From 1b89e7e2903877487ee72b8df39f07b4ed1d8a36 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Mon, 16 Jan 2012 02:10:34 -0800 Subject: [PATCH] Implement `require` in HTML pages. --- static/pad.html | 8 ++++++++ static/timeslider.html | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/static/pad.html b/static/pad.html index 33df2d4f..fba52b78 100644 --- a/static/pad.html +++ b/static/pad.html @@ -340,5 +340,13 @@ + + diff --git a/static/timeslider.html b/static/timeslider.html index 71b4443d..a416562e 100644 --- a/static/timeslider.html +++ b/static/timeslider.html @@ -21,6 +21,10 @@ var require = (function (path) {return (function () {return this}())}); + /* TODO: These globals shouldn't exist. */ + padeditbar = require('/pad_editbar').padeditbar; + padimpexp = require('/pad_impexp').padimpexp; + function createCookie(name,value,days) { if (days) { @@ -143,9 +147,9 @@ clientVars = message.data; //load all script that doesn't work without the clientVars - loadBroadcastSliderJS(); - loadBroadcastRevisionsJS(); - loadBroadcastJS(); + require('/broadcast_slider').loadBroadcastSliderJS(); + require('/broadcast_revisions').loadBroadcastRevisionsJS(); + require('/broadcast').loadBroadcastJS(); //initialize export ui padimpexp.init();