zimjs 18.2.3 → 18.2.5
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 +40 -31
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -1743,7 +1743,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
1743
1743
|
r = call(obj.item(i), i, total, start, end, obj, io);
|
|
1744
1744
|
}
|
|
1745
1745
|
|
|
1746
|
-
if (r == 'next') io.next();
|
|
1746
|
+
if (r == 'next' && i < total-1) io.next();
|
|
1747
1747
|
else if (typeof r != 'undefined') {
|
|
1748
1748
|
io.clear();
|
|
1749
1749
|
return r;
|
|
@@ -1780,7 +1780,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
1780
1780
|
r = call(obj.item(i), i, total, start, end, obj, io);
|
|
1781
1781
|
}
|
|
1782
1782
|
|
|
1783
|
-
if (r == 'next') io.next();
|
|
1783
|
+
if (r == 'next' && i < total-1) io.next();
|
|
1784
1784
|
else if (typeof r != 'undefined') {
|
|
1785
1785
|
io.clear();
|
|
1786
1786
|
return r;
|
|
@@ -1814,7 +1814,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
1814
1814
|
|
|
1815
1815
|
r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
|
|
1816
1816
|
|
|
1817
|
-
if (r == 'next') io.next();
|
|
1817
|
+
if (r == 'next' && i < total-1) io.next();
|
|
1818
1818
|
else if (typeof r != 'undefined') {
|
|
1819
1819
|
io.clear();
|
|
1820
1820
|
return r;
|
|
@@ -1835,7 +1835,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
1835
1835
|
|
|
1836
1836
|
r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
|
|
1837
1837
|
|
|
1838
|
-
if (r == 'next') io.next();
|
|
1838
|
+
if (r == 'next' && i < total-1) io.next();
|
|
1839
1839
|
else if (typeof r != 'undefined') {
|
|
1840
1840
|
io.clear();
|
|
1841
1841
|
return r;
|
|
@@ -2148,8 +2148,8 @@ pauseTimeLeft - if paused, get how much time is left once unpaused
|
|
|
2148
2148
|
obj.paused = state;
|
|
2149
2149
|
};
|
|
2150
2150
|
obj.next = function() {
|
|
2151
|
-
obj.count++;
|
|
2152
|
-
(call)(obj);
|
|
2151
|
+
obj.count++;
|
|
2152
|
+
(call)(obj);
|
|
2153
2153
|
checkTotal();
|
|
2154
2154
|
};
|
|
2155
2155
|
obj.clear = function() {
|
|
@@ -9317,6 +9317,7 @@ Used internally by ZIM to globally dispose common connections
|
|
|
9317
9317
|
if (c.getContext) c.getContext("2d").clearRect(0,0,1,1);
|
|
9318
9318
|
delete obj.z_bc;
|
|
9319
9319
|
}
|
|
9320
|
+
if (obj.cacheCanvas) obj.uncache();
|
|
9320
9321
|
if (zim.KEYFOCUS == obj) zim.KEYFOCUS = null;
|
|
9321
9322
|
if (WW.KEYFOCUS == obj) WW.KEYFOCUS = null;
|
|
9322
9323
|
if (obj.veeObj) obj.veeObj = null;
|
|
@@ -30553,7 +30554,7 @@ var layer = new Layer().center();
|
|
|
30553
30554
|
timeout(100, function(){zog(layer.transformControls);}); // will probably do the trick
|
|
30554
30555
|
The transformControls property holds the following:
|
|
30555
30556
|
|
|
30556
|
-
TRANSFORM
|
|
30557
|
+
TRANSFORM CONTROLS OBJECT PROPERTIES
|
|
30557
30558
|
visible - read only whether the controls are visible
|
|
30558
30559
|
ghost - read only as to whether the ghost outline is showing - set with showGhost and hideGhost
|
|
30559
30560
|
ghostEnabled - read only as to whether the ghost outline will be turned on and off - set with addGhost and removeGhost
|
|
@@ -30562,7 +30563,7 @@ stretchXControls - reference to the Container that holds the left and right boxe
|
|
|
30562
30563
|
stretchYControls - reference to the Container that holds the top and bottom boxes for stretching
|
|
30563
30564
|
rotateControls - reference to the Container that holds the outer circles for rotating
|
|
30564
30565
|
|
|
30565
|
-
TRANSFORM
|
|
30566
|
+
TRANSFORM CONTROLS OBJECT METHODS
|
|
30566
30567
|
hide() - hides the controls - returns object for chaining
|
|
30567
30568
|
show() - shows the controls - returns object for chaining
|
|
30568
30569
|
recordData(toJSON) - returns an object with type, x, y, scaleX, scaleY, rotation, skewX, skewY, visible PROPERTIES
|
|
@@ -52042,7 +52043,7 @@ END EXAMPLE
|
|
|
52042
52043
|
|
|
52043
52044
|
PARAMETERS supports DUO - parameters or single object with properties below
|
|
52044
52045
|
boundary - (default null) a ZIM Boundary object for the drag boundary
|
|
52045
|
-
|
|
52046
|
+
or a ZIM DisplayObject including stage
|
|
52046
52047
|
If the boundary is a display object then ZIM will keep the shape of the dragged object inside the bounds.
|
|
52047
52048
|
If the boundary object is a Blob then the dragged object will stay within the Blob (experimental).
|
|
52048
52049
|
If the boundary object is a Circle then the registration point of the dragged object will stay within the circle
|
|
@@ -52088,7 +52089,7 @@ rect - (depreciated) same as boundary - kept for backwards compatibility when us
|
|
|
52088
52089
|
currentTarget - (default false) same as the all parameter - kept for backwards compatibility when using config object
|
|
52089
52090
|
offStage - (default false) set to true to be able to drag object off stage (thanks Shammi!)
|
|
52090
52091
|
immediateBoundary - (default false) set to true to add bounds immediately when drag() is set on a Container.
|
|
52091
|
-
|
|
52092
|
+
this is normally set to false for a .05 second delay to allow objects to be added to Container before setting bounds.
|
|
52092
52093
|
singleTouch - (default false) set to true to let only one touch operate the drag
|
|
52093
52094
|
also see Frame() singleTouch setting - but setting on drag will only affect that object's drag
|
|
52094
52095
|
dropTargets - an object or an array of objects that can receive a drop
|
|
@@ -52672,7 +52673,7 @@ RETURNS obj for chaining
|
|
|
52672
52673
|
// if (dampY) dampY.immediate(0);
|
|
52673
52674
|
|
|
52674
52675
|
} else {
|
|
52675
|
-
|
|
52676
|
+
obj.downCheck = false; // added ZIM NFT 01
|
|
52676
52677
|
var pointerCount = 0;
|
|
52677
52678
|
for (var o in obj.pointers) {
|
|
52678
52679
|
pointerCount++;
|
|
@@ -56881,7 +56882,12 @@ PARAMETERS
|
|
|
56881
56882
|
** supports DUO - parameters or single object with properties below
|
|
56882
56883
|
** supports VEE - parameters marked with ZIM VEE mean a zim Pick() object or Pick Literal can be passed
|
|
56883
56884
|
Pick Literal formats: [1,3,2] - random; {min:10, max:20} - range; series(1,2,3) - order, function(){return result;} - function
|
|
56884
|
-
|
|
56885
|
+
** supports OCT - parameter defaults can be set with STYLE control (like CSS)
|
|
56886
|
+
NOTE: can target parameters in general like
|
|
56887
|
+
STYLE = {loop:true};
|
|
56888
|
+
to target animate specifically use
|
|
56889
|
+
STYLE = {Animate:{loop:true}};
|
|
56890
|
+
NOT STYLE = {animate:{loop:true}} as lowercase animate conflicts with setting a animate convenience style
|
|
56885
56891
|
props - the object literal holding properties and values to animate
|
|
56886
56892
|
Basic examples: {x:200} or {rotation:360, alpha:0} or {scale:4} or {x:300, y:300, scale:"2"} (relative scale)
|
|
56887
56893
|
There are custom options below including Convenience, ZIM VEE, Relative, and Series properties.
|
|
@@ -57253,6 +57259,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57253
57259
|
if (target && target.type && target.type=="AC" && WW.zdf) {WW.zdf.ac("animate", arguments); return target;}
|
|
57254
57260
|
if (!zim.animateCheck) {z_d("45"); zim.animateCheck=true;}
|
|
57255
57261
|
|
|
57262
|
+
|
|
57256
57263
|
if (!target) target = {}; // ZIM 018 replacing: return; from 10.9.0
|
|
57257
57264
|
var AN = zim.ANIMATE;
|
|
57258
57265
|
if (WW.ANIMATE != null) AN = WW.ANIMATE;
|
|
@@ -57512,7 +57519,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57512
57519
|
// ANIMATION SERIES HANDLING
|
|
57513
57520
|
// if an array is passed in to animate() as the obj
|
|
57514
57521
|
// then animate treats this as an animation series
|
|
57515
|
-
// [{target:circle, obj:{alpha:0}, time:1}, {target:rect, obj:{alpha:0}, time:1}
|
|
57522
|
+
// [{target:circle, obj:{alpha:0}, time:1}, {target:rect, obj:{alpha:0}, time:1}]
|
|
57516
57523
|
|
|
57517
57524
|
if (obj instanceof Array) {
|
|
57518
57525
|
currentCount = 1;
|
|
@@ -60594,7 +60601,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
60594
60601
|
zim.loop = function(obj, call, reverse, interval, step, start, end, immediate, complete, completeParams) {
|
|
60595
60602
|
var sig = "obj, call, reverse, interval, step, start, end, immediate, complete, completeParams";
|
|
60596
60603
|
var duo; if (duo = zob(zim.loop, arguments, sig)) return duo;
|
|
60597
|
-
|
|
60604
|
+
|
|
60598
60605
|
if (!zim.zimLoopCheck) z_d("45.3");
|
|
60599
60606
|
zim.zimLoopCheck = true;
|
|
60600
60607
|
if (zot(obj) || zot(call)) return undefined;
|
|
@@ -60653,7 +60660,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
60653
60660
|
r = call(obj.item(i), i, total, start, end, obj, io);
|
|
60654
60661
|
}
|
|
60655
60662
|
|
|
60656
|
-
if (r == 'next') io.next();
|
|
60663
|
+
if (r == 'next' && i < total-1) io.next();
|
|
60657
60664
|
else if (typeof r != 'undefined') {
|
|
60658
60665
|
io.clear();
|
|
60659
60666
|
return r;
|
|
@@ -60690,7 +60697,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
60690
60697
|
r = call(obj.item(i), i, total, start, end, obj, io);
|
|
60691
60698
|
}
|
|
60692
60699
|
|
|
60693
|
-
if (r == 'next') io.next();
|
|
60700
|
+
if (r == 'next' && i < total-1) io.next();
|
|
60694
60701
|
else if (typeof r != 'undefined') {
|
|
60695
60702
|
io.clear();
|
|
60696
60703
|
return r;
|
|
@@ -60724,7 +60731,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
60724
60731
|
|
|
60725
60732
|
r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
|
|
60726
60733
|
|
|
60727
|
-
if (r == 'next') io.next();
|
|
60734
|
+
if (r == 'next' && i < total-1) io.next();
|
|
60728
60735
|
else if (typeof r != 'undefined') {
|
|
60729
60736
|
io.clear();
|
|
60730
60737
|
return r;
|
|
@@ -60745,7 +60752,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
60745
60752
|
|
|
60746
60753
|
r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
|
|
60747
60754
|
|
|
60748
|
-
if (r == 'next') io.next();
|
|
60755
|
+
if (r == 'next' && i < total-1) io.next();
|
|
60749
60756
|
else if (typeof r != 'undefined') {
|
|
60750
60757
|
io.clear();
|
|
60751
60758
|
return r;
|
|
@@ -60765,7 +60772,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
60765
60772
|
if (typeof r != 'undefined' && r != "next") return r;
|
|
60766
60773
|
}
|
|
60767
60774
|
} else {
|
|
60768
|
-
zim.interval(interval, function(io) {
|
|
60775
|
+
zim.interval(interval, function(io) {
|
|
60769
60776
|
i = io.count;
|
|
60770
60777
|
if (!immediate) i--;
|
|
60771
60778
|
if (step) i *= step;
|
|
@@ -60773,7 +60780,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
60773
60780
|
|
|
60774
60781
|
r = call(obj.getChildAt(i), i, total, start, end, obj, io);
|
|
60775
60782
|
|
|
60776
|
-
if (r == 'next') io.next();
|
|
60783
|
+
if (r == 'next' && i < total-1) io.next();
|
|
60777
60784
|
else if (typeof r != 'undefined') {
|
|
60778
60785
|
io.clear();
|
|
60779
60786
|
return r;
|
|
@@ -60792,9 +60799,8 @@ RETURNS any value returned from the loop - or true if no value is returned from
|
|
|
60792
60799
|
if (!immediate) i--;
|
|
60793
60800
|
if (step != 1) i = -start + i*step;
|
|
60794
60801
|
|
|
60795
|
-
r = call(obj.getChildAt(i), i, total, start, end, obj, io);
|
|
60796
|
-
|
|
60797
|
-
if (r == 'next') io.next();
|
|
60802
|
+
r = call(obj.getChildAt(i), i, total, start, end, obj, io);
|
|
60803
|
+
if (r == 'next' && i < total-1) io.next();
|
|
60798
60804
|
else if (typeof r != 'undefined') {
|
|
60799
60805
|
io.clear();
|
|
60800
60806
|
return r;
|
|
@@ -61711,9 +61717,9 @@ zim constant and static Class
|
|
|
61711
61717
|
Also GLOBALSTYLE zim constant
|
|
61712
61718
|
|
|
61713
61719
|
DESCRIPTION
|
|
61714
|
-
STYLE can be used to set any parameter on a DisplayObject
|
|
61715
|
-
For instance: Circle, Blob, Button, Pane, Bitmap, Sprite, Tile, Pen, Emitter, Scroller, etc.
|
|
61716
|
-
These are applied at the time the objects are made.
|
|
61720
|
+
STYLE can be used to set any parameter on a DisplayObject, many of the Controls, and some methods.
|
|
61721
|
+
For instance: Circle, Blob, Button, Pane, Bitmap, Sprite, Tile, Pen, Emitter, Scroller, drag, animate, etc.
|
|
61722
|
+
These are applied at the time the objects are made or method called.
|
|
61717
61723
|
They are cascading with each level overriding the previous level:
|
|
61718
61724
|
|
|
61719
61725
|
1. GENERAL: any style can be specified in general
|
|
@@ -61750,6 +61756,9 @@ STYLE = {big:{width:500}} // will be automatically converted to STYLE = {group:{
|
|
|
61750
61756
|
NOTE: As of ZIM 016, group styles for an object will be used even if style for the object is set to false
|
|
61751
61757
|
this will ignore all styles except those made by a group
|
|
61752
61758
|
|
|
61759
|
+
NOTE: As of ZIM 019, animate() and drag() can be styled.
|
|
61760
|
+
If the object type is used to target these, use Animate and Drag to avoid conflicting with convenience styles of animate and drag
|
|
61761
|
+
|
|
61753
61762
|
EXAMPLE
|
|
61754
61763
|
STYLE = {
|
|
61755
61764
|
corner:20,
|
|
@@ -90708,12 +90717,12 @@ SVG will give a "ready" and a "complete" event when loaded.
|
|
|
90708
90717
|
These events are triggered 20 ms after making the object if the object is already preloaded.
|
|
90709
90718
|
|
|
90710
90719
|
NOTE: SVG is a container with a bitmap inside (see bitmap property)
|
|
90711
|
-
or if the bitmap option is not selected there are
|
|
90720
|
+
or if the bitmap option is not selected there are various shapes inside.
|
|
90712
90721
|
This means that other objects can be added to the SVG object.
|
|
90713
90722
|
This is like the ZIM Shapes (Rectangle, Circle, etc.) which are containers and can have objects added to them.
|
|
90714
|
-
If doing this, note that the container has its mouseChildren
|
|
90723
|
+
If doing this, note that the container has its mouseChildren turned off
|
|
90715
90724
|
so when dragging, for instance, the whole SVG moves rather than the bitmap inside the SVG.
|
|
90716
|
-
To interact with objects inside, set
|
|
90725
|
+
To interact with objects inside, set mySVG.mouseChildren = true.
|
|
90717
90726
|
Generally, for clarity, avoid adding objects to Shapes, Pics SVGs unless you are used to the mouseChildren setting.
|
|
90718
90727
|
|
|
90719
90728
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
@@ -98172,7 +98181,7 @@ for (z_i = 0; z_i < globalFunctions.length; z_i++) {
|
|
|
98172
98181
|
WW[pair[0]] = zim[pair[0]] = pair[1];
|
|
98173
98182
|
}
|
|
98174
98183
|
|
|
98175
|
-
|
|
98184
|
+
|
|
98176
98185
|
// these are global regardless
|
|
98177
98186
|
var globalsConstants = [
|
|
98178
98187
|
["FIT", zim.FIT],
|
|
@@ -98229,7 +98238,7 @@ if (zns) {
|
|
|
98229
98238
|
for (z_i = 0; z_i < zim.colors.length; z_i++) {
|
|
98230
98239
|
WW[zim.colors[z_i]] = zim.colorsHex[z_i];
|
|
98231
98240
|
}
|
|
98232
|
-
|
|
98241
|
+
|
|
98233
98242
|
|
|
98234
98243
|
WW.zim = zim;
|
|
98235
98244
|
export default zim;
|