diff options
Diffstat (limited to '')
-rw-r--r-- | infrastructure/ace/www/domline.js (renamed from trunk/infrastructure/ace/www/domline.js) | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/trunk/infrastructure/ace/www/domline.js b/infrastructure/ace/www/domline.js index e8a9ba7..38cddf5 100644 --- a/trunk/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; }; @@ -85,12 +90,6 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) { return space+"url"; }); } - if (cls.indexOf('padtag') >= 0) { - cls = cls.replace(/(^| )padtag:(\S+)/g, function(x0, space, padtag) { - href = '/ep/tag/?query=' + padtag; - return space+"padtag padtag_"+padtag; - }); - } if (cls.indexOf('tag') >= 0) { cls = cls.replace(/(^| )tag:(\S+)/g, function(x0, space, tag) { if (! simpleTags) simpleTags = []; @@ -98,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, '"')+'">'; |