cordova-plugin-appice 2.0.2 → 2.0.4

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,279 +1,284 @@
1
- cordova.define("cordova-plugin-appice.AppICE", function(require, exports, module) {
2
-
3
- // Copyright (C) 2015 AppICE
4
- //
5
- // This code is provided under a commercial License.
6
- // A copy of this license has been distributed in a file called LICENSE
7
- // with this source code.
8
- var AppICE = function () {
9
- }
10
-
11
- AppICE.prototype.validateIntegration = function(success, error) {
12
- cordova.exec(success, error, "AppICEPlugin", "validateIntegration", []);
13
- };
14
-
15
- AppICE.prototype.startContext = function(gcmID, success, error) {
16
- cordova.exec(success, error, "AppICEPlugin", "startContext", [{"gcmID":gcmID}]);
17
-
18
- var inputArr = [];
19
- var inputs = document.getElementsByTagName('input');
20
- for (var index = 0; index < inputs.length; ++index) {
21
- var element = inputs[index];
22
- var data = {
23
- "t":element.tagName,
24
- "i":element.id,
25
- "n":element.name,
26
- "y":element.getBoundingClientRect().top + window.scrollY,
27
- "x":element.getBoundingClientRect().left + window.scrollX,
28
- "w":element.getBoundingClientRect().width,
29
- "h":element.getBoundingClientRect().height
30
- };
31
- inputArr.push(data);
32
- }
33
-
34
- cordova.exec(success, error, "AppICEPlugin", "trackScreens",
35
- [{"old":"", "new":"", "loc":location.hash, "h":document.documentElement.clientHeight, "w":document.documentElement.clientWidth, "arr":inputArr}]);
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
- }
54
-
55
- cordova.exec(success, error, "AppICEPlugin", "trackScreens", [{"old":"", "new":"", "loc":location.hash, "h":document.documentElement.clientHeight, "w":document.documentElement.clientWidth, "arr":inputArr}]);
56
- };
57
-
58
- AppICE.prototype.stopContext = function(success, error) {
59
- cordova.exec(success, error, "AppICEPlugin", "stopContext", []);
60
- };
61
-
62
- AppICE.prototype.isSemusiSensing = function(success, error) {
63
- cordova.exec(success, error, "AppICEPlugin", "isSemusiSensing", []);
64
- };
65
-
66
- AppICE.prototype.setAsTestDevice = function(success, error) {
67
- cordova.exec(success, error, "AppICEPlugin", "setAsTestDevice", []);
68
- };
69
-
70
- AppICE.prototype.removeAsTestDevice = function(success, error) {
71
- cordova.exec(success, error, "AppICEPlugin", "removeAsTestDevice", []);
72
- };
73
-
74
- AppICE.prototype.getIsTestDevice = function(success, error) {
75
- cordova.exec(success, error, "AppICEPlugin", "getIsTestDevice", []);
76
- };
77
-
78
- AppICE.prototype.openPlayServiceUpdate = function(success, error) {
79
- cordova.exec(success, error, "AppICEPlugin", "openPlayServiceUpdate", []);
80
- };
81
-
82
- AppICE.prototype.getSdkVersion = function(success, error) {
83
- cordova.exec(success, error, "AppICEPlugin", "getSdkVersion", []);
84
- };
85
-
86
- AppICE.prototype.getSdkIntVersion = function(success, error) {
87
- cordova.exec(success, error, "AppICEPlugin", "getSdkIntVersion", []);
88
- };
89
-
90
- AppICE.prototype.setDeviceId = function(deviceID, success, error) {
91
- cordova.exec(success, error, "AppICEPlugin", "setDeviceId", [{"deviceID":deviceID}]);
92
- };
93
-
94
- AppICE.prototype.getDeviceId = function(success, error) {
95
- cordova.exec(success, error, "AppICEPlugin", "getDeviceId", []);
96
- };
97
-
98
- AppICE.prototype.getAndroidId = function(success, error) {
99
- cordova.exec(success, error, "AppICEPlugin", "getAndroidId", []);
100
- };
101
-
102
- AppICE.prototype.getAppKey = function(success, error) {
103
- cordova.exec(success, error, "AppICEPlugin", "getAppKey", []);
104
- }
105
-
106
- AppICE.prototype.getApiKey = function(success, error) {
107
- cordova.exec(success, error, "AppICEPlugin", "getApiKey", []);
108
- }
109
-
110
- AppICE.prototype.getAppId = function(success, error) {
111
- cordova.exec(success, error, "AppICEPlugin", "getAppId", []);
112
- }
113
-
114
- AppICE.prototype.getCurrentContext = function(success, error) {
115
- cordova.exec(success, error, "AppICEPlugin", "getCurrentContext", []);
116
- }
117
-
118
- AppICE.prototype.setAlias = function(alias, success, error) {
119
- cordova.exec(success, error, "AppICEPlugin", "setAlias", [{"alias":alias}]);
120
- };
121
-
122
- AppICE.prototype.getAlias = function(success, error) {
123
- cordova.exec(success, error, "AppICEPlugin", "getAlias", []);
124
- };
125
-
126
- AppICE.prototype.setUser = function(name, phone, email, success, error) {
127
- cordova.exec(success, error, "AppICEPlugin", "setUser", [{"name":name, "phone":phone, "email":email}]);
128
- };
129
-
130
- AppICE.prototype.getUser = function(success, error) {
131
- cordova.exec(success, error, "AppICEPlugin", "getUser", []);
132
- };
133
-
134
- AppICE.prototype.setChildId = function(childID, success, error) {
135
- cordova.exec(success, error, "AppICEPlugin", "setChildId", [{"childID":childID}]);
136
- };
137
-
138
- AppICE.prototype.getChildId = function(success, error) {
139
- cordova.exec(success, error, "AppICEPlugin", "getChildId", []);
140
- };
141
-
142
- AppICE.prototype.setReferrer = function(referrer, success, error) {
143
- cordova.exec(success, error, "AppICEPlugin", "setReferrer", [{"referrer":referrer}]);
144
- };
145
-
146
- AppICE.prototype.getReferrer = function(success, error) {
147
- cordova.exec(success, error, "AppICEPlugin", "getReferrer", []);
148
- };
149
-
150
- AppICE.prototype.setInstallReferrer = function(installRef, success, error) {
151
- cordova.exec(success, error, "AppICEPlugin", "setInstallReferrer", [{"installRef":installRef}]);
152
- };
153
-
154
- AppICE.prototype.getInstallReferrer = function(success, error) {
155
- cordova.exec(success, error, "AppICEPlugin", "getInstallReferrer", []);
156
- };
157
-
158
- AppICE.prototype.setInstaller = function(installer, success, error) {
159
- cordova.exec(success, error, "AppICEPlugin", "setInstaller", [{"installer":installer}]);
160
- };
161
-
162
- AppICE.prototype.getInstaller = function(success, error) {
163
- cordova.exec(success, error, "AppICEPlugin", "getInstaller", []);
164
- };
165
-
166
- AppICE.prototype.getGCMSenderId = function(success, error) {
167
- cordova.exec(success, error, "AppICEPlugin", "getGCMSenderId", []);
168
- };
169
-
170
- AppICE.prototype.getDeviceToken = function(success, error) {
171
- cordova.exec(success, error, "AppICEPlugin", "getDeviceToken", []);
172
- };
173
-
174
- AppICE.prototype.setCustomVariable = function(key, value, success, error) {
175
- cordova.exec(success, error, "AppICEPlugin", "setCustomVariable", [{"key":key, "value":value}]);
176
- };
177
-
178
- AppICE.prototype.getCustomVariable = function(key, success, error) {
179
- cordova.exec(success, error, "AppICEPlugin", "getCustomVariable", [{"key":key}]);
180
- };
181
-
182
- AppICE.prototype.removeCustomVariable = function(key, success, error) {
183
- cordova.exec(success, error, "AppICEPlugin", "removeCustomVariable", [{"key":key}]);
184
- };
185
-
186
- AppICE.prototype.tagEvent = function(key, data, success, error) {
187
- cordova.exec(success, error, "AppICEPlugin", "tagEvent", [{"key":key, "data":data}]);
188
- };
189
-
190
- AppICE.prototype.setSmallIcon = function(icon, success, error) {
191
- cordova.exec(success, error, "AppICEPlugin", "setSmallIcon", [{"icon":icon}]);
192
- };
193
-
194
- AppICE.prototype.setSessionTimeout = function(timeout, success, error) {
195
- cordova.exec(success, error, "AppICEPlugin", "setSessionTimeout", [{"timeout":timeout}]);
196
- };
197
-
198
- AppICE.prototype.getSessionTimeout = function(success, error) {
199
- cordova.exec(success, error, "AppICEPlugin", "getSessionTimeout", []);
200
- };
201
-
202
- AppICE.prototype.onNotificationOpen = function(success, error) {
203
- cordova.exec(success, error, "AppICEPlugin", "onNotificationOpen", []);
204
- };
205
-
206
- AppICE.prototype.trackTouchS = function(e, success, error) {
207
- var touchobj = e.changedTouches[0]
208
- swipedir = 'none'
209
- dist = 0
210
- startX = touchobj.pageX
211
- startY = touchobj.pageY
212
- startTime = new Date().getTime()
213
- };
214
-
215
- AppICE.prototype.trackTouchE = function(e, success, error) {
216
- var touchobj = e.changedTouches[0]
217
- distX = touchobj.pageX - startX
218
- distY = touchobj.pageY - startY
219
- elapsedTime = new Date().getTime() - startTime
220
- if (elapsedTime <= 1500) {
221
- if (Math.abs(distX) >= 150 && Math.abs(distY) <= 250) {
222
- swipedir = (distX < 0)? 'left' : 'right'
223
- }
224
- else if (Math.abs(distY) >= 150 && Math.abs(distX) <= 250) {
225
- swipedir = (distY < 0)? 'up' : 'down'
226
- }
227
- }
228
-
229
- // console.log('swipe : ' + swipedir + ' , distX: ' + distX + ' , distY: ' + distY);
230
-
231
- var inputArr = [];
232
- var inputs = document.getElementsByTagName('input');
233
- for (var index = 0; index < inputs.length; ++index) {
234
- var element = inputs[index];
235
- var data = {
236
- "t":element.tagName,
237
- "i":element.id,
238
- "n":element.name,
239
- "y":element.getBoundingClientRect().top + window.scrollY,
240
- "x":element.getBoundingClientRect().left + window.scrollX,
241
- "w":element.getBoundingClientRect().width,
242
- "h":element.getBoundingClientRect().height
243
- };
244
- inputArr.push(data);
245
- }
246
-
247
- if (swipedir == 'none') {
248
- var t = e.target;
249
- 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}]);
250
- }
251
- else {
252
- 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}]);
253
- }
254
- };
255
-
256
- AppICE.prototype.trackScreens = function(e, success, error) {
257
- var inputArr = [];
258
- var inputs = document.getElementsByTagName('input');
259
- for (var index = 0; index < inputs.length; ++index) {
260
- var element = inputs[index];
261
- var data = {
262
- "t":element.tagName,
263
- "i":element.id,
264
- "n":element.name,
265
- "y":element.getBoundingClientRect().top + window.scrollY,
266
- "x":element.getBoundingClientRect().left + window.scrollX,
267
- "w":element.getBoundingClientRect().width,
268
- "h":element.getBoundingClientRect().height
269
- };
270
- inputArr.push(data);
271
- }
272
-
273
- 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}]);
274
- };
275
-
276
- module.exports = new AppICE();
277
-
278
- });
1
+ cordova.define("cordova-plugin-appice.AppICE", function(require, exports, module) {
2
+
3
+ // Copyright (C) 2015 AppICE
4
+ //
5
+ // This code is provided under a commercial License.
6
+ // A copy of this license has been distributed in a file called LICENSE
7
+ // with this source code.
8
+ var AppICE = function () {
9
+ }
10
+
11
+ AppICE.prototype.validateIntegration = function(success, error) {
12
+ cordova.exec(success, error, "AppICEPlugin", "validateIntegration", []);
13
+ };
14
+
15
+ AppICE.prototype.startContext = function(gcmID, success, error) {
16
+ cordova.exec(success, error, "AppICEPlugin", "startContext", [{"gcmID":gcmID}]);
17
+
18
+ var inputArr = [];
19
+ var inputs = document.getElementsByTagName('input');
20
+ for (var index = 0; index < inputs.length; ++index) {
21
+ var element = inputs[index];
22
+ var data = {
23
+ "t":element.tagName,
24
+ "i":element.id,
25
+ "n":element.name,
26
+ "y":element.getBoundingClientRect().top + window.scrollY,
27
+ "x":element.getBoundingClientRect().left + window.scrollX,
28
+ "w":element.getBoundingClientRect().width,
29
+ "h":element.getBoundingClientRect().height
30
+ };
31
+ inputArr.push(data);
32
+ }
33
+
34
+ cordova.exec(success, error, "AppICEPlugin", "trackScreens",
35
+ [{"old":"", "new":"", "loc":location.hash, "h":document.documentElement.clientHeight, "w":document.documentElement.clientWidth, "arr":inputArr}]);
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
+ }
54
+
55
+ cordova.exec(success, error, "AppICEPlugin", "trackScreens", [{"old":"", "new":"", "loc":location.hash, "h":document.documentElement.clientHeight, "w":document.documentElement.clientWidth, "arr":inputArr}]);
56
+ };
57
+
58
+ AppICE.prototype.stopContext = function(success, error) {
59
+ cordova.exec(success, error, "AppICEPlugin", "stopContext", []);
60
+ };
61
+
62
+ AppICE.prototype.isSemusiSensing = function(success, error) {
63
+ cordova.exec(success, error, "AppICEPlugin", "isSemusiSensing", []);
64
+ };
65
+
66
+ AppICE.prototype.setAsTestDevice = function(success, error) {
67
+ cordova.exec(success, error, "AppICEPlugin", "setAsTestDevice", []);
68
+ };
69
+
70
+ AppICE.prototype.removeAsTestDevice = function(success, error) {
71
+ cordova.exec(success, error, "AppICEPlugin", "removeAsTestDevice", []);
72
+ };
73
+
74
+ AppICE.prototype.getIsTestDevice = function(success, error) {
75
+ cordova.exec(success, error, "AppICEPlugin", "getIsTestDevice", []);
76
+ };
77
+
78
+ AppICE.prototype.openPlayServiceUpdate = function(success, error) {
79
+ cordova.exec(success, error, "AppICEPlugin", "openPlayServiceUpdate", []);
80
+ };
81
+
82
+ AppICE.prototype.getSdkVersion = function(success, error) {
83
+ cordova.exec(success, error, "AppICEPlugin", "getSdkVersion", []);
84
+ };
85
+
86
+ AppICE.prototype.getSdkIntVersion = function(success, error) {
87
+ cordova.exec(success, error, "AppICEPlugin", "getSdkIntVersion", []);
88
+ };
89
+
90
+ AppICE.prototype.setDeviceId = function(deviceID, success, error) {
91
+ cordova.exec(success, error, "AppICEPlugin", "setDeviceId", [{"deviceID":deviceID}]);
92
+ };
93
+
94
+ AppICE.prototype.getDeviceId = function(success, error) {
95
+ cordova.exec(success, error, "AppICEPlugin", "getDeviceId", []);
96
+ };
97
+
98
+ AppICE.prototype.getAndroidId = function(success, error) {
99
+ cordova.exec(success, error, "AppICEPlugin", "getAndroidId", []);
100
+ };
101
+
102
+ AppICE.prototype.getAppKey = function(success, error) {
103
+ cordova.exec(success, error, "AppICEPlugin", "getAppKey", []);
104
+ }
105
+
106
+ AppICE.prototype.getApiKey = function(success, error) {
107
+ cordova.exec(success, error, "AppICEPlugin", "getApiKey", []);
108
+ }
109
+
110
+ AppICE.prototype.getAppId = function(success, error) {
111
+ cordova.exec(success, error, "AppICEPlugin", "getAppId", []);
112
+ }
113
+
114
+ AppICE.prototype.getCurrentContext = function(success, error) {
115
+ cordova.exec(success, error, "AppICEPlugin", "getCurrentContext", []);
116
+ }
117
+
118
+ AppICE.prototype.setAlias = function(alias, success, error) {
119
+ cordova.exec(success, error, "AppICEPlugin", "setAlias", [{"alias":alias}]);
120
+ };
121
+
122
+ AppICE.prototype.getAlias = function(success, error) {
123
+ cordova.exec(success, error, "AppICEPlugin", "getAlias", []);
124
+ };
125
+
126
+ AppICE.prototype.setUser = function(name, phone, email, success, error) {
127
+ cordova.exec(success, error, "AppICEPlugin", "setUser", [{"name":name, "phone":phone, "email":email}]);
128
+ };
129
+
130
+ AppICE.prototype.getUser = function(success, error) {
131
+ cordova.exec(success, error, "AppICEPlugin", "getUser", []);
132
+ };
133
+
134
+ AppICE.prototype.setChildId = function(childID, success, error) {
135
+ cordova.exec(success, error, "AppICEPlugin", "setChildId", [{"childID":childID}]);
136
+ };
137
+
138
+ AppICE.prototype.getChildId = function(success, error) {
139
+ cordova.exec(success, error, "AppICEPlugin", "getChildId", []);
140
+ };
141
+
142
+ AppICE.prototype.setReferrer = function(referrer, success, error) {
143
+ cordova.exec(success, error, "AppICEPlugin", "setReferrer", [{"referrer":referrer}]);
144
+ };
145
+
146
+ AppICE.prototype.getReferrer = function(success, error) {
147
+ cordova.exec(success, error, "AppICEPlugin", "getReferrer", []);
148
+ };
149
+
150
+ AppICE.prototype.setInstallReferrer = function(installRef, success, error) {
151
+ cordova.exec(success, error, "AppICEPlugin", "setInstallReferrer", [{"installRef":installRef}]);
152
+ };
153
+
154
+ AppICE.prototype.getInstallReferrer = function(success, error) {
155
+ cordova.exec(success, error, "AppICEPlugin", "getInstallReferrer", []);
156
+ };
157
+
158
+ AppICE.prototype.setInstaller = function(installer, success, error) {
159
+ cordova.exec(success, error, "AppICEPlugin", "setInstaller", [{"installer":installer}]);
160
+ };
161
+
162
+ AppICE.prototype.getInstaller = function(success, error) {
163
+ cordova.exec(success, error, "AppICEPlugin", "getInstaller", []);
164
+ };
165
+
166
+ AppICE.prototype.getGCMSenderId = function(success, error) {
167
+ cordova.exec(success, error, "AppICEPlugin", "getGCMSenderId", []);
168
+ };
169
+
170
+ AppICE.prototype.getDeviceToken = function(success, error) {
171
+ cordova.exec(success, error, "AppICEPlugin", "getDeviceToken", []);
172
+ };
173
+
174
+ AppICE.prototype.setCustomVariable = function(key, value, success, error) {
175
+ cordova.exec(success, error, "AppICEPlugin", "setCustomVariable", [{"key":key, "value":value}]);
176
+ };
177
+
178
+ AppICE.prototype.getCustomVariable = function(key, success, error) {
179
+ cordova.exec(success, error, "AppICEPlugin", "getCustomVariable", [{"key":key}]);
180
+ };
181
+
182
+ AppICE.prototype.removeCustomVariable = function(key, success, error) {
183
+ cordova.exec(success, error, "AppICEPlugin", "removeCustomVariable", [{"key":key}]);
184
+ };
185
+
186
+ AppICE.prototype.tagEvent = function(key, data, success, error) {
187
+ cordova.exec(success, error, "AppICEPlugin", "tagEvent", [{"key":key, "data":data}]);
188
+ };
189
+
190
+ AppICE.prototype.setSmallIcon = function(icon, success, error) {
191
+ cordova.exec(success, error, "AppICEPlugin", "setSmallIcon", [{"icon":icon}]);
192
+ };
193
+
194
+ AppICE.prototype.setSessionTimeout = function(timeout, success, error) {
195
+ cordova.exec(success, error, "AppICEPlugin", "setSessionTimeout", [{"timeout":timeout}]);
196
+ };
197
+
198
+ AppICE.prototype.getSessionTimeout = function(success, error) {
199
+ cordova.exec(success, error, "AppICEPlugin", "getSessionTimeout", []);
200
+ };
201
+
202
+ AppICE.prototype.onNotificationOpen = function(success, error) {
203
+ cordova.exec(success, error, "AppICEPlugin", "onNotificationOpen", []);
204
+ };
205
+
206
+ AppICE.prototype.setUserId = function(userID, success, error) {
207
+ cordova.exec(success, error, "AppICEPlugin", "setUserId", [{"userID":userID}]);
208
+ };
209
+
210
+
211
+ AppICE.prototype.trackTouchS = function(e, success, error) {
212
+ var touchobj = e.changedTouches[0]
213
+ swipedir = 'none'
214
+ dist = 0
215
+ startX = touchobj.pageX
216
+ startY = touchobj.pageY
217
+ startTime = new Date().getTime()
218
+ };
219
+
220
+ AppICE.prototype.trackTouchE = function(e, success, error) {
221
+ var touchobj = e.changedTouches[0]
222
+ distX = touchobj.pageX - startX
223
+ distY = touchobj.pageY - startY
224
+ elapsedTime = new Date().getTime() - startTime
225
+ if (elapsedTime <= 1500) {
226
+ if (Math.abs(distX) >= 150 && Math.abs(distY) <= 250) {
227
+ swipedir = (distX < 0)? 'left' : 'right'
228
+ }
229
+ else if (Math.abs(distY) >= 150 && Math.abs(distX) <= 250) {
230
+ swipedir = (distY < 0)? 'up' : 'down'
231
+ }
232
+ }
233
+
234
+ // console.log('swipe : ' + swipedir + ' , distX: ' + distX + ' , distY: ' + distY);
235
+
236
+ var inputArr = [];
237
+ var inputs = document.getElementsByTagName('input');
238
+ for (var index = 0; index < inputs.length; ++index) {
239
+ var element = inputs[index];
240
+ var data = {
241
+ "t":element.tagName,
242
+ "i":element.id,
243
+ "n":element.name,
244
+ "y":element.getBoundingClientRect().top + window.scrollY,
245
+ "x":element.getBoundingClientRect().left + window.scrollX,
246
+ "w":element.getBoundingClientRect().width,
247
+ "h":element.getBoundingClientRect().height
248
+ };
249
+ inputArr.push(data);
250
+ }
251
+
252
+ if (swipedir == 'none') {
253
+ var t = e.target;
254
+ 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}]);
255
+ }
256
+ else {
257
+ 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}]);
258
+ }
259
+ };
260
+
261
+ AppICE.prototype.trackScreens = function(e, success, error) {
262
+ var inputArr = [];
263
+ var inputs = document.getElementsByTagName('input');
264
+ for (var index = 0; index < inputs.length; ++index) {
265
+ var element = inputs[index];
266
+ var data = {
267
+ "t":element.tagName,
268
+ "i":element.id,
269
+ "n":element.name,
270
+ "y":element.getBoundingClientRect().top + window.scrollY,
271
+ "x":element.getBoundingClientRect().left + window.scrollX,
272
+ "w":element.getBoundingClientRect().width,
273
+ "h":element.getBoundingClientRect().height
274
+ };
275
+ inputArr.push(data);
276
+ }
277
+
278
+ 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}]);
279
+ };
280
+
281
+ module.exports = new AppICE();
282
+
283
+ });
279
284