You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(10) |
Jul
(24) |
Aug
(93) |
Sep
(261) |
Oct
(257) |
Nov
(218) |
Dec
(95) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(184) |
Feb
(87) |
Mar
(155) |
Apr
(398) |
May
(201) |
Jun
(35) |
Jul
(68) |
Aug
(92) |
Sep
(52) |
Oct
(111) |
Nov
(135) |
Dec
(116) |
2009 |
Jan
(225) |
Feb
(204) |
Mar
(113) |
Apr
(137) |
May
(220) |
Jun
(199) |
Jul
(196) |
Aug
(98) |
Sep
(100) |
Oct
(179) |
Nov
(164) |
Dec
(72) |
2010 |
Jan
(59) |
Feb
(61) |
Mar
(64) |
Apr
(159) |
May
(107) |
Jun
(252) |
Jul
(180) |
Aug
(96) |
Sep
(82) |
Oct
(58) |
Nov
(43) |
Dec
(53) |
2011 |
Jan
(39) |
Feb
(18) |
Mar
(33) |
Apr
(66) |
May
(48) |
Jun
(124) |
Jul
(112) |
Aug
(62) |
Sep
(45) |
Oct
(102) |
Nov
(47) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(18) |
Mar
(1) |
Apr
(5) |
May
(18) |
Jun
(13) |
Jul
(9) |
Aug
(38) |
Sep
(3) |
Oct
(7) |
Nov
(24) |
Dec
(6) |
2013 |
Jan
(1) |
Feb
(14) |
Mar
(1) |
Apr
(2) |
May
(3) |
Jun
(4) |
Jul
(9) |
Aug
(4) |
Sep
(7) |
Oct
|
Nov
(1) |
Dec
(4) |
2014 |
Jan
(9) |
Feb
(2) |
Mar
|
Apr
|
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Revision: 21580 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21580&view=rev Author: spackers Date: 2011-11-07 14:18:27 +0000 (Mon, 07 Nov 2011) Log Message: ----------- made _readProxyObject public Modified Paths: -------------- trunk/qooxdoo-contrib/ServerObjects/branches/qx-1.4/client/qso-lib/source/class/com.zenesis.qx.remote/ProxyManager.js Modified: trunk/qooxdoo-contrib/ServerObjects/branches/qx-1.4/client/qso-lib/source/class/com.zenesis.qx.remote/ProxyManager.js =================================================================== --- trunk/qooxdoo-contrib/ServerObjects/branches/qx-1.4/client/qso-lib/source/class/com.zenesis.qx.remote/ProxyManager.js 2011-11-03 21:52:33 UTC (rev 21579) +++ trunk/qooxdoo-contrib/ServerObjects/branches/qx-1.4/client/qso-lib/source/class/com.zenesis.qx.remote/ProxyManager.js 2011-11-07 14:18:27 UTC (rev 21580) @@ -229,7 +229,7 @@ // Init or Function return if (type == "bootstrap" || type == "return") { qx.core.Assert.assertNull(result, "Multiple function returns in data from server"); - result = this._readProxyObject(elem.data); + result = this.readProxyObject(elem.data); // An exception was thrown } else if (type == "exception") { @@ -248,9 +248,9 @@ // Setting a property failed with an exception - change the value back and handle the exception } else if (type == "restore") { - var obj = this._readProxyObject(elem.object); + var obj = this.readProxyObject(elem.object); try { - var value = this._readProxyObject(elem.data.oldValue); + var value = this.readProxyObject(elem.data.oldValue); this.setPropertyValueFromServer(obj, elem.name, value); } catch(e) { // Ignore it - we were only trying to recover from a server exception @@ -259,13 +259,13 @@ // A server property value changed, update the client } else if (type == "set") { - var obj = this._readProxyObject(elem.object); - var value = this._readProxyObject(elem.data); + var obj = this.readProxyObject(elem.object); + var value = this.readProxyObject(elem.data); this.setPropertyValueFromServer(obj, elem.name, value); // An on demand server property value changed, clear the cache } else if (type == "expire") { - var obj = this._readProxyObject(elem.object); + var obj = this.readProxyObject(elem.object); var upname = qx.lang.String.firstUp(elem.name); obj["expire" + upname](false); @@ -275,8 +275,8 @@ // An event was fired on the server } else if (type == "fire") { - var obj = this._readProxyObject(elem.object); - var eventData = elem.data ? this._readProxyObject(elem.data) : null; + var obj = this.readProxyObject(elem.object); + var eventData = elem.data ? this.readProxyObject(elem.data) : null; obj.fireDataEvent(elem.name, eventData); // Explicitly load a type onto the client @@ -310,7 +310,7 @@ * Reads a proxy object from the server and either creates a new * object (creating classes as required) or returns an existing one */ - _readProxyObject: function(data) { + readProxyObject: function(data) { if (typeof data == "undefined" || data === null) return null; var result = null; @@ -331,7 +331,7 @@ else { result = []; for (var i = 0; i < data.length; i++) - result[i] = this._readProxyObject(data[i]); + result[i] = this.readProxyObject(data[i]); } // Object - is it a server object or a map? @@ -356,7 +356,7 @@ // if (propName == "resources" || propName == "questions") // debugger; if (propValue) - propValue = this._readProxyObject(propValue); + propValue = this.readProxyObject(propValue); this.setPropertyValueFromServer(result, propName, propValue); } } @@ -368,7 +368,7 @@ for (var propName in data.values) { var propValue = data.values[propName]; if (propValue) - propValue = this._readProxyObject(propValue); + propValue = this.readProxyObject(propValue); this.setPropertyValueFromServer(result, propName, propValue); } } @@ -381,7 +381,7 @@ if (!result.$$proxy.cachedResults) result.$$proxy.cachedResults = {}; if (value) - value = this._readProxyObject(value); + value = this.readProxyObject(value); result.$$proxy.cachedResults[methodName] = value; } } @@ -409,7 +409,7 @@ for (var propName in data) { var propValue = data[propName]; if (propValue) - propValue = this._readProxyObject(propValue); + propValue = this.readProxyObject(propValue); result[propName] = propValue; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <oe...@us...> - 2011-11-03 21:52:40
|
Revision: 21579 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21579&view=rev Author: oetiker Date: 2011-11-03 21:52:33 +0000 (Thu, 03 Nov 2011) Log Message: ----------- it may be that there is no content element yet either Modified Paths: -------------- trunk/qooxdoo-contrib/QxDyGraphs/trunk/source/class/qxdygraphs/Plot.js Modified: trunk/qooxdoo-contrib/QxDyGraphs/trunk/source/class/qxdygraphs/Plot.js =================================================================== --- trunk/qooxdoo-contrib/QxDyGraphs/trunk/source/class/qxdygraphs/Plot.js 2011-10-29 16:47:50 UTC (rev 21578) +++ trunk/qooxdoo-contrib/QxDyGraphs/trunk/source/class/qxdygraphs/Plot.js 2011-11-03 21:52:33 UTC (rev 21579) @@ -150,7 +150,10 @@ * @lint ignoreUndefined(Dygraph) */ __addCanvas: function(data,options){ - var el = this.getContentElement().getDomElement(); + var el = this.getContentElement(); + if (el){ + el = el.getDomElement(); + } /* make sure the element is here yet. Else wait until things show up */ if (el == null){ this.addListenerOnce('appear',qx.lang.Function.bind(this.__addCanvas,this,data,options),this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-10-29 16:47:56
|
Revision: 21578 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21578&view=rev Author: derrell Date: 2011-10-29 16:47:50 +0000 (Sat, 29 Oct 2011) Log Message: ----------- Added note about qooxdoo-specific JSON date formatting no longer working Modified Paths: -------------- trunk/qooxdoo-contrib/RpcExample/source/class/rpcexample/Application.js Modified: trunk/qooxdoo-contrib/RpcExample/source/class/rpcexample/Application.js =================================================================== --- trunk/qooxdoo-contrib/RpcExample/source/class/rpcexample/Application.js 2011-10-29 16:47:15 UTC (rev 21577) +++ trunk/qooxdoo-contrib/RpcExample/source/class/rpcexample/Application.js 2011-10-29 16:47:50 UTC (rev 21578) @@ -399,12 +399,19 @@ { // This is an old application that still requires qooxdoo-specific // formatting and parsing of dates. + // + // FIXME: THIS CODE IS BORKED. qx.util.Json is gone. It was the class + // that contained the CONVERT_DATES flag and had code to handle the old + // qooxdoo-specific formatting and parsing of dates. qx.lang.Json has no + // such flag. It does provide reviver functions that could be used for + // the purpose, so this code should either be eliminated or converted to + // use reviver functions. var convertDates = new qx.ui.form.CheckBox("Old-style 'qooxdoo' dates?"); - convertDates.setValue(qx.util.Json.CONVERT_DATES); + convertDates.setValue(qx.lang.Json.CONVERT_DATES); convertDates.addListener("changeValue", function(e) { - qx.util.Json.CONVERT_DATES = e.getData(); + qx.lang.Json.CONVERT_DATES = e.getData(); }); page.add(convertDates); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-10-29 16:47:21
|
Revision: 21577 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21577&view=rev Author: derrell Date: 2011-10-29 16:47:15 +0000 (Sat, 29 Oct 2011) Log Message: ----------- no such thing as 'settings' any more. it's 'environment' now. Modified Paths: -------------- trunk/qooxdoo-contrib/RpcExample/config.json Modified: trunk/qooxdoo-contrib/RpcExample/config.json =================================================================== --- trunk/qooxdoo-contrib/RpcExample/config.json 2011-10-26 17:17:44 UTC (rev 21576) +++ trunk/qooxdoo-contrib/RpcExample/config.json 2011-10-29 16:47:15 UTC (rev 21577) @@ -23,7 +23,7 @@ { "common" : { - "settings" : + "environment" : { "qx.ioRemoteDebug" : "on", "rpcexample.URL" : "../../RpcPhp/1.2.0/services/index.php" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-26 17:17:51
|
Revision: 21576 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21576&view=rev Author: spackers Date: 2011-10-26 17:17:44 +0000 (Wed, 26 Oct 2011) Log Message: ----------- check dates for equivalence before sending to server, plus fix for _applyProperty without oldValue and name Modified Paths: -------------- trunk/qooxdoo-contrib/ServerObjects/trunk/client/qso-lib/source/class/com/zenesis/qx/remote/ProxyManager.js Modified: trunk/qooxdoo-contrib/ServerObjects/trunk/client/qso-lib/source/class/com/zenesis/qx/remote/ProxyManager.js =================================================================== --- trunk/qooxdoo-contrib/ServerObjects/trunk/client/qso-lib/source/class/com/zenesis/qx/remote/ProxyManager.js 2011-10-24 07:43:31 UTC (rev 21575) +++ trunk/qooxdoo-contrib/ServerObjects/trunk/client/qso-lib/source/class/com/zenesis/qx/remote/ProxyManager.js 2011-10-26 17:17:44 UTC (rev 21576) @@ -75,7 +75,7 @@ isDate: function(value) { // Added "value !== null" because IE throws an exception "Object expected" // by executing "value instanceof Array" if value is a DOM element that - // doesn't exist. It seems that there is a internal different between a + // doesn't exist. It seems that there is a internal difference between a // JavaScript null and a null returned from calling DOM. // e.q. by document.getElementById("ReturnedNull"). return ( @@ -523,7 +523,7 @@ // Create an apply method var applyName = "_apply" + qx.lang.String.firstUp(propName); toDef.apply = applyName; - def.members[applyName] = new Function('value', 'this._applyProperty("' + propName + '", value);'); + def.members[applyName] = new Function('value', 'oldValue', 'name', 'this._applyProperty("' + propName + '", value, oldValue, name);'); // onDemand properties - patch it later if (fromDef.onDemand) @@ -738,6 +738,10 @@ if (this.isSettingProperty(serverObject, propertyName)) return; + // Skip changing date instances if they are equivalent + if (value instanceof Date && oldValue instanceof Date && value.getTime() == oldValue.getTime()) + return; + var data = { cmd: "set", serverId: serverObject.getServerId(), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-24 07:43:38
|
Revision: 21575 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21575&view=rev Author: spackers Date: 2011-10-24 07:43:31 +0000 (Mon, 24 Oct 2011) Log Message: ----------- keyboard support Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-10-24 07:26:23 UTC (rev 21574) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-10-24 07:43:31 UTC (rev 21575) @@ -145,16 +145,19 @@ this.__fixupSize(widget); } }, this); - var keydownId = widget.addListener("keydown", function(evt) { - var data = this.__widgetsData[widget.toHashCode()]; - if (data && data.inputElement) { - var dom = data.inputElement.getDomElement(); - if (dom && typeof dom.click == "function") { - dom.focus(); - dom.click(); + var keydownId = null; + if (qx.core.Environment.get("engine.name") != "gecko") { + keydownId = widget.addListener("keydown", function(evt) { + var data = this.__widgetsData[widget.toHashCode()]; + if (data && data.inputElement) { + var dom = data.inputElement.getDomElement(); + if (dom && typeof dom.click == "function") { + //dom.focus(); + dom.click(); + } } - } - }, this); + }, this); + } this.__widgetsData[widget.toHashCode()] = { appearId: appearId, keydownId: keydownId, widget: widget, inputElement: null }; widget.addListener("resize", function(evt) { this.__fixupSize(widget); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-24 07:26:29
|
Revision: 21574 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21574&view=rev Author: spackers Date: 2011-10-24 07:26:23 +0000 (Mon, 24 Oct 2011) Log Message: ----------- added partial support for keyboard activation & fixed lint warning Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-10-23 21:00:19 UTC (rev 21573) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-10-24 07:26:23 UTC (rev 21574) @@ -135,17 +135,27 @@ * for implementing for other widgets) */ addWidget: function(widget) { - var id = widget.addListenerOnce("appear", function(evt) { + var appearId = widget.addListenerOnce("appear", function(evt) { var data = this.__widgetsData[widget.toHashCode()]; if (data) { - data.listenerId = null; + data.appearId = null; var container = widget.getContainerElement(); container.setStyle("overflow", "hidden"); container.addAt(this._createInputElement(widget), 0); this.__fixupSize(widget); } }, this); - this.__widgetsData[widget.toHashCode()] = { listenerId: id, widget: widget, inputElement: null }; + var keydownId = widget.addListener("keydown", function(evt) { + var data = this.__widgetsData[widget.toHashCode()]; + if (data && data.inputElement) { + var dom = data.inputElement.getDomElement(); + if (dom && typeof dom.click == "function") { + dom.focus(); + dom.click(); + } + } + }, this); + this.__widgetsData[widget.toHashCode()] = { appearId: appearId, keydownId: keydownId, widget: widget, inputElement: null }; widget.addListener("resize", function(evt) { this.__fixupSize(widget); }, this); @@ -158,8 +168,10 @@ removeWidget: function(widget) { var data = this.__widgetsData[widget.toHashCode()]; if (data) { - if (data.listenerId) - widget.removeListener(data.listenerId); + if (data.appearId) + widget.removeListener(data.appearId); + if (data.keydownId) + widget.removeListener(data.keydownId); delete this.__widgetsData[widget.toHashCode()]; } }, Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-10-23 21:00:19 UTC (rev 21573) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-10-24 07:26:23 UTC (rev 21574) @@ -27,6 +27,7 @@ ************************************************************************/ /* #ignore(File) +#ignore(FormData) */ /** * Implementation of AbstractHandler that uses XMLHttpRequest; this is based on work This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-10-23 21:00:26
|
Revision: 21573 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21573&view=rev Author: derrell Date: 2011-10-23 21:00:19 +0000 (Sun, 23 Oct 2011) Log Message: ----------- correct spelling of singular of criteria Modified Paths: -------------- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Dbif.js Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js 2011-10-22 09:32:28 UTC (rev 21572) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js 2011-10-23 21:00:19 UTC (rev 21573) @@ -133,29 +133,29 @@ // If they're not asking for all objects, build a criteria predicate. if (searchCriteria) { - (function(criterium) + (function(criterion) { var filterOp; - switch(criterium.type) + switch(criterion.type) { case "op": - switch(criterium.method) + switch(criterion.method) { case "and": // Generate the conditions specified in the children - criterium.children.forEach(arguments.callee); + criterion.children.forEach(arguments.callee); break; default: - throw new Error("Unrecognized criterium method: " + - criterium.method); + throw new Error("Unrecognized criterion method: " + + criterion.method); } break; case "element": // Map the specified filter operator to the db's filter ops. - filterOp = criterium.filterOp || "="; + filterOp = criterion.filterOp || "="; switch(filterOp) { case "<=": @@ -183,29 +183,29 @@ break; default: - throw new Error("Unrecognized logical operation: " + - criterium.filterOp); + throw new Error("Unrecognized comparison operation: " + + criterion.filterOp); } // Add a filter using the provided parameters - if (fields[criterium.field] == "Integer" || - fields[criterium.field] == "Key") + if (fields[criterion.field] == "Integer" || + fields[criterion.field] == "Key") { - query.addFilter(criterium.field, + query.addFilter(criterion.field, filterOp, - java.lang.Integer(criterium.value)); + java.lang.Integer(criterion.value)); } else { - query.addFilter(criterium.field, + query.addFilter(criterion.field, filterOp, - criterium.value); + criterion.value); } break; default: - throw new Error("Unrceognized criterium type: " + - criterium.type); + throw new Error("Unrceognized criterion type: " + + criterion.type); } })(searchCriteria); } @@ -219,29 +219,29 @@ { // ... then go through the criteria list and handle each. resultCriteria.forEach( - function(criterium) + function(criterion) { - switch(criterium.type) + switch(criterion.type) { case "limit": - options.limit(criterium.value); + options.limit(criterion.value); break; case "offset": - options.offset(criterium.value); + options.offset(criterion.value); break; case "sort": - query.addSort(criterium.field, + query.addSort(criterion.field, { "asc" : Query.SortDirection.ASCENDING, "desc" : Query.SortDirection.DESCENDING - }[criterium.order]); + }[criterion.order]); break; default: - throw new Error("Unrecognized result criterium type: " + - criterium.type); + throw new Error("Unrecognized result criterion type: " + + criterion.type); } }); } Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Dbif.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Dbif.js 2011-10-22 09:32:28 UTC (rev 21572) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Dbif.js 2011-10-23 21:00:19 UTC (rev 21573) @@ -137,7 +137,7 @@ if (searchCriteria) { builtCriteria = - (function(criterium) + (function(criterion) { var i; var ret = ""; @@ -167,20 +167,20 @@ throw new Error("Unexpected filter operation: " + filterOp); } - })(criterium.filterOp); + })(criterion.filterOp); - switch(criterium.type) + switch(criterion.type) { case "op": - switch(criterium.method) + switch(criterion.method) { case "and": // Generate the conditions ret += "("; - for (i = 0; i < criterium.children.length; i++) + for (i = 0; i < criterion.children.length; i++) { - ret += arguments.callee(criterium.children[i]); - if (i < criterium.children.length - 1) + ret += arguments.callee(criterion.children[i]); + if (i < criterion.children.length - 1) { ret += " && "; } @@ -189,63 +189,63 @@ break; default: - throw new Error("Unrecognized criterium method: " + - criterium.method); + throw new Error("Unrecognized criterion method: " + + criterion.method); } break; case "element": // Determine the type of this field propertyTypes = rpcjs.dbif.Entity.propertyTypes; - switch(propertyTypes[type].fields[criterium.field]) + switch(propertyTypes[type].fields[criterion.field]) { case "String": case "LongString": case "Date": - if (typeof criterium.value != "string") + if (typeof criterion.value != "string") { qx.Bootstrap.warn( - "Expected criterium value to be string, " + - "got " + typeof(criterium.value)); + "Expected criterion value to be string, " + + "got " + typeof(criterion.value)); ret += "false"; } else { ret += - "entry[\"" + criterium.field + "\"] " + filterOp + - "\"" + criterium.value + "\" "; + "entry[\"" + criterion.field + "\"] " + filterOp + + "\"" + criterion.value + "\" "; } break; case "Key": case "Integer": case "Float": - if (typeof criterium.value != "number") + if (typeof criterion.value != "number") { qx.Bootstrap.warn( - "Expected criterium value to be number, " + - "got " + typeof(criterium.value)); + "Expected criterion value to be number, " + + "got " + typeof(criterion.value)); ret += "false"; } else { ret += - "entry[\"" + criterium.field + "\"] " + filterOp + - criterium.value; + "entry[\"" + criterion.field + "\"] " + filterOp + + criterion.value; } break; case "KeyArray": case "StringArray": case "LongStringArray": - if (typeof criterium.value != "string") + if (typeof criterion.value != "string") { qx.Bootstrap.warn( - "Expected criterium value to be string, " + - "got " + typeof(criterium.value)); + "Expected criterion value to be string, " + + "got " + typeof(criterion.value)); ret += "false"; } - else if (criterium.filterOp) + else if (criterion.filterOp) { qx.Bootstrap.warn( "Filter operations can not be applied to array types"); @@ -254,21 +254,21 @@ { ret += "qx.lang.Array.contains(entry[\"" + - criterium.field + "\"], " + - "\"" + criterium.value + "\")"; + criterion.field + "\"], " + + "\"" + criterion.value + "\")"; } break; case "IntegerArray": case "FloatArray": - if (typeof criterium.value != "number") + if (typeof criterion.value != "number") { qx.Bootstrap.warn( - "Expected criterium value to be string, " + - "got " + typeof(criterium.value)); + "Expected criterion value to be string, " + + "got " + typeof(criterion.value)); ret += "false"; } - else if (criterium.filterOp) + else if (criterion.filterOp) { qx.Bootstrap.warn( "Filter operations can not be applied to array types"); @@ -277,7 +277,7 @@ { ret += "qx.lang.Array.contains(entry[\"" + - criterium.field + "\"], " + criterium.value + ")"; + criterion.field + "\"], " + criterion.value + ")"; } break; @@ -287,8 +287,8 @@ break; default: - throw new Error("Unrecognized criterium type: " + - criterium.type); + throw new Error("Unrecognized criterion type: " + + criterion.type); } return ret; @@ -313,12 +313,12 @@ { // ... then go through the criteria list and handle each. resultCriteria.forEach( - function(criterium) + function(criterion) { - switch(criterium.type) + switch(criterion.type) { case "limit": - limit = criterium.value; + limit = criterion.value; if (limit <= 0) { throw new Error("Request for limit <= 0"); @@ -326,7 +326,7 @@ break; case "offset": - offset = criterium.value; + offset = criterion.value; if (offset < 0) { throw new Error("Request for offset < 0"); @@ -336,15 +336,15 @@ case "sort": builtSort = [ "var v1, v2;" ]; - builtSort.push("v1 = a['" + criterium.field + "'];"); - builtSort.push("v2 = b['" + criterium.field + "'];"); + builtSort.push("v1 = a['" + criterion.field + "'];"); + builtSort.push("v2 = b['" + criterion.field + "'];"); - if ( criterium.order === "asc" ) + if ( criterion.order === "asc" ) { builtSort.push("if (v1 < v2) return -1;"); builtSort.push("if (v1 > v2) return 1;"); } - else if (criterium.order === "desc" ) + else if (criterion.order === "desc" ) { builtSort.push("if (v1 > v2) return -1;"); builtSort.push("if (v1 < v2) return 1;"); @@ -352,8 +352,8 @@ else { throw new Error( - "Unexpected sort order for " + criterium.field + ": " + - criterium.order); + "Unexpected sort order for " + criterion.field + ": " + + criterion.order); } builtSort.push("return 0;"); @@ -361,8 +361,8 @@ break; default: - throw new Error("Unrecognized result criterium type: " + - criterium.type); + throw new Error("Unrecognized result criterion type: " + + criterion.type); } }); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-22 09:32:35
|
Revision: 21572 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21572&view=rev Author: sandersson Date: 2011-10-22 09:32:28 +0000 (Sat, 22 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/bom/ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/bom/client/ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-10-20 19:26:36 UTC (rev 21571) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-10-22 09:32:28 UTC (rev 21572) @@ -98,5 +98,6 @@ "wizard" : "widget", "wizard-page" : "groupbox" + } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-10-20 19:26:42
|
Revision: 21571 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21571&view=rev Author: derrell Date: 2011-10-20 19:26:36 +0000 (Thu, 20 Oct 2011) Log Message: ----------- correct singular of criteria; shorten lines for latex output Modified Paths: -------------- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/dbif/Entity.js trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Rpc.js Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/dbif/Entity.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/dbif/Entity.js 2011-10-19 20:22:12 UTC (rev 21570) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/dbif/Entity.js 2011-10-20 19:26:36 UTC (rev 21571) @@ -326,7 +326,7 @@ keyField, canonicalize) { - var name; + var pn; // property name // If there's no key field name specified... if (! keyField) @@ -339,11 +339,11 @@ // Add the canonicalize properties to the property list if (canonicalize) { - for (name in canonicalize) + for (pn in canonicalize) { - // Add the property in which to store the canonicalized value to the - // list of database properties. - propertyTypes[canonicalize[name].prop] = canonicalize[name].type; + // Add the property in which to store the canonicalized value + // to the list of database properties. + propertyTypes[canonicalize[pn].prop] = canonicalize[pn].type; } } @@ -442,7 +442,8 @@ } // Gain easy access to the canonicalize map. - canonicalize = rpcjs.dbif.Entity.propertyTypes[entityType].canonicalize; + canonicalize = + rpcjs.dbif.Entity.propertyTypes[entityType].canonicalize; if (canonicalize) { // Get a list of the fields to be mapped @@ -453,41 +454,42 @@ if (canonicalize && searchCriteria) { // Yup. Rebuild the search criteria, replacing non-canonicalized - // fields with their peer canonical fields. Start with a clone of the - // original criteria, so we don't modify the caller's map. + // fields with their peer canonical fields. Start with a clone + // of the original criteria, so we don't modify the caller's map. searchCriteria = qx.util.Serializer.toNativeObject(searchCriteria); // Recursively descend through the search criteria, replacing // non-canonicalized field names with their canonical peer. - (function replaceCanonFields(criterium) + (function replaceCanonFields(criterion) { - // Null or undefined means retrieve all objects. Nothing for us to do - if (! criterium) + // Null or undefined means retrieve all objects. + if (! criterion) { + // Nothing for us to do return; } - // Is this an element criterium (type="element" or no type field)? - if (! criterium.type || criterium.type == "element") + // element criterion (type="element" or no type field)? + if (! criterion.type || criterion.type == "element") { // Is this field name one to be canonicalized? - if (qx.lang.Array.contains(canonFields, criterium.field)) + if (qx.lang.Array.contains(canonFields, criterion.field)) { // Replace the value with the canonical version - criterium.value = - canonicalize[criterium.field].func(criterium.value); + criterion.value = + canonicalize[criterion.field].func(criterion.value); // Replace the field name with its canonical peer - criterium.field = canonicalize[criterium.field].prop; + criterion.field = canonicalize[criterion.field].prop; } } - else if (criterium.children) + else if (criterion.children) { // If there are children, deal with each of them. - criterium.children.forEach( + criterion.children.forEach( function(child) { - replaceCanonFields(criterium[child]); + replaceCanonFields(criterion[child]); }); } })(searchCriteria); @@ -502,18 +504,18 @@ if (resultCriteria) { resultCriteria.forEach( - function(criterium) + function(criterion) { - if (criterium.type == "option") + if (criterion.type == "option") { - switch(criterium.name) + switch(criterion.name) { case "stripCanon": // strip canonical fields from result - bStripCanon = criterium.value; + bStripCanon = criterion.value; break; default: - this.warn("Unrecognized option name: " + criterium.name); + this.warn("Unrecognized option name: " + criterion.name); break; } } Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Rpc.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Rpc.js 2011-10-19 20:22:12 UTC (rev 21570) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Rpc.js 2011-10-20 19:26:36 UTC (rev 21571) @@ -59,8 +59,8 @@ // Save the URL this.setUrl(url); - // Register ourself with the simulation transport, as a handler for the - // specified URL. + // Register ourself with the simulation transport, as a handler + // for the specified URL. rpcjs.sim.Simulator.registerHandler( qx.lang.Function.bind(this.__processRequest, this)); }, @@ -102,7 +102,7 @@ // Make sure we can handle this request if (request.url != this.getUrl()) { - // We don't support this one. Response header status was preset for us. + // We don't support this one. Response header status was preset. return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-19 20:22:19
|
Revision: 21570 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21570&view=rev Author: sandersson Date: 2011-10-19 20:22:12 +0000 (Wed, 19 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Window.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/wizard/IPage.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/wizard/Wizard.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/indicator/ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js 2011-10-18 13:17:58 UTC (rev 21569) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js 2011-10-19 20:22:12 UTC (rev 21570) @@ -79,6 +79,7 @@ dialog.setLayout(new qx.ui.layout.Canvas()); dialog.setHeight(100); dialog.setWidth(100); + dialog.setBlocking(true); dialog.add(label); dialog.moveTo(110, 60); dialog.show(); Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-10-18 13:17:58 UTC (rev 21569) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-10-19 20:22:12 UTC (rev 21570) @@ -84,6 +84,14 @@ /* --------------------------------------------------------------------------- + PROGRESSBAR + --------------------------------------------------------------------------- + */ + + "progressbar/status" : "label", + + /* + --------------------------------------------------------------------------- WIZARD --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-10-18 13:17:58 UTC (rev 21569) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-10-19 20:22:12 UTC (rev 21570) @@ -89,6 +89,14 @@ /* --------------------------------------------------------------------------- + PROGRESSBAR + --------------------------------------------------------------------------- + */ + + "progressbar/status" : "label", + + /* + --------------------------------------------------------------------------- WIZARD --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js 2011-10-18 13:17:58 UTC (rev 21569) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js 2011-10-19 20:22:12 UTC (rev 21570) @@ -23,6 +23,7 @@ qx.Class.define("qxe.ui.dialog.Dialog", { extend : qxe.ui.window.DecoratedWindow, + include : qx.ui.core.MBlocker, /* @@ -80,29 +81,31 @@ /** * Block the ui underneath the dialog while displayed. */ - blocker : + blocking : { check : "Boolean", init : false - }, + } +//, /** * Blocker color */ - blockerColor : +/* blockerColor : { check : "String", init : "black" }, - +*/ /** * Blocker opacity */ - blockerOpacity : +/* blockerOpacity : { check : "Number", init : 0.5 } +*/ }, members : @@ -138,12 +141,12 @@ // Augmented show : function() { - if(this.isBlocker()) + if(this.getBlocking()) { - var root = this.getApplicationRoot(); - root.setBlockerOpacity(this.getBlockerOpacity()); - root.setBlockerColor(this.getBlockerColor()); - root.blockContent(this.getZIndex() - 1); +// var root = this.getApplicationRoot(); +// root.setBlockerOpacity(this.getBlockerOpacity()); +// root.setBlockerColor(this.getBlockerColor()); + this.blockContent(this.getZIndex() - 1); } this.base(arguments); @@ -152,9 +155,10 @@ // Augmented hide : function() { - if(this.isBlocker()) + if(this.isContentBlocked()) { - this.getApplicationRoot().unblockContent(); +// this.getApplicationRoot().unblockContent(); + this.unblockContent(); } this.base(arguments); Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Window.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Window.js 2011-10-18 13:17:58 UTC (rev 21569) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Window.js 2011-10-19 20:22:12 UTC (rev 21570) @@ -97,9 +97,10 @@ DEFAULT_MANAGER_CLASS : qx.ui.window.Manager }, + /* ***************************************************************************** - PROPERTIES + EVENTS ***************************************************************************** */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/wizard/IPage.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/wizard/IPage.js 2011-10-18 13:17:58 UTC (rev 21569) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/wizard/IPage.js 2011-10-19 20:22:12 UTC (rev 21570) @@ -22,5 +22,14 @@ { members : { + /** + * Validate fields of page. + * + * @param wizard {qxe.ui.wizard.Wizard} Wizard parent object. + */ + validate : function(wizard) + { +// this.assert + } } }); Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/wizard/Wizard.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/wizard/Wizard.js 2011-10-18 13:17:58 UTC (rev 21569) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/wizard/Wizard.js 2011-10-19 20:22:12 UTC (rev 21570) @@ -481,6 +481,29 @@ }, /** + * Event handler for <code>onInput</code>. + * + * @param e {qx.event.type.Data} Data event. + */ + _onInput : function(e) + { + var fields = this.getValidator().getItems(); + var len = fields.length; + var counter = 0; + + for(var index=0; index<len; index++) + { + if(fields[index].item.getValue()) + { + counter++; + } + } + + this.getChildControl("reset-button").setEnabled(counter > 0); + this.getChildControl("submit-button").setEnabled(counter == len); + }, + + /** * Event handler for <code>changeSelection</code>. * * @param e {qx.event.type.Data} Data event. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-18 13:18:06
|
Revision: 21569 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21569&view=rev Author: spackers Date: 2011-10-18 13:17:58 +0000 (Tue, 18 Oct 2011) Log Message: ----------- remove testing url Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js 2011-10-18 11:50:48 UTC (rev 21568) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js 2011-10-18 13:17:58 UTC (rev 21569) @@ -76,7 +76,7 @@ // attached, and "/demoupload" is the path files will be uploaded to (i.e. it's the value used // for the form's action attribute) // - var uploader = new com.zenesis.qx.upload.UploadMgr(btn, "http://my.katiemoore.me.uk:8080/demoupload");//"http://www.zenesis.com/demoupload"); + var uploader = new com.zenesis.qx.upload.UploadMgr(btn, "http://www.zenesis.com/demoupload"); uploader.getUploadHandler().addParam("myParam", "test"); uploader.addListener("addFile", function(evt) { var file = evt.getData(), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-18 11:50:54
|
Revision: 21568 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21568&view=rev Author: spackers Date: 2011-10-18 11:50:48 +0000 (Tue, 18 Oct 2011) Log Message: ----------- implemented multipart/form-data on all browsers Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-10-18 11:08:01 UTC (rev 21567) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-10-18 11:50:48 UTC (rev 21568) @@ -106,27 +106,26 @@ xhr.send(fd); } else { - // build query string - var action = this._getUploader().getUploadUrl(), - params = this.getParams(), - pos = action.indexOf('?'), - addAmpersand = true; - if (pos < 0) { - action += "?"; - addAmpersand = false; - } + var boundary = "--------FormData" + Math.random(), + body = "", + action = this._getUploader().getUploadUrl(), + params = this.getParams(); for (var name in params) { - if (addAmpersand) - action += "&"; - else - addAmpersand = true; - action += name + "=" + encodeURIComponent(params[name]); + body += "--" + boundary + "\r\n"; + body += "Content-Disposition: form-data; name=\""+ name +"\";\r\n\r\n"; + body += params[name] + "\r\n"; } + body += "--" + boundary + "\r\n"; + body += "Content-Disposition: form-data; name=\"file\"; filename=\"" + file.getFilename() + "\"\r\n"; + body += "Content-Type: "+ (file.getBrowserObject().type||"application/octet-stream") +"\r\n\r\n"; + body += file.getBrowserObject().getAsBinary() + "\r\n"; + body += "--" + boundary + "--"; + xhr.open("POST", action, true); xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xhr.setRequestHeader("X-File-Name", encodeURIComponent(file.getFilename())); - xhr.setRequestHeader("Content-Type", "application/octet-stream"); - xhr.send(file.getBrowserObject()); + xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundary); + xhr.send(body); } }, @@ -154,8 +153,7 @@ var isSupported = 'multiple' in input && typeof File != "undefined" && - typeof (new XMLHttpRequest()).upload != "undefined" && - (!requireMultipartFormData || typeof FormData == "function"); + typeof (new XMLHttpRequest()).upload != "undefined"; return isSupported; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-18 11:08:13
|
Revision: 21567 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21567&view=rev Author: spackers Date: 2011-10-18 11:08:01 +0000 (Tue, 18 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js 2011-10-18 10:30:33 UTC (rev 21566) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js 2011-10-18 11:08:01 UTC (rev 21567) @@ -76,7 +76,7 @@ // attached, and "/demoupload" is the path files will be uploaded to (i.e. it's the value used // for the form's action attribute) // - var uploader = new com.zenesis.qx.upload.UploadMgr(btn, "http://www.zenesis.com/demoupload"); + var uploader = new com.zenesis.qx.upload.UploadMgr(btn, "http://my.katiemoore.me.uk:8080/demoupload");//"http://www.zenesis.com/demoupload"); uploader.getUploadHandler().addParam("myParam", "test"); uploader.addListener("addFile", function(evt) { var file = evt.getData(), Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-10-18 10:30:33 UTC (rev 21566) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-10-18 11:08:01 UTC (rev 21567) @@ -44,10 +44,6 @@ this.addWidget(widget); if (uploadUrl) this.setUploadUrl(uploadUrl); - if (com.zenesis.qx.upload.XhrHandler.isSupported()) - this.__uploadHandler = new com.zenesis.qx.upload.XhrHandler(this); - else - this.__uploadHandler = new com.zenesis.qx.upload.FormHandler(this); }, events: { @@ -114,6 +110,17 @@ init: "uploadMgrInput", nullable: false, event: "changeInputNamePrefix" + }, + + /** + * Whether the server can only handle multipart/form-data content type + */ + requireMultipartFormData: { + check: "Boolean", + init: true, + nullable: false, + event: "changeRequireMultipartFormData", + apply: "_applyRequireMultipartFormData" } }, @@ -174,7 +181,7 @@ * @param oldValue */ _applyAutoUpload: function(value, oldValue) { - this.__uploadHandler.beginUploads(); + this.getUploadHandler().beginUploads(); }, /** @@ -191,11 +198,19 @@ }, /** + * Callback for changes to the requireMultipartFormData property + */ + _applyRequireMultipartFormData: function(value, oldValue) { + if (this.__uploadHandler) + throw new Error("Changing the requireMultipartFormData property of " + this + " has no effect once uploads have started"); + }, + + /** * Cancels a file being uploaded * @param file */ cancel: function(file) { - this.__uploadHandler.cancel(file); + this.getUploadHandler().cancel(file); }, /** @@ -203,7 +218,7 @@ * @param file */ cancelAll: function() { - this.__uploadHandler.cancelAll(); + this.getUploadHandler().cancelAll(); }, /** @@ -241,9 +256,9 @@ _onInputChange: function(elem, evt) { var widget = elem.getWidget(); - this.__uploadHandler.addFile(elem.getDomElement()); + this.getUploadHandler().addFile(elem.getDomElement()); if (this.getAutoUpload()) - this.__uploadHandler.beginUploads(); + this.getUploadHandler().beginUploads(); this._resetInputElement(widget); }, @@ -252,6 +267,12 @@ * @returns */ getUploadHandler: function() { + if (!this.__uploadHandler) { + if (com.zenesis.qx.upload.XhrHandler.isSupported(this.isRequireMultipartFormData())) + this.__uploadHandler = new com.zenesis.qx.upload.XhrHandler(this); + else + this.__uploadHandler = new com.zenesis.qx.upload.FormHandler(this); + } return this.__uploadHandler; } } Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-10-18 10:30:33 UTC (rev 21566) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-10-18 11:08:01 UTC (rev 21567) @@ -143,25 +143,21 @@ }, statics: { - __isSupported: null, - /** * Detects whether this handler is support on the current browser * @returns {Boolean} */ - isSupported: function() { - if (this.__isSupported !== null) - return this.__isSupported; - + isSupported: function(requireMultipartFormData) { var input = document.createElement('input'); input.type = 'file'; - this.__isSupported = + var isSupported = 'multiple' in input && typeof File != "undefined" && - typeof (new XMLHttpRequest()).upload != "undefined"; + typeof (new XMLHttpRequest()).upload != "undefined" && + (!requireMultipartFormData || typeof FormData == "function"); - return this.__isSupported; + return isSupported; } } }); \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-18 10:30:40
|
Revision: 21566 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21566&view=rev Author: spackers Date: 2011-10-18 10:30:33 +0000 (Tue, 18 Oct 2011) Log Message: ----------- added fodler exclusions Property Changed: ---------------- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/ trunk/qooxdoo-contrib/UploadMgr/trunk/server/ Property changes on: trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source ___________________________________________________________________ Added: svn:ignore + script Property changes on: trunk/qooxdoo-contrib/UploadMgr/trunk/server ___________________________________________________________________ Added: svn:ignore + uploads This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-18 10:28:37
|
Revision: 21565 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21565&view=rev Author: spackers Date: 2011-10-18 10:28:30 +0000 (Tue, 18 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-10-18 10:26:43 UTC (rev 21564) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-10-18 10:28:30 UTC (rev 21565) @@ -89,28 +89,45 @@ self._onCompleted(file, response); } }; + + if (typeof FormData == "function") { + var fd = new FormData(); + + // build query string + var action = this._getUploader().getUploadUrl(), + params = this.getParams(); + for (var name in params) + fd.append(name, encodeURIComponent(params[name])); + fd.append("file", file.getBrowserObject()); - // build query string - var action = this._getUploader().getUploadUrl(), - params = this.getParams(), - pos = action.indexOf('?'), - addAmpersand = true; - if (pos < 0) { - action += "?"; - addAmpersand = false; + xhr.open("POST", action, true); + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + xhr.setRequestHeader("X-File-Name", encodeURIComponent(file.getFilename())); + xhr.send(fd); + + } else { + // build query string + var action = this._getUploader().getUploadUrl(), + params = this.getParams(), + pos = action.indexOf('?'), + addAmpersand = true; + if (pos < 0) { + action += "?"; + addAmpersand = false; + } + for (var name in params) { + if (addAmpersand) + action += "&"; + else + addAmpersand = true; + action += name + "=" + encodeURIComponent(params[name]); + } + xhr.open("POST", action, true); + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + xhr.setRequestHeader("X-File-Name", encodeURIComponent(file.getFilename())); + xhr.setRequestHeader("Content-Type", "application/octet-stream"); + xhr.send(file.getBrowserObject()); } - for (var name in params) { - if (addAmpersand) - action += "&"; - else - addAmpersand = true; - action += name + "=" + encodeURIComponent(params[name]); - } - xhr.open("POST", action, true); - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - xhr.setRequestHeader("X-File-Name", encodeURIComponent(file.getFilename())); - xhr.setRequestHeader("Content-Type", "application/octet-stream"); - xhr.send(file.getBrowserObject()); }, /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-18 10:26:54
|
Revision: 21564 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21564&view=rev Author: spackers Date: 2011-10-18 10:26:43 +0000 (Tue, 18 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/config.json Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/config.json =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/config.json 2011-10-18 10:25:46 UTC (rev 21563) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/config.json 2011-10-18 10:26:43 UTC (rev 21564) @@ -32,7 +32,7 @@ "translation" ], - "default-job" : "source", + "default-job" : "source-hybrid", "let" : { @@ -59,6 +59,7 @@ { "manifest" : "../../Manifest.json" } + ] }, @@ -70,6 +71,13 @@ "add-nocache-param" : false } } - } + }, + "source-hybrid" : { + "compile-options": { + "code": { + "=except": [ "uploadmgr.demo.*", "com.zenesis.*" ] + } + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-18 10:25:52
|
Revision: 21563 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21563&view=rev Author: spackers Date: 2011-10-18 10:25:46 +0000 (Tue, 18 Oct 2011) Log Message: ----------- bugfix for IE Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js 2011-10-18 10:24:53 UTC (rev 21562) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js 2011-10-18 10:25:46 UTC (rev 21563) @@ -63,11 +63,15 @@ return; // fixing Opera 10.53 - if (iframe.contentDocument && iframe.contentDocument.body && - iframe.contentDocument.body.innerHTML == "false") { - // In Opera event is fired second time when body.innerHTML changed from false - // to server response approx. after 1 sec when we upload file with iframe - return; + try { + if (iframe.contentDocument && iframe.contentDocument.body && + iframe.contentDocument.body.innerHTML == "false") { + // In Opera event is fired second time when body.innerHTML changed from false + // to server response approx. after 1 sec when we upload file with iframe + return; + } + }catch(e) { + // IE fix } //self.debug('iframe loaded'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-18 10:25:02
|
Revision: 21562 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21562&view=rev Author: spackers Date: 2011-10-18 10:24:53 +0000 (Tue, 18 Oct 2011) Log Message: ----------- bugfix and simplify server example for php Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/server/php.php Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/server/php.php =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/server/php.php 2011-10-17 16:00:02 UTC (rev 21561) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/server/php.php 2011-10-18 10:24:53 UTC (rev 21562) @@ -1,162 +1,116 @@ <?php -/** - * Handle file uploads via XMLHttpRequest - */ -class qqUploadedFileXhr { - /** - * Save the file to the specified path - * @return boolean TRUE on success - */ - function save($path) { - $input = fopen("php://input", "r"); - $temp = tmpfile(); - $realSize = stream_copy_to_stream($input, $temp); - fclose($input); - - if ($realSize != $this->getSize()){ - return false; - } - - $target = fopen($path, "w"); - fseek($temp, 0, SEEK_SET); - stream_copy_to_stream($temp, $target); - fclose($target); - - return true; - } - function getName() { - return $_GET['qqfile']; - } - function getSize() { - if (isset($_SERVER["CONTENT_LENGTH"])){ - return (int)$_SERVER["CONTENT_LENGTH"]; - } else { - throw new Exception('Getting content length is not supported.'); - } - } -} +/* *********************************************************************** -/** - * Handle file uploads via regular form post (uses the $_FILES array) - */ -class qqUploadedFileForm { - /** - * Save the file to the specified path - * @return boolean TRUE on success - */ - function save($path) { - if(!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path)){ - return false; - } - return true; - } - function getName() { - return $_FILES['qqfile']['name']; - } - function getSize() { - return $_FILES['qqfile']['size']; - } -} + QxUploadMgr - provides an API for uploading one or multiple files + with progress feedback (on modern browsers), does not block the user + interface during uploads, supports cancelling uploads. -class qqFileUploader { - private $allowedExtensions = array(); - private $sizeLimit = 10485760; - private $file; + http://qooxdoo.org - function __construct(array $allowedExtensions = array(), $sizeLimit = 10485760){ - $allowedExtensions = array_map("strtolower", $allowedExtensions); + Copyright: + 2011 Zenesis Limited, http://www.zenesis.com + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + + This software is provided under the same licensing terms as Qooxdoo, + please see the LICENSE file in the Qooxdoo project's top-level directory + for details. + + Parts of this code is based on the work by Andrew Valums (an...@va...) + and is covered by the GNU GPL and GNU LGPL2 licenses; please see + http://valums.com/ajax-upload/. + + Authors: + * John Spackman (joh...@ze...) + +************************************************************************/ + +class QxUploadMgr { + + /** + * Handles the upload + * @param $uploadDirectory {String} the path to upload to + * @param $replaceOldFile {Boolean} whether to replace existing files + */ + public static function handleUpload($uploadDirectory, $replaceOldFile = FALSE) { + if (!is_writable($uploadDirectory)) + throw new Exception("Server error. Upload directory isn't writable."); - $this->allowedExtensions = $allowedExtensions; - $this->sizeLimit = $sizeLimit; - - $this->checkServerSettings(); + /*if ($_SERVER['CONTENT_TYPE'] == "application/octet-stream") + return QxUploadMgr::handleApplicationOctet($uploadDirectory, $replaceOldFile); + else*/ + return QxUploadMgr::handleMultipartFormData($uploadDirectory, $replaceOldFile); + } + + /** + * Determins the filename for the upload + * @param $uploadDirectory {String} the path to upload to + * @param $originalName {String} the filename as given by the browser + * @param $replaceOldFile {Boolean} whether to replace existing files + */ + public static function getFilename($uploadDirectory, $originalName, $replaceOldFile) { + $pathinfo = pathinfo($originalName); + $filename = $uploadDirectory . '/' . $pathinfo['filename'] . '.' . $pathinfo['extension']; - if (isset($_GET['qqfile'])) { - $this->file = new qqUploadedFileXhr(); - } elseif (isset($_FILES['qqfile'])) { - $this->file = new qqUploadedFileForm(); - } else { - $this->file = false; + if (!$replaceOldFile){ + $index = 1; + while (file_exists($filename)) { + $filename = $uploadDirectory . '/' . $pathinfo['filename'] . '-' . $index . '.' . $pathinfo['extension']; + $index++; + } } - } - - private function checkServerSettings(){ - $postSize = $this->toBytes(ini_get('post_max_size')); - $uploadSize = $this->toBytes(ini_get('upload_max_filesize')); + return $filename; + } + + /** + * Handles the upload where content type is "application/octet-stream" + * @param $uploadDirectory {String} the path to upload to + * @param $replaceOldFile {Boolean} whether to replace existing files + */ + public static function handleApplicationOctet($uploadDirectory, $replaceOldFile) { + $filename = QxUploadMgr::getFilename($uploadDirectory, $_SERVER['HTTP_X_FILE_NAME'], $replaceOldFile); + error_log("Receiving application/octet-stream into $filename"); - if ($postSize < $this->sizeLimit || $uploadSize < $this->sizeLimit){ - $size = max(1, $this->sizeLimit / 1024 / 1024) . 'M'; - die("{'error':'increase post_max_size and upload_max_filesize to $size'}"); - } - } - - private function toBytes($str){ - $val = trim($str); - $last = strtolower($str[strlen($str)-1]); - switch($last) { - case 'g': $val *= 1024; - case 'm': $val *= 1024; - case 'k': $val *= 1024; - } - return $val; - } - - /** - * Returns array('success'=>true) or array('error'=>'error message') - */ - function handleUpload($uploadDirectory, $replaceOldFile = FALSE){ - if (!is_writable($uploadDirectory)){ - return array('error' => "Server error. Upload directory isn't writable."); - } + $input = fopen("php://input", "r"); + $target = fopen($filename, "w"); + $realSize = stream_copy_to_stream($input, $target); + fclose($input); + fclose($target); - if (!$this->file){ - return array('error' => 'No files were uploaded.'); + if (isset($_SERVER["CONTENT_LENGTH"])) { + $expectedSize = (int)$_SERVER["CONTENT_LENGTH"]; + if ($realSize != $expectedSize) + return array('error' => 'File is the wrong size'); } - $size = $this->file->getSize(); + return array('success'=>true); + } + + /** + * Handles the upload where content type is "multipart/form-data" + * @param $uploadDirectory {String} the path to upload to + * @param $replaceOldFile {Boolean} whether to replace existing files + */ + public static function handleMultipartFormdata($uploadDirectory, $replaceOldFile) { + error_log("hello, count()=" . $_FILES.count()); + foreach ($_FILES as $file) { + error_log("$file=" . $file); + $filename = QxUploadMgr::getFilename($uploadDirectory, $file['name'], $replaceOldFile); + error_log("Receiving multipart/formdata into $filename"); + if (!move_uploaded_file($file['tmp_name'], $filename)) { + error_log("Failed to move uploaded file from ". $file['tmp_name']. " to $filename"); + return array('error' => 'Failed to move uploaded file'); + } + } - if ($size == 0) { - return array('error' => 'File is empty'); - } - - if ($size > $this->sizeLimit) { - return array('error' => 'File is too large'); - } - - $pathinfo = pathinfo($this->file->getName()); - $filename = $pathinfo['filename']; - //$filename = md5(uniqid()); - $ext = $pathinfo['extension']; - - if($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)){ - $these = implode(', ', $this->allowedExtensions); - return array('error' => 'File has an invalid extension, it should be one of '. $these . '.'); - } - - if(!$replaceOldFile){ - /// don't overwrite previous files that were uploaded - while (file_exists($uploadDirectory . $filename . '.' . $ext)) { - $filename .= rand(10, 99); - } - } - - if ($this->file->save($uploadDirectory . $filename . '.' . $ext)){ - return array('success'=>true); - } else { - return array('error'=> 'Could not save uploaded file.' . - 'The upload was cancelled, or server error encountered'); - } - - } + return array('success'=>true); + } } -// list of valid extensions, ex. array("jpeg", "xml", "bmp") -$allowedExtensions = array(); -// max file size in bytes -$sizeLimit = 10 * 1024 * 1024; +$result = QxUploadMgr::handleUpload('uploads'); -$uploader = new qqFileUploader($allowedExtensions, $sizeLimit); -$result = $uploader->handleUpload('uploads/'); // to pass data through iframe you will need to encode all html tags echo htmlspecialchars(json_encode($result), ENT_NOQUOTES); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-10-17 16:00:13
|
Revision: 21561 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21561&view=rev Author: spackers Date: 2011-10-17 16:00:02 +0000 (Mon, 17 Oct 2011) Log Message: ----------- fixes to resize the input element to match the button; this fixes a bug where the input element in a toolbar would overlap other buttons Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js Added Paths: ----------- trunk/qooxdoo-contrib/UploadMgr/trunk/.project Added: trunk/qooxdoo-contrib/UploadMgr/trunk/.project =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/.project (rev 0) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/.project 2011-10-17 16:00:02 UTC (rev 21561) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>UploadMgr</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js 2011-10-16 15:36:03 UTC (rev 21560) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js 2011-10-17 16:00:02 UTC (rev 21561) @@ -179,6 +179,27 @@ btn = new com.zenesis.qx.upload.UploadButton("Add File(s)", "com/zenesis/qx/upload/test.png"); uploader.addWidget(btn); doc.add(btn, { left: 400, top: 460 }); + + var tb = new qx.ui.toolbar.ToolBar(); + doc.add(tb, { left: 100, top: 510 }); + var part = new qx.ui.toolbar.Part(); + tb.add(part); + + btn = new qx.ui.toolbar.Button("Do Nothing 1"); + btn.addListener("execute", function(evt) { + alert("Do Nothing 1 pressed"); + }); + part.add(btn); + + btn = new com.zenesis.qx.upload.UploadToolbarButton("Add File(s)", "com/zenesis/qx/upload/test.png"); + uploader.addWidget(btn); + part.add(btn); + + btn = new qx.ui.toolbar.Button("Do Nothing 2"); + btn.addListener("execute", function(evt) { + alert("Do Nothing 2 pressed"); + }); + part.add(btn); } } }); Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js 2011-10-16 15:36:03 UTC (rev 21560) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js 2011-10-17 16:00:02 UTC (rev 21561) @@ -111,11 +111,16 @@ * @return {String} */ _getIframeContent: function(iframe){ - // iframe.contentWindow.document - for IE<7 - var doc = iframe.contentDocument ? iframe.contentDocument: iframe.contentWindow.document, - response = doc.body.innerHTML; - //this.debug("response=" + response); - return response; + try { + // iframe.contentWindow.document - for IE<7 + var doc = iframe.contentDocument ? iframe.contentDocument: iframe.contentWindow.document, + response = doc.body.innerHTML; + //this.debug("response=" + response); + return response; + }catch(e) { + // IE will throw an exception if the upload is cross domain and we try to access the iframe's content + return null; + } }, /** Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-10-16 15:36:03 UTC (rev 21560) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-10-17 16:00:02 UTC (rev 21561) @@ -132,10 +132,16 @@ var data = this.__widgetsData[widget.toHashCode()]; if (data) { data.listenerId = null; - widget.getContainerElement().addAt(this._createInputElement(widget), 0); + var container = widget.getContainerElement(); + container.setStyle("overflow", "hidden"); + container.addAt(this._createInputElement(widget), 0); + this.__fixupSize(widget); } }, this); this.__widgetsData[widget.toHashCode()] = { listenerId: id, widget: widget, inputElement: null }; + widget.addListener("resize", function(evt) { + this.__fixupSize(widget); + }, this); }, /** @@ -151,6 +157,17 @@ } }, + __fixupSize: function(widget) { + var data = this.__widgetsData[widget.toHashCode()]; + if (data && data.inputElement) { + var bounds = widget.getBounds(); + data.inputElement.setStyles({ + width: bounds.width + "px", + height: bounds.height + "px" + }); + } + }, + /** * Callback for changes to the autoUpload property * @param value This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-10-16 15:36:09
|
Revision: 21560 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21560&view=rev Author: derrell Date: 2011-10-16 15:36:03 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Refactor to separate RPC from Database functionality - Formerly, the database code handled registration of RPC services, and there was an unnecessarily tight relationship between the two feature sets. That tight relationship has been removed. RPC services are registered in the AbstractRpcHandler class now (with convenience methods so the abstract one is not obviously accessed) - Formerly, RPC services were accessed via some given key, followed by the literal "features", followed by the method name. That has now been generalized, so that instead of passing a single key, an array is passed, which provides the entire path for each later-registered RPC. - Added some missing documentation Modified Paths: -------------- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Rpc.js trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Dbif.js trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Rpc.js Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js 2011-10-14 18:43:08 UTC (rev 21559) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js 2011-10-16 15:36:03 UTC (rev 21560) @@ -23,13 +23,54 @@ { extend : qx.core.Object, - construct : function(services) + /** + * Base constructor for each RPC handler. + * + * @param rpcKey {Array} + * The list of prefix keys for access to the set of remote + * procedure calls supported in this object's services map. + * + * Example: If the passed parameter is [ "sys", "fs" ] and + * one of the methods later added is "read" then the remote + * procedure call will be called "sys.fs.read", and the services + * map will contain: + * + * { + * sys : + * { + * fs : + * { + * read : function() + * { + * // implementation of sys.fs.read() + * } + * } + * } + * } + */ + construct : function(rpcKey) { - // Save the services map. + var i; + var services = {}; + var part; + + // Call the superclass constructor + this.base(arguments); + + // Initialize the services rpcjs.AbstractRpcHandler._services = services; + // Add each of the RPC keys + for (i = 0, part = services; i < rpcKey.length; i++) + { + part = part[rpcKey[i]] = {}; + } + + // Store the final part, where registered services will go + rpcjs.AbstractRpcHandler._servicesByKey = part; + // Get an RPC Server instance. - this._rpcServer = new rpcjs.rpc.Server( + this.__rpcServer = new rpcjs.rpc.Server( rpcjs.AbstractRpcHandler._serviceFactory); }, @@ -37,6 +78,12 @@ { /** The services map */ _services : null, + + /** + * Reference to the final component of the services map, where registered + * services are placed. + */ + _servicesByKey : null, /** * Function to call for authorization to run the service method. If @@ -74,7 +121,7 @@ // evaluate it in hopes of getting a method reference. // // We have a dot-separated fully-qualified method name. We want to - // access that entry in the map of maps in this.__services. Using the + // access that entry in the map of maps in _services. Using the // index notation won't work, since it's multiple levels deep // (i.e. fqMethodName might be something like "a.b.c"). // @@ -112,6 +159,117 @@ // Give 'em the reference to the method they can call. return method; + }, + + /** + * Register a service name and function. + * + * @param serviceName {String} + * The name of this service within the <[rpcKey]> namespace. + * + * @param fService {Function} + * The function which implements the given service name. + * + * @param context {Object} + * The context in which the service function should be called + * + * @param paramNames {Array} + * The names of the formal parameters, in order. + */ + registerService : function(serviceName, fService, context, paramNames) + { + var f; + + // Use this object as the context for the service + f = qx.lang.Function.bind(fService, context); + + // Save the parameter names as a property of the function object + f.parameterNames = paramNames; + + // Save the service + rpcjs.AbstractRpcHandler._servicesByKey[serviceName] = f; + }, + + + /** + * Retrieve the parameter names for a registered service. + * + * @param serviceName {String} + * The name of this service within the <[rpcKey]> namespace. + * + * @return {Array|null|undefined} + * If the specified service exists and parameter names have been + * provided for it, then an array of parameter names is returned. + * + * If the service exists but no parameter names were provided in the + * registration of the service, null is returned. + * + * If the service does not exist, undefined is returned. + */ + getServiceParamNames : function(serviceName) + { + // Get the stored service function + var f = rpcjs.AbstractRpcHandler._servicesByKey[serviceName]; + + // Did we find it? + if (! f) + { + // No, it is not a registered function. + return undefined; + } + + // Were parameter names registered with the function? + if (f.parameterNames) + { + // Yup. Return a copy of the parameter name array + return qx.lang.Array.clone(f.parameterNames); + } + + // The function was registered, but not its parameter names. + return null; } + }, + + members : + { + /** + * Register a service name and function. This is just a convenience member + * method that calls the static function of the same name. + * + * @param serviceName {String} + * The name of this service within the <[rpcKey]> namespace. + * + * @param fService {Function} + * The function which implements the given service name. + * + * @param context {Object} + * The context in which the service function should be called + * + * @param paramNames {Array} + * The names of the formal parameters, in order. + */ + registerService : function(serviceName, fService, context, paramNames) + { + rpcjs.AbstractRpcHandler.registerService(serviceName, + fService, + context, + paramNames); + }, + + /** + * Process an incoming request which is presumably a JSON-RPC request. + * + * @param jsonData {String} + * The JSON-encoded RPC request to be processed + * + * @return {String} + * Upon success, the JSON-encoded result of the RPC request is returned. + * Otherwise, null is returned. + */ + processRequest : function(jsonData) + { + // Call the RPC server to process this request + return this.__rpcServer.processRequest(jsonData); + } } }); Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js 2011-10-14 18:43:08 UTC (rev 21559) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js 2011-10-16 15:36:03 UTC (rev 21560) @@ -12,27 +12,6 @@ extend : qx.core.Object, type : "abstract", - construct : function(rpcKey, rpcUrl) - { - // Call the superclass constructor - this.base(arguments, rpcKey); - - // Save the rpc key - this.__rpcKey = rpcKey; - - // Initialize the services - this.__services = {}; - this.__services[rpcKey] = - { - features : - { - } - }; - - // Start up the App Engine RPC engine - this.__rpcHandler = new rpcjs.appengine.Rpc(this.__services, rpcUrl); - }, - statics : { /** @@ -758,57 +737,6 @@ } }, - members : - { - /** - * Register a service name and function. - * - * @param serviceName {String} - * The name of this service within the <rpcKey>.features namespace. - * - * @param fService {Function} - * The function which implements the given service name. - * - * @param paramNames {Array} - * The names of the formal parameters, in order. - */ - registerService : function(serviceName, fService, paramNames) - { - var f; - - // Use this object as the context for the service - f = qx.lang.Function.bind(fService, this); - - // Save the parameter names as a property of the function object - f.parameterNames = paramNames; - - // Save the service - this.__services[this.__rpcKey].features[serviceName] = f; - }, - - - /** - * Process a single request. - * - * @param jsonData {String} - * The data provide in a POST request - * - * @return {String} - * Upon success, the JSON-encoded result of the RPC request is returned. - * Otherwise, null is returned. - */ - processRequest : function(jsonData) - { - return this.__rpcHandler.processRequest(jsonData); - }, - - /** The top-level RPC key, used to index into this.__services */ - __rpcKey : null, - - /** Remote procedure call services */ - __services : null - }, - defer : function() { // Register our put, query, and remove functions Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Rpc.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Rpc.js 2011-10-14 18:43:08 UTC (rev 21559) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Rpc.js 2011-10-16 15:36:03 UTC (rev 21560) @@ -21,33 +21,7 @@ */ qx.Class.define("rpcjs.appengine.Rpc", { - extend : rpcjs.AbstractRpcHandler, - - construct : function(services, url) - { - // Call the superclass constructor - this.base(arguments, services); - - // The url is ignored in this implementation. We only get here if the url - // matches what's specified in web.xml. - }, + extend : rpcjs.AbstractRpcHandler - members : - { - /** - * Process an incoming request which is presumably a JSON-RPC request. - * - * @param jsonData {String} - * The data provide in a POST request - * - * @return {String} - * Upon success, the JSON-encoded result of the RPC request is returned. - * Otherwise, null is returned. - */ - processRequest : function(jsonData) - { - // Call the RPC server to process this request - return this._rpcServer.processRequest(jsonData); - } - } + // Nothing special to do in this subclass. }); Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Dbif.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Dbif.js 2011-10-14 18:43:08 UTC (rev 21559) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Dbif.js 2011-10-16 15:36:03 UTC (rev 21560) @@ -12,27 +12,6 @@ extend : qx.core.Object, type : "abstract", - construct : function(rpcKey, rpcUrl) - { - // Call the superclass constructor - this.base(arguments); - - // Save the rpc key - this.__rpcKey = rpcKey; - - // Initialize the services - this.__services = {}; - this.__services[rpcKey] = - { - features : - { - } - }; - - // Start up the RPC simulator - new rpcjs.sim.Rpc(this.__services, rpcUrl); - }, - statics : { /** The default database. See {@link setDb}. */ @@ -643,79 +622,5 @@ // Delete the specified blob delete Db[blobStorage][blobId]; } - }, - - members : - { - /** - * Register a service name and function. - * - * @param serviceName {String} - * The name of this service within the <rpcKey>.features namespace. - * - * @param fService {Function} - * The function which implements the given service name. - * - * @param paramNames {Array} - * The names of the formal parameters, in order. - */ - registerService : function(serviceName, fService, paramNames) - { - var f; - - // Use this object as the context for the service - f = qx.lang.Function.bind(fService, this); - - // Save the parameter names as a property of the function object - f.parameterNames = paramNames; - - // Save the service - this.__services[this.__rpcKey].features[serviceName] = f; - }, - - - /** - * Retrieve the parameter names for a registered service. - * - * @param serviceName {String} - * The name of this service within the <rpcKey>.features namespace. - * - * @return {Array|null|undefined} - * If the specified service exists and parameter names have been - * provided for it, then an array of parameter names is returned. - * - * If the service exists but no parameter names were provided in the - * registration of the service, null is returned. - * - * If the service does not exist, undefined is returned. - */ - getServiceParamNames : function(serviceName) - { - // Get the stored service function - var f = this.__services[this.__rpcKey].features[serviceName]; - - // Did we find it? - if (! f) - { - // No, it is not a registered function. - return undefined; - } - - // Were parameter names registered with the function? - if (f.parameterNames) - { - // Yup. Return a copy of the parameter name array - return qx.lang.Array.clone(f.parameterNames); - } - - // The function was registered, but not its parameter names. - return null; - }, - - /** The top-level RPC key, used to index into this.__services */ - __rpcKey : null, - - /** Remote procedure call services */ - __services : null } }); Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Rpc.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Rpc.js 2011-10-14 18:43:08 UTC (rev 21559) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Rpc.js 2011-10-16 15:36:03 UTC (rev 21560) @@ -23,16 +23,44 @@ { extend : rpcjs.AbstractRpcHandler, - construct : function(services, url) + /** + * Constructor for this RPC handler. + * + * @param rpcKey {Array} + * The list of prefix keys for access to the set of remote + * procedure calls supported in this object's services map. + * + * Example: If the passed parameter is [ "sys", "fs" ] and + * one of the methods later added is "read" then the remote + * procedure call will be called "sys.fs.read", and the services + * map will contain: + * + * { + * sys : + * { + * fs : + * { + * read : function() + * { + * // implementation of sys.fs.read() + * } + * } + * } + * } + * + * @param url {String} + * The URL that must match for this service provider to be used + */ + construct : function(rpckey, url) { // Call the superclass constructor - this.base(arguments, services); + this.base(arguments, rpckey); // Save the URL this.setUrl(url); - - // Register ourself as a handler for the specified URL. + // Register ourself with the simulation transport, as a handler for the + // specified URL. rpcjs.sim.Simulator.registerHandler( qx.lang.Function.bind(this.__processRequest, this)); }, @@ -91,12 +119,12 @@ jsonData = request.data; // From here on out, we'll have a successful result (even if the RPC - // sends back an error ressponse). + // sends back an error response). responseHeaders.status = 200; responseHeaders.statusText = ""; // Call the RPC server to process this request - result = this._rpcServer.processRequest(jsonData); + result = this.processRequest(jsonData); return result; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2011-10-14 18:43:16
|
Revision: 21559 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21559&view=rev Author: thron7 Date: 2011-10-14 18:43:08 +0000 (Fri, 14 Oct 2011) Log Message: ----------- [BUG #5706] updated output on test parses Modified Paths: -------------- workspace/thron7/scanner/treegenerator.out workspace/thron7/scanner/treegenerator_new_ast.out Modified: workspace/thron7/scanner/treegenerator.out =================================================================== --- workspace/thron7/scanner/treegenerator.out 2011-10-14 13:18:10 UTC (rev 21558) +++ workspace/thron7/scanner/treegenerator.out 2011-10-14 18:43:08 UTC (rev 21559) @@ -743,6 +743,88 @@ </statement> </loop> +>>> qx.Class.define('foo', {extend: object, bar: function() {return 1;}}) +<call column="16" line="1" breakBefore="false" eolBefore="false"> + <operand> + <variable column="1" line="1"> + <identifier column="1" line="1" name="qx"/> + <identifier column="4" line="1" name="Class"/> + <identifier column="10" line="1" name="define"/> + </variable> + </operand> + <params column="16" line="1"> + <constant breakBefore="false" column="17" eolBefore="false" detail="singlequotes" value="foo" constantType="string" line="1"/> + <map column="24" line="1" breakBefore="false" eolBefore="false"> + <keyvalue column="25" line="1" key="extend"> + <value> + <variable column="33" line="1" breakBefore="false" eolBefore="false"> + <identifier column="33" line="1" name="object"/> + </variable> + </value> + </keyvalue> + <keyvalue column="41" line="1" key="bar"> + <value> + <function column="46" line="1" breakBefore="false" eolBefore="false"> + <params column="54" line="1"/> + <body> + <block column="57" line="1"> + <return column="58" line="1" breakBefore="false" eolBefore="false"> + <expression> + <constant breakBefore="false" column="65" eolBefore="false" detail="int" value="1" constantType="number" line="1"/> + </expression> + </return> + </block> + </body> + </function> + </value> + </keyvalue> + </map> + </params> +</call> + +>>> qx.Class.define('foo', { + extend: object, + bar: function() {return 1;} + } +) +<call column="16" line="1" breakBefore="false" eolBefore="false"> + <operand> + <variable column="1" line="1"> + <identifier column="1" line="1" name="qx"/> + <identifier column="4" line="1" name="Class"/> + <identifier column="10" line="1" name="define"/> + </variable> + </operand> + <params column="16" line="1"> + <constant breakBefore="false" column="17" eolBefore="false" detail="singlequotes" value="foo" constantType="string" line="1"/> + <map column="24" line="1" breakBefore="false" eolBefore="false"> + <keyvalue column="3" line="2" key="extend"> + <value> + <variable column="11" line="2" breakBefore="false" eolBefore="false"> + <identifier column="11" line="2" name="object"/> + </variable> + </value> + </keyvalue> + <keyvalue column="3" line="3" key="bar"> + <value> + <function column="8" line="3" breakBefore="false" eolBefore="false"> + <params column="16" line="3"/> + <body> + <block column="19" line="3"> + <return column="20" line="3" breakBefore="false" eolBefore="false"> + <expression> + <constant breakBefore="false" column="27" eolBefore="false" detail="int" value="1" constantType="number" line="3"/> + </expression> + </return> + </block> + </body> + </function> + </value> + </keyvalue> + </map> + </params> +</call> + >>> var a = /123/; <definitionList column="1" line="1" breakBefore="false" eolBefore="false"> <definition column="5" line="1" identifier="a"> Modified: workspace/thron7/scanner/treegenerator_new_ast.out =================================================================== --- workspace/thron7/scanner/treegenerator_new_ast.out 2011-10-14 13:18:10 UTC (rev 21558) +++ workspace/thron7/scanner/treegenerator_new_ast.out 2011-10-14 18:43:08 UTC (rev 21559) @@ -133,42 +133,28 @@ </map> >>> foo[1] -<variable> - <accessor> - <variable> - <identifier column="1" line="1" value="foo"/> - </variable> - <key> - <constant constantType="number" column="5" line="1" detail="int" value="1"/> - </key> - </accessor> -</variable> +<accessor> + <identifier column="1" line="1" value="foo"/> + <key> + <constant constantType="number" column="5" line="1" detail="int" value="1"/> + </key> +</accessor> >>> foo[bar] -<variable> - <accessor> - <variable> - <identifier column="1" line="1" value="foo"/> - </variable> - <key> - <variable> - <identifier column="5" line="1" value="bar"/> - </variable> - </key> - </accessor> -</variable> +<accessor> + <identifier column="1" line="1" value="foo"/> + <key> + <identifier column="5" line="1" value="bar"/> + </key> +</accessor> >>> foo['bar'] -<variable> - <accessor> - <variable> - <identifier column="1" line="1" value="foo"/> - </variable> - <key> - <constant constantType="string" column="5" line="1" detail="singlequotes" value="bar"/> - </key> - </accessor> -</variable> +<accessor> + <identifier column="1" line="1" value="foo"/> + <key> + <constant constantType="string" column="5" line="1" detail="singlequotes" value="bar"/> + </key> +</accessor> >>> (1,) <group> @@ -216,65 +202,43 @@ </operation> >>> foo.bar -<variable> - <variable> - <identifier column="1" line="1" value="foo"/> - </variable> - <variable> - <identifier column="5" line="1" value="bar"/> - </variable> -</variable> +<dotaccessor> + <identifier column="1" line="1" value="foo"/> + <identifier column="5" line="1" value="bar"/> +</dotaccessor> >>> foo.bar() -<variable> - <variable> - <identifier column="1" line="1" value="foo"/> - </variable> - <call> - <operand> - <variable> - <identifier column="5" line="1" value="bar"/> - </variable> - </operand> - <params/> - </call> -</variable> +<call> + <operand> + <dotaccessor> + <identifier column="1" line="1" value="foo"/> + <identifier column="5" line="1" value="bar"/> + </dotaccessor> + </operand> + <params/> +</call> >>> foo.bar[0] -<variable> - <variable> +<accessor> + <dotaccessor> <identifier column="1" line="1" value="foo"/> - </variable> - <variable> - <accessor> - <variable> - <identifier column="5" line="1" value="bar"/> - </variable> - <key> - <constant constantType="number" column="9" line="1" detail="int" value="0"/> - </key> - </accessor> - </variable> -</variable> + <identifier column="5" line="1" value="bar"/> + </dotaccessor> + <key> + <constant constantType="number" column="9" line="1" detail="int" value="0"/> + </key> +</accessor> >>> foo.bar[baz] -<variable> - <variable> +<accessor> + <dotaccessor> <identifier column="1" line="1" value="foo"/> - </variable> - <variable> - <accessor> - <variable> - <identifier column="5" line="1" value="bar"/> - </variable> - <key> - <variable> - <identifier column="9" line="1" value="baz"/> - </variable> - </key> - </accessor> - </variable> -</variable> + <identifier column="5" line="1" value="bar"/> + </dotaccessor> + <key> + <identifier column="9" line="1" value="baz"/> + </key> +</accessor> >>> 1 + hello <operation operator="ADD" column="3" line="1"> @@ -282,28 +246,22 @@ <constant constantType="number" column="1" line="1" detail="int" value="1"/> </first> <second> - <variable> - <identifier column="5" line="1" value="hello"/> - </variable> + <identifier column="5" line="1" value="hello"/> </second> </operation> >>> 'hello'[0] -<variable> - <accessor> - <constant constantType="string" column="1" line="1" detail="singlequotes" value="hello"/> - <key> - <constant constantType="number" column="9" line="1" detail="int" value="0"/> - </key> - </accessor> -</variable> +<accessor> + <constant constantType="string" column="1" line="1" detail="singlequotes" value="hello"/> + <key> + <constant constantType="number" column="9" line="1" detail="int" value="0"/> + </key> +</accessor> >>> hello() <call> <operand> - <variable> - <identifier column="1" line="1" value="hello"/> - </variable> + <identifier column="1" line="1" value="hello"/> </operand> <params/> </call> @@ -311,9 +269,7 @@ >>> hello(1,2,3) <call> <operand> - <variable> - <identifier column="1" line="1" value="hello"/> - </variable> + <identifier column="1" line="1" value="hello"/> </operand> <params> <constant constantType="number" column="7" line="1" detail="int" value="1"/> @@ -324,216 +280,183 @@ >>> function () { a = 1; } <function column="1" line="1"> - <params> - <group/> - </params> + <params/> <body> <block> - <assignment operator="ASSIGN" column="17" line="1"> - <first> - <variable> + <statements> + <assignment operator="ASSIGN" column="17" line="1"> + <first> <identifier column="15" line="1" value="a"/> - </variable> - </first> - <second> - <constant constantType="number" column="19" line="1" detail="int" value="1"/> - </second> - </assignment> + </first> + <second> + <constant constantType="number" column="19" line="1" detail="int" value="1"/> + </second> + </assignment> + </statements> </block> </body> </function> >>> function foo() { a = 1; } -<function column="1" line="1"> - <identifier column="10" line="1" value="foo"/> - <params> - <group/> - </params> +<function column="1" line="1" name="foo"> + <params/> <body> <block> - <assignment operator="ASSIGN" column="20" line="1"> - <first> - <variable> + <statements> + <assignment operator="ASSIGN" column="20" line="1"> + <first> <identifier column="18" line="1" value="a"/> - </variable> - </first> - <second> - <constant constantType="number" column="22" line="1" detail="int" value="1"/> - </second> - </assignment> + </first> + <second> + <constant constantType="number" column="22" line="1" detail="int" value="1"/> + </second> + </assignment> + </statements> </block> </body> </function> >>> function foo(a,b) { a = 1; } -<function column="1" line="1"> - <identifier column="10" line="1" value="foo"/> +<function column="1" line="1" name="foo"> <params> - <group> - <variable> - <identifier column="14" line="1" value="a"/> - </variable> - <variable> - <identifier column="16" line="1" value="b"/> - </variable> - </group> + <identifier column="14" line="1" value="a"/> + <identifier column="16" line="1" value="b"/> </params> <body> <block> - <assignment operator="ASSIGN" column="23" line="1"> - <first> - <variable> + <statements> + <assignment operator="ASSIGN" column="23" line="1"> + <first> <identifier column="21" line="1" value="a"/> - </variable> - </first> - <second> - <constant constantType="number" column="25" line="1" detail="int" value="1"/> - </second> - </assignment> + </first> + <second> + <constant constantType="number" column="25" line="1" detail="int" value="1"/> + </second> + </assignment> + </statements> </block> </body> </function> >>> function foo(a,b) { a = 1; b = 2;} -<function column="1" line="1"> - <identifier column="10" line="1" value="foo"/> +<function column="1" line="1" name="foo"> <params> - <group> - <variable> - <identifier column="14" line="1" value="a"/> - </variable> - <variable> - <identifier column="16" line="1" value="b"/> - </variable> - </group> + <identifier column="14" line="1" value="a"/> + <identifier column="16" line="1" value="b"/> </params> <body> <block> - <assignment operator="ASSIGN" column="30" line="1"> - <first> - <variable> + <statements> + <assignment operator="ASSIGN" column="23" line="1"> + <first> + <identifier column="21" line="1" value="a"/> + </first> + <second> + <constant constantType="number" column="25" line="1" detail="int" value="1"/> + </second> + </assignment> + <assignment operator="ASSIGN" column="30" line="1"> + <first> <identifier column="28" line="1" value="b"/> - </variable> - </first> - <second> - <constant constantType="number" column="32" line="1" detail="int" value="2"/> - </second> - </assignment> + </first> + <second> + <constant constantType="number" column="32" line="1" detail="int" value="2"/> + </second> + </assignment> + </statements> </block> </body> </function> >>> ([dojo._listener, del, node_listener][listener]).remove(obj, event, handle); -<variable> - <group> - <variable> - <accessor> - <array> - <variable> - <variable> +<call> + <operand> + <dotaccessor> + <group> + <accessor> + <array> + <dotaccessor> <identifier column="3" line="1" value="dojo"/> - </variable> - <variable> <identifier column="8" line="1" value="_listener"/> - </variable> - </variable> - <variable> + </dotaccessor> <identifier column="19" line="1" value="del"/> - </variable> - <variable> <identifier column="24" line="1" value="node_listener"/> - </variable> - </array> - <key> - <variable> + </array> + <key> <identifier column="39" line="1" value="listener"/> - </variable> - </key> - </accessor> - </variable> - </group> - <call> - <operand> - <variable> - <identifier column="50" line="1" value="remove"/> - </variable> - </operand> - <params> - <variable> - <identifier column="57" line="1" value="obj"/> - </variable> - <variable> - <identifier column="62" line="1" value="event"/> - </variable> - <variable> - <identifier column="69" line="1" value="handle"/> - </variable> - </params> - </call> -</variable> + </key> + </accessor> + </group> + <identifier column="50" line="1" value="remove"/> + </dotaccessor> + </operand> + <params> + <identifier column="57" line="1" value="obj"/> + <identifier column="62" line="1" value="event"/> + <identifier column="69" line="1" value="handle"/> + </params> +</call> >>> var a = 1, b; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <constant constantType="number" column="9" line="1" detail="int" value="1"/> - </assignment> - </definition> - <definition> - <identifier column="12" line="1" value="b"/> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <constant constantType="number" column="9" line="1" detail="int" value="1"/> + </assignment> + </definition> + <definition> + <identifier column="12" line="1" value="b"/> + </definition> + </definitionList> +</statements> >>> var a = 'foo \' bar'; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <constant constantType="string" column="9" line="1" detail="singlequotes" value="foo \&apos; bar"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <constant constantType="string" column="9" line="1" detail="singlequotes" value="foo \&apos; bar"/> + </assignment> + </definition> + </definitionList> +</statements> >>> while(a<10){ b.append(a); } -<while column="1" line="1"> - <operation operator="LT" column="8" line="1"> - <first> - <variable> +<statements> + <while column="1" line="1"> + <operation operator="LT" column="8" line="1"> + <first> <identifier column="7" line="1" value="a"/> - </variable> - </first> - <second> - <constant constantType="number" column="9" line="1" detail="int" value="10"/> - </second> - </operation> - <block> - <variable> - <variable> - <identifier column="14" line="1" value="b"/> - </variable> - <call> - <operand> - <variable> - <identifier column="16" line="1" value="append"/> - </variable> - </operand> - <params> - <variable> + </first> + <second> + <constant constantType="number" column="9" line="1" detail="int" value="10"/> + </second> + </operation> + <block> + <statements> + <call> + <operand> + <dotaccessor> + <identifier column="14" line="1" value="b"/> + <identifier column="16" line="1" value="append"/> + </dotaccessor> + </operand> + <params> <identifier column="23" line="1" value="a"/> - </variable> - </params> - </call> - </variable> - </block> -</while> + </params> + </call> + </statements> + </block> + </while> +</statements> >>> i=2 <assignment operator="ASSIGN" column="2" line="1"> <first> - <variable> - <identifier column="1" line="1" value="i"/> - </variable> + <identifier column="1" line="1" value="i"/> </first> <second> <constant constantType="number" column="3" line="1" detail="int" value="2"/> @@ -544,271 +467,331 @@ <constant constantType="number" column="1" line="1" detail="int" value="2"/> >>> for(i=0; i<j; i++){ a=3; } -<loop column="1" line="1" forVariant="iter" loopType="FOR"> - <first> - <expressionList> - <assignment operator="ASSIGN" column="6" line="1"> - <first> - <variable> +<statements> + <loop column="1" line="1" forVariant="iter" loopType="FOR"> + <first> + <expressionList> + <assignment operator="ASSIGN" column="6" line="1"> + <first> <identifier column="5" line="1" value="i"/> - </variable> + </first> + <second> + <constant constantType="number" column="7" line="1" detail="int" value="0"/> + </second> + </assignment> + </expressionList> + </first> + <second> + <operation operator="LT" column="11" line="1"> + <first> + <identifier column="10" line="1" value="i"/> </first> <second> - <constant constantType="number" column="7" line="1" detail="int" value="0"/> - </second> - </assignment> - </expressionList> - </first> - <second> - <operation operator="LT" column="11" line="1"> - <first> - <variable> - <identifier column="10" line="1" value="i"/> - </variable> - </first> - <second> - <variable> <identifier column="12" line="1" value="j"/> - </variable> - </second> - </operation> - </second> - <third> - <operation operator="INC" column="16" line="1"> - <first> - <variable> - <identifier column="15" line="1" value="i"/> - </variable> - </first> - </operation> - </third> - <statement> - <block> - <assignment operator="ASSIGN" column="22" line="1"> + </second> + </operation> + </second> + <third> + <operation operator="INC" column="16" line="1"> <first> - <variable> - <identifier column="21" line="1" value="a"/> - </variable> + <identifier column="15" line="1" value="i"/> </first> - <second> - <constant constantType="number" column="23" line="1" detail="int" value="3"/> - </second> - </assignment> - </block> - </statement> -</loop> + </operation> + </third> + <statement> + <block> + <statements> + <assignment operator="ASSIGN" column="22" line="1"> + <first> + <identifier column="21" line="1" value="a"/> + </first> + <second> + <constant constantType="number" column="23" line="1" detail="int" value="3"/> + </second> + </assignment> + </statements> + </block> + </statement> + </loop> +</statements> >>> for(i=0, j=a; i<j; i++){ a=3; } -<loop column="1" line="1" forVariant="iter" loopType="FOR"> - <first> - <expressionList> - <assignment operator="ASSIGN" column="6" line="1"> - <first> - <variable> +<statements> + <loop column="1" line="1" forVariant="iter" loopType="FOR"> + <first> + <expressionList> + <assignment operator="ASSIGN" column="6" line="1"> + <first> <identifier column="5" line="1" value="i"/> - </variable> - </first> - <second> - <constant constantType="number" column="7" line="1" detail="int" value="0"/> - </second> - </assignment> - <assignment operator="ASSIGN" column="11" line="1"> - <first> - <variable> + </first> + <second> + <constant constantType="number" column="7" line="1" detail="int" value="0"/> + </second> + </assignment> + <assignment operator="ASSIGN" column="11" line="1"> + <first> <identifier column="10" line="1" value="j"/> - </variable> - </first> - <second> - <variable> + </first> + <second> <identifier column="12" line="1" value="a"/> - </variable> - </second> - </assignment> - </expressionList> - </first> - <second> - <operation operator="LT" column="16" line="1"> - <first> - <variable> - <identifier column="15" line="1" value="i"/> - </variable> - </first> - <second> - <variable> - <identifier column="17" line="1" value="j"/> - </variable> - </second> - </operation> - </second> - <third> - <operation operator="INC" column="21" line="1"> - <first> - <variable> - <identifier column="20" line="1" value="i"/> - </variable> - </first> - </operation> - </third> - <statement> - <block> - <assignment operator="ASSIGN" column="27" line="1"> + </second> + </assignment> + </expressionList> + </first> + <second> + <operation operator="LT" column="16" line="1"> <first> - <variable> - <identifier column="26" line="1" value="a"/> - </variable> + <identifier column="15" line="1" value="i"/> </first> <second> - <constant constantType="number" column="28" line="1" detail="int" value="3"/> + <identifier column="17" line="1" value="j"/> </second> - </assignment> - </block> - </statement> -</loop> + </operation> + </second> + <third> + <operation operator="INC" column="21" line="1"> + <first> + <identifier column="20" line="1" value="i"/> + </first> + </operation> + </third> + <statement> + <block> + <statements> + <assignment operator="ASSIGN" column="27" line="1"> + <first> + <identifier column="26" line="1" value="a"/> + </first> + <second> + <constant constantType="number" column="28" line="1" detail="int" value="3"/> + </second> + </assignment> + </statements> + </block> + </statement> + </loop> +</statements> >>> for(var i=0, j=a; i<j; i++){ a=3; } -<loop column="1" line="1" forVariant="iter" loopType="FOR"> - <first> - <definitionList> - <definition> - <assignment> - <second> - <constant constantType="number" column="11" line="1" detail="int" value="0"/> - </second> - </assignment> - </definition> - <definition> - <assignment> - <second> - <variable> +<statements> + <loop column="1" line="1" forVariant="iter" loopType="FOR"> + <first> + <definitionList> + <definition> + <assignment> + <second> + <constant constantType="number" column="11" line="1" detail="int" value="0"/> + </second> + </assignment> + </definition> + <definition> + <assignment> + <second> <identifier column="16" line="1" value="a"/> - </variable> - </second> - </assignment> - </definition> - </definitionList> - </first> - <second> - <operation operator="LT" column="20" line="1"> - <first> - <variable> + </second> + </assignment> + </definition> + </definitionList> + </first> + <second> + <operation operator="LT" column="20" line="1"> + <first> <identifier column="19" line="1" value="i"/> - </variable> - </first> - <second> - <variable> + </first> + <second> <identifier column="21" line="1" value="j"/> - </variable> - </second> - </operation> - </second> - <third> - <operation operator="INC" column="25" line="1"> - <first> - <variable> + </second> + </operation> + </second> + <third> + <operation operator="INC" column="25" line="1"> + <first> <identifier column="24" line="1" value="i"/> - </variable> - </first> - </operation> - </third> - <statement> - <block> - <assignment operator="ASSIGN" column="31" line="1"> + </first> + </operation> + </third> + <statement> + <block> + <statements> + <assignment operator="ASSIGN" column="31" line="1"> + <first> + <identifier column="30" line="1" value="a"/> + </first> + <second> + <constant constantType="number" column="32" line="1" detail="int" value="3"/> + </second> + </assignment> + </statements> + </block> + </statement> + </loop> +</statements> + +>>> for(i in j){} +<statements> + <loop column="1" line="1" forVariant="in" loopType="FOR"> + <first> + <operation operator="IN"> <first> <variable> - <identifier column="30" line="1" value="a"/> + <identifier name="i"/> </variable> </first> <second> - <constant constantType="number" column="32" line="1" detail="int" value="3"/> + <identifier column="10" line="1" value="j"/> </second> - </assignment> - </block> - </statement> -</loop> + </operation> + </first> + <statement> + <block> + <statements/> + </block> + </statement> + </loop> +</statements> ->>> for(i in j){} -<loop column="1" line="1" forVariant="in" loopType="FOR"> - <first> - <operation operator="IN"> - <first> - <variable> - <identifier name="i"/> - </variable> - </first> - <second> - <variable> - <identifier column="10" line="1" value="j"/> - </variable> - </second> - </operation> - </first> - <statement> - <block> - <{/> - </block> - </statement> -</loop> - >>> for(var key in config){process(key);} -<loop column="1" line="1" forVariant="in" loopType="FOR"> - <first> - <operation operator="IN"> - <first> - <definitionList> - <definition identifier="key"/> - </definitionList> - </first> - <second> - <variable> +<statements> + <loop column="1" line="1" forVariant="in" loopType="FOR"> + <first> + <operation operator="IN"> + <first> + <definitionList> + <definition identifier="key"/> + </definitionList> + </first> + <second> <identifier column="16" line="1" value="config"/> - </variable> - </second> - </operation> - </first> - <statement> - <block> - <call> - <operand> - <variable> - <identifier column="24" line="1" value="process"/> - </variable> - </operand> - <params> - <variable> - <identifier column="32" line="1" value="key"/> - </variable> - </params> - </call> - </block> - </statement> -</loop> + </second> + </operation> + </first> + <statement> + <block> + <statements> + <call> + <operand> + <identifier column="24" line="1" value="process"/> + </operand> + <params> + <identifier column="32" line="1" value="key"/> + </params> + </call> + </statements> + </block> + </statement> + </loop> +</statements> +>>> qx.Class.define('foo', {extend: object, bar: function() {return 1;}}) +<call> + <operand> + <dotaccessor> + <dotaccessor> + <identifier column="1" line="1" value="qx"/> + <identifier column="4" line="1" value="Class"/> + </dotaccessor> + <identifier column="10" line="1" value="define"/> + </dotaccessor> + </operand> + <params> + <constant constantType="string" column="17" line="1" detail="singlequotes" value="foo"/> + <map> + <keyvalue key="extend"> + <value> + <identifier column="33" line="1" value="object"/> + </value> + </keyvalue> + <keyvalue key="bar"> + <value> + <function column="46" line="1"> + <params/> + <body> + <block> + <statements> + <return column="58" line="1"> + <constant constantType="number" column="65" line="1" detail="int" value="1"/> + </return> + </statements> + </block> + </body> + </function> + </value> + </keyvalue> + </map> + </params> +</call> + +>>> qx.Class.define('foo', { + extend: object, + bar: function() {return 1;} + } +) +<call> + <operand> + <dotaccessor> + <dotaccessor> + <identifier column="1" line="1" value="qx"/> + <identifier column="4" line="1" value="Class"/> + </dotaccessor> + <identifier column="10" line="1" value="define"/> + </dotaccessor> + </operand> + <params> + <constant constantType="string" column="17" line="1" detail="singlequotes" value="foo"/> + <map> + <keyvalue key="extend"> + <value> + <identifier column="11" line="2" value="object"/> + </value> + </keyvalue> + <keyvalue key="bar"> + <value> + <function column="8" line="3"> + <params/> + <body> + <block> + <statements> + <return column="20" line="3"> + <constant constantType="number" column="27" line="3" detail="int" value="1"/> + </return> + </statements> + </block> + </body> + </function> + </value> + </keyvalue> + </map> + </params> +</call> + >>> var a = /123/; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <constant constantType="regexp" column="9" line="1" value="/123/"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <constant constantType="regexp" column="9" line="1" value="/123/"/> + </assignment> + </definition> + </definitionList> +</statements> >>> var a = /123/mgi; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <constant constantType="regexp" column="9" line="1" value="/123/mgi"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <constant constantType="regexp" column="9" line="1" value="/123/mgi"/> + </assignment> + </definition> + </definitionList> +</statements> >>> foo(1, /a.*b/mgi) <call> <operand> - <variable> - <identifier column="1" line="1" value="foo"/> - </variable> + <identifier column="1" line="1" value="foo"/> </operand> <params> <constant constantType="number" column="5" line="1" detail="int" value="1"/> @@ -817,106 +800,102 @@ </call> >>> var a = /a.*/; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <constant constantType="regexp" column="9" line="1" value="/a.*/"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <constant constantType="regexp" column="9" line="1" value="/a.*/"/> + </assignment> + </definition> + </definitionList> +</statements> >>> var a = /^ab.*?[f-g]+x\/yz[^\.\/]?a.*\\/; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <constant constantType="regexp" column="9" line="1" value="/^ab.*?[f-g]+x\/yz[^\.\/]?a.*\\/"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <constant constantType="regexp" column="9" line="1" value="/^ab.*?[f-g]+x\/yz[^\.\/]?a.*\\/"/> + </assignment> + </definition> + </definitionList> +</statements> >>> var a = /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <constant constantType="regexp" column="9" line="1" value="/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <constant constantType="regexp" column="9" line="1" value="/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/"/> + </assignment> + </definition> + </definitionList> +</statements> >>> var a = 10/123/2; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <operation operator="DIV" column="15" line="1"> - <first> - <operation operator="DIV" column="11" line="1"> - <first> - <constant constantType="number" column="9" line="1" detail="int" value="10"/> - </first> - <second> - <constant constantType="number" column="12" line="1" detail="int" value="123"/> - </second> - </operation> - </first> - <second> - <constant constantType="number" column="16" line="1" detail="int" value="2"/> - </second> - </operation> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <operation operator="DIV" column="15" line="1"> + <first> + <operation operator="DIV" column="11" line="1"> + <first> + <constant constantType="number" column="9" line="1" detail="int" value="10"/> + </first> + <second> + <constant constantType="number" column="12" line="1" detail="int" value="123"/> + </second> + </operation> + </first> + <second> + <constant constantType="number" column="16" line="1" detail="int" value="2"/> + </second> + </operation> + </assignment> + </definition> + </definitionList> +</statements> >>> ++i <operation operator="INC" column="1" line="1" left="true"> <first> - <variable> - <identifier column="3" line="1" value="i"/> - </variable> + <identifier column="3" line="1" value="i"/> </first> </operation> >>> i++ <operation operator="INC" column="2" line="1"> <first> - <variable> - <identifier column="1" line="1" value="i"/> - </variable> + <identifier column="1" line="1" value="i"/> </first> </operation> >>> ++a[0] <operation operator="INC" column="1" line="1" left="true"> <first> - <variable> - <accessor> - <variable> - <identifier column="3" line="1" value="a"/> - </variable> - <key> - <constant constantType="number" column="5" line="1" detail="int" value="0"/> - </key> - </accessor> - </variable> + <accessor> + <identifier column="3" line="1" value="a"/> + <key> + <constant constantType="number" column="5" line="1" detail="int" value="0"/> + </key> + </accessor> </first> </operation> >>> a[0]++ <operation operator="INC" column="5" line="1"> <first> - <variable> - <accessor> - <variable> - <identifier column="1" line="1" value="a"/> - </variable> - <key> - <constant constantType="number" column="3" line="1" detail="int" value="0"/> - </key> - </accessor> - </variable> + <accessor> + <identifier column="1" line="1" value="a"/> + <key> + <constant constantType="number" column="3" line="1" detail="int" value="0"/> + </key> + </accessor> </first> </operation> @@ -924,16 +903,12 @@ <operation operator="INC" column="1" line="1" left="true"> <first> <group> - <variable> - <accessor> - <variable> - <identifier column="4" line="1" value="a"/> - </variable> - <key> - <constant constantType="number" column="6" line="1" detail="int" value="0"/> - </key> - </accessor> - </variable> + <accessor> + <identifier column="4" line="1" value="a"/> + <key> + <constant constantType="number" column="6" line="1" detail="int" value="0"/> + </key> + </accessor> </group> </first> </operation> @@ -942,16 +917,12 @@ <operation operator="INC" column="7" line="1"> <first> <group> - <variable> - <accessor> - <variable> - <identifier column="2" line="1" value="a"/> - </variable> - <key> - <constant constantType="number" column="4" line="1" detail="int" value="0"/> - </key> - </accessor> - </variable> + <accessor> + <identifier column="2" line="1" value="a"/> + <key> + <constant constantType="number" column="4" line="1" detail="int" value="0"/> + </key> + </accessor> </group> </first> </operation> @@ -959,83 +930,85 @@ >>> --i <operation operator="DEC" column="1" line="1" left="true"> <first> - <variable> - <identifier column="3" line="1" value="i"/> - </variable> + <identifier column="3" line="1" value="i"/> </first> </operation> >>> i-- <operation operator="DEC" column="2" line="1"> <first> - <variable> - <identifier column="1" line="1" value="i"/> - </variable> + <identifier column="1" line="1" value="i"/> </first> </operation> >>> /* this is a comment */ var a = 4711; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="2"> - <identifier column="5" line="2" value="a"/> - <constant constantType="number" column="9" line="2" detail="int" value="4711"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="2"> + <identifier column="5" line="2" value="a"/> + <constant constantType="number" column="9" line="2" detail="int" value="4711"/> + </assignment> + </definition> + </definitionList> +</statements> >>> var a = 4711;/* this is a post-comment */ -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <constant constantType="number" column="9" line="1" detail="int" value="4711"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <constant constantType="number" column="9" line="1" detail="int" value="4711"/> + </assignment> + </definition> + </definitionList> +</statements> >>> /* this is a * multi-line comment */ var a = 4711; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="3"> - <identifier column="5" line="3" value="a"/> - <constant constantType="number" column="9" line="3" detail="int" value="4711"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="3"> + <identifier column="5" line="3" value="a"/> + <constant constantType="number" column="9" line="3" detail="int" value="4711"/> + </assignment> + </definition> + </definitionList> +</statements> >>> var a = /* this is an embedded comment */4711; -<definitionList> - <definition> - <assignment operator="ASSIGN" column="7" line="1"> - <identifier column="5" line="1" value="a"/> - <constant constantType="number" column="42" line="1" detail="int" value="4711"/> - </assignment> - </definition> -</definitionList> +<statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="7" line="1"> + <identifier column="5" line="1" value="a"/> + <constant constantType="number" column="42" line="1" detail="int" value="4711"/> + </assignment> + </definition> + </definitionList> +</statements> >>> function (/* comment in args */x) {var a=4711;} <function column="1" line="1"> <params> - <group> - <variable> - <identifier column="32" line="1" value="x"/> - </variable> - </group> + <identifier column="32" line="1" value="x"/> </params> <body> <block> - <definitionList> - <definition> - <assignment operator="ASSIGN" column="41" line="1"> - <identifier column="40" line="1" value="a"/> - <constant constantType="number" column="42" line="1" detail="int" value="4711"/> - </assignment> - </definition> - </definitionList> + <statements> + <definitionList> + <definition> + <assignment operator="ASSIGN" column="41" line="1"> + <identifier column="40" line="1" value="a"/> + <constant constantType="number" column="42" line="1" detail="int" value="4711"/> + </assignment> + </definition> + </definitionList> + </statements> </block> </body> </function> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-10-14 13:18:16
|
Revision: 21558 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21558&view=rev Author: derrell Date: 2011-10-14 13:18:10 +0000 (Fri, 14 Oct 2011) Log Message: ----------- correct term: we are doing authorization, not authentication. Modified Paths: -------------- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js 2011-10-14 13:17:57 UTC (rev 21557) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js 2011-10-14 13:18:10 UTC (rev 21558) @@ -39,13 +39,13 @@ _services : null, /** - * Function to call for authentication to run the service method. If - * null, no authentication is required. Otherwise this should be a + * Function to call for authorization to run the service method. If + * null, no authorization is required. Otherwise this should be a * function which takes as a parameter, the fully-qualified name of the * method to be called, and must return true to allow the function to be * called, or false otherwise, to indicate permission denied. */ - authenticationFunction : null, + authorizationFunction : null, /** * The service factory takes a method name and attempts to produce a @@ -97,8 +97,8 @@ } // Validate allowability of calling this function - if (rpcjs.AbstractRpcHandler.authenticationFunction && - !rpcjs.AbstractRpcHandler.authenticationFunction(fqMethodName)) + if (rpcjs.AbstractRpcHandler.authorizationFunction && + !rpcjs.AbstractRpcHandler.authorizationFunction(fqMethodName)) { // Permission denied error.setCode( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-10-14 13:18:03
|
Revision: 21557 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21557&view=rev Author: derrell Date: 2011-10-14 13:17:57 +0000 (Fri, 14 Oct 2011) Log Message: ----------- This code is mostly copied, so should retain original copyright notices. Modified Paths: -------------- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/remote/MExchange.js Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/remote/MExchange.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/remote/MExchange.js 2011-10-14 13:17:41 UTC (rev 21556) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/remote/MExchange.js 2011-10-14 13:17:57 UTC (rev 21557) @@ -1,6 +1,12 @@ /* + * qooxdoo - the new era of web development + * + * http://qooxdoo.org + * * Copyright: - * 2011 Derrell Lipman + * 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de + * 2006, 2011 Derrell Lipman + * 2006 STZ-IDA, Germany, http://www.stz-ida.de * * License: * LGPL: http://www.gnu.org/licenses/lgpl.html @@ -8,7 +14,10 @@ * See the LICENSE file in the project's top-level directory for details. * * Authors: + * * Sebastian Werner (wpbasti) + * * Andreas Ecker (ecker) * * Derrell Lipman (derrell) + * * Andreas Junghans (lucidcake) */ /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-10-14 13:17:47
|
Revision: 21556 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21556&view=rev Author: derrell Date: 2011-10-14 13:17:41 +0000 (Fri, 14 Oct 2011) Log Message: ----------- shorten line length for easier inclusion in LaTeX listings Modified Paths: -------------- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/rpc/Server.js trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Simulator.js trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/remote/Transport.js Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js 2011-10-14 09:34:34 UTC (rev 21555) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/AbstractRpcHandler.js 2011-10-14 13:17:41 UTC (rev 21556) @@ -49,19 +49,19 @@ /** * The service factory takes a method name and attempts to produce a - * service method that corresponds to that name. In this implementation, - * it concatenates the method name to the name of the variable holding the - * service map, and looks for corresponding method. + * service method that corresponds to that name. This implementation + * concatenates the method name to the name of the variable holding + * the service map, and looks for a corresponding method. * * @param fqMethodName {String} * The fully-qualified name of the method to be called. * * @param protocol {String} - * The JSON-RPC protocol being used ("qx1", "1.0", "2.0") + * The JSON-RPC protocol being used ("qx1", "2.0") * * @param error {rpcjs.rpc.error.Error} - * An error object to be set if an error is encountered in instantiating - * the requested service method. + * An error object to be set if an error is encountered in + * instantiating the requested service method. * * @return {Function} * The service method associated with the specified method name. Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/rpc/Server.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/rpc/Server.js 2011-10-14 09:34:34 UTC (rev 21555) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/rpc/Server.js 2011-10-14 13:17:41 UTC (rev 21556) @@ -435,9 +435,9 @@ // Yup. Initialize to an empty parameter list parameters = []; - // Map the arguments into the parameter array. (We are forgiving - // of members of request.params that are not in the formal - // parameter list. We just ignore them.) + // Map the arguments into the parameter array. (We are + // forgiving of members of request.params that are not + // in the formal parameter list. We just ignore them.) service.parameterNames.forEach( function(paramName) { @@ -448,7 +448,7 @@ } else { - // No provided parameters is equivalent to an empty parameter list + // No provided parameters is equivalent to an empty list parameters = []; } @@ -523,7 +523,7 @@ } else { - // It's not a notification. Run the requested service method now. + // It's not a notification. Run requested service method now. result = run(request); } Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Simulator.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Simulator.js 2011-10-14 09:34:34 UTC (rev 21555) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/Simulator.js 2011-10-14 13:17:41 UTC (rev 21556) @@ -125,7 +125,8 @@ // Pull the first element off of the queue request = requestQueue.shift(); - // Save the transport's post method, and delete it from the request + // Save the transport's post method, and delete it from the request. The + // handler should never see it. transportPost = request.post; delete request.post; @@ -141,16 +142,15 @@ // Call the handler's processRequest function. response = Simulator.__handlers[i](request, responseHeaders); - // Restore the transport's post method to the request object - request.post = transportPost; - // See what the handler did with this request. // status=200 means it handled the request successfully // status=501 means we need to try another handler; - // anything else means it handled the request but an error occurred + // else: handled the request but an error occurred if (responseHeaders.status == 200) { - // Yes it did! Send the response + // Yes it did! Restore the transport's post method to + // the request object and send the response. + request.post = transportPost; request.post(response, responseHeaders); break; } @@ -160,12 +160,22 @@ } else { - // The request got handled, but was not successful + // + // The request got handled, but was not successful. + // + + // Restore the transport's post method to the request + // object and send the error response. + request.post = transportPost; request.post(null, responseHeaders); break; } } + // Restore the transport's post method to the request object and send + // the error response. + request.post = transportPost; + // If we reached the end of the handler list... if (i == Simulator.__handlers.length) { @@ -175,6 +185,8 @@ status : 404, statusText : "No handler for URL " + request.url }; + + // Send the error response. request.post(null, responseHeaders); } Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/remote/Transport.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/remote/Transport.js 2011-10-14 09:34:34 UTC (rev 21555) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/sim/remote/Transport.js 2011-10-14 13:17:41 UTC (rev 21556) @@ -108,7 +108,7 @@ // Post this request to the simulator's request queue rpcjs.sim.Simulator.post(this.__request); - // Simulate sending state, how that we've "initiated" sending to our + // Simulate sending state, now that we've "initiated" sending to our // peer. (In reality, it's already arrived.) this.setState("sending"); }, @@ -347,16 +347,16 @@ defer : function() { - // Patch qx.io.remote.Exchange with our own send() method that supports - // looking at the "need" for a simulated transport. + // Patch qx.io.remote.Exchange with our own send() method that + // supports looking at the "need" for a simulated transport. qx.Class.patch(qx.io.remote.Exchange, rpcjs.sim.remote.MExchange); - // Similarly, for qx.io.remote.Request, except it can be a simple include - // since it's only adding a property. + // Similarly, for qx.io.remote.Request, except it can be a simple + // include since it's only adding a property. qx.Class.include(qx.io.remote.Request, rpcjs.sim.remote.MRequest); - // Patch qx.io.remote.Rpc with our own createRequest() method that supports - // setting the simulate property of the request. + // Patch qx.io.remote.Rpc with our own createRequest() method that + // supports setting the simulate property of the request. qx.Class.patch(qx.io.remote.Rpc, rpcjs.sim.remote.MRpc); // Register ourself with qx.io.remote.Exchange This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |