Skip to content

Commit 4a6b372

Browse files
committed
sendImg -> sendImage, updating dependencies, adding package-lock
1 parent 2463410 commit 4a6b372

File tree

6 files changed

+2699
-23
lines changed

6 files changed

+2699
-23
lines changed

dist/openpixel.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
// Open Pixel v1.0.0 | Published By Dockwa, Inc. | Created By Stuart Yamartino | MIT License
1+
// Open Pixel v1.0.0 | Published By Dockwa | Created By Stuart Yamartino | MIT License
22
;(function(window, document, pixelFunc, pixelFuncName, pixelEndpoint, versionNumber) {
33
'use strict';
44

55
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
66

7-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
7+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
88

99
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1010

1111
var Config = {
1212
id: '',
1313
version: versionNumber
14-
};
1514

16-
// check if a varaible is not undefined, null, or blank
17-
var isset = function isset(variable) {
15+
// check if a variable is not undefined, null, or blank
16+
};var isset = function isset(variable) {
1817
return typeof variable !== "undefined" && variable !== null && variable !== '';
1918
};
2019

@@ -30,12 +29,12 @@ var guid = function guid() {
3029
}) + (1 * new Date()).toString(36);
3130
};
3231

33-
// reduces all optinal data down to a string
32+
// reduces all optional data down to a string
3433
var optinalData = function optinalData(data) {
3534
if (isset(data) === false) {
3635
return '';
3736
} else if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') {
38-
// runs optinalData again to reduce to string incase something else was returned
37+
// runs optinalData again to reduce to string in case something else was returned
3938
return optinalData(JSON.stringify(data));
4039
} else if (typeof data === 'function') {
4140
// runs the function and calls optinalData again to reduce further if it isn't a string
@@ -77,7 +76,7 @@ var Cookie = {
7776
return '__' + pixelFuncName + '_';
7877
},
7978
set: function set(name, value, minutes) {
80-
var path = arguments.length <= 3 || arguments[3] === undefined ? "/" : arguments[3];
79+
var path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "/";
8180

8281
var expires = "";
8382
if (isset(minutes)) {
@@ -142,7 +141,6 @@ var Cookie = {
142141

143142
var Url = {
144143
// http://stackoverflow.com/a/901144/1231563
145-
146144
getParameterByName: function getParameterByName(name, url) {
147145
if (!url) url = window.location.href;
148146
name = name.replace(/[\[\]]/g, "\\$&");
@@ -247,11 +245,11 @@ var Pixel = function () {
247245
}, // get the utm concent
248246
utm_campaign: function utm_campaign(key) {
249247
return Cookie.getUtm(key);
250-
} };
248+
} // get the utm campaign
249+
};
251250
}
252251
}, {
253252
key: 'setParam',
254-
// get the utm campaign
255253
value: function setParam(key, val) {
256254
if (isset(val)) {
257255
this.params.push(key + '=' + val);
@@ -270,8 +268,8 @@ var Pixel = function () {
270268
window.navigator.sendBeacon(this.getSourceUrl());
271269
}
272270
}, {
273-
key: 'sendImg',
274-
value: function sendImg() {
271+
key: 'sendImage',
272+
value: function sendImage() {
275273
this.img = document.createElement('img');
276274
this.img.src = this.getSourceUrl();
277275
this.img.style.display = 'none';
@@ -323,7 +321,7 @@ window.addEventListener('unload', function () {
323321
// set 10 minutes page close cookie
324322
// Cookie.throttle('pageclose');
325323
new Pixel('pageclose', now(), function () {
326-
// if a link was clicked in the last 5 seconds that goes to an extenal host, pass it through as event data
324+
// if a link was clicked in the last 5 seconds that goes to an external host, pass it through as event data
327325
if (isset(Config.externalHost) && now() - Config.externalHost.time < 5 * 1000) {
328326
return Config.externalHost.link;
329327
}

dist/openpixel.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/snippet.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<!-- Start Open Pixel Snippet -->
22
<script>
3-
!function(e,t,n,p,o,a,i,s,c){e[o]||(i=e[o]=function(){i.process?i.process.apply(i,arguments):i.queue.push(arguments)},i.queue=[],i.t=1*new Date,s=t.createElement(n),s.async=1,s.src=p+"?t="+Math.ceil(new Date/a)*a,c=t.getElementsByTagName(n)[0],c.parentNode.insertBefore(s,c))}(window,document,"script","https://static.example.com/v1/openpixel.js","opix",864e5);
4-
opix("init","ID-XXXXXXXX");
5-
opix("event","pageload");
3+
!function(e,t,n,p,o,a,i,s,c){e[o]||(i=e[o]=function(){i.process?i.process.apply(i,arguments):i.queue.push(arguments)},i.queue=[],i.t=1*new Date,s=t.createElement(n),s.async=1,s.src=p+"?t="+Math.ceil(new Date/a)*a,c=t.getElementsByTagName(n)[0],c.parentNode.insertBefore(s,c))}(window,document,"script","https://static.example.com/v1/openpixel.js","opix",864e5),opix("init","ID-XXXXXXXX"),opix("event","pageload");
64
</script>
7-
<!-- End Open Pixel Snippet -->
5+
<!-- End Open Pixel Snippet -->

0 commit comments

Comments
 (0)