Inject pad dependencies into most pad submodules.

This commit is contained in:
Chad Weider 2012-01-26 21:02:58 -08:00
parent 56c07e484a
commit 514698162f
8 changed files with 22 additions and 26 deletions

View file

@ -236,13 +236,9 @@ var padimpexp = (function()
/////
var pad = undefined;
var self = {
init: function()
init: function(_pad)
{
try {
pad = require('/pad2').pad; // Sidestep circular dependency (should be injected).
} catch (e) {
// skip (doesn't require pad when required by timeslider)
}
pad = _pad;
//get /p/padname
var pad_root_path = new RegExp(/.*\/p\/[^\/]+/).exec(document.location.pathname)