Comparing version 0.0.10 to 0.0.11
41
index.js
@@ -13,35 +13,6 @@ var eejs = require('ep_etherpad-lite/node/eejs/'); | ||
function getInlineStyle(header) { | ||
// TODO! | ||
switch (header) { | ||
case "h1": | ||
return "font-size: 2.0em;line-height: 120%;"; | ||
break; | ||
case "h2": | ||
return "font-size: 1.5em;line-height: 120%;"; | ||
break; | ||
case "h3": | ||
return "font-size: 1.17em;line-height: 120%;"; | ||
break; | ||
case "h4": | ||
return "line-height: 120%;"; | ||
break; | ||
case "h5": | ||
return "font-size: 0.83em;line-height: 120%;"; | ||
break; | ||
case "h6": | ||
return "font-size: 0.75em;line-height: 120%;"; | ||
break; | ||
case "code": | ||
return "font-family: monospace"; | ||
} | ||
return ""; | ||
} | ||
// line, apool,attribLine,text | ||
exports.getLineHTMLForExport = function (hook, context) { | ||
var header = _analyzeLine(context.attribLine, context.apool); | ||
if (header) { | ||
var inlineStyle = getInlineStyle(header); | ||
return "<" + header + " style=\"" + inlineStyle + "\">" + context.text.substring(1) + "</" + header + ">"; | ||
var align = _analyzeLine(context.attribLine, context.apool); | ||
if (align) { | ||
return '<div style="width:100%;margin:0 auto;list-style-position:inside;text-align:' + align + '">' + context.lineContent + '</div>'; | ||
} | ||
@@ -51,3 +22,3 @@ } | ||
function _analyzeLine(alineAttrs, apool) { | ||
var header = null; | ||
var align = null; | ||
if (alineAttrs) { | ||
@@ -57,6 +28,6 @@ var opIter = Changeset.opIterator(alineAttrs); | ||
var op = opIter.next(); | ||
header = Changeset.opAttributeValue(op, 'align', apool); | ||
align = Changeset.opAttributeValue(op, 'align', apool); | ||
} | ||
} | ||
return header; | ||
return align; | ||
} |
{ | ||
"description": "Add Left/Center/Right/Justify to lines of text in a pad", | ||
"name": "ep_align", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"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
14612
283