-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathprevel-min.js
1 lines (1 loc) · 16.2 KB
/
prevel-min.js
1
(function(win,doc,proto,ael,ge,cn,nn,u,newRegExp,n,ef,uf){(function(){var types={"function":"fn",object:"obj",number:"int",string:"str","boolean":"bool",regexp:"regexp",date:"date","undefined":u,array:"arr"},op=Object[proto],accessors=!!op.__lookupGetter__&&!!op.__lookupSetter__&&!!op.__defineGetter__,trim=!!"".trim,indexOf=!![].indexOf,toString=op.toString,json=win.JSON&&win.JSON.parse,pl=function(){return function(a,b,c){return pl.fn?new pl.fn.init(a,b,c):uf}}();pl.extend=function(a,b,c){b||(b=a,a=pl);var d=a;if(accessors){var e,f;for(var g in b){e=b.__lookupGetter__(g),f=b.__lookupSetter__(g);if(e||f)e&&a.__defineGetter__(g,e),f&&a.__defineSetter__(g,f);else if(!a[g]||a[g]&&c)a[g]=b[g]}}else for(var g in b)if(!a[g]||a[g]&&c)a[g]=b[g];return d===pl.fn&&pl.implement(pl.fn.init,pl.fn),d=u,a};var ua=win.navigator.userAgent.toLowerCase(),opera=/opera/i.test(ua),chrome=/chrome/i.test(ua),browsers={opera:opera,ie:!opera&&/msie/i.test(ua),ie6:!opera&&/msie 6/i.test(ua),ie7:!opera&&/msie 7/i.test(ua),ie8:!opera&&/msie 8/i.test(ua),firefox:/firefox/i.test(ua),chrome:chrome,safari_khtml:!chrome&&/khtml/i.test(ua),safari:!chrome&&/webkit|safari/i.test(ua)};pl.extend({navigator:[]});for(var key in browsers)browsers[key]&&pl.navigator.push(key);pl.extend({implement:function(a,b,c){return pl.extend(a[proto],b,c)},isArray:Array.isArray||function(a){return pl.type(a,"arr")},type:function(a,b){var c=a===n?nn:a===uf?u:class2type[toString.call(a)]||"obj";return b?b===c:c},empty:function(a){if(pl.type(a,"obj")){for(var b in a)return!1;return!0}return pl.type(a,nn)||pl.type(a,u)||!a.length},trim:function(a){return a=a||"",trim?a.trim():a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},each:function(a,b){var c=-1,d=a.length;while(++c<d)b.call(a[c],c,a[c])},filter:function(a,b){var c=[];return pl.each(a,function(a,d){b(d)&&c.push(d)}),c},inArray:function(a,b,c,d){if(indexOf)return b.indexOf(a,c);for(c=c>0||-1,d=-1;++c<b.length&&!~d;d=b[c]===a?c:d);return d},error:function(a){throw new Error(a)},JSON:function(data){return json?win.JSON.parse(data):!/[^,:{}[]0-9.-+Eaeflnr-u nrt]/.test(data.replace(/"(.|[^"])*"/g,""))&&eval("("+data+")")},browser:function(a){return a?!!~pl.inArray(a,pl.navigator):pl.navigator[0]}});var class2type={};pl.each("Array Boolean Number String Function Date RegExp Object".split(" "),function(a,b){class2type["[object "+b+"]"]=types[b.toLowerCase()]}),win.pl=pl})(),function(){pl.extend({create:function(a,b){var c=doc.createElement(a);for(var d in b)c[pl.fixAttr?pl.fixAttr[d]||d:d]=b[d];return c},parent:function(a,b){return b>0?pl.parent(a.parentNode,--b):a},__self__:uf}),pl.extend({fn:{},find:function(a,b){return doc.querySelectorAll(b?b+" "+a:a)}}),pl.extend(pl.fn,{init:function(){return function(a,b,c){var d;switch(pl.type(a)){case"str":var e=a.match(newRegExp);if(e)d=[pl.create(e[1],b)];else switch(pl.type(b)){case"str":switch(pl.type(c)){case"int":d=[pl.find(a,b)[c]];break;default:case u:d=pl.find(a)}break;case"int":d=[pl.find(a)[b]];break;default:case u:d=pl.find(a)}break;case"fn":pl.events.ready(a);break;case"obj":d=a[b||0]?a:[a]}return this.elements=d,this.selector=arguments,pl.__self__=this,this}}(),len:function(){return this.elements.length},last:function(){var a=this.elements.length;return this.elements=[a&&!pl.type(this.elements[a-1],u)?this.elements[a-1]:n],this},get:function(a){var b=this.elements;return b.length===1?b[0]:pl.type(a,u)?b:b[a]},parent:function(a){return this.elements=[pl.parent(this.elements[0],a||1)],this},remove:function(){return pl.each(this.elements,function(){this.parentNode.removeChild(this)}),this},each:function(a){return pl.each(pl.__self__.elements,function(){a.call(this)}),this}})}(),function(){pl.extend({camelCase:function(a){if(!a.match("-"))return a;var b=a.split("-");return b[0]+b[1].charAt(0).toUpperCase()+b[1].substr(1)},curCSS:{rmvPostFix:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},get:function(a,b){return a.currentStyle?a.currentStyle[b]:win.getComputedStyle(a,n).getPropertyValue(b)}}}),pl.extend(pl.fn,{css:function(a,b){if(!pl.type(b,"undef"))a=pl.camelCase(a),pl.type(b,"int")&&!pl.curCSS.rmvPostFix[a]&&(b+="px"),pl.each(this.elements,function(){this.style[a]=b});else{if(pl.type(a,"str"))return pl.curCSS.get(this.elements[0],a);for(var c in a)pl.fn.css.call(this,c,a[c])}return this}})}(),function(){pl.extend({toParams:function(a){if(pl.type(a,"str"))return a;var b=[];for(var c in a)b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")},ajax:function(a){var b,c=function(){if(win.XMLHttpRequest)b=new XMLHttpRequest,b.overrideMimeType&&b.overrideMimeType("text/html");else if(win.ActiveXObject)try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){}}b||pl.error("Could not create a XMLHttpRequest instance."),b.onreadystatechange=function(c){if(b.readyState===1)(a.load||ef)();else if(b.readyState===4){var d=b.responseText;if(a.dataType==="json")try{d=pl.JSON(d)}catch(c){}b.status>199&&b.status<300||b.status===304?(a.success||ef)(d,b.status):(a.error||ef)(b.status,d)}a.always=a.always||ef;try{a.always(b.readyState,b.status,d)}catch(c){a.always(b.readyState)}}},d=function(c){b.setRequestHeader("X-Requested-With","XMLHttpRequest"),c&&b.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset="+(a.charset||"utf-8"))};a.data=pl.toParams(a.data||{}),a.async=a.async||!0,c(),a.type==="POST"?(b.open("POST",a.url,a.async),d(1),b.send(a.data)):(b.open("GET",a.url+(pl.empty(a.data)?"":(a.url.match(/\?/)?"&":"?")+a.data),a.async),d(),b.send(n))}})}(),function(){pl.extend({fixAttr:{"class":"className","float":"cssFloat","for":"htmlFor"}}),pl.extend(pl.fn,{addClass:function(a){return pl.each(this.elements,function(){if(~pl.inArray(a,this[cn].split(" ")))return;this[cn]+=(this[cn]?" ":"")+a}),this},hasClass:function(a){return this.elements[0]&&this.elements[0][cn]?!!~pl.inArray(a,this.elements[0][cn].split(" ")):!1},removeClass:function(a){return pl.each(this.elements,function(){if(!this[cn])return;var b=this[cn].split(" "),d=pl.inArray(a,b);if(!~d)return;b.splice(d,1),this[cn]=(pl.empty(b)?b.slice(d,1):b).join(" ")}),this},attr:function(a,b){a=pl.fixAttr[a]||a;if(!pl.type(b,"undef"))pl.each(this.elements,function(){this[a]=b});else{if(pl.type(a,"str"))return this.elements[0][a]||this.elements[0].getAttribute(a);for(var c in a)pl.fn.attr.call(this,c,a[c])}return this},removeAttr:function(a){return a=pl.fixAttr[a]||a,pl.each(this.elements,function(){this[a]=n}),this}})}(),function(){pl.extend({events:{ready:function(){this.readyList=[],this.bindReady=function(a){function c(){if(b)return;b=!0,a()}var b=!1;if(doc[ael])pl.events.attaches.bind(doc,"DOMContentLoaded",c);else if(doc.attachEvent){if(doc.documentElement.doScroll&&win===win.top){function d(){if(b)return;if(!doc.body)return;try{doc.documentElement.doScroll("left"),c()}catch(a){setTimeout(d,0)}}d()}pl.events.attaches.bind(doc,"readystatechange",function(){doc.readyState==="complete"&&c()})}pl.events.attaches.bind(win,"load",c)};var a=this;return function(b){a.readyList.length||a.bindReady(function(){pl.each(a.readyList,function(a){this()})}),a.readyList.push(b)}}(),mend:function(a){a=a||win.event;if(a.fixed)return a;a.fixed=!0,a.preventDefault=a.preventDefault||function(){this.returnValue=!1},a.stopPropagation=a.stopPropagation||function(){this.cancelBubble=!0},a.target||(a.target=a.srcElement);if(a.pageX==n&&a.clientX!=n){var b=doc.documentElement,c=doc.body;a.pageX=a.clientX+(b&&b.scrollLeft||c&&c.scrollLeft||0)-(b.clientLeft||0),a.pageY=a.clientY+(b&&b.scrollTop||c&&c.scrollTop||0)-(b.clientTop||0)}return pl.type(a.which,u)&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0),a},attaches:function(){function b(a){a=pl.events.mend(a);var b=this.evt[a.type];for(var c in b){var d=b[c].call(this,a);d===!1&&(a.preventDefault(),a.stopPropagation())}}var a=0;return{bind:function(c,d,e){if(c.setInterval&&!c.frameElement){c!==win&&(c=win);if(~pl.inArray(d,pl.__fwe__))return window.onload=function(){pl(doc.body).bind(d,e)}}e.turnID||(e.turnID=++a),c.evt||(c.evt={},c.handleEvt=function(a){if(!pl.type(pl.events.attaches,u))return b.call(c,a)}),c.evt[d]||(c.evt[d]={},c[ael]?c[ael](d,c.handleEvt,!1):c.attachEvent("on"+d,c.handleEvt)),c.evt[d][e.turnID]=e},unbind:function(a,b,c){var d=a.evt;if(pl.type(c,u)){if(!d)return;for(var e in d)if(pl.type(b,u)||b===e)for(var f in d[e])pl.events.attaches.unbind(a,e,d[e][f]);return}d=d&&d[b];if(!d)return;delete d[c.turnID];for(var f in d)return;a.removeEventListener?a.removeEventListener(b,a.handleEvt,!1):a.detachEvent("on"+b,a.handleEvt),delete a.evt[b];for(var f in a.evt)return;try{delete a.handleEvt,delete a.evt}catch(g){a.removeAttribute("handleEvt"),a.removeAttribute("evt")}}}}(),routeEvent:function(a,b,c){if(pl.type(a,"obj"))for(var d in a)pl.events.routeEvent(d,a[d],c);else if(b&&a||!b&&a||!b&&!a)c?pl.each(pl.__self__.elements,function(){pl.events.attaches.bind(this,a,b)}):pl.each(pl.__self__.elements,function(){pl.events.attaches.unbind(this,a,b)});return pl.__self__}},__fwe__:["click","mouseover","mouseout","keyup","keydown","dblclick","mousedown","mouseup","keypress"]}),pl.extend(pl.fn,{bind:function(a,b){return pl.events.routeEvent(a,b,1)},unbind:function(a,b){return pl.events.routeEvent(a,b,0)}})}(),function(){var a=!!doc[ge+"sByClassName"],b=!!doc.querySelectorAll;pl.find=function(c){return pl.extend(c,{attr:{"":function(a,b){return!!a.getAttribute(b)},"=":function(a,b,c){return(b=a.getAttribute(b))&&b===c},"&=":function(a,b,c){return},"^=":function(a,b,c){return},"$=":function(a,b,c){return},"*=":function(a,b,c){return},"|=":function(a,b,c){return},"!=":function(a,b,c){return}},mods:{"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]!==a},"last-child":function(a){var b=a;while((b=b.nextSibling)&&b.nodeType!=1);return!!b},root:function(a){return a.nodeName.toLowerCase()!=="html"},"nth-child":function(a,b){var c=a.nodeIndex||0,d=b[3]=b[3]?(b[2]==="%"?-1:1)*b[3]:0,e=b[1];if(c)return!((c+d)%e);var f=a.parentNode.firstChild;c++;do if(f.nodeType==1&&(f.nodeIndex=++c)&&a===f&&(c+d)%e)return 0;while(f=f.nextSibling);return 1},"nth-last-child":function(a,b){var c=a.nodeIndexLast||0,d=b[3]?(b[2]==="%"?-1:1)*b[3]:0,e=b[1];if(c)return!((c+d)%e);var f=a.parentNode.lastChild;c++;do if(f.nodeType==1&&(f.nodeLastIndex=c++)&&a===f&&(c+d)%e)return 0;while(f=f.previousSibling);return 1},empty:function(a){return!!a.firstChild},parent:function(a){return!a.firstChild},"only-child":function(a){return a.parentNode[ge+"sByTagName"]("*").length!=1},checked:function(a){return!a.checked},lang:function(a,b){return a.lang!==b&&doc.documentElement.lang!==b},enabled:function(a){return a.disabled||a.type==="hidden"},disabled:function(a){return!a.disabled},selected:function(a){return child.parentNode.selectedIndex,!child.selected}}}),function(d,e){e&&(d=e+" "+d),e=doc;var f=[];if(d==="body *")return doc.body[ge+"sByTagName"]("*");if(/^[\w[:#.][\w\]*^|=!]*$/.test(d)){var g=0;switch(d.charAt(0)){case"#":g=d.slice(1),f=doc[ge+"ById"](g),pl.browser("ie")&&f&&f.id!==g&&(f=doc.all[g]),f=f?[f]:[];break;case".":var h=d.slice(1);if(a)f=(g=(f=e[ge+"sByClassName"](h)).length)?f:[];else{h=" "+h+" ";var i=e[ge+"sByTagName"]("*"),j=0,k;while(k=i[j++])(" "+k[cn]+" ").indexOf(h)!=-1&&(f[g++]=k);f=g?f:[]}break;case":":var k,i=e[ge+"sByTagName"]("*"),j=0,l=d.replace(/[^(]*\(([^)]*)\)/,"$1"),m=d.replace(/\(.*/,"");while(k=i[j++])c.mods[m]&&!c.mods[m](k,l)&&(f[g++]=k);f=g?f:[];break;case"[":var i=e[ge+"sByTagName"]("*"),k,j=0,o=/\[([^!~^*|$ [:=]+)([$^*|]?=)?([^ :\]]+)?\]/.exec(d),p=o[1],q=o[2]||"",r=o[3];while(k=i[j++])console.log("216:",q),c.attr[q]&&(c.attr[q](k,p,r)||p==="class"&&c.attr[q](k,cn,r))&&(f[g++]=k);f=g?f:[];break;default:f=(g=(f=e[ge+"sByTagName"](d)).length)?f:[]}}else if(b&&!~d.indexOf("!="))f=e.querySelectorAll(d.replace(/=([^\]]+)/,'="$1"'));else{var s=d.split(/ *, */),t=s.length-1,u=!!t,v,w,x,y,j,z,i,A,B,h,p,q,m,l,C,g,D,E,F,G,H,I;while(v=s[t--]){x=(w=v.replace(/(\([^)]*)\+/,"$1%").replace(/(\[[^\]]+)~/,"$1&").replace(/(~|>|\+)/," $1 ").split(/ +/)).length,j=0,z=" ",i=[e];while(y=w[j++])if(y!==" "&&y!==">"&&y!=="~"&&y!=="+"&&i){y=y.match(/([^[:.#]+)?(?:#([^[:.#]+))?(?:\.([^[:.]+))?(?:\[([^!&^*|$[:=]+)([!$^*|&]?=)?([^:\]]+)?\])?(?:\:([^(]+)(?:\(([^)]+)\))?)?/),A=y[1]||"*",B=y[2],h=y[3]?" "+y[3]+" ":"",p=y[4],q=y[5]||"",m=y[7],l=m==="nth-child"||m==="nth-last-child"?/(?:(-?\d*)n)?(?:(%|-)(\d*))?/.exec(y[8]==="even"&&"2n"||y[8]==="odd"&&"2n%1"||!/\D/.test(y[8])&&"0n%"+y[8]||y[8]):y[8],C=[],g=D=0,F=j==x;while(E=i[D++])switch(z){case" ":G=E[ge+"sByTagName"](A),I=0,console.log("304: ...");while(H=G[I++])(!B||H.id===B)&&(!h||(" "+H[cn]+" ").indexOf(h)!=-1)&&(!p||c.attr[q]&&(c.attr[q](H,p,y[6])||p==="class"&&c.attr[q](H,cn,y[6])))&&!H.yeasss&&(c.mods[m]?!c.mods[m](H,l):!m)&&(console.log("Passed."),F&&(H.yeasss=1),C[g++]=H);break;case"~":A=A.toLowerCase();while((E=E.nextSibling)&&!E.yeasss)E.nodeType==1&&(A==="*"||E.nodeName.toLowerCase()===A)&&(!B||E.id===B)&&(!h||(" "+E[cn]+" ").indexOf(h)!=-1)&&(!p||c.attr[q]&&(c.attr[q](H,p,y[6])||p==="class"&&c.attr[q](H,cn,y[6])))&&!E.yeasss&&(c.mods[m]?!c.mods[m](E,l):!m)&&(F&&(E.yeasss=1),C[g++]=E);break;case"+":while((E=E.nextSibling)&&E.nodeType!=1);E&&(E.nodeName.toLowerCase()===A.toLowerCase()||A==="*")&&(!B||E.id===B)&&(!h||(" "+H[cn]+" ").indexOf(h)!=-1)&&(!p||c.attr[q]&&(c.attr[q](H,p,y[6])||p==="class"&&c.attr[q](H,cn,y[6])))&&!E.yeasss&&(c.mods[m]?!c.mods[m](E,l):!m)&&(F&&(E.yeasss=1),C[g++]=E);break;case">":G=E[ge+"sByTagName"](A),j=0;while(H=G[j++])H.parentNode===E&&(!B||H.id===B)&&(!h||(" "+H[cn]+" ").indexOf(h)!=-1)&&(!p||c.attr[q]&&(c.attr[q](H,p,y[6])||p==="class"&&c.attr[q](H,cn,y[6])))&&!H.yeasss&&(c.mods[m]?!c.mods[m](H,l):!m)&&(F&&(H.yeasss=1),C[g++]=H)}i=C}else z=y;if(u){if(!i.concat){C=[],I=0;while(H=i[I])C[I++]=H;i=C}f=i.concat(f.length==1?f[0]:f)}else f=i}g=f.length;while(g--)f[g].yeasss=f[g].nodeIndex=f[g].nodeIndexLast=n}return f}}({})}(),function(){pl.extend({innerText:pl.browser("ie")?"innerText":"textContent",innerContent:{midst:function(a,b,c,d){var e=a,a=e.elements[0];if(pl.type(c,u))return a[b];if(pl.type(c,"obj")){var f=doc.createElement("div");f.appendChild(c),c=f.innerHTML}return pl.each(e.elements,function(){d?~d?this[b]+=c:this[b]=c+this[b]:this[b]=c}),e},edge:function(a,b,c,d,e){var f=pl.clean(b);for(var g=d<0?f.length-1:0;g!=(d<0?d:f.length);g+=d)e(a,f[g])}},clean:function(a){var b=[],c=a.length;for(var d=0;d<c;++d)if(pl.type(a[d],"str")){var e="";if(!a[d].indexOf("<thead")||!a[d].indexOf("<tbody"))e="thead",a[d]="<table>"+a[d]+"</table>";else if(!a[d].indexOf("<tr"))e="tr",a[d]="<table>"+a[d]+"</table>";else if(!a[d].indexOf("<td")||!a[d].indexOf("<th"))e="td",a[d]="<table><tbody><tr>"+a[d]+"</tr></tbody></table>";var f=doc.createElement("div");f.innerHTML=a[d],e&&(f=f.firstChild,e!=="thead"&&(f=f.firstChild),e==="td"&&(f=f.firstChild));var g=f.childNodes.length;for(var h=0;h<g;++h)b.push(f.childNodes[h])}else a[d]!==n&&b.push(a[d].nodeType?a[d]:doc.createTextNode(a[d].toString()));return b}}),pl.extend(pl.fn,{html:function(a,b){return pl.innerContent.midst(this,"innerHTML",a,b)},text:function(a,b){return pl.innerContent.midst(this,pl.innerText,a,b)},after:function(){var a=arguments;return pl.each(this.elements,function(){pl.innerContent.edge(this,a,!1,-1,function(a,b){a.parentNode.insertBefore(b,a.nextSibling)})}),this},before:function(){var a=arguments;return pl.each(this.elements,function(){pl.innerContent.edge(this,a,!1,1,function(a,b){a.parentNode.insertBefore(b,a)})}),this},append:function(){var a=arguments;return pl.each(this.elements,function(){pl.innerContent.edge(this,a,!0,1,function(a,b){a.appendChild(b)})}),this},prepend:function(){var a=arguments;return pl.each(this.elements,function(){pl.innerContent.edge(this,a,!0,-1,function(a,b){a.insertBefore(b,a.firstChild)})}),this},appendTo:function(a,b,c){return pl.each(this.elements,function(){pl(a,b,c).append(this)}),this},prependTo:function(a,b,c){return pl.each(this.elements,function(){pl(a,b,c).prepend(this)}),this}})}(),function(){pl.extend(pl.fn,{show:function(){return pl.each(this.elements,function(){this.style.display=this.plrd?this.plrd:"",pl.curCSS.get(this,"display")==="none"&&(this.style.display="block")}),this},hide:function(){return pl.each(this.elements,function(){this.plrd=this.plrd||pl.curCSS.get(this,"display"),this.plrd==="none"&&(this.plrd="block"),this.style.display="none"}),this}})}()})(this,document,"prototype","addEventListener","getElement","className","null","undef","<([A-z]+[1-6]*)>",null,function(){})