JAVASCRIPT 7
Find.js Guest on 27th July 2020 12:15:02 AM
  1. /*
  2.  * Sizzle CSS Selector Engine - v1.0
  3.  *  Copyright 2009, The Dojo Foundation
  4.  *  Released under the MIT, BSD, and GPL Licenses.
  5.  *  More information: http://sizzlejs.com/
  6.  *
  7.  * Modified for inclusion in Shadowbox.js
  8.  */
  9. S.find=(function(){var m=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,n=0,p=Object.prototype.toString,h=false,g=true;[0,0].sort(function(){g=false;return 0});var c=function(x,e,A,B){A=A||[];var D=e=e||document;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!x||typeof x!=="string"){return A}var y=[],u,F,I,t,w=true,v=d(e),C=x;while((m.exec(""),u=m.exec(C))!==null){C=u[3];y.push(u[1]);if(u[2]){t=u[3];break}}if(y.length>1&&i.exec(x)){if(y.length===2&&j.relative[y[0]]){F=q(y[0]+y[1],e)}else{F=j.relative[y[0]]?[e]:c(y.shift(),e);while(y.length){x=y.shift();if(j.relative[x]){x+=y.shift()}F=q(x,F)}}}else{if(!B&&y.length>1&&e.nodeType===9&&!v&&j.match.ID.test(y[0])&&!j.match.ID.test(y[y.length-1])){var E=c.find(y.shift(),e,v);e=E.expr?c.filter(E.expr,E.set)[0]:E.set[0]}if(e){var E=B?{expr:y.pop(),set:l(B)}:c.find(y.pop(),y.length===1&&(y[0]==="~"||y[0]==="+")&&e.parentNode?e.parentNode:e,v);F=E.expr?c.filter(E.expr,E.set):E.set;if(y.length>0){I=l(F)}else{w=false}while(y.length){var H=y.pop(),G=H;if(!j.relative[H]){H=""}else{G=y.pop()}if(G==null){G=e}j.relative[H](I,G,v)}}else{I=y=[]}}if(!I){I=F}if(!I){throw"Syntax error, unrecognized expression: "+(H||x)}if(p.call(I)==="[object Array]"){if(!w){A.push.apply(A,I)}else{if(e&&e.nodeType===1){for(var z=0;I[z]!=null;z++){if(I[z]&&(I[z]===true||I[z].nodeType===1&&k(e,I[z]))){A.push(F[z])}}}else{for(var z=0;I[z]!=null;z++){if(I[z]&&I[z].nodeType===1){A.push(F[z])}}}}}else{l(I,A)}if(t){c(t,D,A,B);c.uniqueSort(A)}return A};c.uniqueSort=function(t){if(o){h=g;t.sort(o);if(h){for(var e=1;e<t.length;e++){if(t[e]===t[e-1]){t.splice(e--,1)}}}}return t};c.matches=function(e,t){return c(e,null,null,t)};c.find=function(z,e,A){var y,w;if(!z){return[]}for(var v=0,u=j.order.length;v<u;v++){var x=j.order[v],w;if((w=j.leftMatch[x].exec(z))){var t=w[1];w.splice(1,1);if(t.substr(t.length-1)!=="\\"){w[1]=(w[1]||"").replace(/\\/g,"");y=j.find[x](w,e,A);if(y!=null){z=z.replace(j.match[x],"");break}}}}if(!y){y=e.getElementsByTagName("*")}return{set:y,expr:z}};c.filter=function(C,B,F,v){var u=C,H=[],z=B,x,e,y=B&&B[0]&&d(B[0]);while(C&&B.length){for(var A in j.filter){if((x=j.match[A].exec(C))!=null){var t=j.filter[A],G,E;e=false;if(z===H){H=[]}if(j.preFilter[A]){x=j.preFilter[A](x,z,F,H,v,y);if(!x){e=G=true}else{if(x===true){continue}}}if(x){for(var w=0;(E=z[w])!=null;w++){if(E){G=t(E,x,w,z);var D=v^!!G;if(F&&G!=null){if(D){e=true}else{z[w]=false}}else{if(D){H.push(E);e=true}}}}}if(G!==undefined){if(!F){z=H}C=C.replace(j.match[A],"");if(!e){return[]}break}}}if(C===u){if(e==null){throw"Syntax error, unrecognized expression: "+C}else{break}}u=C}return z};var j=c.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(y,t){var v=typeof t==="string",x=v&&!/\W/.test(t),z=v&&!x;if(x){t=t.toLowerCase()}for(var u=0,e=y.length,w;u<e;u++){if((w=y[u])){while((w=w.previousSibling)&&w.nodeType!==1){}y[u]=z||w&&w.nodeName.toLowerCase()===t?w||false:w===t}}if(z){c.filter(t,y,true)}},">":function(y,t){var w=typeof t==="string";if(w&&!/\W/.test(t)){t=t.toLowerCase();for(var u=0,e=y.length;u<e;u++){var x=y[u];if(x){var v=x.parentNode;y[u]=v.nodeName.toLowerCase()===t?v:false}}}else{for(var u=0,e=y.length;u<e;u++){var x=y[u];if(x){y[u]=w?x.parentNode:x.parentNode===t}}if(w){c.filter(t,y,true)}}},"":function(v,t,x){var u=n++,e=r;if(typeof t==="string"&&!/\W/.test(t)){var w=t=t.toLowerCase();e=a}e("parentNode",t,u,v,w,x)},"~":function(v,t,x){var u=n++,e=r;if(typeof t==="string"&&!/\W/.test(t)){var w=t=t.toLowerCase();e=a}e("previousSibling",t,u,v,w,x)}},find:{ID:function(t,u,v){if(typeof u.getElementById!=="undefined"&&!v){var e=u.getElementById(t[1]);return e?[e]:[]}},NAME:function(u,x){if(typeof x.getElementsByName!=="undefined"){var t=[],w=x.getElementsByName(u[1]);for(var v=0,e=w.length;v<e;v++){if(w[v].getAttribute("name")===u[1]){t.push(w[v])}}return t.length===0?null:t}},TAG:function(e,t){return t.getElementsByTagName(e[1])}},preFilter:{CLASS:function(v,t,u,e,y,z){v=" "+v[1].replace(/\\/g,"")+" ";if(z){return v}for(var w=0,x;(x=t[w])!=null;w++){if(x){if(y^(x.className&&(" "+x.className+" ").replace(/[\t\n]/g," ").indexOf(v)>=0)){if(!u){e.push(x)}}else{if(u){t[w]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(t,e){return t[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var t=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(t[1]+(t[2]||1))-0;e[3]=t[3]-0}e[0]=n++;return e},ATTR:function(w,t,u,e,x,y){var v=w[1].replace(/\\/g,"");if(!y&&j.attrMap[v]){w[1]=j.attrMap[v]}if(w[2]==="~="){w[4]=" "+w[4]+" "}return w},PSEUDO:function(w,t,u,e,x){if(w[1]==="not"){if((m.exec(w[3])||"").length>1||/^\w/.test(w[3])){w[3]=c(w[3],null,null,t)}else{var v=c.filter(w[3],t,u,true^x);if(!u){e.push.apply(e,v)}return false}}else{if(j.match.POS.test(w[0])||j.match.CHILD.test(w[0])){return true}}return w},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(u,t,e){return !!c(e[3],u).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(t,e){return e===0},last:function(u,t,e,v){return t===v.length-1},even:function(t,e){return e%2===0},odd:function(t,e){return e%2===1},lt:function(u,t,e){return t<e[3]-0},gt:function(u,t,e){return t>e[3]-0},nth:function(u,t,e){return e[3]-0===t},eq:function(u,t,e){return e[3]-0===t}},filter:{PSEUDO:function(y,u,v,z){var t=u[1],w=j.filters[t];if(w){return w(y,v,u,z)}else{if(t==="contains"){return(y.textContent||y.innerText||b([y])||"").indexOf(u[3])>=0}else{if(t==="not"){var x=u[3];for(var v=0,e=x.length;v<e;v++){if(x[v]===y){return false}}return true}else{throw"Syntax error, unrecognized expression: "+t}}}},CHILD:function(e,v){var y=v[1],t=e;switch(y){case"only":case"first":while((t=t.previousSibling)){if(t.nodeType===1){return false}}if(y==="first"){return true}t=e;case"last":while((t=t.nextSibling)){if(t.nodeType===1){return false}}return true;case"nth":var u=v[2],B=v[3];if(u===1&&B===0){return true}var x=v[0],A=e.parentNode;if(A&&(A.sizcache!==x||!e.nodeIndex)){var w=0;for(t=A.firstChild;t;t=t.nextSibling){if(t.nodeType===1){t.nodeIndex=++w}}A.sizcache=x}var z=e.nodeIndex-B;if(u===0){return z===0}else{return(z%u===0&&z/u>=0)}}},ID:function(t,e){return t.nodeType===1&&t.getAttribute("id")===e},TAG:function(t,e){return(e==="*"&&t.nodeType===1)||t.nodeName.toLowerCase()===e},CLASS:function(t,e){return(" "+(t.className||t.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(x,v){var u=v[1],e=j.attrHandle[u]?j.attrHandle[u](x):x[u]!=null?x[u]:x.getAttribute(u),y=e+"",w=v[2],t=v[4];return e==null?w==="!=":w==="="?y===t:w==="*="?y.indexOf(t)>=0:w==="~="?(" "+y+" ").indexOf(t)>=0:!t?y&&e!==false:w==="!="?y!==t:w==="^="?y.indexOf(t)===0:w==="$="?y.substr(y.length-t.length)===t:w==="|="?y===t||y.substr(0,t.length+1)===t+"-":false},POS:function(w,t,u,x){var e=t[2],v=j.setFilters[e];if(v){return v(w,u,t,x)}}}};var i=j.match.POS;for(var f in j.match){j.match[f]=new RegExp(j.match[f].source+/(?![^\[]*\])(?![^\(]*\))/.source);j.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+j.match[f].source)}var l=function(t,e){t=Array.prototype.slice.call(t,0);if(e){e.push.apply(e,t);return e}return t};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(s){l=function(w,v){var t=v||[];if(p.call(w)==="[object Array]"){Array.prototype.push.apply(t,w)}else{if(typeof w.length==="number"){for(var u=0,e=w.length;u<e;u++){t.push(w[u])}}else{for(var u=0;w[u];u++){t.push(w[u])}}}return t}}var o;if(document.documentElement.compareDocumentPosition){o=function(t,e){if(!t.compareDocumentPosition||!e.compareDocumentPosition){if(t==e){h=true}return t.compareDocumentPosition?-1:1}var u=t.compareDocumentPosition(e)&4?-1:t===e?0:1;if(u===0){h=true}return u}}else{if("sourceIndex" in document.documentElement){o=function(t,e){if(!t.sourceIndex||!e.sourceIndex){if(t==e){h=true}return t.sourceIndex?-1:1}var u=t.sourceIndex-e.sourceIndex;if(u===0){h=true}return u}}else{if(document.createRange){o=function(v,t){if(!v.ownerDocument||!t.ownerDocument){if(v==t){h=true}return v.ownerDocument?-1:1}var u=v.ownerDocument.createRange(),e=t.ownerDocument.createRange();u.setStart(v,0);u.setEnd(v,0);e.setStart(t,0);e.setEnd(t,0);var w=u.compareBoundaryPoints(Range.START_TO_END,e);if(w===0){h=true}return w}}}}function b(e){var t="",v;for(var u=0;e[u];u++){v=e[u];if(v.nodeType===3||v.nodeType===4){t+=v.nodeValue}else{if(v.nodeType!==8){t+=b(v.childNodes)}}}return t}(function(){var t=document.createElement("div"),u="script"+(new Date).getTime();t.innerHTML="<a name='"+u+"'/>";var e=document.documentElement;e.insertBefore(t,e.firstChild);if(document.getElementById(u)){j.find.ID=function(w,x,y){if(typeof x.getElementById!=="undefined"&&!y){var v=x.getElementById(w[1]);return v?v.id===w[1]||typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id").nodeValue===w[1]?[v]:undefined:[]}};j.filter.ID=function(x,v){var w=typeof x.getAttributeNode!=="undefined"&&x.getAttributeNode("id");return x.nodeType===1&&w&&w.nodeValue===v}}e.removeChild(t);e=t=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){j.find.TAG=function(t,x){var w=x.getElementsByTagName(t[1]);if(t[1]==="*"){var v=[];for(var u=0;w[u];u++){if(w[u].nodeType===1){v.push(w[u])}}w=v}return w}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){j.attrHandle.href=function(t){return t.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=c,u=document.createElement("div");u.innerHTML="<p class='TEST'></p>";if(u.querySelectorAll&&u.querySelectorAll(".TEST").length===0){return}c=function(y,x,v,w){x=x||document;if(!w&&x.nodeType===9&&!d(x)){try{return l(x.querySelectorAll(y),v)}catch(z){}}return e(y,x,v,w)};for(var t in e){c[t]=e[t]}u=null})()}(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}j.order.splice(1,0,"CLASS");j.find.CLASS=function(t,u,v){if(typeof u.getElementsByClassName!=="undefined"&&!v){return u.getElementsByClassName(t[1])}};e=null})();function a(t,y,x,B,z,A){for(var v=0,u=B.length;v<u;v++){var e=B[v];if(e){e=e[t];var w=false;while(e){if(e.sizcache===x){w=B[e.sizset];break}if(e.nodeType===1&&!A){e.sizcache=x;e.sizset=v}if(e.nodeName.toLowerCase()===y){w=e;break}e=e[t]}B[v]=w}}}function r(t,y,x,B,z,A){for(var v=0,u=B.length;v<u;v++){var e=B[v];if(e){e=e[t];var w=false;while(e){if(e.sizcache===x){w=B[e.sizset];break}if(e.nodeType===1){if(!A){e.sizcache=x;e.sizset=v}if(typeof y!=="string"){if(e===y){w=true;break}}else{if(c.filter(y,[e]).length>0){w=e;break}}}e=e[t]}B[v]=w}}}var k=document.compareDocumentPosition?function(t,e){return t.compareDocumentPosition(e)&16}:function(t,e){return t!==e&&(t.contains?t.contains(e):true)};var d=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return t?t.nodeName!=="HTML":false};var q=function(e,z){var v=[],w="",x,u=z.nodeType?[z]:z;while((x=j.match.PSEUDO.exec(e))){w+=x[0];e=e.replace(j.match.PSEUDO,"")}e=j.relative[e]?e+"*":e;for(var y=0,t=u.length;y<t;y++){c(e,u[y],v)}return c.filter(w,v)};return c})();

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.