summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/static/js/pad.js5
-rw-r--r--src/static/js/pluginfw/plugins.js3
-rw-r--r--src/static/js/timeslider.js5
-rw-r--r--src/templates/pad.html12
-rw-r--r--src/templates/timeslider.html24
5 files changed, 33 insertions, 16 deletions
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index 3a1c1633..9db1c5b9 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -203,7 +203,8 @@ function handshake()
//create the url
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
//find out in which subfolder we are
- var resource = loc.pathname.substr(1, loc.pathname.indexOf("/p/")) + "socket.io";
+ var resource = exports.baseURL + "socket.io";
+
//connect
socket = pad.socket = io.connect(url, {
resource: resource,
@@ -1029,7 +1030,7 @@ var settings = {
};
pad.settings = settings;
-
+exports.baseURL = '';
exports.settings = settings;
exports.createCookie = createCookie;
exports.readCookie = readCookie;
diff --git a/src/static/js/pluginfw/plugins.js b/src/static/js/pluginfw/plugins.js
index a3a8a8df..1f66da41 100644
--- a/src/static/js/pluginfw/plugins.js
+++ b/src/static/js/pluginfw/plugins.js
@@ -24,6 +24,7 @@ exports.loaded = false;
exports.plugins = {};
exports.parts = [];
exports.hooks = {};
+exports.baseURL = '';
exports.ensure = function (cb) {
if (!exports.loaded)
@@ -103,7 +104,7 @@ if (exports.isClient) {
// which appears to fix the issue.
var callback = function () {setTimeout(cb, 0);};
- jQuery.getJSON('../pluginfw/plugin-definitions.json', function(data) {
+ jQuery.getJSON(exports.baseURL + 'pluginfw/plugin-definitions.json', function(data) {
exports.plugins = data.plugins;
exports.parts = data.parts;
exports.hooks = exports.extractHooks(exports.parts, "client_hooks");
diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js
index 438b1695..6c91423b 100644
--- a/src/static/js/timeslider.js
+++ b/src/static/js/timeslider.js
@@ -60,8 +60,8 @@ function init() {
//create the url
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
//find out in which subfolder we are
- var resource = loc.pathname.substr(1,loc.pathname.indexOf("/p/")) + "socket.io";
-
+ var resource = exports.baseURL + 'socket.io';
+
//build up the socket io connection
socket = io.connect(url, {resource: resource});
@@ -153,4 +153,5 @@ function handleClientVars(message)
}
}
+exports.baseURL = '';
exports.init = init;
diff --git a/src/templates/pad.html b/src/templates/pad.html
index 6181b062..3eced909 100644
--- a/src/templates/pad.html
+++ b/src/templates/pad.html
@@ -279,13 +279,19 @@
document.domain = document.domain;
var clientVars = {};
(function () {
- require.setRootURI("../javascripts/src");
- require.setLibraryURI("../javascripts/lib");
+
+ var baseURL = '../';
+
+ require.setRootURI(baseURL + "javascripts/src");
+ require.setLibraryURI(baseURL + "javascripts/lib");
require.setGlobalKeyPath("require");
var plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins');
+ plugins.baseURL = baseURL;
plugins.update(function () {
- require('ep_etherpad-lite/static/js/pad').init();
+ var pad = require('ep_etherpad-lite/static/js/pad');
+ pad.baseURL = baseURL;
+ pad.init();
});
/* TODO: These globals shouldn't exist. */
diff --git a/src/templates/timeslider.html b/src/templates/timeslider.html
index ca4bc6e9..5db11b8f 100644
--- a/src/templates/timeslider.html
+++ b/src/templates/timeslider.html
@@ -123,22 +123,30 @@
</div>
</div>
-<script type="text/javascript" src="../../../static/js/require-kernel.js"></script>
-<script type="text/javascript" src="../../../static/js/jquery.js"></script>
-<script type="text/javascript" src="../../../socket.io/socket.io.js"></script>
-<script type="text/javascript" src="../../../javascripts/lib/ep_etherpad-lite/static/js/timeslider.js?callback=require.define"></script>
-<script type="text/javascript" src="../../../static/custom/timeslider.js"></script>
+<script type="text/javascript" src="../../static/js/require-kernel.js"></script>
+<script type="text/javascript" src="../../static/js/jquery.js"></script>
+<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
+<script type="text/javascript" src="../../javascripts/lib/ep_etherpad-lite/static/js/timeslider.js?callback=require.define"></script>
+<script type="text/javascript" src="../../static/custom/timeslider.js"></script>
+
<script type="text/javascript" >
document.domain = document.domain;
var clientVars = {};
+
(function () {
- require.setRootURI("../../../javascripts/src");
- require.setLibraryURI("../../../javascripts/lib");
+ var baseURL = '../../';
+
+ require.setRootURI(baseURL + "javascripts/src");
+ require.setLibraryURI(baseURL + "javascripts/lib");
require.setGlobalKeyPath("require");
var plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins');
+ plugins.baseURL = baseURL;
+
plugins.update(function () {
- require('ep_etherpad-lite/static/js/timeslider').init();
+ var timeslider = require('ep_etherpad-lite/static/js/timeslider')
+ timeslider.baseURL = baseURL;
+ timeslider.init();
/* TODO: These globals shouldn't exist. */
padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar;