Update of /cvsroot/qooxdoo/qooxdoo/source/script/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29753/source/script/gui
Modified Files:
Tag: renderer
QxImagePreloader.js QxWidgetCore.js
Added Files:
Tag: renderer
QxImagePreloaderSystem.js
Log Message:
Greatly improved application startup handling through optimizations for image pre and postloading, introduce new QxImagePreloaderSystem
--- NEW FILE: QxImagePreloaderSystem.js ---
/* ************************************************************************
qooxdoo - the new era of web interface development
Version:
$Id: QxImagePreloaderSystem.js,v 1.1.2.1 2006/01/30 13:36:26 wpbasti Exp $
Copyright:
(C) 2004-2005 by Schlund + Partner AG, Germany
All rights reserved
License:
LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/
Internet:
* http://qooxdoo.oss.schlund.de
Authors:
* Sebastian Werner (wpbasti)
<sebastian dot werner at 1und1 dot de>
* Andreas Ecker (aecker)
<andreas dot ecker at 1und1 dot de>
************************************************************************ */
/* ************************************************************************
#package(image)
#post(QxImagePreloader)
************************************************************************ */
function QxImagePreloaderSystem(vPreloadList)
{
QxTarget.call(this);
this._list = vPreloadList;
};
QxImagePreloaderSystem.extend(QxTarget, "QxImagePreloaderSystem");
/*
---------------------------------------------------------------------------
USER ACCESS
---------------------------------------------------------------------------
*/
proto.start = function()
{
for (vSource in this._list)
{
vPreloader = new QxImagePreloader(QxImageManager.buildURI(vSource));
if (vPreloader.isErroneous() || vPreloader.isLoaded())
{
delete this._list[vSource];
}
else
{
vPreloader._origSource = vSource;
vPreloader.addEventListener(QxConst.EVENT_TYPE_LOAD, this._onload, this);
vPreloader.addEventListener(QxConst.EVENT_TYPE_ERROR, this._onerror, this);
};
};
this._check();
};
/*
---------------------------------------------------------------------------
EVENT LISTENERS
---------------------------------------------------------------------------
*/
proto._onload = function(e)
{
delete this._list[e.getTarget()._origSource];
this._check();
};
proto._onerror = function(e)
{
delete this._list[e.getTarget()._origSource];
this._check();
};
/*
---------------------------------------------------------------------------
CHECK
---------------------------------------------------------------------------
*/
proto._check = function()
{
if (QxUtil.isObjectEmpty(this._list)) {
this.createDispatchEvent(QxConst.EVENT_TYPE_COMPLETED);
};
};
/*
---------------------------------------------------------------------------
DISPOSER
---------------------------------------------------------------------------
*/
proto.dispose = function()
{
if (this.getDisposed()) {
return true;
};
this._list = null;
delete this._list;
return QxTarget.prototype.dispose.call(this);
};
Index: QxImagePreloader.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/gui/Attic/QxImagePreloader.js,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -d -r1.1.2.6 -r1.1.2.7
--- QxImagePreloader.js 16 Jan 2006 16:11:55 -0000 1.1.2.6
+++ QxImagePreloader.js 30 Jan 2006 13:36:26 -0000 1.1.2.7
@@ -76,7 +76,7 @@
proto._source = null;
proto._isLoaded = false;
-proto._isError = false;
+proto._isErroneous = false;
@@ -90,8 +90,8 @@
proto.getUri = function() { return this._source; };
proto.getSource = function() { return this._source; };
-proto.getIsLoaded = function() { return this._isLoaded; };
-proto.getIsError = function() { return this._isError; };
+proto.isLoaded = function() { return this._isLoaded; };
+proto.isErroneous = function() { return this._isErroneous; };
// only used in mshtml: true when the image format is in png
proto._isPng = false;
@@ -124,7 +124,7 @@
proto._onload = function()
{
this._isLoaded = true;
- this._isError = false;
+ this._isErroneous = false;
if (this.hasEventListeners(QxConst.EVENT_TYPE_LOAD)) {
this.dispatchEvent(new QxEvent(QxConst.EVENT_TYPE_LOAD), true);
@@ -136,7 +136,7 @@
this.debug("Could not load: " + this._source);
this._isLoaded = false;
- this._isError = true;
+ this._isErroneous = true;
if (this.hasEventListeners(QxConst.EVENT_TYPE_ERROR)) {
this.dispatchEvent(new QxEvent(QxConst.EVENT_TYPE_ERROR), true);
@@ -167,6 +167,6 @@
this._element = null;
};
- this._isLoaded = this._isError = this._isPng = false;
+ this._isLoaded = this._isErroneous = this._isPng = false;
return true;
};
\ No newline at end of file
Index: QxWidgetCore.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/gui/Attic/QxWidgetCore.js,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -d -r1.1.2.13 -r1.1.2.14
--- QxWidgetCore.js 25 Jan 2006 17:47:59 -0000 1.1.2.13
+++ QxWidgetCore.js 30 Jan 2006 13:36:26 -0000 1.1.2.14
@@ -72,7 +72,7 @@
QxWidget.flushGlobalQueues = function()
{
- if (QxWidget._inFlushGlobalQueues || !window.application._ready) {
+ if (QxWidget._inFlushGlobalQueues || !window.application.isReady()) {
return;
};
@@ -106,14 +106,6 @@
delete QxWidget._inFlushGlobalQueues;
};
-QxWidget.FLUSH_TIMEOUT = 100;
-
-QxWidget.flushGlobalQueuesTimeout = function() {
- window.setTimeout(QxWidget.flushGlobalQueues, QxWidget.FLUSH_TIMEOUT);
-};
-
-
-
|