Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 298- }
- 299- },
- 300-
- 301- clone: function( events ) {
- 302- // Do the clone
- 303- var ret = this.map(function(){
- 304- if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
- 305- // IE copies events bound via attachEvent when
- 306- // using cloneNode. Calling detachEvent on the
- 307- // clone will also remove the events from the orignal
- 308: // In order to get around this, we use innerHTML.
- 309- // Unfortunately, this means some modifications to
- 310- // attributes in IE that are actually only stored
- 311- // as properties will not be copied (such as the
- 312- // the name attribute on an input).
- 313- var html = this.outerHTML;
- 314- if ( !html ) {
- 315- var div = this.ownerDocument.createElement("div");
- 316- div.appendChild( this.cloneNode(true) );
- 317: html = div.innerHTML;
- 318- }
- 319-
- 320- return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0];
- 321- } else
- 322- return this.cloneNode(true);
- 323- });
- 324-
- 325- // Copy the events from the original to the clone
- 326- if ( events === true ) {
- 327- var orig = this.find("*").andSelf(), i = 0;
- --
- 476- this.selectedIndex = -1;
- 477-
- 478- } else
- 479- this.value = value;
- 480- });
- 481- },
- 482-
- 483- html: function( value ) {
- 484- return value === undefined ?
- 485- (this[0] ?
- 486: this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") :
- 487- null) :
- 488- this.empty().append( value );
- 489- },
- 490-
- 491- replaceWith: function( value ) {
- 492- return this.after( value ).remove();
- 493- },
- 494-
- 495- eq: function( i ) {
- 496- return this.slice( i, +i + 1 );
- --
- 542-
- 543-function evalScript( i, elem ) {
- 544- if ( elem.src )
- 545- jQuery.ajax({
- 546- url: elem.src,
- 547- async: false,
- 548- dataType: "script"
- 549- });
- 550-
- 551- else
- 552: jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
- 553-
- 554- if ( elem.parentNode )
- 555- elem.parentNode.removeChild( elem );
- 556-}
- 557-
- 558-function now(){
- 559- return +new Date;
- 560-}
- 561-
- 562-jQuery.extend = jQuery.fn.extend = function() {
- --
- 901- !tags.indexOf("<col") &&
- 902- [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
- 903-
- 904- // IE can't serialize <link> and <script> tags normally
- 905- !jQuery.support.htmlSerialize &&
- 906- [ 1, "div<div>", "</div>" ] ||
- 907-
- 908- [ 0, "", "" ];
- 909-
- 910- // Go to html and back, then peel off extra wrappers
- 911: div.innerHTML = wrap[1] + elem + wrap[2];
- 912-
- 913- // Move to the right depth
- 914- while ( wrap[0]-- )
- 915- div = div.lastChild;
- 916-
- 917- // Remove IE's autoinserted <tbody> from table fragments
- 918- if ( !jQuery.support.tbody ) {
- 919-
- 920- // String was a <table>, *may* have spurious <tbody>
- 921- var hasBody = /<tbody/i.test(elem),
- --
- 926- wrap[1] == "<table>" && !hasBody ?
- 927- div.childNodes :
- 928- [];
- 929-
- 930- for ( var j = tbody.length - 1; j >= 0 ; --j )
- 931- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
- 932- tbody[ j ].parentNode.removeChild( tbody[ j ] );
- 933-
- 934- }
- 935-
- 936: // IE completely kills leading whitespace when innerHTML is used
- 937- if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
- 938- div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
- 939-
- 940- elem = jQuery.makeArray( div.childNodes );
- 941- }
- 942-
- 943- if ( elem.nodeType )
- 944- ret.push( elem );
- 945- else
- 946- ret = jQuery.merge( ret, elem );
- --
- 2126- return ret;
- 2127- };
- 2128-}
- 2129-
- 2130-// Check to see if the browser returns elements by name when
- 2131-// querying by getElementById (and provide a workaround)
- 2132-(function(){
- 2133- // We're going to inject a fake input element with a specified name
- 2134- var form = document.createElement("form"),
- 2135- id = "script" + (new Date).getTime();
- 2136: form.innerHTML = "<input name='" + id + "'/>";
- 2137-
- 2138- // Inject it into the root element, check its status, and remove it quickly
- 2139- var root = document.documentElement;
- 2140- root.insertBefore( form, root.firstChild );
- 2141-
- 2142- // The workaround has to do additional checks after a getElementById
- 2143- // Which slows things down for other browsers (hence the branching)
- 2144- if ( !!document.getElementById( id ) ) {
- 2145- Expr.find.ID = function(match, context, isXML){
- 2146- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- --
- 2182- }
- 2183-
- 2184- results = tmp;
- 2185- }
- 2186-
- 2187- return results;
- 2188- };
- 2189- }
- 2190-
- 2191- // Check to see if an attribute returns normalized href attributes
- 2192: div.innerHTML = "<a href='#'></a>";
- 2193- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
- 2194- div.firstChild.getAttribute("href") !== "#" ) {
- 2195- Expr.attrHandle.href = function(elem){
- 2196- return elem.getAttribute("href", 2);
- 2197- };
- 2198- }
- 2199-})();
- 2200-
- 2201-if ( document.querySelectorAll ) (function(){
- 2202- var oldSizzle = Sizzle, div = document.createElement("div");
- 2203: div.innerHTML = "<p class='TEST'></p>";
- 2204-
- 2205- // Safari can't handle uppercase or unicode characters when
- 2206- // in quirks mode.
- 2207- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
- 2208- return;
- 2209- }
- 2210-
- 2211- Sizzle = function(query, context, extra, seed){
- 2212- context = context || document;
- 2213-
- --
- 2223- };
- 2224-
- 2225- Sizzle.find = oldSizzle.find;
- 2226- Sizzle.filter = oldSizzle.filter;
- 2227- Sizzle.selectors = oldSizzle.selectors;
- 2228- Sizzle.matches = oldSizzle.matches;
- 2229-})();
- 2230-
- 2231-if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
- 2232- var div = document.createElement("div");
- 2233: div.innerHTML = "<div class='test e'></div><div class='test'></div>";
- 2234-
- 2235- // Opera can't find a second classname (in 9.6)
- 2236- if ( div.getElementsByClassName("e").length === 0 )
- 2237- return;
- 2238-
- 2239- // Safari caches class attributes, doesn't catch changes (in 3.2)
- 2240- div.lastChild.className = "e";
- 2241-
- 2242- if ( div.getElementsByClassName("e").length === 1 )
- 2243- return;
- --
- 3112-(function(){
- 3113-
- 3114- jQuery.support = {};
- 3115-
- 3116- var root = document.documentElement,
- 3117- script = document.createElement("script"),
- 3118- div = document.createElement("div"),
- 3119- id = "script" + (new Date).getTime();
- 3120-
- 3121- div.style.display = "none";
- 3122: div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
- 3123-
- 3124- var all = div.getElementsByTagName("*"),
- 3125- a = div.getElementsByTagName("a")[0];
- 3126-
- 3127- // Can't get basic test support
- 3128- if ( !all || !all.length || !a ) {
- 3129- return;
- 3130- }
- 3131-
- 3132- jQuery.support = {
- 3133: // IE strips leading whitespace when .innerHTML is used
- 3134- leadingWhitespace: div.firstChild.nodeType == 3,
- 3135-
- 3136- // Make sure that tbody elements aren't automatically inserted
- 3137- // IE will insert them into empty tables
- 3138- tbody: !div.getElementsByTagName("tbody").length,
- 3139-
- 3140- // Make sure that you can get all elements in an <object> element
- 3141- // IE 7 always returns no results
- 3142- objectAll: !!div.getElementsByTagName("object")[0]
- 3143- .getElementsByTagName("*").length,
- 3144-
- 3145: // Make sure that link elements get serialized correctly by innerHTML
- 3146- // This requires a wrapper element in IE
- 3147- htmlSerialize: !!div.getElementsByTagName("link").length,
- 3148-
- 3149- // Get the style information from getAttribute
- 3150- // (IE uses .cssText insted)
- 3151- style: /red/.test( a.getAttribute("style") ),
- 3152-
- 3153- // Make sure that URLs aren't manipulated
- 3154- // (IE normalizes it by default)
- 3155- hrefNormalized: a.getAttribute("href") === "/a",
- --
- 4220-
- 4221-jQuery.offset = {
- 4222- initialize: function() {
- 4223- if ( this.initialized ) return;
- 4224- var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
- 4225- html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
- 4226-
- 4227- rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
- 4228- for ( prop in rules ) container.style[prop] = rules[prop];
- 4229-
- 4230: container.innerHTML = html;
- 4231- body.insertBefore(container, body.firstChild);
- 4232- innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
- 4233-
- 4234- this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
- 4235- this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
- 4236-
- 4237- innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
- 4238- this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
- 4239-
- 4240- body.style.marginTop = '1px';
Add Comment
Please, Sign In to add comment