Skip to content
This repository

Manual indent code for beautiful - before many lines had random indents ( #141

Closed
wants to merge 2 commits into from

2 participants

Perlover Mike Alsup
Perlover

I only made indents because ones were broken editing before as i think
Please merge if you are agree with me :)
I kept the style - nothing done
Only editing tabs & spaces :)

Mike Alsup
Owner

All tabs have been converted to spaces.

Mike Alsup malsup closed this March 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 87 additions and 87 deletions. Show diff stats Hide diff stats

  1. 174  jquery.form.js
174  jquery.form.js
@@ -49,7 +49,7 @@ $.fn.ajaxSubmit = function(options) {
49 49
 		log('ajaxSubmit: skipping submit process - no element selected');
50 50
 		return this;
51 51
 	}
52  
-	
  52
+
53 53
 	var method, action, url, $form = this;
54 54
 
55 55
 	if (typeof options == 'function') {
@@ -87,15 +87,15 @@ $.fn.ajaxSubmit = function(options) {
87 87
 		return this;
88 88
 	}
89 89
 
90  
-   var traditional = options.traditional;
91  
-   if ( traditional === undefined ) {
92  
-      traditional = $.ajaxSettings.traditional;
93  
-   }
94  
-   
  90
+	var traditional = options.traditional;
  91
+	if ( traditional === undefined ) {
  92
+	   traditional = $.ajaxSettings.traditional;
  93
+	}
  94
+
95 95
 	var qx,n,v,a = this.formToArray(options.semantic);
96 96
 	if (options.data) {
97 97
 		options.extraData = options.data;
98  
-      qx = $.param(options.data, traditional);
  98
+		qx = $.param(options.data, traditional);
99 99
 	}
100 100
 
101 101
 	// give pre-submit callback an opportunity to abort the submit
@@ -112,8 +112,8 @@ $.fn.ajaxSubmit = function(options) {
112 112
 	}
113 113
 
114 114
 	var q = $.param(a, traditional);
115  
-   if (qx)
116  
-      q = ( q ? (q + '&' + qx) : qx );
  115
+	if (qx)
  116
+	   q = ( q ? (q + '&' + qx) : qx );
117 117
 
118 118
 	if (options.type.toUpperCase() == 'GET') {
119 119
 		options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
@@ -144,7 +144,7 @@ $.fn.ajaxSubmit = function(options) {
144 144
 	}
145 145
 
146 146
 	options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
147  
-		var context = options.context || options;   // jQuery 1.4+ supports scope context 
  147
+		var context = options.context || options;   // jQuery 1.4+ supports scope context
148 148
 		for (var i=0, max=callbacks.length; i < max; i++) {
149 149
 			callbacks[i].apply(context, [data, status, xhr || $form, $form]);
150 150
 		}
@@ -157,25 +157,25 @@ $.fn.ajaxSubmit = function(options) {
157 157
 
158 158
 	// options.iframe allows user to force iframe mode
159 159
 	// 06-NOV-09: now defaulting to iframe mode if file input is detected
160  
-   if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
161  
-	   // hack to fix Safari hang (thanks to Tim Molendijk for this)
162  
-	   // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
163  
-	   if (options.closeKeepAlive) {
164  
-		   $.get(options.closeKeepAlive, function() { fileUpload(a); });
165  
-		}
166  
-	   else {
167  
-		   fileUpload(a);
168  
-		}
169  
-   }
170  
-   else {
171  
-		// IE7 massage (see issue 57)
172  
-		if ($.browser.msie && method == 'get' && typeof options.type === "undefined") {
173  
-			var ieMeth = $form[0].getAttribute('method');
174  
-			if (typeof ieMeth === 'string')
175  
-				options.type = ieMeth;
176  
-		}
177  
-		$.ajax(options);
178  
-   }
  160
+	if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
  161
+		// hack to fix Safari hang (thanks to Tim Molendijk for this)
  162
+		// see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
  163
+		if (options.closeKeepAlive) {
  164
+			$.get(options.closeKeepAlive, function() { fileUpload(a); });
  165
+		     }
  166
+		else {
  167
+			fileUpload(a);
  168
+		     }
  169
+	}
  170
+	else {
  171
+		     // IE7 massage (see issue 57)
  172
+		     if ($.browser.msie && method == 'get' && typeof options.type === "undefined") {
  173
+			     var ieMeth = $form[0].getAttribute('method');
  174
+			     if (typeof ieMeth === 'string')
  175
+				     options.type = ieMeth;
  176
+		     }
  177
+		     $.ajax(options);
  178
+	}
179 179
 
180 180
 	// fire 'notify' event
181 181
 	this.trigger('form-submit-notify', [this, options]);
@@ -185,22 +185,22 @@ $.fn.ajaxSubmit = function(options) {
185 185
 	// private function for handling file uploads (hat tip to YAHOO!)
186 186
 	function fileUpload(a) {
187 187
 		var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
188  
-        var useProp = !!$.fn.prop;
189  
-
190  
-        if (a) {
191  
-            if ( useProp ) {
192  
-            	// ensure that every serialized input is still enabled
193  
-              	for (i=0; i < a.length; i++) {
194  
-                    el = $(form[a[i].name]);
195  
-                    el.prop('disabled', false);
196  
-              	}
197  
-            } else {
198  
-              	for (i=0; i < a.length; i++) {
199  
-                    el = $(form[a[i].name]);
200  
-                    el.removeAttr('disabled');
201  
-              	}
202  
-            };
203  
-        }
  188
+		var useProp = !!$.fn.prop;
  189
+
  190
+		if (a) {
  191
+		    if ( useProp ) {
  192
+			// ensure that every serialized input is still enabled
  193
+			for (i=0; i < a.length; i++) {
  194
+			    el = $(form[a[i].name]);
  195
+			    el.prop('disabled', false);
  196
+			}
  197
+		    } else {
  198
+			for (i=0; i < a.length; i++) {
  199
+			    el = $(form[a[i].name]);
  200
+			    el.removeAttr('disabled');
  201
+			}
  202
+		    };
  203
+		}
204 204
 
205 205
 		if ($(':input[name=submit],:input[id=submit]', form).length) {
206 206
 			// if there is an input with a name or id of 'submit' then we won't be
@@ -208,7 +208,7 @@ $.fn.ajaxSubmit = function(options) {
208 208
 			alert('Error: Form elements must not have name or id of "submit".');
209 209
 			return;
210 210
 		}
211  
-		
  211
+
212 212
 		s = $.extend(true, {}, $.ajaxSettings, options);
213 213
 		s.context = s.context || s;
214 214
 		id = 'jqFormIO' + (new Date().getTime());
@@ -216,7 +216,7 @@ $.fn.ajaxSubmit = function(options) {
216 216
 			$io = $(s.iframeTarget);
217 217
 			n = $io.attr('name');
218 218
 			if (n == null)
219  
-			 	$io.attr('name', id);
  219
+				$io.attr('name', id);
220 220
 			else
221 221
 				id = n;
222 222
 		}
@@ -280,7 +280,7 @@ $.fn.ajaxSubmit = function(options) {
280 280
 				}
281 281
 			}
282 282
 		}
283  
-		
  283
+
284 284
 		var CLIENT_TIMEOUT_ABORT = 1;
285 285
 		var SERVER_ABORT = 2;
286 286
 
@@ -288,7 +288,7 @@ $.fn.ajaxSubmit = function(options) {
288 288
 			var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;
289 289
 			return doc;
290 290
 		}
291  
-		
  291
+
292 292
 		// take a breath so that pending repaints get some cpu time before the upload starts
293 293
 		function doSubmit() {
294 294
 			// make sure form attrs are set
@@ -315,7 +315,7 @@ $.fn.ajaxSubmit = function(options) {
315 315
 			if (s.timeout) {
316 316
 				timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
317 317
 			}
318  
-			
  318
+
319 319
 			// look for server aborts
320 320
 			function checkState() {
321 321
 				try {
@@ -346,7 +346,7 @@ $.fn.ajaxSubmit = function(options) {
346 346
 				if (!s.iframeTarget) {
347 347
 					// add iframe to doc and submit the form
348 348
 					$io.appendTo('body');
349  
-	                io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
  349
+					io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
350 350
 				}
351 351
 				setTimeout(checkState,15);
352 352
 				form.submit();
@@ -397,7 +397,7 @@ $.fn.ajaxSubmit = function(options) {
397 397
 				if (!timedOut)
398 398
 					return;
399 399
 			}
400  
-            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
  400
+			io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
401 401
 
402 402
 			var status = 'success', errMsg;
403 403
 			try {
@@ -421,20 +421,20 @@ $.fn.ajaxSubmit = function(options) {
421 421
 				}
422 422
 
423 423
 				//log('response detected');
424  
-                var docRoot = doc.body ? doc.body : doc.documentElement;
425  
-                xhr.responseText = docRoot ? docRoot.innerHTML : null;
426  
-				xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
427  
-				if (isXml)
428  
-					s.dataType = 'xml';
429  
-				xhr.getResponseHeader = function(header){
430  
-					var headers = {'content-type': s.dataType};
431  
-					return headers[header];
432  
-				};
433  
-                // support for XHR 'status' & 'statusText' emulation :
434  
-                if (docRoot) {
435  
-                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
436  
-                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
437  
-                }
  424
+				var docRoot = doc.body ? doc.body : doc.documentElement;
  425
+				xhr.responseText = docRoot ? docRoot.innerHTML : null;
  426
+						xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
  427
+						if (isXml)
  428
+							s.dataType = 'xml';
  429
+						xhr.getResponseHeader = function(header){
  430
+							var headers = {'content-type': s.dataType};
  431
+							return headers[header];
  432
+						};
  433
+				// support for XHR 'status' & 'statusText' emulation :
  434
+				if (docRoot) {
  435
+				    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
  436
+				    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
  437
+				}
438 438
 
439 439
 				var dt = (s.dataType || '').toLowerCase();
440 440
 				var scr = /(json|script|text)/.test(dt);
@@ -443,9 +443,9 @@ $.fn.ajaxSubmit = function(options) {
443 443
 					var ta = doc.getElementsByTagName('textarea')[0];
444 444
 					if (ta) {
445 445
 						xhr.responseText = ta.value;
446  
-                        // support for XHR 'status' & 'statusText' emulation :
447  
-                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
448  
-                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
  446
+						// support for XHR 'status' & 'statusText' emulation :
  447
+						xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
  448
+						xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
449 449
 					}
450 450
 					else if (scr) {
451 451
 						// account for browsers injecting pre around json response
@@ -463,18 +463,18 @@ $.fn.ajaxSubmit = function(options) {
463 463
 					xhr.responseXML = toXml(xhr.responseText);
464 464
 				}
465 465
 
466  
-                try {
467  
-                    data = httpData(xhr, dt, s);
468  
-                }
469  
-                catch (e) {
470  
-                    status = 'parsererror';
471  
-                    xhr.error = errMsg = (e || status);
472  
-                }
  466
+				try {
  467
+				    data = httpData(xhr, dt, s);
  468
+				}
  469
+				catch (e) {
  470
+				    status = 'parsererror';
  471
+				    xhr.error = errMsg = (e || status);
  472
+				}
473 473
 			}
474 474
 			catch (e) {
475 475
 				log('error caught: ',e);
476 476
 				status = 'error';
477  
-                xhr.error = errMsg = (e || status);
  477
+				xhr.error = errMsg = (e || status);
478 478
 			}
479 479
 
480 480
 			if (xhr.aborted) {
@@ -482,21 +482,21 @@ $.fn.ajaxSubmit = function(options) {
482 482
 				status = null;
483 483
 			}
484 484
 
485  
-            if (xhr.status) { // we've set xhr.status
486  
-                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
487  
-            }
  485
+			if (xhr.status) { // we've set xhr.status
  486
+			    status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
  487
+			}
488 488
 
489 489
 			// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
490 490
 			if (status === 'success') {
491 491
 				s.success && s.success.call(s.context, data, 'success', xhr);
492 492
 				g && $.event.trigger("ajaxSuccess", [xhr, s]);
493 493
 			}
494  
-            else if (status) {
495  
-				if (errMsg == undefined)
496  
-					errMsg = xhr.statusText;
497  
-				s.error && s.error.call(s.context, xhr, status, errMsg);
498  
-				g && $.event.trigger("ajaxError", [xhr, s, errMsg]);
499  
-            }
  494
+			else if (status) {
  495
+					    if (errMsg == undefined)
  496
+						    errMsg = xhr.statusText;
  497
+					    s.error && s.error.call(s.context, xhr, status, errMsg);
  498
+					    g && $.event.trigger("ajaxError", [xhr, s, errMsg]);
  499
+			}
500 500
 
501 501
 			g && $.event.trigger("ajaxComplete", [xhr, s]);
502 502
 
@@ -905,7 +905,7 @@ $.fn.ajaxSubmit.debug = false;
905 905
 
906 906
 // helper fn for console logging
907 907
 function log() {
908  
-	if (!$.fn.ajaxSubmit.debug) 
  908
+	if (!$.fn.ajaxSubmit.debug)
909 909
 		return;
910 910
 	var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
911 911
 	if (window.console && window.console.log) {
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.