From cda3a0e78bbfb5d26d7f449260d59cfa11b04124 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 18 Feb 2013 21:03:52 +0000 Subject: [PATCH] a different approach --- src/static/js/timeslider.js | 5 +++-- src/templates/timeslider.html | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js index acf1b0394..24e6e98de 100644 --- a/src/static/js/timeslider.js +++ b/src/static/js/timeslider.js @@ -30,7 +30,7 @@ var readCookie = require('./pad_utils').readCookie; var randomString = require('./pad_utils').randomString; var _ = require('./underscore'); -var socket, token, padId, export_links; +var token, padId, export_links; function init() { $(document).ready(function () @@ -63,7 +63,6 @@ function init() { //build up the socket io connection 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 socket.on('connect', function() @@ -107,6 +106,8 @@ function init() { window.location.reload(); }); + exports.socket = socket; // make the socket available + }); } diff --git a/src/templates/timeslider.html b/src/templates/timeslider.html index 4a8543c56..5d0e357c6 100644 --- a/src/templates/timeslider.html +++ b/src/templates/timeslider.html @@ -211,6 +211,8 @@ } 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.update(function () {