extjs-rails 4.1.0.alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (517) hide show
  1. data/.gitignore +18 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +36 -0
  4. data/README.md +29 -0
  5. data/Rakefile +2 -0
  6. data/app/assets/javascripts/extjs-rails/extjs-rails.js +1 -0
  7. data/app/assets/javascripts/extjs-rails/index.js.erb +9 -0
  8. data/app/assets/javascripts/extjs-rails/sdk.jsb3 +2017 -0
  9. data/app/assets/javascripts/extjs-rails/src/AbstractComponent.js +3290 -0
  10. data/app/assets/javascripts/extjs-rails/src/AbstractManager.js +144 -0
  11. data/app/assets/javascripts/extjs-rails/src/AbstractPlugin.js +72 -0
  12. data/app/assets/javascripts/extjs-rails/src/Action.js +276 -0
  13. data/app/assets/javascripts/extjs-rails/src/Ajax.js +99 -0
  14. data/app/assets/javascripts/extjs-rails/src/Component.js +1344 -0
  15. data/app/assets/javascripts/extjs-rails/src/ComponentLoader.js +202 -0
  16. data/app/assets/javascripts/extjs-rails/src/ComponentManager.js +47 -0
  17. data/app/assets/javascripts/extjs-rails/src/ComponentQuery.js +521 -0
  18. data/app/assets/javascripts/extjs-rails/src/Editor.js +494 -0
  19. data/app/assets/javascripts/extjs-rails/src/ElementLoader.js +404 -0
  20. data/app/assets/javascripts/extjs-rails/src/FocusManager.js +712 -0
  21. data/app/assets/javascripts/extjs-rails/src/Img.js +111 -0
  22. data/app/assets/javascripts/extjs-rails/src/Layer.js +543 -0
  23. data/app/assets/javascripts/extjs-rails/src/LoadMask.js +432 -0
  24. data/app/assets/javascripts/extjs-rails/src/ModelManager.js +186 -0
  25. data/app/assets/javascripts/extjs-rails/src/PluginManager.js +110 -0
  26. data/app/assets/javascripts/extjs-rails/src/ProgressBar.js +336 -0
  27. data/app/assets/javascripts/extjs-rails/src/Shadow.js +233 -0
  28. data/app/assets/javascripts/extjs-rails/src/ShadowPool.js +43 -0
  29. data/app/assets/javascripts/extjs-rails/src/Template.js +331 -0
  30. data/app/assets/javascripts/extjs-rails/src/XTemplate.js +365 -0
  31. data/app/assets/javascripts/extjs-rails/src/XTemplateCompiler.js +450 -0
  32. data/app/assets/javascripts/extjs-rails/src/XTemplateParser.js +249 -0
  33. data/app/assets/javascripts/extjs-rails/src/ZIndexManager.js +519 -0
  34. data/app/assets/javascripts/extjs-rails/src/app/Application.js +271 -0
  35. data/app/assets/javascripts/extjs-rails/src/app/Controller.js +458 -0
  36. data/app/assets/javascripts/extjs-rails/src/app/EventBus.js +112 -0
  37. data/app/assets/javascripts/extjs-rails/src/button/Button.js +1483 -0
  38. data/app/assets/javascripts/extjs-rails/src/button/Cycle.js +215 -0
  39. data/app/assets/javascripts/extjs-rails/src/button/Split.js +99 -0
  40. data/app/assets/javascripts/extjs-rails/src/chart/Callout.js +140 -0
  41. data/app/assets/javascripts/extjs-rails/src/chart/Chart.js +966 -0
  42. data/app/assets/javascripts/extjs-rails/src/chart/Highlight.js +172 -0
  43. data/app/assets/javascripts/extjs-rails/src/chart/Label.js +241 -0
  44. data/app/assets/javascripts/extjs-rails/src/chart/Legend.js +474 -0
  45. data/app/assets/javascripts/extjs-rails/src/chart/LegendItem.js +217 -0
  46. data/app/assets/javascripts/extjs-rails/src/chart/Mask.js +230 -0
  47. data/app/assets/javascripts/extjs-rails/src/chart/MaskLayer.js +48 -0
  48. data/app/assets/javascripts/extjs-rails/src/chart/Navigation.js +79 -0
  49. data/app/assets/javascripts/extjs-rails/src/chart/Shape.js +106 -0
  50. data/app/assets/javascripts/extjs-rails/src/chart/Tip.js +98 -0
  51. data/app/assets/javascripts/extjs-rails/src/chart/TipSurface.js +42 -0
  52. data/app/assets/javascripts/extjs-rails/src/chart/axis/Abstract.js +73 -0
  53. data/app/assets/javascripts/extjs-rails/src/chart/axis/Axis.js +961 -0
  54. data/app/assets/javascripts/extjs-rails/src/chart/axis/Category.js +130 -0
  55. data/app/assets/javascripts/extjs-rails/src/chart/axis/Gauge.js +203 -0
  56. data/app/assets/javascripts/extjs-rails/src/chart/axis/Numeric.js +235 -0
  57. data/app/assets/javascripts/extjs-rails/src/chart/axis/Radial.js +204 -0
  58. data/app/assets/javascripts/extjs-rails/src/chart/axis/Time.js +135 -0
  59. data/app/assets/javascripts/extjs-rails/src/chart/series/Area.js +803 -0
  60. data/app/assets/javascripts/extjs-rails/src/chart/series/Bar.js +853 -0
  61. data/app/assets/javascripts/extjs-rails/src/chart/series/Cartesian.js +328 -0
  62. data/app/assets/javascripts/extjs-rails/src/chart/series/Column.js +104 -0
  63. data/app/assets/javascripts/extjs-rails/src/chart/series/Gauge.js +490 -0
  64. data/app/assets/javascripts/extjs-rails/src/chart/series/Line.js +1104 -0
  65. data/app/assets/javascripts/extjs-rails/src/chart/series/Pie.js +1072 -0
  66. data/app/assets/javascripts/extjs-rails/src/chart/series/Radar.js +440 -0
  67. data/app/assets/javascripts/extjs-rails/src/chart/series/Scatter.js +668 -0
  68. data/app/assets/javascripts/extjs-rails/src/chart/series/Series.js +443 -0
  69. data/app/assets/javascripts/extjs-rails/src/chart/theme/Base.js +175 -0
  70. data/app/assets/javascripts/extjs-rails/src/chart/theme/Theme.js +253 -0
  71. data/app/assets/javascripts/extjs-rails/src/container/AbstractContainer.js +1062 -0
  72. data/app/assets/javascripts/extjs-rails/src/container/ButtonGroup.js +143 -0
  73. data/app/assets/javascripts/extjs-rails/src/container/Container.js +212 -0
  74. data/app/assets/javascripts/extjs-rails/src/container/DockingContainer.js +265 -0
  75. data/app/assets/javascripts/extjs-rails/src/container/Viewport.js +184 -0
  76. data/app/assets/javascripts/extjs-rails/src/core/dom/Element.form.js +50 -0
  77. data/app/assets/javascripts/extjs-rails/src/core/dom/Element.static-more.js +159 -0
  78. data/app/assets/javascripts/extjs-rails/src/core/examples/index.html +321 -0
  79. data/app/assets/javascripts/extjs-rails/src/core/examples/index.js +6 -0
  80. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/CTO.js +25 -0
  81. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/CoolGuy.js +20 -0
  82. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Developer.js +43 -0
  83. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Gun.js +3 -0
  84. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/HumanResource.js +23 -0
  85. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Musician.js +20 -0
  86. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Person.js +50 -0
  87. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanComposeSongs.js +9 -0
  88. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanPlayGuitar.js +9 -0
  89. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanSing.js +18 -0
  90. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/A.js +3 -0
  91. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/B.js +3 -0
  92. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/C.js +3 -0
  93. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/D.js +3 -0
  94. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/E.js +3 -0
  95. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/A.js +3 -0
  96. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/B.js +4 -0
  97. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/C.js +3 -0
  98. data/app/assets/javascripts/extjs-rails/src/core/src/EventManager.js +1167 -0
  99. data/app/assets/javascripts/extjs-rails/src/core/src/EventObject.js +883 -0
  100. data/app/assets/javascripts/extjs-rails/src/core/src/Ext-more.js +1283 -0
  101. data/app/assets/javascripts/extjs-rails/src/core/src/Ext.js +736 -0
  102. data/app/assets/javascripts/extjs-rails/src/core/src/Support.js +662 -0
  103. data/app/assets/javascripts/extjs-rails/src/core/src/class/Base.js +1085 -0
  104. data/app/assets/javascripts/extjs-rails/src/core/src/class/Class.js +676 -0
  105. data/app/assets/javascripts/extjs-rails/src/core/src/class/ClassManager.js +1591 -0
  106. data/app/assets/javascripts/extjs-rails/src/core/src/class/Loader.js +1423 -0
  107. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.alignment.js +173 -0
  108. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.insertion.js +193 -0
  109. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.js +681 -0
  110. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.position.js +356 -0
  111. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.static.js +474 -0
  112. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.style.js +851 -0
  113. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.traversal.js +180 -0
  114. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractHelper.js +291 -0
  115. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractQuery.js +72 -0
  116. data/app/assets/javascripts/extjs-rails/src/core/src/dom/CompositeElement.js +75 -0
  117. data/app/assets/javascripts/extjs-rails/src/core/src/dom/CompositeElementLite.js +436 -0
  118. data/app/assets/javascripts/extjs-rails/src/core/src/dom/DomQuery-aria.js +1049 -0
  119. data/app/assets/javascripts/extjs-rails/src/core/src/env/Browser.js +186 -0
  120. data/app/assets/javascripts/extjs-rails/src/core/src/env/FeatureDetector.js +274 -0
  121. data/app/assets/javascripts/extjs-rails/src/core/src/env/OS.js +141 -0
  122. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Array.js +1205 -0
  123. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Date.js +1463 -0
  124. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Error.js +326 -0
  125. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Function.js +485 -0
  126. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Number.js +175 -0
  127. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Object.js +606 -0
  128. data/app/assets/javascripts/extjs-rails/src/core/src/lang/String.js +333 -0
  129. data/app/assets/javascripts/extjs-rails/src/core/src/misc/JSON.js +236 -0
  130. data/app/assets/javascripts/extjs-rails/src/core/src/perf/Accumulator.js +244 -0
  131. data/app/assets/javascripts/extjs-rails/src/core/src/perf/Monitor.js +197 -0
  132. data/app/assets/javascripts/extjs-rails/src/core/src/util/DelayedTask.js +71 -0
  133. data/app/assets/javascripts/extjs-rails/src/core/src/util/Event.js +215 -0
  134. data/app/assets/javascripts/extjs-rails/src/core/src/util/Format.js +551 -0
  135. data/app/assets/javascripts/extjs-rails/src/core/src/util/TaskManager.js +417 -0
  136. data/app/assets/javascripts/extjs-rails/src/core/src/version/Version.js +364 -0
  137. data/app/assets/javascripts/extjs-rails/src/core/test/unit/README.MD +91 -0
  138. data/app/assets/javascripts/extjs-rails/src/core/test/unit/bootstrap.js +39 -0
  139. data/app/assets/javascripts/extjs-rails/src/core/test/unit/build/build-data.js +34 -0
  140. data/app/assets/javascripts/extjs-rails/src/core/test/unit/build/build.sh +2 -0
  141. data/app/assets/javascripts/extjs-rails/src/core/test/unit/data.js +27 -0
  142. data/app/assets/javascripts/extjs-rails/src/core/test/unit/index.html +15 -0
  143. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom.html +40 -0
  144. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/extjs-api.js +12 -0
  145. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/platform-api.js +134 -0
  146. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/sanity.js +4 -0
  147. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/touch-api-out.js +128 -0
  148. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/touch-api.js +89 -0
  149. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/env/Environment.js +357 -0
  150. data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/APITest.js +37 -0
  151. data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/jsb3.js +14 -0
  152. data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/test-setup.js +137 -0
  153. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/EventManager.js +629 -0
  154. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext-mess.backup +198 -0
  155. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext-more.js +520 -0
  156. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext.js +1550 -0
  157. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Support.js +250 -0
  158. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/Base.js +47 -0
  159. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/Class.js +561 -0
  160. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/ClassManager.js +555 -0
  161. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/CompositeElementLite.js +409 -0
  162. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/DomHelper.js +444 -0
  163. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.insertion.js +342 -0
  164. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.js +731 -0
  165. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.static.js +201 -0
  166. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.style.js +118 -0
  167. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.traversal.js +336 -0
  168. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Array.js +1229 -0
  169. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Date.js +697 -0
  170. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Error.js +277 -0
  171. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Function.js +536 -0
  172. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Number.js +323 -0
  173. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Object.js +591 -0
  174. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/String.js +451 -0
  175. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/misc/JSON.js +252 -0
  176. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/util/Format.js +521 -0
  177. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/version/Version.js +148 -0
  178. data/app/assets/javascripts/extjs-rails/src/core/test/unit/specs.html +19 -0
  179. data/app/assets/javascripts/extjs-rails/src/data/AbstractStore.js +887 -0
  180. data/app/assets/javascripts/extjs-rails/src/data/ArrayStore.js +74 -0
  181. data/app/assets/javascripts/extjs-rails/src/data/Batch.js +236 -0
  182. data/app/assets/javascripts/extjs-rails/src/data/BufferStore.js +13 -0
  183. data/app/assets/javascripts/extjs-rails/src/data/Connection.js +969 -0
  184. data/app/assets/javascripts/extjs-rails/src/data/DirectStore.js +50 -0
  185. data/app/assets/javascripts/extjs-rails/src/data/Errors.js +52 -0
  186. data/app/assets/javascripts/extjs-rails/src/data/Field.js +341 -0
  187. data/app/assets/javascripts/extjs-rails/src/data/IdGenerator.js +198 -0
  188. data/app/assets/javascripts/extjs-rails/src/data/JsonP.js +253 -0
  189. data/app/assets/javascripts/extjs-rails/src/data/JsonPStore.js +51 -0
  190. data/app/assets/javascripts/extjs-rails/src/data/JsonStore.js +60 -0
  191. data/app/assets/javascripts/extjs-rails/src/data/Model.js +1673 -0
  192. data/app/assets/javascripts/extjs-rails/src/data/NodeInterface.js +1294 -0
  193. data/app/assets/javascripts/extjs-rails/src/data/NodeStore.js +254 -0
  194. data/app/assets/javascripts/extjs-rails/src/data/Operation.js +331 -0
  195. data/app/assets/javascripts/extjs-rails/src/data/Request.js +40 -0
  196. data/app/assets/javascripts/extjs-rails/src/data/ResultSet.js +56 -0
  197. data/app/assets/javascripts/extjs-rails/src/data/SequentialIdGenerator.js +61 -0
  198. data/app/assets/javascripts/extjs-rails/src/data/SortTypes.js +125 -0
  199. data/app/assets/javascripts/extjs-rails/src/data/Store.js +2609 -0
  200. data/app/assets/javascripts/extjs-rails/src/data/StoreManager.js +156 -0
  201. data/app/assets/javascripts/extjs-rails/src/data/Tree.js +290 -0
  202. data/app/assets/javascripts/extjs-rails/src/data/TreeStore.js +655 -0
  203. data/app/assets/javascripts/extjs-rails/src/data/Types.js +190 -0
  204. data/app/assets/javascripts/extjs-rails/src/data/UuidGenerator.js +215 -0
  205. data/app/assets/javascripts/extjs-rails/src/data/XmlStore.js +76 -0
  206. data/app/assets/javascripts/extjs-rails/src/data/association/Association.js +243 -0
  207. data/app/assets/javascripts/extjs-rails/src/data/association/BelongsTo.js +291 -0
  208. data/app/assets/javascripts/extjs-rails/src/data/association/HasMany.js +289 -0
  209. data/app/assets/javascripts/extjs-rails/src/data/association/HasOne.js +304 -0
  210. data/app/assets/javascripts/extjs-rails/src/data/proxy/Ajax.js +282 -0
  211. data/app/assets/javascripts/extjs-rails/src/data/proxy/Client.js +21 -0
  212. data/app/assets/javascripts/extjs-rails/src/data/proxy/Direct.js +181 -0
  213. data/app/assets/javascripts/extjs-rails/src/data/proxy/JsonP.js +313 -0
  214. data/app/assets/javascripts/extjs-rails/src/data/proxy/LocalStorage.js +69 -0
  215. data/app/assets/javascripts/extjs-rails/src/data/proxy/Memory.js +156 -0
  216. data/app/assets/javascripts/extjs-rails/src/data/proxy/Proxy.js +433 -0
  217. data/app/assets/javascripts/extjs-rails/src/data/proxy/Rest.js +173 -0
  218. data/app/assets/javascripts/extjs-rails/src/data/proxy/Server.js +460 -0
  219. data/app/assets/javascripts/extjs-rails/src/data/proxy/SessionStorage.js +39 -0
  220. data/app/assets/javascripts/extjs-rails/src/data/proxy/WebStorage.js +546 -0
  221. data/app/assets/javascripts/extjs-rails/src/data/reader/Array.js +68 -0
  222. data/app/assets/javascripts/extjs-rails/src/data/reader/Json.js +383 -0
  223. data/app/assets/javascripts/extjs-rails/src/data/reader/Reader.js +735 -0
  224. data/app/assets/javascripts/extjs-rails/src/data/reader/Xml.js +292 -0
  225. data/app/assets/javascripts/extjs-rails/src/data/validations.js +149 -0
  226. data/app/assets/javascripts/extjs-rails/src/data/writer/Json.js +81 -0
  227. data/app/assets/javascripts/extjs-rails/src/data/writer/Writer.js +147 -0
  228. data/app/assets/javascripts/extjs-rails/src/data/writer/Xml.js +88 -0
  229. data/app/assets/javascripts/extjs-rails/src/dd/DD.js +300 -0
  230. data/app/assets/javascripts/extjs-rails/src/dd/DDProxy.js +204 -0
  231. data/app/assets/javascripts/extjs-rails/src/dd/DDTarget.js +171 -0
  232. data/app/assets/javascripts/extjs-rails/src/dd/DragDrop.js +1101 -0
  233. data/app/assets/javascripts/extjs-rails/src/dd/DragDropManager.js +1264 -0
  234. data/app/assets/javascripts/extjs-rails/src/dd/DragSource.js +392 -0
  235. data/app/assets/javascripts/extjs-rails/src/dd/DragTracker.js +562 -0
  236. data/app/assets/javascripts/extjs-rails/src/dd/DragZone.js +137 -0
  237. data/app/assets/javascripts/extjs-rails/src/dd/DropTarget.js +118 -0
  238. data/app/assets/javascripts/extjs-rails/src/dd/DropZone.js +254 -0
  239. data/app/assets/javascripts/extjs-rails/src/dd/Registry.js +117 -0
  240. data/app/assets/javascripts/extjs-rails/src/dd/ScrollManager.js +218 -0
  241. data/app/assets/javascripts/extjs-rails/src/dd/StatusProxy.js +179 -0
  242. data/app/assets/javascripts/extjs-rails/src/diag/layout/Context.js +523 -0
  243. data/app/assets/javascripts/extjs-rails/src/diag/layout/ContextItem.js +179 -0
  244. data/app/assets/javascripts/extjs-rails/src/direct/Event.js +35 -0
  245. data/app/assets/javascripts/extjs-rails/src/direct/ExceptionEvent.js +16 -0
  246. data/app/assets/javascripts/extjs-rails/src/direct/JsonProvider.js +82 -0
  247. data/app/assets/javascripts/extjs-rails/src/direct/Manager.js +263 -0
  248. data/app/assets/javascripts/extjs-rails/src/direct/PollingProvider.js +156 -0
  249. data/app/assets/javascripts/extjs-rails/src/direct/Provider.js +96 -0
  250. data/app/assets/javascripts/extjs-rails/src/direct/RemotingEvent.js +24 -0
  251. data/app/assets/javascripts/extjs-rails/src/direct/RemotingMethod.js +100 -0
  252. data/app/assets/javascripts/extjs-rails/src/direct/RemotingProvider.js +510 -0
  253. data/app/assets/javascripts/extjs-rails/src/direct/Transaction.js +41 -0
  254. data/app/assets/javascripts/extjs-rails/src/dom/Element.alignment.js +378 -0
  255. data/app/assets/javascripts/extjs-rails/src/dom/Element.anim.js +962 -0
  256. data/app/assets/javascripts/extjs-rails/src/dom/Element.dd.js +40 -0
  257. data/app/assets/javascripts/extjs-rails/src/dom/Element.fx.js +194 -0
  258. data/app/assets/javascripts/extjs-rails/src/dom/Element.js +1407 -0
  259. data/app/assets/javascripts/extjs-rails/src/dom/Element.position.js +501 -0
  260. data/app/assets/javascripts/extjs-rails/src/dom/Element.scroll.js +214 -0
  261. data/app/assets/javascripts/extjs-rails/src/dom/Element.style.js +792 -0
  262. data/app/assets/javascripts/extjs-rails/src/dom/Element.traversal.js +8 -0
  263. data/app/assets/javascripts/extjs-rails/src/dom/Helper.js +466 -0
  264. data/app/assets/javascripts/extjs-rails/src/dom/Query.js +1067 -0
  265. data/app/assets/javascripts/extjs-rails/src/draw/Color.js +303 -0
  266. data/app/assets/javascripts/extjs-rails/src/draw/Component.js +245 -0
  267. data/app/assets/javascripts/extjs-rails/src/draw/CompositeSprite.js +299 -0
  268. data/app/assets/javascripts/extjs-rails/src/draw/Draw.js +1217 -0
  269. data/app/assets/javascripts/extjs-rails/src/draw/Matrix.js +183 -0
  270. data/app/assets/javascripts/extjs-rails/src/draw/Sprite.js +554 -0
  271. data/app/assets/javascripts/extjs-rails/src/draw/SpriteDD.js +87 -0
  272. data/app/assets/javascripts/extjs-rails/src/draw/Surface.js +1001 -0
  273. data/app/assets/javascripts/extjs-rails/src/draw/Text.js +175 -0
  274. data/app/assets/javascripts/extjs-rails/src/draw/engine/ImageExporter.js +106 -0
  275. data/app/assets/javascripts/extjs-rails/src/draw/engine/Svg.js +734 -0
  276. data/app/assets/javascripts/extjs-rails/src/draw/engine/SvgExporter.js +280 -0
  277. data/app/assets/javascripts/extjs-rails/src/draw/engine/Vml.js +916 -0
  278. data/app/assets/javascripts/extjs-rails/src/flash/Component.js +248 -0
  279. data/app/assets/javascripts/extjs-rails/src/form/Basic.js +1018 -0
  280. data/app/assets/javascripts/extjs-rails/src/form/CheckboxGroup.js +441 -0
  281. data/app/assets/javascripts/extjs-rails/src/form/CheckboxManager.js +26 -0
  282. data/app/assets/javascripts/extjs-rails/src/form/FieldAncestor.js +210 -0
  283. data/app/assets/javascripts/extjs-rails/src/form/FieldContainer.js +290 -0
  284. data/app/assets/javascripts/extjs-rails/src/form/FieldSet.js +506 -0
  285. data/app/assets/javascripts/extjs-rails/src/form/Label.js +110 -0
  286. data/app/assets/javascripts/extjs-rails/src/form/Labelable.js +764 -0
  287. data/app/assets/javascripts/extjs-rails/src/form/Panel.js +335 -0
  288. data/app/assets/javascripts/extjs-rails/src/form/RadioGroup.js +124 -0
  289. data/app/assets/javascripts/extjs-rails/src/form/RadioManager.js +26 -0
  290. data/app/assets/javascripts/extjs-rails/src/form/action/Action.js +307 -0
  291. data/app/assets/javascripts/extjs-rails/src/form/action/DirectLoad.js +107 -0
  292. data/app/assets/javascripts/extjs-rails/src/form/action/DirectSubmit.js +119 -0
  293. data/app/assets/javascripts/extjs-rails/src/form/action/Load.js +120 -0
  294. data/app/assets/javascripts/extjs-rails/src/form/action/StandardSubmit.js +34 -0
  295. data/app/assets/javascripts/extjs-rails/src/form/action/Submit.js +257 -0
  296. data/app/assets/javascripts/extjs-rails/src/form/field/Base.js +813 -0
  297. data/app/assets/javascripts/extjs-rails/src/form/field/Checkbox.js +505 -0
  298. data/app/assets/javascripts/extjs-rails/src/form/field/ComboBox.js +1427 -0
  299. data/app/assets/javascripts/extjs-rails/src/form/field/Date.js +578 -0
  300. data/app/assets/javascripts/extjs-rails/src/form/field/Display.js +155 -0
  301. data/app/assets/javascripts/extjs-rails/src/form/field/Field.js +430 -0
  302. data/app/assets/javascripts/extjs-rails/src/form/field/File.js +265 -0
  303. data/app/assets/javascripts/extjs-rails/src/form/field/Hidden.js +75 -0
  304. data/app/assets/javascripts/extjs-rails/src/form/field/HtmlEditor.js +1439 -0
  305. data/app/assets/javascripts/extjs-rails/src/form/field/Number.js +380 -0
  306. data/app/assets/javascripts/extjs-rails/src/form/field/Picker.js +321 -0
  307. data/app/assets/javascripts/extjs-rails/src/form/field/Radio.js +279 -0
  308. data/app/assets/javascripts/extjs-rails/src/form/field/Spinner.js +321 -0
  309. data/app/assets/javascripts/extjs-rails/src/form/field/Text.js +727 -0
  310. data/app/assets/javascripts/extjs-rails/src/form/field/TextArea.js +228 -0
  311. data/app/assets/javascripts/extjs-rails/src/form/field/Time.js +459 -0
  312. data/app/assets/javascripts/extjs-rails/src/form/field/Trigger.js +469 -0
  313. data/app/assets/javascripts/extjs-rails/src/form/field/VTypes.js +172 -0
  314. data/app/assets/javascripts/extjs-rails/src/fx/Anim.js +472 -0
  315. data/app/assets/javascripts/extjs-rails/src/fx/Animator.js +410 -0
  316. data/app/assets/javascripts/extjs-rails/src/fx/CubicBezier.js +77 -0
  317. data/app/assets/javascripts/extjs-rails/src/fx/Easing.js +136 -0
  318. data/app/assets/javascripts/extjs-rails/src/fx/Manager.js +353 -0
  319. data/app/assets/javascripts/extjs-rails/src/fx/PropertyHandler.js +381 -0
  320. data/app/assets/javascripts/extjs-rails/src/fx/Queue.js +123 -0
  321. data/app/assets/javascripts/extjs-rails/src/fx/target/Component.js +118 -0
  322. data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeElement.js +46 -0
  323. data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeElementCSS.js +22 -0
  324. data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeSprite.js +34 -0
  325. data/app/assets/javascripts/extjs-rails/src/fx/target/Element.js +83 -0
  326. data/app/assets/javascripts/extjs-rails/src/fx/target/ElementCSS.js +77 -0
  327. data/app/assets/javascripts/extjs-rails/src/fx/target/Sprite.js +128 -0
  328. data/app/assets/javascripts/extjs-rails/src/fx/target/Target.js +36 -0
  329. data/app/assets/javascripts/extjs-rails/src/grid/CellEditor.js +172 -0
  330. data/app/assets/javascripts/extjs-rails/src/grid/ColumnComponentLayout.js +34 -0
  331. data/app/assets/javascripts/extjs-rails/src/grid/ColumnLayout.js +201 -0
  332. data/app/assets/javascripts/extjs-rails/src/grid/Lockable.js +863 -0
  333. data/app/assets/javascripts/extjs-rails/src/grid/LockingView.js +169 -0
  334. data/app/assets/javascripts/extjs-rails/src/grid/PagingScroller.js +539 -0
  335. data/app/assets/javascripts/extjs-rails/src/grid/Panel.js +393 -0
  336. data/app/assets/javascripts/extjs-rails/src/grid/RowEditor.js +731 -0
  337. data/app/assets/javascripts/extjs-rails/src/grid/RowNumberer.js +76 -0
  338. data/app/assets/javascripts/extjs-rails/src/grid/Scroller.js +5 -0
  339. data/app/assets/javascripts/extjs-rails/src/grid/View.js +44 -0
  340. data/app/assets/javascripts/extjs-rails/src/grid/ViewDropZone.js +41 -0
  341. data/app/assets/javascripts/extjs-rails/src/grid/column/Action.js +318 -0
  342. data/app/assets/javascripts/extjs-rails/src/grid/column/Boolean.js +82 -0
  343. data/app/assets/javascripts/extjs-rails/src/grid/column/Column.js +835 -0
  344. data/app/assets/javascripts/extjs-rails/src/grid/column/Date.js +63 -0
  345. data/app/assets/javascripts/extjs-rails/src/grid/column/Number.js +52 -0
  346. data/app/assets/javascripts/extjs-rails/src/grid/column/Template.js +58 -0
  347. data/app/assets/javascripts/extjs-rails/src/grid/feature/AbstractSummary.js +154 -0
  348. data/app/assets/javascripts/extjs-rails/src/grid/feature/Chunking.js +77 -0
  349. data/app/assets/javascripts/extjs-rails/src/grid/feature/Feature.js +158 -0
  350. data/app/assets/javascripts/extjs-rails/src/grid/feature/Grouping.js +822 -0
  351. data/app/assets/javascripts/extjs-rails/src/grid/feature/GroupingSummary.js +243 -0
  352. data/app/assets/javascripts/extjs-rails/src/grid/feature/RowBody.js +116 -0
  353. data/app/assets/javascripts/extjs-rails/src/grid/feature/RowWrap.js +120 -0
  354. data/app/assets/javascripts/extjs-rails/src/grid/feature/Summary.js +167 -0
  355. data/app/assets/javascripts/extjs-rails/src/grid/header/Container.js +965 -0
  356. data/app/assets/javascripts/extjs-rails/src/grid/header/DragZone.js +69 -0
  357. data/app/assets/javascripts/extjs-rails/src/grid/header/DropZone.js +265 -0
  358. data/app/assets/javascripts/extjs-rails/src/grid/plugin/CellEditing.js +453 -0
  359. data/app/assets/javascripts/extjs-rails/src/grid/plugin/DragDrop.js +254 -0
  360. data/app/assets/javascripts/extjs-rails/src/grid/plugin/Editing.js +561 -0
  361. data/app/assets/javascripts/extjs-rails/src/grid/plugin/HeaderReorderer.js +49 -0
  362. data/app/assets/javascripts/extjs-rails/src/grid/plugin/HeaderResizer.js +292 -0
  363. data/app/assets/javascripts/extjs-rails/src/grid/plugin/RowEditing.js +339 -0
  364. data/app/assets/javascripts/extjs-rails/src/grid/property/Grid.js +351 -0
  365. data/app/assets/javascripts/extjs-rails/src/grid/property/HeaderContainer.js +109 -0
  366. data/app/assets/javascripts/extjs-rails/src/grid/property/Property.js +36 -0
  367. data/app/assets/javascripts/extjs-rails/src/grid/property/Store.js +141 -0
  368. data/app/assets/javascripts/extjs-rails/src/layout/ClassList.js +90 -0
  369. data/app/assets/javascripts/extjs-rails/src/layout/Context.js +1232 -0
  370. data/app/assets/javascripts/extjs-rails/src/layout/ContextItem.js +1470 -0
  371. data/app/assets/javascripts/extjs-rails/src/layout/Layout.js +761 -0
  372. data/app/assets/javascripts/extjs-rails/src/layout/component/Auto.js +220 -0
  373. data/app/assets/javascripts/extjs-rails/src/layout/component/Body.js +80 -0
  374. data/app/assets/javascripts/extjs-rails/src/layout/component/BoundList.js +95 -0
  375. data/app/assets/javascripts/extjs-rails/src/layout/component/Button.js +261 -0
  376. data/app/assets/javascripts/extjs-rails/src/layout/component/Component.js +427 -0
  377. data/app/assets/javascripts/extjs-rails/src/layout/component/Dock.js +1132 -0
  378. data/app/assets/javascripts/extjs-rails/src/layout/component/Draw.js +79 -0
  379. data/app/assets/javascripts/extjs-rails/src/layout/component/FieldSet.js +62 -0
  380. data/app/assets/javascripts/extjs-rails/src/layout/component/ProgressBar.js +54 -0
  381. data/app/assets/javascripts/extjs-rails/src/layout/component/Tab.js +23 -0
  382. data/app/assets/javascripts/extjs-rails/src/layout/component/field/ComboBox.js +52 -0
  383. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Field.js +372 -0
  384. data/app/assets/javascripts/extjs-rails/src/layout/component/field/FieldContainer.js +48 -0
  385. data/app/assets/javascripts/extjs-rails/src/layout/component/field/HtmlEditor.js +54 -0
  386. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Slider.js +58 -0
  387. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Text.js +75 -0
  388. data/app/assets/javascripts/extjs-rails/src/layout/component/field/TextArea.js +51 -0
  389. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Trigger.js +132 -0
  390. data/app/assets/javascripts/extjs-rails/src/layout/container/Absolute.js +121 -0
  391. data/app/assets/javascripts/extjs-rails/src/layout/container/Accordion.js +308 -0
  392. data/app/assets/javascripts/extjs-rails/src/layout/container/Anchor.js +403 -0
  393. data/app/assets/javascripts/extjs-rails/src/layout/container/Auto.js +70 -0
  394. data/app/assets/javascripts/extjs-rails/src/layout/container/Border-old-js +1079 -0
  395. data/app/assets/javascripts/extjs-rails/src/layout/container/Border.js +816 -0
  396. data/app/assets/javascripts/extjs-rails/src/layout/container/Box.js +929 -0
  397. data/app/assets/javascripts/extjs-rails/src/layout/container/Card.js +361 -0
  398. data/app/assets/javascripts/extjs-rails/src/layout/container/CheckboxGroup.js +376 -0
  399. data/app/assets/javascripts/extjs-rails/src/layout/container/Column.js +234 -0
  400. data/app/assets/javascripts/extjs-rails/src/layout/container/Container.js +961 -0
  401. data/app/assets/javascripts/extjs-rails/src/layout/container/Editor.js +74 -0
  402. data/app/assets/javascripts/extjs-rails/src/layout/container/Fit.js +287 -0
  403. data/app/assets/javascripts/extjs-rails/src/layout/container/Form.js +157 -0
  404. data/app/assets/javascripts/extjs-rails/src/layout/container/HBox.js +134 -0
  405. data/app/assets/javascripts/extjs-rails/src/layout/container/Table.js +412 -0
  406. data/app/assets/javascripts/extjs-rails/src/layout/container/VBox.js +139 -0
  407. data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/Menu.js +365 -0
  408. data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/None.js +83 -0
  409. data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/Scroller.js +475 -0
  410. data/app/assets/javascripts/extjs-rails/src/menu/CheckItem.js +169 -0
  411. data/app/assets/javascripts/extjs-rails/src/menu/ColorPicker.js +110 -0
  412. data/app/assets/javascripts/extjs-rails/src/menu/DatePicker.js +100 -0
  413. data/app/assets/javascripts/extjs-rails/src/menu/Item.js +553 -0
  414. data/app/assets/javascripts/extjs-rails/src/menu/KeyNav.js +134 -0
  415. data/app/assets/javascripts/extjs-rails/src/menu/Manager.js +219 -0
  416. data/app/assets/javascripts/extjs-rails/src/menu/Menu.js +579 -0
  417. data/app/assets/javascripts/extjs-rails/src/menu/Separator.js +126 -0
  418. data/app/assets/javascripts/extjs-rails/src/panel/AbstractPanel.js +323 -0
  419. data/app/assets/javascripts/extjs-rails/src/panel/DD.js +99 -0
  420. data/app/assets/javascripts/extjs-rails/src/panel/Header.js +518 -0
  421. data/app/assets/javascripts/extjs-rails/src/panel/Panel.js +2150 -0
  422. data/app/assets/javascripts/extjs-rails/src/panel/Proxy.js +131 -0
  423. data/app/assets/javascripts/extjs-rails/src/panel/Table.js +1018 -0
  424. data/app/assets/javascripts/extjs-rails/src/panel/Tool.js +304 -0
  425. data/app/assets/javascripts/extjs-rails/src/picker/Color.js +219 -0
  426. data/app/assets/javascripts/extjs-rails/src/picker/Date.js +1140 -0
  427. data/app/assets/javascripts/extjs-rails/src/picker/Month.js +490 -0
  428. data/app/assets/javascripts/extjs-rails/src/picker/Time.js +165 -0
  429. data/app/assets/javascripts/extjs-rails/src/resizer/BorderSplitter.js +22 -0
  430. data/app/assets/javascripts/extjs-rails/src/resizer/BorderSplitterTracker.js +210 -0
  431. data/app/assets/javascripts/extjs-rails/src/resizer/Handle.js +29 -0
  432. data/app/assets/javascripts/extjs-rails/src/resizer/ResizeTracker.js +346 -0
  433. data/app/assets/javascripts/extjs-rails/src/resizer/Resizer.js +477 -0
  434. data/app/assets/javascripts/extjs-rails/src/resizer/Splitter.js +242 -0
  435. data/app/assets/javascripts/extjs-rails/src/resizer/SplitterTracker.js +230 -0
  436. data/app/assets/javascripts/extjs-rails/src/selection/CellModel.js +395 -0
  437. data/app/assets/javascripts/extjs-rails/src/selection/CheckboxModel.js +234 -0
  438. data/app/assets/javascripts/extjs-rails/src/selection/DataViewModel.js +160 -0
  439. data/app/assets/javascripts/extjs-rails/src/selection/Model.js +646 -0
  440. data/app/assets/javascripts/extjs-rails/src/selection/RowModel.js +499 -0
  441. data/app/assets/javascripts/extjs-rails/src/selection/TreeModel.js +78 -0
  442. data/app/assets/javascripts/extjs-rails/src/slider/Multi.js +835 -0
  443. data/app/assets/javascripts/extjs-rails/src/slider/Single.js +56 -0
  444. data/app/assets/javascripts/extjs-rails/src/slider/Thumb.js +259 -0
  445. data/app/assets/javascripts/extjs-rails/src/slider/Tip.js +130 -0
  446. data/app/assets/javascripts/extjs-rails/src/state/CookieProvider.js +120 -0
  447. data/app/assets/javascripts/extjs-rails/src/state/LocalStorageProvider.js +72 -0
  448. data/app/assets/javascripts/extjs-rails/src/state/Manager.js +70 -0
  449. data/app/assets/javascripts/extjs-rails/src/state/Provider.js +182 -0
  450. data/app/assets/javascripts/extjs-rails/src/state/Stateful.js +364 -0
  451. data/app/assets/javascripts/extjs-rails/src/tab/Bar.js +258 -0
  452. data/app/assets/javascripts/extjs-rails/src/tab/Panel.js +654 -0
  453. data/app/assets/javascripts/extjs-rails/src/tab/Tab.js +358 -0
  454. data/app/assets/javascripts/extjs-rails/src/tail.js +10 -0
  455. data/app/assets/javascripts/extjs-rails/src/tip/QuickTip.js +335 -0
  456. data/app/assets/javascripts/extjs-rails/src/tip/QuickTipManager.js +239 -0
  457. data/app/assets/javascripts/extjs-rails/src/tip/Tip.js +160 -0
  458. data/app/assets/javascripts/extjs-rails/src/tip/ToolTip.js +691 -0
  459. data/app/assets/javascripts/extjs-rails/src/toolbar/Fill.js +28 -0
  460. data/app/assets/javascripts/extjs-rails/src/toolbar/Item.js +16 -0
  461. data/app/assets/javascripts/extjs-rails/src/toolbar/Paging.js +600 -0
  462. data/app/assets/javascripts/extjs-rails/src/toolbar/Separator.js +23 -0
  463. data/app/assets/javascripts/extjs-rails/src/toolbar/Spacer.js +33 -0
  464. data/app/assets/javascripts/extjs-rails/src/toolbar/TextItem.js +57 -0
  465. data/app/assets/javascripts/extjs-rails/src/toolbar/Toolbar-legacy.js +123 -0
  466. data/app/assets/javascripts/extjs-rails/src/toolbar/Toolbar.js +447 -0
  467. data/app/assets/javascripts/extjs-rails/src/tree/Column.js +90 -0
  468. data/app/assets/javascripts/extjs-rails/src/tree/Panel.js +505 -0
  469. data/app/assets/javascripts/extjs-rails/src/tree/View.js +658 -0
  470. data/app/assets/javascripts/extjs-rails/src/tree/ViewDragZone.js +49 -0
  471. data/app/assets/javascripts/extjs-rails/src/tree/ViewDropZone.js +287 -0
  472. data/app/assets/javascripts/extjs-rails/src/tree/plugin/TreeViewDragDrop.js +244 -0
  473. data/app/assets/javascripts/extjs-rails/src/util/AbstractMixedCollection.js +772 -0
  474. data/app/assets/javascripts/extjs-rails/src/util/Animate.js +426 -0
  475. data/app/assets/javascripts/extjs-rails/src/util/Bindable.js +102 -0
  476. data/app/assets/javascripts/extjs-rails/src/util/CSS.js +185 -0
  477. data/app/assets/javascripts/extjs-rails/src/util/ClickRepeater.js +238 -0
  478. data/app/assets/javascripts/extjs-rails/src/util/ComponentDragger.js +126 -0
  479. data/app/assets/javascripts/extjs-rails/src/util/Cookies.js +91 -0
  480. data/app/assets/javascripts/extjs-rails/src/util/ElementContainer.js +293 -0
  481. data/app/assets/javascripts/extjs-rails/src/util/Filter.js +159 -0
  482. data/app/assets/javascripts/extjs-rails/src/util/Floating.js +321 -0
  483. data/app/assets/javascripts/extjs-rails/src/util/Grouper.js +26 -0
  484. data/app/assets/javascripts/extjs-rails/src/util/HashMap.js +356 -0
  485. data/app/assets/javascripts/extjs-rails/src/util/History.js +285 -0
  486. data/app/assets/javascripts/extjs-rails/src/util/Inflector.js +297 -0
  487. data/app/assets/javascripts/extjs-rails/src/util/KeyMap.js +427 -0
  488. data/app/assets/javascripts/extjs-rails/src/util/KeyNav.js +239 -0
  489. data/app/assets/javascripts/extjs-rails/src/util/LruCache.js +257 -0
  490. data/app/assets/javascripts/extjs-rails/src/util/Memento.js +131 -0
  491. data/app/assets/javascripts/extjs-rails/src/util/MixedCollection.js +239 -0
  492. data/app/assets/javascripts/extjs-rails/src/util/Observable.js +1003 -0
  493. data/app/assets/javascripts/extjs-rails/src/util/Offset.js +60 -0
  494. data/app/assets/javascripts/extjs-rails/src/util/Point.js +93 -0
  495. data/app/assets/javascripts/extjs-rails/src/util/ProtoElement.js +205 -0
  496. data/app/assets/javascripts/extjs-rails/src/util/Queue.js +76 -0
  497. data/app/assets/javascripts/extjs-rails/src/util/Region.js +388 -0
  498. data/app/assets/javascripts/extjs-rails/src/util/Renderable.js +1079 -0
  499. data/app/assets/javascripts/extjs-rails/src/util/Sortable.js +248 -0
  500. data/app/assets/javascripts/extjs-rails/src/util/Sorter.js +179 -0
  501. data/app/assets/javascripts/extjs-rails/src/util/TextMetrics.js +148 -0
  502. data/app/assets/javascripts/extjs-rails/src/view/AbstractView.js +1103 -0
  503. data/app/assets/javascripts/extjs-rails/src/view/BoundList.js +207 -0
  504. data/app/assets/javascripts/extjs-rails/src/view/BoundListKeyNav.js +92 -0
  505. data/app/assets/javascripts/extjs-rails/src/view/DragZone.js +106 -0
  506. data/app/assets/javascripts/extjs-rails/src/view/DropZone.js +240 -0
  507. data/app/assets/javascripts/extjs-rails/src/view/Table.js +1229 -0
  508. data/app/assets/javascripts/extjs-rails/src/view/TableChunker.js +139 -0
  509. data/app/assets/javascripts/extjs-rails/src/view/View.js +636 -0
  510. data/app/assets/javascripts/extjs-rails/src/window/MessageBox.js +880 -0
  511. data/app/assets/javascripts/extjs-rails/src/window/Window-legacy.js +56 -0
  512. data/app/assets/javascripts/extjs-rails/src/window/Window.js +793 -0
  513. data/extjs-rails.gemspec +24 -0
  514. data/lib/extjs-rails.rb +7 -0
  515. data/lib/extjs-rails/engine.rb +7 -0
  516. data/lib/extjs-rails/version.rb +5 -0
  517. metadata +660 -0
@@ -0,0 +1,2150 @@
1
+ /**
2
+ * Panel is a container that has specific functionality and structural components that make it the perfect building
3
+ * block for application-oriented user interfaces.
4
+ *
5
+ * Panels are, by virtue of their inheritance from {@link Ext.container.Container}, capable of being configured with a
6
+ * {@link Ext.container.Container#layout layout}, and containing child Components.
7
+ *
8
+ * When either specifying child {@link #cfg-items} of a Panel, or dynamically {@link Ext.container.Container#method-add adding}
9
+ * Components to a Panel, remember to consider how you wish the Panel to arrange those child elements, and whether those
10
+ * child elements need to be sized using one of Ext's built-in `{@link Ext.container.Container#layout layout}`
11
+ * schemes. By default, Panels use the {@link Ext.layout.container.Auto Auto} scheme. This simply renders child
12
+ * components, appending them one after the other inside the Container, and **does not apply any sizing** at all.
13
+ *
14
+ * {@img Ext.panel.Panel/panel.png Panel components}
15
+ *
16
+ * A Panel may also contain {@link #bbar bottom} and {@link #tbar top} toolbars, along with separate {@link
17
+ * Ext.panel.Header header}, {@link #fbar footer} and body sections.
18
+ *
19
+ * Panel also provides built-in {@link #collapsible collapsible, expandable} and {@link #closable} behavior. Panels can
20
+ * be easily dropped into any {@link Ext.container.Container Container} or layout, and the layout and rendering pipeline
21
+ * is {@link Ext.container.Container#method-add completely managed by the framework}.
22
+ *
23
+ * **Note:** By default, the `{@link #closable close}` header tool _destroys_ the Panel resulting in removal of the
24
+ * Panel and the destruction of any descendant Components. This makes the Panel object, and all its descendants
25
+ * **unusable**. To enable the close tool to simply _hide_ a Panel for later re-use, configure the Panel with
26
+ * `{@link #closeAction closeAction}: 'hide'`.
27
+ *
28
+ * Usually, Panels are used as constituents within an application, in which case, they would be used as child items of
29
+ * Containers, and would themselves use Ext.Components as child {@link #cfg-items}. However to illustrate simply rendering a
30
+ * Panel into the document, here's how to do it:
31
+ *
32
+ * @example
33
+ * Ext.create('Ext.panel.Panel', {
34
+ * title: 'Hello',
35
+ * width: 200,
36
+ * html: '<p>World!</p>',
37
+ * renderTo: Ext.getBody()
38
+ * });
39
+ *
40
+ * A more realistic scenario is a Panel created to house input fields which will not be rendered, but used as a
41
+ * constituent part of a Container:
42
+ *
43
+ * @example
44
+ * var filterPanel = Ext.create('Ext.panel.Panel', {
45
+ * bodyPadding: 5, // Don't want content to crunch against the borders
46
+ * width: 300,
47
+ * title: 'Filters',
48
+ * items: [{
49
+ * xtype: 'datefield',
50
+ * fieldLabel: 'Start date'
51
+ * }, {
52
+ * xtype: 'datefield',
53
+ * fieldLabel: 'End date'
54
+ * }],
55
+ * renderTo: Ext.getBody()
56
+ * });
57
+ *
58
+ * Note that the Panel above is configured to render into the document and assigned a size. In a real world scenario,
59
+ * the Panel will often be added inside a Container which will use a {@link #layout} to render, size and position its
60
+ * child Components.
61
+ *
62
+ * Panels will often use specific {@link #layout}s to provide an application with shape and structure by containing and
63
+ * arranging child Components:
64
+ *
65
+ * @example
66
+ * var resultsPanel = Ext.create('Ext.panel.Panel', {
67
+ * title: 'Results',
68
+ * width: 600,
69
+ * height: 400,
70
+ * renderTo: Ext.getBody(),
71
+ * layout: {
72
+ * type: 'vbox', // Arrange child items vertically
73
+ * align: 'stretch', // Each takes up full width
74
+ * padding: 5
75
+ * },
76
+ * items: [{ // Results grid specified as a config object with an xtype of 'grid'
77
+ * xtype: 'grid',
78
+ * columns: [{header: 'Column One'}], // One header just for show. There's no data,
79
+ * store: Ext.create('Ext.data.ArrayStore', {}), // A dummy empty data store
80
+ * flex: 1 // Use 1/3 of Container's height (hint to Box layout)
81
+ * }, {
82
+ * xtype: 'splitter' // A splitter between the two child items
83
+ * }, { // Details Panel specified as a config object (no xtype defaults to 'panel').
84
+ * title: 'Details',
85
+ * bodyPadding: 5,
86
+ * items: [{
87
+ * fieldLabel: 'Data item',
88
+ * xtype: 'textfield'
89
+ * }], // An array of form fields
90
+ * flex: 2 // Use 2/3 of Container's height (hint to Box layout)
91
+ * }]
92
+ * });
93
+ *
94
+ * The example illustrates one possible method of displaying search results. The Panel contains a grid with the
95
+ * resulting data arranged in rows. Each selected row may be displayed in detail in the Panel below. The {@link
96
+ * Ext.layout.container.VBox vbox} layout is used to arrange the two vertically. It is configured to stretch child items
97
+ * horizontally to full width. Child items may either be configured with a numeric height, or with a `flex` value to
98
+ * distribute available space proportionately.
99
+ *
100
+ * This Panel itself may be a child item of, for exaple, a {@link Ext.tab.Panel} which will size its child items to fit
101
+ * within its content area.
102
+ *
103
+ * Using these techniques, as long as the **layout** is chosen and configured correctly, an application may have any
104
+ * level of nested containment, all dynamically sized according to configuration, the user's preference and available
105
+ * browser size.
106
+ */
107
+ Ext.define('Ext.panel.Panel', {
108
+ extend: 'Ext.panel.AbstractPanel',
109
+ requires: [
110
+ 'Ext.panel.Header',
111
+ 'Ext.fx.Anim',
112
+ 'Ext.util.KeyMap',
113
+ 'Ext.panel.DD',
114
+ 'Ext.XTemplate',
115
+ 'Ext.layout.component.Dock',
116
+ 'Ext.util.Memento'
117
+ ],
118
+ alias: 'widget.panel',
119
+ alternateClassName: 'Ext.Panel',
120
+
121
+ /**
122
+ * @cfg {String} collapsedCls
123
+ * A CSS class to add to the panel's element after it has been collapsed.
124
+ */
125
+ collapsedCls: 'collapsed',
126
+
127
+ /**
128
+ * @cfg {Boolean} animCollapse
129
+ * `true` to animate the transition when the panel is collapsed, `false` to skip the animation (defaults to `true`
130
+ * if the {@link Ext.fx.Anim} class is available, otherwise `false`). May also be specified as the animation
131
+ * duration in milliseconds.
132
+ */
133
+ animCollapse: Ext.enableFx,
134
+
135
+ /**
136
+ * @cfg {Number} minButtonWidth
137
+ * Minimum width of all footer toolbar buttons in pixels. If set, this will be used as the default
138
+ * value for the {@link Ext.button.Button#minWidth} config of each Button added to the **footer toolbar** via the
139
+ * {@link #fbar} or {@link #buttons} configurations. It will be ignored for buttons that have a minWidth configured
140
+ * some other way, e.g. in their own config object or via the {@link Ext.container.Container#defaults defaults} of
141
+ * their parent container.
142
+ */
143
+ minButtonWidth: 75,
144
+
145
+ /**
146
+ * @cfg {Boolean} collapsed
147
+ * `true` to render the panel collapsed, `false` to render it expanded.
148
+ */
149
+ collapsed: false,
150
+
151
+ /**
152
+ * @cfg {Boolean} collapseFirst
153
+ * `true` to make sure the collapse/expand toggle button always renders first (to the left of) any other tools in
154
+ * the panel's title bar, `false` to render it last.
155
+ */
156
+ collapseFirst: true,
157
+
158
+ /**
159
+ * @cfg {Boolean} hideCollapseTool
160
+ * `true` to hide the expand/collapse toggle button when `{@link #collapsible} == true`, `false` to display it.
161
+ */
162
+ hideCollapseTool: false,
163
+
164
+ /**
165
+ * @cfg {Boolean} titleCollapse
166
+ * `true` to allow expanding and collapsing the panel (when `{@link #collapsible} = true`) by clicking anywhere in
167
+ * the header bar, `false`) to allow it only by clicking to tool button).
168
+ */
169
+ titleCollapse: false,
170
+
171
+ /**
172
+ * @cfg {String} collapseMode
173
+ * **Important: this config is only effective for {@link #collapsible} Panels which are direct child items of a
174
+ * {@link Ext.layout.container.Border border layout}.**
175
+ *
176
+ * When _not_ a direct child item of a {@link Ext.layout.container.Border border layout}, then the Panel's header
177
+ * remains visible, and the body is collapsed to zero dimensions. If the Panel has no header, then a new header
178
+ * (orientated correctly depending on the {@link #collapseDirection}) will be inserted to show a the title and a re-
179
+ * expand tool.
180
+ *
181
+ * When a child item of a {@link Ext.layout.container.Border border layout}, this config has two options:
182
+ *
183
+ * - **`undefined/omitted`**
184
+ *
185
+ * When collapsed, a placeholder {@link Ext.panel.Header Header} is injected into the layout to represent the Panel
186
+ * and to provide a UI with a Tool to allow the user to re-expand the Panel.
187
+ *
188
+ * - **`header`** :
189
+ *
190
+ * The Panel collapses to leave its header visible as when not inside a {@link Ext.layout.container.Border border
191
+ * layout}.
192
+ */
193
+
194
+ /**
195
+ * @cfg {Ext.Component/Object} placeholder
196
+ * **Important: This config is only effective for {@link #collapsible} Panels which are direct child items of a
197
+ * {@link Ext.layout.container.Border border layout} when not using the `'header'` {@link #collapseMode}.**
198
+ *
199
+ * **Optional.** A Component (or config object for a Component) to show in place of this Panel when this Panel is
200
+ * collapsed by a {@link Ext.layout.container.Border border layout}. Defaults to a generated {@link Ext.panel.Header
201
+ * Header} containing a {@link Ext.panel.Tool Tool} to re-expand the Panel.
202
+ */
203
+
204
+ /**
205
+ * @cfg {Boolean} floatable
206
+ * **Important: This config is only effective for {@link #collapsible} Panels which are direct child items of a
207
+ * {@link Ext.layout.container.Border border layout}.**
208
+ *
209
+ * true to allow clicking a collapsed Panel's {@link #placeholder} to display the Panel floated above the layout,
210
+ * false to force the user to fully expand a collapsed region by clicking the expand button to see it again.
211
+ */
212
+ floatable: true,
213
+
214
+ /**
215
+ * @cfg {Boolean} overlapHeader
216
+ * True to overlap the header in a panel over the framing of the panel itself. This is needed when frame:true (and
217
+ * is done automatically for you). Otherwise it is undefined. If you manually add rounded corners to a panel header
218
+ * which does not have frame:true, this will need to be set to true.
219
+ */
220
+
221
+ /**
222
+ * @cfg {Boolean} collapsible
223
+ * True to make the panel collapsible and have an expand/collapse toggle Tool added into the header tool button
224
+ * area. False to keep the panel sized either statically, or by an owning layout manager, with no toggle Tool.
225
+ *
226
+ * See {@link #collapseMode} and {@link #collapseDirection}
227
+ */
228
+ collapsible: false,
229
+
230
+ /**
231
+ * @cfg {Boolean} collapseDirection
232
+ * The direction to collapse the Panel when the toggle button is clicked.
233
+ *
234
+ * Defaults to the {@link #headerPosition}
235
+ *
236
+ * **Important: This config is _ignored_ for {@link #collapsible} Panels which are direct child items of a {@link
237
+ * Ext.layout.container.Border border layout}.**
238
+ *
239
+ * Specify as `'top'`, `'bottom'`, `'left'` or `'right'`.
240
+ */
241
+
242
+ /**
243
+ * @cfg {Boolean} closable
244
+ * True to display the 'close' tool button and allow the user to close the window, false to hide the button and
245
+ * disallow closing the window.
246
+ *
247
+ * By default, when close is requested by clicking the close button in the header, the {@link #method-close} method will be
248
+ * called. This will _{@link Ext.Component#method-destroy destroy}_ the Panel and its content meaning that it may not be
249
+ * reused.
250
+ *
251
+ * To make closing a Panel _hide_ the Panel so that it may be reused, set {@link #closeAction} to 'hide'.
252
+ */
253
+ closable: false,
254
+
255
+ /**
256
+ * @cfg {String} closeAction
257
+ * The action to take when the close header tool is clicked:
258
+ *
259
+ * - **`'{@link #method-destroy}'`** :
260
+ *
261
+ * {@link #method-remove remove} the window from the DOM and {@link Ext.Component#method-destroy destroy} it and all descendant
262
+ * Components. The window will **not** be available to be redisplayed via the {@link #method-show} method.
263
+ *
264
+ * - **`'{@link #method-hide}'`** :
265
+ *
266
+ * {@link #method-hide} the window by setting visibility to hidden and applying negative offsets. The window will be
267
+ * available to be redisplayed via the {@link #method-show} method.
268
+ *
269
+ * **Note:** This behavior has changed! setting *does* affect the {@link #method-close} method which will invoke the
270
+ * approriate closeAction.
271
+ */
272
+ closeAction: 'destroy',
273
+
274
+ /**
275
+ * @cfg {Object/Object[]} dockedItems
276
+ * A component or series of components to be added as docked items to this panel. The docked items can be docked to
277
+ * either the top, right, left or bottom of a panel. This is typically used for things like toolbars or tab bars:
278
+ *
279
+ * var panel = new Ext.panel.Panel({
280
+ * dockedItems: [{
281
+ * xtype: 'toolbar',
282
+ * dock: 'top',
283
+ * items: [{
284
+ * text: 'Docked to the top'
285
+ * }]
286
+ * }]
287
+ * });
288
+ */
289
+
290
+ /**
291
+ * @cfg {Number} placeholderCollapseHideMode
292
+ * The {@link Ext.dom.Element#setVisibilityMode mode} for hiding collapsed panels when
293
+ * using {@link #collapseMode} "placeholder".
294
+ */
295
+ placeholderCollapseHideMode: Ext.Element.VISIBILITY,
296
+
297
+ /**
298
+ * @cfg {Boolean} preventHeader
299
+ * @deprecated 4.1.0 Use {@link #header} instead.
300
+ * Prevent a Header from being created and shown.
301
+ */
302
+ preventHeader: false,
303
+
304
+ /**
305
+ * @cfg {Boolean/Object} header
306
+ * Pass as `false` to prevent a Header from being created and shown.
307
+ *
308
+ * Pass as a config object (optionally containing an `xtype`) to custom-configure this Panel's header.
309
+ *
310
+ */
311
+ header: undefined,
312
+
313
+ /**
314
+ * @cfg {String} headerPosition
315
+ * Specify as `'top'`, `'bottom'`, `'left'` or `'right'`.
316
+ */
317
+ headerPosition: 'top',
318
+
319
+ /**
320
+ * @cfg {Boolean} frame
321
+ * True to apply a frame to the panel.
322
+ */
323
+ frame: false,
324
+
325
+ /**
326
+ * @cfg {Boolean} frameHeader
327
+ * True to apply a frame to the panel panels header (if 'frame' is true).
328
+ */
329
+ frameHeader: true,
330
+
331
+ /**
332
+ * @cfg {Object[]/Ext.panel.Tool[]} tools
333
+ * An array of {@link Ext.panel.Tool} configs/instances to be added to the header tool area. The tools are stored as
334
+ * child components of the header container. They can be accessed using {@link #down} and {#query}, as well as the
335
+ * other component methods. The toggle tool is automatically created if {@link #collapsible} is set to true.
336
+ *
337
+ * Note that, apart from the toggle tool which is provided when a panel is collapsible, these tools only provide the
338
+ * visual button. Any required functionality must be provided by adding handlers that implement the necessary
339
+ * behavior.
340
+ *
341
+ * Example usage:
342
+ *
343
+ * tools:[{
344
+ * type:'refresh',
345
+ * tooltip: 'Refresh form Data',
346
+ * // hidden:true,
347
+ * handler: function(event, toolEl, panel){
348
+ * // refresh logic
349
+ * }
350
+ * },
351
+ * {
352
+ * type:'help',
353
+ * tooltip: 'Get Help',
354
+ * handler: function(event, toolEl, panel){
355
+ * // show help here
356
+ * }
357
+ * }]
358
+ */
359
+
360
+ /**
361
+ * @cfg {String} [title='']
362
+ * The title text to be used to display in the {@link Ext.panel.Header panel header}. When a
363
+ * `title` is specified the {@link Ext.panel.Header} will automatically be created and displayed unless
364
+ * {@link #header} is set to `false`.
365
+ */
366
+
367
+ /**
368
+ * @cfg {String} [titleAlign='left']
369
+ * May be `"left"`, `"right"` or `"center"`.
370
+ *
371
+ * The alignment of the title text within the available space between the icon and the tools.
372
+ */
373
+ titleAlign: 'left',
374
+
375
+ /**
376
+ * @cfg {Boolean} [manageHeight=true]: When true, the dock component layout writes
377
+ * height information to the panel's DOM elements based on its shrink wrap height
378
+ * calculation. This ensures that the browser respects the calculated height.
379
+ * When false, the dock component layout will not write heights on the panel or its
380
+ * body element. In some simple layout cases, not writing the heights to the DOM may
381
+ * be desired because this allows the browser to respond to direct DOM manipulations
382
+ * (like animations).
383
+ */
384
+ manageHeight: true,
385
+
386
+ /**
387
+ * @cfg {String} iconCls
388
+ * CSS class for an icon in the header. Used for displaying an icon to the left of a title.
389
+ */
390
+
391
+ /**
392
+ * @cfg {String} icon
393
+ * Path to image for an icon in the header. Used for displaying an icon to the left of a title.
394
+ */
395
+
396
+ initComponent: function() {
397
+ var me = this;
398
+
399
+ me.addEvents(
400
+
401
+ /**
402
+ * @event beforeclose
403
+ * Fires before the user closes the panel. Return false from any listener to stop the close event being
404
+ * fired
405
+ * @param {Ext.panel.Panel} panel The Panel object
406
+ */
407
+ 'beforeclose',
408
+
409
+ /**
410
+ * @event close
411
+ * Fires when the user closes the panel.
412
+ * @param {Ext.panel.Panel} panel The Panel object
413
+ */
414
+ 'close',
415
+
416
+ /**
417
+ * @event beforeexpand
418
+ * Fires before this panel is expanded. Return false to prevent the expand.
419
+ * @param {Ext.panel.Panel} p The Panel being expanded.
420
+ * @param {Boolean} animate True if the expand is animated, else false.
421
+ */
422
+ "beforeexpand",
423
+
424
+ /**
425
+ * @event beforecollapse
426
+ * Fires before this panel is collapsed. Return false to prevent the collapse.
427
+ * @param {Ext.panel.Panel} p The Panel being collapsed.
428
+ * @param {String} direction . The direction of the collapse. One of
429
+ *
430
+ * - Ext.Component.DIRECTION_TOP
431
+ * - Ext.Component.DIRECTION_RIGHT
432
+ * - Ext.Component.DIRECTION_BOTTOM
433
+ * - Ext.Component.DIRECTION_LEFT
434
+ *
435
+ * @param {Boolean} animate True if the collapse is animated, else false.
436
+ */
437
+ "beforecollapse",
438
+
439
+ /**
440
+ * @event expand
441
+ * Fires after this Panel has expanded.
442
+ * @param {Ext.panel.Panel} p The Panel that has been expanded.
443
+ */
444
+ "expand",
445
+
446
+ /**
447
+ * @event collapse
448
+ * Fires after this Panel hass collapsed.
449
+ * @param {Ext.panel.Panel} p The Panel that has been collapsed.
450
+ */
451
+ "collapse",
452
+
453
+ /**
454
+ * @event titlechange
455
+ * Fires after the Panel title has been set or changed.
456
+ * @param {Ext.panel.Panel} p the Panel which has been resized.
457
+ * @param {String} newTitle The new title.
458
+ * @param {String} oldTitle The previous panel title.
459
+ */
460
+ 'titlechange',
461
+
462
+ /**
463
+ * @event iconchange
464
+ * Fires after the Panel icon has been set or changed.
465
+ * @param {Ext.panel.Panel} p The Panel which has the icon changed.
466
+ * @param {String} newIcon The path to the new icon image.
467
+ * @param {String} oldIcon The path to the previous panel icon image.
468
+ */
469
+ 'iconchange',
470
+
471
+ /**
472
+ * @event iconclschange
473
+ * Fires after the Panel iconCls has been set or changed.
474
+ * @param {Ext.panel.Panel} p The Panel which has the iconCls changed.
475
+ * @param {String} newIconCls The new iconCls.
476
+ * @param {String} oldIconCls The previous panel iconCls.
477
+ */
478
+ 'iconclschange'
479
+ );
480
+
481
+ if (me.collapsible) {
482
+ // Save state on these two events.
483
+ this.addStateEvents(['expand', 'collapse']);
484
+ }
485
+ if (me.unstyled) {
486
+ me.setUI('plain');
487
+ }
488
+
489
+ if (me.frame) {
490
+ me.setUI(me.ui + '-framed');
491
+ }
492
+
493
+ // Backwards compatibility
494
+ me.bridgeToolbars();
495
+
496
+ me.callParent();
497
+ me.collapseDirection = me.collapseDirection || me.headerPosition || Ext.Component.DIRECTION_TOP;
498
+
499
+ // Used to track hidden content elements during collapsed state
500
+ me.hiddenOnCollapse = new Ext.dom.CompositeElement();
501
+
502
+ },
503
+
504
+ beforeDestroy: function() {
505
+ var me = this;
506
+ Ext.destroy(
507
+ me.placeholder,
508
+ me.ghostPanel,
509
+ me.dd
510
+ );
511
+ me.callParent();
512
+ },
513
+
514
+ initAria: function() {
515
+ this.callParent();
516
+ this.initHeaderAria();
517
+ },
518
+
519
+ getFocusEl: function() {
520
+ return this.el;
521
+ },
522
+
523
+ initHeaderAria: function() {
524
+ var me = this,
525
+ el = me.el,
526
+ header = me.header;
527
+ if (el && header) {
528
+ el.dom.setAttribute('aria-labelledby', header.titleCmp.id);
529
+ }
530
+ },
531
+
532
+ getHeader: function() {
533
+ return this.header;
534
+ },
535
+
536
+ /**
537
+ * Set a title for the panel's header. See {@link Ext.panel.Header#title}.
538
+ * @param {String} newTitle
539
+ */
540
+ setTitle: function(newTitle) {
541
+ var me = this,
542
+ oldTitle = me.title,
543
+ header = me.header,
544
+ reExpander = me.reExpander,
545
+ placeholder = me.placeholder;
546
+
547
+ me.title = newTitle;
548
+
549
+ if (header) {
550
+ if (header.isHeader) {
551
+ header.setTitle(newTitle);
552
+ } else {
553
+ header.title = newTitle;
554
+ }
555
+ }
556
+
557
+ if (reExpander) {
558
+ reExpander.setTitle(newTitle);
559
+ }
560
+
561
+ if (placeholder && placeholder.setTitle) {
562
+ placeholder.setTitle(newTitle);
563
+ }
564
+
565
+ me.fireEvent('titlechange', me, newTitle, oldTitle);
566
+ },
567
+
568
+ /**
569
+ * Set the iconCls for the panel's header. See {@link Ext.panel.Header#iconCls}. It will fire the
570
+ * {@link #iconclschange} event after completion.
571
+ * @param {String} newIconCls The new CSS class name
572
+ */
573
+ setIconCls: function(newIconCls) {
574
+ var me = this,
575
+ oldIconCls = me.iconCls,
576
+ header = me.header,
577
+ placeholder = me.placeholder;
578
+
579
+ me.iconCls = newIconCls;
580
+
581
+ if (header) {
582
+ if (header.isHeader) {
583
+ header.setIconCls(newIconCls);
584
+ } else {
585
+ header.iconCls = newIconCls;
586
+ }
587
+ }
588
+
589
+ if (placeholder && placeholder.setIconCls) {
590
+ placeholder.setIconCls(newIconCls);
591
+ }
592
+
593
+ me.fireEvent('iconclschange', me, newIconCls, oldIconCls);
594
+ },
595
+
596
+ /**
597
+ * Set the icon for the panel's header. See {@link Ext.panel.Header#icon}. It will fire the
598
+ * {@link #iconchange} event after completion.
599
+ * @param {String} newIcon The new icon path
600
+ */
601
+ setIcon: function(newIcon) {
602
+ var me = this,
603
+ oldIcon = me.icon,
604
+ header = me.header,
605
+ placeholder = me.placeholder;
606
+
607
+ me.icon = newIcon;
608
+
609
+ if (header) {
610
+ if (header.isHeader) {
611
+ header.setIcon(newIcon);
612
+ } else {
613
+ header.icon = newIcon;
614
+ }
615
+ }
616
+
617
+ if (placeholder && placeholder.setIcon) {
618
+ placeholder.setIcon(newIcon);
619
+ }
620
+
621
+ me.fireEvent('iconchange', me, newIcon, oldIcon);
622
+ },
623
+
624
+ bridgeToolbars: function() {
625
+ var me = this,
626
+ docked = [],
627
+ fbar,
628
+ fbarDefaults,
629
+ minButtonWidth = me.minButtonWidth;
630
+
631
+ function initToolbar (toolbar, pos, useButtonAlign) {
632
+ if (Ext.isArray(toolbar)) {
633
+ toolbar = {
634
+ xtype: 'toolbar',
635
+ items: toolbar
636
+ };
637
+ }
638
+ else if (!toolbar.xtype) {
639
+ toolbar.xtype = 'toolbar';
640
+ }
641
+ toolbar.dock = pos;
642
+ if (pos == 'left' || pos == 'right') {
643
+ toolbar.vertical = true;
644
+ }
645
+
646
+ // Legacy support for buttonAlign (only used by buttons/fbar)
647
+ if (useButtonAlign) {
648
+ toolbar.layout = Ext.applyIf(toolbar.layout || {}, {
649
+ // default to 'end' (right-aligned) if me.buttonAlign is undefined or invalid
650
+ pack: { left:'start', center:'center' }[me.buttonAlign] || 'end'
651
+ });
652
+ }
653
+ return toolbar;
654
+ }
655
+
656
+ // Short-hand toolbars (tbar, bbar and fbar plus new lbar and rbar):
657
+
658
+ /**
659
+ * @cfg {String} buttonAlign
660
+ * The alignment of any buttons added to this panel. Valid values are 'right', 'left' and 'center' (defaults to
661
+ * 'right' for buttons/fbar, 'left' for other toolbar types).
662
+ *
663
+ * **NOTE:** The prefered way to specify toolbars is to use the dockedItems config. Instead of buttonAlign you
664
+ * would add the layout: { pack: 'start' | 'center' | 'end' } option to the dockedItem config.
665
+ */
666
+
667
+ /**
668
+ * @cfg {Object/Object[]} tbar
669
+ * Convenience config. Short for 'Top Bar'.
670
+ *
671
+ * tbar: [
672
+ * { xtype: 'button', text: 'Button 1' }
673
+ * ]
674
+ *
675
+ * is equivalent to
676
+ *
677
+ * dockedItems: [{
678
+ * xtype: 'toolbar',
679
+ * dock: 'top',
680
+ * items: [
681
+ * { xtype: 'button', text: 'Button 1' }
682
+ * ]
683
+ * }]
684
+ */
685
+ if (me.tbar) {
686
+ docked.push(initToolbar(me.tbar, 'top'));
687
+ me.tbar = null;
688
+ }
689
+
690
+ /**
691
+ * @cfg {Object/Object[]} bbar
692
+ * Convenience config. Short for 'Bottom Bar'.
693
+ *
694
+ * bbar: [
695
+ * { xtype: 'button', text: 'Button 1' }
696
+ * ]
697
+ *
698
+ * is equivalent to
699
+ *
700
+ * dockedItems: [{
701
+ * xtype: 'toolbar',
702
+ * dock: 'bottom',
703
+ * items: [
704
+ * { xtype: 'button', text: 'Button 1' }
705
+ * ]
706
+ * }]
707
+ */
708
+ if (me.bbar) {
709
+ docked.push(initToolbar(me.bbar, 'bottom'));
710
+ me.bbar = null;
711
+ }
712
+
713
+ /**
714
+ * @cfg {Object/Object[]} buttons
715
+ * Convenience config used for adding buttons docked to the bottom of the panel. This is a
716
+ * synonym for the {@link #fbar} config.
717
+ *
718
+ * buttons: [
719
+ * { text: 'Button 1' }
720
+ * ]
721
+ *
722
+ * is equivalent to
723
+ *
724
+ * dockedItems: [{
725
+ * xtype: 'toolbar',
726
+ * dock: 'bottom',
727
+ * ui: 'footer',
728
+ * defaults: {minWidth: {@link #minButtonWidth}},
729
+ * items: [
730
+ * { xtype: 'component', flex: 1 },
731
+ * { xtype: 'button', text: 'Button 1' }
732
+ * ]
733
+ * }]
734
+ *
735
+ * The {@link #minButtonWidth} is used as the default {@link Ext.button.Button#minWidth minWidth} for
736
+ * each of the buttons in the buttons toolbar.
737
+ */
738
+ if (me.buttons) {
739
+ me.fbar = me.buttons;
740
+ me.buttons = null;
741
+ }
742
+
743
+ /**
744
+ * @cfg {Object/Object[]} fbar
745
+ * Convenience config used for adding items to the bottom of the panel. Short for Footer Bar.
746
+ *
747
+ * fbar: [
748
+ * { type: 'button', text: 'Button 1' }
749
+ * ]
750
+ *
751
+ * is equivalent to
752
+ *
753
+ * dockedItems: [{
754
+ * xtype: 'toolbar',
755
+ * dock: 'bottom',
756
+ * ui: 'footer',
757
+ * defaults: {minWidth: {@link #minButtonWidth}},
758
+ * items: [
759
+ * { xtype: 'component', flex: 1 },
760
+ * { xtype: 'button', text: 'Button 1' }
761
+ * ]
762
+ * }]
763
+ *
764
+ * The {@link #minButtonWidth} is used as the default {@link Ext.button.Button#minWidth minWidth} for
765
+ * each of the buttons in the fbar.
766
+ */
767
+ if (me.fbar) {
768
+ fbar = initToolbar(me.fbar, 'bottom', true); // only we useButtonAlign
769
+ fbar.ui = 'footer';
770
+
771
+ // Apply the minButtonWidth config to buttons in the toolbar
772
+ if (minButtonWidth) {
773
+ fbarDefaults = fbar.defaults;
774
+ fbar.defaults = function(config) {
775
+ var defaults = fbarDefaults || {};
776
+ if ((!config.xtype || config.xtype === 'button' || (config.isComponent && config.isXType('button'))) &&
777
+ !('minWidth' in defaults)) {
778
+ defaults = Ext.apply({minWidth: minButtonWidth}, defaults);
779
+ }
780
+ return defaults;
781
+ };
782
+ }
783
+
784
+ docked.push(fbar);
785
+ me.fbar = null;
786
+ }
787
+
788
+ /**
789
+ * @cfg {Object/Object[]} lbar
790
+ * Convenience config. Short for 'Left Bar' (left-docked, vertical toolbar).
791
+ *
792
+ * lbar: [
793
+ * { xtype: 'button', text: 'Button 1' }
794
+ * ]
795
+ *
796
+ * is equivalent to
797
+ *
798
+ * dockedItems: [{
799
+ * xtype: 'toolbar',
800
+ * dock: 'left',
801
+ * items: [
802
+ * { xtype: 'button', text: 'Button 1' }
803
+ * ]
804
+ * }]
805
+ */
806
+ if (me.lbar) {
807
+ docked.push(initToolbar(me.lbar, 'left'));
808
+ me.lbar = null;
809
+ }
810
+
811
+ /**
812
+ * @cfg {Object/Object[]} rbar
813
+ * Convenience config. Short for 'Right Bar' (right-docked, vertical toolbar).
814
+ *
815
+ * rbar: [
816
+ * { xtype: 'button', text: 'Button 1' }
817
+ * ]
818
+ *
819
+ * is equivalent to
820
+ *
821
+ * dockedItems: [{
822
+ * xtype: 'toolbar',
823
+ * dock: 'right',
824
+ * items: [
825
+ * { xtype: 'button', text: 'Button 1' }
826
+ * ]
827
+ * }]
828
+ */
829
+ if (me.rbar) {
830
+ docked.push(initToolbar(me.rbar, 'right'));
831
+ me.rbar = null;
832
+ }
833
+
834
+ if (me.dockedItems) {
835
+ if (!Ext.isArray(me.dockedItems)) {
836
+ me.dockedItems = [me.dockedItems];
837
+ }
838
+ me.dockedItems = me.dockedItems.concat(docked);
839
+ } else {
840
+ me.dockedItems = docked;
841
+ }
842
+ },
843
+
844
+ isPlaceHolderCollapse: function(){
845
+ return this.collapseMode == 'placeholder';
846
+ },
847
+
848
+ onBoxReady: function(){
849
+ this.callParent();
850
+ if (this.collapsed) {
851
+ this.setHiddenDocked();
852
+ }
853
+ },
854
+
855
+ beforeRender: function() {
856
+ var me = this,
857
+ wasCollapsed;
858
+
859
+ me.callParent();
860
+
861
+ // Add class-specific header tools.
862
+ // Panel adds collapsible and closable.
863
+ me.initTools();
864
+
865
+ // Dock the header/title unless we are configured specifically not to create a header
866
+ if (!(me.preventHeader || (me.header === false))) {
867
+ me.updateHeader();
868
+ }
869
+
870
+ // If we are rendering collapsed, we still need to save and modify various configs
871
+ if (me.collapsed) {
872
+ if (me.isPlaceHolderCollapse()) {
873
+ me.hidden = true;
874
+
875
+ // This will insert the placeholder Component into the ownerCt's child collection
876
+ // Its getRenderTree call which is calling this will then iterate again and
877
+ // recreate the child items array to include the new Component.
878
+ me.placeholderCollapse();
879
+ wasCollapsed = me.collapsed;
880
+
881
+ // Temporarily clear the flag so that the header is rendered with a collapse tool in it.
882
+ // Placeholder collapse panels never really collapse, they just hide. The tool is always
883
+ // a collapse tool.
884
+ me.collapsed = false;
885
+ } else {
886
+ me.beginCollapse();
887
+ me.addClsWithUI(me.collapsedCls);
888
+ }
889
+ }
890
+
891
+ // Restore the flag if we are being rendered initially placeholder collapsed.
892
+ if (wasCollapsed) {
893
+ me.collapsed = wasCollapsed;
894
+ }
895
+ },
896
+
897
+ /**
898
+ * @private
899
+ * Tools are a Panel-specific capabilty.
900
+ * Panel uses initTools. Subclasses may contribute tools by implementing addTools.
901
+ */
902
+ initTools: function() {
903
+ var me = this;
904
+
905
+ me.tools = me.tools ? Ext.Array.clone(me.tools) : [];
906
+
907
+ // Add a collapse tool unless configured to not show a collapse tool
908
+ // or to not even show a header.
909
+ if (me.collapsible && !(me.hideCollapseTool || me.header === false || me.preventHeader)) {
910
+ me.collapseDirection = me.collapseDirection || me.headerPosition || 'top';
911
+ me.collapseTool = me.expandTool = Ext.widget({
912
+ xtype: 'tool',
913
+ type: (me.collapsed && !me.isPlaceHolderCollapse()) ? ('expand-' + me.getOppositeDirection(me.collapseDirection)) : ('collapse-' + me.collapseDirection),
914
+ handler: me.toggleCollapse,
915
+ scope: me
916
+ });
917
+
918
+ // Prepend collapse tool is configured to do so.
919
+ if (me.collapseFirst) {
920
+ me.tools.unshift(me.collapseTool);
921
+ }
922
+ }
923
+
924
+ // Add subclass-specific tools.
925
+ me.addTools();
926
+
927
+ // Make Panel closable.
928
+ if (me.closable) {
929
+ me.addClsWithUI('closable');
930
+ me.addTool({
931
+ type: 'close',
932
+ handler: Ext.Function.bind(me.close, me, [])
933
+ });
934
+ }
935
+
936
+ // Append collapse tool if needed.
937
+ if (me.collapseTool && !me.collapseFirst) {
938
+ me.addTool(me.collapseTool);
939
+ }
940
+ },
941
+
942
+ /**
943
+ * @private
944
+ * @template
945
+ * Template method to be implemented in subclasses to add their tools after the collapsible tool.
946
+ */
947
+ addTools: Ext.emptyFn,
948
+
949
+ /**
950
+ * Closes the Panel. By default, this method, removes it from the DOM, {@link Ext.Component#method-destroy destroy}s the
951
+ * Panel object and all its descendant Components. The {@link #beforeclose beforeclose} event is fired before the
952
+ * close happens and will cancel the close action if it returns false.
953
+ *
954
+ * **Note:** This method is also affected by the {@link #closeAction} setting. For more explicit control use
955
+ * {@link #method-destroy} and {@link #method-hide} methods.
956
+ */
957
+ close: function() {
958
+ if (this.fireEvent('beforeclose', this) !== false) {
959
+ this.doClose();
960
+ }
961
+ },
962
+
963
+ // private
964
+ doClose: function() {
965
+ this.fireEvent('close', this);
966
+ this[this.closeAction]();
967
+ },
968
+
969
+ /**
970
+ * Create, hide, or show the header component as appropriate based on the current config.
971
+ * @private
972
+ * @param {Boolean} force True to force the header to be created
973
+ */
974
+ updateHeader: function(force) {
975
+ var me = this,
976
+ header = me.header,
977
+ title = me.title,
978
+ tools = me.tools,
979
+ vertical = me.headerPosition == 'left' || me.headerPosition == 'right';
980
+
981
+ if ((header !== false) && (force || title || (tools && tools.length) || (me.collapsible && !me.titleCollapse))) {
982
+ if (header && header.isHeader) {
983
+ header.show();
984
+ } else {
985
+
986
+ // Apply the header property to the header config
987
+ header = me.header = Ext.widget(Ext.apply({
988
+ xtype : 'header',
989
+ title : title,
990
+ titleAlign : me.titleAlign,
991
+ orientation : vertical ? 'vertical' : 'horizontal',
992
+ dock : me.headerPosition || 'top',
993
+ textCls : me.headerTextCls,
994
+ iconCls : me.iconCls,
995
+ icon : me.icon,
996
+ baseCls : me.baseCls + '-header',
997
+ tools : tools,
998
+ ui : me.ui,
999
+ id : me.id + '_header',
1000
+ indicateDrag: me.draggable,
1001
+ frame : me.frame && me.frameHeader,
1002
+ ignoreParentFrame : me.frame || me.overlapHeader,
1003
+ ignoreBorderManagement: me.frame || me.ignoreHeaderBorderManagement,
1004
+ listeners : me.collapsible && me.titleCollapse ? {
1005
+ click: me.toggleCollapse,
1006
+ scope: me
1007
+ } : null
1008
+ }, me.header));
1009
+ me.addDocked(header, 0);
1010
+
1011
+ // Reference the Header's tool array.
1012
+ // Header injects named references.
1013
+ me.tools = header.tools;
1014
+ }
1015
+ me.initHeaderAria();
1016
+ } else if (header) {
1017
+ header.hide();
1018
+ }
1019
+ },
1020
+
1021
+ // inherit docs
1022
+ setUI: function(ui) {
1023
+ var me = this;
1024
+
1025
+ me.callParent(arguments);
1026
+
1027
+ if (me.header && me.header.rendered) {
1028
+ me.header.setUI(ui);
1029
+ }
1030
+ },
1031
+
1032
+ // private
1033
+ getContentTarget: function() {
1034
+ return this.body;
1035
+ },
1036
+
1037
+ getTargetEl: function() {
1038
+ var me = this;
1039
+ return me.body || me.protoBody || me.frameBody || me.el;
1040
+ },
1041
+
1042
+ // the overrides below allow for collapsed regions inside the border layout to be hidden
1043
+
1044
+ // inherit docs
1045
+ isVisible: function(deep){
1046
+ var me = this;
1047
+ if (me.collapsed && me.placeholder) {
1048
+ return me.placeholder.isVisible(deep);
1049
+ }
1050
+ return me.callParent(arguments);
1051
+ },
1052
+
1053
+ // inherit docs
1054
+ onHide: function(){
1055
+ var me = this;
1056
+ if (me.collapsed && me.placeholder) {
1057
+ me.placeholder.hide();
1058
+ } else {
1059
+ me.callParent(arguments);
1060
+ }
1061
+ },
1062
+
1063
+ // inherit docs
1064
+ onShow: function(){
1065
+ var me = this;
1066
+ if (me.collapsed && me.placeholder) {
1067
+ // force hidden back to true, since this gets set by the layout
1068
+ me.hidden = true;
1069
+ me.placeholder.show();
1070
+ } else {
1071
+ me.callParent(arguments);
1072
+ }
1073
+ },
1074
+
1075
+ onRemoved: function(destroying) {
1076
+ var me = this;
1077
+
1078
+ me.callParent(arguments);
1079
+
1080
+ // If we are removed but not being destroyed, ensure our placeholder is also removed but not destroyed
1081
+ // If we are being destroyed, our destroy processing will destroy the placeholder.
1082
+ if (me.placeholder && !destroying) {
1083
+ me.ownerCt.remove(me.placeholder, false);
1084
+ }
1085
+ },
1086
+
1087
+ addTool: function(tools) {
1088
+ tools = [].concat(tools);
1089
+
1090
+ var me = this,
1091
+ header = me.header,
1092
+ t,
1093
+ tLen = tools.length,
1094
+ tool;
1095
+
1096
+ for (t = 0; t < tLen; t++) {
1097
+ tool = tools[t];
1098
+
1099
+ me.tools.push(tool);
1100
+
1101
+ if (header) {
1102
+ header.addTool(tool);
1103
+ }
1104
+ }
1105
+
1106
+ me.updateHeader();
1107
+ },
1108
+
1109
+ getOppositeDirection: function(d) {
1110
+ var c = Ext.Component;
1111
+ switch (d) {
1112
+ case c.DIRECTION_TOP:
1113
+ return c.DIRECTION_BOTTOM;
1114
+ case c.DIRECTION_RIGHT:
1115
+ return c.DIRECTION_LEFT;
1116
+ case c.DIRECTION_BOTTOM:
1117
+ return c.DIRECTION_TOP;
1118
+ case c.DIRECTION_LEFT:
1119
+ return c.DIRECTION_RIGHT;
1120
+ }
1121
+ },
1122
+
1123
+ getWidthAuthority: function() {
1124
+ if (this.collapsed && this.collapsedHorizontal()) {
1125
+ return 1; // the panel determine's its own width
1126
+ }
1127
+
1128
+ return this.callParent();
1129
+ },
1130
+
1131
+ getHeightAuthority: function() {
1132
+ if (this.collapsed && this.collapsedVertical()) {
1133
+ return 1; // the panel determine's its own height
1134
+ }
1135
+
1136
+ return this.callParent();
1137
+ },
1138
+
1139
+ collapsedHorizontal: function () {
1140
+ var dir = this.getCollapsed();
1141
+ return dir == 'left' || dir == 'right';
1142
+ },
1143
+
1144
+ collapsedVertical: function () {
1145
+ var dir = this.getCollapsed();
1146
+ return dir == 'top' || dir == 'bottom';
1147
+ },
1148
+
1149
+ getCollapsed: function() {
1150
+ var me = this;
1151
+ // The collapsed flag, when the Panel is collapsed acts as the direction in which the collapse took
1152
+ // place. It can still be tested as truthy/falsy if only a truth value is required.
1153
+ if (me.collapsed === true) {
1154
+ return me.collapseDirection;
1155
+ }
1156
+ return me.collapsed;
1157
+ },
1158
+
1159
+ getState: function() {
1160
+ var me = this,
1161
+ state = me.callParent(),
1162
+ memento;
1163
+
1164
+ state = me.addPropertyToState(state, 'collapsed');
1165
+
1166
+ // If a collapse has taken place, use remembered values as the dimensions.
1167
+ if (me.collapsed) {
1168
+ memento = me.collapseMemento;
1169
+ memento = memento && memento.data;
1170
+
1171
+ if (me.collapsedVertical()) {
1172
+ if (state) {
1173
+ delete state.height;
1174
+ }
1175
+ if (memento) {
1176
+ state = me.addPropertyToState(state, 'height', memento.height);
1177
+ }
1178
+ } else {
1179
+ if (state) {
1180
+ delete state.width;
1181
+ }
1182
+ if (memento) {
1183
+ state = me.addPropertyToState(state, 'width', memento.width);
1184
+ }
1185
+ }
1186
+ }
1187
+
1188
+ return state;
1189
+ },
1190
+
1191
+ findReExpander: function (direction) {
1192
+ var me = this,
1193
+ c = Ext.Component,
1194
+ dockedItems = me.dockedItems.items,
1195
+ dockedItemCount = dockedItems.length,
1196
+ comp, i;
1197
+
1198
+ // never use the header if we're in collapseMode mini
1199
+ if (me.collapseMode == 'mini') {
1200
+ return;
1201
+ }
1202
+
1203
+ switch (direction) {
1204
+ case c.DIRECTION_TOP:
1205
+ case c.DIRECTION_BOTTOM:
1206
+
1207
+ // Attempt to find a reExpander Component (docked in a horizontal orientation)
1208
+ // Also, collect all other docked items which we must hide after collapse.
1209
+ for (i = 0; i < dockedItemCount; i++) {
1210
+ comp = dockedItems[i];
1211
+ if (!comp.hidden) {
1212
+ if (comp.isHeader && (!comp.dock || comp.dock == 'top' || comp.dock == 'bottom')) {
1213
+ return comp;
1214
+ }
1215
+ }
1216
+ }
1217
+ break;
1218
+
1219
+ case c.DIRECTION_LEFT:
1220
+ case c.DIRECTION_RIGHT:
1221
+
1222
+ // Attempt to find a reExpander Component (docked in a vecrtical orientation)
1223
+ // Also, collect all other docked items which we must hide after collapse.
1224
+ for (i = 0; i < dockedItemCount; i++) {
1225
+ comp = dockedItems[i];
1226
+ if (!comp.hidden) {
1227
+ if (comp.isHeader && (comp.dock == 'left' || comp.dock == 'right')) {
1228
+ return comp;
1229
+ }
1230
+ }
1231
+ }
1232
+ break;
1233
+
1234
+ default:
1235
+ throw('Panel#findReExpander must be passed a valid collapseDirection');
1236
+ }
1237
+ },
1238
+
1239
+ getReExpander: function (direction) {
1240
+ var me = this,
1241
+ collapseDir = direction || me.collapseDirection,
1242
+ reExpander = me.reExpander || me.findReExpander(collapseDir);
1243
+
1244
+ me.expandDirection = me.getOppositeDirection(collapseDir);
1245
+
1246
+ if (!reExpander) {
1247
+ // We did not find a Header of the required orientation: create one.
1248
+ me.reExpander = reExpander = me.createReExpander(collapseDir, {
1249
+ dock: collapseDir,
1250
+ cls: Ext.baseCSSPrefix + 'docked ' + me.baseCls + '-' + me.ui + '-collapsed',
1251
+ ownerCt: me,
1252
+ ownerLayout: me.componentLayout
1253
+ });
1254
+
1255
+ me.dockedItems.insert(0, reExpander);
1256
+ }
1257
+ return reExpander;
1258
+ },
1259
+
1260
+ createReExpander: function(direction, defaults) {
1261
+ var me = this,
1262
+ isLeft = direction == 'left',
1263
+ isRight = direction == 'right',
1264
+ isVertical = isLeft || isRight,
1265
+ toolAtTop,
1266
+ result = Ext.apply({
1267
+ hideMode: 'offsets',
1268
+ title: me.title,
1269
+ orientation: isVertical ? 'vertical' : 'horizontal',
1270
+ textCls: me.headerTextCls,
1271
+ icon: me.icon,
1272
+ iconCls: me.iconCls,
1273
+ baseCls: me.baseCls + '-header',
1274
+ ui: me.ui,
1275
+ frame: me.frame && me.frameHeader,
1276
+ ignoreParentFrame: me.frame || me.overlapHeader,
1277
+ indicateDrag: me.draggable
1278
+ }, defaults);
1279
+
1280
+ // If we're in mini mode, set the placeholder size to only 1px since
1281
+ // we don't need it to show up.
1282
+ if (me.collapseMode == 'mini') {
1283
+ if (isVertical) {
1284
+ result.width = 1;
1285
+ } else {
1286
+ result.height = 1;
1287
+ }
1288
+ }
1289
+
1290
+ // Create the re expand tool
1291
+ // For UI consistency reasons, collapse:left reExpanders, and region: 'west' placeHolders
1292
+ // have the re expand tool at the *top* with a bit of space.
1293
+ if (!me.hideCollapseTool) {
1294
+ toolAtTop = isLeft || (isRight && me.isPlaceHolderCollapse());
1295
+ result[toolAtTop ? 'items' : 'tools'] = [{
1296
+ xtype: 'tool',
1297
+ type: 'expand-' + me.getOppositeDirection(direction),
1298
+ uiCls: ['top'],
1299
+ handler: me.toggleCollapse,
1300
+ scope: me
1301
+ }];
1302
+ }
1303
+ result = new Ext.panel.Header(result);
1304
+ result.addClsWithUI(me.getHeaderCollapsedClasses(result));
1305
+ return result;
1306
+ },
1307
+
1308
+ // private
1309
+ // Create the class array to add to the Header when collpsed.
1310
+ getHeaderCollapsedClasses: function(header) {
1311
+ var me = this,
1312
+ collapsedCls = me.collapsedCls,
1313
+ collapsedClasses;
1314
+
1315
+ collapsedClasses = [ collapsedCls, collapsedCls + '-' + header.dock];
1316
+ if (me.border && (!me.frame || (me.frame && Ext.supports.CSS3BorderRadius))) {
1317
+ collapsedClasses.push(collapsedCls + '-border-' + header.dock);
1318
+ }
1319
+ return collapsedClasses;
1320
+ },
1321
+
1322
+ /**
1323
+ * @private
1324
+ * Called before the change from default, configured state into the collapsed state.
1325
+ * This method may be called at render time to enable rendering in an initially collapsed state,
1326
+ * or at runtime when an existing, fully layed out Panel may be collapsed.
1327
+ * It basically saves configs which need to be clobbered for the duration of the collapsed state.
1328
+ */
1329
+ beginCollapse: function() {
1330
+ var me = this,
1331
+ lastBox = me.lastBox,
1332
+ rendered = me.rendered,
1333
+ collapseMemento = me.collapseMemento || (me.collapseMemento = new Ext.util.Memento(me)),
1334
+ sizeModel = me.getSizeModel(),
1335
+ reExpander;
1336
+
1337
+ // When we collapse a panel, the panel is in control of one dimension (depending on
1338
+ // collapse direction) and sets that on the component. We must restore the user's
1339
+ // original value (including non-existance) when we expand. Using this technique, we
1340
+ // mimic setCalculatedSize for the dimension we do not control and setSize for the
1341
+ // one we do (only while collapsed).
1342
+ // Additionally, the panel may have a shrink wrapped width and/or height. For shrinkWrapped
1343
+ // panels this can be problematic, since a collapsed, shrink-wrapped panel has no way
1344
+ // of determining its width (or height if the collapse direction is horizontal). It is
1345
+ // therefore necessary to capture both the width and height regardless of collapse direction.
1346
+ // This allows us to set a configured width or height on the panel when it is collapsed,
1347
+ // and it will be restored to an unconfigured-width shrinkWrapped state on expand.
1348
+ collapseMemento.capture(['height', 'minHeight', 'width', 'minWidth']);
1349
+ if (lastBox) {
1350
+ collapseMemento.capture(['x', 'y', 'height', 'width'], lastBox, 'last.');
1351
+ }
1352
+ // If the panel has a shrinkWrapped height/width and is already rendered, configure its width/height as its calculated width/height,
1353
+ // so that the collapsed header will have the same width or height as the panel did before it was collapsed.
1354
+ // If the shrinkWrapped panel has not yet been rendered, as will be the case when a panel is initially configured with
1355
+ // collapsed:true, we attempt to use the configured width/height, and fall back to minWidth or minHeight if
1356
+ // width/height has not been configured, and fall back to a value of 100 if a minWidth/minHeight has not been configured.
1357
+ if (me.collapsedVertical()) {
1358
+ if (sizeModel.width.shrinkWrap) {
1359
+ me.width = rendered ? me.getWidth() : me.width || me.minWidth || 100;
1360
+ }
1361
+ delete me.height;
1362
+ me.minHeight = 0;
1363
+ } else if (me.collapsedHorizontal()) {
1364
+ if (sizeModel.height.shrinkWrap) {
1365
+ me.height = rendered ? me.getHeight() : me.height || me.minHeight || 100;
1366
+ }
1367
+ delete me.width;
1368
+ me.minWidth = 0;
1369
+ }
1370
+
1371
+ if (me.ownerCt) {
1372
+ me.ownerCt.getLayout().beginCollapse(me);
1373
+ }
1374
+
1375
+ // Get a reExpander header. This will return the Panel Header if the Header is in the correct orientation
1376
+ // If we are using the Header as the reExpander, change its UI to collapsed state
1377
+ if (!me.isPlaceHolderCollapse()) {
1378
+ if (me.header === (reExpander = me.getReExpander())) {
1379
+ me.header.addClsWithUI(me.getHeaderCollapsedClasses(me.header));
1380
+
1381
+ // Ensure that the reExpander has the correct framing applied.
1382
+ if (me.header.rendered) {
1383
+ me.header.updateFrame();
1384
+ }
1385
+ }
1386
+ // We're going to use a temporary reExpander: show it.
1387
+ else {
1388
+ if (reExpander.el) {
1389
+ reExpander.el.show();
1390
+ reExpander.hidden = false;
1391
+ }
1392
+ }
1393
+ }
1394
+ if (me.resizer) {
1395
+ me.resizer.disable();
1396
+ }
1397
+ },
1398
+
1399
+ beginExpand: function() {
1400
+ var me = this,
1401
+ lastBox = me.lastBox,
1402
+ collapseMemento = me.collapseMemento,
1403
+ reExpander;
1404
+
1405
+ collapseMemento.restore(['height', 'minHeight', 'width', 'minWidth']);
1406
+ if (lastBox) {
1407
+ collapseMemento.restore(['x', 'y', 'height', 'width'], true, lastBox, 'last.');
1408
+ }
1409
+
1410
+ if (me.ownerCt) {
1411
+ me.ownerCt.getLayout().beginExpand(me);
1412
+ }
1413
+
1414
+ if (!me.isPlaceHolderCollapse()) {
1415
+ // If we have been using our Header as the reExpander then restore the Header to expanded UI
1416
+ if (me.header === (reExpander = me.getReExpander())) {
1417
+ me.header.removeClsWithUI(me.getHeaderCollapsedClasses(me.header));
1418
+
1419
+ // Ensure that the reExpander has the correct framing applied.
1420
+ if (me.header.rendered) {
1421
+ me.header.updateFrame();
1422
+ }
1423
+ }
1424
+ // We've been using a temporary reExpander: hide it.
1425
+ else {
1426
+ reExpander.hidden = true;
1427
+ reExpander.el.hide();
1428
+ }
1429
+ }
1430
+ if (me.resizer) {
1431
+ me.resizer.enable();
1432
+ }
1433
+ },
1434
+
1435
+ /**
1436
+ * Collapses the panel body so that the body becomes hidden. Docked Components parallel to the border towards which
1437
+ * the collapse takes place will remain visible. Fires the {@link #beforecollapse} event which will cancel the
1438
+ * collapse action if it returns false.
1439
+ *
1440
+ * @param {String} direction . The direction to collapse towards. Must be one of
1441
+ *
1442
+ * - Ext.Component.DIRECTION_TOP
1443
+ * - Ext.Component.DIRECTION_RIGHT
1444
+ * - Ext.Component.DIRECTION_BOTTOM
1445
+ * - Ext.Component.DIRECTION_LEFT
1446
+ *
1447
+ * @param {Boolean} [animate] True to animate the transition, else false (defaults to the value of the
1448
+ * {@link #animCollapse} panel config)
1449
+ * @return {Ext.panel.Panel} this
1450
+ */
1451
+ collapse: function(direction, animate) {
1452
+ var me = this,
1453
+ collapseDir = direction || me.collapseDirection,
1454
+ ownerCt = me.ownerCt;
1455
+
1456
+ if (me.isCollapsingOrExpanding) {
1457
+ return me;
1458
+ }
1459
+
1460
+ if (arguments.length < 2) {
1461
+ animate = me.animCollapse;
1462
+ }
1463
+
1464
+ if (me.collapsed || me.fireEvent('beforecollapse', me, direction, animate) === false) {
1465
+ return me;
1466
+ }
1467
+
1468
+ if (ownerCt && me.isPlaceHolderCollapse()) {
1469
+ return me.placeholderCollapse(direction, animate);
1470
+ }
1471
+
1472
+ me.collapsed = collapseDir;
1473
+ me.beginCollapse();
1474
+
1475
+ me.fireHierarchyEvent('collapse');
1476
+
1477
+ return me.doCollapseExpand(1, animate);
1478
+ },
1479
+
1480
+ doCollapseExpand: function (flags, animate) {
1481
+ var me = this,
1482
+ originalAnimCollapse = me.animCollapse,
1483
+ ownerLayout = me.ownerLayout;
1484
+
1485
+ // we need to temporarily set animCollapse to the animate value here because ContextItem
1486
+ // uses the animCollapse property to determine if the collapse/expand should be animated
1487
+ me.animCollapse = animate;
1488
+
1489
+ // Flag used by the layouy ContextItem to impose an animation policy based upon the
1490
+ // collapse direction and the animCollapse setting.
1491
+ me.isCollapsingOrExpanding = flags;
1492
+
1493
+ if (ownerLayout && !animate) {
1494
+ ownerLayout.onContentChange(me);
1495
+ } else {
1496
+ me.updateLayout({ isRoot: true });
1497
+ }
1498
+
1499
+ // set animCollapse back to its original value
1500
+ me.animCollapse = originalAnimCollapse;
1501
+
1502
+ return me;
1503
+ },
1504
+
1505
+ /**
1506
+ * Invoked after the Panel is Collapsed.
1507
+ *
1508
+ * @param {Boolean} animated
1509
+ *
1510
+ * @template
1511
+ * @protected
1512
+ */
1513
+ afterCollapse: function(animated) {
1514
+ var me = this,
1515
+ ownerLayout = me.ownerLayout;
1516
+
1517
+ me.isCollapsingOrExpanding = 0;
1518
+ if (me.collapseTool) {
1519
+ me.collapseTool.setType('expand-' + me.getOppositeDirection(me.collapseDirection));
1520
+ }
1521
+
1522
+ if (ownerLayout && animated) {
1523
+ ownerLayout.onContentChange(me);
1524
+ }
1525
+
1526
+ me.setHiddenDocked();
1527
+ me.fireEvent('collapse', me);
1528
+ },
1529
+
1530
+ setHiddenDocked: function(){
1531
+ // Hide Panel content except reExpander using visibility to prevent focusing of contained elements.
1532
+ // Track what we hide to re-show on expand
1533
+ var me = this,
1534
+ toHide = me.hiddenOnCollapse,
1535
+ reExpander = me.getReExpander(),
1536
+ items = me.getDockedItems(),
1537
+ len = items.length,
1538
+ i = 0,
1539
+ item;
1540
+
1541
+ toHide.add(me.body);
1542
+ for (; i < len; i++) {
1543
+ item = items[i];
1544
+ if (item && item !== reExpander && item.el) {
1545
+ toHide.add(item.el);
1546
+ }
1547
+ }
1548
+ toHide.setStyle('visibility', 'hidden');
1549
+ },
1550
+
1551
+ restoreHiddenDocked: function(){
1552
+ var toShow = this.hiddenOnCollapse;
1553
+ // Re-show Panel content which was hidden after collapse.
1554
+ toShow.setStyle('visibility', '');
1555
+ toShow.clear();
1556
+ },
1557
+
1558
+ getPlaceholder: function(direction) {
1559
+ var me = this,
1560
+ collapseDir = direction || me.collapseDirection,
1561
+ listeners = null,
1562
+ placeholder = me.placeholder;
1563
+
1564
+ if (!placeholder) {
1565
+ if (me.floatable || (me.collapsible && me.titleCollapse)) {
1566
+ listeners = {
1567
+ click: {
1568
+ fn: me.floatable ? me.floatCollapsedPanel : me.toggleCollapse,
1569
+ element: 'el',
1570
+ scope: me
1571
+ }
1572
+ };
1573
+ }
1574
+
1575
+ me.placeholder = placeholder = Ext.widget(me.createReExpander(collapseDir, {
1576
+ id: me.id + '-placeholder',
1577
+ listeners: listeners
1578
+ }));
1579
+ }
1580
+
1581
+ // User created placeholder was passed in
1582
+ if (!placeholder.placeholderFor) {
1583
+ // Handle the case of a placeholder config
1584
+ if (!placeholder.isComponent) {
1585
+ me.placeholder = placeholder = me.lookupComponent(placeholder);
1586
+ }
1587
+ Ext.applyIf(placeholder, {
1588
+ margins: me.margins,
1589
+ placeholderFor: me
1590
+ });
1591
+
1592
+ placeholder.addCls([Ext.baseCSSPrefix + 'region-collapsed-placeholder', Ext.baseCSSPrefix + 'region-collapsed-' + collapseDir + '-placeholder', me.collapsedCls]);
1593
+ }
1594
+
1595
+ return placeholder;
1596
+ },
1597
+
1598
+ placeholderCollapse: function(direction, animate) {
1599
+ var me = this,
1600
+ ownerCt = me.ownerCt,
1601
+ collapseDir = direction || me.collapseDirection,
1602
+ floatCls = Ext.baseCSSPrefix + 'border-region-slide-in',
1603
+ placeholder = me.getPlaceholder(direction);
1604
+
1605
+ me.isCollapsingOrExpanding = 1;
1606
+
1607
+ // Upcoming layout run will ignore this Component
1608
+ me.hidden = true;
1609
+ me.collapsed = collapseDir;
1610
+
1611
+ if (placeholder.rendered) {
1612
+ // We may have been added to another Container from that in which we rendered the placeholder
1613
+ if (placeholder.el.dom.parentNode !== me.el.dom.parentNode) {
1614
+ me.el.dom.parentNode.insertBefore(placeholder.el.dom, me.el.dom);
1615
+ }
1616
+
1617
+ placeholder.hidden = false;
1618
+ placeholder.el.show();
1619
+ ownerCt.updateLayout();
1620
+ } else {
1621
+ ownerCt.insert(ownerCt.items.indexOf(me), placeholder);
1622
+ }
1623
+
1624
+ if (me.rendered) {
1625
+ // We MUST NOT hide using display because that resets all scroll information.
1626
+ me.el.setVisibilityMode(me.placeholderCollapseHideMode);
1627
+ if (animate) {
1628
+ me.el.addCls(floatCls);
1629
+ placeholder.el.hide();
1630
+
1631
+ me.el.slideOut(collapseDir.substr(0, 1), {
1632
+ preserveScroll: true,
1633
+ duration: Ext.Number.from(animate, Ext.fx.Anim.prototype.duration),
1634
+ listeners: {
1635
+ afteranimate: function() {
1636
+ me.el.removeCls(floatCls);
1637
+ /* We need to show the element so that slideIn will work correctly. However, if we leave it
1638
+ visible then it can be seen before the animation starts, causing a flicker. The solution,
1639
+ borrowed from date picker, is to hide it using display none. The slideIn effect includes
1640
+ a call to fixDisplay() that will undo the display none at the appropriate time.
1641
+ */
1642
+ placeholder.el.show().setStyle('display', 'none').slideIn(collapseDir.substr(0, 1), {
1643
+ easing: 'linear',
1644
+ duration: 100,
1645
+ listeners: {
1646
+ afteranimate: function() {
1647
+ placeholder.focus();
1648
+ me.isCollapsingOrExpanding = 0;
1649
+ me.fireEvent('collapse', me);
1650
+ }
1651
+ }
1652
+ });
1653
+ }
1654
+ }
1655
+ });
1656
+ } else {
1657
+ me.el.hide();
1658
+ me.isCollapsingOrExpanding = 0;
1659
+ me.fireEvent('collapse', me);
1660
+ }
1661
+ } else {
1662
+ me.isCollapsingOrExpanding = 0;
1663
+ me.fireEvent('collapse', me);
1664
+ }
1665
+
1666
+ return me;
1667
+ },
1668
+
1669
+ floatCollapsedPanel: function() {
1670
+ var me = this,
1671
+ placeholder = me.placeholder,
1672
+ pb = placeholder.getBox(true),
1673
+ myBox,
1674
+ floatCls = Ext.baseCSSPrefix + 'border-region-slide-in',
1675
+ collapsed = me.collapsed,
1676
+ layoutOwner = me.ownerCt || me,
1677
+ slideDirection;
1678
+
1679
+ // Already floated
1680
+ if (me.el.hasCls(floatCls)) {
1681
+ me.slideOutFloatedPanel();
1682
+ return;
1683
+ }
1684
+
1685
+ if (me.isSliding) {
1686
+ return;
1687
+ }
1688
+ me.isSliding = true;
1689
+
1690
+ // Function to be called when the mouse leaves the floated Panel
1691
+ // Slide out when the mouse leaves the region bounded by the slid Component and its placeholder.
1692
+ function onMouseLeaveFloated(e) {
1693
+ var slideRegion = me.el.getRegion().union(placeholder.el.getRegion()).adjust(1, -1, -1, 1);
1694
+
1695
+ // If mouse is not within slide Region, slide it out
1696
+ if (!slideRegion.contains(e.getPoint())) {
1697
+ me.slideOutFloatedPanel();
1698
+ }
1699
+ }
1700
+
1701
+ // Lay out in fully expanded mode to ensure we are at the correct size, and collect our expanded box
1702
+ me.placeholder.el.hide();
1703
+ me.placeholder.hidden = true;
1704
+ me.el.show();
1705
+ me.hidden = false;
1706
+ me.collapsed = false;
1707
+ layoutOwner.updateLayout();
1708
+ myBox = me.getBox(true);
1709
+
1710
+ // Then go back immediately to collapsed state from which to initiate the float into view.
1711
+ me.placeholder.el.show();
1712
+ me.placeholder.hidden = false;
1713
+ me.el.hide();
1714
+ me.hidden = true;
1715
+ me.collapsed = collapsed;
1716
+ layoutOwner.updateLayout();
1717
+
1718
+ // Monitor for mouseouting of the placeholder. Hide it if they exit for half a second or more
1719
+ me.placeholderMouseMon = placeholder.el.monitorMouseLeave(500, onMouseLeaveFloated);
1720
+ me.panelMouseMon = me.el.monitorMouseLeave(500, onMouseLeaveFloated);
1721
+ me.el.addCls(floatCls);
1722
+
1723
+ // Hide collapse tool in header if there is one (we might be headerless)
1724
+ if (me.collapseTool) {
1725
+ me.collapseTool.el.hide();
1726
+ }
1727
+
1728
+ switch (me.collapsed) {
1729
+ case 'top':
1730
+ me.el.setLeftTop(pb.x, pb.y + pb.height - 1);
1731
+ slideDirection = 't';
1732
+ break;
1733
+ case 'right':
1734
+ me.el.setLeftTop(pb.x - myBox.width + 1, pb.y);
1735
+ slideDirection = 'r';
1736
+ break;
1737
+ case 'bottom':
1738
+ me.el.setLeftTop(pb.x, pb.y - myBox.height + 1);
1739
+ slideDirection = 'b';
1740
+ break;
1741
+ case 'left':
1742
+ me.el.setLeftTop(pb.x + pb.width - 1, pb.y);
1743
+ slideDirection = 'l';
1744
+ break;
1745
+ }
1746
+
1747
+ // Remember how we are really collapsed so we can restore it, but also so we can
1748
+ // become a layoutRoot while we are floated:
1749
+ me.floatedFromCollapse = me.collapsed;
1750
+ me.collapsed = me.hidden = false;
1751
+
1752
+ me.el.slideIn(slideDirection, {
1753
+ preserveScroll: true,
1754
+ listeners: {
1755
+ afteranimate: function() {
1756
+ me.isSliding = false;
1757
+ }
1758
+ }
1759
+ });
1760
+ },
1761
+
1762
+ isLayoutRoot: function() {
1763
+ if (this.floatedFromCollapse) {
1764
+ return true;
1765
+ }
1766
+ return this.callParent();
1767
+ },
1768
+
1769
+ slideOutFloatedPanel: function() {
1770
+ var me = this,
1771
+ compEl = this.el,
1772
+ collapseDirection;
1773
+
1774
+ if (me.isSliding) {
1775
+ return;
1776
+ }
1777
+
1778
+ me.isSliding = true;
1779
+
1780
+ me.slideOutFloatedPanelBegin();
1781
+
1782
+ if (typeof me.collapsed == 'string') {
1783
+ collapseDirection = me.collapsed.charAt(0);
1784
+ }
1785
+
1786
+ compEl.slideOut(collapseDirection, {
1787
+ preserveScroll: true,
1788
+ listeners: {
1789
+ afteranimate: function() {
1790
+ me.slideOutFloatedPanelEnd();
1791
+ // this would be in slideOutFloatedPanelEnd except that the only other
1792
+ // caller removes this cls later
1793
+ me.el.removeCls(Ext.baseCSSPrefix + 'border-region-slide-in');
1794
+ me.isSliding = false;
1795
+ }
1796
+ }
1797
+ });
1798
+ },
1799
+
1800
+ /**
1801
+ * This method begins the slide out of the floated panel.
1802
+ * @private
1803
+ */
1804
+ slideOutFloatedPanelBegin: function() {
1805
+ var me = this,
1806
+ compEl = this.el;
1807
+
1808
+ me.collapsed = me.floatedFromCollapse;
1809
+ me.hidden = true;
1810
+ me.floatedFromCollapse = null;
1811
+
1812
+ // Remove mouse leave monitors
1813
+ compEl.un(me.panelMouseMon);
1814
+ me.placeholder.el.un(me.placeholderMouseMon);
1815
+ },
1816
+
1817
+ /**
1818
+ * This method cleans up after the slide out of the floated panel.
1819
+ * @private
1820
+ */
1821
+ slideOutFloatedPanelEnd: function() {
1822
+ if (this.collapseTool) {
1823
+ this.collapseTool.el.show();
1824
+ }
1825
+ },
1826
+
1827
+ /**
1828
+ * Expands the panel body so that it becomes visible. Fires the {@link #beforeexpand} event which will
1829
+ * cancel the expand action if it returns false.
1830
+ * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
1831
+ * {@link #animCollapse} panel config)
1832
+ * @return {Ext.panel.Panel} this
1833
+ */
1834
+ expand: function(animate) {
1835
+ var me = this;
1836
+
1837
+ if (me.isCollapsingOrExpanding) {
1838
+ return me;
1839
+ }
1840
+
1841
+ if (!arguments.length) {
1842
+ animate = me.animCollapse;
1843
+ }
1844
+
1845
+ if (!me.collapsed && !me.floatedFromCollapse) {
1846
+ return me;
1847
+ }
1848
+
1849
+ if (me.fireEvent('beforeexpand', me, animate) === false) {
1850
+ return me;
1851
+ }
1852
+
1853
+ if (me.isPlaceHolderCollapse()) {
1854
+ return me.placeholderExpand(animate);
1855
+ }
1856
+
1857
+ me.restoreHiddenDocked();
1858
+ me.beginExpand();
1859
+ me.collapsed = false;
1860
+
1861
+ me.fireHierarchyEvent('expand');
1862
+
1863
+ return me.doCollapseExpand(2, animate);
1864
+ },
1865
+
1866
+ placeholderExpand: function(animate) {
1867
+ var me = this,
1868
+ collapseDir = me.collapsed,
1869
+ floatCls = Ext.baseCSSPrefix + 'border-region-slide-in',
1870
+ finalPos,
1871
+ floatedPos,
1872
+ slideInDirection;
1873
+
1874
+ if (me.floatedFromCollapse) {
1875
+ floatedPos = me.getPosition(true);
1876
+ // these are the same cleanups performed by the normal slideOut mechanism:
1877
+ me.slideOutFloatedPanelBegin();
1878
+ me.slideOutFloatedPanelEnd();
1879
+ }
1880
+
1881
+ me.isCollapsingOrExpanding = 2;
1882
+
1883
+ // Expand me and hide the placeholder
1884
+ me.placeholder.hidden = true;
1885
+ me.placeholder.el.hide();
1886
+ me.collapsed = false;
1887
+ me.show();
1888
+
1889
+ if (animate) {
1890
+ // Floated, move it back to the floated pos, and thence into the correct place
1891
+ if (floatedPos) {
1892
+ finalPos = me.el.getXY();
1893
+ me.el.setLeftTop(floatedPos[0], floatedPos[1]);
1894
+ me.el.moveTo(finalPos[0], finalPos[1], {
1895
+ duration: Ext.Number.from(animate, Ext.fx.Anim.prototype.duration),
1896
+ listeners: {
1897
+ afteranimate: function() {
1898
+ me.el.removeCls(floatCls);
1899
+ me.isCollapsingOrExpanding = 0;
1900
+ me.fireEvent('expand', me);
1901
+ }
1902
+ }
1903
+ });
1904
+ }
1905
+ // Not floated, slide it in to the correct place
1906
+ else {
1907
+ me.hidden = true;
1908
+ me.el.addCls(floatCls);
1909
+ me.el.hide();
1910
+ me.collapsed = collapseDir;
1911
+ me.placeholder.show();
1912
+ slideInDirection = collapseDir.substr(0, 1);
1913
+
1914
+ // Slide this Component's el back into place, after which we lay out AGAIN
1915
+ me.hidden = false;
1916
+ me.el.slideIn(slideInDirection, {
1917
+ preserveScroll: true,
1918
+ duration: Ext.Number.from(animate, Ext.fx.Anim.prototype.duration),
1919
+ listeners: {
1920
+ afteranimate: function() {
1921
+ me.collapsed = false;
1922
+
1923
+ // the ordering of these two lines appears to be important in
1924
+ // IE9. There is an odd expand issue in IE 9 in the border layout
1925
+ // example that causes the index1 child of the south dock region
1926
+ // to get 'hidden' after a collapse / expand cycle. See
1927
+ // EXTJSIV-5318 for details
1928
+ me.el.removeCls(floatCls);
1929
+ me.placeholder.hide();
1930
+
1931
+ me.isCollapsingOrExpanding = 0;
1932
+ me.fireEvent('expand', me);
1933
+ }
1934
+ }
1935
+ });
1936
+ }
1937
+
1938
+ } else {
1939
+ me.isCollapsingOrExpanding = 0;
1940
+ me.fireEvent('expand', me);
1941
+ }
1942
+
1943
+ return me;
1944
+ },
1945
+
1946
+ /**
1947
+ * Invoked after the Panel is Expanded.
1948
+ *
1949
+ * @param {Boolean} animated
1950
+ *
1951
+ * @template
1952
+ * @protected
1953
+ */
1954
+ afterExpand: function(animated) {
1955
+ var me = this,
1956
+ ownerLayout = me.ownerLayout;
1957
+
1958
+ me.isCollapsingOrExpanding = 0;
1959
+ if (me.collapseTool) {
1960
+ me.collapseTool.setType('collapse-' + me.collapseDirection);
1961
+ }
1962
+
1963
+ if (ownerLayout && animated) {
1964
+ ownerLayout.onContentChange(me);
1965
+ }
1966
+
1967
+ me.fireEvent('expand', me);
1968
+ },
1969
+
1970
+ // inherit docs
1971
+ setBorder: function(border, targetEl) {
1972
+ if (targetEl) {
1973
+ // skip out here, the panel will set the border on the body/header during rendering
1974
+ return;
1975
+ }
1976
+
1977
+ var me = this,
1978
+ header = me.header;
1979
+
1980
+ if (!border) {
1981
+ border = 0;
1982
+ } else {
1983
+ border = Ext.Element.unitizeBox((border === true) ? 1 : border);
1984
+ }
1985
+
1986
+ if (header) {
1987
+ if (header.isHeader) {
1988
+ header.setBorder(border);
1989
+ } else {
1990
+ header.border = border;
1991
+ }
1992
+ }
1993
+
1994
+ if (me.rendered && me.bodyBorder !== false) {
1995
+ me.body.setStyle('border-width', border);
1996
+ }
1997
+ me.updateLayout();
1998
+
1999
+ me.border = border;
2000
+ },
2001
+
2002
+ /**
2003
+ * Shortcut for performing an {@link #method-expand} or {@link #method-collapse} based on the current state of the panel.
2004
+ * @return {Ext.panel.Panel} this
2005
+ */
2006
+ toggleCollapse: function() {
2007
+ return (this.collapsed || this.floatedFromCollapse) ? this.expand() : this.collapse();
2008
+ },
2009
+
2010
+ // private
2011
+ getKeyMap : function() {
2012
+ return this.keyMap || (this.keyMap = new Ext.util.KeyMap(Ext.apply({
2013
+ target: this.el
2014
+ }, this.keys)));
2015
+ },
2016
+
2017
+ // private
2018
+ initDraggable : function(){
2019
+ /**
2020
+ * @property {Ext.dd.DragSource} dd
2021
+ * If this Panel is configured {@link #cfg-draggable}, this property will contain an instance of {@link
2022
+ * Ext.dd.DragSource} which handles dragging the Panel.
2023
+ *
2024
+ * The developer must provide implementations of the abstract methods of {@link Ext.dd.DragSource} in order to
2025
+ * supply behaviour for each stage of the drag/drop process. See {@link #cfg-draggable}.
2026
+ */
2027
+ this.dd = new Ext.panel.DD(this, Ext.isBoolean(this.draggable) ? null : this.draggable);
2028
+ },
2029
+
2030
+ // private - helper function for ghost
2031
+ ghostTools : function() {
2032
+ var tools = [],
2033
+ header = this.header,
2034
+ headerTools = header ? header.query('tool[hidden=false]') : [],
2035
+ t, tLen, tool;
2036
+
2037
+ if (headerTools.length) {
2038
+ t = 0;
2039
+ tLen = headerTools.length;
2040
+
2041
+ for (; t < tLen; t++) {
2042
+ tool = headerTools[t];
2043
+
2044
+ // Some tools can be full components, and copying them into the ghost
2045
+ // actually removes them from the owning panel. You could also potentially
2046
+ // end up with duplicate DOM ids as well. To avoid any issues we just make
2047
+ // a simple bare-minimum clone of each tool for ghosting purposes.
2048
+ tools.push({
2049
+ type: tool.type
2050
+ });
2051
+ }
2052
+ } else {
2053
+ tools = [{
2054
+ type: 'placeholder'
2055
+ }];
2056
+ }
2057
+ return tools;
2058
+ },
2059
+
2060
+ // private - used for dragging
2061
+ ghost: function(cls) {
2062
+ var me = this,
2063
+ ghostPanel = me.ghostPanel,
2064
+ box = me.getBox(),
2065
+ header;
2066
+
2067
+ if (!ghostPanel) {
2068
+ ghostPanel = new Ext.panel.Panel({
2069
+ renderTo: document.body,
2070
+ floating: {
2071
+ shadow: false
2072
+ },
2073
+ frame: me.frame && !me.alwaysFramed,
2074
+ alwaysFramed: me.alwaysFramed,
2075
+ overlapHeader: me.overlapHeader,
2076
+ headerPosition: me.headerPosition,
2077
+ baseCls: me.baseCls,
2078
+ cls: me.baseCls + '-ghost ' + (cls ||'')
2079
+ });
2080
+ me.ghostPanel = ghostPanel;
2081
+ }
2082
+ ghostPanel.floatParent = me.floatParent;
2083
+ if (me.floating) {
2084
+ ghostPanel.setZIndex(Ext.Number.from(me.el.getStyle('zIndex'), 0));
2085
+ } else {
2086
+ ghostPanel.toFront();
2087
+ }
2088
+ if (!(me.preventHeader || (me.header === false))) {
2089
+ header = ghostPanel.header;
2090
+ // restore options
2091
+ if (header) {
2092
+ header.suspendLayouts();
2093
+ Ext.Array.forEach(header.query('tool'), header.remove, header);
2094
+ header.resumeLayouts();
2095
+ }
2096
+ ghostPanel.addTool(me.ghostTools());
2097
+ ghostPanel.setTitle(me.title);
2098
+ ghostPanel.setIconCls(me.iconCls);
2099
+ }
2100
+
2101
+ ghostPanel.el.show();
2102
+ ghostPanel.setPagePosition(box.x, box.y);
2103
+ ghostPanel.setSize(box.width, box.height);
2104
+ me.el.hide();
2105
+ return ghostPanel;
2106
+ },
2107
+
2108
+ // private
2109
+ unghost: function(show, matchPosition) {
2110
+ var me = this;
2111
+ if (!me.ghostPanel) {
2112
+ return;
2113
+ }
2114
+ if (show !== false) {
2115
+ // Show el first, so that position adjustment in setPagePosition
2116
+ // will work when relative positioned elements have their XY read.
2117
+ me.el.show();
2118
+ if (matchPosition !== false) {
2119
+ me.setPagePosition(me.ghostPanel.el.getXY());
2120
+ if (me.hideMode == 'offsets') {
2121
+ // clear the hidden style because we just repositioned
2122
+ delete me.el.hideModeStyles;
2123
+ }
2124
+ }
2125
+ Ext.defer(me.focus, 10, me);
2126
+ }
2127
+ me.ghostPanel.el.hide();
2128
+ },
2129
+
2130
+ beginDrag: function() {
2131
+ if (this.floatingItems) {
2132
+ this.floatingItems.hide();
2133
+ }
2134
+ },
2135
+
2136
+ endDrag: function() {
2137
+ if (this.floatingItems) {
2138
+ this.floatingItems.show();
2139
+ }
2140
+ },
2141
+
2142
+ initResizable: function(resizable) {
2143
+ if (this.collapsed) {
2144
+ resizable.disabled = true;
2145
+ }
2146
+ this.callParent([resizable]);
2147
+ }
2148
+ }, function() {
2149
+ this.prototype.animCollapse = Ext.enableFx;
2150
+ });