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.

171 lines
6.4 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.Element
  17. */
  18. Ext.Element.addMethods(
  19. function() {
  20. var VISIBILITY = "visibility",
  21. DISPLAY = "display",
  22. HIDDEN = "hidden",
  23. NONE = "none",
  24. XMASKED = "x-masked",
  25. XMASKEDRELATIVE = "x-masked-relative",
  26. data = Ext.Element.data;
  27. return {
  28. <div id="method-Ext.Element-isVisible"></div>/**
  29. * Checks whether the element is currently visible using both visibility and display properties.
  30. * @param {Boolean} deep (optional) True to walk the dom and see if parent elements are hidden (defaults to false)
  31. * @return {Boolean} True if the element is currently visible, else false
  32. */
  33. isVisible : function(deep) {
  34. var vis = !this.isStyle(VISIBILITY, HIDDEN) && !this.isStyle(DISPLAY, NONE),
  35. p = this.dom.parentNode;
  36. if (deep !== true || !vis) {
  37. return vis;
  38. }
  39. while (p && !(/^body/i.test(p.tagName))) {
  40. if (!Ext.fly(p, '_isVisible').isVisible()) {
  41. return false;
  42. }
  43. p = p.parentNode;
  44. }
  45. return true;
  46. },
  47. <div id="method-Ext.Element-isDisplayed"></div>/**
  48. * Returns true if display is not "none"
  49. * @return {Boolean}
  50. */
  51. isDisplayed : function() {
  52. return !this.isStyle(DISPLAY, NONE);
  53. },
  54. <div id="method-Ext.Element-enableDisplayMode"></div>/**
  55. * Convenience method for setVisibilityMode(Element.DISPLAY)
  56. * @param {String} display (optional) What to set display to when visible
  57. * @return {Ext.Element} this
  58. */
  59. enableDisplayMode : function(display) {
  60. this.setVisibilityMode(Ext.Element.DISPLAY);
  61. if (!Ext.isEmpty(display)) {
  62. data(this.dom, 'originalDisplay', display);
  63. }
  64. return this;
  65. },
  66. <div id="method-Ext.Element-mask"></div>/**
  67. * Puts a mask over this element to disable user interaction. Requires core.css.
  68. * This method can only be applied to elements which accept child nodes.
  69. * @param {String} msg (optional) A message to display in the mask
  70. * @param {String} msgCls (optional) A css class to apply to the msg element
  71. * @return {Element} The mask element
  72. */
  73. mask : function(msg, msgCls) {
  74. var me = this,
  75. dom = me.dom,
  76. dh = Ext.DomHelper,
  77. EXTELMASKMSG = "ext-el-mask-msg",
  78. el,
  79. mask;
  80. if (!(/^body/i.test(dom.tagName) && me.getStyle('position') == 'static')) {
  81. me.addClass(XMASKEDRELATIVE);
  82. }
  83. if (el = data(dom, 'maskMsg')) {
  84. el.remove();
  85. }
  86. if (el = data(dom, 'mask')) {
  87. el.remove();
  88. }
  89. mask = dh.append(dom, {cls : "ext-el-mask"}, true);
  90. data(dom, 'mask', mask);
  91. me.addClass(XMASKED);
  92. mask.setDisplayed(true);
  93. if (typeof msg == 'string') {
  94. var mm = dh.append(dom, {cls : EXTELMASKMSG, cn:{tag:'div'}}, true);
  95. data(dom, 'maskMsg', mm);
  96. mm.dom.className = msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG;
  97. mm.dom.firstChild.innerHTML = msg;
  98. mm.setDisplayed(true);
  99. mm.center(me);
  100. }
  101. // ie will not expand full height automatically
  102. if (Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto') {
  103. mask.setSize(undefined, me.getHeight());
  104. }
  105. return mask;
  106. },
  107. <div id="method-Ext.Element-unmask"></div>/**
  108. * Removes a previously applied mask.
  109. */
  110. unmask : function() {
  111. var me = this,
  112. dom = me.dom,
  113. mask = data(dom, 'mask'),
  114. maskMsg = data(dom, 'maskMsg');
  115. if (mask) {
  116. if (maskMsg) {
  117. maskMsg.remove();
  118. data(dom, 'maskMsg', undefined);
  119. }
  120. mask.remove();
  121. data(dom, 'mask', undefined);
  122. me.removeClass([XMASKED, XMASKEDRELATIVE]);
  123. }
  124. },
  125. <div id="method-Ext.Element-isMasked"></div>/**
  126. * Returns true if this element is masked
  127. * @return {Boolean}
  128. */
  129. isMasked : function() {
  130. var m = data(this.dom, 'mask');
  131. return m && m.isVisible();
  132. },
  133. <div id="method-Ext.Element-createShim"></div>/**
  134. * Creates an iframe shim for this element to keep selects and other windowed objects from
  135. * showing through.
  136. * @return {Ext.Element} The new shim element
  137. */
  138. createShim : function() {
  139. var el = document.createElement('iframe'),
  140. shim;
  141. el.frameBorder = '0';
  142. el.className = 'ext-shim';
  143. el.src = Ext.SSL_SECURE_URL;
  144. shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom));
  145. shim.autoBoxAdjust = false;
  146. return shim;
  147. }
  148. };
  149. }()
  150. );</pre>
  151. </body>
  152. </html>