diff --git a/dist/eq.min.js b/dist/eq.min.js index 26f3454..1c3892d 100644 --- a/dist/eq.min.js +++ b/dist/eq.min.js @@ -1,3 +1,3 @@ -/*! eq.js v1.7.0 (c) 2013-2015 Sam Richard, MIT license */ -!function(e){"use strict";function t(){this.nodes=[],this.eqsLength=0,this.widths=[],this.points=[],this.callback=void 0}function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,function(){return n.call(e,window.event)})}function o(e){return window.getComputedStyle(e,":before").getPropertyValue("content").slice(1,-1)}var r=function(e,t){return[].slice.call(e).concat([].slice.call(t))};t.prototype.query=function(t,n){var r,i=Object.getPrototypeOf(e);n&&"function"==typeof n&&(i.callback=n),t&&"number"!=typeof t?r=t.length:(t=i.nodes,r=i.nodesLength);var s,u=[],a=[];for(s=0;r>s;s++){u.push(t[s].offsetWidth);try{a.push(i.sortObj(t[s].getAttribute("data-eq-pts")))}catch(d){try{a.push(i.sortObj(o(t[s])))}catch(l){a.push([{key:"",value:0}])}}}i.widths=u,i.points=a,t&&"number"!=typeof t?i.nodeWrites(t,u,a):n&&"function"!=typeof n?i.nodeWrites():window.requestAnimationFrame(i.nodeWrites)},t.prototype.nodeWrites=function(t){var n,o,r,i,s,u,a,d=Object.getPrototypeOf(e),l=d.widths,c=d.points;for(t&&"number"!=typeof t?i=t.length:(t=d.nodes,i=d.nodesLength),n=0;i>n;n++){var f=l[n],p=t[n],h=c[n],v=[],y=h.length;if(f=h[y-1].value){for(r=0;y>r;r++)v.push(h[r].key);a=v.join(" ")}else for(o=0;y>o;o++){var w=h[o],b=h[o+1];if(v.push(w.key),0===o&&f=w.value&&fs;s++){u.push(t[s].offsetWidth);try{a.push(i.sortObj(t[s].getAttribute("data-eq-pts")))}catch(l){try{a.push(i.sortObj(o(t[s])))}catch(d){a.push([{key:"",value:0}])}}}i.widths=u,i.points=a,t&&"number"!=typeof t?i.nodeWrites(t,u,a):n&&"function"!=typeof n?i.nodeWrites():window.requestAnimationFrame(i.nodeWrites)},t.prototype.nodeWrites=function(t){var n,o,r,i,s,u,a,l=Object.getPrototypeOf(e),d=l.widths,c=l.points;for(t&&"number"!=typeof t?i=t.length:(t=l.nodes,i=l.nodesLength),n=0;i>n;n++){var f=d[n],p=t[n],h=c[n],v=[],y=h.length;if(f=h[y-1].value){for(r=0;y>r;r++)v.push(h[r].key);a=v.join(" ")}else for(o=0;y>o;o++){var b=h[o],w=h[o+1];if(v.push(b.key),0===o&&f=b.value&&fo&&(o=0),e=n,setTimeout(function(){e=Date.now(),t(performance.now())},o)},t.cancelAnimationFrame=function(t){clearTimeout(t)}}(this),function(t){if(!("Event"in t))return!1;if("function"==typeof t.Event)return!0;try{return new Event("click"),!0}catch(e){return!1}}(this)||(this.Event=function(t,e){if(!t)throw new Error("Not enough arguments");var n=document.createEvent("Event"),o=e&&void 0!==e.bubbles?e.bubbles:!1,r=e&&void 0!==e.cancelable?e.cancelable:!1;return n.initEvent(t,o,r),n}),!1 in this&&("function"==typeof this.CustomEvent||this.CustomEvent.toString().indexOf("CustomEventConstructor")>-1)&&(this.CustomEvent=function(t,e){if(!t)throw Error('TypeError: Failed to construct "CustomEvent": An event name must be provided.');var n;e=e||{bubbles:!1,cancelable:!1,detail:null};try{n=document.createEvent("CustomEvent"),n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail)}catch(o){n=document.createEvent("Event"),n.initEvent(t,e.bubbles,e.cancelable),n.detail=e.detail}return n},CustomEvent.prototype=Event.prototype),!1 in this&&document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))}),!1 in this&&!function(t){function e(t,n,o){var r,i=t.document&&t.currentStyle[n].match(/([\d\.]+)(%|cm|em|in|mm|pc|pt|)/)||[0,0,""],u=i[1],c=i[2];return o=o?/%|em/.test(c)&&t.parentElement?e(t.parentElement,"fontSize",null):16:o,r="fontSize"==n?o:/width/i.test(n)?t.clientWidth:t.clientHeight,"%"==c?u/100*r:"cm"==c?.3937*u*96:"em"==c?u*o:"in"==c?96*u:"mm"==c?.3937*u*96/10:"pc"==c?12*u*96/72:"pt"==c?96*u/72:u}function n(t,e){var n="border"==e?"Width":"",o=e+"Top"+n,r=e+"Right"+n,i=e+"Bottom"+n,u=e+"Left"+n;t[e]=(t[o]==t[r]&&t[o]==t[i]&&t[o]==t[u]?[t[o]]:t[o]==t[i]&&t[u]==t[r]?[t[o],t[r]]:t[u]==t[r]?[t[o],t[r],t[i]]:[t[o],t[r],t[i],t[u]]).join(" ")}function o(t){var o,r=this,i=t.currentStyle,u=e(t,"fontSize"),c=function(t){return"-"+t.toLowerCase()};for(o in i)if(Array.prototype.push.call(r,"styleFloat"==o?"float":o.replace(/[A-Z]/,c)),"width"==o)r[o]=t.offsetWidth+"px";else if("height"==o)r[o]=t.offsetHeight+"px";else if("styleFloat"==o)r.float=i[o];else if(/margin.|padding.|border.+W/.test(o)&&"auto"!=r[o])r[o]=Math.round(e(t,o,u))+"px";else if(/^outline/.test(o))try{r[o]=i[o]}catch(a){r.outlineColor=i.color,r.outlineStyle=r.outlineStyle||"none",r.outlineWidth=r.outlineWidth||"0px",r.outline=[r.outlineColor,r.outlineWidth,r.outlineStyle].join(" ")}else r[o]=i[o];n(r,"margin"),n(r,"padding"),n(r,"border"),r.fontSize=Math.round(u)+"px"}o.prototype={constructor:o,getPropertyPriority:function(){throw new Error("NotSupportedError: DOM Exception 9")},getPropertyValue:function(t){return this[t.replace(/-\w/g,function(t){return t[1].toUpperCase()})]},item:function(t){return this[t]},removeProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},setProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},getPropertyCSSValue:function(){throw new Error("NotSupportedError: DOM Exception 9")}},t.getComputedStyle=function(t){return new o(t)}}(this),!1 in Array.prototype&&(Array.prototype.forEach=function(t){if(void 0===this||null===this)throw new TypeError(this+"is not an object");if(!(t instanceof Function))throw new TypeError(t+" is not a function");for(var e=Object(this),n=arguments[1],o=e instanceof String?e.split(""):e,r=Math.max(Math.min(o.length,9007199254740991),0)||0,i=-1;++iu;u++){c.push(e[u].offsetWidth);try{a.push(i.sortObj(e[u].getAttribute("data-eq-pts")))}catch(s){try{a.push(i.sortObj(o(e[u])))}catch(l){a.push([{key:"",value:0}])}}}i.widths=c,i.points=a,e&&"number"!=typeof e?i.nodeWrites(e,c,a):n&&"function"!=typeof n?i.nodeWrites():window.requestAnimationFrame(i.nodeWrites)},e.prototype.nodeWrites=function(e){var n,o,r,i,u,c,a,s=Object.getPrototypeOf(t),l=s.widths,f=s.points;for(e&&"number"!=typeof e?i=e.length:(e=s.nodes,i=s.nodesLength),n=0;i>n;n++){var d=l[n],p=e[n],h=f[n],y=[],v=h.length;if(d=h[v-1].value){for(r=0;v>r;r++)y.push(h[r].key);a=y.join(" ")}else for(o=0;v>o;o++){var m=h[o],b=h[o+1];if(y.push(m.key),0===o&&d=m.value&&do&&(o=0),e=n,setTimeout(function(){e=Date.now(),t(performance.now())},o)},t.cancelAnimationFrame=function(t){clearTimeout(t)}}(this),function(t){if(!("Event"in t))return!1;if("function"==typeof t.Event)return!0;try{return new Event("click"),!0}catch(e){return!1}}(this)||(this.Event=function(t,e){if(!t)throw new Error("Not enough arguments");var n=document.createEvent("Event"),o=e&&void 0!==e.bubbles?e.bubbles:!1,r=e&&void 0!==e.cancelable?e.cancelable:!1;return n.initEvent(t,o,r),n}),"CustomEvent"in this&&("function"==typeof this.CustomEvent||this.CustomEvent.toString().indexOf("CustomEventConstructor")>-1)||(this.CustomEvent=function(t,e){if(!t)throw Error('TypeError: Failed to construct "CustomEvent": An event name must be provided.');var n;e=e||{bubbles:!1,cancelable:!1,detail:null};try{n=document.createEvent("CustomEvent"),n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail)}catch(o){n=document.createEvent("Event"),n.initEvent(t,e.bubbles,e.cancelable),n.detail=e.detail}return n},CustomEvent.prototype=Event.prototype),"addEventListener"in this||document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))}),"getComputedStyle"in this||!function(t){function e(t,n,o){var r,i=t.document&&t.currentStyle[n].match(/([\d\.]+)(%|cm|em|in|mm|pc|pt|)/)||[0,0,""],u=i[1],c=i[2];return o=o?/%|em/.test(c)&&t.parentElement?e(t.parentElement,"fontSize",null):16:o,r="fontSize"==n?o:/width/i.test(n)?t.clientWidth:t.clientHeight,"%"==c?u/100*r:"cm"==c?.3937*u*96:"em"==c?u*o:"in"==c?96*u:"mm"==c?.3937*u*96/10:"pc"==c?12*u*96/72:"pt"==c?96*u/72:u}function n(t,e){var n="border"==e?"Width":"",o=e+"Top"+n,r=e+"Right"+n,i=e+"Bottom"+n,u=e+"Left"+n;t[e]=(t[o]==t[r]&&t[o]==t[i]&&t[o]==t[u]?[t[o]]:t[o]==t[i]&&t[u]==t[r]?[t[o],t[r]]:t[u]==t[r]?[t[o],t[r],t[i]]:[t[o],t[r],t[i],t[u]]).join(" ")}function o(t){var o,r=this,i=t.currentStyle,u=e(t,"fontSize"),c=function(t){return"-"+t.toLowerCase()};for(o in i)if(Array.prototype.push.call(r,"styleFloat"==o?"float":o.replace(/[A-Z]/,c)),"width"==o)r[o]=t.offsetWidth+"px";else if("height"==o)r[o]=t.offsetHeight+"px";else if("styleFloat"==o)r.float=i[o];else if(/margin.|padding.|border.+W/.test(o)&&"auto"!=r[o])r[o]=Math.round(e(t,o,u))+"px";else if(/^outline/.test(o))try{r[o]=i[o]}catch(a){r.outlineColor=i.color,r.outlineStyle=r.outlineStyle||"none",r.outlineWidth=r.outlineWidth||"0px",r.outline=[r.outlineColor,r.outlineWidth,r.outlineStyle].join(" ")}else r[o]=i[o];n(r,"margin"),n(r,"padding"),n(r,"border"),r.fontSize=Math.round(u)+"px"}o.prototype={constructor:o,getPropertyPriority:function(){throw new Error("NotSupportedError: DOM Exception 9")},getPropertyValue:function(t){return this[t.replace(/-\w/g,function(t){return t[1].toUpperCase()})]},item:function(t){return this[t]},removeProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},setProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},getPropertyCSSValue:function(){throw new Error("NotSupportedError: DOM Exception 9")}},t.getComputedStyle=function(t){return new o(t)}}(this),"forEach"in Array.prototype||(Array.prototype.forEach=function(t){if(void 0===this||null===this)throw new TypeError(this+"is not an object");if(!(t instanceof Function))throw new TypeError(t+" is not a function");for(var e=Object(this),n=arguments[1],o=e instanceof String?e.split(""):e,r=Math.max(Math.min(o.length,9007199254740991),0)||0,i=-1;++iu;u++){c.push(e[u].offsetWidth);try{a.push(i.sortObj(e[u].getAttribute("data-eq-pts")))}catch(s){try{a.push(i.sortObj(o(e[u])))}catch(l){a.push([{key:"",value:0}])}}}i.widths=c,i.points=a,e&&"number"!=typeof e?i.nodeWrites(e,c,a):n&&"function"!=typeof n?i.nodeWrites():window.requestAnimationFrame(i.nodeWrites)},e.prototype.nodeWrites=function(e){var n,o,r,i,u,c,a,s=Object.getPrototypeOf(t),l=s.widths,f=s.points;for(e&&"number"!=typeof e?i=e.length:(e=s.nodes,i=s.nodesLength),n=0;i>n;n++){var d=l[n],p=e[n],h=f[n],y=[],v=h.length;if(d=h[v-1].value){for(r=0;v>r;r++)y.push(h[r].key);a=y.join(" ")}else for(o=0;v>o;o++){var m=h[o],b=h[o+1];if(y.push(m.key),0===o&&d=m.value&&do&&(o=0),e=n,setTimeout(function(){e=Date.now(),t(performance.now())},o)},t.cancelAnimationFrame=function(t){clearTimeout(t)}}(this),function(t){if(!("Event"in t))return!1;if("function"==typeof t.Event)return!0;try{return new Event("click"),!0}catch(e){return!1}}(this)||(this.Event=function(t,e){if(!t)throw new Error("Not enough arguments");var n=document.createEvent("Event"),o=e&&void 0!==e.bubbles?e.bubbles:!1,r=e&&void 0!==e.cancelable?e.cancelable:!1;return n.initEvent(t,o,r),n}),!1 in this&&("function"==typeof this.CustomEvent||this.CustomEvent.toString().indexOf("CustomEventConstructor")>-1)&&(this.CustomEvent=function(t,e){if(!t)throw Error('TypeError: Failed to construct "CustomEvent": An event name must be provided.');var n;e=e||{bubbles:!1,cancelable:!1,detail:null};try{n=document.createEvent("CustomEvent"),n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail)}catch(o){n=document.createEvent("Event"),n.initEvent(t,e.bubbles,e.cancelable),n.detail=e.detail}return n},CustomEvent.prototype=Event.prototype),!1 in this&&document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))}),!1 in this&&!function(t){function e(t,n,o){var r,i=t.document&&t.currentStyle[n].match(/([\d\.]+)(%|cm|em|in|mm|pc|pt|)/)||[0,0,""],c=i[1],u=i[2];return o=o?/%|em/.test(u)&&t.parentElement?e(t.parentElement,"fontSize",null):16:o,r="fontSize"==n?o:/width/i.test(n)?t.clientWidth:t.clientHeight,"%"==u?c/100*r:"cm"==u?.3937*c*96:"em"==u?c*o:"in"==u?96*c:"mm"==u?.3937*c*96/10:"pc"==u?12*c*96/72:"pt"==u?96*c/72:c}function n(t,e){var n="border"==e?"Width":"",o=e+"Top"+n,r=e+"Right"+n,i=e+"Bottom"+n,c=e+"Left"+n;t[e]=(t[o]==t[r]&&t[o]==t[i]&&t[o]==t[c]?[t[o]]:t[o]==t[i]&&t[c]==t[r]?[t[o],t[r]]:t[c]==t[r]?[t[o],t[r],t[i]]:[t[o],t[r],t[i],t[c]]).join(" ")}function o(t){var o,r=this,i=t.currentStyle,c=e(t,"fontSize"),u=function(t){return"-"+t.toLowerCase()};for(o in i)if(Array.prototype.push.call(r,"styleFloat"==o?"float":o.replace(/[A-Z]/,u)),"width"==o)r[o]=t.offsetWidth+"px";else if("height"==o)r[o]=t.offsetHeight+"px";else if("styleFloat"==o)r.float=i[o];else if(/margin.|padding.|border.+W/.test(o)&&"auto"!=r[o])r[o]=Math.round(e(t,o,c))+"px";else if(/^outline/.test(o))try{r[o]=i[o]}catch(a){r.outlineColor=i.color,r.outlineStyle=r.outlineStyle||"none",r.outlineWidth=r.outlineWidth||"0px",r.outline=[r.outlineColor,r.outlineWidth,r.outlineStyle].join(" ")}else r[o]=i[o];n(r,"margin"),n(r,"padding"),n(r,"border"),r.fontSize=Math.round(c)+"px"}o.prototype={constructor:o,getPropertyPriority:function(){throw new Error("NotSupportedError: DOM Exception 9")},getPropertyValue:function(t){return this[t.replace(/-\w/g,function(t){return t[1].toUpperCase()})]},item:function(t){return this[t]},removeProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},setProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},getPropertyCSSValue:function(){throw new Error("NotSupportedError: DOM Exception 9")}},t.getComputedStyle=function(t){return new o(t)}}(this),!1 in Array.prototype&&(Array.prototype.forEach=function(t){if(void 0===this||null===this)throw new TypeError(this+"is not an object");if(!(t instanceof Function))throw new TypeError(t+" is not a function");for(var e=Object(this),n=arguments[1],o=e instanceof String?e.split(""):e,r=Math.max(Math.min(o.length,9007199254740991),0)||0,i=-1;++io&&(o=0),e=n,setTimeout(function(){e=Date.now(),t(performance.now())},o)},t.cancelAnimationFrame=function(t){clearTimeout(t)}}(this),function(t){if(!("Event"in t))return!1;if("function"==typeof t.Event)return!0;try{return new Event("click"),!0}catch(e){return!1}}(this)||(this.Event=function(t,e){if(!t)throw new Error("Not enough arguments");var n=document.createEvent("Event"),o=e&&void 0!==e.bubbles?e.bubbles:!1,r=e&&void 0!==e.cancelable?e.cancelable:!1;return n.initEvent(t,o,r),n}),"CustomEvent"in this&&("function"==typeof this.CustomEvent||this.CustomEvent.toString().indexOf("CustomEventConstructor")>-1)||(this.CustomEvent=function(t,e){if(!t)throw Error('TypeError: Failed to construct "CustomEvent": An event name must be provided.');var n;e=e||{bubbles:!1,cancelable:!1,detail:null};try{n=document.createEvent("CustomEvent"),n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail)}catch(o){n=document.createEvent("Event"),n.initEvent(t,e.bubbles,e.cancelable),n.detail=e.detail}return n},CustomEvent.prototype=Event.prototype),"addEventListener"in this||document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))}),"getComputedStyle"in this||!function(t){function e(t,n,o){var r,i=t.document&&t.currentStyle[n].match(/([\d\.]+)(%|cm|em|in|mm|pc|pt|)/)||[0,0,""],c=i[1],u=i[2];return o=o?/%|em/.test(u)&&t.parentElement?e(t.parentElement,"fontSize",null):16:o,r="fontSize"==n?o:/width/i.test(n)?t.clientWidth:t.clientHeight,"%"==u?c/100*r:"cm"==u?.3937*c*96:"em"==u?c*o:"in"==u?96*c:"mm"==u?.3937*c*96/10:"pc"==u?12*c*96/72:"pt"==u?96*c/72:c}function n(t,e){var n="border"==e?"Width":"",o=e+"Top"+n,r=e+"Right"+n,i=e+"Bottom"+n,c=e+"Left"+n;t[e]=(t[o]==t[r]&&t[o]==t[i]&&t[o]==t[c]?[t[o]]:t[o]==t[i]&&t[c]==t[r]?[t[o],t[r]]:t[c]==t[r]?[t[o],t[r],t[i]]:[t[o],t[r],t[i],t[c]]).join(" ")}function o(t){var o,r=this,i=t.currentStyle,c=e(t,"fontSize"),u=function(t){return"-"+t.toLowerCase()};for(o in i)if(Array.prototype.push.call(r,"styleFloat"==o?"float":o.replace(/[A-Z]/,u)),"width"==o)r[o]=t.offsetWidth+"px";else if("height"==o)r[o]=t.offsetHeight+"px";else if("styleFloat"==o)r.float=i[o];else if(/margin.|padding.|border.+W/.test(o)&&"auto"!=r[o])r[o]=Math.round(e(t,o,c))+"px";else if(/^outline/.test(o))try{r[o]=i[o]}catch(a){r.outlineColor=i.color,r.outlineStyle=r.outlineStyle||"none",r.outlineWidth=r.outlineWidth||"0px",r.outline=[r.outlineColor,r.outlineWidth,r.outlineStyle].join(" ")}else r[o]=i[o];n(r,"margin"),n(r,"padding"),n(r,"border"),r.fontSize=Math.round(c)+"px"}o.prototype={constructor:o,getPropertyPriority:function(){throw new Error("NotSupportedError: DOM Exception 9")},getPropertyValue:function(t){return this[t.replace(/-\w/g,function(t){return t[1].toUpperCase()})]},item:function(t){return this[t]},removeProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},setProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},getPropertyCSSValue:function(){throw new Error("NotSupportedError: DOM Exception 9")}},t.getComputedStyle=function(t){return new o(t)}}(this),"forEach"in Array.prototype||(Array.prototype.forEach=function(t){if(void 0===this||null===this)throw new TypeError(this+"is not an object");if(!(t instanceof Function))throw new TypeError(t+" is not a function");for(var e=Object(this),n=arguments[1],o=e instanceof String?e.split(""):e,r=Math.max(Math.min(o.length,9007199254740991),0)||0,i=-1;++i