-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy patheasyab.min.js
2 lines (2 loc) · 1.56 KB
/
easyab.min.js
1
2
/* easyAB v1.0.2 | (c) 2013 @_srom | srom.github.io/easyAB | MIT @license */
!function($){function t(t){var n;return d?n=999*Math.random():(f||(f=e()),n=f),Math.floor(n%t)}function e(){var t=o(g);return t||(t=999*Math.random(),n(g,t,30)),t}function n(t,e,n){if(n){var o=new Date;o.setTime(o.getTime()+1e3*60*60*24*n);var a="; expires="+o.toGMTString()}else var a="";document.cookie=t+"="+e+a+"; path=/"}function o(t){for(var e=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var a=n[o];" "==a.charAt(0);)a=a.substring(1,a.length);if(0==a.indexOf(e))return a.substring(e.length,a.length)}return null}function a(t){if(s.alternative){var e=s.alternative;"string"==typeof e?t.text(e):"function"==typeof e&&e(t)}}function i(t,e,n,o){var a=o.scope||3;window._gaq.push(["_setCustomVar",t,e,n,a])}function r(t,e,n){var o=n["event-label"]||void 0,a=n["event-value"]||void 0,i=["event-noninteraction"]||!0;window._gaq.push(["_trackEvent",t,e,o,a,i])}function u(t){return"undefined"!=typeof window.console&&"string"==typeof t?window.console.log(t):void 0}function v(t){if("undefined"!=typeof window._gaq){var e="",n=t.slot;e=0!==c?s.value||"alternative"+c:t["default-value"]||"default",d?n?u(l+" : "+e+" (custom var "+n+")"):u(l+" : "+e+" (event)"):n?i(n,l,e,t):r(l,e,t)}}var f,l,s,c,d,w=/#!dev/,g="_easyab_seed";$.fn.easyab=function(e){return e&&"object"==typeof e&&navigator.cookieEnabled?(l=e.name,l&&e.alternatives&&(d=w.test(window.location),c=t(e.alternatives.length+1),0!==c&&(s=e.alternatives[c-1]),v(e)),this.each(function(){var t=$(this);0!==c&&a(t)})):this}}(window.jQuery||window.Zepto);