From 0e5cd65d8d72ca14409d3c3e0b8dae793531fc3d Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Sat, 11 Apr 2015 13:22:27 +0200 Subject: [PATCH] First baby steps towards requirejs --- src/node/utils/Minify.js | 1 + src/static/js/pluginfw/shared.js | 1 + src/templates/pad.html | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/src/node/utils/Minify.js b/src/node/utils/Minify.js index ba45ab75e..56ca4be0e 100644 --- a/src/node/utils/Minify.js +++ b/src/node/utils/Minify.js @@ -42,6 +42,7 @@ var LIBRARY_WHITELIST = [ , 'tinycon' , 'underscore' , 'unorm' + , 'requirejs' ]; // Rewrite tar to include modules with no extensions and proper rooted paths. diff --git a/src/static/js/pluginfw/shared.js b/src/static/js/pluginfw/shared.js index 4df71aee8..544bb580b 100644 --- a/src/static/js/pluginfw/shared.js +++ b/src/static/js/pluginfw/shared.js @@ -15,6 +15,7 @@ function loadFn(path, hookName) { functionName = parts[1]; } + console.log(["LOADING", path]); var fn = require(path); functionName = functionName ? functionName : hookName; diff --git a/src/templates/pad.html b/src/templates/pad.html index dd260414e..f8bca095a 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -368,6 +368,8 @@ + + @@ -389,6 +391,10 @@ require.setLibraryURI(baseURL + "javascripts/lib"); require.setGlobalKeyPath("require"); + requirejs.config({ + baseUrl: baseURL + "static/plugins" + }); + $ = jQuery = require('ep_etherpad-lite/static/js/rjquery').jQuery; // Expose jQuery #HACK browser = require('ep_etherpad-lite/static/js/browser').browser; if ((!browser.msie) && (!(browser.mozilla && browser.version.indexOf("1.8.") == 0))) {