Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.1 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * VERSION: 1.7.0
  3. * DATE: 2018-05-21
  4. * UPDATES AND DOCS AT: http://greensock.com
  5. *
  6. * @license Copyright (c) 2008-2019, GreenSock. All rights reserved.
  7. * This work is subject to the terms at http://greensock.com/standard-license or for
  8. * Club GreenSock members, the software agreement that was issued with your membership.
  9. *
  10. * @author: Jack Doyle, jack@greensock.com
  11. **/
  12. /* eslint-disable */
  13. var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
  14. (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
  15. "use strict";
  16. var RoundPropsPlugin = _gsScope._gsDefine.plugin({
  17. propName: "roundProps",
  18. version: "1.7.0",
  19. priority: -1,
  20. API: 2,
  21. //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
  22. init: function(target, value, tween) {
  23. this._tween = tween;
  24. return true;
  25. }
  26. }),
  27. _getRoundFunc = function(v) { //pass in 0.1 get a function that'll round to the nearest tenth, or 5 to round to the closest 5, or 0.001 to the closest 1000th, etc.
  28. var p = v < 1 ? Math.pow(10, (v + "").length - 2) : 1; //to avoid floating point math errors (like 24 * 0.1 == 2.4000000000000004), we chop off at a specific number of decimal places (much faster than toFixed()
  29. return function(n) {
  30. return ((Math.round(n / v) * v * p) | 0) / p;
  31. };
  32. },
  33. _roundLinkedList = function(node, mod) {
  34. while (node) {
  35. if (!node.f && !node.blob) {
  36. node.m = mod || Math.round;
  37. }
  38. node = node._next;
  39. }
  40. },
  41. p = RoundPropsPlugin.prototype;
  42. p._onInitAllProps = function() {
  43. var tween = this._tween,
  44. rp = tween.vars.roundProps,
  45. lookup = {},
  46. rpt = tween._propLookup.roundProps,
  47. pt, next, i, p;
  48. if (typeof(rp) === "object" && !rp.push) {
  49. for (p in rp) {
  50. lookup[p] = _getRoundFunc(rp[p]);
  51. }
  52. } else {
  53. if (typeof(rp) === "string") {
  54. rp = rp.split(",");
  55. }
  56. i = rp.length;
  57. while (--i > -1) {
  58. lookup[rp[i]] = Math.round;
  59. }
  60. }
  61. for (p in lookup) {
  62. pt = tween._firstPT;
  63. while (pt) {
  64. next = pt._next; //record here, because it may get removed
  65. if (pt.pg) {
  66. pt.t._mod(lookup);
  67. } else if (pt.n === p) {
  68. if (pt.f === 2 && pt.t) { //a blob (text containing multiple numeric values)
  69. _roundLinkedList(pt.t._firstPT, lookup[p]);
  70. } else {
  71. this._add(pt.t, p, pt.s, pt.c, lookup[p]);
  72. //remove from linked list
  73. if (next) {
  74. next._prev = pt._prev;
  75. }
  76. if (pt._prev) {
  77. pt._prev._next = next;
  78. } else if (tween._firstPT === pt) {
  79. tween._firstPT = next;
  80. }
  81. pt._next = pt._prev = null;
  82. tween._propLookup[p] = rpt;
  83. }
  84. }
  85. pt = next;
  86. }
  87. }
  88. return false;
  89. };
  90. p._add = function(target, p, s, c, mod) {
  91. this._addTween(target, p, s, s + c, p, mod || Math.round);
  92. this._overwriteProps.push(p);
  93. };
  94. }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }