Comparing version 0.0.11 to 0.0.12
@@ -17,3 +17,3 @@ { | ||
"collectContentPost": "ep_align/static/js/shared", | ||
"getLineHTMLForExport": "ep_align/index", | ||
"asyncLineHTMLForExport": "ep_align/index", | ||
"eejsBlock_dd_format":"ep_align/index" | ||
@@ -20,0 +20,0 @@ } |
19
index.js
@@ -13,2 +13,4 @@ var eejs = require('ep_etherpad-lite/node/eejs/'); | ||
// Replaced with the async option | ||
/* | ||
exports.getLineHTMLForExport = function (hook, context) { | ||
@@ -20,13 +22,20 @@ var align = _analyzeLine(context.attribLine, context.apool); | ||
} | ||
*/ | ||
function _analyzeLine(alineAttrs, apool) { | ||
exports.asyncLineHTMLForExport = function (hook, context, cb) { | ||
cb(applyAlign); | ||
} | ||
function applyAlign(context){ | ||
var align = null; | ||
if (alineAttrs) { | ||
var opIter = Changeset.opIterator(alineAttrs); | ||
if (context.attribLine) { | ||
var opIter = Changeset.opIterator(context.attribLine); | ||
if (opIter.hasNext()) { | ||
var op = opIter.next(); | ||
align = Changeset.opAttributeValue(op, 'align', apool); | ||
align = Changeset.opAttributeValue(op, 'align', context.apool); | ||
} | ||
} | ||
return align; | ||
if (align) { | ||
return '<div style="width:100%;margin:0 auto;list-style-position:inside;text-align:' + align + '">' + context.lineContent + '</div>'; | ||
} | ||
} |
{ | ||
"description": "Add Left/Center/Right/Justify to lines of text in a pad", | ||
"name": "ep_align", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "John McLear", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14884
291