mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-28 11:26:16 -04:00
First baby steps towards requirejs
This commit is contained in:
parent
f5d1cd1751
commit
0e5cd65d8d
3 changed files with 8 additions and 0 deletions
|
@ -42,6 +42,7 @@ var LIBRARY_WHITELIST = [
|
||||||
, 'tinycon'
|
, 'tinycon'
|
||||||
, 'underscore'
|
, 'underscore'
|
||||||
, 'unorm'
|
, 'unorm'
|
||||||
|
, 'requirejs'
|
||||||
];
|
];
|
||||||
|
|
||||||
// Rewrite tar to include modules with no extensions and proper rooted paths.
|
// Rewrite tar to include modules with no extensions and proper rooted paths.
|
||||||
|
|
|
@ -15,6 +15,7 @@ function loadFn(path, hookName) {
|
||||||
functionName = parts[1];
|
functionName = parts[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(["LOADING", path]);
|
||||||
var fn = require(path);
|
var fn = require(path);
|
||||||
functionName = functionName ? functionName : hookName;
|
functionName = functionName ? functionName : hookName;
|
||||||
|
|
||||||
|
|
|
@ -368,6 +368,8 @@
|
||||||
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
|
<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="../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) -->
|
<!-- 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/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>
|
<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.setLibraryURI(baseURL + "javascripts/lib");
|
||||||
require.setGlobalKeyPath("require");
|
require.setGlobalKeyPath("require");
|
||||||
|
|
||||||
|
requirejs.config({
|
||||||
|
baseUrl: baseURL + "static/plugins"
|
||||||
|
});
|
||||||
|
|
||||||
$ = jQuery = require('ep_etherpad-lite/static/js/rjquery').jQuery; // Expose jQuery #HACK
|
$ = jQuery = require('ep_etherpad-lite/static/js/rjquery').jQuery; // Expose jQuery #HACK
|
||||||
browser = require('ep_etherpad-lite/static/js/browser').browser;
|
browser = require('ep_etherpad-lite/static/js/browser').browser;
|
||||||
if ((!browser.msie) && (!(browser.mozilla && browser.version.indexOf("1.8.") == 0))) {
|
if ((!browser.msie) && (!(browser.mozilla && browser.version.indexOf("1.8.") == 0))) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue