diff options
author | Derrell Lipman <derrell@samba.org> | 2007-02-14 04:19:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:48:12 -0500 |
commit | b79bf0623235672684d7dd79dd7a6b202adfb35f (patch) | |
tree | 3154a686d000b754eb8ff63c25b29d879f8b48e9 /webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/io/image/PreloaderSystem.js | |
parent | ecfbc670c2a641b1f18155af0ed9a6e49278185a (diff) | |
download | samba-b79bf0623235672684d7dd79dd7a6b202adfb35f.tar.gz samba-b79bf0623235672684d7dd79dd7a6b202adfb35f.tar.bz2 samba-b79bf0623235672684d7dd79dd7a6b202adfb35f.zip |
r21326: get rid of old qooxdoo version.
(This used to be commit 39a4803ad1046e2473bdc7b22321a5f61ae3a1ea)
Diffstat (limited to 'webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/io/image/PreloaderSystem.js')
-rwxr-xr-x | webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/io/image/PreloaderSystem.js | 187 |
1 files changed, 0 insertions, 187 deletions
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/io/image/PreloaderSystem.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/io/image/PreloaderSystem.js deleted file mode 100755 index ef1356dc52..0000000000 --- a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/io/image/PreloaderSystem.js +++ /dev/null @@ -1,187 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org - - License: - LGPL 2.1: http://www.gnu.org/licenses/lgpl.html - - Authors: - * Sebastian Werner (wpbasti) - * Andreas Ecker (ecker) - -************************************************************************ */ - -/* ************************************************************************ - -#module(ui_core) - -************************************************************************ */ - -/** - * @event completed {qx.event.type.Event} - */ -qx.OO.defineClass("qx.io.image.PreloaderSystem", qx.core.Target, -function(vPreloadList, vCallBack, vCallBackScope) -{ - qx.core.Target.call(this); - - this._list = vPreloadList; - - // Create timer - this._timer = new qx.client.Timer(this.getSetting("timeout")); - this._timer.addEventListener("interval", this._oninterval, this); - - // If we use the compact syntax, automatically add an event listeners and start the loading process - if (vCallBack) - { - this.addEventListener("completed", vCallBack, vCallBackScope || null); - this.start(); - } -}); - -qx.Proto._stopped = false; - - - -/* ---------------------------------------------------------------------------- - DEFAULT SETTINGS ---------------------------------------------------------------------------- -*/ - -qx.Settings.setDefault("timeout", 3000); - - - - - -/* ---------------------------------------------------------------------------- - USER ACCESS ---------------------------------------------------------------------------- -*/ - -qx.Proto.start = function() -{ - if (qx.lang.Object.isEmpty(this._list)) - { - this.createDispatchEvent("completed"); - return; - } - - for (var vSource in this._list) - { - var vPreloader = qx.manager.object.ImagePreloaderManager.getInstance().create(qx.manager.object.AliasManager.getInstance().resolvePath(vSource)); - - if (vPreloader.isErroneous() || vPreloader.isLoaded()) - { - delete this._list[vSource]; - } - else - { - vPreloader._origSource = vSource; - - vPreloader.addEventListener("load", this._onload, this); - vPreloader.addEventListener("error", this._onerror, this); - } - } - - // Initial check - this._check(); -} - - - - - -/* ---------------------------------------------------------------------------- - EVENT LISTENERS ---------------------------------------------------------------------------- -*/ - -qx.Proto._onload = function(e) -{ - delete this._list[e.getTarget()._origSource]; - this._check(); -} - -qx.Proto._onerror = function(e) -{ - delete this._list[e.getTarget()._origSource]; - this._check(); -} - -qx.Proto._oninterval = function(e) -{ - this.error("Could not preload: " + qx.lang.Object.getKeysAsString(this._list)); - - this._stopped = true; - this._timer.stop(); - - this.createDispatchEvent("completed"); -} - - - - - - -/* ---------------------------------------------------------------------------- - CHECK ---------------------------------------------------------------------------- -*/ - -qx.Proto._check = function() -{ - if (this._stopped) { - return; - } - - // this.debug("Check: " + qx.lang.Object.getKeysAsString(this._list)); - - if (qx.lang.Object.isEmpty(this._list)) - { - this._timer.stop(); - this.createDispatchEvent("completed"); - } - else - { - // Restart timer for timeout - this._timer.restart(); - } -} - - - - - - -/* ---------------------------------------------------------------------------- - DISPOSER ---------------------------------------------------------------------------- -*/ - -qx.Proto.dispose = function() -{ - if (this.getDisposed()) { - return true; - } - - this._list = null; - - if (this._timer) - { - this._timer.dispose(); - this._timer = null; - } - - return qx.core.Target.prototype.dispose.call(this); -} |