zimjs 16.3.3 → 16.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/zim.js +1416 -1236
- package/ts-src/typings/zim/index.d.ts +2 -1
package/src/zim.js
CHANGED
|
@@ -14809,7 +14809,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
14809
14809
|
//-53.1
|
|
14810
14810
|
|
|
14811
14811
|
/*--
|
|
14812
|
-
zim.Line = function(length, thickness, color, startHead, endHead, dashed, strokeObj, lineType, lineOrientation, curveH, curveV, points, style, group, inherit)
|
|
14812
|
+
zim.Line = function(length, thickness, color, startHead, endHead, dashed, strokeObj, lineType, lineOrientation, curveH, curveV, points, startLength, endLength, style, group, inherit)
|
|
14813
14813
|
|
|
14814
14814
|
Line
|
|
14815
14815
|
zim class - extends a zim.CustomShape which extends a zim.Container which extends a createjs.Container
|
|
@@ -14870,6 +14870,16 @@ points - (default null) an Array of points for the line which will ignore length
|
|
|
14870
14870
|
[cpX, cpY, x, y] for quadratic curve to with a single control point followed by the destination point
|
|
14871
14871
|
[cp1X, cp1Y, cp2X, cp2Y, x, y] for Bezier curve to with start and end control points followed by the destination point
|
|
14872
14872
|
// see the ZIM Shape docs (or https://www.createjs.com/docs/easeljs/classes/Graphics) for details on the curves
|
|
14873
|
+
startLength - |VEE| (default null) for lineType corner or curved, the length the line will start.
|
|
14874
|
+
should be less than half the line distance (either vertical or horizontal depending on lineOrientation) otherwise ignored
|
|
14875
|
+
varying this will avoid overlap when used with Connectors - also see endLength
|
|
14876
|
+
for the corner lineType both can be set but usually one would be set
|
|
14877
|
+
for the curved lineType the endLength will be chosen over the startLength
|
|
14878
|
+
endLength - |VEE| (default null) for lineType corner or curved, the length the line will end.
|
|
14879
|
+
should be less than half the line distance (either vertical or horizontal depending on lineOrientation) otherwise ignored
|
|
14880
|
+
varying this will avoid overlap when used with Connectors - also see startLength
|
|
14881
|
+
for the corner lineType both can be set but usually one would be set
|
|
14882
|
+
for the curved lineType the endLength will be chosen over the startLength
|
|
14873
14883
|
style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
|
|
14874
14884
|
group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
|
|
14875
14885
|
inherit - (default null) used internally but can receive an {} of styles directly
|
|
@@ -14918,6 +14928,8 @@ endX - get or set the end x point - allows for animation
|
|
|
14918
14928
|
endY - get or set the end y point - allows for animation
|
|
14919
14929
|
startHead - get or set the start head - see startHead parameter
|
|
14920
14930
|
endHead - get or set the end head - see endHead parameter
|
|
14931
|
+
startLength - get or set the start length of the line (see startLength parameter)
|
|
14932
|
+
endLength - get or set the end length of the line (see endLength parameter)
|
|
14921
14933
|
angle - gets (not sets) the current angle relative to the line (does not include line rotation)
|
|
14922
14934
|
points - get and set the points array (see points parameter) - ignoring all settings above
|
|
14923
14935
|
** above will not change the x and y of the shape
|
|
@@ -14957,8 +14969,8 @@ EVENTS
|
|
|
14957
14969
|
See the CreateJS Easel Docs for Container events such as:
|
|
14958
14970
|
added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmove, pressup, removed, rollout, rollover
|
|
14959
14971
|
--*///+53.15
|
|
14960
|
-
zim.Line = function(length, thickness, color, startHead, endHead, dashed, strokeObj, lineType, lineOrientation, curveH, curveV, points, style, group, inherit) {
|
|
14961
|
-
var sig = "length, thickness, color, startHead, endHead, dashed, strokeObj, lineType, lineOrientation, curveH, curveV, points, style, group, inherit";
|
|
14972
|
+
zim.Line = function(length, thickness, color, startHead, endHead, dashed, strokeObj, lineType, lineOrientation, curveH, curveV, points, startLength, endLength, style, group, inherit) {
|
|
14973
|
+
var sig = "length, thickness, color, startHead, endHead, dashed, strokeObj, lineType, lineOrientation, curveH, curveV, points, startLength, endLength, style, group, inherit";
|
|
14962
14974
|
var duo; if (duo = zob(zim.Line, arguments, sig, this)) return duo;
|
|
14963
14975
|
z_d("53.15");
|
|
14964
14976
|
this.zimCustomShape_constructor(null,null,null,null,false);
|
|
@@ -14982,9 +14994,12 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
14982
14994
|
if (zot(curveV)) curveV = DS.curveV!=null?DS.curveV:20;
|
|
14983
14995
|
if (zot(strokeObj)) strokeObj = DS.strokeObj!=null?DS.strokeObj:{};
|
|
14984
14996
|
|
|
14997
|
+
if (zot(startLength)) startLength = DS.startLength!=null?DS.startLength:null;
|
|
14998
|
+
if (zot(endLength)) endLength = DS.endLength!=null?DS.endLength:null;
|
|
14999
|
+
|
|
14985
15000
|
// PICK
|
|
14986
|
-
var oa = remember(length, color, thickness, startHead, endHead);
|
|
14987
|
-
this.veeObj = {length:oa[0], color:oa[1], thickness:oa[2], startHead:oa[3], endHead:oa[4]};
|
|
15001
|
+
var oa = remember(length, color, thickness, startHead, endHead, startLength, endLength);
|
|
15002
|
+
this.veeObj = {length:oa[0], color:oa[1], thickness:oa[2], startHead:oa[3], endHead:oa[4], startHead:oa[5], endHead:oa[6]};
|
|
14988
15003
|
function remember() {return arguments;} // for cloning PICK
|
|
14989
15004
|
length = zim.Pick.choose(length);
|
|
14990
15005
|
color = zim.Pick.choose(color);
|
|
@@ -14994,6 +15009,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
14994
15009
|
// do below otherwise will be the same head and get moved if cloned
|
|
14995
15010
|
if (startHead && startHead.clone) startHead = startHead.clone();
|
|
14996
15011
|
if (endHead && endHead.clone) endHead = endHead.clone();
|
|
15012
|
+
startLength = zim.Pick.choose(startLength);
|
|
15013
|
+
endLength = zim.Pick.choose(endLength);
|
|
14997
15014
|
|
|
14998
15015
|
var that = this;
|
|
14999
15016
|
that._length = length;
|
|
@@ -15139,6 +15156,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
15139
15156
|
if (that.lineType == "straight") {
|
|
15140
15157
|
g.mt(sX, sY).lt(eX, eY);
|
|
15141
15158
|
startArrowGuide = endArrowGuide = [sX, sY, eX, eY];
|
|
15159
|
+
|
|
15142
15160
|
} else if (that.lineType == "corner") {
|
|
15143
15161
|
var midX = sX + (eX-sX)*.4;
|
|
15144
15162
|
var midY = sY + (eY-sY)*.4;
|
|
@@ -15147,18 +15165,62 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
15147
15165
|
}
|
|
15148
15166
|
if (that._lineOrientation == "horizontal" || that.autoOrientation == "horizontal") {
|
|
15149
15167
|
startArrowGuide = endArrowGuide = [sX, sY, midX, sY];
|
|
15150
|
-
// startArrowGuide = endArrowGuide = [that._startX, that._startY, midX, that._startY];
|
|
15151
|
-
|
|
15168
|
+
// startArrowGuide = endArrowGuide = [that._startX, that._startY, midX, that._startY];
|
|
15169
|
+
var mX1 = midX;
|
|
15170
|
+
var mX2;
|
|
15171
|
+
if (startLength!=null) {
|
|
15172
|
+
if (midX > sX) {
|
|
15173
|
+
if (midX-sX > startLength) mX1 = sX + startLength;
|
|
15174
|
+
} else {
|
|
15175
|
+
if (sX-midX > startLength) mX1 = sX - startLength;
|
|
15176
|
+
}
|
|
15177
|
+
}
|
|
15178
|
+
if (endLength!=null) {
|
|
15179
|
+
if (eX > midX) {
|
|
15180
|
+
if (eX-midX > endLength) mX2 = eX - endLength;
|
|
15181
|
+
else mX2 = midX;
|
|
15182
|
+
} else {
|
|
15183
|
+
if (midX-eX > endLength) mX2 = eX + endLength;
|
|
15184
|
+
else mX2 = midX;
|
|
15185
|
+
}
|
|
15186
|
+
if (startLength==null) mX1 = mX2;
|
|
15187
|
+
} else {
|
|
15188
|
+
mX2 = mX1;
|
|
15189
|
+
}
|
|
15190
|
+
g.mt(sX, sY).lt(mX1, sY).lt(mX2, eY).lt(eX, eY);
|
|
15152
15191
|
} else {
|
|
15153
15192
|
startArrowGuide = endArrowGuide = [sX, sY, sX, midY];
|
|
15154
15193
|
// startArrowGuide = endArrowGuide = [that._startX, that._startY, that._startX, midY];
|
|
15155
|
-
|
|
15194
|
+
var mY1 = midY;
|
|
15195
|
+
var mY2;
|
|
15196
|
+
if (startLength!=null) {
|
|
15197
|
+
if (midY > sY) {
|
|
15198
|
+
if (midY-sY > startLength) mY1 = sY + startLength;
|
|
15199
|
+
} else {
|
|
15200
|
+
if (sY-midY > startLength) mY1 = sY - startLength;
|
|
15201
|
+
}
|
|
15202
|
+
}
|
|
15203
|
+
if (endLength!=null) {
|
|
15204
|
+
if (eY > midY) {
|
|
15205
|
+
if (eY-midY > endLength) mY2 = eY - endLength;
|
|
15206
|
+
else mY2 = midY;
|
|
15207
|
+
} else {
|
|
15208
|
+
if (midY-eY > endLength) mY2 = eY + endLength;
|
|
15209
|
+
else mY2 = midY;
|
|
15210
|
+
}
|
|
15211
|
+
if (startLength==null) mY1 = mY2;
|
|
15212
|
+
} else {
|
|
15213
|
+
mY2 = mY1;
|
|
15214
|
+
}
|
|
15215
|
+
g.mt(sX, sY).lt(sX, mY1).lt(eX, mY2).lt(eX, eY);
|
|
15156
15216
|
}
|
|
15157
15217
|
} else { // "curve"
|
|
15218
|
+
|
|
15219
|
+
|
|
15158
15220
|
var hSign = (sX > eX)?-1:1;
|
|
15159
15221
|
var vSign = (sY > eY)?-1:1;
|
|
15160
15222
|
|
|
15161
|
-
var nextX = sX; // relative drawing would be handy but not
|
|
15223
|
+
var nextX = sX; // relative drawing would be handy but not implemented in version yet
|
|
15162
15224
|
var nextY = sY;
|
|
15163
15225
|
var distX = Math.abs(sX - eX);
|
|
15164
15226
|
var distY = Math.abs(sY - eY);
|
|
@@ -15169,15 +15231,24 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
15169
15231
|
that.autoOrientation = (Math.abs(sX-eX) > Math.abs(sY-eY))?"horizontal":"vertical";
|
|
15170
15232
|
}
|
|
15171
15233
|
|
|
15234
|
+
if (startLength!=null && endLength!=null) {
|
|
15235
|
+
startLength=null;
|
|
15236
|
+
if (zon) zogy("ZIM Line() - startLength ignored");
|
|
15237
|
+
}
|
|
15238
|
+
|
|
15172
15239
|
var insideDistance,outsideDistance,lastX,lastY;
|
|
15173
15240
|
if (that._lineOrientation == "horizontal" || that.autoOrientation == "horizontal") {
|
|
15174
15241
|
|
|
15175
15242
|
insideDistance = (distY-curveY*2);
|
|
15176
15243
|
outsideDistance = (distX-curveX*2)/2;
|
|
15177
15244
|
|
|
15245
|
+
var diff = 0;
|
|
15246
|
+
if (startLength != null) diff = Math.max(0, distX/2-startLength);
|
|
15247
|
+
if (endLength != null) diff = Math.min(0, -(distX/2-endLength));
|
|
15248
|
+
|
|
15178
15249
|
g.mt(nextX, nextY);
|
|
15179
15250
|
if (outsideDistance > 0) {
|
|
15180
|
-
nextX = nextX+outsideDistance*hSign;
|
|
15251
|
+
nextX = nextX+(outsideDistance-diff)*hSign;
|
|
15181
15252
|
g.lt(nextX, nextY);
|
|
15182
15253
|
}
|
|
15183
15254
|
|
|
@@ -15197,7 +15268,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
15197
15268
|
nextX = nextX+curveX*hSign;
|
|
15198
15269
|
g.qt(lastX, nextY, nextX, nextY);
|
|
15199
15270
|
if (outsideDistance > 0) {
|
|
15200
|
-
nextX = nextX+outsideDistance*hSign;
|
|
15271
|
+
nextX = nextX+(outsideDistance+diff)*hSign;
|
|
15201
15272
|
g.lt(nextX, nextY);
|
|
15202
15273
|
}
|
|
15203
15274
|
|
|
@@ -15206,9 +15277,13 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
15206
15277
|
insideDistance = (distX-curveX*2);
|
|
15207
15278
|
outsideDistance = (distY-curveY*2)/2;
|
|
15208
15279
|
|
|
15280
|
+
var diff = 0;
|
|
15281
|
+
if (startLength != null) diff = Math.max(0, distY/2-startLength);
|
|
15282
|
+
if (endLength != null) diff = Math.min(0, -(distY/2-endLength));
|
|
15283
|
+
|
|
15209
15284
|
g.mt(nextX, nextY);
|
|
15210
15285
|
if (outsideDistance > 0) {
|
|
15211
|
-
nextY = nextY+outsideDistance*vSign;
|
|
15286
|
+
nextY = nextY+(outsideDistance-diff)*vSign;
|
|
15212
15287
|
g.lt(nextX, nextY);
|
|
15213
15288
|
}
|
|
15214
15289
|
|
|
@@ -15228,7 +15303,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
15228
15303
|
nextY = nextY+curveY*vSign;
|
|
15229
15304
|
g.qt(nextX, lastY, nextX, nextY);
|
|
15230
15305
|
if (outsideDistance > 0) {
|
|
15231
|
-
nextY = nextY+outsideDistance*vSign;
|
|
15306
|
+
nextY = nextY+(outsideDistance+diff)*vSign;
|
|
15232
15307
|
g.lt(nextX, nextY);
|
|
15233
15308
|
}
|
|
15234
15309
|
}
|
|
@@ -15408,6 +15483,26 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
15408
15483
|
that.drawShape();
|
|
15409
15484
|
}
|
|
15410
15485
|
});
|
|
15486
|
+
Object.defineProperty(that, 'startLength', {
|
|
15487
|
+
get: function() {
|
|
15488
|
+
return startLength;
|
|
15489
|
+
},
|
|
15490
|
+
set: function(value) {
|
|
15491
|
+
oa[5] = value;
|
|
15492
|
+
startLength = zik(value);
|
|
15493
|
+
that.drawShape();
|
|
15494
|
+
}
|
|
15495
|
+
});
|
|
15496
|
+
Object.defineProperty(that, 'endLength', {
|
|
15497
|
+
get: function() {
|
|
15498
|
+
return endLength;
|
|
15499
|
+
},
|
|
15500
|
+
set: function(value) {
|
|
15501
|
+
oa[6] = value;
|
|
15502
|
+
endLength = zik(value);
|
|
15503
|
+
that.drawShape();
|
|
15504
|
+
}
|
|
15505
|
+
});
|
|
15411
15506
|
Object.defineProperty(that, 'points', {
|
|
15412
15507
|
get: function() {
|
|
15413
15508
|
return that._points;
|
|
@@ -15452,7 +15547,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
15452
15547
|
endH.rotation = that._endHead.startAngle;
|
|
15453
15548
|
}
|
|
15454
15549
|
}
|
|
15455
|
-
var newShape = that.cloneProps(new zim.Line((exact||!zim.isPick(oa[0]))?that.length:oa[0], (exact||!zim.isPick(oa[2]))?that.thickness:oa[2], (exact||!zim.isPick(oa[1]))?that.color:oa[1], startH, endH, that.dashed, strokeObj, lineType, that._lineOrientation, curveH, curveV, zim.copy(points), cloneStyle, this.group, inherit));
|
|
15550
|
+
var newShape = that.cloneProps(new zim.Line((exact||!zim.isPick(oa[0]))?that.length:oa[0], (exact||!zim.isPick(oa[2]))?that.thickness:oa[2], (exact||!zim.isPick(oa[1]))?that.color:oa[1], startH, endH, that.dashed, strokeObj, lineType, that._lineOrientation, curveH, curveV, zim.copy(points), (exact||!zim.isPick(oa[5]))?startLength:oa[5], (exact||!zim.isPick(oa[6]))?endLength:oa[6], cloneStyle, this.group, inherit));
|
|
15456
15551
|
if (that.points) newShape.setPoints(that.points);
|
|
15457
15552
|
else newShape.setPoints(that._startX, that._startY, that._endX, that._endY);
|
|
15458
15553
|
|
|
@@ -30020,7 +30115,7 @@ zim.TextInput = function(width, height, placeholder, text, size, font, color, ba
|
|
|
30020
30115
|
|
|
30021
30116
|
// the Window usually masks but masks to the edge and not to inside the padding
|
|
30022
30117
|
// so add a custom mask
|
|
30023
|
-
mask = new zim.Rectangle({width:width-padding*2, height:height-padding*2, color:zim.clear, style:false}).center(that);
|
|
30118
|
+
mask = new zim.Rectangle({width:width-padding*2, height:height-padding*2+4, color:zim.clear, style:false}).center(that);
|
|
30024
30119
|
that.cur("text");
|
|
30025
30120
|
|
|
30026
30121
|
label = that.label = new zim.TextInput.LabelInput(pastText!=null?pastText:text, size, maxLength, password, selectionColor, selectionAlpha, cursorColor, cursorSpeed, font, color, null, null, null, align, "top", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, shiftH, shiftV, null, null, null, null, inputType, rtl, uppercase, placeholderInstant, style, group, inherit);
|
|
@@ -30440,7 +30535,7 @@ zim.TextInput.LabelInput = function(text, size, maxLength, password, selectionCo
|
|
|
30440
30535
|
}
|
|
30441
30536
|
this.text = this.hiddenInput.type=="password"?newText.replace(/./g, '*'):newText;
|
|
30442
30537
|
this.measureText();
|
|
30443
|
-
|
|
30538
|
+
if (WW.M) this.positionBlinkerAndSelection();
|
|
30444
30539
|
if (!noEvent) this.dispatchEvent("input");
|
|
30445
30540
|
}
|
|
30446
30541
|
this.onSelect = function() {
|
|
@@ -39244,7 +39339,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
39244
39339
|
//-67.1
|
|
39245
39340
|
|
|
39246
39341
|
/*--
|
|
39247
|
-
zim.Keyboard = function(labels, backgroundColor, color, shiftBackgroundColor, shiftHoldBackgroundColor, placeBackgroundColor, placeColor, cursorColor, shadeAlpha, borderColor, borderWidth, margin, corner, draggable, placeClose, shadowColor, shadowBlur, container, data, place, placeShiftH, placeShiftV, special, rtl, hardKeyboard, layout, numPadScale, numPadDraggable, numPadOnly, numPadAdvanced, maxLength, numbersOnly, style, group, inherit)
|
|
39342
|
+
zim.Keyboard = function(labels, backgroundColor, color, shiftBackgroundColor, shiftHoldBackgroundColor, placeBackgroundColor, placeColor, cursorColor, shadeAlpha, borderColor, borderWidth, margin, corner, draggable, placeClose, shadowColor, shadowBlur, container, data, place, placeShiftH, placeShiftV, special, rtl, hardKeyboard, layout, numPadScale, numPadDraggable, numPadOnly, numPadAdvanced, maxLength, numbersOnly, placeScale, style, group, inherit)
|
|
39248
39343
|
|
|
39249
39344
|
Keyboard
|
|
39250
39345
|
zim class - extends a zim.Container which extends a createjs.Container
|
|
@@ -39382,6 +39477,7 @@ numPadOnly - (default false) set to true to open the NumPad only but can then us
|
|
|
39382
39477
|
numPadAdvanced - (default false) set to true to add an extra row to the NumPad with round brackets, exponential and percent or modulus keys
|
|
39383
39478
|
maxLength - (default null) set to a number for the maximum characters - also see maxLength property
|
|
39384
39479
|
numbersOnly - (default false) set to force numbers only - also see numbersOnly property
|
|
39480
|
+
placeScale - (default 1) set the place menu scale - will move to by place parameters in ZIM 017
|
|
39385
39481
|
style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
|
|
39386
39482
|
group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
|
|
39387
39483
|
inherit - (default null) used internally but can receive an {} of styles directly
|
|
@@ -39425,7 +39521,7 @@ selectedIndex - the index of the cursor in the selected label or -1 if no cursor
|
|
|
39425
39521
|
toggled - read-only Boolean that is true if keyboard is visible and false if not
|
|
39426
39522
|
keys - reference to the keyboard itself
|
|
39427
39523
|
numPad - reference to the NumPad once it has been shown once
|
|
39428
|
-
|
|
39524
|
+
placeMenu - reference to the place menu
|
|
39429
39525
|
maxLength - get or set the maximum characters - will not change existing label
|
|
39430
39526
|
numbersOnly - get or set to force numbers only - will not change existing label
|
|
39431
39527
|
|
|
@@ -39447,40 +39543,139 @@ Dispatches "numpadopen" and "numpadclose" events when the NumPad is opened or cl
|
|
|
39447
39543
|
ALSO: see the CreateJS Easel Docs for Container events such as:
|
|
39448
39544
|
added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmove, pressup, removed, rollout, rollover
|
|
39449
39545
|
--*///+67.2
|
|
39450
|
-
|
|
39451
|
-
|
|
39452
|
-
|
|
39453
|
-
|
|
39454
|
-
|
|
39455
|
-
|
|
39456
|
-
|
|
39457
|
-
|
|
39546
|
+
zim.Keyboard = function(labels, backgroundColor, color, shiftBackgroundColor, shiftHoldBackgroundColor, placeBackgroundColor, placeColor, cursorColor, shadeAlpha, borderColor, borderWidth, margin, corner, draggable, placeClose, shadowColor, shadowBlur, container, data, place, placeShiftH, placeShiftV, special, rtl, hardKeyboard, layout, numPadScale, numPadDraggable, numPadOnly, numPadAdvanced, maxLength, numbersOnly, placeScale, style, group, inherit) {
|
|
39547
|
+
var sig = "labels, backgroundColor, color, shiftBackgroundColor, shiftHoldBackgroundColor, placeBackgroundColor, placeColor, cursorColor, shadeAlpha, borderColor, borderWidth, margin, corner, draggable, placeClose, shadowColor, shadowBlur, container, data, place, placeShiftH, placeShiftV, special, rtl, hardKeyboard, layout, numPadScale, numPadDraggable, numPadOnly, numPadAdvanced, maxLength, numbersOnly, placeScale, style, group, inherit";
|
|
39548
|
+
var duo; if (duo = zob(zim.Keyboard, arguments, sig, this)) return duo;
|
|
39549
|
+
z_d("67.2");
|
|
39550
|
+
this.zimContainer_constructor(1000,400,null,null,false);
|
|
39551
|
+
this.type = "Keyboard";
|
|
39552
|
+
this.group = group;
|
|
39553
|
+
var DS = style===false?{}:zim.getStyle(this.type, this.group, inherit);
|
|
39458
39554
|
|
|
39459
|
-
|
|
39460
|
-
|
|
39461
|
-
|
|
39462
|
-
|
|
39463
|
-
|
|
39464
|
-
|
|
39465
|
-
|
|
39466
|
-
|
|
39467
|
-
|
|
39468
|
-
|
|
39469
|
-
|
|
39470
|
-
|
|
39471
|
-
|
|
39472
|
-
|
|
39473
|
-
|
|
39474
|
-
|
|
39475
|
-
|
|
39476
|
-
|
|
39477
|
-
|
|
39478
|
-
|
|
39479
|
-
|
|
39555
|
+
if (zot(labels)) labels = DS.labels!=null?DS.labels:[];
|
|
39556
|
+
if (!Array.isArray(labels)) labels = [labels];
|
|
39557
|
+
if (zot(backgroundColor)) backgroundColor = DS.backgroundColor!=null?DS.backgroundColor:zim.dark;
|
|
39558
|
+
if (zot(color)) color = DS.color!=null?DS.color:zim.white;
|
|
39559
|
+
if (zot(shiftBackgroundColor)) shiftBackgroundColor = DS.shiftBackgroundColor!=null?DS.shiftBackgroundColor:"orange";
|
|
39560
|
+
if (zot(shiftHoldBackgroundColor)) shiftHoldBackgroundColor = DS.shiftHoldBackgroundColor!=null?DS.shiftHoldBackgroundColor:"red";
|
|
39561
|
+
if (zot(placeBackgroundColor)) placeBackgroundColor = DS.placeBackgroundColor!=null?DS.placeBackgroundColor:zim.blue;
|
|
39562
|
+
if (zot(placeColor)) placeColor = DS.placeColor!=null?DS.placeColor:color;
|
|
39563
|
+
if (zot(cursorColor)) cursorColor = DS.cursorColor!=null?DS.cursorColor:zim.blue;
|
|
39564
|
+
if (zot(shadeAlpha)) shadeAlpha = DS.shadeAlpha!=null?DS.shadeAlpha:.2;
|
|
39565
|
+
if (zot(borderColor)) borderColor = DS.borderColor!=null?DS.borderColor:"rgba(0,0,0,.1)";
|
|
39566
|
+
if (zot(borderWidth)) borderWidth = DS.borderWidth!=null?DS.borderWidth:null;
|
|
39567
|
+
if (borderColor < 0 || borderWidth < 0) borderColor = borderWidth = null;
|
|
39568
|
+
else if (borderColor!=null && borderWidth==null) borderWidth = 1;
|
|
39569
|
+
if (zot(margin)) margin = DS.margin!=null?DS.margin:5;
|
|
39570
|
+
if (zot(corner)) corner = DS.corner!=null?DS.corner:30;
|
|
39571
|
+
if (zot(draggable)) draggable = DS.draggable!=null?DS.draggable:false;
|
|
39572
|
+
if (zot(placeClose)) placeClose = DS.placeClose!=null?DS.placeClose:true;
|
|
39573
|
+
if (zot(shadowColor)) shadowColor=DS.shadowColor!=null?DS.shadowColor:"rgba(0,0,0,.2)";
|
|
39574
|
+
if (zot(shadowBlur)) shadowBlur=DS.shadowBlur!=null?DS.shadowBlur:14;
|
|
39575
|
+
if (zot(data)) data = DS.data!=null?DS.data:[
|
|
39576
|
+
[
|
|
39577
|
+
["q","w","e","r","t","y","u","i","o","p"],
|
|
39578
|
+
["a","s","d","f","g","h","j","k","l"],
|
|
39579
|
+
["shift","z","x","c","v","b","n","m","backspace"],
|
|
39580
|
+
["?123","@"] // rest of bottom line automatically added
|
|
39581
|
+
],[
|
|
39582
|
+
["1","2","3","4","5","6","7","8","9","0"],
|
|
39583
|
+
["!","@","#","$","/","^","&","*","(",")"],
|
|
39584
|
+
["1/2","-","'", "\"",":",";",",","?","backspace"],
|
|
39585
|
+
["ABC","@"] // rest of bottom line automatically added
|
|
39586
|
+
],[
|
|
39587
|
+
["+","x","%","=","<",">","{","}","[","]"],
|
|
39588
|
+
["€","£","¥", "$", "₩", "~", "`","¤","♡","☆"],
|
|
39589
|
+
["2/2","_","\\","|","《","》","¡","¿","backspace"],
|
|
39590
|
+
["ABC","@"] // rest of bottom line automatically added
|
|
39591
|
+
]
|
|
39592
|
+
];
|
|
39593
|
+
if (!data[3]) data[3] = {
|
|
39594
|
+
e:["ė","ē","ę","ê","é","ë","è"],
|
|
39595
|
+
u:["ū","û","ú","ü","ù"],
|
|
39596
|
+
i:["ī","į","ì","í","ï","î"],
|
|
39597
|
+
o:["ō","œ","ø","õ","ô","ó","ö","ò"],
|
|
39598
|
+
a:["ā","ã","å","â","á","ä","à","æ"],
|
|
39599
|
+
n:["ñ","ń"]
|
|
39600
|
+
};
|
|
39601
|
+
var that = this;
|
|
39602
|
+
if (zot(place)) place = DS.place!=null?DS.place:true;
|
|
39603
|
+
if (zot(placeShiftH)) placeShiftH = DS.placeShiftH!=null?DS.placeShiftH:0;
|
|
39604
|
+
if (zot(placeShiftV)) placeShiftV = DS.placeShiftV!=null?DS.placeShiftV:0;
|
|
39605
|
+
if (zot(placeScale)) placeScale = DS.placeScale!=null?DS.placeScale:1;
|
|
39606
|
+
if (zot(rtl)) rtl = DS.rtl!=null?DS.rtl:false;
|
|
39607
|
+
if (zot(hardKeyboard)) hardKeyboard = DS.hardKeyboard!=null?DS.hardKeyboard:true;
|
|
39608
|
+
if (zot(numPadScale)) numPadScale = DS.numPadScale!=null?DS.numPadScale:.8;
|
|
39609
|
+
if (zot(numPadOnly)) numPadOnly = DS.numPadOnly!=null?DS.numPadOnly:false;
|
|
39610
|
+
if (zot(numPadDraggable)) numPadDraggable = DS.numPadDraggable!=null?DS.numPadDraggable:true;
|
|
39611
|
+
if (zot(numPadAdvanced)) numPadAdvanced = DS.numPadAdvanced!=null?DS.numPadAdvanced:false;
|
|
39612
|
+
if (zot(maxLength)) maxLength = DS.maxLength!=null?DS.maxLength:null;
|
|
39613
|
+
if (zot(numbersOnly)) numbersOnly = DS.numbersOnly!=null?DS.numbersOnly:false;
|
|
39614
|
+
this.maxLength = maxLength;
|
|
39615
|
+
this.numbersOnly = numbersOnly;
|
|
39616
|
+
|
|
39617
|
+
if (zot(layout)) layout = DS.layout!=null?DS.layout:"qwerty";
|
|
39618
|
+
layout = layout.toLowerCase();
|
|
39619
|
+
if (layout != "qwerty") {
|
|
39620
|
+
if (layout == "arabic") {
|
|
39621
|
+
data = [
|
|
39622
|
+
[
|
|
39623
|
+
["ض", "ص", "ث", "ق", "ف", "غ", "ع", "ه", "خ", "ح", "ج"],
|
|
39624
|
+
["ش", "س", "ي", "ب", "ل", "ا", "ت", "ن", "م", "ك", "ط"],
|
|
39625
|
+
["ذ", "ء", "ؤ", "ر", "ى", "ة", "و", "ز", "ظ", "د","back"],
|
|
39626
|
+
["?123","ـ"] // rest of bottom line automatically added
|
|
39627
|
+
],[
|
|
39628
|
+
["1","2","3","4","5","6","7","8","9","0","*"],
|
|
39629
|
+
["!","@","#","$","/","^","&","*","(",")","*"],
|
|
39630
|
+
["1/2","-","'", "\"",":",";",",","?","*","backspace"],
|
|
39631
|
+
["ABC","*"] // rest of bottom line automatically added
|
|
39632
|
+
],[
|
|
39633
|
+
["+","x","%","=","<",">","{","}","[","]","*"],
|
|
39634
|
+
["€","£","¥", "$", "₩", "~", "`","¤","♡","☆","*"],
|
|
39635
|
+
["2/2","_","\\","|","《","》","¡","¿","*","backspace"],
|
|
39636
|
+
["ABC","*"] // rest of bottom line automatically added
|
|
39637
|
+
],{
|
|
39638
|
+
ا:["أ","إ","آ","ء"],
|
|
39639
|
+
ى:["ئ"],
|
|
39640
|
+
ء:["ئ","ؤ"],
|
|
39641
|
+
و:["ؤ"],
|
|
39642
|
+
ـ:["ٍ", "ً", "ٌ", "ْ", "ُ", "ِ", "َ", "ّ"],
|
|
39643
|
+
"*":["ٍ", "ً", "ٌ", "ْ", "ُ", "ِ", "َ", "ّ"],
|
|
39644
|
+
n:["ñ","ń"]
|
|
39645
|
+
}
|
|
39646
|
+
];
|
|
39647
|
+
} else if (layout == "hebrew") {
|
|
39648
|
+
data = [
|
|
39649
|
+
[
|
|
39650
|
+
["ק", "ר", "א", "ט", "ו", "ן", "ם", "פ", "backspace"],
|
|
39651
|
+
["ש", "ד", "ג", "כ", "ע", "י", "ח", "ל", "ך", "ף"],
|
|
39652
|
+
["ז", "ס", "ב", "נ", "ה", "מ", "צ", "ת", "ץ"],
|
|
39653
|
+
["?123", "@"] // rest of bottom line automatically added
|
|
39654
|
+
], [
|
|
39655
|
+
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"],
|
|
39656
|
+
["!", "@", "#", "$", "/", "^", "&", "*", "(", ")"],
|
|
39657
|
+
["1/2", "-", "'", "\"", ":", ";", ",", "?", "backspace"],
|
|
39658
|
+
["ABC", "@"] // rest of bottom line automatically added
|
|
39659
|
+
], [
|
|
39660
|
+
["+", "x", "%", "=", "<", ">", "{", "}", "[", "]"],
|
|
39661
|
+
["€", "£", "¥", "$", "₩", "~", "`", "¤", "♡", "☆"],
|
|
39662
|
+
["2/2", "_", "\\", "|", "《", "》", "¡", "¿", "backspace"],
|
|
39663
|
+
["ABC", "@"] // rest of bottom line automatically added
|
|
39664
|
+
], {
|
|
39665
|
+
e: ["ė", "ē", "ę", "ê", "é", "ë", "è"],
|
|
39666
|
+
u: ["ū", "û", "ú", "ü", "ù"],
|
|
39667
|
+
i: ["ī", "į", "ì", "í", "ï", "î"],
|
|
39668
|
+
o: ["ō", "œ", "ø", "õ", "ô", "ó", "ö", "ò"],
|
|
39669
|
+
a: ["ā", "ã", "å", "â", "á", "ä", "à", "æ"],
|
|
39670
|
+
n: ["ñ", "ń"]
|
|
39671
|
+
}
|
|
39672
|
+
];
|
|
39673
|
+
} else if (layout == "azerty") {
|
|
39674
|
+
data = [
|
|
39480
39675
|
[
|
|
39481
|
-
["
|
|
39482
|
-
["
|
|
39483
|
-
["shift","
|
|
39676
|
+
["a","z","e","r","t","y","u","i","o","p"],
|
|
39677
|
+
["q","s","d","f","g","h","j","k","l","m"],
|
|
39678
|
+
["shift","w","x","c","v","b","n","´","backspace"],
|
|
39484
39679
|
["?123","@"] // rest of bottom line automatically added
|
|
39485
39680
|
],[
|
|
39486
39681
|
["1","2","3","4","5","6","7","8","9","0"],
|
|
@@ -39492,1231 +39687,1138 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
39492
39687
|
["€","£","¥", "$", "₩", "~", "`","¤","♡","☆"],
|
|
39493
39688
|
["2/2","_","\\","|","《","》","¡","¿","backspace"],
|
|
39494
39689
|
["ABC","@"] // rest of bottom line automatically added
|
|
39495
|
-
]
|
|
39496
|
-
|
|
39497
|
-
|
|
39498
|
-
|
|
39499
|
-
|
|
39500
|
-
|
|
39501
|
-
|
|
39502
|
-
a:["ā","ã","å","â","á","ä","à","æ"],
|
|
39503
|
-
n:["ñ","ń"]
|
|
39504
|
-
};
|
|
39505
|
-
var that = this;
|
|
39506
|
-
if (zot(place)) place = DS.place!=null?DS.place:true;
|
|
39507
|
-
if (zot(placeShiftH)) placeShiftH = DS.placeShiftH!=null?DS.placeShiftH:0;
|
|
39508
|
-
if (zot(placeShiftV)) placeShiftV = DS.placeShiftV!=null?DS.placeShiftV:0;
|
|
39509
|
-
if (zot(rtl)) rtl = DS.rtl!=null?DS.rtl:false;
|
|
39510
|
-
if (zot(hardKeyboard)) hardKeyboard = DS.hardKeyboard!=null?DS.hardKeyboard:true;
|
|
39511
|
-
if (zot(numPadScale)) numPadScale = DS.numPadScale!=null?DS.numPadScale:.8;
|
|
39512
|
-
if (zot(numPadOnly)) numPadOnly = DS.numPadOnly!=null?DS.numPadOnly:false;
|
|
39513
|
-
if (zot(numPadDraggable)) numPadDraggable = DS.numPadDraggable!=null?DS.numPadDraggable:true;
|
|
39514
|
-
if (zot(numPadAdvanced)) numPadAdvanced = DS.numPadAdvanced!=null?DS.numPadAdvanced:false;
|
|
39515
|
-
if (zot(maxLength)) maxLength = DS.maxLength!=null?DS.maxLength:null;
|
|
39516
|
-
if (zot(numbersOnly)) numbersOnly = DS.numbersOnly!=null?DS.numbersOnly:false;
|
|
39517
|
-
this.maxLength = maxLength;
|
|
39518
|
-
this.numbersOnly = numbersOnly;
|
|
39519
|
-
|
|
39520
|
-
if (zot(layout)) layout = DS.layout!=null?DS.layout:"qwerty";
|
|
39521
|
-
layout = layout.toLowerCase();
|
|
39522
|
-
if (layout != "qwerty") {
|
|
39523
|
-
if (layout == "arabic") {
|
|
39524
|
-
data = [
|
|
39525
|
-
[
|
|
39526
|
-
["ض", "ص", "ث", "ق", "ف", "غ", "ع", "ه", "خ", "ح", "ج"],
|
|
39527
|
-
["ش", "س", "ي", "ب", "ل", "ا", "ت", "ن", "م", "ك", "ط"],
|
|
39528
|
-
["ذ", "ء", "ؤ", "ر", "ى", "ة", "و", "ز", "ظ", "د","back"],
|
|
39529
|
-
["?123","ـ"] // rest of bottom line automatically added
|
|
39530
|
-
],[
|
|
39531
|
-
["1","2","3","4","5","6","7","8","9","0","*"],
|
|
39532
|
-
["!","@","#","$","/","^","&","*","(",")","*"],
|
|
39533
|
-
["1/2","-","'", "\"",":",";",",","?","*","backspace"],
|
|
39534
|
-
["ABC","*"] // rest of bottom line automatically added
|
|
39535
|
-
],[
|
|
39536
|
-
["+","x","%","=","<",">","{","}","[","]","*"],
|
|
39537
|
-
["€","£","¥", "$", "₩", "~", "`","¤","♡","☆","*"],
|
|
39538
|
-
["2/2","_","\\","|","《","》","¡","¿","*","backspace"],
|
|
39539
|
-
["ABC","*"] // rest of bottom line automatically added
|
|
39540
|
-
],{
|
|
39541
|
-
ا:["أ","إ","آ","ء"],
|
|
39542
|
-
ى:["ئ"],
|
|
39543
|
-
ء:["ئ","ؤ"],
|
|
39544
|
-
و:["ؤ"],
|
|
39545
|
-
ـ:["ٍ", "ً", "ٌ", "ْ", "ُ", "ِ", "َ", "ّ"],
|
|
39546
|
-
"*":["ٍ", "ً", "ٌ", "ْ", "ُ", "ِ", "َ", "ّ"],
|
|
39547
|
-
n:["ñ","ń"]
|
|
39548
|
-
}
|
|
39549
|
-
];
|
|
39550
|
-
} else if (layout == "hebrew") {
|
|
39551
|
-
data = [
|
|
39552
|
-
[
|
|
39553
|
-
["ק", "ר", "א", "ט", "ו", "ן", "ם", "פ", "backspace"],
|
|
39554
|
-
["ש", "ד", "ג", "כ", "ע", "י", "ח", "ל", "ך", "ף"],
|
|
39555
|
-
["ז", "ס", "ב", "נ", "ה", "מ", "צ", "ת", "ץ"],
|
|
39556
|
-
["?123", "@"] // rest of bottom line automatically added
|
|
39557
|
-
], [
|
|
39558
|
-
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"],
|
|
39559
|
-
["!", "@", "#", "$", "/", "^", "&", "*", "(", ")"],
|
|
39560
|
-
["1/2", "-", "'", "\"", ":", ";", ",", "?", "backspace"],
|
|
39561
|
-
["ABC", "@"] // rest of bottom line automatically added
|
|
39562
|
-
], [
|
|
39563
|
-
["+", "x", "%", "=", "<", ">", "{", "}", "[", "]"],
|
|
39564
|
-
["€", "£", "¥", "$", "₩", "~", "`", "¤", "♡", "☆"],
|
|
39565
|
-
["2/2", "_", "\\", "|", "《", "》", "¡", "¿", "backspace"],
|
|
39566
|
-
["ABC", "@"] // rest of bottom line automatically added
|
|
39567
|
-
], {
|
|
39568
|
-
e: ["ė", "ē", "ę", "ê", "é", "ë", "è"],
|
|
39569
|
-
u: ["ū", "û", "ú", "ü", "ù"],
|
|
39570
|
-
i: ["ī", "į", "ì", "í", "ï", "î"],
|
|
39571
|
-
o: ["ō", "œ", "ø", "õ", "ô", "ó", "ö", "ò"],
|
|
39572
|
-
a: ["ā", "ã", "å", "â", "á", "ä", "à", "æ"],
|
|
39573
|
-
n: ["ñ", "ń"]
|
|
39690
|
+
],{
|
|
39691
|
+
e:["ė","ē","ę","ê","é","ë","è"],
|
|
39692
|
+
u:["ū","û","ú","ü","ù"],
|
|
39693
|
+
i:["ī","į","ì","í","ï","î"],
|
|
39694
|
+
o:["ō","œ","ø","õ","ô","ó","ö","ò"],
|
|
39695
|
+
a:["ā","ã","å","â","á","ä","à","æ"],
|
|
39696
|
+
n:["ñ","ń"]
|
|
39574
39697
|
}
|
|
39575
39698
|
];
|
|
39576
|
-
} else if (layout == "
|
|
39699
|
+
} else if (layout == "turkish") {
|
|
39577
39700
|
data = [
|
|
39578
|
-
|
|
39579
|
-
|
|
39580
|
-
|
|
39581
|
-
|
|
39582
|
-
|
|
39583
|
-
|
|
39584
|
-
|
|
39585
|
-
|
|
39586
|
-
|
|
39587
|
-
|
|
39588
|
-
|
|
39589
|
-
|
|
39590
|
-
|
|
39591
|
-
|
|
39592
|
-
|
|
39593
|
-
|
|
39594
|
-
|
|
39595
|
-
|
|
39596
|
-
|
|
39597
|
-
|
|
39598
|
-
|
|
39599
|
-
|
|
39600
|
-
|
|
39601
|
-
|
|
39602
|
-
|
|
39603
|
-
data = [
|
|
39604
|
-
[
|
|
39605
|
-
["q","w","e","r","t","y","u","ı","o","p","ğ","ü"],
|
|
39606
|
-
["a","s","d","f","g","h","j","k","l","ş","i"],
|
|
39607
|
-
["shift","z","x","c","v","b","n","m","ö","ç","backspace"],
|
|
39608
|
-
["?123","*"] // rest of bottom line automatically added
|
|
39609
|
-
],[
|
|
39610
|
-
["1","2","3","4","5","6","7","8","9","0","*"],
|
|
39611
|
-
["!","@","#","$","/","^","&","*","(",")","*"],
|
|
39612
|
-
["1/2","-","'", "\"",":",";",",","?","*","backspace"],
|
|
39613
|
-
["ABC","*"] // rest of bottom line automatically added
|
|
39614
|
-
],[
|
|
39615
|
-
["+","x","%","=","<",">","{","}","[","]","*"],
|
|
39616
|
-
["€","£","¥", "$", "₩", "~", "`","¤","♡","☆","*"],
|
|
39617
|
-
["2/2","_","\\","|","《","》","¡","¿","*","backspace"],
|
|
39618
|
-
["ABC","*"] // rest of bottom line automatically added
|
|
39619
|
-
],{
|
|
39620
|
-
e:["ė","ē","ę","ê","é","ë","è"],
|
|
39621
|
-
u:["ū","û","ú","ü","ù"],
|
|
39622
|
-
i:["ī","į","ì","í","ï","î"],
|
|
39623
|
-
o:["ō","œ","ø","õ","ô","ó","ö","ò"],
|
|
39624
|
-
a:["ā","ã","å","â","á","ä","à","æ"],
|
|
39625
|
-
n:["ñ","ń"]
|
|
39701
|
+
[
|
|
39702
|
+
["q","w","e","r","t","y","u","ı","o","p","ğ","ü"],
|
|
39703
|
+
["a","s","d","f","g","h","j","k","l","ş","i"],
|
|
39704
|
+
["shift","z","x","c","v","b","n","m","ö","ç","backspace"],
|
|
39705
|
+
["?123","*"] // rest of bottom line automatically added
|
|
39706
|
+
],[
|
|
39707
|
+
["1","2","3","4","5","6","7","8","9","0","*"],
|
|
39708
|
+
["!","@","#","$","/","^","&","*","(",")","*"],
|
|
39709
|
+
["1/2","-","'", "\"",":",";",",","?","*","backspace"],
|
|
39710
|
+
["ABC","*"] // rest of bottom line automatically added
|
|
39711
|
+
],[
|
|
39712
|
+
["+","x","%","=","<",">","{","}","[","]","*"],
|
|
39713
|
+
["€","£","¥", "$", "₩", "~", "`","¤","♡","☆","*"],
|
|
39714
|
+
["2/2","_","\\","|","《","》","¡","¿","*","backspace"],
|
|
39715
|
+
["ABC","*"] // rest of bottom line automatically added
|
|
39716
|
+
],{
|
|
39717
|
+
e:["ė","ē","ę","ê","é","ë","è"],
|
|
39718
|
+
u:["ū","û","ú","ü","ù"],
|
|
39719
|
+
i:["ī","į","ì","í","ï","î"],
|
|
39720
|
+
o:["ō","œ","ø","õ","ô","ó","ö","ò"],
|
|
39721
|
+
a:["ā","ã","å","â","á","ä","à","æ"],
|
|
39722
|
+
n:["ñ","ń"]
|
|
39723
|
+
},{
|
|
39724
|
+
ı:"I", // lowercase to uppercase map
|
|
39725
|
+
i:"İ"
|
|
39626
39726
|
},{
|
|
39627
|
-
|
|
39628
|
-
|
|
39629
|
-
|
|
39630
|
-
|
|
39631
|
-
|
|
39632
|
-
|
|
39633
|
-
|
|
39634
|
-
|
|
39635
|
-
|
|
39636
|
-
|
|
39637
|
-
|
|
39638
|
-
|
|
39639
|
-
|
|
39640
|
-
if (WW.zdf) {
|
|
39641
|
-
container = WW.zdf.stage;
|
|
39642
|
-
} else {
|
|
39643
|
-
zogy(mess);
|
|
39644
|
-
return;
|
|
39645
|
-
}
|
|
39646
|
-
} else if (!container.getBounds) {
|
|
39727
|
+
I:"ı", // uppercase to lowercase map
|
|
39728
|
+
İ:"i"
|
|
39729
|
+
}
|
|
39730
|
+
];
|
|
39731
|
+
}
|
|
39732
|
+
}
|
|
39733
|
+
that.data = data;
|
|
39734
|
+
|
|
39735
|
+
var mess = "zim display - Keyboard(): Please pass in a reference to a container with bounds set";
|
|
39736
|
+
if (zot(container)) {
|
|
39737
|
+
if (WW.zdf) {
|
|
39738
|
+
container = WW.zdf.stage;
|
|
39739
|
+
} else {
|
|
39647
39740
|
zogy(mess);
|
|
39648
39741
|
return;
|
|
39649
|
-
} else if (zot(container.stage)) {
|
|
39650
|
-
zogy("zim display - Keyboard(): The container must have a stage property");
|
|
39651
|
-
return;
|
|
39652
39742
|
}
|
|
39743
|
+
} else if (!container.getBounds) {
|
|
39744
|
+
zogy(mess);
|
|
39745
|
+
return;
|
|
39746
|
+
} else if (zot(container.stage)) {
|
|
39747
|
+
zogy("zim display - Keyboard(): The container must have a stage property");
|
|
39748
|
+
return;
|
|
39749
|
+
}
|
|
39653
39750
|
|
|
39654
|
-
|
|
39655
|
-
|
|
39751
|
+
if (shadowColor != -1 && shadowBlur > 0) that.shadow = new createjs.Shadow(shadowColor, 3, 3, shadowBlur);
|
|
39752
|
+
var currentStage = WW.zdf?WW.zdf.stage:null;
|
|
39656
39753
|
|
|
39657
|
-
|
|
39754
|
+
// ~~~~~~~~~~~~~~~~~ SETUP
|
|
39658
39755
|
|
|
39659
|
-
|
|
39660
|
-
|
|
39661
|
-
|
|
39662
|
-
|
|
39663
|
-
|
|
39664
|
-
|
|
39665
|
-
|
|
39666
|
-
|
|
39667
|
-
|
|
39668
|
-
|
|
39669
|
-
|
|
39670
|
-
|
|
39671
|
-
|
|
39672
|
-
|
|
39673
|
-
|
|
39674
|
-
|
|
39675
|
-
|
|
39676
|
-
|
|
39677
|
-
|
|
39678
|
-
|
|
39679
|
-
|
|
39680
|
-
|
|
39681
|
-
|
|
39682
|
-
|
|
39683
|
-
|
|
39684
|
-
|
|
39685
|
-
|
|
39686
|
-
|
|
39687
|
-
|
|
39688
|
-
|
|
39689
|
-
|
|
39690
|
-
|
|
39691
|
-
|
|
39692
|
-
|
|
39693
|
-
|
|
39694
|
-
|
|
39695
|
-
|
|
39696
|
-
|
|
39697
|
-
|
|
39698
|
-
|
|
39699
|
-
|
|
39700
|
-
|
|
39701
|
-
|
|
39702
|
-
|
|
39703
|
-
|
|
39704
|
-
|
|
39705
|
-
|
|
39706
|
-
|
|
39707
|
-
|
|
39708
|
-
|
|
39709
|
-
|
|
39710
|
-
|
|
39711
|
-
|
|
39712
|
-
|
|
39713
|
-
|
|
39714
|
-
|
|
39715
|
-
|
|
39716
|
-
|
|
39717
|
-
|
|
39718
|
-
|
|
39719
|
-
|
|
39720
|
-
|
|
39721
|
-
|
|
39722
|
-
|
|
39723
|
-
|
|
39724
|
-
|
|
39725
|
-
|
|
39726
|
-
|
|
39727
|
-
|
|
39728
|
-
|
|
39729
|
-
|
|
39730
|
-
|
|
39731
|
-
|
|
39732
|
-
|
|
39733
|
-
|
|
39734
|
-
|
|
39735
|
-
|
|
39736
|
-
|
|
39737
|
-
|
|
39738
|
-
|
|
39739
|
-
|
|
39740
|
-
|
|
39741
|
-
|
|
39742
|
-
|
|
39743
|
-
|
|
39744
|
-
|
|
39745
|
-
|
|
39746
|
-
|
|
39747
|
-
|
|
39748
|
-
|
|
39749
|
-
|
|
39750
|
-
|
|
39751
|
-
|
|
39752
|
-
|
|
39753
|
-
|
|
39754
|
-
|
|
39755
|
-
|
|
39756
|
-
|
|
39757
|
-
}
|
|
39756
|
+
that.labels = labels;
|
|
39757
|
+
var maxWidth;
|
|
39758
|
+
|
|
39759
|
+
// Dan Zen Cat 03 - to handle any number of keys in row (always at least 10)
|
|
39760
|
+
var maxNum = 10;
|
|
39761
|
+
zim.loop(data[0], function (d) {
|
|
39762
|
+
if (d.length> maxNum) maxNum = d.length;
|
|
39763
|
+
});
|
|
39764
|
+
var numH = maxNum;
|
|
39765
|
+
|
|
39766
|
+
var botArray = ["/","",",",".","numpad","away"];
|
|
39767
|
+
if (!zot(special)) botArray.splice(1,0,special);
|
|
39768
|
+
|
|
39769
|
+
var textKeys = zim.copy(data[0]);
|
|
39770
|
+
// textKeys[2].unshift("shift");
|
|
39771
|
+
// textKeys[2].push("backspace");
|
|
39772
|
+
textKeys[3] = textKeys[3].concat(botArray);
|
|
39773
|
+
|
|
39774
|
+
var numberKeys1 = zim.copy(data[1]);
|
|
39775
|
+
// numberKeys1[2].push("backspace");
|
|
39776
|
+
numberKeys1[3] = numberKeys1[3].concat(botArray);
|
|
39777
|
+
|
|
39778
|
+
var numberKeys2 = zim.copy(data[2]);
|
|
39779
|
+
// numberKeys2[2].push("backspace");
|
|
39780
|
+
numberKeys2[3] = numberKeys2[3].concat(botArray);
|
|
39781
|
+
|
|
39782
|
+
// var textKeys = [
|
|
39783
|
+
// ["q","w","e","r","t","y","u","i","o","p"],
|
|
39784
|
+
// ["a","s","d","f","g","h","j","k","l"],
|
|
39785
|
+
// ["shift","z","x","c","v","b","n","m","backspace"],
|
|
39786
|
+
// ["?123","@","",".","/","away"]
|
|
39787
|
+
// ]
|
|
39788
|
+
// var numberKeys1 = [
|
|
39789
|
+
// ["1","2","3","4","5","6","7","8","9","0"],
|
|
39790
|
+
// ["!","@","#","$","/","^","&","*","(",")"],
|
|
39791
|
+
// ["1/2","-","'", "\"",":",";",",","?","backspace"],
|
|
39792
|
+
// ["ABC","@","",".","/","away"]
|
|
39793
|
+
// ];
|
|
39794
|
+
// var numberKeys2 = [
|
|
39795
|
+
// ["+","x","%","=","<",">","{","}","[","]"],
|
|
39796
|
+
// ["€","£","¥", "$", "₩", "~", "`","¤","♡","☆"],
|
|
39797
|
+
// ["2/2","_","\\","|","《","》","¡","¿","backspace"],
|
|
39798
|
+
// ["ABC", "@","",".","/","away"]
|
|
39799
|
+
// ];
|
|
39800
|
+
// var eLetters = data[3][0]; // ["ė","ē","ę","ê","é","ë","è"];//ĒĘÊÉËÈ
|
|
39801
|
+
// var uLetters = data[3][1]; // ["ū","û","ú","ü","ù"];//ŪÛÚÜÙ
|
|
39802
|
+
// var iLetters = data[3][2]; // ["ī","į","ì","í","ï","î"];//ĪĮÌÍÏÎ
|
|
39803
|
+
// var oLetters = data[3][3]; // ["ō","œ","ø","õ","ô","ó","ö","ò"];// ŌŒØÕÔÓÖÒ
|
|
39804
|
+
// var aLetters = data[3][4]; // ["ā","ã","å","â","á","ä","à","æ"];// ĀÃÅÂÁÄÀÆ
|
|
39805
|
+
// var nLetters = data[3][5]; // ["ñ","ń"];
|
|
39806
|
+
|
|
39807
|
+
var textKeyButtons = [];
|
|
39808
|
+
|
|
39809
|
+
//maateenheid horizontaal
|
|
39810
|
+
var size = (1000-((numH-1)*5))/numH;
|
|
39811
|
+
|
|
39812
|
+
//statuses toestenbord
|
|
39813
|
+
var statuses = {
|
|
39814
|
+
def: "default",
|
|
39815
|
+
shift: "shift",
|
|
39816
|
+
number1: "number1",
|
|
39817
|
+
number2: "number2"
|
|
39818
|
+
};
|
|
39819
|
+
var currentStatus = statuses.def;
|
|
39820
|
+
var currentKeyboard;
|
|
39821
|
+
var alternativeMenu;
|
|
39822
|
+
var textBlinker;
|
|
39823
|
+
var bigShiftOn = false;
|
|
39824
|
+
var shiftKey;
|
|
39825
|
+
var currentLabel;
|
|
39826
|
+
var insertPoint = 0;
|
|
39827
|
+
var cursorShiftMenu;
|
|
39828
|
+
var buttonsCursor = [];
|
|
39829
|
+
var shiftKeyIcon;
|
|
39830
|
+
var backspaceIcon;
|
|
39831
|
+
var hideKeyBoardIcon;
|
|
39832
|
+
var showNumPadIcon;
|
|
39833
|
+
var hideNumPadIcon;
|
|
39834
|
+
var numPadKey;
|
|
39835
|
+
var dragButton;
|
|
39836
|
+
var dragY;
|
|
39837
|
+
|
|
39838
|
+
makeIcons();
|
|
39839
|
+
makeButtons(currentStatus);
|
|
39840
|
+
if (draggable) makeDragButton();
|
|
39841
|
+
|
|
39842
|
+
// ~~~~~~~~~~~~~~~~~ INTERACTIONS
|
|
39843
|
+
|
|
39844
|
+
this.on("mousedown", buttonPressed);
|
|
39845
|
+
|
|
39846
|
+
function buttonPressed(e) {
|
|
39847
|
+
currentStage = that.stage;
|
|
39848
|
+
if (alternativeMenu) {
|
|
39849
|
+
that.removeChild(alternativeMenu);
|
|
39850
|
+
}
|
|
39851
|
+
if (cursorShiftMenu) {
|
|
39852
|
+
if (buttonsCursor.indexOf(e.target) < 0) {
|
|
39853
|
+
removeCursorShiftMenu();
|
|
39758
39854
|
}
|
|
39759
|
-
|
|
39760
|
-
|
|
39761
|
-
|
|
39762
|
-
|
|
39763
|
-
|
|
39764
|
-
|
|
39765
|
-
|
|
39766
|
-
|
|
39767
|
-
|
|
39768
|
-
|
|
39769
|
-
|
|
39770
|
-
|
|
39771
|
-
|
|
39772
|
-
|
|
39773
|
-
|
|
39774
|
-
|
|
39775
|
-
|
|
39776
|
-
|
|
39777
|
-
|
|
39778
|
-
|
|
39779
|
-
|
|
39780
|
-
|
|
39781
|
-
|
|
39782
|
-
|
|
39783
|
-
|
|
39784
|
-
|
|
39785
|
-
|
|
39786
|
-
|
|
39787
|
-
|
|
39788
|
-
|
|
39789
|
-
|
|
39790
|
-
|
|
39791
|
-
|
|
39792
|
-
|
|
39793
|
-
|
|
39794
|
-
|
|
39795
|
-
|
|
39796
|
-
|
|
39797
|
-
|
|
39798
|
-
|
|
39799
|
-
|
|
39800
|
-
|
|
39801
|
-
|
|
39802
|
-
|
|
39803
|
-
|
|
39804
|
-
|
|
39805
|
-
|
|
39806
|
-
|
|
39807
|
-
|
|
39808
|
-
|
|
39809
|
-
|
|
39810
|
-
|
|
39811
|
-
currentStage.update();
|
|
39855
|
+
}
|
|
39856
|
+
if (!zot(e.target.na)) {
|
|
39857
|
+
//WIJZIGINGEN STATUS keyboard
|
|
39858
|
+
if (draggable && e.target === dragButton) {
|
|
39859
|
+
that.tickerMouseEvent = currentStage.on("stagemousemove", function (e) {
|
|
39860
|
+
that.mouseYAmount = e.stageY;
|
|
39861
|
+
});
|
|
39862
|
+
zim.Ticker.add(startDragging);
|
|
39863
|
+
that.on("pressup", stopDragging);
|
|
39864
|
+
dragY = e.stageY - that.localToGlobal(0, 0).y;
|
|
39865
|
+
} else if (!zot(special) && e.target.na === special) {
|
|
39866
|
+
that.dispatchEvent("special");
|
|
39867
|
+
} else if (e.target.na === "shift") { //shift
|
|
39868
|
+
shiftKeys();
|
|
39869
|
+
} else if (e.target.toggle === "?123") { //nummers
|
|
39870
|
+
that.removeChild(currentKeyboard);
|
|
39871
|
+
makeButtons(statuses.number1);
|
|
39872
|
+
} else if (e.target.toggle === "ABC") { //teksten
|
|
39873
|
+
that.removeChild(currentKeyboard);
|
|
39874
|
+
currentStatus = statuses.def;
|
|
39875
|
+
makeButtons();
|
|
39876
|
+
if (bigShiftOn) shiftKeys(true);
|
|
39877
|
+
} else if (e.target.toggle === "1/2") {
|
|
39878
|
+
that.removeChild(currentKeyboard);
|
|
39879
|
+
makeButtons(statuses.number2);
|
|
39880
|
+
} else if (e.target.toggle === "2/2") {
|
|
39881
|
+
that.removeChild(currentKeyboard);
|
|
39882
|
+
makeButtons(statuses.number1);
|
|
39883
|
+
} else if (e.target.na === "numpad") {
|
|
39884
|
+
showNumPad(e.target);
|
|
39885
|
+
} else if (e.target.na === "away") {
|
|
39886
|
+
that.hideKeyboard();
|
|
39887
|
+
that.dispatchEvent("close");
|
|
39888
|
+
} else if (data[3] && data[3][e.target.na]) {
|
|
39889
|
+
makeAlternativeLetters(e.target.na);
|
|
39890
|
+
// e.target.na === "e" ||
|
|
39891
|
+
// e.target.na === "u" ||
|
|
39892
|
+
// e.target.na === "i" ||
|
|
39893
|
+
// e.target.na === "o" ||
|
|
39894
|
+
// e.target.na === "a" ||
|
|
39895
|
+
// e.target.na === "n") { //VARIATIES LETTERS euioan
|
|
39896
|
+
// makeAlternativeLetters(e.target.na);
|
|
39897
|
+
} else if (e.target.na === "return") {
|
|
39898
|
+
addToLabel("\n");
|
|
39899
|
+
} else if (e.target.na === "backspace") {
|
|
39900
|
+
backspaceRemovesLetter();
|
|
39901
|
+
} else if (e.target.na === "back") {
|
|
39902
|
+
backspaceRemovesLetter();
|
|
39903
|
+
} else if (e.target.na === "") {
|
|
39904
|
+
addToLabel(" ");
|
|
39905
|
+
} else {
|
|
39906
|
+
addToLabel(e.target.na);
|
|
39812
39907
|
}
|
|
39908
|
+
currentStage.update();
|
|
39813
39909
|
}
|
|
39910
|
+
}
|
|
39814
39911
|
|
|
39815
|
-
|
|
39816
|
-
|
|
39817
|
-
|
|
39818
|
-
|
|
39819
|
-
|
|
39820
|
-
|
|
39821
|
-
|
|
39822
|
-
|
|
39823
|
-
|
|
39824
|
-
|
|
39825
|
-
|
|
39826
|
-
|
|
39827
|
-
|
|
39828
|
-
|
|
39829
|
-
|
|
39830
|
-
|
|
39831
|
-
|
|
39912
|
+
that.addChar = function (chara) { // do not use char - it is a keyword
|
|
39913
|
+
if (!zot(chara) && chara.match(/^.$/)) addToLabel(chara);
|
|
39914
|
+
};
|
|
39915
|
+
that.removeChar = function () {
|
|
39916
|
+
backspaceRemovesLetter(true);
|
|
39917
|
+
};
|
|
39918
|
+
that.clearText = function () {
|
|
39919
|
+
currentLabel.text = "";
|
|
39920
|
+
backspaceRemovesLetter(true);
|
|
39921
|
+
makeWidthsArray();
|
|
39922
|
+
that.selectedIndex = 0;
|
|
39923
|
+
};
|
|
39924
|
+
that.setText = function (text) {
|
|
39925
|
+
currentLabel.text = text;
|
|
39926
|
+
makeWidthsArray();
|
|
39927
|
+
that.selectedIndex = text.length;
|
|
39928
|
+
};
|
|
39832
39929
|
|
|
39833
|
-
|
|
39834
|
-
|
|
39835
|
-
|
|
39836
|
-
|
|
39837
|
-
|
|
39838
|
-
|
|
39839
|
-
|
|
39840
|
-
|
|
39841
|
-
|
|
39842
|
-
|
|
39843
|
-
|
|
39844
|
-
|
|
39845
|
-
|
|
39846
|
-
|
|
39847
|
-
|
|
39848
|
-
|
|
39849
|
-
|
|
39850
|
-
}
|
|
39851
|
-
}
|
|
39852
|
-
}
|
|
39853
|
-
if (!immediate) {
|
|
39854
|
-
//na halve seconde gaat groot shift aan
|
|
39855
|
-
bigShift = true;
|
|
39856
|
-
setTimeout(putBigShiftOn, 500);
|
|
39857
|
-
shiftEvent = that.on("pressup", doNotPutBigShiftOn);
|
|
39858
|
-
}
|
|
39859
|
-
currentStatus = statuses.shift;
|
|
39860
|
-
//vanuit shift
|
|
39861
|
-
} else {
|
|
39862
|
-
shiftKey.color = backgroundColor;
|
|
39863
|
-
bigShiftOn = false;
|
|
39864
|
-
//keyboard veranderen
|
|
39865
|
-
for (i = 0; i < textKeyButtons.length - 6; i++) {
|
|
39866
|
-
tkb = textKeyButtons[i];
|
|
39867
|
-
if (tkb.label.text.length > 0) {
|
|
39868
|
-
if (tkb.na.length === 1) {
|
|
39869
|
-
if (data[5] && data[5][tkb.label.text]) tkb.label.text = data[5][tkb.label.text];
|
|
39870
|
-
else tkb.label.text = tkb.label.text.toLowerCase();
|
|
39871
|
-
tkb.label.centerReg(tkb).mov(0, 3);
|
|
39872
|
-
} else {
|
|
39873
|
-
tkb.label.centerReg(tkb);
|
|
39874
|
-
}
|
|
39930
|
+
var shiftEvent;
|
|
39931
|
+
function shiftKeys(immediate) {
|
|
39932
|
+
var bigShift = false;
|
|
39933
|
+
var i, tkb;
|
|
39934
|
+
//vanuit default
|
|
39935
|
+
if (currentStatus === statuses.def) {
|
|
39936
|
+
shiftKey.color = immediate ? shiftHoldBackgroundColor : shiftBackgroundColor;
|
|
39937
|
+
//keyboard veranderen
|
|
39938
|
+
for (i = 0; i < textKeyButtons.length - 6 - (zot(special) ? 0 : 1); i++) {
|
|
39939
|
+
tkb = textKeyButtons[i];
|
|
39940
|
+
if (tkb.label.text.length > 0) {
|
|
39941
|
+
if (tkb.na.length === 1) {
|
|
39942
|
+
if (data[4] && data[4][tkb.label.text]) tkb.label.text = data[4][tkb.label.text];
|
|
39943
|
+
else tkb.label.text = layout=="turkish"?tkb.label.text.toLocaleUpperCase("tr-TR"):tkb.label.text.toUpperCase();
|
|
39944
|
+
tkb.label.centerReg(tkb).mov(0, 6);
|
|
39945
|
+
} else {
|
|
39946
|
+
tkb.label.centerReg(tkb);
|
|
39875
39947
|
}
|
|
39876
39948
|
}
|
|
39877
|
-
currentStatus = statuses.def;
|
|
39878
39949
|
}
|
|
39879
|
-
|
|
39880
|
-
|
|
39881
|
-
|
|
39882
|
-
|
|
39883
|
-
|
|
39884
|
-
shiftKey.color = shiftHoldBackgroundColor;
|
|
39885
|
-
currentKeyboard.updateCache();
|
|
39886
|
-
if (that.stage) that.stage.update();
|
|
39887
|
-
}
|
|
39950
|
+
if (!immediate) {
|
|
39951
|
+
//na halve seconde gaat groot shift aan
|
|
39952
|
+
bigShift = true;
|
|
39953
|
+
setTimeout(putBigShiftOn, 500);
|
|
39954
|
+
shiftEvent = that.on("pressup", doNotPutBigShiftOn);
|
|
39888
39955
|
}
|
|
39889
|
-
|
|
39890
|
-
|
|
39891
|
-
|
|
39892
|
-
|
|
39893
|
-
|
|
39894
|
-
|
|
39895
|
-
|
|
39896
|
-
|
|
39897
|
-
|
|
39898
|
-
|
|
39899
|
-
|
|
39900
|
-
|
|
39901
|
-
|
|
39902
|
-
var yPos = 0;
|
|
39903
|
-
var thisWidth;
|
|
39904
|
-
var bigKey;
|
|
39905
|
-
var thisIsSpacekey = false;
|
|
39906
|
-
var thisKeyLetter;
|
|
39907
|
-
var passesLetter;
|
|
39908
|
-
var dark = false;
|
|
39909
|
-
//zonder parameters maak ik letters
|
|
39910
|
-
if (zot(which)) which = statuses.def;
|
|
39911
|
-
//letters
|
|
39912
|
-
if (which === statuses.def) {
|
|
39913
|
-
typeKeyboard = textKeys;
|
|
39914
|
-
//nummers1
|
|
39915
|
-
} else if (which === statuses.number1) {
|
|
39916
|
-
typeKeyboard = numberKeys1;
|
|
39917
|
-
//nummers 2
|
|
39918
|
-
} else if (which === statuses.number2) {
|
|
39919
|
-
typeKeyboard = numberKeys2;
|
|
39920
|
-
}
|
|
39921
|
-
//container maken
|
|
39922
|
-
that.keys = currentKeyboard = new zim.Container(1000, 430, null, null, false).addTo(that).vis(!numPadOnly);
|
|
39923
|
-
//alle toetsen, door arrays heen wandelen
|
|
39924
|
-
for (var i = 0; i < typeKeyboard.length; i++) {
|
|
39925
|
-
if (i <= 1 || (which == statuses.def && i == 2 && typeKeyboard[2][0] != "shift")) {
|
|
39926
|
-
xPos = (size / 2 + 2.5) * (numH - typeKeyboard[i].length);
|
|
39927
|
-
}
|
|
39928
|
-
for (var j = 0; j < typeKeyboard[i].length; j++) {
|
|
39929
|
-
thisIsSpacekey = false;
|
|
39930
|
-
thisKeyLetter = null;
|
|
39931
|
-
dark = false;
|
|
39932
|
-
if (typeKeyboard[i][j] == "backspace") {
|
|
39933
|
-
bigKey = true;
|
|
39934
|
-
thisKeyLetter = backspaceIcon;
|
|
39935
|
-
dark = true;
|
|
39936
|
-
} else if (typeKeyboard[i][j] == "back") {
|
|
39937
|
-
bigKey = false;
|
|
39938
|
-
thisKeyLetter = backspaceIcon;
|
|
39939
|
-
dark = true;
|
|
39940
|
-
} else if (typeKeyboard[i][j] == "shift") {
|
|
39941
|
-
bigKey = true;
|
|
39942
|
-
thisKeyLetter = shiftKeyIcon;
|
|
39943
|
-
} else if ((i == 3 || (which != statuses.def && i == 2)) && j == 0) {
|
|
39944
|
-
bigKey = true;
|
|
39945
|
-
dark = true;
|
|
39946
|
-
} else if (typeKeyboard[i][j] == "") {
|
|
39947
|
-
bigKey = false;
|
|
39948
|
-
thisIsSpacekey = true;
|
|
39949
|
-
} else if (typeKeyboard[i][j] == "numpad") {
|
|
39950
|
-
thisKeyLetter = showNumPadIcon;
|
|
39951
|
-
bigKey = false;
|
|
39952
|
-
dark = true;
|
|
39953
|
-
} else if (typeKeyboard[i][j] == "away") {
|
|
39954
|
-
thisKeyLetter = hideKeyBoardIcon;
|
|
39955
|
-
bigKey = true;
|
|
39956
|
-
dark = true;
|
|
39957
|
-
} else {
|
|
39958
|
-
bigKey = false;
|
|
39959
|
-
}
|
|
39960
|
-
//brede toets: breedte instellen
|
|
39961
|
-
if (bigKey) {
|
|
39962
|
-
thisWidth = (size * 1.5 + 2.5);
|
|
39963
|
-
} else if (thisIsSpacekey) {
|
|
39964
|
-
// Dan Zen Cat 03 patch - make spacebar take up available space
|
|
39965
|
-
thisWidth = (size + 5) * ((zot(special) ? 3 : 2) + numH-10+1-data[0][3].length) - 5;
|
|
39966
|
-
if (data[0][3].indexOf("backspace") != -1) {
|
|
39967
|
-
thisWidth -= size/2;
|
|
39968
|
-
}
|
|
39956
|
+
currentStatus = statuses.shift;
|
|
39957
|
+
//vanuit shift
|
|
39958
|
+
} else {
|
|
39959
|
+
shiftKey.color = backgroundColor;
|
|
39960
|
+
bigShiftOn = false;
|
|
39961
|
+
//keyboard veranderen
|
|
39962
|
+
for (i = 0; i < textKeyButtons.length - 6; i++) {
|
|
39963
|
+
tkb = textKeyButtons[i];
|
|
39964
|
+
if (tkb.label.text.length > 0) {
|
|
39965
|
+
if (tkb.na.length === 1) {
|
|
39966
|
+
if (data[5] && data[5][tkb.label.text]) tkb.label.text = data[5][tkb.label.text];
|
|
39967
|
+
else tkb.label.text = tkb.label.text.toLowerCase();
|
|
39968
|
+
tkb.label.centerReg(tkb).mov(0, 3);
|
|
39969
39969
|
} else {
|
|
39970
|
-
|
|
39970
|
+
tkb.label.centerReg(tkb);
|
|
39971
39971
|
}
|
|
39972
|
-
|
|
39973
|
-
|
|
39972
|
+
}
|
|
39973
|
+
}
|
|
39974
|
+
currentStatus = statuses.def;
|
|
39975
|
+
}
|
|
39976
|
+
currentKeyboard.updateCache();
|
|
39977
|
+
if (that.stage) that.stage.update();
|
|
39978
|
+
function putBigShiftOn() {
|
|
39979
|
+
if (bigShift) {
|
|
39980
|
+
bigShiftOn = true;
|
|
39981
|
+
shiftKey.color = shiftHoldBackgroundColor;
|
|
39982
|
+
currentKeyboard.updateCache();
|
|
39983
|
+
if (that.stage) that.stage.update();
|
|
39984
|
+
}
|
|
39985
|
+
}
|
|
39986
|
+
function doNotPutBigShiftOn() {
|
|
39987
|
+
that.off("pressup", shiftEvent);
|
|
39988
|
+
bigShift = false;
|
|
39989
|
+
}
|
|
39990
|
+
}
|
|
39974
39991
|
|
|
39975
|
-
|
|
39976
|
-
|
|
39977
|
-
|
|
39978
|
-
|
|
39979
|
-
|
|
39980
|
-
|
|
39981
|
-
|
|
39982
|
-
|
|
39983
|
-
|
|
39984
|
-
|
|
39985
|
-
|
|
39986
|
-
|
|
39987
|
-
|
|
39988
|
-
|
|
39989
|
-
|
|
39990
|
-
|
|
39991
|
-
|
|
39992
|
-
|
|
39993
|
-
|
|
39994
|
-
|
|
39995
|
-
|
|
39996
|
-
|
|
39997
|
-
|
|
39998
|
-
|
|
39999
|
-
|
|
40000
|
-
|
|
40001
|
-
|
|
40002
|
-
|
|
40003
|
-
|
|
40004
|
-
|
|
40005
|
-
|
|
40006
|
-
|
|
40007
|
-
|
|
40008
|
-
|
|
40009
|
-
|
|
40010
|
-
|
|
40011
|
-
|
|
40012
|
-
|
|
40013
|
-
|
|
40014
|
-
|
|
40015
|
-
|
|
39992
|
+
// ~~~~~~~~~~~~~~~~~ ASSETS
|
|
39993
|
+
|
|
39994
|
+
function makeButtons(which) {
|
|
39995
|
+
var typeKeyboard;
|
|
39996
|
+
var label;
|
|
39997
|
+
var button;
|
|
39998
|
+
var xPos = 0;
|
|
39999
|
+
var yPos = 0;
|
|
40000
|
+
var thisWidth;
|
|
40001
|
+
var bigKey;
|
|
40002
|
+
var thisIsSpacekey = false;
|
|
40003
|
+
var thisKeyLetter;
|
|
40004
|
+
var passesLetter;
|
|
40005
|
+
var dark = false;
|
|
40006
|
+
//zonder parameters maak ik letters
|
|
40007
|
+
if (zot(which)) which = statuses.def;
|
|
40008
|
+
//letters
|
|
40009
|
+
if (which === statuses.def) {
|
|
40010
|
+
typeKeyboard = textKeys;
|
|
40011
|
+
//nummers1
|
|
40012
|
+
} else if (which === statuses.number1) {
|
|
40013
|
+
typeKeyboard = numberKeys1;
|
|
40014
|
+
//nummers 2
|
|
40015
|
+
} else if (which === statuses.number2) {
|
|
40016
|
+
typeKeyboard = numberKeys2;
|
|
40017
|
+
}
|
|
40018
|
+
//container maken
|
|
40019
|
+
that.keys = currentKeyboard = new zim.Container(1000, 430, null, null, false).addTo(that).vis(!numPadOnly);
|
|
40020
|
+
//alle toetsen, door arrays heen wandelen
|
|
40021
|
+
for (var i = 0; i < typeKeyboard.length; i++) {
|
|
40022
|
+
if (i <= 1 || (which == statuses.def && i == 2 && typeKeyboard[2][0] != "shift")) {
|
|
40023
|
+
xPos = (size / 2 + 2.5) * (numH - typeKeyboard[i].length);
|
|
40024
|
+
}
|
|
40025
|
+
for (var j = 0; j < typeKeyboard[i].length; j++) {
|
|
40026
|
+
thisIsSpacekey = false;
|
|
40027
|
+
thisKeyLetter = null;
|
|
40028
|
+
dark = false;
|
|
40029
|
+
if (typeKeyboard[i][j] == "backspace") {
|
|
40030
|
+
bigKey = true;
|
|
40031
|
+
thisKeyLetter = backspaceIcon;
|
|
40032
|
+
dark = true;
|
|
40033
|
+
} else if (typeKeyboard[i][j] == "back") {
|
|
40034
|
+
bigKey = false;
|
|
40035
|
+
thisKeyLetter = backspaceIcon;
|
|
40036
|
+
dark = true;
|
|
40037
|
+
} else if (typeKeyboard[i][j] == "shift") {
|
|
40038
|
+
bigKey = true;
|
|
40039
|
+
thisKeyLetter = shiftKeyIcon;
|
|
40040
|
+
} else if ((i == 3 || (which != statuses.def && i == 2)) && j == 0) {
|
|
40041
|
+
bigKey = true;
|
|
40042
|
+
dark = true;
|
|
40043
|
+
} else if (typeKeyboard[i][j] == "") {
|
|
40044
|
+
bigKey = false;
|
|
40045
|
+
thisIsSpacekey = true;
|
|
40046
|
+
} else if (typeKeyboard[i][j] == "numpad") {
|
|
40047
|
+
thisKeyLetter = showNumPadIcon;
|
|
40048
|
+
bigKey = false;
|
|
40049
|
+
dark = true;
|
|
40050
|
+
} else if (typeKeyboard[i][j] == "away") {
|
|
40051
|
+
thisKeyLetter = hideKeyBoardIcon;
|
|
40052
|
+
bigKey = true;
|
|
40053
|
+
dark = true;
|
|
40054
|
+
} else {
|
|
40055
|
+
bigKey = false;
|
|
40056
|
+
}
|
|
40057
|
+
//brede toets: breedte instellen
|
|
40058
|
+
if (bigKey) {
|
|
40059
|
+
thisWidth = (size * 1.5 + 2.5);
|
|
40060
|
+
} else if (thisIsSpacekey) {
|
|
40061
|
+
// Dan Zen Cat 03 patch - make spacebar take up available space
|
|
40062
|
+
thisWidth = (size + 5) * ((zot(special) ? 3 : 2) + numH-10+1-data[0][3].length) - 5;
|
|
40063
|
+
if (data[0][3].indexOf("backspace") != -1) {
|
|
40064
|
+
thisWidth -= size/2;
|
|
40065
|
+
}
|
|
40066
|
+
} else {
|
|
40067
|
+
thisWidth = size;
|
|
40068
|
+
}
|
|
40069
|
+
button = new zim.Rectangle(thisWidth, size, backgroundColor, borderColor, borderWidth, corner, null, null, null, false).cur().addTo(currentKeyboard);
|
|
40070
|
+
if (dark) button.addChild(new zim.Rectangle(thisWidth, size, "black", null, null, corner, null, null, null, false).alp(shadeAlpha));
|
|
40071
|
+
|
|
40072
|
+
if (thisKeyLetter) {
|
|
40073
|
+
button.label = label = new zim.Label({ text: "", backgroundColor: "ignore", font: DS.font != null ? DS.font : null, style: false });
|
|
40074
|
+
} else {
|
|
40075
|
+
button.label = label = new zim.Label({
|
|
40076
|
+
lineWidth: 10,
|
|
40077
|
+
lineHeight: 25,
|
|
40078
|
+
font: DS.font != null ? DS.font : null,
|
|
40079
|
+
text: typeKeyboard[i][j],
|
|
40080
|
+
color: color,
|
|
40081
|
+
align: "center",
|
|
40082
|
+
style: false
|
|
40083
|
+
});
|
|
40084
|
+
}
|
|
40085
|
+
//plaatje op bakking
|
|
40086
|
+
if (thisKeyLetter) {
|
|
40087
|
+
var clone = thisKeyLetter.clone();
|
|
40088
|
+
var sc;
|
|
40089
|
+
if (typeKeyboard[i][j]=="numpad") {
|
|
40090
|
+
sc = 60;
|
|
40091
|
+
numPadKey = button;
|
|
40016
40092
|
} else {
|
|
40017
|
-
|
|
40018
|
-
xPos += 67.33;
|
|
40093
|
+
sc = 70;
|
|
40019
40094
|
}
|
|
40020
|
-
|
|
40021
|
-
|
|
40022
|
-
|
|
40023
|
-
|
|
40024
|
-
|
|
40025
|
-
|
|
40026
|
-
|
|
40027
|
-
|
|
40028
|
-
|
|
40029
|
-
|
|
40030
|
-
|
|
40031
|
-
|
|
40032
|
-
|
|
40033
|
-
|
|
40034
|
-
|
|
40035
|
-
|
|
40036
|
-
// case "u":
|
|
40037
|
-
// thisArray = uLetters;
|
|
40038
|
-
// break;
|
|
40039
|
-
// case "i":
|
|
40040
|
-
// thisArray = iLetters;
|
|
40041
|
-
// break;
|
|
40042
|
-
// case "o":
|
|
40043
|
-
// thisArray = oLetters;
|
|
40044
|
-
// break;
|
|
40045
|
-
// case "a":
|
|
40046
|
-
// thisArray = aLetters;
|
|
40047
|
-
// break;
|
|
40048
|
-
// case "n":
|
|
40049
|
-
// thisArray = nLetters;
|
|
40050
|
-
// break;
|
|
40051
|
-
// default:
|
|
40052
|
-
// break;
|
|
40053
|
-
// }
|
|
40054
|
-
timeWait = zim.timeout(500, makeAlternatemenu, null, "ms");
|
|
40055
|
-
var mouseUpEvent = that.on("pressup", mouseUp);
|
|
40056
|
-
function mouseUp() {
|
|
40057
|
-
mouseReleased = true;
|
|
40058
|
-
that.off("pressup", mouseUpEvent);
|
|
40059
|
-
if (!alternativeMenuIsmade) {
|
|
40060
|
-
addToLabel(letter);
|
|
40061
|
-
}
|
|
40062
|
-
}
|
|
40063
|
-
function makeAlternatemenu() {
|
|
40064
|
-
var label,
|
|
40065
|
-
button,
|
|
40066
|
-
overlay,
|
|
40067
|
-
xPos = 0,
|
|
40068
|
-
thisLetter;
|
|
40069
|
-
timeWait.clear();
|
|
40070
|
-
if (!mouseReleased) {
|
|
40071
|
-
alternativeMenuIsmade = true;
|
|
40072
|
-
alternativeMenu = new zim.Container(1000, size, null, null, false).addTo(that, 0);
|
|
40073
|
-
alternativeMenu.y = - size - 5;
|
|
40074
|
-
for (var i = 0; i < thisArray.length; i++) {
|
|
40075
|
-
if (currentStatus === statuses.shift) {
|
|
40076
|
-
thisLetter = layout=="turkish"?thisArray[i].toLocaleUpperCase("tr-TR"):thisArray[i].toUpperCase();
|
|
40077
|
-
} else {
|
|
40078
|
-
thisLetter = thisArray[i];
|
|
40079
|
-
}
|
|
40080
|
-
label = new zim.Label({
|
|
40081
|
-
lineWidth: 10,
|
|
40082
|
-
lineHeight: 25,
|
|
40083
|
-
text: thisLetter,
|
|
40084
|
-
font: DS.font != null ? DS.font : null,
|
|
40085
|
-
color: color,
|
|
40086
|
-
align: "center",
|
|
40087
|
-
style: false
|
|
40088
|
-
});
|
|
40089
|
-
button = new zim.Rectangle(size, size, backgroundColor, borderColor, borderWidth, corner, null, null, null, false).addTo(alternativeMenu);
|
|
40090
|
-
overlay = new zim.Rectangle(size, size, "white", null, null, corner, null, null, null, false).alp(.2);
|
|
40091
|
-
button.addChild(overlay);
|
|
40092
|
-
label.center(button);
|
|
40093
|
-
button.na = thisArray[i];
|
|
40094
|
-
button.x = xPos;
|
|
40095
|
-
xPos += size + 5;
|
|
40095
|
+
clone.scaleTo(button, sc, sc);
|
|
40096
|
+
clone.centerReg(button);
|
|
40097
|
+
}
|
|
40098
|
+
if (!passesLetter) {
|
|
40099
|
+
label.centerReg(button).mov(0, (!isNaN(label.text)) ? 7 : 3);
|
|
40100
|
+
button.x = xPos;
|
|
40101
|
+
button.y = yPos;
|
|
40102
|
+
button.na = typeKeyboard[i][j];
|
|
40103
|
+
if (i == 2 && j == 0 && which == statuses.number1) button.toggle = "1/2";
|
|
40104
|
+
if (i == 2 && j == 0 && which == statuses.number2) button.toggle = "2/2";
|
|
40105
|
+
if (i == 3 && j == 0 && which == statuses.def) button.toggle = "?123";
|
|
40106
|
+
if (i == 3 && j == 0 && which != statuses.def) button.toggle = "ABC";
|
|
40107
|
+
if (button.toggle) label.mov(0, 3);
|
|
40108
|
+
textKeyButtons.push(button);
|
|
40109
|
+
if (button.na == "shift") {
|
|
40110
|
+
shiftKey = button;
|
|
40096
40111
|
}
|
|
40097
|
-
|
|
40112
|
+
xPos = button.x + button.width + 5;
|
|
40113
|
+
} else {
|
|
40114
|
+
passesLetter = false;
|
|
40115
|
+
xPos += 67.33;
|
|
40098
40116
|
}
|
|
40099
40117
|
}
|
|
40118
|
+
yPos += size + 5;
|
|
40119
|
+
xPos = 0;
|
|
40100
40120
|
}
|
|
40121
|
+
currentKeyboard.cache(borderWidth ? -borderWidth : 0, borderWidth ? -borderWidth : 0, borderWidth ? currentKeyboard.width + borderWidth * 2 : currentKeyboard.width, borderWidth ? currentKeyboard.height + borderWidth * 2 : currentKeyboard.height);
|
|
40122
|
+
}
|
|
40101
40123
|
|
|
40102
|
-
|
|
40103
|
-
|
|
40104
|
-
|
|
40105
|
-
|
|
40106
|
-
|
|
40107
|
-
|
|
40108
|
-
|
|
40109
|
-
|
|
40110
|
-
|
|
40111
|
-
|
|
40112
|
-
|
|
40113
|
-
|
|
40114
|
-
|
|
40115
|
-
|
|
40116
|
-
|
|
40117
|
-
|
|
40118
|
-
|
|
40119
|
-
|
|
40120
|
-
|
|
40121
|
-
|
|
40122
|
-
|
|
40123
|
-
|
|
40124
|
-
|
|
40125
|
-
|
|
40126
|
-
|
|
40127
|
-
|
|
40128
|
-
|
|
40129
|
-
|
|
40130
|
-
|
|
40131
|
-
|
|
40132
|
-
|
|
40133
|
-
|
|
40134
|
-
|
|
40135
|
-
|
|
40136
|
-
|
|
40137
|
-
|
|
40138
|
-
|
|
40139
|
-
|
|
40140
|
-
|
|
40141
|
-
|
|
40142
|
-
|
|
40143
|
-
|
|
40144
|
-
|
|
40145
|
-
|
|
40146
|
-
|
|
40147
|
-
|
|
40148
|
-
|
|
40149
|
-
|
|
40150
|
-
|
|
40151
|
-
|
|
40152
|
-
}
|
|
40153
|
-
showNumPadIcon = new zim.Container({ style: false });
|
|
40154
|
-
showNumPadIcon.setBounds(0, 0, 62, 86);
|
|
40155
|
-
hideNumPadIcon = new zim.Container({ style: false });
|
|
40156
|
-
hideNumPadIcon.setBounds(0, 0, 62, 86);
|
|
40157
|
-
var sA = [
|
|
40158
|
-
{ p: ("Ai+heIF9AAIi/C9g"), transform: [33, 76, 1, 1, 180] },
|
|
40159
|
-
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [46, 43.2] },
|
|
40160
|
-
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [32.3, 43.2] },
|
|
40161
|
-
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [18.8, 43.2] },
|
|
40162
|
-
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [46, 29.5] },
|
|
40163
|
-
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [32.3, 29.5] },
|
|
40164
|
-
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [18.6, 29.5] },
|
|
40165
|
-
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [45.8, 15.8] },
|
|
40166
|
-
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [32.1, 15.8] },
|
|
40167
|
-
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [18.4, 15.8] }
|
|
40168
|
-
];
|
|
40169
|
-
for (var i = 0; i < sA.length; i++) {
|
|
40170
|
-
var numShape = new zim.Shape({ style: false });
|
|
40171
|
-
numShape.graphics.f(color).s().p(sA[i].p);
|
|
40172
|
-
numShape.setTransform(sA[i].transform[0], sA[i].transform[1], sA[i].transform[2], sA[i].transform[3], sA[i].transform[4]);
|
|
40173
|
-
numShape.addTo(showNumPadIcon);
|
|
40174
|
-
var num2Shape = new zim.Shape({ style: false });
|
|
40175
|
-
num2Shape.graphics.f(color).s().p(sA[i].p);
|
|
40176
|
-
num2Shape.setTransform(sA[i].transform[0], sA[i].transform[1]);
|
|
40177
|
-
num2Shape.addTo(hideNumPadIcon);
|
|
40178
|
-
}
|
|
40179
|
-
numShape.graphics.ef().s(white).ss(3).rr(-16,-14,60,55,10);
|
|
40180
|
-
num2Shape.graphics.ef().s(white).ss(3).rr(-16,-14,60,55,10);
|
|
40181
|
-
}
|
|
40182
|
-
|
|
40183
|
-
function makeDragButton() {
|
|
40184
|
-
dragButton = new zim.Rectangle((size * 1.5 + 2.5) + 2.5, size, backgroundColor, borderColor, borderWidth, corner, null, null, null, false).addTo(that, 0).cur();
|
|
40185
|
-
var rect;
|
|
40186
|
-
for (var i = 0; i < 4; i++) {
|
|
40187
|
-
rect = new zim.Rectangle(dragButton.width * 0.4, 4, color, null, null, null, null, null, null, false).centerReg(dragButton).alp(.2);
|
|
40188
|
-
rect.y -= -22 + (i * 15);
|
|
40189
|
-
}
|
|
40190
|
-
dragButton.x = (8.5 * size) + (40);
|
|
40191
|
-
dragButton.y = - size - 5;
|
|
40192
|
-
dragButton.na = "drag";
|
|
40193
|
-
}
|
|
40194
|
-
|
|
40195
|
-
function showNumPad(status) {
|
|
40196
|
-
if (!that.numPad) {
|
|
40197
|
-
that.numPad = new zim.NumPad({advanced:numPadAdvanced, draggable:numPadDraggable}).sca(numPadScale);
|
|
40198
|
-
if (numPadDraggable || numPadOnly) that.numPad.center({add:false});
|
|
40199
|
-
else that.numPad.pos({x:0, y:8, horizontal:"center", vertical:"bottom", add:false});
|
|
40200
|
-
that.numPad.on("pressed", function() {
|
|
40201
|
-
if (that.numPad.key == "enter") {
|
|
40202
|
-
that.dispatchEvent("enter");
|
|
40203
|
-
} else if (that.numPad.key == "backspace") {
|
|
40204
|
-
that.removeChar();
|
|
40205
|
-
} else if (that.numPad.key == "clear") {
|
|
40206
|
-
that.clearText();
|
|
40207
|
-
} else if (that.numPad.key == "space") {
|
|
40208
|
-
addToLabel(" ");
|
|
40124
|
+
function makeAlternativeLetters(letter) {
|
|
40125
|
+
var thisArray = data[3][letter];
|
|
40126
|
+
var mouseReleased = false;
|
|
40127
|
+
var alternativeMenuIsmade = false;
|
|
40128
|
+
var timeWait;
|
|
40129
|
+
// switch (letter) {
|
|
40130
|
+
// case "e":
|
|
40131
|
+
// thisArray = eLetters;
|
|
40132
|
+
// break;
|
|
40133
|
+
// case "u":
|
|
40134
|
+
// thisArray = uLetters;
|
|
40135
|
+
// break;
|
|
40136
|
+
// case "i":
|
|
40137
|
+
// thisArray = iLetters;
|
|
40138
|
+
// break;
|
|
40139
|
+
// case "o":
|
|
40140
|
+
// thisArray = oLetters;
|
|
40141
|
+
// break;
|
|
40142
|
+
// case "a":
|
|
40143
|
+
// thisArray = aLetters;
|
|
40144
|
+
// break;
|
|
40145
|
+
// case "n":
|
|
40146
|
+
// thisArray = nLetters;
|
|
40147
|
+
// break;
|
|
40148
|
+
// default:
|
|
40149
|
+
// break;
|
|
40150
|
+
// }
|
|
40151
|
+
timeWait = zim.timeout(500, makeAlternatemenu, null, "ms");
|
|
40152
|
+
var mouseUpEvent = that.on("pressup", mouseUp);
|
|
40153
|
+
function mouseUp() {
|
|
40154
|
+
mouseReleased = true;
|
|
40155
|
+
that.off("pressup", mouseUpEvent);
|
|
40156
|
+
if (!alternativeMenuIsmade) {
|
|
40157
|
+
addToLabel(letter);
|
|
40158
|
+
}
|
|
40159
|
+
}
|
|
40160
|
+
function makeAlternatemenu() {
|
|
40161
|
+
var label,
|
|
40162
|
+
button,
|
|
40163
|
+
overlay,
|
|
40164
|
+
xPos = 0,
|
|
40165
|
+
thisLetter;
|
|
40166
|
+
timeWait.clear();
|
|
40167
|
+
if (!mouseReleased) {
|
|
40168
|
+
alternativeMenuIsmade = true;
|
|
40169
|
+
alternativeMenu = new zim.Container(1000, size, null, null, false).addTo(that, 0);
|
|
40170
|
+
alternativeMenu.y = - size - 5;
|
|
40171
|
+
for (var i = 0; i < thisArray.length; i++) {
|
|
40172
|
+
if (currentStatus === statuses.shift) {
|
|
40173
|
+
thisLetter = layout=="turkish"?thisArray[i].toLocaleUpperCase("tr-TR"):thisArray[i].toUpperCase();
|
|
40209
40174
|
} else {
|
|
40210
|
-
|
|
40175
|
+
thisLetter = thisArray[i];
|
|
40211
40176
|
}
|
|
40212
|
-
|
|
40213
|
-
|
|
40214
|
-
|
|
40215
|
-
|
|
40216
|
-
|
|
40217
|
-
|
|
40218
|
-
|
|
40219
|
-
|
|
40220
|
-
|
|
40221
|
-
|
|
40222
|
-
|
|
40223
|
-
|
|
40224
|
-
|
|
40225
|
-
|
|
40226
|
-
|
|
40227
|
-
|
|
40228
|
-
|
|
40229
|
-
that.
|
|
40230
|
-
showNumPadIcon.clone().scaleTo(numPadKey, 60, 60).centerReg(numPadKey,2);
|
|
40231
|
-
} else if (!that.numPad.parent || status === true) {
|
|
40232
|
-
that.numPad.addTo();
|
|
40233
|
-
that.dispatchEvent("numpadopen");
|
|
40234
|
-
hideNumPadIcon.clone().scaleTo(numPadKey, 60, 60).centerReg(numPadKey,2);
|
|
40177
|
+
label = new zim.Label({
|
|
40178
|
+
lineWidth: 10,
|
|
40179
|
+
lineHeight: 25,
|
|
40180
|
+
text: thisLetter,
|
|
40181
|
+
font: DS.font != null ? DS.font : null,
|
|
40182
|
+
color: color,
|
|
40183
|
+
align: "center",
|
|
40184
|
+
style: false
|
|
40185
|
+
});
|
|
40186
|
+
button = new zim.Rectangle(size, size, backgroundColor, borderColor, borderWidth, corner, null, null, null, false).addTo(alternativeMenu);
|
|
40187
|
+
overlay = new zim.Rectangle(size, size, "white", null, null, corner, null, null, null, false).alp(.2);
|
|
40188
|
+
button.addChild(overlay);
|
|
40189
|
+
label.center(button);
|
|
40190
|
+
button.na = thisArray[i];
|
|
40191
|
+
button.x = xPos;
|
|
40192
|
+
xPos += size + 5;
|
|
40193
|
+
}
|
|
40194
|
+
if (that.stage) that.stage.update();
|
|
40235
40195
|
}
|
|
40236
|
-
currentKeyboard.updateCache();
|
|
40237
|
-
if (that.stage) that.stage.update();
|
|
40238
40196
|
}
|
|
40197
|
+
}
|
|
40239
40198
|
|
|
40240
|
-
|
|
40241
|
-
|
|
40242
|
-
}
|
|
40199
|
+
function makeIcons() {
|
|
40200
|
+
//shift
|
|
40201
|
+
shiftKeyIcon = new zim.Shape({ style: false });
|
|
40202
|
+
shiftKeyIcon.graphics.f(color).p("AhIFoIAAjYIixAAID5n3ID6H3IixAAIAADYgAjHBxICeAAIAADYIBTAAIAAjYICeAAIjImSg");
|
|
40203
|
+
shiftKeyIcon.setBounds(-51 / 2, -72 / 2, 51, 72);
|
|
40204
|
+
//backspace
|
|
40205
|
+
backspaceIcon = new zim.Container({ style: false });
|
|
40206
|
+
var backspaceShape1 = new zim.Shape({ style: false });
|
|
40207
|
+
backspaceShape1.graphics.f(color).p("ACgC+IigigIifCgQgGAGgJAAQgJAAgGgGQgGgGgBgJQABgJAGgGICgigIigifQgGgGgBgJQABgJAGgGQAGgGAJAAQAIAAAHAGICfCgICgigQAGgGAJAAQAJAAAGAGQAGAGABAJQgBAJgGAGIigCfICgCgQAGAGABAJQgBAJgGAGQgGAGgJAAQgJAAgGgGg");
|
|
40208
|
+
backspaceShape1.setTransform(82.6, 32);
|
|
40209
|
+
backspaceShape1.addTo(backspaceIcon);
|
|
40210
|
+
var backspaceShape2 = new zim.Shape({ style: false });
|
|
40211
|
+
backspaceShape2.graphics.f(color).s().p("AkhFAQgcAAgUgUIkHj6QgVgUAAgeQAAgdAVgVIEHj6QAUgTAcAAINKAAQAdAAAUAUQAUAUAAAdIAAH1QAAAdgUATQgUAVgdAAgAk0kOIkGD8QgIAHAAALQAAALAIAIIEGD7QAIAHALAAINKAAQALAAAIgIQAHgHAAgLIAAn1QAAgLgHgIQgIgIgLAAItKAAQgLAAgIAHg");
|
|
40212
|
+
backspaceShape2.setTransform(62.2, 32);
|
|
40213
|
+
backspaceShape2.addTo(backspaceIcon);
|
|
40214
|
+
backspaceIcon.setBounds(0, 0, 125, 64);
|
|
40215
|
+
//keyboardAway
|
|
40216
|
+
hideKeyBoardIcon = new zim.Container({ style: false });
|
|
40217
|
+
hideKeyBoardIcon.setBounds(0, 0, 147, 86);
|
|
40218
|
+
var hideKeyBoardIconArray = [
|
|
40219
|
+
{ p: ("Ai+heIF9AAIi/C9g"), transform: [73.4, 76] },
|
|
40220
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [128.4, 43.2] },
|
|
40221
|
+
{ p: ("AnNAzIAAhlIObAAIAABlg"), transform: [73, 43.2] },
|
|
40222
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [18.8, 43.2] },
|
|
40223
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [128.2, 29.5] },
|
|
40224
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [114.5, 29.5] },
|
|
40225
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [100.8, 29.5] },
|
|
40226
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [87.1, 29.5] },
|
|
40227
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [73.4, 29.5] },
|
|
40228
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [59.7, 29.5] },
|
|
40229
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [46, 29.5] },
|
|
40230
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [32.3, 29.5] },
|
|
40231
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [18.6, 29.5] },
|
|
40232
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [128, 15.8] },
|
|
40233
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [114.3, 15.8] },
|
|
40234
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [100.6, 15.8] },
|
|
40235
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [86.9, 15.8] },
|
|
40236
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [73.2, 15.8] },
|
|
40237
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [59.5, 15.8] },
|
|
40238
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [45.8, 15.8] },
|
|
40239
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [32.1, 15.8] },
|
|
40240
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [18.4, 15.8] },
|
|
40241
|
+
{ p: ("AphEnQgzAAgkgkQglglAAgzIAAlVQAAgzAlglQAkgkAzAAITDAAQAzAAAkAkQAlAlAAAzIAAFVQAAAzglAlQgkAkgzAAgAqjjtQgcAcAAAnIAAFVQAAAnAcAbQAbAcAnAAITDAAQAnAAAcgcQAbgbAAgnIAAlVQAAgngbgcQgcgcgnAAIzDAAQgnAAgbAcg"), transform: [73.4, 29.5] }
|
|
40242
|
+
];
|
|
40243
|
+
var thisShape;
|
|
40244
|
+
for (var i = 0; i < hideKeyBoardIconArray.length; i++) {
|
|
40245
|
+
thisShape = new zim.Shape({ style: false });
|
|
40246
|
+
thisShape.graphics.f(color).s().p(hideKeyBoardIconArray[i].p);
|
|
40247
|
+
thisShape.setTransform(hideKeyBoardIconArray[i].transform[0], hideKeyBoardIconArray[i].transform[1]);
|
|
40248
|
+
thisShape.addTo(hideKeyBoardIcon);
|
|
40249
|
+
}
|
|
40250
|
+
showNumPadIcon = new zim.Container({ style: false });
|
|
40251
|
+
showNumPadIcon.setBounds(0, 0, 62, 86);
|
|
40252
|
+
hideNumPadIcon = new zim.Container({ style: false });
|
|
40253
|
+
hideNumPadIcon.setBounds(0, 0, 62, 86);
|
|
40254
|
+
var sA = [
|
|
40255
|
+
{ p: ("Ai+heIF9AAIi/C9g"), transform: [33, 76, 1, 1, 180] },
|
|
40256
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [46, 43.2] },
|
|
40257
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [32.3, 43.2] },
|
|
40258
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [18.8, 43.2] },
|
|
40259
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [46, 29.5] },
|
|
40260
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [32.3, 29.5] },
|
|
40261
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [18.6, 29.5] },
|
|
40262
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [45.8, 15.8] },
|
|
40263
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [32.1, 15.8] },
|
|
40264
|
+
{ p: ("AgyAzIAAhlIBlAAIAABlg"), transform: [18.4, 15.8] }
|
|
40265
|
+
];
|
|
40266
|
+
for (var i = 0; i < sA.length; i++) {
|
|
40267
|
+
var numShape = new zim.Shape({ style: false });
|
|
40268
|
+
numShape.graphics.f(color).s().p(sA[i].p);
|
|
40269
|
+
numShape.setTransform(sA[i].transform[0], sA[i].transform[1], sA[i].transform[2], sA[i].transform[3], sA[i].transform[4]);
|
|
40270
|
+
numShape.addTo(showNumPadIcon);
|
|
40271
|
+
var num2Shape = new zim.Shape({ style: false });
|
|
40272
|
+
num2Shape.graphics.f(color).s().p(sA[i].p);
|
|
40273
|
+
num2Shape.setTransform(sA[i].transform[0], sA[i].transform[1]);
|
|
40274
|
+
num2Shape.addTo(hideNumPadIcon);
|
|
40275
|
+
}
|
|
40276
|
+
numShape.graphics.ef().s(white).ss(3).rr(-16,-14,60,55,10);
|
|
40277
|
+
num2Shape.graphics.ef().s(white).ss(3).rr(-16,-14,60,55,10);
|
|
40278
|
+
}
|
|
40243
40279
|
|
|
40244
|
-
|
|
40245
|
-
|
|
40246
|
-
|
|
40280
|
+
function makeDragButton() {
|
|
40281
|
+
dragButton = new zim.Rectangle((size * 1.5 + 2.5) + 2.5, size, backgroundColor, borderColor, borderWidth, corner, null, null, null, false).addTo(that, 0).cur();
|
|
40282
|
+
var rect;
|
|
40283
|
+
for (var i = 0; i < 4; i++) {
|
|
40284
|
+
rect = new zim.Rectangle(dragButton.width * 0.4, 4, color, null, null, null, null, null, null, false).centerReg(dragButton).alp(.2);
|
|
40285
|
+
rect.y -= -22 + (i * 15);
|
|
40286
|
+
}
|
|
40287
|
+
dragButton.x = (8.5 * size) + (40);
|
|
40288
|
+
dragButton.y = - size - 5;
|
|
40289
|
+
dragButton.na = "drag";
|
|
40290
|
+
}
|
|
40291
|
+
|
|
40292
|
+
function showNumPad(status) {
|
|
40293
|
+
if (!that.numPad) {
|
|
40294
|
+
that.numPad = new zim.NumPad({advanced:numPadAdvanced, draggable:numPadDraggable}).sca(numPadScale);
|
|
40295
|
+
if (numPadDraggable || numPadOnly) that.numPad.center({add:false, container:container});
|
|
40296
|
+
else that.numPad.pos({x:0, y:8, horizontal:"center", vertical:"bottom", add:false, container:container});
|
|
40297
|
+
that.numPad.on("pressed", function() {
|
|
40298
|
+
if (that.numPad.key == "enter") {
|
|
40299
|
+
that.dispatchEvent("enter");
|
|
40300
|
+
} else if (that.numPad.key == "backspace") {
|
|
40301
|
+
that.removeChar();
|
|
40302
|
+
} else if (that.numPad.key == "clear") {
|
|
40303
|
+
that.clearText();
|
|
40304
|
+
} else if (that.numPad.key == "space") {
|
|
40305
|
+
addToLabel(" ");
|
|
40306
|
+
} else {
|
|
40307
|
+
addToLabel(that.numPad.key);
|
|
40308
|
+
}
|
|
40309
|
+
});
|
|
40310
|
+
that.numPad.on("close", function() {
|
|
40311
|
+
numPadKey.removeChildAt(2);
|
|
40312
|
+
showNumPadIcon.clone().scaleTo(numPadKey, 60, 60).centerReg(numPadKey,2);
|
|
40313
|
+
currentKeyboard.updateCache();
|
|
40314
|
+
if ((!that.keys.parent || !that.keys.visible) && textBlinker) {
|
|
40315
|
+
textBlinker.visible = false;
|
|
40316
|
+
that.toggled = false;
|
|
40317
|
+
removeCursorShiftMenu();
|
|
40318
|
+
}
|
|
40319
|
+
that.dispatchEvent("numpadclose");
|
|
40320
|
+
});
|
|
40247
40321
|
}
|
|
40322
|
+
|
|
40248
40323
|
|
|
40249
|
-
|
|
40324
|
+
numPadKey.removeChildAt(2);
|
|
40325
|
+
if (that.numPad.parent || status === false) {
|
|
40326
|
+
that.numPad.removeFrom();
|
|
40327
|
+
that.dispatchEvent("numpadclose");
|
|
40328
|
+
showNumPadIcon.clone().scaleTo(numPadKey, 60, 60).centerReg(numPadKey,2);
|
|
40329
|
+
} else if (!that.numPad.parent || status === true) {
|
|
40330
|
+
that.numPad.addTo(container);
|
|
40331
|
+
that.dispatchEvent("numpadopen");
|
|
40332
|
+
hideNumPadIcon.clone().scaleTo(numPadKey, 60, 60).centerReg(numPadKey,2);
|
|
40333
|
+
}
|
|
40334
|
+
currentKeyboard.updateCache();
|
|
40335
|
+
if (that.stage) that.stage.update();
|
|
40336
|
+
}
|
|
40250
40337
|
|
|
40251
|
-
|
|
40338
|
+
function startDragging() {
|
|
40339
|
+
if (that.mouseYAmount) that.y = that.parent.globalToLocal(0, that.mouseYAmount - dragY).y;
|
|
40340
|
+
}
|
|
40252
40341
|
|
|
40253
|
-
|
|
40254
|
-
|
|
40255
|
-
|
|
40256
|
-
|
|
40257
|
-
|
|
40258
|
-
|
|
40259
|
-
}
|
|
40260
|
-
// Dan Zen added 9.5.0 padding for three types of Label (backing, backgroundColor and neither)
|
|
40261
|
-
textBlinker.heightOnly = currentLabel.getBounds().height*(currentLabel.backing&&zot(currentLabel.padding)?.9:1)-((currentLabel.paddingV&¤tLabel.background)?currentLabel.paddingV*2:0);
|
|
40262
|
-
textBlinker.center(currentLabel);
|
|
40263
|
-
textBlinker.x = positionXBlinker;
|
|
40264
|
-
}
|
|
40342
|
+
function stopDragging() {
|
|
40343
|
+
currentStage.off("pressmousemove", that.tickerMouseEvent);
|
|
40344
|
+
zim.Ticker.remove(startDragging);
|
|
40345
|
+
}
|
|
40346
|
+
|
|
40347
|
+
that.setBounds(1000,400-(numH-10)*26); // Dan Zen for any size keyboard
|
|
40265
40348
|
|
|
40266
|
-
|
|
40267
|
-
|
|
40268
|
-
|
|
40269
|
-
|
|
40270
|
-
|
|
40271
|
-
|
|
40272
|
-
|
|
40273
|
-
|
|
40274
|
-
point = currentLabel.localToLocal(0, 0, that);
|
|
40275
|
-
cursorShiftMenu = that.place = new zim.Container({ style: false }).addTo(that).cur();
|
|
40276
|
-
for (var i = 0; i < tekens.length; i++) {
|
|
40277
|
-
bakking = new zim.Rectangle(size, size, placeBackgroundColor, borderColor, borderWidth, corner, null, null, null, false);
|
|
40278
|
-
if (tekens[i] == "x") new zim.Rectangle(size, size, "black", null, null, corner, null, null, null, false).alp(shadeAlpha).addTo(bakking);
|
|
40279
|
-
button = new zim.Label({
|
|
40280
|
-
lineWidth: 10,
|
|
40281
|
-
// lineHeight:58, // ?
|
|
40282
|
-
text: tekens[i],
|
|
40283
|
-
backing: bakking,
|
|
40284
|
-
font: DS.font != null ? DS.font : null,
|
|
40285
|
-
color: placeColor,
|
|
40286
|
-
align: "center",
|
|
40287
|
-
valign: "center",
|
|
40288
|
-
style: false
|
|
40289
|
-
});
|
|
40290
|
-
button.pos(0, 0, zim.LEFT, zim.TOP, cursorShiftMenu).cache();
|
|
40291
|
-
button.x = button.x + i * (size + 5);
|
|
40292
|
-
buttonsCursor.push(button);
|
|
40293
|
-
}
|
|
40294
|
-
point = currentLabel.localToLocal(0, 0, that);
|
|
40295
|
-
cursorShiftMenu.x = point.x + placeShiftH;
|
|
40296
|
-
cursorShiftMenu.y = point.y + currentLabel.height + 15 + placeShiftV;
|
|
40297
|
-
cursorShiftMenu.on("click", verschuifCursor);
|
|
40298
|
-
function verschuifCursor(e) {
|
|
40299
|
-
if (buttonsCursor.indexOf(e.target) == 0) {
|
|
40300
|
-
if (insertPoint > 0) insertPoint--;
|
|
40301
|
-
} else if (buttonsCursor.indexOf(e.target) == 1) {
|
|
40302
|
-
if (insertPoint < currentLabel.text.length) insertPoint++;
|
|
40303
|
-
} else {
|
|
40304
|
-
removeCursorShiftMenu();
|
|
40305
|
-
}
|
|
40306
|
-
positionBlinker();
|
|
40307
|
-
}
|
|
40308
|
-
if (that.stage) that.stage.update();
|
|
40349
|
+
// ~~~~~~~~~~~~~~~~~ LABELS AND CURSOR
|
|
40350
|
+
|
|
40351
|
+
function positionBlinker() {
|
|
40352
|
+
if (!currentLabel || !textBlinker) return;
|
|
40353
|
+
// Dan Zen added 9.5.0 using CreateJS Label to avoid padding and backing issues and addition of bounds x for align issues
|
|
40354
|
+
var positionXBlinker = currentLabel.label.x + currentLabel.label.getBounds().x;
|
|
40355
|
+
for (var i=0; i<insertPoint;i++) {
|
|
40356
|
+
positionXBlinker += currentLabel.widthArray[i]?currentLabel.widthArray[i]:0;
|
|
40309
40357
|
}
|
|
40310
|
-
|
|
40311
|
-
|
|
40312
|
-
|
|
40313
|
-
|
|
40314
|
-
|
|
40315
|
-
|
|
40316
|
-
|
|
40317
|
-
|
|
40318
|
-
|
|
40319
|
-
|
|
40320
|
-
|
|
40321
|
-
|
|
40322
|
-
|
|
40323
|
-
|
|
40324
|
-
|
|
40358
|
+
// Dan Zen added 9.5.0 padding for three types of Label (backing, backgroundColor and neither)
|
|
40359
|
+
textBlinker.heightOnly = currentLabel.getBounds().height*(currentLabel.backing&&zot(currentLabel.padding)?.9:1)-((currentLabel.paddingV&¤tLabel.background)?currentLabel.paddingV*2:0);
|
|
40360
|
+
textBlinker.center(currentLabel);
|
|
40361
|
+
textBlinker.x = positionXBlinker;
|
|
40362
|
+
}
|
|
40363
|
+
|
|
40364
|
+
function makeCursorShiftmenu() {
|
|
40365
|
+
if (cursorShiftMenu) return that;
|
|
40366
|
+
if (!currentLabel) return that;
|
|
40367
|
+
var tekens = placeClose ? ["<", ">", "x"] : ["<", ">"];
|
|
40368
|
+
var bakking;
|
|
40369
|
+
var button;
|
|
40370
|
+
var point;
|
|
40371
|
+
buttonsCursor = [];
|
|
40372
|
+
point = currentLabel.localToLocal(0, 0, that);
|
|
40373
|
+
cursorShiftMenu = that.placeMenu = new zim.Container({ style: false }).sca(placeScale).addTo(container).cur();
|
|
40374
|
+
for (var i = 0; i < tekens.length; i++) {
|
|
40375
|
+
bakking = new zim.Rectangle(size, size, placeBackgroundColor, borderColor, borderWidth, corner, null, null, null, false);
|
|
40376
|
+
if (tekens[i] == "x") new zim.Rectangle(size, size, "black", null, null, corner, null, null, null, false).alp(shadeAlpha).addTo(bakking);
|
|
40377
|
+
button = new zim.Label({
|
|
40378
|
+
lineWidth: 10,
|
|
40379
|
+
// lineHeight:58, // ?
|
|
40380
|
+
text: tekens[i],
|
|
40381
|
+
backing: bakking,
|
|
40382
|
+
font: DS.font != null ? DS.font : null,
|
|
40383
|
+
color: placeColor,
|
|
40384
|
+
align: "center",
|
|
40385
|
+
valign: "center",
|
|
40386
|
+
style: false
|
|
40387
|
+
});
|
|
40388
|
+
button.pos(0, 0, zim.LEFT, zim.TOP, cursorShiftMenu).cache();
|
|
40389
|
+
button.x = button.x + i * (size + 5);
|
|
40390
|
+
buttonsCursor.push(button);
|
|
40391
|
+
}
|
|
40392
|
+
point = currentLabel.localToLocal(0, 0, container);
|
|
40393
|
+
cursorShiftMenu.x = point.x + placeShiftH;
|
|
40394
|
+
cursorShiftMenu.y = point.y + currentLabel.height + 15 + placeShiftV;
|
|
40395
|
+
cursorShiftMenu.on("click", verschuifCursor);
|
|
40396
|
+
function verschuifCursor(e) {
|
|
40397
|
+
if (buttonsCursor.indexOf(e.target) == 0) {
|
|
40398
|
+
if (insertPoint > 0) insertPoint--;
|
|
40399
|
+
} else if (buttonsCursor.indexOf(e.target) == 1) {
|
|
40400
|
+
if (insertPoint < currentLabel.text.length) insertPoint++;
|
|
40325
40401
|
} else {
|
|
40326
|
-
|
|
40327
|
-
letter = layout=="turkish"?letter.toLocaleUpperCase("tr-TR"):letter.toUpperCase();
|
|
40328
|
-
}
|
|
40329
|
-
if (currentLabel && that.maxLength && currentLabel.text.length >= that.maxLength) return;
|
|
40330
|
-
if (that.numbersOnly && !isFinite(Number(letter))) return;
|
|
40331
|
-
var textBeforeCheck = currentLabel.text;
|
|
40332
|
-
measureField = currentLabel.clone().removeFrom();
|
|
40333
|
-
measureField.text = letter;
|
|
40334
|
-
widthMeasureField = measureField.label.getMeasuredWidth();
|
|
40335
|
-
if (!currentLabel.widthArray) {
|
|
40336
|
-
currentLabel.widthArray = [currentLabel.breedte];
|
|
40337
|
-
} else {
|
|
40338
|
-
currentLabel.widthArray.splice(insertPoint,0,widthMeasureField);
|
|
40339
|
-
}
|
|
40340
|
-
//toevoegen in string
|
|
40341
|
-
if (insertPoint<currentLabel.text.length) {
|
|
40342
|
-
currentLabel.text = [currentLabel.text.slice(0,insertPoint),letter,currentLabel.text.slice(insertPoint)].join('');
|
|
40343
|
-
} else {
|
|
40344
|
-
// currentLabel.text+="\u202E" + letter;
|
|
40345
|
-
currentLabel.text+=letter;
|
|
40346
|
-
}
|
|
40347
|
-
// if (currentLabel && currentLabel.width<maxWidth) {
|
|
40348
|
-
if (currentLabel && currentLabel.label.getBounds().width<maxWidth) {
|
|
40349
|
-
insertPoint++;
|
|
40350
|
-
positionBlinker();
|
|
40351
|
-
} else {
|
|
40352
|
-
currentLabel.text = textBeforeCheck;
|
|
40353
|
-
}
|
|
40354
|
-
}
|
|
40355
|
-
if (currentStatus === statuses.shift&&!bigShiftOn) {
|
|
40356
|
-
that.removeChild(currentKeyboard);
|
|
40357
|
-
makeButtons();
|
|
40358
|
-
currentStatus = statuses.def;
|
|
40402
|
+
removeCursorShiftMenu();
|
|
40359
40403
|
}
|
|
40360
40404
|
positionBlinker();
|
|
40361
|
-
var keyEvent = new createjs.Event("keydown");
|
|
40362
|
-
keyEvent.letter = letter;
|
|
40363
|
-
that.dispatchEvent(keyEvent);
|
|
40364
|
-
if (that.stage) that.stage.update();
|
|
40365
40405
|
}
|
|
40406
|
+
if (that.stage) that.stage.update();
|
|
40407
|
+
}
|
|
40366
40408
|
|
|
40367
|
-
|
|
40368
|
-
|
|
40369
|
-
|
|
40370
|
-
|
|
40371
|
-
|
|
40372
|
-
|
|
40373
|
-
|
|
40374
|
-
|
|
40375
|
-
|
|
40376
|
-
|
|
40377
|
-
|
|
40378
|
-
|
|
40379
|
-
|
|
40380
|
-
|
|
40381
|
-
|
|
40382
|
-
|
|
40383
|
-
|
|
40384
|
-
|
|
40385
|
-
|
|
40386
|
-
|
|
40387
|
-
|
|
40388
|
-
|
|
40389
|
-
|
|
40390
|
-
|
|
40391
|
-
|
|
40392
|
-
|
|
40393
|
-
|
|
40394
|
-
|
|
40395
|
-
|
|
40396
|
-
// found = true;
|
|
40397
|
-
// break;
|
|
40398
|
-
// }
|
|
40399
|
-
// }
|
|
40400
|
-
for (var i=0; i<currentLabel.widthArray.length; i++) {
|
|
40401
|
-
sumUp += currentLabel.widthArray[i];
|
|
40402
|
-
// Dan Zen added 9.5.0 addition of bounds x for when align is center or right
|
|
40403
|
-
if (point.x < sumUp-currentLabel.widthArray[i]/2+currentLabel.label.getBounds().x) {
|
|
40404
|
-
insertPoint = i;
|
|
40405
|
-
found = true;
|
|
40406
|
-
break;
|
|
40407
|
-
}
|
|
40409
|
+
function removeCursorShiftMenu() {
|
|
40410
|
+
if (!cursorShiftMenu) return that;
|
|
40411
|
+
cursorShiftMenu.dispose();
|
|
40412
|
+
cursorShiftMenu = null;
|
|
40413
|
+
}
|
|
40414
|
+
|
|
40415
|
+
function addToLabel(letter) {
|
|
40416
|
+
if (!currentLabel) return;
|
|
40417
|
+
var measureField;
|
|
40418
|
+
var widthMeasureField;
|
|
40419
|
+
// backspace
|
|
40420
|
+
if (letter === "del") {
|
|
40421
|
+
if (currentLabel) currentLabel.text = [currentLabel.text.slice(0,insertPoint-1),currentLabel.text.slice(insertPoint)].join('');
|
|
40422
|
+
insertPoint--;
|
|
40423
|
+
makeWidthsArray();
|
|
40424
|
+
} else {
|
|
40425
|
+
if (currentStatus === statuses.shift) {
|
|
40426
|
+
letter = layout=="turkish"?letter.toLocaleUpperCase("tr-TR"):letter.toUpperCase();
|
|
40427
|
+
}
|
|
40428
|
+
if (currentLabel && that.maxLength && currentLabel.text.length >= that.maxLength) return;
|
|
40429
|
+
if (that.numbersOnly && !isFinite(Number(letter))) return;
|
|
40430
|
+
var textBeforeCheck = currentLabel.text;
|
|
40431
|
+
measureField = currentLabel.clone().removeFrom();
|
|
40432
|
+
measureField.text = letter;
|
|
40433
|
+
widthMeasureField = measureField.label.getMeasuredWidth();
|
|
40434
|
+
if (!currentLabel.widthArray) {
|
|
40435
|
+
currentLabel.widthArray = [currentLabel.breedte];
|
|
40436
|
+
} else {
|
|
40437
|
+
currentLabel.widthArray.splice(insertPoint,0,widthMeasureField);
|
|
40408
40438
|
}
|
|
40409
|
-
|
|
40410
|
-
|
|
40439
|
+
//toevoegen in string
|
|
40440
|
+
if (insertPoint<currentLabel.text.length) {
|
|
40441
|
+
currentLabel.text = [currentLabel.text.slice(0,insertPoint),letter,currentLabel.text.slice(insertPoint)].join('');
|
|
40442
|
+
} else {
|
|
40443
|
+
// currentLabel.text+="\u202E" + letter;
|
|
40444
|
+
currentLabel.text+=letter;
|
|
40411
40445
|
}
|
|
40412
|
-
|
|
40413
|
-
if (
|
|
40414
|
-
|
|
40415
|
-
|
|
40416
|
-
|
|
40417
|
-
|
|
40418
|
-
point = currentLabel.localToLocal(0, 0, that);
|
|
40419
|
-
cursorShiftMenu.x = point.x+placeShiftH;
|
|
40420
|
-
cursorShiftMenu.y = point.y+currentLabel.height+15+placeShiftV;
|
|
40421
|
-
} else {
|
|
40422
|
-
removeCursorShiftMenu();
|
|
40423
|
-
}
|
|
40446
|
+
// if (currentLabel && currentLabel.width<maxWidth) {
|
|
40447
|
+
if (currentLabel && currentLabel.label.getBounds().width<maxWidth) {
|
|
40448
|
+
insertPoint++;
|
|
40449
|
+
positionBlinker();
|
|
40450
|
+
} else {
|
|
40451
|
+
currentLabel.text = textBeforeCheck;
|
|
40424
40452
|
}
|
|
40425
40453
|
}
|
|
40426
|
-
|
|
40427
|
-
|
|
40428
|
-
|
|
40429
|
-
|
|
40430
|
-
for (var i=0; i<currentLabel.text.length; i++) {
|
|
40431
|
-
measureField = currentLabel.clone().removeFrom();
|
|
40432
|
-
measureField.text = currentLabel.text[i];
|
|
40433
|
-
currentLabel.widthArray.push(measureField.label.getMeasuredWidth());
|
|
40434
|
-
}
|
|
40435
|
-
measureField.text = currentLabel.text; // weird bug shortening clone shortens hitArea of original
|
|
40436
|
-
currentLabel.widthArrayCheck = true;
|
|
40437
|
-
positionBlinker();
|
|
40454
|
+
if (currentStatus === statuses.shift&&!bigShiftOn) {
|
|
40455
|
+
that.removeChild(currentKeyboard);
|
|
40456
|
+
makeButtons();
|
|
40457
|
+
currentStatus = statuses.def;
|
|
40438
40458
|
}
|
|
40459
|
+
positionBlinker();
|
|
40460
|
+
var keyEvent = new createjs.Event("keydown");
|
|
40461
|
+
keyEvent.letter = letter;
|
|
40462
|
+
that.dispatchEvent(keyEvent);
|
|
40463
|
+
if (that.stage) that.stage.update();
|
|
40464
|
+
}
|
|
40439
40465
|
|
|
40440
|
-
|
|
40441
|
-
|
|
40442
|
-
|
|
40443
|
-
|
|
40444
|
-
|
|
40445
|
-
|
|
40446
|
-
|
|
40447
|
-
|
|
40448
|
-
|
|
40449
|
-
|
|
40450
|
-
|
|
40451
|
-
|
|
40452
|
-
|
|
40453
|
-
|
|
40466
|
+
function activateLabel(e) {
|
|
40467
|
+
if (!that.stage) return;
|
|
40468
|
+
var point;
|
|
40469
|
+
var sumUp = 0;
|
|
40470
|
+
var found = false;
|
|
40471
|
+
currentLabel = e.target;
|
|
40472
|
+
if (!currentLabel.widthArrayCheck) makeWidthsArray();
|
|
40473
|
+
maxWidth = currentLabel.label.lineWidth?currentLabel.label.lineWidth:10000;
|
|
40474
|
+
|
|
40475
|
+
// Dan Zen added 9.5.0 point relative to actual CreateJS Label - to avoid padding and backing issues
|
|
40476
|
+
point = currentLabel.globalToLocal(e.stageX/zim.scaX, e.stageY/zim.scaY);
|
|
40477
|
+
point.x -= currentLabel.label.x; // adjusted for retina - label is CreateJS with broken globalToLocal
|
|
40478
|
+
point.y -= currentLabel.label.y;
|
|
40479
|
+
// point opzoeken in array textfield door op te tellen
|
|
40480
|
+
// for (var i=currentLabel.widthArray.length-1; i>=0; i--) {
|
|
40481
|
+
// sumUp += currentLabel.widthArray[i];
|
|
40482
|
+
// if (point.x < sumUp-currentLabel.widthArray[i]/2) {
|
|
40483
|
+
// insertPoint = i;
|
|
40484
|
+
// found = true;
|
|
40485
|
+
// break;
|
|
40486
|
+
// }
|
|
40487
|
+
// }
|
|
40488
|
+
// var rightOfLabel = currentLabel.getBounds().width + currentLabel.getBounds().x;
|
|
40489
|
+
// zog(rightOfLabel);
|
|
40490
|
+
// zog(currentLabel.widthArray)
|
|
40491
|
+
// for (var i=0; i<currentLabel.widthArray.length; i++) {
|
|
40492
|
+
// sumUp += currentLabel.widthArray.reverse()[i];
|
|
40493
|
+
// if (point.x < rightOfLabel - sumUp-currentLabel.widthArray.reverse()[i]/2) {
|
|
40494
|
+
// insertPoint = i;
|
|
40495
|
+
// found = true;
|
|
40496
|
+
// break;
|
|
40497
|
+
// }
|
|
40498
|
+
// }
|
|
40499
|
+
for (var i=0; i<currentLabel.widthArray.length; i++) {
|
|
40500
|
+
sumUp += currentLabel.widthArray[i];
|
|
40501
|
+
// Dan Zen added 9.5.0 addition of bounds x for when align is center or right
|
|
40502
|
+
if (point.x < sumUp-currentLabel.widthArray[i]/2+currentLabel.label.getBounds().x) {
|
|
40503
|
+
insertPoint = i;
|
|
40504
|
+
found = true;
|
|
40505
|
+
break;
|
|
40454
40506
|
}
|
|
40455
|
-
|
|
40456
|
-
|
|
40457
|
-
|
|
40458
|
-
|
|
40459
|
-
|
|
40460
|
-
|
|
40461
|
-
|
|
40462
|
-
|
|
40507
|
+
}
|
|
40508
|
+
if (!found) {
|
|
40509
|
+
insertPoint = currentLabel.text.length;
|
|
40510
|
+
}
|
|
40511
|
+
positionBlinker();
|
|
40512
|
+
if (place && !cursorShiftMenu && currentLabel.text.length > 0) {
|
|
40513
|
+
makeCursorShiftmenu();
|
|
40514
|
+
}
|
|
40515
|
+
if (cursorShiftMenu && currentLabel) {
|
|
40516
|
+
if (currentLabel.text.length > 0) {
|
|
40517
|
+
point = currentLabel.localToLocal(0, 0, container);
|
|
40518
|
+
cursorShiftMenu.x = point.x+placeShiftH;
|
|
40519
|
+
cursorShiftMenu.y = point.y+currentLabel.height+15+placeShiftV;
|
|
40520
|
+
} else {
|
|
40521
|
+
removeCursorShiftMenu();
|
|
40463
40522
|
}
|
|
40464
|
-
|
|
40523
|
+
}
|
|
40524
|
+
}
|
|
40525
|
+
function makeWidthsArray() {
|
|
40526
|
+
if (!currentLabel) return;
|
|
40527
|
+
var measureField = new zim.Label("");
|
|
40528
|
+
currentLabel.widthArray = [];
|
|
40529
|
+
for (var i=0; i<currentLabel.text.length; i++) {
|
|
40530
|
+
measureField = currentLabel.clone().removeFrom();
|
|
40531
|
+
measureField.text = currentLabel.text[i];
|
|
40532
|
+
currentLabel.widthArray.push(measureField.label.getMeasuredWidth());
|
|
40533
|
+
}
|
|
40534
|
+
measureField.text = currentLabel.text; // weird bug shortening clone shortens hitArea of original
|
|
40535
|
+
currentLabel.widthArrayCheck = true;
|
|
40536
|
+
positionBlinker();
|
|
40537
|
+
}
|
|
40538
|
+
|
|
40539
|
+
function backspaceRemovesLetter(once) {
|
|
40540
|
+
var removalOkay = true;
|
|
40541
|
+
var timeOut;
|
|
40542
|
+
function haalWeg() {
|
|
40543
|
+
if (!currentLabel || currentLabel.text.length < 1 || that.currentIndex == 0) {
|
|
40465
40544
|
removalOkay = false;
|
|
40466
|
-
if (timeOut) timeOut.clear();
|
|
40467
|
-
that.off("pressup", stopRemoval);
|
|
40468
40545
|
}
|
|
40469
|
-
|
|
40470
|
-
|
|
40471
|
-
|
|
40546
|
+
if (removalOkay) {
|
|
40547
|
+
removeLetter();
|
|
40548
|
+
if (timeOut) timeOut = zim.timeout(200, haalWeg, null, "ms");
|
|
40549
|
+
}
|
|
40550
|
+
if (currentLabel && currentLabel.text.length < 1) {
|
|
40551
|
+
stopRemoval();
|
|
40552
|
+
}
|
|
40553
|
+
}
|
|
40554
|
+
function removeLetter() {
|
|
40555
|
+
if (currentLabel && currentLabel.text.length > 0) {
|
|
40556
|
+
if (that.selectedIndex > 0) addToLabel("del");
|
|
40557
|
+
if (once) stopRemoval();
|
|
40558
|
+
else that.on("pressup", stopRemoval);
|
|
40559
|
+
} else {
|
|
40560
|
+
addToLabel("del");
|
|
40561
|
+
}
|
|
40472
40562
|
}
|
|
40563
|
+
function stopRemoval() {
|
|
40564
|
+
removalOkay = false;
|
|
40565
|
+
if (timeOut) timeOut.clear();
|
|
40566
|
+
that.off("pressup", stopRemoval);
|
|
40567
|
+
}
|
|
40568
|
+
removeLetter();
|
|
40569
|
+
timeOut = zim.timeout(300, haalWeg, null, "ms");
|
|
40570
|
+
if (that.stage) that.stage.update();
|
|
40571
|
+
}
|
|
40572
|
+
|
|
40573
|
+
function setLabels() {
|
|
40574
|
+
for (var i = 0; i < labels.length; i++) {
|
|
40575
|
+
labels[i].clickEvent = labels[i].on("click", activateLabel);
|
|
40576
|
+
}
|
|
40577
|
+
}
|
|
40578
|
+
setLabels();
|
|
40473
40579
|
|
|
40474
|
-
|
|
40580
|
+
function unsetLabels() {
|
|
40581
|
+
if (labels.length > 1) {
|
|
40475
40582
|
for (var i = 0; i < labels.length; i++) {
|
|
40476
|
-
labels[i].
|
|
40583
|
+
labels[i].off("click", labels[i].clickEvent);
|
|
40477
40584
|
}
|
|
40478
40585
|
}
|
|
40479
|
-
|
|
40586
|
+
}
|
|
40480
40587
|
|
|
40481
|
-
|
|
40482
|
-
|
|
40483
|
-
|
|
40484
|
-
|
|
40485
|
-
|
|
40486
|
-
|
|
40487
|
-
|
|
40488
|
-
|
|
40489
|
-
|
|
40490
|
-
|
|
40491
|
-
|
|
40492
|
-
|
|
40493
|
-
|
|
40494
|
-
|
|
40495
|
-
|
|
40496
|
-
|
|
40497
|
-
|
|
40498
|
-
|
|
40499
|
-
|
|
40500
|
-
|
|
40501
|
-
loopWait: 750,
|
|
40502
|
-
time: 250,
|
|
40503
|
-
id: "knipperTekst",
|
|
40504
|
-
timeUnit: "ms"
|
|
40505
|
-
});
|
|
40506
|
-
for (var j = 0; j < labels.length; j++) {
|
|
40507
|
-
labels[j].widthArray = [0];
|
|
40508
|
-
}
|
|
40509
|
-
makeWidthsArray();
|
|
40588
|
+
function makeCursor() {
|
|
40589
|
+
if (textBlinker) return;
|
|
40590
|
+
currentLabel = labels[0];
|
|
40591
|
+
maxWidth = (currentLabel && currentLabel.label.lineWidth) ? currentLabel.label.lineWidth : 10000;
|
|
40592
|
+
if (currentLabel) {
|
|
40593
|
+
textBlinker = that.blinker = new zim.Rectangle(3, currentLabel.height - ((currentLabel.paddingV && currentLabel.background) ? currentLabel.paddingV * 2 : 0), cursorColor, null, null, null, null, null, null, false)
|
|
40594
|
+
.center(currentLabel);
|
|
40595
|
+
textBlinker.x = 0;
|
|
40596
|
+
textBlinker.visible = false;
|
|
40597
|
+
textBlinker.animate({
|
|
40598
|
+
props: { alpha: 0 },
|
|
40599
|
+
rewind: true,
|
|
40600
|
+
loop: true,
|
|
40601
|
+
loopWait: 750,
|
|
40602
|
+
time: 250,
|
|
40603
|
+
id: "knipperTekst",
|
|
40604
|
+
timeUnit: "ms"
|
|
40605
|
+
});
|
|
40606
|
+
for (var j = 0; j < labels.length; j++) {
|
|
40607
|
+
labels[j].widthArray = [0];
|
|
40510
40608
|
}
|
|
40609
|
+
makeWidthsArray();
|
|
40511
40610
|
}
|
|
40512
|
-
|
|
40513
|
-
|
|
40514
|
-
|
|
40515
|
-
|
|
40516
|
-
|
|
40517
|
-
|
|
40518
|
-
|
|
40519
|
-
|
|
40611
|
+
}
|
|
40612
|
+
makeCursor();
|
|
40613
|
+
function removeCursor() {
|
|
40614
|
+
zim.stopAnimate("knipperTekst");
|
|
40615
|
+
if (currentLabel) currentLabel.removeChild(textBlinker);
|
|
40616
|
+
textBlinker = null;
|
|
40617
|
+
currentLabel = null;
|
|
40618
|
+
}
|
|
40619
|
+
|
|
40520
40620
|
|
|
40521
|
-
|
|
40621
|
+
// ~~~~~~~~~~~~~~~ GETTER SETTER PROPS
|
|
40522
40622
|
|
|
40523
|
-
|
|
40524
|
-
|
|
40525
|
-
|
|
40526
|
-
|
|
40527
|
-
|
|
40528
|
-
|
|
40529
|
-
|
|
40530
|
-
|
|
40531
|
-
|
|
40532
|
-
|
|
40623
|
+
Object.defineProperty(this, 'selectedLabel', {
|
|
40624
|
+
get: function() {
|
|
40625
|
+
return currentLabel;
|
|
40626
|
+
},
|
|
40627
|
+
set: function(label) {
|
|
40628
|
+
var obj = {target:label};
|
|
40629
|
+
activateLabel(obj);
|
|
40630
|
+
that.hidePlace();
|
|
40631
|
+
}
|
|
40632
|
+
});
|
|
40533
40633
|
|
|
40534
|
-
|
|
40535
|
-
|
|
40536
|
-
|
|
40537
|
-
|
|
40538
|
-
|
|
40539
|
-
|
|
40540
|
-
|
|
40541
|
-
|
|
40542
|
-
|
|
40634
|
+
Object.defineProperty(this, 'selectedIndex', {
|
|
40635
|
+
get: function() {
|
|
40636
|
+
return insertPoint;
|
|
40637
|
+
},
|
|
40638
|
+
set: function(index) {
|
|
40639
|
+
insertPoint = index;
|
|
40640
|
+
positionBlinker();
|
|
40641
|
+
}
|
|
40642
|
+
});
|
|
40543
40643
|
|
|
40544
|
-
|
|
40644
|
+
// ~~~~~~~~~~~~~~~ METHODS
|
|
40545
40645
|
|
|
40546
|
-
|
|
40547
|
-
|
|
40548
|
-
|
|
40549
|
-
|
|
40550
|
-
|
|
40551
|
-
|
|
40552
|
-
|
|
40553
|
-
if (textBlinker) textBlinker.visible = true;
|
|
40554
|
-
that.toggled = true;
|
|
40555
|
-
if (numPadOnly) showNumPad();
|
|
40556
|
-
else if (!numPadOnly || override) {
|
|
40557
|
-
that.keys.vis(true);
|
|
40558
|
-
background.vis(true);
|
|
40559
|
-
}
|
|
40560
|
-
if (that.numPad && that.numPad.parent) that.numPad.top();
|
|
40561
|
-
return that;
|
|
40562
|
-
};
|
|
40563
|
-
|
|
40564
|
-
this.hide = function() {
|
|
40565
|
-
that.removeFrom(container);
|
|
40566
|
-
showNumPad(false);
|
|
40567
|
-
if (textBlinker) {textBlinker.visible = false;}
|
|
40568
|
-
currentStage.update();
|
|
40569
|
-
that.toggled = false;
|
|
40570
|
-
return that;
|
|
40571
|
-
};
|
|
40572
|
-
|
|
40573
|
-
this.showNumPad = function() {
|
|
40574
|
-
showNumPad(true);
|
|
40575
|
-
that.toggled = true;
|
|
40576
|
-
if (textBlinker) textBlinker.visible = true;
|
|
40646
|
+
this.show = function(index, override) {
|
|
40647
|
+
that.addTo(container);
|
|
40648
|
+
if (that.placeMenu) that.placeMenu.addTo(container);
|
|
40649
|
+
// that.resize();
|
|
40650
|
+
if (!zot(index)) {
|
|
40651
|
+
var obj = {target:labels[index]};
|
|
40652
|
+
activateLabel(obj);
|
|
40577
40653
|
}
|
|
40578
|
-
|
|
40579
|
-
|
|
40580
|
-
|
|
40581
|
-
|
|
40582
|
-
|
|
40583
|
-
|
|
40584
|
-
}
|
|
40654
|
+
setTimeout(()=>{if (textBlinker) textBlinker.visible = true;}, 200);
|
|
40655
|
+
that.toggled = true;
|
|
40656
|
+
if (numPadOnly) showNumPad();
|
|
40657
|
+
else if (!numPadOnly || override) {
|
|
40658
|
+
that.keys.vis(true);
|
|
40659
|
+
background.vis(true);
|
|
40585
40660
|
}
|
|
40586
|
-
|
|
40587
|
-
|
|
40588
|
-
|
|
40661
|
+
if (that.numPad && that.numPad.parent) that.numPad.top();
|
|
40662
|
+
return that;
|
|
40663
|
+
};
|
|
40664
|
+
|
|
40665
|
+
this.hide = function() {
|
|
40666
|
+
that.removeFrom();
|
|
40667
|
+
if (that.placeMenu) that.placeMenu.removeFrom();
|
|
40668
|
+
showNumPad(false);
|
|
40669
|
+
if (textBlinker) {textBlinker.visible = false;}
|
|
40670
|
+
currentStage.update();
|
|
40671
|
+
that.toggled = false;
|
|
40672
|
+
return that;
|
|
40673
|
+
};
|
|
40674
|
+
|
|
40675
|
+
this.showNumPad = function() {
|
|
40676
|
+
showNumPad(true);
|
|
40677
|
+
that.toggled = true;
|
|
40678
|
+
if (textBlinker) textBlinker.visible = true;
|
|
40679
|
+
}
|
|
40680
|
+
this.hideNumPad = function() {
|
|
40681
|
+
showNumPad(false);
|
|
40682
|
+
if ((!that.keys.parent || !that.keys.visible) && textBlinker) {
|
|
40683
|
+
textBlinker.visible = false;
|
|
40684
|
+
that.toggled = false;
|
|
40685
|
+
removeCursorShiftMenu();
|
|
40589
40686
|
}
|
|
40590
|
-
|
|
40591
|
-
|
|
40592
|
-
|
|
40593
|
-
|
|
40594
|
-
|
|
40595
|
-
|
|
40596
|
-
|
|
40597
|
-
|
|
40687
|
+
}
|
|
40688
|
+
|
|
40689
|
+
this.showKeyboard = function() {
|
|
40690
|
+
that.show(null, true);
|
|
40691
|
+
}
|
|
40692
|
+
|
|
40693
|
+
this.hideKeyboard = function() {
|
|
40694
|
+
if (!that.numPad || !that.numPad.parent) {
|
|
40695
|
+
that.hide();
|
|
40696
|
+
} else {
|
|
40697
|
+
that.keys.vis(false);
|
|
40698
|
+
background.vis(false);
|
|
40598
40699
|
}
|
|
40700
|
+
}
|
|
40599
40701
|
|
|
40600
|
-
|
|
40601
|
-
|
|
40602
|
-
|
|
40603
|
-
|
|
40604
|
-
|
|
40605
|
-
|
|
40606
|
-
|
|
40702
|
+
this.toggle = function(state) {
|
|
40703
|
+
if (state===true) that.show();
|
|
40704
|
+
else if (state===false) that.hide();
|
|
40705
|
+
else if (that.parent) that.hide();
|
|
40706
|
+
else that.show();
|
|
40707
|
+
return that;
|
|
40708
|
+
};
|
|
40607
40709
|
|
|
40608
|
-
|
|
40609
|
-
|
|
40610
|
-
|
|
40611
|
-
|
|
40710
|
+
this.showPlace = function() {
|
|
40711
|
+
makeCursorShiftmenu();
|
|
40712
|
+
return that;
|
|
40713
|
+
};
|
|
40612
40714
|
|
|
40613
|
-
|
|
40614
|
-
|
|
40615
|
-
|
|
40616
|
-
|
|
40715
|
+
this.hidePlace = function() {
|
|
40716
|
+
removeCursorShiftMenu();
|
|
40717
|
+
return that;
|
|
40718
|
+
};
|
|
40617
40719
|
|
|
40618
|
-
|
|
40619
|
-
|
|
40620
|
-
|
|
40621
|
-
|
|
40622
|
-
|
|
40623
|
-
|
|
40624
|
-
|
|
40625
|
-
|
|
40626
|
-
|
|
40627
|
-
|
|
40628
|
-
|
|
40629
|
-
|
|
40630
|
-
|
|
40631
|
-
|
|
40720
|
+
this.addLabels = function(labs) {
|
|
40721
|
+
if (!Array.isArray(labs)) labs = [labs];
|
|
40722
|
+
for (var i=labs.length-1; i>=0; i--) {
|
|
40723
|
+
var ind = labels.indexOf(labs[i]);
|
|
40724
|
+
if (ind >= 0 || labs[i].type != "Label") labs.splice(i, 1);
|
|
40725
|
+
else labs[i].widthArray = [0];
|
|
40726
|
+
}
|
|
40727
|
+
unsetLabels();
|
|
40728
|
+
labels = labels.concat(labs);
|
|
40729
|
+
setLabels();
|
|
40730
|
+
makeCursor();
|
|
40731
|
+
if (textBlinker) textBlinker.visible = true;
|
|
40732
|
+
return that;
|
|
40733
|
+
};
|
|
40632
40734
|
|
|
40633
|
-
|
|
40634
|
-
|
|
40635
|
-
|
|
40636
|
-
|
|
40637
|
-
|
|
40638
|
-
|
|
40639
|
-
|
|
40640
|
-
|
|
40641
|
-
|
|
40642
|
-
|
|
40643
|
-
|
|
40644
|
-
|
|
40645
|
-
|
|
40646
|
-
|
|
40647
|
-
}
|
|
40735
|
+
this.removeLabels = function(labs) {
|
|
40736
|
+
if (!Array.isArray(labs)) labs = [labs];
|
|
40737
|
+
unsetLabels();
|
|
40738
|
+
for (var i=0; i<labs.length; i++) {
|
|
40739
|
+
var ind = labels.indexOf(labs[i]);
|
|
40740
|
+
if (ind >= 0) labels.splice(ind, 1);
|
|
40741
|
+
}
|
|
40742
|
+
setLabels();
|
|
40743
|
+
if (labels.length == 0) {
|
|
40744
|
+
if (currentLabel) removeCursor();
|
|
40745
|
+
} else {
|
|
40746
|
+
if (currentLabel && labels.indexOf(currentLabel) == -1) {
|
|
40747
|
+
removeCursor();
|
|
40748
|
+
makeCursor();
|
|
40648
40749
|
}
|
|
40649
|
-
|
|
40650
|
-
|
|
40750
|
+
}
|
|
40751
|
+
return that;
|
|
40752
|
+
};
|
|
40651
40753
|
|
|
40652
|
-
|
|
40653
|
-
|
|
40654
|
-
|
|
40655
|
-
|
|
40754
|
+
var background = new zim.Rectangle(this.width, this.height, zim.clear, null, null, null, null, null, null, false).addTo(this).expand().bot();
|
|
40755
|
+
background.on("mousedown", function(){});
|
|
40756
|
+
background.on("click", function(){});
|
|
40757
|
+
if (numPadOnly) background.vis(false);
|
|
40656
40758
|
|
|
40657
|
-
|
|
40658
|
-
|
|
40659
|
-
|
|
40660
|
-
|
|
40661
|
-
|
|
40662
|
-
|
|
40663
|
-
|
|
40664
|
-
|
|
40759
|
+
this.resize = function() {
|
|
40760
|
+
that.scaleTo(currentStage, 100-margin*2/currentStage.width*100, 50-margin*2/currentStage.height*100);
|
|
40761
|
+
that.y = currentStage.height - that.height - margin;
|
|
40762
|
+
that.x = currentStage.width/2 - that.width/2;
|
|
40763
|
+
if (currentLabel && cursorShiftMenu) {
|
|
40764
|
+
var point = currentLabel.localToLocal(0, 0, that);
|
|
40765
|
+
cursorShiftMenu.x = point.x;
|
|
40766
|
+
cursorShiftMenu.y = point.y + currentLabel.height + 15;
|
|
40767
|
+
}
|
|
40768
|
+
if (that.stage) that.stage.update();
|
|
40769
|
+
return that;
|
|
40770
|
+
};
|
|
40771
|
+
this.resize();
|
|
40772
|
+
|
|
40773
|
+
if (that.selectedLabel) that.selectedIndex = that.selectedLabel.text.length;
|
|
40774
|
+
|
|
40775
|
+
// Dan Zen added ZIM 10.5.1
|
|
40776
|
+
if (hardKeyboard) {
|
|
40777
|
+
this.keydownEvent = function(e) {
|
|
40778
|
+
if (!that.stage) return;
|
|
40779
|
+
var k = that;
|
|
40780
|
+
if (zot(k)) return;
|
|
40781
|
+
if (e.keyCode==35) k.selectedIndex = k.selectedLabel.text.length; // end
|
|
40782
|
+
if (e.keyCode==36) k.selectedIndex = 0; // home
|
|
40783
|
+
if (e.keyCode==37) k.selectedIndex = k.selectedIndex-1; // left
|
|
40784
|
+
if (e.keyCode==39) k.selectedIndex = k.selectedIndex+1; // right
|
|
40785
|
+
if (e.keyCode==46) { // del
|
|
40786
|
+
if (k.selectedIndex < k.selectedLabel.text.length) {
|
|
40787
|
+
k.selectedIndex = k.selectedIndex + 1;
|
|
40788
|
+
k.removeChar();
|
|
40789
|
+
}
|
|
40790
|
+
}
|
|
40791
|
+
if (e.keyCode==8) {
|
|
40792
|
+
e.preventDefault();
|
|
40793
|
+
k.removeChar(); // backspace
|
|
40665
40794
|
}
|
|
40795
|
+
k.addChar(e.key);
|
|
40666
40796
|
if (that.stage) that.stage.update();
|
|
40667
|
-
return that;
|
|
40668
40797
|
};
|
|
40669
|
-
this.
|
|
40670
|
-
|
|
40671
|
-
if (that.selectedLabel) that.selectedIndex = that.selectedLabel.text.length;
|
|
40672
|
-
|
|
40673
|
-
// Dan Zen added ZIM 10.5.1
|
|
40674
|
-
if (hardKeyboard) {
|
|
40675
|
-
this.keydownEvent = function(e) {
|
|
40676
|
-
if (!that.stage) return;
|
|
40677
|
-
var k = that;
|
|
40678
|
-
if (zot(k)) return;
|
|
40679
|
-
if (e.keyCode==35) k.selectedIndex = k.selectedLabel.text.length; // end
|
|
40680
|
-
if (e.keyCode==36) k.selectedIndex = 0; // home
|
|
40681
|
-
if (e.keyCode==37) k.selectedIndex = k.selectedIndex-1; // left
|
|
40682
|
-
if (e.keyCode==39) k.selectedIndex = k.selectedIndex+1; // right
|
|
40683
|
-
if (e.keyCode==46) { // del
|
|
40684
|
-
if (k.selectedIndex < k.selectedLabel.text.length) {
|
|
40685
|
-
k.selectedIndex = k.selectedIndex + 1;
|
|
40686
|
-
k.removeChar();
|
|
40687
|
-
}
|
|
40688
|
-
}
|
|
40689
|
-
if (e.keyCode==8) {
|
|
40690
|
-
e.preventDefault();
|
|
40691
|
-
k.removeChar(); // backspace
|
|
40692
|
-
}
|
|
40693
|
-
k.addChar(e.key);
|
|
40694
|
-
if (that.stage) that.stage.update();
|
|
40695
|
-
};
|
|
40696
|
-
WW.addEventListener("keydown", this.keydownEvent);
|
|
40697
|
-
}
|
|
40798
|
+
WW.addEventListener("keydown", this.keydownEvent);
|
|
40799
|
+
}
|
|
40698
40800
|
|
|
40699
|
-
|
|
40700
|
-
|
|
40701
|
-
|
|
40702
|
-
|
|
40703
|
-
|
|
40704
|
-
|
|
40705
|
-
|
|
40706
|
-
|
|
40707
|
-
|
|
40708
|
-
|
|
40709
|
-
|
|
40710
|
-
|
|
40711
|
-
|
|
40712
|
-
|
|
40713
|
-
|
|
40714
|
-
|
|
40715
|
-
|
|
40716
|
-
|
|
40717
|
-
};
|
|
40801
|
+
if (style!==false) zim.styleTransforms(this, DS);
|
|
40802
|
+
this.clone = function() {
|
|
40803
|
+
var kb = new zim.Keyboard(labels, backgroundColor, color, shiftBackgroundColor, shiftHoldBackgroundColor, placeBackgroundColor, cursorColor, shadeAlpha, margin, corner, draggable, placeClose, shadowColor, shadowBlur, container, data, place, placeShiftH, placeShiftV, special, rtl, hardKeyboard, layout, numPadScale, numPadDraggable, numPadOnly, numPadAdvanced, maxLength, numbersOnly, placeScale, style, this.group, inherit);
|
|
40804
|
+
return that.cloneProps(kb);
|
|
40805
|
+
};
|
|
40806
|
+
this.dispose = function(a,b,disposing) {
|
|
40807
|
+
background.removeAllEventListeners();
|
|
40808
|
+
background = null;
|
|
40809
|
+
if (that.keydownEvent) WW.removeEventListener("keydown", that.keydownEvent);
|
|
40810
|
+
for(var i=0; i<that.labels.length; i++) {
|
|
40811
|
+
that.labels[i].removeAllEventListeners();
|
|
40812
|
+
}
|
|
40813
|
+
if (that.numPad) that.numPad.dispose()
|
|
40814
|
+
if (textBlinker) textBlinker.dispose();
|
|
40815
|
+
that.labels = currentLabel = null;
|
|
40816
|
+
if (currentStage) currentStage.off("pressmousemove", that.tickerMouseEvent);
|
|
40817
|
+
if (!disposing) that.zimContainer_dispose(true);
|
|
40818
|
+
return true;
|
|
40718
40819
|
};
|
|
40719
|
-
|
|
40820
|
+
};
|
|
40821
|
+
zim.extend(zim.Keyboard, zim.Container, ["clone", "dispose"], "zimContainer", false);
|
|
40720
40822
|
//-67.2
|
|
40721
40823
|
|
|
40722
40824
|
/*--
|
|
@@ -41137,6 +41239,15 @@ The lineType in the Line can be set to "straight", "corner" or "curve"
|
|
|
41137
41239
|
Line also accepts points for any arrangement of a connector
|
|
41138
41240
|
but in this version, these have not been used in Connectors.
|
|
41139
41241
|
|
|
41242
|
+
BASE
|
|
41243
|
+
A DisplayObject can be used as a base for the connector and have nodes added.
|
|
41244
|
+
A base can have multiple nodes attached on any of its sides
|
|
41245
|
+
This approaches diagramming tools like Powerpoint, etc.
|
|
41246
|
+
but currently, only vertically placed nodes can connect to vertically placed nodes
|
|
41247
|
+
and horizontally placed nodes can connect to horizontally placed nodes.
|
|
41248
|
+
DropType single works per node, not per base so use a single node on a base for this.
|
|
41249
|
+
A base can be a Blob or a Squiggle as well with nodes added to points.
|
|
41250
|
+
|
|
41140
41251
|
See: https://zimjs.com/cat/connectors.html
|
|
41141
41252
|
|
|
41142
41253
|
PREMADE CONNECTIONS
|
|
@@ -41192,12 +41303,26 @@ PARAMETERS
|
|
|
41192
41303
|
** supports OCT - parameter defaults can be set with STYLE control (like CSS)
|
|
41193
41304
|
width - (default null) the width of the connnectors container or will grow with added connectors
|
|
41194
41305
|
height - (default null) the height of the connnectors container or will grow with added connectors
|
|
41195
|
-
points - (default [[0,0], [100,0], [100,100], [0,100]]) an array of point arrays for the connectors
|
|
41196
|
-
or can
|
|
41197
|
-
|
|
41198
|
-
|
|
41199
|
-
|
|
41306
|
+
points - (default [[0,0], [100,0], [100,100], [0,100]]) an array of point arrays for the connectors
|
|
41307
|
+
or can be [[x, y, startNode, endNode, startLength, endLength], etc]
|
|
41308
|
+
x - the x position of the node
|
|
41309
|
+
y - the y position of the node
|
|
41310
|
+
startNode - (default true) set to false to not drag from node
|
|
41311
|
+
endNode - (default true) set to false to not drop on node
|
|
41312
|
+
startLength - (default null) set line startLength - see Connectors line parameter (for corner or curve lineType)
|
|
41313
|
+
endLength - (default null) set line endLength - see Connectors line parameter (for corner or curve lineType)
|
|
41314
|
+
example:
|
|
41315
|
+
[[0,0,true,false,50], [100,0,false,true], ...]
|
|
41316
|
+
would allow dragging from the first to the second but not the second to the first
|
|
41317
|
+
and if the line (see line parameter) is lineType corner or curve the start length would be 50
|
|
41318
|
+
Another point could have a different startLength to avoid overlapping lines
|
|
41319
|
+
A convenience object literal can be used as well for any or all points:
|
|
41320
|
+
[{x:0, y:0, endNode:false, startLength:50}, {x:100, y:0, startNode:false}, ...]
|
|
41321
|
+
or the first two items in the array can can be a base (that connectors nodes will be added to) and baseInfo as follows:
|
|
41200
41322
|
[[base, baseInfo], [base, baseInfo], [base, baseInfo], etc.]
|
|
41323
|
+
these can have the startNode, endNode, startLength, endLength as well
|
|
41324
|
+
and can have the object literal format as follows:
|
|
41325
|
+
[{base:base, info:baseInfo, etc.}, etc.] rather than the x:x and y:y properties
|
|
41201
41326
|
the baseInfo can be a number of nodes to place around all base sides
|
|
41202
41327
|
or baseInfo can be an array with three different formats:
|
|
41203
41328
|
[all]
|
|
@@ -41208,10 +41333,19 @@ points - (default [[0,0], [100,0], [100,100], [0,100]]) an array of point arrays
|
|
|
41208
41333
|
or -1 for both corners on the side
|
|
41209
41334
|
or -2 for the first corner on the side
|
|
41210
41335
|
or -3 for the second corner on the side
|
|
41336
|
+
or can specify a ZIM Blob or Squiggle to place connectors on their points
|
|
41337
|
+
so: points:blob or points:squiggle
|
|
41338
|
+
the Blob or Squiggle do not need to be added to the stage
|
|
41339
|
+
use the getPoints(true) method of the Blob or Squiggle or see https://zimjs.com/paths/
|
|
41211
41340
|
node - (default new Circle(10, grey, grey)) the DisplayObject to use as a node - should be centerReg()
|
|
41212
41341
|
line - (default new zim.Line({thickness:3, color:tin, strokeObj:{caps:"round"}})) the line to use as the connector
|
|
41213
41342
|
ZIM Line has a lineType parameter for "straight", "corner", and "curve" which will affect the connector lines
|
|
41214
41343
|
ZIM Line has a lineOrientation parameter of AUTO, HORIZONTAL or VERTICAL that will affect the connector lines
|
|
41344
|
+
ZIM LIne has startLength and endLength parameters that work with "corner" and "curve"
|
|
41345
|
+
these accept ZIM VEE to dynamically set random or a series of values
|
|
41346
|
+
that can help avoid overlapping lines or
|
|
41347
|
+
these values can be set individually on the points parameter or on bases directly as properties
|
|
41348
|
+
which will override any values set on the line provided here in the line parameter
|
|
41215
41349
|
ZIM Line as curveH and curveV settings that will adjust the lines for the "curve" setting
|
|
41216
41350
|
the caps should be set to "round" if drawing with clear or transparent nodes
|
|
41217
41351
|
linear - (default false) lines will only connect to points that are next to one another (in the point order)
|
|
@@ -41268,9 +41402,15 @@ group - (default null) set to String (or comma delimited String) so STYLE can se
|
|
|
41268
41402
|
inherit - (default null) used internally but can receive an {} of styles directly
|
|
41269
41403
|
|
|
41270
41404
|
METHODS
|
|
41271
|
-
addNode(x, y,
|
|
41272
|
-
|
|
41273
|
-
|
|
41405
|
+
addNode(x, y, startNode, endNode, startLength, endLength) - add a node at x and y
|
|
41406
|
+
cannot add nodes in linear mode - see linear parameter
|
|
41407
|
+
addNode will not work with the dropArray parameter
|
|
41408
|
+
x - the x position of the node or provide a base (see Connectors points parameter)
|
|
41409
|
+
y - the y position of the node or provide base info (see Connectors points parameter)
|
|
41410
|
+
startNode - (default true) set to false to not drag from node
|
|
41411
|
+
endNode - (default true) set to false to not drop on node
|
|
41412
|
+
startLength - (default null) set line startLength - see Connectors line parameter (for corner or curve lineType)
|
|
41413
|
+
endLength - (default null) set line endLength - see Connectors line parameter (for corner or curve lineType)
|
|
41274
41414
|
removeNode(node) - remove the node (and its children)
|
|
41275
41415
|
removeConnectors() - removes all nodes and connectors except for root nodes which were specified in the points parameter
|
|
41276
41416
|
selectNode(node, children) - select a node and its children unless children parameter is set to false
|
|
@@ -41346,6 +41486,12 @@ bases - an Array of DisplayObjects used as bases (provided through the points pa
|
|
|
41346
41486
|
connectorOverEvent - reference to pressmove event on base
|
|
41347
41487
|
connectorOutEvent - reference to pressmove event on base
|
|
41348
41488
|
setConnectorColors(baseColor, baseBorderColor, nodeRollColor, nodeRollBorderColor) - method to set colors
|
|
41489
|
+
startNode - set to false to not start a line from this base - see points parameter
|
|
41490
|
+
endNode - set to false to not end a line on this base - see points parameter
|
|
41491
|
+
startLength - set a start length for the connector - see points parameter
|
|
41492
|
+
good to prevent corner and curved lines from overlapping
|
|
41493
|
+
endLength - set an end Length for the connector - see points parameter
|
|
41494
|
+
good to prevent corner and curved lines from overlapping
|
|
41349
41495
|
|
|
41350
41496
|
ALSO: see ZIM Container for properties such as:
|
|
41351
41497
|
width, height, widthOnly, heightOnly, draggable, level, depth, group
|
|
@@ -41388,6 +41534,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41388
41534
|
color:zim.tin,
|
|
41389
41535
|
strokeObj:{caps:"round"}
|
|
41390
41536
|
});
|
|
41537
|
+
line.oStartLength = line.startLength;
|
|
41538
|
+
line.oEndLength = line.endLength;
|
|
41391
41539
|
if (zot(num)) num = DS.num!=null?DS.num:10;
|
|
41392
41540
|
if (zot(linear)) linear = DS.linear!=null?DS.linear:false;
|
|
41393
41541
|
if (zot(linearWrap)) linearWrap = DS.linearWrap!=null?DS.linearWrap:true;
|
|
@@ -41450,17 +41598,31 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41450
41598
|
p.push([point[0], point[1]]);
|
|
41451
41599
|
});
|
|
41452
41600
|
points = p;
|
|
41601
|
+
} else {
|
|
41602
|
+
// convert any convenience objects to array
|
|
41603
|
+
zim.loop(points, function(p, i) {
|
|
41604
|
+
if (p.constructor === {}.constructor) {
|
|
41605
|
+
points[i] = [p.x, p.y, p.startNode, p.endNode, p.startLength, p.endLength];
|
|
41606
|
+
if (p.base != null) points[i][0] = p.base;
|
|
41607
|
+
if (p.info != null) points[i][1] = p.info;
|
|
41608
|
+
}
|
|
41609
|
+
});
|
|
41453
41610
|
}
|
|
41454
41611
|
that.points = points;
|
|
41612
|
+
|
|
41455
41613
|
|
|
41456
|
-
this.addNode = function(x, y,
|
|
41614
|
+
this.addNode = function(x, y, startNode, endNode, startLength, endLength) {
|
|
41457
41615
|
if (linear) return; // cannot add nodes in linear
|
|
41458
|
-
return addNode(x, y,
|
|
41616
|
+
return addNode(x, y, startNode, endNode, startLength, endLength);
|
|
41459
41617
|
};
|
|
41460
41618
|
|
|
41461
|
-
function addNode (x, y,
|
|
41619
|
+
function addNode (x, y, startNode, endNode, startLength, endLength, orientation) {
|
|
41462
41620
|
if (x.addChild) {
|
|
41463
41621
|
// adding connector to a base
|
|
41622
|
+
|
|
41623
|
+
// {base:squares.items[0], info:[0,0,1,0], startNode:true, endNode:false, startLength:50, endLength:100},
|
|
41624
|
+
// [squares.items[0], [0,0,1,0], true, false, 50, 100],
|
|
41625
|
+
|
|
41464
41626
|
// second value is a single number for all sides
|
|
41465
41627
|
// or an array of two numbers for left/top and right/bottom
|
|
41466
41628
|
// or an array of four numbers for left,right,top,bottom
|
|
@@ -41469,17 +41631,17 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41469
41631
|
// [[box1,3], [box2,-1]]
|
|
41470
41632
|
// [[box1,[0,3,0,3]], [box2,[3,0,0,3]]] none left top, none right top
|
|
41471
41633
|
|
|
41472
|
-
// override
|
|
41473
|
-
dropType = "on";
|
|
41634
|
+
// override rootLock and grandChildren
|
|
41635
|
+
// dropType = "on"; // // removed override of dropType in ZIM 016 patch
|
|
41474
41636
|
rootLock = true;
|
|
41475
41637
|
grandChildren = false;
|
|
41476
41638
|
|
|
41477
|
-
base = x;
|
|
41639
|
+
var base = x;
|
|
41478
41640
|
|
|
41479
41641
|
if (!base.connectorMoveEvent) {
|
|
41480
41642
|
if (!that.bases) that.bases = [];
|
|
41481
41643
|
that.bases.push(base);
|
|
41482
|
-
base.connectorMoveEvent = base.on("pressmove", function () {
|
|
41644
|
+
base.connectorMoveEvent = base.on("pressmove", function () {
|
|
41483
41645
|
// move all nodes and redraw lines
|
|
41484
41646
|
base.positionConnectors(base, true, true);
|
|
41485
41647
|
});
|
|
@@ -41563,7 +41725,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41563
41725
|
base.connectors = [];
|
|
41564
41726
|
base.baseStart = new zim.Point(base.x, base.y);
|
|
41565
41727
|
zim.loop(basePoints, function (point) {
|
|
41566
|
-
var node = addNode(point[0], point[1],
|
|
41728
|
+
var node = addNode(point[0], point[1], startNode, endNode, startLength, endLength, point[2]);
|
|
41729
|
+
if (startNode===false || (startNode!==true && base.startNode===false)) node.noMouse();
|
|
41567
41730
|
addBaseConnector(base, node);
|
|
41568
41731
|
});
|
|
41569
41732
|
|
|
@@ -41576,6 +41739,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41576
41739
|
|
|
41577
41740
|
var theNode = node.clone().loc(x, y, nodes).drag({boundary:boundary}).expand(expand);
|
|
41578
41741
|
theNode.orientation = orientation;
|
|
41742
|
+
theNode.startLength = startLength;
|
|
41743
|
+
theNode.endLength = endLength;
|
|
41744
|
+
theNode.startNode = startNode;
|
|
41745
|
+
theNode.endNode = endNode;
|
|
41579
41746
|
theNode.nodeColor = theNode.color;
|
|
41580
41747
|
|
|
41581
41748
|
theNode.on("mouseover", overNode);
|
|
@@ -41593,7 +41760,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41593
41760
|
// that.added(function () {
|
|
41594
41761
|
function setNodes() {
|
|
41595
41762
|
zim.loop(points, function (point, i) {
|
|
41596
|
-
var node = addNode(point[0], point[1]);
|
|
41763
|
+
var node = addNode(point[0], point[1], point[2], point[3], point[4], point[5]);
|
|
41764
|
+
// var node = addNode(point[0], point[1]);
|
|
41597
41765
|
node.dropIndex = i;
|
|
41598
41766
|
if (dropArray) node.dropArray = dropArray[i];
|
|
41599
41767
|
});
|
|
@@ -41678,8 +41846,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41678
41846
|
var downIndex;
|
|
41679
41847
|
function downNode(e, stepping, moving, ctrl) {
|
|
41680
41848
|
var child = e.target;
|
|
41681
|
-
if (zot(child)) return;
|
|
41682
|
-
|
|
41849
|
+
if (zot(child)) return;
|
|
41850
|
+
|
|
41683
41851
|
if (moving) {
|
|
41684
41852
|
child.selected = true;
|
|
41685
41853
|
selectedList = [];
|
|
@@ -41741,6 +41909,11 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41741
41909
|
parent.dropArray = child.dropArray;
|
|
41742
41910
|
parent.lineArray = child.lineArray;
|
|
41743
41911
|
parent.color = parent.nodeColor = child.nodeColor;
|
|
41912
|
+
|
|
41913
|
+
parent.startLength = child.startLength;
|
|
41914
|
+
parent.endLength = child.endLength;
|
|
41915
|
+
parent.startNode = child.startNode;
|
|
41916
|
+
parent.endNode = child.endNode;
|
|
41744
41917
|
|
|
41745
41918
|
var newNodeNum = parent.nodeNum;
|
|
41746
41919
|
parent.nodeNum = child.nodeNum;
|
|
@@ -41756,7 +41929,11 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41756
41929
|
if (parent.base.connectors) parent.base.connectors.splice(parent.base.connectors.indexOf(child), 1, parent);
|
|
41757
41930
|
parent.color = parent.base.connectorColor;
|
|
41758
41931
|
parent.borderColor = parent.base.connectorBorderColor;
|
|
41932
|
+
if (parent.base.startLength != null) line.startLength = parent.base.startLength;
|
|
41933
|
+
if (parent.base.endLength != null) line.endLength = parent.base.endLength;
|
|
41759
41934
|
}
|
|
41935
|
+
if (child.startLength != null) line.startLength = child.startLength; // override base
|
|
41936
|
+
if (child.endLength != null) line.endLength = child.endLength;
|
|
41760
41937
|
|
|
41761
41938
|
// adjust to handle linearWrap
|
|
41762
41939
|
parent.before = child.before;
|
|
@@ -41777,7 +41954,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41777
41954
|
|
|
41778
41955
|
// set up properties for child
|
|
41779
41956
|
child.creator = parent;
|
|
41780
|
-
child.creatorLine = line.clone().setPoints(child.x,child.y,child.x,child.y).addTo(lines).alp(0);
|
|
41957
|
+
child.creatorLine = line.clone(true).setPoints(child.x,child.y,child.x,child.y).addTo(lines).alp(0);
|
|
41958
|
+
// reset original
|
|
41959
|
+
line.startLength = line.oStartLength;
|
|
41960
|
+
line.endLength = line.oEndLength;
|
|
41781
41961
|
child.creatorLine.lineOrientation = child.orientation;
|
|
41782
41962
|
child.creatorLine.node = child;
|
|
41783
41963
|
child.creatorLine.creatorNode = parent;
|
|
@@ -41820,7 +42000,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41820
42000
|
removeBaseColors(base);
|
|
41821
42001
|
}
|
|
41822
42002
|
});
|
|
41823
|
-
}
|
|
42003
|
+
}
|
|
42004
|
+
|
|
41824
42005
|
var dbl = false;
|
|
41825
42006
|
if (!linear && downCount > 1 && !stepping) { // double click
|
|
41826
42007
|
clearTimeout(downID);
|
|
@@ -41929,8 +42110,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41929
42110
|
var bad = nodes.loop(function (obj) {
|
|
41930
42111
|
if (node == obj) return;
|
|
41931
42112
|
if (node.hitTestCircles(obj)) {
|
|
41932
|
-
hitObj = obj;
|
|
41933
|
-
if (that.bases && (node.orientation != obj.orientation || (node.creator && node.creator.base && node.creator.base == obj.base))) return;
|
|
42113
|
+
hitObj = obj;
|
|
42114
|
+
if (that.bases && (obj.endNode===false || (obj.endNode!==true && obj.base && obj.base.endNode===false) || node.orientation != obj.orientation || (node.creator && node.creator.base && node.creator.base == obj.base))) return;
|
|
41934
42115
|
if (node.dropArray) if (node.dropArray.indexOf(obj.dropIndex) == -1) return;
|
|
41935
42116
|
if (!duplicateLine && node.lineArray && node.lineArray.indexOf(obj.dropIndex) != -1) return;
|
|
41936
42117
|
if (dropType == "on") return false; // bad will be true
|
|
@@ -48327,13 +48508,13 @@ END EXAMPLE
|
|
|
48327
48508
|
|
|
48328
48509
|
RETURNS obj for chaining
|
|
48329
48510
|
--*///+33.25
|
|
48330
|
-
zim.noWire = function(
|
|
48331
|
-
var sig = "
|
|
48511
|
+
zim.noWire = function(obj, target, prop, input) {
|
|
48512
|
+
var sig = "obj, target, prop, input";
|
|
48332
48513
|
var duo; if (duo = zob(zim.noWire, arguments, sig)) return duo;
|
|
48333
48514
|
z_d("33.25");
|
|
48334
48515
|
if (zot(zim.Ticker)) if (zon) {zogy("noWire() - requires ZIM Frame"); return source;}
|
|
48335
|
-
zim.Ticker.removeWire(
|
|
48336
|
-
return
|
|
48516
|
+
zim.Ticker.removeWire(obj, target, prop, input);
|
|
48517
|
+
return obj;
|
|
48337
48518
|
};//-33.25
|
|
48338
48519
|
|
|
48339
48520
|
//
|
|
@@ -48368,13 +48549,13 @@ END EXAMPLE
|
|
|
48368
48549
|
|
|
48369
48550
|
RETURNS obj for chaining
|
|
48370
48551
|
--*///+33.3
|
|
48371
|
-
zim.wired = function(
|
|
48372
|
-
var sig = "
|
|
48552
|
+
zim.wired = function(obj, source, prop, twoWay, setSource, filter, call, input) {
|
|
48553
|
+
var sig = "obj, source, prop, twoWay, setSource, filter, call, input";
|
|
48373
48554
|
var duo; if (duo = zob(zim.wired, arguments, sig)) return duo;
|
|
48374
48555
|
z_d("33.3");
|
|
48375
48556
|
if (zot(zim.Ticker)) if (zon) {zogy("wired() - requires ZIM Frame"); return target;}
|
|
48376
|
-
zim.wire(source,
|
|
48377
|
-
return
|
|
48557
|
+
zim.wire(source, obj, prop, twoWay, setSource, filter, call, input);
|
|
48558
|
+
return obj;
|
|
48378
48559
|
};//-33.3
|
|
48379
48560
|
|
|
48380
48561
|
/*--
|
|
@@ -50688,7 +50869,7 @@ const rect = new Rectangle(30,400).centerReg().pos(70).addPhysics(false); // sta
|
|
|
50688
50869
|
const tri = new Triangle(150,150,150,green,grey).center().pos(200).addPhysics({linear:10}); // does not slide easily
|
|
50689
50870
|
|
|
50690
50871
|
// turn on dragging
|
|
50691
|
-
physics.drag(); // note: to add a boundary use the
|
|
50872
|
+
physics.drag(); // note: to add a boundary use the borders parameter of Physics()
|
|
50692
50873
|
END EXAMPLE
|
|
50693
50874
|
|
|
50694
50875
|
PARAMETERS
|
|
@@ -58509,16 +58690,15 @@ you can define multiple pages objects add and remove pages objects as needed
|
|
|
58509
58690
|
emi.on("fizzed", function () {
|
|
58510
58691
|
if (fadeTrans) emi.dispose();
|
|
58511
58692
|
});
|
|
58693
|
+
}
|
|
58694
|
+
if (holder && holder.type != "Stage" && holder.type != "StageGL") {
|
|
58695
|
+
if (emi.particles && holder.shape) emi.particles.setMask(holder.shape);
|
|
58512
58696
|
}
|
|
58513
58697
|
|
|
58514
|
-
|
|
58515
|
-
if (emi.particles && holder.shape) emi.particles.setMask(holder.shape)
|
|
58516
|
-
}
|
|
58517
|
-
|
|
58518
|
-
} // end emitter
|
|
58698
|
+
} // end emitter
|
|
58519
58699
|
|
|
58520
58700
|
if (holder && holder.shape) {
|
|
58521
|
-
if (emi && emi.particles) emi.particles.setMask(holder.shape)
|
|
58701
|
+
if (emi && emi.particles) emi.particles.setMask(holder.shape);
|
|
58522
58702
|
}
|
|
58523
58703
|
|
|
58524
58704
|
removeHTML(currentPage);
|
|
@@ -58732,7 +58912,7 @@ All ZIM Button methods
|
|
|
58732
58912
|
PROPERTIES
|
|
58733
58913
|
setDisabled - set to true or false in ZIM Pages "page" event function to override Arrow button setting
|
|
58734
58914
|
or just manually adjust the Pages pages swipe array - which is better as disables or enables swipe and Arrow button setting
|
|
58735
|
-
All ZIM Button properties
|
|
58915
|
+
All ZIM Button properties - including icon and rollIcon which access the ZIM Triangle for the arrow
|
|
58736
58916
|
|
|
58737
58917
|
ACTIONEVENT
|
|
58738
58918
|
This component is affected by the general ACTIONEVENT setting
|
|
@@ -69868,7 +70048,7 @@ const circle = new Circle(50,blue,grey).center().addPhysics({restitution:1.1});
|
|
|
69868
70048
|
// make sure to reg(CENTER) or centerReg() any rectangular objects
|
|
69869
70049
|
const rect = new Rectangle(30,400).reg(CENTER).pos(70).addPhysics(false); // static - do not move
|
|
69870
70050
|
const tri = new Triangle(150,150,150,green,grey).center().pos(200).addPhysics({linear:10});
|
|
69871
|
-
physics.drag(); // note: to add a boundary use the
|
|
70051
|
+
physics.drag(); // note: to add a boundary use the borders parameter of Physics()
|
|
69872
70052
|
// test to see if circle hits rectangle
|
|
69873
70053
|
// contact callback function receives ZIM object (and physics body as next param)
|
|
69874
70054
|
// a ZIM border will have a type = "Border" and a side = LEFT, RIGHT, TOP, "bottom"
|
|
@@ -86033,19 +86213,19 @@ function zimify(obj, a, b, c, d, list) {
|
|
|
86033
86213
|
return zim.updateEffects(this, redoCache);
|
|
86034
86214
|
},
|
|
86035
86215
|
wire:function(target, prop, twoWay, setSource, filter, call, input) {
|
|
86036
|
-
if (isDUO(arguments)) {arguments[0].
|
|
86216
|
+
if (isDUO(arguments)) {arguments[0].obj = this; return zim.wire(arguments[0]);}
|
|
86037
86217
|
else {return zim.wire(this, target, prop, twoWay, setSource, filter, call, input);}
|
|
86038
86218
|
},
|
|
86039
86219
|
noWire:function(target, prop, input) {
|
|
86040
|
-
if (isDUO(arguments)) {arguments[0].
|
|
86220
|
+
if (isDUO(arguments)) {arguments[0].obj = this; return zim.noWire(arguments[0]);}
|
|
86041
86221
|
else {return zim.noWire(this, target, prop, input);}
|
|
86042
86222
|
},
|
|
86043
|
-
wired:function(source, prop, twoWay, setSource, filter, call, input) {
|
|
86044
|
-
if (isDUO(arguments)) {arguments[0].
|
|
86223
|
+
wired:function(source, prop, twoWay, setSource, filter, call, input) {
|
|
86224
|
+
if (isDUO(arguments)) {arguments[0].obj = this; return zim.wired(arguments[0]);}
|
|
86045
86225
|
else {return zim.wired(this, source, prop, twoWay, setSource, filter, call, input);}
|
|
86046
86226
|
},
|
|
86047
86227
|
noWired:function(source, prop, input) {
|
|
86048
|
-
if (isDUO(arguments)) {arguments[0].
|
|
86228
|
+
if (isDUO(arguments)) {arguments[0].obj = this; return zim.noWired(arguments[0]);}
|
|
86049
86229
|
else {return zim.noWired(this, source, prop, input);}
|
|
86050
86230
|
},
|
|
86051
86231
|
bind:function(id, props, extra, filter, bindObj) {
|
|
@@ -90813,7 +90993,7 @@ for (z_i = 0; z_i < globalFunctions.length; z_i++) {
|
|
|
90813
90993
|
WW[pair[0]] = zim[pair[0]] = pair[1];
|
|
90814
90994
|
}
|
|
90815
90995
|
|
|
90816
|
-
|
|
90996
|
+
|
|
90817
90997
|
// these are global regardless
|
|
90818
90998
|
var globalsConstants = [
|
|
90819
90999
|
["FIT", zim.FIT],
|
|
@@ -90868,7 +91048,7 @@ for (z_i = 0; z_i < globalFunctions.length; z_i++) {
|
|
|
90868
91048
|
for (z_i = 0; z_i < zim.colors.length; z_i++) {
|
|
90869
91049
|
WW[zim.colors[z_i]] = zim.colorsHex[z_i];
|
|
90870
91050
|
}
|
|
90871
|
-
|
|
91051
|
+
|
|
90872
91052
|
|
|
90873
91053
|
WW.zim = zim;
|
|
90874
91054
|
export default zim;
|