diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2013-09-09 11:26:21 -0400 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2013-09-09 11:34:23 -0400 |
commit | 3b53b75160606610cc8f87404f89fc9e10441c4b (patch) | |
tree | b20600c885ee70e7b9cc7c880fc7a2cf141b56a8 /src/manipulation.js | |
parent | 2fe09ceaf9c261d8e7fbdf37a13b21bfd85da962 (diff) | |
download | jquery-3b53b75160606610cc8f87404f89fc9e10441c4b.tar.gz jquery-3b53b75160606610cc8f87404f89fc9e10441c4b.zip |
Break jQuery.access out into its own module to separate it from core; Adjust CommonJS+AMD build support to include non-var dependencies. Convert modules with more than a few dependencies to use CJS+AMD syntax.
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 1bae4f3db..b6e10f140 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -1,18 +1,23 @@ -define([ - "./core", - "./var/concat", - "./var/push", - "./manipulation/var/rcheckableType", - "./manipulation/support", - "./data/var/data_priv", - "./data/var/data_user", - "./data/accepts", - "./selector", - "./traversing", - "./event" -], function( jQuery, concat, push, rcheckableType, support, data_priv, data_user ){ - -var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, +// Require more than a few needed variables +// Keep in mind that a dependency array cannot be used with CommonJS+AMD syntax +define(function( require ){ + +// Dependencies not needed as variables +require( "./data/accepts" ); +require( "./traversing" ); +require( "./selector" ); +require( "./event" ); + +var + jQuery = require( "./core" ), + concat = require( "./var/concat" ), + push = require( "./var/push" ), + access = require( "./core/access" ), + rcheckableType = require( "./manipulation/var/rcheckableType" ), + support = require( "./manipulation/support" ), + data_priv = require( "./data/var/data_priv" ), + data_user = require( "./data/var/data_user" ), + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, @@ -44,7 +49,7 @@ wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { - return jQuery.access( this, function( value ) { + return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) ); @@ -134,7 +139,7 @@ jQuery.fn.extend({ }, html: function( value ) { - return jQuery.access( this, function( value ) { + return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; |