You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2013/02/06 16:07:40 UTC

[5/8] git commit: Warnings cleanup. No functional changes!

Warnings cleanup.
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/5f3cfa13
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/5f3cfa13
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/5f3cfa13

Branch: refs/heads/master
Commit: 5f3cfa1361938251a3a5f3c48b9597353c24585d
Parents: ccb4b0f
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Wed Feb 6 14:39:52 2013 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Wed Feb 6 16:07:29 2013 +0100

----------------------------------------------------------------------
 .../wicket/ajax/res/js/wicket-ajax-jquery.js       |   38 +++++++--------
 wicket-core/src/test/js/ajax.js                    |   26 +++++-----
 2 files changed, 30 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/5f3cfa13/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 53c09f5..358dd31 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
@@ -65,7 +65,7 @@
 	 * Creates an iframe that can be used to load data asynchronously or as a
 	 * target for Ajax form submit.
 	 *
-	 * @param {String} the value of the iframe's name attribute
+	 * @param iframeName {String} the value of the iframe's name attribute
 	 */
 	createIFrame = function (iframeName) {
 		var $iframe = jQuery('<iframe name="'+iframeName+'" id="'+iframeName+
@@ -359,7 +359,7 @@
 		/**
 		 * A helper function that executes an array of handlers (before, success, failure)
 		 *
-		 * @param {Array[FunctionBody]} handlers - the handlers to execute
+		 * @param handlers {Array[FunctionBody]} - the handlers to execute
 		 */
 		_executeHandlers: function (handlers) {
 			if (jQuery.isArray(handlers)) {
@@ -388,13 +388,15 @@
 		 * @see jQuery.serializeArray
 		 */
 		_asParamArray: function(parameters) {
-			var result = [];
+			var result = [],
+				value,
+				name;
 			if (jQuery.isArray(parameters)) {
 				result = parameters;
 			}
 			else if (jQuery.isPlainObject(parameters)) {
-				for (var name in parameters) {
-					var value = parameters[name];
+				for (name in parameters) {
+					value = parameters[name];
 					result.push({name: name, value: value});
 				}
 			}
@@ -610,7 +612,7 @@
 		/**
 		 * Method that processes a manually supplied <ajax-response>.
 		 *
-		 * @param {XmlDocument} data - the <ajax-response> XML document
+		 * @param data {XmlDocument} - the <ajax-response> XML document
 		 */
 		process: function(data) {
 			var context =  {
@@ -626,10 +628,10 @@
 		/**
 		 * Method that processes the <ajax-response> in the context of an XMLHttpRequest.
 		 *
-		 * @param {XmlDocument} data - the <ajax-response> XML document
-		 * @param {String} textStatus - the response status as text (e.g. 'success', 'parsererror', etc.)
-		 * @param {Object} jqXHR - the jQuery wrapper around XMLHttpRequest
-		 * @param {Object} context - the request context with the Ajax request attributes and the FunctionExecuter's steps
+		 * @param data {XmlDocument} - the <ajax-response> XML document
+		 * @param textStatus {String} - the response status as text (e.g. 'success', 'parsererror', etc.)
+		 * @param jqXHR {Object} - the jQuery wrapper around XMLHttpRequest
+		 * @param context {Object} - the request context with the Ajax request attributes and the FunctionExecuter's steps
 		 */
 		processAjaxResponse: function (data, textStatus, jqXHR, context) {
 
@@ -985,10 +987,8 @@
 
 		/**
 		 * Adds a closure that evaluates javascript code.
-		 * @param steps {Array} - the steps for FunctionExecutor
+		 * @param context {Object} - the object that brings the executer's steps and the attributes
 		 * @param node {XmlElement} - the <[priority-]evaluate> element with the script to evaluate
-		 * @param attrs {Object} - the attributes used for the Ajax request
-		 * @param event {jQuery.Event} - the event that caused this Ajax call
 		 */
 		processEvaluation: function (context, node) {
 			context.steps.push(function (notify) {
@@ -1247,7 +1247,7 @@
 			/**
 			 * Serializes HTMLFormSelectElement to URL encoded key=value string.
 			 *
-			 * @param {HTMLFormSelectElement} select - the form element to serialize
+			 * @param select {HTMLFormSelectElement} - the form element to serialize
 			 * @return an object of key -> value pair where 'value' can be an array of Strings if the select is .multiple,
 			 *		or empty object if the form element is disabled.
 			 */
@@ -1279,7 +1279,7 @@
 			 *
 			 * Note: this function intentionally ignores image and submit inputs.
 			 *
-			 * @param {HtmlFormElement} input - the form element to serialize
+			 * @param input {HtmlFormElement} - the form element to serialize
 			 * @return the URL encoded key=value pair or empty string if the form element is disabled.
 			 */
 			serializeInput: function (input) {
@@ -2209,14 +2209,11 @@
 			/**
 			 * Called when the mouse button is released.
 			 * Cleans all temporary variables and callback methods.
-			 *
-			 * @param {Event} e
 			 */
-			mouseUp: function (e) {
-				e = Wicket.Event.fix(e);
+			mouseUp: function () {
 				var o = Wicket.Drag.current;
 
-				if (o !== null && typeof(o) !== "undefined") {
+				if (o) {
 					o.wicketOnDragEnd(o);
 
 					o.lastMouseX = null;
@@ -2294,7 +2291,6 @@
 					Wicket.Log.info("returned focused element: " + Wicket.$(Wicket.Focus.lastFocusId));
 					return Wicket.$(Wicket.Focus.lastFocusId);
 				}
-				return;
 			},
 
 			setFocusOnId: function (id) {

http://git-wip-us.apache.org/repos/asf/wicket/blob/5f3cfa13/wicket-core/src/test/js/ajax.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/ajax.js b/wicket-core/src/test/js/ajax.js
index 89cf000..acf5b74 100644
--- a/wicket-core/src/test/js/ajax.js
+++ b/wicket-core/src/test/js/ajax.js
@@ -101,7 +101,7 @@ jQuery(document).ready(function() {
 			var attrs = {
 				u: 'data/ajax/evaluationIdentifierAndCodeId.xml',
 				c: 'evaluationIdentifierAndCodeId'
-			}
+			};
 			execute(attrs);
 		});
 
@@ -120,7 +120,7 @@ jQuery(document).ready(function() {
 						equal(jQuery('#componentToReplace').text(), 'new body', 'The component must be replaced');
 					}
 				]
-			}
+			};
 			execute(attrs);
 		});
 
@@ -147,7 +147,7 @@ jQuery(document).ready(function() {
 						equal(jQuery('#componentToReplaceDoesNotExist').length, 0, 'A component with id \'componentToReplaceDoesNotExist\' must not exist!');
 					}
 				]
-			}
+			};
 			execute(attrs);
 		});
 
@@ -164,7 +164,7 @@ jQuery(document).ready(function() {
 						equal(jQuery('#componentToReplace')[0].tagName.toLowerCase(), 'table', 'A component with id \'componentToReplace\' must be a table now!');
 					}
 				]
-			}
+			};
 			execute(attrs);
 
 		});
@@ -187,7 +187,7 @@ jQuery(document).ready(function() {
 						$title.text(oldTitle);
 					}
 				]
-			}
+			};
 			execute(attrs);
 		});
 
@@ -211,7 +211,7 @@ jQuery(document).ready(function() {
 						equal('success', textStatus);
 					}
 				]
-			}
+			};
 			execute(attrs);
 		});
 
@@ -242,7 +242,7 @@ jQuery(document).ready(function() {
 						}
 					}
 				]
-			}
+			};
 
 			Wicket.Ajax.ajax(attrs);
 
@@ -278,7 +278,7 @@ jQuery(document).ready(function() {
 						equal('success', textStatus);
 					}
 				]
-			}
+			};
 
 			Wicket.Ajax.ajax(attrs);
 
@@ -340,7 +340,7 @@ jQuery(document).ready(function() {
 						equal(attrs.u, attributes.u, 'Complete: attributes equal');
 					}
 				]
-			}
+			};
 
 			Wicket.Ajax.ajax(attrs);
 
@@ -388,7 +388,7 @@ jQuery(document).ready(function() {
 						equal(attrs.u, attributes.u);
 					}
 				]
-			}
+			};
 
 			Wicket.Ajax.ajax(attrs);
 
@@ -410,7 +410,7 @@ jQuery(document).ready(function() {
 				coh: [
 					function(attributes, jqXHR, textStatus) {
 						start();
-						equal(textStatus, "parsererror", "textStatus")
+						equal(textStatus, "parsererror", "textStatus");
 						equal(attributes.u, attrs.u, "url");
 						deepEqual(attributes.e, [ "domready" ], "events");
 						equal(attributes.ch, '0|s', 'channel');
@@ -436,7 +436,7 @@ jQuery(document).ready(function() {
 
 					}
 				]
-			}
+			};
 
 			Wicket.Ajax.ajax(attrs);
 		});
@@ -697,7 +697,7 @@ jQuery(document).ready(function() {
 					equal(attrs.u, attributes.u, 'Before: attrs');
 				}],
 				pre: [function() {
-					ok(true, "Precondition is called!")
+					ok(true, "Precondition is called!");
 					// do not allow calling of beforeSend handlers
 					return false;
 				}],