ep_headings
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -11,7 +11,8 @@ { | ||
"aceAttribsToClasses": "ep_headings/static/js/index", | ||
"collectContentPre": "ep_headings/static/js/index", | ||
"collectContentPre": "ep_headings/static/js/shared", | ||
"aceRegisterBlockElements": "ep_headings/static/js/index" | ||
}, | ||
"hooks": { | ||
"eejsBlock_editbarMenuLeft": "ep_headings/index" | ||
"eejsBlock_editbarMenuLeft": "ep_headings/index", | ||
"collectContentPre": "ep_headings/static/js/shared" | ||
} | ||
@@ -18,0 +19,0 @@ } |
{ | ||
"description": "Adds heading support to Etherpad Lite.", | ||
"name": "ep_headings", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"author": "fourplusone <info@fourplusone.de>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -7,19 +7,5 @@ var _, $, jQuery; | ||
var cssFiles = ['ep_headings/static/css/editor.css']; | ||
var tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; | ||
// Here we collect our <h1>...<h6> tags and transform them tho heading | ||
// attributes. | ||
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]; | ||
} | ||
}; | ||
// All our tags are block elements, so we just return them. | ||
var tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; | ||
var aceRegisterBlockElements = function(){ | ||
@@ -112,3 +98,2 @@ return tags; | ||
exports.aceRegisterBlockElements = aceRegisterBlockElements; | ||
exports.collectContentPre = collectContentPre; | ||
exports.aceInitialized = aceInitialized; | ||
@@ -118,2 +103,2 @@ exports.postAceInit = postAceInit; | ||
exports.aceAttribsToClasses = aceAttribsToClasses; | ||
exports.aceEditorCSS = aceEditorCSS; | ||
exports.aceEditorCSS = aceEditorCSS; |
5610
8
133