Fires a callback when the dom is ready
775556
function(fn) {
	/*!
	 * contentloaded.js
	 *
	 * Author: Diego Perini (diego.perini at gmail.com)
	 * Summary: cross-browser wrapper for DOMContentLoaded
	 * Updated: 20101020
	 * License: MIT
	 * Version: 1.2
	 *
	 * URL:
	 * http://javascript.nwbox.com/ContentLoaded/
	 * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
	 *
	 */
	
	// @fn function reference

	var done = false,
		top = true,

		root = y.documentElement,
	
		add = y.attachEvent ? 'attachEvent' : 'addEventListener',
		rem = y.attachEvent ? 'detachEvent' : 'removeEventListener',
		pre = y.attachEvent ? 'on' : '',
	
		init = function(e) {
			if (e.type == 'readystatechange' && y.readyState != 'complete') return;
			(e.type == 'load' ? z : y)[rem](pre + e.type, init, false);
			if (!done && (done = true)) fn.call(z, e.type || e);
		},
	
		poll = function() {
			try { 
				if(!root.doScroll('left')){ 
					setTimeout(poll, 50); return;
				} 
			} catch(e) { setTimeout(poll, 50); return; }
			init('poll');
		};

	if (y.readyState == 'complete') fn.call(z, 'lazy');
	else {
		if (y.createEventObject && root.doScroll) {
			try { top = !z.frameElement; } catch(e) { }
			if (top) poll();
		}
		y[add](pre + 'DOMContentLoaded', init, false);
		y[add](pre + 'readystatechange', init, false);
		z[add](pre + 'load', init, false);
	}
}
1135027
function() {
		if (!ready) {
			ready = true;
			//Call the stack of onload functions in given context or window object
			for (var i=0, len=stack.length; i < len; i++) {
				stack[i][0].call(stack[i][1]);	
			}
			//Clean up after the DOM is ready
			if (document.removeEventListener) {
				document.removeEventListener("DOMContentLoaded", onStateChange, false);
			}
			//Clear the interval	
			clearInterval(timer);
			//Null the timer and event handlers to release memory
			document.onreadystatechange = window.onload = timer = null;
		}
	}
307317
function(callback, nowait) {
    var self = this;
    var loadWait = function() {
      setTimeout(function() {
        self.waitForPage(callback, true);
      }, 100);
    };
    if (nowait) {
      if (loading) {
        loadWait();
      }
      else {
        getPage(function(page) {
          page.evaluate(function() {
            return jQuery.isReady;
          }, function(ready) {
            if (ready) {
              callback.call(self);
            }
            else {
              loadWait();
            }
          });
        });
      }
    }
    else {
      loadWait();
    }
  }
524445
function( callback ){
      var tm = this;

      setTimeout(function () {
        var returnValue;

        //check for template existance.
        if (tm.template) {
          tm._tokenize();
          returnValue = tm._tokens;

          // execute callback.
          if (callback) {
            callback( returnValue );
          }
        } else {
          throw "ParseError: No template to parse.";
        }
      }, 0);
    }
827175
function execWaitReadyFunctions() {
    if (isReady()) {
        logger.info('Page is ready. Executing ' + callbacksOnReady.length + ' functions that are waiting.');
        for (var i = 0; i < callbacksOnReady.length; i++) {
            var callback = callbacksOnReady[i];
            callback();
        }
    }
}
1071471
function domReady(callback) {
    if (doc.readyState === "complete" || (doc.readyState !== "loading" && !doc.documentElement.doScroll))
        setTimeout(() => callback && callback(), 0)
    else {
        let handler = () => {
            doc.removeEventListener("DOMContentLoaded", handler, false)
            win.removeEventListener("load", handler, false)
            callback && callback()
        }
        doc.addEventListener("DOMContentLoaded", handler, false)
        win.addEventListener("load", handler, false)
    }
}
133190
function whenDocumentReady( callback ) {
   return new Promise( ( resolve, reject ) => {
      function ready() {
         try {
            resolve( callback() );
         }
         catch( err ) {
            reject( err );
         }
      }

      if( document.readyState === 'complete' || document.readyState === 'interactive' ) {
         ready();
      }
      else {
         document.addEventListener( 'DOMContentLoaded', ready );
      }
   } );
}
535333
function(e) {
		this.fire("dataloaded");
		this._initLayout();
		this._initEvents();
		this._initAnalytics();
		if (this.message) {
			this.message.hide();
		}

		this.ready = true;

	}
456543
function windowReadiness({ document }) {
  if (document.readyState === "loading") {
    // Loading hasn't finished yet
    return new Promise((resolve, reject) =>
      document.addEventListener("DOMContentLoaded", resolve)
    );
  }
  // it's ready
}
1350566
function (fn) {
            if (domReady) {
                try {
                    fn(S);
                } catch (e) {
                    setTimeout(function () {
                        throw e;
                    }, 0);
                }
            } else {
                callbacks.push(fn);
            }
            return this;
        }
20485
function contentLoaded(callback) {
    var addEventListener = doc['addEventListener'];
    var done = false, top = true,
        add = addEventListener ? 'addEventListener' : 'attachEvent',
        rem = addEventListener ? 'removeEventListener' : 'detachEvent',
        pre = addEventListener ? '' : 'on',

        init = function(e) {
          if (e.type == 'readystatechange' && doc.readyState != 'complete') {
            return;
          }
          (e.type == 'load' ? win : doc)[rem](pre + e.type, init, false);
          if (!done && (done = true)) { callback.call(win, e.type || e); }
        },

        poll = function() {
          try {
            root.doScroll('left');
          } catch(e) {
            win.setTimeout(poll, 50);
            return;
          }
          init('poll');
        };

    if (doc.readyState == 'complete') {
      callback.call(win, 'lazy');
    } else {
      if (doc.createEventObject && root.doScroll) {
        try { top = !win.frameElement; } catch(e) { }
        if (top) { poll(); }
      }
      doc[add](pre + 'DOMContentLoaded', init, false);
      doc[add](pre + 'readystatechange', init, false);
      win[add](pre + 'load', init, false);
    }
  }
227767
function bindOnReady(win, callback, eventUtils) {
      var doc = win.document, event = { type: 'ready' };

      if (eventUtils.domLoaded) {
        callback(event);
        return;
      }

      function isDocReady() {
        // Check complete or interactive state if there is a body
        // element on some iframes IE 8 will produce a null body
        return doc.readyState === "complete" || (doc.readyState === "interactive" && doc.body);
      }

      // Gets called when the DOM is ready
      function readyHandler() {
        if (!eventUtils.domLoaded) {
          eventUtils.domLoaded = true;
          callback(event);
        }
      }

      function waitForDomLoaded() {
        if (isDocReady()) {
          removeEvent(doc, "readystatechange", waitForDomLoaded);
          readyHandler();
        }
      }

      function tryScroll() {
        try {
          // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author.
          // http://javascript.nwbox.com/IEContentLoaded/
          doc.documentElement.doScroll("left");
        } catch (ex) {
          Delay.setTimeout(tryScroll);
          return;
        }

        readyHandler();
      }

      // Use W3C method (exclude IE 9,10 - readyState "interactive" became valid only in IE 11)
      if (doc.addEventListener && !(Env.ie && Env.ie < 11)) {
        if (isDocReady()) {
          readyHandler();
        } else {
          addEvent(win, 'DOMContentLoaded', readyHandler);
        }
      } else {
        // Use IE method
        addEvent(doc, "readystatechange", waitForDomLoaded);

        // Wait until we can scroll, when we can the DOM is initialized
        if (doc.documentElement.doScroll && win.self === win.top) {
          tryScroll();
        }
      }

      // Fallback if any of the above methods should fail for some odd reason
      addEvent(win, 'load', readyHandler);
    }
1032144
function() {
      this.listenTo(this.view, 'initialize:complete', this.__augmentViewPrepare);
      this.listenTo(this.view, 'before-dispose-callback', this.__dispose);
      _.each(eventMap, function(callback, event) {
        this.listenTo(this.view, event, this[callback]);
      }, this);
    }
840011
function (type) {
                        this.domReady (function (dom) { var e = document.createEvent ('Event')
                                                            e.initEvent (type, true /* bubbles */, true /* cancellable */)
                                         dom.dispatchEvent (e) }) }
175643
function ready( fn ) {
	        if ( !isReady ) {
	    
	            // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
	            if ( !doc.body ) {
	                return defer( ready );
	            }
	    
	            // Remember that the DOM is ready
	            isReady = true;
	    
	            // Execute all callbacks
	            while ( fn = callbacks.shift() ) {
	                defer( fn );
	            }
	        }
	    }
954126
def on(self, evt, func):
        ''''''
        if evt not in self._callbacks:
            raise NotImplementedError('callback "%s"' % evt)
        else:
            self._callbacks[evt] = func
557391
function waitForReadyState(element, readyState, interval, done) {
  var timer = setInterval(function() {
    if (element.readyState >= readyState) {
      clearInterval(timer);
      done(null, true);
    }
  }, interval);
}