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.

183 lines
5.5 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * VERSION: 0.1.13
  3. * DATE: 2018-08-27
  4. * UPDATES AND DOCS AT: http://greensock.com/jquery-gsap-plugin/
  5. *
  6. * Requires TweenLite version 1.8.0 or higher and CSSPlugin.
  7. *
  8. * @license Copyright (c) 2013-2019, GreenSock. All rights reserved.
  9. * This work is subject to the terms at http://greensock.com/standard-license or for
  10. * Club GreenSock members, the software agreement that was issued with your membership.
  11. *
  12. * @author: Jack Doyle, jack@greensock.com
  13. */
  14. /* eslint-disable */
  15. (function($) {
  16. "use strict";
  17. var _animate = $.fn.animate,
  18. _stop = $.fn.stop,
  19. _enabled = true,
  20. TweenLite, CSSPlugin, _warned,
  21. _copy = function(o) {
  22. var copy = {},
  23. p;
  24. for (p in o) {
  25. copy[p] = o[p];
  26. }
  27. return copy;
  28. },
  29. _reserved = {overwrite:1, delay:1, useFrames:1, runBackwards:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, autoCSS:1},
  30. _defaultLegacyProps = ",scrollTop,scrollLeft,show,hide,toggle,",
  31. _legacyProps = _defaultLegacyProps,
  32. _copyCriticalReserved = function(main, sub) {
  33. for (var p in _reserved) {
  34. if (_reserved[p] && main[p] !== undefined) {
  35. sub[p] = main[p];
  36. }
  37. }
  38. },
  39. _createEase = function(ease) {
  40. return function(p) {
  41. return ease.getRatio(p);
  42. };
  43. },
  44. _easeMap = {},
  45. _init = function() {
  46. var globals = window.GreenSockGlobals || window,
  47. p;
  48. TweenLite = globals.TweenMax || globals.TweenLite; //we prioritize TweenMax if it's loaded so that we can accommodate special features like repeat, yoyo, repeatDelay, etc.
  49. if (TweenLite) {
  50. globals = globals.com.greensock;
  51. CSSPlugin = globals.plugins.CSSPlugin;
  52. _easeMap = globals.easing.Ease.map || {}; //don't do just window.Ease or window.CSSPlugin because some other libraries like EaselJS/TweenJS use those same names and there could be a collision.
  53. }
  54. if (!TweenLite || !CSSPlugin) {
  55. TweenLite = null;
  56. if (!_warned && window.console) {
  57. window.console.log("The jquery.gsap.js plugin requires the TweenMax (or at least TweenLite and CSSPlugin) JavaScript file(s).");
  58. _warned = true;
  59. }
  60. return;
  61. }
  62. if ($.easing) {
  63. for (p in _easeMap) {
  64. $.easing[p] = _createEase(_easeMap[p]);
  65. }
  66. _init = false;
  67. }
  68. };
  69. $.fn.animate = function(prop, speed, easing, callback) {
  70. prop = prop || {};
  71. if (_init) {
  72. _init();
  73. if (!TweenLite || !CSSPlugin) {
  74. return _animate.call(this, prop, speed, easing, callback);
  75. }
  76. }
  77. if (!_enabled || prop.skipGSAP === true || (typeof(speed) === "object" && typeof(speed.step) === "function")) { //we don't support the "step" feature because it's too costly performance-wise, so fall back to the native animate() call if we sense one. Same with scrollTop and scrollLeft which are handled in a special way in jQuery.
  78. return _animate.call(this, prop, speed, easing, callback);
  79. }
  80. var config = $.speed(speed, easing, callback),
  81. vars = {ease:(_easeMap[config.easing] || ((config.easing === false) ? _easeMap.linear : _easeMap.swing))},
  82. obj = this,
  83. specEasing = (typeof(speed) === "object") ? speed.specialEasing : null,
  84. val, p, doAnimation, specEasingVars;
  85. for (p in prop) {
  86. val = prop[p];
  87. if (val instanceof Array && _easeMap[val[1]]) {
  88. specEasing = specEasing || {};
  89. specEasing[p] = val[1];
  90. val = val[0];
  91. }
  92. if (val === "show" || val === "hide" || val === "toggle" || (_legacyProps.indexOf(p) !== -1 && _legacyProps.indexOf("," + p + ",") !== -1)) { //note: slideUp() and slideDown() pass in opacity:"show" or opacity:"hide"
  93. return _animate.call(this, prop, speed, easing, callback);
  94. } else {
  95. vars[(p.indexOf("-") === -1) ? p : $.camelCase(p)] = val;
  96. }
  97. }
  98. if (specEasing) {
  99. vars = _copy(vars);
  100. specEasingVars = [];
  101. for (p in specEasing) {
  102. val = specEasingVars[specEasingVars.length] = {};
  103. _copyCriticalReserved(vars, val);
  104. val.ease = (_easeMap[specEasing[p]] || vars.ease);
  105. if (p.indexOf("-") !== -1) {
  106. p = $.camelCase(p);
  107. }
  108. val[p] = vars[p];
  109. delete vars[p];
  110. }
  111. if (specEasingVars.length === 0) {
  112. specEasingVars = null;
  113. }
  114. }
  115. doAnimation = function(next) {
  116. var varsCopy = _copy(vars),
  117. i;
  118. if (specEasingVars) {
  119. i = specEasingVars.length;
  120. while (--i > -1) {
  121. TweenLite.to(this, $.fx.off ? 0 : config.duration / 1000, specEasingVars[i]);
  122. }
  123. }
  124. varsCopy.onComplete = function() {
  125. if (next) {
  126. next();
  127. } else if (config.old) {
  128. $(this).each(config.old);
  129. }
  130. };
  131. TweenLite.to(this, $.fx.off ? 0 : config.duration / 1000, varsCopy);
  132. };
  133. if (config.queue !== false) {
  134. obj.queue(config.queue, doAnimation); //note: the queued function will get called once for each element in the jQuery collection.
  135. if (typeof(config.old) === "function") {
  136. $(obj[obj.length-1]).queue(config.queue, function(next) {
  137. config.old.call(obj);
  138. next();
  139. });
  140. }
  141. } else {
  142. doAnimation.call(obj);
  143. }
  144. return obj;
  145. };
  146. $.fn.stop = function(clearQueue, gotoEnd) {
  147. _stop.call(this, clearQueue, gotoEnd);
  148. if (TweenLite) {
  149. if (gotoEnd) {
  150. var tweens = TweenLite.getTweensOf(this),
  151. i = tweens.length,
  152. progress;
  153. while (--i > -1) {
  154. progress = tweens[i].totalTime() / tweens[i].totalDuration();
  155. if (progress > 0 && progress < 1) {
  156. tweens[i].seek(tweens[i].totalDuration());
  157. }
  158. }
  159. }
  160. TweenLite.killTweensOf(this);
  161. }
  162. return this;
  163. };
  164. $.gsap = {
  165. enabled:function(value) {
  166. _enabled = value;
  167. },
  168. version:"0.1.13",
  169. legacyProps:function(value) {
  170. _legacyProps = _defaultLegacyProps + value + ",";
  171. }
  172. };
  173. }(jQuery));