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.

121 lines
5.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.CompositeElement"></div>/**
  16. * @class Ext.CompositeElement
  17. * @extends Ext.CompositeElementLite
  18. * <p>This class encapsulates a <i>collection</i> of DOM elements, providing methods to filter
  19. * members, or to perform collective actions upon the whole set.</p>
  20. * <p>Although they are not listed, this class supports all of the methods of {@link Ext.Element} and
  21. * {@link Ext.Fx}. The methods from these classes will be performed on all the elements in this collection.</p>
  22. * <p>All methods return <i>this</i> and can be chained.</p>
  23. * Usage:
  24. <pre><code>
  25. var els = Ext.select("#some-el div.some-class", true);
  26. // or select directly from an existing element
  27. var el = Ext.get('some-el');
  28. el.select('div.some-class', true);
  29. els.setWidth(100); // all elements become 100 width
  30. els.hide(true); // all elements fade out and hide
  31. // or
  32. els.setWidth(100).hide(true);
  33. </code></pre>
  34. */
  35. Ext.CompositeElement = Ext.extend(Ext.CompositeElementLite, {
  36. constructor : function(els, root){
  37. this.elements = [];
  38. this.add(els, root);
  39. },
  40. // private
  41. getElement : function(el){
  42. // In this case just return it, since we already have a reference to it
  43. return el;
  44. },
  45. // private
  46. transformElement : function(el){
  47. return Ext.get(el);
  48. }
  49. /**
  50. * Adds elements to this composite.
  51. * @param {String/Array} els A string CSS selector, an array of elements or an element
  52. * @return {CompositeElement} this
  53. */
  54. /**
  55. * Returns the Element object at the specified index
  56. * @param {Number} index
  57. * @return {Ext.Element}
  58. */
  59. <div id="method-Ext.CompositeElement-"></div>/**
  60. * Iterates each <code>element</code> in this <code>composite</code>
  61. * calling the supplied function using {@link Ext#each}.
  62. * @param {Function} fn The function to be called with each
  63. * <code>element</code>. If the supplied function returns <tt>false</tt>,
  64. * iteration stops. This function is called with the following arguments:
  65. * <div class="mdetail-params"><ul>
  66. * <li><code>element</code> : <i>Ext.Element</i><div class="sub-desc">The element at the current <code>index</code>
  67. * in the <code>composite</code></div></li>
  68. * <li><code>composite</code> : <i>Object</i> <div class="sub-desc">This composite.</div></li>
  69. * <li><code>index</code> : <i>Number</i> <div class="sub-desc">The current index within the <code>composite</code> </div></li>
  70. * </ul></div>
  71. * @param {Object} scope (optional) The scope (<code><this</code> reference) in which the specified function is executed.
  72. * Defaults to the <code>element</code> at the current <code>index</code>
  73. * within the composite.
  74. * @return {CompositeElement} this
  75. */
  76. });
  77. <div id="method-Ext.Element-select"></div>/**
  78. * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods
  79. * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or
  80. * {@link Ext.CompositeElementLite CompositeElementLite} object.
  81. * @param {String/Array} selector The CSS selector or an array of elements
  82. * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object)
  83. * @param {HTMLElement/String} root (optional) The root element of the query or id of the root
  84. * @return {CompositeElementLite/CompositeElement}
  85. * @member Ext.Element
  86. * @method select
  87. */
  88. Ext.Element.select = function(selector, unique, root){
  89. var els;
  90. if(typeof selector == "string"){
  91. els = Ext.Element.selectorFunction(selector, root);
  92. }else if(selector.length !== undefined){
  93. els = selector;
  94. }else{
  95. throw "Invalid selector";
  96. }
  97. return (unique === true) ? new Ext.CompositeElement(els) : new Ext.CompositeElementLite(els);
  98. };
  99. <div id="method-Ext-select"></div>/**
  100. * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods
  101. * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or
  102. * {@link Ext.CompositeElementLite CompositeElementLite} object.
  103. * @param {String/Array} selector The CSS selector or an array of elements
  104. * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object)
  105. * @param {HTMLElement/String} root (optional) The root element of the query or id of the root
  106. * @return {CompositeElementLite/CompositeElement}
  107. * @member Ext
  108. * @method select
  109. */
  110. Ext.select = Ext.Element.select;</pre>
  111. </body>
  112. </html>