-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmylib-qsa-min.js
1 lines (1 loc) · 1.74 KB
/
mylib-qsa-min.js
1
var global=this;if(this.API&&this.API.getEBCS&&this.API.isHostMethod(this.document,"querySelectorAll")){(function(){var H=global.API,B=H.getEBCS;var F,G,J,E;var D=function(R,O,L){var Q,S=B(R,O);if(S.length==L){var P=global.document,M=H.getBodyElement();var K=H.createElement("div");K.appendChild(P.createTextNode(" "));var N=P.querySelectorAll("div:empty").length;M.appendChild(K);Q=N==P.querySelectorAll("div:empty").length-1;M.removeChild(K)}G=!Q;return S};var C=function(T,P,L){var R,U=B(T,P);if(U.length==L){var Q=global.document,N=H.getBodyElement();var K=H.createElement("option");K=H.setAttribute(K,"selected");var S=Q.createElement("fieldset");var M=Q.createElement("select");M.appendChild(K);S.appendChild(M);var O=Q.querySelectorAll("option[selected]").length;N.appendChild(S);R=O==Q.querySelectorAll("option[selected]").length-1;N.removeChild(S)}J=!R;return U};var A=function(N,P,L){var O=global.document,M=H.createElement("div"),K=H.getBodyElement();M.className="MyLibraryAPITest";K.appendChild(M);E=!!(O.querySelectorAll("div.mylibraryapitest").length);K.removeChild(M)};try{(Array.prototype.slice.call(global.document.querySelectorAll("html"),0));F=function(K){return Array.prototype.slice.call(K,0)}}catch(I){F=H.toArray}global.API.getEBCS=function(M,O){var K,L;if(E||(G&&M.indexOf(":empty")!=-1||(J&&M.indexOf("[selected]")!=-1))||(O&&(typeof O.nodeType!="number"||O.nodeType!=9))){return B(M,O)}try{K=F((O||global.document).querySelectorAll(M));if(H.getBodyElement){if(typeof E=="undefined"){A()}if(typeof G=="undefined"&&M.indexOf(":empty")!=-1){L=D(M,O,K.length);return G?L:K}if(typeof J=="undefined"&&M.indexOf("[selected]")!=-1){L=C(M,O,K.length);return J?L:K}}return E?B(M,O):K}catch(N){return B(M,O)}};if(global["$"]==B){global["$"]=global.API.getEBCS}})()}