Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/countvoncount. A Magic: The Gathering JS life counter
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135// Initialize a jQuery objectdefine( [ "../core", "../var/document", "./var/rsingleTag", "../traversing/findFilter"], function( jQuery, document, rsingleTag ) {
// A central reference to the root jQuery(document)var rootjQuery,
// A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
init = jQuery.fn.init = function( selector, context, root ) { var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; }
// Method init() accepts an alternate rootjQuery // so migrate can support jQuery.sub (gh-2101) root = root || rootjQuery;
// Handle HTML strings if ( typeof selector === "string" ) { if ( selector[ 0 ] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ];
} else { match = rquickExpr.exec( selector ); }
// Match html or make sure no context is specified for #id if ( match && ( match[ 1 ] || !context ) ) {
// HANDLE: $(html) -> $(array) if ( match[ 1 ] ) { context = context instanceof jQuery ? context[ 0 ] : context;
// Option to run scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) );
// HANDLE: $(html, props) if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) {
// Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] );
// ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } }
return this;
// HANDLE: $(#id) } else { elem = document.getElementById( match[ 2 ] );
// Support: Blackberry 4.6 // gEBID returns nodes no longer in the document (#6963) if ( elem && elem.parentNode ) {
// Inject the element directly into the jQuery object this.length = 1; this[ 0 ] = elem; }
this.context = document; this.selector = selector; return this; }
// HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || root ).find( selector );
// HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); }
// HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[ 0 ] = selector; this.length = 1; return this;
// HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return root.ready !== undefined ? root.ready( selector ) :
// Execute immediately if ready is not present selector( jQuery ); }
if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; }
return jQuery.makeArray( selector, this ); };
// Give the init function the jQuery prototype for later instantiationinit.prototype = jQuery.fn;
// Initialize central referencerootjQuery = jQuery( document );
return init;
} );