mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-26 10:26:15 -04:00
added baseURL export to pad.js, timeslider.js, plugins.js, fixing #670
This commit is contained in:
parent
d554420f57
commit
513deef768
5 changed files with 33 additions and 16 deletions
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue