From 7418f08dc788b2f8a405fc20d73b088ee4413e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 7 Apr 2012 01:02:50 +0200 Subject: [PATCH] Added 2 new Hooks + aceInitialized is called when ace has been fully initialized + aceRegisterBlockElements allows to register new Block Elements with ace. --- src/static/js/ace2_inner.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 4dcd5edcc..99bbbb4f1 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -35,6 +35,8 @@ var isNodeText = Ace2Common.isNodeText, binarySearchInfinite = Ace2Common.binarySearchInfinite, htmlPrettyEscape = Ace2Common.htmlPrettyEscape, noop = Ace2Common.noop; + var hooks = require('./pluginfw/hooks'); + function Ace2Inner(){ @@ -2871,6 +2873,10 @@ function Ace2Inner(){ "ul": 1 }; + _.each(hooks.callAll('aceRegisterBlockElements'), function(element){ + _blockElems[element] = 1; + }) + function isBlockElement(n) { return !!_blockElems[(n.tagName || "").toLowerCase()]; @@ -5429,7 +5435,13 @@ function Ace2Inner(){ bindTheEventHandlers(); }); - + + hooks.callAll('aceInitialized', { + editorInfo: editorInfo, + rep: rep, + documentAttributeManager: documentAttributeManager + }); + scheduler.setTimeout(function() { parent.readyFunc(); // defined in code that sets up the inner iframe