Comparing version 0.0.4 to 0.0.6
{ | ||
"description": "Add Left/Center/Right/Justify to lines of text in a pad", | ||
"name": "ep_align", | ||
"version": "0.0.4", | ||
"version": "0.0.6", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "John McLear", |
@@ -34,2 +34,3 @@ var _, $, jQuery; | ||
ace.ace_doInsertalign(alignment); | ||
ace.ace_focus(); | ||
},'insertalign' , true); | ||
@@ -39,4 +40,8 @@ } | ||
// Our align attribute will result in a heaading:h1... :h6 class | ||
// Our align attribute will result in an align:left...right class | ||
function aceAttribsToClasses(hook, context){ | ||
if(context.key.indexOf("align:") !== -1){ | ||
var align = /(?:^| )align:([A-Za-z0-9]*)/.exec(context.key); | ||
return ['align:' + align[1] ]; | ||
} | ||
if(context.key == 'align'){ | ||
@@ -57,4 +62,4 @@ return ['align:' + context.value ]; | ||
var modifier = { | ||
preHtml: '<p style="width:100%;text-align:' + tag + '"><span>', | ||
postHtml: '</span></p>', | ||
preHtml: '<'+tag+'><p style="width:100%;text-align:' + tag + '"><span>', | ||
postHtml: '</span></p></'+tag+'>', | ||
processedMarker: true | ||
@@ -61,0 +66,0 @@ }; |
@@ -10,3 +10,2 @@ var _ = require('ep_etherpad-lite/static/js/underscore'); | ||
var tagIndex = _.indexOf(tags, tname); | ||
if(tagIndex >= 0){ | ||
@@ -13,0 +12,0 @@ lineAttributes['align'] = tags[tagIndex]; |
10992
216