From 9add648b720b8cce52214c96e6761ee448072532 Mon Sep 17 00:00:00 2001 From: Umang Galaiya Date: Tue, 26 Mar 2019 02:04:15 +0530 Subject: [PATCH 1/4] Update Documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6a95782..707fadd 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Initialise lytics: ```js lytics.init({ parent: '#myContainer', - track: (props, callback) => { + tracker: (props, callback) => { trackAnalyticsForWebsite(props) .then(() => { callback(); @@ -70,7 +70,7 @@ Currently, only two types of triggers are supported: | Property | Type | Default | Description | | --- | --- | --- | --- | | parent | String or HTMLElement | `document.documentElement` | Parent element or selector. Delegated events will be listened from this element. | -| track | Function | (p, cb) => cb(); | Function that gets two parameters: `props`, `callback`. Make sure to invoke callback in the tracking method that you provide. | +| tracker | Function | (p, cb) => cb(); | Function that gets two parameters: `props`, `callback`. Make sure to invoke callback in the tracking method that you provide. | | ignoreSynthetic | Boolean | `true` | Whether or not to ignore synthetic events. Synthetic events are events triggered programmatically. | | timeout | Number | 300 | Timeout for automatic invocation of callback. If the callback isn't executed within `timeout` ms by you, it will automatically be executed. From 10a173dc9ded91cd308f10d253f670efbba2d5bd Mon Sep 17 00:00:00 2001 From: Umang Galaiya Date: Tue, 26 Mar 2019 02:04:51 +0530 Subject: [PATCH 2/4] Add sanity check --- utils/listeners.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/listeners.js b/utils/listeners.js index f2a3c86..74cd854 100644 --- a/utils/listeners.js +++ b/utils/listeners.js @@ -49,7 +49,7 @@ export function initListeners(parent, tracker, ignoreSynthetic, timeout) { const submit = createAndAttachListener('submit', parent, tracker, ignoreSynthetic, timeout); return () => { - click(); - submit(); + click && click(); + submit && submit(); } } \ No newline at end of file From 1ca6c21e1d2acd9c3247dd16971010191a21e2ce Mon Sep 17 00:00:00 2001 From: Umang Galaiya Date: Tue, 26 Mar 2019 02:05:53 +0530 Subject: [PATCH 3/4] Prepare v1.0.1 --- CHANGELOG.md | 4 ++++ README.md | 2 +- dist/lytics.js | 2 +- package.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..613a00e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +### v1.0.1 + +- Minor bugfix +- Documentation update \ No newline at end of file diff --git a/README.md b/README.md index 707fadd..1df710a 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ npm i @razorpay/lytics --save Unpkg ```html - + ``` ### Initialising diff --git a/dist/lytics.js b/dist/lytics.js index 15055ec..03f5813 100644 --- a/dist/lytics.js +++ b/dist/lytics.js @@ -1 +1 @@ -(function () {var a={};function l(t){return t.split("-").map(function(t,e){return 0===e?t:t[0].toUpperCase()+t.slice(1,t.length)}).join("")}function g(t){for(var e=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:"click",e=arguments.length>3?arguments[3]:void 0,$=arguments.length>4?arguments[4]:void 0;if(r){var c=d(r);c.trigger&&c.trigger===a&&k(r,t,a,e,$)}}function m(t){return t.ctrlKey||t.metaKey||t.shiftKey}function n(t,e){if(!m(t))return t.preventDefault(),e}function f(t,e,a){var r=t.call(null,e,a);return r&&(r=n(a,r)),r}function p(t){var e=t.getAttribute("target");if(!e||"_self"===e)return function(){var e=t.getAttribute("href");e&&(window.location.href=e)}}function q(t){var e=t.getAttribute("target");if(!e||"_self"===e)return function(){t.submit()}}function s(t,e){var a=!1;return e>0&&setTimeout(function(){a=!0,t()},e),function(){a||(a=!0,t())}}c.initListeners=i;var u=function(e,t){t()};function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parent,r=void 0===t?document.documentElement:t,$=e.tracker,i=void 0===$?u:$,o=e.ignoreSynthetic,n=void 0===o||o,s=e.timeout,b=void 0===s?300:s;if("string"==typeof r&&(r=document.querySelector(r)),r instanceof HTMLElement)return{off:c.initListeners(r,i,n,b)}}var t=r;a.init=t;var e=d;a.getAttributesOfEl=e;if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=a}else if(typeof define==="function"&&define.amd){define(function(){return a})}else{this["lytics"]=a}})(); \ No newline at end of file +(function () {var a={};function l(t){return t.split("-").map(function(t,e){return 0===e?t:t[0].toUpperCase()+t.slice(1,t.length)}).join("")}function g(t){for(var e=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:"click",e=arguments.length>3?arguments[3]:void 0,$=arguments.length>4?arguments[4]:void 0;if(r){var c=d(r);c.trigger&&c.trigger===a&&k(r,t,a,e,$)}}function m(t){return t.ctrlKey||t.metaKey||t.shiftKey}function n(t,e){if(!m(t))return t.preventDefault(),e}function f(t,e,a){var r=t.call(null,e,a);return r&&(r=n(a,r)),r}function p(t){var e=t.getAttribute("target");if(!e||"_self"===e)return function(){var e=t.getAttribute("href");e&&(window.location.href=e)}}function q(t){var e=t.getAttribute("target");if(!e||"_self"===e)return function(){t.submit()}}function s(t,e){var a=!1;return e>0&&setTimeout(function(){a=!0,t()},e),function(){a||(a=!0,t())}}c.initListeners=i;var u=function(e,t){t()};function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parent,r=void 0===t?document.documentElement:t,$=e.tracker,i=void 0===$?u:$,o=e.ignoreSynthetic,n=void 0===o||o,s=e.timeout,b=void 0===s?300:s;if("string"==typeof r&&(r=document.querySelector(r)),r instanceof HTMLElement)return{off:c.initListeners(r,i,n,b)}}var t=r;a.init=t;var e=d;a.getAttributesOfEl=e;if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=a}else if(typeof define==="function"&&define.amd){define(function(){return a})}else{this["lytics"]=a}})(); \ No newline at end of file diff --git a/package.json b/package.json index 4e456e5..94fa288 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@razorpay/lytics", - "version": "1.0.0", + "version": "1.0.1", "description": "Simpler analytics using HTML attributes.", "main": "dist/lytics", "scripts": { From d8a813afaa0f2f18852541ee1b4cc9c94fd0d59d Mon Sep 17 00:00:00 2001 From: Umang Galaiya Date: Tue, 26 Mar 2019 12:58:45 +0530 Subject: [PATCH 4/4] Add hash --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2cab2b..a8dac46 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Unpkg ```html ```