diff options
author | Barak Korren <[email protected]> | 2013-04-02 20:38:07 +0300 |
---|---|---|
committer | Barak Korren <[email protected]> | 2013-04-02 20:38:07 +0300 |
commit | 58a2577d48790c79adfd44bcfd662c980ce6cfe4 (patch) | |
tree | 523d814ea0b7b6f617fe515b186099c6e83fed72 /lib/dojo/domReady.js.uncompressed.js | |
parent | e470a273cf09562fb2f9c0c899002303f19c8d16 (diff) | |
parent | cc332603431102a682feda22b9cf0093a29f0176 (diff) |
Merge branch 'master' of https://github.com/gothfox/Tiny-Tiny-RSS.git
Diffstat (limited to 'lib/dojo/domReady.js.uncompressed.js')
-rw-r--r-- | lib/dojo/domReady.js.uncompressed.js | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/lib/dojo/domReady.js.uncompressed.js b/lib/dojo/domReady.js.uncompressed.js deleted file mode 100644 index 90d03d4c7..000000000 --- a/lib/dojo/domReady.js.uncompressed.js +++ /dev/null @@ -1,97 +0,0 @@ -define("dojo/domReady", ['./has'], function(has){ - var global = this, - doc = document, - readyStates = { 'loaded': 1, 'complete': 1 }, - fixReadyState = typeof doc.readyState != "string", - ready = !!readyStates[doc.readyState]; - - // For FF <= 3.5 - if(fixReadyState){ doc.readyState = "loading"; } - - if(!ready){ - var readyQ = [], tests = [], - detectReady = function(evt){ - evt = evt || global.event; - if(ready || (evt.type == "readystatechange" && !readyStates[doc.readyState])){ return; } - ready = 1; - - // For FF <= 3.5 - if(fixReadyState){ doc.readyState = "complete"; } - - while(readyQ.length){ - (readyQ.shift())(doc); - } - }, - on = function(node, event){ - node.addEventListener(event, detectReady, false); - readyQ.push(function(){ node.removeEventListener(event, detectReady, false); }); - }; - - if(!has("dom-addeventlistener")){ - on = function(node, event){ - event = "on" + event; - node.attachEvent(event, detectReady); - readyQ.push(function(){ node.detachEvent(event, detectReady); }); - }; - - var div = doc.createElement("div"); - try{ - if(div.doScroll && global.frameElement === null){ - // the doScroll test is only useful if we're in the top-most frame - tests.push(function(){ - // Derived with permission from Diego Perini's IEContentLoaded - // http://javascript.nwbox.com/IEContentLoaded/ - try{ - div.doScroll("left"); - return 1; - }catch(e){} - }); - } - }catch(e){} - } - - on(doc, "DOMContentLoaded"); - on(global, "load"); - - if("onreadystatechange" in doc){ - on(doc, "readystatechange"); - }else if(!fixReadyState){ - // if the ready state property exists and there's - // no readystatechange event, poll for the state - // to change - tests.push(function(){ - return readyStates[doc.readyState]; - }); - } - - if(tests.length){ - var poller = function(){ - if(ready){ return; } - var i = tests.length; - while(i--){ - if(tests[i]()){ - detectReady("poller"); - return; - } - } - setTimeout(poller, 30); - }; - poller(); - } - } - - function domReady(callback){ - // summary: - // Plugin to delay require()/define() callback from firing until the DOM has finished loading. - if(ready){ - callback(doc); - }else{ - readyQ.push(callback); - } - } - domReady.load = function(id, req, load){ - domReady(load); - }; - - return domReady; -}); |