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,112 @@
1
+ /**
2
+ * @class Ext.app.EventBus
3
+ * @private
4
+ */
5
+ Ext.define('Ext.app.EventBus', {
6
+ requires: [
7
+ 'Ext.util.Event',
8
+ 'Ext.Component'
9
+ ],
10
+ mixins: {
11
+ observable: 'Ext.util.Observable'
12
+ },
13
+
14
+ constructor: function() {
15
+ this.mixins.observable.constructor.call(this);
16
+
17
+ this.bus = {};
18
+
19
+ var me = this;
20
+ Ext.override(Ext.Component, {
21
+ fireEvent: function(ev) {
22
+ if (Ext.util.Observable.prototype.fireEvent.apply(this, arguments) !== false) {
23
+ return me.dispatch.call(me, ev, this, arguments);
24
+ }
25
+ return false;
26
+ }
27
+ });
28
+ },
29
+
30
+ dispatch: function(ev, target, args) {
31
+ var bus = this.bus,
32
+ selectors = bus[ev],
33
+ selector, controllers, id, events, event, i, ln;
34
+
35
+ if (selectors) {
36
+ // Loop over all the selectors that are bound to this event
37
+ for (selector in selectors) {
38
+ // Check if the target matches the selector
39
+ if (selectors.hasOwnProperty(selector) && target.is(selector)) {
40
+ // Loop over all the controllers that are bound to this selector
41
+ controllers = selectors[selector];
42
+ for (id in controllers) {
43
+ if (controllers.hasOwnProperty(id)) {
44
+ // Loop over all the events that are bound to this selector on this controller
45
+ events = controllers[id];
46
+ for (i = 0, ln = events.length; i < ln; i++) {
47
+ event = events[i];
48
+ // Fire the event!
49
+ if (event.fire.apply(event, Array.prototype.slice.call(args, 1)) === false) {
50
+ return false;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ return true;
59
+ },
60
+
61
+ control: function(selectors, listeners, controller) {
62
+ var bus = this.bus,
63
+ hasListeners, tree, list,
64
+ selector, options, listener, scope, event, listenerList, ev;
65
+
66
+ if (Ext.isString(selectors)) {
67
+ selector = selectors;
68
+ selectors = {};
69
+ selectors[selector] = listeners;
70
+ this.control(selectors, null, controller);
71
+ return;
72
+ }
73
+
74
+ hasListeners = Ext.util.Observable.HasListeners.prototype;
75
+ for (selector in selectors) {
76
+ if (selectors.hasOwnProperty(selector)) {
77
+ listenerList = selectors[selector] || {};
78
+
79
+ for (ev in listenerList) {
80
+ if (listenerList.hasOwnProperty(ev)) {
81
+ options = {};
82
+ listener = listenerList[ev];
83
+ scope = controller;
84
+ event = new Ext.util.Event(controller, ev);
85
+
86
+ // Normalize the listener
87
+ if (Ext.isObject(listener)) {
88
+ options = listener;
89
+ listener = options.fn;
90
+ scope = options.scope || controller;
91
+
92
+ delete options.fn;
93
+ delete options.scope;
94
+ }
95
+
96
+ event.addListener(listener, scope, options);
97
+
98
+ hasListeners[ev] = 1;
99
+
100
+ // Create the bus tree if it is not there yet
101
+ tree = bus[ev] || (bus[ev] = {});
102
+ tree = tree[selector] || (tree[selector] = {});
103
+ list = tree[controller.id] || (tree[controller.id] = []);
104
+
105
+ // Push our listener in our bus
106
+ list.push(event);
107
+ }
108
+ } //end inner loop
109
+ }
110
+ } //end outer loop
111
+ }
112
+ });
@@ -0,0 +1,1483 @@
1
+ /**
2
+ * @docauthor Robert Dougan <rob@sencha.com>
3
+ *
4
+ * Create simple buttons with this component. Customisations include {@link #iconAlign aligned}
5
+ * {@link #iconCls icons}, {@link #cfg-menu dropdown menus}, {@link #tooltip tooltips}
6
+ * and {@link #scale sizing options}. Specify a {@link #handler handler} to run code when
7
+ * a user clicks the button, or use {@link #listeners listeners} for other events such as
8
+ * {@link #mouseover mouseover}. Example usage:
9
+ *
10
+ * @example
11
+ * Ext.create('Ext.Button', {
12
+ * text: 'Click me',
13
+ * renderTo: Ext.getBody(),
14
+ * handler: function() {
15
+ * alert('You clicked the button!');
16
+ * }
17
+ * });
18
+ *
19
+ * The {@link #handler} configuration can also be updated dynamically using the {@link #setHandler}
20
+ * method. Example usage:
21
+ *
22
+ * @example
23
+ * Ext.create('Ext.Button', {
24
+ * text : 'Dynamic Handler Button',
25
+ * renderTo: Ext.getBody(),
26
+ * handler : function() {
27
+ * // this button will spit out a different number every time you click it.
28
+ * // so firstly we must check if that number is already set:
29
+ * if (this.clickCount) {
30
+ * // looks like the property is already set, so lets just add 1 to that number and alert the user
31
+ * this.clickCount++;
32
+ * alert('You have clicked the button "' + this.clickCount + '" times.\n\nTry clicking it again..');
33
+ * } else {
34
+ * // if the clickCount property is not set, we will set it and alert the user
35
+ * this.clickCount = 1;
36
+ * alert('You just clicked the button for the first time!\n\nTry pressing it again..');
37
+ * }
38
+ * }
39
+ * });
40
+ *
41
+ * A button within a container:
42
+ *
43
+ * @example
44
+ * Ext.create('Ext.Container', {
45
+ * renderTo: Ext.getBody(),
46
+ * items : [
47
+ * {
48
+ * xtype: 'button',
49
+ * text : 'My Button'
50
+ * }
51
+ * ]
52
+ * });
53
+ *
54
+ * A useful option of Button is the {@link #scale} configuration. This configuration has three different options:
55
+ *
56
+ * - `'small'`
57
+ * - `'medium'`
58
+ * - `'large'`
59
+ *
60
+ * Example usage:
61
+ *
62
+ * @example
63
+ * Ext.create('Ext.Button', {
64
+ * renderTo: document.body,
65
+ * text : 'Click me',
66
+ * scale : 'large'
67
+ * });
68
+ *
69
+ * Buttons can also be toggled. To enable this, you simple set the {@link #enableToggle} property to `true`.
70
+ * Example usage:
71
+ *
72
+ * @example
73
+ * Ext.create('Ext.Button', {
74
+ * renderTo: Ext.getBody(),
75
+ * text: 'Click Me',
76
+ * enableToggle: true
77
+ * });
78
+ *
79
+ * You can assign a menu to a button by using the {@link #cfg-menu} configuration. This standard configuration
80
+ * can either be a reference to a {@link Ext.menu.Menu menu} object, a {@link Ext.menu.Menu menu} id or a
81
+ * {@link Ext.menu.Menu menu} config blob. When assigning a menu to a button, an arrow is automatically
82
+ * added to the button. You can change the alignment of the arrow using the {@link #arrowAlign} configuration
83
+ * on button. Example usage:
84
+ *
85
+ * @example
86
+ * Ext.create('Ext.Button', {
87
+ * text : 'Menu button',
88
+ * renderTo : Ext.getBody(),
89
+ * arrowAlign: 'bottom',
90
+ * menu : [
91
+ * {text: 'Item 1'},
92
+ * {text: 'Item 2'},
93
+ * {text: 'Item 3'},
94
+ * {text: 'Item 4'}
95
+ * ]
96
+ * });
97
+ *
98
+ * Using listeners, you can easily listen to events fired by any component, using the {@link #listeners}
99
+ * configuration or using the {@link #addListener} method. Button has a variety of different listeners:
100
+ *
101
+ * - `click`
102
+ * - `toggle`
103
+ * - `mouseover`
104
+ * - `mouseout`
105
+ * - `mouseshow`
106
+ * - `menuhide`
107
+ * - `menutriggerover`
108
+ * - `menutriggerout`
109
+ *
110
+ * Example usage:
111
+ *
112
+ * @example
113
+ * Ext.create('Ext.Button', {
114
+ * text : 'Button',
115
+ * renderTo : Ext.getBody(),
116
+ * listeners: {
117
+ * click: function() {
118
+ * // this == the button, as we are in the local scope
119
+ * this.setText('I was clicked!');
120
+ * },
121
+ * mouseover: function() {
122
+ * // set a new config which says we moused over, if not already set
123
+ * if (!this.mousedOver) {
124
+ * this.mousedOver = true;
125
+ * alert('You moused over a button!\n\nI wont do this again.');
126
+ * }
127
+ * }
128
+ * }
129
+ * });
130
+ */
131
+ Ext.define('Ext.button.Button', {
132
+
133
+ /* Begin Definitions */
134
+ alias: 'widget.button',
135
+ extend: 'Ext.Component',
136
+
137
+ requires: [
138
+ 'Ext.menu.Manager',
139
+ 'Ext.util.ClickRepeater',
140
+ 'Ext.layout.component.Button',
141
+ 'Ext.util.TextMetrics',
142
+ 'Ext.util.KeyMap'
143
+ ],
144
+
145
+ alternateClassName: 'Ext.Button',
146
+ /* End Definitions */
147
+
148
+ /*
149
+ * @property {Boolean} isAction
150
+ * `true` in this class to identify an object as an instantiated Button, or subclass thereof.
151
+ */
152
+ isButton: true,
153
+ componentLayout: 'button',
154
+
155
+ /**
156
+ * @property {Boolean} hidden
157
+ * True if this button is hidden.
158
+ * @readonly
159
+ */
160
+ hidden: false,
161
+
162
+ /**
163
+ * @property {Boolean} disabled
164
+ * True if this button is disabled.
165
+ * @readonly
166
+ */
167
+ disabled: false,
168
+
169
+ /**
170
+ * @property {Boolean} pressed
171
+ * True if this button is pressed (only if enableToggle = true).
172
+ * @readonly
173
+ */
174
+ pressed: false,
175
+
176
+ /**
177
+ * @cfg {String} text
178
+ * The button text to be used as innerHTML (html tags are accepted).
179
+ */
180
+
181
+ /**
182
+ * @cfg {String} icon
183
+ * The path to an image to display in the button.
184
+ */
185
+
186
+ /**
187
+ * @cfg {Function} handler
188
+ * A function called when the button is clicked (can be used instead of click event).
189
+ * @cfg {Ext.button.Button} handler.button This button.
190
+ * @cfg {Ext.EventObject} handler.e The click event.
191
+ */
192
+
193
+ /**
194
+ * @cfg {Number} minWidth
195
+ * The minimum width for this button (used to give a set of buttons a common width).
196
+ * See also {@link Ext.panel.Panel}.{@link Ext.panel.Panel#minButtonWidth minButtonWidth}.
197
+ */
198
+
199
+ /**
200
+ * @cfg {String/Object} tooltip
201
+ * The tooltip for the button - can be a string to be used as innerHTML (html tags are accepted) or
202
+ * QuickTips config object.
203
+ */
204
+
205
+ /**
206
+ * @cfg {Boolean} [hidden=false]
207
+ * True to start hidden.
208
+ */
209
+
210
+ /**
211
+ * @cfg {Boolean} [disabled=false]
212
+ * True to start disabled.
213
+ */
214
+
215
+ /**
216
+ * @cfg {Boolean} [pressed=false]
217
+ * True to start pressed (only if enableToggle = true)
218
+ */
219
+
220
+ /**
221
+ * @cfg {String} toggleGroup
222
+ * The group this toggle button is a member of (only 1 per group can be pressed)
223
+ */
224
+
225
+ /**
226
+ * @cfg {Boolean/Object} [repeat=false]
227
+ * True to repeat fire the click event while the mouse is down. This can also be a
228
+ * {@link Ext.util.ClickRepeater ClickRepeater} config object.
229
+ */
230
+
231
+ /**
232
+ * @cfg {Number} tabIndex
233
+ * Set a DOM tabIndex for this button.
234
+ */
235
+
236
+ /**
237
+ * @cfg {Boolean} [allowDepress=true]
238
+ * False to not allow a pressed Button to be depressed. Only valid when {@link #enableToggle} is true.
239
+ */
240
+
241
+ /**
242
+ * @cfg {Boolean} [enableToggle=false]
243
+ * True to enable pressed/not pressed toggling.
244
+ */
245
+ enableToggle: false,
246
+
247
+ /**
248
+ * @cfg {Function} toggleHandler
249
+ * Function called when a Button with {@link #enableToggle} set to true is clicked.
250
+ * @cfg {Ext.button.Button} toggleHandler.button This button.
251
+ * @cfg {Boolean} toggleHandler.state The next state of the Button, true means pressed.
252
+ */
253
+
254
+ /**
255
+ * @cfg {Ext.menu.Menu/String/Object} menu
256
+ * Standard menu attribute consisting of a reference to a menu object, a menu id or a menu config blob.
257
+ */
258
+
259
+ /**
260
+ * @cfg {String} menuAlign
261
+ * The position to align the menu to (see {@link Ext.Element#alignTo} for more details).
262
+ */
263
+ menuAlign: 'tl-bl?',
264
+
265
+ /**
266
+ * @cfg {String} textAlign
267
+ * The text alignment for this button (center, left, right).
268
+ */
269
+ textAlign: 'center',
270
+
271
+ /**
272
+ * @cfg {String} overflowText
273
+ * If used in a {@link Ext.toolbar.Toolbar Toolbar}, the text to be used if this item is shown in the overflow menu.
274
+ * See also {@link Ext.toolbar.Item}.`{@link Ext.toolbar.Item#overflowText overflowText}`.
275
+ */
276
+
277
+ /**
278
+ * @cfg {String} iconCls
279
+ * A css class which sets a background image to be used as the icon for this button.
280
+ */
281
+
282
+ /**
283
+ * @cfg {String} type
284
+ * The type of `<input>` to create: submit, reset or button.
285
+ */
286
+ type: 'button',
287
+
288
+ /**
289
+ * @cfg {String} clickEvent
290
+ * The DOM event that will fire the handler of the button. This can be any valid event name (dblclick, contextmenu).
291
+ */
292
+ clickEvent: 'click',
293
+
294
+ /**
295
+ * @cfg {Boolean} preventDefault
296
+ * True to prevent the default action when the {@link #clickEvent} is processed.
297
+ */
298
+ preventDefault: true,
299
+
300
+ /**
301
+ * @cfg {Boolean} handleMouseEvents
302
+ * False to disable visual cues on mouseover, mouseout and mousedown.
303
+ */
304
+ handleMouseEvents: true,
305
+
306
+ /**
307
+ * @cfg {String} tooltipType
308
+ * The type of tooltip to use. Either 'qtip' for QuickTips or 'title' for title attribute.
309
+ */
310
+ tooltipType: 'qtip',
311
+
312
+ /**
313
+ * @cfg {String} [baseCls='x-btn']
314
+ * The base CSS class to add to all buttons.
315
+ */
316
+ baseCls: Ext.baseCSSPrefix + 'btn',
317
+
318
+ /**
319
+ * @cfg {String} pressedCls
320
+ * The CSS class to add to a button when it is in the pressed state.
321
+ */
322
+ pressedCls: 'pressed',
323
+
324
+ /**
325
+ * @cfg {String} overCls
326
+ * The CSS class to add to a button when it is in the over (hovered) state.
327
+ */
328
+ overCls: 'over',
329
+
330
+ /**
331
+ * @cfg {String} focusCls
332
+ * The CSS class to add to a button when it is in the focussed state.
333
+ */
334
+ focusCls: 'focus',
335
+
336
+ /**
337
+ * @cfg {String} menuActiveCls
338
+ * The CSS class to add to a button when it's menu is active.
339
+ */
340
+ menuActiveCls: 'menu-active',
341
+
342
+ /**
343
+ * @cfg {String} href
344
+ * The URL to open when the button is clicked. Specifying this config causes the Button to be
345
+ * rendered with an anchor (An `<a>` element) as its active element, referencing the specified URL.
346
+ *
347
+ * This is better than specifying a click handler of
348
+ *
349
+ * function() { window.location = "http://www.sencha.com" }
350
+ *
351
+ * because the UI will provide meaningful hints to the user as to what to expect upon clicking
352
+ * the button, and will also allow the user to open in a new tab or window, bookmark or drag the URL, or directly save
353
+ * the URL stream to disk.
354
+ *
355
+ * See also the {@link #hrefTarget} config.
356
+ */
357
+
358
+ /**
359
+ * @cfg {String} [hrefTarget="_blank"]
360
+ * The target attribute to use for the underlying anchor. Only used if the {@link #href}
361
+ * property is specified.
362
+ */
363
+ hrefTarget: '_blank',
364
+
365
+ border: true,
366
+
367
+ /**
368
+ * @cfg {Object} baseParams
369
+ * An object literal of parameters to pass to the url when the {@link #href} property is specified.
370
+ */
371
+
372
+ /**
373
+ * @cfg {Object} params
374
+ * An object literal of parameters to pass to the url when the {@link #href} property is specified. Any params
375
+ * override {@link #baseParams}. New params can be set using the {@link #setParams} method.
376
+ */
377
+
378
+ childEls: [
379
+ 'btnEl', 'btnWrap', 'btnInnerEl', 'btnIconEl'
380
+ ],
381
+
382
+ renderTpl: [
383
+ '<em id="{id}-btnWrap"<tpl if="splitCls"> class="{splitCls}"</tpl>>',
384
+ '<tpl if="href">',
385
+ '<a id="{id}-btnEl" href="{href}" class="{btnCls}" target="{hrefTarget}"',
386
+ '<tpl if="tabIndex"> tabIndex="{tabIndex}"</tpl>',
387
+ '<tpl if="disabled"> disabled="disabled"</tpl>',
388
+ ' role="link">',
389
+ '<span id="{id}-btnInnerEl" class="{baseCls}-inner">',
390
+ '{text}',
391
+ '</span>',
392
+ '<span id="{id}-btnIconEl" class="{baseCls}-icon {iconCls}"<tpl if="iconUrl"> style="background-image:url({iconUrl})"</tpl>></span>',
393
+ '</a>',
394
+ '<tpl else>',
395
+ '<button id="{id}-btnEl" type="{type}" class="{btnCls}" hidefocus="true"',
396
+ // the autocomplete="off" is required to prevent Firefox from remembering
397
+ // the button's disabled state between page reloads.
398
+ '<tpl if="tabIndex"> tabIndex="{tabIndex}"</tpl>',
399
+ '<tpl if="disabled"> disabled="disabled"</tpl>',
400
+ ' role="button" autocomplete="off">',
401
+ '<span id="{id}-btnInnerEl" class="{baseCls}-inner" style="{innerSpanStyle}">',
402
+ '{text}',
403
+ '</span>',
404
+ '<span id="{id}-btnIconEl" class="{baseCls}-icon {iconCls}"<tpl if="iconUrl"> style="background-image:url({iconUrl})"</tpl>></span>',
405
+ '</button>',
406
+ '</tpl>',
407
+ '</em>',
408
+ '<tpl if="closable">',
409
+ '<a id="{id}-closeEl" href="#" class="{baseCls}-close-btn" title="{closeText}"></a>',
410
+ '</tpl>'
411
+ ],
412
+
413
+ /**
414
+ * @cfg {String} scale
415
+ * The size of the Button. Three values are allowed:
416
+ *
417
+ * - 'small' - Results in the button element being 16px high.
418
+ * - 'medium' - Results in the button element being 24px high.
419
+ * - 'large' - Results in the button element being 32px high.
420
+ */
421
+ scale: 'small',
422
+
423
+ /**
424
+ * @private
425
+ * An array of allowed scales.
426
+ */
427
+ allowedScales: ['small', 'medium', 'large'],
428
+
429
+ /**
430
+ * @cfg {Object} scope
431
+ * The scope (**this** reference) in which the `{@link #handler}` and `{@link #toggleHandler}` is executed.
432
+ * Defaults to this Button.
433
+ */
434
+
435
+ /**
436
+ * @cfg {String} iconAlign
437
+ * The side of the Button box to render the icon. Four values are allowed:
438
+ *
439
+ * - 'top'
440
+ * - 'right'
441
+ * - 'bottom'
442
+ * - 'left'
443
+ */
444
+ iconAlign: 'left',
445
+
446
+ /**
447
+ * @cfg {String} arrowAlign
448
+ * The side of the Button box to render the arrow if the button has an associated {@link #cfg-menu}. Two
449
+ * values are allowed:
450
+ *
451
+ * - 'right'
452
+ * - 'bottom'
453
+ */
454
+ arrowAlign: 'right',
455
+
456
+ /**
457
+ * @cfg {String} arrowCls
458
+ * The className used for the inner arrow element if the button has a menu.
459
+ */
460
+ arrowCls: 'arrow',
461
+
462
+ /**
463
+ * @property {Ext.Template} template
464
+ * A {@link Ext.Template Template} used to create the Button's DOM structure.
465
+ *
466
+ * Instances, or subclasses which need a different DOM structure may provide a different template layout in
467
+ * conjunction with an implementation of {@link #getTemplateArgs}.
468
+ */
469
+
470
+ /**
471
+ * @cfg {String} cls
472
+ * A CSS class string to apply to the button's main element.
473
+ */
474
+
475
+ /**
476
+ * @property {Ext.menu.Menu} menu
477
+ * The {@link Ext.menu.Menu Menu} object associated with this Button when configured with the {@link #cfg-menu} config
478
+ * option.
479
+ */
480
+
481
+ maskOnDisable: false,
482
+
483
+ /**
484
+ * @private
485
+ * @property persistentPadding
486
+ * The padding spuriously added to a &lt;button> element which must be accounted for in the margins of the innerEl.
487
+ * This is calculated at first render time by creating a hidden button and measuring its insides.
488
+ */
489
+ persistentPadding: undefined,
490
+
491
+ shrinkWrap: 3,
492
+
493
+ frame: true,
494
+
495
+ // inherit docs
496
+ initComponent: function() {
497
+ var me = this;
498
+ me.callParent(arguments);
499
+
500
+ me.addEvents(
501
+ /**
502
+ * @event click
503
+ * Fires when this button is clicked, before the configured {@link #handler} is invoked. Execution of the
504
+ * {@link #handler} may be vetoed by returning <code>false</code> to this event.
505
+ * @param {Ext.button.Button} this
506
+ * @param {Event} e The click event
507
+ */
508
+ 'click',
509
+
510
+ /**
511
+ * @event toggle
512
+ * Fires when the 'pressed' state of this button changes (only if enableToggle = true)
513
+ * @param {Ext.button.Button} this
514
+ * @param {Boolean} pressed
515
+ */
516
+ 'toggle',
517
+
518
+ /**
519
+ * @event mouseover
520
+ * Fires when the mouse hovers over the button
521
+ * @param {Ext.button.Button} this
522
+ * @param {Event} e The event object
523
+ */
524
+ 'mouseover',
525
+
526
+ /**
527
+ * @event mouseout
528
+ * Fires when the mouse exits the button
529
+ * @param {Ext.button.Button} this
530
+ * @param {Event} e The event object
531
+ */
532
+ 'mouseout',
533
+
534
+ /**
535
+ * @event menushow
536
+ * If this button has a menu, this event fires when it is shown
537
+ * @param {Ext.button.Button} this
538
+ * @param {Ext.menu.Menu} menu
539
+ */
540
+ 'menushow',
541
+
542
+ /**
543
+ * @event menuhide
544
+ * If this button has a menu, this event fires when it is hidden
545
+ * @param {Ext.button.Button} this
546
+ * @param {Ext.menu.Menu} menu
547
+ */
548
+ 'menuhide',
549
+
550
+ /**
551
+ * @event menutriggerover
552
+ * If this button has a menu, this event fires when the mouse enters the menu triggering element
553
+ * @param {Ext.button.Button} this
554
+ * @param {Ext.menu.Menu} menu
555
+ * @param {Event} e
556
+ */
557
+ 'menutriggerover',
558
+
559
+ /**
560
+ * @event menutriggerout
561
+ * If this button has a menu, this event fires when the mouse leaves the menu triggering element
562
+ * @param {Ext.button.Button} this
563
+ * @param {Ext.menu.Menu} menu
564
+ * @param {Event} e
565
+ */
566
+ 'menutriggerout'
567
+ );
568
+
569
+ if (me.menu) {
570
+ // Flag that we'll have a splitCls
571
+ me.split = true;
572
+
573
+ // retrieve menu by id or instantiate instance if needed
574
+ me.menu = Ext.menu.Manager.get(me.menu);
575
+ me.menu.ownerButton = me;
576
+ }
577
+
578
+ // Accept url as a synonym for href
579
+ if (me.url) {
580
+ me.href = me.url;
581
+ }
582
+
583
+ // preventDefault defaults to false for links
584
+ if (me.href && !me.hasOwnProperty('preventDefault')) {
585
+ me.preventDefault = false;
586
+ }
587
+
588
+ if (Ext.isString(me.toggleGroup)) {
589
+ me.enableToggle = true;
590
+ }
591
+
592
+ },
593
+
594
+ // inherit docs
595
+ getActionEl: function() {
596
+ return this.btnEl;
597
+ },
598
+
599
+ // inherit docs
600
+ getFocusEl: function() {
601
+ return this.inOnFocus ? this.el : this.btnEl;
602
+ },
603
+
604
+ // Buttons add the focus class to the *outermost element*, not the focusEl!
605
+ onFocus: function(e) {
606
+ var me = this;
607
+
608
+ // Set this flag, so that when AbstractComponent's onFocus gets the focusEl to add the focusCls
609
+ // to, it will get the encapsulating element - that's what the CSS rules for Button need right now
610
+ me.inOnFocus = true;
611
+ me.callParent(arguments);
612
+ me.inOnFocus = false;
613
+ },
614
+
615
+ // Buttons add the focus class to the *outermost element*, not the focusEl!
616
+ onBlur : function(e) {
617
+ var me = this,
618
+ focusCls = me.focusCls,
619
+ targetEl = me.getEl();
620
+
621
+ if (me.destroying) {
622
+ return;
623
+ }
624
+
625
+ me.beforeBlur(e);
626
+ if (focusCls && targetEl) {
627
+ targetEl.removeCls(me.removeClsWithUI(focusCls, true));
628
+ }
629
+ if (me.validateOnBlur) {
630
+ me.validate();
631
+ }
632
+ me.hasFocus = false;
633
+ me.fireEvent('blur', me, e);
634
+ me.postBlur(e);
635
+ },
636
+
637
+ // private
638
+ setComponentCls: function() {
639
+ var me = this,
640
+ cls = me.getComponentCls();
641
+
642
+ if (!Ext.isEmpty(me.oldCls)) {
643
+ me.removeClsWithUI(me.oldCls);
644
+ me.removeClsWithUI(me.pressedCls);
645
+ }
646
+
647
+ me.oldCls = cls;
648
+ me.addClsWithUI(cls);
649
+ },
650
+
651
+ getComponentCls: function() {
652
+ var me = this,
653
+ cls = [];
654
+
655
+ // Check whether the button has an icon or not, and if it has an icon, what is the alignment
656
+ if (me.iconCls || me.icon) {
657
+ if (me.text) {
658
+ cls.push('icon-text-' + me.iconAlign);
659
+ } else {
660
+ cls.push('icon');
661
+ }
662
+ } else if (me.text) {
663
+ cls.push('noicon');
664
+ }
665
+
666
+ if (me.pressed) {
667
+ cls.push(me.pressedCls);
668
+ }
669
+ return cls;
670
+ },
671
+
672
+ beforeRender: function () {
673
+ var me = this;
674
+
675
+ me.callParent();
676
+
677
+ // Add all needed classes to the protoElement.
678
+ me.oldCls = me.getComponentCls();
679
+ me.addClsWithUI(me.oldCls);
680
+
681
+ // Apply the renderData to the template args
682
+ Ext.applyIf(me.renderData, me.getTemplateArgs());
683
+
684
+ if (me.scale) {
685
+ me.setScale(me.scale);
686
+ }
687
+ },
688
+
689
+ // private
690
+ onRender: function() {
691
+ var me = this,
692
+ btn,
693
+ btnListeners;
694
+
695
+ me.doc = Ext.getDoc();
696
+ me.callParent(arguments);
697
+
698
+ // If it is a split button + has a toolip for the arrow
699
+ if (me.split && me.arrowTooltip) {
700
+ me.arrowEl.dom.setAttribute(me.getTipAttr(), me.arrowTooltip);
701
+ }
702
+
703
+ // Set btn as a local variable for easy access
704
+ btn = me.el;
705
+
706
+ if (me.tooltip) {
707
+ me.setTooltip(me.tooltip, true);
708
+ }
709
+
710
+ // Add the mouse events to the button
711
+ if (me.handleMouseEvents) {
712
+ btnListeners = {
713
+ scope: me,
714
+ mouseover: me.onMouseOver,
715
+ mouseout: me.onMouseOut,
716
+ mousedown: me.onMouseDown
717
+ };
718
+ if (me.split) {
719
+ btnListeners.mousemove = me.onMouseMove;
720
+ }
721
+ } else {
722
+ btnListeners = {
723
+ scope: me
724
+ };
725
+ }
726
+
727
+ // Check if the button has a menu
728
+ if (me.menu) {
729
+ me.mon(me.menu, {
730
+ scope: me,
731
+ show: me.onMenuShow,
732
+ hide: me.onMenuHide
733
+ });
734
+
735
+ me.keyMap = new Ext.util.KeyMap({
736
+ target: me.el,
737
+ key: Ext.EventObject.DOWN,
738
+ handler: me.onDownKey,
739
+ scope: me
740
+ });
741
+ }
742
+
743
+ // Check if it is a repeat button
744
+ if (me.repeat) {
745
+ me.mon(new Ext.util.ClickRepeater(btn, Ext.isObject(me.repeat) ? me.repeat: {}), 'click', me.onRepeatClick, me);
746
+ } else {
747
+ btnListeners[me.clickEvent] = me.onClick;
748
+ }
749
+
750
+ // Add whatever button listeners we need
751
+ me.mon(btn, btnListeners);
752
+
753
+ // Register the button in the toggle manager
754
+ Ext.ButtonToggleManager.register(me);
755
+ },
756
+
757
+ /**
758
+ * This method returns an object which provides substitution parameters for the {@link #renderTpl XTemplate} used to
759
+ * create this Button's DOM structure.
760
+ *
761
+ * Instances or subclasses which use a different Template to create a different DOM structure may need to provide
762
+ * their own implementation of this method.
763
+ *
764
+ * @return {Object} Substitution data for a Template. The default implementation which provides data for the default
765
+ * {@link #template} returns an Object containing the following properties:
766
+ * @return {String} return.type The `<button>`'s {@link #type}
767
+ * @return {String} return.splitCls A CSS class to determine the presence and position of an arrow icon.
768
+ * (`'x-btn-arrow'` or `'x-btn-arrow-bottom'` or `''`)
769
+ * @return {String} return.cls A CSS class name applied to the Button's main `<tbody>` element which determines the
770
+ * button's scale and icon alignment.
771
+ * @return {String} return.text The {@link #text} to display ion the Button.
772
+ * @return {Number} return.tabIndex The tab index within the input flow.
773
+ */
774
+ getTemplateArgs: function() {
775
+ var me = this,
776
+ persistentPadding = me.getPersistentPadding(),
777
+ innerSpanStyle = '';
778
+
779
+ // Create negative margin offsets to counteract persistent button padding if needed
780
+ if (Math.max.apply(Math, persistentPadding) > 0) {
781
+ innerSpanStyle = 'margin:' + Ext.Array.map(persistentPadding, function(pad) {
782
+ return -pad + 'px';
783
+ }).join(' ');
784
+ }
785
+
786
+ return {
787
+ href : me.getHref(),
788
+ disabled : me.disabled,
789
+ hrefTarget: me.hrefTarget,
790
+ type : me.type,
791
+ btnCls : me.getBtnCls(),
792
+ splitCls : me.getSplitCls(),
793
+ iconUrl : me.icon,
794
+ iconCls : me.iconCls,
795
+ text : me.text || '&#160;',
796
+ tabIndex : me.tabIndex,
797
+ innerSpanStyle: innerSpanStyle
798
+ };
799
+ },
800
+
801
+ /**
802
+ * @private
803
+ * If there is a configured href for this Button, returns the href with parameters appended.
804
+ * @returns The href string with parameters appended.
805
+ */
806
+ getHref: function() {
807
+ var me = this,
808
+ params = Ext.apply({}, me.baseParams);
809
+
810
+ // write baseParams first, then write any params
811
+ params = Ext.apply(params, me.params);
812
+ return me.href ? Ext.urlAppend(me.href, Ext.Object.toQueryString(params)) : false;
813
+ },
814
+
815
+ /**
816
+ * Sets the href of the link dynamically according to the params passed, and any {@link #baseParams} configured.
817
+ *
818
+ * **Only valid if the Button was originally configured with a {@link #href}**
819
+ *
820
+ * @param {Object} params Parameters to use in the href URL.
821
+ */
822
+ setParams: function(params) {
823
+ this.params = params;
824
+ this.btnEl.dom.href = this.getHref();
825
+ },
826
+
827
+ getSplitCls: function() {
828
+ var me = this;
829
+ return me.split ? (me.baseCls + '-' + me.arrowCls) + ' ' + (me.baseCls + '-' + me.arrowCls + '-' + me.arrowAlign) : '';
830
+ },
831
+
832
+ getBtnCls: function() {
833
+ return this.textAlign ? this.baseCls + '-' + this.textAlign : '';
834
+ },
835
+
836
+ /**
837
+ * Sets the CSS class that provides a background image to use as the button's icon. This method also changes the
838
+ * value of the {@link #iconCls} config internally.
839
+ * @param {String} cls The CSS class providing the icon image
840
+ * @return {Ext.button.Button} this
841
+ */
842
+ setIconCls: function(cls) {
843
+ var me = this,
844
+ btnIconEl = me.btnIconEl,
845
+ oldCls = me.iconCls;
846
+
847
+ me.iconCls = cls;
848
+ if (btnIconEl) {
849
+ // Remove the previous iconCls from the button
850
+ btnIconEl.removeCls(oldCls);
851
+ btnIconEl.addCls(cls || '');
852
+ me.setComponentCls();
853
+ if (me.didIconStateChange(oldCls, cls)) {
854
+ me.updateLayout();
855
+ }
856
+ }
857
+ return me;
858
+ },
859
+
860
+ /**
861
+ * Sets the tooltip for this Button.
862
+ *
863
+ * @param {String/Object} tooltip This may be:
864
+ *
865
+ * - **String** : A string to be used as innerHTML (html tags are accepted) to show in a tooltip
866
+ * - **Object** : A configuration object for {@link Ext.tip.QuickTipManager#register}.
867
+ *
868
+ * @return {Ext.button.Button} this
869
+ */
870
+ setTooltip: function(tooltip, initial) {
871
+ var me = this;
872
+
873
+ if (me.rendered) {
874
+ if (!initial) {
875
+ me.clearTip();
876
+ }
877
+ if (Ext.isObject(tooltip)) {
878
+ Ext.tip.QuickTipManager.register(Ext.apply({
879
+ target: me.btnEl.id
880
+ },
881
+ tooltip));
882
+ me.tooltip = tooltip;
883
+ } else {
884
+ me.btnEl.dom.setAttribute(me.getTipAttr(), tooltip);
885
+ }
886
+ } else {
887
+ me.tooltip = tooltip;
888
+ }
889
+ return me;
890
+ },
891
+
892
+ /**
893
+ * Sets the text alignment for this button.
894
+ * @param {String} align The new alignment of the button text. See {@link #textAlign}.
895
+ */
896
+ setTextAlign: function(align) {
897
+ var me = this,
898
+ btnEl = me.btnEl;
899
+
900
+ if (btnEl) {
901
+ btnEl.removeCls(me.baseCls + '-' + me.textAlign);
902
+ btnEl.addCls(me.baseCls + '-' + align);
903
+ }
904
+ me.textAlign = align;
905
+ return me;
906
+ },
907
+
908
+ getTipAttr: function(){
909
+ return this.tooltipType == 'qtip' ? 'data-qtip' : 'title';
910
+ },
911
+
912
+ // private
913
+ getRefItems: function(deep){
914
+ var menu = this.menu,
915
+ items;
916
+
917
+ if (menu) {
918
+ items = menu.getRefItems(deep);
919
+ items.unshift(menu);
920
+ }
921
+ return items || [];
922
+ },
923
+
924
+ // private
925
+ clearTip: function() {
926
+ if (Ext.isObject(this.tooltip)) {
927
+ Ext.tip.QuickTipManager.unregister(this.btnEl);
928
+ }
929
+ },
930
+
931
+ // private
932
+ beforeDestroy: function() {
933
+ var me = this;
934
+ if (me.rendered) {
935
+ me.clearTip();
936
+ }
937
+ if (me.menu && me.destroyMenu !== false) {
938
+ Ext.destroy(me.menu);
939
+ }
940
+ Ext.destroy(me.btnInnerEl, me.repeater);
941
+ me.callParent();
942
+ },
943
+
944
+ // private
945
+ onDestroy: function() {
946
+ var me = this;
947
+ if (me.rendered) {
948
+ me.doc.un('mouseover', me.monitorMouseOver, me);
949
+ me.doc.un('mouseup', me.onMouseUp, me);
950
+ delete me.doc;
951
+ Ext.ButtonToggleManager.unregister(me);
952
+
953
+ Ext.destroy(me.keyMap);
954
+ delete me.keyMap;
955
+ }
956
+ me.callParent();
957
+ },
958
+
959
+ /**
960
+ * Assigns this Button's click handler
961
+ * @param {Function} handler The function to call when the button is clicked
962
+ * @param {Object} [scope] The scope (`this` reference) in which the handler function is executed.
963
+ * Defaults to this Button.
964
+ * @return {Ext.button.Button} this
965
+ */
966
+ setHandler: function(handler, scope) {
967
+ this.handler = handler;
968
+ this.scope = scope;
969
+ return this;
970
+ },
971
+
972
+ /**
973
+ * Sets this Button's text
974
+ * @param {String} text The button text
975
+ * @return {Ext.button.Button} this
976
+ */
977
+ setText: function(text) {
978
+ var me = this;
979
+ me.text = text;
980
+ if (me.rendered) {
981
+ me.btnInnerEl.update(text || '&#160;');
982
+ me.setComponentCls();
983
+ if (Ext.isStrict && Ext.isIE8) {
984
+ // weird repaint issue causes it to not resize
985
+ me.el.repaint();
986
+ }
987
+ me.updateLayout();
988
+ }
989
+ return me;
990
+ },
991
+
992
+ /**
993
+ * Sets the background image (inline style) of the button. This method also changes the value of the {@link #icon}
994
+ * config internally.
995
+ * @param {String} icon The path to an image to display in the button
996
+ * @return {Ext.button.Button} this
997
+ */
998
+ setIcon: function(icon) {
999
+ var me = this,
1000
+ btnIconEl = me.btnIconEl,
1001
+ oldIcon = me.icon;
1002
+
1003
+ me.icon = icon;
1004
+ if (btnIconEl) {
1005
+ btnIconEl.setStyle('background-image', icon ? 'url(' + icon + ')': '');
1006
+ me.setComponentCls();
1007
+ if (me.didIconStateChange(oldIcon, icon)) {
1008
+ me.updateLayout();
1009
+ }
1010
+ }
1011
+ return me;
1012
+ },
1013
+
1014
+ /**
1015
+ * Checks if the icon/iconCls changed from being empty to having a value, or having a value to being empty.
1016
+ * @private
1017
+ * @param {String} old The old icon/iconCls
1018
+ * @param {String} current The current icon/iconCls
1019
+ * @return {Boolean} True if the icon state changed
1020
+ */
1021
+ didIconStateChange: function(old, current) {
1022
+ var currentEmpty = Ext.isEmpty(current);
1023
+ return Ext.isEmpty(old) ? !currentEmpty : currentEmpty;
1024
+ },
1025
+
1026
+ /**
1027
+ * Gets the text for this Button
1028
+ * @return {String} The button text
1029
+ */
1030
+ getText: function() {
1031
+ return this.text;
1032
+ },
1033
+
1034
+ /**
1035
+ * If a state it passed, it becomes the pressed state otherwise the current state is toggled.
1036
+ * @param {Boolean} [state] Force a particular state
1037
+ * @param {Boolean} [suppressEvent=false] True to stop events being fired when calling this method.
1038
+ * @return {Ext.button.Button} this
1039
+ */
1040
+ toggle: function(state, suppressEvent) {
1041
+ var me = this;
1042
+ state = state === undefined ? !me.pressed: !!state;
1043
+ if (state !== me.pressed) {
1044
+ if (me.rendered) {
1045
+ me[state ? 'addClsWithUI': 'removeClsWithUI'](me.pressedCls);
1046
+ }
1047
+ me.pressed = state;
1048
+ if (!suppressEvent) {
1049
+ me.fireEvent('toggle', me, state);
1050
+ Ext.callback(me.toggleHandler, me.scope || me, [me, state]);
1051
+ }
1052
+ }
1053
+ return me;
1054
+ },
1055
+
1056
+ maybeShowMenu: function(){
1057
+ var me = this;
1058
+ if (me.menu && !me.hasVisibleMenu() && !me.ignoreNextClick) {
1059
+ me.showMenu();
1060
+ }
1061
+ },
1062
+
1063
+ /**
1064
+ * Shows this button's menu (if it has one)
1065
+ */
1066
+ showMenu: function() {
1067
+ var me = this;
1068
+ if (me.rendered && me.menu) {
1069
+ if (me.tooltip && me.getTipAttr() != 'title') {
1070
+ Ext.tip.QuickTipManager.getQuickTip().cancelShow(me.btnEl);
1071
+ }
1072
+ if (me.menu.isVisible()) {
1073
+ me.menu.hide();
1074
+ }
1075
+
1076
+ me.menu.showBy(me.el, me.menuAlign, ((!Ext.isStrict && Ext.isIE) || Ext.isIE6) ? [-2, -2] : undefined);
1077
+ }
1078
+ return me;
1079
+ },
1080
+
1081
+ /**
1082
+ * Hides this button's menu (if it has one)
1083
+ */
1084
+ hideMenu: function() {
1085
+ if (this.hasVisibleMenu()) {
1086
+ this.menu.hide();
1087
+ }
1088
+ return this;
1089
+ },
1090
+
1091
+ /**
1092
+ * Returns true if the button has a menu and it is visible
1093
+ * @return {Boolean}
1094
+ */
1095
+ hasVisibleMenu: function() {
1096
+ var menu = this.menu;
1097
+ return menu && menu.rendered && menu.isVisible();
1098
+ },
1099
+
1100
+ // private
1101
+ onRepeatClick: function(repeat, e) {
1102
+ this.onClick(e);
1103
+ },
1104
+
1105
+ // private
1106
+ onClick: function(e) {
1107
+ var me = this;
1108
+ if (me.preventDefault || (me.disabled && me.getHref()) && e) {
1109
+ e.preventDefault();
1110
+ }
1111
+ if (e.button !== 0) {
1112
+ return;
1113
+ }
1114
+ if (!me.disabled) {
1115
+ me.doToggle();
1116
+ me.maybeShowMenu();
1117
+ me.fireHandler(e);
1118
+ }
1119
+ },
1120
+
1121
+ fireHandler: function(e){
1122
+ var me = this,
1123
+ handler = me.handler;
1124
+
1125
+ if (me.fireEvent('click', me, e) !== false) {
1126
+ if (handler) {
1127
+ handler.call(me.scope || me, me, e);
1128
+ }
1129
+ me.blur();
1130
+ }
1131
+ },
1132
+
1133
+ doToggle: function(){
1134
+ var me = this;
1135
+ if (me.enableToggle && (me.allowDepress !== false || !me.pressed)) {
1136
+ me.toggle();
1137
+ }
1138
+ },
1139
+
1140
+ /**
1141
+ * @private mouseover handler called when a mouseover event occurs anywhere within the encapsulating element.
1142
+ * The targets are interrogated to see what is being entered from where.
1143
+ * @param e
1144
+ */
1145
+ onMouseOver: function(e) {
1146
+ var me = this;
1147
+ if (!me.disabled && !e.within(me.el, true, true)) {
1148
+ me.onMouseEnter(e);
1149
+ }
1150
+ },
1151
+
1152
+ /**
1153
+ * @private
1154
+ * mouseout handler called when a mouseout event occurs anywhere within the encapsulating element -
1155
+ * or the mouse leaves the encapsulating element.
1156
+ * The targets are interrogated to see what is being exited to where.
1157
+ * @param e
1158
+ */
1159
+ onMouseOut: function(e) {
1160
+ var me = this;
1161
+ if (!e.within(me.el, true, true)) {
1162
+ if (me.overMenuTrigger) {
1163
+ me.onMenuTriggerOut(e);
1164
+ }
1165
+ me.onMouseLeave(e);
1166
+ }
1167
+ },
1168
+
1169
+ /**
1170
+ * @private
1171
+ * mousemove handler called when the mouse moves anywhere within the encapsulating element.
1172
+ * The position is checked to determine if the mouse is entering or leaving the trigger area. Using
1173
+ * mousemove to check this is more resource intensive than we'd like, but it is necessary because
1174
+ * the trigger area does not line up exactly with sub-elements so we don't always get mouseover/out
1175
+ * events when needed. In the future we should consider making the trigger a separate element that
1176
+ * is absolutely positioned and sized over the trigger area.
1177
+ */
1178
+ onMouseMove: function(e) {
1179
+ var me = this,
1180
+ el = me.el,
1181
+ over = me.overMenuTrigger,
1182
+ overlap, btnSize;
1183
+
1184
+ if (me.split) {
1185
+ if (me.arrowAlign === 'right') {
1186
+ overlap = e.getX() - el.getX();
1187
+ btnSize = el.getWidth();
1188
+ } else {
1189
+ overlap = e.getY() - el.getY();
1190
+ btnSize = el.getHeight();
1191
+ }
1192
+
1193
+ if (overlap > (btnSize - me.getTriggerSize())) {
1194
+ if (!over) {
1195
+ me.onMenuTriggerOver(e);
1196
+ }
1197
+ } else {
1198
+ if (over) {
1199
+ me.onMenuTriggerOut(e);
1200
+ }
1201
+ }
1202
+ }
1203
+ },
1204
+
1205
+ /**
1206
+ * @private
1207
+ * Measures the size of the trigger area for menu and split buttons. Will be a width for
1208
+ * a right-aligned trigger and a height for a bottom-aligned trigger. Cached after first measurement.
1209
+ */
1210
+ getTriggerSize: function() {
1211
+ var me = this,
1212
+ size = me.triggerSize,
1213
+ side, sideFirstLetter, undef;
1214
+
1215
+ if (size === undef) {
1216
+ side = me.arrowAlign;
1217
+ sideFirstLetter = side.charAt(0);
1218
+ size = me.triggerSize = me.el.getFrameWidth(sideFirstLetter) + me.btnWrap.getFrameWidth(sideFirstLetter) + me.frameSize[side];
1219
+ }
1220
+ return size;
1221
+ },
1222
+
1223
+ /**
1224
+ * @private
1225
+ * virtual mouseenter handler called when it is detected that the mouseout event
1226
+ * signified the mouse entering the encapsulating element.
1227
+ * @param e
1228
+ */
1229
+ onMouseEnter: function(e) {
1230
+ var me = this;
1231
+ me.addClsWithUI(me.overCls);
1232
+ me.fireEvent('mouseover', me, e);
1233
+ },
1234
+
1235
+ /**
1236
+ * @private
1237
+ * virtual mouseleave handler called when it is detected that the mouseover event
1238
+ * signified the mouse entering the encapsulating element.
1239
+ * @param e
1240
+ */
1241
+ onMouseLeave: function(e) {
1242
+ var me = this;
1243
+ me.removeClsWithUI(me.overCls);
1244
+ me.fireEvent('mouseout', me, e);
1245
+ },
1246
+
1247
+ /**
1248
+ * @private
1249
+ * virtual mouseenter handler called when it is detected that the mouseover event
1250
+ * signified the mouse entering the arrow area of the button - the `<em>`.
1251
+ * @param e
1252
+ */
1253
+ onMenuTriggerOver: function(e) {
1254
+ var me = this;
1255
+ me.overMenuTrigger = true;
1256
+ me.fireEvent('menutriggerover', me, me.menu, e);
1257
+ },
1258
+
1259
+ /**
1260
+ * @private
1261
+ * virtual mouseleave handler called when it is detected that the mouseout event
1262
+ * signified the mouse leaving the arrow area of the button - the `<em>`.
1263
+ * @param e
1264
+ */
1265
+ onMenuTriggerOut: function(e) {
1266
+ var me = this;
1267
+ delete me.overMenuTrigger;
1268
+ me.fireEvent('menutriggerout', me, me.menu, e);
1269
+ },
1270
+
1271
+ // inherit docs
1272
+ enable : function(silent) {
1273
+ var me = this;
1274
+
1275
+ me.callParent(arguments);
1276
+
1277
+ if (me.btnEl) {
1278
+ me.btnEl.dom.disabled = false;
1279
+ }
1280
+ me.removeClsWithUI('disabled');
1281
+
1282
+ return me;
1283
+ },
1284
+
1285
+ // inherit docs
1286
+ disable : function(silent) {
1287
+ var me = this;
1288
+
1289
+ me.callParent(arguments);
1290
+
1291
+ if (me.btnEl) {
1292
+ me.btnEl.dom.disabled = true;
1293
+ }
1294
+ me.addClsWithUI('disabled');
1295
+ me.removeClsWithUI(me.overCls);
1296
+
1297
+ // IE renders disabled text by layering gray text on top of white text, offset by 1 pixel. Normally this is fine
1298
+ // but in some circumstances (such as using formBind) it gets confused and renders them side by side instead.
1299
+ if (me.btnInnerEl && (Ext.isIE6 || Ext.isIE7)) {
1300
+ me.btnInnerEl.repaint();
1301
+ }
1302
+
1303
+ return me;
1304
+ },
1305
+
1306
+ /**
1307
+ * Method to change the scale of the button. See {@link #scale} for allowed configurations.
1308
+ * @param {String} scale The scale to change to.
1309
+ */
1310
+ setScale: function(scale) {
1311
+ var me = this,
1312
+ ui = me.ui.replace('-' + me.scale, '');
1313
+
1314
+ //check if it is an allowed scale
1315
+ if (!Ext.Array.contains(me.allowedScales, scale)) {
1316
+ throw('#setScale: scale must be an allowed scale (' + me.allowedScales.join(', ') + ')');
1317
+ }
1318
+
1319
+ me.scale = scale;
1320
+ me.setUI(ui);
1321
+ },
1322
+
1323
+ // inherit docs
1324
+ setUI: function(ui) {
1325
+ var me = this;
1326
+
1327
+ //we need to append the scale to the UI, if not already done
1328
+ if (me.scale && !ui.match(me.scale)) {
1329
+ ui = ui + '-' + me.scale;
1330
+ }
1331
+
1332
+ me.callParent([ui]);
1333
+
1334
+ // Set all the state classNames, as they need to include the UI
1335
+ // me.disabledCls += ' ' + me.baseCls + '-' + me.ui + '-disabled';
1336
+ },
1337
+
1338
+ // private
1339
+ onMouseDown: function(e) {
1340
+ var me = this;
1341
+ if (!me.disabled && e.button === 0) {
1342
+ me.addClsWithUI(me.pressedCls);
1343
+ me.doc.on('mouseup', me.onMouseUp, me);
1344
+ }
1345
+ },
1346
+ // private
1347
+ onMouseUp: function(e) {
1348
+ var me = this;
1349
+ if (e.button === 0) {
1350
+ if (!me.pressed) {
1351
+ me.removeClsWithUI(me.pressedCls);
1352
+ }
1353
+ me.doc.un('mouseup', me.onMouseUp, me);
1354
+ }
1355
+ },
1356
+ // private
1357
+ onMenuShow: function(e) {
1358
+ var me = this;
1359
+ me.ignoreNextClick = 0;
1360
+ me.addClsWithUI(me.menuActiveCls);
1361
+ me.fireEvent('menushow', me, me.menu);
1362
+ },
1363
+
1364
+ // private
1365
+ onMenuHide: function(e) {
1366
+ var me = this;
1367
+ me.removeClsWithUI(me.menuActiveCls);
1368
+ me.ignoreNextClick = Ext.defer(me.restoreClick, 250, me);
1369
+ me.fireEvent('menuhide', me, me.menu);
1370
+ },
1371
+
1372
+ // private
1373
+ restoreClick: function() {
1374
+ this.ignoreNextClick = 0;
1375
+ },
1376
+
1377
+ // private
1378
+ onDownKey: function() {
1379
+ var me = this;
1380
+
1381
+ if (!me.disabled) {
1382
+ if (me.menu) {
1383
+ me.showMenu();
1384
+ }
1385
+ }
1386
+ },
1387
+
1388
+ /**
1389
+ * @private
1390
+ * Some browsers (notably Safari and older Chromes on Windows) add extra "padding" inside the button
1391
+ * element that cannot be removed. This method returns the size of that padding with a one-time detection.
1392
+ * @return {Number[]} [top, right, bottom, left]
1393
+ */
1394
+ getPersistentPadding: function() {
1395
+ var me = this,
1396
+ padding = me.persistentPadding,
1397
+ btn, leftTop, btnEl, btnInnerEl;
1398
+
1399
+ // Create auto-size button offscreen and measure its insides
1400
+ // Short-circuit IE as it sometimes gives false positive for padding
1401
+ if (!padding) {
1402
+ padding = me.self.prototype.persistentPadding = [0, 0, 0, 0];
1403
+ if (!Ext.isIE) {
1404
+ btn = new Ext.button.Button({
1405
+ text: 'test',
1406
+ style: 'position:absolute;top:-999px;'
1407
+ });
1408
+ btn.el = Ext.DomHelper.append(Ext.getBody(), btn.getRenderTree(), true);
1409
+ btn.applyChildEls(btn.el);
1410
+ btnEl = btn.btnEl;
1411
+ btnInnerEl = btn.btnInnerEl;
1412
+ btnEl.setSize(null, null); //clear any hard dimensions on the button el to see what it does naturally
1413
+ leftTop = btnInnerEl.getOffsetsTo(btnEl);
1414
+ padding[0] = leftTop[1];
1415
+ padding[1] = btnEl.getWidth() - btnInnerEl.getWidth() - leftTop[0];
1416
+ padding[2] = btnEl.getHeight() - btnInnerEl.getHeight() - leftTop[1];
1417
+ padding[3] = leftTop[0];
1418
+
1419
+ btn.destroy();
1420
+ btn.el.remove();
1421
+ }
1422
+ }
1423
+ return padding;
1424
+ }
1425
+ }, function() {
1426
+ var groups = {},
1427
+ toggleGroup = function(btn, state) {
1428
+ if (state) {
1429
+ var g = groups[btn.toggleGroup],
1430
+ length = g.length,
1431
+ i;
1432
+
1433
+ for (i = 0; i < length; i++) {
1434
+ if (g[i] !== btn) {
1435
+ g[i].toggle(false);
1436
+ }
1437
+ }
1438
+ }
1439
+ };
1440
+
1441
+ // Private utility class used by Button
1442
+ Ext.ButtonToggleManager = {
1443
+ register: function(btn) {
1444
+ if (!btn.toggleGroup) {
1445
+ return;
1446
+ }
1447
+ var group = groups[btn.toggleGroup];
1448
+ if (!group) {
1449
+ group = groups[btn.toggleGroup] = [];
1450
+ }
1451
+ group.push(btn);
1452
+ btn.on('toggle', toggleGroup);
1453
+ },
1454
+
1455
+ unregister: function(btn) {
1456
+ if (!btn.toggleGroup) {
1457
+ return;
1458
+ }
1459
+ var group = groups[btn.toggleGroup];
1460
+ if (group) {
1461
+ Ext.Array.remove(group, btn);
1462
+ btn.un('toggle', toggleGroup);
1463
+ }
1464
+ },
1465
+
1466
+ // Gets the pressed button in the passed group or null
1467
+ // @param {String} group
1468
+ // @return {Ext.button.Button}
1469
+ getPressed: function(group) {
1470
+ var g = groups[group],
1471
+ i = 0,
1472
+ len;
1473
+ if (g) {
1474
+ for (len = g.length; i < len; i++) {
1475
+ if (g[i].pressed === true) {
1476
+ return g[i];
1477
+ }
1478
+ }
1479
+ }
1480
+ return null;
1481
+ }
1482
+ };
1483
+ });