📄 jquery.1.2.3.intellisense.js
字号:
// Need to set the expando to null on the cloned set if it exists // removeData doesn't work here, IE removes it from the original as well // this is primarily for IE but the data expando shouldn't be copied over in any browser var clone = ret.find("*").andSelf().each(function(){ if ( this[ expando ] != undefined ) this[ expando ] = null; }); // Copy the events from the original to the clone if ( events === true ) this.find("*").andSelf().each(function(i){ if (this.nodeType == 3) return; var events = jQuery.data( this, "events" ); for ( var type in events ) for ( var handler in events[ type ] ) jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); }); // Return the cloned set return ret; }, filter: function( selector ) { ///<summary> /// 1. filter(expr) - Removes all elements from the set of matched elements that do not match the specified expression(s). /// 2. filter(fn) - Removes all elements from the set of matched elements that does not match the specified function. ///</summary> ///<param name="selector"> /// 1. expr - An expression to pass into the filter. /// 2. fn - A function to pass into the filter. ///</param> ///<param name="selector"></param> ///<returns type="jQuery" /> return this.pushStack( jQuery.isFunction( selector ) && jQuery.grep(this, function(elem, i){ return selector.call( elem, i ); }) || jQuery.multiFilter( selector, this ) ); }, not: function( selector ) { ///<summary>Removes elements matching the specified expression from the set of matched elements.</summary> ///<param name="selector">An expression with which to remove matching elements, an element to remove from the set or a set of elements to remove from the jQuery set of matched elements.</param> ///<returns type="jQuery" /> if ( selector.constructor == String ) // test special case where just one selector is passed in if ( isSimple.test( selector ) ) return this.pushStack( jQuery.multiFilter( selector, this, true ) ); else selector = jQuery.multiFilter( selector, this ); var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; return this.filter(function() { return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; }); }, add: function( selector ) { ///<summary>Adds more elements, matched by the given expression, to the set of matched elements.</summary> ///<param name="expr">An expression whose matched elements are added for String, a string of HTML to create on the fly for DOMElement or one or more Elements to add if an Array.</param> ///<returns type="jQuery" /> return !selector ? this : this.pushStack( jQuery.merge( this.get(), selector.constructor == String ? jQuery( selector ).get() : selector.length != undefined && (!selector.nodeName || jQuery.nodeName(selector, "form")) ? selector : [selector] ) ); }, is: function( selector ) { ///<summary>Checks the current selection against an expression and returns true, if at least one element of the selection fits the given expression.</summary> ///<param name="selector">The expression with which to filter</param> ///<returns type="Boolean" /> return selector ? jQuery.multiFilter( selector, this ).length > 0 : false; }, hasClass: function( selector ) { ///<summary>Checks the current selection against a class and returns true, if at least one element of the selection has the given class.</summary> ///<param name="selector">The class to match.</param> ///<returns type="Boolean" /> return this.is( "." + selector ); }, val: function( value ) { ///<summary> /// 1. val() - Get the content of the value attribute of the first matched element. Returns String or Array /// 2. val(value) - Set the value attribute of every matched element. /// 3. val(value) - Checks, or selects, all the radio buttons, checkboxes, and select options that match the set of values. ///</summary> ///<param name="value" optional="true">(optional) The value to set on the matched element.</param> ///<returns type="jQuery" /> if ( value == undefined ) { if ( this.length ) { var elem = this[0]; // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, values = [], options = elem.options, one = elem.type == "select-one"; // Nothing was selected if ( index < 0 ) return null; // Loop through all the selected options for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { var option = options[ i ]; if ( option.selected ) { // Get the specifc value for the option value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; // We don't need an array for one selects if ( one ) return value; // Multi-Selects return an array values.push( value ); } } return values; // Everything else, we just grab the value } else return (this[0].value || "").replace(/\r/g, ""); } return undefined; } return this.each(function(){ if ( this.nodeType != 1 ) return; if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) this.checked = (jQuery.inArray(this.value, value) >= 0 || jQuery.inArray(this.name, value) >= 0); else if ( jQuery.nodeName( this, "select" ) ) { var values = value.constructor == Array ? value : [ value ]; jQuery( "option", this ).each(function(){ this.selected = (jQuery.inArray( this.value, values ) >= 0 || jQuery.inArray( this.text, values ) >= 0); }); if ( !values.length ) this.selectedIndex = -1; } else this.value = value; }); }, html: function( value ) { ///<summary> /// 1. html() - Get the html contents (innerHTML) of the first matched element. This property is not available on XML documents (although it will work for XHTML documents). Returns String. /// 2. html(val) - Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents).</summary> ///<param name="" optional="true">(optional) Set the html contents to the specified value.</param> ///<returns type="jQuery" /> return value == undefined ? (this.length ? this[0].innerHTML : null) : this.empty().append( value ); }, replaceWith: function( value ) { ///<summary>Replaces all matched elements with the specified HTML or DOM elements.</summary> ///<param name="value">Content to replace the matched elements with</param> ///<returns type="jQuery" /> return this.after( value ).remove(); }, eq: function( i ) { ///<summary>Reduce the set of matched elements to a single element.</summary> ///<param name="i">The index of the element to select.</param> ///<returns type="jQuery" /> return this.slice( i, i + 1 ); }, slice: function() { ///<summary> /// slice(start, [end]) - Selects a subset of the matched elements. /// start - Where to start the subset. The first element is at zero. Can be negative to start from the end of the selection. /// end - (optional) Where to end the subset. If unspecified, ends at the end of the selection. ///</summary> ///<returns type="jQuery" /> return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); }, map: function( callback ) { ///<summary>Translate a set of elements in the jQuery object into another set of values in an array (which may, or may not, be elements).</summary> ///<param name="callback">The function to execute on each element in the set.</param> ///<returns type="jQuery" /> return this.pushStack( jQuery.map(this, function(elem, i){ return callback.call( elem, i, elem ); })); }, andSelf: function() { ///<summary>Add the previous selection to the current selection.</summary> ///<returns type="jQuery" /> return this.add( this.prevObject ); }, data: function( key, value ){ var parts = key.split("."); parts[1] = parts[1] ? "." + parts[1] : ""; if ( value == null ) { var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); if ( data == undefined && this.length ) data = jQuery.data( this[0], key ); return data == null && parts[1] ? this.data( parts[0] ) : data; } else return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ jQuery.data( this, key, value ); }); }, removeData: function( key ){ return this.each(function(){ jQuery.removeData( this, key ); }); }, domManip: function( args, table, reverse, callback ) { var clone = this.length > 1, elems; return this.each(function(){ if ( !elems ) { elems = jQuery.clean( args, this.ownerDocument ); if ( reverse ) elems.reverse(); } var obj = this; if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") ); var scripts = jQuery( [] ); jQuery.each(elems, function(){ var elem = clone ? jQuery( this ).clone( true )[0] : this; // execute all scripts after the elements have been injected if ( jQuery.nodeName( elem, "script" ) ) { scripts = scripts.add( elem ); } else { // Remove any inner scripts for later evaluation if ( elem.nodeType == 1 ) scripts = scripts.add( jQuery( "script", elem ).remove() ); // Inject the elements into the document callback.call( obj, elem ); } }); scripts.each( evalScript ); }); }};// Give the init function the jQuery prototype for later instantiationjQuery.prototype.init.prototype = jQuery.prototype;function evalScript( i, elem ) { if ( elem.src ) jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); else jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); if ( elem.parentNode ) elem.parentNode.removeChild( elem );}jQuery.extend = jQuery.fn.extend = function() { ///<summary> ///extend(target, object1, [objectN]) - Extends the jQuery element set to provide new methods (used to make a typical jQuery plugin). /// target - The object to extend. /// object1 - The object that will be merged into the first. /// objectN - (optional) More objects to merge into the first. ///</summary> ///<param name="object">The object that will be merged into the jQuery object. note: intellisense not working.</param> ///<returns type="jQuery" /> // copy reference to target object var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; // Handle a deep copy situation if ( target.constructor == Boolean ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target != "object" && typeof target != "function" ) target = {}; // extend jQuery itself if only one argument is passed if ( length == 1 ) { target = this; i = 0; } for ( ; i < length; i++ ) // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) // Extend the base object for ( var name in options ) { // Prevent never-ending loop if ( target === options[ name ] ) continue; // Recurse if we're merging object values if ( deep && options[ name ] && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType ) target[ name ] = jQuery.extend( target[ name ], options[ name ] ); // Don't bring in undefined values else if ( options[ name ] != undefined ) target[ name ] = options[ name ]; } // Return the modified object return target;};var expando = "jQuery" + (new Date()).getTime(), uuid = 0, windowData = {};// exclude the following css properties to add pxvar exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;jQuery.extend({ noConflict: function( deep ) { ///<summary>Run this function to give control of the $ variable back to whichever library first implemented it. note: intellisense not working</summary> ///<param name="">(optional) Set to true to enable the extreme rollback of jQuery and it's variables.</param> ///<returns type="jQuery" /> window.$ = _$; if ( deep ) window.jQuery = _jQuery; return jQuery; }, // See test/unit/core.js for details concerning this function. isFunction: function( fn ) { ///<summary>Determine if the parameter passed is a function.</summary> ///<param name="fn">Object to test whether or not it is a function.</param> ///<returns type="Boolean" /> return !!fn && typeof fn != "string" && !fn.nodeName && fn.constructor != Array && /function/i.test( fn + "" ); }, // check if an element is in a (or is an) XML document isXMLDoc: function( elem ) { return elem.documentElement && !elem.body || elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; }, // Evalulates a script in a global context
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -