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.

383 lines
11 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. if(typeof YAHOO == "undefined"){
  16. throw "Unable to load Ext, core YUI utilities (yahoo, dom, event) not found.";
  17. }
  18. (function(){
  19. var E = YAHOO.util.Event,
  20. D = YAHOO.util.Dom,
  21. CN = YAHOO.util.Connect,
  22. ES = YAHOO.util.Easing,
  23. A = YAHOO.util.Anim,
  24. libFlyweight,
  25. version = YAHOO.env.getVersion('yahoo').version.split('.'),
  26. mouseEnterSupported = parseInt(version[0], 10) >= 3,
  27. mouseCache = {},
  28. elContains = function(parent, child){
  29. if(parent && parent.firstChild){
  30. while(child){
  31. if(child === parent){
  32. return true;
  33. }
  34. child = child.parentNode;
  35. if(child && (child.nodeType != 1)){
  36. child = null;
  37. }
  38. }
  39. }
  40. return false;
  41. }, checkRelatedTarget = function(e){
  42. return !elContains(e.currentTarget, Ext.lib.Event.getRelatedTarget(e));
  43. };
  44. Ext.lib.Dom = {
  45. getViewWidth : function(full){
  46. return full ? D.getDocumentWidth() : D.getViewportWidth();
  47. },
  48. getViewHeight : function(full){
  49. return full ? D.getDocumentHeight() : D.getViewportHeight();
  50. },
  51. isAncestor : function(haystack, needle){
  52. return D.isAncestor(haystack, needle);
  53. },
  54. getRegion : function(el){
  55. return D.getRegion(el);
  56. },
  57. getY : function(el){
  58. return this.getXY(el)[1];
  59. },
  60. getX : function(el){
  61. return this.getXY(el)[0];
  62. },
  63. // original version based on YahooUI getXY
  64. // this version fixes several issues in Safari and FF
  65. // and boosts performance by removing the batch overhead, repetitive dom lookups and array index calls
  66. getXY : function(el){
  67. var p, pe, b, scroll, bd = (document.body || document.documentElement);
  68. el = Ext.getDom(el);
  69. if(el == bd){
  70. return [0, 0];
  71. }
  72. if (el.getBoundingClientRect) {
  73. b = el.getBoundingClientRect();
  74. scroll = fly(document).getScroll();
  75. return [Math.round(b.left + scroll.left), Math.round(b.top + scroll.top)];
  76. }
  77. var x = 0, y = 0;
  78. p = el;
  79. var hasAbsolute = fly(el).getStyle("position") == "absolute";
  80. while (p) {
  81. x += p.offsetLeft;
  82. y += p.offsetTop;
  83. if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
  84. hasAbsolute = true;
  85. }
  86. if (Ext.isGecko) {
  87. pe = fly(p);
  88. var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
  89. var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
  90. x += bl;
  91. y += bt;
  92. if (p != el && pe.getStyle('overflow') != 'visible') {
  93. x += bl;
  94. y += bt;
  95. }
  96. }
  97. p = p.offsetParent;
  98. }
  99. if (Ext.isSafari && hasAbsolute) {
  100. x -= bd.offsetLeft;
  101. y -= bd.offsetTop;
  102. }
  103. if (Ext.isGecko && !hasAbsolute) {
  104. var dbd = fly(bd);
  105. x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
  106. y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
  107. }
  108. p = el.parentNode;
  109. while (p && p != bd) {
  110. if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {
  111. x -= p.scrollLeft;
  112. y -= p.scrollTop;
  113. }
  114. p = p.parentNode;
  115. }
  116. return [x, y];
  117. },
  118. setXY : function(el, xy){
  119. el = Ext.fly(el, '_setXY');
  120. el.position();
  121. var pts = el.translatePoints(xy);
  122. if(xy[0] !== false){
  123. el.dom.style.left = pts.left + "px";
  124. }
  125. if(xy[1] !== false){
  126. el.dom.style.top = pts.top + "px";
  127. }
  128. },
  129. setX : function(el, x){
  130. this.setXY(el, [x, false]);
  131. },
  132. setY : function(el, y){
  133. this.setXY(el, [false, y]);
  134. }
  135. };
  136. Ext.lib.Event = {
  137. getPageX : function(e){
  138. return E.getPageX(e.browserEvent || e);
  139. },
  140. getPageY : function(e){
  141. return E.getPageY(e.browserEvent || e);
  142. },
  143. getXY : function(e){
  144. return E.getXY(e.browserEvent || e);
  145. },
  146. getTarget : function(e){
  147. return E.getTarget(e.browserEvent || e);
  148. },
  149. getRelatedTarget : function(e){
  150. return E.getRelatedTarget(e.browserEvent || e);
  151. },
  152. on : function(el, eventName, fn, scope, override){
  153. if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){
  154. var item = mouseCache[el.id] || (mouseCache[el.id] = {});
  155. item[eventName] = fn;
  156. fn = fn.createInterceptor(checkRelatedTarget);
  157. eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout';
  158. }
  159. E.on(el, eventName, fn, scope, override);
  160. },
  161. un : function(el, eventName, fn){
  162. if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){
  163. var item = mouseCache[el.id],
  164. ev = item && item[eventName];
  165. if(ev){
  166. fn = ev.fn;
  167. delete item[eventName];
  168. eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout';
  169. }
  170. }
  171. E.removeListener(el, eventName, fn);;
  172. },
  173. purgeElement : function(el){
  174. E.purgeElement(el);
  175. },
  176. preventDefault : function(e){
  177. E.preventDefault(e.browserEvent || e);
  178. },
  179. stopPropagation : function(e){
  180. E.stopPropagation(e.browserEvent || e);
  181. },
  182. stopEvent : function(e){
  183. E.stopEvent(e.browserEvent || e);
  184. },
  185. onAvailable : function(el, fn, scope, override){
  186. return E.onAvailable(el, fn, scope, override);
  187. }
  188. };
  189. Ext.lib.Ajax = {
  190. request : function(method, uri, cb, data, options){
  191. if(options){
  192. var hs = options.headers;
  193. if(hs){
  194. for(var h in hs){
  195. if(hs.hasOwnProperty(h)){
  196. CN.initHeader(h, hs[h], false);
  197. }
  198. }
  199. }
  200. if(options.xmlData){
  201. if (!hs || !hs['Content-Type']){
  202. CN.initHeader('Content-Type', 'text/xml', false);
  203. }
  204. method = (method ? method : (options.method ? options.method : 'POST'));
  205. data = options.xmlData;
  206. }else if(options.jsonData){
  207. if (!hs || !hs['Content-Type']){
  208. CN.initHeader('Content-Type', 'application/json', false);
  209. }
  210. method = (method ? method : (options.method ? options.method : 'POST'));
  211. data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;
  212. }
  213. }
  214. return CN.asyncRequest(method, uri, cb, data);
  215. },
  216. formRequest : function(form, uri, cb, data, isUpload, sslUri){
  217. CN.setForm(form, isUpload, sslUri);
  218. return CN.asyncRequest(Ext.getDom(form).method ||'POST', uri, cb, data);
  219. },
  220. isCallInProgress : function(trans){
  221. return CN.isCallInProgress(trans);
  222. },
  223. abort : function(trans){
  224. return CN.abort(trans);
  225. },
  226. serializeForm : function(form){
  227. var d = CN.setForm(form.dom || form);
  228. CN.resetFormState();
  229. return d;
  230. }
  231. };
  232. Ext.lib.Region = YAHOO.util.Region;
  233. Ext.lib.Point = YAHOO.util.Point;
  234. Ext.lib.Anim = {
  235. scroll : function(el, args, duration, easing, cb, scope){
  236. this.run(el, args, duration, easing, cb, scope, YAHOO.util.Scroll);
  237. },
  238. motion : function(el, args, duration, easing, cb, scope){
  239. this.run(el, args, duration, easing, cb, scope, YAHOO.util.Motion);
  240. },
  241. color : function(el, args, duration, easing, cb, scope){
  242. this.run(el, args, duration, easing, cb, scope, YAHOO.util.ColorAnim);
  243. },
  244. run : function(el, args, duration, easing, cb, scope, type){
  245. type = type || YAHOO.util.Anim;
  246. if(typeof easing == "string"){
  247. easing = YAHOO.util.Easing[easing];
  248. }
  249. var anim = new type(el, args, duration, easing);
  250. anim.animateX(function(){
  251. Ext.callback(cb, scope);
  252. });
  253. return anim;
  254. }
  255. };
  256. // all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights
  257. function fly(el){
  258. if(!libFlyweight){
  259. libFlyweight = new Ext.Element.Flyweight();
  260. }
  261. libFlyweight.dom = el;
  262. return libFlyweight;
  263. }
  264. // prevent IE leaks
  265. if(Ext.isIE) {
  266. function fnCleanUp() {
  267. var p = Function.prototype;
  268. delete p.createSequence;
  269. delete p.defer;
  270. delete p.createDelegate;
  271. delete p.createCallback;
  272. delete p.createInterceptor;
  273. window.detachEvent("onunload", fnCleanUp);
  274. }
  275. window.attachEvent("onunload", fnCleanUp);
  276. }
  277. // various overrides
  278. // add ability for callbacks with animations
  279. if(YAHOO.util.Anim){
  280. YAHOO.util.Anim.prototype.animateX = function(callback, scope){
  281. var f = function(){
  282. this.onComplete.unsubscribe(f);
  283. if(typeof callback == "function"){
  284. callback.call(scope || this, this);
  285. }
  286. };
  287. this.onComplete.subscribe(f, this, true);
  288. this.animate();
  289. };
  290. }
  291. if(YAHOO.util.DragDrop && Ext.dd.DragDrop){
  292. YAHOO.util.DragDrop.defaultPadding = Ext.dd.DragDrop.defaultPadding;
  293. YAHOO.util.DragDrop.constrainTo = Ext.dd.DragDrop.constrainTo;
  294. }
  295. YAHOO.util.Dom.getXY = function(el) {
  296. var f = function(el) {
  297. return Ext.lib.Dom.getXY(el);
  298. };
  299. return YAHOO.util.Dom.batch(el, f, YAHOO.util.Dom, true);
  300. };
  301. // workaround for Safari anim duration speed problems
  302. if(YAHOO.util.AnimMgr){
  303. YAHOO.util.AnimMgr.fps = 1000;
  304. }
  305. YAHOO.util.Region.prototype.adjust = function(t, l, b, r){
  306. this.top += t;
  307. this.left += l;
  308. this.right += r;
  309. this.bottom += b;
  310. return this;
  311. };
  312. YAHOO.util.Region.prototype.constrainTo = function(r) {
  313. this.top = this.top.constrain(r.top, r.bottom);
  314. this.bottom = this.bottom.constrain(r.top, r.bottom);
  315. this.left = this.left.constrain(r.left, r.right);
  316. this.right = this.right.constrain(r.left, r.right);
  317. return this;
  318. };
  319. })();</pre>
  320. </body>
  321. </html>