Style fixes in org-accept.js file.
authorPawel Solyga <Pawel.Solyga@gmail.com>
Mon, 16 Feb 2009 22:40:42 +0000
changeset 1367 9899e92121b7
parent 1366 ed246513e7cb
child 1368 bd710a3ee7e7
Style fixes in org-accept.js file. Patch by: Pawel Solyga Reviewed by: to-be-reviewed
app/soc/content/js/org-accept.js
--- a/app/soc/content/js/org-accept.js	Mon Feb 16 22:30:55 2009 +0000
+++ b/app/soc/content/js/org-accept.js	Mon Feb 16 22:40:42 2009 +0000
@@ -7,7 +7,7 @@
 	$.getJSON(bulk_accept_link,
 		function(data){
 			// If there are applications to accept...
-			if (data.nr_applications!=0) {
+			if (data.nr_applications != 0) {
 				//...then fade out the button, show the progress bar and call the function for acceptance
 				$("#button_accept").fadeOut("slow",
 					function() {
@@ -42,12 +42,12 @@
 		var error_happened = false;
 
 		var application = data.applications[application_index];
-		var current_application = application_index+1;
+		var current_application = application_index + 1;
 		// regular expression to find a valid scope path inside matching parenthesis
 		var re = /\((\w*)\)/;
 		var scope_path = GLOBAL_LINK.match(re)[1];
 		// the URL is obtained by using the scope path found in the matching parenthesis
-		var url_to_call = GLOBAL_LINK.replace(re,eval("application."+scope_path));
+		var url_to_call = GLOBAL_LINK.replace(re, eval("application." + scope_path));
 		// now we can call the URL found
 		$.ajax({
 			async: false,
@@ -58,11 +58,11 @@
 				if (data) {
 					// update progress bar percentage and description
 					var percentage = Math.floor(100 * (current_application) / (TOTAL_APPLICATIONS));
-					$("#description_progressbar").html(" Processed application "+application.name+" ("+(current_application)+"/"+TOTAL_APPLICATIONS+")");
+					$("#description_progressbar").html(" Processed application " + application.name + " (" + (current_application) + "/" + TOTAL_APPLICATIONS + ")");
 					$("#applications_progress_bar").progressBar(percentage);
 				}
 			},
-			error: function(XMLHttpRequest,textStatus,errorThrown) {
+			error: function(XMLHttpRequest, textStatus, errorThrown) {
 				// if there is an error rename the button to Retry and show an error message
 				error_happened = true;
 				$("#button_accept").val("Retry");
@@ -75,8 +75,8 @@
 		if (!error_happened) {
 			// prepare for new iteration and then recall this function
 			application_index++;
-			if (application_index<total_index) {
-				setTimeout(arguments.callee,0);
+			if (application_index < total_index) {
+				setTimeout(arguments.callee, 0);
 			}
 			else {
 				// all ok, tell the user we are done