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,1294 @@
1
+ /**
2
+ * This class is used as a set of methods that are applied to the prototype of a
3
+ * Model to decorate it with a Node API. This means that models used in conjunction with a tree
4
+ * will have all of the tree related methods available on the model. In general this class will
5
+ * not be used directly by the developer. This class also creates extra fields on the model if
6
+ * they do not exist, to help maintain the tree state and UI. These fields are documented as
7
+ * config options.
8
+ */
9
+ Ext.define('Ext.data.NodeInterface', {
10
+ requires: ['Ext.data.Field'],
11
+
12
+ /**
13
+ * @cfg {String} parentId
14
+ * ID of parent node.
15
+ */
16
+
17
+ /**
18
+ * @cfg {Number} index
19
+ * The position of the node inside its parent. When parent has 4 children and the node is third amongst them,
20
+ * index will be 2.
21
+ */
22
+
23
+ /**
24
+ * @cfg {Number} depth
25
+ * The number of parents this node has. A root node has depth 0, a child of it depth 1, and so on...
26
+ */
27
+
28
+ /**
29
+ * @cfg {Boolean} [expanded=false]
30
+ * True if the node is expanded.
31
+ */
32
+
33
+ /**
34
+ * @cfg {Boolean} [expandable=false]
35
+ * Set to true to allow for expanding/collapsing of this node.
36
+ */
37
+
38
+ /**
39
+ * @cfg {Boolean} [checked=null]
40
+ * Set to true or false to show a checkbox alongside this node.
41
+ */
42
+
43
+ /**
44
+ * @cfg {Boolean} [leaf=false]
45
+ * Set to true to indicate that this child can have no children. The expand icon/arrow will then not be
46
+ * rendered for this node.
47
+ */
48
+
49
+ /**
50
+ * @cfg {String} cls
51
+ * CSS class to apply for this node.
52
+ */
53
+
54
+ /**
55
+ * @cfg {String} iconCls
56
+ * CSS class to apply for this node's icon.
57
+ */
58
+
59
+ /**
60
+ * @cfg {String} icon
61
+ * URL for this node's icon.
62
+ */
63
+
64
+ /**
65
+ * @cfg {Boolean} root
66
+ * True if this is the root node.
67
+ */
68
+
69
+ /**
70
+ * @cfg {Boolean} isLast
71
+ * True if this is the last node.
72
+ */
73
+
74
+ /**
75
+ * @cfg {Boolean} isFirst
76
+ * True if this is the first node.
77
+ */
78
+
79
+ /**
80
+ * @cfg {Boolean} [allowDrop=true]
81
+ * Set to false to deny dropping on this node.
82
+ */
83
+
84
+ /**
85
+ * @cfg {Boolean} [allowDrag=true]
86
+ * Set to false to deny dragging of this node.
87
+ */
88
+
89
+ /**
90
+ * @cfg {Boolean} [loaded=false]
91
+ * True if the node has finished loading.
92
+ */
93
+
94
+ /**
95
+ * @cfg {Boolean} [loading=false]
96
+ * True if the node is currently loading.
97
+ */
98
+
99
+ /**
100
+ * @cfg {String} href
101
+ * An URL for a link that's created when this config is specified.
102
+ */
103
+
104
+ /**
105
+ * @cfg {String} hrefTarget
106
+ * Target for link. Only applicable when {@link #href} also specified.
107
+ */
108
+
109
+ /**
110
+ * @cfg {String} qtip
111
+ * Tooltip text to show on this node.
112
+ */
113
+
114
+ /**
115
+ * @cfg {String} qtitle
116
+ * Tooltip title.
117
+ */
118
+
119
+ /**
120
+ * @cfg {String} text
121
+ * The text for to show on node label.
122
+ */
123
+
124
+ /**
125
+ * @cfg {Ext.data.NodeInterface[]} children
126
+ * Array of child nodes.
127
+ */
128
+
129
+
130
+ /**
131
+ * @property nextSibling
132
+ * A reference to this node's next sibling node. `null` if this node does not have a next sibling.
133
+ */
134
+
135
+ /**
136
+ * @property previousSibling
137
+ * A reference to this node's previous sibling node. `null` if this node does not have a previous sibling.
138
+ */
139
+
140
+ /**
141
+ * @property parentNode
142
+ * A reference to this node's parent node. `null` if this node is the root node.
143
+ */
144
+
145
+ /**
146
+ * @property lastChild
147
+ * A reference to this node's last child node. `null` if this node has no children.
148
+ */
149
+
150
+ /**
151
+ * @property firstChild
152
+ * A reference to this node's first child node. `null` if this node has no children.
153
+ */
154
+
155
+ /**
156
+ * @property childNodes
157
+ * An array of this nodes children. Array will be empty if this node has no chidren.
158
+ */
159
+
160
+ statics: {
161
+ /**
162
+ * This method allows you to decorate a Model's class to implement the NodeInterface.
163
+ * This adds a set of methods, new events, new properties and new fields on every Record.
164
+ * @param {Ext.Class/Ext.data.Model} modelClass The Model class or an instance of the Model class you want to
165
+ * decorate the prototype of.
166
+ * @static
167
+ */
168
+ decorate: function(modelClass) {
169
+ var idName, idType;
170
+
171
+ // get the reference to the model class, in case the argument was a string or a record
172
+ if (typeof modelClass == 'string') {
173
+ modelClass = Ext.ModelManager.getModel(modelClass);
174
+ } else if (modelClass.isModel) {
175
+ modelClass = Ext.ModelManager.getModel(modelClass.modelName);
176
+ }
177
+
178
+ // avoid unnecessary work in case the model was already decorated
179
+ if (modelClass.prototype.isNode) {
180
+ return;
181
+ }
182
+
183
+ idName = modelClass.prototype.idProperty;
184
+ idType = modelClass.prototype.fields.get(idName).type.type;
185
+ modelClass.override(this.getPrototypeBody());
186
+ this.applyFields(modelClass, [
187
+ {name: 'parentId', type: idType, defaultValue: null},
188
+ {name: 'index', type: 'int', defaultValue: null, persist: false},
189
+ {name: 'depth', type: 'int', defaultValue: 0, persist: false},
190
+ {name: 'expanded', type: 'bool', defaultValue: false, persist: false},
191
+ {name: 'expandable', type: 'bool', defaultValue: true, persist: false},
192
+ {name: 'checked', type: 'auto', defaultValue: null, persist: false},
193
+ {name: 'leaf', type: 'bool', defaultValue: false},
194
+ {name: 'cls', type: 'string', defaultValue: null, persist: false},
195
+ {name: 'iconCls', type: 'string', defaultValue: null, persist: false},
196
+ {name: 'icon', type: 'string', defaultValue: null, persist: false},
197
+ {name: 'root', type: 'boolean', defaultValue: false, persist: false},
198
+ {name: 'isLast', type: 'boolean', defaultValue: false, persist: false},
199
+ {name: 'isFirst', type: 'boolean', defaultValue: false, persist: false},
200
+ {name: 'allowDrop', type: 'boolean', defaultValue: true, persist: false},
201
+ {name: 'allowDrag', type: 'boolean', defaultValue: true, persist: false},
202
+ {name: 'loaded', type: 'boolean', defaultValue: false, persist: false},
203
+ {name: 'loading', type: 'boolean', defaultValue: false, persist: false},
204
+ {name: 'href', type: 'string', defaultValue: null, persist: false},
205
+ {name: 'hrefTarget', type: 'string', defaultValue: null, persist: false},
206
+ {name: 'qtip', type: 'string', defaultValue: null, persist: false},
207
+ {name: 'qtitle', type: 'string', defaultValue: null, persist: false},
208
+ {name: 'children', type: 'auto', defaultValue: null, persist: false}
209
+ ]);
210
+ },
211
+
212
+ applyFields: function(modelClass, addFields) {
213
+ var modelPrototype = modelClass.prototype,
214
+ fields = modelPrototype.fields,
215
+ keys = fields.keys,
216
+ ln = addFields.length,
217
+ addField, i;
218
+
219
+ for (i = 0; i < ln; i++) {
220
+ addField = addFields[i];
221
+ if (!Ext.Array.contains(keys, addField.name)) {
222
+ fields.add(new Ext.data.Field(addField));
223
+ }
224
+ }
225
+
226
+ },
227
+
228
+ getPrototypeBody: function() {
229
+ return {
230
+ /**
231
+ * @property {Boolean} isNode
232
+ * `true` in this class to identify an object as an instantiated Node, or subclass thereof.
233
+ */
234
+ isNode: true,
235
+
236
+ constructor: function() {
237
+ var me = this;
238
+ this.callParent(arguments);
239
+ Ext.applyIf(me, {
240
+ firstChild: null,
241
+ lastChild: null,
242
+ parentNode: null,
243
+ previousSibling: null,
244
+ nextSibling: null,
245
+ childNodes: []
246
+ });
247
+ me.enableBubble([
248
+ /**
249
+ * @event append
250
+ * Fires when a new child node is appended
251
+ * @param {Ext.data.NodeInterface} this This node
252
+ * @param {Ext.data.NodeInterface} node The newly appended node
253
+ * @param {Number} index The index of the newly appended node
254
+ */
255
+ "append",
256
+
257
+ /**
258
+ * @event remove
259
+ * Fires when a child node is removed
260
+ * @param {Ext.data.NodeInterface} this This node
261
+ * @param {Ext.data.NodeInterface} node The removed node
262
+ * @param {Boolean} isMove `true` if the child node is being removed so it can be moved to another position in the tree.
263
+ * (a side effect of calling {@link #appendChild} or {@link #insertBefore} with a node that already has a parentNode
264
+ */
265
+ "remove",
266
+
267
+ /**
268
+ * @event move
269
+ * Fires when this node is moved to a new location in the tree
270
+ * @param {Ext.data.NodeInterface} this This node
271
+ * @param {Ext.data.NodeInterface} oldParent The old parent of this node
272
+ * @param {Ext.data.NodeInterface} newParent The new parent of this node
273
+ * @param {Number} index The index it was moved to
274
+ */
275
+ "move",
276
+
277
+ /**
278
+ * @event insert
279
+ * Fires when a new child node is inserted.
280
+ * @param {Ext.data.NodeInterface} this This node
281
+ * @param {Ext.data.NodeInterface} node The child node inserted
282
+ * @param {Ext.data.NodeInterface} refNode The child node the node was inserted before
283
+ */
284
+ "insert",
285
+
286
+ /**
287
+ * @event beforeappend
288
+ * Fires before a new child is appended, return false to cancel the append.
289
+ * @param {Ext.data.NodeInterface} this This node
290
+ * @param {Ext.data.NodeInterface} node The child node to be appended
291
+ */
292
+ "beforeappend",
293
+
294
+ /**
295
+ * @event beforeremove
296
+ * Fires before a child is removed, return false to cancel the remove.
297
+ * @param {Ext.data.NodeInterface} this This node
298
+ * @param {Ext.data.NodeInterface} node The child node to be removed
299
+ * @param {Boolean} isMove `true` if the child node is being removed so it can be moved to another position in the tree.
300
+ * (a side effect of calling {@link #appendChild} or {@link #insertBefore} with a node that already has a parentNode
301
+ */
302
+ "beforeremove",
303
+
304
+ /**
305
+ * @event beforemove
306
+ * Fires before this node is moved to a new location in the tree. Return false to cancel the move.
307
+ * @param {Ext.data.NodeInterface} this This node
308
+ * @param {Ext.data.NodeInterface} oldParent The parent of this node
309
+ * @param {Ext.data.NodeInterface} newParent The new parent this node is moving to
310
+ * @param {Number} index The index it is being moved to
311
+ */
312
+ "beforemove",
313
+
314
+ /**
315
+ * @event beforeinsert
316
+ * Fires before a new child is inserted, return false to cancel the insert.
317
+ * @param {Ext.data.NodeInterface} this This node
318
+ * @param {Ext.data.NodeInterface} node The child node to be inserted
319
+ * @param {Ext.data.NodeInterface} refNode The child node the node is being inserted before
320
+ */
321
+ "beforeinsert",
322
+
323
+ /**
324
+ * @event expand
325
+ * Fires when this node is expanded.
326
+ * @param {Ext.data.NodeInterface} this The expanding node
327
+ */
328
+ "expand",
329
+
330
+ /**
331
+ * @event collapse
332
+ * Fires when this node is collapsed.
333
+ * @param {Ext.data.NodeInterface} this The collapsing node
334
+ */
335
+ "collapse",
336
+
337
+ /**
338
+ * @event beforeexpand
339
+ * Fires before this node is expanded.
340
+ * @param {Ext.data.NodeInterface} this The expanding node
341
+ */
342
+ "beforeexpand",
343
+
344
+ /**
345
+ * @event beforecollapse
346
+ * Fires before this node is collapsed.
347
+ * @param {Ext.data.NodeInterface} this The collapsing node
348
+ */
349
+ "beforecollapse",
350
+
351
+ /**
352
+ * @event sort
353
+ * Fires when this node's childNodes are sorted.
354
+ * @param {Ext.data.NodeInterface} this This node.
355
+ * @param {Ext.data.NodeInterface[]} childNodes The childNodes of this node.
356
+ */
357
+ "sort"
358
+ ]);
359
+ return me;
360
+ },
361
+ /**
362
+ * Ensures that the passed object is an instance of a Record with the NodeInterface applied
363
+ * @return {Boolean}
364
+ */
365
+ createNode: function(node) {
366
+ if (Ext.isObject(node) && !node.isModel) {
367
+ node = Ext.ModelManager.create(node, this.modelName);
368
+ }
369
+ return node;
370
+ },
371
+
372
+ /**
373
+ * Returns true if this node is a leaf
374
+ * @return {Boolean}
375
+ */
376
+ isLeaf : function() {
377
+ return this.get('leaf') === true;
378
+ },
379
+
380
+ /**
381
+ * Sets the first child of this node
382
+ * @private
383
+ * @param {Ext.data.NodeInterface} node
384
+ */
385
+ setFirstChild : function(node) {
386
+ this.firstChild = node;
387
+ },
388
+
389
+ /**
390
+ * Sets the last child of this node
391
+ * @private
392
+ * @param {Ext.data.NodeInterface} node
393
+ */
394
+ setLastChild : function(node) {
395
+ this.lastChild = node;
396
+ },
397
+
398
+ /**
399
+ * Updates general data of this node like isFirst, isLast, depth. This
400
+ * method is internally called after a node is moved. This shouldn't
401
+ * have to be called by the developer unless they are creating custom
402
+ * Tree plugins.
403
+ * @return {Boolean}
404
+ */
405
+ updateInfo: function(commit) {
406
+ var me = this,
407
+ isRoot = me.isRoot(),
408
+ parentNode = me.parentNode,
409
+ isFirst = (!parentNode || isRoot ? true : parentNode.firstChild === me),
410
+ isLast = (!parentNode || isRoot ? true : parentNode.lastChild === me),
411
+ depth = 0,
412
+ parent = me,
413
+ children = me.childNodes,
414
+ len = children.length,
415
+ i = 0,
416
+ phantom = me.phantom;
417
+
418
+ while (parent.parentNode) {
419
+ ++depth;
420
+ parent = parent.parentNode;
421
+ }
422
+
423
+ me.beginEdit();
424
+ me.set({
425
+ isFirst: isFirst,
426
+ isLast: isLast,
427
+ depth: depth,
428
+ index: parentNode ? parentNode.indexOf(me) : 0,
429
+ parentId: parentNode ? parentNode.getId() : null
430
+ });
431
+ me.endEdit(true);
432
+ if (commit) {
433
+ me.commit();
434
+ me.phantom = phantom;
435
+ }
436
+
437
+ for (i = 0; i < len; i++) {
438
+ children[i].updateInfo(commit);
439
+ }
440
+ },
441
+
442
+ /**
443
+ * Returns true if this node is the last child of its parent
444
+ * @return {Boolean}
445
+ */
446
+ isLast : function() {
447
+ return this.get('isLast');
448
+ },
449
+
450
+ /**
451
+ * Returns true if this node is the first child of its parent
452
+ * @return {Boolean}
453
+ */
454
+ isFirst : function() {
455
+ return this.get('isFirst');
456
+ },
457
+
458
+ /**
459
+ * Returns true if this node has one or more child nodes, else false.
460
+ * @return {Boolean}
461
+ */
462
+ hasChildNodes : function() {
463
+ return !this.isLeaf() && this.childNodes.length > 0;
464
+ },
465
+
466
+ /**
467
+ * Returns true if this node has one or more child nodes, or if the <tt>expandable</tt>
468
+ * node attribute is explicitly specified as true, otherwise returns false.
469
+ * @return {Boolean}
470
+ */
471
+ isExpandable : function() {
472
+ var me = this;
473
+
474
+ if (me.get('expandable')) {
475
+ return !(me.isLeaf() || (me.isLoaded() && !me.hasChildNodes()));
476
+ }
477
+ return false;
478
+ },
479
+
480
+ /**
481
+ * Inserts node(s) as the last child node of this node.
482
+ *
483
+ * If the node was previously a child node of another parent node, it will be removed from that node first.
484
+ *
485
+ * @param {Ext.data.NodeInterface/Ext.data.NodeInterface[]} node The node or Array of nodes to append
486
+ * @return {Ext.data.NodeInterface} The appended node if single append, or null if an array was passed
487
+ */
488
+ appendChild : function(node, suppressEvents, commit) {
489
+ var me = this,
490
+ i, ln,
491
+ index,
492
+ oldParent,
493
+ ps;
494
+
495
+ // if passed an array do them one by one
496
+ if (Ext.isArray(node)) {
497
+ // suspend auto syncing while we append all the nodes
498
+ me.callStore('suspendAutoSync');
499
+ for (i = 0, ln = node.length - 1; i < ln; i++) {
500
+ me.appendChild(node[i]);
501
+ }
502
+ // resume auto syncing before we append the last node
503
+ me.callStore('resumeAutoSync');
504
+ me.appendChild(node[ln]);
505
+ } else {
506
+ // Make sure it is a record
507
+ node = me.createNode(node);
508
+
509
+ if (suppressEvents !== true && (!me.hasListeners.beforeappend || me.fireEvent("beforeappend", me, node) === false)) {
510
+ return false;
511
+ }
512
+
513
+ index = me.childNodes.length;
514
+ oldParent = node.parentNode;
515
+
516
+ // it's a move, make sure we move it cleanly
517
+ if (oldParent) {
518
+ if (suppressEvents !== true && (!me.hasListeners.beforeremove || node.fireEvent("beforemove", node, oldParent, me, index) === false)) {
519
+ return false;
520
+ }
521
+ oldParent.removeChild(node, false, false, true);
522
+ }
523
+
524
+ index = me.childNodes.length;
525
+ if (index === 0) {
526
+ me.setFirstChild(node);
527
+ }
528
+
529
+ me.childNodes.push(node);
530
+ node.parentNode = me;
531
+ node.nextSibling = null;
532
+
533
+ me.setLastChild(node);
534
+
535
+ ps = me.childNodes[index - 1];
536
+ if (ps) {
537
+ node.previousSibling = ps;
538
+ ps.nextSibling = node;
539
+ ps.updateInfo(commit);
540
+ } else {
541
+ node.previousSibling = null;
542
+ }
543
+
544
+ node.updateInfo(commit);
545
+
546
+ // As soon as we append a child to this node, we are loaded
547
+ if (!me.isLoaded()) {
548
+ me.set('loaded', true);
549
+ } else if (me.childNodes.length === 1) {
550
+ // This isn't ideal, however none of the underlying fields have changed
551
+ // but we still need to update the UI
552
+ me.afterEdit([]);
553
+ }
554
+
555
+ if(!node.isLeaf() && node.phantom) {
556
+ node.set('loaded', true);
557
+ }
558
+
559
+ if (suppressEvents !== true) {
560
+ me.fireEvent("append", me, node, index);
561
+
562
+ if (oldParent) {
563
+ node.fireEvent("move", node, oldParent, me, index);
564
+ }
565
+ }
566
+
567
+ return node;
568
+ }
569
+ },
570
+
571
+ /**
572
+ * Returns the bubble target for this node
573
+ * @private
574
+ * @return {Object} The bubble target
575
+ */
576
+ getBubbleTarget: function() {
577
+ return this.parentNode;
578
+ },
579
+
580
+ /**
581
+ * Removes a child node from this node.
582
+ * @param {Ext.data.NodeInterface} node The node to remove
583
+ * @param {Boolean} [destroy=false] True to destroy the node upon removal.
584
+ * @return {Ext.data.NodeInterface} The removed node
585
+ */
586
+ removeChild : function(node, destroy, suppressEvents, isMove) {
587
+ var me = this,
588
+ index = me.indexOf(node),
589
+ i, childCount;
590
+
591
+ if (index == -1 || (suppressEvents !== true && (!me.hasListeners.beforeremove || me.fireEvent("beforeremove", me, node, !!isMove) === false))) {
592
+ return false;
593
+ }
594
+
595
+ // remove it from childNodes collection
596
+ Ext.Array.erase(me.childNodes, index, 1);
597
+
598
+ // update child refs
599
+ if (me.firstChild == node) {
600
+ me.setFirstChild(node.nextSibling);
601
+ }
602
+ if (me.lastChild == node) {
603
+ me.setLastChild(node.previousSibling);
604
+ }
605
+
606
+ // update siblings
607
+ if (node.previousSibling) {
608
+ node.previousSibling.nextSibling = node.nextSibling;
609
+ }
610
+ if (node.nextSibling) {
611
+ node.nextSibling.previousSibling = node.previousSibling;
612
+ }
613
+
614
+ // update the info for all siblings starting at the index before the node's old index (or 0 if the removed node was the firstChild)
615
+ for(i = index > 0 ? index - 1 : 0, childCount = me.childNodes.length; i < childCount; i++) {
616
+ me.childNodes[i].updateInfo();
617
+ }
618
+
619
+ // If this node suddenly doesnt have childnodes anymore, update myself
620
+ if (!me.childNodes.length) {
621
+ me.set('loaded', me.isLoaded());
622
+ }
623
+
624
+ if (suppressEvents !== true) {
625
+ if (me.hasListeners.remove) {
626
+ me.fireEvent("remove", me, node, !!isMove);
627
+ }
628
+ }
629
+
630
+ if (destroy) {
631
+ node.destroy(true);
632
+ } else {
633
+ node.clear();
634
+ }
635
+
636
+ return node;
637
+ },
638
+
639
+ /**
640
+ * Creates a copy (clone) of this Node.
641
+ * @param {String} [id] A new id, defaults to this Node's id.
642
+ * @param {Boolean} [deep=false] True to recursively copy all child Nodes into the new Node.
643
+ * False to copy without child Nodes.
644
+ * @return {Ext.data.NodeInterface} A copy of this Node.
645
+ */
646
+ copy: function(newId, deep) {
647
+ var me = this,
648
+ result = me.callOverridden(arguments),
649
+ len = me.childNodes ? me.childNodes.length : 0,
650
+ i;
651
+
652
+ // Move child nodes across to the copy if required
653
+ if (deep) {
654
+ for (i = 0; i < len; i++) {
655
+ result.appendChild(me.childNodes[i].copy(true));
656
+ }
657
+ }
658
+ return result;
659
+ },
660
+
661
+ /**
662
+ * Clears the node.
663
+ * @private
664
+ * @param {Boolean} [destroy=false] True to destroy the node.
665
+ */
666
+ clear : function(destroy) {
667
+ var me = this;
668
+
669
+ // clear any references from the node
670
+ me.parentNode = me.previousSibling = me.nextSibling = null;
671
+ if (destroy) {
672
+ me.firstChild = me.lastChild = null;
673
+ }
674
+ },
675
+
676
+ /**
677
+ * Destroys the node.
678
+ */
679
+ destroy : function(silent) {
680
+ /*
681
+ * Silent is to be used in a number of cases
682
+ * 1) When setRoot is called.
683
+ * 2) When destroy on the tree is called
684
+ * 3) For destroying child nodes on a node
685
+ */
686
+ var me = this,
687
+ options = me.destroyOptions,
688
+ nodes = me.childNodes,
689
+ nLen = nodes.length,
690
+ n;
691
+
692
+ if (silent === true) {
693
+ me.clear(true);
694
+
695
+ for (n = 0; n < nLen; n++) {
696
+ nodes[n].destroy(true);
697
+ }
698
+
699
+ me.childNodes = null;
700
+ delete me.destroyOptions;
701
+ me.callOverridden([options]);
702
+ } else {
703
+ me.destroyOptions = silent;
704
+ // overridden method will be called, since remove will end up calling destroy(true);
705
+ me.remove(true);
706
+ }
707
+ },
708
+
709
+ /**
710
+ * Inserts the first node before the second node in this nodes childNodes collection.
711
+ * @param {Ext.data.NodeInterface} node The node to insert
712
+ * @param {Ext.data.NodeInterface} refNode The node to insert before (if null the node is appended)
713
+ * @return {Ext.data.NodeInterface} The inserted node
714
+ */
715
+ insertBefore : function(node, refNode, suppressEvents) {
716
+ var me = this,
717
+ index = me.indexOf(refNode),
718
+ oldParent = node.parentNode,
719
+ refIndex = index,
720
+ childCount, ps, i;
721
+
722
+ if (!refNode) { // like standard Dom, refNode can be null for append
723
+ return me.appendChild(node);
724
+ }
725
+
726
+ // nothing to do
727
+ if (node == refNode) {
728
+ return false;
729
+ }
730
+
731
+ // Make sure it is a record with the NodeInterface
732
+ node = me.createNode(node);
733
+
734
+ if (suppressEvents !== true && (!me.hasListeners.beforeinsert || me.fireEvent("beforeinsert", me, node, refNode) === false)) {
735
+ return false;
736
+ }
737
+
738
+ // when moving internally, indexes will change after remove
739
+ if (oldParent == me && me.indexOf(node) < index) {
740
+ refIndex--;
741
+ }
742
+
743
+ // it's a move, make sure we move it cleanly
744
+ if (oldParent) {
745
+ if (suppressEvents !== true && (!me.hasListeners.beforeremove || node.fireEvent("beforemove", node, oldParent, me, index, refNode) === false)) {
746
+ return false;
747
+ }
748
+ oldParent.removeChild(node, false, false, true);
749
+ }
750
+
751
+ if (refIndex === 0) {
752
+ me.setFirstChild(node);
753
+ }
754
+
755
+ Ext.Array.splice(me.childNodes, refIndex, 0, node);
756
+ node.parentNode = me;
757
+
758
+ node.nextSibling = refNode;
759
+ refNode.previousSibling = node;
760
+
761
+ ps = me.childNodes[refIndex - 1];
762
+ if (ps) {
763
+ node.previousSibling = ps;
764
+ ps.nextSibling = node;
765
+ } else {
766
+ node.previousSibling = null;
767
+ }
768
+
769
+ // update the info for all siblings starting at the index before the node's insertion point (or 0 if the inserted node is the firstChild)
770
+ for(i = refIndex > 0 ? refIndex - 1 : 0, childCount = me.childNodes.length; i < childCount; i++) {
771
+ me.childNodes[i].updateInfo();
772
+ }
773
+
774
+ if (!me.isLoaded()) {
775
+ me.set('loaded', true);
776
+ }
777
+ // If this node didnt have any childnodes before, update myself
778
+ else if (me.childNodes.length === 1) {
779
+ me.set('loaded', me.isLoaded());
780
+ }
781
+
782
+ if(!node.isLeaf() && node.phantom) {
783
+ node.set('loaded', true);
784
+ }
785
+
786
+ if (suppressEvents !== true) {
787
+ if (me.hasListeners.insert) {
788
+ me.fireEvent("insert", me, node, refNode);
789
+ }
790
+
791
+ if (oldParent && me.hasListeners.move) {
792
+ node.fireEvent("move", node, oldParent, me, refIndex, refNode);
793
+ }
794
+ }
795
+
796
+ return node;
797
+ },
798
+
799
+ /**
800
+ * Insert a node into this node
801
+ * @param {Number} index The zero-based index to insert the node at
802
+ * @param {Ext.data.Model} node The node to insert
803
+ * @return {Ext.data.Model} The record you just inserted
804
+ */
805
+ insertChild: function(index, node) {
806
+ var sibling = this.childNodes[index];
807
+ if (sibling) {
808
+ return this.insertBefore(node, sibling);
809
+ }
810
+ else {
811
+ return this.appendChild(node);
812
+ }
813
+ },
814
+
815
+ /**
816
+ * Removes this node from its parent
817
+ * @param {Boolean} [destroy=false] True to destroy the node upon removal.
818
+ * @return {Ext.data.NodeInterface} this
819
+ */
820
+ remove : function(destroy, suppressEvents) {
821
+ var parentNode = this.parentNode;
822
+
823
+ if (parentNode) {
824
+ parentNode.removeChild(this, destroy, suppressEvents);
825
+ }
826
+ return this;
827
+ },
828
+
829
+ /**
830
+ * Removes all child nodes from this node.
831
+ * @param {Boolean} [destroy=false] <True to destroy the node upon removal.
832
+ * @return {Ext.data.NodeInterface} this
833
+ */
834
+ removeAll : function(destroy, suppressEvents) {
835
+ var cn = this.childNodes,
836
+ n;
837
+
838
+ while ((n = cn[0])) {
839
+ this.removeChild(n, destroy, suppressEvents);
840
+ }
841
+ return this;
842
+ },
843
+
844
+ /**
845
+ * Returns the child node at the specified index.
846
+ * @param {Number} index
847
+ * @return {Ext.data.NodeInterface}
848
+ */
849
+ getChildAt : function(index) {
850
+ return this.childNodes[index];
851
+ },
852
+
853
+ /**
854
+ * Replaces one child node in this node with another.
855
+ * @param {Ext.data.NodeInterface} newChild The replacement node
856
+ * @param {Ext.data.NodeInterface} oldChild The node to replace
857
+ * @return {Ext.data.NodeInterface} The replaced node
858
+ */
859
+ replaceChild : function(newChild, oldChild, suppressEvents) {
860
+ var s = oldChild ? oldChild.nextSibling : null;
861
+
862
+ this.removeChild(oldChild, false, suppressEvents);
863
+ this.insertBefore(newChild, s, suppressEvents);
864
+ return oldChild;
865
+ },
866
+
867
+ /**
868
+ * Returns the index of a child node
869
+ * @param {Ext.data.NodeInterface} node
870
+ * @return {Number} The index of the node or -1 if it was not found
871
+ */
872
+ indexOf : function(child) {
873
+ return Ext.Array.indexOf(this.childNodes, child);
874
+ },
875
+
876
+ /**
877
+ * Returns the index of a child node that matches the id
878
+ * @param {String} id The id of the node to find
879
+ * @return {Number} The index of the node or -1 if it was not found
880
+ */
881
+ indexOfId: function(id) {
882
+ var childNodes = this.childNodes,
883
+ len = childNodes.length,
884
+ i = 0;
885
+
886
+ for (; i < len; ++i) {
887
+ if (childNodes[i].getId() === id) {
888
+ return i;
889
+ }
890
+ }
891
+ return -1;
892
+ },
893
+
894
+ /**
895
+ * Gets the hierarchical path from the root of the current node.
896
+ * @param {String} [field] The field to construct the path from. Defaults to the model idProperty.
897
+ * @param {String} [separator="/"] A separator to use.
898
+ * @return {String} The node path
899
+ */
900
+ getPath: function(field, separator) {
901
+ field = field || this.idProperty;
902
+ separator = separator || '/';
903
+
904
+ var path = [this.get(field)],
905
+ parent = this.parentNode;
906
+
907
+ while (parent) {
908
+ path.unshift(parent.get(field));
909
+ parent = parent.parentNode;
910
+ }
911
+ return separator + path.join(separator);
912
+ },
913
+
914
+ /**
915
+ * Returns depth of this node (the root node has a depth of 0)
916
+ * @return {Number}
917
+ */
918
+ getDepth : function() {
919
+ return this.get('depth');
920
+ },
921
+
922
+ /**
923
+ * Bubbles up the tree from this node, calling the specified function with each node. The arguments to the function
924
+ * will be the args provided or the current node. If the function returns false at any point,
925
+ * the bubble is stopped.
926
+ * @param {Function} fn The function to call
927
+ * @param {Object} [scope] The scope (this reference) in which the function is executed. Defaults to the current Node.
928
+ * @param {Array} [args] The args to call the function with. Defaults to passing the current Node.
929
+ */
930
+ bubble : function(fn, scope, args) {
931
+ var p = this;
932
+ while (p) {
933
+ if (fn.apply(scope || p, args || [p]) === false) {
934
+ break;
935
+ }
936
+ p = p.parentNode;
937
+ }
938
+ },
939
+
940
+ //<deprecated since=0.99>
941
+ cascade: function() {
942
+ if (Ext.isDefined(Ext.global.console)) {
943
+ Ext.global.console.warn('Ext.data.Node: cascade has been deprecated. Please use cascadeBy instead.');
944
+ }
945
+ return this.cascadeBy.apply(this, arguments);
946
+ },
947
+ //</deprecated>
948
+
949
+ /**
950
+ * Cascades down the tree from this node, calling the specified function with each node. The arguments to the function
951
+ * will be the args provided or the current node. If the function returns false at any point,
952
+ * the cascade is stopped on that branch.
953
+ * @param {Function} fn The function to call
954
+ * @param {Object} [scope] The scope (this reference) in which the function is executed. Defaults to the current Node.
955
+ * @param {Array} [args] The args to call the function with. Defaults to passing the current Node.
956
+ */
957
+ cascadeBy : function(fn, scope, args) {
958
+ if (fn.apply(scope || this, args || [this]) !== false) {
959
+ var childNodes = this.childNodes,
960
+ length = childNodes.length,
961
+ i;
962
+
963
+ for (i = 0; i < length; i++) {
964
+ childNodes[i].cascadeBy(fn, scope, args);
965
+ }
966
+ }
967
+ },
968
+
969
+ /**
970
+ * Interates the child nodes of this node, calling the specified function with each node. The arguments to the function
971
+ * will be the args provided or the current node. If the function returns false at any point,
972
+ * the iteration stops.
973
+ * @param {Function} fn The function to call
974
+ * @param {Object} [scope] The scope (this reference) in which the function is executed. Defaults to the current Node in iteration.
975
+ * @param {Array} [args] The args to call the function with. Defaults to passing the current Node.
976
+ */
977
+ eachChild : function(fn, scope, args) {
978
+ var childNodes = this.childNodes,
979
+ length = childNodes.length,
980
+ i;
981
+
982
+ for (i = 0; i < length; i++) {
983
+ if (fn.apply(scope || this, args || [childNodes[i]]) === false) {
984
+ break;
985
+ }
986
+ }
987
+ },
988
+
989
+ /**
990
+ * Finds the first child that has the attribute with the specified value.
991
+ * @param {String} attribute The attribute name
992
+ * @param {Object} value The value to search for
993
+ * @param {Boolean} [deep=false] True to search through nodes deeper than the immediate children
994
+ * @return {Ext.data.NodeInterface} The found child or null if none was found
995
+ */
996
+ findChild : function(attribute, value, deep) {
997
+ return this.findChildBy(function() {
998
+ return this.get(attribute) == value;
999
+ }, null, deep);
1000
+ },
1001
+
1002
+ /**
1003
+ * Finds the first child by a custom function. The child matches if the function passed returns true.
1004
+ * @param {Function} fn A function which must return true if the passed Node is the required Node.
1005
+ * @param {Object} [scope] The scope (this reference) in which the function is executed. Defaults to the Node being tested.
1006
+ * @param {Boolean} [deep=false] True to search through nodes deeper than the immediate children
1007
+ * @return {Ext.data.NodeInterface} The found child or null if none was found
1008
+ */
1009
+ findChildBy : function(fn, scope, deep) {
1010
+ var cs = this.childNodes,
1011
+ len = cs.length,
1012
+ i = 0, n, res;
1013
+
1014
+ for (; i < len; i++) {
1015
+ n = cs[i];
1016
+ if (fn.call(scope || n, n) === true) {
1017
+ return n;
1018
+ }
1019
+ else if (deep) {
1020
+ res = n.findChildBy(fn, scope, deep);
1021
+ if (res !== null) {
1022
+ return res;
1023
+ }
1024
+ }
1025
+ }
1026
+
1027
+ return null;
1028
+ },
1029
+
1030
+ /**
1031
+ * Returns true if this node is an ancestor (at any point) of the passed node.
1032
+ * @param {Ext.data.NodeInterface} node
1033
+ * @return {Boolean}
1034
+ */
1035
+ contains : function(node) {
1036
+ return node.isAncestor(this);
1037
+ },
1038
+
1039
+ /**
1040
+ * Returns true if the passed node is an ancestor (at any point) of this node.
1041
+ * @param {Ext.data.NodeInterface} node
1042
+ * @return {Boolean}
1043
+ */
1044
+ isAncestor : function(node) {
1045
+ var p = this.parentNode;
1046
+ while (p) {
1047
+ if (p == node) {
1048
+ return true;
1049
+ }
1050
+ p = p.parentNode;
1051
+ }
1052
+ return false;
1053
+ },
1054
+
1055
+ /**
1056
+ * Sorts this nodes children using the supplied sort function.
1057
+ * @param {Function} fn A function which, when passed two Nodes, returns -1, 0 or 1 depending upon required sort order.
1058
+ * @param {Boolean} [recursive=false] True to apply this sort recursively
1059
+ * @param {Boolean} [suppressEvent=false] True to not fire a sort event.
1060
+ */
1061
+ sort : function(sortFn, recursive, suppressEvent) {
1062
+ var cs = this.childNodes,
1063
+ ln = cs.length,
1064
+ i, n;
1065
+
1066
+ if (ln > 0) {
1067
+ Ext.Array.sort(cs, sortFn);
1068
+ for (i = 0; i < ln; i++) {
1069
+ n = cs[i];
1070
+ n.previousSibling = cs[i-1];
1071
+ n.nextSibling = cs[i+1];
1072
+
1073
+ if (i === 0) {
1074
+ this.setFirstChild(n);
1075
+ }
1076
+ if (i == ln - 1) {
1077
+ this.setLastChild(n);
1078
+ }
1079
+ n.updateInfo();
1080
+ if (recursive && !n.isLeaf()) {
1081
+ n.sort(sortFn, true, true);
1082
+ }
1083
+ }
1084
+
1085
+ if (suppressEvent !== true) {
1086
+ this.fireEvent('sort', this, cs);
1087
+ }
1088
+ }
1089
+ },
1090
+
1091
+ /**
1092
+ * Returns true if this node is expaned
1093
+ * @return {Boolean}
1094
+ */
1095
+ isExpanded: function() {
1096
+ return this.get('expanded');
1097
+ },
1098
+
1099
+ /**
1100
+ * Returns true if this node is loaded
1101
+ * @return {Boolean}
1102
+ */
1103
+ isLoaded: function() {
1104
+ return this.get('loaded');
1105
+ },
1106
+
1107
+ /**
1108
+ * Returns true if this node is loading
1109
+ * @return {Boolean}
1110
+ */
1111
+ isLoading: function() {
1112
+ return this.get('loading');
1113
+ },
1114
+
1115
+ /**
1116
+ * Returns true if this node is the root node
1117
+ * @return {Boolean}
1118
+ */
1119
+ isRoot: function() {
1120
+ return !this.parentNode;
1121
+ },
1122
+
1123
+ /**
1124
+ * Returns true if this node is visible
1125
+ * @return {Boolean}
1126
+ */
1127
+ isVisible: function() {
1128
+ var parent = this.parentNode;
1129
+ while (parent) {
1130
+ if (!parent.isExpanded()) {
1131
+ return false;
1132
+ }
1133
+ parent = parent.parentNode;
1134
+ }
1135
+ return true;
1136
+ },
1137
+
1138
+ /**
1139
+ * Expand this node.
1140
+ * @param {Boolean} [recursive=false] True to recursively expand all the children
1141
+ * @param {Function} [callback] The function to execute once the expand completes
1142
+ * @param {Object} [scope] The scope to run the callback in
1143
+ */
1144
+ expand: function(recursive, callback, scope) {
1145
+ var me = this;
1146
+
1147
+ // all paths must call the callback (eventually) or things like
1148
+ // selectPath fail
1149
+
1150
+ // First we start by checking if this node is a parent
1151
+ if (!me.isLeaf()) {
1152
+ // If it's loaded, wait until it loads before proceeding
1153
+ if (me.isLoading()) {
1154
+ me.on('expand', function(){
1155
+ me.expand(recursive, callback, scope);
1156
+ }, me, {single: true});
1157
+ } else {
1158
+ // Now we check if this record is already expanding or expanded
1159
+ if (!me.isExpanded()) {
1160
+ // The TreeStore actually listens for the beforeexpand method and checks
1161
+ // whether we have to asynchronously load the children from the server
1162
+ // first. Thats why we pass a callback function to the event that the
1163
+ // store can call once it has loaded and parsed all the children.
1164
+ me.fireEvent('beforeexpand', me, function() {
1165
+ me.set('expanded', true);
1166
+ if (me.hasListeners.expand) {
1167
+ me.fireEvent('expand', me, me.childNodes, false);
1168
+ }
1169
+
1170
+ // Call the expandChildren method if recursive was set to true
1171
+ if (recursive) {
1172
+ me.expandChildren(true, callback, scope);
1173
+ } else {
1174
+ Ext.callback(callback, scope || me, [me.childNodes]);
1175
+ }
1176
+ }, me);
1177
+ } else if (recursive) {
1178
+ // If it is is already expanded but we want to recursively expand then call expandChildren
1179
+ me.expandChildren(true, callback, scope);
1180
+ } else {
1181
+ Ext.callback(callback, scope || me, [me.childNodes]);
1182
+ }
1183
+ }
1184
+ } else {
1185
+ // If it's not then we fire the callback right away
1186
+ Ext.callback(callback, scope || me); // leaf = no childNodes
1187
+ }
1188
+ },
1189
+
1190
+ /**
1191
+ * Expand all the children of this node.
1192
+ * @param {Boolean} [recursive=false] True to recursively expand all the children
1193
+ * @param {Function} [callback] The function to execute once all the children are expanded
1194
+ * @param {Object} [scope] The scope to run the callback in
1195
+ */
1196
+ expandChildren: function(recursive, callback, scope) {
1197
+ var me = this,
1198
+ i = 0,
1199
+ nodes = me.childNodes,
1200
+ ln = nodes.length,
1201
+ node,
1202
+ expanding = 0;
1203
+
1204
+ for (; i < ln; ++i) {
1205
+ node = nodes[i];
1206
+ if (!node.isLeaf() && !node.isExpanded()) {
1207
+ expanding++;
1208
+ nodes[i].expand(recursive, function () {
1209
+ expanding--;
1210
+ if (callback && !expanding) {
1211
+ Ext.callback(callback, scope || me, [me.childNodes]);
1212
+ }
1213
+ });
1214
+ }
1215
+ }
1216
+
1217
+ if (!expanding && callback) {
1218
+ Ext.callback(callback, scope || me, [me.childNodes]); }
1219
+ },
1220
+
1221
+ /**
1222
+ * Collapse this node.
1223
+ * @param {Boolean} [recursive=false] True to recursively collapse all the children
1224
+ * @param {Function} [callback] The function to execute once the collapse completes
1225
+ * @param {Object} [scope] The scope to run the callback in
1226
+ */
1227
+ collapse: function(recursive, callback, scope) {
1228
+ var me = this;
1229
+
1230
+ // First we start by checking if this node is a parent
1231
+ if (!me.isLeaf()) {
1232
+ // Now we check if this record is already collapsing or collapsed
1233
+ if (!me.collapsing && me.isExpanded()) {
1234
+ me.fireEvent('beforecollapse', me, function() {
1235
+ me.set('expanded', false);
1236
+ if (me.hasListeners.collapse) {
1237
+ me.fireEvent('collapse', me, me.childNodes, false);
1238
+ }
1239
+
1240
+ // Call the collapseChildren method if recursive was set to true
1241
+ if (recursive) {
1242
+ me.collapseChildren(true, callback, scope);
1243
+ }
1244
+ else {
1245
+ Ext.callback(callback, scope || me, [me.childNodes]);
1246
+ }
1247
+ }, me);
1248
+ }
1249
+ // If it is is already collapsed but we want to recursively collapse then call collapseChildren
1250
+ else if (recursive) {
1251
+ me.collapseChildren(true, callback, scope);
1252
+ }
1253
+ }
1254
+ // If it's not then we fire the callback right away
1255
+ else {
1256
+ Ext.callback(callback, scope || me, [me.childNodes]);
1257
+ }
1258
+ },
1259
+
1260
+ /**
1261
+ * Collapse all the children of this node.
1262
+ * @param {Function} [recursive=false] True to recursively collapse all the children
1263
+ * @param {Function} [callback] The function to execute once all the children are collapsed
1264
+ * @param {Object} [scope] The scope to run the callback in
1265
+ */
1266
+ collapseChildren: function(recursive, callback, scope) {
1267
+ var me = this,
1268
+ i = 0,
1269
+ nodes = me.childNodes,
1270
+ ln = nodes.length,
1271
+ node,
1272
+ collapsing = 0;
1273
+
1274
+ for (; i < ln; ++i) {
1275
+ node = nodes[i];
1276
+ if (!node.isLeaf() && node.isExpanded()) {
1277
+ collapsing++;
1278
+ nodes[i].collapse(recursive, function () {
1279
+ collapsing--;
1280
+ if (callback && !collapsing) {
1281
+ Ext.callback(callback, scope || me, [me.childNodes]);
1282
+ }
1283
+ });
1284
+ }
1285
+ }
1286
+
1287
+ if (!collapsing && callback) {
1288
+ Ext.callback(callback, scope || me, [me.childNodes]);
1289
+ }
1290
+ }
1291
+ };
1292
+ }
1293
+ }
1294
+ });