diff options
Diffstat (limited to 'webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client')
4 files changed, 0 insertions, 1314 deletions
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/Command.js b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/Command.js deleted file mode 100644 index d7026203f9..0000000000 --- a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/Command.js +++ /dev/null @@ -1,349 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2004-2007 1&1 Internet AG, Germany, http://www.1and1.org - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Sebastian Werner (wpbasti) - * Andreas Ecker (ecker) - * Fabian Jakobs (fjakobs) - -************************************************************************ */ - -/* ************************************************************************ - -#module(ui_core) -#require(qx.locale.Key) - -************************************************************************ */ - -/** - * This contains a command with shortcut. - * - * Each command could be assigned to multiple widgets. - * - * @event execute {qx.event.type.DataEvent} when the command is executed. Sets the - * "data" property of the event to the object that issued the command. - * - * @param vShortcut {String} shortcuts can be composed of optional modifier - * keys Control, Alt, Shift, Meta and a non modifier key. - * If no non modifier key is specified, the second paramater is evaluated. - * The key must be seperated by a <code>+</code> or <code>-</code> character. - * Examples: Alt+F1, Control+C, Control+Alt+Enf - * - * @param vKeyCode {Integer} Additional key of the command interpreted as a keyCode. - */ -qx.OO.defineClass("qx.client.Command", qx.core.Target, -function(vShortcut, vKeyCode) -{ - qx.core.Target.call(this); - - this._modifier = {}; - this._key = null; - - if (vShortcut != null) { - this.setShortcut(vShortcut); - } - - if (vKeyCode != null) - { - this.warn("The use of keyCode in command is deprecated. Use keyIdentifier instead."); - this.setKeyCode(vKeyCode); - } - - // OSX warning for Alt key combinations - if (this._modifier.Alt && this._key && this._key.length == 1) { - if ( - (this._key >= "A" && this._key <= "Z") || - (this._key >= "0" && this._key <= "9") - ) { - this.warn("A shortcut containing Alt and a letter or number will not work under OS X!"); - } - } - qx.event.handler.EventHandler.getInstance().addCommand(this); -}); - - -/** the command shortcut */ -qx.OO.addProperty({ name : "shortcut", type : "string" }); - -/** - * keyCode - * @deprecated - * - * Still there for compatibility with the old key handler/commands - */ -qx.OO.addProperty({ name : "keyCode", type : "number" }); - -/** KeyIdentifier */ -qx.OO.addProperty({ name : "keyIdentifier", type : "string" }); - - - -/* ---------------------------------------------------------------------------- - USER METHODS ---------------------------------------------------------------------------- -*/ - -/** - * Fire the "execute" event on this command. - * - * @param vTarget {Object} Object which issued the execute event - */ -qx.Proto.execute = function(vTarget) -{ - if (this.hasEventListeners("execute")) { - var event = new qx.event.type.DataEvent("execute", vTarget); - this.dispatchEvent(event, true); - } - - return false; -}; - - - -/* ---------------------------------------------------------------------------- - MODIFIER ---------------------------------------------------------------------------- -*/ - -qx.Proto._modifyShortcut = function(propValue, propOldValue, propData) -{ - if (propValue) - { - this._modifier = {}; - this._key = null; - - // split string to get each key which must be pressed - // build a hash with active keys - var a = propValue.split(/[-+\s]+/); - var al = a.length; - - for (var i=0; i<al; i++) - { - var identifier = this._oldKeyNameToKeyIdentifier(a[i]); - - switch (identifier) - { - case "Control": - case "Shift": - case "Meta": - case "Alt": - this._modifier[identifier] = true; - break; - - case "Unidentified": - var msg = "Not a valid key name for a command: " + a[i]; - this.error(msg); - throw msg; - - default: - if (this._key) { - var msg = "You can only specify one non modifier key!"; - this.error(msg); - throw msg; - } - this._key = identifier; - } - } - } - return true; -}; - - - -/* --------------------------------------------------------------------------- - INTERNAL MATCHING LOGIC ---------------------------------------------------------------------------- -*/ - -/** - * Checks wether the given key event matches the command's shortcut - * - * @param e {qx.event.type.KeyEvent} the key event object - * @return {Boolean} wether the commands shortcut matches the key event - */ -qx.Proto._matchesKeyEvent = function(e) -{ - var key = this._key || this.getKeyIdentifier(); - if (!key && !this.getKeyCode()) { - // no shortcut defined. - return; - } - - // pre-check for check special keys - // we handle this here to omit to check this later again. - if ( - (this._modifier.Shift && !e.isShiftPressed()) || - (this._modifier.Control && !e.isCtrlPressed()) || -// (this._modifier.Meta && !e.getMetaKey()) || - (this._modifier.Alt && !e.isAltPressed()) - ) { - return false; - } - - if (key) - { - if (key == e.getKeyIdentifier()) { - return true; - } - } - else - { - if (this.getKeyCode() == e.getKeyCode()) { - return true; - } - } - - return false; -}; - - -/* ---------------------------------------------------------------------------- - COMPATIBILITY TO COMMAND ---------------------------------------------------------------------------- -*/ - -qx.Proto._oldKeyNameToKeyIdentifierMap = -{ - // all other keys are converted by converting the first letter to uppercase - - esc : "Escape", - ctrl : "Control", - print : "PrintScreen", - del : "Delete", - pageup : "PageUp", - pagedown : "PageDown", - numlock : "NumLock", - numpad_0 : "0", - numpad_1 : "1", - numpad_2 : "2", - numpad_3 : "3", - numpad_4 : "4", - numpad_5 : "5", - numpad_6 : "6", - numpad_7 : "7", - numpad_8 : "8", - numpad_9 : "9", - numpad_divide : "/", - numpad_multiply : "*", - numpad_minus : "-", - numpad_plus : "+" -}; - - -/** - * converts an old key name as found in {@link qx.event.type.KeyEvent.keys} to - * the new keyIdentifier. - * - * @param keyName {String} old name of the key. - * @return {String} corresponding keyIdentifier or "Unidentified" if a conversion was not possible - */ -qx.Proto._oldKeyNameToKeyIdentifier = function(keyName) -{ - var keyHandler = qx.event.handler.KeyEventHandler.getInstance(); - var keyIdentifier = "Unidentified"; - - if (keyHandler.isValidKeyIdentifier(keyName)) { - return keyName; - } - - if (keyName.length == 1 && keyName >= "a" && keyName <= "z") { - return keyName.toUpperCase(); - } - - keyName = keyName.toLowerCase(); - - // check wether its a valid old key name - if (!qx.event.type.KeyEvent.keys[keyName]) { - return "Unidentified"; - } - - var keyIdentifier = this._oldKeyNameToKeyIdentifierMap[keyName]; - if (keyIdentifier) { - return keyIdentifier; - } else { - return qx.lang.String.toFirstUp(keyName); - } -}; - - -/* ---------------------------------------------------------------------------- - STRING CONVERTION ---------------------------------------------------------------------------- -*/ - -/** - * Returns the shortcut as string - * - * @return {String} shortcut - */ -qx.Proto.toString = function() -{ - //var vShortcut = this.getShortcut(); - var vKeyCode = this.getKeyCode(); - var key = this._key || this.getKeyIdentifier(); - - var vString = []; - - for (var modifier in this._modifier) { - vString.push(qx.locale.Key.getKeyName("short", modifier)); - } - - if (key) { - vString.push(qx.locale.Key.getKeyName("short", key)); - } - /* - if (vShortcut != null) { - vString.push(vShortcut); - } - */ - if (vKeyCode != null) - { - var vTemp = qx.event.type.KeyEvent.codes[vKeyCode]; - vString.push(vTemp ? qx.lang.String.toFirstUp(vTemp) : String(vKeyCode)); - } - - return vString.join("-"); -}; - - - -/* ---------------------------------------------------------------------------- - DISPOSER ---------------------------------------------------------------------------- -*/ - -/** - * Destructor - */ -qx.Proto.dispose = function() -{ - if (this.getDisposed()) { - return; - } - - this._shortcutParts = null; - - var vMgr = qx.event.handler.EventHandler.getInstance(); - if (vMgr) { - vMgr.removeCommand(this); - } - - return qx.core.Target.prototype.dispose.call(this); -}; diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/History.js b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/History.js deleted file mode 100644 index 3cc8004d46..0000000000 --- a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/History.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2004-2007 1&1 Internet AG, Germany, http://www.1and1.org - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Sebastian Werner (wpbasti) - * Andreas Ecker (ecker) - -************************************************************************ */ - -/* ************************************************************************ - -#require(qx.manager.object.AliasManager) -#embed(qx.static/history/historyHelper.html) - -************************************************************************ */ - -/** - * A helper for using the browser history in JavaScript Applications without - * reloading the main page. - * <p> - * Adds entries to the browser history and fires a "request" event when one of - * the entries was requested by the user (e.g. by clicking on the back button). - * </p> - * - * @event request {qx.event.type.DataEvent} Fired when the user moved in the - * history. The data property of the event holds the command, which was - * passed to {@link #addToHistory}. - */ -qx.OO.defineClass("qx.client.History", qx.core.Target, -function() { - qx.core.Target.call(this); - - this._pageFlag = true; -}); - - -/** - * Initializes the History. This method has to called by applications using this - * class once during initialization. Subsequent calls have no (negative) effect. - */ -qx.Proto.init = function() { - if (this._iframe == null) { - this._iframe = document.createElement("iframe"); - this._iframe.style.visibility = "hidden"; - document.body.appendChild(this._iframe); - } -} - - -/** - * Adds an entry to the browser history. - * - * @param command {String} a string representing the old state of the - * application. This command will be delivered in the data property of - * the "request" event. - * @param newTitle {String ? null} the page title to set after the history entry - * is done. This title should represent the new state of the application. - */ -qx.Proto.addToHistory = function(command, newTitle) { - if (command == this._currentCommand) { - document.title = newTitle; - } else { - if (this._iframe == null) { - throw new Error("You have to call init first!"); - } - - this._pageFlag = !this._pageFlag; - this._currentCommand = command; - this._newTitle = newTitle; - - // NOTE: We need the command attribute to enforce a loading of the page - // (Otherwise we don't get an onload event). - // The browser will still cache commands loaded once. - // Without the onload-problem anchors would work, too. - // (Anchors would have the advantage that the helper is only loaded once) - this._iframe.src = this.getSetting("helperFile") + "?c=" + command; - } -} - - -/** - * Event handler. Called when the history helper page was loaded. - * - * @param location {Map} the location property of the window object of the - * helper page. - */ -qx.Proto._onHistoryLoad = function(location) -{ - try { - var equalsPos = location.search.indexOf("="); - var command = location.search.substring(equalsPos + 1); - - if (this._newTitle) { - document.title = this._newTitle; - this._newTitle = null; - } - - if (command != this._currentCommand) { - this._currentCommand = command; - - this.createDispatchDataEvent("request", command); - } - } catch (exc) { - this.error("Handling history load failed", exc); - } - - qx.ui.core.Widget.flushGlobalQueues(); -} - - -/** The URL to the helper page. */ -qx.Settings.setDefault("helperFile", qx.Settings.getValueOfClass("qx.manager.object.AliasManager", "staticUri") + "/history/historyHelper.html"); - - - - - - -/* ---------------------------------------------------------------------------- - DEFER SINGLETON INSTANCE ---------------------------------------------------------------------------- -*/ - -/** - * Singleton Instance Getter - */ -qx.Class.getInstance = qx.lang.Function.returnInstance; diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/NativeWindow.js b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/NativeWindow.js deleted file mode 100644 index e63ac4f12e..0000000000 --- a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/NativeWindow.js +++ /dev/null @@ -1,641 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2004-2007 1&1 Internet AG, Germany, http://www.1and1.org - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Sebastian Werner (wpbasti) - * Andreas Ecker (ecker) - -************************************************************************ */ - -/* ************************************************************************ - -#require(qx.html.Window) - -************************************************************************ */ - -qx.OO.defineClass("qx.client.NativeWindow", qx.core.Target, -function(vUrl, vName) -{ - qx.core.Target.call(this); - - - // ************************************************************************ - // TIMER - // ************************************************************************ - - this._timer = new qx.client.Timer(100); - this._timer.addEventListener("interval", this._oninterval, this); - - - // ************************************************************************ - // INITIAL PROPERTIES - // ************************************************************************ - - if (vUrl != null) { - this.setUrl(vUrl); - } - - if (vName != null) { - this.setName(vName); - } -}); - - - - - -/* ---------------------------------------------------------------------------- - PROPERTIES ---------------------------------------------------------------------------- -*/ - -/*! - If the window is open or closed -*/ -qx.OO.addProperty({ name : "open", type : "boolean", defaultValue : false }); - -/*! - The outer width of the window. -*/ -qx.OO.addProperty({ name : "width", type : "number", defaultValue : 400, impl : "dimension" }); - -/*! - The outer height of the window. -*/ -qx.OO.addProperty({ name : "height", type : "number", defaultValue : 250, impl : "dimension" }); - -/*! - The left screen coordinate of the window. -*/ -qx.OO.addProperty({ name : "left", type : "number", defaultValue : 100, impl : "position" }); - -/*! - The top screen coordinate of the window. -*/ -qx.OO.addProperty({ name : "top", type : "number", defaultValue : 200, impl : "position" }); - -/*! - Should be window be modal -*/ -qx.OO.addProperty({ name : "modal", type : "boolean", defaultValue : false }); - -/*! - Should be window be dependent on this application window -*/ -qx.OO.addProperty({ name : "dependent", type : "boolean", defaultValue : true }); - -/*! - The url -*/ -qx.OO.addProperty({ name : "url", type : "string" }); - -/*! - The window name -*/ -qx.OO.addProperty({ name : "name", type : "string" }); - -/*! - The text of the statusbar -*/ -qx.OO.addProperty({ name : "status", type : "string", defaultValue : "Ready" }); - -/*! - Should the statusbar be shown -*/ -qx.OO.addProperty({ name : "showStatusbar", type : "boolean", defaultValue : false }); - -/*! - Should the menubar be shown -*/ -qx.OO.addProperty({ name : "showMenubar", type : "boolean", defaultValue : false }); - -/*! - Should the location(bar) be shown -*/ -qx.OO.addProperty({ name : "showLocation", type : "boolean", defaultValue : false }); - -/*! - Should the toolbar be shown -*/ -qx.OO.addProperty({ name : "showToolbar", type : "boolean", defaultValue : false }); - -/*! - If the window is resizeable -*/ -qx.OO.addProperty({ name : "resizeable", type : "boolean", defaultValue : true }); - -/*! - If the window is able to scroll and has visible scrollbars if needed -*/ -qx.OO.addProperty({ name : "allowScrollbars", type : "boolean", defaultValue : true }); - - - -/* ---------------------------------------------------------------------------- - STATE ---------------------------------------------------------------------------- -*/ - -qx.Proto._loaded = false; - - - - -/* ---------------------------------------------------------------------------- - PROPERTY GROUPS ---------------------------------------------------------------------------- -*/ - -qx.OO.addPropertyGroup({ name : "location", members : [ "left", "top" ]}); -qx.OO.addPropertyGroup({ name : "dimension", members : [ "width", "height" ]}); - - - - -/* ---------------------------------------------------------------------------- - MODIFIERS ---------------------------------------------------------------------------- -*/ - -qx.Proto._modifyPosition = function(propValue, propOldValue, propName) -{ - /* - http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/sp2brows.mspx - Changes to Functionality in Microsoft Windows XP Service Pack 2 - Part 5: Enhanced Browsing Security - URLACTION_FEATURE_WINDOW_RESTRICTIONS - Allow script-initiated windows without size or position constraints - Code: 2102 - */ - - if (!this.isClosed()) - { - try - { - this._window.moveTo(this.getLeft(), this.getTop()); - } - catch(ex) - { - this.error("Cross-Domain Scripting problem: Could not move window!", ex); - } - } - - return true; -} - -qx.Proto._modifyDimension = function(propValue, propOldValue, propName) -{ - /* - http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/sp2brows.mspx - Changes to Functionality in Microsoft Windows XP Service Pack 2 - Part 5: Enhanced Browsing Security - URLACTION_FEATURE_WINDOW_RESTRICTIONS - Allow script-initiated windows without size or position constraints - Code: 2102 - */ - - if (!this.isClosed()) - { - try - { - this._window.resizeTo(this.getWidth(), this.getHeight()); - } - catch(ex) - { - this.error("Cross-Domain Scripting problem: Could not resize window!", ex); - } - } - - return true; -} - -qx.Proto._modifyName = function(propValue, propOldValue, propName) -{ - if (!this.isClosed()) { - this._window.name = propValue; - } - - return true; -} - -qx.Proto._modifyUrl = function(propValue, propOldValue, propName) -{ - // String hack needed for old compressor (compile.py) - if(!this.isClosed()) { - this._window.location.replace(propValue != null ? propValue : ("javascript:/" + "/")); - } - - return true; -} - -qx.Proto._modifyOpen = function(propValue, propOldValue, propData) -{ - propValue ? this._open() : this._close(); - return true; -} - - - - - - -/* ---------------------------------------------------------------------------- - NAME ---------------------------------------------------------------------------- -*/ - -qx.Proto.getName = function() -{ - if (!this.isClosed()) - { - try - { - var vName = this._window.name; - } - catch(ex) - { - return this._valueName; - } - - if (vName == this._valueName) - { - return vName; - } - else - { - throw new Error("window name and name property are not identical"); - } - } - else - { - return this._valueName; - } -} - - - - - - -/* ---------------------------------------------------------------------------- - UTILITY ---------------------------------------------------------------------------- -*/ - -qx.Proto.isClosed = function() -{ - var vClosed = true; - - if (this._window) - { - try { - vClosed = this._window.closed; - } catch(ex) {} - } - - return vClosed; -} - -qx.Proto.open = function() { - this.setOpen(true); -} - -qx.Proto.close = function() { - this.setOpen(false); -} - -qx.Proto.isLoaded = function() { - return this._loaded; -} - - - - - - - -/* ---------------------------------------------------------------------------- - OPEN METHOD ---------------------------------------------------------------------------- -*/ - -qx.Proto._open = function() -{ - var vConf = []; - - - /* - ------------------------------------------------------------------------------ - PRE CONFIGURE WINDOW - ------------------------------------------------------------------------------ - */ - - if (this.getWidth() != null) - { - vConf.push("width"); - vConf.push("="); - vConf.push(this.getWidth()); - vConf.push(","); - } - - if (this.getHeight() != null) - { - vConf.push("height"); - vConf.push("="); - vConf.push(this.getHeight()); - vConf.push(","); - } - - if (this.getLeft() != null) - { - vConf.push("left"); - vConf.push("="); - vConf.push(this.getLeft()); - vConf.push(","); - } - - if (this.getTop() != null) - { - vConf.push("top"); - vConf.push("="); - vConf.push(this.getTop()); - vConf.push(","); - } - - - - vConf.push("dependent"); - vConf.push("="); - vConf.push(this.getDependent() ? "yes" : "no"); - vConf.push(","); - - vConf.push("resizable"); - vConf.push("="); - vConf.push(this.getResizeable() ? "yes" : "no"); - vConf.push(","); - - vConf.push("status"); - vConf.push("="); - vConf.push(this.getShowStatusbar() ? "yes" : "no"); - vConf.push(","); - - vConf.push("location"); - vConf.push("="); - vConf.push(this.getShowLocation() ? "yes" : "no"); - vConf.push(","); - - vConf.push("menubar"); - vConf.push("="); - vConf.push(this.getShowMenubar() ? "yes" : "no"); - vConf.push(","); - - vConf.push("toolbar"); - vConf.push("="); - vConf.push(this.getShowToolbar() ? "yes" : "no"); - vConf.push(","); - - vConf.push("scrollbars"); - vConf.push("="); - vConf.push(this.getAllowScrollbars() ? "yes" : "no"); - vConf.push(","); - - vConf.push("modal"); - vConf.push("="); - vConf.push(this.getModal() ? "yes" : "no"); - vConf.push(","); - - - - - - - /* - ------------------------------------------------------------------------------ - OPEN WINDOW - ------------------------------------------------------------------------------ - */ - - if (this.getName() != null) { - this.setName("qx_NativeWindow" + this.toHashCode()); - } - - this._window = window.open(this.getUrl(), this.getName(), vConf.join("")); - - if (this.isClosed()) - { - this.error("Window could not be opened. It seems, there is a popup blocker active!"); - } - else - { - // This try-catch is needed because of cross domain issues (access rights) - try - { - this._window._native = this; - this._window.onload = this._onload; - } - catch(ex) {} - - // start timer for close detection - this._timer.start(); - - // block original document - if (this.getModal()) { - qx.ui.core.ClientDocument.getInstance().block(this); - } - } -} - -qx.Proto._close = function() -{ - if (!this._window) { - return; - } - - // stop timer for close detection - this._timer.stop(); - - // release window again - if (this.getModal()){ - qx.ui.core.ClientDocument.getInstance().release(this); - } - - // finally close window - if (!this.isClosed()) { - this._window.close(); - } - - try - { - this._window._native = null; - this._window.onload = null; - } - catch(ex) {}; - - this._window = null; - this._loaded = false; - - this.createDispatchEvent("close"); -} - - - - - - -/* ---------------------------------------------------------------------------- - CENTER SUPPORT ---------------------------------------------------------------------------- -*/ - -qx.Proto.centerToScreen = function() { - return this._centerHelper((screen.width - this.getWidth()) / 2, (screen.height - this.getHeight()) / 2); -} - -qx.Proto.centerToScreenArea = function() { - return this._centerHelper((screen.availWidth - this.getWidth()) / 2, (screen.availHeight - this.getHeight()) / 2); -} - -qx.Proto.centerToOpener = function() { - return this._centerHelper(((qx.html.Window.getInnerWidth(window) - this.getWidth()) / 2) + qx.html.Location.getScreenBoxLeft(window.document.body), ((qx.html.Window.getInnerHeight(window) - this.getHeight()) / 2) + qx.html.Location.getScreenBoxTop(window.document.body)); -} - -qx.Proto._centerHelper = function(l, t) -{ - // set new values - this.setLeft(l); - this.setTop(t); - - // focus window if opened - if (!this.isClosed()) { - this.focus(); - } -} - - - - - - -/* ---------------------------------------------------------------------------- - FOCUS HANDLING ---------------------------------------------------------------------------- -*/ - -qx.Proto.focus = function() -{ - if (!this.isClosed()) { - this._window.focus(); - } -} - -qx.Proto.blur = function() -{ - if (!this.isClosed()) { - this._window.blur(); - } -} - - - - - - - -/* ---------------------------------------------------------------------------- - EVENT HANDLING ---------------------------------------------------------------------------- -*/ - -qx.Proto._oninterval = function(e) -{ - if (this.isClosed()) { - this.setOpen(false); - } - else if (!this._loaded) - { - // This try-catch is needed because of cross domain issues (access rights) - try - { - if (this._window.document && this._window.document.readyState == "complete") - { - this._loaded = true; - this.createDispatchEvent("load"); - } - } - catch(ex) {}; - } -} - -qx.Proto._onload = function(e) -{ - var obj = this._native; - - if (!obj._loaded) - { - obj._loaded = true; - obj.createDispatchEvent("load"); - } -} - - - - - - -/* ---------------------------------------------------------------------------- - DISPOSER ---------------------------------------------------------------------------- -*/ - -qx.Proto.dispose = function() -{ - if (this.getDisposed()) { - return; - } - - if (this.getDependent()) { - this.close(); - } - - if (this._timer) - { - this._timer.stop(); - this._timer = null; - } - - if (this._window) - { - try - { - this._window._native = null; - this._window.onload = null; - } - catch(ex) {}; - - this._window = null; - } - - return qx.core.Target.prototype.dispose.call(this); -} diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/Timer.js b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/Timer.js deleted file mode 100644 index 36fb11dc08..0000000000 --- a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/client/Timer.js +++ /dev/null @@ -1,185 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2004-2007 1&1 Internet AG, Germany, http://www.1and1.org - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Sebastian Werner (wpbasti) - * Andreas Ecker (ecker) - -************************************************************************ */ - -/* ************************************************************************ - -#module(core) - -************************************************************************ */ - -/** - * Global timer support. Simplifies javascript intervals for objects. - * - * @event interval {qx.event.type.Event} - */ -qx.OO.defineClass("qx.client.Timer", qx.core.Target, -function(vInterval) -{ - qx.core.Target.call(this); - - this.setEnabled(false); - - if (vInterval != null) { - this.setInterval(vInterval); - } - - // Object wrapper to timer event - var o = this; - this.__oninterval = function() { o._oninterval(); } -}); - -qx.OO.addProperty({ name : "interval", type : "number", defaultValue : 1000 }); - -qx.Proto._intervalHandle = null; - - - -/* ---------------------------------------------------------------------------- - MODIFIER ---------------------------------------------------------------------------- -*/ - -qx.Proto._modifyEnabled = function(propValue, propOldValue, propData) -{ - if (propOldValue) - { - window.clearInterval(this._intervalHandle); - this._intervalHandle = null; - } - else if (propValue) - { - this._intervalHandle = window.setInterval(this.__oninterval, this.getInterval()); - } - - return true; -} - - - - -/* ---------------------------------------------------------------------------- - USER-ACCESS ---------------------------------------------------------------------------- -*/ - -qx.Proto.start = function() { - this.setEnabled(true); -} - -qx.Proto.startWith = function(vInterval) -{ - this.setInterval(vInterval); - this.start(); -} - -qx.Proto.stop = function() { - this.setEnabled(false); -} - -qx.Proto.restart = function() -{ - this.stop(); - this.start(); -} - -qx.Proto.restartWith = function(vInterval) -{ - this.stop(); - this.startWith(vInterval); -} - - - - -/* ---------------------------------------------------------------------------- - EVENT-MAPPER ---------------------------------------------------------------------------- -*/ - -qx.Proto._oninterval = function() -{ - if (this.getEnabled()) { - this.createDispatchEvent("interval"); - } -} - - - - - -/* ---------------------------------------------------------------------------- - DISPOSER ---------------------------------------------------------------------------- -*/ - -qx.Proto.dispose = function() -{ - if(this.getDisposed()) { - return; - } - - // Stop interval - this.stop(); - - // Clear handle - if (this._intervalHandler) - { - window.clearInterval(this._intervalHandle); - this._intervalHandler = null; - } - - // Clear object wrapper function - this.__oninterval = null; - - // Call qx.core.Target to do the other dispose work - return qx.core.Target.prototype.dispose.call(this); -} - - - - - -/* ---------------------------------------------------------------------------- - HELPER ---------------------------------------------------------------------------- -*/ - -qx.client.Timer.once = function(vFunction, vObject, vTimeout) -{ - // Create time instance - var vTimer = new qx.client.Timer(vTimeout); - - // Add event listener to interval - vTimer.addEventListener("interval", function(e) - { - vFunction.call(vObject, e); - vTimer.dispose(); - - vObject = null; - }, vObject); - - // Directly start timer - vTimer.start(); -} |