-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhorizontalLine.js
39 lines (29 loc) · 981 Bytes
/
horizontalLine.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var eejs = require('ep_etherpad-lite/node/eejs/');
var Changeset = require("ep_etherpad-lite/static/js/Changeset");
function eejsBlock_editbarMenuLeft(hook_name,args,cb){
args.content += eejs.require('ep_horizontal_line/templates/hrLineButton.ejs');
return cb();
}
function getLineHTMLForExport(hook,context){
var hr = checkHrInLine(context.attribLine,context.apool);
if(hr){
return '<hr></hr>';
}
}
function checkHrInLine(lineAttrib,pool){
var hr= null;
if(lineAttrib){
var iter = ChangeSet.opIterator(lineAttrib);
while(iter.hasNext()){
var op = iter.next();
hr = ChangeSet.opAttributeValue(op,'hrline',pool);
}
}
}
function eejsBlock_styles (hook_name, args, cb) {
args.content = args.content + eejs.require("ep_horizontal_line/templates/styles.html", {}, module);
return cb();
}
exports.eejsBlock_editbarMenuLeft = eejsBlock_editbarMenuLeft;
exports.getLineHTMLForExport = getLineHTMLForExport;
exports.eejsBlock_styles = eejsBlock_styles;