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.

344 lines
14 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. /**
  16. * @class Ext.EventManager
  17. */
  18. Ext.apply(Ext.EventManager, function(){
  19. var resizeEvent,
  20. resizeTask,
  21. textEvent,
  22. textSize,
  23. D = Ext.lib.Dom,
  24. propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,
  25. curWidth = 0,
  26. curHeight = 0,
  27. // note 1: IE fires ONLY the keydown event on specialkey autorepeat
  28. // note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on specialkey autorepeat
  29. // (research done by @Jan Wolter at http://unixpapa.com/js/key.html)
  30. useKeydown = Ext.isWebKit ?
  31. Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1]) >= 525 :
  32. !((Ext.isGecko && !Ext.isWindows) || Ext.isOpera);
  33. return {
  34. // private
  35. doResizeEvent: function(){
  36. var h = D.getViewHeight(),
  37. w = D.getViewWidth();
  38. //whacky problem in IE where the resize event will fire even though the w/h are the same.
  39. if(curHeight != h || curWidth != w){
  40. resizeEvent.fire(curWidth = w, curHeight = h);
  41. }
  42. },
  43. <div id="method-Ext.EventManager-onWindowResize"></div>/**
  44. * Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 milliseconds),
  45. * passes new viewport width and height to handlers.
  46. * @param {Function} fn The handler function the window resize event invokes.
  47. * @param {Object} scope The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window.
  48. * @param {boolean} options Options object as passed to {@link Ext.Element#addListener}
  49. */
  50. onWindowResize : function(fn, scope, options){
  51. if(!resizeEvent){
  52. resizeEvent = new Ext.util.Event();
  53. resizeTask = new Ext.util.DelayedTask(this.doResizeEvent);
  54. Ext.EventManager.on(window, "resize", this.fireWindowResize, this);
  55. }
  56. resizeEvent.addListener(fn, scope, options);
  57. },
  58. // exposed only to allow manual firing
  59. fireWindowResize : function(){
  60. if(resizeEvent){
  61. resizeTask.delay(100);
  62. }
  63. },
  64. <div id="method-Ext.EventManager-onTextResize"></div>/**
  65. * Adds a listener to be notified when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.
  66. * @param {Function} fn The function the event invokes.
  67. * @param {Object} scope The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window.
  68. * @param {boolean} options Options object as passed to {@link Ext.Element#addListener}
  69. */
  70. onTextResize : function(fn, scope, options){
  71. if(!textEvent){
  72. textEvent = new Ext.util.Event();
  73. var textEl = new Ext.Element(document.createElement('div'));
  74. textEl.dom.className = 'x-text-resize';
  75. textEl.dom.innerHTML = 'X';
  76. textEl.appendTo(document.body);
  77. textSize = textEl.dom.offsetHeight;
  78. setInterval(function(){
  79. if(textEl.dom.offsetHeight != textSize){
  80. textEvent.fire(textSize, textSize = textEl.dom.offsetHeight);
  81. }
  82. }, this.textResizeInterval);
  83. }
  84. textEvent.addListener(fn, scope, options);
  85. },
  86. <div id="method-Ext.EventManager-removeResizeListener"></div>/**
  87. * Removes the passed window resize listener.
  88. * @param {Function} fn The method the event invokes
  89. * @param {Object} scope The scope of handler
  90. */
  91. removeResizeListener : function(fn, scope){
  92. if(resizeEvent){
  93. resizeEvent.removeListener(fn, scope);
  94. }
  95. },
  96. // private
  97. fireResize : function(){
  98. if(resizeEvent){
  99. resizeEvent.fire(D.getViewWidth(), D.getViewHeight());
  100. }
  101. },
  102. <div id="prop-Ext.EventManager-textResizeInterval"></div>/**
  103. * The frequency, in milliseconds, to check for text resize events (defaults to 50)
  104. */
  105. textResizeInterval : 50,
  106. <div id="prop-Ext.EventManager-ieDeferSrc"></div>/**
  107. * Url used for onDocumentReady with using SSL (defaults to Ext.SSL_SECURE_URL)
  108. */
  109. ieDeferSrc : false,
  110. // protected, short accessor for useKeydown
  111. getKeyEvent : function(){
  112. return useKeydown ? 'keydown' : 'keypress';
  113. },
  114. // protected for use inside the framework
  115. // detects whether we should use keydown or keypress based on the browser.
  116. useKeydown: useKeydown
  117. };
  118. }());
  119. Ext.EventManager.on = Ext.EventManager.addListener;
  120. Ext.apply(Ext.EventObjectImpl.prototype, {
  121. <div id="prop-Ext.EventManager-BACKSPACE"></div>/** Key constant @type Number */
  122. BACKSPACE: 8,
  123. <div id="prop-Ext.EventManager-TAB"></div>/** Key constant @type Number */
  124. TAB: 9,
  125. <div id="prop-Ext.EventManager-NUM_CENTER"></div>/** Key constant @type Number */
  126. NUM_CENTER: 12,
  127. <div id="prop-Ext.EventManager-ENTER"></div>/** Key constant @type Number */
  128. ENTER: 13,
  129. <div id="prop-Ext.EventManager-RETURN"></div>/** Key constant @type Number */
  130. RETURN: 13,
  131. <div id="prop-Ext.EventManager-SHIFT"></div>/** Key constant @type Number */
  132. SHIFT: 16,
  133. <div id="prop-Ext.EventManager-CTRL"></div>/** Key constant @type Number */
  134. CTRL: 17,
  135. CONTROL : 17, // legacy
  136. <div id="prop-Ext.EventManager-ALT"></div>/** Key constant @type Number */
  137. ALT: 18,
  138. <div id="prop-Ext.EventManager-PAUSE"></div>/** Key constant @type Number */
  139. PAUSE: 19,
  140. <div id="prop-Ext.EventManager-CAPS_LOCK"></div>/** Key constant @type Number */
  141. CAPS_LOCK: 20,
  142. <div id="prop-Ext.EventManager-ESC"></div>/** Key constant @type Number */
  143. ESC: 27,
  144. <div id="prop-Ext.EventManager-SPACE"></div>/** Key constant @type Number */
  145. SPACE: 32,
  146. <div id="prop-Ext.EventManager-PAGE_UP"></div>/** Key constant @type Number */
  147. PAGE_UP: 33,
  148. PAGEUP : 33, // legacy
  149. <div id="prop-Ext.EventManager-PAGE_DOWN"></div>/** Key constant @type Number */
  150. PAGE_DOWN: 34,
  151. PAGEDOWN : 34, // legacy
  152. <div id="prop-Ext.EventManager-END"></div>/** Key constant @type Number */
  153. END: 35,
  154. <div id="prop-Ext.EventManager-HOME"></div>/** Key constant @type Number */
  155. HOME: 36,
  156. <div id="prop-Ext.EventManager-LEFT"></div>/** Key constant @type Number */
  157. LEFT: 37,
  158. <div id="prop-Ext.EventManager-UP"></div>/** Key constant @type Number */
  159. UP: 38,
  160. <div id="prop-Ext.EventManager-RIGHT"></div>/** Key constant @type Number */
  161. RIGHT: 39,
  162. <div id="prop-Ext.EventManager-DOWN"></div>/** Key constant @type Number */
  163. DOWN: 40,
  164. <div id="prop-Ext.EventManager-PRINT_SCREEN"></div>/** Key constant @type Number */
  165. PRINT_SCREEN: 44,
  166. <div id="prop-Ext.EventManager-INSERT"></div>/** Key constant @type Number */
  167. INSERT: 45,
  168. <div id="prop-Ext.EventManager-DELETE"></div>/** Key constant @type Number */
  169. DELETE: 46,
  170. <div id="prop-Ext.EventManager-ZERO"></div>/** Key constant @type Number */
  171. ZERO: 48,
  172. <div id="prop-Ext.EventManager-ONE"></div>/** Key constant @type Number */
  173. ONE: 49,
  174. <div id="prop-Ext.EventManager-TWO"></div>/** Key constant @type Number */
  175. TWO: 50,
  176. <div id="prop-Ext.EventManager-THREE"></div>/** Key constant @type Number */
  177. THREE: 51,
  178. <div id="prop-Ext.EventManager-FOUR"></div>/** Key constant @type Number */
  179. FOUR: 52,
  180. <div id="prop-Ext.EventManager-FIVE"></div>/** Key constant @type Number */
  181. FIVE: 53,
  182. <div id="prop-Ext.EventManager-SIX"></div>/** Key constant @type Number */
  183. SIX: 54,
  184. <div id="prop-Ext.EventManager-SEVEN"></div>/** Key constant @type Number */
  185. SEVEN: 55,
  186. <div id="prop-Ext.EventManager-EIGHT"></div>/** Key constant @type Number */
  187. EIGHT: 56,
  188. <div id="prop-Ext.EventManager-NINE"></div>/** Key constant @type Number */
  189. NINE: 57,
  190. <div id="prop-Ext.EventManager-A"></div>/** Key constant @type Number */
  191. A: 65,
  192. <div id="prop-Ext.EventManager-B"></div>/** Key constant @type Number */
  193. B: 66,
  194. <div id="prop-Ext.EventManager-C"></div>/** Key constant @type Number */
  195. C: 67,
  196. <div id="prop-Ext.EventManager-D"></div>/** Key constant @type Number */
  197. D: 68,
  198. <div id="prop-Ext.EventManager-E"></div>/** Key constant @type Number */
  199. E: 69,
  200. <div id="prop-Ext.EventManager-F"></div>/** Key constant @type Number */
  201. F: 70,
  202. <div id="prop-Ext.EventManager-G"></div>/** Key constant @type Number */
  203. G: 71,
  204. <div id="prop-Ext.EventManager-H"></div>/** Key constant @type Number */
  205. H: 72,
  206. <div id="prop-Ext.EventManager-I"></div>/** Key constant @type Number */
  207. I: 73,
  208. <div id="prop-Ext.EventManager-J"></div>/** Key constant @type Number */
  209. J: 74,
  210. <div id="prop-Ext.EventManager-K"></div>/** Key constant @type Number */
  211. K: 75,
  212. <div id="prop-Ext.EventManager-L"></div>/** Key constant @type Number */
  213. L: 76,
  214. <div id="prop-Ext.EventManager-M"></div>/** Key constant @type Number */
  215. M: 77,
  216. <div id="prop-Ext.EventManager-N"></div>/** Key constant @type Number */
  217. N: 78,
  218. <div id="prop-Ext.EventManager-O"></div>/** Key constant @type Number */
  219. O: 79,
  220. <div id="prop-Ext.EventManager-P"></div>/** Key constant @type Number */
  221. P: 80,
  222. <div id="prop-Ext.EventManager-Q"></div>/** Key constant @type Number */
  223. Q: 81,
  224. <div id="prop-Ext.EventManager-R"></div>/** Key constant @type Number */
  225. R: 82,
  226. <div id="prop-Ext.EventManager-S"></div>/** Key constant @type Number */
  227. S: 83,
  228. <div id="prop-Ext.EventManager-T"></div>/** Key constant @type Number */
  229. T: 84,
  230. <div id="prop-Ext.EventManager-U"></div>/** Key constant @type Number */
  231. U: 85,
  232. <div id="prop-Ext.EventManager-V"></div>/** Key constant @type Number */
  233. V: 86,
  234. <div id="prop-Ext.EventManager-W"></div>/** Key constant @type Number */
  235. W: 87,
  236. <div id="prop-Ext.EventManager-X"></div>/** Key constant @type Number */
  237. X: 88,
  238. <div id="prop-Ext.EventManager-Y"></div>/** Key constant @type Number */
  239. Y: 89,
  240. <div id="prop-Ext.EventManager-Z"></div>/** Key constant @type Number */
  241. Z: 90,
  242. <div id="prop-Ext.EventManager-CONTEXT_MENU"></div>/** Key constant @type Number */
  243. CONTEXT_MENU: 93,
  244. <div id="prop-Ext.EventManager-NUM_ZERO"></div>/** Key constant @type Number */
  245. NUM_ZERO: 96,
  246. <div id="prop-Ext.EventManager-NUM_ONE"></div>/** Key constant @type Number */
  247. NUM_ONE: 97,
  248. <div id="prop-Ext.EventManager-NUM_TWO"></div>/** Key constant @type Number */
  249. NUM_TWO: 98,
  250. <div id="prop-Ext.EventManager-NUM_THREE"></div>/** Key constant @type Number */
  251. NUM_THREE: 99,
  252. <div id="prop-Ext.EventManager-NUM_FOUR"></div>/** Key constant @type Number */
  253. NUM_FOUR: 100,
  254. <div id="prop-Ext.EventManager-NUM_FIVE"></div>/** Key constant @type Number */
  255. NUM_FIVE: 101,
  256. <div id="prop-Ext.EventManager-NUM_SIX"></div>/** Key constant @type Number */
  257. NUM_SIX: 102,
  258. <div id="prop-Ext.EventManager-NUM_SEVEN"></div>/** Key constant @type Number */
  259. NUM_SEVEN: 103,
  260. <div id="prop-Ext.EventManager-NUM_EIGHT"></div>/** Key constant @type Number */
  261. NUM_EIGHT: 104,
  262. <div id="prop-Ext.EventManager-NUM_NINE"></div>/** Key constant @type Number */
  263. NUM_NINE: 105,
  264. <div id="prop-Ext.EventManager-NUM_MULTIPLY"></div>/** Key constant @type Number */
  265. NUM_MULTIPLY: 106,
  266. <div id="prop-Ext.EventManager-NUM_PLUS"></div>/** Key constant @type Number */
  267. NUM_PLUS: 107,
  268. <div id="prop-Ext.EventManager-NUM_MINUS"></div>/** Key constant @type Number */
  269. NUM_MINUS: 109,
  270. <div id="prop-Ext.EventManager-NUM_PERIOD"></div>/** Key constant @type Number */
  271. NUM_PERIOD: 110,
  272. <div id="prop-Ext.EventManager-NUM_DIVISION"></div>/** Key constant @type Number */
  273. NUM_DIVISION: 111,
  274. <div id="prop-Ext.EventManager-F1"></div>/** Key constant @type Number */
  275. F1: 112,
  276. <div id="prop-Ext.EventManager-F2"></div>/** Key constant @type Number */
  277. F2: 113,
  278. <div id="prop-Ext.EventManager-F3"></div>/** Key constant @type Number */
  279. F3: 114,
  280. <div id="prop-Ext.EventManager-F4"></div>/** Key constant @type Number */
  281. F4: 115,
  282. <div id="prop-Ext.EventManager-F5"></div>/** Key constant @type Number */
  283. F5: 116,
  284. <div id="prop-Ext.EventManager-F6"></div>/** Key constant @type Number */
  285. F6: 117,
  286. <div id="prop-Ext.EventManager-F7"></div>/** Key constant @type Number */
  287. F7: 118,
  288. <div id="prop-Ext.EventManager-F8"></div>/** Key constant @type Number */
  289. F8: 119,
  290. <div id="prop-Ext.EventManager-F9"></div>/** Key constant @type Number */
  291. F9: 120,
  292. <div id="prop-Ext.EventManager-F10"></div>/** Key constant @type Number */
  293. F10: 121,
  294. <div id="prop-Ext.EventManager-F11"></div>/** Key constant @type Number */
  295. F11: 122,
  296. <div id="prop-Ext.EventManager-F12"></div>/** Key constant @type Number */
  297. F12: 123,
  298. /** @private */
  299. isNavKeyPress : function(){
  300. var me = this,
  301. k = this.normalizeKey(me.keyCode);
  302. return (k >= 33 && k <= 40) || // Page Up/Down, End, Home, Left, Up, Right, Down
  303. k == me.RETURN ||
  304. k == me.TAB ||
  305. k == me.ESC;
  306. },
  307. isSpecialKey : function(){
  308. var k = this.normalizeKey(this.keyCode);
  309. return (this.type == 'keypress' && this.ctrlKey) ||
  310. this.isNavKeyPress() ||
  311. (k == this.BACKSPACE) || // Backspace
  312. (k >= 16 && k <= 20) || // Shift, Ctrl, Alt, Pause, Caps Lock
  313. (k >= 44 && k <= 46); // Print Screen, Insert, Delete
  314. },
  315. getPoint : function(){
  316. return new Ext.lib.Point(this.xy[0], this.xy[1]);
  317. },
  318. <div id="method-Ext.EventManager-hasModifier"></div>/**
  319. * Returns true if the control, meta, shift or alt key was pressed during this event.
  320. * @return {Boolean}
  321. */
  322. hasModifier : function(){
  323. return ((this.ctrlKey || this.altKey) || this.shiftKey);
  324. }
  325. });</pre>
  326. </body>
  327. </html>