Remove unused RequireJS optional module
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/5af79dbf Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/5af79dbf Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/5af79dbf Branch: refs/heads/5.4-js-rewrite Commit: 5af79dbf53dbfe737ea15042dfb93dd82efdb5c7 Parents: 6af7305 Author: Howard M. Lewis Ship <[email protected]> Authored: Sat Nov 17 19:30:45 2012 +0000 Committer: Howard M. Lewis Ship <[email protected]> Committed: Sat Nov 17 19:30:45 2012 +0000 ---------------------------------------------------------------------- .../apache/tapestry5/corelib/modulejs/domReady.js | 125 --------------- 1 files changed, 0 insertions(+), 125 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5af79dbf/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/modulejs/domReady.js ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/modulejs/domReady.js b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/modulejs/domReady.js deleted file mode 100644 index 6a79772..0000000 --- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/modulejs/domReady.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * @license RequireJS domReady 2.0.0 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/requirejs/domReady for details - */ -/*jslint */ -/*global require: false, define: false, requirejs: false, - window: false, clearInterval: false, document: false, - self: false, setInterval: false */ - - -define(function () { - 'use strict'; - - var isBrowser = typeof window !== "undefined" && window.document, - isPageLoaded = !isBrowser, - doc = isBrowser ? document : null, - readyCalls = [], - isTop, testDiv, scrollIntervalId; - - function runCallbacks(callbacks) { - var i; - for (i = 0; i < callbacks.length; i++) { - callbacks[i](doc); - } - } - - function callReady() { - var callbacks = readyCalls; - - if (isPageLoaded) { - //Call the DOM ready callbacks - if (callbacks.length) { - readyCalls = []; - runCallbacks(callbacks); - } - } - } - - /** - * Sets the page as loaded. - */ - function pageLoaded() { - if (!isPageLoaded) { - isPageLoaded = true; - if (scrollIntervalId) { - clearInterval(scrollIntervalId); - } - - callReady(); - } - } - - if (isBrowser) { - if (document.addEventListener) { - //Standards. Hooray! Assumption here that if standards based, - //it knows about DOMContentLoaded. - document.addEventListener("DOMContentLoaded", pageLoaded, false); - window.addEventListener("load", pageLoaded, false); - } else if (window.attachEvent) { - window.attachEvent("onload", pageLoaded); - - testDiv = document.createElement('div'); - try { - isTop = window.frameElement === null; - } catch(e) {} - - //DOMContentLoaded approximation that uses a doScroll, as found by - //Diego Perini: http://javascript.nwbox.com/IEContentLoaded/, - //but modified by other contributors, including jdalton - if (testDiv.doScroll && isTop && window.external) { - scrollIntervalId = setInterval(function () { - try { - testDiv.doScroll(); - pageLoaded(); - } catch (e) {} - }, 30); - } - } - - //Check if document already complete, and if so, just trigger page load - //listeners. Latest webkit browsers also use "interactive", and - //will fire the onDOMContentLoaded before "interactive" but not after - //entering "interactive" or "complete". More details: - //http://dev.w3.org/html5/spec/the-end.html#the-end - //http://stackoverflow.com/questions/3665561/document-readystate-of-interactive-vs-ondomcontentloaded - if (document.readyState === "complete" || - document.readyState === "interactive") { - pageLoaded(); - } - } - - /** START OF PUBLIC API **/ - - /** - * Registers a callback for DOM ready. If DOM is already ready, the - * callback is called immediately. - * @param {Function} callback - */ - function domReady(callback) { - if (isPageLoaded) { - callback(doc); - } else { - readyCalls.push(callback); - } - return domReady; - } - - domReady.version = '2.0.0'; - - /** - * Loader Plugin API method - */ - domReady.load = function (name, req, onLoad, config) { - if (config.isBuild) { - onLoad(null); - } else { - domReady(onLoad); - } - }; - - /** END OF PUBLIC API **/ - - return domReady; -});
