diff --git a/README.md b/README.md index 508e6ca..f0ad224 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # AB Tester +An AB testing library that supports weights, callbacks, CSS based tests, persistence, and an interface. + ## Developing ```bash npm install # Install dependencies diff --git a/bookmarklet/index.html b/bookmarklet/index.html new file mode 100644 index 0000000..3a5ac01 --- /dev/null +++ b/bookmarklet/index.html @@ -0,0 +1,12 @@ + + + + + + AB Tester Bookmarklet + + +

Drag the link below to your bookmarks bar

+ AB Tests + + diff --git a/build/bookmarklet.html b/build/bookmarklet.html new file mode 100644 index 0000000..6e3451f --- /dev/null +++ b/build/bookmarklet.html @@ -0,0 +1,12 @@ + + + + + + AB Tester Bookmarklet + + +

Drag the link below to your bookmarks bar

+ AB Tests + + diff --git a/build/test-interface.min.js b/build/test-interface.min.js index 3abb3ec..5422ef0 100644 --- a/build/test-interface.min.js +++ b/build/test-interface.min.js @@ -1,3 +1,3 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.TestInterface=e()}}(function(){var e;return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s\n [data-ab-tester] {\n background: #111 url(http://i.imgur.com/lnDx7VT.jpg) center center repeat;\n border: 1px solid rgba(0, 0, 0, 0.5);\n border-radius: 5px;\n color: #fff;\n padding: 10px;\n position: fixed;\n font-family: sans-serif;\n right: 10px;\n text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);\n top: 10px;\n width: 200px;\n z-index: 9;\n -webkit-font-smoothing: antialiased;\n }\n [data-ab-tester] ul {\n list-style-type: none;\n margin: 0;\n padding: 0;\n }\n [data-ab-tester] ul li:not(:last-child) {\n margin-bottom: 15px;\n }\n [data-ab-tester] label {\n margin-bottom: 5px;\n font-weight: bold;\n display: block;\n }\n [data-ab-tester] select {\n display: block;\n width: 100%;\n }\n ')}},{key:"template",value:function(){var e=a["default"]("
"),t=a["default"](""),n=this.tests,r=Object.keys(n);return 0===r.length?(e.html("No Tests"),e):(r.sort().forEach(function(e){var r=n[e].bucket,i=n[e].buckets.map(function(e){return""+e+""});t.append("
  • \n \n \n
  • ")}),t.appendTo(e),e)}},{key:"listen",value:function(e){var t=this,n=this.tests;this.$template.find("select").on("change",function(r){var i=a["default"](r.target),o=i.data("test"),s=i.val();n[o].bucket=s,e.call(t)})}},{key:"update",value:function(){l["default"].local.setItem(this.key,JSON.stringify(this.tests))}}]),e}();n["default"]=p},{"../vendor/storage":4,jquery:3}],3:[function(t,n,r){!function(e,t){"object"==typeof n&&"object"==typeof n.exports?n.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(t,n){function r(e){var t="length"in e&&e.length,n=ee.type(e);return"function"===n||ee.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function i(e,t,n){if(ee.isFunction(t))return ee.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return ee.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ue.test(t))return ee.filter(t,e,n);t=ee.filter(t,e)}return ee.grep(e,function(e){return V.call(t,e)>=0!==n})}function o(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function s(e){var t=ge[e]={};return ee.each(e.match(he)||[],function(e,n){t[n]=!0}),t}function a(){K.removeEventListener("DOMContentLoaded",a,!1),t.removeEventListener("load",a,!1),ee.ready()}function u(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ee.expando+u.uid++}function l(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(we,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:be.test(n)?ee.parseJSON(n):n}catch(i){}xe.set(e,t,n)}else n=void 0;return n}function c(){return!0}function f(){return!1}function p(){try{return K.activeElement}catch(e){}}function d(e,t){return ee.nodeName(e,"table")&&ee.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function h(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function g(e){var t=Me.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n=0,r=e.length;r>n;n++)ye.set(e[n],"globalEval",!t||ye.get(t[n],"globalEval"))}function v(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(ye.hasData(e)&&(o=ye.access(e),s=ye.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)ee.event.add(t,i,l[i][n])}xe.hasData(e)&&(a=xe.access(e),u=ee.extend({},a),xe.set(t,u))}}function y(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&ee.nodeName(e,t)?ee.merge([e],n):n}function x(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ne.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function b(e,n){var r,i=ee(n.createElement(e)).appendTo(n.body),o=t.getDefaultComputedStyle&&(r=t.getDefaultComputedStyle(i[0]))?r.display:ee.css(i[0],"display");return i.detach(),o}function w(e){var t=K,n=Ie[e];return n||(n=b(e,t),"none"!==n&&n||(We=(We||ee("