cordova-plugin-appice 2.0.10 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/www/AppICE.js CHANGED
@@ -1,289 +1,336 @@
1
+ cordova.define("cordova-plugin-appice.AppICE", function (require, exports, module) {
2
+
3
+ var AppICE = function () { }
4
+
5
+
6
+ //===================================
7
+ // SDK CONFIG APIS
8
+ //===================================
9
+
10
+ AppICE.prototype.validateIntegration = function (success, error) {
11
+ cordova.exec(success, error, "AppICEPlugin", "validateIntegration", []);
12
+ };
13
+
14
+ AppICE.prototype.startContext = function (gcmID, success, error) {
15
+ cordova.exec(success, error, "AppICEPlugin", "startContext", [{ "gcmID": gcmID }]);
16
+
17
+ var inputArr = [];
18
+ var inputs = document.getElementsByTagName('input');
19
+ for (var index = 0; index < inputs.length; ++index) {
20
+ var element = inputs[index];
21
+ var data = {
22
+ "t": element.tagName,
23
+ "i": element.id,
24
+ "n": element.name,
25
+ "y": element.getBoundingClientRect().top + window.scrollY,
26
+ "x": element.getBoundingClientRect().left + window.scrollX,
27
+ "w": element.getBoundingClientRect().width,
28
+ "h": element.getBoundingClientRect().height
29
+ };
30
+ inputArr.push(data);
31
+ }
1
32
 
2
- var AppICE = function () {}
3
-
4
-
5
- //===================================
6
- // SDK CONFIG APIS
7
- //===================================
8
-
9
- AppICE.prototype.validateIntegration = function (success, error) {
10
- cordova.exec(success, error, "AppICEPlugin", "validateIntegration", []);
11
- };
12
-
13
- AppICE.prototype.startContext = function (gcmID, success, error) {
14
- cordova.exec(success, error, "AppICEPlugin", "startContext", [{ "gcmID": gcmID }]);
15
-
16
- var inputArr = [];
17
- var inputs = document.getElementsByTagName('input');
18
- for (var index = 0; index < inputs.length; ++index) {
19
- var element = inputs[index];
20
- var data = {
21
- "t": element.tagName,
22
- "i": element.id,
23
- "n": element.name,
24
- "y": element.getBoundingClientRect().top + window.scrollY,
25
- "x": element.getBoundingClientRect().left + window.scrollX,
26
- "w": element.getBoundingClientRect().width,
27
- "h": element.getBoundingClientRect().height
28
- };
29
- inputArr.push(data);
30
- }
31
-
32
- cordova.exec(success, error, "AppICEPlugin", "trackScreens",
33
- [{ "old": "", "new": "", "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
34
- };
35
-
36
- AppICE.prototype.initSdk = function (appID, appKey, apiKey, gcmID, region, baseUrl, certs, success, error) {
37
- cordova.exec(success, error, "AppICEPlugin", "initSdk", [{ "appID": appID, "appKey": appKey, "apiKey": apiKey, "gcmID": gcmID, "region": region, "baseUrl": baseUrl, "certs": certs }]);
38
- var inputArr = [];
39
- var inputs = document.getElementsByTagName('input');
40
- for (var index = 0; index < inputs.length; ++index) {
41
- var element = inputs[index];
42
- var data = {
43
- "t": element.tagName,
44
- "i": element.id,
45
- "n": element.name,
46
- "y": element.getBoundingClientRect().top + window.scrollY,
47
- "x": element.getBoundingClientRect().left + window.scrollX,
48
- "w": element.getBoundingClientRect().width,
49
- "h": element.getBoundingClientRect().height
50
- };
51
- inputArr.push(data);
52
- }
33
+ cordova.exec(success, error, "AppICEPlugin", "trackScreens",
34
+ [{ "old": "", "new": "", "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
35
+ };
36
+
37
+ AppICE.prototype.initSdk = function (appID, appKey, apiKey, gcmID, region, baseUrl, certs, success, error) {
38
+ cordova.exec(success, error, "AppICEPlugin", "initSdk", [{ "appID": appID, "appKey": appKey, "apiKey": apiKey, "gcmID": gcmID, "region": region, "baseUrl": baseUrl, "certs": certs }]);
39
+ var inputArr = [];
40
+ var inputs = document.getElementsByTagName('input');
41
+ for (var index = 0; index < inputs.length; ++index) {
42
+ var element = inputs[index];
43
+ var data = {
44
+ "t": element.tagName,
45
+ "i": element.id,
46
+ "n": element.name,
47
+ "y": element.getBoundingClientRect().top + window.scrollY,
48
+ "x": element.getBoundingClientRect().left + window.scrollX,
49
+ "w": element.getBoundingClientRect().width,
50
+ "h": element.getBoundingClientRect().height
51
+ };
52
+ inputArr.push(data);
53
+ }
53
54
 
54
- cordova.exec(success, error, "AppICEPlugin", "trackScreens", [{ "old": "", "new": "", "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
55
- };
55
+ cordova.exec(success, error, "AppICEPlugin", "trackScreens", [{ "old": "", "new": "", "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
56
+ };
56
57
 
57
- AppICE.prototype.stopContext = function (success, error) {
58
- cordova.exec(success, error, "AppICEPlugin", "stopContext", []);
59
- };
58
+ AppICE.prototype.stopContext = function (success, error) {
59
+ cordova.exec(success, error, "AppICEPlugin", "stopContext", []);
60
+ };
60
61
 
61
- AppICE.prototype.getCurrentContext = function (success, error) {
62
- cordova.exec(success, error, "AppICEPlugin", "getCurrentContext", []);
63
- }
62
+ AppICE.prototype.getCurrentContext = function (success, error) {
63
+ cordova.exec(success, error, "AppICEPlugin", "getCurrentContext", []);
64
+ };
64
65
 
65
- AppICE.prototype.registerLifeCycle = function (success, error) {
66
- cordova.exec(success, error, "AppICEPlugin", "registerLifeCycle", []);
67
- }
66
+ AppICE.prototype.registerLifeCycle = function (success, error) {
67
+ cordova.exec(success, error, "AppICEPlugin", "registerLifeCycle", []);
68
+ };
68
69
 
69
- //==================================
70
- // PLAY STORE SETTING APIS
71
- //==================================
70
+ AppICE.prototype.isDeviceReady = function (success, error) {
71
+ cordova.exec(success, error, "AppICEPlugin", "isDeviceReady", []);
72
+ };
72
73
 
73
- AppICE.prototype.openPlayServiceUpdate = function (success, error) {
74
- cordova.exec(success, error, "AppICEPlugin", "openPlayServiceUpdate", []);
75
- };
74
+ //==================================
75
+ // PLAY STORE SETTING APIS
76
+ //==================================
76
77
 
77
- //===================================
78
- // SDK METADATA APIS
79
- //===================================
78
+ AppICE.prototype.openPlayServiceUpdate = function (success, error) {
79
+ cordova.exec(success, error, "AppICEPlugin", "openPlayServiceUpdate", []);
80
+ };
80
81
 
81
- AppICE.prototype.getAppKey = function (success, error) {
82
- cordova.exec(success, error, "AppICEPlugin", "getAppKey", []);
83
- }
82
+ //===================================
83
+ // SDK METADATA APIS
84
+ //===================================
84
85
 
85
- AppICE.prototype.getApiKey = function (success, error) {
86
- cordova.exec(success, error, "AppICEPlugin", "getApiKey", []);
87
- }
86
+ AppICE.prototype.getAppKey = function (success, error) {
87
+ cordova.exec(success, error, "AppICEPlugin", "getAppKey", []);
88
+ }
88
89
 
89
- AppICE.prototype.getAppId = function (success, error) {
90
- cordova.exec(success, error, "AppICEPlugin", "getAppId", []);
91
- }
90
+ AppICE.prototype.getApiKey = function (success, error) {
91
+ cordova.exec(success, error, "AppICEPlugin", "getApiKey", []);
92
+ }
92
93
 
93
- AppICE.prototype.getSdkVersion = function (success, error) {
94
- cordova.exec(success, error, "AppICEPlugin", "getSdkVersion", []);
95
- };
94
+ AppICE.prototype.getAppId = function (success, error) {
95
+ cordova.exec(success, error, "AppICEPlugin", "getAppId", []);
96
+ }
96
97
 
97
- AppICE.prototype.getSdkIntVersion = function (success, error) {
98
- cordova.exec(success, error, "AppICEPlugin", "getSdkIntVersion", []);
99
- };
98
+ AppICE.prototype.getSdkVersion = function (success, error) {
99
+ cordova.exec(success, error, "AppICEPlugin", "getSdkVersion", []);
100
+ };
100
101
 
101
- //==================================
102
- // DEVICE ID SETTING APIS
103
- //==================================
102
+ AppICE.prototype.getSdkIntVersion = function (success, error) {
103
+ cordova.exec(success, error, "AppICEPlugin", "getSdkIntVersion", []);
104
+ };
104
105
 
105
- AppICE.prototype.setDeviceId = function (deviceID, success, error) {
106
- cordova.exec(success, error, "AppICEPlugin", "setDeviceId", [{ "deviceID": deviceID }]);
107
- };
106
+ //==================================
107
+ // DEVICE ID SETTING APIS
108
+ //==================================
108
109
 
109
- AppICE.prototype.getDeviceId = function (success, error) {
110
- cordova.exec(success, error, "AppICEPlugin", "getDeviceId", []);
111
- };
110
+ AppICE.prototype.setDeviceId = function (deviceID, success, error) {
111
+ cordova.exec(success, error, "AppICEPlugin", "setDeviceId", [{ "deviceID": deviceID }]);
112
+ };
112
113
 
113
- AppICE.prototype.getAndroidId = function (success, error) {
114
- cordova.exec(success, error, "AppICEPlugin", "getAndroidId", []);
115
- };
114
+ AppICE.prototype.getDeviceId = function (success, error) {
115
+ cordova.exec(success, error, "AppICEPlugin", "getDeviceId", []);
116
+ };
116
117
 
117
- //===================================
118
- // ALIAS SETTING APIS
119
- //===================================
118
+ AppICE.prototype.getAndroidId = function (success, error) {
119
+ cordova.exec(success, error, "AppICEPlugin", "getAndroidId", []);
120
+ };
120
121
 
121
- AppICE.prototype.setAlias = function (alias, success, error) {
122
- cordova.exec(success, error, "AppICEPlugin", "setAlias", [{ "alias": alias }]);
123
- };
122
+ //===================================
123
+ // ALIAS SETTING APIS
124
+ //===================================
124
125
 
125
- AppICE.prototype.getAlias = function (success, error) {
126
- cordova.exec(success, error, "AppICEPlugin", "getAlias", []);
127
- };
128
-
129
- //====================================
130
- // USER SETTING APIS
131
- //====================================
132
-
133
- AppICE.prototype.setUser = function (name, phone, email, success, error) {
134
- cordova.exec(success, error, "AppICEPlugin", "setUser", [{ "name": name, "phone": phone, "email": email }]);
135
- };
136
-
137
- AppICE.prototype.getUser = function (success, error) {
138
- cordova.exec(success, error, "AppICEPlugin", "getUser", []);
139
- };
140
-
141
- AppICE.prototype.setUserId = function (userID, success, error) {
142
- cordova.exec(success, error, "AppICEPlugin", "setUserId", [{ "userID": userID }]);
143
- };
144
-
145
- //=============================
146
- // CHILD KEY SETTING APIS
147
- //=============================
148
-
149
- AppICE.prototype.setChildId = function (childID, success, error) {
150
- cordova.exec(success, error, "AppICEPlugin", "setChildId", [{ "childID": childID }]);
151
- };
152
-
153
- AppICE.prototype.getChildId = function (success, error) {
154
- cordova.exec(success, error, "AppICEPlugin", "getChildId", []);
155
- };
156
-
157
- //=========================================
158
- // CUSTOM VARIBALE AND EVENT SETTING APIS
159
- //==========================================
160
-
161
- AppICE.prototype.setCustomVariable = function (key, value, success, error) {
162
- cordova.exec(success, error, "AppICEPlugin", "setCustomVariable", [{ "key": key, "value": value }]);
163
- };
164
-
165
- AppICE.prototype.getCustomVariable = function (key, success, error) {
166
- cordova.exec(success, error, "AppICEPlugin", "getCustomVariable", [{ "key": key }]);
167
- };
168
-
169
- AppICE.prototype.removeCustomVariable = function (key, success, error) {
170
- cordova.exec(success, error, "AppICEPlugin", "removeCustomVariable", [{ "key": key }]);
171
- };
172
-
173
- AppICE.prototype.tagEvent = function (key, data, success, error) {
174
- cordova.exec(success, error, "AppICEPlugin", "tagEvent", [{ "key": key, "data": data }]);
175
- };
176
-
177
- //==================================
178
- // SESSION SETTING APIS
179
- //==================================
180
-
181
- AppICE.prototype.setSessionTimeout = function (timeout, success, error) {
182
- cordova.exec(success, error, "AppICEPlugin", "setSessionTimeout", [{ "timeout": timeout }]);
183
- };
184
-
185
- AppICE.prototype.getSessionTimeout = function (success, error) {
186
- cordova.exec(success, error, "AppICEPlugin", "getSessionTimeout", []);
187
- };
188
-
189
- //==================================
190
- // PUSH NOTIFICATION SETTING APIS
191
- //==================================
192
-
193
- AppICE.prototype.getDeviceToken = function (success, error) {
194
- cordova.exec(success, error, "AppICEPlugin", "getDeviceToken", []);
195
- };
196
-
197
- AppICE.prototype.setSmallIcon = function (icon, success, error) {
198
- cordova.exec(success, error, "AppICEPlugin", "setSmallIcon", [{ "icon": icon }]);
199
- };
200
-
201
- AppICE.prototype.onNotificationOpen = function (success, error) {
202
- cordova.exec(success, error, "AppICEPlugin", "onNotificationOpen", []);
203
- };
204
-
205
- AppICE.prototype.pushNotificationClicked = function (payload, success, error) {
206
- cordova.exec(success, error, "AppICEPlugin", "pushNotificationClicked", [{"pushPayload": payload}]);
207
- };
208
-
209
- AppICE.prototype.getDeepLinkURL = function (payload, success, error) {
210
- cordova.exec(success, error, "AppICEPlugin", "getDeepLinkURL", [{"pushPayload": payload}]);
211
- };
212
-
213
- //===============================
214
- // VISUAL PLAYBACK SETTING APIS
215
- //===============================
216
-
217
- AppICE.prototype.isSemusiSensing = function (success, error) {
218
- cordova.exec(success, error, "AppICEPlugin", "isSemusiSensing", []);
219
- };
220
-
221
- AppICE.prototype.trackTouchS = function (e, success, error) {
222
- var touchobj = e.changedTouches[0]
223
- swipedir = 'none'
224
- dist = 0
225
- startX = touchobj.pageX
226
- startY = touchobj.pageY
227
- startTime = new Date().getTime()
228
- };
229
-
230
- AppICE.prototype.trackTouchE = function (e, success, error) {
231
- var touchobj = e.changedTouches[0]
232
- distX = touchobj.pageX - startX
233
- distY = touchobj.pageY - startY
234
- elapsedTime = new Date().getTime() - startTime
235
- if (elapsedTime <= 1500) {
236
- if (Math.abs(distX) >= 150 && Math.abs(distY) <= 250) {
237
- swipedir = (distX < 0) ? 'left' : 'right'
126
+ AppICE.prototype.setAlias = function (alias, success, error) {
127
+ cordova.exec(success, error, "AppICEPlugin", "setAlias", [{ "alias": alias }]);
128
+ };
129
+
130
+ AppICE.prototype.getAlias = function (success, error) {
131
+ cordova.exec(success, error, "AppICEPlugin", "getAlias", []);
132
+ };
133
+
134
+ //====================================
135
+ // USER SETTING APIS
136
+ //====================================
137
+
138
+ AppICE.prototype.setUser = function (name, phone, email, success, error) {
139
+ cordova.exec(success, error, "AppICEPlugin", "setUser", [{ "name": name, "phone": phone, "email": email }]);
140
+ };
141
+
142
+ AppICE.prototype.getUser = function (success, error) {
143
+ cordova.exec(success, error, "AppICEPlugin", "getUser", []);
144
+ };
145
+
146
+ AppICE.prototype.setUserId = function (userID, success, error) {
147
+ cordova.exec(success, error, "AppICEPlugin", "setUserId", [{ "userID": userID }]);
148
+ };
149
+
150
+ //=============================
151
+ // CHILD KEY SETTING APIS
152
+ //=============================
153
+
154
+ AppICE.prototype.setChildId = function (childID, success, error) {
155
+ cordova.exec(success, error, "AppICEPlugin", "setChildId", [{ "childID": childID }]);
156
+ };
157
+
158
+ AppICE.prototype.getChildId = function (success, error) {
159
+ cordova.exec(success, error, "AppICEPlugin", "getChildId", []);
160
+ };
161
+
162
+ //=========================================
163
+ // CUSTOM VARIBALE AND EVENT SETTING APIS
164
+ //==========================================
165
+
166
+ AppICE.prototype.setCustomVariable = function (key, value, success, error) {
167
+ cordova.exec(success, error, "AppICEPlugin", "setCustomVariable", [{ "key": key, "value": value }]);
168
+ };
169
+
170
+ AppICE.prototype.getCustomVariable = function (key, success, error) {
171
+ cordova.exec(success, error, "AppICEPlugin", "getCustomVariable", [{ "key": key }]);
172
+ };
173
+
174
+ AppICE.prototype.removeCustomVariable = function (key, success, error) {
175
+ cordova.exec(success, error, "AppICEPlugin", "removeCustomVariable", [{ "key": key }]);
176
+ };
177
+
178
+ AppICE.prototype.tagEvent = function (key, data, success, error) {
179
+ cordova.exec(success, error, "AppICEPlugin", "tagEvent", [{ "key": key, "data": data }]);
180
+ };
181
+
182
+ //==================================
183
+ // SESSION SETTING APIS
184
+ //==================================
185
+
186
+ AppICE.prototype.setSessionTimeout = function (timeout, success, error) {
187
+ cordova.exec(success, error, "AppICEPlugin", "setSessionTimeout", [{ "timeout": timeout }]);
188
+ };
189
+
190
+ AppICE.prototype.getSessionTimeout = function (success, error) {
191
+ cordova.exec(success, error, "AppICEPlugin", "getSessionTimeout", []);
192
+ };
193
+
194
+ //==================================
195
+ // PUSH NOTIFICATION SETTING APIS
196
+ //==================================
197
+
198
+ AppICE.prototype.getDeviceToken = function (success, error) {
199
+ cordova.exec(success, error, "AppICEPlugin", "getDeviceToken", []);
200
+ };
201
+
202
+ AppICE.prototype.setSmallIcon = function (icon, success, error) {
203
+ cordova.exec(success, error, "AppICEPlugin", "setSmallIcon", [{ "icon": icon }]);
204
+ };
205
+
206
+ AppICE.prototype.onNotificationOpen = function (success, error) {
207
+ cordova.exec(success, error, "AppICEPlugin", "onNotificationOpen", []);
208
+ };
209
+
210
+ AppICE.prototype.pushNotificationClicked = function (payload, success, error) {
211
+ cordova.exec(success, error, "AppICEPlugin", "pushNotificationClicked", [{ "pushPayload": payload }]);
212
+ };
213
+
214
+ AppICE.prototype.getDeepLinkURL = function (payload, success, error) {
215
+ cordova.exec(success, error, "AppICEPlugin", "getDeepLinkURL", [{ "pushPayload": payload }]);
216
+ };
217
+
218
+ AppICE.prototype.getDataForKey = function (payload, key, success, error) {
219
+ try {
220
+ let parsedPayload;
221
+
222
+ // if payload is a string
223
+ if (typeof payload === 'string') {
224
+ // Parse the payload string to JSON
225
+ parsedPayload = JSON.parse(payload);
226
+ } else {
227
+ // if already an object
228
+ parsedPayload = payload;
229
+ }
230
+
231
+ // if key exist then return the value
232
+ if (parsedPayload.hasOwnProperty(key)) {
233
+ success(parsedPayload[key]);
234
+ }
235
+
236
+ // check for active camps in case of who + what payload
237
+ if (parsedPayload.hasOwnProperty('activeCampaigns') && parsedPayload.activeCampaigns.length > 0) {
238
+ const data = parsedPayload.activeCampaigns[0].data;
239
+ if (data && data.hasOwnProperty(key)) {
240
+ success(data[key]);
241
+ }
242
+ // activeCamps => cdata
243
+ if (data && data.hasOwnProperty('cdata') && data.cdata.hasOwnProperty(key)) {
244
+ success(data.cdata[key]);
245
+ }
246
+ }
247
+
248
+ if (parsedPayload.hasOwnProperty('cdata') && parsedPayload.cdata.hasOwnProperty(key)) {
249
+ success(parsedPayload.cdata[key]);
250
+ }
251
+
252
+ error('something is wrong please try again with valid data');
253
+ } catch (errMessage) {
254
+ error(errMessage)
238
255
  }
239
- else if (Math.abs(distY) >= 150 && Math.abs(distX) <= 250) {
240
- swipedir = (distY < 0) ? 'up' : 'down'
256
+ };
257
+
258
+ //===============================
259
+ // VISUAL PLAYBACK SETTING APIS
260
+ //===============================
261
+
262
+ AppICE.prototype.isSemusiSensing = function (success, error) {
263
+ cordova.exec(success, error, "AppICEPlugin", "isSemusiSensing", []);
264
+ };
265
+
266
+ AppICE.prototype.trackTouchS = function (e, success, error) {
267
+ var touchobj = e.changedTouches[0]
268
+ swipedir = 'none'
269
+ dist = 0
270
+ startX = touchobj.pageX
271
+ startY = touchobj.pageY
272
+ startTime = new Date().getTime()
273
+ };
274
+
275
+ AppICE.prototype.trackTouchE = function (e, success, error) {
276
+ var touchobj = e.changedTouches[0]
277
+ distX = touchobj.pageX - startX
278
+ distY = touchobj.pageY - startY
279
+ elapsedTime = new Date().getTime() - startTime
280
+ if (elapsedTime <= 1500) {
281
+ if (Math.abs(distX) >= 150 && Math.abs(distY) <= 250) {
282
+ swipedir = (distX < 0) ? 'left' : 'right'
283
+ }
284
+ else if (Math.abs(distY) >= 150 && Math.abs(distX) <= 250) {
285
+ swipedir = (distY < 0) ? 'up' : 'down'
286
+ }
241
287
  }
242
- }
243
288
 
244
- var inputArr = [];
245
- var inputs = document.getElementsByTagName('input');
246
- for (var index = 0; index < inputs.length; ++index) {
247
- var element = inputs[index];
248
- var data = {
249
- "t": element.tagName,
250
- "i": element.id,
251
- "n": element.name,
252
- "y": element.getBoundingClientRect().top + window.scrollY,
253
- "x": element.getBoundingClientRect().left + window.scrollX,
254
- "w": element.getBoundingClientRect().width,
255
- "h": element.getBoundingClientRect().height
256
- };
257
- inputArr.push(data);
258
- }
289
+ var inputArr = [];
290
+ var inputs = document.getElementsByTagName('input');
291
+ for (var index = 0; index < inputs.length; ++index) {
292
+ var element = inputs[index];
293
+ var data = {
294
+ "t": element.tagName,
295
+ "i": element.id,
296
+ "n": element.name,
297
+ "y": element.getBoundingClientRect().top + window.scrollY,
298
+ "x": element.getBoundingClientRect().left + window.scrollX,
299
+ "w": element.getBoundingClientRect().width,
300
+ "h": element.getBoundingClientRect().height
301
+ };
302
+ inputArr.push(data);
303
+ }
259
304
 
260
- if (swipedir == 'none') {
261
- var t = e.target;
262
- cordova.exec(success, error, "AppICEPlugin", "trackTouches", [{ "type": t.tagName, "id": t.id, "name": t.name, "py": t.getBoundingClientRect().top + window.scrollY, "px": t.getBoundingClientRect().left + window.scrollX, "pw": t.getBoundingClientRect().width, "ph": t.getBoundingClientRect().height, "x": touchobj.screenX, "y": touchobj.screenY, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
263
- }
264
- else {
265
- cordova.exec(success, error, "AppICEPlugin", "trackSwipes", [{ "type": swipedir, "x1": startX, "y1": startY, "x2": touchobj.screenX, "y2": touchobj.screenY, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
266
- }
267
- };
268
-
269
- AppICE.prototype.trackScreens = function (e, success, error) {
270
- var inputArr = [];
271
- var inputs = document.getElementsByTagName('input');
272
- for (var index = 0; index < inputs.length; ++index) {
273
- var element = inputs[index];
274
- var data = {
275
- "t": element.tagName,
276
- "i": element.id,
277
- "n": element.name,
278
- "y": element.getBoundingClientRect().top + window.scrollY,
279
- "x": element.getBoundingClientRect().left + window.scrollX,
280
- "w": element.getBoundingClientRect().width,
281
- "h": element.getBoundingClientRect().height
282
- };
283
- inputArr.push(data);
284
- }
285
- cordova.exec(success, error, "AppICEPlugin", "trackScreens", [{ "old": e.oldURL, "new": e.newURL, "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
286
- };
305
+ if (swipedir == 'none') {
306
+ var t = e.target;
307
+ cordova.exec(success, error, "AppICEPlugin", "trackTouches", [{ "type": t.tagName, "id": t.id, "name": t.name, "py": t.getBoundingClientRect().top + window.scrollY, "px": t.getBoundingClientRect().left + window.scrollX, "pw": t.getBoundingClientRect().width, "ph": t.getBoundingClientRect().height, "x": touchobj.screenX, "y": touchobj.screenY, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
308
+ }
309
+ else {
310
+ cordova.exec(success, error, "AppICEPlugin", "trackSwipes", [{ "type": swipedir, "x1": startX, "y1": startY, "x2": touchobj.screenX, "y2": touchobj.screenY, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
311
+ }
312
+ };
313
+
314
+ AppICE.prototype.trackScreens = function (e, success, error) {
315
+ var inputArr = [];
316
+ var inputs = document.getElementsByTagName('input');
317
+ for (var index = 0; index < inputs.length; ++index) {
318
+ var element = inputs[index];
319
+ var data = {
320
+ "t": element.tagName,
321
+ "i": element.id,
322
+ "n": element.name,
323
+ "y": element.getBoundingClientRect().top + window.scrollY,
324
+ "x": element.getBoundingClientRect().left + window.scrollX,
325
+ "w": element.getBoundingClientRect().width,
326
+ "h": element.getBoundingClientRect().height
327
+ };
328
+ inputArr.push(data);
329
+ }
330
+ cordova.exec(success, error, "AppICEPlugin", "trackScreens", [{ "old": e.oldURL, "new": e.newURL, "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
331
+ };
332
+
333
+ module.exports = new AppICE();
287
334
 
288
- module.exports = new AppICE();
289
335
 
336
+ });