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.

169 lines
5.0 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. (function(){
  16. var doc = document,
  17. isCSS1 = doc.compatMode == "CSS1Compat",
  18. MAX = Math.max,
  19. ROUND = Math.round,
  20. PARSEINT = parseInt;
  21. Ext.lib.Dom = {
  22. isAncestor : function(p, c) {
  23. var ret = false;
  24. p = Ext.getDom(p);
  25. c = Ext.getDom(c);
  26. if (p && c) {
  27. if (p.contains) {
  28. return p.contains(c);
  29. } else if (p.compareDocumentPosition) {
  30. return !!(p.compareDocumentPosition(c) & 16);
  31. } else {
  32. while (c = c.parentNode) {
  33. ret = c == p || ret;
  34. }
  35. }
  36. }
  37. return ret;
  38. },
  39. getViewWidth : function(full) {
  40. return full ? this.getDocumentWidth() : this.getViewportWidth();
  41. },
  42. getViewHeight : function(full) {
  43. return full ? this.getDocumentHeight() : this.getViewportHeight();
  44. },
  45. getDocumentHeight: function() {
  46. return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight());
  47. },
  48. getDocumentWidth: function() {
  49. return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth());
  50. },
  51. getViewportHeight: function(){
  52. return Ext.isIE ?
  53. (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) :
  54. self.innerHeight;
  55. },
  56. getViewportWidth : function() {
  57. return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth :
  58. Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth;
  59. },
  60. getY : function(el) {
  61. return this.getXY(el)[1];
  62. },
  63. getX : function(el) {
  64. return this.getXY(el)[0];
  65. },
  66. getXY : function(el) {
  67. var p,
  68. pe,
  69. b,
  70. bt,
  71. bl,
  72. dbd,
  73. x = 0,
  74. y = 0,
  75. scroll,
  76. hasAbsolute,
  77. bd = (doc.body || doc.documentElement),
  78. ret = [0,0];
  79. el = Ext.getDom(el);
  80. if(el != bd){
  81. if (el.getBoundingClientRect) {
  82. b = el.getBoundingClientRect();
  83. scroll = fly(document).getScroll();
  84. ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)];
  85. } else {
  86. p = el;
  87. hasAbsolute = fly(el).isStyle("position", "absolute");
  88. while (p) {
  89. pe = fly(p);
  90. x += p.offsetLeft;
  91. y += p.offsetTop;
  92. hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute");
  93. if (Ext.isGecko) {
  94. y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0;
  95. x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0;
  96. if (p != el && !pe.isStyle('overflow','visible')) {
  97. x += bl;
  98. y += bt;
  99. }
  100. }
  101. p = p.offsetParent;
  102. }
  103. if (Ext.isSafari && hasAbsolute) {
  104. x -= bd.offsetLeft;
  105. y -= bd.offsetTop;
  106. }
  107. if (Ext.isGecko && !hasAbsolute) {
  108. dbd = fly(bd);
  109. x += PARSEINT(dbd.getStyle("borderLeftWidth"), 10) || 0;
  110. y += PARSEINT(dbd.getStyle("borderTopWidth"), 10) || 0;
  111. }
  112. p = el.parentNode;
  113. while (p && p != bd) {
  114. if (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) {
  115. x -= p.scrollLeft;
  116. y -= p.scrollTop;
  117. }
  118. p = p.parentNode;
  119. }
  120. ret = [x,y];
  121. }
  122. }
  123. return ret;
  124. },
  125. setXY : function(el, xy) {
  126. (el = Ext.fly(el, '_setXY')).position();
  127. var pts = el.translatePoints(xy),
  128. style = el.dom.style,
  129. pos;
  130. for (pos in pts) {
  131. if (!isNaN(pts[pos])) {
  132. style[pos] = pts[pos] + "px";
  133. }
  134. }
  135. },
  136. setX : function(el, x) {
  137. this.setXY(el, [x, false]);
  138. },
  139. setY : function(el, y) {
  140. this.setXY(el, [false, y]);
  141. }
  142. };
  143. })();</pre>
  144. </body>
  145. </html>