How to use v method in ng-mocks

Best JavaScript code snippet using ng-mocks

jquery-1.10.2.js

Source:jquery-1.10.2.js Github

copy

Full Screen

...4814 }4815 }4816});4817var isSimple = /^.[^:#\[\.,]*$/,4818 rparentsprev = /^(?:parents|prev(?:Until|All))/,4819 rneedsContext = jQuery.expr.match.needsContext,4820 // methods guaranteed to produce a unique set when starting from a unique set4821 guaranteedUnique = {4822 children: true,4823 contents: true,4824 next: true,4825 prev: true4826 };4827jQuery.fn.extend({4828 find: function( selector ) {4829 var i,4830 ret = [],4831 self = this,4832 len = self.length;4833 if ( typeof selector !== "string" ) {4834 return this.pushStack( jQuery( selector ).filter(function() {4835 for ( i = 0; i < len; i++ ) {4836 if ( jQuery.contains( self[ i ], this ) ) {4837 return true;4838 }4839 }4840 }) );4841 }4842 for ( i = 0; i < len; i++ ) {4843 jQuery.find( selector, self[ i ], ret );4844 }4845 // Needed because $( selector, context ) becomes $( context ).find( selector )4846 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );4847 ret.selector = this.selector ? this.selector + " " + selector : selector;4848 return ret;4849 },4850 has: function( target ) {4851 var i,4852 targets = jQuery( target, this ),4853 len = targets.length;4854 return this.filter(function() {4855 for ( i = 0; i < len; i++ ) {4856 if ( jQuery.contains( this, targets[i] ) ) {4857 return true;4858 }4859 }4860 });4861 },4862 not: function( selector ) {4863 return this.pushStack( winnow(this, selector || [], true) );4864 },4865 filter: function( selector ) {4866 return this.pushStack( winnow(this, selector || [], false) );4867 },4868 is: function( selector ) {4869 return !!winnow(4870 this,4871 // If this is a positional/relative selector, check membership in the returned set4872 // so $("p:first").is("p:last") won't return true for a doc with two "p".4873 typeof selector === "string" && rneedsContext.test( selector ) ?4874 jQuery( selector ) :4875 selector || [],4876 false4877 ).length;4878 },4879 closest: function( selectors, context ) {4880 var cur,4881 i = 0,4882 l = this.length,4883 ret = [],4884 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?4885 jQuery( selectors, context || this.context ) :4886 0;4887 for ( ; i < l; i++ ) {4888 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {4889 // Always skip document fragments4890 if ( cur.nodeType < 11 && (pos ?4891 pos.index(cur) > -1 :4892 // Don't pass non-elements to Sizzle4893 cur.nodeType === 1 &&4894 jQuery.find.matchesSelector(cur, selectors)) ) {4895 cur = ret.push( cur );4896 break;4897 }4898 }4899 }4900 return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );4901 },4902 // Determine the position of an element within4903 // the matched set of elements4904 index: function( elem ) {4905 // No argument, return index in parent4906 if ( !elem ) {4907 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;4908 }4909 // index in selector4910 if ( typeof elem === "string" ) {4911 return jQuery.inArray( this[0], jQuery( elem ) );4912 }4913 // Locate the position of the desired element4914 return jQuery.inArray(4915 // If it receives a jQuery object, the first element is used4916 elem.jquery ? elem[0] : elem, this );4917 },4918 add: function( selector, context ) {4919 var set = typeof selector === "string" ?4920 jQuery( selector, context ) :4921 jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),4922 all = jQuery.merge( this.get(), set );4923 return this.pushStack( jQuery.unique(all) );4924 },4925 addBack: function( selector ) {4926 return this.add( selector == null ?4927 this.prevObject : this.prevObject.filter(selector)4928 );4929 }4930});4931function sibling( cur, dir ) {4932 do {4933 cur = cur[ dir ];4934 } while ( cur && cur.nodeType !== 1 );4935 return cur;4936}4937jQuery.each({4938 parent: function( elem ) {4939 var parent = elem.parentNode;4940 return parent && parent.nodeType !== 11 ? parent : null;4941 },4942 parents: function( elem ) {4943 return jQuery.dir( elem, "parentNode" );4944 },4945 parentsUntil: function( elem, i, until ) {4946 return jQuery.dir( elem, "parentNode", until );4947 },4948 next: function( elem ) {4949 return sibling( elem, "nextSibling" );4950 },4951 prev: function( elem ) {4952 return sibling( elem, "previousSibling" );4953 },4954 nextAll: function( elem ) {4955 return jQuery.dir( elem, "nextSibling" );4956 },4957 prevAll: function( elem ) {4958 return jQuery.dir( elem, "previousSibling" );4959 },4960 nextUntil: function( elem, i, until ) {4961 return jQuery.dir( elem, "nextSibling", until );4962 },4963 prevUntil: function( elem, i, until ) {4964 return jQuery.dir( elem, "previousSibling", until );4965 },4966 siblings: function( elem ) {4967 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );4968 },4969 children: function( elem ) {4970 return jQuery.sibling( elem.firstChild );4971 },4972 contents: function( elem ) {4973 return jQuery.nodeName( elem, "iframe" ) ?4974 elem.contentDocument || elem.contentWindow.document :4975 jQuery.merge( [], elem.childNodes );4976 }4977}, function( name, fn ) {4978 jQuery.fn[ name ] = function( until, selector ) {4979 var ret = jQuery.map( this, fn, until );4980 if ( name.slice( -5 ) !== "Until" ) {4981 selector = until;4982 }4983 if ( selector && typeof selector === "string" ) {4984 ret = jQuery.filter( selector, ret );4985 }4986 if ( this.length > 1 ) {4987 // Remove duplicates4988 if ( !guaranteedUnique[ name ] ) {4989 ret = jQuery.unique( ret );4990 }4991 // Reverse order for parents* and prev-derivatives4992 if ( rparentsprev.test( name ) ) {4993 ret = ret.reverse();4994 }4995 }4996 return this.pushStack( ret );4997 };4998});4999jQuery.extend({5000 filter: function( expr, elems, not ) {5001 var elem = elems[ 0 ];5002 if ( not ) {5003 expr = ":not(" + expr + ")";5004 }5005 return elems.length === 1 && elem.nodeType === 1 ?5006 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :5007 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {5008 return elem.nodeType === 1;5009 }));5010 },5011 dir: function( elem, dir, until ) {5012 var matched = [],5013 cur = elem[ dir ];5014 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {5015 if ( cur.nodeType === 1 ) {5016 matched.push( cur );5017 }5018 cur = cur[dir];5019 }5020 return matched;5021 },5022 sibling: function( n, elem ) {5023 var r = [];5024 for ( ; n; n = n.nextSibling ) {5025 if ( n.nodeType === 1 && n !== elem ) {5026 r.push( n );5027 }5028 }5029 return r;5030 }5031});5032// Implement the identical functionality for filter and not5033function winnow( elements, qualifier, not ) {5034 if ( jQuery.isFunction( qualifier ) ) {5035 return jQuery.grep( elements, function( elem, i ) {5036 /* jshint -W018 */5037 return !!qualifier.call( elem, i, elem ) !== not;5038 });5039 }5040 if ( qualifier.nodeType ) {5041 return jQuery.grep( elements, function( elem ) {5042 return ( elem === qualifier ) !== not;5043 });5044 }5045 if ( typeof qualifier === "string" ) {5046 if ( isSimple.test( qualifier ) ) {5047 return jQuery.filter( qualifier, elements, not );5048 }5049 qualifier = jQuery.filter( qualifier, elements );5050 }5051 return jQuery.grep( elements, function( elem ) {5052 return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;5053 });5054}5055function createSafeFragment( document ) {5056 var list = nodeNames.split( "|" ),5057 safeFrag = document.createDocumentFragment();5058 if ( safeFrag.createElement ) {5059 while ( list.length ) {5060 safeFrag.createElement(5061 list.pop()5062 );5063 }5064 }5065 return safeFrag;5066}5067var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +5068 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",5069 rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,5070 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),5071 rleadingWhitespace = /^\s+/,5072 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,5073 rtagName = /<([\w:]+)/,5074 rtbody = /<tbody/i,5075 rhtml = /<|&#?\w+;/,5076 rnoInnerhtml = /<(?:script|style|link)/i,5077 manipulation_rcheckableType = /^(?:checkbox|radio)$/i,5078 // checked="checked" or checked5079 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,5080 rscriptType = /^$|\/(?:java|ecma)script/i,5081 rscriptTypeMasked = /^true\/(.*)/,5082 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,5083 // We have to close these tags to support XHTML (#13200)5084 wrapMap = {5085 option: [ 1, "<select multiple='multiple'>", "</select>" ],5086 legend: [ 1, "<fieldset>", "</fieldset>" ],5087 area: [ 1, "<map>", "</map>" ],5088 param: [ 1, "<object>", "</object>" ],5089 thead: [ 1, "<table>", "</table>" ],5090 tr: [ 2, "<table><tbody>", "</tbody></table>" ],5091 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],5092 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],5093 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,5094 // unless wrapped in a div with non-breaking characters in front of it.5095 _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]5096 },5097 safeFragment = createSafeFragment( document ),5098 fragmentDiv = safeFragment.appendChild( document.createElement("div") );5099wrapMap.optgroup = wrapMap.option;5100wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;5101wrapMap.th = wrapMap.td;5102jQuery.fn.extend({5103 text: function( value ) {5104 return jQuery.access( this, function( value ) {5105 return value === undefined ?5106 jQuery.text( this ) :5107 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );5108 }, null, value, arguments.length );5109 },5110 append: function() {5111 return this.domManip( arguments, function( elem ) {5112 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {5113 var target = manipulationTarget( this, elem );5114 target.appendChild( elem );5115 }5116 });5117 },5118 prepend: function() {5119 return this.domManip( arguments, function( elem ) {5120 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {5121 var target = manipulationTarget( this, elem );5122 target.insertBefore( elem, target.firstChild );5123 }5124 });5125 },5126 before: function() {5127 return this.domManip( arguments, function( elem ) {5128 if ( this.parentNode ) {5129 this.parentNode.insertBefore( elem, this );5130 }5131 });5132 },5133 after: function() {5134 return this.domManip( arguments, function( elem ) {5135 if ( this.parentNode ) {5136 this.parentNode.insertBefore( elem, this.nextSibling );5137 }5138 });5139 },5140 // keepData is for internal use only--do not document5141 remove: function( selector, keepData ) {5142 var elem,5143 elems = selector ? jQuery.filter( selector, this ) : this,5144 i = 0;5145 for ( ; (elem = elems[i]) != null; i++ ) {5146 if ( !keepData && elem.nodeType === 1 ) {5147 jQuery.cleanData( getAll( elem ) );5148 }5149 if ( elem.parentNode ) {5150 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {5151 setGlobalEval( getAll( elem, "script" ) );5152 }5153 elem.parentNode.removeChild( elem );5154 }5155 }5156 return this;5157 },5158 empty: function() {5159 var elem,5160 i = 0;5161 for ( ; (elem = this[i]) != null; i++ ) {5162 // Remove element nodes and prevent memory leaks5163 if ( elem.nodeType === 1 ) {5164 jQuery.cleanData( getAll( elem, false ) );5165 }5166 // Remove any remaining nodes5167 while ( elem.firstChild ) {5168 elem.removeChild( elem.firstChild );5169 }5170 // If this is a select, ensure that it displays empty (#12336)5171 // Support: IE<95172 if ( elem.options && jQuery.nodeName( elem, "select" ) ) {5173 elem.options.length = 0;5174 }5175 }5176 return this;5177 },5178 clone: function( dataAndEvents, deepDataAndEvents ) {5179 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;5180 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;5181 return this.map( function () {5182 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );5183 });5184 },5185 html: function( value ) {5186 return jQuery.access( this, function( value ) {5187 var elem = this[0] || {},5188 i = 0,5189 l = this.length;5190 if ( value === undefined ) {5191 return elem.nodeType === 1 ?5192 elem.innerHTML.replace( rinlinejQuery, "" ) :5193 undefined;5194 }5195 // See if we can take a shortcut and just use innerHTML5196 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&5197 ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&5198 ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&5199 !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {5200 value = value.replace( rxhtmlTag, "<$1></$2>" );5201 try {5202 for (; i < l; i++ ) {5203 // Remove element nodes and prevent memory leaks5204 elem = this[i] || {};5205 if ( elem.nodeType === 1 ) {5206 jQuery.cleanData( getAll( elem, false ) );5207 elem.innerHTML = value;5208 }5209 }5210 elem = 0;5211 // If using innerHTML throws an exception, use the fallback method5212 } catch(e) {}5213 }5214 if ( elem ) {5215 this.empty().append( value );5216 }5217 }, null, value, arguments.length );5218 },5219 replaceWith: function() {5220 var5221 // Snapshot the DOM in case .domManip sweeps something relevant into its fragment5222 args = jQuery.map( this, function( elem ) {5223 return [ elem.nextSibling, elem.parentNode ];5224 }),5225 i = 0;5226 // Make the changes, replacing each context element with the new content5227 this.domManip( arguments, function( elem ) {5228 var next = args[ i++ ],5229 parent = args[ i++ ];5230 if ( parent ) {5231 // Don't use the snapshot next if it has moved (#13810)5232 if ( next && next.parentNode !== parent ) {5233 next = this.nextSibling;5234 }5235 jQuery( this ).remove();5236 parent.insertBefore( elem, next );5237 }5238 // Allow new content to include elements from the context set5239 }, true );5240 // Force removal if there was no new content (e.g., from empty arguments)5241 return i ? this : this.remove();5242 },5243 detach: function( selector ) {5244 return this.remove( selector, true );5245 },5246 domManip: function( args, callback, allowIntersection ) {5247 // Flatten any nested arrays5248 args = core_concat.apply( [], args );5249 var first, node, hasScripts,5250 scripts, doc, fragment,5251 i = 0,5252 l = this.length,5253 set = this,5254 iNoClone = l - 1,5255 value = args[0],5256 isFunction = jQuery.isFunction( value );5257 // We can't cloneNode fragments that contain checked, in WebKit5258 if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {5259 return this.each(function( index ) {5260 var self = set.eq( index );5261 if ( isFunction ) {5262 args[0] = value.call( this, index, self.html() );5263 }5264 self.domManip( args, callback, allowIntersection );5265 });5266 }5267 if ( l ) {5268 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );5269 first = fragment.firstChild;5270 if ( fragment.childNodes.length === 1 ) {5271 fragment = first;5272 }5273 if ( first ) {5274 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );5275 hasScripts = scripts.length;5276 // Use the original fragment for the last item instead of the first because it can end up5277 // being emptied incorrectly in certain situations (#8070).5278 for ( ; i < l; i++ ) {5279 node = fragment;5280 if ( i !== iNoClone ) {5281 node = jQuery.clone( node, true, true );5282 // Keep references to cloned scripts for later restoration5283 if ( hasScripts ) {5284 jQuery.merge( scripts, getAll( node, "script" ) );5285 }5286 }5287 callback.call( this[i], node, i );5288 }5289 if ( hasScripts ) {5290 doc = scripts[ scripts.length - 1 ].ownerDocument;5291 // Reenable scripts5292 jQuery.map( scripts, restoreScript );5293 // Evaluate executable scripts on first document insertion5294 for ( i = 0; i < hasScripts; i++ ) {5295 node = scripts[ i ];5296 if ( rscriptType.test( node.type || "" ) &&5297 !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {5298 if ( node.src ) {5299 // Hope ajax is available...5300 jQuery._evalUrl( node.src );5301 } else {5302 jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );5303 }5304 }5305 }5306 }5307 // Fix #11809: Avoid leaking memory5308 fragment = first = null;5309 }5310 }5311 return this;5312 }5313});5314// Support: IE<85315// Manipulating tables requires a tbody5316function manipulationTarget( elem, content ) {5317 return jQuery.nodeName( elem, "table" ) &&5318 jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?5319 elem.getElementsByTagName("tbody")[0] ||5320 elem.appendChild( elem.ownerDocument.createElement("tbody") ) :5321 elem;5322}5323// Replace/restore the type attribute of script elements for safe DOM manipulation5324function disableScript( elem ) {5325 elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;5326 return elem;5327}5328function restoreScript( elem ) {5329 var match = rscriptTypeMasked.exec( elem.type );5330 if ( match ) {5331 elem.type = match[1];5332 } else {5333 elem.removeAttribute("type");5334 }5335 return elem;5336}5337// Mark scripts as having already been evaluated5338function setGlobalEval( elems, refElements ) {5339 var elem,5340 i = 0;5341 for ( ; (elem = elems[i]) != null; i++ ) {5342 jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );5343 }5344}5345function cloneCopyEvent( src, dest ) {5346 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {5347 return;5348 }5349 var type, i, l,5350 oldData = jQuery._data( src ),5351 curData = jQuery._data( dest, oldData ),5352 events = oldData.events;5353 if ( events ) {5354 delete curData.handle;5355 curData.events = {};5356 for ( type in events ) {5357 for ( i = 0, l = events[ type ].length; i < l; i++ ) {5358 jQuery.event.add( dest, type, events[ type ][ i ] );5359 }5360 }5361 }5362 // make the cloned public data object a copy from the original5363 if ( curData.data ) {5364 curData.data = jQuery.extend( {}, curData.data );5365 }5366}5367function fixCloneNodeIssues( src, dest ) {5368 var nodeName, e, data;5369 // We do not need to do anything for non-Elements5370 if ( dest.nodeType !== 1 ) {5371 return;5372 }5373 nodeName = dest.nodeName.toLowerCase();5374 // IE6-8 copies events bound via attachEvent when using cloneNode.5375 if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {5376 data = jQuery._data( dest );5377 for ( e in data.events ) {5378 jQuery.removeEvent( dest, e, data.handle );5379 }5380 // Event data gets referenced instead of copied if the expando gets copied too5381 dest.removeAttribute( jQuery.expando );5382 }5383 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text5384 if ( nodeName === "script" && dest.text !== src.text ) {5385 disableScript( dest ).text = src.text;5386 restoreScript( dest );5387 // IE6-10 improperly clones children of object elements using classid.5388 // IE10 throws NoModificationAllowedError if parent is null, #12132.5389 } else if ( nodeName === "object" ) {5390 if ( dest.parentNode ) {5391 dest.outerHTML = src.outerHTML;5392 }5393 // This path appears unavoidable for IE9. When cloning an object5394 // element in IE9, the outerHTML strategy above is not sufficient.5395 // If the src has innerHTML and the destination does not,5396 // copy the src.innerHTML into the dest.innerHTML. #103245397 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {5398 dest.innerHTML = src.innerHTML;5399 }5400 } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {5401 // IE6-8 fails to persist the checked state of a cloned checkbox5402 // or radio button. Worse, IE6-7 fail to give the cloned element5403 // a checked appearance if the defaultChecked value isn't also set5404 dest.defaultChecked = dest.checked = src.checked;5405 // IE6-7 get confused and end up setting the value of a cloned5406 // checkbox/radio button to an empty string instead of "on"5407 if ( dest.value !== src.value ) {5408 dest.value = src.value;5409 }5410 // IE6-8 fails to return the selected option to the default selected5411 // state when cloning options5412 } else if ( nodeName === "option" ) {5413 dest.defaultSelected = dest.selected = src.defaultSelected;5414 // IE6-8 fails to set the defaultValue to the correct value when5415 // cloning other types of input fields5416 } else if ( nodeName === "input" || nodeName === "textarea" ) {5417 dest.defaultValue = src.defaultValue;5418 }5419}5420jQuery.each({5421 appendTo: "append",5422 prependTo: "prepend",5423 insertBefore: "before",5424 insertAfter: "after",5425 replaceAll: "replaceWith"5426}, function( name, original ) {5427 jQuery.fn[ name ] = function( selector ) {5428 var elems,5429 i = 0,5430 ret = [],5431 insert = jQuery( selector ),5432 last = insert.length - 1;5433 for ( ; i <= last; i++ ) {5434 elems = i === last ? this : this.clone(true);5435 jQuery( insert[i] )[ original ]( elems );5436 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()5437 core_push.apply( ret, elems.get() );5438 }5439 return this.pushStack( ret );5440 };5441});5442function getAll( context, tag ) {5443 var elems, elem,5444 i = 0,5445 found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :5446 typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :5447 undefined;5448 if ( !found ) {5449 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {5450 if ( !tag || jQuery.nodeName( elem, tag ) ) {5451 found.push( elem );5452 } else {5453 jQuery.merge( found, getAll( elem, tag ) );5454 }5455 }5456 }5457 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?5458 jQuery.merge( [ context ], found ) :5459 found;5460}5461// Used in buildFragment, fixes the defaultChecked property5462function fixDefaultChecked( elem ) {5463 if ( manipulation_rcheckableType.test( elem.type ) ) {5464 elem.defaultChecked = elem.checked;5465 }5466}5467jQuery.extend({5468 clone: function( elem, dataAndEvents, deepDataAndEvents ) {5469 var destElements, node, clone, i, srcElements,5470 inPage = jQuery.contains( elem.ownerDocument, elem );5471 if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {5472 clone = elem.cloneNode( true );5473 // IE<=8 does not properly clone detached, unknown element nodes5474 } else {5475 fragmentDiv.innerHTML = elem.outerHTML;5476 fragmentDiv.removeChild( clone = fragmentDiv.firstChild );5477 }5478 if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&5479 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {5480 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/25481 destElements = getAll( clone );5482 srcElements = getAll( elem );5483 // Fix all IE cloning issues5484 for ( i = 0; (node = srcElements[i]) != null; ++i ) {5485 // Ensure that the destination node is not null; Fixes #95875486 if ( destElements[i] ) {5487 fixCloneNodeIssues( node, destElements[i] );5488 }5489 }5490 }5491 // Copy the events from the original to the clone5492 if ( dataAndEvents ) {5493 if ( deepDataAndEvents ) {5494 srcElements = srcElements || getAll( elem );5495 destElements = destElements || getAll( clone );5496 for ( i = 0; (node = srcElements[i]) != null; i++ ) {5497 cloneCopyEvent( node, destElements[i] );5498 }5499 } else {5500 cloneCopyEvent( elem, clone );5501 }5502 }5503 // Preserve script evaluation history5504 destElements = getAll( clone, "script" );5505 if ( destElements.length > 0 ) {5506 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );5507 }5508 destElements = srcElements = node = null;5509 // Return the cloned set5510 return clone;5511 },5512 buildFragment: function( elems, context, scripts, selection ) {5513 var j, elem, contains,5514 tmp, tag, tbody, wrap,5515 l = elems.length,5516 // Ensure a safe fragment5517 safe = createSafeFragment( context ),5518 nodes = [],5519 i = 0;5520 for ( ; i < l; i++ ) {5521 elem = elems[ i ];5522 if ( elem || elem === 0 ) {5523 // Add nodes directly5524 if ( jQuery.type( elem ) === "object" ) {5525 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );5526 // Convert non-html into a text node5527 } else if ( !rhtml.test( elem ) ) {5528 nodes.push( context.createTextNode( elem ) );5529 // Convert html into DOM nodes5530 } else {5531 tmp = tmp || safe.appendChild( context.createElement("div") );5532 // Deserialize a standard representation5533 tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();5534 wrap = wrapMap[ tag ] || wrapMap._default;5535 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];5536 // Descend through wrappers to the right content5537 j = wrap[0];5538 while ( j-- ) {5539 tmp = tmp.lastChild;5540 }5541 // Manually add leading whitespace removed by IE5542 if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {5543 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );5544 }5545 // Remove IE's autoinserted <tbody> from table fragments5546 if ( !jQuery.support.tbody ) {5547 // String was a <table>, *may* have spurious <tbody>5548 elem = tag === "table" && !rtbody.test( elem ) ?5549 tmp.firstChild :5550 // String was a bare <thead> or <tfoot>5551 wrap[1] === "<table>" && !rtbody.test( elem ) ?5552 tmp :5553 0;5554 j = elem && elem.childNodes.length;5555 while ( j-- ) {5556 if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {5557 elem.removeChild( tbody );5558 }5559 }5560 }5561 jQuery.merge( nodes, tmp.childNodes );5562 // Fix #12392 for WebKit and IE > 95563 tmp.textContent = "";5564 // Fix #12392 for oldIE5565 while ( tmp.firstChild ) {5566 tmp.removeChild( tmp.firstChild );5567 }5568 // Remember the top-level container for proper cleanup5569 tmp = safe.lastChild;5570 }5571 }5572 }5573 // Fix #11356: Clear elements from fragment5574 if ( tmp ) {5575 safe.removeChild( tmp );5576 }5577 // Reset defaultChecked for any radios and checkboxes5578 // about to be appended to the DOM in IE 6/7 (#8060)5579 if ( !jQuery.support.appendChecked ) {5580 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );5581 }5582 i = 0;5583 while ( (elem = nodes[ i++ ]) ) {5584 // #4087 - If origin and destination elements are the same, and this is5585 // that element, do not do anything5586 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {5587 continue;5588 }5589 contains = jQuery.contains( elem.ownerDocument, elem );5590 // Append to fragment5591 tmp = getAll( safe.appendChild( elem ), "script" );5592 // Preserve script evaluation history5593 if ( contains ) {5594 setGlobalEval( tmp );5595 }5596 // Capture executables5597 if ( scripts ) {5598 j = 0;5599 while ( (elem = tmp[ j++ ]) ) {5600 if ( rscriptType.test( elem.type || "" ) ) {5601 scripts.push( elem );5602 }5603 }5604 }5605 }5606 tmp = null;5607 return safe;5608 },5609 cleanData: function( elems, /* internal */ acceptData ) {5610 var elem, type, id, data,5611 i = 0,5612 internalKey = jQuery.expando,5613 cache = jQuery.cache,5614 deleteExpando = jQuery.support.deleteExpando,5615 special = jQuery.event.special;5616 for ( ; (elem = elems[i]) != null; i++ ) {5617 if ( acceptData || jQuery.acceptData( elem ) ) {5618 id = elem[ internalKey ];5619 data = id && cache[ id ];5620 if ( data ) {5621 if ( data.events ) {5622 for ( type in data.events ) {5623 if ( special[ type ] ) {5624 jQuery.event.remove( elem, type );5625 // This is a shortcut to avoid jQuery.event.remove's overhead5626 } else {5627 jQuery.removeEvent( elem, type, data.handle );5628 }5629 }5630 }5631 // Remove cache only if it was not already removed by jQuery.event.remove5632 if ( cache[ id ] ) {5633 delete cache[ id ];5634 // IE does not allow us to delete expando properties from nodes,5635 // nor does it have a removeAttribute function on Document nodes;5636 // we must handle all of these cases5637 if ( deleteExpando ) {5638 delete elem[ internalKey ];5639 } else if ( typeof elem.removeAttribute !== core_strundefined ) {5640 elem.removeAttribute( internalKey );5641 } else {5642 elem[ internalKey ] = null;5643 }5644 core_deletedIds.push( id );5645 }5646 }5647 }5648 }5649 },5650 _evalUrl: function( url ) {5651 return jQuery.ajax({5652 url: url,5653 type: "GET",5654 dataType: "script",5655 async: false,5656 global: false,5657 "throws": true5658 });5659 }5660});5661jQuery.fn.extend({5662 wrapAll: function( html ) {5663 if ( jQuery.isFunction( html ) ) {5664 return this.each(function(i) {5665 jQuery(this).wrapAll( html.call(this, i) );5666 });5667 }5668 if ( this[0] ) {5669 // The elements to wrap the target around5670 var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);5671 if ( this[0].parentNode ) {5672 wrap.insertBefore( this[0] );5673 }5674 wrap.map(function() {5675 var elem = this;5676 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {5677 elem = elem.firstChild;5678 }5679 return elem;5680 }).append( this );5681 }5682 return this;5683 },5684 wrapInner: function( html ) {5685 if ( jQuery.isFunction( html ) ) {5686 return this.each(function(i) {5687 jQuery(this).wrapInner( html.call(this, i) );5688 });5689 }5690 return this.each(function() {5691 var self = jQuery( this ),5692 contents = self.contents();5693 if ( contents.length ) {5694 contents.wrapAll( html );5695 } else {5696 self.append( html );5697 }5698 });5699 },5700 wrap: function( html ) {5701 var isFunction = jQuery.isFunction( html );5702 return this.each(function(i) {5703 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );5704 });5705 },5706 unwrap: function() {5707 return this.parent().each(function() {5708 if ( !jQuery.nodeName( this, "body" ) ) {5709 jQuery( this ).replaceWith( this.childNodes );5710 }5711 }).end();5712 }5713});5714var iframe, getStyles, curCSS,5715 ralpha = /alpha\([^)]*\)/i,5716 ropacity = /opacity\s*=\s*([^)]*)/,5717 rposition = /^(top|right|bottom|left)$/,5718 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"5719 // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display5720 rdisplayswap = /^(none|table(?!-c[ea]).+)/,5721 rmargin = /^margin/,5722 rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),5723 rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),5724 rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),5725 elemdisplay = { BODY: "block" },5726 cssShow = { position: "absolute", visibility: "hidden", display: "block" },5727 cssNormalTransform = {5728 letterSpacing: 0,5729 fontWeight: 4005730 },5731 cssExpand = [ "Top", "Right", "Bottom", "Left" ],5732 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];5733// return a css property mapped to a potentially vendor prefixed property5734function vendorPropName( style, name ) {5735 // shortcut for names that are not vendor prefixed5736 if ( name in style ) {5737 return name;5738 }5739 // check for vendor prefixed names5740 var capName = name.charAt(0).toUpperCase() + name.slice(1),5741 origName = name,5742 i = cssPrefixes.length;5743 while ( i-- ) {5744 name = cssPrefixes[ i ] + capName;5745 if ( name in style ) {5746 return name;5747 }5748 }5749 return origName;5750}5751function isHidden( elem, el ) {5752 // isHidden might be called from jQuery#filter function;5753 // in that case, element will be second argument5754 elem = el || elem;5755 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );5756}5757function showHide( elements, show ) {5758 var display, elem, hidden,5759 values = [],5760 index = 0,5761 length = elements.length;5762 for ( ; index < length; index++ ) {5763 elem = elements[ index ];5764 if ( !elem.style ) {5765 continue;5766 }5767 values[ index ] = jQuery._data( elem, "olddisplay" );5768 display = elem.style.display;5769 if ( show ) {5770 // Reset the inline display of this element to learn if it is5771 // being hidden by cascaded rules or not5772 if ( !values[ index ] && display === "none" ) {5773 elem.style.display = "";5774 }5775 // Set elements which have been overridden with display: none5776 // in a stylesheet to whatever the default browser style is5777 // for such an element5778 if ( elem.style.display === "" && isHidden( elem ) ) {5779 values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );5780 }5781 } else {5782 if ( !values[ index ] ) {5783 hidden = isHidden( elem );5784 if ( display && display !== "none" || !hidden ) {5785 jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );5786 }5787 }5788 }5789 }5790 // Set the display of most of the elements in a second loop5791 // to avoid the constant reflow5792 for ( index = 0; index < length; index++ ) {5793 elem = elements[ index ];5794 if ( !elem.style ) {5795 continue;5796 }5797 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {5798 elem.style.display = show ? values[ index ] || "" : "none";5799 }5800 }5801 return elements;5802}5803jQuery.fn.extend({5804 css: function( name, value ) {5805 return jQuery.access( this, function( elem, name, value ) {5806 var len, styles,5807 map = {},5808 i = 0;5809 if ( jQuery.isArray( name ) ) {5810 styles = getStyles( elem );5811 len = name.length;5812 for ( ; i < len; i++ ) {5813 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );5814 }5815 return map;5816 }5817 return value !== undefined ?5818 jQuery.style( elem, name, value ) :5819 jQuery.css( elem, name );5820 }, name, value, arguments.length > 1 );5821 },5822 show: function() {5823 return showHide( this, true );5824 },5825 hide: function() {5826 return showHide( this );5827 },5828 toggle: function( state ) {5829 if ( typeof state === "boolean" ) {5830 return state ? this.show() : this.hide();5831 }5832 return this.each(function() {5833 if ( isHidden( this ) ) {5834 jQuery( this ).show();5835 } else {5836 jQuery( this ).hide();5837 }5838 });5839 }5840});5841jQuery.extend({5842 // Add in style property hooks for overriding the default5843 // behavior of getting and setting a style property5844 cssHooks: {5845 opacity: {5846 get: function( elem, computed ) {5847 if ( computed ) {5848 // We should always get a number back from opacity5849 var ret = curCSS( elem, "opacity" );5850 return ret === "" ? "1" : ret;5851 }5852 }5853 }5854 },5855 // Don't automatically add "px" to these possibly-unitless properties5856 cssNumber: {5857 "columnCount": true,5858 "fillOpacity": true,5859 "fontWeight": true,5860 "lineHeight": true,5861 "opacity": true,5862 "order": true,5863 "orphans": true,5864 "widows": true,5865 "zIndex": true,5866 "zoom": true5867 },5868 // Add in properties whose names you wish to fix before5869 // setting or getting the value5870 cssProps: {5871 // normalize float css property5872 "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"5873 },5874 // Get and set the style property on a DOM Node5875 style: function( elem, name, value, extra ) {5876 // Don't set styles on text and comment nodes5877 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {5878 return;5879 }5880 // Make sure that we're working with the right name5881 var ret, type, hooks,5882 origName = jQuery.camelCase( name ),5883 style = elem.style;5884 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );5885 // gets hook for the prefixed version5886 // followed by the unprefixed version5887 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];5888 // Check if we're setting a value5889 if ( value !== undefined ) {5890 type = typeof value;5891 // convert relative number strings (+= or -=) to relative numbers. #73455892 if ( type === "string" && (ret = rrelNum.exec( value )) ) {5893 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );5894 // Fixes bug #92375895 type = "number";5896 }5897 // Make sure that NaN and null values aren't set. See: #71165898 if ( value == null || type === "number" && isNaN( value ) ) {5899 return;5900 }5901 // If a number was passed in, add 'px' to the (except for certain CSS properties)5902 if ( type === "number" && !jQuery.cssNumber[ origName ] ) {5903 value += "px";5904 }5905 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,5906 // but it would mean to define eight (for every problematic property) identical functions5907 if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {5908 style[ name ] = "inherit";5909 }5910 // If a hook was provided, use that value, otherwise just set the specified value5911 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {5912 // Wrapped to prevent IE from throwing errors when 'invalid' values are provided5913 // Fixes bug #55095914 try {5915 style[ name ] = value;5916 } catch(e) {}5917 }5918 } else {5919 // If a hook was provided get the non-computed value from there5920 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {5921 return ret;5922 }5923 // Otherwise just get the value from the style object5924 return style[ name ];5925 }5926 },5927 css: function( elem, name, extra, styles ) {5928 var num, val, hooks,5929 origName = jQuery.camelCase( name );5930 // Make sure that we're working with the right name5931 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );5932 // gets hook for the prefixed version5933 // followed by the unprefixed version5934 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];5935 // If a hook was provided get the computed value from there5936 if ( hooks && "get" in hooks ) {5937 val = hooks.get( elem, true, extra );5938 }5939 // Otherwise, if a way to get the computed value exists, use that5940 if ( val === undefined ) {5941 val = curCSS( elem, name, styles );5942 }5943 //convert "normal" to computed value5944 if ( val === "normal" && name in cssNormalTransform ) {5945 val = cssNormalTransform[ name ];5946 }5947 // Return, converting to number if forced or a qualifier was provided and val looks numeric5948 if ( extra === "" || extra ) {5949 num = parseFloat( val );5950 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;5951 }5952 return val;5953 }5954});5955// NOTE: we've included the "window" in window.getComputedStyle5956// because jsdom on node.js will break without it.5957if ( window.getComputedStyle ) {5958 getStyles = function( elem ) {5959 return window.getComputedStyle( elem, null );5960 };5961 curCSS = function( elem, name, _computed ) {5962 var width, minWidth, maxWidth,5963 computed = _computed || getStyles( elem ),5964 // getPropertyValue is only needed for .css('filter') in IE9, see #125375965 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,5966 style = elem.style;5967 if ( computed ) {5968 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {5969 ret = jQuery.style( elem, name );5970 }5971 // A tribute to the "awesome hack by Dean Edwards"5972 // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right5973 // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels5974 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values5975 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {5976 // Remember the original values5977 width = style.width;5978 minWidth = style.minWidth;5979 maxWidth = style.maxWidth;5980 // Put in the new values to get a computed value out5981 style.minWidth = style.maxWidth = style.width = ret;5982 ret = computed.width;5983 // Revert the changed values5984 style.width = width;5985 style.minWidth = minWidth;5986 style.maxWidth = maxWidth;5987 }5988 }5989 return ret;5990 };5991} else if ( document.documentElement.currentStyle ) {5992 getStyles = function( elem ) {5993 return elem.currentStyle;5994 };5995 curCSS = function( elem, name, _computed ) {5996 var left, rs, rsLeft,5997 computed = _computed || getStyles( elem ),5998 ret = computed ? computed[ name ] : undefined,5999 style = elem.style;6000 // Avoid setting ret to empty string here6001 // so we don't default to auto6002 if ( ret == null && style && style[ name ] ) {6003 ret = style[ name ];6004 }6005 // From the awesome hack by Dean Edwards6006 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-1022916007 // If we're not dealing with a regular pixel number6008 // but a number that has a weird ending, we need to convert it to pixels6009 // but not position css attributes, as those are proportional to the parent element instead6010 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem6011 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {6012 // Remember the original values6013 left = style.left;6014 rs = elem.runtimeStyle;6015 rsLeft = rs && rs.left;6016 // Put in the new values to get a computed value out6017 if ( rsLeft ) {6018 rs.left = elem.currentStyle.left;6019 }6020 style.left = name === "fontSize" ? "1em" : ret;6021 ret = style.pixelLeft + "px";6022 // Revert the changed values6023 style.left = left;6024 if ( rsLeft ) {6025 rs.left = rsLeft;6026 }6027 }6028 return ret === "" ? "auto" : ret;6029 };6030}6031function setPositiveNumber( elem, value, subtract ) {6032 var matches = rnumsplit.exec( value );6033 return matches ?6034 // Guard against undefined "subtract", e.g., when used as in cssHooks6035 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :6036 value;6037}6038function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {6039 var i = extra === ( isBorderBox ? "border" : "content" ) ?6040 // If we already have the right measurement, avoid augmentation6041 4 :6042 // Otherwise initialize for horizontal or vertical properties6043 name === "width" ? 1 : 0,6044 val = 0;6045 for ( ; i < 4; i += 2 ) {6046 // both box models exclude margin, so add it if we want it6047 if ( extra === "margin" ) {6048 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );6049 }6050 if ( isBorderBox ) {6051 // border-box includes padding, so remove it if we want content6052 if ( extra === "content" ) {6053 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );6054 }6055 // at this point, extra isn't border nor margin, so remove border6056 if ( extra !== "margin" ) {6057 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );6058 }6059 } else {6060 // at this point, extra isn't content, so add padding6061 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );6062 // at this point, extra isn't content nor padding, so add border6063 if ( extra !== "padding" ) {6064 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );6065 }6066 }6067 }6068 return val;6069}6070function getWidthOrHeight( elem, name, extra ) {6071 // Start with offset property, which is equivalent to the border-box value6072 var valueIsBorderBox = true,6073 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,6074 styles = getStyles( elem ),6075 isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";6076 // some non-html elements return undefined for offsetWidth, so check for null/undefined6077 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=6492856078 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=4916686079 if ( val <= 0 || val == null ) {6080 // Fall back to computed then uncomputed css if necessary6081 val = curCSS( elem, name, styles );6082 if ( val < 0 || val == null ) {6083 val = elem.style[ name ];6084 }6085 // Computed unit is not pixels. Stop here and return.6086 if ( rnumnonpx.test(val) ) {6087 return val;6088 }6089 // we need the check for style in case a browser which returns unreliable values6090 // for getComputedStyle silently falls back to the reliable elem.style6091 valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );6092 // Normalize "", auto, and prepare for extra6093 val = parseFloat( val ) || 0;6094 }6095 // use the active box-sizing model to add/subtract irrelevant styles6096 return ( val +6097 augmentWidthOrHeight(6098 elem,6099 name,6100 extra || ( isBorderBox ? "border" : "content" ),6101 valueIsBorderBox,6102 styles6103 )6104 ) + "px";6105}6106// Try to determine the default display value of an element6107function css_defaultDisplay( nodeName ) {6108 var doc = document,6109 display = elemdisplay[ nodeName ];6110 if ( !display ) {6111 display = actualDisplay( nodeName, doc );6112 // If the simple way fails, read from inside an iframe6113 if ( display === "none" || !display ) {6114 // Use the already-created iframe if possible6115 iframe = ( iframe ||6116 jQuery("<iframe frameborder='0' width='0' height='0'/>")6117 .css( "cssText", "display:block !important" )6118 ).appendTo( doc.documentElement );6119 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse6120 doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;6121 doc.write("<!doctype html><html><body>");6122 doc.close();6123 display = actualDisplay( nodeName, doc );6124 iframe.detach();6125 }6126 // Store the correct default display6127 elemdisplay[ nodeName ] = display;6128 }6129 return display;6130}6131// Called ONLY from within css_defaultDisplay6132function actualDisplay( name, doc ) {6133 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),6134 display = jQuery.css( elem[0], "display" );6135 elem.remove();6136 return display;6137}6138jQuery.each([ "height", "width" ], function( i, name ) {6139 jQuery.cssHooks[ name ] = {6140 get: function( elem, computed, extra ) {6141 if ( computed ) {6142 // certain elements can have dimension info if we invisibly show them6143 // however, it must have a current display style that would benefit from this6144 return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?6145 jQuery.swap( elem, cssShow, function() {6146 return getWidthOrHeight( elem, name, extra );6147 }) :6148 getWidthOrHeight( elem, name, extra );6149 }6150 },6151 set: function( elem, value, extra ) {6152 var styles = extra && getStyles( elem );6153 return setPositiveNumber( elem, value, extra ?6154 augmentWidthOrHeight(6155 elem,6156 name,6157 extra,6158 jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",6159 styles6160 ) : 06161 );6162 }6163 };6164});6165if ( !jQuery.support.opacity ) {6166 jQuery.cssHooks.opacity = {6167 get: function( elem, computed ) {6168 // IE uses filters for opacity6169 return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?6170 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :6171 computed ? "1" : "";6172 },6173 set: function( elem, value ) {6174 var style = elem.style,6175 currentStyle = elem.currentStyle,6176 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",6177 filter = currentStyle && currentStyle.filter || style.filter || "";6178 // IE has trouble with opacity if it does not have layout6179 // Force it by setting the zoom level6180 style.zoom = 1;6181 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #66526182 // if value === "", then remove inline opacity #126856183 if ( ( value >= 1 || value === "" ) &&6184 jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&6185 style.removeAttribute ) {6186 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText6187 // if "filter:" is present at all, clearType is disabled, we want to avoid this6188 // style.removeAttribute is IE Only, but so apparently is this code path...6189 style.removeAttribute( "filter" );6190 // if there is no filter style applied in a css rule or unset inline opacity, we are done6191 if ( value === "" || currentStyle && !currentStyle.filter ) {6192 return;6193 }6194 }6195 // otherwise, set new filter values6196 style.filter = ralpha.test( filter ) ?6197 filter.replace( ralpha, opacity ) :6198 filter + " " + opacity;6199 }6200 };6201}6202// These hooks cannot be added until DOM ready because the support test6203// for it is not run until after DOM ready6204jQuery(function() {6205 if ( !jQuery.support.reliableMarginRight ) {6206 jQuery.cssHooks.marginRight = {6207 get: function( elem, computed ) {6208 if ( computed ) {6209 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right6210 // Work around by temporarily setting element display to inline-block6211 return jQuery.swap( elem, { "display": "inline-block" },6212 curCSS, [ elem, "marginRight" ] );6213 }6214 }6215 };6216 }6217 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=290846218 // getComputedStyle returns percent when specified for top/left/bottom/right6219 // rather than make the css module depend on the offset module, we just check for it here6220 if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {6221 jQuery.each( [ "top", "left" ], function( i, prop ) {6222 jQuery.cssHooks[ prop ] = {6223 get: function( elem, computed ) {6224 if ( computed ) {6225 computed = curCSS( elem, prop );6226 // if curCSS returns percentage, fallback to offset6227 return rnumnonpx.test( computed ) ?6228 jQuery( elem ).position()[ prop ] + "px" :6229 computed;6230 }6231 }6232 };6233 });6234 }6235});6236if ( jQuery.expr && jQuery.expr.filters ) {6237 jQuery.expr.filters.hidden = function( elem ) {6238 // Support: Opera <= 12.126239 // Opera reports offsetWidths and offsetHeights less than zero on some elements6240 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||6241 (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");6242 };6243 jQuery.expr.filters.visible = function( elem ) {6244 return !jQuery.expr.filters.hidden( elem );6245 };6246}6247// These hooks are used by animate to expand properties6248jQuery.each({6249 margin: "",6250 padding: "",6251 border: "Width"6252}, function( prefix, suffix ) {6253 jQuery.cssHooks[ prefix + suffix ] = {6254 expand: function( value ) {6255 var i = 0,6256 expanded = {},6257 // assumes a single number if not a string6258 parts = typeof value === "string" ? value.split(" ") : [ value ];6259 for ( ; i < 4; i++ ) {6260 expanded[ prefix + cssExpand[ i ] + suffix ] =6261 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];6262 }6263 return expanded;6264 }6265 };6266 if ( !rmargin.test( prefix ) ) {6267 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;6268 }6269});6270var r20 = /%20/g,6271 rbracket = /\[\]$/,6272 rCRLF = /\r?\n/g,6273 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,6274 rsubmittable = /^(?:input|select|textarea|keygen)/i;6275jQuery.fn.extend({6276 serialize: function() {6277 return jQuery.param( this.serializeArray() );6278 },6279 serializeArray: function() {6280 return this.map(function(){6281 // Can add propHook for "elements" to filter or add form elements6282 var elements = jQuery.prop( this, "elements" );6283 return elements ? jQuery.makeArray( elements ) : this;6284 })6285 .filter(function(){6286 var type = this.type;6287 // Use .is(":disabled") so that fieldset[disabled] works6288 return this.name && !jQuery( this ).is( ":disabled" ) &&6289 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&6290 ( this.checked || !manipulation_rcheckableType.test( type ) );6291 })6292 .map(function( i, elem ){6293 var val = jQuery( this ).val();6294 return val == null ?6295 null :6296 jQuery.isArray( val ) ?6297 jQuery.map( val, function( val ){6298 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };6299 }) :6300 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };6301 }).get();6302 }6303});6304//Serialize an array of form elements or a set of6305//key/values into a query string6306jQuery.param = function( a, traditional ) {6307 var prefix,6308 s = [],6309 add = function( key, value ) {6310 // If value is a function, invoke it and return its value6311 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );6312 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );6313 };6314 // Set traditional to true for jQuery <= 1.3.2 behavior.6315 if ( traditional === undefined ) {6316 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;6317 }6318 // If an array was passed in, assume that it is an array of form elements.6319 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {6320 // Serialize the form elements6321 jQuery.each( a, function() {6322 add( this.name, this.value );6323 });6324 } else {6325 // If traditional, encode the "old" way (the way 1.3.2 or older6326 // did it), otherwise encode params recursively.6327 for ( prefix in a ) {6328 buildParams( prefix, a[ prefix ], traditional, add );6329 }6330 }6331 // Return the resulting serialization6332 return s.join( "&" ).replace( r20, "+" );6333};6334function buildParams( prefix, obj, traditional, add ) {6335 var name;6336 if ( jQuery.isArray( obj ) ) {6337 // Serialize array item.6338 jQuery.each( obj, function( i, v ) {6339 if ( traditional || rbracket.test( prefix ) ) {6340 // Treat each array item as a scalar.6341 add( prefix, v );6342 } else {6343 // Item is non-scalar (array or object), encode its numeric index.6344 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );6345 }6346 });6347 } else if ( !traditional && jQuery.type( obj ) === "object" ) {6348 // Serialize object item.6349 for ( name in obj ) {6350 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );6351 }6352 } else {6353 // Serialize scalar item.6354 add( prefix, obj );6355 }6356}6357jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +6358 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +6359 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {6360 // Handle event binding6361 jQuery.fn[ name ] = function( data, fn ) {6362 return arguments.length > 0 ?6363 this.on( name, null, data, fn ) :6364 this.trigger( name );6365 };6366});6367jQuery.fn.extend({6368 hover: function( fnOver, fnOut ) {6369 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );6370 },6371 bind: function( types, data, fn ) {6372 return this.on( types, null, data, fn );6373 },6374 unbind: function( types, fn ) {6375 return this.off( types, null, fn );6376 },6377 delegate: function( selector, types, data, fn ) {6378 return this.on( types, selector, data, fn );6379 },6380 undelegate: function( selector, types, fn ) {6381 // ( namespace ) or ( selector, types [, fn] )6382 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );6383 }6384});6385var6386 // Document location6387 ajaxLocParts,6388 ajaxLocation,6389 ajax_nonce = jQuery.now(),6390 ajax_rquery = /\?/,6391 rhash = /#.*$/,6392 rts = /([?&])_=[^&]*/,6393 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL6394 // #7653, #8125, #8152: local protocol detection6395 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,6396 rnoContent = /^(?:GET|HEAD)$/,6397 rprotocol = /^\/\//,6398 rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,6399 // Keep a copy of the old load method6400 _load = jQuery.fn.load,6401 /* Prefilters6402 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)6403 * 2) These are called:6404 * - BEFORE asking for a transport6405 * - AFTER param serialization (s.data is a string if s.processData is true)6406 * 3) key is the dataType6407 * 4) the catchall symbol "*" can be used6408 * 5) execution will start with transport dataType and THEN continue down to "*" if needed6409 */6410 prefilters = {},6411 /* Transports bindings6412 * 1) key is the dataType6413 * 2) the catchall symbol "*" can be used6414 * 3) selection will start with transport dataType and THEN go to "*" if needed6415 */6416 transports = {},6417 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression6418 allTypes = "*/".concat("*");6419// #8138, IE may throw an exception when accessing6420// a field from window.location if document.domain has been set6421try {6422 ajaxLocation = location.href;6423} catch( e ) {6424 // Use the href attribute of an A element6425 // since IE will modify it given document.location6426 ajaxLocation = document.createElement( "a" );6427 ajaxLocation.href = "";6428 ajaxLocation = ajaxLocation.href;6429}6430// Segment location into parts6431ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];6432// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport6433function addToPrefiltersOrTransports( structure ) {6434 // dataTypeExpression is optional and defaults to "*"6435 return function( dataTypeExpression, func ) {6436 if ( typeof dataTypeExpression !== "string" ) {6437 func = dataTypeExpression;6438 dataTypeExpression = "*";6439 }6440 var dataType,6441 i = 0,6442 dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];6443 if ( jQuery.isFunction( func ) ) {6444 // For each dataType in the dataTypeExpression6445 while ( (dataType = dataTypes[i++]) ) {6446 // Prepend if requested6447 if ( dataType[0] === "+" ) {6448 dataType = dataType.slice( 1 ) || "*";6449 (structure[ dataType ] = structure[ dataType ] || []).unshift( func );6450 // Otherwise append6451 } else {6452 (structure[ dataType ] = structure[ dataType ] || []).push( func );6453 }6454 }6455 }6456 };6457}6458// Base inspection function for prefilters and transports6459function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {6460 var inspected = {},6461 seekingTransport = ( structure === transports );6462 function inspect( dataType ) {6463 var selected;6464 inspected[ dataType ] = true;6465 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {6466 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );6467 if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {6468 options.dataTypes.unshift( dataTypeOrTransport );6469 inspect( dataTypeOrTransport );6470 return false;6471 } else if ( seekingTransport ) {6472 return !( selected = dataTypeOrTransport );6473 }6474 });6475 return selected;6476 }6477 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );6478}6479// A special extend for ajax options6480// that takes "flat" options (not to be deep extended)6481// Fixes #98876482function ajaxExtend( target, src ) {6483 var deep, key,6484 flatOptions = jQuery.ajaxSettings.flatOptions || {};6485 for ( key in src ) {6486 if ( src[ key ] !== undefined ) {6487 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];6488 }6489 }6490 if ( deep ) {6491 jQuery.extend( true, target, deep );6492 }6493 return target;6494}6495jQuery.fn.load = function( url, params, callback ) {6496 if ( typeof url !== "string" && _load ) {6497 return _load.apply( this, arguments );6498 }6499 var selector, response, type,6500 self = this,6501 off = url.indexOf(" ");6502 if ( off >= 0 ) {6503 selector = url.slice( off, url.length );6504 url = url.slice( 0, off );6505 }6506 // If it's a function6507 if ( jQuery.isFunction( params ) ) {6508 // We assume that it's the callback6509 callback = params;6510 params = undefined;6511 // Otherwise, build a param string6512 } else if ( params && typeof params === "object" ) {6513 type = "POST";6514 }6515 // If we have elements to modify, make the request6516 if ( self.length > 0 ) {6517 jQuery.ajax({6518 url: url,6519 // if "type" variable is undefined, then "GET" method will be used6520 type: type,6521 dataType: "html",6522 data: params6523 }).done(function( responseText ) {6524 // Save response for use in complete callback6525 response = arguments;6526 self.html( selector ?6527 // If a selector was specified, locate the right elements in a dummy div6528 // Exclude scripts to avoid IE 'Permission Denied' errors6529 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :6530 // Otherwise use the full result6531 responseText );6532 }).complete( callback && function( jqXHR, status ) {6533 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );6534 });6535 }6536 return this;6537};6538// Attach a bunch of functions for handling common AJAX events6539jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){6540 jQuery.fn[ type ] = function( fn ){6541 return this.on( type, fn );6542 };6543});6544jQuery.extend({6545 // Counter for holding the number of active queries6546 active: 0,6547 // Last-Modified header cache for next request6548 lastModified: {},6549 etag: {},6550 ajaxSettings: {6551 url: ajaxLocation,6552 type: "GET",6553 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),6554 global: true,6555 processData: true,6556 async: true,6557 contentType: "application/x-www-form-urlencoded; charset=UTF-8",6558 /*6559 timeout: 0,6560 data: null,6561 dataType: null,6562 username: null,6563 password: null,6564 cache: null,6565 throws: false,6566 traditional: false,6567 headers: {},6568 */6569 accepts: {6570 "*": allTypes,6571 text: "text/plain",6572 html: "text/html",6573 xml: "application/xml, text/xml",6574 json: "application/json, text/javascript"6575 },6576 contents: {6577 xml: /xml/,6578 html: /html/,6579 json: /json/6580 },6581 responseFields: {6582 xml: "responseXML",6583 text: "responseText",6584 json: "responseJSON"6585 },6586 // Data converters6587 // Keys separate source (or catchall "*") and destination types with a single space6588 converters: {6589 // Convert anything to text6590 "* text": String,6591 // Text to html (true = no transformation)6592 "text html": true,6593 // Evaluate text as a json expression6594 "text json": jQuery.parseJSON,6595 // Parse text as xml6596 "text xml": jQuery.parseXML6597 },6598 // For options that shouldn't be deep extended:6599 // you can add your own custom options here if6600 // and when you create one that shouldn't be6601 // deep extended (see ajaxExtend)6602 flatOptions: {6603 url: true,6604 context: true6605 }6606 },6607 // Creates a full fledged settings object into target6608 // with both ajaxSettings and settings fields.6609 // If target is omitted, writes into ajaxSettings.6610 ajaxSetup: function( target, settings ) {6611 return settings ?6612 // Building a settings object6613 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :6614 // Extending ajaxSettings6615 ajaxExtend( jQuery.ajaxSettings, target );6616 },6617 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),6618 ajaxTransport: addToPrefiltersOrTransports( transports ),6619 // Main method6620 ajax: function( url, options ) {6621 // If url is an object, simulate pre-1.5 signature6622 if ( typeof url === "object" ) {6623 options = url;6624 url = undefined;6625 }6626 // Force options to be an object6627 options = options || {};6628 var // Cross-domain detection vars6629 parts,6630 // Loop variable6631 i,6632 // URL without anti-cache param6633 cacheURL,6634 // Response headers as string6635 responseHeadersString,6636 // timeout handle6637 timeoutTimer,6638 // To know if global events are to be dispatched6639 fireGlobals,6640 transport,6641 // Response headers6642 responseHeaders,6643 // Create the final options object6644 s = jQuery.ajaxSetup( {}, options ),6645 // Callbacks context6646 callbackContext = s.context || s,6647 // Context for global events is callbackContext if it is a DOM node or jQuery collection6648 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?6649 jQuery( callbackContext ) :6650 jQuery.event,6651 // Deferreds6652 deferred = jQuery.Deferred(),6653 completeDeferred = jQuery.Callbacks("once memory"),6654 // Status-dependent callbacks6655 statusCode = s.statusCode || {},6656 // Headers (they are sent all at once)6657 requestHeaders = {},6658 requestHeadersNames = {},6659 // The jqXHR state6660 state = 0,6661 // Default abort message6662 strAbort = "canceled",6663 // Fake xhr6664 jqXHR = {6665 readyState: 0,6666 // Builds headers hashtable if needed6667 getResponseHeader: function( key ) {6668 var match;6669 if ( state === 2 ) {6670 if ( !responseHeaders ) {6671 responseHeaders = {};6672 while ( (match = rheaders.exec( responseHeadersString )) ) {6673 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];6674 }6675 }6676 match = responseHeaders[ key.toLowerCase() ];6677 }6678 return match == null ? null : match;6679 },6680 // Raw string6681 getAllResponseHeaders: function() {6682 return state === 2 ? responseHeadersString : null;6683 },6684 // Caches the header6685 setRequestHeader: function( name, value ) {6686 var lname = name.toLowerCase();6687 if ( !state ) {6688 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;6689 requestHeaders[ name ] = value;6690 }6691 return this;6692 },6693 // Overrides response content-type header6694 overrideMimeType: function( type ) {6695 if ( !state ) {6696 s.mimeType = type;6697 }6698 return this;6699 },6700 // Status-dependent callbacks6701 statusCode: function( map ) {6702 var code;6703 if ( map ) {6704 if ( state < 2 ) {6705 for ( code in map ) {6706 // Lazy-add the new callback in a way that preserves old ones6707 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];6708 }6709 } else {6710 // Execute the appropriate callbacks6711 jqXHR.always( map[ jqXHR.status ] );6712 }6713 }6714 return this;6715 },6716 // Cancel the request6717 abort: function( statusText ) {6718 var finalText = statusText || strAbort;6719 if ( transport ) {6720 transport.abort( finalText );6721 }6722 done( 0, finalText );6723 return this;6724 }6725 };6726 // Attach deferreds6727 deferred.promise( jqXHR ).complete = completeDeferred.add;6728 jqXHR.success = jqXHR.done;6729 jqXHR.error = jqXHR.fail;6730 // Remove hash character (#7531: and string promotion)6731 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)6732 // Handle falsy url in the settings object (#10093: consistency with old signature)6733 // We also use the url parameter if available6734 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );6735 // Alias method option to type as per ticket #120046736 s.type = options.method || options.type || s.method || s.type;6737 // Extract dataTypes list6738 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];6739 // A cross-domain request is in order when we have a protocol:host:port mismatch6740 if ( s.crossDomain == null ) {6741 parts = rurl.exec( s.url.toLowerCase() );6742 s.crossDomain = !!( parts &&6743 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||6744 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==6745 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )6746 );6747 }6748 // Convert data if not already a string6749 if ( s.data && s.processData && typeof s.data !== "string" ) {6750 s.data = jQuery.param( s.data, s.traditional );6751 }6752 // Apply prefilters6753 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );6754 // If request was aborted inside a prefilter, stop there6755 if ( state === 2 ) {6756 return jqXHR;6757 }6758 // We can fire global events as of now if asked to6759 fireGlobals = s.global;6760 // Watch for a new set of requests6761 if ( fireGlobals && jQuery.active++ === 0 ) {6762 jQuery.event.trigger("ajaxStart");6763 }6764 // Uppercase the type6765 s.type = s.type.toUpperCase();6766 // Determine if request has content6767 s.hasContent = !rnoContent.test( s.type );6768 // Save the URL in case we're toying with the If-Modified-Since6769 // and/or If-None-Match header later on6770 cacheURL = s.url;6771 // More options handling for requests with no content6772 if ( !s.hasContent ) {6773 // If data is available, append data to url6774 if ( s.data ) {6775 cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );6776 // #9682: remove data so that it's not used in an eventual retry6777 delete s.data;6778 }6779 // Add anti-cache in url if needed6780 if ( s.cache === false ) {6781 s.url = rts.test( cacheURL ) ?6782 // If there is already a '_' parameter, set its value6783 cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :6784 // Otherwise add one to the end6785 cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;6786 }6787 }6788 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.6789 if ( s.ifModified ) {6790 if ( jQuery.lastModified[ cacheURL ] ) {6791 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );6792 }6793 if ( jQuery.etag[ cacheURL ] ) {6794 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );6795 }6796 }6797 // Set the correct header, if data is being sent6798 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {6799 jqXHR.setRequestHeader( "Content-Type", s.contentType );6800 }6801 // Set the Accepts header for the server, depending on the dataType6802 jqXHR.setRequestHeader(6803 "Accept",6804 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?6805 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :6806 s.accepts[ "*" ]6807 );6808 // Check for headers option6809 for ( i in s.headers ) {6810 jqXHR.setRequestHeader( i, s.headers[ i ] );6811 }6812 // Allow custom headers/mimetypes and early abort6813 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {6814 // Abort if not done already and return6815 return jqXHR.abort();6816 }6817 // aborting is no longer a cancellation6818 strAbort = "abort";6819 // Install callbacks on deferreds6820 for ( i in { success: 1, error: 1, complete: 1 } ) {6821 jqXHR[ i ]( s[ i ] );6822 }6823 // Get transport6824 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );6825 // If no transport, we auto-abort6826 if ( !transport ) {6827 done( -1, "No Transport" );6828 } else {6829 jqXHR.readyState = 1;6830 // Send global event6831 if ( fireGlobals ) {6832 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );6833 }6834 // Timeout6835 if ( s.async && s.timeout > 0 ) {6836 timeoutTimer = setTimeout(function() {6837 jqXHR.abort("timeout");6838 }, s.timeout );6839 }6840 try {6841 state = 1;6842 transport.send( requestHeaders, done );6843 } catch ( e ) {6844 // Propagate exception as error if not done6845 if ( state < 2 ) {6846 done( -1, e );6847 // Simply rethrow otherwise6848 } else {6849 throw e;6850 }6851 }6852 }6853 // Callback for when everything is done6854 function done( status, nativeStatusText, responses, headers ) {6855 var isSuccess, success, error, response, modified,6856 statusText = nativeStatusText;6857 // Called once6858 if ( state === 2 ) {6859 return;6860 }6861 // State is "done" now6862 state = 2;6863 // Clear timeout if it exists6864 if ( timeoutTimer ) {6865 clearTimeout( timeoutTimer );6866 }6867 // Dereference transport for early garbage collection6868 // (no matter how long the jqXHR object will be used)6869 transport = undefined;6870 // Cache response headers6871 responseHeadersString = headers || "";6872 // Set readyState6873 jqXHR.readyState = status > 0 ? 4 : 0;6874 // Determine if successful6875 isSuccess = status >= 200 && status < 300 || status === 304;6876 // Get response data6877 if ( responses ) {6878 response = ajaxHandleResponses( s, jqXHR, responses );6879 }6880 // Convert no matter what (that way responseXXX fields are always set)6881 response = ajaxConvert( s, response, jqXHR, isSuccess );6882 // If successful, handle type chaining6883 if ( isSuccess ) {6884 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.6885 if ( s.ifModified ) {6886 modified = jqXHR.getResponseHeader("Last-Modified");6887 if ( modified ) {6888 jQuery.lastModified[ cacheURL ] = modified;6889 }6890 modified = jqXHR.getResponseHeader("etag");6891 if ( modified ) {6892 jQuery.etag[ cacheURL ] = modified;6893 }6894 }6895 // if no content6896 if ( status === 204 || s.type === "HEAD" ) {6897 statusText = "nocontent";6898 // if not modified6899 } else if ( status === 304 ) {6900 statusText = "notmodified";6901 // If we have data, let's convert it6902 } else {6903 statusText = response.state;6904 success = response.data;6905 error = response.error;6906 isSuccess = !error;6907 }6908 } else {6909 // We extract error from statusText6910 // then normalize statusText and status for non-aborts6911 error = statusText;6912 if ( status || !statusText ) {6913 statusText = "error";6914 if ( status < 0 ) {6915 status = 0;6916 }6917 }6918 }6919 // Set data for the fake xhr object6920 jqXHR.status = status;6921 jqXHR.statusText = ( nativeStatusText || statusText ) + "";6922 // Success/Error6923 if ( isSuccess ) {6924 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );6925 } else {6926 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );6927 }6928 // Status-dependent callbacks6929 jqXHR.statusCode( statusCode );6930 statusCode = undefined;6931 if ( fireGlobals ) {6932 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",6933 [ jqXHR, s, isSuccess ? success : error ] );6934 }6935 // Complete6936 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );6937 if ( fireGlobals ) {6938 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );6939 // Handle the global AJAX counter6940 if ( !( --jQuery.active ) ) {6941 jQuery.event.trigger("ajaxStop");6942 }6943 }6944 }6945 return jqXHR;6946 },6947 getJSON: function( url, data, callback ) {6948 return jQuery.get( url, data, callback, "json" );6949 },6950 getScript: function( url, callback ) {6951 return jQuery.get( url, undefined, callback, "script" );6952 }6953});6954jQuery.each( [ "get", "post" ], function( i, method ) {6955 jQuery[ method ] = function( url, data, callback, type ) {6956 // shift arguments if data argument was omitted6957 if ( jQuery.isFunction( data ) ) {6958 type = type || callback;6959 callback = data;6960 data = undefined;6961 }6962 return jQuery.ajax({6963 url: url,6964 type: method,6965 dataType: type,6966 data: data,6967 success: callback6968 });6969 };6970});6971/* Handles responses to an ajax request:6972 * - finds the right dataType (mediates between content-type and expected dataType)6973 * - returns the corresponding response6974 */6975function ajaxHandleResponses( s, jqXHR, responses ) {6976 var firstDataType, ct, finalDataType, type,6977 contents = s.contents,6978 dataTypes = s.dataTypes;6979 // Remove auto dataType and get content-type in the process6980 while( dataTypes[ 0 ] === "*" ) {6981 dataTypes.shift();6982 if ( ct === undefined ) {6983 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");6984 }6985 }6986 // Check if we're dealing with a known content-type6987 if ( ct ) {6988 for ( type in contents ) {6989 if ( contents[ type ] && contents[ type ].test( ct ) ) {6990 dataTypes.unshift( type );6991 break;6992 }6993 }6994 }6995 // Check to see if we have a response for the expected dataType6996 if ( dataTypes[ 0 ] in responses ) {6997 finalDataType = dataTypes[ 0 ];6998 } else {6999 // Try convertible dataTypes7000 for ( type in responses ) {7001 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {7002 finalDataType = type;7003 break;7004 }7005 if ( !firstDataType ) {7006 firstDataType = type;7007 }7008 }7009 // Or just use first one7010 finalDataType = finalDataType || firstDataType;7011 }7012 // If we found a dataType7013 // We add the dataType to the list if needed7014 // and return the corresponding response7015 if ( finalDataType ) {7016 if ( finalDataType !== dataTypes[ 0 ] ) {7017 dataTypes.unshift( finalDataType );7018 }7019 return responses[ finalDataType ];7020 }7021}7022/* Chain conversions given the request and the original response7023 * Also sets the responseXXX fields on the jqXHR instance7024 */7025function ajaxConvert( s, response, jqXHR, isSuccess ) {7026 var conv2, current, conv, tmp, prev,7027 converters = {},7028 // Work with a copy of dataTypes in case we need to modify it for conversion7029 dataTypes = s.dataTypes.slice();7030 // Create converters map with lowercased keys7031 if ( dataTypes[ 1 ] ) {7032 for ( conv in s.converters ) {7033 converters[ conv.toLowerCase() ] = s.converters[ conv ];7034 }7035 }7036 current = dataTypes.shift();7037 // Convert to each sequential dataType7038 while ( current ) {7039 if ( s.responseFields[ current ] ) {7040 jqXHR[ s.responseFields[ current ] ] = response;7041 }7042 // Apply the dataFilter if provided7043 if ( !prev && isSuccess && s.dataFilter ) {7044 response = s.dataFilter( response, s.dataType );7045 }7046 prev = current;7047 current = dataTypes.shift();7048 if ( current ) {7049 // There's only work to do if current dataType is non-auto7050 if ( current === "*" ) {7051 current = prev;7052 // Convert response if prev dataType is non-auto and differs from current7053 } else if ( prev !== "*" && prev !== current ) {7054 // Seek a direct converter7055 conv = converters[ prev + " " + current ] || converters[ "* " + current ];7056 // If none found, seek a pair7057 if ( !conv ) {7058 for ( conv2 in converters ) {7059 // If conv2 outputs current7060 tmp = conv2.split( " " );7061 if ( tmp[ 1 ] === current ) {7062 // If prev can be converted to accepted input7063 conv = converters[ prev + " " + tmp[ 0 ] ] ||7064 converters[ "* " + tmp[ 0 ] ];7065 if ( conv ) {7066 // Condense equivalence converters7067 if ( conv === true ) {7068 conv = converters[ conv2 ];7069 // Otherwise, insert the intermediate dataType7070 } else if ( converters[ conv2 ] !== true ) {7071 current = tmp[ 0 ];7072 dataTypes.unshift( tmp[ 1 ] );7073 }7074 break;7075 }7076 }7077 }7078 }7079 // Apply converter (if not an equivalence)7080 if ( conv !== true ) {7081 // Unless errors are allowed to bubble, catch and return them7082 if ( conv && s[ "throws" ] ) {7083 response = conv( response );7084 } else {7085 try {7086 response = conv( response );7087 } catch ( e ) {7088 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };7089 }7090 }7091 }7092 }7093 }7094 }7095 return { state: "success", data: response };7096}7097// Install script dataType7098jQuery.ajaxSetup({7099 accepts: {7100 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"...

Full Screen

Full Screen

jquery-ui.custom.min.js

Source:jquery-ui.custom.min.js Github

copy

Full Screen

1/*! jQuery UI - v1.10.3 - 2013-05-032* http://jqueryui.com3* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */4(function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=!1;return t[s]>0?!0:(t[s]=1,a=t[s]>0,t[s]=0,a)}})})(jQuery);5/*! jQuery UI - v1.10.3 - 2013-05-036* http://jqueryui.com7* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */8(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery);9/*! jQuery UI - v1.10.3 - 2013-05-0310* http://jqueryui.com11* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */12(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);13/*! jQuery UI - v1.10.3 - 2013-05-0314* http://jqueryui.com15* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */16(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||e.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(t){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=t.pageX,l=t.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var s=e(this).data("ui-draggable"),n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var s=e(this).data("ui-draggable"),n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i){var s=e(this).data("ui-draggable"),n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-t.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-e(document).scrollTop()<s.scrollSensitivity?n=e(document).scrollTop(e(document).scrollTop()-s.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<s.scrollSensitivity&&(n=e(document).scrollTop(e(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-e(document).scrollLeft()<s.scrollSensitivity?n=e(document).scrollLeft(e(document).scrollLeft()-s.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<s.scrollSensitivity&&(n=e(document).scrollLeft(e(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(i,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),i=t.options;t.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=e(this),s=i.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(t,i){var s,n,a,o,r,h,l,u,c,d,p=e(this).data("ui-draggable"),f=p.options,m=f.snapTolerance,g=i.offset.left,v=g+p.helperProportions.width,b=i.offset.top,y=b+p.helperProportions.height;for(c=p.snapElements.length-1;c>=0;c--)r=p.snapElements[c].left,h=r+p.snapElements[c].width,l=p.snapElements[c].top,u=l+p.snapElements[c].height,r-m>v||g>h+m||l-m>y||b>u+m||!e.contains(p.snapElements[c].item.ownerDocument,p.snapElements[c].item)?(p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(s=m>=Math.abs(l-y),n=m>=Math.abs(u-b),a=m>=Math.abs(r-v),o=m>=Math.abs(h-g),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||a||o,"outer"!==f.snapMode&&(s=m>=Math.abs(l-b),n=m>=Math.abs(u-y),a=m>=Math.abs(r-g),o=m>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=s||n||a||o||d)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,s=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(t=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}})})(jQuery);17/*! jQuery UI - v1.10.3 - 2013-05-0318* http://jqueryui.com19* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */...

Full Screen

Full Screen

shared.ts

Source:shared.ts Github

copy

Full Screen

1import { lighten } from 'polished';2import { css } from '@emotion/react';3import styled from '@emotion/styled';4import { colors } from './colors';5export const outer = css`6 position: relative;7 padding: 0 5vw;8`;9// Centered content container blocks10export const inner = css`11 margin: 0 auto;12 max-width: 1040px;13 width: 100%;14`;15export const SiteNavMain = css`16 position: fixed;17 top: 0;18 right: 0;19 left: 0;20 z-index: 1000;21 /* background: color(var(--darkgrey) l(-5%)); */22 background: ${lighten('-0.05', colors.darkgrey)};23`;24export const SiteMain = css`25 flex-grow: 1;26 @media (prefers-color-scheme: dark) {27 background: ${colors.darkmode};28 }29`;30export const SiteTitle = styled.h1`31 z-index: 10;32 margin: 0 0 0 -2px;33 padding: 0;34 font-size: 5rem;35 line-height: 1em;36 font-weight: 600;37 @media (max-width: 500px) {38 font-size: 4.2rem;39 }40`;41export const SiteDescription = styled.h2`42 z-index: 10;43 margin: 0;44 padding: 5px 0;45 font-size: 2.1rem;46 line-height: 1.4em;47 font-weight: 400;48 opacity: 0.8;49 @media (max-width: 500px) {50 font-size: 1.8rem;51 }52`;53export const Posts = css`54 overflow-x: hidden;55`;56export const PostFeed = css`57 position: relative;58 display: flex;59 flex-wrap: wrap;60 margin: 0 -20px;61 padding: 50px 0 0;62 background: #fff;63 /* Special Template Styles */64 padding: 40px 0 5vw;65 border-top-left-radius: 3px;66 border-top-right-radius: 3px;67 @media (prefers-color-scheme: dark) {68 background: ${colors.darkmode};69 }70`;71export const SocialLink = css`72 display: inline-block;73 margin: 0;74 padding: 10px;75 opacity: 0.8;76 :hover {77 opacity: 1;78 }79 svg {80 height: 1.8rem;81 fill: #fff;82 }83`;84export const SocialLinkFb = css`85 svg {86 height: 1.6rem;87 }88`;89export const SiteHeader = css``;90export const SiteHeaderContent = styled.div`91 z-index: 100;92 display: flex;93 flex-direction: column;94 justify-content: center;95 align-items: center;96 padding: 6vw 3vw;97 min-height: 200px;98 max-height: 340px;99`;100export const SiteHeaderStyles = css`101 position: relative;102 /* margin-top: 64px; */103 padding-bottom: 12px;104 color: #fff;105 /* background: color(var(--darkgrey) l(-5%)) no-repeat center center; */106 background: ${lighten('-0.05', colors.darkgrey)} no-repeat center center;107 background-size: cover;108 :before {109 content: '';110 position: absolute;111 top: 0;112 right: 0;113 bottom: 0;114 left: 0;115 z-index: 10;116 display: block;117 background: rgba(0, 0, 0, 0.18);118 }119 :after {120 content: '';121 position: absolute;122 top: 0;123 right: 0;124 bottom: auto;125 left: 0;126 z-index: 10;127 display: block;128 height: 140px;129 background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0));130 }131 @media (prefers-color-scheme: dark) {132 :before {133 background: rgba(0, 0, 0, 0.6);134 }135 }136`;137export const AuthorProfileImage = css`138 flex: 0 0 60px;139 margin: 0;140 width: 60px;141 height: 60px;142 border: none;143 @media (prefers-color-scheme: dark) {144 box-shadow: 0 0 0 6px hsla(0, 0%, 100%, 0.04);145 background: ${colors.darkmode};146 }147`;148// tag and author post lists149export const SiteArchiveHeader = css`150 .site-header-content {151 position: relative;152 align-items: stretch;153 padding: 12vw 0 20px;154 min-height: 200px;155 max-height: 600px;156 }157`;158export const SiteHeaderBackground = css`159 margin-top: 64px;160`;161export const ResponsiveHeaderBackground = styled.div<{ backgroundImage?: string }>`162 ${p =>163 p.backgroundImage164 && `165 position: relative;166 margin-top: 64px;167 padding-bottom: 12px;168 color: #fff;169 background-size: cover;170 /* background: color(var(--darkgrey) l(-5%)) no-repeat center center; */171 background: #090a0b no-repeat 50%;172 background-image: url(${p.backgroundImage});173 :before {174 content: '';175 position: absolute;176 top: 0;177 right: 0;178 bottom: 0;179 left: 0;180 z-index: 10;181 display: block;182 background: rgba(0, 0, 0, 0.18);183 }184 :after {185 content: '';186 position: absolute;187 top: 0;188 right: 0;189 bottom: auto;190 left: 0;191 z-index: 10;192 display: block;193 height: 140px;194 background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0));195 }196 @media (prefers-color-scheme: dark) {197 &:before {198 background: rgba(0, 0, 0, 0.6);199 }200 }201 `}202 ${p =>203 !p.backgroundImage204 && `205 padding-top: 0;206 padding-bottom: 0;207 /* color: var(--darkgrey); */208 color: ${colors.darkgrey};209 background: #fff;210 opacity: 1;211 .site-description {212 /* color: var(--midgrey); */213 color: ${colors.midgrey};214 opacity: 1;215 }216 .site-header-content {217 padding: 5vw 0 10px;218 /* border-bottom: 1px solid color(var(--lightgrey) l(+12%)); */219 border-bottom: 1px solid ${lighten('0.12', colors.lightgrey)};220 }221 .author-bio {222 /* color: var(--midgrey); */223 color: ${colors.midgrey};224 opacity: 1;225 }226 .author-meta {227 /* color: var(--midgrey); */228 color: ${colors.midgrey};229 opacity: 1;230 }231 .author-social-link a {232 /* color: var(--darkgrey); */233 color: ${colors.darkgrey};234 }235 .author-social-link a:before {236 /* color: var(--midgrey); */237 color: ${colors.midgrey};238 }239 .author-location + .author-stats:before,240 .author-stats + .author-social-link:before,241 .author-social-link + .author-social-link:before {242 /* color: var(--midgrey); */243 color: ${colors.midgrey};244 }245 .author-header {246 padding-bottom: 20px;247 }248 @media (max-width: 500px) {249 .site-header-content {250 flex-direction: column;251 align-items: center;252 min-height: unset;253 }254 .site-title {255 font-size: 4.2rem;256 text-align: center;257 }258 .site-header-content {259 padding: 12vw 0 20px;260 }261 .author-header {262 padding-bottom: 10px;263 }264 }265 @media (prefers-color-scheme: dark) {266 color: rgba(255, 255, 255, 0.9);267 /* background: var(--darkmode); */268 background: ${colors.darkmode};269 .site-header-content {270 /* border-bottom-color: color(var(--darkmode) l(+15%)); */271 /* border-bottom-color: ${lighten('0.15', colors.darkmode)}; */272 border-bottom-color: #272a30;273 }274 .author-social-link a {275 color: rgba(255, 255, 255, 0.75);276 }277 }278 `}279`;280export const NoImage = css`281 .no-image {282 padding-top: 0;283 padding-bottom: 0;284 /* color: var(--darkgrey); */285 color: ${colors.darkgrey};286 background: #fff;287 opacity: 1;288 }289 .no-image .site-description {290 /* color: var(--midgrey); */291 color: ${colors.midgrey};292 opacity: 1;293 }294 .no-image .site-header-content {295 padding: 5vw 0 10px;296 /* border-bottom: 1px solid color(var(--lightgrey) l(+12%)); */297 border-bottom: 1px solid ${lighten('0.12', colors.lightgrey)};298 }299 .no-image .author-bio {300 /* color: var(--midgrey); */301 color: ${colors.midgrey};302 opacity: 1;303 }304 .no-image .author-meta {305 /* color: var(--midgrey); */306 color: ${colors.midgrey};307 opacity: 1;308 }309 .no-image .author-social-link a {310 /* color: var(--darkgrey); */311 color: ${colors.darkgrey};312 }313 .no-image .author-social-link a:before {314 /* color: var(--midgrey); */315 color: ${colors.midgrey};316 }317 .no-image .author-location + .author-stats:before,318 .no-image .author-stats + .author-social-link:before,319 .no-image .author-social-link + .author-social-link:before {320 /* color: var(--midgrey); */321 color: ${colors.midgrey};322 }323 @media (max-width: 500px) {324 .site-header-content {325 flex-direction: column;326 align-items: center;327 min-height: unset;328 }329 .site-title {330 font-size: 4.2rem;331 text-align: center;332 }333 .no-image .site-header-content {334 padding: 12vw 0 20px;335 }336 }337 @media (prefers-color-scheme: dark) {338 .no-image {339 color: rgba(255, 255, 255, 0.9);340 /* background: var(--darkmode); */341 background: ${colors.darkmode};342 }343 .no-image .site-header-content {344 /* border-bottom-color: color(var(--darkmode) l(+15%)); */345 border-bottom-color: ${lighten('0.15', colors.darkmode)};346 }347 .no-image .author-social-link a {348 color: rgba(255, 255, 255, 0.75);349 }350 }...

Full Screen

Full Screen

app.diff.js

Source:app.diff.js Github

copy

Full Screen

1(function app_diff(diff, $) {2// takes an array of strings and returns an object where each string of the array3// is a key of the object and the value is the number of occurences of the string in the array4function array_count(list) {5 var obj = {};6 var list = list.sort();7 for(var i=0; i<list.length; ) {8 for(var j=i+1; j<list.length; j++) {9 if(list[i] !== list[j]) break;10 }11 obj[list[i]] = (j-i);12 i=j;13 }14 return obj;15}16/**17 * contents is an array of content18 * content is a hash of pairs code-qty19 * @memberOf diff20 */21diff.compute_simple = function compute_simple(contents, meta_contents) {22 var customizations = [];23 var ensembles = [];24 for(var decknum=0; decknum<contents.length; decknum++) {25 var choices = {};26 var cards = [];27 $.each(contents[decknum], function (code, qty) {28 for(var copynum=0; copynum<qty; copynum++) {29 cards.push(code);30 }31 });32 Object.keys(meta_contents[decknum] || {}).forEach(function(key) {33 var val = meta_contents[decknum][key];34 if (key.indexOf('cus_') === 0) {35 var entries = val ? val.split(',') : [];36 var r = [];37 for(var i=0; i<entries.length; i++) {38 var entry = entries[i];39 var parts = entry.split('|');40 var index = parseInt(parts[0], 10);41 var xp = parseInt(parts[1], 10);42 var choice = parts.length > 2 ? parts[2] : undefined;43 r.push({44 "index": index,45 "xp": xp,46 "choice": choice,47 "raw": entry,48 });49 }50 if (r.length) {51 choices[key.substring(4)] = r;52 }53 }54 });55 ensembles.push(cards);56 customizations.push(choices);57 }58 var meta_additions={};59 var meta_removals={};60 var new_customizations = {};61 Object.keys(customizations[0]).concat(Object.keys(customizations[1])).forEach(function(code) {62 var choices = customizations[0][code] || [];63 var previous = customizations[1][code] || [];64 var new_choices = [];65 var additions = [];66 var removals = [];67 // Check for additions68 for(var i=0; i<choices.length; i++) {69 var choice = choices[i];70 var found = false;71 var p = null;72 for (var j=0; j<previous.length; j++) {73 if (choice.raw === previous[j].raw) {74 found = true;75 break;76 }77 if (choice.index == previous[j].index) {78 // Found a matching index, so we can't have an exact match.79 p = previous[j];80 break;81 }82 }83 if (!found) {84 // Something changed85 new_choices.push({86 "index": choice.index,87 "xp_delta": choice.xp - ((p && p.xp) || 0)88 });89 additions.push(choice.raw);90 }91 }92 // Check for removals.93 for (var j=0; j<previous.length; j++) {94 var found = false;95 for (var i=0; i<choices.length; i++) {96 if (choices[i].raw === previous[j].raw) {97 found = true;98 break;99 }100 }101 if (!found) {102 removals.push(previous[j].raw);103 }104 }105 if (new_choices.length) {106 new_customizations[code] = new_choices;107 }108 if (additions.length) {109 meta_additions[code] = additions;110 }111 if (removals.length) {112 meta_removals[code] = removals;113 }114 });115 var conjunction = [];116 for(var i=0; i<ensembles[0].length; i++) {117 var code = ensembles[0][i];118 var indexes = [ i ];119 for(var j=1; j<ensembles.length; j++) {120 var index = ensembles[j].indexOf(code);121 if(index > -1) indexes.push(index);122 else break;123 }124 if(indexes.length === ensembles.length) {125 conjunction.push(code);126 for(var j=0; j<indexes.length; j++) {127 ensembles[j].splice(indexes[j], 1);128 }129 i--;130 }131 }132 var listings = [];133 for(var i=0; i<ensembles.length; i++) {134 listings[i] = array_count(ensembles[i]);135 }136 // Add customization changes to the variations.137 listings[2] = meta_additions;138 listings[3] = meta_removals;139 var intersect = array_count(conjunction);140 return [listings, intersect, new_customizations];141};...

Full Screen

Full Screen

.eslintrc.js

Source:.eslintrc.js Github

copy

Full Screen

1module.exports = {2 root: true,3 env: {4 node: true,5 jest: true,6 browser: true,7 },8 extends: ['xo-space', 'xo-react/space', 'xo-typescript'],9 rules: {10 '@typescript-eslint/object-curly-spacing': ['error', 'always'],11 '@typescript-eslint/indent': ['error', 2, { SwitchCase: 1 }],12 '@typescript-eslint/explicit-function-return-type': 'off',13 'capitalized-comments': 'off',14 'comma-dangle': ['error', 'always-multiline'],15 'react/jsx-tag-spacing': 'off',16 'react/prop-types': 'off',17 'react/require-default-props': 'off',18 'no-warning-comments': 'off',19 'complexity': 'off',20 'jsx-quotes': 'off',21 '@typescript-eslint/strict-boolean-expressions': 'off',22 '@typescript-eslint/no-unnecessary-condition': 'off',23 '@typescript-eslint/no-unsafe-call': 'off',24 '@typescript-eslint/no-unsafe-member-access': 'off',25 '@typescript-eslint/restrict-template-expressions': 'off',26 '@typescript-eslint/prefer-readonly-parameter-types': 'off',27 '@typescript-eslint/no-unsafe-return': 'off',28 '@typescript-eslint/comma-dangle': 'off',29 '@typescript-eslint/no-confusing-void-expression': 'off',30 '@typescript-eslint/no-unsafe-assignment': 'off',31 '@typescript-eslint/no-require-imports': 'off',32 '@typescript-eslint/naming-convention': 'off',33 '@typescript-eslint/no-unnecessary-type-arguments': 'off',34 },...

Full Screen

Full Screen

colors.ts

Source:colors.ts Github

copy

Full Screen

1export const colors = {2 blue: '#3eb0ef',3 green: '#a4d037',4 purple: '#ad26b4',5 yellow: '#fecd35',6 red: '#f05230',7 darkgrey: '#15171A',8 midgrey: '#738a94',9 lightgrey: '#c5d2d9',10 whitegrey: '#e5eff5',11 pink: '#fa3a57',12 brown: '#a3821a',13 // darkmode: color(var(--darkgrey) l(+2%)),14 darkmode: '#191b1f',...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { v } from 'ng-mocks';2describe('MyComponent', () => {3 let component: MyComponent;4 let fixture: ComponentFixture<MyComponent>;5 beforeEach(async(() => {6 TestBed.configureTestingModule({7 })8 .compileComponents();9 }));10 beforeEach(() => {11 fixture = TestBed.createComponent(MyComponent);12 component = fixture.componentInstance;13 fixture.detectChanges();14 });15 it('should create', () => {16 expect(component).toBeTruthy();17 });18 it('should have a button', () => {19 const button = v('button');20 expect(button).toBeTruthy();21 });22 it('should have a button with text', () => {23 const button = v('button');24 expect(button.nativeElement.textContent).toBe('click me');25 });26 it('should have a button with text', () => {27 const button = v('button');28 expect(button.nativeElement.textContent).toBe('click me');29 });30 it('should have a button with text', () => {31 const button = v('button');32 expect(button.nativeElement.textContent).toBe('click me');33 });34 it('should have a button with text', () => {35 const button = v('button');36 expect(button.nativeElement.textContent).toBe('click me');37 });38 it('should have a button with text', () => {39 const button = v('button');40 expect(button.nativeElement.textContent).toBe('click me');41 });42 it('should have a button with text', () => {43 const button = v('button');44 expect(button.nativeElement.textContent).toBe('click me');45 });46 it('should have a button with text', () => {47 const button = v('button');48 expect(button.nativeElement.textContent).toBe('click me');49 });50 it('should have a button with text', () => {51 const button = v('button');52 expect(button.nativeElement.textContent).toBe('click me');53 });54 it('should have a button with text', () => {55 const button = v('button');56 expect(button.nativeElement.textContent).toBe('click me');57 });58 it('should have a button with text', () => {59 const button = v('button');60 expect(button.nativeElement.textContent).toBe('click me');61 });62 it('should have a button with text', () => {63 const button = v('button');64 expect(button.nativeElement.textContent).toBe('click me');

Full Screen

Using AI Code Generation

copy

Full Screen

1import { v } from 'ng-mocks';2describe('TestComponent', () => {3 let component: TestComponent;4 let fixture: ComponentFixture<TestComponent>;5 beforeEach(async(() => {6 TestBed.configureTestingModule({7 }).compileComponents();8 }));9 beforeEach(() => {10 fixture = TestBed.createComponent(TestComponent);11 component = fixture.componentInstance;12 fixture.detectChanges();13 });14 it('should create', () => {15 expect(component).toBeTruthy();16 });17 it('should have a div', () => {18 const div = v('div');19 expect(div).toBeTruthy();20 });21});22import { Component, OnInit } from '@angular/core';23@Component({24})25export class TestComponent implements OnInit {26 constructor() {}27 ngOnInit(): void {}28}29div {30 color: blue;31}32import { async, ComponentFixture, TestBed } from '@angular/core/testing';33import { TestComponent } from './test.component';34describe('TestComponent', () => {35 let component: TestComponent;36 let fixture: ComponentFixture<TestComponent>;37 beforeEach(async(() => {38 TestBed.configureTestingModule({39 }).compileComponents();40 }));41 beforeEach(() => {42 fixture = TestBed.createComponent(TestComponent);43 component = fixture.componentInstance;44 fixture.detectChanges();45 });46 it('should create', () => {47 expect(component).toBeTruthy();48 });49});50import { OnInit } from '@angular/core';51export declare class TestComponent implements OnInit {52 constructor();53 ngOnInit(): void;54}55import { Component, OnInit } from '@angular/core';56@Component({57})58export class TestComponent implements OnInit {59 constructor() {}60 ngOnInit(): void {}61}62div {63 color: blue;64}65import { async, ComponentFixture, TestBed } from '@angular/core/testing';66import { TestComponent } from './test.component';67describe('TestComponent', () => {

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('test', function() {2 beforeEach(angular.mock.module('myApp'));3 beforeEach(angular.mock.inject(function($controller, $rootScope) {4 $scope = $rootScope.$new();5 $controller('myController', {6 });7 }));8 it('should have a value', function() {9 expect($scope.myVar).toBe('value');10 });11});12angular.module('myApp', [])13.controller('myController', function($scope) {14 $scope.myVar = 'value';15});

Full Screen

Using AI Code Generation

copy

Full Screen

1var v = ngMocks.v;2var mock = ngMocks.mock;3var fixture = ngMocks.fixture;4var when = ngMocks.when;5var flush = ngMocks.flush;6describe('my test', function() {7 beforeEach(function() {8 ngMocks.autoMock();9 ngMocks.autoSpy();10 });11 it('should test', function() {12 ngMocks.stub(v.router, 'navigate', function() {13 return Promise.resolve(true);14 });15 ngMocks.stub(v.router, 'navigateByUrl', function() {16 return Promise.resolve(true);17 });18 var injector = fixture.debugElement.injector;19 var service = injector.get(MyService);20 });21});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run ng-mocks automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful