diff options
author | Gedion <gwy321@gmail.com> | 2012-09-11 16:21:14 -0500 |
---|---|---|
committer | Gedion <gwy321@gmail.com> | 2012-09-11 16:21:14 -0500 |
commit | 9be69ef2582dfc2c1b050041d4586cbd90d20e2c (patch) | |
tree | 540891085e6822bee30c37a81313fb4718987d24 /src/static | |
parent | c37c48cd12c82bbebf06e6f8d9090196b9533638 (diff) | |
download | etherpad-lite-9be69ef2582dfc2c1b050041d4586cbd90d20e2c.zip |
fixed plugins
Diffstat (limited to 'src/static')
-rw-r--r-- | src/static/js/ace2_inner.js | 13 | ||||
-rw-r--r-- | src/static/js/contentcollector.js | 14 | ||||
-rw-r--r-- | src/static/js/linestylefilter.js | 9 |
3 files changed, 22 insertions, 14 deletions
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index c262deb4..4251d878 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -1719,8 +1719,8 @@ function Ace2Inner(){ root:root, point:selection.startPoint, documentAttributeManager: documentAttributeManager - }); - selStart = selStartFromHook || getLineAndCharForPoint(selection.startPoint); + }); + selStart = (selStartFromHook==null||selStartFromHook.length==0)?getLineAndCharForPoint(selection.startPoint):selStartFromHook; } if (selection && !selEnd) { @@ -1746,7 +1746,7 @@ function Ace2Inner(){ point:selection.endPoint, documentAttributeManager: documentAttributeManager }); - selEnd = selEndFromHook || getLineAndCharForPoint(selection.endPoint); + selEnd = (selEndFromHook==null||selEndFromHook.length==0)?getLineAndCharForPoint(selection.endPoint):selEndFromHook; } // selection from content collection can, in various ways, extend past final @@ -3628,16 +3628,15 @@ function Ace2Inner(){ * This hook is provided to allow a plugin to handle key events. * The return value should true if you have handled the event. * - */ - editorInfo.specialHandled = null; - specialHandled = hooks.callAll('aceKeyEvent', { + */ + var specialHandledInHook = hooks.callAll('aceKeyEvent', { callstack: currentCallStack, editorInfo: editorInfo, rep: rep, documentAttributeManager: documentAttributeManager, evt:evt }); - + specialHandled = (specialHandledInHook&&specialHandledInHook.length>0)?specialHandledInHook[0]:specialHandled; if ((!specialHandled) && isTypeForSpecialKey && keyCode == 8) { // "delete" key; in mozilla, if we're at the beginning of a line, normalize now, diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 27d2940a..1f1f5f20 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -388,6 +388,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class * The return value should be the validated/manipulated text. * */ + //top.console.log(' nodevalue ',txt); var txtFromHook = hooks.callAll('collectContentLineText', { cc: this, state: state, @@ -397,7 +398,8 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class styl: null, cls: null }); - var txt = txtFromHook||txt; + var txt = (typeof(txtFromHook)=='object'&&txtFromHook.length==0)?dom.nodeValue(node):txtFromHook[0]; + var rest = ''; var x = 0; // offset into original text if (txt.length == 0) @@ -409,7 +411,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class if (endPoint && node == endPoint.node) { selEnd = _pointHere(0, state); - } + } } while (txt.length > 0) { @@ -476,8 +478,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class * The return value should be either true(break the line) or false. * */ - { - cc.startNewLine(state); + { this.breakLine = true; var tvalue = dom.nodeAttr(node, 'value'); var induceLineBreak = hooks.callAll('collectContentLineBreak', { @@ -487,8 +488,9 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class tvalue:tvalue, styl: null, cls: null - }); - if(induceLineBreak){ + }); + var startNewLine= (typeof(induceLineBreak)=='object'&&induceLineBreak.length==0)?true:induceLineBreak[0]; + if(startNewLine){ cc.startNewLine(state); } } diff --git a/src/static/js/linestylefilter.js b/src/static/js/linestylefilter.js index 1cbfac29..7da27b1d 100644 --- a/src/static/js/linestylefilter.js +++ b/src/static/js/linestylefilter.js @@ -146,9 +146,16 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun return function(txt, cls) { + + var disableAuthColorForThisLine = hooks.callAll("disableAuthorColorsForThisLine", { + linestylefilter: linestylefilter, + text: txt, + class: cls + }, " ", " ", ""); + var disableAuthors = (disableAuthColorForThisLine==null||disableAuthColorForThisLine.length==0)?false:disableAuthColorForThisLine[0]; while (txt.length > 0) { - if (leftInAuthor <= 0) + if (leftInAuthor <= 0 || disableAuthors) { // prevent infinite loop if something funny's going on return nextAfterAuthorColors(txt, cls); |