summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartyn York <etinquis@gmail.com>2012-04-18 14:44:25 -0700
committerMartyn York <etinquis@gmail.com>2012-04-18 14:44:25 -0700
commitda75b87d3c90ecd27dfe9d1f8b583e9db38de7a7 (patch)
treea64076d19ff22617f6646faa295cfedb866db846
parent7ede4872b1f4be142c4c21df350809f863bcee1d (diff)
downloadetherpad-lite-da75b87d3c90ecd27dfe9d1f8b583e9db38de7a7.zip
added new hook 'acePostWriteDomLineHTML' which gets called after a domline is created and has been added to the page. Also fixed problems with ReferenceExceptions due to require-kernel not being sent to the iframe.
-rw-r--r--src/static/js/ace.js8
-rw-r--r--src/static/js/domline.js4
2 files changed, 11 insertions, 1 deletions
diff --git a/src/static/js/ace.js b/src/static/js/ace.js
index 6ea2938b..85801d33 100644
--- a/src/static/js/ace.js
+++ b/src/static/js/ace.js
@@ -167,7 +167,13 @@ require.setGlobalKeyPath("require");\n\
buffer.push(Ace2Editor.EMBEDED[KERNEL_SOURCE]);
buffer.push(KERNEL_BOOT);
buffer.push('<\/script>');
- }
+ } else {
+ file = KERNEL_SOURCE;
+ buffer.push('<script type="application/javascript" src="' + KERNEL_SOURCE + '"><\/script>');
+ buffer.push('<script type="text/javascript">');
+ buffer.push(KERNEL_BOOT);
+ buffer.push('<\/script>');
+ }
}
function pushScriptsTo(buffer) {
/* Folling is for packaging regular expression. */
diff --git a/src/static/js/domline.js b/src/static/js/domline.js
index 5d8bb719..1be0f4ee 100644
--- a/src/static/js/domline.js
+++ b/src/static/js/domline.js
@@ -229,6 +229,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
result.node.innerHTML = curHTML;
}
if (lineClass !== null) result.node.className = lineClass;
+
+ hooks.callAll("acePostWriteDomLineHTML", {
+ node: result.node
+ });
}
result.prepareForAdd = writeHTML;
result.finishUpdate = writeHTML;