You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by cm...@apache.org on 2014/08/25 07:57:49 UTC

[03/15] git commit: Improve comments, logs and variable names. No functional changes

Improve comments, logs and variable names. No functional changes


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/5af8ea44
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/5af8ea44
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/5af8ea44

Branch: refs/heads/WICKET-5677
Commit: 5af8ea44e905fb70390e129e93ff1862ea1ff30d
Parents: 7ff5623
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Aug 18 12:27:35 2014 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Aug 18 12:27:35 2014 +0300

----------------------------------------------------------------------
 .../apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/5af8ea44/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index ee05cd8..694ef0e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -261,7 +261,7 @@
 			var res = name.match(/^([^|]+)\|(d|s|a)$/);
 			if (isUndef(res)) {
 				this.name = '0'; // '0' is the default channel name
-				this.type = 's'; // default to stack
+				this.type = 's'; // default to stack/queue
 			}
 			else {
 				this.name = res[1];
@@ -282,14 +282,14 @@
 				}
 			} else {
 				var busyChannel = "Channel '"+ this.name+"' is busy";
-				if (this.type === 's') { // stack
+				if (this.type === 's') { // stack/queue
 					Wicket.Log.info(busyChannel + " - scheduling the callback to be executed when the previous request finish.");
 					this.callbacks.push(callback);
 				}
 				else if (this.type === 'd') { // drop
-					Wicket.Log.info(busyChannel + " - dropping all previous scheduled callbacks and scheduled a new one to be executed when the current request finish.");
+					Wicket.Log.info(busyChannel + " - dropping all previous scheduled callbacks and scheduling a new one to be executed when the current request finish.");
 					this.callbacks = [];
-					this.callbacks[0] = callback;
+					this.callbacks.push(callback);
 				} else if (this.type === 'a') { // active
 					Wicket.Log.info(busyChannel + " - ignoring the Ajax call because there is a running request.");
 				}
@@ -298,17 +298,17 @@
 		},
 
 		done: function () {
-			var c = null;
+			var callback = null;
 
 			if (this.callbacks.length > 0) {
-				c = this.callbacks.shift();
+				callback = this.callbacks.shift();
 			}
 
-			if (c !== null && typeof(c) !== "undefined") {
+			if (callback !== null && typeof(callback) !== "undefined") {
 				Wicket.Log.info("Calling postponed function...");
 				// we can't call the callback from this call-stack
 				// therefore we set it on timer event
-				window.setTimeout(c, 1);
+				window.setTimeout(callback, 1);
 			} else {
 				this.busy = false;
 			}