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

jquery / jquery

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1,766
    • 169
  • Source
  • Commits
  • Network (169)
  • Graphs
  • Tree: a18f682

click here to add a description

click here to add a homepage

  • Switch Branches (3)
    • master
    • mobile
    • omgrequire
  • Switch Tags (41)
    • 1.4rc1
    • 1.4a2
    • 1.4a1
    • 1.4.2
    • 1.4.1
    • 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

  Cancel

http://jquery.com/

  Cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Made some code tweaks related to running jQuery through JSLint (thanks to 
Lorin Larson for the JSLint run).
jeresig (author)
Mon Mar 01 09:44:56 -0800 2010
commit  a18f682012ae8e63f3b43b39375b3c5ce0a561e3
tree    e897c8e14067e1fd3ef7bd658f0ef91afdcf7d0a
parent  5353c6bcc352c4d900cc76af110e56ee1e70ae0f
M src/ajax.js 12 ••••
M src/core.js 2 ••
M src/css.js 53 ••••
M src/effects.js 6 ••••
M src/event.js 10 ••••
0
src/ajax.js
...
278
279
280
 
 
281
282
 
283
284
285
...
386
387
388
389
 
390
391
392
...
499
500
501
502
 
503
504
505
...
511
512
513
514
 
515
516
517
...
520
521
522
523
 
524
525
526
...
278
279
280
281
282
283
 
284
285
286
287
...
388
389
390
 
391
392
393
394
...
501
502
503
 
504
505
506
507
...
513
514
515
 
516
517
518
519
...
522
523
524
 
525
526
527
528
0
@@ -278,8 +278,10 @@ jQuery.extend({
0
       s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
0
     }
0
 
0
+    jQuery.active++;
0
+
0
     // Watch for a new set of requests
0
-    if ( s.global && ! jQuery.active++ ) {
0
+    if ( s.global && jQuery.active === 1 ) {
0
       jQuery.event.trigger( "ajaxStart" );
0
     }
0
 
0
@@ -386,7 +388,7 @@ jQuery.extend({
0
     }
0
 
0
     if ( s.global ) {
0
-      trigger("ajaxSend", [xhr, s]);
0
+      contextTrigger("ajaxSend", [xhr, s]);
0
     }
0
 
0
     // Wait for a response to come back
0
@@ -499,7 +501,7 @@ jQuery.extend({
0
 
0
       // Fire the global callback
0
       if ( s.global ) {
0
-        trigger( "ajaxSuccess", [xhr, s] );
0
+        contextTrigger( "ajaxSuccess", [xhr, s] );
0
       }
0
     }
0
 
0
@@ -511,7 +513,7 @@ jQuery.extend({
0
 
0
       // The request was completed
0
       if ( s.global ) {
0
-        trigger( "ajaxComplete", [xhr, s] );
0
+        contextTrigger( "ajaxComplete", [xhr, s] );
0
       }
0
 
0
       // Handle the global AJAX counter
0
@@ -520,7 +522,7 @@ jQuery.extend({
0
       }
0
     }
0
     
0
-    function trigger(type, args) {
0
+    function contextTrigger(type, args) {
0
       (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
0
     }
0
 
0
src/core.js
...
693
694
695
696
 
697
698
699
...
693
694
695
 
696
697
698
699
0
@@ -693,7 +693,7 @@ jQuery.extend({
0
       /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
0
       /(msie) ([\w.]+)/.exec( ua ) ||
0
       !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
0
-        [];
0
+      [];
0
 
0
     return { browser: match[1] || "", version: match[2] || "0" };
0
   },
0
src/css.js
...
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
 
 
109
110
 
 
 
111
112
113
...
211
212
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
215
216
...
82
83
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
87
88
 
89
90
91
92
93
94
...
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
0
@@ -82,32 +82,13 @@ jQuery.extend({
0
 
0
   css: function( elem, name, force, extra ) {
0
     if ( name === "width" || name === "height" ) {
0
-      var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
0
-
0
-      function getWH() {
0
-        val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
0
-
0
-        if ( extra === "border" ) {
0
-          return;
0
-        }
0
-
0
-        jQuery.each( which, function() {
0
-          if ( !extra ) {
0
-            val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
0
-          }
0
-
0
-          if ( extra === "margin" ) {
0
-            val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
0
-          } else {
0
-            val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
0
-          }
0
-        });
0
-      }
0
-
0
       if ( elem.offsetWidth !== 0 ) {
0
-        getWH();
0
+        val = getWH( elem, name, extra );
0
+
0
       } else {
0
-        jQuery.swap( elem, props, getWH );
0
+        jQuery.swap( elem, cssShow, function() {
0
+          val = getWH( elem, name, extra );
0
+        });
0
       }
0
 
0
       return Math.max(0, Math.round(val));
0
@@ -211,6 +192,30 @@ jQuery.extend({
0
   }
0
 });
0
 
0
+function getWH( elem, name, extra ) {
0
+  var which = name === "width" ? cssWidth : cssHeight,
0
+    val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
0
+
0
+  if ( extra === "border" ) {
0
+    return val;
0
+  }
0
+
0
+  jQuery.each( which, function() {
0
+    if ( !extra ) {
0
+      val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
0
+    }
0
+
0
+    if ( extra === "margin" ) {
0
+      val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
0
+
0
+    } else {
0
+      val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
0
+    }
0
+  });
0
+
0
+  return val;
0
+}
0
+
0
 if ( jQuery.expr && jQuery.expr.filters ) {
0
   jQuery.expr.filters.hidden = function( elem ) {
0
     var width = elem.offsetWidth, height = elem.offsetHeight,
0
src/effects.js
...
443
444
445
446
447
448
 
 
 
449
450
451
...
443
444
445
 
 
 
446
447
448
449
450
451
0
@@ -443,9 +443,9 @@ jQuery.extend( jQuery.fx, {
0
   
0
   speeds: {
0
     slow: 600,
0
-     fast: 200,
0
-     // Default speed
0
-     _default: 400
0
+    fast: 200,
0
+    // Default speed
0
+    _default: 400
0
   },
0
 
0
   step: {
0
src/event.js
...
51
52
53
54
 
55
56
57
...
980
981
982
983
984
 
 
985
986
 
987
988
989
...
992
993
994
995
 
996
997
998
...
51
52
53
 
54
55
56
57
...
980
981
982
 
 
983
984
985
 
986
987
988
989
...
992
993
994
 
995
996
997
998
0
@@ -51,7 +51,7 @@ jQuery.event = {
0
     }
0
 
0
     var events = elemData.events = elemData.events || {},
0
-      eventHandle = elemData.handle, eventHandle;
0
+      eventHandle = elemData.handle;
0
 
0
     if ( !eventHandle ) {
0
       elemData.handle = eventHandle = function() {
0
@@ -980,10 +980,10 @@ jQuery.each(["live", "die"], function( i, name ) {
0
 
0
       if ( name === "live" ) {
0
         // bind live handler
0
-        context.each(function(){
0
-          jQuery.event.add( this, liveConvert( type, selector ),
0
+        for ( var j = 0, l = context.length; j < l; j++ ) {
0
+          jQuery.event.add( context[j], liveConvert( type, selector ),
0
             { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
0
-        });
0
+        }
0
 
0
       } else {
0
         // unbind live handler
0
@@ -992,7 +992,7 @@ jQuery.each(["live", "die"], function( i, name ) {
0
     }
0
     
0
     return this;
0
-  }
0
+  };
0
 });
0
 
0
 function liveHandler( event ) {

Comments

Please log in to comment.
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