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.

324 lines
10 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * VERSION: 0.2.2
  3. * DATE: 2018-02-15
  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 _numExp = /(\d|\.)+/g,
  17. _ColorFilter, _ColorMatrixFilter,
  18. _colorProps = ["redMultiplier","greenMultiplier","blueMultiplier","alphaMultiplier","redOffset","greenOffset","blueOffset","alphaOffset"],
  19. _colorLookup = {aqua:[0,255,255],
  20. lime:[0,255,0],
  21. silver:[192,192,192],
  22. black:[0,0,0],
  23. maroon:[128,0,0],
  24. teal:[0,128,128],
  25. blue:[0,0,255],
  26. navy:[0,0,128],
  27. white:[255,255,255],
  28. fuchsia:[255,0,255],
  29. olive:[128,128,0],
  30. yellow:[255,255,0],
  31. orange:[255,165,0],
  32. gray:[128,128,128],
  33. purple:[128,0,128],
  34. green:[0,128,0],
  35. red:[255,0,0],
  36. pink:[255,192,203],
  37. cyan:[0,255,255],
  38. transparent:[255,255,255,0]},
  39. _parseColor = function(color) {
  40. if (color === "" || color == null || color === "none") {
  41. return _colorLookup.transparent;
  42. } else if (_colorLookup[color]) {
  43. return _colorLookup[color];
  44. } else if (typeof(color) === "number") {
  45. return [color >> 16, (color >> 8) & 255, color & 255];
  46. } else if (color.charAt(0) === "#") {
  47. if (color.length === 4) { //for shorthand like #9F0
  48. color = "#" + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2) + color.charAt(3) + color.charAt(3);
  49. }
  50. color = parseInt(color.substr(1), 16);
  51. return [color >> 16, (color >> 8) & 255, color & 255];
  52. }
  53. return color.match(_numExp) || _colorLookup.transparent;
  54. },
  55. _parseColorFilter = function(t, v, pg) {
  56. if (!_ColorFilter) {
  57. _ColorFilter = (_gsScope.ColorFilter || _gsScope.createjs.ColorFilter);
  58. if (!_ColorFilter) {
  59. throw("EaselPlugin error: The EaselJS ColorFilter JavaScript file wasn't loaded.");
  60. }
  61. }
  62. var filters = t.filters || [],
  63. i = filters.length,
  64. c, s, e, a, p;
  65. while (--i > -1) {
  66. if (filters[i] instanceof _ColorFilter) {
  67. s = filters[i];
  68. break;
  69. }
  70. }
  71. if (!s) {
  72. s = new _ColorFilter();
  73. filters.push(s);
  74. t.filters = filters;
  75. }
  76. e = s.clone();
  77. if (v.tint != null) {
  78. c = _parseColor(v.tint);
  79. a = (v.tintAmount != null) ? Number(v.tintAmount) : 1;
  80. e.redOffset = Number(c[0]) * a;
  81. e.greenOffset = Number(c[1]) * a;
  82. e.blueOffset = Number(c[2]) * a;
  83. e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1 - a;
  84. } else {
  85. for (p in v) {
  86. if (p !== "exposure") if (p !== "brightness") {
  87. e[p] = Number(v[p]);
  88. }
  89. }
  90. }
  91. if (v.exposure != null) {
  92. e.redOffset = e.greenOffset = e.blueOffset = 255 * (Number(v.exposure) - 1);
  93. e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1;
  94. } else if (v.brightness != null) {
  95. a = Number(v.brightness) - 1;
  96. e.redOffset = e.greenOffset = e.blueOffset = (a > 0) ? a * 255 : 0;
  97. e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1 - Math.abs(a);
  98. }
  99. i = 8;
  100. while (--i > -1) {
  101. p = _colorProps[i];
  102. if (s[p] !== e[p]) {
  103. pg._addTween(s, p, s[p], e[p], "easel_colorFilter");
  104. }
  105. }
  106. pg._overwriteProps.push("easel_colorFilter");
  107. if (!t.cacheID) {
  108. throw("EaselPlugin warning: for filters to display in EaselJS, you must call the object's cache() method first. " + t);
  109. }
  110. },
  111. _idMatrix = [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],
  112. _lumR = 0.212671,
  113. _lumG = 0.715160,
  114. _lumB = 0.072169,
  115. _applyMatrix = function(m, m2) {
  116. if (!(m instanceof Array) || !(m2 instanceof Array)) {
  117. return m2;
  118. }
  119. var temp = [],
  120. i = 0,
  121. z = 0,
  122. y, x;
  123. for (y = 0; y < 4; y++) {
  124. for (x = 0; x < 5; x++) {
  125. z = (x === 4) ? m[i + 4] : 0;
  126. temp[i + x] = m[i] * m2[x] + m[i+1] * m2[x + 5] + m[i+2] * m2[x + 10] + m[i+3] * m2[x + 15] + z;
  127. }
  128. i += 5;
  129. }
  130. return temp;
  131. },
  132. _setSaturation = function(m, n) {
  133. if (isNaN(n)) {
  134. return m;
  135. }
  136. var inv = 1 - n,
  137. r = inv * _lumR,
  138. g = inv * _lumG,
  139. b = inv * _lumB;
  140. return _applyMatrix([r + n, g, b, 0, 0, r, g + n, b, 0, 0, r, g, b + n, 0, 0, 0, 0, 0, 1, 0], m);
  141. },
  142. _colorize = function(m, color, amount) {
  143. if (isNaN(amount)) {
  144. amount = 1;
  145. }
  146. var c = _parseColor(color),
  147. r = c[0] / 255,
  148. g = c[1] / 255,
  149. b = c[2] / 255,
  150. inv = 1 - amount;
  151. return _applyMatrix([inv + amount * r * _lumR, amount * r * _lumG, amount * r * _lumB, 0, 0, amount * g * _lumR, inv + amount * g * _lumG, amount * g * _lumB, 0, 0, amount * b * _lumR, amount * b * _lumG, inv + amount * b * _lumB, 0, 0, 0, 0, 0, 1, 0], m);
  152. },
  153. _setHue = function(m, n) {
  154. if (isNaN(n)) {
  155. return m;
  156. }
  157. n *= Math.PI / 180;
  158. var c = Math.cos(n),
  159. s = Math.sin(n);
  160. return _applyMatrix([(_lumR + (c * (1 - _lumR))) + (s * (-_lumR)), (_lumG + (c * (-_lumG))) + (s * (-_lumG)), (_lumB + (c * (-_lumB))) + (s * (1 - _lumB)), 0, 0, (_lumR + (c * (-_lumR))) + (s * 0.143), (_lumG + (c * (1 - _lumG))) + (s * 0.14), (_lumB + (c * (-_lumB))) + (s * -0.283), 0, 0, (_lumR + (c * (-_lumR))) + (s * (-(1 - _lumR))), (_lumG + (c * (-_lumG))) + (s * _lumG), (_lumB + (c * (1 - _lumB))) + (s * _lumB), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], m);
  161. },
  162. _setContrast = function(m, n) {
  163. if (isNaN(n)) {
  164. return m;
  165. }
  166. n += 0.01;
  167. return _applyMatrix([n,0,0,0,128 * (1 - n), 0,n,0,0,128 * (1 - n), 0,0,n,0,128 * (1 - n), 0,0,0,1,0], m);
  168. },
  169. _parseColorMatrixFilter = function(t, v, pg) {
  170. if (!_ColorMatrixFilter) {
  171. _ColorMatrixFilter = (_gsScope.ColorMatrixFilter || _gsScope.createjs.ColorMatrixFilter);
  172. if (!_ColorMatrixFilter) {
  173. throw("EaselPlugin error: The EaselJS ColorMatrixFilter JavaScript file wasn't loaded.");
  174. }
  175. }
  176. var filters = t.filters || [],
  177. i = filters.length,
  178. matrix, startMatrix, s;
  179. while (--i > -1) {
  180. if (filters[i] instanceof _ColorMatrixFilter) {
  181. s = filters[i];
  182. break;
  183. }
  184. }
  185. if (!s) {
  186. s = new _ColorMatrixFilter(_idMatrix.slice());
  187. filters.push(s);
  188. t.filters = filters;
  189. }
  190. startMatrix = s.matrix;
  191. matrix = _idMatrix.slice();
  192. if (v.colorize != null) {
  193. matrix = _colorize(matrix, v.colorize, Number(v.colorizeAmount));
  194. }
  195. if (v.contrast != null) {
  196. matrix = _setContrast(matrix, Number(v.contrast));
  197. }
  198. if (v.hue != null) {
  199. matrix = _setHue(matrix, Number(v.hue));
  200. }
  201. if (v.saturation != null) {
  202. matrix = _setSaturation(matrix, Number(v.saturation));
  203. }
  204. i = matrix.length;
  205. while (--i > -1) {
  206. if (matrix[i] !== startMatrix[i]) {
  207. pg._addTween(startMatrix, i, startMatrix[i], matrix[i], "easel_colorMatrixFilter");
  208. }
  209. }
  210. pg._overwriteProps.push("easel_colorMatrixFilter");
  211. if (!t.cacheID) {
  212. throw("EaselPlugin warning: for filters to display in EaselJS, you must call the object's cache() method first. " + t);
  213. }
  214. pg._matrix = startMatrix;
  215. };
  216. var EaselPlugin = _gsScope._gsDefine.plugin({
  217. propName: "easel",
  218. priority: -1,
  219. version: "0.2.2",
  220. API: 2,
  221. //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
  222. init: function(target, value, tween, index) {
  223. this._target = target;
  224. var p, pt, tint, colorMatrix, end, labels, i;
  225. for (p in value) {
  226. end = value[p];
  227. if (typeof(end) === "function") {
  228. end = end(index, target);
  229. }
  230. if (p === "colorFilter" || p === "tint" || p === "tintAmount" || p === "exposure" || p === "brightness") {
  231. if (!tint) {
  232. _parseColorFilter(target, value.colorFilter || value, this);
  233. tint = true;
  234. }
  235. } else if (p === "saturation" || p === "contrast" || p === "hue" || p === "colorize" || p === "colorizeAmount") {
  236. if (!colorMatrix) {
  237. _parseColorMatrixFilter(target, value.colorMatrixFilter || value, this);
  238. colorMatrix = true;
  239. }
  240. } else if (p === "frame") {
  241. this._firstPT = pt = {_next:this._firstPT, t:target, p:"gotoAndStop", s:target.currentFrame, f:true, n:"frame", pr:0, type:0, m:Math.round};
  242. if (typeof(end) === "string" && end.charAt(1) !== "=" && (labels = target.labels)) {
  243. for (i = 0; i < labels.length; i++) {
  244. if (labels[i].label === end) {
  245. end = labels[i].position;
  246. }
  247. }
  248. }
  249. pt.c = (typeof(end) === "number") ? end - pt.s : parseFloat((end+"").split("=").join(""));
  250. if (pt._next) {
  251. pt._next._prev = pt;
  252. }
  253. } else if (target[p] != null) {
  254. this._firstPT = pt = {_next:this._firstPT, t:target, p:p, f:(typeof(target[p]) === "function"), n:p, pr:0, type:0};
  255. pt.s = (!pt.f) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]();
  256. pt.c = (typeof(end) === "number") ? end - pt.s : (typeof(end) === "string") ? parseFloat(end.split("=").join("")) : 0;
  257. if (pt._next) {
  258. pt._next._prev = pt;
  259. }
  260. }
  261. }
  262. return true;
  263. },
  264. //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
  265. set: function(v) {
  266. var pt = this._firstPT,
  267. min = 0.000001,
  268. val;
  269. while (pt) {
  270. val = pt.c * v + pt.s;
  271. if (pt.m) {
  272. val = pt.m(val, pt.t);
  273. } else if (val < min && val > -min) {
  274. val = 0;
  275. }
  276. if (pt.f) {
  277. pt.t[pt.p](val);
  278. } else {
  279. pt.t[pt.p] = val;
  280. }
  281. pt = pt._next;
  282. }
  283. if (this._target.cacheID) {
  284. this._target.updateCache();
  285. }
  286. }
  287. });
  288. }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
  289. //export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date)
  290. (function(name) {
  291. "use strict";
  292. var getGlobal = function() {
  293. return (_gsScope.GreenSockGlobals || _gsScope)[name];
  294. };
  295. if (typeof(module) !== "undefined" && module.exports) { //node
  296. require("../TweenLite.js");
  297. module.exports = getGlobal();
  298. } else if (typeof(define) === "function" && define.amd) { //AMD
  299. define(["TweenLite"], getGlobal);
  300. }
  301. }("EaselPlugin"));