uil 4.2.2 → 4.2.6
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 +1 -1
- package/build/uil.js +257 -261
- package/build/uil.min.js +1 -1
- package/build/uil.module.js +326 -385
- package/package.json +1 -1
package/build/uil.module.js
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* @author lth / https://github.com/lo-th
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
const REVISION = '4.2.6';
|
|
11
|
+
|
|
10
12
|
// INTENAL FUNCTION
|
|
11
13
|
|
|
12
14
|
const R = {
|
|
@@ -250,7 +252,7 @@ const R = {
|
|
|
250
252
|
e.type = 'mouseup';
|
|
251
253
|
}
|
|
252
254
|
|
|
253
|
-
if( event.type === 'pointerleave')
|
|
255
|
+
if( event.type === 'pointerleave') R.isLeave = true;
|
|
254
256
|
|
|
255
257
|
if( event.type === 'pointerdown') e.type = 'mousedown';
|
|
256
258
|
if( event.type === 'pointerup') e.type = 'mouseup';
|
|
@@ -301,6 +303,8 @@ const R = {
|
|
|
301
303
|
|
|
302
304
|
}
|
|
303
305
|
|
|
306
|
+
//if( R.ID.marginDiv ) e.clientY -= R.ID.margin * 0.5
|
|
307
|
+
|
|
304
308
|
R.ID.handleEvent( e );
|
|
305
309
|
|
|
306
310
|
}
|
|
@@ -367,13 +371,13 @@ const R = {
|
|
|
367
371
|
// GUI / GROUP FUNCTION
|
|
368
372
|
// ----------------------
|
|
369
373
|
|
|
370
|
-
calcUis:
|
|
374
|
+
calcUis: ( uis, zone, py ) => {
|
|
371
375
|
|
|
372
376
|
//console.log('calc_uis')
|
|
373
377
|
|
|
374
|
-
let i = uis.length, u, px = 0, n = 0, tw;
|
|
378
|
+
let i = uis.length, u, px = 0, n = 0, tw, m;
|
|
379
|
+
|
|
375
380
|
let height = 0;
|
|
376
|
-
let m = 1;
|
|
377
381
|
|
|
378
382
|
while( i-- ){
|
|
379
383
|
|
|
@@ -382,33 +386,30 @@ const R = {
|
|
|
382
386
|
|
|
383
387
|
if( u.isGroup ) u.calcUis();
|
|
384
388
|
|
|
385
|
-
u.zone.w = u.w;
|
|
386
|
-
u.zone.h = u.h;
|
|
387
389
|
m = u.margin;
|
|
390
|
+
//div = u.marginDiv
|
|
388
391
|
|
|
392
|
+
u.zone.w = u.w;
|
|
393
|
+
u.zone.h = u.h + m;
|
|
394
|
+
|
|
389
395
|
if( !u.autoWidth ){
|
|
390
396
|
|
|
391
|
-
if( px===0 )
|
|
392
|
-
height += u.h + m;
|
|
393
|
-
|
|
394
|
-
}
|
|
397
|
+
if( px === 0 ) height += u.h + m;
|
|
395
398
|
|
|
396
399
|
u.zone.x = zone.x + px;
|
|
397
|
-
u.zone.y = py
|
|
400
|
+
u.zone.y = py;// + u.mtop
|
|
401
|
+
//if(div) u.zone.y += m * 0.5
|
|
398
402
|
|
|
399
403
|
tw = R.getWidth(u);
|
|
400
404
|
if( tw ) u.zone.w = u.w = tw;
|
|
401
|
-
// focrce width if content is canvas
|
|
402
405
|
else if( u.fw ) u.zone.w = u.w = u.fw;
|
|
403
406
|
|
|
404
|
-
|
|
405
|
-
//console.log( u.name, u.zone.w, u.w, zone, tw )
|
|
406
|
-
//console.log( tw )
|
|
407
407
|
px += u.zone.w;
|
|
408
408
|
|
|
409
409
|
if( px >= zone.w ) {
|
|
410
|
-
py += u.h + m;
|
|
411
|
-
|
|
410
|
+
py += u.h + m;
|
|
411
|
+
//if(div) py += m * 0.5
|
|
412
|
+
px = 0;
|
|
412
413
|
}
|
|
413
414
|
|
|
414
415
|
} else {
|
|
@@ -419,6 +420,7 @@ const R = {
|
|
|
419
420
|
u.zone.y = py;
|
|
420
421
|
py += u.h + m;
|
|
421
422
|
|
|
423
|
+
|
|
422
424
|
height += u.h + m;
|
|
423
425
|
|
|
424
426
|
}
|
|
@@ -472,8 +474,13 @@ const R = {
|
|
|
472
474
|
let mx = x - z.x;
|
|
473
475
|
let my = y - z.y;
|
|
474
476
|
|
|
477
|
+
//if( this.marginDiv ) e.clientY -= this.margin * 0.5
|
|
478
|
+
//if( o.group && o.group.marginDiv ) my += o.group.margin * 0.5
|
|
479
|
+
|
|
475
480
|
let over = ( mx >= 0 ) && ( my >= 0 ) && ( mx <= z.w ) && ( my <= z.h );
|
|
476
481
|
|
|
482
|
+
//if( o.marginDiv ) my -= o.margin * 0.5
|
|
483
|
+
|
|
477
484
|
if( over ) o.local.set( mx, my );
|
|
478
485
|
else o.local.neg();
|
|
479
486
|
|
|
@@ -910,7 +917,7 @@ const T = {
|
|
|
910
917
|
torad: Math.PI / 180,
|
|
911
918
|
todeg: 180 / Math.PI,
|
|
912
919
|
|
|
913
|
-
clamp:
|
|
920
|
+
clamp: ( v, min, max ) => {
|
|
914
921
|
|
|
915
922
|
v = v < min ? min : v;
|
|
916
923
|
v = v > max ? max : v;
|
|
@@ -918,13 +925,15 @@ const T = {
|
|
|
918
925
|
|
|
919
926
|
},
|
|
920
927
|
|
|
928
|
+
isDivid: ( v ) => ( v*0.5 === Math.floor(v*0.5) ),
|
|
929
|
+
|
|
921
930
|
size: { w: 240, h: 20, p: 30, s: 8 },
|
|
922
931
|
|
|
923
932
|
// ----------------------
|
|
924
933
|
// COLOR
|
|
925
934
|
// ----------------------
|
|
926
935
|
|
|
927
|
-
defineColor:
|
|
936
|
+
defineColor: ( o, cc = T.colors ) => {
|
|
928
937
|
|
|
929
938
|
let color = { ...cc };
|
|
930
939
|
|
|
@@ -969,7 +978,7 @@ const T = {
|
|
|
969
978
|
if( o.fontSelect ) color.textSelect = o.fontSelect;
|
|
970
979
|
if( o.groupBorder ) color.gborder = o.groupBorder;
|
|
971
980
|
|
|
972
|
-
if( o.transparent ) o.bg = 'none'
|
|
981
|
+
//if( o.transparent ) o.bg = 'none'
|
|
973
982
|
//if( o.bg ) color.background = color.backgroundOver = o.bg
|
|
974
983
|
if( o.bgOver ) color.backgroundOver = o.bgOver;
|
|
975
984
|
|
|
@@ -989,12 +998,13 @@ const T = {
|
|
|
989
998
|
|
|
990
999
|
colors: {
|
|
991
1000
|
|
|
992
|
-
sx:
|
|
993
|
-
sy:
|
|
1001
|
+
sx: 4,//4
|
|
1002
|
+
sy: 2,//2
|
|
1003
|
+
radius:2,
|
|
994
1004
|
|
|
995
1005
|
content:'none',
|
|
996
|
-
background: 'rgba(50,50,50,0.
|
|
997
|
-
backgroundOver: 'rgba(50,50,50,0.
|
|
1006
|
+
background: 'rgba(50,50,50,0.15)',
|
|
1007
|
+
backgroundOver: 'rgba(50,50,50,0.3)',
|
|
998
1008
|
|
|
999
1009
|
title : '#CCC',
|
|
1000
1010
|
titleoff : '#BBB',
|
|
@@ -1002,26 +1012,22 @@ const T = {
|
|
|
1002
1012
|
textOver : '#EEE',
|
|
1003
1013
|
textSelect : '#FFF',
|
|
1004
1014
|
|
|
1005
|
-
//inputBg: 'rgba(0,0,0,0.25)',
|
|
1006
|
-
//itemBg:'rgba(0,0,0,0.25)',
|
|
1007
|
-
|
|
1008
1015
|
back:'rgba(0,0,0,0.2)',
|
|
1009
1016
|
backoff:'rgba(0,0,0,0.3)',
|
|
1010
|
-
//inputOver: 'rgba(0,0,0,0.2)',
|
|
1011
1017
|
|
|
1012
1018
|
// input and button border
|
|
1013
1019
|
border : '#4c4c4c',
|
|
1014
1020
|
borderSize : 1,
|
|
1015
|
-
gborder : 'none',
|
|
1016
1021
|
|
|
1022
|
+
gborder : 'none',
|
|
1017
1023
|
groups : 'none',
|
|
1024
|
+
|
|
1018
1025
|
button : '#3c3c3c',
|
|
1019
1026
|
overoff : '#5c5c5c',
|
|
1020
1027
|
over : '#024699',
|
|
1021
1028
|
select : '#308AFF',
|
|
1022
1029
|
action: '#FF3300',
|
|
1023
1030
|
|
|
1024
|
-
|
|
1025
1031
|
//fontFamily: 'Tahoma',
|
|
1026
1032
|
fontFamily: 'Consolas, monospace',
|
|
1027
1033
|
//fontFamily: "'Roboto Mono', 'Source Code Pro', Menlo, Courier, monospace",
|
|
@@ -1029,7 +1035,7 @@ const T = {
|
|
|
1029
1035
|
fontShadow: 'none',//'#000',
|
|
1030
1036
|
fontSize:12,
|
|
1031
1037
|
|
|
1032
|
-
|
|
1038
|
+
|
|
1033
1039
|
hide: 'rgba(0,0,0,0)',
|
|
1034
1040
|
|
|
1035
1041
|
},
|
|
@@ -1038,14 +1044,9 @@ const T = {
|
|
|
1038
1044
|
|
|
1039
1045
|
css : {
|
|
1040
1046
|
|
|
1041
|
-
//unselect: '-o-user-select:none; -ms-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -moz-user-select:none;',
|
|
1042
1047
|
basic: 'position:absolute; pointer-events:none; box-sizing:border-box; margin:0; padding:0; overflow:hidden; ' + '-o-user-select:none; -ms-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -moz-user-select:none;',
|
|
1043
|
-
button:'display:flex;
|
|
1044
|
-
middle:'display:flex; align-items:center;'
|
|
1045
|
-
|
|
1046
|
-
/*txt: T.css.basic + 'font-family:'+ T.colors.fontFamily +'; font-size:'+T.colors.fontSize+'px; color:'+T.colors.text+'; padding:2px 10px; left:0; top:2px; height:16px; width:100px; overflow:hidden; white-space: nowrap;',
|
|
1047
|
-
txtselect: T.css.txt + 'display:flex; justify-content:left; align-items:center; text-align:left;' +'padding:2px 5px; border:1px dashed ' + T.colors.border + '; background:'+ T.colors.txtselectbg+';',
|
|
1048
|
-
item: T.css.txt + 'position:relative; background:rgba(0,0,0,0.2); margin-bottom:1px;',*/
|
|
1048
|
+
button:'display:flex; align-items:center; justify-content:center; text-align:center;',
|
|
1049
|
+
middle:'display:flex; align-items:center; justify-content:left; text-align:left; flex-direction: row-reverse;'
|
|
1049
1050
|
},
|
|
1050
1051
|
|
|
1051
1052
|
// svg path
|
|
@@ -1057,6 +1058,7 @@ const T = {
|
|
|
1057
1058
|
|
|
1058
1059
|
group:'M 7 7 L 7 8 8 8 8 7 7 7 M 5 7 L 5 8 6 8 6 7 5 7 M 3 7 L 3 8 4 8 4 7 3 7 M 7 5 L 7 6 8 6 8 5 7 5 M 6 6 L 6 5 5 5 5 6 6 6 M 7 3 L 7 4 8 4 8 3 7 3 M 6 4 L 6 3 5 3 5 4 6 4 M 3 5 L 3 6 4 6 4 5 3 5 M 3 3 L 3 4 4 4 4 3 3 3 Z',
|
|
1059
1060
|
arrow:'M 3 8 L 8 5 3 2 3 8 Z',
|
|
1061
|
+
|
|
1060
1062
|
arrowDown:'M 5 8 L 8 3 2 3 5 8 Z',
|
|
1061
1063
|
arrowUp:'M 5 2 L 2 7 8 7 5 2 Z',
|
|
1062
1064
|
|
|
@@ -1075,7 +1077,9 @@ const T = {
|
|
|
1075
1077
|
object:'M 10 1 L 7 4 4 1 1 1 1 13 4 13 4 5 7 8 10 5 10 13 13 13 13 1 10 1 Z',
|
|
1076
1078
|
none:'M 9 5 L 5 5 5 9 9 9 9 5 Z',
|
|
1077
1079
|
cursor:'M 4 7 L 1 10 1 12 2 13 4 13 7 10 9 14 14 0 0 5 4 7 Z',
|
|
1078
|
-
load:'M
|
|
1080
|
+
load:'M 13 8 L 11.5 6.5 9 9 9 3 5 3 5 9 2.5 6.5 1 8 7 14 13 8 M 9 2 L 9 0 5 0 5 2 9 2 Z',
|
|
1081
|
+
save:'M 9 12 L 5 12 5 14 9 14 9 12 M 11.5 7.5 L 13 6 7 0 1 6 2.5 7.5 5 5 5 11 9 11 9 5 11.5 7.5 Z',
|
|
1082
|
+
extern:'M 14 14 L 14 0 0 0 0 14 14 14 M 12 6 L 12 12 2 12 2 6 12 6 M 12 2 L 12 4 2 4 2 2 12 2 Z',
|
|
1079
1083
|
|
|
1080
1084
|
},
|
|
1081
1085
|
|
|
@@ -1123,16 +1127,13 @@ const T = {
|
|
|
1123
1127
|
else size += 'px';
|
|
1124
1128
|
|
|
1125
1129
|
|
|
1126
|
-
let align = 'display:flex; justify-content:left; align-items:center; text-align:left;'
|
|
1130
|
+
//let align = 'display:flex; justify-content:left; align-items:center; text-align:left;'
|
|
1127
1131
|
|
|
1128
|
-
T.css.txt = T.css.basic +
|
|
1132
|
+
T.css.txt = T.css.basic + T.css.middle + ' font-family:'+ font +'; font-weight:'+weight+'; font-size:'+size+'; color:'+cc.text+'; padding:0px 8px; left:0; top:2px; height:16px; width:100px; overflow:hidden; white-space: nowrap; letter-spacing: normal;';
|
|
1129
1133
|
if( shadow !== 'none' ) T.css.txt += ' text-shadow: 1px 1px 1px '+shadow+';';
|
|
1130
1134
|
|
|
1131
1135
|
T.css.txtselect = T.css.txt + 'padding:0px 4px; border:1px dashed ' + cc.border + ';';
|
|
1132
|
-
|
|
1133
|
-
T.css.item = T.css.txt + ' position:relative; margin-bottom:1px; display:block; padding:2px 4px;';//
|
|
1134
|
-
|
|
1135
|
-
//console.log( T.css.txt )
|
|
1136
|
+
T.css.item = T.css.txt + 'padding:0px 4px; position:relative; margin-bottom:1px; ';
|
|
1136
1137
|
|
|
1137
1138
|
},
|
|
1138
1139
|
|
|
@@ -1323,6 +1324,8 @@ const T = {
|
|
|
1323
1324
|
|
|
1324
1325
|
ColorLuma : function ( hex, l ) {
|
|
1325
1326
|
|
|
1327
|
+
//if( hex.substring(0, 3) === 'rgba' ) hex = '#000';
|
|
1328
|
+
|
|
1326
1329
|
if( hex === 'n' ) hex = '#000';
|
|
1327
1330
|
|
|
1328
1331
|
// validate hex string
|
|
@@ -1780,6 +1783,9 @@ class Files {
|
|
|
1780
1783
|
case 'image':
|
|
1781
1784
|
t = [ { description: 'Images', accept: { 'image/*': ['.png', '.gif', '.jpeg', '.jpg'] } }, ];
|
|
1782
1785
|
break;
|
|
1786
|
+
case 'icon':
|
|
1787
|
+
t = [ { description: 'Icons', accept: { 'image/x-ico': ['.ico'] } }, ];
|
|
1788
|
+
break;
|
|
1783
1789
|
|
|
1784
1790
|
}
|
|
1785
1791
|
|
|
@@ -2151,6 +2157,9 @@ class Proto {
|
|
|
2151
2157
|
|
|
2152
2158
|
this.isListen = false;
|
|
2153
2159
|
|
|
2160
|
+
this.top = 0;
|
|
2161
|
+
this.ytop = 0;
|
|
2162
|
+
|
|
2154
2163
|
this.isSelectable = o.selectable !== undefined ? o.selectable : false;
|
|
2155
2164
|
this.unselectable = o.unselect !== undefined ? o.unselect : this.isSelectable;
|
|
2156
2165
|
|
|
@@ -2162,7 +2171,7 @@ class Proto {
|
|
|
2162
2171
|
|
|
2163
2172
|
this.svgs = Tools.svgs;
|
|
2164
2173
|
|
|
2165
|
-
this.zone = { x:0, y:0, w:0, h:0 };
|
|
2174
|
+
this.zone = { x:0, y:0, w:0, h:0, d:0 };
|
|
2166
2175
|
this.local = new V2().neg();
|
|
2167
2176
|
|
|
2168
2177
|
this.isCanvasOnly = false;
|
|
@@ -2254,18 +2263,21 @@ class Proto {
|
|
|
2254
2263
|
this.s[0] = this.c[0].style;
|
|
2255
2264
|
|
|
2256
2265
|
// bottom margin
|
|
2257
|
-
this.margin =
|
|
2266
|
+
this.margin = this.colors.sy;
|
|
2267
|
+
this.mtop = 0;
|
|
2268
|
+
let marginDiv = Tools.isDivid( this.margin );
|
|
2269
|
+
|
|
2258
2270
|
if( this.isUI && this.margin ){
|
|
2259
2271
|
this.s[0].boxSizing = 'content-box';
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
this.s[0].borderTop =
|
|
2263
|
-
|
|
2272
|
+
if( marginDiv ){
|
|
2273
|
+
this.mtop = this.margin * 0.5;
|
|
2274
|
+
//this.s[0].borderTop = '${this.mtop}px solid transparent'
|
|
2275
|
+
//console.log(`${this.mtop}px solid transparent`)
|
|
2276
|
+
this.s[0].borderTop = this.mtop + 'px solid transparent';
|
|
2277
|
+
this.s[0].borderBottom = this.mtop + 'px solid transparent';
|
|
2264
2278
|
} else {
|
|
2265
|
-
//this.s[0].borderTop = (this.margin*0.5) + 'px solid transparent'
|
|
2266
2279
|
this.s[0].borderBottom = this.margin + 'px solid transparent';
|
|
2267
2280
|
}
|
|
2268
|
-
|
|
2269
2281
|
}
|
|
2270
2282
|
|
|
2271
2283
|
// with title
|
|
@@ -2298,7 +2310,9 @@ class Proto {
|
|
|
2298
2310
|
|
|
2299
2311
|
init() {
|
|
2300
2312
|
|
|
2301
|
-
this.
|
|
2313
|
+
this.ytop = this.top + this.mtop;
|
|
2314
|
+
|
|
2315
|
+
this.zone.h = this.h + this.margin;
|
|
2302
2316
|
this.zone.w = this.w;
|
|
2303
2317
|
|
|
2304
2318
|
let s = this.s; // style cache
|
|
@@ -2321,8 +2335,6 @@ class Proto {
|
|
|
2321
2335
|
s[1] = c[1].style;
|
|
2322
2336
|
s[1].top = 1 + 'px';
|
|
2323
2337
|
s[1].height = (this.h-2) + 'px';
|
|
2324
|
-
//s[1].height = (this.h-4) + 'px';
|
|
2325
|
-
// s[1].lineHeight = (this.h-8) + 'px';
|
|
2326
2338
|
}
|
|
2327
2339
|
|
|
2328
2340
|
let frag = Tools.frag;
|
|
@@ -2443,6 +2455,12 @@ class Proto {
|
|
|
2443
2455
|
|
|
2444
2456
|
/////////
|
|
2445
2457
|
|
|
2458
|
+
content() {
|
|
2459
|
+
|
|
2460
|
+
return this.c[0]
|
|
2461
|
+
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2446
2464
|
getDom() {
|
|
2447
2465
|
|
|
2448
2466
|
return this.c[0]
|
|
@@ -2452,7 +2470,6 @@ class Proto {
|
|
|
2452
2470
|
uiout() {
|
|
2453
2471
|
|
|
2454
2472
|
if( this.lock ) return;
|
|
2455
|
-
|
|
2456
2473
|
if(this.s) this.s[0].background = this.colors.background;
|
|
2457
2474
|
|
|
2458
2475
|
}
|
|
@@ -2460,7 +2477,6 @@ class Proto {
|
|
|
2460
2477
|
uiover() {
|
|
2461
2478
|
|
|
2462
2479
|
if( this.lock ) return;
|
|
2463
|
-
|
|
2464
2480
|
if(this.s) this.s[0].background = this.colors.backgroundOver;
|
|
2465
2481
|
|
|
2466
2482
|
}
|
|
@@ -2666,6 +2682,7 @@ class Proto {
|
|
|
2666
2682
|
case 3: s = 0.001; break;
|
|
2667
2683
|
case 4: s = 0.0001; break;
|
|
2668
2684
|
case 5: s = 0.00001; break;
|
|
2685
|
+
case 6: s = 0.000001; break;
|
|
2669
2686
|
}
|
|
2670
2687
|
|
|
2671
2688
|
this.step = o.step === undefined ? s : o.step;
|
|
@@ -2677,7 +2694,7 @@ class Proto {
|
|
|
2677
2694
|
numValue( n ) {
|
|
2678
2695
|
|
|
2679
2696
|
if( this.noNeg ) n = Math.abs( n );
|
|
2680
|
-
return Math.min( this.max, Math.max( this.min, n ) ).toFixed( this.precision ) * 1
|
|
2697
|
+
return Math.min( this.max, Math.max( this.min, n ) ).toFixed( this.precision ) * 1
|
|
2681
2698
|
|
|
2682
2699
|
}
|
|
2683
2700
|
|
|
@@ -2689,11 +2706,17 @@ class Proto {
|
|
|
2689
2706
|
handleEvent( e ) {
|
|
2690
2707
|
|
|
2691
2708
|
if( this.lock ) return
|
|
2692
|
-
|
|
2693
2709
|
if( this.neverlock ) Roots.lock = false;
|
|
2694
|
-
|
|
2695
2710
|
if( !this[e.type] ) return console.error(e.type, 'this type of event no existe !')
|
|
2696
2711
|
|
|
2712
|
+
|
|
2713
|
+
// TODO !!!!
|
|
2714
|
+
|
|
2715
|
+
//if( this.marginDiv ) z.d -= this.margin * 0.5
|
|
2716
|
+
|
|
2717
|
+
//if( this.marginDiv ) e.clientY -= this.margin * 0.5
|
|
2718
|
+
//if( this.group && this.group.marginDiv ) e.clientY -= this.group.margin * 0.5
|
|
2719
|
+
|
|
2697
2720
|
return this[e.type](e)
|
|
2698
2721
|
|
|
2699
2722
|
}
|
|
@@ -2816,7 +2839,7 @@ class Bool extends Proto {
|
|
|
2816
2839
|
} else {
|
|
2817
2840
|
this.p = 0;
|
|
2818
2841
|
if( this.c[1] !== undefined ) this.c[1].textContent = '';
|
|
2819
|
-
this.c[2] = this.dom( 'div', this.css.txt + this.css.button + 'top:1px; background:'+cc.button+'; height:'+(this.h-2)+'px; border:
|
|
2842
|
+
this.c[2] = this.dom( 'div', this.css.txt + this.css.button + 'top:1px; background:'+cc.button+'; height:'+(this.h-2)+'px; border:'+cc.borderSize+'px solid '+cc.border+'; border-radius:'+this.radius+'px;' );
|
|
2820
2843
|
}
|
|
2821
2844
|
|
|
2822
2845
|
this.stat = -1;
|
|
@@ -2930,7 +2953,7 @@ class Bool extends Proto {
|
|
|
2930
2953
|
s[3].left = w + 'px';
|
|
2931
2954
|
} else {
|
|
2932
2955
|
s[2].left = this.sa + 'px';
|
|
2933
|
-
s[2].width =
|
|
2956
|
+
s[2].width = this.sb + 'px';
|
|
2934
2957
|
}
|
|
2935
2958
|
|
|
2936
2959
|
}
|
|
@@ -2948,9 +2971,7 @@ class Button extends Proto {
|
|
|
2948
2971
|
this.values = o.value || this.txt;
|
|
2949
2972
|
if( o.values ) this.values = o.values;
|
|
2950
2973
|
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2974
|
+
if( !o.values && !o.value ) this.txt = '';
|
|
2954
2975
|
|
|
2955
2976
|
this.onName = o.onName || null;
|
|
2956
2977
|
|
|
@@ -2986,14 +3007,14 @@ class Button extends Proto {
|
|
|
2986
3007
|
|
|
2987
3008
|
}
|
|
2988
3009
|
|
|
2989
|
-
|
|
2990
|
-
if( this.c[1] !== undefined ) {
|
|
2991
|
-
this.c[1].textContent = '';
|
|
2992
|
-
//this.txt = ''
|
|
2993
|
-
}
|
|
2994
|
-
}
|
|
3010
|
+
|
|
2995
3011
|
if( this.txt==='' ) this.p = 0;
|
|
2996
3012
|
|
|
3013
|
+
if( (!o.value && !o.values) || this.p === 0 ){
|
|
3014
|
+
if( this.c[1] !== undefined ) this.c[1].textContent = '';
|
|
3015
|
+
}
|
|
3016
|
+
|
|
3017
|
+
|
|
2997
3018
|
this.init();
|
|
2998
3019
|
|
|
2999
3020
|
}
|
|
@@ -3001,7 +3022,7 @@ class Button extends Proto {
|
|
|
3001
3022
|
onOff() {
|
|
3002
3023
|
|
|
3003
3024
|
this.on = !this.on;
|
|
3004
|
-
this.label( this.on ? this.onName : this.
|
|
3025
|
+
this.label( this.on ? this.onName : this.value );
|
|
3005
3026
|
|
|
3006
3027
|
}
|
|
3007
3028
|
|
|
@@ -3106,10 +3127,10 @@ class Button extends Proto {
|
|
|
3106
3127
|
|
|
3107
3128
|
switch( n ){
|
|
3108
3129
|
|
|
3109
|
-
case 1: s[i].color = cc.text; s[i].background = cc.button; break
|
|
3110
|
-
case 2: s[i].color = cc.textOver; s[i].background = cc.overoff; break
|
|
3111
|
-
case 3: s[i].color = cc.textOver; s[i].background = cc.over; break
|
|
3112
|
-
case 4: s[i].color = cc.textSelect; s[i].background = cc.select; break
|
|
3130
|
+
case 1: s[i].color = cc.text; s[i].background = cc.button; break
|
|
3131
|
+
case 2: s[i].color = cc.textOver; s[i].background = cc.overoff; break
|
|
3132
|
+
case 3: s[i].color = cc.textOver; s[i].background = cc.over; break
|
|
3133
|
+
case 4: s[i].color = cc.textSelect; s[i].background = cc.select; break
|
|
3113
3134
|
|
|
3114
3135
|
}
|
|
3115
3136
|
|
|
@@ -3159,7 +3180,7 @@ class Button extends Proto {
|
|
|
3159
3180
|
let i = this.lng;
|
|
3160
3181
|
let sx = this.colors.sx; //this.space;
|
|
3161
3182
|
//let size = Math.floor( ( w-(dc*(i-1)) ) / i );
|
|
3162
|
-
let size = (
|
|
3183
|
+
let size = ( w-(sx*(i-1)) ) / i;
|
|
3163
3184
|
|
|
3164
3185
|
if( this.bw ){
|
|
3165
3186
|
size = this.bw < size ? this.bw : size;
|
|
@@ -3204,7 +3225,6 @@ class Circular extends Proto {
|
|
|
3204
3225
|
this.offset = new V2();
|
|
3205
3226
|
|
|
3206
3227
|
this.h = o.h || this.w + 10;
|
|
3207
|
-
this.top = 0;
|
|
3208
3228
|
|
|
3209
3229
|
this.c[0].style.width = this.w +'px';
|
|
3210
3230
|
this.c[0].style.display = 'block';
|
|
@@ -3320,7 +3340,7 @@ class Circular extends Proto {
|
|
|
3320
3340
|
|
|
3321
3341
|
let off = this.offset;
|
|
3322
3342
|
off.x = (this.w*0.5) - ( e.clientX - this.zone.x );
|
|
3323
|
-
off.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.
|
|
3343
|
+
off.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.ytop );
|
|
3324
3344
|
|
|
3325
3345
|
this.r = off.angle() - this.pi90;
|
|
3326
3346
|
this.r = (((this.r%this.twoPi)+this.twoPi)%this.twoPi);
|
|
@@ -3425,6 +3445,8 @@ class Color extends Proto {
|
|
|
3425
3445
|
this.cw = this.sb > 256 ? 256 : this.sb;
|
|
3426
3446
|
if(o.cw != undefined ) this.cw = o.cw;
|
|
3427
3447
|
|
|
3448
|
+
|
|
3449
|
+
|
|
3428
3450
|
// color up or down
|
|
3429
3451
|
this.side = o.side || 'down';
|
|
3430
3452
|
this.up = this.side === 'down' ? 0 : 1;
|
|
@@ -3435,15 +3457,19 @@ class Color extends Proto {
|
|
|
3435
3457
|
this.decal = new V2();
|
|
3436
3458
|
this.pp = new V2();
|
|
3437
3459
|
|
|
3438
|
-
|
|
3439
|
-
|
|
3460
|
+
let cc = this.colors;
|
|
3461
|
+
|
|
3462
|
+
// this.c[2] = this.dom( 'div', this.css.txt + this.css.middle + 'top:1px; height:'+(this.h-2)+'px;' + 'border-radius:'+this.radius+'px; text-shadow:none; border:'+cc.borderSize+'px solid '+cc.border+';' )
|
|
3463
|
+
|
|
3464
|
+
this.c[2] = this.dom( 'div', `${this.css.txt} ${this.css.middle} top:1px; height:${this.h-2}px; border-radius:${this.radius}px; text-shadow:none; border:${cc.borderSize}px solid ${cc.border};` );
|
|
3465
|
+
//this.s[2] = this.c[2].style;
|
|
3440
3466
|
|
|
3441
|
-
this.s[2].textShadow = 'none'
|
|
3467
|
+
//this.s[2].textShadow = 'none'
|
|
3442
3468
|
|
|
3443
|
-
if( this.up ){
|
|
3469
|
+
/*if( this.up ){
|
|
3444
3470
|
this.s[2].top = 'auto';
|
|
3445
3471
|
this.s[2].bottom = '2px';
|
|
3446
|
-
}
|
|
3472
|
+
}*/
|
|
3447
3473
|
|
|
3448
3474
|
//this.c[0].style.textAlign = 'center';
|
|
3449
3475
|
this.c[0].style.display = 'block';
|
|
@@ -3471,10 +3497,10 @@ class Color extends Proto {
|
|
|
3471
3497
|
this.hue = 0;
|
|
3472
3498
|
this.d = 256;
|
|
3473
3499
|
|
|
3474
|
-
this.setColor( this.value );
|
|
3475
|
-
|
|
3476
3500
|
this.init();
|
|
3477
3501
|
|
|
3502
|
+
this.setColor( this.value );
|
|
3503
|
+
|
|
3478
3504
|
if( o.open !== undefined ) this.open();
|
|
3479
3505
|
|
|
3480
3506
|
}
|
|
@@ -3482,20 +3508,17 @@ class Color extends Proto {
|
|
|
3482
3508
|
testZone ( mx, my ) {
|
|
3483
3509
|
|
|
3484
3510
|
let l = this.local;
|
|
3485
|
-
if( l.x === -1 && l.y === -1 ) return ''
|
|
3486
|
-
|
|
3487
|
-
|
|
3511
|
+
if( l.x === -1 && l.y === -1 ) return ''
|
|
3488
3512
|
|
|
3489
3513
|
if( this.up && this.isOpen ){
|
|
3490
3514
|
|
|
3491
|
-
if( l.y > this.wfixe ) return 'title'
|
|
3492
|
-
else return 'color'
|
|
3515
|
+
if( l.y > this.wfixe ) return 'title'
|
|
3516
|
+
else return 'color'
|
|
3493
3517
|
|
|
3494
3518
|
} else {
|
|
3495
3519
|
|
|
3496
|
-
if( l.y < this.baseH+2 ) return 'title'
|
|
3497
|
-
else if( this.isOpen ) return 'color'
|
|
3498
|
-
|
|
3520
|
+
if( l.y < this.baseH+2 ) return 'title'
|
|
3521
|
+
else if( this.isOpen ) return 'color'
|
|
3499
3522
|
|
|
3500
3523
|
}
|
|
3501
3524
|
|
|
@@ -3546,7 +3569,7 @@ class Color extends Proto {
|
|
|
3546
3569
|
|
|
3547
3570
|
off = this.offset;
|
|
3548
3571
|
off.x = e.clientX - ( this.zone.x + this.decal.x + this.mid );
|
|
3549
|
-
off.y = e.clientY - ( this.zone.y + this.decal.y + this.mid );
|
|
3572
|
+
off.y = e.clientY - ( this.zone.y + this.decal.y + this.mid ) - this.ytop;
|
|
3550
3573
|
d = off.length() * this.ratio;
|
|
3551
3574
|
rr = off.angle();
|
|
3552
3575
|
if(rr < 0) rr += 2 * T.PI;
|
|
@@ -3676,7 +3699,6 @@ class Color extends Proto {
|
|
|
3676
3699
|
|
|
3677
3700
|
this.setSvg( this.c[3], 'fill', cc, 2, 0 );
|
|
3678
3701
|
|
|
3679
|
-
|
|
3680
3702
|
this.s[2].background = this.bcolor;
|
|
3681
3703
|
if(!this.notext) this.c[2].textContent = Tools.htmlToHex( this.bcolor );
|
|
3682
3704
|
|
|
@@ -3784,6 +3806,12 @@ class Color extends Proto {
|
|
|
3784
3806
|
s[2].width = this.sb + 'px';
|
|
3785
3807
|
s[2].left = this.sa + 'px';
|
|
3786
3808
|
|
|
3809
|
+
//console.log(this.sb)
|
|
3810
|
+
|
|
3811
|
+
this.cw = this.sb > 256 ? 256 : this.sb;
|
|
3812
|
+
|
|
3813
|
+
|
|
3814
|
+
|
|
3787
3815
|
this.rSizeColor( this.cw );
|
|
3788
3816
|
|
|
3789
3817
|
this.decal.x = Math.floor((this.w - this.wfixe) * 0.5);
|
|
@@ -3793,10 +3821,15 @@ class Color extends Proto {
|
|
|
3793
3821
|
|
|
3794
3822
|
rSizeColor ( w ) {
|
|
3795
3823
|
|
|
3824
|
+
|
|
3796
3825
|
if( w === this.wfixe ) return;
|
|
3797
3826
|
|
|
3827
|
+
|
|
3828
|
+
|
|
3798
3829
|
this.wfixe = w;
|
|
3799
3830
|
|
|
3831
|
+
|
|
3832
|
+
|
|
3800
3833
|
let s = this.s;
|
|
3801
3834
|
|
|
3802
3835
|
//this.decal.x = Math.floor((this.w - this.wfixe) * 0.5);
|
|
@@ -4385,7 +4418,7 @@ class Graph extends Proto {
|
|
|
4385
4418
|
nup = this.mode( this.isDown ? 2 : 1, name );
|
|
4386
4419
|
//this.cursor( this.current !== -1 ? 'move' : 'pointer' );
|
|
4387
4420
|
if(this.isDown){
|
|
4388
|
-
this.v[name] = this.clamp( 1 - (( e.clientY - this.zone.y - this.
|
|
4421
|
+
this.v[name] = this.clamp( 1 - (( e.clientY - this.zone.y - this.ytop - 10 ) / this.gh) , 0, 1 );
|
|
4389
4422
|
this.update( true );
|
|
4390
4423
|
}
|
|
4391
4424
|
|
|
@@ -4418,16 +4451,16 @@ class Graph extends Proto {
|
|
|
4418
4451
|
wm = w + this.iw*0.5;
|
|
4419
4452
|
wn = w + this.iw;
|
|
4420
4453
|
|
|
4421
|
-
if(i===0) p+='M '+w+' '+ h + ' T ' + wm +' '+ h;
|
|
4454
|
+
if( i === 0 ) p+='M '+w+' '+ h + ' T ' + wm +' '+ h;
|
|
4422
4455
|
else p += ' C ' + ow +' '+ oh + ',' + w +' '+ h + ',' + wm +' '+ h;
|
|
4423
|
-
if(i === this.lng-1) p+=' T ' + wn +' '+ h;
|
|
4456
|
+
if( i === this.lng-1 ) p+=' T ' + wn +' '+ h;
|
|
4424
4457
|
|
|
4425
4458
|
ow = wn;
|
|
4426
4459
|
oh = h;
|
|
4427
4460
|
|
|
4428
4461
|
}
|
|
4429
4462
|
|
|
4430
|
-
return p
|
|
4463
|
+
return p
|
|
4431
4464
|
|
|
4432
4465
|
}
|
|
4433
4466
|
|
|
@@ -4441,7 +4474,6 @@ class Graph extends Proto {
|
|
|
4441
4474
|
|
|
4442
4475
|
let gw = this.w - 28;
|
|
4443
4476
|
let iw = ((gw-(4*(this.lng-1)))/this.lng);
|
|
4444
|
-
|
|
4445
4477
|
let t = [];
|
|
4446
4478
|
|
|
4447
4479
|
s[2].width = gw + 'px';
|
|
@@ -4484,63 +4516,21 @@ class Group extends Proto {
|
|
|
4484
4516
|
|
|
4485
4517
|
const cc = this.colors;
|
|
4486
4518
|
|
|
4487
|
-
this.isLine = o.line !== undefined ? o.line : false;
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
4519
|
this.useFlex = true;
|
|
4492
4520
|
let flexible = this.useFlex ? 'display:flex; flex-flow: row wrap;' : '';
|
|
4493
4521
|
|
|
4494
|
-
this.c[2] = this.dom( 'div', this.css.basic + flexible + 'width:100%; left:0; height:auto; overflow:hidden; top:'+(this.h
|
|
4522
|
+
this.c[2] = this.dom( 'div', this.css.basic + flexible + 'width:100%; left:0; height:auto; overflow:hidden; top:'+(this.h)+'px');
|
|
4495
4523
|
this.c[3] = this.dom( 'path', this.css.basic + 'position:absolute; width:6px; height:6px; left:0; top:'+fltop+'px;', { d:this.svgs.g1, fill:cc.text, stroke:'none'});
|
|
4496
|
-
//this.c[3] = this.dom( 'path', this.css.basic + 'position:absolute; width:10px; height:10px; left:0; top:'+fltop+'px;', { d:this.svgs.group, fill:cc.text, stroke:'none'})
|
|
4497
|
-
//this.c[3] = this.dom( 'path', this.css.basic + 'position:absolute; width:10px; height:10px; left:0; top:'+fltop+'px;', { d:this.svgs.group, fill:cc.text, stroke:'none'})
|
|
4498
|
-
//this.c[4] = this.dom( 'path', this.css.basic + 'position:absolute; width:10px; height:10px; left:'+(this.decal-1)+'px; top:'+fltop+'px;', { d:this.svgs.arrow, fill:cc.text, stroke:'none'})
|
|
4499
4524
|
|
|
4525
|
+
let bh = this.mtop === 0 ? this.margin : this.mtop;
|
|
4526
|
+
|
|
4527
|
+
this.c[4] = this.dom( 'div', this.css.basic + 'width:100%; left:0; height:'+(bh+1)+'px; top:'+((this.h-1))+'px; background:none;');
|
|
4500
4528
|
|
|
4501
|
-
|
|
4502
|
-
// bottom line
|
|
4503
|
-
if( this.isLine ) this.c[5] = this.dom( 'div', this.css.basic + 'background:rgba(255, 255, 255, 0.2); width:100%; left:0; height:1px; bottom:0px');
|
|
4504
|
-
//else this.c[5] = this.dom( 'div', this.css.basic + 'width:100%; left:0; height:auto; top:'+(this.h-1)+'px')
|
|
4505
|
-
|
|
4506
|
-
let s = this.s;
|
|
4507
|
-
s[0].height = this.h + 'px';
|
|
4529
|
+
this.s;
|
|
4508
4530
|
this.c[1].name = 'group';
|
|
4509
4531
|
|
|
4510
|
-
if( cc.groups !== 'none' ){
|
|
4511
|
-
|
|
4512
|
-
s[1].background = cc.groups;
|
|
4513
|
-
s[1].border = cc.borderSize+'px solid '+ cc.border;
|
|
4514
|
-
s[1].borderRadius = this.radius+'px';
|
|
4515
|
-
|
|
4516
|
-
//s[5].border = '2px solid ' + '#000'
|
|
4517
|
-
//s[1].marginRight = 10+'px';
|
|
4518
|
-
}
|
|
4519
|
-
|
|
4520
|
-
//this.c[1].innerHTML = this.dd + this.name
|
|
4521
|
-
|
|
4522
|
-
//s[1].padding = '0px ' + (10+this.decal)+'px';
|
|
4523
|
-
|
|
4524
|
-
s[1].lineHeight = this.h-4;
|
|
4525
|
-
s[1].color = cc.text;
|
|
4526
|
-
//s[1].fontWeight = 'bold';
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
4532
|
this.init();
|
|
4533
4533
|
|
|
4534
|
-
if( this.radius !== 0 ){
|
|
4535
|
-
//s[0].borderRadius = this.radius+'px'
|
|
4536
|
-
|
|
4537
|
-
s[1].borderRadius = this.radius+'px';
|
|
4538
|
-
s[2].borderRadius = this.radius+'px';
|
|
4539
|
-
}
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
//s[1].paddingLeft = (10+this.decal)+'px'
|
|
4543
|
-
|
|
4544
4534
|
this.setBG( o.bg );
|
|
4545
4535
|
|
|
4546
4536
|
if( o.open ) this.open();
|
|
@@ -4549,22 +4539,33 @@ class Group extends Proto {
|
|
|
4549
4539
|
|
|
4550
4540
|
setBG ( bg ) {
|
|
4551
4541
|
|
|
4552
|
-
this.colors;
|
|
4553
|
-
|
|
4542
|
+
const cc = this.colors;
|
|
4554
4543
|
const s = this.s;
|
|
4555
4544
|
|
|
4556
|
-
|
|
4545
|
+
if( bg !== undefined ) cc.groups = bg;
|
|
4546
|
+
if(cc.groups === 'none') cc.groups = cc.background;
|
|
4547
|
+
cc.background = 'none';
|
|
4548
|
+
|
|
4549
|
+
s[0].background = 'none';
|
|
4550
|
+
s[1].background = cc.groups;
|
|
4551
|
+
s[2].background = cc.groups;
|
|
4557
4552
|
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4553
|
+
if( cc.gborder !== 'none' ){
|
|
4554
|
+
s[1].border = cc.borderSize+'px solid '+ cc.gborder;
|
|
4555
|
+
}
|
|
4561
4556
|
|
|
4562
|
-
|
|
4563
|
-
// s[5].background = '#000'
|
|
4557
|
+
if( this.radius !== 0 ){
|
|
4564
4558
|
|
|
4559
|
+
s[1].borderRadius = this.radius+'px';
|
|
4560
|
+
s[2].borderRadius = this.radius+'px';
|
|
4565
4561
|
|
|
4562
|
+
}
|
|
4566
4563
|
|
|
4567
|
-
this.uis.length;
|
|
4564
|
+
/*let i = this.uis.length;
|
|
4565
|
+
while(i--){
|
|
4566
|
+
this.uis[i].setBG( 'none' );
|
|
4567
|
+
//this.uis[i].setBG( this.colors.background );
|
|
4568
|
+
}*/
|
|
4568
4569
|
|
|
4569
4570
|
}
|
|
4570
4571
|
|
|
@@ -4575,11 +4576,13 @@ class Group extends Proto {
|
|
|
4575
4576
|
|
|
4576
4577
|
let name = '';
|
|
4577
4578
|
|
|
4578
|
-
if( l.y < this.baseH ) name = 'title';
|
|
4579
|
+
if( l.y < this.baseH + this.margin ) name = 'title';
|
|
4579
4580
|
else {
|
|
4580
4581
|
if( this.isOpen ) name = 'content';
|
|
4581
4582
|
}
|
|
4582
4583
|
|
|
4584
|
+
//console.log(name)
|
|
4585
|
+
|
|
4583
4586
|
return name;
|
|
4584
4587
|
|
|
4585
4588
|
}
|
|
@@ -4623,16 +4626,23 @@ class Group extends Proto {
|
|
|
4623
4626
|
switch( name ){
|
|
4624
4627
|
|
|
4625
4628
|
case 'content':
|
|
4626
|
-
|
|
4629
|
+
|
|
4630
|
+
//this.cursor()
|
|
4631
|
+
|
|
4632
|
+
//if( this.marginDiv ) e.clientY -= this.margin * 0.5
|
|
4627
4633
|
|
|
4628
4634
|
if( Roots.isMobile && type === 'mousedown' ) this.getNext( e, change );
|
|
4629
4635
|
|
|
4630
|
-
if( this.proto )
|
|
4636
|
+
if( this.proto ){
|
|
4637
|
+
//e.clientY -= this.margin
|
|
4638
|
+
protoChange = this.proto.handleEvent( e );
|
|
4639
|
+
}
|
|
4631
4640
|
|
|
4632
4641
|
if( !Roots.lock ) this.getNext( e, change );
|
|
4633
4642
|
|
|
4634
4643
|
break;
|
|
4635
4644
|
case 'title':
|
|
4645
|
+
//this.cursor( this.isOpen ? 'n-resize':'s-resize' );
|
|
4636
4646
|
this.cursor('pointer');
|
|
4637
4647
|
if( type === 'mousedown' ){
|
|
4638
4648
|
if( this.isOpen ) this.close();
|
|
@@ -4690,6 +4700,9 @@ class Group extends Proto {
|
|
|
4690
4700
|
}
|
|
4691
4701
|
|
|
4692
4702
|
let u = this.ADD.apply( this, a );
|
|
4703
|
+
//u.margin += this.margin
|
|
4704
|
+
|
|
4705
|
+
//console.log( u.margin )
|
|
4693
4706
|
|
|
4694
4707
|
this.uis.push( u );
|
|
4695
4708
|
|
|
@@ -4749,9 +4762,9 @@ class Group extends Proto {
|
|
|
4749
4762
|
let id = this.uis.indexOf( n );
|
|
4750
4763
|
|
|
4751
4764
|
if ( id !== -1 ) {
|
|
4752
|
-
this.calc( - ( this.uis[ id ].h +
|
|
4765
|
+
this.calc( - ( this.uis[ id ].h + this.margin ) );
|
|
4753
4766
|
this.c[2].removeChild( this.uis[ id ].c[0] );
|
|
4754
|
-
this.uis.splice( id, 1 );
|
|
4767
|
+
this.uis.splice( id, 1 );
|
|
4755
4768
|
|
|
4756
4769
|
if( this.uis.length === 0 ){
|
|
4757
4770
|
this.isEmpty = true;
|
|
@@ -4768,13 +4781,16 @@ class Group extends Proto {
|
|
|
4768
4781
|
super.open();
|
|
4769
4782
|
|
|
4770
4783
|
this.setSvg( this.c[3], 'd', this.svgs.g2 );
|
|
4771
|
-
|
|
4772
|
-
//this.setSvg( this.c[4], 'd', this.svgs.arrowDown )
|
|
4773
4784
|
this.rSizeContent();
|
|
4774
4785
|
|
|
4775
|
-
this.h - this.baseH
|
|
4786
|
+
//let t = this.h - this.baseH
|
|
4776
4787
|
|
|
4777
4788
|
const s = this.s;
|
|
4789
|
+
const cc = this.colors;
|
|
4790
|
+
|
|
4791
|
+
//s[2].top = (this.h-1) + 'px'
|
|
4792
|
+
s[2].top = (this.h+this.mtop) + 'px';
|
|
4793
|
+
s[4].background = cc.groups;//'#0f0'
|
|
4778
4794
|
|
|
4779
4795
|
if(this.radius){
|
|
4780
4796
|
|
|
@@ -4786,10 +4802,18 @@ class Group extends Proto {
|
|
|
4786
4802
|
s[2].borderBottomLeftRadius = this.radius+'px';
|
|
4787
4803
|
s[2].borderBottomRightRadius = this.radius+'px';
|
|
4788
4804
|
}
|
|
4789
|
-
|
|
4790
4805
|
|
|
4806
|
+
if( cc.gborder !== 'none' ){
|
|
4807
|
+
|
|
4808
|
+
s[4].borderLeft = cc.borderSize+'px solid '+ cc.gborder;
|
|
4809
|
+
s[4].borderRight = cc.borderSize+'px solid '+ cc.gborder;
|
|
4791
4810
|
|
|
4811
|
+
s[2].border = cc.borderSize+'px solid '+ cc.gborder;
|
|
4812
|
+
s[2].borderTop = 'none';
|
|
4813
|
+
s[1].borderBottom = cc.borderSize+'px solid rgba(0,0,0,0)';
|
|
4792
4814
|
|
|
4815
|
+
}
|
|
4816
|
+
|
|
4793
4817
|
this.parentHeight();
|
|
4794
4818
|
|
|
4795
4819
|
}
|
|
@@ -4798,15 +4822,28 @@ class Group extends Proto {
|
|
|
4798
4822
|
|
|
4799
4823
|
super.close();
|
|
4800
4824
|
|
|
4801
|
-
this.h - this.baseH
|
|
4825
|
+
//let t = this.h - this.baseH
|
|
4802
4826
|
|
|
4803
4827
|
this.setSvg( this.c[3], 'd', this.svgs.g1 );
|
|
4804
4828
|
|
|
4805
|
-
//this.setSvg( this.c[4], 'd', this.svgs.arrow )
|
|
4806
4829
|
this.h = this.baseH;
|
|
4807
4830
|
|
|
4808
4831
|
const s = this.s;
|
|
4832
|
+
const cc = this.colors;
|
|
4833
|
+
|
|
4809
4834
|
s[0].height = this.h + 'px';
|
|
4835
|
+
//s[1].height = (this.h-2) + 'px'
|
|
4836
|
+
//s[2].top = this.h + 'px'
|
|
4837
|
+
s[2].top = (this.h+this.mtop) + 'px';
|
|
4838
|
+
s[4].background = 'none';
|
|
4839
|
+
|
|
4840
|
+
if( cc.gborder !== 'none' ){
|
|
4841
|
+
|
|
4842
|
+
s[4].border = 'none';
|
|
4843
|
+
s[2].border = 'none';
|
|
4844
|
+
s[1].border = cc.borderSize+'px solid '+ cc.gborder;
|
|
4845
|
+
}
|
|
4846
|
+
|
|
4810
4847
|
if(this.radius) s[1].borderRadius = this.radius+'px';
|
|
4811
4848
|
|
|
4812
4849
|
this.parentHeight();
|
|
@@ -4816,7 +4853,8 @@ class Group extends Proto {
|
|
|
4816
4853
|
calcUis () {
|
|
4817
4854
|
|
|
4818
4855
|
if( !this.isOpen ) this.h = this.baseH;
|
|
4819
|
-
else this.h = Roots.calcUis( this.uis, this.zone, this.zone.y + this.baseH ) + this.baseH;
|
|
4856
|
+
//else this.h = Roots.calcUis( this.uis, this.zone, this.zone.y + this.baseH ) + this.baseH;
|
|
4857
|
+
else this.h = Roots.calcUis( this.uis, this.zone, this.zone.y + this.baseH + this.margin ) + this.baseH;
|
|
4820
4858
|
|
|
4821
4859
|
this.s[0].height = this.h + 'px';
|
|
4822
4860
|
|
|
@@ -4857,19 +4895,30 @@ class Group extends Proto {
|
|
|
4857
4895
|
this.w = this.w - this.decal;
|
|
4858
4896
|
|
|
4859
4897
|
s[3].left = ( this.sa + this.sb - 6 ) + 'px';
|
|
4860
|
-
//s[1].width = this.isbgGroup ? (this.w-5) + 'px' : this.w + 'px'
|
|
4861
4898
|
|
|
4862
4899
|
s[1].width = this.w + 'px';
|
|
4863
4900
|
s[2].width = this.w + 'px';
|
|
4864
|
-
//s[1].width = (this.w - this.decal) + 'px'
|
|
4865
|
-
//s[2].width = (this.w - this.decal) + 'px'
|
|
4866
|
-
|
|
4867
4901
|
s[1].left = (this.decal) + 'px';
|
|
4868
4902
|
s[2].left = (this.decal) + 'px';
|
|
4869
4903
|
|
|
4904
|
+
if( this.isOpen ) this.rSizeContent();
|
|
4905
|
+
|
|
4906
|
+
}
|
|
4870
4907
|
|
|
4908
|
+
//
|
|
4871
4909
|
|
|
4872
|
-
|
|
4910
|
+
uiout() {
|
|
4911
|
+
|
|
4912
|
+
if( this.lock ) return;
|
|
4913
|
+
if(this.s) this.s[0].background = this.colors.background;
|
|
4914
|
+
|
|
4915
|
+
}
|
|
4916
|
+
|
|
4917
|
+
uiover() {
|
|
4918
|
+
|
|
4919
|
+
if( this.lock ) return;
|
|
4920
|
+
//if( this.isOpen ) return;
|
|
4921
|
+
if(this.s) this.s[0].background = this.colors.backgroundOver;
|
|
4873
4922
|
|
|
4874
4923
|
}
|
|
4875
4924
|
|
|
@@ -4905,7 +4954,6 @@ class Joystick extends Proto {
|
|
|
4905
4954
|
this.distance = (this.diam*0.5)*0.25;
|
|
4906
4955
|
|
|
4907
4956
|
this.h = o.h || this.w + 10;
|
|
4908
|
-
this.top = 0;
|
|
4909
4957
|
|
|
4910
4958
|
this.c[0].style.width = this.w +'px';
|
|
4911
4959
|
|
|
@@ -5019,7 +5067,7 @@ class Joystick extends Proto {
|
|
|
5019
5067
|
//this.tmp.y = this.radius - ( e.clientY - this.zone.y - this.top );
|
|
5020
5068
|
|
|
5021
5069
|
this.tmp.x = (this.w*0.5) - ( e.clientX - this.zone.x );
|
|
5022
|
-
this.tmp.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.
|
|
5070
|
+
this.tmp.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.ytop );
|
|
5023
5071
|
|
|
5024
5072
|
let distance = this.tmp.length();
|
|
5025
5073
|
|
|
@@ -5137,7 +5185,6 @@ class Knob extends Proto {
|
|
|
5137
5185
|
this.offset = new V2();
|
|
5138
5186
|
|
|
5139
5187
|
this.h = o.h || this.w + 10;
|
|
5140
|
-
this.top = 0;
|
|
5141
5188
|
|
|
5142
5189
|
this.c[0].style.width = this.w +'px';
|
|
5143
5190
|
this.c[0].style.display = 'block';
|
|
@@ -5256,7 +5303,7 @@ class Knob extends Proto {
|
|
|
5256
5303
|
//off.y = this.radius - ( e.clientY - this.zone.y - this.top );
|
|
5257
5304
|
|
|
5258
5305
|
off.x = (this.w*0.5) - ( e.clientX - this.zone.x );
|
|
5259
|
-
off.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.
|
|
5306
|
+
off.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.ytop );
|
|
5260
5307
|
|
|
5261
5308
|
this.r = - Math.atan2( off.x, off.y );
|
|
5262
5309
|
|
|
@@ -5390,9 +5437,10 @@ class List extends Proto {
|
|
|
5390
5437
|
this.tmpImage = {};
|
|
5391
5438
|
this.tmpUrl = [];
|
|
5392
5439
|
|
|
5393
|
-
|
|
5440
|
+
this.m = o.m !== undefined ? o.m : 5;
|
|
5441
|
+
|
|
5394
5442
|
|
|
5395
|
-
let align = o.align || '
|
|
5443
|
+
let align = o.align || 'left';
|
|
5396
5444
|
|
|
5397
5445
|
// scroll size
|
|
5398
5446
|
let ss = o.scrollSize || 10;
|
|
@@ -5415,7 +5463,7 @@ class List extends Proto {
|
|
|
5415
5463
|
let cc = this.colors;
|
|
5416
5464
|
|
|
5417
5465
|
this.c[2] = this.dom( 'div', this.css.basic + 'top:0; display:none; border-radius:'+this.radius+'px;' );
|
|
5418
|
-
this.c[3] = this.dom( 'div', this.css.item + 'position:absolute; text-align:'+align+'; line-height:'+(this.h-4)+'px; top:1px; background:'+cc.button+'; height:'+(this.h-2)+'px; border:1px solid '+cc.border+'; border-radius:'+this.radius+'px;' );
|
|
5466
|
+
this.c[3] = this.dom( 'div', this.css.item + 'padding:0px '+this.m+'px; margin-bottom:0px; position:absolute; justify-content:'+align+'; text-align:'+align+'; line-height:'+(this.h-4)+'px; top:1px; background:'+cc.button+'; height:'+(this.h-2)+'px; border:1px solid '+cc.border+'; border-radius:'+this.radius+'px;' );
|
|
5419
5467
|
this.c[4] = this.dom( 'path', this.css.basic + 'position:absolute; width:6px; height:6px; top:'+fltop+'px;', { d:this.svgs.g1, fill:cc.text, stroke:'none'});
|
|
5420
5468
|
|
|
5421
5469
|
this.scrollerBack = this.dom( 'div', this.css.basic + 'right:0px; width:'+ss+'px; background:'+cc.back+'; display:none;');
|
|
@@ -5427,12 +5475,12 @@ class List extends Proto {
|
|
|
5427
5475
|
this.list = [];
|
|
5428
5476
|
this.refObject = null;
|
|
5429
5477
|
|
|
5430
|
-
if(o.list){
|
|
5478
|
+
if( o.list ){
|
|
5431
5479
|
if( o.list instanceof Array ){
|
|
5432
5480
|
this.list = o.list;
|
|
5433
|
-
} else {
|
|
5481
|
+
} else if( o.list instanceof Object ){
|
|
5434
5482
|
this.refObject = o.list;
|
|
5435
|
-
for( let g in this.refObject ) this.list.push(g);
|
|
5483
|
+
for( let g in this.refObject ) this.list.push( g );
|
|
5436
5484
|
}
|
|
5437
5485
|
}
|
|
5438
5486
|
|
|
@@ -5442,7 +5490,7 @@ class List extends Proto {
|
|
|
5442
5490
|
|
|
5443
5491
|
this.baseH = this.h;
|
|
5444
5492
|
|
|
5445
|
-
this.itemHeight = o.itemHeight || (this.h-3);
|
|
5493
|
+
this.itemHeight = o.itemHeight || this.h;//(this.h-3);
|
|
5446
5494
|
|
|
5447
5495
|
// force full list
|
|
5448
5496
|
this.full = o.full || false;
|
|
@@ -5463,7 +5511,6 @@ class List extends Proto {
|
|
|
5463
5511
|
this.c[2].style.top = 'auto';
|
|
5464
5512
|
this.c[3].style.top = 'auto';
|
|
5465
5513
|
this.c[4].style.top = 'auto';
|
|
5466
|
-
//this.c[5].style.top = 'auto';
|
|
5467
5514
|
|
|
5468
5515
|
this.c[2].style.bottom = this.h-2 + 'px';
|
|
5469
5516
|
this.c[3].style.bottom = '1px';
|
|
@@ -5519,14 +5566,9 @@ class List extends Proto {
|
|
|
5519
5566
|
this.init();
|
|
5520
5567
|
if( this.isOpenOnStart ) this.open( true );
|
|
5521
5568
|
|
|
5522
|
-
|
|
5569
|
+
this.baseH += this.mtop;
|
|
5523
5570
|
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
super.send( v );
|
|
5527
|
-
|
|
5528
|
-
//Proto.prototype.send.call( this, v );
|
|
5529
|
-
}*/
|
|
5571
|
+
}
|
|
5530
5572
|
|
|
5531
5573
|
// image list
|
|
5532
5574
|
|
|
@@ -5717,9 +5759,9 @@ class List extends Proto {
|
|
|
5717
5759
|
this.value = this.list[ this.current.id ];
|
|
5718
5760
|
|
|
5719
5761
|
if( this.isSelectable ) this.selected();
|
|
5720
|
-
|
|
5721
|
-
//this.
|
|
5722
|
-
this.send( this.
|
|
5762
|
+
|
|
5763
|
+
//this.send( this.refObject !== null ? this.refObject[ this.list[this.current.id]] : this.value );
|
|
5764
|
+
this.send( this.value );
|
|
5723
5765
|
|
|
5724
5766
|
if( !this.listOnly ) {
|
|
5725
5767
|
this.close();
|
|
@@ -5751,6 +5793,7 @@ class List extends Proto {
|
|
|
5751
5793
|
this.modeScroll(1);
|
|
5752
5794
|
if( this.isDown ){
|
|
5753
5795
|
this.modeScroll(2);
|
|
5796
|
+
//this.update( ( e.clientY - top ) - ( this.sh*0.5 ) );
|
|
5754
5797
|
let top = this.zone.y+this.baseH-2;
|
|
5755
5798
|
this.update( ( e.clientY - top ) - ( this.sh*0.5 ) );
|
|
5756
5799
|
}
|
|
@@ -5894,8 +5937,8 @@ class List extends Proto {
|
|
|
5894
5937
|
for( let i=0; i<this.length; i++ ){
|
|
5895
5938
|
|
|
5896
5939
|
n = this.list[i];
|
|
5897
|
-
item = this.dom( 'div', this.css.item + 'width:'+this.ww+'px; height:'+this.itemHeight+'px; line-height:'+(this.itemHeight-
|
|
5898
|
-
item.name = 'item'+i;
|
|
5940
|
+
item = this.dom( 'div', this.css.item + 'padding:0px '+(this.m+1)+'px; width:'+this.ww+'px; height:'+this.itemHeight+'px; line-height:'+(this.itemHeight-2)+'px; color:'+this.colors.text+'; background:'+this.colors.back+';' );
|
|
5941
|
+
item.name = 'item'+ i;
|
|
5899
5942
|
item.id = i;
|
|
5900
5943
|
item.select = false;
|
|
5901
5944
|
item.posy = (this.itemHeight+1)*i;
|
|
@@ -5912,6 +5955,8 @@ class List extends Proto {
|
|
|
5912
5955
|
let c = new Image();
|
|
5913
5956
|
c.src = this.tmpCanvas.toDataURL();
|
|
5914
5957
|
|
|
5958
|
+
//item.style.marginLeft = (this.imageSize[0]+8)+'px'
|
|
5959
|
+
|
|
5915
5960
|
|
|
5916
5961
|
/*let c = document.createElement('canvas')
|
|
5917
5962
|
|
|
@@ -5920,7 +5965,11 @@ class List extends Proto {
|
|
|
5920
5965
|
let ctx = c.getContext("2d")
|
|
5921
5966
|
ctx.fillStyle = this.canvasBg
|
|
5922
5967
|
ctx.fillRect(0, 0, this.imageSize[0], this.imageSize[1])*/
|
|
5923
|
-
|
|
5968
|
+
|
|
5969
|
+
//c.style.cssText = 'position:relative; pointer-events:none; display:inline-block; float:left; margin-left:0px; margin-right:5px; top:2px'
|
|
5970
|
+
// c.style.cssText =' flex-shrink: 0;'
|
|
5971
|
+
|
|
5972
|
+
c.style.cssText ='margin-right:4px;';
|
|
5924
5973
|
|
|
5925
5974
|
|
|
5926
5975
|
//c.style.cssText = 'display:flex; align-content: flex-start; flex-wrap: wrap;'
|
|
@@ -5931,12 +5980,12 @@ class List extends Proto {
|
|
|
5931
5980
|
|
|
5932
5981
|
}
|
|
5933
5982
|
|
|
5934
|
-
if(this.dragout){
|
|
5983
|
+
if( this.dragout ){
|
|
5935
5984
|
|
|
5936
5985
|
item.img = this.tmpImage[n];
|
|
5937
5986
|
|
|
5938
5987
|
item.style.pointerEvents = 'auto';
|
|
5939
|
-
item.draggable="true";
|
|
5988
|
+
item.draggable = "true";
|
|
5940
5989
|
|
|
5941
5990
|
item.addEventListener('dragstart', this.dragstart || function(){ /*console.log('drag start')*/});
|
|
5942
5991
|
item.addEventListener('drag', this.drag || function(){ /*console.log('drag start')*/});
|
|
@@ -5956,6 +6005,7 @@ class List extends Proto {
|
|
|
5956
6005
|
}
|
|
5957
6006
|
|
|
5958
6007
|
drawImage( name, image, x,y,w,h ){
|
|
6008
|
+
|
|
5959
6009
|
this.tmpCtx.clearRect(0, 0, this.imageSize[0], this.imageSize[1]);
|
|
5960
6010
|
this.tmpCtx.drawImage(image, x, y, w, h, 0, 0, this.imageSize[0], this.imageSize[1]);
|
|
5961
6011
|
this.tmpImage[name].src = this.tmpCanvas.toDataURL();
|
|
@@ -5986,18 +6036,20 @@ class List extends Proto {
|
|
|
5986
6036
|
|
|
5987
6037
|
setTopItem (){
|
|
5988
6038
|
|
|
5989
|
-
if(this.staticTop) return;
|
|
6039
|
+
if( this.staticTop ) return;
|
|
5990
6040
|
|
|
5991
|
-
if( this.isWithImage ){
|
|
6041
|
+
if( this.isWithImage ){
|
|
5992
6042
|
|
|
5993
|
-
if(
|
|
6043
|
+
if(!this.preLoadComplete ) return;
|
|
5994
6044
|
|
|
5995
6045
|
if(!this.c[3].children.length){
|
|
5996
6046
|
this.canvas = document.createElement('canvas');
|
|
5997
6047
|
this.canvas.width = this.imageSize[0];
|
|
5998
6048
|
this.canvas.height = this.imageSize[1];
|
|
5999
|
-
this.canvas.style.cssText =
|
|
6049
|
+
this.canvas.style.cssText ='margin-right:4px;';
|
|
6000
6050
|
this.ctx = this.canvas.getContext("2d");
|
|
6051
|
+
this.c[3].style.textAlign = 'left';
|
|
6052
|
+
this.c[3].style.justifyContent = 'left';
|
|
6001
6053
|
this.c[3].appendChild( this.canvas );
|
|
6002
6054
|
}
|
|
6003
6055
|
|
|
@@ -6014,13 +6066,11 @@ class List extends Proto {
|
|
|
6014
6066
|
this.canvas = document.createElement('canvas');
|
|
6015
6067
|
this.canvas.width = this.imageSize[0];
|
|
6016
6068
|
this.canvas.height = this.imageSize[1];
|
|
6017
|
-
|
|
6018
|
-
this.canvas.style.cssText = 'position:relative; pointer-events:none; display:inline-block; float:left; margin-left:0px; margin-right:5px; top:2px';
|
|
6019
|
-
//this.canvas.style.cssText = 'position:absolute; top:'+h+'px; left:5px;'
|
|
6069
|
+
this.canvas.style.cssText ='margin-right:4px;';
|
|
6020
6070
|
this.ctx = this.canvas.getContext("2d");
|
|
6021
6071
|
this.c[3].style.textAlign = 'left';
|
|
6072
|
+
this.c[3].style.justifyContent = 'left';
|
|
6022
6073
|
this.c[3].appendChild( this.canvas );
|
|
6023
|
-
|
|
6024
6074
|
}
|
|
6025
6075
|
|
|
6026
6076
|
this.ctx.drawImage( this.tmpImage[ this.value ], 0, 0 );
|
|
@@ -6165,7 +6215,6 @@ class Numeric extends Proto {
|
|
|
6165
6215
|
this.allway = o.allway || false;
|
|
6166
6216
|
|
|
6167
6217
|
this.isDown = false;
|
|
6168
|
-
|
|
6169
6218
|
this.value = [0];
|
|
6170
6219
|
this.multy = 1;
|
|
6171
6220
|
this.invmulty = 1;
|
|
@@ -6182,10 +6231,10 @@ class Numeric extends Proto {
|
|
|
6182
6231
|
this.isDrag = o.drag || false;
|
|
6183
6232
|
|
|
6184
6233
|
if( o.value !== undefined ){
|
|
6185
|
-
if(!isNaN(o.value)){
|
|
6234
|
+
if( !isNaN(o.value) ){
|
|
6186
6235
|
this.value = [o.value];
|
|
6187
6236
|
} else if( o.value instanceof Array ){
|
|
6188
|
-
this.value = o.value;
|
|
6237
|
+
this.value = o.value;
|
|
6189
6238
|
this.isSingle = false;
|
|
6190
6239
|
} else if( o.value instanceof Object ){
|
|
6191
6240
|
this.value = [];
|
|
@@ -6193,16 +6242,14 @@ class Numeric extends Proto {
|
|
|
6193
6242
|
if( o.value.y !== undefined ) this.value[1] = o.value.y;
|
|
6194
6243
|
if( o.value.z !== undefined ) this.value[2] = o.value.z;
|
|
6195
6244
|
if( o.value.w !== undefined ) this.value[3] = o.value.w;
|
|
6196
|
-
this.isVector = true;
|
|
6197
6245
|
this.isSingle = false;
|
|
6246
|
+
this.isVector = true;
|
|
6198
6247
|
}
|
|
6199
6248
|
}
|
|
6200
6249
|
|
|
6201
6250
|
this.lng = this.value.length;
|
|
6202
6251
|
this.tmp = [];
|
|
6203
6252
|
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
6253
|
this.current = -1;
|
|
6207
6254
|
this.prev = { x:0, y:0, d:0, v:0 };
|
|
6208
6255
|
|
|
@@ -6216,24 +6263,23 @@ class Numeric extends Proto {
|
|
|
6216
6263
|
let i = this.lng;
|
|
6217
6264
|
while(i--){
|
|
6218
6265
|
|
|
6219
|
-
if(this.isAngle) this.value[i] = (this.value[i] * 180 / Math.PI).toFixed( this.precision );
|
|
6220
|
-
this.c[3+i] = this.dom( 'div', this.css.txtselect + ' height:'+(this.h-
|
|
6266
|
+
if( this.isAngle ) this.value[i] = (this.value[i] * 180 / Math.PI).toFixed( this.precision );
|
|
6267
|
+
this.c[3+i] = this.dom( 'div', this.css.txtselect + 'top:1px; height:'+(this.h-2)+'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border+'; border-radius:'+this.radius+'px;');
|
|
6221
6268
|
if(o.center) this.c[2+i].style.textAlign = 'center';
|
|
6222
6269
|
this.c[3+i].textContent = this.value[i];
|
|
6223
6270
|
this.c[3+i].style.color = this.colors.text;
|
|
6224
6271
|
this.c[3+i].isNum = true;
|
|
6225
|
-
|
|
6226
6272
|
this.cMode[i] = 0;
|
|
6227
6273
|
|
|
6228
6274
|
}
|
|
6229
6275
|
|
|
6230
6276
|
// selection
|
|
6231
6277
|
this.selectId = 3 + this.lng;
|
|
6232
|
-
this.c[this.selectId] = this.dom( 'div', this.css.txtselect + 'position:absolute; top:
|
|
6278
|
+
this.c[this.selectId] = this.dom( 'div', this.css.txtselect + 'position:absolute; top:2px; height:' + (this.h-4) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;');
|
|
6233
6279
|
|
|
6234
6280
|
// cursor
|
|
6235
6281
|
this.cursorId = 4 + this.lng;
|
|
6236
|
-
this.c[ this.cursorId ] = this.dom( 'div', this.css.basic + 'top:
|
|
6282
|
+
this.c[ this.cursorId ] = this.dom( 'div', this.css.basic + 'top:2px; height:' + (this.h-4) + 'px; width:0px; background:'+cc.text+';' );
|
|
6237
6283
|
|
|
6238
6284
|
this.init();
|
|
6239
6285
|
}
|
|
@@ -6241,42 +6287,19 @@ class Numeric extends Proto {
|
|
|
6241
6287
|
testZone ( e ) {
|
|
6242
6288
|
|
|
6243
6289
|
let l = this.local;
|
|
6244
|
-
if( l.x === -1 && l.y === -1 ) return ''
|
|
6290
|
+
if( l.x === -1 && l.y === -1 ) return ''
|
|
6245
6291
|
|
|
6246
6292
|
let i = this.lng;
|
|
6247
6293
|
let t = this.tmp;
|
|
6248
|
-
|
|
6249
6294
|
|
|
6250
6295
|
while( i-- ){
|
|
6251
|
-
if( l.x>t[i][0] && l.x<t[i][2] ) return i
|
|
6296
|
+
if( l.x>t[i][0] && l.x<t[i][2] ) return i
|
|
6252
6297
|
}
|
|
6253
6298
|
|
|
6254
|
-
return ''
|
|
6299
|
+
return ''
|
|
6255
6300
|
|
|
6256
6301
|
}
|
|
6257
6302
|
|
|
6258
|
-
/* mode: function ( n, name ) {
|
|
6259
|
-
|
|
6260
|
-
if( n === this.cMode[name] ) return false;
|
|
6261
|
-
|
|
6262
|
-
//let m;
|
|
6263
|
-
|
|
6264
|
-
/*switch(n){
|
|
6265
|
-
|
|
6266
|
-
case 0: m = this.colors.border; break;
|
|
6267
|
-
case 1: m = this.colors.borderOver; break;
|
|
6268
|
-
case 2: m = this.colors.borderSelect; break;
|
|
6269
|
-
|
|
6270
|
-
}*/
|
|
6271
|
-
|
|
6272
|
-
/* this.reset();
|
|
6273
|
-
//this.c[name+2].style.borderColor = m;
|
|
6274
|
-
this.cMode[name] = n;
|
|
6275
|
-
|
|
6276
|
-
return true;
|
|
6277
|
-
|
|
6278
|
-
},*/
|
|
6279
|
-
|
|
6280
6303
|
// ----------------------
|
|
6281
6304
|
// EVENTS
|
|
6282
6305
|
// ----------------------
|
|
@@ -6289,25 +6312,13 @@ class Numeric extends Proto {
|
|
|
6289
6312
|
this.isDown = true;
|
|
6290
6313
|
if( name !== '' ){
|
|
6291
6314
|
this.current = name;
|
|
6292
|
-
this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] )
|
|
6315
|
+
this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] ) };
|
|
6293
6316
|
this.setInput( this.c[ 3 + this.current ] );
|
|
6294
6317
|
}
|
|
6295
|
-
return this.mousemove( e )
|
|
6318
|
+
return this.mousemove( e )
|
|
6296
6319
|
}
|
|
6297
6320
|
|
|
6298
|
-
return false
|
|
6299
|
-
/*
|
|
6300
|
-
|
|
6301
|
-
if( name === '' ) return false;
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
this.current = name;
|
|
6305
|
-
this.isDown = true;
|
|
6306
|
-
|
|
6307
|
-
this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] ) };
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
return this.mode( 2, name );*/
|
|
6321
|
+
return false
|
|
6311
6322
|
|
|
6312
6323
|
}
|
|
6313
6324
|
|
|
@@ -6316,35 +6327,12 @@ class Numeric extends Proto {
|
|
|
6316
6327
|
if( this.isDown ){
|
|
6317
6328
|
|
|
6318
6329
|
this.isDown = false;
|
|
6319
|
-
//this.current = -1;
|
|
6320
6330
|
this.prev = { x:0, y:0, d:0, v:0 };
|
|
6321
6331
|
|
|
6322
|
-
return this.mousemove( e )
|
|
6332
|
+
return this.mousemove( e )
|
|
6323
6333
|
}
|
|
6324
6334
|
|
|
6325
|
-
return false
|
|
6326
|
-
|
|
6327
|
-
/*let name = this.testZone( e );
|
|
6328
|
-
this.isDown = false;
|
|
6329
|
-
|
|
6330
|
-
if( this.current !== -1 ){
|
|
6331
|
-
|
|
6332
|
-
//let tm = this.current;
|
|
6333
|
-
let td = this.prev.d;
|
|
6334
|
-
|
|
6335
|
-
this.current = -1;
|
|
6336
|
-
this.prev = { x:0, y:0, d:0, v:0 };
|
|
6337
|
-
|
|
6338
|
-
if( !td ){
|
|
6339
|
-
|
|
6340
|
-
this.setInput( this.c[ 3 + name ] );
|
|
6341
|
-
return true;//this.mode( 2, name );
|
|
6342
|
-
|
|
6343
|
-
} else {
|
|
6344
|
-
return this.reset();//this.mode( 0, tm );
|
|
6345
|
-
}
|
|
6346
|
-
|
|
6347
|
-
}*/
|
|
6335
|
+
return false
|
|
6348
6336
|
|
|
6349
6337
|
}
|
|
6350
6338
|
|
|
@@ -6386,38 +6374,20 @@ class Numeric extends Proto {
|
|
|
6386
6374
|
|
|
6387
6375
|
if( this.isDown ) x = e.clientX - this.zone.x -3;
|
|
6388
6376
|
if( this.current !== -1 ) x -= this.tmp[this.current][0];
|
|
6389
|
-
return this.upInput( x, this.isDown )
|
|
6377
|
+
return this.upInput( x, this.isDown )
|
|
6390
6378
|
|
|
6391
6379
|
}
|
|
6392
6380
|
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
return nup;
|
|
6381
|
+
return nup
|
|
6397
6382
|
|
|
6398
6383
|
}
|
|
6399
6384
|
|
|
6400
|
-
//keydown: function ( e ) { return true; },
|
|
6401
|
-
|
|
6402
6385
|
// ----------------------
|
|
6403
6386
|
|
|
6404
6387
|
reset () {
|
|
6405
6388
|
|
|
6406
6389
|
let nup = false;
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
//this.current = 0;
|
|
6410
|
-
|
|
6411
|
-
/* let i = this.lng;
|
|
6412
|
-
while(i--){
|
|
6413
|
-
if(this.cMode[i]!==0){
|
|
6414
|
-
this.cMode[i] = 0;
|
|
6415
|
-
//this.c[2+i].style.borderColor = this.colors.border;
|
|
6416
|
-
nup = true;
|
|
6417
|
-
}
|
|
6418
|
-
}*/
|
|
6419
|
-
|
|
6420
|
-
return nup;
|
|
6390
|
+
return nup
|
|
6421
6391
|
|
|
6422
6392
|
}
|
|
6423
6393
|
|
|
@@ -6425,17 +6395,12 @@ class Numeric extends Proto {
|
|
|
6425
6395
|
setValue ( v ) {
|
|
6426
6396
|
|
|
6427
6397
|
if( this.isVector ){
|
|
6428
|
-
|
|
6429
6398
|
if( v.x !== undefined ) this.value[0] = v.x;
|
|
6430
6399
|
if( v.y !== undefined ) this.value[1] = v.y;
|
|
6431
6400
|
if( v.z !== undefined ) this.value[2] = v.z;
|
|
6432
6401
|
if( v.w !== undefined ) this.value[3] = v.w;
|
|
6433
|
-
|
|
6434
6402
|
} else {
|
|
6435
|
-
|
|
6436
|
-
if( this.isSingle ) this.value = [v];
|
|
6437
|
-
else this.value = v;
|
|
6438
|
-
|
|
6403
|
+
this.value = this.isSingle ? [v] : v;
|
|
6439
6404
|
}
|
|
6440
6405
|
|
|
6441
6406
|
this.update();
|
|
@@ -6471,9 +6436,7 @@ class Numeric extends Proto {
|
|
|
6471
6436
|
if( this.objectLink !== null ){
|
|
6472
6437
|
|
|
6473
6438
|
if( this.isVector ){
|
|
6474
|
-
|
|
6475
6439
|
this.objectLink[ this.objectKey ].fromArray( v );
|
|
6476
|
-
|
|
6477
6440
|
} else {
|
|
6478
6441
|
this.objectLink[ this.objectKey ] = v;
|
|
6479
6442
|
}
|
|
@@ -6481,7 +6444,6 @@ class Numeric extends Proto {
|
|
|
6481
6444
|
}
|
|
6482
6445
|
|
|
6483
6446
|
if( this.callback ) this.callback( v, this.objectKey );
|
|
6484
|
-
|
|
6485
6447
|
this.isSend = false;
|
|
6486
6448
|
|
|
6487
6449
|
}
|
|
@@ -6497,9 +6459,6 @@ class Numeric extends Proto {
|
|
|
6497
6459
|
let d = this.current !== -1 ? this.tmp[this.current][0] + 5 : 0;
|
|
6498
6460
|
s[this.cursorId].width = '1px';
|
|
6499
6461
|
s[this.cursorId].left = ( d + c ) + 'px';
|
|
6500
|
-
//s[2].left = ( d + e ) + 'px';
|
|
6501
|
-
//s[2].width = w + 'px';
|
|
6502
|
-
|
|
6503
6462
|
s[this.selectId].left = ( d + e ) + 'px';
|
|
6504
6463
|
s[this.selectId].width = w + 'px';
|
|
6505
6464
|
this.c[this.selectId].innerHTML = t;
|
|
@@ -6509,7 +6468,7 @@ class Numeric extends Proto {
|
|
|
6509
6468
|
unselect () {
|
|
6510
6469
|
|
|
6511
6470
|
let s = this.s;
|
|
6512
|
-
if(!s) return
|
|
6471
|
+
if(!s) return
|
|
6513
6472
|
this.c[this.selectId].innerHTML = '';
|
|
6514
6473
|
s[this.selectId].width = 0 + 'px';
|
|
6515
6474
|
s[this.cursorId].width = 0 + 'px';
|
|
@@ -6535,10 +6494,8 @@ class Numeric extends Proto {
|
|
|
6535
6494
|
ar[i] = this.value[i] * this.multy;
|
|
6536
6495
|
}
|
|
6537
6496
|
|
|
6538
|
-
if( !force ) return
|
|
6539
|
-
|
|
6540
|
-
if( this.isSingle ) this.send( ar[0] );
|
|
6541
|
-
else this.send( ar );
|
|
6497
|
+
if( !force ) return
|
|
6498
|
+
this.send( this.isSingle ? ar[0] : ar );
|
|
6542
6499
|
|
|
6543
6500
|
}
|
|
6544
6501
|
|
|
@@ -6845,17 +6802,17 @@ class TextInput extends Proto {
|
|
|
6845
6802
|
let cc = this.colors;
|
|
6846
6803
|
|
|
6847
6804
|
// text
|
|
6848
|
-
this.c[2] = this.dom( 'div', this.css.txtselect + 'height:' + (this.h-
|
|
6805
|
+
this.c[2] = this.dom( 'div', this.css.txtselect + 'top:1px; height:' + (this.h-2) + 'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border+'; border-radius:'+this.radius+'px;' );
|
|
6849
6806
|
this.c[2].textContent = this.value;
|
|
6850
6807
|
|
|
6851
6808
|
// selection
|
|
6852
|
-
this.c[3] = this.dom( 'div', this.css.txtselect + 'position:absolute; top:
|
|
6809
|
+
this.c[3] = this.dom( 'div', this.css.txtselect + 'position:absolute; top:2px; height:' + (this.h-4) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;');
|
|
6853
6810
|
|
|
6854
6811
|
// cursor
|
|
6855
|
-
this.c[4] = this.dom( 'div', this.css.basic + 'top:
|
|
6812
|
+
this.c[4] = this.dom( 'div', this.css.basic + 'top:2px; height:' + (this.h-4) + 'px; width:0px; background:'+cc.text+';' );
|
|
6856
6813
|
|
|
6857
6814
|
// fake
|
|
6858
|
-
this.c[5] = this.dom( 'div', this.css.txtselect + 'height:' + (this.h-
|
|
6815
|
+
this.c[5] = this.dom( 'div', this.css.txtselect + 'top:1px; height:' + (this.h-2) + 'px; border:none; justify-content: center; font-style: italic; color:'+cc.border+';' );
|
|
6859
6816
|
if( this.value === '' ) this.c[5].textContent = this.placeHolder;
|
|
6860
6817
|
|
|
6861
6818
|
|
|
@@ -7072,9 +7029,7 @@ class Select extends Proto {
|
|
|
7072
7029
|
super( o );
|
|
7073
7030
|
|
|
7074
7031
|
this.value = o.value || '';
|
|
7075
|
-
|
|
7076
7032
|
this.isDown = false;
|
|
7077
|
-
|
|
7078
7033
|
this.onActif = o.onActif || function(){};
|
|
7079
7034
|
|
|
7080
7035
|
//let prefix = o.prefix || '';
|
|
@@ -7099,8 +7054,8 @@ class Select extends Proto {
|
|
|
7099
7054
|
testZone ( e ) {
|
|
7100
7055
|
|
|
7101
7056
|
let l = this.local;
|
|
7102
|
-
if( l.x === -1 && l.y === -1 ) return ''
|
|
7103
|
-
if( l.x > this.sa && l.x < this.sa+30 ) return 'over'
|
|
7057
|
+
if( l.x === -1 && l.y === -1 ) return ''
|
|
7058
|
+
if( l.x > this.sa && l.x < this.sa+30 ) return 'over'
|
|
7104
7059
|
return '0'
|
|
7105
7060
|
|
|
7106
7061
|
}
|
|
@@ -7115,10 +7070,10 @@ class Select extends Proto {
|
|
|
7115
7070
|
//this.value = false;
|
|
7116
7071
|
this.isDown = false;
|
|
7117
7072
|
//this.send();
|
|
7118
|
-
return this.mousemove( e )
|
|
7073
|
+
return this.mousemove( e )
|
|
7119
7074
|
}
|
|
7120
7075
|
|
|
7121
|
-
return false
|
|
7076
|
+
return false
|
|
7122
7077
|
|
|
7123
7078
|
}
|
|
7124
7079
|
|
|
@@ -7126,25 +7081,19 @@ class Select extends Proto {
|
|
|
7126
7081
|
|
|
7127
7082
|
let name = this.testZone( e );
|
|
7128
7083
|
|
|
7129
|
-
if( !name ) return false
|
|
7084
|
+
if( !name ) return false
|
|
7130
7085
|
|
|
7131
7086
|
this.isDown = true;
|
|
7132
7087
|
//this.value = this.values[ name-2 ];
|
|
7133
7088
|
//this.send();
|
|
7134
|
-
return this.mousemove( e )
|
|
7089
|
+
return this.mousemove( e )
|
|
7135
7090
|
|
|
7136
7091
|
}
|
|
7137
7092
|
|
|
7138
7093
|
mousemove ( e ) {
|
|
7139
7094
|
|
|
7140
7095
|
let up = false;
|
|
7141
|
-
|
|
7142
7096
|
let name = this.testZone( e );
|
|
7143
|
-
//let sel = false;
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
//console.log(name)
|
|
7148
7097
|
|
|
7149
7098
|
if( name === 'over' ){
|
|
7150
7099
|
this.cursor('pointer');
|
|
@@ -7153,7 +7102,7 @@ class Select extends Proto {
|
|
|
7153
7102
|
up = this.reset();
|
|
7154
7103
|
}
|
|
7155
7104
|
|
|
7156
|
-
return up
|
|
7105
|
+
return up
|
|
7157
7106
|
|
|
7158
7107
|
}
|
|
7159
7108
|
|
|
@@ -7209,7 +7158,7 @@ class Select extends Proto {
|
|
|
7209
7158
|
|
|
7210
7159
|
}
|
|
7211
7160
|
|
|
7212
|
-
return change
|
|
7161
|
+
return change
|
|
7213
7162
|
|
|
7214
7163
|
|
|
7215
7164
|
|
|
@@ -7218,7 +7167,7 @@ class Select extends Proto {
|
|
|
7218
7167
|
reset () {
|
|
7219
7168
|
|
|
7220
7169
|
this.cursor();
|
|
7221
|
-
return this.mode( this.isActif ? 4 : 1 )
|
|
7170
|
+
return this.mode( this.isActif ? 4 : 1 )
|
|
7222
7171
|
|
|
7223
7172
|
}
|
|
7224
7173
|
|
|
@@ -7323,11 +7272,6 @@ class Bitmap extends Proto {
|
|
|
7323
7272
|
let up = false;
|
|
7324
7273
|
|
|
7325
7274
|
let name = this.testZone( e );
|
|
7326
|
-
//let sel = false;
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
//console.log(name)
|
|
7331
7275
|
|
|
7332
7276
|
if( name === 'over' ){
|
|
7333
7277
|
this.cursor('pointer');
|
|
@@ -7366,7 +7310,7 @@ class Bitmap extends Proto {
|
|
|
7366
7310
|
|
|
7367
7311
|
if( this.img !== null ){
|
|
7368
7312
|
if( this.objectLink !== null ) this.objectLink[ this.val ] = v;
|
|
7369
|
-
if( this.callback ) this.callback(
|
|
7313
|
+
if( this.callback ) this.callback( this.value, this.img, this.name );
|
|
7370
7314
|
}
|
|
7371
7315
|
|
|
7372
7316
|
}
|
|
@@ -7388,15 +7332,6 @@ class Bitmap extends Proto {
|
|
|
7388
7332
|
|
|
7389
7333
|
if( this.stat !== n ){
|
|
7390
7334
|
|
|
7391
|
-
/*if( n===1 ) this.isActif = false
|
|
7392
|
-
|
|
7393
|
-
if( n===3 ){
|
|
7394
|
-
if( !this.isActif ){ this.isActif = true; n=4; this.onActif( this ); }
|
|
7395
|
-
else { this.isActif = false; }
|
|
7396
|
-
}
|
|
7397
|
-
|
|
7398
|
-
if( n===2 && this.isActif ) n = 4;*/
|
|
7399
|
-
|
|
7400
7335
|
this.stat = n;
|
|
7401
7336
|
|
|
7402
7337
|
switch( n ){
|
|
@@ -7605,21 +7540,24 @@ class Grid extends Proto {
|
|
|
7605
7540
|
this.value = o.value || null;
|
|
7606
7541
|
|
|
7607
7542
|
|
|
7543
|
+
let cc = this.colors;
|
|
7544
|
+
|
|
7545
|
+
|
|
7608
7546
|
this.isSelectable = o.selectable || false;
|
|
7609
|
-
this.spaces = o.spaces || [
|
|
7610
|
-
this.bsize = o.bsize || [90,
|
|
7547
|
+
this.spaces = o.spaces || [ cc.sx, cc.sy ];
|
|
7548
|
+
this.bsize = o.bsize || [ 90, this.h ];
|
|
7611
7549
|
|
|
7612
|
-
if(o.h) this.bsize[1] = o.h;
|
|
7613
7550
|
this.bsizeMax = this.bsize[0];
|
|
7614
7551
|
|
|
7615
|
-
|
|
7616
7552
|
this.tmp = [];
|
|
7617
7553
|
this.stat = [];
|
|
7618
7554
|
this.grid = [ 2, Math.round( this.lng * 0.5 ) ];
|
|
7619
|
-
|
|
7555
|
+
|
|
7556
|
+
this.h = ( this.grid[1] * this.bsize[1] ) + ( this.grid[1] * this.spaces[1] ); //+ 4 - (this.mtop*2) //+ (this.spaces[1] - this.mtop);
|
|
7620
7557
|
|
|
7621
7558
|
this.c[1].textContent = '';
|
|
7622
|
-
this.c[2] = this.dom( 'table', this.css.basic + 'width:100%; top:'+(this.spaces[1]-2)+'px; height:auto; border-collapse:separate; border:none; border-spacing: '+(this.spaces[0]-2)+'px '+(this.spaces[1]-2)+'px;' );
|
|
7559
|
+
//this.c[2] = this.dom( 'table', this.css.basic + 'width:100%; top:'+(this.spaces[1]-2)+'px; height:auto; border-collapse:separate; border:none; border-spacing: '+(this.spaces[0]-2)+'px '+(this.spaces[1]-2)+'px;' );
|
|
7560
|
+
this.c[2] = this.dom( 'table', this.css.basic + 'width:100%; border-spacing: '+(this.spaces[0]-2)+'px '+(this.spaces[1])+'px; border:none;' );
|
|
7623
7561
|
|
|
7624
7562
|
let n = 0, b, td, tr, sel;
|
|
7625
7563
|
|
|
@@ -7627,13 +7565,11 @@ class Grid extends Proto {
|
|
|
7627
7565
|
this.isDown = false;
|
|
7628
7566
|
this.neverlock = true;
|
|
7629
7567
|
|
|
7630
|
-
this.buttons = [];
|
|
7568
|
+
this.buttons = [];
|
|
7631
7569
|
this.stat = [];
|
|
7632
7570
|
this.tmpX = [];
|
|
7633
7571
|
this.tmpY = [];
|
|
7634
7572
|
|
|
7635
|
-
let cc = this.colors;
|
|
7636
|
-
|
|
7637
7573
|
for( let i = 0; i < this.grid[1]; i++ ){
|
|
7638
7574
|
|
|
7639
7575
|
tr = this.c[2].insertRow();
|
|
@@ -7649,7 +7585,7 @@ class Grid extends Proto {
|
|
|
7649
7585
|
if( this.values[n] === this.value && this.isSelectable ) sel = true;
|
|
7650
7586
|
|
|
7651
7587
|
b = document.createElement( 'div' );
|
|
7652
|
-
b.style.cssText = this.css.txt + this.css.button + 'position:static; width:'+this.bsize[0]+'px; height:'+this.bsize[1]+'px; border:'+cc.borderSize+'px solid '+cc.border+'; left:auto; right:auto; border-radius:'+this.radius+'px;';
|
|
7588
|
+
b.style.cssText = this.css.txt + this.css.button + 'position:static; top:1px; width:'+this.bsize[0]+'px; height:'+(this.bsize[1]-2)+'px; border:'+cc.borderSize+'px solid '+cc.border+'; left:auto; right:auto; border-radius:'+this.radius+'px;';
|
|
7653
7589
|
b.style.background = sel ? cc.select : cc.button;
|
|
7654
7590
|
b.style.color = sel ? cc.textSelect : cc.text;
|
|
7655
7591
|
b.innerHTML = this.values[n];
|
|
@@ -7674,6 +7610,8 @@ class Grid extends Proto {
|
|
|
7674
7610
|
}
|
|
7675
7611
|
}
|
|
7676
7612
|
|
|
7613
|
+
this.s[0].border = 'none';
|
|
7614
|
+
|
|
7677
7615
|
this.init();
|
|
7678
7616
|
|
|
7679
7617
|
}
|
|
@@ -7682,6 +7620,8 @@ class Grid extends Proto {
|
|
|
7682
7620
|
|
|
7683
7621
|
let l = this.local;
|
|
7684
7622
|
if( l.x === -1 && l.y === -1 ) return -1;
|
|
7623
|
+
|
|
7624
|
+
l.y += this.mtop;
|
|
7685
7625
|
|
|
7686
7626
|
let tx = this.tmpX;
|
|
7687
7627
|
let ty = this.tmpY;
|
|
@@ -7936,7 +7876,6 @@ class Pad2D extends Proto {
|
|
|
7936
7876
|
|
|
7937
7877
|
|
|
7938
7878
|
this.h = o.h || this.w + 10;
|
|
7939
|
-
this.top = 0;
|
|
7940
7879
|
|
|
7941
7880
|
this.c[0].style.width = this.w + 'px';
|
|
7942
7881
|
|
|
@@ -7950,6 +7889,8 @@ class Pad2D extends Proto {
|
|
|
7950
7889
|
|
|
7951
7890
|
}
|
|
7952
7891
|
|
|
7892
|
+
//this.top -= this.margin
|
|
7893
|
+
|
|
7953
7894
|
let cc = this.colors;
|
|
7954
7895
|
|
|
7955
7896
|
|
|
@@ -7983,6 +7924,8 @@ class Pad2D extends Proto {
|
|
|
7983
7924
|
|
|
7984
7925
|
if( l.x === -1 && l.y === -1 ) return '';
|
|
7985
7926
|
|
|
7927
|
+
|
|
7928
|
+
|
|
7986
7929
|
if( l.y <= this.c[ 1 ].offsetHeight ) return 'title';
|
|
7987
7930
|
else if ( l.y > this.h - this.c[ 2 ].offsetHeight ) return 'text';
|
|
7988
7931
|
else return 'pad';
|
|
@@ -7999,7 +7942,7 @@ class Pad2D extends Proto {
|
|
|
7999
7942
|
|
|
8000
7943
|
this.isDown = false;
|
|
8001
7944
|
return this.mode(0);
|
|
8002
|
-
|
|
7945
|
+
|
|
8003
7946
|
}
|
|
8004
7947
|
|
|
8005
7948
|
mousedown ( e ) {
|
|
@@ -8018,7 +7961,9 @@ class Pad2D extends Proto {
|
|
|
8018
7961
|
if( !this.isDown ) return;
|
|
8019
7962
|
|
|
8020
7963
|
let x = (this.w*0.5) - ( e.clientX - this.zone.x );
|
|
8021
|
-
let y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.
|
|
7964
|
+
let y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.ytop );
|
|
7965
|
+
|
|
7966
|
+
|
|
8022
7967
|
let r = 256 / this.diam;
|
|
8023
7968
|
|
|
8024
7969
|
x = -(x*r);
|
|
@@ -8175,7 +8120,7 @@ const add = function () {
|
|
|
8175
8120
|
|
|
8176
8121
|
o = a[2];
|
|
8177
8122
|
o.name = a[1];
|
|
8178
|
-
if( type === 'list' ){ o.list = a[0][a[1]]; }
|
|
8123
|
+
if( type === 'list' && !o.list ){ o.list = a[0][a[1]]; }
|
|
8179
8124
|
else o.value = a[0][a[1]];
|
|
8180
8125
|
|
|
8181
8126
|
}
|
|
@@ -8319,6 +8264,9 @@ class Gui {
|
|
|
8319
8264
|
//this.prevY = -1;
|
|
8320
8265
|
this.sw = 0;
|
|
8321
8266
|
|
|
8267
|
+
this.margin = this.colors.sy;
|
|
8268
|
+
this.marginDiv = Tools.isDivid( this.margin );
|
|
8269
|
+
|
|
8322
8270
|
|
|
8323
8271
|
|
|
8324
8272
|
// bottom and close height
|
|
@@ -8640,7 +8588,7 @@ class Gui {
|
|
|
8640
8588
|
|
|
8641
8589
|
case 'content':
|
|
8642
8590
|
|
|
8643
|
-
e.clientY = this.isScroll ?
|
|
8591
|
+
e.clientY = this.isScroll ? e.clientY + this.decal : e.clientY;
|
|
8644
8592
|
|
|
8645
8593
|
if( Roots.isMobile && type === 'mousedown' ) this.getNext( e, change );
|
|
8646
8594
|
|
|
@@ -8700,7 +8648,6 @@ class Gui {
|
|
|
8700
8648
|
if( next !== this.current ){
|
|
8701
8649
|
this.clearTarget();
|
|
8702
8650
|
this.current = next;
|
|
8703
|
-
|
|
8704
8651
|
this.isNewTarget = true;
|
|
8705
8652
|
|
|
8706
8653
|
}
|
|
@@ -8874,7 +8821,7 @@ class Gui {
|
|
|
8874
8821
|
while(i--){
|
|
8875
8822
|
if( this.uis[i].value === name ){
|
|
8876
8823
|
this.uis[i].selected( true );
|
|
8877
|
-
if( this.isScroll ) this.update( ( i*(this.uis[i].h+
|
|
8824
|
+
if( this.isScroll ) this.update( ( i*(this.uis[i].h+this.margin) )*this.ratio );
|
|
8878
8825
|
}
|
|
8879
8826
|
}
|
|
8880
8827
|
|
|
@@ -8980,7 +8927,6 @@ class Gui {
|
|
|
8980
8927
|
|
|
8981
8928
|
|
|
8982
8929
|
if( this.forceHeight && this.lockHeight ) this.content.style.height = this.forceHeight + 'px';
|
|
8983
|
-
|
|
8984
8930
|
if( this.isCanvas ) this.draw( true );
|
|
8985
8931
|
|
|
8986
8932
|
}
|
|
@@ -8994,11 +8940,8 @@ class Gui {
|
|
|
8994
8940
|
if( w ) this.zone.w = w;
|
|
8995
8941
|
|
|
8996
8942
|
this.zone.w = Math.floor( this.zone.w );
|
|
8997
|
-
|
|
8998
8943
|
this.content.style.width = this.zone.w + 'px';
|
|
8999
|
-
|
|
9000
8944
|
if( this.isCenter ) this.content.style.marginLeft = -(Math.floor(this.zone.w*0.5)) + 'px';
|
|
9001
|
-
|
|
9002
8945
|
this.setItemWidth( this.zone.w - this.sw );
|
|
9003
8946
|
|
|
9004
8947
|
}
|
|
@@ -9015,6 +8958,4 @@ class Gui {
|
|
|
9015
8958
|
|
|
9016
8959
|
}
|
|
9017
8960
|
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
export { Files, Gui, Proto, REVISION, Tools, add };
|
|
8961
|
+
export { Files, Gui, REVISION, Tools, add };
|