uil 1.0.1 → 4.0.0
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/README.md +57 -0
- package/build/uil.js +7040 -4199
- package/build/uil.min.js +6 -4
- package/build/uil.module.js +7200 -2761
- package/examples/js/BufferGeometryUtils.js +921 -0
- package/examples/js/SimplexNoise.js +324 -0
- package/examples/js/controls/OrbitControls.js +1215 -0
- package/examples/js/controls/OrbitControls_.js +1042 -0
- package/examples/js/libs/sea3d.min.js +373 -0
- package/examples/js/libs/three.min.js +6 -0
- package/examples/js/math.js +447 -0
- package/examples/js/objects/Landscape.js +778 -0
- package/examples/js/objects/Lensflare.js +372 -0
- package/examples/js/objects/SuperSky.js +297 -0
- package/examples/js/objects/Water.js +329 -0
- package/package.json +56 -54
- package/src/Uil.js +2 -17
- package/src/Uil_dev.js +15 -0
- package/src/core/Gui.js +601 -299
- package/src/core/Proto.js +490 -220
- package/src/core/Roots.js +864 -0
- package/src/core/Tools.js +591 -140
- package/src/core/V2.js +131 -0
- package/src/core/add.js +52 -57
- package/src/proto/Bool.js +117 -52
- package/src/proto/Button.js +286 -146
- package/src/proto/Circular.js +162 -130
- package/src/proto/Color.js +331 -289
- package/src/proto/Empty.js +15 -0
- package/src/proto/Fps.js +232 -159
- package/src/proto/Graph.js +310 -0
- package/src/proto/Grid.js +297 -0
- package/src/proto/Group.js +334 -160
- package/src/proto/Item.js +120 -0
- package/src/proto/Joystick.js +159 -185
- package/src/proto/Knob.js +210 -91
- package/src/proto/List.js +661 -249
- package/src/proto/Numeric.js +329 -162
- package/src/proto/Pad2D.js +268 -0
- package/src/proto/Rubric.js +0 -0
- package/src/proto/Select.js +178 -0
- package/src/proto/Selector.js +13 -0
- package/src/proto/Slide.js +191 -185
- package/src/proto/TextInput.js +149 -59
- package/src/proto/Title.js +40 -31
package/src/proto/Numeric.js
CHANGED
|
@@ -1,250 +1,417 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Proto } from '../core/Proto.js';
|
|
2
|
+
import { Tools } from '../core/Tools.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export class Numeric extends Proto {
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
constructor( o = {} ) {
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
super( o );
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
this.setTypeNumber( o );
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
this.isDrag = o.drag === undefined ? true : o.drag;
|
|
12
|
+
this.allway = o.allway || false;
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
this.toRad = 1;
|
|
17
|
-
this.isNumber = true;
|
|
18
|
-
this.isAngle = false;
|
|
19
|
-
this.isVector = false;
|
|
14
|
+
this.isDown = false;
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
this.value = [0];
|
|
17
|
+
this.multy = 1;
|
|
18
|
+
this.invmulty = 1;
|
|
19
|
+
this.isSingle = true;
|
|
20
|
+
this.isAngle = false;
|
|
21
|
+
this.isVector = false;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.value = [];
|
|
28
|
-
if(o.value.x) this.value[0] = o.value.x;
|
|
29
|
-
if(o.value.y) this.value[1] = o.value.y;
|
|
30
|
-
if(o.value.z) this.value[2] = o.value.z;
|
|
31
|
-
if(o.value.w) this.value[3] = o.value.w;
|
|
32
|
-
this.isVector = true;
|
|
23
|
+
if( o.isAngle ){
|
|
24
|
+
this.isAngle = true;
|
|
25
|
+
this.multy = Tools.torad;
|
|
26
|
+
this.invmulty = Tools.todeg;
|
|
33
27
|
}
|
|
34
|
-
}
|
|
35
28
|
|
|
36
|
-
|
|
29
|
+
this.isDrag = o.drag || false;
|
|
30
|
+
|
|
31
|
+
if( o.value !== undefined ){
|
|
32
|
+
if(!isNaN(o.value)){
|
|
33
|
+
this.value = [o.value];
|
|
34
|
+
} else if( o.value instanceof Array ){
|
|
35
|
+
this.value = o.value;
|
|
36
|
+
this.isSingle = false;
|
|
37
|
+
} else if( o.value instanceof Object ){
|
|
38
|
+
this.value = [];
|
|
39
|
+
if( o.value.x !== undefined ) this.value[0] = o.value.x;
|
|
40
|
+
if( o.value.y !== undefined ) this.value[1] = o.value.y;
|
|
41
|
+
if( o.value.z !== undefined ) this.value[2] = o.value.z;
|
|
42
|
+
if( o.value.w !== undefined ) this.value[3] = o.value.w;
|
|
43
|
+
this.isVector = true;
|
|
44
|
+
this.isSingle = false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
this.lng = this.value.length;
|
|
49
|
+
this.tmp = [];
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
this.current = -1;
|
|
54
|
+
this.prev = { x:0, y:0, d:0, v:0 };
|
|
55
|
+
|
|
56
|
+
let cc = this.colors
|
|
57
|
+
|
|
58
|
+
// bg
|
|
59
|
+
this.c[2] = this.dom( 'div', this.css.basic + ' background:' + cc.select + '; top:4px; width:0px; height:' + (this.h-8) + 'px;' );
|
|
60
|
+
|
|
61
|
+
this.cMode = [];
|
|
62
|
+
|
|
63
|
+
let i = this.lng;
|
|
64
|
+
while(i--){
|
|
65
|
+
|
|
66
|
+
if(this.isAngle) this.value[i] = (this.value[i] * 180 / Math.PI).toFixed( this.precision );
|
|
67
|
+
this.c[3+i] = this.dom( 'div', this.css.txtselect + ' height:'+(this.h-4)+'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border+'; border-radius:'+this.radius+'px;');
|
|
68
|
+
if(o.center) this.c[2+i].style.textAlign = 'center';
|
|
69
|
+
this.c[3+i].textContent = this.value[i];
|
|
70
|
+
this.c[3+i].style.color = this.colors.text;
|
|
71
|
+
this.c[3+i].isNum = true;
|
|
72
|
+
|
|
73
|
+
this.cMode[i] = 0;
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// selection
|
|
78
|
+
this.selectId = 3 + this.lng;
|
|
79
|
+
this.c[this.selectId] = this.dom( 'div', this.css.txtselect + 'position:absolute; top:4px; height:' + (this.h-8) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;');
|
|
80
|
+
|
|
81
|
+
// cursor
|
|
82
|
+
this.cursorId = 4 + this.lng;
|
|
83
|
+
this.c[ this.cursorId ] = this.dom( 'div', this.css.basic + 'top:4px; height:' + (this.h-8) + 'px; width:0px; background:'+cc.text+';' );
|
|
37
84
|
|
|
38
|
-
|
|
39
|
-
this.isAngle = true;
|
|
40
|
-
this.toRad = Math.PI/180;
|
|
85
|
+
this.init();
|
|
41
86
|
}
|
|
42
87
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.c[2+i].events = [ 'keydown', 'keyup', 'mousedown', 'blur', 'focus' ]; //'click',
|
|
88
|
+
testZone ( e ) {
|
|
89
|
+
|
|
90
|
+
let l = this.local;
|
|
91
|
+
if( l.x === -1 && l.y === -1 ) return '';
|
|
92
|
+
|
|
93
|
+
let i = this.lng;
|
|
94
|
+
let t = this.tmp;
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
while( i-- ){
|
|
98
|
+
if( l.x>t[i][0] && l.x<t[i][2] ) return i;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return '';
|
|
58
102
|
|
|
59
103
|
}
|
|
60
104
|
|
|
61
|
-
|
|
62
|
-
}
|
|
105
|
+
/* mode: function ( n, name ) {
|
|
63
106
|
|
|
64
|
-
|
|
65
|
-
Numeric.prototype.constructor = Numeric;
|
|
107
|
+
if( n === this.cMode[name] ) return false;
|
|
66
108
|
|
|
67
|
-
|
|
109
|
+
//let m;
|
|
68
110
|
|
|
69
|
-
|
|
70
|
-
//e.stopPropagation();
|
|
111
|
+
/*switch(n){
|
|
71
112
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
case 'keydown': this.keydown( e ); break;
|
|
76
|
-
case 'keyup': this.keyup( e ); break;
|
|
113
|
+
case 0: m = this.colors.border; break;
|
|
114
|
+
case 1: m = this.colors.borderOver; break;
|
|
115
|
+
case 2: m = this.colors.borderSelect; break;
|
|
77
116
|
|
|
78
|
-
|
|
79
|
-
case 'focus': this.focus( e ); break;
|
|
117
|
+
}*/
|
|
80
118
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
119
|
+
/* this.reset();
|
|
120
|
+
//this.c[name+2].style.borderColor = m;
|
|
121
|
+
this.cMode[name] = n;
|
|
84
122
|
|
|
85
|
-
|
|
123
|
+
return true;
|
|
86
124
|
|
|
87
|
-
}
|
|
125
|
+
},*/
|
|
88
126
|
|
|
89
|
-
|
|
127
|
+
// ----------------------
|
|
128
|
+
// EVENTS
|
|
129
|
+
// ----------------------
|
|
90
130
|
|
|
91
|
-
|
|
92
|
-
this.value[n] = this.numValue( v );
|
|
93
|
-
this.c[2+n].textContent = this.value[n];
|
|
131
|
+
mousedown ( e ) {
|
|
94
132
|
|
|
95
|
-
|
|
133
|
+
let name = this.testZone( e );
|
|
96
134
|
|
|
97
|
-
|
|
135
|
+
if( !this.isDown ){
|
|
136
|
+
this.isDown = true;
|
|
137
|
+
if( name !== '' ){
|
|
138
|
+
this.current = name;
|
|
139
|
+
this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] ) };
|
|
140
|
+
this.setInput( this.c[ 3 + this.current ] );
|
|
141
|
+
}
|
|
142
|
+
return this.mousemove( e );
|
|
143
|
+
}
|
|
98
144
|
|
|
99
|
-
|
|
145
|
+
return false;
|
|
146
|
+
/*
|
|
147
|
+
|
|
148
|
+
if( name === '' ) return false;
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
this.current = name;
|
|
152
|
+
this.isDown = true;
|
|
153
|
+
|
|
154
|
+
this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] ) };
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
return this.mode( 2, name );*/
|
|
100
158
|
|
|
101
|
-
if( e.keyCode === 13 ){
|
|
102
|
-
e.preventDefault();
|
|
103
|
-
this.testValue( parseFloat(e.target.name) );
|
|
104
|
-
this.validate();
|
|
105
|
-
e.target.blur();
|
|
106
159
|
}
|
|
107
160
|
|
|
108
|
-
|
|
161
|
+
mouseup ( e ) {
|
|
109
162
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
163
|
+
if( this.isDown ){
|
|
164
|
+
|
|
165
|
+
this.isDown = false;
|
|
166
|
+
//this.current = -1;
|
|
167
|
+
this.prev = { x:0, y:0, d:0, v:0 };
|
|
168
|
+
|
|
169
|
+
return this.mousemove( e );
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return false;
|
|
173
|
+
|
|
174
|
+
/*let name = this.testZone( e );
|
|
175
|
+
this.isDown = false;
|
|
176
|
+
|
|
177
|
+
if( this.current !== -1 ){
|
|
178
|
+
|
|
179
|
+
//let tm = this.current;
|
|
180
|
+
let td = this.prev.d;
|
|
181
|
+
|
|
182
|
+
this.current = -1;
|
|
183
|
+
this.prev = { x:0, y:0, d:0, v:0 };
|
|
184
|
+
|
|
185
|
+
if( !td ){
|
|
186
|
+
|
|
187
|
+
this.setInput( this.c[ 3 + name ] );
|
|
188
|
+
return true;//this.mode( 2, name );
|
|
189
|
+
|
|
190
|
+
} else {
|
|
191
|
+
return this.reset();//this.mode( 0, tm );
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
}*/
|
|
113
195
|
|
|
114
|
-
if( this.allway ){
|
|
115
|
-
this.testValue( parseFloat(e.target.name) );
|
|
116
|
-
this.validate();
|
|
117
196
|
}
|
|
118
197
|
|
|
119
|
-
|
|
198
|
+
mousemove ( e ) {
|
|
120
199
|
|
|
121
|
-
|
|
200
|
+
let nup = false;
|
|
201
|
+
let x = 0;
|
|
122
202
|
|
|
123
|
-
|
|
124
|
-
e.target.style.borderColor = Tools.colors.border;
|
|
125
|
-
e.target.contentEditable = false;
|
|
126
|
-
//e.target.style.border = '1px solid rgba(255,255,255,0.1)';
|
|
127
|
-
if(this.isDrag) e.target.style.cursor = 'move';
|
|
128
|
-
else e.target.style.cursor = 'pointer';
|
|
203
|
+
let name = this.testZone( e );
|
|
129
204
|
|
|
130
|
-
|
|
205
|
+
if( name === '' ) this.cursor();
|
|
206
|
+
else{
|
|
207
|
+
if(!this.isDrag) this.cursor('text');
|
|
208
|
+
else this.cursor( this.current !== -1 ? 'move' : 'pointer' );
|
|
209
|
+
}
|
|
131
210
|
|
|
132
|
-
|
|
211
|
+
|
|
133
212
|
|
|
134
|
-
|
|
135
|
-
this.current = undefined;
|
|
136
|
-
e.target.style.borderColor = Tools.colors.borderSelect;
|
|
137
|
-
|
|
138
|
-
//e.target.style.border = '1px solid ' + UIL.BorderSelect;
|
|
139
|
-
if(this.isDrag) e.target.style.cursor = 'auto';
|
|
213
|
+
if( this.isDrag ){
|
|
140
214
|
|
|
141
|
-
|
|
215
|
+
if( this.current !== -1 ){
|
|
142
216
|
|
|
143
|
-
|
|
217
|
+
this.prev.d += ( e.clientX - this.prev.x ) - ( e.clientY - this.prev.y );
|
|
144
218
|
|
|
145
|
-
|
|
219
|
+
let n = this.prev.v + ( this.prev.d * this.step);
|
|
146
220
|
|
|
147
|
-
|
|
221
|
+
this.value[ this.current ] = this.numValue(n);
|
|
222
|
+
this.c[ 3 + this.current ].textContent = this.value[this.current];
|
|
148
223
|
|
|
149
|
-
|
|
224
|
+
this.validate();
|
|
150
225
|
|
|
151
|
-
|
|
152
|
-
|
|
226
|
+
this.prev.x = e.clientX;
|
|
227
|
+
this.prev.y = e.clientY;
|
|
153
228
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
else this.prev.v = parseFloat( this.value[this.current] );
|
|
229
|
+
nup = true;
|
|
230
|
+
}
|
|
157
231
|
|
|
232
|
+
} else {
|
|
158
233
|
|
|
234
|
+
if( this.isDown ) x = e.clientX - this.zone.x -3;
|
|
235
|
+
if( this.current !== -1 ) x -= this.tmp[this.current][0]
|
|
236
|
+
return this.upInput( x, this.isDown );
|
|
159
237
|
|
|
160
|
-
|
|
161
|
-
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
return nup;
|
|
244
|
+
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
//keydown: function ( e ) { return true; },
|
|
248
|
+
|
|
249
|
+
// ----------------------
|
|
250
|
+
|
|
251
|
+
reset () {
|
|
252
|
+
|
|
253
|
+
let nup = false;
|
|
254
|
+
//this.isDown = false;
|
|
255
|
+
|
|
256
|
+
//this.current = 0;
|
|
162
257
|
|
|
163
|
-
|
|
258
|
+
/* let i = this.lng;
|
|
259
|
+
while(i--){
|
|
260
|
+
if(this.cMode[i]!==0){
|
|
261
|
+
this.cMode[i] = 0;
|
|
262
|
+
//this.c[2+i].style.borderColor = this.colors.border;
|
|
263
|
+
nup = true;
|
|
264
|
+
}
|
|
265
|
+
}*/
|
|
164
266
|
|
|
165
|
-
|
|
267
|
+
return nup;
|
|
166
268
|
|
|
167
|
-
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
setValue ( v ) {
|
|
168
273
|
|
|
169
|
-
|
|
274
|
+
if( this.isVector ){
|
|
170
275
|
|
|
171
|
-
|
|
172
|
-
|
|
276
|
+
if( v.x !== undefined ) this.value[0] = v.x;
|
|
277
|
+
if( v.y !== undefined ) this.value[1] = v.y;
|
|
278
|
+
if( v.z !== undefined ) this.value[2] = v.z;
|
|
279
|
+
if( v.w !== undefined ) this.value[3] = v.w;
|
|
173
280
|
|
|
174
|
-
|
|
281
|
+
} else {
|
|
175
282
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
283
|
+
if( this.isSingle ) this.value = [v]
|
|
284
|
+
else this.value = v
|
|
285
|
+
|
|
179
286
|
}
|
|
180
287
|
|
|
181
|
-
|
|
288
|
+
this.update();
|
|
289
|
+
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
sameStr ( str ){
|
|
182
293
|
|
|
294
|
+
let i = this.value.length;
|
|
295
|
+
while(i--) this.c[ 3 + i ].textContent = str;
|
|
183
296
|
|
|
184
|
-
//this.c[2+this.current].style.cursor = 'move';
|
|
185
297
|
}
|
|
186
298
|
|
|
187
|
-
|
|
299
|
+
update ( up ) {
|
|
188
300
|
|
|
189
|
-
|
|
301
|
+
let i = this.value.length;
|
|
190
302
|
|
|
191
|
-
|
|
303
|
+
while(i--){
|
|
304
|
+
this.value[i] = this.numValue( this.value[i] * this.invmulty );
|
|
305
|
+
this.c[ 3 + i ].textContent = this.value[i];
|
|
306
|
+
}
|
|
192
307
|
|
|
193
|
-
|
|
308
|
+
if( up ) this.send();
|
|
194
309
|
|
|
195
|
-
|
|
310
|
+
}
|
|
196
311
|
|
|
197
|
-
|
|
198
|
-
var n = this.prev.v + ( this.prev.d * this.step);
|
|
312
|
+
send ( v ) {
|
|
199
313
|
|
|
200
|
-
|
|
201
|
-
//this.c[2+this.current].value = this.value[this.current];
|
|
314
|
+
v = v || this.value;
|
|
202
315
|
|
|
203
|
-
|
|
316
|
+
this.isSend = true;
|
|
204
317
|
|
|
205
|
-
|
|
318
|
+
if( this.objectLink !== null ){
|
|
206
319
|
|
|
207
|
-
|
|
208
|
-
this.prev.y = e.clientY;
|
|
320
|
+
if( this.isVector ){
|
|
209
321
|
|
|
210
|
-
|
|
322
|
+
this.objectLink[ this.val ].fromArray( v );
|
|
211
323
|
|
|
212
|
-
|
|
324
|
+
/*this.objectLink[ this.val ].x = v[0];
|
|
325
|
+
this.objectLink[ this.val ].y = v[1];
|
|
326
|
+
this.objectLink[ this.val ].z = v[2];
|
|
327
|
+
if( v[3] ) this.objectLink[ this.val ].w = v[3];*/
|
|
213
328
|
|
|
214
|
-
|
|
329
|
+
} else {
|
|
330
|
+
this.objectLink[ this.val ] = v;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if( this.callback ) this.callback( v, this.val );
|
|
336
|
+
|
|
337
|
+
this.isSend = false;
|
|
215
338
|
|
|
216
|
-
if(!isNaN( this.c[2+n].textContent )){
|
|
217
|
-
var nx = this.numValue( this.c[2+n].textContent );
|
|
218
|
-
this.c[2+n].textContent = nx;
|
|
219
|
-
this.value[n] = nx;
|
|
220
|
-
} else { // not number
|
|
221
|
-
this.c[2+n].textContent = this.value[n];
|
|
222
339
|
}
|
|
223
340
|
|
|
224
|
-
};
|
|
225
341
|
|
|
226
|
-
|
|
342
|
+
// ----------------------
|
|
343
|
+
// INPUT
|
|
344
|
+
// ----------------------
|
|
345
|
+
|
|
346
|
+
select ( c, e, w, t ) {
|
|
227
347
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
348
|
+
let s = this.s;
|
|
349
|
+
let d = this.current !== -1 ? this.tmp[this.current][0] + 5 : 0;
|
|
350
|
+
s[this.cursorId].width = '1px';
|
|
351
|
+
s[this.cursorId].left = ( d + c ) + 'px';
|
|
352
|
+
//s[2].left = ( d + e ) + 'px';
|
|
353
|
+
//s[2].width = w + 'px';
|
|
231
354
|
|
|
232
|
-
|
|
233
|
-
|
|
355
|
+
s[this.selectId].left = ( d + e ) + 'px';
|
|
356
|
+
s[this.selectId].width = w + 'px';
|
|
357
|
+
this.c[this.selectId].innerHTML = t
|
|
358
|
+
|
|
359
|
+
}
|
|
234
360
|
|
|
235
|
-
|
|
361
|
+
unselect () {
|
|
236
362
|
|
|
237
|
-
|
|
363
|
+
let s = this.s;
|
|
364
|
+
if(!s) return;
|
|
365
|
+
this.c[this.selectId].innerHTML = ''
|
|
366
|
+
s[this.selectId].width = 0 + 'px';
|
|
367
|
+
s[this.cursorId].width = 0 + 'px';
|
|
238
368
|
|
|
239
|
-
Proto.prototype.rSize.call( this );
|
|
240
|
-
this.w = ~~( ( this.sb + 5 ) / this.length )-5;
|
|
241
|
-
var s = this.s;
|
|
242
|
-
var i = this.length;
|
|
243
|
-
while(i--){
|
|
244
|
-
s[2+i].left = (~~( this.sa + ( this.w * i )+( 5 * i ))) + 'px';
|
|
245
|
-
s[2+i].width = this.w + 'px';
|
|
246
369
|
}
|
|
247
370
|
|
|
248
|
-
|
|
371
|
+
validate ( force ) {
|
|
372
|
+
|
|
373
|
+
let ar = [];
|
|
374
|
+
let i = this.lng;
|
|
375
|
+
|
|
376
|
+
if( this.allway ) force = true;
|
|
377
|
+
|
|
378
|
+
while(i--){
|
|
379
|
+
if(!isNaN( this.c[ 3 + i ].textContent )){
|
|
380
|
+
let nx = this.numValue( this.c[ 3 + i ].textContent );
|
|
381
|
+
this.c[ 3 + i ].textContent = nx;
|
|
382
|
+
this.value[i] = nx;
|
|
383
|
+
} else { // not number
|
|
384
|
+
this.c[ 3 + i ].textContent = this.value[i];
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
ar[i] = this.value[i] * this.multy;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if( !force ) return;
|
|
391
|
+
|
|
392
|
+
if( this.isSingle ) this.send( ar[0] );
|
|
393
|
+
else this.send( ar );
|
|
394
|
+
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// ----------------------
|
|
398
|
+
// REZISE
|
|
399
|
+
// ----------------------
|
|
400
|
+
|
|
401
|
+
rSize () {
|
|
402
|
+
|
|
403
|
+
super.rSize();
|
|
404
|
+
|
|
405
|
+
let w = Math.floor( ( this.sb + 5 ) / this.lng )-5;
|
|
406
|
+
let s = this.s;
|
|
407
|
+
let i = this.lng;
|
|
408
|
+
while(i--){
|
|
409
|
+
this.tmp[i] = [ Math.floor( this.sa + ( w * i )+( 5 * i )), w ];
|
|
410
|
+
this.tmp[i][2] = this.tmp[i][0] + this.tmp[i][1];
|
|
411
|
+
s[ 3 + i ].left = this.tmp[i][0] + 'px';
|
|
412
|
+
s[ 3 + i ].width = this.tmp[i][1] + 'px';
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
}
|
|
249
416
|
|
|
250
|
-
|
|
417
|
+
}
|