zimjs 19.0.4 → 19.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/zim.js +217 -160
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "19.0.4",
3
+ "version": "19.0.6",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -2114,7 +2114,7 @@ pauseTimeLeft - if paused, get how much time is left once unpaused
2114
2114
  if (zot(immediate)) immediate = false;
2115
2115
  if (!zot(total) && (isNaN(total) || total<=0)) return;
2116
2116
  if (zot(total)) total = -1;
2117
- var obj = {count:(immediate && (isPick(time) || time > (timeType=="s"?5/1000:5))) ? -1:0, total:total, paused:false, time:time, active:true, timeUnit:timeUnit};
2117
+ var obj = {count:(immediate && (!isPick(time) && time <= (timeType=="s"?5/1000:5))) ? -1:0, total:total, paused:false, time:time, active:true, timeUnit:timeUnit};
2118
2118
 
2119
2119
  if (pauseOnBlur) {
2120
2120
  if (zot(zim.blurCheck)) zim.setBlurDetect();
@@ -8708,9 +8708,9 @@ See the parameters - which are all properties
8708
8708
  // SUBSECTION HTML FUNCTIONS
8709
8709
 
8710
8710
  /*--
8711
- zim.scrollX = function(num, time)
8711
+ zim.browserScrollX = function(num, time)
8712
8712
 
8713
- scrollX
8713
+ browserScrollX
8714
8714
  zim function
8715
8715
 
8716
8716
  DESCRIPTION
@@ -8718,11 +8718,13 @@ This function gets or sets how many pixels from the left the browser window has
8718
8718
  If num is provided then the function scrolls the window to this x position.
8719
8719
  If num and time are provided it animates the window to the x position in time milliseconds.
8720
8720
 
8721
+ NOTE: this was changed from scrollX() to getScrollX() in ZIM 019 to avoid conflict with window.scrollX
8722
+
8721
8723
  NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
8722
8724
 
8723
8725
  EXAMPLE
8724
8726
  // hide the logo if the page is scrolled left more than 200 pixels
8725
- if (scrollX < -200) zss("logo").display = "none";
8727
+ if (browserScrollX() < -200) zss("logo").display = "none";
8726
8728
  END EXAMPLE
8727
8729
 
8728
8730
  PARAMETERS
@@ -8730,17 +8732,17 @@ num - (default null) optional scroll position to go to (probably negative)
8730
8732
  time - (default 0) time in seconds to take to go to the num position (also see ZIM TIME constant)
8731
8733
 
8732
8734
  RETURNS a Number
8733
- --*///+18
8734
- zim.scrollX = function(num, time) {
8735
- z_d("18");
8735
+ --*///+18.1
8736
+ zim.browserScrollX = function(num, time) {
8737
+ z_d("18.1");
8736
8738
  return zim.abstractScroll("X", "Left", num, time);
8737
- };//-18
8739
+ };//-18.1
8738
8740
 
8739
8741
 
8740
8742
  /*--
8741
- zim.scrollY = function(num, time)
8743
+ zim.browserScrollY = function(num, time)
8742
8744
 
8743
- scrollY
8745
+ browserScrollY
8744
8746
  zim function
8745
8747
 
8746
8748
  DESCRIPTION
@@ -8748,11 +8750,13 @@ This function gets or sets how many pixels from the top the browser window has b
8748
8750
  If num is provided then the function scrolls the window to this y position.
8749
8751
  If num and time are provided it animates the window to the y position in time milliseconds.
8750
8752
 
8753
+ NOTE: this was changed from scrollY() to getScrollY() in ZIM 019 to avoid conflict with window.scrollY
8754
+
8751
8755
  NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
8752
8756
 
8753
8757
  EXAMPLE
8754
8758
  // animate the scroll position down 100 pixels in half a second
8755
- scrollY(scrollY()-100, .5);
8759
+ browserScrollY(browserScrollY()-100, .5);
8756
8760
  END EXAMPLE
8757
8761
 
8758
8762
  PARAMETERS
@@ -8760,11 +8764,11 @@ num - (default null) optional scroll position to go to (probably negative)
8760
8764
  time - (default 0) time in seconds to take to go to the num position (also see ZIM TIME constant)
8761
8765
 
8762
8766
  RETURNS a Number
8763
- --*///+19
8764
- zim.scrollY = function(num, time) {
8765
- z_d("19");
8767
+ --*///+19.1
8768
+ zim.browserScrollY = function(num, time) {
8769
+ z_d("19.1");
8766
8770
  return zim.abstractScroll("Y", "Top", num, time);
8767
- };//-19
8771
+ };//-19.1
8768
8772
 
8769
8773
  //+20
8770
8774
  zim.abstractScroll = function(dir, side, num, time) {
@@ -8774,22 +8778,22 @@ RETURNS a Number
8774
8778
  if (zot(num)) {
8775
8779
  return (document.documentElement && document.documentElement["scroll"+side]) || document.body["scroll"+side];
8776
8780
  } else if (zot(time)) {
8777
- WW.scrollTo(zim["scroll"+perpend](), num);
8781
+ WW.scrollTo(zim["browserScroll"+perpend](), num);
8778
8782
  } else {
8779
8783
  var interval = 50;
8780
8784
  var t = time*(timeType=="s"?1000:1);
8781
8785
  if (t < interval) t = interval;
8782
8786
  var steps = t/interval;
8783
- var current = zim["scroll"+dir]();
8787
+ var current = zim["browserScroll"+dir]();
8784
8788
  var amount = num - current;
8785
8789
  var diff = amount/steps;
8786
8790
  var count = 0;
8787
8791
  var scrollInterval = setInterval(function() {
8788
8792
  count++;
8789
8793
  current+=diff;
8790
- WW.scrollTo(zim["scroll"+perpend](), current);
8794
+ WW.scrollTo(zim["browserScroll"+perpend](), current);
8791
8795
  if (count >= steps) {
8792
- WW.scrollTo(zim["scroll"+perpend](), num);
8796
+ WW.scrollTo(zim["browserScroll"+perpend](), num);
8793
8797
  clearInterval(scrollInterval);
8794
8798
  }
8795
8799
  }, interval);
@@ -10203,13 +10207,13 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
10203
10207
 
10204
10208
  this.normalized = true;
10205
10209
  that.saveOriginalReg = function() {
10206
- that.loop(c=>{
10210
+ that.loop(function(c) {
10207
10211
  c._orX = c.regX;
10208
10212
  c._orY = c.regY;
10209
10213
  });
10210
10214
  }
10211
10215
  that.resetOriginalReg = function() {
10212
- that.loop(c=>{
10216
+ that.loop(function(c) {
10213
10217
  c.reg(c._orX, c._orY, true);
10214
10218
  });
10215
10219
  }
@@ -10222,7 +10226,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
10222
10226
  var maxX = -10000000;
10223
10227
  var maxY = -10000000;
10224
10228
 
10225
- that.loop(c=>{
10229
+ that.loop(function(c) {
10226
10230
  c._dx = c._dy = null;
10227
10231
  if (from == "center") c._dx = that.width/2-c.x;
10228
10232
  else if (from == "end") c._dx = that.width-c.x;
@@ -10234,7 +10238,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
10234
10238
  maxX = Math.max(maxX, Math.abs(c._orX-c._dx));
10235
10239
  maxY = Math.max(maxY, Math.abs(c._orY-c._dy));
10236
10240
  });
10237
- that.loop(c=>{
10241
+ that.loop(function(c) {
10238
10242
  c.ratio = 1 - (Math.sqrt(Math.pow((c._orX-c._dx),2) + Math.pow((c._orY-c._dy),2)) / Math.sqrt(Math.pow(maxX,2) + Math.pow(maxY,2)));
10239
10243
  if (factor==-1) c.ratio = 1-c.ratio;
10240
10244
  if (clamp) c.ratio = zim.constrain(c.ratio, 0, 1);
@@ -10256,7 +10260,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
10256
10260
  function setMM() {
10257
10261
  var minC = 1000000000;
10258
10262
  var maxC = -1000000000;
10259
- that.loop(c=>{
10263
+ that.loop(function(c) {
10260
10264
  if (zot(min) && c[prop] < minC) minC = c[prop];
10261
10265
  if (zot(max) && c[prop] > maxC) maxC = c[prop];
10262
10266
  });
@@ -14870,7 +14874,7 @@ zim.Shader = function(width, height, fragment, uniforms, vertex, dynamic, preCal
14870
14874
  if (value) {
14871
14875
  zim.Ticker.add(this.ticker, null, mID, that);
14872
14876
  } else {
14873
- zim.Ticker.remove(this.ticker, mID, that);
14877
+ if (this.ticker) zim.Ticker.remove(this.ticker, mID, that);
14874
14878
  }
14875
14879
  _dynamic = value?true:false;
14876
14880
  }
@@ -14999,7 +15003,7 @@ zim.ShaderOverlay = function(width, height, fragment, uniforms, vertex, dynamic,
14999
15003
  if (value) {
15000
15004
  zim.Ticker.add(this.ticker, null, mID, that);
15001
15005
  } else {
15002
- zim.Ticker.remove(this.ticker, mID, that, that);
15006
+ if (this.ticker) zim.Ticker.remove(this.ticker, mID, that, that);
15003
15007
  }
15004
15008
  _dynamic = value?true:false;
15005
15009
  }
@@ -15257,7 +15261,7 @@ function makeShader(DS, width, height, fragment, uniforms, vertex, dynamic, preC
15257
15261
  update();
15258
15262
  var ticker = zim.Ticker.add(update, null, mID, tether);
15259
15263
  if (!dynamic) {
15260
- zim.Ticker.remove(ticker, mID, tether);
15264
+ if (ticker) zim.Ticker.remove(ticker, mID, tether);
15261
15265
  setTimeout(update, 50);
15262
15266
  if (tether.stage) tether.stage.update();
15263
15267
  }
@@ -15739,7 +15743,7 @@ borderWidth - |ZIM VEE| (default 1 if stroke is set) the size of the stroke in p
15739
15743
  dashed - (default false) set to true for dashed border (if borderWidth or borderColor set)
15740
15744
  or set to an array of line size then space size, etc.
15741
15745
  eg. [20, 10] is 20 line and 10 space repeated and [20,100,50,10] is 20 line, 100 space, 50 line, 10 space, etc.
15742
- percent - (default 100) set to a percentage of a circle (arc) - registration stays at radius center, bounds shrink to arc
15746
+ percent - |ZIM VEE| - (default 100) set to a percentage of a circle (arc) - registration stays at radius center, bounds shrink to arc
15743
15747
  percentClose - (default true) set to false to not close the border of a circle with percent set
15744
15748
  percentArc - (default false) set to a percent to make moon shapes - must have percent turned on
15745
15749
  the value is the distance the arc-making circle is placed from the original circle's edge
@@ -16283,6 +16287,7 @@ Pick Literal formats: [1,3,2] - random; {min:10, max:20} - range; series(1,2,3)
16283
16287
  a, b and c - |ZIM VEE| (default 100) the lengths of the sides
16284
16288
  a will run horizontally along the bottom
16285
16289
  b is upwards and c is back to the origin
16290
+ if there is b and c is left empty then it will be set equal to b and make an isosceles triangle
16286
16291
  if b or c is set to -1 will assume a 90 angle
16287
16292
  color - |ZIM VEE| (default black) the fill color as any CSS color including "rgba()" for alpha fill (set a to 0 for tranparent fill)
16288
16293
  borderColor - |ZIM VEE| (default null) the stroke color
@@ -16386,7 +16391,7 @@ zim.Triangle = function(a, b, c, color, borderColor, borderWidth, corner, center
16386
16391
 
16387
16392
  if (zot(a)) a = DS.a!=null?DS.a:100;
16388
16393
  if (zot(b)) b = DS.b!=null?DS.b:a;
16389
- if (zot(c)) c = DS.c!=null?DS.c:a;
16394
+ if (zot(c)) c = DS.c!=null?DS.c:b;
16390
16395
  if (b==-1) b = Math.sqrt(Math.pow(a,2)+Math.pow(c,2));
16391
16396
  if (c==-1) c = Math.sqrt(Math.pow(a,2)+Math.pow(b,2));
16392
16397
  if (zot(corner)) corner = DS.corner!=null?DS.corner:0;
@@ -20943,7 +20948,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
20943
20948
  // we need to find the new index of the second point
20944
20949
  // we will store this as i3
20945
20950
  var num = that.points.length;
20946
- let i3 = (i1 > i2) ? num-i1+i2 : i2-i1;
20951
+ var i3 = (i1 > i2) ? num-i1+i2 : i2-i1;
20947
20952
 
20948
20953
  // split the squiggle into two at the adjusted second point
20949
20954
  var s2 = s1.splitPoints(i3).loc(that); // returns second Squiggle
@@ -26349,17 +26354,21 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
26349
26354
  if (zot(width)) width=DS.width!=null?DS.width:200;
26350
26355
  if (zot(height)) height=DS.height!=null?DS.height:60;
26351
26356
 
26352
- if (zot(WW.M)) WW.M = zim.mobile();
26357
+ if (zot(WW.M)) WW.M = zim.mobile();
26353
26358
 
26359
+ // used if custom label to determine which color to use
26360
+ var colorStart = color!=null?color:color=DS.color!=null?DS.color:null
26361
+ var rollColorStart = rollColor!=null?rollColor:rollColor=DS.rollColor!=null?DS.rollColor:null
26354
26362
 
26363
+ if (zot(colorStart)) color=zim.white;
26364
+ else color = colorStart;
26365
+ if (zot(rollColorStart)) rollColor=zim.white;
26366
+ else rollColor = rollColorStart;
26355
26367
 
26356
- var oRollColor = rollColor;
26357
- var oDownColor = downColor;
26358
- if (zot(color)) color=DS.color!=null?DS.color:zim.white;
26359
-
26368
+ // used to return the label to start colors after roll colors
26360
26369
  var oColor = color;
26370
+ var oRollColor = rollColor;
26361
26371
 
26362
- if (zot(rollColor)) rollColor=DS.rollColor!=null?DS.rollColor:zim.white;
26363
26372
  if (zot(autoPadding)) autoPadding=DS.autoPadding!=null?DS.autoPadding:20;
26364
26373
  if (zot(autoPaddingH)) autoPaddingH=DS.autoPaddingH!=null?DS.autoPaddingH:autoPadding;
26365
26374
  if (zot(autoPaddingV)) autoPaddingV=DS.autoPaddingV!=null?DS.autoPaddingV:autoPadding;
@@ -26375,10 +26384,25 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
26375
26384
  style:false, group:this.group
26376
26385
  });
26377
26386
  } else {
26378
- if (!zot(oColor)) label.color = oColor;
26379
- color = label.color;
26380
- if (zot(label.rollColor) || !zot(oRollColor)) label.rollColor = rollColor;
26381
- rollColor = label.rollColor;
26387
+ if (zot(colorStart)) {
26388
+ color = label.color;
26389
+ oColor = color;
26390
+ } else {
26391
+ label.color = color;
26392
+ }
26393
+
26394
+ if (zot(rollColorStart)) {
26395
+ if (zot(label.rollColor)) {
26396
+ rollColor = color;
26397
+ oRollColor = color;
26398
+ label.rollColor = rollColor;
26399
+ } else {
26400
+ rollColor = label.rollColor;
26401
+ oRollColor = rollColor;
26402
+ }
26403
+ } else {
26404
+ label.rollColor = rollColor;
26405
+ }
26382
26406
  }
26383
26407
  if (zot(downColor)) downColor=DS.downColor!=null?DS.downColor:rollColor;
26384
26408
 
@@ -30595,7 +30619,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
30595
30619
  if (!scrollBarActive && optimize) {
30596
30620
  if (that.zDE) content.off("mousedown", that.zDE, null, mID);
30597
30621
  that.zDE = content.on("mousedown", function() {
30598
- if (that.zTI) zim.Ticker.remove(testContent, mID, that);
30622
+ if (that.zTI && testContent) zim.Ticker.remove(testContent, mID, that);
30599
30623
  }, null, null, null, null, mID);
30600
30624
  if (that.zME) content.off("pressmove", that.zME, null, mID);
30601
30625
  that.zME = content.on("pressmove", testContent, null, null, null, null, mID);
@@ -30667,7 +30691,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
30667
30691
  }
30668
30692
 
30669
30693
  function stageUp() {
30670
- zim.Ticker.remove(swipeMovescrollBars, mID, that);
30694
+ if (swipeMovescrollBars) zim.Ticker.remove(swipeMovescrollBars, mID, that);
30671
30695
  swipeCheck = false;
30672
30696
  if (hCheck) if (scrollBarFade && scrollBarActive) zim.animate(hscrollBar, {alpha:0}, scrollBar.fadeTime);
30673
30697
  if (vCheck) if (scrollBarFade && scrollBarActive) zim.animate(vscrollBar, {alpha:0}, scrollBar.fadeTime);
@@ -30691,7 +30715,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
30691
30715
  that.dispatchEvent("hoverout");
30692
30716
  hoverOutCalled = true;
30693
30717
  }
30694
- zim.Ticker.remove(timeMouse, mID, that);
30718
+ if (timeMouse) zim.Ticker.remove(timeMouse, mID, that);
30695
30719
  }
30696
30720
  function timeMouse() {
30697
30721
  if (!content.stage) {
@@ -30699,7 +30723,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
30699
30723
  that.dispatchEvent("hoverout");
30700
30724
  hoverOutCalled = true;
30701
30725
  }
30702
- zim.Ticker.remove(timeMouse, mID, that);
30726
+ if (timeMouse) zim.Ticker.remove(timeMouse, mID, that);
30703
30727
  return;
30704
30728
  }
30705
30729
  if (Math.abs(lastMouseX-that.windowMouseX) > thresh || Math.abs(lastMouseY-that.windowMouseY) > thresh) {
@@ -32488,8 +32512,10 @@ index - (default 0) - set the index at start. Use -1 for no indicator at start.
32488
32512
  backgroundAlpha - (default 1 or .2 if indicatorType is Emoji) - affects only Emoji and custom DisplayObject indicatorType
32489
32513
  selectedIndex - same as index, kept in for backwards compatibility in ZIM DUO
32490
32514
  toggleFirst - (default true) set to false to not toggle first light if indicator is set to interactive
32491
- delayLight - (default false) set to true to not activate the light when interactive is true
32515
+ delayLights - (default false) set to true to not activate the light when interactive is true
32492
32516
  sometimes something else will set the lights so just dispatch a change event without updating the light
32517
+ indicatorList - (default null) an array of custom objects for the non-selected items
32518
+ selectedIndicatorList - (default null) an array of custom objects for the selected items
32493
32519
  style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
32494
32520
  group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
32495
32521
  inherit - (default null) used internally but can receive an {} of styles directly
@@ -32512,8 +32538,8 @@ type - holds the class name as a String
32512
32538
  index - gets or sets the current index of the indicator
32513
32539
  num - the assigned num value (how many light objects) (read only)
32514
32540
  backdrop - gives access to the backdrop if there is one Rectangle
32515
- lights - an array of the light objects (zim Circle or Rectangle objects)
32516
- lightsContainer - gives access to the lights createjs.Container with its Circle or Rectangle children
32541
+ lights - an array of the light objects - each is a Container that holds the Circle, Rectangle, or custom object
32542
+ lightsContainer - gives access to the lights Container that holds light objects - see lights above
32517
32543
  enabled - set to false to disable component
32518
32544
 
32519
32545
  ALSO: see ZIM Container for properties such as:
@@ -41571,7 +41597,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
41571
41597
  currentEvent = e;
41572
41598
  }, null, null, null, null, mID);
41573
41599
  this.on("pressup", function () {
41574
- zim.Ticker.remove(that.ticker, mID, that);
41600
+ if (that.ticker) zim.Ticker.remove(that.ticker, mID, that);
41575
41601
  that.dirX = that.dirY = 0;
41576
41602
  arrows.loop(function (arrow) {
41577
41603
  arrow.color = indicatorColor;
@@ -41878,9 +41904,9 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
41878
41904
 
41879
41905
  button.zimOverEvent = button.on("mouseover", function(e) {
41880
41906
  var button = e.target;
41881
- button.colorCommand.style = (button==that.selected&&currentSelected)?button.selectedRollBackgroundColor:button.rollBackgroundColor;
41907
+ button.colorCommand.style = (button==that.selected && currentSelected)?button.selectedRollBackgroundColor:button.rollBackgroundColor;
41882
41908
 
41883
- if (button.label) button.label.color = (button==that.selected&&currentSelected)?button.selectedRollColor:button.rollColor;
41909
+ if (button.label) button.label.color = (button==that.selected && currentSelected)?button.selectedRollColor:button.rollColor;
41884
41910
  if (rollIcons) {
41885
41911
  button.holder.removeAllChildren();
41886
41912
  rollIcons[button.num].loc(1,0,button.holder);
@@ -41889,8 +41915,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
41889
41915
  }, null, null, null, null, mID);
41890
41916
  button.zimOutEvent = button.on("mouseout", function(e) {
41891
41917
  var button = e.target;
41892
- button.colorCommand.style = (button==that.selected&&currentSelected)?button.selectedBackgroundColor:button.backgroundColor;
41893
- if (button.label) button.label.color = (button==that.selected&&currentSelected)?button.selectedColor:button.color;
41918
+ button.colorCommand.style = (button==that.selected && currentSelected)?button.selectedBackgroundColor:button.backgroundColor;
41919
+ if (button.label) button.label.color = (button==that.selected && currentSelected)?button.selectedColor:button.color;
41894
41920
  if (rollIcons) {
41895
41921
  button.holder.removeAllChildren();
41896
41922
  if (icons) icons[button.num].loc(1,0,button.holder);
@@ -45371,7 +45397,7 @@ zim.Keyboard = function(labels, backgroundColor, color, shiftBackgroundColor, sh
45371
45397
 
45372
45398
  function stopDragging() {
45373
45399
  currentStage.off("pressmousemove", that.tickerMouseEvent, null, mID);
45374
- zim.Ticker.remove(startDragging, mID, that);
45400
+ if (startDragging) zim.Ticker.remove(startDragging, mID, that);
45375
45401
  }
45376
45402
 
45377
45403
  that.setBounds(1000,400-(numH-10)*26); // Dan Zen for any size keyboard
@@ -45386,7 +45412,7 @@ zim.Keyboard = function(labels, backgroundColor, color, shiftBackgroundColor, sh
45386
45412
  positionXBlinker += currentLabel.widthArray[i]?currentLabel.widthArray[i]:0;
45387
45413
  }
45388
45414
  // Dan Zen added 9.5.0 padding for three types of Label (backing, backgroundColor and neither)
45389
- textBlinker.heightOnly = currentLabel.getBounds().height*(currentLabel.backing&&zot(currentLabel.padding)?.9:1)-((currentLabel.paddingV&&currentLabel.background)?currentLabel.paddingV*2:0);
45415
+ textBlinker.heightOnly = currentLabel.getBounds().height*(currentLabel.backing && zot(currentLabel.padding)?.9:1)-((currentLabel.paddingV && currentLabel.background)?currentLabel.paddingV*2:0);
45390
45416
  textBlinker.center(currentLabel);
45391
45417
  textBlinker.x = positionXBlinker;
45392
45418
  }
@@ -45690,7 +45716,7 @@ zim.Keyboard = function(labels, backgroundColor, color, shiftBackgroundColor, sh
45690
45716
  var obj = {target:labels[index]};
45691
45717
  activateLabel(obj);
45692
45718
  }
45693
- setTimeout(()=>{if (textBlinker) textBlinker.visible = true;}, 200);
45719
+ setTimeout(function() {if (textBlinker) textBlinker.visible = true;}, 200);
45694
45720
  that.toggled = true;
45695
45721
  if (numPadOnly) showNumPad();
45696
45722
  else if (!numPadOnly || override) {
@@ -47760,7 +47786,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
47760
47786
  if (zot(mix)) mix = DS.mix!=null?DS.mix:true;
47761
47787
  this.zimContainer_constructor(width+marginLeft+marginRight,height,null,null,false);
47762
47788
  this.type = "Marquee";
47763
-
47789
+
47764
47790
  // MONITOR
47765
47791
  var mID = this.mID = "z~"+(DS.monitor===false?"-":this.type);
47766
47792
 
@@ -48829,7 +48855,7 @@ zim.Carousel3D = function(width, height, items, widthFactor, heightFactor, curve
48829
48855
  that.stillTO;
48830
48856
  that.added(function(){
48831
48857
  that.makeCarousel();
48832
- that.tick = Ticker.add(()=>{
48858
+ that.tick = Ticker.add(function() {
48833
48859
  if (vertical) {
48834
48860
  that.holder.loop(function(item, i) {
48835
48861
  item.y = item.start - r + (that.amount+r+r*2*1000000 + item.shift) % (r*2);
@@ -49024,6 +49050,7 @@ zim.Carousel3D = function(width, height, items, widthFactor, heightFactor, curve
49024
49050
  });
49025
49051
 
49026
49052
  this.dispose = function(a,b,disposing) {
49053
+ if (that.tick) zim.Ticker.remove(that.tick);
49027
49054
  if (that.swiper) that.swiper.dispose();
49028
49055
  if (!disposing) {this.zimContainer_dispose();}
49029
49056
  return true;
@@ -53795,7 +53822,7 @@ RETURNS obj for chaining
53795
53822
  if (Math.abs(dragObject.x-dragObject.dragStartX) < 1 && Math.abs(dragObject.y-dragObject.dragStartY) < 1) {
53796
53823
  hasMoved = false;
53797
53824
  dragObject.dispatchEvent("slidestop");
53798
- zim.Ticker.remove(obj.zimDragTicker, mID, obj);
53825
+ if (obj.zimDragTicker) zim.Ticker.remove(obj.zimDragTicker, mID, obj);
53799
53826
  }
53800
53827
 
53801
53828
  // if (dampX) dampX.immediate(50);
@@ -53807,7 +53834,7 @@ RETURNS obj for chaining
53807
53834
  for (var o in obj.pointers) {
53808
53835
  pointerCount++;
53809
53836
  }
53810
- if (pointerCount == 0) zim.Ticker.remove(obj.zimDragTicker, mID, obj);
53837
+ if (pointerCount == 0 && obj.zimDragTicker) zim.Ticker.remove(obj.zimDragTicker, mID, obj);
53811
53838
  // extra pen drag
53812
53839
  if (obj.type == "Pen") {
53813
53840
  obj.zimDragCheck = false;
@@ -53991,7 +54018,7 @@ RETURNS obj for chaining
53991
54018
  o.slideStartY = null;
53992
54019
  if (hasMoved) {
53993
54020
  o.dispatchEvent("slidestop");
53994
- zim.Ticker.remove(obj.zimDragTicker, mID, obj);
54021
+ if (obj.zimDragTicker) zim.Ticker.remove(obj.zimDragTicker, mID, obj);
53995
54022
  }
53996
54023
  // extra pen drag
53997
54024
  if (obj.type == "Pen") {
@@ -59275,7 +59302,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
59275
59302
  return target;
59276
59303
  }
59277
59304
  var coTarget = target;
59278
- if (coTarget.cT) {zim.Ticker.remove(coTarget.cT, mID, target);}
59305
+ if (coTarget.cT) zim.Ticker.remove(coTarget.cT, mID, target);
59279
59306
  target = {val:0, zimTweens:{}, ticker:coTarget.cT};
59280
59307
  var startColor = coTarget.material.color.getHexString();
59281
59308
  var endColor = obj.color;
@@ -61011,7 +61038,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
61011
61038
  var ticker = target.zimTweens[id].zimTicker;
61012
61039
  if (target.zimTweens[id].extraTickers) {
61013
61040
  for (var k=0; k<target.zimTweens[id].extraTickers.length; k++) {
61014
- zim.Ticker.remove(target.zimTweens[id].extraTickers[k]);
61041
+ if (target.zimTweens[id].extraTickers[k]) zim.Ticker.remove(target.zimTweens[id].extraTickers[k]);
61015
61042
  }
61016
61043
  }
61017
61044
  // if (ticker) zim.Ticker.remove(ticker); ticker = null;
@@ -61031,7 +61058,9 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
61031
61058
  tween.zimPaused = paused;
61032
61059
 
61033
61060
  if (paused) {
61034
- if (tween.zimTicker) tween.zimAnimateTimeout = setTimeout(function(){zim.Ticker.remove(tween.zimTicker, mID, target);},200);
61061
+ if (tween.zimTicker) tween.zimAnimateTimeout = setTimeout(function(){
61062
+ if (tween.zimTicker) zim.Ticker.remove(tween.zimTicker, mID, target);
61063
+ },200);
61035
61064
  // if (target.zimZoomTicker) zim.Ticker.remove(target.zimZoomTicker);
61036
61065
  } else {
61037
61066
  tween.startPaused = false;
@@ -61091,7 +61120,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
61091
61120
  target.off("pressmove", target.zimAnimateDragPress, null, mID);
61092
61121
  target.off("pressup", target.zimAnimateDragUp, null, mID);
61093
61122
  if (target.amu) stage.frame.off("mouseupplus", target.amu, null, mID);
61094
- zim.Ticker.remove(target.zimDragAnimateTicker, mID, target);
61123
+ if (target.zimDragAnimateTicker) zim.Ticker.remove(target.zimDragAnimateTicker, mID, target);
61095
61124
  }
61096
61125
  if (zot(ids)) {
61097
61126
  if (!include) return target; // would be exclude all ids
@@ -68561,10 +68590,12 @@ note: the item is not the event object target - as that is the tile
68561
68590
  zim.loop(that.items, function (t) {
68562
68591
  // get index of middle of bounding box of item
68563
68592
  var b = t.getBounds();
68564
- var x = t.x - t.regX + b.x + b.width / 2;
68565
- var y = t.y - t.regY + b.y + b.height / 2;
68566
- var index = that.hitTestGrid(that.width, that.height, that.cols, that.rows, x, y, null, null, spacingHList[0], spacingVList[0], true, "open");
68567
- if (index != null) items[index[0]] = t;
68593
+ if (b) {
68594
+ var x = t.x - t.regX + b.x + b.width / 2;
68595
+ var y = t.y - t.regY + b.y + b.height / 2;
68596
+ var index = that.hitTestGrid(that.width, that.height, that.cols, that.rows, x, y, null, null, spacingHList[0], spacingVList[0], true, "open");
68597
+ if (index != null) items[index[0]] = t;
68598
+ }
68568
68599
  });
68569
68600
  // // slow with hundreds
68570
68601
  // for (var j=0; j<that.rows; j++) {
@@ -68718,7 +68749,7 @@ note: the item is not the event object target - as that is the tile
68718
68749
  item.mov(colSize?-spacingHOList[i]/2:0, rowSize?-spacingVOList[Math.floor(i/that.cols)]/2:0);
68719
68750
  });
68720
68751
  var bb = that.getBounds();
68721
- that.setBounds(bb.x, bb.y, bb.width-(colSize?spacingHOTotal:0), bb.height-(rowSize?spacingVOTotal:0))
68752
+ if (bb) that.setBounds(bb.x, bb.y, bb.width-(colSize?spacingHOTotal:0), bb.height-(rowSize?spacingVOTotal:0))
68722
68753
  bb = that.getBounds();
68723
68754
  }
68724
68755
  if (backing) that.backings = backings;
@@ -68730,7 +68761,7 @@ note: the item is not the event object target - as that is the tile
68730
68761
 
68731
68762
  that.setBounds(null)
68732
68763
  var bounds = that.getBounds();
68733
- that.setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
68764
+ if (bounds) that.setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
68734
68765
 
68735
68766
  // add backdrop
68736
68767
 
@@ -68742,18 +68773,20 @@ note: the item is not the event object target - as that is the tile
68742
68773
  // add backdropColor
68743
68774
  if (backdropColor) {
68744
68775
  var bb = that.getBounds();
68745
- backdrop = that.backdrop = new zim.Rectangle({
68746
- width:bb.width+backdropPaddingH*2,
68747
- height:bb.height+backdropPaddingV*2,
68748
- color:backdropColor,
68749
- style:false,
68750
- group:"backdrop"
68751
- });
68752
- backdrop.center(that,0);
68753
- that.loop(function(item) {
68754
- item.mov(Math.max(0,backdropPaddingH), Math.max(backdropPaddingV,0));
68755
- });
68756
- that.setBounds(0,0,bb.width+Math.max(0,backdropPaddingH)*2,bb.height+Math.max(backdropPaddingV,0)*2);
68776
+ if (bb) {
68777
+ backdrop = that.backdrop = new zim.Rectangle({
68778
+ width:bb.width+backdropPaddingH*2,
68779
+ height:bb.height+backdropPaddingV*2,
68780
+ color:backdropColor,
68781
+ style:false,
68782
+ group:"backdrop"
68783
+ });
68784
+ backdrop.center(that,0);
68785
+ that.loop(function(item) {
68786
+ item.mov(Math.max(0,backdropPaddingH), Math.max(backdropPaddingV,0));
68787
+ });
68788
+ that.setBounds(0,0,bb.width+Math.max(0,backdropPaddingH)*2,bb.height+Math.max(backdropPaddingV,0)*2);
68789
+ }
68757
68790
  }
68758
68791
 
68759
68792
  }
@@ -72808,7 +72841,7 @@ zim.TextureActivesManager = function(stage, toggleKey, damp) {
72808
72841
  }, null, mID, that);
72809
72842
  nav.add(slider,0,true);
72810
72843
  nav.removeFrom();
72811
- zim.Ticker.remove(that.ticker, mID, that);
72844
+ if (that.ticker) zim.Ticker.remove(that.ticker, mID, that);
72812
72845
 
72813
72846
  function protectOn() {
72814
72847
  if (moveCheck) return;
@@ -72872,7 +72905,7 @@ zim.TextureActivesManager = function(stage, toggleKey, damp) {
72872
72905
  frame.color = lastColor==undefined?null:lastColor==null?null:lastColor;
72873
72906
  frame.outerColor = lastOuter==undefined?null:lastOuter==null?null:lastOuter;
72874
72907
  that.toggled = false;
72875
- zim.Ticker.remove(that.ticker, mID, that);
72908
+ if (that.ticker) zim.Ticker.remove(that.ticker, mID, that);
72876
72909
  nav.removeFrom();
72877
72910
  var doms = [];
72878
72911
  zim.loop(objs, function(obj) {
@@ -75543,7 +75576,7 @@ dispatches a "swipestop" event when swipeup has happened and value has stopped c
75543
75576
  function disable() {
75544
75577
  if (container.canvas) offStageEvents();
75545
75578
  else offMouseEvents();
75546
- zim.Ticker.remove(that.swiperTicker, mID, that);
75579
+ if (that.swiperTicker) zim.Ticker.remove(that.swiperTicker, mID, that);
75547
75580
  }
75548
75581
 
75549
75582
  function enable() {
@@ -75985,6 +76018,7 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
75985
76018
  var mouseEvent3;
75986
76019
  var mouseEvent4;
75987
76020
  var offTimeEvent;
76021
+ var stageupEvent;
75988
76022
  var pressing = false;
75989
76023
  var moveCheck = false;
75990
76024
  var under, i, a, gamepad, first;
@@ -76076,7 +76110,9 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76076
76110
  that.x = p.x; that.y = p.y;
76077
76111
  calculate();
76078
76112
  }, null, null, null, null, mID);
76113
+
76079
76114
  if (!zot(offTime)) offTimeEvent = stage.on("stagemouseup", doOffTime, null, null, null, null, mID);
76115
+ stageupEvent = stage.on("stagemouseup", doStageUp, null, null, null, null, mID);
76080
76116
  } else if (type == "pressmove" || type == "pressdrag" || type == "follow") {
76081
76117
  if (that.offSpeed) {
76082
76118
  that.stopAnimate("off");
@@ -76171,7 +76207,7 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76171
76207
  pressing = false;
76172
76208
  }, null, null, null, null, mID);
76173
76209
  if (!zot(offTime)) offTimeEvent = stage.on("stagemouseup", doOffTime, null, null, null, null, mID);
76174
-
76210
+ stageupEvent = stage.on("stagemouseup", doStageUp, null, null, null, null, mID);
76175
76211
  } else if (type == "gamestick") {
76176
76212
  gamepad = this.gamepad = new zim.GamePad();
76177
76213
  for (i=0; i<4; i++) { // make map hold arrays
@@ -76290,6 +76326,10 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76290
76326
  }
76291
76327
  }
76292
76328
  }
76329
+
76330
+ function doStageUp() {
76331
+ that.dispatchEvent("pressup");
76332
+ }
76293
76333
 
76294
76334
  function moveMe() {
76295
76335
  var p = container.globalToLocal(that.moveX, that.moveY);
@@ -76728,11 +76768,13 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76728
76768
  } else if (type == "mousedown" || type == "mousemove") {
76729
76769
  mouseEvent = stage.on("stage" + type, mouseEvent, null, null, null, null, mID);
76730
76770
  if (offTimeEvent) offTimeEvent = stage.on("stagemouseup", offTimeEvent, null, null, null, null, mID);
76771
+ if (stageupEvent) stageupEvent = stage.on("stagemouseup", stageupEvent, null, null, null, null, mID);
76731
76772
  } else if (type == "pressmove") {
76732
76773
  mouseEvent = stage.on("stagemousedown", mouseEvent, null, null, null, null, mID);
76733
76774
  if (mouseEvent2) mouseEvent2 = stage.on("stagemousemove", mouseEvent2, null, null, null, null, mID);
76734
76775
  if (mouseEvent3) mouseEvent3 = stage.on("stagemouseup", mouseEvent3, null, null, null, null, mID);
76735
76776
  if (offTimeEvent) offTimeEvent = stage.on("stagemouseup", offTimeEvent, null, null, null, null, mID);
76777
+ if (stageupEvent) stageupEvent = stage.on("stagemouseup", stageupEvent, null, null, null, null, mID);
76736
76778
  }
76737
76779
  mainTicker = zim.Ticker.add(mainTicker, stage, mID, that);
76738
76780
  }
@@ -76740,11 +76782,11 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76740
76782
  if (type == "keydown") {
76741
76783
  frame.off("keydown", keydownEvent, null, mID);
76742
76784
  frame.off("keyup", keyupEvent, null, mID);
76743
- zim.Ticker.remove(keyTicker, mID, that);
76785
+ if (keyTicker) zim.Ticker.remove(keyTicker, mID, that);
76744
76786
  } else if (type == "gamebutton") {
76745
76787
  gamepad.off("buttondown", buttondownEvent, null, mID);
76746
76788
  gamepad.off("buttonup", buttonupEvent, null, mID);
76747
- zim.Ticker.remove(keyTicker, mID, that);
76789
+ if (keyTicker) zim.Ticker.remove(keyTicker, mID, that);
76748
76790
  } else if (type == "gamestick") {
76749
76791
  gamepad.off("data", stickEvent, null, mID);
76750
76792
  } else if (type == "swipe") {
@@ -76753,14 +76795,16 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76753
76795
  swiperX.off("swipemove", swiperEvent, null, mID);
76754
76796
  } else if (type == "mousedown" || type == "mousemove") {
76755
76797
  stage.off("stage" + type, mouseEvent, null, mID);
76756
- stage.off("stagemouseup", offTimeEvent, null, mID);
76798
+ stage.off("stagemouseup", offTimeEvent, null, mID);
76799
+ stage.off("stagemouseup", stageupEvent, null, mID);
76757
76800
  } else if (type == "pressmove") {
76758
76801
  stage.off("stagemousedown", mouseEvent, null, mID);
76759
76802
  stage.off("stagemousemove", mouseEvent2, null, mID);
76760
76803
  stage.off("stagemouseup", mouseEvent3, null, mID);
76761
76804
  stage.off("stagemouseup", offTimeEvent, null, mID);
76805
+ stage.off("stagemouseup", stageupEvent, null, mID);
76762
76806
  }
76763
- zim.Ticker.remove(mainTicker, mID, that);
76807
+ if (mainTicker) zim.Ticker.remove(mainTicker, mID, that);
76764
76808
  }
76765
76809
  this.dispose = function() {
76766
76810
  disable();
@@ -76819,7 +76863,7 @@ gamepad.on("data", e=>{
76819
76863
  zog(e.axes[0]); // left stick x or horizontal data from -1 to 1 (lots of decimal noise)
76820
76864
  zog(e.axes[GamePad.LTX]); // another way of accessing left stick x
76821
76865
  zog(e.buttons[9]); // true or false depending on if the START button is pressed
76822
- zog(e.buttons[GamePad.START]); another way to find if the START button is pressed
76866
+ zog(e.buttons[GamePad.START]); // another way to find if the START button is pressed
76823
76867
  });
76824
76868
  END EXAMPLE
76825
76869
 
@@ -77722,7 +77766,7 @@ b2ContactListener = Box2D.Dynamics.b2ContactListener;
77722
77766
  var physics = obj.physics;
77723
77767
  physics.world.DestroyJoint(obj.puppetJoint);
77724
77768
  obj.puppetJoint = null;
77725
- zim.Ticker.remove(obj.zimPuppetTicker, mID, obj);
77769
+ if (obj.zimPuppetTicker) zim.Ticker.remove(obj.zimPuppetTicker, mID, obj);
77726
77770
  return obj;
77727
77771
  };
77728
77772
  if (!obj.hasOwnProperty("dynamic")) {
@@ -78161,7 +78205,7 @@ var DS = style===false?group!=null?zim.getStyle(null,null,inherit,this.group):{}
78161
78205
  if (themeColor != zim.purple) doColor(themeColor);
78162
78206
 
78163
78207
  this.dispose = function(a,b,disposing) {
78164
- zim.Ticker.remove(that.tickerID, mID, that);
78208
+ if (that.tickerID) zim.Ticker.remove(that.tickerID, mID, that);
78165
78209
  F.off("keydown", that.keyEvent, null, mID);
78166
78210
  if (!disposing) this.zimContainer_dispose(true);
78167
78211
  return true;
@@ -81240,7 +81284,7 @@ paused - read-only boolean whether the parallax is paused - see pause() and star
81240
81284
  this.dispose = function() {
81241
81285
  stage.off("stagemousemove", that.stageEvent, null, mID);
81242
81286
  myLayers = null;
81243
- if (auto) zim.Ticker.remove(zimTicker, mID, that);
81287
+ if (auto && zimTicker) zim.Ticker.remove(zimTicker, mID, that);
81244
81288
  return true;
81245
81289
  };
81246
81290
 
@@ -81257,7 +81301,7 @@ paused - read-only boolean whether the parallax is paused - see pause() and star
81257
81301
 
81258
81302
  if (auto) {
81259
81303
  var zimTicker = zim.Ticker.add(animate, stage, mID, that);
81260
- if (startPaused) zim.Ticker.remove(zimTicker, mID, that);
81304
+ if (startPaused && zimTicker) zim.Ticker.remove(zimTicker, mID, that);
81261
81305
  }
81262
81306
 
81263
81307
  // loop though our layers and apply the converted proportion damping
@@ -81272,8 +81316,8 @@ paused - read-only boolean whether the parallax is paused - see pause() and star
81272
81316
  if (zot(custom)) {
81273
81317
  if (o.input == "mouseX") input = that.mouseX;
81274
81318
  else if (o.input == "mouseY") input = that.mouseY;
81275
- else if (o.input == "scrollX") input = zim.scrollX();
81276
- else if (o.input == "scrollY") input = zim.scrollY();
81319
+ else if (o.input == "scrollX") input = zim.browserScrollX();
81320
+ else if (o.input == "scrollY") input = zim.browserScrollY();
81277
81321
  } else {
81278
81322
  input = custom;
81279
81323
  }
@@ -81299,7 +81343,7 @@ paused - read-only boolean whether the parallax is paused - see pause() and star
81299
81343
  that.paused = state;
81300
81344
  if (zimTicker) {
81301
81345
  if (!state) zimTicker = zim.Ticker.add(zimTicker, null, mID, that);
81302
- else zim.Ticker.remove(zimTicker, mID, that);
81346
+ else if (zimTicker) zim.Ticker.remove(zimTicker, mID, that);
81303
81347
  }
81304
81348
  }
81305
81349
  return that;
@@ -82003,7 +82047,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
82003
82047
  time:time,
82004
82048
  ease:ease,
82005
82049
  call:function () {
82006
- zim.Ticker.remove(ticker, mID, that);
82050
+ if (ticker) zim.Ticker.remove(ticker, mID, that);
82007
82051
  that.moving = false;
82008
82052
  setPeel(w, h, side);
82009
82053
  }
@@ -82034,7 +82078,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
82034
82078
  props:{currentW:0, currentH:0},
82035
82079
  time:time,
82036
82080
  call:function () {
82037
- zim.Ticker.remove(ticker, mID, that);
82081
+ if (ticker) zim.Ticker.remove(ticker, mID, that);
82038
82082
  setPeel(0, 0, side);
82039
82083
  that.moving = false;
82040
82084
  onHTML();
@@ -82094,7 +82138,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
82094
82138
  time:.3,
82095
82139
  timeUnit:"s",
82096
82140
  call:function () {
82097
- zim.Ticker.remove(ticker, mID, that);
82141
+ if (ticker) zim.Ticker.remove(ticker, mID, that);
82098
82142
  pageBack.reg(0,0);
82099
82143
  pageNext.setMask(null);
82100
82144
  toPage(that._currentPage+2);
@@ -82138,7 +82182,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
82138
82182
  time:.3,
82139
82183
  timeUnit:"s",
82140
82184
  call:function () {
82141
- zim.Ticker.remove(ticker, mID, that);
82185
+ if (ticker) zim.Ticker.remove(ticker, mID, that);
82142
82186
  pageFore.reg(0,0);
82143
82187
  pagePrev.setMask(null);
82144
82188
  toPage(that._currentPage-2);
@@ -83788,7 +83832,7 @@ Dispatches a "pause" event when paused is complete (sometimes a delay to slow to
83788
83832
  if (style!==false) zim.styleTransforms(this, DS);
83789
83833
 
83790
83834
  this.dispose = function() {
83791
- zim.Ticker.remove(zimTicker, mID, that);
83835
+ if (zimTicker) zim.Ticker.remove(zimTicker, mID, that);
83792
83836
  // if (that.backing1) that.backing1.dispose(); // leaving them around...
83793
83837
  // if (that.backing2) that.backing2.dispose();
83794
83838
  return true;
@@ -85230,9 +85274,7 @@ zim.Emitter = function(obj, width, height, interval, num, life, fade, shrink, wa
85230
85274
  this.dispose = function() {
85231
85275
  if (cache) stage.snapToPixelEnabled = true;
85232
85276
  if (that.zimInterval) that.zimInterval.clear();
85233
- if (emitterTicker) {
85234
- zim.Ticker.remove(emitterTicker, mID, that);
85235
- }
85277
+ if (emitterTicker) zim.Ticker.remove(emitterTicker, mID, that);
85236
85278
  zim.loop(poolList, function(particle) {
85237
85279
  if (particle) particle.dispose();
85238
85280
  });
@@ -86440,7 +86482,7 @@ and drawpause or drawSpacebarPause parameters are true
86440
86482
  }
86441
86483
  if (that.maxCount && that.count >= that.maxCount) {
86442
86484
  that.dispatchEvent("complete");
86443
- zim.Ticker.remove(that.ticker, mID, that);
86485
+ if (that.ticker) zim.Ticker.remove(that.ticker, mID, that);
86444
86486
  }
86445
86487
  }
86446
86488
 
@@ -87632,6 +87674,16 @@ dispatches an "undo" and a "redo" whenever undo and redo happens
87632
87674
  };
87633
87675
 
87634
87676
  that.immediate = function(x, y) {
87677
+ if (typeof x != "number" && x.x != null && x.y != null) {
87678
+ if (x.localToGlobal) {
87679
+ var p = x.localToGlobal(0,0);
87680
+ x = p.x;
87681
+ y = p.y;
87682
+ } else {
87683
+ y = x.y;
87684
+ x = x.x;
87685
+ }
87686
+ }
87635
87687
  if (!zot(x)) {
87636
87688
  that.x = x;
87637
87689
  that.dampX.immediate(that.x);
@@ -87687,7 +87739,7 @@ dispatches an "undo" and a "redo" whenever undo and redo happens
87687
87739
  if (stage && that.stageDown) stage.off("stagemousedown", that.stageDown, null, mID);
87688
87740
  if (stage && that.stageUp) stage.off("stagemouseup", that.stageUp, null, mID);
87689
87741
  if (stage && that.upEvent) stage.off("stagemouseup", that.upEvent, null, mID);
87690
- zim.Ticker.remove(that.ticker, mID, that);
87742
+ if (that.ticker) zim.Ticker.remove(that.ticker, mID, that);
87691
87743
  that.removeAllEventListeners(null, mID);
87692
87744
  if (nib) nib.removeFrom();
87693
87745
  if (all) { // remove paper too
@@ -88999,7 +89051,7 @@ the result of the play() or tone() method will dispatch a "complete" event when
88999
89051
  }
89000
89052
  if (wahAmount || wahRate || !zot(wahShape) || !zot(wahThroat)) makeWah();
89001
89053
  that2.removeWah = function() {
89002
- zim.Ticker.remove(wah.ticker, mID, that2);
89054
+ if (wah.ticker) zim.Ticker.remove(wah.ticker, mID, that2);
89003
89055
  wah.dispose();
89004
89056
  wah = that2.wah = null;
89005
89057
  that2.filter.Q.value = 0;
@@ -89370,7 +89422,7 @@ the result of the play() or tone() method will dispatch a "complete" event when
89370
89422
  that2.paused = state;
89371
89423
  };
89372
89424
  this.dispose = function () {
89373
- zim.Ticker.remove(this.ticker, mID, that2);
89425
+ if (this.ticker) zim.Ticker.remove(this.ticker, mID, that2);
89374
89426
  };
89375
89427
  };
89376
89428
  this.oscillator = function(frequency, gain, shape, offset) {
@@ -90412,6 +90464,7 @@ singleTouch - set to true for single touch rather than the default multitouch (o
90412
90464
  ZAPP DIRECTIVES
90413
90465
  These were created for the ZIM Editor (and Slate) where the Frame is already made.
90414
90466
  When these are placed inside the Editor, the Editor will parse them and run them as Frame parameters.
90467
+ WARNING: These are only parsed at the start - do not use them once your code has loaded.
90415
90468
  In ZIM 019 the system was made to work with regular code to make for easy transfer of Editor code.
90416
90469
  When these are placed in normal code above the Frame() they will override the matching Frame parameters.
90417
90470
  Examples:
@@ -90648,7 +90701,9 @@ makeCat(height) - returns a ZIM Cat icon - provide height rather than scaling fo
90648
90701
  makeIcon(edges, box, slats, borderColor, borderWidth) |ZIM DUO| - returns a ZIM Z icon
90649
90702
  edges defaults to zim.light and is the top and bottom line in the Z
90650
90703
  box defaults to zim.dark and is the background box color
90651
- slats defaults to the ZIM colors but can be set to any array of five colors (setting true will set to zim.silver)
90704
+ slats defaults to the ZIM colors but can be set to any array of five colors
90705
+ setting true will set to zim.silver
90706
+ setting to a single color will make each slat that color
90652
90707
  borderColor and borderWidth default to null - or borderWidth 1 if color set and borderColor black if borderWidth set
90653
90708
  madeWith(color, text, edges, box, slats, borderColor, borderWidth) |ZIM DUO| - returns a ZIM Z icon with Made With message
90654
90709
  color - (default zim.dark) change color of text (pass in clear to hide text)
@@ -90920,7 +90975,7 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
90920
90975
  var oldLeft = false;
90921
90976
  var old2Left = false;
90922
90977
  this.leftMouseDown = false;
90923
- function leftEvent(e) {
90978
+ function leftEvent(e) {
90924
90979
  // e = e.nativeEvent;
90925
90980
  that.leftMouseDown = e.buttons === undefined?e.which === 1:e.buttons === 1;
90926
90981
  if (oldLeft && !that.leftMouseDown) {
@@ -90974,8 +91029,8 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
90974
91029
  function setFrameShim() {
90975
91030
  that.scale = shim.stage.scaleX;
90976
91031
  var bRect = canvas.getBoundingClientRect();
90977
- that.x = bRect.x + zim.scrollX();
90978
- that.y = bRect.y + zim.scrollY();
91032
+ that.x = bRect.x + zim.browserScrollX();
91033
+ that.y = bRect.y + zim.browserScrollY();
90979
91034
  zim.scaX = createjs.stageTransformable ? 1 : shim.stage.scaleX;
90980
91035
  zim.scaY = createjs.stageTransformable ? 1 : shim.stage.scaleY;
90981
91036
  }
@@ -91185,7 +91240,7 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
91185
91240
  that.pauseTicker = function(state) {
91186
91241
  if (zot(state)) state = true;
91187
91242
  if (state) {
91188
- zim.Ticker.remove(that.updateID, mID, that);
91243
+ if (that.updateID) zim.Ticker.remove(that.updateID, mID, that);
91189
91244
  } else {
91190
91245
  zim.Ticker.add(that.updateID, null, mID, that);
91191
91246
  }
@@ -91275,8 +91330,8 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
91275
91330
  });
91276
91331
 
91277
91332
  }
91278
-
91279
- function setMousemove() {
91333
+
91334
+ function setMousemove() {
91280
91335
  if (captureMouse) { // patched in 10.7.1
91281
91336
  that.mouseX = 0;
91282
91337
  that.mouseY = 0;
@@ -91289,12 +91344,13 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
91289
91344
  that.mouseY = e.stageY/zim.scaY;
91290
91345
  }, null, null, null, null, mID);
91291
91346
  }
91292
- WW.removeEventListener("mousedown", leftEvent, true);
91293
- WW.removeEventListener("mousemove", leftEvent, true);
91294
- WW.removeEventListener("mouseup", leftEvent);
91295
- WW.addEventListener("mousedown", leftEvent, true);
91296
- WW.addEventListener("mousemove", leftEvent, true); // tell actual mousemove there was a mouseup
91297
- WW.addEventListener("mouseup", leftEvent); // give actual mouseup a chance to act
91347
+ // changed to pointer in ZIM 019 patch mousedown, etc. was not activating after CreateJS 1.5 switch
91348
+ WW.removeEventListener("pointerdown", leftEvent, true);
91349
+ WW.removeEventListener("pointermove", leftEvent, true);
91350
+ WW.removeEventListener("pointerup", leftEvent);
91351
+ WW.addEventListener("pointerdown", leftEvent, true);
91352
+ WW.addEventListener("pointermove", leftEvent, true); // tell actual mousemove there was a mouseup
91353
+ WW.addEventListener("pointerup", leftEvent); // give actual mouseup a chance to act
91298
91354
  }
91299
91355
 
91300
91356
  function makeStage() {
@@ -91371,8 +91427,8 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
91371
91427
  zim.scaY = createjs.stageTransformable ? 1 : stage.scaleY;
91372
91428
  }
91373
91429
  if (!allowDefault) {
91374
- zim.scrollX(0);
91375
- zim.scrollY(0);
91430
+ zim.browserScrollX(0);
91431
+ zim.browserScrollY(0);
91376
91432
  }
91377
91433
  setVisible();
91378
91434
  return;
@@ -91409,8 +91465,8 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
91409
91465
  can.style.left = can.style.top = "0px";
91410
91466
 
91411
91467
  bRect = can.getBoundingClientRect();
91412
- that.x = bRect.x + zim.scrollX();
91413
- that.y = bRect.y + zim.scrollY();
91468
+ that.x = bRect.x + zim.browserScrollX();
91469
+ that.y = bRect.y + zim.browserScrollY();
91414
91470
  setVisible();
91415
91471
  return;
91416
91472
  } else if (scaling == "inline") {
@@ -91470,8 +91526,8 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
91470
91526
  }
91471
91527
  can.style.left = can.style.top = "0px";
91472
91528
  bRect = can.getBoundingClientRect();
91473
- that.x = bRect.x + zim.scrollX();
91474
- that.y = bRect.y + zim.scrollY();
91529
+ that.x = bRect.x + zim.browserScrollX();
91530
+ that.y = bRect.y + zim.browserScrollY();
91475
91531
  setVisible();
91476
91532
  return;
91477
91533
  }
@@ -91508,8 +91564,8 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
91508
91564
  can.style.left = that.x + "px";
91509
91565
  can.style.top = that.y + "px";
91510
91566
  if (!allowDefault) {
91511
- zim.scrollX(0);
91512
- zim.scrollY(0);
91567
+ zim.browserScrollX(0);
91568
+ zim.browserScrollY(0);
91513
91569
  }
91514
91570
  setVisible();
91515
91571
 
@@ -92466,7 +92522,7 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92466
92522
  }
92467
92523
  });
92468
92524
 
92469
- if (obj.default) document.body.style.cursor = "none";
92525
+ if (obj["default"]) document.body.style.cursor = "none";
92470
92526
 
92471
92527
  that.pme = that.on("pointermove", function(e) {
92472
92528
  // move the cursor object and update stage if not already a Ticker
@@ -92481,10 +92537,10 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92481
92537
  }
92482
92538
  if (co && (co._cursor || co.cursor)) {
92483
92539
  setCustom(co);
92484
- } else if (obj.default) {
92540
+ } else if (obj["default"]) {
92485
92541
  setCursor("none");
92486
- that.cursorObj = obj.default;
92487
- obj.default.addTo(that.stage);
92542
+ that.cursorObj = obj["default"];
92543
+ obj["default"].addTo(that.stage);
92488
92544
  } else {
92489
92545
  setCursor();
92490
92546
  }
@@ -92502,14 +92558,14 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92502
92558
  var co = that.stage.getObjectUnderPoint(that.mouseX, that.mouseY, 1);
92503
92559
  if (co && (co._cursor || co.cursor)) {
92504
92560
  setCustom(co);
92505
- } else if (obj.default) {
92561
+ } else if (obj["default"]) {
92506
92562
  setCursor("none");
92507
- obj.default.x = that.mouseX;
92508
- obj.default.y = that.mouseY;
92509
- that.cursorObj = obj.default;
92563
+ obj["default"].x = that.mouseX;
92564
+ obj["default"].y = that.mouseY;
92565
+ that.cursorObj = obj["default"];
92510
92566
  that.cursorObj.mouseChildren = false;
92511
92567
  that.cursorObj.mouseEnabled = false;
92512
- obj.default.addTo(that.stage);
92568
+ obj["default"].addTo(that.stage);
92513
92569
  } else {
92514
92570
  setCursor();
92515
92571
  }
@@ -92538,8 +92594,8 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92538
92594
  co = co.parent;
92539
92595
  }
92540
92596
  if (co && (co._cursor || co.cursor)) return;
92541
- if (obj.default) {
92542
- doCursor(obj.default);
92597
+ if (obj["default"]) {
92598
+ doCursor(obj["default"]);
92543
92599
  } else {
92544
92600
  setCursor();
92545
92601
  }
@@ -92563,10 +92619,10 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92563
92619
  if (obj[target._cursor] == that.cursorObj) return; // only set if it is different
92564
92620
  if (that.cursorObj) that.cursorObj.removeFrom();
92565
92621
  doCursor(obj[target._cursor]);
92566
- } else if (obj.default && (!target.cursor || !that.cursorTypes.includes(target.cursor))) {
92567
- if (obj.default == that.cursorObj) return; // only set if it is different
92622
+ } else if (obj["default"] && (!target.cursor || !that.cursorTypes.includes(target.cursor))) {
92623
+ if (obj["default"] == that.cursorObj) return; // only set if it is different
92568
92624
  if (that.cursorObj) that.cursorObj.removeFrom();
92569
- doCursor(obj.default);
92625
+ doCursor(obj["default"]);
92570
92626
  } else {
92571
92627
  if (!that.cursorTypes.includes(target.cursor)) target.cursor = "default";
92572
92628
  if (that.cursorObj) that.cursorObj.removeFrom();
@@ -92591,8 +92647,8 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92591
92647
 
92592
92648
  that.smu = that.stage.on("mouseout", function(e) {
92593
92649
  if (that.cursorObj) that.cursorObj.removeFrom();
92594
- if (obj.default) {
92595
- doCursor(obj.default);
92650
+ if (obj["default"]) {
92651
+ doCursor(obj["default"]);
92596
92652
  } else {
92597
92653
  setCursor();
92598
92654
  }
@@ -92885,10 +92941,10 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92885
92941
  if (that.zimDevicemotionEvent) WW.removeEventListener("devicemotion", that.zimDevicemotionEvent);
92886
92942
  if (that.zimDeviceorientationEvent) WW.removeEventListener("deviceorientation", that.zimDeviceorientationEvent);
92887
92943
 
92888
- WW.removeEventListener("mousedown", leftEvent, true);
92889
- WW.removeEventListener("mousemove", leftEvent, true);
92890
- WW.removeEventListener("mouseup", leftEvent);
92891
-
92944
+ WW.removeEventListener("pointerdown", leftEvent, true);
92945
+ WW.removeEventListener("pointermove", leftEvent, true);
92946
+ WW.removeEventListener("pointerup", leftEvent);
92947
+
92892
92948
  if (!allowDefault) document.body.style.overflow = "athatuto";
92893
92949
  recursiveDispose(stage);
92894
92950
  function recursiveDispose(obj) {
@@ -92966,6 +93022,7 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92966
93022
  if (zot(edges)) edges = zim.light;
92967
93023
  if (zot(box)) box = zim.dark;
92968
93024
  if (slats === true) slats = [zim.silver, zim.silver, zim.silver, zim.silver, zim.silver];
93025
+ else if (!zot(slats) && !Array.isArray(slats)) slats = [slats, slats, slats, slats, slats, slats];
92969
93026
  new zim.Rectangle(icon.width, icon.height, box, borderColor, borderWidth).loc(-20,-13,icon);
92970
93027
 
92971
93028
  var data = [
@@ -95850,6 +95907,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
95850
95907
  zim.Monitor.reports = []; // {o:obj, s:"report string"}
95851
95908
  zim.Monitor.report = function() {
95852
95909
 
95910
+ if (!zim.monitorCheck) {z_d("84"); zim.monitorCheck=true;}
95911
+
95853
95912
  var objects = zim.Monitor.levels();
95854
95913
  var objTypes = [];
95855
95914
  zim.loop(objects, function(o) {
@@ -96176,7 +96235,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
96176
96235
  })
96177
96236
  .scaleTo(content, 100)
96178
96237
  .pos(0,bar2.y+bar2.height+28,CENTER,TOP,content)
96179
- .change(e=>{
96238
+ .change(function(e) {
96180
96239
  var item = e.item;
96181
96240
  settings[item.label.text.toLowerCase()] = item.checked;
96182
96241
  updateSettings();
@@ -96493,9 +96552,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
96493
96552
  var s = pre + ": [" + (crumbs&&crumbs.length>0?crumbs.join(" > "):"loose") + "] " + "interval " + id + " " + state + " " + time + "" + timeType + " " + "total: " + (total?total:"infinite") + " " + suf;
96494
96553
  monitor.reports.push({o:obj?obj:"loose", t:state, w:"i", s:s});
96495
96554
  obj = crumbs = null;
96496
- }
96497
-
96498
- //-84
96555
+ }//-84
96499
96556
 
96500
96557
  /*--
96501
96558
  zim.DISTILL
@@ -98811,7 +98868,7 @@ animator - the Gifler animator
98811
98868
  if (to) clearTimeout(to);
98812
98869
  if (state && that.animator.running()) {
98813
98870
  that.animator.stop();
98814
- zim.Ticker.remove(that.ticker, mID, that);
98871
+ if (that.ticker) zim.Ticker.remove(that.ticker, mID, that);
98815
98872
  } else if (!state && !that.animator.running()) {
98816
98873
  that.animator.start();
98817
98874
  zim.Ticker.add(that.ticker, null, mID, that);
@@ -98841,7 +98898,7 @@ animator - the Gifler animator
98841
98898
  this.dispose = function() {
98842
98899
  that.animator.stop();
98843
98900
  if (that.parent) that.removeFrom();
98844
- zim.Ticker.remove(that.ticker, mID, that);
98901
+ if (that.ticker) zim.Ticker.remove(that.ticker, mID, that);
98845
98902
  zim.gD(this);
98846
98903
  };
98847
98904
 
@@ -102854,8 +102911,8 @@ export let ProportionDamp = zim.ProportionDamp;
102854
102911
  export let Dictionary = zim.Dictionary;
102855
102912
  export let Hierarchy = zim.Hierarchy;
102856
102913
  export let Pick = zim.Pick;
102857
- export let scrollX = zim.scrollX;
102858
- export let scrollY = zim.scrollY;
102914
+ export let browserScrollX = zim.browserScrollX;
102915
+ export let browserScrollY = zim.browserScrollY;
102859
102916
  export let windowWidth = zim.windowWidth;
102860
102917
  export let windowHeight = zim.windowHeight;
102861
102918
  export let browserZoom = zim.browserZoom;
@@ -103106,4 +103163,4 @@ export let Ticker = zim.Ticker;
103106
103163
  export let Style = zim.Style;
103107
103164
  export let assets = zim.assets;
103108
103165
  export let assetIDs = zim.assetIDs;
103109
- export let ZIMON = zim.ZIMON;
103166
+ export let ZIMON = zim.ZIMON;