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.

188 lines
7.1 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. <div id="cls-Ext.QuickTips"></div>/**
  16. * @class Ext.QuickTips
  17. * <p>Provides attractive and customizable tooltips for any element. The QuickTips
  18. * singleton is used to configure and manage tooltips globally for multiple elements
  19. * in a generic manner. To create individual tooltips with maximum customizability,
  20. * you should consider either {@link Ext.Tip} or {@link Ext.ToolTip}.</p>
  21. * <p>Quicktips can be configured via tag attributes directly in markup, or by
  22. * registering quick tips programmatically via the {@link #register} method.</p>
  23. * <p>The singleton's instance of {@link Ext.QuickTip} is available via
  24. * {@link #getQuickTip}, and supports all the methods, and all the all the
  25. * configuration properties of Ext.QuickTip. These settings will apply to all
  26. * tooltips shown by the singleton.</p>
  27. * <p>Below is the summary of the configuration properties which can be used.
  28. * For detailed descriptions see the config options for the {@link Ext.QuickTip QuickTip} class</p>
  29. * <p><b>QuickTips singleton configs (all are optional)</b></p>
  30. * <div class="mdetail-params"><ul><li>dismissDelay</li>
  31. * <li>hideDelay</li>
  32. * <li>maxWidth</li>
  33. * <li>minWidth</li>
  34. * <li>showDelay</li>
  35. * <li>trackMouse</li></ul></div>
  36. * <p><b>Target element configs (optional unless otherwise noted)</b></p>
  37. * <div class="mdetail-params"><ul><li>autoHide</li>
  38. * <li>cls</li>
  39. * <li>dismissDelay (overrides singleton value)</li>
  40. * <li>target (required)</li>
  41. * <li>text (required)</li>
  42. * <li>title</li>
  43. * <li>width</li></ul></div>
  44. * <p>Here is an example showing how some of these config options could be used:</p>
  45. * <pre><code>
  46. // Init the singleton. Any tag-based quick tips will start working.
  47. Ext.QuickTips.init();
  48. // Apply a set of config properties to the singleton
  49. Ext.apply(Ext.QuickTips.getQuickTip(), {
  50. maxWidth: 200,
  51. minWidth: 100,
  52. showDelay: 50, // Show 50ms after entering target
  53. trackMouse: true
  54. });
  55. // Manually register a quick tip for a specific element
  56. Ext.QuickTips.register({
  57. target: 'my-div',
  58. title: 'My Tooltip',
  59. text: 'This tooltip was added in code',
  60. width: 100,
  61. dismissDelay: 10000 // Hide after 10 seconds hover
  62. });
  63. </code></pre>
  64. * <p>To register a quick tip in markup, you simply add one or more of the valid QuickTip attributes prefixed with
  65. * the <b>ext:</b> namespace. The HTML element itself is automatically set as the quick tip target. Here is the summary
  66. * of supported attributes (optional unless otherwise noted):</p>
  67. * <ul><li><b>hide</b>: Specifying "user" is equivalent to setting autoHide = false. Any other value will be the
  68. * same as autoHide = true.</li>
  69. * <li><b>qclass</b>: A CSS class to be applied to the quick tip (equivalent to the 'cls' target element config).</li>
  70. * <li><b>qtip (required)</b>: The quick tip text (equivalent to the 'text' target element config).</li>
  71. * <li><b>qtitle</b>: The quick tip title (equivalent to the 'title' target element config).</li>
  72. * <li><b>qwidth</b>: The quick tip width (equivalent to the 'width' target element config).</li></ul>
  73. * <p>Here is an example of configuring an HTML element to display a tooltip from markup:</p>
  74. * <pre><code>
  75. // Add a quick tip to an HTML button
  76. &lt;input type="button" value="OK" ext:qtitle="OK Button" ext:qwidth="100"
  77. ext:qtip="This is a quick tip from markup!">&lt;/input>
  78. </code></pre>
  79. * @singleton
  80. */
  81. Ext.QuickTips = function(){
  82. var tip,
  83. disabled = false;
  84. return {
  85. <div id="method-Ext.QuickTips-init"></div>/**
  86. * Initialize the global QuickTips instance and prepare any quick tips.
  87. * @param {Boolean} autoRender True to render the QuickTips container immediately to preload images. (Defaults to true)
  88. */
  89. init : function(autoRender){
  90. if(!tip){
  91. if(!Ext.isReady){
  92. Ext.onReady(function(){
  93. Ext.QuickTips.init(autoRender);
  94. });
  95. return;
  96. }
  97. tip = new Ext.QuickTip({
  98. elements:'header,body',
  99. disabled: disabled
  100. });
  101. if(autoRender !== false){
  102. tip.render(Ext.getBody());
  103. }
  104. }
  105. },
  106. // Protected method called by the dd classes
  107. ddDisable : function(){
  108. // don't disable it if we don't need to
  109. if(tip && !disabled){
  110. tip.disable();
  111. }
  112. },
  113. // Protected method called by the dd classes
  114. ddEnable : function(){
  115. // only enable it if it hasn't been disabled
  116. if(tip && !disabled){
  117. tip.enable();
  118. }
  119. },
  120. <div id="method-Ext.QuickTips-enable"></div>/**
  121. * Enable quick tips globally.
  122. */
  123. enable : function(){
  124. if(tip){
  125. tip.enable();
  126. }
  127. disabled = false;
  128. },
  129. <div id="method-Ext.QuickTips-disable"></div>/**
  130. * Disable quick tips globally.
  131. */
  132. disable : function(){
  133. if(tip){
  134. tip.disable();
  135. }
  136. disabled = true;
  137. },
  138. <div id="method-Ext.QuickTips-isEnabled"></div>/**
  139. * Returns true if quick tips are enabled, else false.
  140. * @return {Boolean}
  141. */
  142. isEnabled : function(){
  143. return tip !== undefined && !tip.disabled;
  144. },
  145. <div id="method-Ext.QuickTips-getQuickTip"></div>/**
  146. * Gets the single {@link Ext.QuickTip QuickTip} instance used to show tips from all registered elements.
  147. * @return {Ext.QuickTip}
  148. */
  149. getQuickTip : function(){
  150. return tip;
  151. },
  152. <div id="method-Ext.QuickTips-register"></div>/**
  153. * Configures a new quick tip instance and assigns it to a target element. See
  154. * {@link Ext.QuickTip#register} for details.
  155. * @param {Object} config The config object
  156. */
  157. register : function(){
  158. tip.register.apply(tip, arguments);
  159. },
  160. <div id="method-Ext.QuickTips-unregister"></div>/**
  161. * Removes any registered quick tip from the target element and destroys it.
  162. * @param {String/HTMLElement/Element} el The element from which the quick tip is to be removed.
  163. */
  164. unregister : function(){
  165. tip.unregister.apply(tip, arguments);
  166. },
  167. <div id="method-Ext.QuickTips-tips"></div>/**
  168. * Alias of {@link #register}.
  169. * @param {Object} config The config object
  170. */
  171. tips : function(){
  172. tip.register.apply(tip, arguments);
  173. }
  174. };
  175. }();</pre>
  176. </body>
  177. </html>