From fa65f889ec8174b2b723fcc45b7d391780b9cd52 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Tue, 11 Sep 2012 20:52:48 -0700 Subject: [PATCH] Consolidate Ace2Editor frame's boot script. --- src/static/js/ace.js | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/src/static/js/ace.js b/src/static/js/ace.js index db62deb42..e7e4fca86 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -24,6 +24,8 @@ // requires: plugins // requires: undefined +var KERNEL_SOURCE = '../static/js/require-kernel.js'; + Ace2Editor.registry = { nextId: 1 }; @@ -155,24 +157,6 @@ function Ace2Editor() return {embeded: embededFiles, remote: remoteFiles}; } - function pushRequireScriptTo(buffer) { - var KERNEL_SOURCE = '../static/js/require-kernel.js'; - var KERNEL_BOOT = '\ -require.setRootURI("../javascripts/src");\n\ -require.setLibraryURI("../javascripts/lib");\n\ -require.setGlobalKeyPath("require");\n\ -'; - if (Ace2Editor.EMBEDED && Ace2Editor.EMBEDED[KERNEL_SOURCE]) { - buffer.push('\ +\n\ + $ = jQuery = require("ep_etherpad-lite/static/js/rjquery").jQuery; // Expose jQuery #HACK\n\ + require("ep_etherpad-lite/static/js/ace2_inner");\n\ +\n\ '); - - iframeHTML.push('