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.

588 lines
17 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 jQuery == "undefined"){
  16. throw "Unable to load Ext, jQuery not found.";
  17. }
  18. (function(){
  19. var libFlyweight;
  20. Ext.lib.Dom = {
  21. getViewWidth : function(full){
  22. // jQuery doesn't report full window size on document query, so max both
  23. return full ? Math.max(jQuery(document).width(),jQuery(window).width()) : jQuery(window).width();
  24. },
  25. getViewHeight : function(full){
  26. // jQuery doesn't report full window size on document query, so max both
  27. return full ? Math.max(jQuery(document).height(),jQuery(window).height()) : jQuery(window).height();
  28. },
  29. isAncestor : function(p, c){
  30. var ret = false;
  31. p = Ext.getDom(p);
  32. c = Ext.getDom(c);
  33. if (p && c) {
  34. if (p.contains) {
  35. return p.contains(c);
  36. } else if (p.compareDocumentPosition) {
  37. return !!(p.compareDocumentPosition(c) & 16);
  38. } else {
  39. while (c = c.parentNode) {
  40. ret = c == p || ret;
  41. }
  42. }
  43. }
  44. return ret;
  45. },
  46. getRegion : function(el){
  47. return Ext.lib.Region.getRegion(el);
  48. },
  49. //////////////////////////////////////////////////////////////////////////////////////
  50. // Use of jQuery.offset() removed to promote consistent behavior across libs.
  51. // JVS 05/23/07
  52. //////////////////////////////////////////////////////////////////////////////////////
  53. getY : function(el){
  54. return this.getXY(el)[1];
  55. },
  56. getX : function(el){
  57. return this.getXY(el)[0];
  58. },
  59. getXY : function(el) {
  60. var p, pe, b, scroll, bd = (document.body || document.documentElement);
  61. el = Ext.getDom(el);
  62. if(el == bd){
  63. return [0, 0];
  64. }
  65. if (el.getBoundingClientRect) {
  66. b = el.getBoundingClientRect();
  67. scroll = fly(document).getScroll();
  68. return [Math.round(b.left + scroll.left), Math.round(b.top + scroll.top)];
  69. }
  70. var x = 0, y = 0;
  71. p = el;
  72. var hasAbsolute = fly(el).getStyle("position") == "absolute";
  73. while (p) {
  74. x += p.offsetLeft;
  75. y += p.offsetTop;
  76. if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
  77. hasAbsolute = true;
  78. }
  79. if (Ext.isGecko) {
  80. pe = fly(p);
  81. var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
  82. var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
  83. x += bl;
  84. y += bt;
  85. if (p != el && pe.getStyle('overflow') != 'visible') {
  86. x += bl;
  87. y += bt;
  88. }
  89. }
  90. p = p.offsetParent;
  91. }
  92. if (Ext.isSafari && hasAbsolute) {
  93. x -= bd.offsetLeft;
  94. y -= bd.offsetTop;
  95. }
  96. if (Ext.isGecko && !hasAbsolute) {
  97. var dbd = fly(bd);
  98. x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
  99. y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
  100. }
  101. p = el.parentNode;
  102. while (p && p != bd) {
  103. if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {
  104. x -= p.scrollLeft;
  105. y -= p.scrollTop;
  106. }
  107. p = p.parentNode;
  108. }
  109. return [x, y];
  110. },
  111. setXY : function(el, xy){
  112. el = Ext.fly(el, '_setXY');
  113. el.position();
  114. var pts = el.translatePoints(xy);
  115. if(xy[0] !== false){
  116. el.dom.style.left = pts.left + "px";
  117. }
  118. if(xy[1] !== false){
  119. el.dom.style.top = pts.top + "px";
  120. }
  121. },
  122. setX : function(el, x){
  123. this.setXY(el, [x, false]);
  124. },
  125. setY : function(el, y){
  126. this.setXY(el, [false, y]);
  127. }
  128. };
  129. // all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights
  130. function fly(el){
  131. if(!libFlyweight){
  132. libFlyweight = new Ext.Element.Flyweight();
  133. }
  134. libFlyweight.dom = el;
  135. return libFlyweight;
  136. }
  137. Ext.lib.Event = {
  138. getPageX : function(e){
  139. e = e.browserEvent || e;
  140. return e.pageX;
  141. },
  142. getPageY : function(e){
  143. e = e.browserEvent || e;
  144. return e.pageY;
  145. },
  146. getXY : function(e){
  147. e = e.browserEvent || e;
  148. return [e.pageX, e.pageY];
  149. },
  150. getTarget : function(e){
  151. return e.target;
  152. },
  153. // all Ext events will go through event manager which provides scoping
  154. on : function(el, eventName, fn, scope, override){
  155. jQuery(el).bind(eventName, fn);
  156. },
  157. un : function(el, eventName, fn){
  158. jQuery(el).unbind(eventName, fn);
  159. },
  160. purgeElement : function(el){
  161. jQuery(el).unbind();
  162. },
  163. preventDefault : function(e){
  164. e = e.browserEvent || e;
  165. if(e.preventDefault){
  166. e.preventDefault();
  167. }else{
  168. e.returnValue = false;
  169. }
  170. },
  171. stopPropagation : function(e){
  172. e = e.browserEvent || e;
  173. if(e.stopPropagation){
  174. e.stopPropagation();
  175. }else{
  176. e.cancelBubble = true;
  177. }
  178. },
  179. stopEvent : function(e){
  180. this.preventDefault(e);
  181. this.stopPropagation(e);
  182. },
  183. onAvailable : function(id, fn, scope){
  184. var start = new Date();
  185. var f = function(){
  186. if(start.getElapsed() > 10000){
  187. clearInterval(iid);
  188. }
  189. var el = document.getElementById(id);
  190. if(el){
  191. clearInterval(iid);
  192. fn.call(scope||window, el);
  193. }
  194. };
  195. var iid = setInterval(f, 50);
  196. },
  197. resolveTextNode: Ext.isGecko ? function(node){
  198. if(!node){
  199. return;
  200. }
  201. var s = HTMLElement.prototype.toString.call(node);
  202. if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){
  203. return;
  204. }
  205. return node.nodeType == 3 ? node.parentNode : node;
  206. } : function(node){
  207. return node && node.nodeType == 3 ? node.parentNode : node;
  208. },
  209. getRelatedTarget: function(ev) {
  210. ev = ev.browserEvent || ev;
  211. var t = ev.relatedTarget;
  212. if (!t) {
  213. if (ev.type == "mouseout") {
  214. t = ev.toElement;
  215. } else if (ev.type == "mouseover") {
  216. t = ev.fromElement;
  217. }
  218. }
  219. return this.resolveTextNode(t);
  220. }
  221. };
  222. Ext.lib.Ajax = function(){
  223. var createComplete = function(cb){
  224. return function(xhr, status){
  225. if((status == 'error' || status == 'timeout') && cb.failure){
  226. cb.failure.call(cb.scope||window, createResponse(cb, xhr));
  227. }else if(cb.success){
  228. cb.success.call(cb.scope||window, createResponse(cb, xhr));
  229. }
  230. };
  231. };
  232. var createResponse = function(cb, xhr){
  233. var headerObj = {},
  234. headerStr,
  235. t,
  236. s;
  237. try {
  238. headerStr = xhr.getAllResponseHeaders();
  239. Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){
  240. t = v.indexOf(':');
  241. if(t >= 0){
  242. s = v.substr(0, t).toLowerCase();
  243. if(v.charAt(t + 1) == ' '){
  244. ++t;
  245. }
  246. headerObj[s] = v.substr(t + 1);
  247. }
  248. });
  249. } catch(e) {}
  250. return {
  251. responseText: xhr.responseText,
  252. responseXML : xhr.responseXML,
  253. argument: cb.argument,
  254. status: xhr.status,
  255. statusText: xhr.statusText,
  256. getResponseHeader : function(header){
  257. return headerObj[header.toLowerCase()];
  258. },
  259. getAllResponseHeaders : function(){
  260. return headerStr;
  261. }
  262. };
  263. };
  264. return {
  265. request : function(method, uri, cb, data, options){
  266. var o = {
  267. type: method,
  268. url: uri,
  269. data: data,
  270. timeout: cb.timeout,
  271. complete: createComplete(cb)
  272. };
  273. if(options){
  274. var hs = options.headers;
  275. if(options.xmlData){
  276. o.data = options.xmlData;
  277. o.processData = false;
  278. o.type = (method ? method : (options.method ? options.method : 'POST'));
  279. if (!hs || !hs['Content-Type']){
  280. o.contentType = 'text/xml';
  281. }
  282. }else if(options.jsonData){
  283. o.data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;
  284. o.processData = false;
  285. o.type = (method ? method : (options.method ? options.method : 'POST'));
  286. if (!hs || !hs['Content-Type']){
  287. o.contentType = 'application/json';
  288. }
  289. }
  290. if(hs){
  291. o.beforeSend = function(xhr){
  292. for (var h in hs) {
  293. if (hs.hasOwnProperty(h)) {
  294. xhr.setRequestHeader(h, hs[h]);
  295. }
  296. }
  297. };
  298. }
  299. }
  300. jQuery.ajax(o);
  301. },
  302. formRequest : function(form, uri, cb, data, isUpload, sslUri){
  303. jQuery.ajax({
  304. type: Ext.getDom(form).method ||'POST',
  305. url: uri,
  306. data: jQuery(form).serialize()+(data?'&'+data:''),
  307. timeout: cb.timeout,
  308. complete: createComplete(cb)
  309. });
  310. },
  311. isCallInProgress : function(trans){
  312. return false;
  313. },
  314. abort : function(trans){
  315. return false;
  316. },
  317. serializeForm : function(form){
  318. return jQuery(form.dom||form).serialize();
  319. }
  320. };
  321. }();
  322. Ext.lib.Anim = function(){
  323. var createAnim = function(cb, scope){
  324. var animated = true;
  325. return {
  326. stop : function(skipToLast){
  327. // do nothing
  328. },
  329. isAnimated : function(){
  330. return animated;
  331. },
  332. proxyCallback : function(){
  333. animated = false;
  334. Ext.callback(cb, scope);
  335. }
  336. };
  337. };
  338. return {
  339. scroll : function(el, args, duration, easing, cb, scope){
  340. // scroll anim not supported so just scroll immediately
  341. var anim = createAnim(cb, scope);
  342. el = Ext.getDom(el);
  343. if(typeof args.scroll.to[0] == 'number'){
  344. el.scrollLeft = args.scroll.to[0];
  345. }
  346. if(typeof args.scroll.to[1] == 'number'){
  347. el.scrollTop = args.scroll.to[1];
  348. }
  349. anim.proxyCallback();
  350. return anim;
  351. },
  352. motion : function(el, args, duration, easing, cb, scope){
  353. return this.run(el, args, duration, easing, cb, scope);
  354. },
  355. color : function(el, args, duration, easing, cb, scope){
  356. // color anim not supported, so execute callback immediately
  357. var anim = createAnim(cb, scope);
  358. anim.proxyCallback();
  359. return anim;
  360. },
  361. run : function(el, args, duration, easing, cb, scope, type){
  362. var anim = createAnim(cb, scope), e = Ext.fly(el, '_animrun');
  363. var o = {};
  364. for(var k in args){
  365. switch(k){ // jquery doesn't support, so convert
  366. case 'points':
  367. var by, pts;
  368. e.position();
  369. if(by = args.points.by){
  370. var xy = e.getXY();
  371. pts = e.translatePoints([xy[0]+by[0], xy[1]+by[1]]);
  372. }else{
  373. pts = e.translatePoints(args.points.to);
  374. }
  375. o.left = pts.left;
  376. o.top = pts.top;
  377. if(!parseInt(e.getStyle('left'), 10)){ // auto bug
  378. e.setLeft(0);
  379. }
  380. if(!parseInt(e.getStyle('top'), 10)){
  381. e.setTop(0);
  382. }
  383. if(args.points.from){
  384. e.setXY(args.points.from);
  385. }
  386. break;
  387. case 'width':
  388. o.width = args.width.to;
  389. if (args.width.from)
  390. e.setWidth(args.width.from);
  391. break;
  392. case 'height':
  393. o.height = args.height.to;
  394. if (args.height.from)
  395. e.setHeight(args.height.from);
  396. break;
  397. case 'opacity':
  398. o.opacity = args.opacity.to;
  399. if (args.opacity.from)
  400. e.setOpacity(args.opacity.from);
  401. break;
  402. case 'left':
  403. o.left = args.left.to;
  404. if (args.left.from)
  405. e.setLeft(args.left.from);
  406. break;
  407. case 'top':
  408. o.top = args.top.to;
  409. if (args.top.from)
  410. e.setTop(args.top.from);
  411. break;
  412. // jQuery can't handle callback, scope, and xy arguments, so break here
  413. case 'callback':
  414. case 'scope':
  415. case 'xy':
  416. break;
  417. default:
  418. o[k] = args[k].to;
  419. if (args[k].from)
  420. e.setStyle(k, args[k].from);
  421. break;
  422. }
  423. }
  424. // TODO: find out about easing plug in?
  425. jQuery(el).animate(o, duration*1000, undefined, anim.proxyCallback);
  426. return anim;
  427. }
  428. };
  429. }();
  430. Ext.lib.Region = function(t, r, b, l) {
  431. this.top = t;
  432. this[1] = t;
  433. this.right = r;
  434. this.bottom = b;
  435. this.left = l;
  436. this[0] = l;
  437. };
  438. Ext.lib.Region.prototype = {
  439. contains : function(region) {
  440. return ( region.left >= this.left &&
  441. region.right <= this.right &&
  442. region.top >= this.top &&
  443. region.bottom <= this.bottom );
  444. },
  445. getArea : function() {
  446. return ( (this.bottom - this.top) * (this.right - this.left) );
  447. },
  448. intersect : function(region) {
  449. var t = Math.max( this.top, region.top );
  450. var r = Math.min( this.right, region.right );
  451. var b = Math.min( this.bottom, region.bottom );
  452. var l = Math.max( this.left, region.left );
  453. if (b >= t && r >= l) {
  454. return new Ext.lib.Region(t, r, b, l);
  455. } else {
  456. return null;
  457. }
  458. },
  459. union : function(region) {
  460. var t = Math.min( this.top, region.top );
  461. var r = Math.max( this.right, region.right );
  462. var b = Math.max( this.bottom, region.bottom );
  463. var l = Math.min( this.left, region.left );
  464. return new Ext.lib.Region(t, r, b, l);
  465. },
  466. constrainTo : function(r) {
  467. this.top = this.top.constrain(r.top, r.bottom);
  468. this.bottom = this.bottom.constrain(r.top, r.bottom);
  469. this.left = this.left.constrain(r.left, r.right);
  470. this.right = this.right.constrain(r.left, r.right);
  471. return this;
  472. },
  473. adjust : function(t, l, b, r){
  474. this.top += t;
  475. this.left += l;
  476. this.right += r;
  477. this.bottom += b;
  478. return this;
  479. }
  480. };
  481. Ext.lib.Region.getRegion = function(el) {
  482. var p = Ext.lib.Dom.getXY(el);
  483. var t = p[1];
  484. var r = p[0] + el.offsetWidth;
  485. var b = p[1] + el.offsetHeight;
  486. var l = p[0];
  487. return new Ext.lib.Region(t, r, b, l);
  488. };
  489. Ext.lib.Point = function(x, y) {
  490. if (Ext.isArray(x)) {
  491. y = x[1];
  492. x = x[0];
  493. }
  494. this.x = this.right = this.left = this[0] = x;
  495. this.y = this.top = this.bottom = this[1] = y;
  496. };
  497. Ext.lib.Point.prototype = new Ext.lib.Region();
  498. // prevent IE leaks
  499. if(Ext.isIE) {
  500. function fnCleanUp() {
  501. var p = Function.prototype;
  502. delete p.createSequence;
  503. delete p.defer;
  504. delete p.createDelegate;
  505. delete p.createCallback;
  506. delete p.createInterceptor;
  507. window.detachEvent("onunload", fnCleanUp);
  508. }
  509. window.attachEvent("onunload", fnCleanUp);
  510. }
  511. })();</pre>
  512. </body>
  513. </html>