summaryrefslogtreecommitdiffstats
path: root/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js')
-rw-r--r--static/js/index.js7
-rw-r--r--static/js/shared.js28
2 files changed, 35 insertions, 0 deletions
diff --git a/static/js/index.js b/static/js/index.js
new file mode 100644
index 0000000..ab18207
--- /dev/null
+++ b/static/js/index.js
@@ -0,0 +1,7 @@
+var cssFiles = ['ep_headline_buttons/static/css/headline_buttons.css'];
+
+function aceEditorCSS(){
+ return cssFiles;
+};
+
+exports.aceEditorCSS = aceEditorCSS;
diff --git a/static/js/shared.js b/static/js/shared.js
new file mode 100644
index 0000000..df88e6b
--- /dev/null
+++ b/static/js/shared.js
@@ -0,0 +1,28 @@
+var _ = require('ep_etherpad-lite/static/js/underscore');
+
+var tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
+
+var collectContentPre = function(hook, context){
+ var tname = context.tname;
+ var state = context.state;
+ var lineAttributes = state.lineAttributes
+ var tagIndex = _.indexOf(tags, tname);
+
+ if (tagIndex >= 0) {
+ lineAttributes['heading'] = tags[tagIndex];
+ }
+};
+
+var collectContentPost = function(hook, context){
+ var tname = context.tname;
+ var state = context.state;
+ var lineAttributes = state.lineAttributes
+ var tagIndex = _.indexOf(tags, tname);
+
+ if (tagIndex >= 0) {
+ delete lineAttributes['heading'];
+ }
+};
+
+exports.collectContentPre = collectContentPre;
+exports.collectContentPost = collectContentPost;