First baby steps towards requirejs

i18n
Egil Moeller 2015-04-11 13:22:27 +02:00
parent f5d1cd1751
commit 0e5cd65d8d
3 changed files with 8 additions and 0 deletions

View File

@ -42,6 +42,7 @@ var LIBRARY_WHITELIST = [
, 'tinycon'
, 'underscore'
, 'unorm'
, 'requirejs'
];
// Rewrite tar to include modules with no extensions and proper rooted paths.

View File

@ -15,6 +15,7 @@ function loadFn(path, hookName) {
functionName = parts[1];
}
console.log(["LOADING", path]);
var fn = require(path);
functionName = functionName ? functionName : hookName;

View File

@ -368,6 +368,8 @@
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
<script type="text/javascript" src="../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../static/plugins/requirejs/require.js"></script>
<!-- Include base packages manually (this help with debugging) -->
<script type="text/javascript" src="../javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define"></script>
<script type="text/javascript" src="../javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define"></script>
@ -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))) {