extjs-rails 4.1.0.alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (517) hide show
  1. data/.gitignore +18 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +36 -0
  4. data/README.md +29 -0
  5. data/Rakefile +2 -0
  6. data/app/assets/javascripts/extjs-rails/extjs-rails.js +1 -0
  7. data/app/assets/javascripts/extjs-rails/index.js.erb +9 -0
  8. data/app/assets/javascripts/extjs-rails/sdk.jsb3 +2017 -0
  9. data/app/assets/javascripts/extjs-rails/src/AbstractComponent.js +3290 -0
  10. data/app/assets/javascripts/extjs-rails/src/AbstractManager.js +144 -0
  11. data/app/assets/javascripts/extjs-rails/src/AbstractPlugin.js +72 -0
  12. data/app/assets/javascripts/extjs-rails/src/Action.js +276 -0
  13. data/app/assets/javascripts/extjs-rails/src/Ajax.js +99 -0
  14. data/app/assets/javascripts/extjs-rails/src/Component.js +1344 -0
  15. data/app/assets/javascripts/extjs-rails/src/ComponentLoader.js +202 -0
  16. data/app/assets/javascripts/extjs-rails/src/ComponentManager.js +47 -0
  17. data/app/assets/javascripts/extjs-rails/src/ComponentQuery.js +521 -0
  18. data/app/assets/javascripts/extjs-rails/src/Editor.js +494 -0
  19. data/app/assets/javascripts/extjs-rails/src/ElementLoader.js +404 -0
  20. data/app/assets/javascripts/extjs-rails/src/FocusManager.js +712 -0
  21. data/app/assets/javascripts/extjs-rails/src/Img.js +111 -0
  22. data/app/assets/javascripts/extjs-rails/src/Layer.js +543 -0
  23. data/app/assets/javascripts/extjs-rails/src/LoadMask.js +432 -0
  24. data/app/assets/javascripts/extjs-rails/src/ModelManager.js +186 -0
  25. data/app/assets/javascripts/extjs-rails/src/PluginManager.js +110 -0
  26. data/app/assets/javascripts/extjs-rails/src/ProgressBar.js +336 -0
  27. data/app/assets/javascripts/extjs-rails/src/Shadow.js +233 -0
  28. data/app/assets/javascripts/extjs-rails/src/ShadowPool.js +43 -0
  29. data/app/assets/javascripts/extjs-rails/src/Template.js +331 -0
  30. data/app/assets/javascripts/extjs-rails/src/XTemplate.js +365 -0
  31. data/app/assets/javascripts/extjs-rails/src/XTemplateCompiler.js +450 -0
  32. data/app/assets/javascripts/extjs-rails/src/XTemplateParser.js +249 -0
  33. data/app/assets/javascripts/extjs-rails/src/ZIndexManager.js +519 -0
  34. data/app/assets/javascripts/extjs-rails/src/app/Application.js +271 -0
  35. data/app/assets/javascripts/extjs-rails/src/app/Controller.js +458 -0
  36. data/app/assets/javascripts/extjs-rails/src/app/EventBus.js +112 -0
  37. data/app/assets/javascripts/extjs-rails/src/button/Button.js +1483 -0
  38. data/app/assets/javascripts/extjs-rails/src/button/Cycle.js +215 -0
  39. data/app/assets/javascripts/extjs-rails/src/button/Split.js +99 -0
  40. data/app/assets/javascripts/extjs-rails/src/chart/Callout.js +140 -0
  41. data/app/assets/javascripts/extjs-rails/src/chart/Chart.js +966 -0
  42. data/app/assets/javascripts/extjs-rails/src/chart/Highlight.js +172 -0
  43. data/app/assets/javascripts/extjs-rails/src/chart/Label.js +241 -0
  44. data/app/assets/javascripts/extjs-rails/src/chart/Legend.js +474 -0
  45. data/app/assets/javascripts/extjs-rails/src/chart/LegendItem.js +217 -0
  46. data/app/assets/javascripts/extjs-rails/src/chart/Mask.js +230 -0
  47. data/app/assets/javascripts/extjs-rails/src/chart/MaskLayer.js +48 -0
  48. data/app/assets/javascripts/extjs-rails/src/chart/Navigation.js +79 -0
  49. data/app/assets/javascripts/extjs-rails/src/chart/Shape.js +106 -0
  50. data/app/assets/javascripts/extjs-rails/src/chart/Tip.js +98 -0
  51. data/app/assets/javascripts/extjs-rails/src/chart/TipSurface.js +42 -0
  52. data/app/assets/javascripts/extjs-rails/src/chart/axis/Abstract.js +73 -0
  53. data/app/assets/javascripts/extjs-rails/src/chart/axis/Axis.js +961 -0
  54. data/app/assets/javascripts/extjs-rails/src/chart/axis/Category.js +130 -0
  55. data/app/assets/javascripts/extjs-rails/src/chart/axis/Gauge.js +203 -0
  56. data/app/assets/javascripts/extjs-rails/src/chart/axis/Numeric.js +235 -0
  57. data/app/assets/javascripts/extjs-rails/src/chart/axis/Radial.js +204 -0
  58. data/app/assets/javascripts/extjs-rails/src/chart/axis/Time.js +135 -0
  59. data/app/assets/javascripts/extjs-rails/src/chart/series/Area.js +803 -0
  60. data/app/assets/javascripts/extjs-rails/src/chart/series/Bar.js +853 -0
  61. data/app/assets/javascripts/extjs-rails/src/chart/series/Cartesian.js +328 -0
  62. data/app/assets/javascripts/extjs-rails/src/chart/series/Column.js +104 -0
  63. data/app/assets/javascripts/extjs-rails/src/chart/series/Gauge.js +490 -0
  64. data/app/assets/javascripts/extjs-rails/src/chart/series/Line.js +1104 -0
  65. data/app/assets/javascripts/extjs-rails/src/chart/series/Pie.js +1072 -0
  66. data/app/assets/javascripts/extjs-rails/src/chart/series/Radar.js +440 -0
  67. data/app/assets/javascripts/extjs-rails/src/chart/series/Scatter.js +668 -0
  68. data/app/assets/javascripts/extjs-rails/src/chart/series/Series.js +443 -0
  69. data/app/assets/javascripts/extjs-rails/src/chart/theme/Base.js +175 -0
  70. data/app/assets/javascripts/extjs-rails/src/chart/theme/Theme.js +253 -0
  71. data/app/assets/javascripts/extjs-rails/src/container/AbstractContainer.js +1062 -0
  72. data/app/assets/javascripts/extjs-rails/src/container/ButtonGroup.js +143 -0
  73. data/app/assets/javascripts/extjs-rails/src/container/Container.js +212 -0
  74. data/app/assets/javascripts/extjs-rails/src/container/DockingContainer.js +265 -0
  75. data/app/assets/javascripts/extjs-rails/src/container/Viewport.js +184 -0
  76. data/app/assets/javascripts/extjs-rails/src/core/dom/Element.form.js +50 -0
  77. data/app/assets/javascripts/extjs-rails/src/core/dom/Element.static-more.js +159 -0
  78. data/app/assets/javascripts/extjs-rails/src/core/examples/index.html +321 -0
  79. data/app/assets/javascripts/extjs-rails/src/core/examples/index.js +6 -0
  80. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/CTO.js +25 -0
  81. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/CoolGuy.js +20 -0
  82. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Developer.js +43 -0
  83. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Gun.js +3 -0
  84. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/HumanResource.js +23 -0
  85. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Musician.js +20 -0
  86. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Person.js +50 -0
  87. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanComposeSongs.js +9 -0
  88. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanPlayGuitar.js +9 -0
  89. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanSing.js +18 -0
  90. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/A.js +3 -0
  91. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/B.js +3 -0
  92. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/C.js +3 -0
  93. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/D.js +3 -0
  94. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/E.js +3 -0
  95. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/A.js +3 -0
  96. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/B.js +4 -0
  97. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/C.js +3 -0
  98. data/app/assets/javascripts/extjs-rails/src/core/src/EventManager.js +1167 -0
  99. data/app/assets/javascripts/extjs-rails/src/core/src/EventObject.js +883 -0
  100. data/app/assets/javascripts/extjs-rails/src/core/src/Ext-more.js +1283 -0
  101. data/app/assets/javascripts/extjs-rails/src/core/src/Ext.js +736 -0
  102. data/app/assets/javascripts/extjs-rails/src/core/src/Support.js +662 -0
  103. data/app/assets/javascripts/extjs-rails/src/core/src/class/Base.js +1085 -0
  104. data/app/assets/javascripts/extjs-rails/src/core/src/class/Class.js +676 -0
  105. data/app/assets/javascripts/extjs-rails/src/core/src/class/ClassManager.js +1591 -0
  106. data/app/assets/javascripts/extjs-rails/src/core/src/class/Loader.js +1423 -0
  107. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.alignment.js +173 -0
  108. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.insertion.js +193 -0
  109. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.js +681 -0
  110. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.position.js +356 -0
  111. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.static.js +474 -0
  112. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.style.js +851 -0
  113. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.traversal.js +180 -0
  114. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractHelper.js +291 -0
  115. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractQuery.js +72 -0
  116. data/app/assets/javascripts/extjs-rails/src/core/src/dom/CompositeElement.js +75 -0
  117. data/app/assets/javascripts/extjs-rails/src/core/src/dom/CompositeElementLite.js +436 -0
  118. data/app/assets/javascripts/extjs-rails/src/core/src/dom/DomQuery-aria.js +1049 -0
  119. data/app/assets/javascripts/extjs-rails/src/core/src/env/Browser.js +186 -0
  120. data/app/assets/javascripts/extjs-rails/src/core/src/env/FeatureDetector.js +274 -0
  121. data/app/assets/javascripts/extjs-rails/src/core/src/env/OS.js +141 -0
  122. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Array.js +1205 -0
  123. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Date.js +1463 -0
  124. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Error.js +326 -0
  125. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Function.js +485 -0
  126. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Number.js +175 -0
  127. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Object.js +606 -0
  128. data/app/assets/javascripts/extjs-rails/src/core/src/lang/String.js +333 -0
  129. data/app/assets/javascripts/extjs-rails/src/core/src/misc/JSON.js +236 -0
  130. data/app/assets/javascripts/extjs-rails/src/core/src/perf/Accumulator.js +244 -0
  131. data/app/assets/javascripts/extjs-rails/src/core/src/perf/Monitor.js +197 -0
  132. data/app/assets/javascripts/extjs-rails/src/core/src/util/DelayedTask.js +71 -0
  133. data/app/assets/javascripts/extjs-rails/src/core/src/util/Event.js +215 -0
  134. data/app/assets/javascripts/extjs-rails/src/core/src/util/Format.js +551 -0
  135. data/app/assets/javascripts/extjs-rails/src/core/src/util/TaskManager.js +417 -0
  136. data/app/assets/javascripts/extjs-rails/src/core/src/version/Version.js +364 -0
  137. data/app/assets/javascripts/extjs-rails/src/core/test/unit/README.MD +91 -0
  138. data/app/assets/javascripts/extjs-rails/src/core/test/unit/bootstrap.js +39 -0
  139. data/app/assets/javascripts/extjs-rails/src/core/test/unit/build/build-data.js +34 -0
  140. data/app/assets/javascripts/extjs-rails/src/core/test/unit/build/build.sh +2 -0
  141. data/app/assets/javascripts/extjs-rails/src/core/test/unit/data.js +27 -0
  142. data/app/assets/javascripts/extjs-rails/src/core/test/unit/index.html +15 -0
  143. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom.html +40 -0
  144. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/extjs-api.js +12 -0
  145. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/platform-api.js +134 -0
  146. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/sanity.js +4 -0
  147. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/touch-api-out.js +128 -0
  148. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/touch-api.js +89 -0
  149. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/env/Environment.js +357 -0
  150. data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/APITest.js +37 -0
  151. data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/jsb3.js +14 -0
  152. data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/test-setup.js +137 -0
  153. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/EventManager.js +629 -0
  154. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext-mess.backup +198 -0
  155. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext-more.js +520 -0
  156. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext.js +1550 -0
  157. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Support.js +250 -0
  158. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/Base.js +47 -0
  159. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/Class.js +561 -0
  160. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/ClassManager.js +555 -0
  161. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/CompositeElementLite.js +409 -0
  162. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/DomHelper.js +444 -0
  163. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.insertion.js +342 -0
  164. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.js +731 -0
  165. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.static.js +201 -0
  166. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.style.js +118 -0
  167. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.traversal.js +336 -0
  168. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Array.js +1229 -0
  169. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Date.js +697 -0
  170. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Error.js +277 -0
  171. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Function.js +536 -0
  172. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Number.js +323 -0
  173. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Object.js +591 -0
  174. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/String.js +451 -0
  175. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/misc/JSON.js +252 -0
  176. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/util/Format.js +521 -0
  177. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/version/Version.js +148 -0
  178. data/app/assets/javascripts/extjs-rails/src/core/test/unit/specs.html +19 -0
  179. data/app/assets/javascripts/extjs-rails/src/data/AbstractStore.js +887 -0
  180. data/app/assets/javascripts/extjs-rails/src/data/ArrayStore.js +74 -0
  181. data/app/assets/javascripts/extjs-rails/src/data/Batch.js +236 -0
  182. data/app/assets/javascripts/extjs-rails/src/data/BufferStore.js +13 -0
  183. data/app/assets/javascripts/extjs-rails/src/data/Connection.js +969 -0
  184. data/app/assets/javascripts/extjs-rails/src/data/DirectStore.js +50 -0
  185. data/app/assets/javascripts/extjs-rails/src/data/Errors.js +52 -0
  186. data/app/assets/javascripts/extjs-rails/src/data/Field.js +341 -0
  187. data/app/assets/javascripts/extjs-rails/src/data/IdGenerator.js +198 -0
  188. data/app/assets/javascripts/extjs-rails/src/data/JsonP.js +253 -0
  189. data/app/assets/javascripts/extjs-rails/src/data/JsonPStore.js +51 -0
  190. data/app/assets/javascripts/extjs-rails/src/data/JsonStore.js +60 -0
  191. data/app/assets/javascripts/extjs-rails/src/data/Model.js +1673 -0
  192. data/app/assets/javascripts/extjs-rails/src/data/NodeInterface.js +1294 -0
  193. data/app/assets/javascripts/extjs-rails/src/data/NodeStore.js +254 -0
  194. data/app/assets/javascripts/extjs-rails/src/data/Operation.js +331 -0
  195. data/app/assets/javascripts/extjs-rails/src/data/Request.js +40 -0
  196. data/app/assets/javascripts/extjs-rails/src/data/ResultSet.js +56 -0
  197. data/app/assets/javascripts/extjs-rails/src/data/SequentialIdGenerator.js +61 -0
  198. data/app/assets/javascripts/extjs-rails/src/data/SortTypes.js +125 -0
  199. data/app/assets/javascripts/extjs-rails/src/data/Store.js +2609 -0
  200. data/app/assets/javascripts/extjs-rails/src/data/StoreManager.js +156 -0
  201. data/app/assets/javascripts/extjs-rails/src/data/Tree.js +290 -0
  202. data/app/assets/javascripts/extjs-rails/src/data/TreeStore.js +655 -0
  203. data/app/assets/javascripts/extjs-rails/src/data/Types.js +190 -0
  204. data/app/assets/javascripts/extjs-rails/src/data/UuidGenerator.js +215 -0
  205. data/app/assets/javascripts/extjs-rails/src/data/XmlStore.js +76 -0
  206. data/app/assets/javascripts/extjs-rails/src/data/association/Association.js +243 -0
  207. data/app/assets/javascripts/extjs-rails/src/data/association/BelongsTo.js +291 -0
  208. data/app/assets/javascripts/extjs-rails/src/data/association/HasMany.js +289 -0
  209. data/app/assets/javascripts/extjs-rails/src/data/association/HasOne.js +304 -0
  210. data/app/assets/javascripts/extjs-rails/src/data/proxy/Ajax.js +282 -0
  211. data/app/assets/javascripts/extjs-rails/src/data/proxy/Client.js +21 -0
  212. data/app/assets/javascripts/extjs-rails/src/data/proxy/Direct.js +181 -0
  213. data/app/assets/javascripts/extjs-rails/src/data/proxy/JsonP.js +313 -0
  214. data/app/assets/javascripts/extjs-rails/src/data/proxy/LocalStorage.js +69 -0
  215. data/app/assets/javascripts/extjs-rails/src/data/proxy/Memory.js +156 -0
  216. data/app/assets/javascripts/extjs-rails/src/data/proxy/Proxy.js +433 -0
  217. data/app/assets/javascripts/extjs-rails/src/data/proxy/Rest.js +173 -0
  218. data/app/assets/javascripts/extjs-rails/src/data/proxy/Server.js +460 -0
  219. data/app/assets/javascripts/extjs-rails/src/data/proxy/SessionStorage.js +39 -0
  220. data/app/assets/javascripts/extjs-rails/src/data/proxy/WebStorage.js +546 -0
  221. data/app/assets/javascripts/extjs-rails/src/data/reader/Array.js +68 -0
  222. data/app/assets/javascripts/extjs-rails/src/data/reader/Json.js +383 -0
  223. data/app/assets/javascripts/extjs-rails/src/data/reader/Reader.js +735 -0
  224. data/app/assets/javascripts/extjs-rails/src/data/reader/Xml.js +292 -0
  225. data/app/assets/javascripts/extjs-rails/src/data/validations.js +149 -0
  226. data/app/assets/javascripts/extjs-rails/src/data/writer/Json.js +81 -0
  227. data/app/assets/javascripts/extjs-rails/src/data/writer/Writer.js +147 -0
  228. data/app/assets/javascripts/extjs-rails/src/data/writer/Xml.js +88 -0
  229. data/app/assets/javascripts/extjs-rails/src/dd/DD.js +300 -0
  230. data/app/assets/javascripts/extjs-rails/src/dd/DDProxy.js +204 -0
  231. data/app/assets/javascripts/extjs-rails/src/dd/DDTarget.js +171 -0
  232. data/app/assets/javascripts/extjs-rails/src/dd/DragDrop.js +1101 -0
  233. data/app/assets/javascripts/extjs-rails/src/dd/DragDropManager.js +1264 -0
  234. data/app/assets/javascripts/extjs-rails/src/dd/DragSource.js +392 -0
  235. data/app/assets/javascripts/extjs-rails/src/dd/DragTracker.js +562 -0
  236. data/app/assets/javascripts/extjs-rails/src/dd/DragZone.js +137 -0
  237. data/app/assets/javascripts/extjs-rails/src/dd/DropTarget.js +118 -0
  238. data/app/assets/javascripts/extjs-rails/src/dd/DropZone.js +254 -0
  239. data/app/assets/javascripts/extjs-rails/src/dd/Registry.js +117 -0
  240. data/app/assets/javascripts/extjs-rails/src/dd/ScrollManager.js +218 -0
  241. data/app/assets/javascripts/extjs-rails/src/dd/StatusProxy.js +179 -0
  242. data/app/assets/javascripts/extjs-rails/src/diag/layout/Context.js +523 -0
  243. data/app/assets/javascripts/extjs-rails/src/diag/layout/ContextItem.js +179 -0
  244. data/app/assets/javascripts/extjs-rails/src/direct/Event.js +35 -0
  245. data/app/assets/javascripts/extjs-rails/src/direct/ExceptionEvent.js +16 -0
  246. data/app/assets/javascripts/extjs-rails/src/direct/JsonProvider.js +82 -0
  247. data/app/assets/javascripts/extjs-rails/src/direct/Manager.js +263 -0
  248. data/app/assets/javascripts/extjs-rails/src/direct/PollingProvider.js +156 -0
  249. data/app/assets/javascripts/extjs-rails/src/direct/Provider.js +96 -0
  250. data/app/assets/javascripts/extjs-rails/src/direct/RemotingEvent.js +24 -0
  251. data/app/assets/javascripts/extjs-rails/src/direct/RemotingMethod.js +100 -0
  252. data/app/assets/javascripts/extjs-rails/src/direct/RemotingProvider.js +510 -0
  253. data/app/assets/javascripts/extjs-rails/src/direct/Transaction.js +41 -0
  254. data/app/assets/javascripts/extjs-rails/src/dom/Element.alignment.js +378 -0
  255. data/app/assets/javascripts/extjs-rails/src/dom/Element.anim.js +962 -0
  256. data/app/assets/javascripts/extjs-rails/src/dom/Element.dd.js +40 -0
  257. data/app/assets/javascripts/extjs-rails/src/dom/Element.fx.js +194 -0
  258. data/app/assets/javascripts/extjs-rails/src/dom/Element.js +1407 -0
  259. data/app/assets/javascripts/extjs-rails/src/dom/Element.position.js +501 -0
  260. data/app/assets/javascripts/extjs-rails/src/dom/Element.scroll.js +214 -0
  261. data/app/assets/javascripts/extjs-rails/src/dom/Element.style.js +792 -0
  262. data/app/assets/javascripts/extjs-rails/src/dom/Element.traversal.js +8 -0
  263. data/app/assets/javascripts/extjs-rails/src/dom/Helper.js +466 -0
  264. data/app/assets/javascripts/extjs-rails/src/dom/Query.js +1067 -0
  265. data/app/assets/javascripts/extjs-rails/src/draw/Color.js +303 -0
  266. data/app/assets/javascripts/extjs-rails/src/draw/Component.js +245 -0
  267. data/app/assets/javascripts/extjs-rails/src/draw/CompositeSprite.js +299 -0
  268. data/app/assets/javascripts/extjs-rails/src/draw/Draw.js +1217 -0
  269. data/app/assets/javascripts/extjs-rails/src/draw/Matrix.js +183 -0
  270. data/app/assets/javascripts/extjs-rails/src/draw/Sprite.js +554 -0
  271. data/app/assets/javascripts/extjs-rails/src/draw/SpriteDD.js +87 -0
  272. data/app/assets/javascripts/extjs-rails/src/draw/Surface.js +1001 -0
  273. data/app/assets/javascripts/extjs-rails/src/draw/Text.js +175 -0
  274. data/app/assets/javascripts/extjs-rails/src/draw/engine/ImageExporter.js +106 -0
  275. data/app/assets/javascripts/extjs-rails/src/draw/engine/Svg.js +734 -0
  276. data/app/assets/javascripts/extjs-rails/src/draw/engine/SvgExporter.js +280 -0
  277. data/app/assets/javascripts/extjs-rails/src/draw/engine/Vml.js +916 -0
  278. data/app/assets/javascripts/extjs-rails/src/flash/Component.js +248 -0
  279. data/app/assets/javascripts/extjs-rails/src/form/Basic.js +1018 -0
  280. data/app/assets/javascripts/extjs-rails/src/form/CheckboxGroup.js +441 -0
  281. data/app/assets/javascripts/extjs-rails/src/form/CheckboxManager.js +26 -0
  282. data/app/assets/javascripts/extjs-rails/src/form/FieldAncestor.js +210 -0
  283. data/app/assets/javascripts/extjs-rails/src/form/FieldContainer.js +290 -0
  284. data/app/assets/javascripts/extjs-rails/src/form/FieldSet.js +506 -0
  285. data/app/assets/javascripts/extjs-rails/src/form/Label.js +110 -0
  286. data/app/assets/javascripts/extjs-rails/src/form/Labelable.js +764 -0
  287. data/app/assets/javascripts/extjs-rails/src/form/Panel.js +335 -0
  288. data/app/assets/javascripts/extjs-rails/src/form/RadioGroup.js +124 -0
  289. data/app/assets/javascripts/extjs-rails/src/form/RadioManager.js +26 -0
  290. data/app/assets/javascripts/extjs-rails/src/form/action/Action.js +307 -0
  291. data/app/assets/javascripts/extjs-rails/src/form/action/DirectLoad.js +107 -0
  292. data/app/assets/javascripts/extjs-rails/src/form/action/DirectSubmit.js +119 -0
  293. data/app/assets/javascripts/extjs-rails/src/form/action/Load.js +120 -0
  294. data/app/assets/javascripts/extjs-rails/src/form/action/StandardSubmit.js +34 -0
  295. data/app/assets/javascripts/extjs-rails/src/form/action/Submit.js +257 -0
  296. data/app/assets/javascripts/extjs-rails/src/form/field/Base.js +813 -0
  297. data/app/assets/javascripts/extjs-rails/src/form/field/Checkbox.js +505 -0
  298. data/app/assets/javascripts/extjs-rails/src/form/field/ComboBox.js +1427 -0
  299. data/app/assets/javascripts/extjs-rails/src/form/field/Date.js +578 -0
  300. data/app/assets/javascripts/extjs-rails/src/form/field/Display.js +155 -0
  301. data/app/assets/javascripts/extjs-rails/src/form/field/Field.js +430 -0
  302. data/app/assets/javascripts/extjs-rails/src/form/field/File.js +265 -0
  303. data/app/assets/javascripts/extjs-rails/src/form/field/Hidden.js +75 -0
  304. data/app/assets/javascripts/extjs-rails/src/form/field/HtmlEditor.js +1439 -0
  305. data/app/assets/javascripts/extjs-rails/src/form/field/Number.js +380 -0
  306. data/app/assets/javascripts/extjs-rails/src/form/field/Picker.js +321 -0
  307. data/app/assets/javascripts/extjs-rails/src/form/field/Radio.js +279 -0
  308. data/app/assets/javascripts/extjs-rails/src/form/field/Spinner.js +321 -0
  309. data/app/assets/javascripts/extjs-rails/src/form/field/Text.js +727 -0
  310. data/app/assets/javascripts/extjs-rails/src/form/field/TextArea.js +228 -0
  311. data/app/assets/javascripts/extjs-rails/src/form/field/Time.js +459 -0
  312. data/app/assets/javascripts/extjs-rails/src/form/field/Trigger.js +469 -0
  313. data/app/assets/javascripts/extjs-rails/src/form/field/VTypes.js +172 -0
  314. data/app/assets/javascripts/extjs-rails/src/fx/Anim.js +472 -0
  315. data/app/assets/javascripts/extjs-rails/src/fx/Animator.js +410 -0
  316. data/app/assets/javascripts/extjs-rails/src/fx/CubicBezier.js +77 -0
  317. data/app/assets/javascripts/extjs-rails/src/fx/Easing.js +136 -0
  318. data/app/assets/javascripts/extjs-rails/src/fx/Manager.js +353 -0
  319. data/app/assets/javascripts/extjs-rails/src/fx/PropertyHandler.js +381 -0
  320. data/app/assets/javascripts/extjs-rails/src/fx/Queue.js +123 -0
  321. data/app/assets/javascripts/extjs-rails/src/fx/target/Component.js +118 -0
  322. data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeElement.js +46 -0
  323. data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeElementCSS.js +22 -0
  324. data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeSprite.js +34 -0
  325. data/app/assets/javascripts/extjs-rails/src/fx/target/Element.js +83 -0
  326. data/app/assets/javascripts/extjs-rails/src/fx/target/ElementCSS.js +77 -0
  327. data/app/assets/javascripts/extjs-rails/src/fx/target/Sprite.js +128 -0
  328. data/app/assets/javascripts/extjs-rails/src/fx/target/Target.js +36 -0
  329. data/app/assets/javascripts/extjs-rails/src/grid/CellEditor.js +172 -0
  330. data/app/assets/javascripts/extjs-rails/src/grid/ColumnComponentLayout.js +34 -0
  331. data/app/assets/javascripts/extjs-rails/src/grid/ColumnLayout.js +201 -0
  332. data/app/assets/javascripts/extjs-rails/src/grid/Lockable.js +863 -0
  333. data/app/assets/javascripts/extjs-rails/src/grid/LockingView.js +169 -0
  334. data/app/assets/javascripts/extjs-rails/src/grid/PagingScroller.js +539 -0
  335. data/app/assets/javascripts/extjs-rails/src/grid/Panel.js +393 -0
  336. data/app/assets/javascripts/extjs-rails/src/grid/RowEditor.js +731 -0
  337. data/app/assets/javascripts/extjs-rails/src/grid/RowNumberer.js +76 -0
  338. data/app/assets/javascripts/extjs-rails/src/grid/Scroller.js +5 -0
  339. data/app/assets/javascripts/extjs-rails/src/grid/View.js +44 -0
  340. data/app/assets/javascripts/extjs-rails/src/grid/ViewDropZone.js +41 -0
  341. data/app/assets/javascripts/extjs-rails/src/grid/column/Action.js +318 -0
  342. data/app/assets/javascripts/extjs-rails/src/grid/column/Boolean.js +82 -0
  343. data/app/assets/javascripts/extjs-rails/src/grid/column/Column.js +835 -0
  344. data/app/assets/javascripts/extjs-rails/src/grid/column/Date.js +63 -0
  345. data/app/assets/javascripts/extjs-rails/src/grid/column/Number.js +52 -0
  346. data/app/assets/javascripts/extjs-rails/src/grid/column/Template.js +58 -0
  347. data/app/assets/javascripts/extjs-rails/src/grid/feature/AbstractSummary.js +154 -0
  348. data/app/assets/javascripts/extjs-rails/src/grid/feature/Chunking.js +77 -0
  349. data/app/assets/javascripts/extjs-rails/src/grid/feature/Feature.js +158 -0
  350. data/app/assets/javascripts/extjs-rails/src/grid/feature/Grouping.js +822 -0
  351. data/app/assets/javascripts/extjs-rails/src/grid/feature/GroupingSummary.js +243 -0
  352. data/app/assets/javascripts/extjs-rails/src/grid/feature/RowBody.js +116 -0
  353. data/app/assets/javascripts/extjs-rails/src/grid/feature/RowWrap.js +120 -0
  354. data/app/assets/javascripts/extjs-rails/src/grid/feature/Summary.js +167 -0
  355. data/app/assets/javascripts/extjs-rails/src/grid/header/Container.js +965 -0
  356. data/app/assets/javascripts/extjs-rails/src/grid/header/DragZone.js +69 -0
  357. data/app/assets/javascripts/extjs-rails/src/grid/header/DropZone.js +265 -0
  358. data/app/assets/javascripts/extjs-rails/src/grid/plugin/CellEditing.js +453 -0
  359. data/app/assets/javascripts/extjs-rails/src/grid/plugin/DragDrop.js +254 -0
  360. data/app/assets/javascripts/extjs-rails/src/grid/plugin/Editing.js +561 -0
  361. data/app/assets/javascripts/extjs-rails/src/grid/plugin/HeaderReorderer.js +49 -0
  362. data/app/assets/javascripts/extjs-rails/src/grid/plugin/HeaderResizer.js +292 -0
  363. data/app/assets/javascripts/extjs-rails/src/grid/plugin/RowEditing.js +339 -0
  364. data/app/assets/javascripts/extjs-rails/src/grid/property/Grid.js +351 -0
  365. data/app/assets/javascripts/extjs-rails/src/grid/property/HeaderContainer.js +109 -0
  366. data/app/assets/javascripts/extjs-rails/src/grid/property/Property.js +36 -0
  367. data/app/assets/javascripts/extjs-rails/src/grid/property/Store.js +141 -0
  368. data/app/assets/javascripts/extjs-rails/src/layout/ClassList.js +90 -0
  369. data/app/assets/javascripts/extjs-rails/src/layout/Context.js +1232 -0
  370. data/app/assets/javascripts/extjs-rails/src/layout/ContextItem.js +1470 -0
  371. data/app/assets/javascripts/extjs-rails/src/layout/Layout.js +761 -0
  372. data/app/assets/javascripts/extjs-rails/src/layout/component/Auto.js +220 -0
  373. data/app/assets/javascripts/extjs-rails/src/layout/component/Body.js +80 -0
  374. data/app/assets/javascripts/extjs-rails/src/layout/component/BoundList.js +95 -0
  375. data/app/assets/javascripts/extjs-rails/src/layout/component/Button.js +261 -0
  376. data/app/assets/javascripts/extjs-rails/src/layout/component/Component.js +427 -0
  377. data/app/assets/javascripts/extjs-rails/src/layout/component/Dock.js +1132 -0
  378. data/app/assets/javascripts/extjs-rails/src/layout/component/Draw.js +79 -0
  379. data/app/assets/javascripts/extjs-rails/src/layout/component/FieldSet.js +62 -0
  380. data/app/assets/javascripts/extjs-rails/src/layout/component/ProgressBar.js +54 -0
  381. data/app/assets/javascripts/extjs-rails/src/layout/component/Tab.js +23 -0
  382. data/app/assets/javascripts/extjs-rails/src/layout/component/field/ComboBox.js +52 -0
  383. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Field.js +372 -0
  384. data/app/assets/javascripts/extjs-rails/src/layout/component/field/FieldContainer.js +48 -0
  385. data/app/assets/javascripts/extjs-rails/src/layout/component/field/HtmlEditor.js +54 -0
  386. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Slider.js +58 -0
  387. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Text.js +75 -0
  388. data/app/assets/javascripts/extjs-rails/src/layout/component/field/TextArea.js +51 -0
  389. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Trigger.js +132 -0
  390. data/app/assets/javascripts/extjs-rails/src/layout/container/Absolute.js +121 -0
  391. data/app/assets/javascripts/extjs-rails/src/layout/container/Accordion.js +308 -0
  392. data/app/assets/javascripts/extjs-rails/src/layout/container/Anchor.js +403 -0
  393. data/app/assets/javascripts/extjs-rails/src/layout/container/Auto.js +70 -0
  394. data/app/assets/javascripts/extjs-rails/src/layout/container/Border-old-js +1079 -0
  395. data/app/assets/javascripts/extjs-rails/src/layout/container/Border.js +816 -0
  396. data/app/assets/javascripts/extjs-rails/src/layout/container/Box.js +929 -0
  397. data/app/assets/javascripts/extjs-rails/src/layout/container/Card.js +361 -0
  398. data/app/assets/javascripts/extjs-rails/src/layout/container/CheckboxGroup.js +376 -0
  399. data/app/assets/javascripts/extjs-rails/src/layout/container/Column.js +234 -0
  400. data/app/assets/javascripts/extjs-rails/src/layout/container/Container.js +961 -0
  401. data/app/assets/javascripts/extjs-rails/src/layout/container/Editor.js +74 -0
  402. data/app/assets/javascripts/extjs-rails/src/layout/container/Fit.js +287 -0
  403. data/app/assets/javascripts/extjs-rails/src/layout/container/Form.js +157 -0
  404. data/app/assets/javascripts/extjs-rails/src/layout/container/HBox.js +134 -0
  405. data/app/assets/javascripts/extjs-rails/src/layout/container/Table.js +412 -0
  406. data/app/assets/javascripts/extjs-rails/src/layout/container/VBox.js +139 -0
  407. data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/Menu.js +365 -0
  408. data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/None.js +83 -0
  409. data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/Scroller.js +475 -0
  410. data/app/assets/javascripts/extjs-rails/src/menu/CheckItem.js +169 -0
  411. data/app/assets/javascripts/extjs-rails/src/menu/ColorPicker.js +110 -0
  412. data/app/assets/javascripts/extjs-rails/src/menu/DatePicker.js +100 -0
  413. data/app/assets/javascripts/extjs-rails/src/menu/Item.js +553 -0
  414. data/app/assets/javascripts/extjs-rails/src/menu/KeyNav.js +134 -0
  415. data/app/assets/javascripts/extjs-rails/src/menu/Manager.js +219 -0
  416. data/app/assets/javascripts/extjs-rails/src/menu/Menu.js +579 -0
  417. data/app/assets/javascripts/extjs-rails/src/menu/Separator.js +126 -0
  418. data/app/assets/javascripts/extjs-rails/src/panel/AbstractPanel.js +323 -0
  419. data/app/assets/javascripts/extjs-rails/src/panel/DD.js +99 -0
  420. data/app/assets/javascripts/extjs-rails/src/panel/Header.js +518 -0
  421. data/app/assets/javascripts/extjs-rails/src/panel/Panel.js +2150 -0
  422. data/app/assets/javascripts/extjs-rails/src/panel/Proxy.js +131 -0
  423. data/app/assets/javascripts/extjs-rails/src/panel/Table.js +1018 -0
  424. data/app/assets/javascripts/extjs-rails/src/panel/Tool.js +304 -0
  425. data/app/assets/javascripts/extjs-rails/src/picker/Color.js +219 -0
  426. data/app/assets/javascripts/extjs-rails/src/picker/Date.js +1140 -0
  427. data/app/assets/javascripts/extjs-rails/src/picker/Month.js +490 -0
  428. data/app/assets/javascripts/extjs-rails/src/picker/Time.js +165 -0
  429. data/app/assets/javascripts/extjs-rails/src/resizer/BorderSplitter.js +22 -0
  430. data/app/assets/javascripts/extjs-rails/src/resizer/BorderSplitterTracker.js +210 -0
  431. data/app/assets/javascripts/extjs-rails/src/resizer/Handle.js +29 -0
  432. data/app/assets/javascripts/extjs-rails/src/resizer/ResizeTracker.js +346 -0
  433. data/app/assets/javascripts/extjs-rails/src/resizer/Resizer.js +477 -0
  434. data/app/assets/javascripts/extjs-rails/src/resizer/Splitter.js +242 -0
  435. data/app/assets/javascripts/extjs-rails/src/resizer/SplitterTracker.js +230 -0
  436. data/app/assets/javascripts/extjs-rails/src/selection/CellModel.js +395 -0
  437. data/app/assets/javascripts/extjs-rails/src/selection/CheckboxModel.js +234 -0
  438. data/app/assets/javascripts/extjs-rails/src/selection/DataViewModel.js +160 -0
  439. data/app/assets/javascripts/extjs-rails/src/selection/Model.js +646 -0
  440. data/app/assets/javascripts/extjs-rails/src/selection/RowModel.js +499 -0
  441. data/app/assets/javascripts/extjs-rails/src/selection/TreeModel.js +78 -0
  442. data/app/assets/javascripts/extjs-rails/src/slider/Multi.js +835 -0
  443. data/app/assets/javascripts/extjs-rails/src/slider/Single.js +56 -0
  444. data/app/assets/javascripts/extjs-rails/src/slider/Thumb.js +259 -0
  445. data/app/assets/javascripts/extjs-rails/src/slider/Tip.js +130 -0
  446. data/app/assets/javascripts/extjs-rails/src/state/CookieProvider.js +120 -0
  447. data/app/assets/javascripts/extjs-rails/src/state/LocalStorageProvider.js +72 -0
  448. data/app/assets/javascripts/extjs-rails/src/state/Manager.js +70 -0
  449. data/app/assets/javascripts/extjs-rails/src/state/Provider.js +182 -0
  450. data/app/assets/javascripts/extjs-rails/src/state/Stateful.js +364 -0
  451. data/app/assets/javascripts/extjs-rails/src/tab/Bar.js +258 -0
  452. data/app/assets/javascripts/extjs-rails/src/tab/Panel.js +654 -0
  453. data/app/assets/javascripts/extjs-rails/src/tab/Tab.js +358 -0
  454. data/app/assets/javascripts/extjs-rails/src/tail.js +10 -0
  455. data/app/assets/javascripts/extjs-rails/src/tip/QuickTip.js +335 -0
  456. data/app/assets/javascripts/extjs-rails/src/tip/QuickTipManager.js +239 -0
  457. data/app/assets/javascripts/extjs-rails/src/tip/Tip.js +160 -0
  458. data/app/assets/javascripts/extjs-rails/src/tip/ToolTip.js +691 -0
  459. data/app/assets/javascripts/extjs-rails/src/toolbar/Fill.js +28 -0
  460. data/app/assets/javascripts/extjs-rails/src/toolbar/Item.js +16 -0
  461. data/app/assets/javascripts/extjs-rails/src/toolbar/Paging.js +600 -0
  462. data/app/assets/javascripts/extjs-rails/src/toolbar/Separator.js +23 -0
  463. data/app/assets/javascripts/extjs-rails/src/toolbar/Spacer.js +33 -0
  464. data/app/assets/javascripts/extjs-rails/src/toolbar/TextItem.js +57 -0
  465. data/app/assets/javascripts/extjs-rails/src/toolbar/Toolbar-legacy.js +123 -0
  466. data/app/assets/javascripts/extjs-rails/src/toolbar/Toolbar.js +447 -0
  467. data/app/assets/javascripts/extjs-rails/src/tree/Column.js +90 -0
  468. data/app/assets/javascripts/extjs-rails/src/tree/Panel.js +505 -0
  469. data/app/assets/javascripts/extjs-rails/src/tree/View.js +658 -0
  470. data/app/assets/javascripts/extjs-rails/src/tree/ViewDragZone.js +49 -0
  471. data/app/assets/javascripts/extjs-rails/src/tree/ViewDropZone.js +287 -0
  472. data/app/assets/javascripts/extjs-rails/src/tree/plugin/TreeViewDragDrop.js +244 -0
  473. data/app/assets/javascripts/extjs-rails/src/util/AbstractMixedCollection.js +772 -0
  474. data/app/assets/javascripts/extjs-rails/src/util/Animate.js +426 -0
  475. data/app/assets/javascripts/extjs-rails/src/util/Bindable.js +102 -0
  476. data/app/assets/javascripts/extjs-rails/src/util/CSS.js +185 -0
  477. data/app/assets/javascripts/extjs-rails/src/util/ClickRepeater.js +238 -0
  478. data/app/assets/javascripts/extjs-rails/src/util/ComponentDragger.js +126 -0
  479. data/app/assets/javascripts/extjs-rails/src/util/Cookies.js +91 -0
  480. data/app/assets/javascripts/extjs-rails/src/util/ElementContainer.js +293 -0
  481. data/app/assets/javascripts/extjs-rails/src/util/Filter.js +159 -0
  482. data/app/assets/javascripts/extjs-rails/src/util/Floating.js +321 -0
  483. data/app/assets/javascripts/extjs-rails/src/util/Grouper.js +26 -0
  484. data/app/assets/javascripts/extjs-rails/src/util/HashMap.js +356 -0
  485. data/app/assets/javascripts/extjs-rails/src/util/History.js +285 -0
  486. data/app/assets/javascripts/extjs-rails/src/util/Inflector.js +297 -0
  487. data/app/assets/javascripts/extjs-rails/src/util/KeyMap.js +427 -0
  488. data/app/assets/javascripts/extjs-rails/src/util/KeyNav.js +239 -0
  489. data/app/assets/javascripts/extjs-rails/src/util/LruCache.js +257 -0
  490. data/app/assets/javascripts/extjs-rails/src/util/Memento.js +131 -0
  491. data/app/assets/javascripts/extjs-rails/src/util/MixedCollection.js +239 -0
  492. data/app/assets/javascripts/extjs-rails/src/util/Observable.js +1003 -0
  493. data/app/assets/javascripts/extjs-rails/src/util/Offset.js +60 -0
  494. data/app/assets/javascripts/extjs-rails/src/util/Point.js +93 -0
  495. data/app/assets/javascripts/extjs-rails/src/util/ProtoElement.js +205 -0
  496. data/app/assets/javascripts/extjs-rails/src/util/Queue.js +76 -0
  497. data/app/assets/javascripts/extjs-rails/src/util/Region.js +388 -0
  498. data/app/assets/javascripts/extjs-rails/src/util/Renderable.js +1079 -0
  499. data/app/assets/javascripts/extjs-rails/src/util/Sortable.js +248 -0
  500. data/app/assets/javascripts/extjs-rails/src/util/Sorter.js +179 -0
  501. data/app/assets/javascripts/extjs-rails/src/util/TextMetrics.js +148 -0
  502. data/app/assets/javascripts/extjs-rails/src/view/AbstractView.js +1103 -0
  503. data/app/assets/javascripts/extjs-rails/src/view/BoundList.js +207 -0
  504. data/app/assets/javascripts/extjs-rails/src/view/BoundListKeyNav.js +92 -0
  505. data/app/assets/javascripts/extjs-rails/src/view/DragZone.js +106 -0
  506. data/app/assets/javascripts/extjs-rails/src/view/DropZone.js +240 -0
  507. data/app/assets/javascripts/extjs-rails/src/view/Table.js +1229 -0
  508. data/app/assets/javascripts/extjs-rails/src/view/TableChunker.js +139 -0
  509. data/app/assets/javascripts/extjs-rails/src/view/View.js +636 -0
  510. data/app/assets/javascripts/extjs-rails/src/window/MessageBox.js +880 -0
  511. data/app/assets/javascripts/extjs-rails/src/window/Window-legacy.js +56 -0
  512. data/app/assets/javascripts/extjs-rails/src/window/Window.js +793 -0
  513. data/extjs-rails.gemspec +24 -0
  514. data/lib/extjs-rails.rb +7 -0
  515. data/lib/extjs-rails/engine.rb +7 -0
  516. data/lib/extjs-rails/version.rb +5 -0
  517. metadata +660 -0
@@ -0,0 +1,36 @@
1
+ /**
2
+ * A specific {@link Ext.data.Model} type that represents a name/value pair and is made to work with the
3
+ * {@link Ext.grid.property.Grid}. Typically, Properties do not need to be created directly as they can be
4
+ * created implicitly by simply using the appropriate data configs either via the
5
+ * {@link Ext.grid.property.Grid#source} config property or by calling {@link Ext.grid.property.Grid#setSource}.
6
+ * However, if the need arises, these records can also be created explicitly as shown below. Example usage:
7
+ *
8
+ * var rec = new Ext.grid.property.Property({
9
+ * name: 'birthday',
10
+ * value: Ext.Date.parse('17/06/1962', 'd/m/Y')
11
+ * });
12
+ * // Add record to an already populated grid
13
+ * grid.store.addSorted(rec);
14
+ *
15
+ * @constructor
16
+ * Creates new property.
17
+ * @param {Object} config A data object in the format:
18
+ * @param {String/String[]} config.name A name or names for the property.
19
+ * @param {Mixed/Mixed[]} config.value A value or values for the property.
20
+ * The specified value's type will be read automatically by the grid to determine the type of editor to use when
21
+ * displaying it.
22
+ * @return {Object}
23
+ */
24
+ Ext.define('Ext.grid.property.Property', {
25
+ extend: 'Ext.data.Model',
26
+
27
+ alternateClassName: 'Ext.PropGridProperty',
28
+
29
+ fields: [{
30
+ name: 'name',
31
+ type: 'string'
32
+ }, {
33
+ name: 'value'
34
+ }],
35
+ idProperty: 'name'
36
+ });
@@ -0,0 +1,141 @@
1
+ /**
2
+ * A custom {@link Ext.data.Store} for the {@link Ext.grid.property.Grid}. This class handles the mapping
3
+ * between the custom data source objects supported by the grid and the {@link Ext.grid.property.Property} format
4
+ * used by the {@link Ext.data.Store} base class.
5
+ */
6
+ Ext.define('Ext.grid.property.Store', {
7
+
8
+ extend: 'Ext.data.Store',
9
+
10
+ alternateClassName: 'Ext.grid.PropertyStore',
11
+
12
+ sortOnLoad: false,
13
+
14
+ uses: ['Ext.data.reader.Reader', 'Ext.data.proxy.Proxy', 'Ext.data.ResultSet', 'Ext.grid.property.Property'],
15
+
16
+ /**
17
+ * Creates new property store.
18
+ * @param {Ext.grid.Panel} grid The grid this store will be bound to
19
+ * @param {Object} source The source data config object
20
+ */
21
+ constructor : function(grid, source){
22
+ var me = this;
23
+
24
+ me.grid = grid;
25
+ me.source = source;
26
+ me.callParent([{
27
+ data: source,
28
+ model: Ext.grid.property.Property,
29
+ proxy: me.getProxy()
30
+ }]);
31
+ },
32
+
33
+ // Return a singleton, customized Proxy object which configures itself with a custom Reader
34
+ getProxy: function() {
35
+ if (!this.proxy) {
36
+ Ext.grid.property.Store.prototype.proxy = new Ext.data.proxy.Memory({
37
+ model: Ext.grid.property.Property,
38
+ reader: this.getReader()
39
+ });
40
+ }
41
+ return this.proxy;
42
+ },
43
+
44
+ // Return a singleton, customized Reader object which reads Ext.grid.property.Property records from an object.
45
+ getReader: function() {
46
+ if (!this.reader) {
47
+ Ext.grid.property.Store.prototype.reader = new Ext.data.reader.Reader({
48
+ model: Ext.grid.property.Property,
49
+
50
+ buildExtractors: Ext.emptyFn,
51
+
52
+ read: function(dataObject) {
53
+ return this.readRecords(dataObject);
54
+ },
55
+
56
+ readRecords: function(dataObject) {
57
+ var val,
58
+ propName,
59
+ result = {
60
+ records: [],
61
+ success: true
62
+ };
63
+
64
+ for (propName in dataObject) {
65
+ if (dataObject.hasOwnProperty(propName)) {
66
+ val = dataObject[propName];
67
+ if (this.isEditableValue(val)) {
68
+ result.records.push(new Ext.grid.property.Property({
69
+ name: propName,
70
+ value: val
71
+ }, propName));
72
+ }
73
+ }
74
+ }
75
+ result.total = result.count = result.records.length;
76
+ return new Ext.data.ResultSet(result);
77
+ },
78
+
79
+ // private
80
+ isEditableValue: function(val){
81
+ return Ext.isPrimitive(val) || Ext.isDate(val);
82
+ }
83
+ });
84
+ }
85
+ return this.reader;
86
+ },
87
+
88
+ // protected - should only be called by the grid. Use grid.setSource instead.
89
+ setSource : function(dataObject) {
90
+ var me = this;
91
+
92
+ me.source = dataObject;
93
+ me.suspendEvents();
94
+ me.removeAll();
95
+ me.proxy.data = dataObject;
96
+ me.load();
97
+ me.resumeEvents();
98
+ me.fireEvent('datachanged', me);
99
+ me.fireEvent('refresh', me);
100
+ },
101
+
102
+ // private
103
+ getProperty : function(row) {
104
+ return Ext.isNumber(row) ? this.getAt(row) : this.getById(row);
105
+ },
106
+
107
+ // private
108
+ setValue : function(prop, value, create){
109
+ var me = this,
110
+ rec = me.getRec(prop);
111
+
112
+ if (rec) {
113
+ rec.set('value', value);
114
+ me.source[prop] = value;
115
+ } else if (create) {
116
+ // only create if specified.
117
+ me.source[prop] = value;
118
+ rec = new Ext.grid.property.Property({name: prop, value: value}, prop);
119
+ me.add(rec);
120
+ }
121
+ },
122
+
123
+ // private
124
+ remove : function(prop) {
125
+ var rec = this.getRec(prop);
126
+ if (rec) {
127
+ this.callParent([rec]);
128
+ delete this.source[prop];
129
+ }
130
+ },
131
+
132
+ // private
133
+ getRec : function(prop) {
134
+ return this.getById(prop);
135
+ },
136
+
137
+ // protected - should only be called by the grid. Use grid.getSource instead.
138
+ getSource : function() {
139
+ return this.source;
140
+ }
141
+ });
@@ -0,0 +1,90 @@
1
+ /**
2
+ * This class provides a DOM ClassList API to buffer access to an element's class.
3
+ * Instances of this class are created by {@link Ext.layout.ContextItem#getClassList}.
4
+ */
5
+ Ext.define('Ext.layout.ClassList', (function () {
6
+
7
+ var splitWords = Ext.String.splitWords,
8
+ toMap = Ext.Array.toMap;
9
+
10
+ return {
11
+ dirty: false,
12
+
13
+ constructor: function (owner) {
14
+ this.owner = owner;
15
+ this.map = toMap(this.classes = splitWords(owner.el.className));
16
+ },
17
+
18
+ /**
19
+ * Adds a single class to the class list.
20
+ */
21
+ add: function (cls) {
22
+ var me = this;
23
+
24
+ if (!me.map[cls]) {
25
+ me.map[cls] = true;
26
+ me.classes.push(cls);
27
+ if (!me.dirty) {
28
+ me.dirty = true;
29
+ me.owner.markDirty();
30
+ }
31
+ }
32
+ },
33
+
34
+ /**
35
+ * Adds one or more classes in an array or space-delimited string to the class list.
36
+ */
37
+ addMany: function (classes) {
38
+ Ext.each(splitWords(classes), this.add, this);
39
+ },
40
+
41
+ contains: function (cls) {
42
+ return this.map[cls];
43
+ },
44
+
45
+ flush: function () {
46
+ this.owner.el.className = this.classes.join(' ');
47
+ this.dirty = false;
48
+ },
49
+
50
+ /**
51
+ * Removes a single class from the class list.
52
+ */
53
+ remove: function (cls) {
54
+ var me = this;
55
+
56
+ if (me.map[cls]) {
57
+ delete me.map[cls];
58
+ me.classes = Ext.Array.filter(me.classes, function (c) {
59
+ return c != cls;
60
+ });
61
+ if (!me.dirty) {
62
+ me.dirty = true;
63
+ me.owner.markDirty();
64
+ }
65
+ }
66
+ },
67
+
68
+ /**
69
+ * Removes one or more classes in an array or space-delimited string from the class
70
+ * list.
71
+ */
72
+ removeMany: function (classes) {
73
+ var me = this,
74
+ remove = toMap(splitWords(classes));
75
+
76
+ me.classes = Ext.Array.filter(me.classes, function (c) {
77
+ if (!remove[c]) {
78
+ return true;
79
+ }
80
+
81
+ delete me.map[c];
82
+ if (!me.dirty) {
83
+ me.dirty = true;
84
+ me.owner.markDirty();
85
+ }
86
+ return false;
87
+ });
88
+ }
89
+ };
90
+ }()));
@@ -0,0 +1,1232 @@
1
+ /**
2
+ * Manages context information during a layout.
3
+ *
4
+ * # Algorithm
5
+ *
6
+ * This class performs the following jobs:
7
+ *
8
+ * - Cache DOM reads to avoid reading the same values repeatedly.
9
+ * - Buffer DOM writes and flush them as a block to avoid read/write interleaving.
10
+ * - Track layout dependencies so each layout does not have to figure out the source of
11
+ * its dependent values.
12
+ * - Intelligently run layouts when the values on which they depend change (a trigger).
13
+ * - Allow layouts to avoid processing when required values are unavailable (a block).
14
+ *
15
+ * Work done during layout falls into either a "read phase" or a "write phase" and it is
16
+ * essential to always be aware of the current phase. Most methods in
17
+ * {@link Ext.layout.Layout Layout} are called during a read phase:
18
+ * {@link Ext.layout.Layout#calculate claculate},
19
+ * {@link Ext.layout.Layout#completeLayout completeLayout} and
20
+ * {@link Ext.layout.Layout#finalizeLayout finalizeLayout}. The exceptions to this are
21
+ * {@link Ext.layout.Layout#beginLayout beginLayout},
22
+ * {@link Ext.layout.Layout#beginLayoutCycle beginLayoutCycle} and
23
+ * {@link Ext.layout.Layout#finishedLayout finishedLayout} which are called during
24
+ * a write phase. While {@link Ext.layout.Layout#finishedLayout finishedLayout} is called
25
+ * a write phase, it is really intended to be a catch-all for post-processing after a
26
+ * layout run.
27
+ *
28
+ * In a read phase, it is OK to read the DOM but this should be done using the appropriate
29
+ * {@link Ext.layout.ContextItem ContextItem} where possible since that provides a cache
30
+ * to avoid redundant reads. No writes should be made to the DOM in a read phase! Instead,
31
+ * the values should be written to the proper ContextItem for later write-back.
32
+ *
33
+ * The rules flip-flop in a write phase. The only difference is that ContextItem methods
34
+ * like {@link Ext.layout.ContextItem#getStyle getStyle} will still read the DOM unless the
35
+ * value was previously read. This detail is unknowable from the outside of ContextItem, so
36
+ * read calls to ContextItem should also be avoided in a write phase.
37
+ *
38
+ * Calculating interdependent layouts requires a certain amount of iteration. In a given
39
+ * cycle, some layouts will contribute results that allow other layouts to proceed. The
40
+ * general flow then is to gather all of the layouts (both component and container) in a
41
+ * component tree and queue them all for processing. The initial queue order is bottom-up
42
+ * and component layout first, then container layout (if applicable) for each component.
43
+ *
44
+ * This initial step also calls the beginLayout method on all layouts to clear any values
45
+ * from the DOM that might interfere with calculations and measurements. In other words,
46
+ * this is a "write phase" and reads from the DOM should be strictly avoided.
47
+ *
48
+ * Next the layout enters into its iterations or "cycles". Each cycle consists of calling
49
+ * the {@link Ext.layout.Layout#calculate calculate} method on all layouts in the
50
+ * {@link #layoutQueue}. These calls are part of a "read phase" and writes to the DOM should
51
+ * be strictly avoided.
52
+ *
53
+ * # Considerations
54
+ *
55
+ * **RULE 1**: Respect the read/write cycles. Always use the {@link Ext.layout.ContextItem#getProp getProp}
56
+ * or {@link Ext.layout.ContextItem#getDomProp getDomProp} methods to get calculated values;
57
+ * only use the {@link Ext.layout.ContextItem#getStyle getStyle} method to read styles; use
58
+ * {@link Ext.layout.ContextItem#setProp setProp} to set DOM values. Some reads will, of
59
+ * course, still go directly to the DOM, but if there is a method in
60
+ * {@link Ext.layout.ContextItem ContextItem} to do a certain job, it should be used instead
61
+ * of a lower-level equivalent.
62
+ *
63
+ * The basic logic flow in {@link Ext.layout.Layout#calculate calculate} consists of gathering
64
+ * values by calling {@link Ext.layout.ContextItem#getProp getProp} or
65
+ * {@link Ext.layout.ContextItem#getDomProp getDomProp}, calculating results and publishing
66
+ * them by calling {@link Ext.layout.ContextItem#setProp setProp}. It is important to realize
67
+ * that {@link Ext.layout.ContextItem#getProp getProp} will return `undefined` if the value
68
+ * is not yet known. But the act of calling the method is enough to track the fact that the
69
+ * calling layout depends (in some way) on this value. In other words, the calling layout is
70
+ * "triggered" by the properties it requests.
71
+ *
72
+ * **RULE 2**: Avoid calling {@link Ext.layout.ContextItem#getProp getProp} unless the value
73
+ * is needed. Gratuitous calls cause inefficiency because the layout will appear to depend on
74
+ * values that it never actually uses. This applies equally to
75
+ * {@link Ext.layout.ContextItem#getDomProp getDomProp} and the test-only methods
76
+ * {@link Ext.layout.ContextItem#hasProp hasProp} and {@link Ext.layout.ContextItem#hasDomProp hasDomProp}.
77
+ *
78
+ * Because {@link Ext.layout.ContextItem#getProp getProp} can return `undefined`, it is often
79
+ * the case that subsequent math will produce NaN's. This is usually not a problem as the
80
+ * NaN's simply propagate along and result in final results that are NaN. Both `undefined`
81
+ * and NaN are ignored by {@link Ext.layout.ContextItem#setProp}, so it is often not necessary
82
+ * to even know that this is happening. It does become important for determining if a layout
83
+ * is not done or if it might lead to publishing an incorrect (but not NaN or `undefined`)
84
+ * value.
85
+ *
86
+ * **RULE 3**: If a layout has not calculated all the values it is required to calculate, it
87
+ * must set {@link Ext.layout.Layout#done done} to `false` before returning from
88
+ * {@link Ext.layout.Layout#calculate calculate}. This value is always `true` on entry because
89
+ * it is simpler to detect the incomplete state rather than the complete state (especially up
90
+ * and down a class hierarchy).
91
+ *
92
+ * **RULE 4**: A layout must never publish an incomplete (wrong) result. Doing so would cause
93
+ * dependent layouts to run their calculations on those wrong values, producing more wrong
94
+ * values and some layouts may even incorrectly flag themselves as {@link Ext.layout.Layout#done done}
95
+ * before the correct values are determined and republished. Doing this will poison the
96
+ * calculations.
97
+ *
98
+ * **RULE 5**: Each value should only be published by one layout. If multiple layouts attempt
99
+ * to publish the same values, it would be nearly impossible to avoid breaking **RULE 4**. To
100
+ * help detect this problem, the layout diagnostics will trap on an attempt to set a value
101
+ * from different layouts.
102
+ *
103
+ * Complex layouts can produce many results as part of their calculations. These values are
104
+ * important for other layouts to proceed and need to be published by the earliest possible
105
+ * call to {@link Ext.layout.Layout#calculate} to avoid unnecessary cycles and poor performance. It is
106
+ * also possible, however, for some results to be related in a way such that publishing them
107
+ * may be an all-or-none proposition (typically to avoid breaking *RULE 4*).
108
+ *
109
+ * **RULE 6**: Publish results as soon as they are known to be correct rather than wait for
110
+ * all values to be calculated. Waiting for everything to be complete can lead to deadlock.
111
+ * The key here is not to forget **RULE 4** in the process.
112
+ *
113
+ * Some layouts depend on certain critical values as part of their calculations. For example,
114
+ * HBox depends on width and cannot do anything until the width is known. In these cases, it
115
+ * is best to use {@link Ext.layout.ContextItem#block block} or
116
+ * {@link Ext.layout.ContextItem#domBlock domBlock} and thereby avoid processing the layout
117
+ * until the needed value is available.
118
+ *
119
+ * **RULE 7**: Use {@link Ext.layout.ContextItem#block block} or
120
+ * {@link Ext.layout.ContextItem#domBlock domBlock} when values are required to make progress.
121
+ * This will mimize wasted recalculations.
122
+ *
123
+ * **RULE 8**: Blocks should only be used when no forward progress can be made. If even one
124
+ * value could still be calculated, a block could result in a deadlock.
125
+ *
126
+ * Historically, layouts have been invoked directly by component code, sometimes in places
127
+ * like an `afterLayout` method for a child component. With the flexibility now available
128
+ * to solve complex, iterative issues, such things should be done in a responsible layout
129
+ * (be it component or container).
130
+ *
131
+ * **RULE 9**: Use layouts to solve layout issues and don't wait for the layout to finish to
132
+ * perform further layouts. This is especially important now that layouts process entire
133
+ * component trees and not each layout in isolation.
134
+ *
135
+ * # Sequence Diagram
136
+ *
137
+ * The simplest sequence diagram for a layout run looks roughly like this:
138
+ *
139
+ * Context Layout 1 Item 1 Layout 2 Item 2
140
+ * | | | | |
141
+ * ---->X-------------->X | | |
142
+ * run X---------------|-----------|---------->X |
143
+ * X beginLayout | | | |
144
+ * X | | | |
145
+ * A X-------------->X | | |
146
+ * X calculate X---------->X | |
147
+ * X C X getProp | | |
148
+ * B X X---------->X | |
149
+ * X | setProp | | |
150
+ * X | | | |
151
+ * D X---------------|-----------|---------->X |
152
+ * X calculate | | X---------->X
153
+ * X | | | setProp |
154
+ * E X | | | |
155
+ * X---------------|-----------|---------->X |
156
+ * X completeLayout| | F | |
157
+ * X | | | |
158
+ * G X | | | |
159
+ * H X-------------->X | | |
160
+ * X calculate X---------->X | |
161
+ * X I X getProp | | |
162
+ * X X---------->X | |
163
+ * X | setProp | | |
164
+ * J X-------------->X | | |
165
+ * X completeLayout| | | |
166
+ * X | | | |
167
+ * K X-------------->X | | |
168
+ * X---------------|-----------|---------->X |
169
+ * X finalizeLayout| | | |
170
+ * X | | | |
171
+ * L X-------------->X | | |
172
+ * X---------------|-----------|---------->X |
173
+ * X finishedLayout| | | |
174
+ * X | | | |
175
+ * M X-------------->X | | |
176
+ * X---------------|-----------|---------->X |
177
+ * X notifyOwner | | | |
178
+ * N | | | | |
179
+ * - - - - -
180
+ *
181
+ *
182
+ * Notes:
183
+ *
184
+ * **A.** This is a call from the {@link #run} method to the {@link #runCycle} method.
185
+ * Each layout in the queue will have its {@link Ext.layout.Layout#calculate calculate}
186
+ * method called.
187
+ *
188
+ * **B.** After each {@link Ext.layout.Layout#calculate calculate} method is called the
189
+ * {@link Ext.layout.Layout#done done} flag is checked to see if the Layout has completed.
190
+ * If it has completed and that layout object implements a
191
+ * {@link Ext.layout.Layout#completeLayout completeLayout} method, this layout is queued to
192
+ * receive its call. Otherwise, the layout will be queued again unless there are blocks or
193
+ * triggers that govern its requeueing.
194
+ *
195
+ * **C.** The call to {@link Ext.layout.ContextItem#getProp getProp} is made to the Item
196
+ * and that will be tracked as a trigger (keyed by the name of the property being requested).
197
+ * Changes to this property will cause this layout to be requeued. The call to
198
+ * {@link Ext.layout.ContextItem#setProp setProp} will place a value in the item and not
199
+ * directly into the DOM.
200
+ *
201
+ * **D.** Call the other layouts now in the first cycle (repeat **B** and **C** for each
202
+ * layout).
203
+ *
204
+ * **E.** After completing a cycle, if progress was made (new properties were written to
205
+ * the context) and if the {@link #layoutQueue} is not empty, the next cycle is run. If no
206
+ * progress was made or no layouts are ready to run, all buffered values are written to
207
+ * the DOM (a flush).
208
+ *
209
+ * **F.** After flushing, any layouts that were marked as {@link Ext.layout.Layout#done done}
210
+ * that also have a {@link Ext.layout.Layout#completeLayout completeLayout} method are called.
211
+ * This can cause them to become no longer done (see {@link #invalidate}). As with
212
+ * {@link Ext.layout.Layout#calculate calculate}, this is considered a "read phase" and
213
+ * direct DOM writes should be avoided.
214
+ *
215
+ * **G.** Flushing and calling any pending {@link Ext.layout.Layout#completeLayout completeLayout}
216
+ * methods will likely trigger layouts that called {@link Ext.layout.ContextItem#getDomProp getDomProp}
217
+ * and unblock layouts that have called {@link Ext.layout.ContextItem#domBlock domBlock}.
218
+ * These variants are used when a layout needs the value to be correct in the DOM and not
219
+ * simply known. If this does not cause at least one layout to enter the queue, we have a
220
+ * layout FAILURE. Otherwise, we continue with the next cycle.
221
+ *
222
+ * **H.** Call {@link Ext.layout.Layout#calculate calculate} on any layouts in the queue
223
+ * at the start of this cycle. Just a repeat of **B** through **G**.
224
+ *
225
+ * **I.** Once the layout has calculated all that it is resposible for, it can leave itself
226
+ * in the {@link Ext.layout.Layout#done done} state. This is the value on entry to
227
+ * {@link Ext.layout.Layout#calculate calculate} and must be cleared in that call if the
228
+ * layout has more work to do.
229
+ *
230
+ * **J.** Now that all layouts are done, flush any DOM values and
231
+ * {@link Ext.layout.Layout#completeLayout completeLayout} calls. This can again cause
232
+ * layouts to become not done, and so we will be back on another cycle if that happens.
233
+ *
234
+ * **K.** After all layouts are done, call the {@link Ext.layout.Layout#finalizeLayout finalizeLayout}
235
+ * method on any layouts that have one. As with {@link Ext.layout.Layout#completeLayout completeLayout},
236
+ * this can cause layouts to become no longer done. This is less desirable than using
237
+ * {@link Ext.layout.Layout#completeLayout completeLayout} because it will cause all
238
+ * {@link Ext.layout.Layout#finalizeLayout finalizeLayout} methods to be called again
239
+ * when we think things are all wrapped up.
240
+ *
241
+ * **L.** After finishing the last iteration, layouts that have a
242
+ * {@link Ext.layout.Layout#finishedLayout finishedLayout} method will be called. This
243
+ * call will only happen once per run and cannot cause layouts to be run further.
244
+ *
245
+ * **M.** After calling finahedLayout, layouts that have a
246
+ * {@link Ext.layout.Layout#notifyOwner notifyOwner} method will be called. This
247
+ * call will only happen once per run and cannot cause layouts to be run further.
248
+ *
249
+ * **N.** One last flush to make sure everything has been written to the DOM.
250
+ *
251
+ * # Inter-Layout Collaboration
252
+ *
253
+ * Many layout problems require collaboration between multiple layouts. In some cases, this
254
+ * is as simple as a component's container layout providing results used by its component
255
+ * layout or vise-versa. A slightly more distant collaboration occurs in a box layout when
256
+ * stretchmax is used: the child item's component layout provides results that are consumed
257
+ * by the ownerCt's box layout to determine the size of the children.
258
+ *
259
+ * The various forms of interdependence between a container and its children are described by
260
+ * each components' {@link Ext.AbstractComponent#getSizeModel size model}.
261
+ *
262
+ * To facilitate this collaboration, the following pairs of properties are published to the
263
+ * component's {@link Ext.layout.ContextItem ContextItem}:
264
+ *
265
+ * - width/height: These hold the final size of the component. The layout indicated by the
266
+ * {@link Ext.AbstractComponent#getSizeModel size model} is responsible for setting these.
267
+ * - contentWidth/contentHeight: These hold size information published by the container
268
+ * layout or from DOM measurement. These describe the content only. These values are
269
+ * used by the component layout to determine the outer width/height when that component
270
+ * is {@link Ext.AbstractComponent#shrinkWrap shrink-wrapped}. They are also used to
271
+ * determine overflow. All container layouts must publish these values for dimensions
272
+ * that are shrink-wrapped. If a component has raw content (not container items), the
273
+ * componentLayout must publish these values instead.
274
+ *
275
+ * @protected
276
+ */
277
+ Ext.define('Ext.layout.Context', {
278
+ requires: [
279
+ 'Ext.util.Queue',
280
+ 'Ext.layout.ContextItem',
281
+ 'Ext.layout.Layout',
282
+ 'Ext.fx.Anim',
283
+ 'Ext.fx.Manager'
284
+ ],
285
+
286
+ currentOwnerCtContext: null,
287
+
288
+ remainingLayouts: 0,
289
+
290
+ /**
291
+ * @property {Number} state One of these values:
292
+ *
293
+ * - 0 - Before run
294
+ * - 1 - Running
295
+ * - 2 - Run complete
296
+ */
297
+ state: 0,
298
+
299
+ constructor: function (config) {
300
+ var me = this;
301
+
302
+ Ext.apply(me, config);
303
+
304
+ // holds the ContextItem collection, keyed by element id
305
+ me.items = {};
306
+
307
+ // a collection of layouts keyed by layout id
308
+ me.layouts = {};
309
+
310
+ // the number of blocks of any kind:
311
+ me.blockCount = 0;
312
+ // the number of cycles that have been run:
313
+ me.cycleCount = 0;
314
+ // the number of flushes to the DOM:
315
+ me.flushCount = 0;
316
+ // the number of layout calculate calls:
317
+ me.calcCount = 0;
318
+
319
+ me.animateQueue = me.newQueue();
320
+ me.completionQueue = me.newQueue();
321
+ me.finalizeQueue = me.newQueue();
322
+ me.finishQueue = me.newQueue();
323
+ me.flushQueue = me.newQueue();
324
+
325
+ me.invalidateData = {};
326
+
327
+ /**
328
+ * @property {Ext.util.Queue} layoutQueue
329
+ * List of layouts to perform.
330
+ */
331
+ me.layoutQueue = me.newQueue();
332
+
333
+ // this collection is special because we ensure that there are no parent/child pairs
334
+ // present, only distinct top-level components
335
+ me.invalidQueue = [];
336
+
337
+ me.triggers = {
338
+ data: {
339
+ /*
340
+ layoutId: [
341
+ { item: contextItem, prop: propertyName }
342
+ ]
343
+ */
344
+ },
345
+ dom: {}
346
+ };
347
+ },
348
+
349
+ callLayout: function (layout, methodName) {
350
+ this.currentLayout = layout;
351
+ var ownerContext = this.getCmp(layout.owner);
352
+ layout[methodName](ownerContext);
353
+ },
354
+
355
+ cancelComponent: function (comp, isChild) {
356
+ var me = this,
357
+ components = comp,
358
+ isArray = !comp.isComponent,
359
+ length = isArray ? components.length : 1,
360
+ i, k, klen, items, layout, newQueue, oldQueue, entry, temp;
361
+
362
+ for (i = 0; i < length; ++i) {
363
+ if (isArray) {
364
+ comp = components[i];
365
+ }
366
+
367
+ if (!isChild) {
368
+ oldQueue = me.invalidQueue;
369
+ klen = oldQueue.length;
370
+
371
+ if (klen) {
372
+ me.invalidQueue = newQueue = [];
373
+ for (k = 0; k < klen; ++k) {
374
+ entry = oldQueue[k];
375
+ temp = entry.item.target;
376
+ if (temp != comp && !temp.isDescendant(comp)) {
377
+ newQueue.push(entry);
378
+ }
379
+ }
380
+ }
381
+ }
382
+
383
+ layout = comp.componentLayout;
384
+ me.cancelLayout(layout);
385
+
386
+ if (layout.getLayoutItems) {
387
+ items = layout.getLayoutItems();
388
+ if (items.length) {
389
+ me.cancelComponent(items, true);
390
+ }
391
+ }
392
+
393
+ if (comp.isContainer && !comp.collapsed) {
394
+ layout = comp.layout;
395
+ me.cancelLayout(layout);
396
+
397
+ items = layout.getVisibleItems();
398
+ if (items.length) {
399
+ me.cancelComponent(items, true);
400
+ }
401
+ }
402
+ }
403
+ },
404
+
405
+ cancelLayout: function (layout) {
406
+ var me = this;
407
+
408
+ me.completionQueue.remove(layout);
409
+ me.finalizeQueue.remove(layout);
410
+ me.finishQueue.remove(layout);
411
+ me.layoutQueue.remove(layout);
412
+
413
+ if (layout.running) {
414
+ me.layoutDone(layout);
415
+ }
416
+
417
+ layout.ownerContext = null;
418
+ },
419
+
420
+ clearTriggers: function (layout, inDom) {
421
+ var id = layout.id,
422
+ triggers = this.triggers[inDom ? 'dom' : 'data'][id],
423
+ length = (triggers && triggers.length) || 0,
424
+ collection, i, item, trigger;
425
+
426
+ for (i = 0; i < length; ++i) {
427
+ trigger = triggers[i];
428
+ item = trigger.item;
429
+
430
+ collection = inDom ? item.domTriggers : item.triggers;
431
+ delete collection[trigger.prop][id];
432
+ }
433
+ },
434
+
435
+ finishInvalidate: function (options, item, name) {
436
+ // When calling a callback, the currentLayout needs to be adjusted so
437
+ // that whichever layout caused the invalidate is the currentLayout...
438
+ if (options[name]) {
439
+ var me = this,
440
+ currentLayout = me.currentLayout;
441
+
442
+ me.currentLayout = options.layout || null;
443
+
444
+ options[name](item, options);
445
+
446
+ me.currentLayout = currentLayout;
447
+ }
448
+ },
449
+
450
+ /**
451
+ * Flushes any pending writes to the DOM by calling each ContextItem in the flushQueue.
452
+ */
453
+ flush: function () {
454
+ var me = this,
455
+ items = me.flushQueue.clear(),
456
+ length = items.length, i;
457
+
458
+ if (length) {
459
+ ++me.flushCount;
460
+
461
+ for (i = 0; i < length; ++i) {
462
+ items[i].flush();
463
+ }
464
+ }
465
+ },
466
+
467
+ flushAnimations: function() {
468
+ var me = this,
469
+ items = me.animateQueue.clear(),
470
+ len = items.length,
471
+ i;
472
+
473
+ if (len) {
474
+ for (i = 0; i < len; i++) {
475
+ // Each Component may refuse to participate in animations.
476
+ // This is used by the BoxReorder plugin which drags a Component,
477
+ // during which that Component must be exempted from layout positioning.
478
+ if (items[i].target.animate !== false) {
479
+ items[i].flushAnimations();
480
+ }
481
+ }
482
+
483
+ // Ensure the first frame fires now to avoid a browser repaint with the elements in the "to" state
484
+ // before they are returned to their "from" state by the animation.
485
+ Ext.fx.Manager.runner();
486
+ }
487
+ },
488
+
489
+ flushInvalidates: function () {
490
+ var me = this,
491
+ queue = me.invalidQueue,
492
+ length = queue && queue.length,
493
+ comp, components, entry, i;
494
+
495
+ me.invalidQueue = [];
496
+
497
+ if (length) {
498
+ components = [];
499
+ for (i = 0; i < length; ++i) {
500
+ comp = (entry = queue[i]).item.target;
501
+ // we filter out-of-body components here but allow them into the queue to
502
+ // ensure that their child components are coalesced out (w/no additional
503
+ // cost beyond our normal effort to avoid parent/child components in the
504
+ // queue)
505
+ if (!comp.container.isDetachedBody) {
506
+ components.push(comp);
507
+
508
+ if (entry.options) {
509
+ me.invalidateData[comp.id] = entry.options;
510
+ }
511
+ }
512
+ }
513
+
514
+ me.invalidate(components, null);
515
+ }
516
+ },
517
+
518
+ flushLayouts: function (queueName, methodName, dontClear) {
519
+ var me = this,
520
+ layouts = dontClear ? me[queueName].items : me[queueName].clear(),
521
+ length = layouts.length,
522
+ i, layout;
523
+
524
+ if (length) {
525
+ for (i = 0; i < length; ++i) {
526
+ layout = layouts[i];
527
+ if (!layout.running) {
528
+ me.callLayout(layout, methodName);
529
+ }
530
+ }
531
+ me.currentLayout = null;
532
+ }
533
+ },
534
+
535
+ /**
536
+ * Returns the ContextItem for a component.
537
+ * @param {Ext.Component} cmp
538
+ */
539
+ getCmp: function (cmp) {
540
+ return this.getItem(cmp, cmp.el);
541
+ },
542
+
543
+ /**
544
+ * Returns the ContextItem for an element.
545
+ * @param {Ext.layout.ContextItem} parent
546
+ * @param {Ext.dom.Element} el
547
+ */
548
+ getEl: function (parent, el) {
549
+ var item = this.getItem(el, el);
550
+
551
+ if (!item.parent) {
552
+ item.parent = parent;
553
+
554
+ // all items share an empty children array (to avoid null checks), so we can
555
+ // only push on to the children array if there is already something there (we
556
+ // copy-on-write):
557
+ if (parent.children.length) {
558
+ parent.children.push(item);
559
+ } else {
560
+ parent.children = [ item ]; // now parent has its own children[] (length=1)
561
+ }
562
+ }
563
+
564
+ return item;
565
+ },
566
+
567
+ getItem: function (target, el) {
568
+ var id = el.id,
569
+ items = this.items,
570
+ item = items[id] ||
571
+ (items[id] = new Ext.layout.ContextItem({
572
+ context: this,
573
+ target: target,
574
+ el: el,
575
+ ownerCtContext: this.currentOwnerCtContext
576
+ }));
577
+
578
+ return item;
579
+ },
580
+
581
+ handleFailure: function () {
582
+ // This method should never be called, but is need when layouts fail (hence the
583
+ // "should never"). We just disconnect any of the layouts from the run and return
584
+ // them to the state they would be in had the layout completed properly.
585
+ var layouts = this.layouts,
586
+ layout, key;
587
+
588
+ Ext.failedLayouts = (Ext.failedLayouts || 0) + 1;
589
+ //<debug>
590
+ Ext.log('Layout run failed');
591
+ //</debug>
592
+
593
+ for (key in layouts) {
594
+ layout = layouts[key];
595
+
596
+ if (layouts.hasOwnProperty(key)) {
597
+ layout.running = false;
598
+ layout.ownerContext = null;
599
+ }
600
+ }
601
+ },
602
+
603
+ /**
604
+ * Invalidates one or more components' layouts (component and container). This can be
605
+ * called before run to identify the components that need layout or during the run to
606
+ * restart the layout of a component. This is called internally to flush any queued
607
+ * invalidations at the start of a cycle. If called during a run, it is not expected
608
+ * that new components will be introduced to the layout.
609
+ *
610
+ * @param {Ext.Component/Array} components An array of Components or a single Component.
611
+ * @param {Ext.layout.ContextItem} ownerCtContext The ownerCt's ContextItem.
612
+ * @param {Boolean} full True if all properties should be invalidated, otherwise only
613
+ * those calculated by the component should be invalidated.
614
+ */
615
+ invalidate: function (components, ownerCtContext, full) {
616
+ var me = this,
617
+ isArray = !components.isComponent,
618
+ itemCache = me.items,
619
+ running = me.state > 0,
620
+ previousOwnerCtContext = me.currentOwnerCtContext,
621
+ componentChildrenDone, containerChildrenDone, containerLayoutDone, ownerCt,
622
+ firstTime, i, k, comp, item, items, length, componentLayout, layout, props,
623
+ invalidateData;
624
+
625
+ me.currentOwnerCtContext = ownerCtContext;
626
+
627
+ for (i = 0, length = isArray ? components.length : 1; i < length; ++i) {
628
+ comp = isArray ? components[i] : components;
629
+
630
+ if (comp.rendered && !comp.hidden) {
631
+ firstTime = !comp.componentLayout.ownerContext;
632
+ item = me.getCmp(comp);
633
+ if (firstTime) {
634
+ // this must occur before we proceed since it can do many things (like
635
+ // add children perhaps)
636
+ if (comp.beforeLayout) {
637
+ comp.beforeLayout();
638
+ }
639
+
640
+ // Normally the firstTime we meet a component is before the context is
641
+ // run, but it is possible for components to be added to a run already
642
+ // in progress. If so, we have to lookup the ownerCtContext since the
643
+ // odds are very high that the new component is a child of something
644
+ // already in the run. It is currently unsupported to drag in the
645
+ // owner of a running component (that would need to cleanup the
646
+ // isTopLevel indicators as well as boxParent tracking).
647
+ if (running && !ownerCtContext && (ownerCt = comp.ownerCt)) {
648
+ ownerCtContext = itemCache[ownerCt.el.id];
649
+ }
650
+
651
+ item.init(ownerCtContext);
652
+ }
653
+ componentChildrenDone = containerChildrenDone = containerLayoutDone = true;
654
+
655
+ // A ComponentLayout MUST implement getLayoutItems to allow its children to
656
+ // be collected. Ext.container.Container does this, but non-Container Components
657
+ // which manage Components as part of their structure (eg HtmlEditor) must
658
+ // return child Components through their own implementation of getLayoutItems.
659
+ componentLayout = comp.componentLayout;
660
+ componentLayout.ownerContext = item;
661
+ if (componentLayout.getLayoutItems) {
662
+ componentLayout.renderChildren();
663
+
664
+ items = componentLayout.getLayoutItems();
665
+ if (items.length) {
666
+ me.invalidate(items, item, true);
667
+ componentChildrenDone = false;
668
+ }
669
+ }
670
+
671
+ if (comp.isContainer && !comp.collapsed) {
672
+ layout = comp.layout;
673
+ layout.ownerContext = item;
674
+ layout.renderChildren();
675
+
676
+ containerLayoutDone = false;
677
+
678
+ items = layout.getVisibleItems();
679
+ if (items.length) {
680
+ me.invalidate(items, item, true);
681
+ containerChildrenDone = false;
682
+ }
683
+ } else {
684
+ layout = null;
685
+ }
686
+
687
+ if (firstTime){
688
+ item.hasRawContent = true;
689
+
690
+ // we need to know how we will determine content size: containers can look at
691
+ // the results of their items but non-containers or item-less containers with
692
+ // raw markup need to be measured in the DOM:
693
+ if (item.target.isContainer) {
694
+ if (item.target.items.items.length || !item.target.getTargetEl().dom.firstChild) {
695
+ item.hasRawContent = false;
696
+ }
697
+ }
698
+
699
+ } else {
700
+ item.doInvalidate(full);
701
+
702
+ // invalidate the elements owned by the component:
703
+ items = item.children;
704
+ for (k = items.length; k--; ) {
705
+ items[k].doInvalidate(true);
706
+ }
707
+ }
708
+
709
+ // These properties are only set when they are true:
710
+ props = item.props;
711
+ if (componentChildrenDone) {
712
+ props.componentChildrenDone = true;
713
+ if (containerChildrenDone) {
714
+ props.childrenDone = true;
715
+ }
716
+ }
717
+ if (containerChildrenDone) {
718
+ props.containerChildrenDone = true;
719
+ }
720
+ if (containerLayoutDone) {
721
+ props.containerLayoutDone = true;
722
+ }
723
+
724
+ invalidateData = me.invalidateData[item.id];
725
+ if (invalidateData) {
726
+ delete me.invalidateData[item.id];
727
+ if (invalidateData.state) {
728
+ Ext.apply(item.state, invalidateData.state);
729
+ }
730
+ me.finishInvalidate(invalidateData, item, 'before');
731
+ }
732
+
733
+ me.resetLayout(componentLayout, item, firstTime);
734
+ if (layout) {
735
+ me.resetLayout(layout, item, firstTime);
736
+ }
737
+
738
+ if (invalidateData) {
739
+ me.finishInvalidate(invalidateData, item, 'after');
740
+ }
741
+
742
+ if (item.boxChildren && item.widthModel.shrinkWrap) {
743
+ // set a very large width to allow the children to measure their natural
744
+ // widths (this is cleared once all children have been measured):
745
+ item.el.setWidth(10000);
746
+
747
+ // don't run layouts for this component until we clear this width...
748
+ item.state.blocks = (item.state.blocks || 0) + 1;
749
+ }
750
+
751
+ if (firstTime) {
752
+ item.initAnimatePolicy();
753
+ }
754
+ }
755
+ }
756
+
757
+ me.currentOwnerCtContext = previousOwnerCtContext;
758
+ },
759
+
760
+ layoutDone: function (layout) {
761
+ var ownerContext = layout.ownerContext,
762
+ ownerCtContext;
763
+
764
+ layout.running = false;
765
+
766
+ // Once a component layout completes, we can mark it as "done" but we can also
767
+ // decrement the remainingChildLayouts property on the ownerCtContext. When that
768
+ // goes to 0, we can mark the ownerCtContext as "childrenDone".
769
+ if (layout.isComponentLayout) {
770
+ if (ownerContext.measuresBox) {
771
+ ownerContext.onBoxMeasured(); // be sure to release our boxParent
772
+ }
773
+
774
+ ownerContext.setProp('done', true);
775
+
776
+ ownerCtContext = ownerContext.ownerCtContext;
777
+ if (ownerCtContext) {
778
+ if (ownerContext.target.ownerLayout.isComponentLayout) {
779
+ if (! --ownerCtContext.remainingComponentChildLayouts) {
780
+ ownerCtContext.setProp('componentChildrenDone', true);
781
+ }
782
+ } else {
783
+ if (! --ownerCtContext.remainingContainerChildLayouts) {
784
+ ownerCtContext.setProp('containerChildrenDone', true);
785
+ }
786
+ }
787
+ if (! --ownerCtContext.remainingChildLayouts) {
788
+ ownerCtContext.setProp('childrenDone', true);
789
+ }
790
+ }
791
+ } else {
792
+ ownerContext.setProp('containerLayoutDone', true);
793
+ }
794
+
795
+ --this.remainingLayouts;
796
+ ++this.progressCount; // a layout completion is progress
797
+ },
798
+
799
+ newQueue: function () {
800
+ return new Ext.util.Queue();
801
+ },
802
+
803
+ /**
804
+ * Queues a ContextItem to have its {@link Ext.layout.ContextItem#flushAnimations} method called.
805
+ *
806
+ * @param {Ext.layout.ContextItem} item
807
+ * @private
808
+ */
809
+ queueAnimation: function (item) {
810
+ this.animateQueue.add(item);
811
+ },
812
+
813
+ /**
814
+ * Queues a layout to have its {@link Ext.layout.Layout#completeLayout} method called.
815
+ *
816
+ * @param {Ext.layout.Layout} layout
817
+ * @private
818
+ */
819
+ queueCompletion: function (layout) {
820
+ this.completionQueue.add(layout);
821
+ },
822
+
823
+ /**
824
+ * Queues a layout to have its {@link Ext.layout.Layout#finalizeLayout} method called.
825
+ *
826
+ * @param {Ext.layout.Layout} layout
827
+ * @private
828
+ */
829
+ queueFinalize: function (layout) {
830
+ this.finalizeQueue.add(layout);
831
+ },
832
+
833
+ /**
834
+ * Queues a ContextItem for the next flush to the DOM. This should only be called by
835
+ * the {@link Ext.layout.ContextItem} class.
836
+ *
837
+ * @param {Ext.layout.ContextItem} item
838
+ * @private
839
+ */
840
+ queueFlush: function (item) {
841
+ this.flushQueue.add(item);
842
+ },
843
+
844
+ chainFns: function (oldOptions, newOptions, funcName) {
845
+ var oldFn = oldOptions[funcName],
846
+ newFn = newOptions[funcName];
847
+
848
+ // Call newFn last so it can get the final word on things... also, the "this"
849
+ // pointer will be passed correctly by createSequence with oldFn first.
850
+ return function (contextItem) {
851
+ if (oldFn) {
852
+ oldFn.call(oldOptions.scope || oldOptions, contextItem, oldOptions);
853
+ }
854
+ newFn.call(newOptions.scope || newOptions, contextItem, newOptions);
855
+ };
856
+ },
857
+
858
+ /**
859
+ * Queue a component (and its tree) to be invalidated on the next cycle.
860
+ *
861
+ * @param {Ext.Component/Ext.layout.ContextItem} item The component or ContextItem to invalidate.
862
+ * @param {Object} options An object describing how to handle the invalidation (see
863
+ * {@link Ext.layout.ContextItem#invalidate} for details).
864
+ * @private
865
+ */
866
+ queueInvalidate: function (item, options) {
867
+ var me = this,
868
+ newQueue = [],
869
+ oldQueue = me.invalidQueue,
870
+ index = oldQueue.length,
871
+ comp, old, oldComp, oldOptions, oldState;
872
+
873
+ if (item.isComponent) {
874
+ item = me.getCmp(comp = item);
875
+ } else {
876
+ comp = item.target;
877
+ }
878
+
879
+ // See if comp is contained by any component already in the queue (ignore comp if
880
+ // that is the case). Eliminate any components in the queue that are contained by
881
+ // comp (by not adding them to newQueue).
882
+ while (index--) {
883
+ old = oldQueue[index];
884
+ oldComp = old.item.target;
885
+
886
+ if (comp.isDescendant(oldComp)) {
887
+ return; // oldComp contains comp, so this invalidate is redundant
888
+ }
889
+
890
+ if (oldComp == comp) {
891
+ // if already in the queue, update the options...
892
+ if (!(oldOptions = old.options)) {
893
+ old.options = options;
894
+ } else if (options) {
895
+ if (!(oldState = oldOptions.state)) {
896
+ oldOptions.state = options.state;
897
+ } else if (options.state) {
898
+ Ext.apply(oldState, options.state);
899
+ }
900
+
901
+ if (options.before) {
902
+ oldOptions.before = me.chainFns(oldOptions, options, 'before');
903
+ }
904
+ if (options.after) {
905
+ oldOptions.after = me.chainFns(oldOptions, options, 'after');
906
+ }
907
+ }
908
+
909
+ // leave the old queue alone now that we've update this comp's entry...
910
+ return;
911
+ }
912
+
913
+ if (!oldComp.isDescendant(comp)) {
914
+ newQueue.push(old); // comp does not contain oldComp
915
+ }
916
+ // else if (oldComp isDescendant of comp) skip
917
+ }
918
+ // newQueue contains only those components not a descendant of comp
919
+
920
+ // to get here, comp must not be a child of anything already in the queue, so it
921
+ // needs to be added along with its "options":
922
+ newQueue.push({ item: item, options: options });
923
+
924
+ me.invalidQueue = newQueue;
925
+ },
926
+
927
+ queueItemLayouts: function (item) {
928
+ var comp = item.isComponent ? item : item.target,
929
+ layout = comp.componentLayout;
930
+
931
+ if (!layout.pending && !layout.invalid && !layout.done) {
932
+ this.queueLayout(layout);
933
+ }
934
+
935
+ layout = comp.layout;
936
+ if (layout && !layout.pending && !layout.invalid && !layout.done) {
937
+ this.queueLayout(layout);
938
+ }
939
+ },
940
+
941
+ /**
942
+ * Queues a layout for the next calculation cycle. This should not be called if the
943
+ * layout is done, blocked or already in the queue. The only classes that should call
944
+ * this method are this class and {@link Ext.layout.ContextItem}.
945
+ *
946
+ * @param {Ext.layout.Layout} layout The layout to add to the queue.
947
+ * @private
948
+ */
949
+ queueLayout: function (layout) {
950
+ this.layoutQueue.add(layout);
951
+ layout.pending = true;
952
+ },
953
+
954
+ /**
955
+ * Resets the given layout object. This is called at the start of the run and can also
956
+ * be called during the run by calling {@link #invalidate}.
957
+ */
958
+ resetLayout: function (layout, ownerContext, firstTime) {
959
+ var me = this,
960
+ ownerCtContext;
961
+
962
+ me.currentLayout = layout;
963
+
964
+ layout.done = false;
965
+ layout.pending = true;
966
+ layout.firedTriggers = 0;
967
+
968
+ me.layoutQueue.add(layout);
969
+
970
+ if (firstTime) {
971
+ me.layouts[layout.id] = layout; // track the layout for this run by its id
972
+ layout.running = true;
973
+
974
+ if (layout.finishedLayout) {
975
+ me.finishQueue.add(layout);
976
+ }
977
+
978
+ // reset or update per-run counters:
979
+
980
+ ++me.remainingLayouts;
981
+ ++layout.layoutCount; // the number of whole layouts run for the layout
982
+
983
+ layout.beginCount = 0; // the number of beginLayout calls
984
+ layout.blockCount = 0; // the number of blocks set for the layout
985
+ layout.calcCount = 0; // the number of times calculate is called
986
+ layout.triggerCount = 0; // the number of triggers set for the layout
987
+
988
+ // Count the children of each ownerCt so we can tell when they are all done:
989
+ if (layout.isComponentLayout && (ownerCtContext = ownerContext.ownerCtContext)) {
990
+ // This layout's ownerCt is in this run... The component associated with
991
+ // this layout (the "target") could be owned by the ownerCt's container
992
+ // layout or component layout (e.g. docked items)! To manage this, we keep
993
+ // two counters for these and one for the combined total:
994
+ if (ownerContext.target.ownerLayout.isComponentLayout) {
995
+ ++ownerCtContext.remainingComponentChildLayouts;
996
+ } else {
997
+ ++ownerCtContext.remainingContainerChildLayouts;
998
+ }
999
+ ++ownerCtContext.remainingChildLayouts;
1000
+ }
1001
+
1002
+ if (!layout.initialized) {
1003
+ layout.initLayout();
1004
+ }
1005
+
1006
+ layout.beginLayout(ownerContext);
1007
+ } else {
1008
+ ++layout.beginCount;
1009
+
1010
+ if (!layout.running) {
1011
+ // back into the mahem with this one:
1012
+ ++me.remainingLayouts;
1013
+ layout.running = true;
1014
+
1015
+ if (layout.isComponentLayout) {
1016
+ // this one is fun... if we call setProp('done', false) that would still
1017
+ // trigger/unblock layouts, but what layouts are really looking for with
1018
+ // this property is for it to go to true, not just be set to a value...
1019
+ ownerContext.unsetProp('done');
1020
+
1021
+ // On subsequent resets we increment the child layout count properties
1022
+ // on ownerCtContext and clear 'childrenDone' and the appropriate other
1023
+ // indicator as we transition to 1:
1024
+ ownerCtContext = ownerContext.ownerCtContext;
1025
+ if (ownerCtContext) {
1026
+ if (ownerContext.target.ownerLayout.isComponentLayout) {
1027
+ if (++ownerCtContext.remainingComponentChildLayouts == 1) {
1028
+ ownerCtContext.unsetProp('componentChildrenDone');
1029
+ }
1030
+ } else {
1031
+ if (++ownerCtContext.remainingContainerChildLayouts == 1) {
1032
+ ownerCtContext.unsetProp('containerChildrenDone');
1033
+ }
1034
+ }
1035
+ if (++ownerCtContext.remainingChildLayouts == 1) {
1036
+ ownerCtContext.unsetProp('childrenDone');
1037
+ }
1038
+ }
1039
+ }
1040
+
1041
+ // and it needs to be removed from the completion and/or finalize queues...
1042
+ me.completionQueue.remove(layout);
1043
+ me.finalizeQueue.remove(layout);
1044
+ }
1045
+ }
1046
+
1047
+ layout.beginLayoutCycle(ownerContext, firstTime);
1048
+ },
1049
+
1050
+ /**
1051
+ * Runs the layout calculations. This can be called only once on this object.
1052
+ * @return {Boolean} True if all layouts were completed, false if not.
1053
+ */
1054
+ run: function () {
1055
+ var me = this,
1056
+ flushed = false,
1057
+ watchDog = 100;
1058
+
1059
+ me.flushInvalidates();
1060
+
1061
+ me.state = 1;
1062
+ me.totalCount = me.layoutQueue.getCount();
1063
+
1064
+ // We may start with unflushed data placed by beginLayout calls. Since layouts may
1065
+ // use setProp as a convenience, even in a write phase, we don't want to transition
1066
+ // to a read phase with unflushed data since we can write it now "cheaply". Also,
1067
+ // these value could easily be needed in the DOM in order to really get going with
1068
+ // the calculations. In particular, fixed (configured) dimensions fall into this
1069
+ // category.
1070
+ me.flush();
1071
+
1072
+ // While we have layouts that have not completed...
1073
+ while ((me.remainingLayouts || me.invalidQueue.length) && watchDog--) {
1074
+ if (me.invalidQueue.length) {
1075
+ me.flushInvalidates();
1076
+ }
1077
+
1078
+ // if any of them can run right now, run them
1079
+ if (me.runCycle()) {
1080
+ flushed = false; // progress means we probably need to flush something
1081
+ // but not all progress appears in the flushQueue (e.g. 'contentHeight')
1082
+ } else if (!flushed) {
1083
+ // as long as we are making progress, flush updates to the DOM and see if
1084
+ // that triggers or unblocks any layouts...
1085
+ me.flush();
1086
+ flushed = true; // all flushed now, so more progress is required
1087
+
1088
+ me.flushLayouts('completionQueue', 'completeLayout');
1089
+ } else {
1090
+ // after a flush, we must make progress or something is WRONG
1091
+ me.state = 2;
1092
+ break;
1093
+ }
1094
+
1095
+ if (!(me.remainingLayouts || me.invalidQueue.length)) {
1096
+ me.flush();
1097
+ me.flushLayouts('completionQueue', 'completeLayout');
1098
+ me.flushLayouts('finalizeQueue', 'finalizeLayout');
1099
+ }
1100
+ }
1101
+
1102
+ return me.runComplete();
1103
+ },
1104
+
1105
+ runComplete: function () {
1106
+ var me = this;
1107
+
1108
+ me.state = 2;
1109
+
1110
+ if (me.remainingLayouts) {
1111
+ me.handleFailure();
1112
+ return false;
1113
+ }
1114
+
1115
+ me.flush();
1116
+
1117
+ // Call finishedLayout on all layouts, but do not clear the queue.
1118
+ me.flushLayouts('finishQueue', 'finishedLayout', true);
1119
+
1120
+ // Call notifyOwner on all layouts and then clear the queue.
1121
+ me.flushLayouts('finishQueue', 'notifyOwner');
1122
+
1123
+ me.flush(); // in case any setProp calls were made
1124
+
1125
+ me.flushAnimations();
1126
+
1127
+ return true;
1128
+ },
1129
+
1130
+ /**
1131
+ * Performs one layout cycle by calling each layout in the layout queue.
1132
+ * @return {Boolean} True if some progress was made, false if not.
1133
+ * @protected
1134
+ */
1135
+ runCycle: function () {
1136
+ var me = this,
1137
+ layouts = me.layoutQueue.clear(),
1138
+ length = layouts.length,
1139
+ i;
1140
+
1141
+ ++me.cycleCount;
1142
+
1143
+ // This value is incremented by ContextItem#setProp whenever new values are set
1144
+ // (thereby detecting forward progress):
1145
+ me.progressCount = 0;
1146
+
1147
+ for (i = 0; i < length; ++i) {
1148
+ me.runLayout(me.currentLayout = layouts[i]);
1149
+ }
1150
+
1151
+ me.currentLayout = null;
1152
+
1153
+ return me.progressCount > 0;
1154
+ },
1155
+
1156
+ /**
1157
+ * Runs one layout as part of a cycle.
1158
+ * @private
1159
+ */
1160
+ runLayout: function (layout) {
1161
+ var me = this,
1162
+ ownerContext = me.getCmp(layout.owner);
1163
+
1164
+ layout.pending = false;
1165
+
1166
+ if (ownerContext.state.blocks) {
1167
+ return;
1168
+ }
1169
+
1170
+ // We start with the assumption that the layout will finish and if it does not, it
1171
+ // must clear this flag. It turns out this is much simpler than knowing when a layout
1172
+ // is done (100% correctly) when base classes and derived classes are collaborating.
1173
+ // Knowing that some part of the layout is not done is much more obvious.
1174
+ layout.done = true;
1175
+
1176
+ ++layout.calcCount;
1177
+ ++me.calcCount;
1178
+
1179
+ layout.calculate(ownerContext);
1180
+
1181
+ if (layout.done) {
1182
+ me.layoutDone(layout);
1183
+
1184
+ if (layout.completeLayout) {
1185
+ me.queueCompletion(layout);
1186
+ }
1187
+ if (layout.finalizeLayout) {
1188
+ me.queueFinalize(layout);
1189
+ }
1190
+ } else if (!layout.pending && !layout.invalid && !(layout.blockCount + layout.triggerCount - layout.firedTriggers)) {
1191
+ // A layout that is not done and has no blocks or triggers that will queue it
1192
+ // automatically, must be queued now:
1193
+ me.queueLayout(layout);
1194
+ }
1195
+ },
1196
+
1197
+ /**
1198
+ * Set the size of a component, element or composite or an array of components or elements.
1199
+ * @param {Ext.Component/Ext.Component[]/Ext.dom.Element/Ext.dom.Element[]/Ext.dom.CompositeElement}
1200
+ * The item(s) to size.
1201
+ * @param {Number} width The new width to set (ignored if undefined or NaN).
1202
+ * @param {Number} height The new height to set (ignored if undefined or NaN).
1203
+ */
1204
+ setItemSize: function(item, width, height) {
1205
+ var items = item,
1206
+ len = 1,
1207
+ contextItem, i;
1208
+
1209
+ // NOTE: we don't pre-check for validity because:
1210
+ // - maybe only one dimension is valid
1211
+ // - the diagnostics layer will track the setProp call to help find who is trying
1212
+ // (but failing) to set a property
1213
+ // - setProp already checks this anyway
1214
+
1215
+ if (item.isComposite) {
1216
+ items = item.elements;
1217
+ len = items.length;
1218
+ item = items[0];
1219
+ } else if (!item.dom && !item.el) { // array by process of elimination
1220
+ len = items.length;
1221
+ item = items[0];
1222
+ }
1223
+ // else len = 1 and items = item (to avoid error on "items[++i]")
1224
+
1225
+ for (i = 0; i < len; ) {
1226
+ contextItem = this.get(item);
1227
+ contextItem.setSize(width, height);
1228
+
1229
+ item = items[++i]; // this accomodation avoids making an array of 1
1230
+ }
1231
+ }
1232
+ });