Update of /cvsroot/qooxdoo/qooxdoo/source/contributed/httptransport_ricks
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5189/httptransport_ricks
Modified Files:
Tag: renderer
Http_Transport_1.html QxHttpTransport.js
QxHttpTransportQueue.js
Log Message:
dos2unix
Index: QxHttpTransportQueue.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/contributed/httptransport_ricks/Attic/QxHttpTransportQueue.js,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- QxHttpTransportQueue.js 24 Jan 2006 14:12:45 -0000 1.1.2.1
+++ QxHttpTransportQueue.js 3 Feb 2006 09:58:00 -0000 1.1.2.2
@@ -1,127 +1,127 @@
-/*****************************************************************************
-
- qooxdoo - the new era of web interface development
-
- Version:
- $Id$
-
- Copyright:
- (C) 2006 by IT Operations PTY LTD (www.itoperations.com.au)
- All rights reserved
-
- License:
- LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/
-
- Internet:
- * http://qooxdoo.oss.schlund.de
-
- Authors:
- * Chris Ricks
- <chris at itoperations dot com dot au>
-
-*****************************************************************************/
-
-function QxHttpTransportQueue(activeCount, queuedCount) {
- if (!activeCount) {
- throw new Error("Active queue length must be explicitly set.");
- } else {
- this.setActiveLimit(activeCount);
- }
-
- if (queuedCount) {
- this.setQueueLimit(queuedCount);
- }
-
- this._active = new Array();
-
- if (0 != this.getQueueLimit()) {
- this._queued = new Array();
- }
-}
-
-QxHttpTransportQueue.extend(QxTarget, "QxHttpTransportQueue");
-
-proto._activeLimit = -1;
-
-QxHttpTransportQueue.addProperty({name : "queueLimit", type : QxConst.TYPEOF_NUMBER, defaultValue : -1});
-
-proto.getActiveLimit = function() {
- return this._activeLimit;
-}
-
-proto.setActiveLimit = function(limit) {
- if (0 <= limit && limit != this._activeLimit) {
- if (-1 == this._activeLimit) {
- QxHttpTransport.alterPoolSize(limit);
- } else {
- QxHttpTransport.alterPoolSize(limit - this._activeLimit);
- }
- this._activeLimit = limit;
- }
-}
-
-proto._active = null;
-proto._queued = null;
-
-proto.add = function() {
- for (var i = 0; i < arguments.length; i++) {
- this._add(arguments[i]);
- }
-}
-
-proto.remove = function() {
- for (var i = 0; i < arguments.length; i++) {
- this._remove(arguments[i]);
- }
-}
-
-proto.contains = function(req) {
- if (this._active.contains(req) || this._queued.contains(req)) {
- return true;
- } else {
- return false;
- }
-}
-
-proto._add = function(req) {
- if (this.contains(req)) {
- return;
- }
- if (this.getActiveLimit() == -1 || this._active.length < this.getActiveLimit()) {
- this._active.push(req);
- req._begin();
- return true;
- } else if (this.getQueueLimit() == -1 || this._queued.length < this.getQueueLimit()) {
- this._queued.push(req);
- return true;
- } else {
- return false;
- }
-}
-
-proto._pump = function() {
- if (this._active.length < this.getActiveLimit() && this._queued.length > 0) {
- var req = this._queued.getFirst();
- this._active.push(req);
- this._queued.remove(req);
- req._begin();
- }
-}
-
-proto.dispose = function() {
- // Cowardly refuse to dispose a non-empty queue instance
- if (0 == this._active.length && 0 == this._queued.length) {
- delete this._active;
- delete this._queued;
-
- return QxTarget.prototype.dispose.call(this);
- } else {
- return false;
- }
-}
-
-proto._remove = function(req) {
- this._active.remove(req);
- this._queued.remove(req);
- this._pump();
+/*****************************************************************************
+
+ qooxdoo - the new era of web interface development
+
+ Version:
+ $Id$
+
+ Copyright:
+ (C) 2006 by IT Operations PTY LTD (www.itoperations.com.au)
+ All rights reserved
+
+ License:
+ LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/
+
+ Internet:
+ * http://qooxdoo.oss.schlund.de
+
+ Authors:
+ * Chris Ricks
+ <chris at itoperations dot com dot au>
+
+*****************************************************************************/
+
+function QxHttpTransportQueue(activeCount, queuedCount) {
+ if (!activeCount) {
+ throw new Error("Active queue length must be explicitly set.");
+ } else {
+ this.setActiveLimit(activeCount);
+ }
+
+ if (queuedCount) {
+ this.setQueueLimit(queuedCount);
+ }
+
+ this._active = new Array();
+
+ if (0 != this.getQueueLimit()) {
+ this._queued = new Array();
+ }
+}
+
+QxHttpTransportQueue.extend(QxTarget, "QxHttpTransportQueue");
+
+proto._activeLimit = -1;
+
+QxHttpTransportQueue.addProperty({name : "queueLimit", type : QxConst.TYPEOF_NUMBER, defaultValue : -1});
+
+proto.getActiveLimit = function() {
+ return this._activeLimit;
+}
+
+proto.setActiveLimit = function(limit) {
+ if (0 <= limit && limit != this._activeLimit) {
+ if (-1 == this._activeLimit) {
+ QxHttpTransport.alterPoolSize(limit);
+ } else {
+ QxHttpTransport.alterPoolSize(limit - this._activeLimit);
+ }
+ this._activeLimit = limit;
+ }
+}
+
+proto._active = null;
+proto._queued = null;
+
+proto.add = function() {
+ for (var i = 0; i < arguments.length; i++) {
+ this._add(arguments[i]);
+ }
+}
+
+proto.remove = function() {
+ for (var i = 0; i < arguments.length; i++) {
+ this._remove(arguments[i]);
+ }
+}
+
+proto.contains = function(req) {
+ if (this._active.contains(req) || this._queued.contains(req)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+proto._add = function(req) {
+ if (this.contains(req)) {
+ return;
+ }
+ if (this.getActiveLimit() == -1 || this._active.length < this.getActiveLimit()) {
+ this._active.push(req);
+ req._begin();
+ return true;
+ } else if (this.getQueueLimit() == -1 || this._queued.length < this.getQueueLimit()) {
+ this._queued.push(req);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+proto._pump = function() {
+ if (this._active.length < this.getActiveLimit() && this._queued.length > 0) {
+ var req = this._queued.getFirst();
+ this._active.push(req);
+ this._queued.remove(req);
+ req._begin();
+ }
+}
+
+proto.dispose = function() {
+ // Cowardly refuse to dispose a non-empty queue instance
+ if (0 == this._active.length && 0 == this._queued.length) {
+ delete this._active;
+ delete this._queued;
+
+ return QxTarget.prototype.dispose.call(this);
+ } else {
+ return false;
+ }
+}
+
+proto._remove = function(req) {
+ this._active.remove(req);
+ this._queued.remove(req);
+ this._pump();
}
\ No newline at end of file
Index: Http_Transport_1.html
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/contributed/httptransport_ricks/Attic/Http_Transport_1.html,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- Http_Transport_1.html 24 Jan 2006 14:25:19 -0000 1.1.2.2
+++ Http_Transport_1.html 3 Feb 2006 09:58:00 -0000 1.1.2.3
@@ -1,138 +1,138 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
-<head>
- <script type="text/javascript">window._htmlstart=(new Date).valueOf()</script>
-
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
- <meta http-equiv="MsThemeCompatible" content="yes" />
- <meta http-equiv="ImageToolBar" content="no" />
- <meta name="MSSmartTagsPreventParsing" content="yes" />
-
- <title>qooxdoo demo dev</title>
- <link type="text/css" rel="stylesheet" href="../../style/qooxdoo.css"/>
- <link type="text/css" rel="stylesheet" href="../../style/demolayout.css"/>
-
- <script type="text/javascript" src="../../../tools/script/includer.js"></script>
- <script type="text/javascript" src="QxHttpTransportQueue.js"></script>
- <script type="text/javascript" src="QxHttpTransport.js"></script>
-</head>
-<body>
- <script type="text/javascript" src="../../../tools/script/demolayout.js"></script>
- <div id="testDescription">
- <p>QxHttpTransport test - Ugly but functional</p>
- </div>
- <script type="text/javascript">
- window.application.main = function() {
- var d = this.getClientWindow().getClientDocument();
-
- var req = new QxHttpTransport();
- var queue = new QxHttpTransportQueue(1);
-
- req.setQueue(queue);
-
- var ta = new QxTextArea();
- var fs = new QxFieldSet("Response");
- var statLabel = new QxLabel("Status code:");
- var statCode = new QxTextField();
-
- var sizeLabel = new QxLabel("Transfer:");
- var sizeText = new QxTextField();
-
- function handleSendClick(e) {
- sizeText.setValue("0");
- req.setTarget(targetBox.getValue());
- req.setPayload(payloadBox.getValue());
- req.send();
- }
-
- function inspect(obj) {
- var s = new String();
-
- for (var i in obj) {
- s += i + ": " + obj[i] + "\n";
- }
- return s;
- }
-
- function handleReqDone(e) {
- ta.setValue(this.getResponseText());
- statCode.setValue(this.getReadyState().toString());
- }
-
- function handleReqError(e) {
- ta.setValue(inspect(e));
- statCode.setValue(this.getReadyState().toString);
- }
-
- function handleReqProgress(e) {
- sizeText.setValue(this.getFetchedLength().toString());
- }
-
- statLabel.setLocation(200, 48);
- statCode.setLocation(280, 48);
- statCode.setReadOnly(true);
-
- sizeLabel.setLocation(200, 78);
- sizeText.setLocation(280, 78);
-
- fs.setLocation(20, 150);
- fs.setWidth(600);
- fs.setHeight(600);
- fs.add(ta)
- ta.setHeight("100%");
- ta.setWidth("100%");
- ta.setReadOnly(true);
-
- this.add(fs);
- this.add(statLabel);
- this.add(statCode);
-
- this.add(sizeLabel);
- this.add(sizeText);
-
- req.addEventListener("error", handleReqError);
- req.addEventListener("done", handleReqDone);
- req.addEventListener("progress", handleReqProgress);
-
- var grid = new QxGridLayout();
- this.add(grid);
-
- with (grid) {
- setLocation(20, 48);
- setColumnCount(2);
- setDimension("auto", "auto");
- setBorder(QxBorderObject.presets.outset);
- setRowCount(3);
- setVerticalSpacing(4);
- setPadding(8);
-
- for (var i = 0; i < getRowCount(); i++) {
- setRowHeight(i, 20);
- }
-
- setColumnWidth(0, 45);
- setColumnWidth(1, 100);
- }
-
- var targetLabel = new QxLabel("Target");
- var targetBox = new QxTextField();
-
- var payloadLabel = new QxLabel("Payload");
- var payloadBox = new QxTextField();
-
- var button = new QxButton("Send");
- button.setHorizontalAlign("right");
- button.addEventListener("execute", handleSendClick);
-
- grid.add(targetLabel, 0, 0);
- grid.add(targetBox, 1, 0);
- grid.add(payloadLabel, 0, 1);
- grid.add(payloadBox, 1, 1);
- grid.add(button, 1, 2);
-
-
- }
- </script>
-</body>
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
+<head>
+ <script type="text/javascript">window._htmlstart=(new Date).valueOf()</script>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
+ <meta http-equiv="MsThemeCompatible" content="yes" />
+ <meta http-equiv="ImageToolBar" content="no" />
+ <meta name="MSSmartTagsPreventParsing" content="yes" />
+
+ <title>qooxdoo demo dev</title>
+ <link type="text/css" rel="stylesheet" href="../../style/qooxdoo.css"/>
+ <link type="text/css" rel="stylesheet" href="../../style/demolayout.css"/>
+
+ <script type="text/javascript" src="../../../tools/script/includer.js"></script>
+ <script type="text/javascript" src="QxHttpTransportQueue.js"></script>
+ <script type="text/javascript" src="QxHttpTransport.js"></script>
+</head>
+<body>
+ <script type="text/javascript" src="../../../tools/script/demolayout.js"></script>
+ <div id="testDescription">
+ <p>QxHttpTransport test - Ugly but functional</p>
+ </div>
+ <script type="text/javascript">
+ window.application.main = function() {
+ var d = this.getClientWindow().getClientDocument();
+
+ var req = new QxHttpTransport();
+ var queue = new QxHttpTransportQueue(1);
+
+ req.setQueue(queue);
+
+ var ta = new QxTextArea();
+ var fs = new QxFieldSet("Response");
+ var statLabel = new QxLabel("Status code:");
+ var statCode = new QxTextField();
+
+ var sizeLabel = new QxLabel("Transfer:");
+ var sizeText = new QxTextField();
+
+ function handleSendClick(e) {
+ sizeText.setValue("0");
+ req.setTarget(targetBox.getValue());
+ req.setPayload(payloadBox.getValue());
+ req.send();
+ }
+
+ function inspect(obj) {
+ var s = new String();
+
+ for (var i in obj) {
+ s += i + ": " + obj[i] + "\n";
+ }
+ return s;
+ }
+
+ function handleReqDone(e) {
+ ta.setValue(this.getResponseText());
+ statCode.setValue(this.getReadyState().toString());
+ }
+
+ function handleReqError(e) {
+ ta.setValue(inspect(e));
+ statCode.setValue(this.getReadyState().toString);
+ }
+
+ function handleReqProgress(e) {
+ sizeText.setValue(this.getFetchedLength().toString());
+ }
+
+ statLabel.setLocation(200, 48);
+ statCode.setLocation(280, 48);
+ statCode.setReadOnly(true);
+
+ sizeLabel.setLocation(200, 78);
+ sizeText.setLocation(280, 78);
+
+ fs.setLocation(20, 150);
+ fs.setWidth(600);
+ fs.setHeight(600);
+ fs.add(ta)
+ ta.setHeight("100%");
+ ta.setWidth("100%");
+ ta.setReadOnly(true);
+
+ this.add(fs);
+ this.add(statLabel);
+ this.add(statCode);
+
+ this.add(sizeLabel);
+ this.add(sizeText);
+
+ req.addEventListener("error", handleReqError);
+ req.addEventListener("done", handleReqDone);
+ req.addEventListener("progress", handleReqProgress);
+
+ var grid = new QxGridLayout();
+ this.add(grid);
+
+ with (grid) {
+ setLocation(20, 48);
+ setColumnCount(2);
+ setDimension("auto", "auto");
+ setBorder(QxBorderObject.presets.outset);
+ setRowCount(3);
+ setVerticalSpacing(4);
+ setPadding(8);
+
+ for (var i = 0; i < getRowCount(); i++) {
+ setRowHeight(i, 20);
+ }
+
+ setColumnWidth(0, 45);
+ setColumnWidth(1, 100);
+ }
+
+ var targetLabel = new QxLabel("Target");
+ var targetBox = new QxTextField();
+
+ var payloadLabel = new QxLabel("Payload");
+ var payloadBox = new QxTextField();
+
+ var button = new QxButton("Send");
+ button.setHorizontalAlign("right");
+ button.addEventListener("execute", handleSendClick);
+
+ grid.add(targetLabel, 0, 0);
+ grid.add(targetBox, 1, 0);
+ grid.add(payloadLabel, 0, 1);
+ grid.add(payloadBox, 1, 1);
+ grid.add(button, 1, 2);
+
+
+ }
+ </script>
+</body>
</html>
\ No newline at end of file
Index: QxHttpTransport.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/contributed/httptransport_ricks/Attic/QxHttpTransport.js,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- QxHttpTransport.js 24 Jan 2006 14:12:45 -0000 1.1.2.1
+++ QxHttpTransport.js 3 Feb 2006 09:58:00 -0000 1.1.2.2
@@ -1,632 +1,632 @@
-/*****************************************************************************
-
- qooxdoo - the new era of web interface development
-
- Version:
- $Id$
-
- Copyright:
- (C) 2006 by IT Operations PTY LTD (www.itoperations.com.au)
- All rights reserved
-
[...1233 lines suppressed...]
+
+ this._activeTimeouts[endState].push(timeout);
+ this._pendingTimeouts[rs].removeAt(i);
+ timeout.start();
+ }
+ }
+ }
+}
+
+proto._depopulateActiveTimeoutQueue = function(queue) {
+ for (var i = 0; i < queue.length; i++) {
+ var timeout = queue[i];
+ var startState = timeout.getData("startstate");
+
+ timeout.stop();
+ this._pendingTimeouts[startState].push(timeout);
+ queue.removeAt(i);
+ }
+}
+
|