Current Path : /var/www/ooareogundevinitiative/wp-content/plugins/popup-maker/assets/js/ |
Current File : /var/www/ooareogundevinitiative/wp-content/plugins/popup-maker/assets/js/admin-bar.min.js |
(function(){var t,u=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};function e(t){null==t&&(t={}),this.options={},this.setOptions(this.default_options),this.setOptions(t)}e.prototype.default_options={selectors:["id","class","tag","nthchild"]},e.prototype.setOptions=function(t){var e,n,r;for(e in null==t&&(t={}),n=[],t)r=t[e],this.default_options.hasOwnProperty(e)?n.push(this.options[e]=r):n.push(void 0);return n},e.prototype.isElement=function(t){return!(1!==(null!=t?t.nodeType:void 0))},e.prototype.getParents=function(t){var e,n=[];if(this.isElement(t))for(e=t;this.isElement(e);)n.push(e),e=e.parentNode;return n},e.prototype.getTagSelector=function(t){return this.sanitizeItem(t.tagName.toLowerCase())},e.prototype.sanitizeItem=function(t){return t.split("").map(function(t){return":"===t?"\\"+":".charCodeAt(0).toString(16).toUpperCase()+" ":/[ !"#$%&'()*+,.\/;<=>?@\[\\\]^`{|}~]/.test(t)?"\\"+t:escape(t).replace(/\%/g,"\\")}).join("")},e.prototype.getIdSelector=function(t){var e,n=t.getAttribute("id");return null==n||""===n||/\s/.exec(n)||/^\d/.exec(n)||(e="#"+this.sanitizeItem(n),1!==t.ownerDocument.querySelectorAll(e).length)?null:e},e.prototype.getClassSelectors=function(t){var o,e=[],i=t.getAttribute("class");return null!=i&&""!==(i=(i=i.replace(/\s+/g," ")).replace(/^\s|\s$/g,""))&&(e=function(){for(var t=i.split(/\s+/),e=[],n=0,r=t.length;n<r;n++)o=t[n],e.push("."+this.sanitizeItem(o));return e}.call(this)),e},e.prototype.getAttributeSelectors=function(t){for(var e,n,r=[],o=["id","class"],i=t.attributes,s=0,l=i.length;s<l;s++)n=(e=i[s]).nodeName,u.call(o,n)<0&&r.push("["+e.nodeName+"="+e.nodeValue+"]");return r},e.prototype.getNthChildSelector=function(t){var e,n,r,o,i,s=t.parentNode;if(null!=s)for(n=e=0,r=(i=s.childNodes).length;n<r;n++)if(o=i[n],this.isElement(o)&&(e++,o===t))return":nth-child("+e+")";return null},e.prototype.testSelector=function(t,e){var n,r=!1;return null!=e&&""!==e&&1===(n=t.ownerDocument.querySelectorAll(e)).length&&n[0]===t&&(r=!0),r},e.prototype.getAllSelectors=function(t){var e={t:null,i:null,c:null,a:null,n:null};return 0<=u.call(this.options.selectors,"tag")&&(e.t=this.getTagSelector(t)),0<=u.call(this.options.selectors,"id")&&(e.i=this.getIdSelector(t)),0<=u.call(this.options.selectors,"class")&&(e.c=this.getClassSelectors(t)),0<=u.call(this.options.selectors,"attribute")&&(e.a=this.getAttributeSelectors(t)),0<=u.call(this.options.selectors,"nthchild")&&(e.n=this.getNthChildSelector(t)),e},e.prototype.testUniqueness=function(t,e){var n=t.parentNode.querySelectorAll(e);return 1===n.length&&n[0]===t},e.prototype.testCombinations=function(t,e,n){for(var r,o,i,s,l=this.getCombinations(e),u=0,c=l.length;u<c;u++)if(r=l[u],this.testUniqueness(t,r))return r;if(null!=n)for(o=0,i=(s=e.map(function(t){return n+t})).length;o<i;o++)if(r=s[o],this.testUniqueness(t,r))return r;return null},e.prototype.getUniqueSelector=function(t){for(var e,n=this.getAllSelectors(t),r=this.options.selectors,o=0,i=r.length;o<i;o++)switch(r[o]){case"id":if(null!=n.i)return n.i;break;case"tag":if(null!=n.t&&this.testUniqueness(t,n.t))return n.t;break;case"class":if(null!=n.c&&0!==n.c.length&&(e=this.testCombinations(t,n.c,n.t)))return e;break;case"attribute":if(null!=n.a&&0!==n.a.length&&(e=this.testCombinations(t,n.a,n.t)))return e;break;case"nthchild":if(null!=n.n)return n.n}return"*"},e.prototype.getSelector=function(t){for(var e,n,r,o,i,s,l=[],u=this.getParents(t),c=0,a=u.length;c<a;c++)e=u[c],null!=(i=this.getUniqueSelector(e))&&l.push(i);for(s=[],n=0,r=l.length;n<r;n++)if(e=l[n],s.unshift(e),o=s.join(" > "),this.testSelector(t,o))return o;return null},e.prototype.getCombinations=function(t){var e,n,r,o,i,s,l;for(null==t&&(t=[]),l=[[]],e=r=0,i=t.length-1;0<=i?r<=i:i<=r;e=0<=i?++r:--r)for(n=o=0,s=l.length-1;0<=s?o<=s:s<=o;n=0<=s?++o:--o)l.push(l[n].concat(t[e]));return l.shift(),l=(l=l.sort(function(t,e){return t.length-e.length})).map(function(t){return t.join("")})},t=e,"undefined"!=typeof define&&null!==define&&define.amd?define([],function(){return t}):("undefined"!=typeof exports&&null!==exports?exports:this).CssSelectorGenerator=t}).call(this),function(e){var r=new CssSelectorGenerator,o=o||{instructions:"After clicking ok, click the element you want a selector for.",results:"Selector"};e(document).on("click","#wp-admin-bar-pum-get-selector",function(t){alert(o.instructions),t.preventDefault(),t.stopPropagation(),e(document).one("click",function(t){var e=t.target,n=r.getSelector(e);alert(o.results+": "+n),t.preventDefault(),t.stopPropagation()})})}(jQuery);