a different approach

pull/1537/head
John McLear 2013-02-18 21:03:52 +00:00
parent 7fcc71710f
commit cda3a0e78b
2 changed files with 5 additions and 2 deletions

View File

@ -30,7 +30,7 @@ var readCookie = require('./pad_utils').readCookie;
var randomString = require('./pad_utils').randomString; var randomString = require('./pad_utils').randomString;
var _ = require('./underscore'); var _ = require('./underscore');
var socket, token, padId, export_links; var token, padId, export_links;
function init() { function init() {
$(document).ready(function () $(document).ready(function ()
@ -63,7 +63,6 @@ function init() {
//build up the socket io connection //build up the socket io connection
socket = io.connect(url, {resource: resource}); socket = io.connect(url, {resource: resource});
window.parent.socket = socket; // Expose the socket to it's parent HACK
//send the ready message once we're connected //send the ready message once we're connected
socket.on('connect', function() socket.on('connect', function()
@ -107,6 +106,8 @@ function init() {
window.location.reload(); window.location.reload();
}); });
exports.socket = socket; // make the socket available
}); });
} }

View File

@ -211,6 +211,8 @@
} }
var plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins'); var plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins');
var socket = require('ep_etherpad-lite/static/js/timeslider').socket;
plugins.baseURL = baseURL; plugins.baseURL = baseURL;
plugins.update(function () { plugins.update(function () {