From a408557a0ed84cfda81a0b6414a3cf56d4d88e64 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Sat, 28 Jan 2012 15:26:39 -0800 Subject: [PATCH] Make implicit loading of modules unnecessary. This is one step on the way to simplifying `Minify` and allowing all of the modules within pad.js to be loaded independently in development mode (which is useful for debugging). --- node/utils/Minify.js | 5 ----- static/js/pad.js | 9 +++++++++ static/js/timeslider.js | 6 ++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/node/utils/Minify.js b/node/utils/Minify.js index ea7834dc..98774d19 100644 --- a/node/utils/Minify.js +++ b/node/utils/Minify.js @@ -306,11 +306,6 @@ function tarCode(filesInOrder, files, write) { write("\n\n\n/*** File: static/js/" + filename + " ***/\n\n\n"); write(isolateJS(files[filename], filename)); } - - for(var i = 0, ii = filesInOrder.length; i < filesInOrder.length; i++) { - var filename = filesInOrder[i]; - write('require(' + JSON.stringify('/' + filename.replace(/^\/+/, '')) + ');\n'); - } } // Wrap the following code in a self executing function and assign exports to diff --git a/static/js/pad.js b/static/js/pad.js index e6d8dc9a..fb297d4a 100644 --- a/static/js/pad.js +++ b/static/js/pad.js @@ -24,6 +24,15 @@ var socket; +// These jQuery things should create local references, but for now `require()` +// assigns to the global `$` and augments it with plugins. +require('/jquery'); +require('/jquery-ui'); +require('/farbtastic'); +require('/excanvas'); +require('/json2'); +require('/undo-xpopup'); + var chat = require('/chat').chat; var getCollabClient = require('/collab_client').getCollabClient; var padconnectionstatus = require('/pad_connectionstatus').padconnectionstatus; diff --git a/static/js/timeslider.js b/static/js/timeslider.js index 3b49f49a..939c4c64 100644 --- a/static/js/timeslider.js +++ b/static/js/timeslider.js @@ -20,6 +20,12 @@ * limitations under the License. */ +// These jQuery things should create local references, but for now `require()` +// assigns to the global `$` and augments it with plugins. +require('/jquery'); +require('/json2'); +require('/undo-xpopup'); + function createCookie(name,value,days) { if (days) {