mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-29 03:39:13 -04:00
More AMDificatioN
This commit is contained in:
parent
4234681efd
commit
7a1f065702
18 changed files with 233 additions and 290 deletions
|
@ -30,7 +30,7 @@ Ace2Editor.registry = {
|
|||
nextId: 1
|
||||
};
|
||||
|
||||
var hooks = require('./pluginfw/hooks');
|
||||
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
|
||||
var _ = require('./underscore');
|
||||
|
||||
function scriptTag(source) {
|
||||
|
@ -241,23 +241,35 @@ function Ace2Editor()
|
|||
}
|
||||
|
||||
iframeHTML.push(scriptTag(
|
||||
Ace2Editor.EMBEDED[KERNEL_SOURCE] + '\n\
|
||||
require.setRootURI("../javascripts/src");\n\
|
||||
require.setLibraryURI("../javascripts/lib");\n\
|
||||
require.setGlobalKeyPath("require");\n\
|
||||
\n\
|
||||
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");\n\
|
||||
var plugins = require("ep_etherpad-lite/static/js/pluginfw/client_plugins");\n\
|
||||
hooks.plugins = plugins;\n\
|
||||
plugins.adoptPluginsFromAncestorsOf(window);\n\
|
||||
\n\
|
||||
$ = jQuery = require("ep_etherpad-lite/static/js/rjquery").jQuery; // Expose jQuery #HACK\n\
|
||||
var Ace2Inner = require("ep_etherpad-lite/static/js/ace2_inner");\n\
|
||||
\n\
|
||||
plugins.ensure(function () {\n\
|
||||
Ace2Inner.init();\n\
|
||||
});\n\
|
||||
'));
|
||||
Ace2Editor.EMBEDED[KERNEL_SOURCE] + '\n\
|
||||
require.setRootURI("../javascripts/src");\n\
|
||||
require.setLibraryURI("../javascripts/lib");\n\
|
||||
require.setGlobalKeyPath("require");\n\
|
||||
'));
|
||||
|
||||
iframeHTML.push('<script type="text/javascript" src="../static/plugins/requirejs/require.js"></script>');
|
||||
|
||||
iframeHTML.push(scriptTag('\n\
|
||||
var pathComponents = parent.parent.location.pathname.split("/");\n\
|
||||
var baseURL = pathComponents.slice(0,pathComponents.length-2).join("/") + "/";\n\
|
||||
requirejs.config({\n\
|
||||
baseUrl: baseURL + "static/plugins",\n\
|
||||
paths: {underscore: baseURL + "static/plugins/underscore/underscore"}\n\
|
||||
});\n\
|
||||
\n\
|
||||
requirejs(["ep_etherpad-lite/static/js/rjquery", "ep_etherpad-lite/static/js/pluginfw/client_plugins", "ep_etherpad-lite/static/js/ace2_inner"], function (j, plugins, Ace2Inner) {\n\
|
||||
jQuery = $ = window.jQuery = window.$ = j; // Expose jQuery #HACK\n\
|
||||
\n\
|
||||
plugins.adoptPluginsFromAncestorsOf(window, function () {\n\
|
||||
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");\n\
|
||||
hooks.plugins = plugins;\n\
|
||||
\n\
|
||||
plugins.ensure(function () {\n\
|
||||
Ace2Inner.init();\n\
|
||||
});\n\
|
||||
});\n\
|
||||
});\n\
|
||||
'));
|
||||
|
||||
iframeHTML.push('<style type="text/css" title="dynamicsyntax"></style>');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue