github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jquery / jquery

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1,330
    • 117
  • Source
  • Commits
  • Network (117)
  • Graphs
  • Tree: 1a4d190
  • Branches (3)
    • master
    • mobile
    • omgrequire
  • Tags (39)
    • 1.4rc1
    • 1.4a2
    • 1.4a1
    • 1.4
    • 1.3rc1
    • 1.3b2
    • 1.3b1
    • 1.3.2
    • 1.3.1rc1
    • 1.3.1
    • 1.3
    • 1.2.6
    • 1.2.5
    • 1.2.4b
    • 1.2.4a
    • 1.2.4
    • 1.2.3b
    • 1.2.3a
    • 1.2.3
    • 1.2.2b2
    • 1.2.2b
    • 1.2.2
    • 1.2.1
    • 1.2
    • 1.1b
    • 1.1a
    • 1.1.4
    • 1.1.3a
    • 1.1.3.1
    • 1.1.3
    • 1.1.2
    • 1.1.1
    • 1.1
    • 1.0a
    • 1.0.4
    • 1.0.3
    • 1.0.2
    • 1.0.1
    • 1.0
  • Comments
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

jQuery JavaScript Library — Read more

or cancel

http://jquery.com/

or cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Fix up whitespace and a couple of glitches.
Yehuda Katz (author)
Wed Dec 09 21:15:49 -0800 2009
commit  1a4d1904ae8631f94b7400d99af24d3fe2f33ecd
tree    5abaa5ef73f77ae556112a413c767f8a37d25614
parent  b3cee01820adde707428d68fcf02b0fdf53fe527
M src/attributes.js 33 ••••
M src/core.js 6 ••••
M src/manipulation.js 10 ••••
M test/unit/attributes.js 20 ••••
M test/unit/manipulation.js 12 ••••
0
src/attributes.js
...
4
5
6
7
8
9
10
11
 
 
 
 
 
12
13
14
...
35
36
37
38
39
40
41
42
 
 
 
 
 
43
44
45
...
170
171
172
173
174
175
176
177
178
179
180
181
182
...
198
199
200
201
202
203
 
 
 
204
205
206
...
4
5
6
 
 
 
 
 
7
8
9
10
11
12
13
14
...
35
36
37
 
 
 
 
 
38
39
40
41
42
43
44
45
...
170
171
172
 
 
 
 
 
 
 
173
174
175
...
191
192
193
 
 
 
194
195
196
197
198
199
0
@@ -4,11 +4,11 @@ jQuery.fn.extend({
0
   },
0
 
0
   addClass: function( value ) {
0
-    if(jQuery.isFunction(value)) {
0
-      return this.each(function() {
0
-        jQuery(this).addClass( value.call(this) );
0
-      });
0
-    }
0
+    if(jQuery.isFunction(value)) {
0
+      return this.each(function() {
0
+        jQuery(this).addClass( value.call(this) );
0
+      });
0
+    }
0
 
0
     if ( value && typeof value === "string" ) {
0
       var classNames = (value || "").split(/\s+/);
0
@@ -35,11 +35,11 @@ jQuery.fn.extend({
0
   },
0
 
0
   removeClass: function( value ) {
0
-    if(jQuery.isFunction(value)) {
0
-      return this.each(function() {
0
-        jQuery(this).removeClass( value.call(this) );
0
-      });
0
-    }
0
+    if(jQuery.isFunction(value)) {
0
+      return this.each(function() {
0
+        jQuery(this).removeClass( value.call(this) );
0
+      });
0
+    }
0
 
0
     if ( (value && typeof value === "string") || value === undefined ) {
0
       var classNames = (value || "").split(/\s+/);
0
@@ -170,13 +170,6 @@ jQuery.each({
0
   },
0
 
0
   toggleClass: function( classNames, state ) {
0
-    if( jQuery.isFunction(classNames) ) {
0
-      return this.each(function() {
0
-        console.log(this);
0
-        jQuery(this).toggleClass( classNames.call(this), state );
0
-      });
0
-    }
0
-
0
     var type = typeof classNames;
0
     if ( type === "string" ) {
0
       // toggle individual class names
0
@@ -198,9 +191,9 @@ jQuery.each({
0
   }
0
 }, function(name, fn){
0
   jQuery.fn[ name ] = function(val, state){
0
-    if( jQuery.isFunction( val ) ) {
0
-      return this.each(function() { jQuery(this)[ name ]( val.call(this), state ); });
0
-    }
0
+    if( jQuery.isFunction( val ) ) {
0
+      return this.each(function() { jQuery(this)[ name ]( val.call(this), state ); });
0
+    }
0
 
0
     return this.each( fn, arguments );
0
   };
0
src/core.js
...
444
445
446
447
448
 
 
449
450
451
...
481
482
483
484
 
485
486
487
...
444
445
446
 
 
447
448
449
450
451
...
481
482
483
 
484
485
486
487
0
@@ -444,8 +444,8 @@ jQuery.extend({
0
     
0
     // not own constructor property must be Object
0
     if ( obj.constructor
0
-      && !hasOwnProperty.call(obj, "constructor")
0
-      && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
0
+      && !hasOwnProperty.call(obj, "constructor")
0
+      && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
0
       return false;
0
     }
0
     
0
@@ -481,7 +481,7 @@ jQuery.extend({
0
         script.text = data;
0
       }
0
 
0
-      // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
0
+      // Use insertBefore instead of appendChild to circumvent an IE6 bug.
0
       // This arises when a base node is used (#2709).
0
       head.insertBefore( script, head.firstChild );
0
       head.removeChild( script );
0
src/manipulation.js
...
32
33
34
35
36
37
38
39
 
 
 
 
 
40
41
42
...
32
33
34
 
 
 
 
 
35
36
37
38
39
40
41
42
0
@@ -32,11 +32,11 @@ if ( !jQuery.support.htmlSerialize ) {
0
 
0
 jQuery.fn.extend({
0
   text: function( text ) {
0
-    if(jQuery.isFunction(text)) {
0
-      return this.each(function() {
0
-        return jQuery(this).text( text.call(this) );
0
-      });
0
-    }
0
+    if(jQuery.isFunction(text)) {
0
+      return this.each(function() {
0
+        return jQuery(this).text( text.call(this) );
0
+      });
0
+    }
0
 
0
     if ( typeof text !== "object" && text !== undefined ) {
0
       return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
0
test/unit/attributes.js
...
81
82
83
84
85
 
 
86
87
88
...
314
315
316
317
 
318
319
320
321
 
322
323
324
...
355
356
357
358
 
359
360
361
362
 
363
364
365
...
415
416
417
418
 
419
420
421
422
 
423
424
425
...
428
429
430
431
 
432
433
434
435
 
436
437
438
...
81
82
83
 
 
84
85
86
87
88
...
314
315
316
 
317
318
319
320
 
321
322
323
324
...
355
356
357
 
358
359
360
361
 
362
363
364
365
...
415
416
417
 
418
419
420
421
 
422
423
424
425
...
428
429
430
 
431
432
433
434
 
435
436
437
438
0
@@ -81,8 +81,8 @@ test("attr(Hash)", function() {
0
     if ( this.getAttribute('foo') != "baz" && this.getAttribute('zoo') != "ping" ) pass = false;
0
   });
0
   ok( pass, "Set Multiple Attributes" );
0
-       equals( jQuery('#text1').attr({'value': function() { return this.id; }})[0].value, "text1", "Set attribute to computed value #1" );
0
-       equals( jQuery('#text1').attr({'title': function(i) { return i; }}).attr('title'), "0", "Set attribute to computed value #2");
0
+       equals( jQuery('#text1').attr({'value': function() { return this.id; }})[0].value, "text1", "Set attribute to computed value #1" );
0
+       equals( jQuery('#text1').attr({'title': function(i) { return i; }}).attr('title'), "0", "Set attribute to computed value #2");
0
 
0
 });
0
 
0
@@ -314,11 +314,11 @@ var testAddClass = function(valueObj) {
0
 }
0
 
0
 test("addClass(String)", function() {
0
-  testAddClass(bareObj);
0
+  testAddClass(bareObj);
0
 });
0
 
0
 test("addClass(Function)", function() {
0
-  testAddClass(functionReturningObj);
0
+  testAddClass(functionReturningObj);
0
 });
0
 
0
 var testRemoveClass = function(valueObj) {
0
@@ -355,11 +355,11 @@ var testRemoveClass = function(valueObj) {
0
 };
0
 
0
 test("removeClass(String) - simple", function() {
0
-  testRemoveClass(bareObj);
0
+  testRemoveClass(bareObj);
0
 });
0
 
0
 test("removeClass(Function) - simple", function() {
0
-  testRemoveClass(functionReturningObj);
0
+  testRemoveClass(functionReturningObj);
0
 });
0
 
0
 var testToggleClass = function(valueObj) {
0
@@ -415,11 +415,11 @@ var testToggleClass = function(valueObj) {
0
 };
0
 
0
 test("toggleClass(String|boolean|undefined[, boolean])", function() {
0
-  testToggleClass(bareObj);
0
+  testToggleClass(bareObj);
0
 });
0
 
0
 test("toggleClass(Function[, boolean])", function() {
0
-  testToggleClass(functionReturningObj);
0
+  testToggleClass(functionReturningObj);
0
 });
0
 
0
 var testRemoveAttr = function(valueObj) {
0
@@ -428,11 +428,11 @@ var testRemoveAttr = function(valueObj) {
0
 };
0
 
0
 test("removeAttr(String)", function() {
0
-  testRemoveAttr(bareObj);
0
+  testRemoveAttr(bareObj);
0
 });
0
 
0
 test("removeAttr(Function)", function() {
0
-  testRemoveAttr(functionReturningObj);
0
+  testRemoveAttr(functionReturningObj);
0
 });
0
 
0
 test("addClass, removeClass, hasClass", function() {
0
test/unit/manipulation.js
...
105
106
107
108
 
109
110
111
...
130
131
132
133
 
134
135
136
...
251
252
253
254
 
255
256
257
...
658
659
660
661
662
663
 
 
 
664
665
666
...
105
106
107
 
108
109
110
111
...
130
131
132
 
133
134
135
136
...
251
252
253
 
254
255
256
257
...
658
659
660
 
 
 
661
662
663
664
665
666
0
@@ -105,7 +105,7 @@ test("wrapAll(String|Element)", function() {
0
 
0
 // TODO: Figure out why each(wrapAll) is not equivalent to wrapAll
0
 // test("wrapAll(Function)", function() {
0
-//   testWrapAll(functionReturningObj);
0
+//  testWrapAll(functionReturningObj);
0
 // })
0
 
0
 var testWrapInner = function(val) {
0
@@ -130,7 +130,7 @@ test("wrapInner(String|Element)", function() {
0
 
0
 // TODO: wrapInner uses wrapAll -- get wrapAll working with Function
0
 // test("wrapInner(Function)", function() {
0
-//   testWrapInner(functionReturningObj)
0
+//  testWrapInner(functionReturningObj)
0
 // })
0
 
0
 var testUnwrap = function() {
0
@@ -251,7 +251,7 @@ var testAppend = function(valueObj) {
0
 }
0
 
0
 test("append(String|Element|Array<Element>|jQuery)", function() {
0
-  testAppend(bareObj);
0
+  testAppend(bareObj);
0
 });
0
 
0
 test("append(Function)", function() {
0
@@ -658,9 +658,9 @@ var testVal = function(valueObj) {
0
   jQuery("#select1").val(valueObj( 2 ));
0
   equals( jQuery("#select1").val(), "2", "Check for modified (via val(Number)) value of select element" );
0
 
0
-  jQuery("#select1").append("<option value='4'>four</option>");
0
-  jQuery("#select1").val(valueObj( 4 ));
0
-  equals( jQuery("#select1").val(), "4", "Should be possible to set the val() to a newly created option" );
0
+  jQuery("#select1").append("<option value='4'>four</option>");
0
+  jQuery("#select1").val(valueObj( 4 ));
0
+  equals( jQuery("#select1").val(), "4", "Should be possible to set the val() to a newly created option" );
0
 
0
   // using contents will get comments regular, text, and comment nodes
0
   var j = jQuery("#nonnodes").contents();

Comments

Parsed with GitHub Flavored Markdown
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server
This feature is coming soon. Sit tight!