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,204 @@
1
+ /*
2
+ * This is a derivative of the similarly named class in the YUI Library.
3
+ * The original license:
4
+ * Copyright (c) 2006, Yahoo! Inc. All rights reserved.
5
+ * Code licensed under the BSD License:
6
+ * http://developer.yahoo.net/yui/license.txt
7
+ */
8
+
9
+ /**
10
+ * A DragDrop implementation that inserts an empty, bordered div into
11
+ * the document that follows the cursor during drag operations. At the time of
12
+ * the click, the frame div is resized to the dimensions of the linked html
13
+ * element, and moved to the exact location of the linked element.
14
+ *
15
+ * References to the "frame" element refer to the single proxy element that
16
+ * was created to be dragged in place of all DDProxy elements on the
17
+ * page.
18
+ */
19
+ Ext.define('Ext.dd.DDProxy', {
20
+ extend: 'Ext.dd.DD',
21
+
22
+ statics: {
23
+ /**
24
+ * The default drag frame div id
25
+ * @static
26
+ */
27
+ dragElId: "ygddfdiv"
28
+ },
29
+
30
+ /**
31
+ * Creates new DDProxy.
32
+ * @param {String} id the id of the linked html element
33
+ * @param {String} sGroup the group of related DragDrop objects
34
+ * @param {Object} config an object containing configurable attributes.
35
+ * Valid properties for DDProxy in addition to those in DragDrop:
36
+ *
37
+ * - resizeFrame
38
+ * - centerFrame
39
+ * - dragElId
40
+ */
41
+ constructor: function(id, sGroup, config) {
42
+ if (id) {
43
+ this.init(id, sGroup, config);
44
+ this.initFrame();
45
+ }
46
+ },
47
+
48
+ /**
49
+ * @property {Boolean} resizeFrame
50
+ * By default we resize the drag frame to be the same size as the element
51
+ * we want to drag (this is to get the frame effect). We can turn it off
52
+ * if we want a different behavior.
53
+ */
54
+ resizeFrame: true,
55
+
56
+ /**
57
+ * @property {Boolean} centerFrame
58
+ * By default the frame is positioned exactly where the drag element is, so
59
+ * we use the cursor offset provided by Ext.dd.DD. Another option that works only if
60
+ * you do not have constraints on the obj is to have the drag frame centered
61
+ * around the cursor. Set centerFrame to true for this effect.
62
+ */
63
+ centerFrame: false,
64
+
65
+ /**
66
+ * Creates the proxy element if it does not yet exist
67
+ */
68
+ createFrame: function() {
69
+ var self = this,
70
+ body = document.body,
71
+ div,
72
+ s;
73
+
74
+ if (!body || !body.firstChild) {
75
+ setTimeout( function() { self.createFrame(); }, 50 );
76
+ return;
77
+ }
78
+
79
+ div = this.getDragEl();
80
+
81
+ if (!div) {
82
+ div = document.createElement("div");
83
+ div.id = this.dragElId;
84
+ s = div.style;
85
+
86
+ s.position = "absolute";
87
+ s.visibility = "hidden";
88
+ s.cursor = "move";
89
+ s.border = "2px solid #aaa";
90
+ s.zIndex = 999;
91
+
92
+ // appendChild can blow up IE if invoked prior to the window load event
93
+ // while rendering a table. It is possible there are other scenarios
94
+ // that would cause this to happen as well.
95
+ body.insertBefore(div, body.firstChild);
96
+ }
97
+ },
98
+
99
+ /**
100
+ * Initialization for the drag frame element. Must be called in the
101
+ * constructor of all subclasses
102
+ */
103
+ initFrame: function() {
104
+ this.createFrame();
105
+ },
106
+
107
+ applyConfig: function() {
108
+ this.callParent();
109
+
110
+ this.resizeFrame = (this.config.resizeFrame !== false);
111
+ this.centerFrame = (this.config.centerFrame);
112
+ this.setDragElId(this.config.dragElId || Ext.dd.DDProxy.dragElId);
113
+ },
114
+
115
+ /**
116
+ * Resizes the drag frame to the dimensions of the clicked object, positions
117
+ * it over the object, and finally displays it
118
+ * @param {Number} iPageX X click position
119
+ * @param {Number} iPageY Y click position
120
+ * @private
121
+ */
122
+ showFrame: function(iPageX, iPageY) {
123
+ var el = this.getEl(),
124
+ dragEl = this.getDragEl(),
125
+ s = dragEl.style;
126
+
127
+ this._resizeProxy();
128
+
129
+ if (this.centerFrame) {
130
+ this.setDelta( Math.round(parseInt(s.width, 10)/2),
131
+ Math.round(parseInt(s.height, 10)/2) );
132
+ }
133
+
134
+ this.setDragElPos(iPageX, iPageY);
135
+
136
+ Ext.fly(dragEl).show();
137
+ },
138
+
139
+ /**
140
+ * The proxy is automatically resized to the dimensions of the linked
141
+ * element when a drag is initiated, unless resizeFrame is set to false
142
+ * @private
143
+ */
144
+ _resizeProxy: function() {
145
+ if (this.resizeFrame) {
146
+ var el = this.getEl();
147
+ Ext.fly(this.getDragEl()).setSize(el.offsetWidth, el.offsetHeight);
148
+ }
149
+ },
150
+
151
+ // overrides Ext.dd.DragDrop
152
+ b4MouseDown: function(e) {
153
+ var x = e.getPageX(),
154
+ y = e.getPageY();
155
+ this.autoOffset(x, y);
156
+ this.setDragElPos(x, y);
157
+ },
158
+
159
+ // overrides Ext.dd.DragDrop
160
+ b4StartDrag: function(x, y) {
161
+ // show the drag frame
162
+ this.showFrame(x, y);
163
+ },
164
+
165
+ // overrides Ext.dd.DragDrop
166
+ b4EndDrag: function(e) {
167
+ Ext.fly(this.getDragEl()).hide();
168
+ },
169
+
170
+ // overrides Ext.dd.DragDrop
171
+ // By default we try to move the element to the last location of the frame.
172
+ // This is so that the default behavior mirrors that of Ext.dd.DD.
173
+ endDrag: function(e) {
174
+
175
+ var lel = this.getEl(),
176
+ del = this.getDragEl();
177
+
178
+ // Show the drag frame briefly so we can get its position
179
+ del.style.visibility = "";
180
+
181
+ this.beforeMove();
182
+ // Hide the linked element before the move to get around a Safari
183
+ // rendering bug.
184
+ lel.style.visibility = "hidden";
185
+ Ext.dd.DDM.moveToEl(lel, del);
186
+ del.style.visibility = "hidden";
187
+ lel.style.visibility = "";
188
+
189
+ this.afterDrag();
190
+ },
191
+
192
+ beforeMove : function(){
193
+
194
+ },
195
+
196
+ afterDrag : function(){
197
+
198
+ },
199
+
200
+ toString: function() {
201
+ return ("DDProxy " + this.id);
202
+ }
203
+
204
+ });
@@ -0,0 +1,171 @@
1
+ /*
2
+ * This is a derivative of the similarly named class in the YUI Library.
3
+ * The original license:
4
+ * Copyright (c) 2006, Yahoo! Inc. All rights reserved.
5
+ * Code licensed under the BSD License:
6
+ * http://developer.yahoo.net/yui/license.txt
7
+ */
8
+
9
+
10
+ /**
11
+ * A DragDrop implementation that does not move, but can be a drop
12
+ * target. You would get the same result by simply omitting implementation
13
+ * for the event callbacks, but this way we reduce the processing cost of the
14
+ * event listener and the callbacks.
15
+ */
16
+ Ext.define('Ext.dd.DDTarget', {
17
+ extend: 'Ext.dd.DragDrop',
18
+
19
+ /**
20
+ * Creates new DDTarget.
21
+ * @param {String} id the id of the element that is a drop target
22
+ * @param {String} sGroup the group of related DragDrop objects
23
+ * @param {Object} config an object containing configurable attributes.
24
+ * Valid properties for DDTarget in addition to those in DragDrop: none.
25
+ */
26
+ constructor: function(id, sGroup, config) {
27
+ if (id) {
28
+ this.initTarget(id, sGroup, config);
29
+ }
30
+ },
31
+
32
+ /**
33
+ * Overridden and disabled. A DDTarget does not support being dragged.
34
+ * @method
35
+ */
36
+ getDragEl: Ext.emptyFn,
37
+ /**
38
+ * Overridden and disabled. A DDTarget does not support being dragged.
39
+ * @method
40
+ */
41
+ isValidHandleChild: Ext.emptyFn,
42
+ /**
43
+ * Overridden and disabled. A DDTarget does not support being dragged.
44
+ * @method
45
+ */
46
+ startDrag: Ext.emptyFn,
47
+ /**
48
+ * Overridden and disabled. A DDTarget does not support being dragged.
49
+ * @method
50
+ */
51
+ endDrag: Ext.emptyFn,
52
+ /**
53
+ * Overridden and disabled. A DDTarget does not support being dragged.
54
+ * @method
55
+ */
56
+ onDrag: Ext.emptyFn,
57
+ /**
58
+ * Overridden and disabled. A DDTarget does not support being dragged.
59
+ * @method
60
+ */
61
+ onDragDrop: Ext.emptyFn,
62
+ /**
63
+ * Overridden and disabled. A DDTarget does not support being dragged.
64
+ * @method
65
+ */
66
+ onDragEnter: Ext.emptyFn,
67
+ /**
68
+ * Overridden and disabled. A DDTarget does not support being dragged.
69
+ * @method
70
+ */
71
+ onDragOut: Ext.emptyFn,
72
+ /**
73
+ * Overridden and disabled. A DDTarget does not support being dragged.
74
+ * @method
75
+ */
76
+ onDragOver: Ext.emptyFn,
77
+ /**
78
+ * Overridden and disabled. A DDTarget does not support being dragged.
79
+ * @method
80
+ */
81
+ onInvalidDrop: Ext.emptyFn,
82
+ /**
83
+ * Overridden and disabled. A DDTarget does not support being dragged.
84
+ * @method
85
+ */
86
+ onMouseDown: Ext.emptyFn,
87
+ /**
88
+ * Overridden and disabled. A DDTarget does not support being dragged.
89
+ * @method
90
+ */
91
+ onMouseUp: Ext.emptyFn,
92
+ /**
93
+ * Overridden and disabled. A DDTarget does not support being dragged.
94
+ * @method
95
+ */
96
+ setXConstraint: Ext.emptyFn,
97
+ /**
98
+ * Overridden and disabled. A DDTarget does not support being dragged.
99
+ * @method
100
+ */
101
+ setYConstraint: Ext.emptyFn,
102
+ /**
103
+ * Overridden and disabled. A DDTarget does not support being dragged.
104
+ * @method
105
+ */
106
+ resetConstraints: Ext.emptyFn,
107
+ /**
108
+ * Overridden and disabled. A DDTarget does not support being dragged.
109
+ * @method
110
+ */
111
+ clearConstraints: Ext.emptyFn,
112
+ /**
113
+ * Overridden and disabled. A DDTarget does not support being dragged.
114
+ * @method
115
+ */
116
+ clearTicks: Ext.emptyFn,
117
+ /**
118
+ * Overridden and disabled. A DDTarget does not support being dragged.
119
+ * @method
120
+ */
121
+ setInitPosition: Ext.emptyFn,
122
+ /**
123
+ * Overridden and disabled. A DDTarget does not support being dragged.
124
+ * @method
125
+ */
126
+ setDragElId: Ext.emptyFn,
127
+ /**
128
+ * Overridden and disabled. A DDTarget does not support being dragged.
129
+ * @method
130
+ */
131
+ setHandleElId: Ext.emptyFn,
132
+ /**
133
+ * Overridden and disabled. A DDTarget does not support being dragged.
134
+ * @method
135
+ */
136
+ setOuterHandleElId: Ext.emptyFn,
137
+ /**
138
+ * Overridden and disabled. A DDTarget does not support being dragged.
139
+ * @method
140
+ */
141
+ addInvalidHandleClass: Ext.emptyFn,
142
+ /**
143
+ * Overridden and disabled. A DDTarget does not support being dragged.
144
+ * @method
145
+ */
146
+ addInvalidHandleId: Ext.emptyFn,
147
+ /**
148
+ * Overridden and disabled. A DDTarget does not support being dragged.
149
+ * @method
150
+ */
151
+ addInvalidHandleType: Ext.emptyFn,
152
+ /**
153
+ * Overridden and disabled. A DDTarget does not support being dragged.
154
+ * @method
155
+ */
156
+ removeInvalidHandleClass: Ext.emptyFn,
157
+ /**
158
+ * Overridden and disabled. A DDTarget does not support being dragged.
159
+ * @method
160
+ */
161
+ removeInvalidHandleId: Ext.emptyFn,
162
+ /**
163
+ * Overridden and disabled. A DDTarget does not support being dragged.
164
+ * @method
165
+ */
166
+ removeInvalidHandleType: Ext.emptyFn,
167
+
168
+ toString: function() {
169
+ return ("DDTarget " + this.id);
170
+ }
171
+ });
@@ -0,0 +1,1101 @@
1
+ /*
2
+ * This is a derivative of the similarly named class in the YUI Library.
3
+ * The original license:
4
+ * Copyright (c) 2006, Yahoo! Inc. All rights reserved.
5
+ * Code licensed under the BSD License:
6
+ * http://developer.yahoo.net/yui/license.txt
7
+ */
8
+
9
+
10
+ /**
11
+ * Defines the interface and base operation of items that that can be
12
+ * dragged or can be drop targets. It was designed to be extended, overriding
13
+ * the event handlers for startDrag, onDrag, onDragOver and onDragOut.
14
+ * Up to three html elements can be associated with a DragDrop instance:
15
+ *
16
+ * - linked element: the element that is passed into the constructor.
17
+ * This is the element which defines the boundaries for interaction with
18
+ * other DragDrop objects.
19
+ *
20
+ * - handle element(s): The drag operation only occurs if the element that
21
+ * was clicked matches a handle element. By default this is the linked
22
+ * element, but there are times that you will want only a portion of the
23
+ * linked element to initiate the drag operation, and the setHandleElId()
24
+ * method provides a way to define this.
25
+ *
26
+ * - drag element: this represents the element that would be moved along
27
+ * with the cursor during a drag operation. By default, this is the linked
28
+ * element itself as in {@link Ext.dd.DD}. setDragElId() lets you define
29
+ * a separate element that would be moved, as in {@link Ext.dd.DDProxy}.
30
+ *
31
+ * This class should not be instantiated until the onload event to ensure that
32
+ * the associated elements are available.
33
+ * The following would define a DragDrop obj that would interact with any
34
+ * other DragDrop obj in the "group1" group:
35
+ *
36
+ * dd = new Ext.dd.DragDrop("div1", "group1");
37
+ *
38
+ * Since none of the event handlers have been implemented, nothing would
39
+ * actually happen if you were to run the code above. Normally you would
40
+ * override this class or one of the default implementations, but you can
41
+ * also override the methods you want on an instance of the class...
42
+ *
43
+ * dd.onDragDrop = function(e, id) {
44
+ * alert("dd was dropped on " + id);
45
+ * }
46
+ *
47
+ */
48
+ Ext.define('Ext.dd.DragDrop', {
49
+ requires: ['Ext.dd.DragDropManager'],
50
+
51
+ /**
52
+ * Creates new DragDrop.
53
+ * @param {String} id of the element that is linked to this instance
54
+ * @param {String} sGroup the group of related DragDrop objects
55
+ * @param {Object} config an object containing configurable attributes.
56
+ * Valid properties for DragDrop:
57
+ *
58
+ * - padding
59
+ * - isTarget
60
+ * - maintainOffset
61
+ * - primaryButtonOnly
62
+ */
63
+ constructor: function(id, sGroup, config) {
64
+ if(id) {
65
+ this.init(id, sGroup, config);
66
+ }
67
+ },
68
+
69
+ /**
70
+ * @property {Boolean} ignoreSelf
71
+ * Set to false to enable a DragDrop object to fire drag events while dragging
72
+ * over its own Element. Defaults to true - DragDrop objects do not by default
73
+ * fire drag events to themselves.
74
+ */
75
+
76
+ /**
77
+ * @property {String} id
78
+ * The id of the element associated with this object. This is what we
79
+ * refer to as the "linked element" because the size and position of
80
+ * this element is used to determine when the drag and drop objects have
81
+ * interacted.
82
+ */
83
+ id: null,
84
+
85
+ /**
86
+ * @property {Object} config
87
+ * Configuration attributes passed into the constructor
88
+ */
89
+ config: null,
90
+
91
+ /**
92
+ * @property {String} dragElId
93
+ * The id of the element that will be dragged. By default this is same
94
+ * as the linked element, but could be changed to another element. Ex:
95
+ * Ext.dd.DDProxy
96
+ * @private
97
+ */
98
+ dragElId: null,
99
+
100
+ /**
101
+ * @property {String} handleElId
102
+ * The ID of the element that initiates the drag operation. By default
103
+ * this is the linked element, but could be changed to be a child of this
104
+ * element. This lets us do things like only starting the drag when the
105
+ * header element within the linked html element is clicked.
106
+ * @private
107
+ */
108
+ handleElId: null,
109
+
110
+ /**
111
+ * @property {Object} invalidHandleTypes
112
+ * An object who's property names identify HTML tags to be considered invalid as drag handles.
113
+ * A non-null property value identifies the tag as invalid. Defaults to the
114
+ * following value which prevents drag operations from being initiated by `<a>` elements:
115
+ *
116
+ * {
117
+ * A: "A"
118
+ * }
119
+ */
120
+ invalidHandleTypes: null,
121
+
122
+ /**
123
+ * @property {Object} invalidHandleIds
124
+ * An object who's property names identify the IDs of elements to be considered invalid as drag handles.
125
+ * A non-null property value identifies the ID as invalid. For example, to prevent
126
+ * dragging from being initiated on element ID "foo", use:
127
+ *
128
+ * {
129
+ * foo: true
130
+ * }
131
+ */
132
+ invalidHandleIds: null,
133
+
134
+ /**
135
+ * @property {String[]} invalidHandleClasses
136
+ * An Array of CSS class names for elements to be considered in valid as drag handles.
137
+ */
138
+ invalidHandleClasses: null,
139
+
140
+ /**
141
+ * @property {Number} startPageX
142
+ * The linked element's absolute X position at the time the drag was
143
+ * started
144
+ * @private
145
+ */
146
+ startPageX: 0,
147
+
148
+ /**
149
+ * @property {Number} startPageY
150
+ * The linked element's absolute X position at the time the drag was
151
+ * started
152
+ * @private
153
+ */
154
+ startPageY: 0,
155
+
156
+ /**
157
+ * @property {Object} groups
158
+ * The group defines a logical collection of DragDrop objects that are
159
+ * related. Instances only get events when interacting with other
160
+ * DragDrop object in the same group. This lets us define multiple
161
+ * groups using a single DragDrop subclass if we want.
162
+ *
163
+ * An object in the format {'group1':true, 'group2':true}
164
+ */
165
+ groups: null,
166
+
167
+ /**
168
+ * @property {Boolean} locked
169
+ * Individual drag/drop instances can be locked. This will prevent
170
+ * onmousedown start drag.
171
+ * @private
172
+ */
173
+ locked: false,
174
+
175
+ /**
176
+ * Locks this instance
177
+ */
178
+ lock: function() {
179
+ this.locked = true;
180
+ },
181
+
182
+ /**
183
+ * @property {Boolean} moveOnly
184
+ * When set to true, other DD objects in cooperating DDGroups do not receive
185
+ * notification events when this DD object is dragged over them.
186
+ */
187
+ moveOnly: false,
188
+
189
+ /**
190
+ * Unlocks this instace
191
+ */
192
+ unlock: function() {
193
+ this.locked = false;
194
+ },
195
+
196
+ /**
197
+ * @property {Boolean} isTarget
198
+ * By default, all instances can be a drop target. This can be disabled by
199
+ * setting isTarget to false.
200
+ */
201
+ isTarget: true,
202
+
203
+ /**
204
+ * @property {Number[]} padding
205
+ * The padding configured for this drag and drop object for calculating
206
+ * the drop zone intersection with this object.
207
+ * An array containing the 4 padding values: [top, right, bottom, left]
208
+ */
209
+ padding: null,
210
+
211
+ /**
212
+ * @property _domRef
213
+ * Cached reference to the linked element
214
+ * @private
215
+ */
216
+ _domRef: null,
217
+
218
+ /**
219
+ * @property __ygDragDrop
220
+ * Internal typeof flag
221
+ * @private
222
+ */
223
+ __ygDragDrop: true,
224
+
225
+ /**
226
+ * @property {Boolean} constrainX
227
+ * Set to true when horizontal contraints are applied
228
+ * @private
229
+ */
230
+ constrainX: false,
231
+
232
+ /**
233
+ * @property {Boolean} constrainY
234
+ * Set to true when vertical contraints are applied
235
+ * @private
236
+ */
237
+ constrainY: false,
238
+
239
+ /**
240
+ * @property {Number} minX
241
+ * The left constraint
242
+ * @private
243
+ */
244
+ minX: 0,
245
+
246
+ /**
247
+ * @property {Number} maxX
248
+ * The right constraint
249
+ * @private
250
+ */
251
+ maxX: 0,
252
+
253
+ /**
254
+ * @property {Number} minY
255
+ * The up constraint
256
+ * @private
257
+ */
258
+ minY: 0,
259
+
260
+ /**
261
+ * @property {Number} maxY
262
+ * The down constraint
263
+ * @private
264
+ */
265
+ maxY: 0,
266
+
267
+ /**
268
+ * @property {Boolean} maintainOffset
269
+ * Maintain offsets when we resetconstraints. Set to true when you want
270
+ * the position of the element relative to its parent to stay the same
271
+ * when the page changes
272
+ */
273
+ maintainOffset: false,
274
+
275
+ /**
276
+ * @property {Number[]} xTicks
277
+ * Array of pixel locations the element will snap to if we specified a
278
+ * horizontal graduation/interval. This array is generated automatically
279
+ * when you define a tick interval.
280
+ */
281
+ xTicks: null,
282
+
283
+ /**
284
+ * @property {Number[]} yTicks
285
+ * Array of pixel locations the element will snap to if we specified a
286
+ * vertical graduation/interval. This array is generated automatically
287
+ * when you define a tick interval.
288
+ */
289
+ yTicks: null,
290
+
291
+ /**
292
+ * @property {Boolean} primaryButtonOnly
293
+ * By default the drag and drop instance will only respond to the primary
294
+ * button click (left button for a right-handed mouse). Set to true to
295
+ * allow drag and drop to start with any mouse click that is propogated
296
+ * by the browser
297
+ */
298
+ primaryButtonOnly: true,
299
+
300
+ /**
301
+ * @property {Boolean} available
302
+ * The available property is false until the linked dom element is accessible.
303
+ */
304
+ available: false,
305
+
306
+ /**
307
+ * @property {Boolean} hasOuterHandles
308
+ * By default, drags can only be initiated if the mousedown occurs in the
309
+ * region the linked element is. This is done in part to work around a
310
+ * bug in some browsers that mis-report the mousedown if the previous
311
+ * mouseup happened outside of the window. This property is set to true
312
+ * if outer handles are defined. Defaults to false.
313
+ */
314
+ hasOuterHandles: false,
315
+
316
+ /**
317
+ * Code that executes immediately before the startDrag event
318
+ * @private
319
+ */
320
+ b4StartDrag: function(x, y) { },
321
+
322
+ /**
323
+ * Abstract method called after a drag/drop object is clicked
324
+ * and the drag or mousedown time thresholds have beeen met.
325
+ * @param {Number} X click location
326
+ * @param {Number} Y click location
327
+ */
328
+ startDrag: function(x, y) { /* override this */ },
329
+
330
+ /**
331
+ * Code that executes immediately before the onDrag event
332
+ * @private
333
+ */
334
+ b4Drag: function(e) { },
335
+
336
+ /**
337
+ * Abstract method called during the onMouseMove event while dragging an
338
+ * object.
339
+ * @param {Event} e the mousemove event
340
+ */
341
+ onDrag: function(e) { /* override this */ },
342
+
343
+ /**
344
+ * Abstract method called when this element fist begins hovering over
345
+ * another DragDrop obj
346
+ * @param {Event} e the mousemove event
347
+ * @param {String/Ext.dd.DragDrop[]} id In POINT mode, the element
348
+ * id this is hovering over. In INTERSECT mode, an array of one or more
349
+ * dragdrop items being hovered over.
350
+ */
351
+ onDragEnter: function(e, id) { /* override this */ },
352
+
353
+ /**
354
+ * Code that executes immediately before the onDragOver event
355
+ * @private
356
+ */
357
+ b4DragOver: function(e) { },
358
+
359
+ /**
360
+ * Abstract method called when this element is hovering over another
361
+ * DragDrop obj
362
+ * @param {Event} e the mousemove event
363
+ * @param {String/Ext.dd.DragDrop[]} id In POINT mode, the element
364
+ * id this is hovering over. In INTERSECT mode, an array of dd items
365
+ * being hovered over.
366
+ */
367
+ onDragOver: function(e, id) { /* override this */ },
368
+
369
+ /**
370
+ * Code that executes immediately before the onDragOut event
371
+ * @private
372
+ */
373
+ b4DragOut: function(e) { },
374
+
375
+ /**
376
+ * Abstract method called when we are no longer hovering over an element
377
+ * @param {Event} e the mousemove event
378
+ * @param {String/Ext.dd.DragDrop[]} id In POINT mode, the element
379
+ * id this was hovering over. In INTERSECT mode, an array of dd items
380
+ * that the mouse is no longer over.
381
+ */
382
+ onDragOut: function(e, id) { /* override this */ },
383
+
384
+ /**
385
+ * Code that executes immediately before the onDragDrop event
386
+ * @private
387
+ */
388
+ b4DragDrop: function(e) { },
389
+
390
+ /**
391
+ * Abstract method called when this item is dropped on another DragDrop
392
+ * obj
393
+ * @param {Event} e the mouseup event
394
+ * @param {String/Ext.dd.DragDrop[]} id In POINT mode, the element
395
+ * id this was dropped on. In INTERSECT mode, an array of dd items this
396
+ * was dropped on.
397
+ */
398
+ onDragDrop: function(e, id) { /* override this */ },
399
+
400
+ /**
401
+ * Abstract method called when this item is dropped on an area with no
402
+ * drop target
403
+ * @param {Event} e the mouseup event
404
+ */
405
+ onInvalidDrop: function(e) { /* override this */ },
406
+
407
+ /**
408
+ * Code that executes immediately before the endDrag event
409
+ * @private
410
+ */
411
+ b4EndDrag: function(e) { },
412
+
413
+ /**
414
+ * Called when we are done dragging the object
415
+ * @param {Event} e the mouseup event
416
+ */
417
+ endDrag: function(e) { /* override this */ },
418
+
419
+ /**
420
+ * Code executed immediately before the onMouseDown event
421
+ * @param {Event} e the mousedown event
422
+ * @private
423
+ */
424
+ b4MouseDown: function(e) { },
425
+
426
+ /**
427
+ * Called when a drag/drop obj gets a mousedown
428
+ * @param {Event} e the mousedown event
429
+ */
430
+ onMouseDown: function(e) { /* override this */ },
431
+
432
+ /**
433
+ * Called when a drag/drop obj gets a mouseup
434
+ * @param {Event} e the mouseup event
435
+ */
436
+ onMouseUp: function(e) { /* override this */ },
437
+
438
+ /**
439
+ * Override the onAvailable method to do what is needed after the initial
440
+ * position was determined.
441
+ */
442
+ onAvailable: function () {
443
+ },
444
+
445
+ /**
446
+ * @property {Object} defaultPadding
447
+ * Provides default constraint padding to "constrainTo" elements.
448
+ */
449
+ defaultPadding: {
450
+ left: 0,
451
+ right: 0,
452
+ top: 0,
453
+ bottom: 0
454
+ },
455
+
456
+ /**
457
+ * Initializes the drag drop object's constraints to restrict movement to a certain element.
458
+ *
459
+ * Usage:
460
+ *
461
+ * var dd = new Ext.dd.DDProxy("dragDiv1", "proxytest",
462
+ * { dragElId: "existingProxyDiv" });
463
+ * dd.startDrag = function(){
464
+ * this.constrainTo("parent-id");
465
+ * };
466
+ *
467
+ * Or you can initalize it using the {@link Ext.Element} object:
468
+ *
469
+ * Ext.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
470
+ * startDrag : function(){
471
+ * this.constrainTo("parent-id");
472
+ * }
473
+ * });
474
+ *
475
+ * @param {String/HTMLElement/Ext.Element} constrainTo The element or element ID to constrain to.
476
+ * @param {Object/Number} pad (optional) Pad provides a way to specify "padding" of the constraints,
477
+ * and can be either a number for symmetrical padding (4 would be equal to `{left:4, right:4, top:4, bottom:4}`) or
478
+ * an object containing the sides to pad. For example: `{right:10, bottom:10}`
479
+ * @param {Boolean} inContent (optional) Constrain the draggable in the content box of the element (inside padding and borders)
480
+ */
481
+ constrainTo : function(constrainTo, pad, inContent){
482
+ if(Ext.isNumber(pad)){
483
+ pad = {left: pad, right:pad, top:pad, bottom:pad};
484
+ }
485
+ pad = pad || this.defaultPadding;
486
+ var b = Ext.get(this.getEl()).getBox(),
487
+ ce = Ext.get(constrainTo),
488
+ s = ce.getScroll(),
489
+ c,
490
+ cd = ce.dom,
491
+ xy,
492
+ topSpace,
493
+ leftSpace;
494
+ if(cd == document.body){
495
+ c = { x: s.left, y: s.top, width: Ext.Element.getViewWidth(), height: Ext.Element.getViewHeight()};
496
+ }else{
497
+ xy = ce.getXY();
498
+ c = {x : xy[0], y: xy[1], width: cd.clientWidth, height: cd.clientHeight};
499
+ }
500
+
501
+ topSpace = b.y - c.y;
502
+ leftSpace = b.x - c.x;
503
+
504
+ this.resetConstraints();
505
+ this.setXConstraint(leftSpace - (pad.left||0), // left
506
+ c.width - leftSpace - b.width - (pad.right||0), //right
507
+ this.xTickSize
508
+ );
509
+ this.setYConstraint(topSpace - (pad.top||0), //top
510
+ c.height - topSpace - b.height - (pad.bottom||0), //bottom
511
+ this.yTickSize
512
+ );
513
+ },
514
+
515
+ /**
516
+ * Returns a reference to the linked element
517
+ * @return {HTMLElement} the html element
518
+ */
519
+ getEl: function() {
520
+ if (!this._domRef) {
521
+ this._domRef = Ext.getDom(this.id);
522
+ }
523
+
524
+ return this._domRef;
525
+ },
526
+
527
+ /**
528
+ * Returns a reference to the actual element to drag. By default this is
529
+ * the same as the html element, but it can be assigned to another
530
+ * element. An example of this can be found in Ext.dd.DDProxy
531
+ * @return {HTMLElement} the html element
532
+ */
533
+ getDragEl: function() {
534
+ return Ext.getDom(this.dragElId);
535
+ },
536
+
537
+ /**
538
+ * Sets up the DragDrop object. Must be called in the constructor of any
539
+ * Ext.dd.DragDrop subclass
540
+ * @param {String} id the id of the linked element
541
+ * @param {String} sGroup the group of related items
542
+ * @param {Object} config configuration attributes
543
+ */
544
+ init: function(id, sGroup, config) {
545
+ this.initTarget(id, sGroup, config);
546
+ Ext.EventManager.on(this.id, "mousedown", this.handleMouseDown, this);
547
+ // Ext.EventManager.on(this.id, "selectstart", Event.preventDefault);
548
+ },
549
+
550
+ /**
551
+ * Initializes Targeting functionality only... the object does not
552
+ * get a mousedown handler.
553
+ * @param {String} id the id of the linked element
554
+ * @param {String} sGroup the group of related items
555
+ * @param {Object} config configuration attributes
556
+ */
557
+ initTarget: function(id, sGroup, config) {
558
+ // configuration attributes
559
+ this.config = config || {};
560
+
561
+ // create a local reference to the drag and drop manager
562
+ this.DDMInstance = Ext.dd.DragDropManager;
563
+ // initialize the groups array
564
+ this.groups = {};
565
+
566
+ // assume that we have an element reference instead of an id if the
567
+ // parameter is not a string
568
+ if (typeof id !== "string") {
569
+ id = Ext.id(id);
570
+ }
571
+
572
+ // set the id
573
+ this.id = id;
574
+
575
+ // add to an interaction group
576
+ this.addToGroup((sGroup) ? sGroup : "default");
577
+
578
+ // We don't want to register this as the handle with the manager
579
+ // so we just set the id rather than calling the setter.
580
+ this.handleElId = id;
581
+
582
+ // the linked element is the element that gets dragged by default
583
+ this.setDragElId(id);
584
+
585
+ // by default, clicked anchors will not start drag operations.
586
+ this.invalidHandleTypes = { A: "A" };
587
+ this.invalidHandleIds = {};
588
+ this.invalidHandleClasses = [];
589
+
590
+ this.applyConfig();
591
+
592
+ this.handleOnAvailable();
593
+ },
594
+
595
+ /**
596
+ * Applies the configuration parameters that were passed into the constructor.
597
+ * This is supposed to happen at each level through the inheritance chain. So
598
+ * a DDProxy implentation will execute apply config on DDProxy, DD, and
599
+ * DragDrop in order to get all of the parameters that are available in
600
+ * each object.
601
+ */
602
+ applyConfig: function() {
603
+
604
+ // configurable properties:
605
+ // padding, isTarget, maintainOffset, primaryButtonOnly
606
+ this.padding = this.config.padding || [0, 0, 0, 0];
607
+ this.isTarget = (this.config.isTarget !== false);
608
+ this.maintainOffset = (this.config.maintainOffset);
609
+ this.primaryButtonOnly = (this.config.primaryButtonOnly !== false);
610
+
611
+ },
612
+
613
+ /**
614
+ * Executed when the linked element is available
615
+ * @private
616
+ */
617
+ handleOnAvailable: function() {
618
+ this.available = true;
619
+ this.resetConstraints();
620
+ this.onAvailable();
621
+ },
622
+
623
+ /**
624
+ * Configures the padding for the target zone in px. Effectively expands
625
+ * (or reduces) the virtual object size for targeting calculations.
626
+ * Supports css-style shorthand; if only one parameter is passed, all sides
627
+ * will have that padding, and if only two are passed, the top and bottom
628
+ * will have the first param, the left and right the second.
629
+ * @param {Number} iTop Top pad
630
+ * @param {Number} iRight Right pad
631
+ * @param {Number} iBot Bot pad
632
+ * @param {Number} iLeft Left pad
633
+ */
634
+ setPadding: function(iTop, iRight, iBot, iLeft) {
635
+ // this.padding = [iLeft, iRight, iTop, iBot];
636
+ if (!iRight && 0 !== iRight) {
637
+ this.padding = [iTop, iTop, iTop, iTop];
638
+ } else if (!iBot && 0 !== iBot) {
639
+ this.padding = [iTop, iRight, iTop, iRight];
640
+ } else {
641
+ this.padding = [iTop, iRight, iBot, iLeft];
642
+ }
643
+ },
644
+
645
+ /**
646
+ * Stores the initial placement of the linked element.
647
+ * @param {Number} diffX the X offset, default 0
648
+ * @param {Number} diffY the Y offset, default 0
649
+ */
650
+ setInitPosition: function(diffX, diffY) {
651
+ var el = this.getEl(),
652
+ dx, dy, p;
653
+
654
+ if (!this.DDMInstance.verifyEl(el)) {
655
+ return;
656
+ }
657
+
658
+ dx = diffX || 0;
659
+ dy = diffY || 0;
660
+
661
+ p = Ext.Element.getXY( el );
662
+
663
+ this.initPageX = p[0] - dx;
664
+ this.initPageY = p[1] - dy;
665
+
666
+ this.lastPageX = p[0];
667
+ this.lastPageY = p[1];
668
+
669
+ this.setStartPosition(p);
670
+ },
671
+
672
+ /**
673
+ * Sets the start position of the element. This is set when the obj
674
+ * is initialized, the reset when a drag is started.
675
+ * @param pos current position (from previous lookup)
676
+ * @private
677
+ */
678
+ setStartPosition: function(pos) {
679
+ var p = pos || Ext.Element.getXY( this.getEl() );
680
+ this.deltaSetXY = null;
681
+
682
+ this.startPageX = p[0];
683
+ this.startPageY = p[1];
684
+ },
685
+
686
+ /**
687
+ * Adds this instance to a group of related drag/drop objects. All
688
+ * instances belong to at least one group, and can belong to as many
689
+ * groups as needed.
690
+ * @param {String} sGroup the name of the group
691
+ */
692
+ addToGroup: function(sGroup) {
693
+ this.groups[sGroup] = true;
694
+ this.DDMInstance.regDragDrop(this, sGroup);
695
+ },
696
+
697
+ /**
698
+ * Removes this instance from the supplied interaction group
699
+ * @param {String} sGroup The group to drop
700
+ */
701
+ removeFromGroup: function(sGroup) {
702
+ if (this.groups[sGroup]) {
703
+ delete this.groups[sGroup];
704
+ }
705
+
706
+ this.DDMInstance.removeDDFromGroup(this, sGroup);
707
+ },
708
+
709
+ /**
710
+ * Allows you to specify that an element other than the linked element
711
+ * will be moved with the cursor during a drag
712
+ * @param {String} id the id of the element that will be used to initiate the drag
713
+ */
714
+ setDragElId: function(id) {
715
+ this.dragElId = id;
716
+ },
717
+
718
+ /**
719
+ * Allows you to specify a child of the linked element that should be
720
+ * used to initiate the drag operation. An example of this would be if
721
+ * you have a content div with text and links. Clicking anywhere in the
722
+ * content area would normally start the drag operation. Use this method
723
+ * to specify that an element inside of the content div is the element
724
+ * that starts the drag operation.
725
+ * @param {String} id the id of the element that will be used to
726
+ * initiate the drag.
727
+ */
728
+ setHandleElId: function(id) {
729
+ if (typeof id !== "string") {
730
+ id = Ext.id(id);
731
+ }
732
+ this.handleElId = id;
733
+ this.DDMInstance.regHandle(this.id, id);
734
+ },
735
+
736
+ /**
737
+ * Allows you to set an element outside of the linked element as a drag
738
+ * handle
739
+ * @param {String} id the id of the element that will be used to initiate the drag
740
+ */
741
+ setOuterHandleElId: function(id) {
742
+ if (typeof id !== "string") {
743
+ id = Ext.id(id);
744
+ }
745
+ Ext.EventManager.on(id, "mousedown", this.handleMouseDown, this);
746
+ this.setHandleElId(id);
747
+
748
+ this.hasOuterHandles = true;
749
+ },
750
+
751
+ /**
752
+ * Removes all drag and drop hooks for this element
753
+ */
754
+ unreg: function() {
755
+ Ext.EventManager.un(this.id, "mousedown", this.handleMouseDown, this);
756
+ this._domRef = null;
757
+ this.DDMInstance._remove(this);
758
+ },
759
+
760
+ destroy : function(){
761
+ this.unreg();
762
+ },
763
+
764
+ /**
765
+ * Returns true if this instance is locked, or the drag drop mgr is locked
766
+ * (meaning that all drag/drop is disabled on the page.)
767
+ * @return {Boolean} true if this obj or all drag/drop is locked, else
768
+ * false
769
+ */
770
+ isLocked: function() {
771
+ return (this.DDMInstance.isLocked() || this.locked);
772
+ },
773
+
774
+ /**
775
+ * Called when this object is clicked
776
+ * @param {Event} e
777
+ * @param {Ext.dd.DragDrop} oDD the clicked dd object (this dd obj)
778
+ * @private
779
+ */
780
+ handleMouseDown: function(e, oDD){
781
+ if (this.primaryButtonOnly && e.button != 0) {
782
+ return;
783
+ }
784
+
785
+ if (this.isLocked()) {
786
+ return;
787
+ }
788
+
789
+ this.DDMInstance.refreshCache(this.groups);
790
+
791
+ if (this.hasOuterHandles || this.DDMInstance.isOverTarget(e.getPoint(), this) ) {
792
+ if (this.clickValidator(e)) {
793
+ // set the initial element position
794
+ this.setStartPosition();
795
+ this.b4MouseDown(e);
796
+ this.onMouseDown(e);
797
+
798
+ this.DDMInstance.handleMouseDown(e, this);
799
+
800
+ this.DDMInstance.stopEvent(e);
801
+ }
802
+ }
803
+ },
804
+
805
+ clickValidator: function(e) {
806
+ var target = e.getTarget();
807
+ return ( this.isValidHandleChild(target) &&
808
+ (this.id == this.handleElId ||
809
+ this.DDMInstance.handleWasClicked(target, this.id)) );
810
+ },
811
+
812
+ /**
813
+ * Allows you to specify a tag name that should not start a drag operation
814
+ * when clicked. This is designed to facilitate embedding links within a
815
+ * drag handle that do something other than start the drag.
816
+ * @method addInvalidHandleType
817
+ * @param {String} tagName the type of element to exclude
818
+ */
819
+ addInvalidHandleType: function(tagName) {
820
+ var type = tagName.toUpperCase();
821
+ this.invalidHandleTypes[type] = type;
822
+ },
823
+
824
+ /**
825
+ * Lets you to specify an element id for a child of a drag handle
826
+ * that should not initiate a drag
827
+ * @method addInvalidHandleId
828
+ * @param {String} id the element id of the element you wish to ignore
829
+ */
830
+ addInvalidHandleId: function(id) {
831
+ if (typeof id !== "string") {
832
+ id = Ext.id(id);
833
+ }
834
+ this.invalidHandleIds[id] = id;
835
+ },
836
+
837
+ /**
838
+ * Lets you specify a css class of elements that will not initiate a drag
839
+ * @param {String} cssClass the class of the elements you wish to ignore
840
+ */
841
+ addInvalidHandleClass: function(cssClass) {
842
+ this.invalidHandleClasses.push(cssClass);
843
+ },
844
+
845
+ /**
846
+ * Unsets an excluded tag name set by addInvalidHandleType
847
+ * @param {String} tagName the type of element to unexclude
848
+ */
849
+ removeInvalidHandleType: function(tagName) {
850
+ var type = tagName.toUpperCase();
851
+ // this.invalidHandleTypes[type] = null;
852
+ delete this.invalidHandleTypes[type];
853
+ },
854
+
855
+ /**
856
+ * Unsets an invalid handle id
857
+ * @param {String} id the id of the element to re-enable
858
+ */
859
+ removeInvalidHandleId: function(id) {
860
+ if (typeof id !== "string") {
861
+ id = Ext.id(id);
862
+ }
863
+ delete this.invalidHandleIds[id];
864
+ },
865
+
866
+ /**
867
+ * Unsets an invalid css class
868
+ * @param {String} cssClass the class of the element(s) you wish to
869
+ * re-enable
870
+ */
871
+ removeInvalidHandleClass: function(cssClass) {
872
+ for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {
873
+ if (this.invalidHandleClasses[i] == cssClass) {
874
+ delete this.invalidHandleClasses[i];
875
+ }
876
+ }
877
+ },
878
+
879
+ /**
880
+ * Checks the tag exclusion list to see if this click should be ignored
881
+ * @param {HTMLElement} node the HTMLElement to evaluate
882
+ * @return {Boolean} true if this is a valid tag type, false if not
883
+ */
884
+ isValidHandleChild: function(node) {
885
+
886
+ var valid = true,
887
+ nodeName,
888
+ i, len;
889
+ // var n = (node.nodeName == "#text") ? node.parentNode : node;
890
+ try {
891
+ nodeName = node.nodeName.toUpperCase();
892
+ } catch(e) {
893
+ nodeName = node.nodeName;
894
+ }
895
+ valid = valid && !this.invalidHandleTypes[nodeName];
896
+ valid = valid && !this.invalidHandleIds[node.id];
897
+
898
+ for (i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
899
+ valid = !Ext.fly(node).hasCls(this.invalidHandleClasses[i]);
900
+ }
901
+
902
+
903
+ return valid;
904
+
905
+ },
906
+
907
+ /**
908
+ * Creates the array of horizontal tick marks if an interval was specified
909
+ * in setXConstraint().
910
+ * @private
911
+ */
912
+ setXTicks: function(iStartX, iTickSize) {
913
+ this.xTicks = [];
914
+ this.xTickSize = iTickSize;
915
+
916
+ var tickMap = {},
917
+ i;
918
+
919
+ for (i = this.initPageX; i >= this.minX; i = i - iTickSize) {
920
+ if (!tickMap[i]) {
921
+ this.xTicks[this.xTicks.length] = i;
922
+ tickMap[i] = true;
923
+ }
924
+ }
925
+
926
+ for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
927
+ if (!tickMap[i]) {
928
+ this.xTicks[this.xTicks.length] = i;
929
+ tickMap[i] = true;
930
+ }
931
+ }
932
+
933
+ Ext.Array.sort(this.xTicks, this.DDMInstance.numericSort);
934
+ },
935
+
936
+ /**
937
+ * Creates the array of vertical tick marks if an interval was specified in
938
+ * setYConstraint().
939
+ * @private
940
+ */
941
+ setYTicks: function(iStartY, iTickSize) {
942
+ this.yTicks = [];
943
+ this.yTickSize = iTickSize;
944
+
945
+ var tickMap = {},
946
+ i;
947
+
948
+ for (i = this.initPageY; i >= this.minY; i = i - iTickSize) {
949
+ if (!tickMap[i]) {
950
+ this.yTicks[this.yTicks.length] = i;
951
+ tickMap[i] = true;
952
+ }
953
+ }
954
+
955
+ for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
956
+ if (!tickMap[i]) {
957
+ this.yTicks[this.yTicks.length] = i;
958
+ tickMap[i] = true;
959
+ }
960
+ }
961
+
962
+ Ext.Array.sort(this.yTicks, this.DDMInstance.numericSort);
963
+ },
964
+
965
+ /**
966
+ * By default, the element can be dragged any place on the screen. Use
967
+ * this method to limit the horizontal travel of the element. Pass in
968
+ * 0,0 for the parameters if you want to lock the drag to the y axis.
969
+ * @param {Number} iLeft the number of pixels the element can move to the left
970
+ * @param {Number} iRight the number of pixels the element can move to the
971
+ * right
972
+ * @param {Number} iTickSize (optional) parameter for specifying that the
973
+ * element should move iTickSize pixels at a time.
974
+ */
975
+ setXConstraint: function(iLeft, iRight, iTickSize) {
976
+ this.leftConstraint = iLeft;
977
+ this.rightConstraint = iRight;
978
+
979
+ this.minX = this.initPageX - iLeft;
980
+ this.maxX = this.initPageX + iRight;
981
+ if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
982
+
983
+ this.constrainX = true;
984
+ },
985
+
986
+ /**
987
+ * Clears any constraints applied to this instance. Also clears ticks
988
+ * since they can't exist independent of a constraint at this time.
989
+ */
990
+ clearConstraints: function() {
991
+ this.constrainX = false;
992
+ this.constrainY = false;
993
+ this.clearTicks();
994
+ },
995
+
996
+ /**
997
+ * Clears any tick interval defined for this instance
998
+ */
999
+ clearTicks: function() {
1000
+ this.xTicks = null;
1001
+ this.yTicks = null;
1002
+ this.xTickSize = 0;
1003
+ this.yTickSize = 0;
1004
+ },
1005
+
1006
+ /**
1007
+ * By default, the element can be dragged any place on the screen. Set
1008
+ * this to limit the vertical travel of the element. Pass in 0,0 for the
1009
+ * parameters if you want to lock the drag to the x axis.
1010
+ * @param {Number} iUp the number of pixels the element can move up
1011
+ * @param {Number} iDown the number of pixels the element can move down
1012
+ * @param {Number} iTickSize (optional) parameter for specifying that the
1013
+ * element should move iTickSize pixels at a time.
1014
+ */
1015
+ setYConstraint: function(iUp, iDown, iTickSize) {
1016
+ this.topConstraint = iUp;
1017
+ this.bottomConstraint = iDown;
1018
+
1019
+ this.minY = this.initPageY - iUp;
1020
+ this.maxY = this.initPageY + iDown;
1021
+ if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
1022
+
1023
+ this.constrainY = true;
1024
+
1025
+ },
1026
+
1027
+ /**
1028
+ * Must be called if you manually reposition a dd element.
1029
+ * @param {Boolean} maintainOffset
1030
+ */
1031
+ resetConstraints: function() {
1032
+ // Maintain offsets if necessary
1033
+ if (this.initPageX || this.initPageX === 0) {
1034
+ // figure out how much this thing has moved
1035
+ var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0,
1036
+ dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
1037
+
1038
+ this.setInitPosition(dx, dy);
1039
+
1040
+ // This is the first time we have detected the element's position
1041
+ } else {
1042
+ this.setInitPosition();
1043
+ }
1044
+
1045
+ if (this.constrainX) {
1046
+ this.setXConstraint( this.leftConstraint,
1047
+ this.rightConstraint,
1048
+ this.xTickSize );
1049
+ }
1050
+
1051
+ if (this.constrainY) {
1052
+ this.setYConstraint( this.topConstraint,
1053
+ this.bottomConstraint,
1054
+ this.yTickSize );
1055
+ }
1056
+ },
1057
+
1058
+ /**
1059
+ * Normally the drag element is moved pixel by pixel, but we can specify
1060
+ * that it move a number of pixels at a time. This method resolves the
1061
+ * location when we have it set up like this.
1062
+ * @param {Number} val where we want to place the object
1063
+ * @param {Number[]} tickArray sorted array of valid points
1064
+ * @return {Number} the closest tick
1065
+ * @private
1066
+ */
1067
+ getTick: function(val, tickArray) {
1068
+ if (!tickArray) {
1069
+ // If tick interval is not defined, it is effectively 1 pixel,
1070
+ // so we return the value passed to us.
1071
+ return val;
1072
+ } else if (tickArray[0] >= val) {
1073
+ // The value is lower than the first tick, so we return the first
1074
+ // tick.
1075
+ return tickArray[0];
1076
+ } else {
1077
+ var i, len, next, diff1, diff2;
1078
+ for (i=0, len=tickArray.length; i<len; ++i) {
1079
+ next = i + 1;
1080
+ if (tickArray[next] && tickArray[next] >= val) {
1081
+ diff1 = val - tickArray[i];
1082
+ diff2 = tickArray[next] - val;
1083
+ return (diff2 > diff1) ? tickArray[i] : tickArray[next];
1084
+ }
1085
+ }
1086
+
1087
+ // The value is larger than the last tick, so we return the last
1088
+ // tick.
1089
+ return tickArray[tickArray.length - 1];
1090
+ }
1091
+ },
1092
+
1093
+ /**
1094
+ * toString method
1095
+ * @return {String} string representation of the dd obj
1096
+ */
1097
+ toString: function() {
1098
+ return ("DragDrop " + this.id);
1099
+ }
1100
+
1101
+ });