Inject pad dependencies into most pad submodules.
parent
56c07e484a
commit
514698162f
|
@ -438,7 +438,7 @@ var pad = {
|
|||
}
|
||||
|
||||
// order of inits is important here:
|
||||
padcookie.init(clientVars.cookiePrefsToSet);
|
||||
padcookie.init(clientVars.cookiePrefsToSet, this);
|
||||
|
||||
$("#widthprefcheck").click(pad.toggleWidthPref);
|
||||
// $("#sidebarcheck").click(pad.togglewSidebar);
|
||||
|
@ -465,16 +465,16 @@ var pad = {
|
|||
initialTitle: clientVars.initialTitle,
|
||||
initialPassword: clientVars.initialPassword,
|
||||
guestPolicy: pad.padOptions.guestPolicy
|
||||
});
|
||||
padimpexp.init();
|
||||
padsavedrevs.init(clientVars.initialRevisionList);
|
||||
}, this);
|
||||
padimpexp.init(this);
|
||||
padsavedrevs.init(clientVars.initialRevisionList, this);
|
||||
|
||||
padeditor.init(postAceInit, pad.padOptions.view || {});
|
||||
padeditor.init(postAceInit, pad.padOptions.view || {}, this);
|
||||
|
||||
paduserlist.init(pad.myUserInfo);
|
||||
paduserlist.init(pad.myUserInfo, this);
|
||||
// padchat.init(clientVars.chatHistory, pad.myUserInfo);
|
||||
padconnectionstatus.init();
|
||||
padmodals.init();
|
||||
padmodals.init(this);
|
||||
|
||||
pad.collabClient = getCollabClient(padeditor.ace, clientVars.collab_client_vars, pad.myUserInfo, {
|
||||
colorPalette: pad.getColorPalette()
|
||||
|
|
|
@ -87,9 +87,9 @@ var padcookie = (function()
|
|||
|
||||
var pad = undefined;
|
||||
var self = {
|
||||
init: function(prefsToSet)
|
||||
init: function(prefsToSet, _pad)
|
||||
{
|
||||
pad = require('/pad2').pad; // Sidestep circular dependency (should be injected).
|
||||
pad = _pad;
|
||||
|
||||
var rawCookie = getRawCookie();
|
||||
if (rawCookie)
|
||||
|
|
|
@ -118,9 +118,9 @@ var paddocbar = (function()
|
|||
var self = {
|
||||
title: null,
|
||||
password: null,
|
||||
init: function(opts)
|
||||
init: function(opts, _pad)
|
||||
{
|
||||
pad = require('/pad2').pad; // Sidestep circular dependency (should be injected).
|
||||
pad = _pad;
|
||||
|
||||
panels = {
|
||||
impexp: {
|
||||
|
|
|
@ -32,11 +32,11 @@ var padeditor = (function()
|
|||
ace: null,
|
||||
// this is accessed directly from other files
|
||||
viewZoom: 100,
|
||||
init: function(readyFunc, initialViewOptions)
|
||||
init: function(readyFunc, initialViewOptions, _pad)
|
||||
{
|
||||
Ace2Editor = require('/ace').Ace2Editor;
|
||||
pad = require('/pad2').pad; // Sidestep circular dependency (should be injected).
|
||||
settings = require('/pad2').settings;
|
||||
pad = _pad;
|
||||
settings = pad.settings;
|
||||
|
||||
function aceReady()
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -75,9 +75,9 @@ var padmodals = (function()
|
|||
|
||||
var pad = undefined;
|
||||
var self = {
|
||||
init: function()
|
||||
init: function(_pad)
|
||||
{
|
||||
pad = require('/pad2').pad; // Sidestep circular dependency (should be injected).
|
||||
pad = _pad;
|
||||
|
||||
self.initFeedback();
|
||||
self.initShareBox();
|
||||
|
|
|
@ -349,9 +349,9 @@ var padsavedrevs = (function()
|
|||
|
||||
var pad = undefined;
|
||||
var self = {
|
||||
init: function(initialRevisions)
|
||||
init: function(initialRevisions, _pad)
|
||||
{
|
||||
pad = require('/pad2').pad; // Sidestep circular dependency (should be injected).
|
||||
pad = _pad;
|
||||
self.newRevisionList(initialRevisions, true);
|
||||
|
||||
$("#savedrevs-savenow").click(function()
|
||||
|
|
|
@ -464,9 +464,9 @@ var paduserlist = (function()
|
|||
|
||||
var pad = undefined;
|
||||
var self = {
|
||||
init: function(myInitialUserInfo)
|
||||
init: function(myInitialUserInfo, _pad)
|
||||
{
|
||||
pad = require('/pad2').pad; // Sidestep circular dependency (should be injected).
|
||||
pad = _pad;
|
||||
|
||||
self.setMyUserInfo(myInitialUserInfo);
|
||||
|
||||
|
|
Loading…
Reference in New Issue