Web Interface For Lite Argus Control modules
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.

314 lines
9.2 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. // Easing functions
  16. (function(){
  17. // shortcuts to aid compression
  18. var abs = Math.abs,
  19. pi = Math.PI,
  20. asin = Math.asin,
  21. pow = Math.pow,
  22. sin = Math.sin,
  23. EXTLIB = Ext.lib;
  24. Ext.apply(EXTLIB.Easing, {
  25. easeBoth: function (t, b, c, d) {
  26. return ((t /= d / 2) < 1) ? c / 2 * t * t + b : -c / 2 * ((--t) * (t - 2) - 1) + b;
  27. },
  28. easeInStrong: function (t, b, c, d) {
  29. return c * (t /= d) * t * t * t + b;
  30. },
  31. easeOutStrong: function (t, b, c, d) {
  32. return -c * ((t = t / d - 1) * t * t * t - 1) + b;
  33. },
  34. easeBothStrong: function (t, b, c, d) {
  35. return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b;
  36. },
  37. elasticIn: function (t, b, c, d, a, p) {
  38. if (t == 0 || (t /= d) == 1) {
  39. return t == 0 ? b : b + c;
  40. }
  41. p = p || (d * .3);
  42. var s;
  43. if (a >= abs(c)) {
  44. s = p / (2 * pi) * asin(c / a);
  45. } else {
  46. a = c;
  47. s = p / 4;
  48. }
  49. return -(a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b;
  50. },
  51. elasticOut: function (t, b, c, d, a, p) {
  52. if (t == 0 || (t /= d) == 1) {
  53. return t == 0 ? b : b + c;
  54. }
  55. p = p || (d * .3);
  56. var s;
  57. if (a >= abs(c)) {
  58. s = p / (2 * pi) * asin(c / a);
  59. } else {
  60. a = c;
  61. s = p / 4;
  62. }
  63. return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b;
  64. },
  65. elasticBoth: function (t, b, c, d, a, p) {
  66. if (t == 0 || (t /= d / 2) == 2) {
  67. return t == 0 ? b : b + c;
  68. }
  69. p = p || (d * (.3 * 1.5));
  70. var s;
  71. if (a >= abs(c)) {
  72. s = p / (2 * pi) * asin(c / a);
  73. } else {
  74. a = c;
  75. s = p / 4;
  76. }
  77. return t < 1 ?
  78. -.5 * (a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b :
  79. a * pow(2, -10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b;
  80. },
  81. backIn: function (t, b, c, d, s) {
  82. s = s || 1.70158;
  83. return c * (t /= d) * t * ((s + 1) * t - s) + b;
  84. },
  85. backOut: function (t, b, c, d, s) {
  86. if (!s) {
  87. s = 1.70158;
  88. }
  89. return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
  90. },
  91. backBoth: function (t, b, c, d, s) {
  92. s = s || 1.70158;
  93. return ((t /= d / 2 ) < 1) ?
  94. c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b :
  95. c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
  96. },
  97. bounceIn: function (t, b, c, d) {
  98. return c - EXTLIB.Easing.bounceOut(d - t, 0, c, d) + b;
  99. },
  100. bounceOut: function (t, b, c, d) {
  101. if ((t /= d) < (1 / 2.75)) {
  102. return c * (7.5625 * t * t) + b;
  103. } else if (t < (2 / 2.75)) {
  104. return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
  105. } else if (t < (2.5 / 2.75)) {
  106. return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
  107. }
  108. return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
  109. },
  110. bounceBoth: function (t, b, c, d) {
  111. return (t < d / 2) ?
  112. EXTLIB.Easing.bounceIn(t * 2, 0, c, d) * .5 + b :
  113. EXTLIB.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
  114. }
  115. });
  116. })();
  117. (function() {
  118. var EXTLIB = Ext.lib;
  119. // Color Animation
  120. EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) {
  121. return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim);
  122. };
  123. EXTLIB.ColorAnim = function(el, attributes, duration, method) {
  124. EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
  125. };
  126. Ext.extend(EXTLIB.ColorAnim, EXTLIB.AnimBase);
  127. var superclass = EXTLIB.ColorAnim.superclass,
  128. colorRE = /color$/i,
  129. transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/,
  130. rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
  131. hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
  132. hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,
  133. isset = function(v){
  134. return typeof v !== 'undefined';
  135. };
  136. // private
  137. function parseColor(s) {
  138. var pi = parseInt,
  139. base,
  140. out = null,
  141. c;
  142. if (s.length == 3) {
  143. return s;
  144. }
  145. Ext.each([hexRE, rgbRE, hex3RE], function(re, idx){
  146. base = (idx % 2 == 0) ? 16 : 10;
  147. c = re.exec(s);
  148. if(c && c.length == 4){
  149. out = [pi(c[1], base), pi(c[2], base), pi(c[3], base)];
  150. return false;
  151. }
  152. });
  153. return out;
  154. }
  155. Ext.apply(EXTLIB.ColorAnim.prototype, {
  156. getAttr : function(attr) {
  157. var me = this,
  158. el = me.el,
  159. val;
  160. if(colorRE.test(attr)){
  161. while(el && transparentRE.test(val = Ext.fly(el).getStyle(attr))){
  162. el = el.parentNode;
  163. val = "fff";
  164. }
  165. }else{
  166. val = superclass.getAttr.call(me, attr);
  167. }
  168. return val;
  169. },
  170. doMethod : function(attr, start, end) {
  171. var me = this,
  172. val,
  173. floor = Math.floor,
  174. i,
  175. len,
  176. v;
  177. if(colorRE.test(attr)){
  178. val = [];
  179. end = end || [];
  180. for(i = 0, len = start.length; i < len; i++) {
  181. v = start[i];
  182. val[i] = superclass.doMethod.call(me, attr, v, end[i]);
  183. }
  184. val = 'rgb(' + floor(val[0]) + ',' + floor(val[1]) + ',' + floor(val[2]) + ')';
  185. }else{
  186. val = superclass.doMethod.call(me, attr, start, end);
  187. }
  188. return val;
  189. },
  190. setRunAttr : function(attr) {
  191. var me = this,
  192. a = me.attributes[attr],
  193. to = a.to,
  194. by = a.by,
  195. ra;
  196. superclass.setRunAttr.call(me, attr);
  197. ra = me.runAttrs[attr];
  198. if(colorRE.test(attr)){
  199. var start = parseColor(ra.start),
  200. end = parseColor(ra.end);
  201. if(!isset(to) && isset(by)){
  202. end = parseColor(by);
  203. for(var i=0,len=start.length; i<len; i++) {
  204. end[i] = start[i] + end[i];
  205. }
  206. }
  207. ra.start = start;
  208. ra.end = end;
  209. }
  210. }
  211. });
  212. })();
  213. (function() {
  214. // Scroll Animation
  215. var EXTLIB = Ext.lib;
  216. EXTLIB.Anim.scroll = function(el, args, duration, easing, cb, scope) {
  217. return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.Scroll);
  218. };
  219. EXTLIB.Scroll = function(el, attributes, duration, method) {
  220. if(el){
  221. EXTLIB.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
  222. }
  223. };
  224. Ext.extend(EXTLIB.Scroll, EXTLIB.ColorAnim);
  225. var superclass = EXTLIB.Scroll.superclass,
  226. SCROLL = 'scroll';
  227. Ext.apply(EXTLIB.Scroll.prototype, {
  228. doMethod : function(attr, start, end) {
  229. var val,
  230. me = this,
  231. curFrame = me.curFrame,
  232. totalFrames = me.totalFrames;
  233. if(attr == SCROLL){
  234. val = [me.method(curFrame, start[0], end[0] - start[0], totalFrames),
  235. me.method(curFrame, start[1], end[1] - start[1], totalFrames)];
  236. }else{
  237. val = superclass.doMethod.call(me, attr, start, end);
  238. }
  239. return val;
  240. },
  241. getAttr : function(attr) {
  242. var me = this;
  243. if (attr == SCROLL) {
  244. return [me.el.scrollLeft, me.el.scrollTop];
  245. }else{
  246. return superclass.getAttr.call(me, attr);
  247. }
  248. },
  249. setAttr : function(attr, val, unit) {
  250. var me = this;
  251. if(attr == SCROLL){
  252. me.el.scrollLeft = val[0];
  253. me.el.scrollTop = val[1];
  254. }else{
  255. superclass.setAttr.call(me, attr, val, unit);
  256. }
  257. }
  258. });
  259. })();</pre>
  260. </body>
  261. </html>