extjs-rails 4.1.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
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,427 @@
1
+ /**
2
+ * This class is intended to be extended or created via the {@link Ext.Component#componentLayout layout}
3
+ * configuration property. See {@link Ext.Component#componentLayout} for additional details.
4
+ * @private
5
+ */
6
+ Ext.define('Ext.layout.component.Component', {
7
+
8
+ /* Begin Definitions */
9
+
10
+ extend: 'Ext.layout.Layout',
11
+
12
+ /* End Definitions */
13
+
14
+ type: 'component',
15
+
16
+ isComponentLayout: true,
17
+
18
+ nullBox: {},
19
+
20
+ usesContentHeight: true,
21
+ usesContentWidth: true,
22
+ usesHeight: true,
23
+ usesWidth: true,
24
+
25
+ beginLayoutCycle: function (ownerContext, firstCycle) {
26
+ var me = this,
27
+ owner = me.owner,
28
+ ownerCtContext = ownerContext.ownerCtContext,
29
+ heightModel = ownerContext.heightModel,
30
+ widthModel = ownerContext.widthModel,
31
+ body = owner.el.dom === document.body,
32
+ lastBox = owner.lastBox || me.nullBox,
33
+ lastSize = owner.el.lastBox || me.nullBox,
34
+ dirty = !body,
35
+ ownerLayout, v, widthName, heightName;
36
+
37
+ me.callParent(arguments);
38
+
39
+ if (firstCycle) {
40
+ if (me.usesContentWidth) {
41
+ ++ownerContext.consumersContentWidth;
42
+ }
43
+ if (me.usesContentHeight) {
44
+ ++ownerContext.consumersContentHeight;
45
+ }
46
+ if (me.usesWidth) {
47
+ ++ownerContext.consumersWidth;
48
+ }
49
+ if (me.usesHeight) {
50
+ ++ownerContext.consumersHeight;
51
+ }
52
+
53
+ if (ownerCtContext && !ownerCtContext.hasRawContent) {
54
+ ownerLayout = owner.ownerLayout;
55
+
56
+ if (ownerLayout.usesWidth) {
57
+ ++ownerContext.consumersWidth;
58
+ }
59
+ if (ownerLayout.usesHeight) {
60
+ ++ownerContext.consumersHeight;
61
+ }
62
+ }
63
+ }
64
+
65
+ // we want to publish configured dimensions as early as possible and since this is
66
+ // a write phase...
67
+
68
+ if (widthModel.configured) {
69
+ // If the owner.el is the body, owner.width is not dirty (we don't want to write
70
+ // it to the body el). For other el's, the width may already be correct in the
71
+ // DOM (e.g., it is rendered in the markup initially). If the width is not
72
+ // correct in the DOM, this is only going to be the case on the first cycle.
73
+ widthName = widthModel.names.width;
74
+
75
+ if (!body) {
76
+ dirty = firstCycle ? owner[widthName] !== lastSize.width
77
+ : widthModel.constrained;
78
+ }
79
+
80
+ ownerContext.setWidth(owner[widthName], dirty);
81
+ } else if (ownerContext.isTopLevel) {
82
+ if (widthModel.calculated) {
83
+ v = lastBox.width;
84
+ ownerContext.setWidth(v, /*dirty=*/v != lastSize.width);
85
+ }
86
+
87
+ v = lastBox.x;
88
+ ownerContext.setProp('x', v, /*dirty=*/v != lastSize.x);
89
+ }
90
+
91
+ if (heightModel.configured) {
92
+ heightName = heightModel.names.height;
93
+
94
+ if (!body) {
95
+ dirty = firstCycle ? owner[heightName] !== lastSize.height
96
+ : heightModel.constrained;
97
+ }
98
+
99
+ ownerContext.setHeight(owner[heightName], dirty);
100
+ } else if (ownerContext.isTopLevel) {
101
+ if (heightModel.calculated) {
102
+ v = lastBox.height;
103
+ ownerContext.setHeight(v, v != lastSize.height);
104
+ }
105
+
106
+ v = lastBox.y;
107
+ ownerContext.setProp('y', v, /*dirty=*/v != lastSize.y);
108
+ }
109
+ },
110
+
111
+ finishedLayout: function(ownerContext) {
112
+ var me = this,
113
+ elementChildren = ownerContext.children,
114
+ owner = me.owner,
115
+ len, i, elContext, lastBox, props, v;
116
+
117
+ // NOTE: In the code below we cannot use getProp because that will generate a layout dependency
118
+
119
+ // Set lastBox on managed child Elements.
120
+ // So that ContextItem.constructor can snag the lastBox for use by its undo method.
121
+ if (elementChildren) {
122
+ len = elementChildren.length;
123
+ for (i = 0; i < len; i++) {
124
+ elContext = elementChildren[i];
125
+ elContext.el.lastBox = elContext.props;
126
+ }
127
+ }
128
+
129
+ // Cache the size from which we are changing so that notifyOwner can notify the owningComponent with all essential information
130
+ ownerContext.previousSize = me.lastComponentSize;
131
+
132
+ // Cache the currently layed out size
133
+ me.lastComponentSize = owner.el.lastBox = props = ownerContext.props;
134
+
135
+ // lastBox is a copy of the defined props to allow save/restore of these (panel
136
+ // collapse needs this)
137
+ owner.lastBox = lastBox = {};
138
+
139
+ v = props.x;
140
+ if (v !== undefined) {
141
+ lastBox.x = v;
142
+ }
143
+ v = props.y;
144
+ if (v !== undefined) {
145
+ lastBox.y = v;
146
+ }
147
+ v = props.width;
148
+ if (v !== undefined) {
149
+ lastBox.width = v;
150
+ }
151
+ v = props.height;
152
+ if (v !== undefined) {
153
+ lastBox.height = v;
154
+ }
155
+
156
+ me.callParent(arguments);
157
+ },
158
+
159
+ notifyOwner: function(ownerContext) {
160
+ var me = this,
161
+ currentSize = me.lastComponentSize,
162
+ prevSize = ownerContext.previousSize,
163
+ args = [currentSize.width, currentSize.height];
164
+
165
+ if (prevSize) {
166
+ args.push(prevSize.width, prevSize.height);
167
+ }
168
+
169
+ // Call afterComponentLayout passing new size, and only passing old size if there *was* an old size.
170
+ me.owner.afterComponentLayout.apply(me.owner, args);
171
+ },
172
+
173
+ /**
174
+ * Returns the owner component's resize element.
175
+ * @return {Ext.Element}
176
+ */
177
+ getTarget : function() {
178
+ return this.owner.el;
179
+ },
180
+
181
+ /**
182
+ * Returns the element into which rendering must take place. Defaults to the owner Component's encapsulating element.
183
+ *
184
+ * May be overridden in Component layout managers which implement an inner element.
185
+ * @return {Ext.Element}
186
+ */
187
+ getRenderTarget : function() {
188
+ return this.owner.el;
189
+ },
190
+
191
+ cacheTargetInfo: function(ownerContext) {
192
+ var me = this,
193
+ targetInfo = me.targetInfo,
194
+ target;
195
+
196
+ if (!targetInfo) {
197
+ target = ownerContext.getEl('getTarget', me);
198
+
199
+ me.targetInfo = targetInfo = {
200
+ padding: target.getPaddingInfo(),
201
+ border: target.getBorderInfo()
202
+ };
203
+ }
204
+
205
+ return targetInfo;
206
+ },
207
+
208
+ measureAutoDimensions: function (ownerContext, dimensions) {
209
+ // Subtle But Important:
210
+ //
211
+ // We don't want to call getProp/hasProp et.al. unless we in fact need that value
212
+ // for our results! If we call it and don't need it, the layout manager will think
213
+ // we depend on it and will schedule us again should it change.
214
+
215
+ var me = this,
216
+ owner = me.owner,
217
+ heightModel = ownerContext.heightModel,
218
+ widthModel = ownerContext.widthModel,
219
+ boxParent = ownerContext.boxParent,
220
+ isBoxParent = ownerContext.isBoxParent,
221
+ props = ownerContext.props,
222
+ isContainer,
223
+ ret = {
224
+ gotWidth: false,
225
+ gotHeight: false,
226
+ isContainer: (isContainer = !ownerContext.hasRawContent)
227
+ },
228
+ hv = dimensions || 3,
229
+ zeroWidth, zeroHeight,
230
+ needed = 0,
231
+ got = 0,
232
+ ready, size;
233
+
234
+ // Note: this method is called *a lot*, so we have to be careful not to waste any
235
+ // time or make useless calls or, especially, read the DOM when we can avoid it.
236
+
237
+ //---------------------------------------------------------------------
238
+ // Width
239
+
240
+ if (widthModel.shrinkWrap && ownerContext.consumersContentWidth) {
241
+ ++needed;
242
+ zeroWidth = !(hv & 1);
243
+
244
+ if (isContainer) {
245
+ // as a componentLayout for a container, we rely on the container layout to
246
+ // produce contentWidth...
247
+ if (zeroWidth) {
248
+ ret.contentWidth = 0;
249
+ ret.gotWidth = true;
250
+ ++got;
251
+ } else if ((ret.contentWidth = ownerContext.getProp('contentWidth')) !== undefined) {
252
+ ret.gotWidth = true;
253
+ ++got;
254
+ }
255
+ } else {
256
+ size = props.contentWidth;
257
+
258
+ if (typeof size == 'number') { // if (already determined)
259
+ ret.contentWidth = size;
260
+ ret.gotWidth = true;
261
+ ++got;
262
+ } else {
263
+ if (zeroWidth) {
264
+ ready = true;
265
+ } else if (!ownerContext.hasDomProp('containerChildrenDone')) {
266
+ ready = false;
267
+ } else if (isBoxParent || !boxParent || boxParent.widthModel.shrinkWrap) {
268
+ // if we have no boxParent, we are ready, but a shrinkWrap boxParent
269
+ // artificially provides width early in the measurement process so
270
+ // we are ready to go in that case as well...
271
+ ready = true;
272
+ } else {
273
+ // lastly, we have a boxParent that will be given a width, so we
274
+ // can wait for that width to be set in order to properly measure
275
+ // whatever is inside...
276
+ ready = boxParent.hasDomProp('width');
277
+ }
278
+
279
+ if (ready) {
280
+ if (!isNaN(ret.contentWidth = zeroWidth ? 0 : me.measureContentWidth(ownerContext))) {
281
+ ownerContext.setContentWidth(ret.contentWidth, true);
282
+ ret.gotWidth = true;
283
+ ++got;
284
+ }
285
+ }
286
+ }
287
+ }
288
+ } else if (widthModel.natural && ownerContext.consumersWidth) {
289
+ ++needed;
290
+ size = props.width;
291
+ // zeroWidth does not apply
292
+
293
+ if (typeof size == 'number') { // if (already determined)
294
+ ret.width = size;
295
+ ret.gotWidth = true;
296
+ ++got;
297
+ } else {
298
+ if (isBoxParent || !boxParent) {
299
+ ready = true;
300
+ } else {
301
+ // lastly, we have a boxParent that will be given a width, so we
302
+ // can wait for that width to be set in order to properly measure
303
+ // whatever is inside...
304
+ ready = boxParent.hasDomProp('width');
305
+ }
306
+
307
+ if (ready) {
308
+ if (!isNaN(ret.width = me.measureOwnerWidth(ownerContext))) {
309
+ ownerContext.setWidth(ret.width, false);
310
+ ret.gotWidth = true;
311
+ ++got;
312
+ }
313
+ }
314
+ }
315
+ }
316
+
317
+ //---------------------------------------------------------------------
318
+ // Height
319
+
320
+ if (heightModel.shrinkWrap && ownerContext.consumersContentHeight) {
321
+ ++needed;
322
+ zeroHeight = !(hv & 2);
323
+
324
+ if (isContainer) {
325
+ // don't ask unless we need to know...
326
+ if (zeroHeight) {
327
+ ret.contentHeight = 0;
328
+ ret.gotHeight = true;
329
+ ++got;
330
+ } else if ((ret.contentHeight = ownerContext.getProp('contentHeight')) !== undefined) {
331
+ ret.gotHeight = true;
332
+ ++got;
333
+ }
334
+ } else {
335
+ size = props.contentHeight;
336
+
337
+ if (typeof size == 'number') { // if (already determined)
338
+ ret.contentHeight = size;
339
+ ret.gotHeight = true;
340
+ ++got;
341
+ } else {
342
+ if (zeroHeight) {
343
+ ready = true;
344
+ } else if (!ownerContext.hasDomProp('containerChildrenDone')) {
345
+ ready = false;
346
+ } else if (owner.noWrap) {
347
+ ready = true;
348
+ } else if (!widthModel.shrinkWrap) {
349
+ // fixed width, so we need the width to determine the height...
350
+ ready = (ownerContext.bodyContext || ownerContext).hasDomProp('width');// && (!ownerContext.bodyContext || ownerContext.bodyContext.hasDomProp('width'));
351
+ } else if (isBoxParent || !boxParent || boxParent.widthModel.shrinkWrap) {
352
+ // if we have no boxParent, we are ready, but an autoWidth boxParent
353
+ // artificially provides width early in the measurement process so
354
+ // we are ready to go in that case as well...
355
+ ready = true;
356
+ } else {
357
+ // lastly, we have a boxParent that will be given a width, so we
358
+ // can wait for that width to be set in order to properly measure
359
+ // whatever is inside...
360
+ ready = boxParent.hasDomProp('width');
361
+ }
362
+
363
+ if (ready) {
364
+ if (!isNaN(ret.contentHeight = zeroHeight ? 0 : me.measureContentHeight(ownerContext))) {
365
+ ownerContext.setContentHeight(ret.contentHeight, true);
366
+ ret.gotHeight = true;
367
+ ++got;
368
+ }
369
+ }
370
+ }
371
+ }
372
+ } else if (heightModel.natural && ownerContext.consumersHeight) {
373
+ ++needed;
374
+ size = props.height;
375
+ // zeroHeight does not apply
376
+
377
+ if (typeof size == 'number') { // if (already determined)
378
+ ret.height = size;
379
+ ret.gotHeight = true;
380
+ ++got;
381
+ } else {
382
+ if (isBoxParent || !boxParent) {
383
+ ready = true;
384
+ } else {
385
+ // lastly, we have a boxParent that will be given a width, so we
386
+ // can wait for that width to be set in order to properly measure
387
+ // whatever is inside...
388
+ ready = boxParent.hasDomProp('width');
389
+ }
390
+
391
+ if (ready) {
392
+ if (!isNaN(ret.height = me.measureOwnerHeight(ownerContext))) {
393
+ ownerContext.setHeight(ret.height, false);
394
+ ret.gotHeight = true;
395
+ ++got;
396
+ }
397
+ }
398
+ }
399
+ }
400
+
401
+ if (boxParent) {
402
+ ownerContext.onBoxMeasured();
403
+ }
404
+
405
+ ret.gotAll = got == needed;
406
+ // see if we can avoid calling this method by storing something on ownerContext.
407
+ return ret;
408
+ },
409
+
410
+ measureContentWidth: function (ownerContext) {
411
+ // contentWidth includes padding, but not border, framing or margins
412
+ return ownerContext.el.getWidth() - ownerContext.getFrameInfo().width;
413
+ },
414
+
415
+ measureContentHeight: function (ownerContext) {
416
+ // contentHeight includes padding, but not border, framing or margins
417
+ return ownerContext.el.getHeight() - ownerContext.getFrameInfo().height;
418
+ },
419
+
420
+ measureOwnerHeight: function (ownerContext) {
421
+ return ownerContext.el.getHeight();
422
+ },
423
+
424
+ measureOwnerWidth: function (ownerContext) {
425
+ return ownerContext.el.getWidth();
426
+ }
427
+ });
@@ -0,0 +1,1132 @@
1
+ /**
2
+ * This ComponentLayout handles docking for Panels. It takes care of panels that are
3
+ * part of a ContainerLayout that sets this Panel's size and Panels that are part of
4
+ * an AutoContainerLayout in which this panel get his height based of the CSS or
5
+ * or its content.
6
+ * @private
7
+ */
8
+ Ext.define('Ext.layout.component.Dock', {
9
+
10
+ /* Begin Definitions */
11
+
12
+ extend: 'Ext.layout.component.Component',
13
+
14
+ alias: 'layout.dock',
15
+
16
+ alternateClassName: 'Ext.layout.component.AbstractDock',
17
+
18
+ /* End Definitions */
19
+
20
+ type: 'dock',
21
+
22
+ initializedBorders: -1,
23
+
24
+ horizontalCollapsePolicy: { width: true, x: true },
25
+
26
+ verticalCollapsePolicy: { height: true, y: true },
27
+
28
+ finishRender: function () {
29
+ var me = this,
30
+ target, items;
31
+
32
+ me.callParent();
33
+
34
+ target = me.getRenderTarget();
35
+ items = me.getDockedItems();
36
+
37
+ me.finishRenderItems(target, items);
38
+ },
39
+
40
+ isItemBoxParent: function (itemContext) {
41
+ return true;
42
+ },
43
+
44
+ isItemShrinkWrap: function (item) {
45
+ return true;
46
+ },
47
+
48
+ dockOpposites: {
49
+ top: 'bottom',
50
+ right: 'left',
51
+ bottom: 'top',
52
+ left: 'right'
53
+ },
54
+
55
+ handleItemBorders: function() {
56
+ var me = this,
57
+ owner = me.owner,
58
+ borders, docked,
59
+ oldBorders = me.borders,
60
+ opposites = me.dockOpposites,
61
+ currentGeneration = owner.dockedItems.generation,
62
+ i, ln, item, dock, side,
63
+ collapsed = me.collapsed;
64
+
65
+ if (me.initializedBorders == currentGeneration || (owner.border && !owner.manageBodyBorders)) {
66
+ return;
67
+ }
68
+
69
+ me.initializedBorders = currentGeneration;
70
+
71
+ // Borders have to be calculated using expanded docked item collection.
72
+ me.collapsed = false;
73
+ docked = me.getLayoutItems();
74
+ me.collapsed = collapsed;
75
+
76
+ borders = { top: [], right: [], bottom: [], left: [] };
77
+
78
+ for (i = 0, ln = docked.length; i < ln; i++) {
79
+ item = docked[i];
80
+ dock = item.dock;
81
+
82
+ if (item.ignoreBorderManagement) {
83
+ continue;
84
+ }
85
+
86
+ if (!borders[dock].satisfied) {
87
+ borders[dock].push(item);
88
+ borders[dock].satisfied = true;
89
+ }
90
+
91
+ if (!borders.top.satisfied && opposites[dock] !== 'top') {
92
+ borders.top.push(item);
93
+ }
94
+ if (!borders.right.satisfied && opposites[dock] !== 'right') {
95
+ borders.right.push(item);
96
+ }
97
+ if (!borders.bottom.satisfied && opposites[dock] !== 'bottom') {
98
+ borders.bottom.push(item);
99
+ }
100
+ if (!borders.left.satisfied && opposites[dock] !== 'left') {
101
+ borders.left.push(item);
102
+ }
103
+ }
104
+
105
+ if (oldBorders) {
106
+ for (side in oldBorders) {
107
+ if (oldBorders.hasOwnProperty(side)) {
108
+ ln = oldBorders[side].length;
109
+ if (!owner.manageBodyBorders) {
110
+ for (i = 0; i < ln; i++) {
111
+ oldBorders[side][i].removeCls(Ext.baseCSSPrefix + 'docked-noborder-' + side);
112
+ }
113
+ if (!oldBorders[side].satisfied && !owner.bodyBorder) {
114
+ owner.removeBodyCls(Ext.baseCSSPrefix + 'docked-noborder-' + side);
115
+ }
116
+ }
117
+ else if (oldBorders[side].satisfied) {
118
+ owner.setBodyStyle('border-' + side + '-width', '');
119
+ }
120
+ }
121
+ }
122
+ }
123
+
124
+ for (side in borders) {
125
+ if (borders.hasOwnProperty(side)) {
126
+ ln = borders[side].length;
127
+ if (!owner.manageBodyBorders) {
128
+ for (i = 0; i < ln; i++) {
129
+ borders[side][i].addCls(Ext.baseCSSPrefix + 'docked-noborder-' + side);
130
+ }
131
+ if ((!borders[side].satisfied && !owner.bodyBorder) || owner.bodyBorder === false) {
132
+ owner.addBodyCls(Ext.baseCSSPrefix + 'docked-noborder-' + side);
133
+ }
134
+ }
135
+ else if (borders[side].satisfied) {
136
+ owner.setBodyStyle('border-' + side + '-width', '1px');
137
+ }
138
+ }
139
+ }
140
+
141
+ me.borders = borders;
142
+ },
143
+
144
+ beginLayout: function(ownerContext) {
145
+ var me = this,
146
+ owner = me.owner,
147
+ docked = me.getLayoutItems(),
148
+ layoutContext = ownerContext.context,
149
+ dockedItemCount = docked.length,
150
+ collapsedVert = false,
151
+ collapsedHorz = false,
152
+ dockedItems, i, item, itemContext, offsets,
153
+ collapsed;
154
+
155
+ me.callParent(arguments);
156
+
157
+ me.handleItemBorders();
158
+
159
+ // Cache the children as ContextItems (like a Container). Also setup to handle
160
+ // collapsed state:
161
+ collapsed = owner.getCollapsed();
162
+ if (Ext.isDefined(me.lastCollapsedState) && (collapsed !== me.lastCollapsedState)) {
163
+
164
+ // If we are collapsing...
165
+ if (me.owner.collapsed) {
166
+ ownerContext.isCollapsingOrExpanding = 1;
167
+ // Add the collapsed class now, so that collapsed CSS rules are applied before measurements are taken by the layout.
168
+ owner.addClsWithUI(owner.collapsedCls);
169
+ } else {
170
+ ownerContext.isCollapsingOrExpanding = 2;
171
+ // Remove the collapsed class now, before layout calculations are done.
172
+ owner.removeClsWithUI(owner.collapsedCls);
173
+ ownerContext.lastCollapsedState = me.lastCollapsedState;
174
+ }
175
+ }
176
+ me.lastCollapsedState = collapsed;
177
+
178
+ ownerContext.dockedItems = dockedItems = [];
179
+
180
+ for (i = 0; i < dockedItemCount; i++) {
181
+ item = docked[i];
182
+ itemContext = layoutContext.getCmp(item);
183
+ itemContext.dockedAt = { x: 0, y: 0 };
184
+ itemContext.offsets = offsets = Ext.Element.parseBox(item.offsets || {});
185
+ offsets.width = offsets.left + offsets.right;
186
+ offsets.height = offsets.top + offsets.bottom;
187
+ dockedItems.push(itemContext);
188
+ }
189
+
190
+ if (owner.collapsed) {
191
+ if (owner.collapsedVertical()) {
192
+ collapsedVert = true;
193
+ ownerContext.measureDimensions = 1;
194
+ } else {
195
+ collapsedHorz = true;
196
+ ownerContext.measureDimensions = 2;
197
+ }
198
+ }
199
+
200
+ ownerContext.collapsedVert = collapsedVert;
201
+ ownerContext.collapsedHorz = collapsedHorz;
202
+
203
+ ownerContext.bodyContext = ownerContext.getEl('body');
204
+ },
205
+
206
+ beginLayoutCycle: function(ownerContext) {
207
+ var me = this,
208
+ docked = ownerContext.dockedItems,
209
+ len = docked.length,
210
+ owner = me.owner,
211
+ frameBody = owner.frameBody,
212
+ lastHeightModel = me.lastHeightModel,
213
+ i, item, dock;
214
+
215
+ me.callParent(arguments);
216
+
217
+ // If we are collapsed, we want to auto-layout using the placeholder/expander
218
+ // instead of the normal items/dockedItems. This must be done here since we could
219
+ // be in a box layout w/stretchmax which sets the width/heightModel to allow it to
220
+ // control the size.
221
+ if (ownerContext.collapsedVert) {
222
+ ownerContext.heightModel = me.sizeModels.shrinkWrap;
223
+ } else if (ownerContext.collapsedHorz) {
224
+ ownerContext.widthModel = me.sizeModels.shrinkWrap;
225
+ }
226
+
227
+ if (lastHeightModel && lastHeightModel.shrinkWrap &&
228
+ !ownerContext.heightModel.shrinkWrap &&
229
+ !me.owner.manageHeight) {
230
+ owner.body.dom.style.marginBottom = '';
231
+ }
232
+
233
+ if (ownerContext.widthModel.auto) {
234
+ if (ownerContext.widthModel.shrinkWrap) {
235
+ owner.el.setWidth(null);
236
+ }
237
+ owner.body.setWidth(null);
238
+ if (frameBody) {
239
+ frameBody.setWidth(null);
240
+ }
241
+ }
242
+ if (ownerContext.heightModel.auto) {
243
+ owner.body.setHeight(null);
244
+ //owner.el.setHeight(null); Disable this for now
245
+ if (frameBody) {
246
+ frameBody.setHeight(null);
247
+ }
248
+ }
249
+
250
+ // Each time we begin (2nd+ would be due to invalidate) we need to publish the
251
+ // known contentWidth/Height if we are collapsed:
252
+ if (ownerContext.collapsedVert) {
253
+ ownerContext.setContentHeight(0);
254
+ } else if (ownerContext.collapsedHorz) {
255
+ ownerContext.setContentWidth(0);
256
+ }
257
+
258
+ // dock: 'right' items, when a panel gets narrower get "squished". Moving them to
259
+ // left:0px avoids this!
260
+ for (i = 0; i < len; i++) {
261
+ item = docked[i].target;
262
+ dock = item.dock;
263
+
264
+ if (dock == 'right') {
265
+ item.el.setLeft(0);
266
+ } else if (dock != 'left') {
267
+ continue;
268
+ }
269
+
270
+ // TODO - clear width/height?
271
+ }
272
+ },
273
+
274
+ calculate: function (ownerContext) {
275
+ var me = this,
276
+ measure = me.measureAutoDimensions(ownerContext, ownerContext.measureDimensions),
277
+ state = ownerContext.state,
278
+ horzDone = state.horzDone,
279
+ vertDone = state.vertDone,
280
+ bodyContext = ownerContext.bodyContext,
281
+ horz, vert, forward, backward;
282
+
283
+ // make sure we can use these value w/o calling methods to get them
284
+ ownerContext.borderInfo || ownerContext.getBorderInfo();
285
+ ownerContext.paddingInfo || ownerContext.getPaddingInfo();
286
+ ownerContext.framingInfo || ownerContext.getFraming();
287
+ bodyContext.borderInfo || bodyContext.getBorderInfo();
288
+ bodyContext.paddingInfo || bodyContext.getPaddingInfo();
289
+
290
+ // Start the axes so they are ready to proceed inwards (fixed-size) or outwards
291
+ // (shrinkWrap) and stash key property names as well:
292
+ horz = !horzDone &&
293
+ me.createAxis(ownerContext, measure.contentWidth, ownerContext.widthModel,
294
+ 'left', 'right', 'x', 'width', 'Width', ownerContext.collapsedHorz);
295
+ vert = !vertDone &&
296
+ me.createAxis(ownerContext, measure.contentHeight, ownerContext.heightModel,
297
+ 'top', 'bottom', 'y', 'height', 'Height', ownerContext.collapsedVert);
298
+
299
+ // We iterate forward and backward over the dockedItems at the same time based on
300
+ // whether an axis is shrinkWrap or fixed-size. For a fixed-size axis, the outer box
301
+ // axis is allocated to docked items in forward order and is reduced accordingly.
302
+ // To handle a shrinkWrap axis, the box starts at the inner (body) size and is used to
303
+ // size docked items in backwards order. This is because the last docked item shares
304
+ // an edge with the body. The item size is used to adjust the shrinkWrap axis outwards
305
+ // until the first docked item (at the outermost edge) is processed. This backwards
306
+ // order ensures that docked items never get an incorrect size for any dimension.
307
+ for (forward = 0, backward = ownerContext.dockedItems.length; backward--; ++forward) {
308
+ if (horz) {
309
+ me.dockChild(ownerContext, horz, backward, forward);
310
+ }
311
+ if (vert) {
312
+ me.dockChild(ownerContext, vert, backward, forward);
313
+ }
314
+ }
315
+
316
+ if (horz && me.finishAxis(ownerContext, horz)) {
317
+ state.horzDone = horzDone = horz;
318
+ }
319
+
320
+ if (vert && me.finishAxis(ownerContext, vert)) {
321
+ state.vertDone = vertDone = vert;
322
+ }
323
+
324
+ // Once all items are docked, the final size of the outer panel or inner body can
325
+ // be determined. If we can determine both width and height, we are done.
326
+ if (horzDone && vertDone && me.finishConstraints(ownerContext, horzDone, vertDone)) {
327
+ // Size information is published as we dock items but position is hard to do
328
+ // that way (while avoiding published multiple times) so we publish all the
329
+ // positions at the end.
330
+ me.finishPositions(ownerContext, horzDone, vertDone);
331
+ } else {
332
+ me.done = false;
333
+ }
334
+ },
335
+
336
+ /**
337
+ * Creates an axis object given the particulars.
338
+ * @private
339
+ */
340
+ createAxis: function (ownerContext, contentSize, sizeModel, dockBegin, dockEnd, posProp,
341
+ sizeProp, sizePropCap, collapsedAxis) {
342
+ var begin = 0,
343
+ owner = this.owner,
344
+ maxSize = owner['max' + sizePropCap],
345
+ minSize = owner['min' + sizePropCap] || 0,
346
+ hasMaxSize = maxSize != null, // exactly the same as "maxSize !== null && maxSize !== undefined"
347
+ constrainedSize = ownerContext.state['constrained' + sizePropCap],
348
+ isConstrainedSize = constrainedSize != null,
349
+ setSize = 'set' + sizePropCap,
350
+ border, bodyContext, frameSize, padding, end;
351
+
352
+ if (sizeModel.shrinkWrap && !isConstrainedSize) {
353
+ // End position before adding docks around the content is content size plus the body borders in this axis.
354
+ // If collapsed in this axis, the body borders will not be shown.
355
+ if (collapsedAxis) {
356
+ end = 0;
357
+ } else {
358
+ bodyContext = ownerContext.bodyContext;
359
+ end = contentSize + bodyContext.borderInfo[sizeProp];
360
+ }
361
+ } else {
362
+ border = ownerContext.borderInfo;
363
+ frameSize = ownerContext.framingInfo;
364
+ padding = ownerContext.paddingInfo;
365
+
366
+ if (isConstrainedSize) {
367
+ end = constrainedSize;
368
+ sizeModel = this.sizeModels.calculated; // behave as if calculated
369
+ ownerContext[setSize](constrainedSize);
370
+ } else {
371
+ end = ownerContext.getProp(sizeProp);
372
+ }
373
+
374
+ end -= border[dockEnd] + padding[dockEnd] + frameSize[dockEnd];
375
+ begin = border[dockBegin] + padding[dockBegin] + frameSize[dockBegin];
376
+ }
377
+
378
+ return {
379
+ shrinkWrap: sizeModel.shrinkWrap,
380
+ sizeModel: sizeModel,
381
+ // An axis tracks start and end+1 px positions. eg 0 to 10 for 10px high
382
+ begin: begin,
383
+ end: end,
384
+ collapsed: collapsedAxis,
385
+ horizontal: posProp == 'x',
386
+ ignoreFrameBegin: false,
387
+ ignoreFrameEnd: false,
388
+ initialSize: end - begin,
389
+ hasMinMaxConstraints: (minSize || hasMaxSize) && sizeModel.shrinkWrap,
390
+ isConstrainedSize: isConstrainedSize,
391
+ minSize: minSize,
392
+ maxSize: hasMaxSize ? maxSize : 1e9,
393
+ bodyPosProp: this.owner.manageHeight ? posProp : ('margin-' + dockBegin), // 'margin-left' or 'margin-top'
394
+ dockBegin: dockBegin, // 'left' or 'top'
395
+ dockEnd: dockEnd, // 'right' or 'end'
396
+ posProp: posProp, // 'x' or 'y'
397
+ sizeProp: sizeProp, // 'width' or 'height'
398
+ sizePropCap: sizePropCap, // 'Width' or 'Height'
399
+ setSize: setSize,
400
+ dockedPixelsEnd: 0
401
+ };
402
+ },
403
+
404
+ /**
405
+ * Docks a child item on the specified axis. This boils down to determining if the item
406
+ * is docked at the "beginning" of the axis ("left" if horizontal, "top" if vertical),
407
+ * the "end" of the axis ("right" if horizontal, "bottom" if vertical) or stretches
408
+ * along the axis ("top" or "bottom" if horizontal, "left" or "right" if vertical). It
409
+ * also has to differentiate between fixed and shrinkWrap sized dimensions.
410
+ * @private
411
+ */
412
+ dockChild: function (ownerContext, axis, backward, forward) {
413
+ var me = this,
414
+ itemContext = ownerContext.dockedItems[axis.shrinkWrap ? backward : forward],
415
+ item = itemContext.target,
416
+ dock = item.dock, // left/top/right/bottom
417
+ pos;
418
+
419
+ if(item.ignoreParentFrame && ownerContext.isCollapsingOrExpanding) {
420
+ // collapsed window header margins may differ from expanded window header margins
421
+ // so we need to make sure the old cached values are not used in axis calculations
422
+ itemContext.clearMarginCache();
423
+ }
424
+
425
+ if (dock == axis.dockBegin) {
426
+ if (axis.shrinkWrap) {
427
+ pos = me.dockOutwardBegin(ownerContext, itemContext, item, axis);
428
+ } else {
429
+ pos = me.dockInwardBegin(ownerContext, itemContext, item, axis);
430
+ }
431
+ } else if (dock == axis.dockEnd) {
432
+ if (axis.shrinkWrap) {
433
+ pos = me.dockOutwardEnd(ownerContext, itemContext, item, axis);
434
+ } else {
435
+ pos = me.dockInwardEnd(ownerContext, itemContext, item, axis);
436
+ }
437
+ } else {
438
+ pos = me.dockStretch(ownerContext, itemContext, item, axis);
439
+ }
440
+
441
+ itemContext.dockedAt[axis.posProp] = pos;
442
+ },
443
+
444
+ /**
445
+ * Docks an item on a fixed-size axis at the "beginning". The "beginning" of the horizontal
446
+ * axis is "left" and the vertical is "top". For a fixed-size axis, the size works from
447
+ * the outer element (the panel) towards the body.
448
+ * @private
449
+ */
450
+ dockInwardBegin: function (ownerContext, itemContext, item, axis) {
451
+ var pos = axis.begin,
452
+ sizeProp = axis.sizeProp,
453
+ size,
454
+ dock;
455
+
456
+ if (item.ignoreParentFrame) {
457
+ dock = item.dock;
458
+ pos -= ownerContext.borderInfo[dock] + ownerContext.paddingInfo[dock] +
459
+ ownerContext.framingInfo[dock];
460
+ }
461
+
462
+ if (!item.overlay) {
463
+ size = itemContext.getProp(sizeProp) + itemContext.getMarginInfo()[sizeProp];
464
+ axis.begin += size;
465
+ }
466
+
467
+ return pos;
468
+ },
469
+
470
+ /**
471
+ * Docks an item on a fixed-size axis at the "end". The "end" of the horizontal axis is
472
+ * "right" and the vertical is "bottom".
473
+ * @private
474
+ */
475
+ dockInwardEnd: function (ownerContext, itemContext, item, axis) {
476
+ var sizeProp = axis.sizeProp,
477
+ size = itemContext.getProp(sizeProp) + itemContext.getMarginInfo()[sizeProp],
478
+ pos = axis.end - size;
479
+
480
+ if (!item.overlay) {
481
+ axis.end = pos;
482
+ }
483
+
484
+ if (item.ignoreParentFrame) {
485
+ pos += ownerContext.borderInfo[item.dock] + ownerContext.paddingInfo[item.dock] +
486
+ ownerContext.framingInfo[item.dock];
487
+ }
488
+
489
+ return pos;
490
+ },
491
+
492
+ /**
493
+ * Docks an item on a shrinkWrap axis at the "beginning". The "beginning" of the horizontal
494
+ * axis is "left" and the vertical is "top". For a shrinkWrap axis, the size works from
495
+ * the body outward to the outermost element (the panel).
496
+ *
497
+ * During the docking process, coordinates are allowed to be negative. We start with the
498
+ * body at (0,0) so items docked "top" or "left" will simply be assigned negative x/y. In
499
+ * the {@link #finishPositions} method these are corrected and framing is added. This way
500
+ * the correction is applied as a simple translation of delta x/y on all coordinates to
501
+ * bring the origin back to (0,0).
502
+ * @private
503
+ */
504
+ dockOutwardBegin: function (ownerContext, itemContext, item, axis) {
505
+ var pos = axis.begin,
506
+ sizeProp = axis.sizeProp,
507
+ dock, size;
508
+
509
+ if (axis.collapsed) {
510
+ axis.ignoreFrameBegin = axis.ignoreFrameEnd = true;
511
+ } else if (item.ignoreParentFrame) {
512
+ dock = item.dock;
513
+ pos -= ownerContext.borderInfo[dock] + ownerContext.paddingInfo[dock] +
514
+ ownerContext.framingInfo[dock];
515
+
516
+ axis.ignoreFrameBegin = true;
517
+ }
518
+
519
+ if (!item.overlay) {
520
+ size = itemContext.getProp(sizeProp) + itemContext.getMarginInfo()[sizeProp];
521
+ pos -= size;
522
+ axis.begin = pos;
523
+ }
524
+
525
+ return pos;
526
+ },
527
+
528
+ /**
529
+ * Docks an item on a shrinkWrap axis at the "end". The "end" of the horizontal axis is
530
+ * "right" and the vertical is "bottom".
531
+ * @private
532
+ */
533
+ dockOutwardEnd: function (ownerContext, itemContext, item, axis) {
534
+ var pos = axis.end,
535
+ sizeProp = axis.sizeProp,
536
+ dock, size;
537
+
538
+ size = itemContext.getProp(sizeProp) + itemContext.getMarginInfo()[sizeProp];
539
+
540
+ if (axis.collapsed) {
541
+ axis.ignoreFrameBegin = axis.ignoreFrameEnd = true;
542
+ } else if (item.ignoreParentFrame) {
543
+ dock = item.dock;
544
+ pos += ownerContext.borderInfo[dock] + ownerContext.paddingInfo[dock] +
545
+ ownerContext.framingInfo[dock];
546
+
547
+ axis.ignoreFrameEnd = true;
548
+ }
549
+
550
+ if (!item.overlay) {
551
+ axis.end = pos + size;
552
+ axis.dockedPixelsEnd += size;
553
+ }
554
+
555
+ return pos;
556
+ },
557
+
558
+ /**
559
+ * Docks an item that might stretch across an axis. This is done for dock "top" and
560
+ * "bottom" items on the horizontal axis and dock "left" and "right" on the vertical.
561
+ * @private
562
+ */
563
+ dockStretch: function (ownerContext, itemContext, item, axis) {
564
+ var dock = item.dock, // left/top/right/bottom (also used to index padding/border)
565
+ sizeProp = axis.sizeProp, // 'width' or 'height'
566
+ horizontal = dock == 'top' || dock == 'bottom',
567
+ offsets = itemContext.offsets,
568
+ border = ownerContext.borderInfo,
569
+ padding = ownerContext.paddingInfo,
570
+ endProp = horizontal ? 'right' : 'bottom',
571
+ startProp = horizontal ? 'left' : 'top',
572
+ pos = axis.begin + offsets[startProp],
573
+ margin, size, framing;
574
+
575
+ if (item.stretch !== false) {
576
+ size = axis.end - pos - offsets[endProp];
577
+
578
+ if (item.ignoreParentFrame) {
579
+ framing = ownerContext.framingInfo;
580
+ pos -= border[startProp] + padding[startProp] + framing[startProp];
581
+ size += border[sizeProp] + padding[sizeProp] + framing[sizeProp];
582
+ }
583
+
584
+ margin = itemContext.getMarginInfo();
585
+ size -= margin[sizeProp];
586
+
587
+ itemContext[axis.setSize](size);
588
+ }
589
+
590
+ return pos;
591
+ },
592
+
593
+ /**
594
+ * Finishes the calculation of an axis by determining its size. In non-shrink-wrap
595
+ * cases, this is also where we set the body size.
596
+ * @private
597
+ */
598
+ finishAxis: function (ownerContext, axis) {
599
+ var size = axis.end - axis.begin,
600
+ setSizeMethod = axis.setSize,
601
+ beginName = axis.dockBegin, // left or top
602
+ endName = axis.dockEnd, // right or bottom
603
+ border = ownerContext.borderInfo,
604
+ padding = ownerContext.paddingInfo,
605
+ framing = ownerContext.framingInfo,
606
+ frameSize = padding[beginName] + border[beginName] + framing[beginName],
607
+ bodyContext = ownerContext.bodyContext,
608
+ bodyPos, bodySize, dirty;
609
+
610
+ if (axis.shrinkWrap) {
611
+ // Since items docked left/top on a shrinkWrap axis go into negative coordinates,
612
+ // we apply a delta to all coordinates to adjust their relative origin back to
613
+ // (0,0).
614
+ axis.delta = -axis.begin; // either 0 or a positive number
615
+
616
+ bodySize = axis.initialSize;
617
+
618
+ if (axis.ignoreFrameBegin) {
619
+ axis.delta -= border[beginName];
620
+ bodyPos = -axis.begin - frameSize;
621
+ } else {
622
+ size += frameSize;
623
+ axis.delta += padding[beginName] + framing[beginName];
624
+ bodyPos = -axis.begin;
625
+ }
626
+
627
+ if (!axis.ignoreFrameEnd) {
628
+ size += padding[endName] + border[endName] + framing[endName];
629
+ }
630
+
631
+ axis.size = size; // we have to wait for min/maxWidth/Height processing
632
+
633
+ if (!axis.horizontal && !this.owner.manageHeight) {
634
+ // the height of the bodyEl will give the proper height to the outerEl so
635
+ // we don't need to set heights in the DOM
636
+ dirty = false;
637
+ }
638
+ } else {
639
+ // For a fixed-size axis, we started at the outer box and already have the
640
+ // proper origin... almost... except for the owner's border.
641
+ axis.delta = -border[axis.dockBegin]; // 'left' or 'top'
642
+
643
+ // Body size is remaining space between ends of Axis.
644
+ bodySize = size;
645
+ bodyPos = axis.begin - frameSize;
646
+ }
647
+
648
+ bodyContext[setSizeMethod](bodySize, dirty);
649
+ bodyContext.setProp(axis.bodyPosProp, bodyPos);
650
+
651
+ return !isNaN(size);
652
+ },
653
+
654
+ /**
655
+ * Finishes processing of each axis by applying the min/max size constraints.
656
+ * @private
657
+ */
658
+ finishConstraints: function (ownerContext, horz, vert) {
659
+ var horzTooSmall = horz.size < horz.minSize,
660
+ horzTooBig = horz.size > horz.maxSize,
661
+ vertTooSmall = vert.size < vert.minSize,
662
+ vertTooBig = vert.size > vert.maxSize,
663
+ state = ownerContext.state,
664
+ ret = true,
665
+ configured = this.sizeModels.configured,
666
+ dirty;
667
+
668
+ // Analysis of the potential constraint feedback given the possibilities for the
669
+ // various constraints:
670
+ //
671
+ // #1: h < min, v > max : (Expand width, Shrink height)
672
+ // In general, making the panel wider could possibly cause the content to
673
+ // be shorter thereby eliminating the need to reduce the height, but we
674
+ // just measured the content width given effectively infinite space in
675
+ // which to expand. This means it is very unlikey (if not impossible) for
676
+ // the height to change given more width, so no special concerns.
677
+ //
678
+ // #2: h < min, v < min : (Expand width, Expand height)
679
+ // Making panel bigger in both directions has no concerns. Again, making
680
+ // the panel wider could only reduce height, so the need to expand the
681
+ // height would remain.
682
+ //
683
+ // #3: h > max, v > max : (Shrink width, Shrink height)
684
+ // Making the panel narrower cannot cause the maxHeight violation to go
685
+ // away, so no special concerns.
686
+ //
687
+ // #4: h > max, v < min : (Shrink width, Expand height)
688
+ // Finally an interesting case! Shrinking the width can cause the height
689
+ // to increase. We cannot know if it will increase enough to avoid the
690
+ // minHeight violation, but if we apply the minHeight constraint, we will
691
+ // not be able to tell that we should not have done so. Which means, in
692
+ // this case, we must only apply the maxWidth constraint, allowing the
693
+ // layout to rerun and perhaps apply the minHeight constraint next time.
694
+
695
+ // NOTE: if we are already applying a constraint on a given axis, that axis will
696
+ // *not* be in shrinkWrap mode.
697
+
698
+ if (horz.shrinkWrap && horzTooBig && vert.shrinkWrap && vertTooSmall) { // if (#4)
699
+ state.constrainedWidth = horz.maxSize;
700
+ ownerContext.widthModel = configured; // via maxWidth config
701
+ ret = false;
702
+ } else {
703
+ if (horz.shrinkWrap) {
704
+ if (horzTooBig) {
705
+ state.constrainedWidth = horz.maxSize;
706
+ ownerContext.widthModel = configured;
707
+ ret = false;
708
+ } else if (horzTooSmall) {
709
+ state.constrainedWidth = horz.minSize;
710
+ ownerContext.widthModel = configured;
711
+ ret = false;
712
+ }
713
+ }
714
+
715
+ if (vert.shrinkWrap) {
716
+ if (vertTooBig) {
717
+ state.constrainedHeight = vert.maxSize;
718
+ ownerContext.heightModel = configured;
719
+ ret = false;
720
+ } else if (vertTooSmall) {
721
+ state.constrainedHeight = vert.minSize;
722
+ ownerContext.heightModel = configured;
723
+ ret = false;
724
+ }
725
+ }
726
+ }
727
+
728
+ if (ret) {
729
+ if (horz.shrinkWrap) {
730
+ ownerContext.setWidth(horz.size);
731
+ }
732
+ if (vert.shrinkWrap) {
733
+ if (!ownerContext.collapsedVert && !this.owner.manageHeight) {
734
+ // height of the outerEl is provided by the height (including margins) of
735
+ // the bodyEl, so this value does not need to be written to the DOM:
736
+ dirty = false;
737
+
738
+ // so long as we set top and bottom margins on the bodyEl!
739
+ ownerContext.bodyContext.setProp('margin-bottom', vert.dockedPixelsEnd);
740
+ }
741
+
742
+ ownerContext.setHeight(vert.size, dirty);
743
+ }
744
+ } else {
745
+ ownerContext.invalidate({
746
+ state: {
747
+ constrainedWidth: state.constrainedWidth,
748
+ constrainedHeight: state.constrainedHeight
749
+ }
750
+ });
751
+ }
752
+
753
+ return ret;
754
+ },
755
+
756
+ /**
757
+ * Finishes the calculation by setting positions on the body and all of the items.
758
+ * @private
759
+ */
760
+ finishPositions: function (ownerContext, horz, vert) {
761
+ var dockedItems = ownerContext.dockedItems,
762
+ length = dockedItems.length,
763
+ deltaX = horz.delta,
764
+ deltaY = vert.delta,
765
+ index, itemContext;
766
+
767
+ for (index = 0; index < length; ++index) {
768
+ itemContext = dockedItems[index];
769
+
770
+ itemContext.setProp('x', deltaX + itemContext.dockedAt.x);
771
+ itemContext.setProp('y', deltaY + itemContext.dockedAt.y);
772
+ }
773
+ },
774
+
775
+ finishedLayout: function(ownerContext) {
776
+ var me = this,
777
+ target = ownerContext.target;
778
+
779
+ me.callParent(arguments);
780
+
781
+ if (!ownerContext.animatePolicy) {
782
+ if (ownerContext.isCollapsingOrExpanding === 1) {
783
+ target.afterCollapse(false);
784
+ } else if (ownerContext.isCollapsingOrExpanding === 2) {
785
+ target.afterExpand(false);
786
+ }
787
+ }
788
+ },
789
+
790
+ getAnimatePolicy: function(ownerContext) {
791
+ var me = this,
792
+ lastCollapsedState, policy;
793
+
794
+ if (ownerContext.isCollapsingOrExpanding == 1) {
795
+ lastCollapsedState = me.lastCollapsedState;
796
+ } else if (ownerContext.isCollapsingOrExpanding == 2) {
797
+ lastCollapsedState = ownerContext.lastCollapsedState;
798
+ }
799
+
800
+ if (lastCollapsedState == 'left' || lastCollapsedState == 'right') {
801
+ policy = me.horizontalCollapsePolicy;
802
+ } else if (lastCollapsedState == 'top' || lastCollapsedState == 'bottom') {
803
+ policy = me.verticalCollapsePolicy;
804
+ }
805
+
806
+ return policy;
807
+ },
808
+
809
+ /**
810
+ * Retrieve an ordered and/or filtered array of all docked Components.
811
+ * @param {String} [order='render'] The desired ordering of the items ('render' or 'visual').
812
+ * @param {Boolean} [beforeBody] An optional flag to limit the set of items to only those
813
+ * before the body (true) or after the body (false). All components are returned by
814
+ * default.
815
+ * @return {Ext.Component[]} An array of components.
816
+ * @protected
817
+ */
818
+ getDockedItems: function(order, beforeBody) {
819
+ var me = this,
820
+ all = me.owner.dockedItems.items,
821
+ sort = all && all.length && order !== false,
822
+ renderOrder,
823
+ dock, dockedItems, i, isBefore, length;
824
+
825
+ if (beforeBody == null) {
826
+ dockedItems = sort ? all.slice() : all;
827
+ } else {
828
+ dockedItems = [];
829
+
830
+ for (i = 0, length = all.length; i < length; ++i) {
831
+ dock = all[i].dock;
832
+ isBefore = (dock == 'top' || dock == 'left');
833
+ if (beforeBody ? isBefore : !isBefore) {
834
+ dockedItems.push(all[i]);
835
+ }
836
+ }
837
+
838
+ sort = sort && dockedItems.length;
839
+ }
840
+
841
+ if (sort) {
842
+ renderOrder = (order = order || 'render') == 'render';
843
+ Ext.Array.sort(dockedItems, function(a, b) {
844
+ var aw,
845
+ bw;
846
+
847
+ // If the two items are on opposite sides of the body, they must not be sorted by any weight value:
848
+ // For rendering purposes, left/top *always* sorts before right/bottom
849
+ if (renderOrder && ((aw = me.owner.dockOrder[a.dock]) !== (bw = me.owner.dockOrder[b.dock]))) {
850
+
851
+ // The two dockOrder values cancel out when two items are on opposite sides.
852
+ if (!(aw + bw)) {
853
+ return aw - bw;
854
+ }
855
+ }
856
+
857
+ aw = me.getItemWeight(a, order);
858
+ bw = me.getItemWeight(b, order);
859
+ if ((aw !== undefined) && (bw !== undefined)) {
860
+ return aw - bw;
861
+ }
862
+ return 0;
863
+ });
864
+ }
865
+
866
+ return dockedItems || [];
867
+ },
868
+
869
+ getItemWeight: function (item, order) {
870
+ var weight = item.weight || this.owner.defaultDockWeights[item.dock];
871
+ return weight[order] || weight;
872
+ },
873
+
874
+ /**
875
+ * @protected
876
+ * Returns an array containing all the **visible** docked items inside this layout's owner Panel
877
+ * @return {Array} An array containing all the **visible** docked items of the Panel
878
+ */
879
+ getLayoutItems : function() {
880
+ var me = this,
881
+ items,
882
+ itemCount,
883
+ item,
884
+ i,
885
+ result;
886
+
887
+ if (me.owner.collapsed) {
888
+ result = me.owner.getCollapsedDockedItems();
889
+ } else {
890
+ items = me.getDockedItems('visual');
891
+ itemCount = items.length;
892
+ result = [];
893
+ for (i = 0; i < itemCount; i++) {
894
+ item = items[i];
895
+ if (!item.hidden) {
896
+ result.push(item);
897
+ }
898
+ }
899
+ }
900
+ return result;
901
+ },
902
+
903
+ // Content size includes padding but not borders, so subtract them off
904
+ measureContentWidth: function (ownerContext) {
905
+ var bodyContext = ownerContext.bodyContext;
906
+ return bodyContext.el.getWidth() - bodyContext.getBorderInfo().width;
907
+ },
908
+
909
+ measureContentHeight: function (ownerContext) {
910
+ var bodyContext = ownerContext.bodyContext;
911
+ return bodyContext.el.getHeight() - bodyContext.getBorderInfo().height;
912
+ },
913
+
914
+ redoLayout: function(ownerContext) {
915
+ var me = this,
916
+ owner = me.owner;
917
+
918
+ // If we are collapsing...
919
+ if (ownerContext.isCollapsingOrExpanding == 1) {
920
+ if (owner.reExpander) {
921
+ owner.reExpander.el.show();
922
+ }
923
+ // Add the collapsed class now, so that collapsed CSS rules are applied before measurements are taken by the layout.
924
+ owner.addClsWithUI(owner.collapsedCls);
925
+ ownerContext.redo(true);
926
+ } else if (ownerContext.isCollapsingOrExpanding == 2) {
927
+ // Remove the collapsed class now, before layout calculations are done.
928
+ owner.removeClsWithUI(owner.collapsedCls);
929
+ ownerContext.bodyContext.redo();
930
+ }
931
+ },
932
+
933
+ // @private override inherited.
934
+ // We need to render in the correct order, top/left before bottom/right
935
+ renderChildren: function() {
936
+ var me = this,
937
+ items = me.getDockedItems(),
938
+ target = me.getRenderTarget();
939
+
940
+ me.renderItems(items, target);
941
+ },
942
+
943
+ /**
944
+ * @protected
945
+ * Render the top and left docked items before any existing DOM nodes in our render target,
946
+ * and then render the right and bottom docked items after. This is important, for such things
947
+ * as tab stops and ARIA readers, that the DOM nodes are in a meaningful order.
948
+ * Our collection of docked items will already be ordered via Panel.getDockedItems().
949
+ */
950
+ renderItems: function(items, target) {
951
+ var me = this,
952
+ dockedItemCount = items.length,
953
+ itemIndex = 0,
954
+ correctPosition = 0,
955
+ item,
956
+ staticNodeCount = 0,
957
+ targetNodes = me.getRenderTarget().dom.childNodes,
958
+ targetChildCount = targetNodes.length,
959
+ i, j, targetChildNode, item;
960
+
961
+ // Calculate the number of DOM nodes in our target that are not our docked items
962
+ for (i = 0, j = 0; i < targetChildCount; i++) {
963
+ targetChildNode = targetNodes[i];
964
+ if (Ext.fly(targetChildNode).hasCls('x-resizable-handle')) {
965
+ break;
966
+ }
967
+ for (j = 0; j < dockedItemCount; j++) {
968
+ item = items[j];
969
+ if (item.rendered && item.el.dom === targetChildNode) {
970
+ break;
971
+ }
972
+ }
973
+ // Walked off the end of the docked items without matching the found child node;
974
+ // Then it's a static node.
975
+ if (j === dockedItemCount) {
976
+ staticNodeCount++;
977
+ }
978
+ }
979
+
980
+ // Now we go through our docked items and render/move them
981
+ for (; itemIndex < dockedItemCount; itemIndex++, correctPosition++) {
982
+ item = items[itemIndex];
983
+
984
+ // If we're now at the first right/bottom docked item, we jump over the body element.
985
+ //
986
+ // TODO: This is affected if users provide custom weight values to their
987
+ // docked items, which puts it out of (t,l,r,b) order. Avoiding a second
988
+ // sort operation here, for now, in the name of performance. getDockedItems()
989
+ // needs the sort operation not just for this layout-time rendering, but
990
+ // also for getRefItems() to return a logical ordering (FocusManager, CQ, et al).
991
+ if (itemIndex === correctPosition && (item.dock === 'right' || item.dock === 'bottom')) {
992
+ correctPosition += staticNodeCount;
993
+ }
994
+
995
+ // Same logic as Layout.renderItems()
996
+ if (item && !item.rendered) {
997
+ me.renderItem(item, target, correctPosition);
998
+ }
999
+ else if (!me.isValidParent(item, target, correctPosition)) {
1000
+ me.moveItem(item, target, correctPosition);
1001
+ }
1002
+ }
1003
+ },
1004
+
1005
+ undoLayout: function(ownerContext) {
1006
+ var me = this,
1007
+ owner = me.owner;
1008
+
1009
+ // If we are collapsing...
1010
+ if (ownerContext.isCollapsingOrExpanding == 1) {
1011
+
1012
+ // We do not want to see the re-expander header until the final collapse is complete
1013
+ if (owner.reExpander) {
1014
+ owner.reExpander.el.hide();
1015
+ }
1016
+ // Add the collapsed class now, so that collapsed CSS rules are applied before measurements are taken by the layout.
1017
+ owner.removeClsWithUI(owner.collapsedCls);
1018
+ ownerContext.undo(true);
1019
+ } else if (ownerContext.isCollapsingOrExpanding == 2) {
1020
+ // Remove the collapsed class now, before layout calculations are done.
1021
+ owner.addClsWithUI(owner.collapsedCls);
1022
+ ownerContext.bodyContext.undo();
1023
+ }
1024
+ },
1025
+
1026
+ sizePolicy: {
1027
+ nostretch: {
1028
+ setsWidth: 0,
1029
+ setsHeight: 0
1030
+ },
1031
+ stretchH: {
1032
+ setsWidth: 1,
1033
+ setsHeight: 0
1034
+ },
1035
+ stretchV: {
1036
+ setsWidth: 0,
1037
+ setsHeight: 1
1038
+ },
1039
+
1040
+ // Circular dependency with partial auto-sized panels:
1041
+ //
1042
+ // If we have an autoHeight docked item being stretched horizontally (top/bottom),
1043
+ // that stretching will determine its width and its width must be set before its
1044
+ // autoHeight can be determined. If that item is docked in an autoWidth panel, the
1045
+ // body will need its height set before it can determine its width, but the height
1046
+ // of the docked item is needed to subtract from the panel height in order to set
1047
+ // the body height.
1048
+ //
1049
+ // This same pattern occurs with autoHeight panels with autoWidth docked items on
1050
+ // left or right. If the panel is fully auto or fully fixed, these problems don't
1051
+ // come up because there is no dependency between the dimensions.
1052
+ //
1053
+ // Cutting the Gordian Knot: In these cases, we have to allow something to measure
1054
+ // itself without full context. This is OK as long as the managed dimension doesn't
1055
+ // effect the auto-dimension, which is often the case for things like toolbars. The
1056
+ // managed dimension only effects overflow handlers and such and does not change the
1057
+ // auto-dimension. To encourage the item to measure itself without waiting for the
1058
+ // managed dimension, we have to tell it that the layout will also be reading that
1059
+ // dimension. This is similar to how stretchmax works.
1060
+
1061
+ autoStretchH: {
1062
+ readsWidth: 1,
1063
+ setsWidth: 1,
1064
+ setsHeight: 0
1065
+ },
1066
+ autoStretchV: {
1067
+ readsHeight: 1,
1068
+ setsWidth: 0,
1069
+ setsHeight: 1
1070
+ }
1071
+ },
1072
+
1073
+ getItemSizePolicy: function (item) {
1074
+ var policy = this.sizePolicy,
1075
+ dock, vertical;
1076
+
1077
+ if (item.stretch === false) {
1078
+ return policy.nostretch;
1079
+ }
1080
+
1081
+ dock = item.dock;
1082
+ vertical = (dock == 'left' || dock == 'right');
1083
+
1084
+ /*
1085
+ owner = this.owner;
1086
+ autoWidth = !owner.isFixedWidth();
1087
+ autoHeight = !owner.isFixedHeight();
1088
+ if (autoWidth !== autoHeight) { // if (partial auto)
1089
+ // see above...
1090
+ if (vertical) {
1091
+ if (autoHeight) {
1092
+ return policy.autoStretchV;
1093
+ }
1094
+ } else if (autoWidth) {
1095
+ return policy.autoStretchH;
1096
+ }
1097
+ }*/
1098
+
1099
+ if (vertical) {
1100
+ return policy.stretchV;
1101
+ }
1102
+
1103
+ return policy.stretchH;
1104
+ },
1105
+
1106
+ /**
1107
+ * @protected
1108
+ * We are overriding the Ext.layout.Layout configureItem method to also add a class that
1109
+ * indicates the position of the docked item. We use the itemCls (x-docked) as a prefix.
1110
+ * An example of a class added to a dock: right item is x-docked-right
1111
+ * @param {Ext.Component} item The item we are configuring
1112
+ */
1113
+ configureItem : function(item, pos) {
1114
+ this.callParent(arguments);
1115
+
1116
+ item.addCls(Ext.baseCSSPrefix + 'docked');
1117
+ item.addClsWithUI('docked-' + item.dock);
1118
+ },
1119
+
1120
+ afterRemove : function(item) {
1121
+ this.callParent(arguments);
1122
+ if (this.itemCls) {
1123
+ item.el.removeCls(this.itemCls + '-' + item.dock);
1124
+ }
1125
+ var dom = item.el.dom;
1126
+
1127
+ if (!item.destroying && dom) {
1128
+ dom.parentNode.removeChild(dom);
1129
+ }
1130
+ this.childrenChanged = true;
1131
+ }
1132
+ });