Guest User

Untitled

a guest
Jun 24th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.29 KB | None | 0 0
  1. 298- }
  2. 299- },
  3. 300-
  4. 301- clone: function( events ) {
  5. 302- // Do the clone
  6. 303- var ret = this.map(function(){
  7. 304- if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
  8. 305- // IE copies events bound via attachEvent when
  9. 306- // using cloneNode. Calling detachEvent on the
  10. 307- // clone will also remove the events from the orignal
  11. 308: // In order to get around this, we use innerHTML.
  12. 309- // Unfortunately, this means some modifications to
  13. 310- // attributes in IE that are actually only stored
  14. 311- // as properties will not be copied (such as the
  15. 312- // the name attribute on an input).
  16. 313- var html = this.outerHTML;
  17. 314- if ( !html ) {
  18. 315- var div = this.ownerDocument.createElement("div");
  19. 316- div.appendChild( this.cloneNode(true) );
  20. 317: html = div.innerHTML;
  21. 318- }
  22. 319-
  23. 320- return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0];
  24. 321- } else
  25. 322- return this.cloneNode(true);
  26. 323- });
  27. 324-
  28. 325- // Copy the events from the original to the clone
  29. 326- if ( events === true ) {
  30. 327- var orig = this.find("*").andSelf(), i = 0;
  31. --
  32. 476- this.selectedIndex = -1;
  33. 477-
  34. 478- } else
  35. 479- this.value = value;
  36. 480- });
  37. 481- },
  38. 482-
  39. 483- html: function( value ) {
  40. 484- return value === undefined ?
  41. 485- (this[0] ?
  42. 486: this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") :
  43. 487- null) :
  44. 488- this.empty().append( value );
  45. 489- },
  46. 490-
  47. 491- replaceWith: function( value ) {
  48. 492- return this.after( value ).remove();
  49. 493- },
  50. 494-
  51. 495- eq: function( i ) {
  52. 496- return this.slice( i, +i + 1 );
  53. --
  54. 542-
  55. 543-function evalScript( i, elem ) {
  56. 544- if ( elem.src )
  57. 545- jQuery.ajax({
  58. 546- url: elem.src,
  59. 547- async: false,
  60. 548- dataType: "script"
  61. 549- });
  62. 550-
  63. 551- else
  64. 552: jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
  65. 553-
  66. 554- if ( elem.parentNode )
  67. 555- elem.parentNode.removeChild( elem );
  68. 556-}
  69. 557-
  70. 558-function now(){
  71. 559- return +new Date;
  72. 560-}
  73. 561-
  74. 562-jQuery.extend = jQuery.fn.extend = function() {
  75. --
  76. 901- !tags.indexOf("<col") &&
  77. 902- [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
  78. 903-
  79. 904- // IE can't serialize <link> and <script> tags normally
  80. 905- !jQuery.support.htmlSerialize &&
  81. 906- [ 1, "div<div>", "</div>" ] ||
  82. 907-
  83. 908- [ 0, "", "" ];
  84. 909-
  85. 910- // Go to html and back, then peel off extra wrappers
  86. 911: div.innerHTML = wrap[1] + elem + wrap[2];
  87. 912-
  88. 913- // Move to the right depth
  89. 914- while ( wrap[0]-- )
  90. 915- div = div.lastChild;
  91. 916-
  92. 917- // Remove IE's autoinserted <tbody> from table fragments
  93. 918- if ( !jQuery.support.tbody ) {
  94. 919-
  95. 920- // String was a <table>, *may* have spurious <tbody>
  96. 921- var hasBody = /<tbody/i.test(elem),
  97. --
  98. 926- wrap[1] == "<table>" && !hasBody ?
  99. 927- div.childNodes :
  100. 928- [];
  101. 929-
  102. 930- for ( var j = tbody.length - 1; j >= 0 ; --j )
  103. 931- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
  104. 932- tbody[ j ].parentNode.removeChild( tbody[ j ] );
  105. 933-
  106. 934- }
  107. 935-
  108. 936: // IE completely kills leading whitespace when innerHTML is used
  109. 937- if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
  110. 938- div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
  111. 939-
  112. 940- elem = jQuery.makeArray( div.childNodes );
  113. 941- }
  114. 942-
  115. 943- if ( elem.nodeType )
  116. 944- ret.push( elem );
  117. 945- else
  118. 946- ret = jQuery.merge( ret, elem );
  119. --
  120. 2126- return ret;
  121. 2127- };
  122. 2128-}
  123. 2129-
  124. 2130-// Check to see if the browser returns elements by name when
  125. 2131-// querying by getElementById (and provide a workaround)
  126. 2132-(function(){
  127. 2133- // We're going to inject a fake input element with a specified name
  128. 2134- var form = document.createElement("form"),
  129. 2135- id = "script" + (new Date).getTime();
  130. 2136: form.innerHTML = "<input name='" + id + "'/>";
  131. 2137-
  132. 2138- // Inject it into the root element, check its status, and remove it quickly
  133. 2139- var root = document.documentElement;
  134. 2140- root.insertBefore( form, root.firstChild );
  135. 2141-
  136. 2142- // The workaround has to do additional checks after a getElementById
  137. 2143- // Which slows things down for other browsers (hence the branching)
  138. 2144- if ( !!document.getElementById( id ) ) {
  139. 2145- Expr.find.ID = function(match, context, isXML){
  140. 2146- if ( typeof context.getElementById !== "undefined" && !isXML ) {
  141. --
  142. 2182- }
  143. 2183-
  144. 2184- results = tmp;
  145. 2185- }
  146. 2186-
  147. 2187- return results;
  148. 2188- };
  149. 2189- }
  150. 2190-
  151. 2191- // Check to see if an attribute returns normalized href attributes
  152. 2192: div.innerHTML = "<a href='#'></a>";
  153. 2193- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
  154. 2194- div.firstChild.getAttribute("href") !== "#" ) {
  155. 2195- Expr.attrHandle.href = function(elem){
  156. 2196- return elem.getAttribute("href", 2);
  157. 2197- };
  158. 2198- }
  159. 2199-})();
  160. 2200-
  161. 2201-if ( document.querySelectorAll ) (function(){
  162. 2202- var oldSizzle = Sizzle, div = document.createElement("div");
  163. 2203: div.innerHTML = "<p class='TEST'></p>";
  164. 2204-
  165. 2205- // Safari can't handle uppercase or unicode characters when
  166. 2206- // in quirks mode.
  167. 2207- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
  168. 2208- return;
  169. 2209- }
  170. 2210-
  171. 2211- Sizzle = function(query, context, extra, seed){
  172. 2212- context = context || document;
  173. 2213-
  174. --
  175. 2223- };
  176. 2224-
  177. 2225- Sizzle.find = oldSizzle.find;
  178. 2226- Sizzle.filter = oldSizzle.filter;
  179. 2227- Sizzle.selectors = oldSizzle.selectors;
  180. 2228- Sizzle.matches = oldSizzle.matches;
  181. 2229-})();
  182. 2230-
  183. 2231-if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
  184. 2232- var div = document.createElement("div");
  185. 2233: div.innerHTML = "<div class='test e'></div><div class='test'></div>";
  186. 2234-
  187. 2235- // Opera can't find a second classname (in 9.6)
  188. 2236- if ( div.getElementsByClassName("e").length === 0 )
  189. 2237- return;
  190. 2238-
  191. 2239- // Safari caches class attributes, doesn't catch changes (in 3.2)
  192. 2240- div.lastChild.className = "e";
  193. 2241-
  194. 2242- if ( div.getElementsByClassName("e").length === 1 )
  195. 2243- return;
  196. --
  197. 3112-(function(){
  198. 3113-
  199. 3114- jQuery.support = {};
  200. 3115-
  201. 3116- var root = document.documentElement,
  202. 3117- script = document.createElement("script"),
  203. 3118- div = document.createElement("div"),
  204. 3119- id = "script" + (new Date).getTime();
  205. 3120-
  206. 3121- div.style.display = "none";
  207. 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>';
  208. 3123-
  209. 3124- var all = div.getElementsByTagName("*"),
  210. 3125- a = div.getElementsByTagName("a")[0];
  211. 3126-
  212. 3127- // Can't get basic test support
  213. 3128- if ( !all || !all.length || !a ) {
  214. 3129- return;
  215. 3130- }
  216. 3131-
  217. 3132- jQuery.support = {
  218. 3133: // IE strips leading whitespace when .innerHTML is used
  219. 3134- leadingWhitespace: div.firstChild.nodeType == 3,
  220. 3135-
  221. 3136- // Make sure that tbody elements aren't automatically inserted
  222. 3137- // IE will insert them into empty tables
  223. 3138- tbody: !div.getElementsByTagName("tbody").length,
  224. 3139-
  225. 3140- // Make sure that you can get all elements in an <object> element
  226. 3141- // IE 7 always returns no results
  227. 3142- objectAll: !!div.getElementsByTagName("object")[0]
  228. 3143- .getElementsByTagName("*").length,
  229. 3144-
  230. 3145: // Make sure that link elements get serialized correctly by innerHTML
  231. 3146- // This requires a wrapper element in IE
  232. 3147- htmlSerialize: !!div.getElementsByTagName("link").length,
  233. 3148-
  234. 3149- // Get the style information from getAttribute
  235. 3150- // (IE uses .cssText insted)
  236. 3151- style: /red/.test( a.getAttribute("style") ),
  237. 3152-
  238. 3153- // Make sure that URLs aren't manipulated
  239. 3154- // (IE normalizes it by default)
  240. 3155- hrefNormalized: a.getAttribute("href") === "/a",
  241. --
  242. 4220-
  243. 4221-jQuery.offset = {
  244. 4222- initialize: function() {
  245. 4223- if ( this.initialized ) return;
  246. 4224- var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
  247. 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>';
  248. 4226-
  249. 4227- rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
  250. 4228- for ( prop in rules ) container.style[prop] = rules[prop];
  251. 4229-
  252. 4230: container.innerHTML = html;
  253. 4231- body.insertBefore(container, body.firstChild);
  254. 4232- innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
  255. 4233-
  256. 4234- this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
  257. 4235- this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
  258. 4236-
  259. 4237- innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
  260. 4238- this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
  261. 4239-
  262. 4240- body.style.marginTop = '1px';
Add Comment
Please, Sign In to add comment