diff options
author | Egil Moeller <egil.moller@freecode.no> | 2010-03-25 19:14:53 +0100 |
---|---|---|
committer | Egil Moeller <egil.moller@freecode.no> | 2010-03-25 19:14:53 +0100 |
commit | 20014050bf91266757b2c1ba82ab333638fe570d (patch) | |
tree | b4de4f05376f30cab0ca4a729a99f841a4ef123f /infrastructure/ace/www/domline.js | |
parent | f7dd3aa34cad8a59ad00172339c565731ad80fbb (diff) | |
download | etherpad-20014050bf91266757b2c1ba82ab333638fe570d.tar.gz etherpad-20014050bf91266757b2c1ba82ab333638fe570d.tar.xz etherpad-20014050bf91266757b2c1ba82ab333638fe570d.zip |
Added aceCreateDomline hook plus some code cleanup in the ace
Diffstat (limited to 'infrastructure/ace/www/domline.js')
-rw-r--r-- | infrastructure/ace/www/domline.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/infrastructure/ace/www/domline.js b/infrastructure/ace/www/domline.js index 70f86cc..38cddf5 100644 --- a/infrastructure/ace/www/domline.js +++ b/infrastructure/ace/www/domline.js @@ -1,4 +1,5 @@ // THIS FILE IS ALSO AN APPJET MODULE: etherpad.collab.ace.domline +// %APPJET%: import("etherpad.admin.plugins"); /** * Copyright 2009 Google Inc. @@ -16,6 +17,10 @@ * limitations under the License. */ +// requires: top +// requires: plugins +// requires: undefined + var domline = {}; domline.noop = function() {}; domline.identity = function(x) { return x; }; @@ -92,12 +97,22 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) { return space+tag; }); } + + var extraOpenTags = ""; + var extraCloseTags = ""; + + ((top == undefined) ? plugins : top.plugins).callHook( + "aceCreateDomLine", {domline:domline, cls:cls} + ).map(function (modifier) { + cls = modifier.cls; + extraOpenTags = extraOpenTags+modifier.extraOpenTags; + extraCloseTags = modifier.extraCloseTags+extraCloseTags; + }); + if ((! txt) && cls) { lineClass = domline.addToLineClass(lineClass, cls); } else if (txt) { - var extraOpenTags = ""; - var extraCloseTags = ""; if (href) { extraOpenTags = extraOpenTags+'<a href="'+ href.replace(/\"/g, '"')+'">'; |