targetj 1.0.39 → 1.0.41
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/package.json +1 -1
- package/src/App.js +6 -6
- package/src/Browser.js +0 -74
- package/src/TModel.js +2 -1
- package/webpack.config.js +5 -3
- package/.jshintrc +0 -4
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -40,8 +40,8 @@ function AppFn(uiFactory, rootId) {
|
|
|
40
40
|
|
|
41
41
|
my.dim = Dim().measureScreen();
|
|
42
42
|
|
|
43
|
-
my.uiFactory = uiFactory;
|
|
44
|
-
my.ui = uiFactory();
|
|
43
|
+
my.uiFactory = uiFactory instanceof TModel ? function() { return new TModel(uiFactory.type, uiFactory.targets); } : uiFactory;
|
|
44
|
+
my.ui = my.uiFactory();
|
|
45
45
|
my.ui.xVisible = true;
|
|
46
46
|
my.ui.yVisible = true;
|
|
47
47
|
|
|
@@ -128,8 +128,8 @@ function AppFn(uiFactory, rootId) {
|
|
|
128
128
|
return my;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
function App(
|
|
132
|
-
tapp = AppFn(
|
|
131
|
+
function App(ui, rootId) {
|
|
132
|
+
tapp = AppFn(ui, rootId);
|
|
133
133
|
tapp.init().start();
|
|
134
134
|
|
|
135
135
|
return tapp;
|
|
@@ -149,11 +149,11 @@ function getLoader() {
|
|
|
149
149
|
|
|
150
150
|
function getScreenWidth() {
|
|
151
151
|
return tapp ? tapp.dim.screen.width : 0;
|
|
152
|
-
}
|
|
152
|
+
}
|
|
153
153
|
|
|
154
154
|
function getScreenHeight() {
|
|
155
155
|
return tapp ? tapp.dim.screen.height : 0;
|
|
156
|
-
}
|
|
156
|
+
}
|
|
157
157
|
|
|
158
158
|
window.t = window.t || SearchUtil.find;
|
|
159
159
|
|
package/src/Browser.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
var browser = {
|
|
2
2
|
style: undefined,
|
|
3
|
-
localStorage: null,
|
|
4
|
-
startTimes: [],
|
|
5
|
-
callCount: {},
|
|
6
3
|
delayProcess: {},
|
|
7
4
|
setup: function () {
|
|
8
5
|
|
|
@@ -156,19 +153,6 @@ var browser = {
|
|
|
156
153
|
return function() {};
|
|
157
154
|
}
|
|
158
155
|
},
|
|
159
|
-
getLocalStorage: function () {
|
|
160
|
-
if (this.localStorage === null) {
|
|
161
|
-
try {
|
|
162
|
-
this.localStorage = window.localStorage; // This will throw an exception in some browsers when cookies/localStorage are explicitly disabled (i.e. Chrome)
|
|
163
|
-
this.localStorage.setItem('TEST', '1');
|
|
164
|
-
this.localStorage.removeItem('TEST');
|
|
165
|
-
} catch (e) {
|
|
166
|
-
this.localStorage = false;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return this.localStorage;
|
|
171
|
-
},
|
|
172
156
|
prefixStyle: function (style) {
|
|
173
157
|
var elementStyle = document.createElement('div').style;
|
|
174
158
|
|
|
@@ -199,64 +183,6 @@ var browser = {
|
|
|
199
183
|
nowInSeconds: function () {
|
|
200
184
|
return Math.floor(this.now() / 1000);
|
|
201
185
|
},
|
|
202
|
-
time: function (s) {
|
|
203
|
-
this.startTimes.push({label: s, time: this.now()});
|
|
204
|
-
},
|
|
205
|
-
timeEnd: function (minTime) {
|
|
206
|
-
minTime = minTime || 0;
|
|
207
|
-
var total = 0, diff;
|
|
208
|
-
var key, out = [];
|
|
209
|
-
browser.time("#end#");
|
|
210
|
-
for (var i = 1; i < this.startTimes.length; i++) {
|
|
211
|
-
|
|
212
|
-
diff = (this.startTimes[i].time - this.startTimes[i - 1].time);
|
|
213
|
-
total += diff;
|
|
214
|
-
|
|
215
|
-
if (diff >= minTime) {
|
|
216
|
-
out.push(this.startTimes[i - 1].label + " = " + diff);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
for (key in this.callCount) {
|
|
221
|
-
out.push("count: " + key + " = " + this.callCount[key]);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
console.log(out);
|
|
225
|
-
|
|
226
|
-
this.startTimes.length = 0;
|
|
227
|
-
this.callCount = {};
|
|
228
|
-
|
|
229
|
-
return out;
|
|
230
|
-
},
|
|
231
|
-
createCookie: function (name, value, days) {
|
|
232
|
-
if (!name) return;
|
|
233
|
-
|
|
234
|
-
var expires;
|
|
235
|
-
|
|
236
|
-
if (days) {
|
|
237
|
-
var date = new Date();
|
|
238
|
-
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
|
239
|
-
expires = "; expires=" + date.toGMTString();
|
|
240
|
-
} else {
|
|
241
|
-
expires = "";
|
|
242
|
-
}
|
|
243
|
-
document.cookie = escape(name) + "=" + escape(value) + expires + "; path=/";
|
|
244
|
-
},
|
|
245
|
-
readCookie: function (name) {
|
|
246
|
-
var nameEQ = escape(name) + "=";
|
|
247
|
-
var ca = document.cookie.split(';');
|
|
248
|
-
for (var i = 0; i < ca.length; i++) {
|
|
249
|
-
var c = ca[i];
|
|
250
|
-
while (c.charAt(0) === ' ')
|
|
251
|
-
c = c.substring(1, c.length);
|
|
252
|
-
if (c.indexOf(nameEQ) === 0)
|
|
253
|
-
return unescape(c.substring(nameEQ.length, c.length));
|
|
254
|
-
}
|
|
255
|
-
return null;
|
|
256
|
-
},
|
|
257
|
-
eraseCookie: function (name) {
|
|
258
|
-
browser.createCookie(name, "", -1);
|
|
259
|
-
},
|
|
260
186
|
delay: function (fn, oid, delay) {
|
|
261
187
|
var timeStamp = browser.now() + delay;
|
|
262
188
|
|
package/src/TModel.js
CHANGED
|
@@ -19,7 +19,7 @@ function TModel(type, targets) {
|
|
|
19
19
|
this.oidNum = uniqueId.num;
|
|
20
20
|
|
|
21
21
|
this.targetValues = {};
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
this.actualValues = {
|
|
24
24
|
x: 0,
|
|
25
25
|
y: 0,
|
|
@@ -50,6 +50,7 @@ function TModel(type, targets) {
|
|
|
50
50
|
canBeBracketed: true,
|
|
51
51
|
isDomDeletable: true
|
|
52
52
|
};
|
|
53
|
+
|
|
53
54
|
this.activeTargetKeyMap = {};
|
|
54
55
|
|
|
55
56
|
this.targetUpdatingMap = {};
|
package/webpack.config.js
CHANGED
package/.jshintrc
DELETED