sproutcore 0.9.23 → 1.0.1003

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 (1668) hide show
  1. data/Buildfile +125 -0
  2. data/History.txt +5 -569
  3. data/README.txt +99 -64
  4. data/Rakefile +236 -6
  5. data/Todo.txt +1 -0
  6. data/VERSION.yml +5 -0
  7. data/bin/sc-build +9 -210
  8. data/bin/sc-build-number +13 -0
  9. data/bin/sc-docs +14 -0
  10. data/bin/sc-gen +9 -23
  11. data/bin/sc-init +9 -34
  12. data/bin/sc-manifest +13 -0
  13. data/bin/sc-server +9 -82
  14. data/bin/sproutcore +10 -24
  15. data/buildtasks/build.rake +82 -0
  16. data/buildtasks/entry.rake +62 -0
  17. data/buildtasks/manifest.rake +565 -0
  18. data/buildtasks/render.rake +21 -0
  19. data/buildtasks/target.rake +61 -0
  20. data/design/Technical Notes.graffle/QuickLook/Preview.pdf +0 -0
  21. data/design/Technical Notes.graffle/QuickLook/Thumbnail.tiff +0 -0
  22. data/design/Technical Notes.graffle/data.plist +5534 -0
  23. data/design/Technical Notes.graffle/image8.png +0 -0
  24. data/doc_templates/jsdoc/publish.js +170 -0
  25. data/doc_templates/jsdoc/static/default.css +162 -0
  26. data/{jsdoc/templates/sproutcore → doc_templates/jsdoc}/static/header.html +0 -0
  27. data/doc_templates/jsdoc/static/index.html +19 -0
  28. data/doc_templates/sproutcore/publish.js +345 -0
  29. data/doc_templates/sproutcore/static/default.css +258 -0
  30. data/doc_templates/sproutcore/static/header.html +2 -0
  31. data/doc_templates/sproutcore/static/index.html +19 -0
  32. data/frameworks/sproutcore/Buildfile +88 -0
  33. data/frameworks/sproutcore/HISTORY +10 -10
  34. data/frameworks/sproutcore/README +8 -1
  35. data/frameworks/sproutcore/apps/docs/core.js +27 -0
  36. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Preview.pdf +0 -0
  37. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Thumbnail.tiff +0 -0
  38. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/data.plist +14378 -0
  39. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image10.png +0 -0
  40. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image11.png +0 -0
  41. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image13.png +0 -0
  42. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image14.png +0 -0
  43. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image8.png +0 -0
  44. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image9.tiff +0 -0
  45. data/frameworks/sproutcore/apps/docs/english.lproj/loading.rhtml +9 -0
  46. data/frameworks/sproutcore/apps/docs/english.lproj/main_page.js +22 -0
  47. data/frameworks/sproutcore/apps/docs/english.lproj/strings.js +15 -0
  48. data/frameworks/sproutcore/apps/docs/main.js +30 -0
  49. data/frameworks/sproutcore/apps/tests/controllers/detail.js +25 -0
  50. data/frameworks/sproutcore/apps/tests/controllers/source.js +29 -0
  51. data/frameworks/sproutcore/apps/tests/controllers/target.js +26 -0
  52. data/frameworks/sproutcore/apps/tests/controllers/targets.js +86 -0
  53. data/frameworks/sproutcore/apps/tests/controllers/tests.js +33 -0
  54. data/frameworks/sproutcore/apps/tests/core.js +133 -0
  55. data/frameworks/sproutcore/apps/tests/english.lproj/loading.rhtml +9 -0
  56. data/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +39 -0
  57. data/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +232 -0
  58. data/frameworks/sproutcore/apps/tests/english.lproj/strings.js +26 -0
  59. data/frameworks/sproutcore/apps/tests/main.js +28 -0
  60. data/frameworks/sproutcore/apps/tests/states/no_targets.js +26 -0
  61. data/frameworks/sproutcore/apps/tests/states/ready.js +56 -0
  62. data/frameworks/sproutcore/apps/tests/states/ready_detail.js +41 -0
  63. data/frameworks/sproutcore/apps/tests/states/ready_empty.js +48 -0
  64. data/frameworks/sproutcore/apps/tests/states/ready_list.js +41 -0
  65. data/frameworks/sproutcore/apps/tests/states/ready_loading.js +44 -0
  66. data/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +31 -0
  67. data/frameworks/sproutcore/apps/tests/states/start.js +39 -0
  68. data/frameworks/sproutcore/apps/tests/tests/controllers/detail.js +15 -0
  69. data/frameworks/sproutcore/apps/tests/tests/controllers/source.js +15 -0
  70. data/frameworks/sproutcore/apps/tests/tests/controllers/target.js +15 -0
  71. data/frameworks/sproutcore/apps/tests/tests/controllers/targets.js +15 -0
  72. data/frameworks/sproutcore/apps/tests/tests/controllers/tests.js +15 -0
  73. data/frameworks/sproutcore/apps/tests/tests/models/target.js +15 -0
  74. data/frameworks/sproutcore/apps/tests/tests/models/test.js +15 -0
  75. data/frameworks/sproutcore/apps/tests/tests/views/offset_checkbox.js +15 -0
  76. data/frameworks/sproutcore/apps/tests/views/offset_checkbox.js +26 -0
  77. data/frameworks/sproutcore/apps/welcome/controllers/targets.js +49 -0
  78. data/frameworks/sproutcore/apps/welcome/core.js +30 -0
  79. data/frameworks/sproutcore/apps/welcome/english.lproj/loading.rhtml +10 -0
  80. data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.css +7 -0
  81. data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +77 -0
  82. data/frameworks/sproutcore/apps/welcome/english.lproj/strings.js +15 -0
  83. data/frameworks/sproutcore/apps/welcome/main.js +19 -0
  84. data/frameworks/sproutcore/apps/welcome/tests/controllers/targets.js +15 -0
  85. data/frameworks/sproutcore/design/CollectionView State Charts.graffle +4848 -0
  86. data/frameworks/sproutcore/design/Design Charts.graffle +18232 -0
  87. data/frameworks/sproutcore/design/Record State Table.numbers +0 -0
  88. data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/QuickLook/Preview.pdf +0 -0
  89. data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/QuickLook/Thumbnail.tiff +0 -0
  90. data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/data.plist +19588 -0
  91. data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/image8.png +0 -0
  92. data/frameworks/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Preview.pdf +0 -0
  93. data/frameworks/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Thumbnail.tiff +0 -0
  94. data/frameworks/sproutcore/design/SproutCore Design Template.graffle/data.plist +1452 -0
  95. data/frameworks/sproutcore/design/SproutCore Design Template.graffle/image8.png +0 -0
  96. data/frameworks/sproutcore/design/TestRunner Design.graffle/QuickLook/Preview.pdf +0 -0
  97. data/frameworks/sproutcore/design/TestRunner Design.graffle/QuickLook/Thumbnail.tiff +0 -0
  98. data/frameworks/sproutcore/design/TestRunner Design.graffle/data.plist +24187 -0
  99. data/frameworks/sproutcore/design/TestRunner Design.graffle/image10.png +0 -0
  100. data/frameworks/sproutcore/design/TestRunner Design.graffle/image11.png +0 -0
  101. data/frameworks/sproutcore/design/TestRunner Design.graffle/image13.png +0 -0
  102. data/frameworks/sproutcore/design/TestRunner Design.graffle/image15.png +0 -0
  103. data/frameworks/sproutcore/design/TestRunner Design.graffle/image16.png +0 -0
  104. data/frameworks/sproutcore/design/TestRunner Design.graffle/image17.png +0 -0
  105. data/frameworks/sproutcore/design/TestRunner Design.graffle/image18.png +0 -0
  106. data/frameworks/sproutcore/design/TestRunner Design.graffle/image19.png +0 -0
  107. data/frameworks/sproutcore/design/TestRunner Design.graffle/image22.tiff +0 -0
  108. data/frameworks/sproutcore/design/TestRunner Design.graffle/image23.png +0 -0
  109. data/frameworks/sproutcore/design/TestRunner Design.graffle/image24.png +0 -0
  110. data/frameworks/sproutcore/design/TestRunner Design.graffle/image25.png +0 -0
  111. data/frameworks/sproutcore/design/TestRunner Design.graffle/image30.png +0 -0
  112. data/frameworks/sproutcore/design/TestRunner Design.graffle/image31.png +0 -0
  113. data/frameworks/sproutcore/design/TestRunner Design.graffle/image8.png +0 -0
  114. data/frameworks/sproutcore/design/TestRunner Design.graffle/image9.png +0 -0
  115. data/frameworks/sproutcore/frameworks/core_tools/core.js +20 -0
  116. data/frameworks/sproutcore/frameworks/core_tools/data_source.js +99 -0
  117. data/frameworks/sproutcore/frameworks/core_tools/english.lproj/strings.js +15 -0
  118. data/frameworks/sproutcore/frameworks/core_tools/fixtures/target.js +87 -0
  119. data/frameworks/sproutcore/frameworks/core_tools/fixtures/test.js +44 -0
  120. data/frameworks/sproutcore/frameworks/core_tools/models/target.js +108 -0
  121. data/frameworks/sproutcore/frameworks/core_tools/models/test.js +48 -0
  122. data/frameworks/sproutcore/frameworks/datastore/core.js +8 -0
  123. data/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +180 -0
  124. data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +340 -0
  125. data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +393 -0
  126. data/frameworks/sproutcore/frameworks/datastore/debug/json.js +71 -0
  127. data/frameworks/sproutcore/frameworks/datastore/debug/standard_setup.js +96 -0
  128. data/frameworks/sproutcore/frameworks/datastore/fixtures/author_fixtures.js +2503 -0
  129. data/frameworks/sproutcore/frameworks/datastore/fixtures/sample.js +17 -0
  130. data/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +100 -0
  131. data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +152 -0
  132. data/frameworks/sproutcore/frameworks/datastore/models/record.js +898 -0
  133. data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +462 -0
  134. data/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +158 -0
  135. data/frameworks/sproutcore/frameworks/datastore/system/many_array.js +411 -0
  136. data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +499 -0
  137. data/frameworks/sproutcore/frameworks/datastore/system/query.js +1488 -0
  138. data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +568 -0
  139. data/frameworks/sproutcore/frameworks/datastore/system/store.js +2407 -0
  140. data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +117 -0
  141. data/frameworks/sproutcore/frameworks/datastore/tests/integration/contact_model.js +131 -0
  142. data/frameworks/sproutcore/frameworks/datastore/tests/integration/cyclical_relationship.js +119 -0
  143. data/frameworks/sproutcore/frameworks/datastore/tests/integration/mail_model.js +91 -0
  144. data/frameworks/sproutcore/frameworks/datastore/tests/integration/test_runner_model.js +56 -0
  145. data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +384 -0
  146. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +55 -0
  147. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +81 -0
  148. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +245 -0
  149. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +53 -0
  150. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/refresh.js +48 -0
  151. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +169 -0
  152. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +51 -0
  153. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +97 -0
  154. data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +178 -0
  155. data/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +216 -0
  156. data/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +204 -0
  157. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +149 -0
  158. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +171 -0
  159. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +154 -0
  160. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +113 -0
  161. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +99 -0
  162. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +180 -0
  163. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +126 -0
  164. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +163 -0
  165. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +166 -0
  166. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +219 -0
  167. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/compare.js +131 -0
  168. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/contains.js +131 -0
  169. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/containsRecordTypes.js +81 -0
  170. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/copy.js +30 -0
  171. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +185 -0
  172. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +92 -0
  173. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/expandedRecordTypes.js +64 -0
  174. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/parse.js +202 -0
  175. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/queryWithScope.js +57 -0
  176. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/record_type_is.js +43 -0
  177. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_comparisons.js +66 -0
  178. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_query_extensions.js +67 -0
  179. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +177 -0
  180. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +134 -0
  181. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +54 -0
  182. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +133 -0
  183. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +211 -0
  184. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +136 -0
  185. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +72 -0
  186. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +78 -0
  187. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +254 -0
  188. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +106 -0
  189. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +530 -0
  190. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +21 -0
  191. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +61 -0
  192. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readDataHash.js +74 -0
  193. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readEditableDataHash.js +74 -0
  194. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +73 -0
  195. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +144 -0
  196. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +184 -0
  197. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +125 -0
  198. data/frameworks/sproutcore/frameworks/datejs/core.js +865 -0
  199. data/frameworks/sproutcore/frameworks/datejs/english.lproj/en-US.js +186 -0
  200. data/frameworks/sproutcore/frameworks/datejs/extras.js +332 -0
  201. data/frameworks/sproutcore/frameworks/datejs/license.js +25 -0
  202. data/frameworks/sproutcore/frameworks/datejs/parser.js +1116 -0
  203. data/frameworks/sproutcore/frameworks/datejs/spanish.lproj/es-CO.js +186 -0
  204. data/frameworks/sproutcore/frameworks/datejs/sugarpak.js +475 -0
  205. data/frameworks/sproutcore/frameworks/datejs/time.js +269 -0
  206. data/frameworks/sproutcore/frameworks/datejs/validators/datejs.js +34 -0
  207. data/frameworks/sproutcore/frameworks/debug/core.js +99 -0
  208. data/frameworks/sproutcore/frameworks/designer/coders/design.js +29 -0
  209. data/frameworks/sproutcore/frameworks/designer/coders/localization.js +27 -0
  210. data/frameworks/sproutcore/frameworks/designer/coders/object.js +347 -0
  211. data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +102 -0
  212. data/frameworks/sproutcore/frameworks/designer/css/css_rule.js +22 -0
  213. data/frameworks/sproutcore/frameworks/designer/css/css_style.js +29 -0
  214. data/frameworks/sproutcore/frameworks/designer/css/css_style_sheet.js +201 -0
  215. data/frameworks/sproutcore/frameworks/designer/ext/page.js +86 -0
  216. data/frameworks/sproutcore/frameworks/designer/ext/view.js +38 -0
  217. data/frameworks/sproutcore/frameworks/designer/views/controls/button.js +17 -0
  218. data/frameworks/sproutcore/frameworks/designer/views/designer.js +569 -0
  219. data/frameworks/sproutcore/frameworks/designer/views/label.js +16 -0
  220. data/frameworks/sproutcore/frameworks/designer/views/mixins/button.js +11 -0
  221. data/frameworks/sproutcore/frameworks/designer/views/tab.js +16 -0
  222. data/frameworks/sproutcore/frameworks/desktop/core.js +6 -0
  223. data/frameworks/sproutcore/frameworks/desktop/debug/drag.js +41 -0
  224. data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +56 -0
  225. data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/a_sample_image.jpg +0 -0
  226. data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/apple-logo1.jpeg +0 -0
  227. data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/iframe.html +23 -0
  228. data/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +78 -0
  229. data/frameworks/sproutcore/frameworks/desktop/english.lproj/drag.css +6 -0
  230. data/frameworks/sproutcore/frameworks/desktop/english.lproj/icons.css +943 -0
  231. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_222222.png +0 -0
  232. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_454545.png +0 -0
  233. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_888888.png +0 -0
  234. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_ffffff.png +0 -0
  235. data/frameworks/sproutcore/{english.lproj/images/shared-icons.png → frameworks/desktop/english.lproj/images/icons/shared.png} +0 -0
  236. data/{clients/sc_test_runner → frameworks/sproutcore/frameworks/desktop}/english.lproj/images/indicator.gif +0 -0
  237. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-x.png +0 -0
  238. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-y.png +0 -0
  239. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sc-theme-sprite.png +0 -0
  240. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/000000.png +0 -0
  241. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/ffffff.png +0 -0
  242. data/frameworks/sproutcore/{english.lproj → frameworks/desktop/english.lproj}/images/sticky-note.png +0 -0
  243. data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +209 -0
  244. data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +113 -0
  245. data/frameworks/sproutcore/frameworks/desktop/english.lproj/modal.css +5 -0
  246. data/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +95 -0
  247. data/frameworks/sproutcore/frameworks/desktop/english.lproj/picker.css +39 -0
  248. data/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +31 -0
  249. data/frameworks/sproutcore/frameworks/desktop/english.lproj/radio.css +10 -0
  250. data/frameworks/sproutcore/frameworks/desktop/english.lproj/scroller.css +26 -0
  251. data/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +141 -0
  252. data/frameworks/sproutcore/frameworks/desktop/english.lproj/separator.css +19 -0
  253. data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +62 -0
  254. data/frameworks/sproutcore/frameworks/desktop/english.lproj/split.css +70 -0
  255. data/frameworks/sproutcore/frameworks/desktop/english.lproj/split_divider.css +9 -0
  256. data/frameworks/sproutcore/frameworks/desktop/english.lproj/strings.js +14 -0
  257. data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +12 -0
  258. data/frameworks/sproutcore/frameworks/desktop/english.lproj/toolbar.css +6 -0
  259. data/frameworks/sproutcore/frameworks/desktop/mixins/border.js +53 -0
  260. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +22 -0
  261. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +61 -0
  262. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +292 -0
  263. data/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +247 -0
  264. data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +408 -0
  265. data/frameworks/sproutcore/frameworks/desktop/panes/drop_down.js +665 -0
  266. data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +680 -0
  267. data/frameworks/sproutcore/frameworks/desktop/panes/modal.js +68 -0
  268. data/frameworks/sproutcore/frameworks/desktop/panes/palette.js +63 -0
  269. data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +184 -0
  270. data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +403 -0
  271. data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +46 -0
  272. data/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +39 -0
  273. data/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +81 -0
  274. data/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +175 -0
  275. data/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +290 -0
  276. data/frameworks/sproutcore/frameworks/desktop/system/drag.js +869 -0
  277. data/frameworks/sproutcore/frameworks/desktop/system/key_bindings.js +40 -0
  278. data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +647 -0
  279. data/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +187 -0
  280. data/frameworks/sproutcore/frameworks/desktop/tests/datetime_recordattribute.js +73 -0
  281. data/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js +43 -0
  282. data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/methods.js +10 -0
  283. data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +152 -0
  284. data/frameworks/sproutcore/frameworks/desktop/tests/panes/dropDown/methods.js +161 -0
  285. data/frameworks/sproutcore/frameworks/desktop/tests/panes/dropDown/ui.js +199 -0
  286. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +55 -0
  287. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +59 -0
  288. data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/methods.js +10 -0
  289. data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +35 -0
  290. data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +10 -0
  291. data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +40 -0
  292. data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +10 -0
  293. data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +84 -0
  294. data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/methods.js +10 -0
  295. data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +38 -0
  296. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +45 -0
  297. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +163 -0
  298. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +144 -0
  299. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +99 -0
  300. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +249 -0
  301. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +82 -0
  302. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +199 -0
  303. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/displayProperties.js +31 -0
  304. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +288 -0
  305. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +65 -0
  306. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +88 -0
  307. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +174 -0
  308. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/nowShowing.js +121 -0
  309. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +177 -0
  310. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +240 -0
  311. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +191 -0
  312. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +197 -0
  313. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +141 -0
  314. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +182 -0
  315. data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/methods.js +10 -0
  316. data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +64 -0
  317. data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +10 -0
  318. data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/ui.js +10 -0
  319. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +92 -0
  320. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +183 -0
  321. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +133 -0
  322. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +131 -0
  323. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +56 -0
  324. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +167 -0
  325. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +127 -0
  326. data/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +284 -0
  327. data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/methods.js +10 -0
  328. data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +44 -0
  329. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/methods.js +128 -0
  330. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +240 -0
  331. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +113 -0
  332. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +200 -0
  333. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +142 -0
  334. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +169 -0
  335. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +72 -0
  336. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/ui.js +71 -0
  337. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +95 -0
  338. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +222 -0
  339. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +132 -0
  340. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +110 -0
  341. data/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +37 -0
  342. data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/methods.js +10 -0
  343. data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/ui.js +10 -0
  344. data/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +60 -0
  345. data/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +52 -0
  346. data/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +231 -0
  347. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +54 -0
  348. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +88 -0
  349. data/frameworks/sproutcore/frameworks/desktop/tests/views/web/methods.js +10 -0
  350. data/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +110 -0
  351. data/frameworks/sproutcore/frameworks/desktop/views/button.js +375 -0
  352. data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +126 -0
  353. data/frameworks/sproutcore/frameworks/desktop/views/collection.js +2775 -0
  354. data/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +60 -0
  355. data/frameworks/sproutcore/frameworks/desktop/views/form.js +594 -0
  356. data/frameworks/sproutcore/frameworks/desktop/views/grid.js +201 -0
  357. data/frameworks/sproutcore/frameworks/desktop/views/list.js +549 -0
  358. data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +657 -0
  359. data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +608 -0
  360. data/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +20 -0
  361. data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +68 -0
  362. data/frameworks/sproutcore/frameworks/desktop/views/progress.js +233 -0
  363. data/frameworks/sproutcore/frameworks/desktop/views/radio.js +357 -0
  364. data/frameworks/sproutcore/frameworks/desktop/views/scene.js +204 -0
  365. data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +689 -0
  366. data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +227 -0
  367. data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +587 -0
  368. data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +311 -0
  369. data/frameworks/sproutcore/frameworks/desktop/views/separator.js +37 -0
  370. data/frameworks/sproutcore/frameworks/desktop/views/slider.js +261 -0
  371. data/frameworks/sproutcore/frameworks/desktop/views/source_list.js +47 -0
  372. data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +169 -0
  373. data/frameworks/sproutcore/frameworks/desktop/views/split.js +684 -0
  374. data/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +55 -0
  375. data/frameworks/sproutcore/frameworks/desktop/views/stacked.js +101 -0
  376. data/frameworks/sproutcore/frameworks/desktop/views/tab.js +191 -0
  377. data/frameworks/sproutcore/frameworks/desktop/views/thumb.js +49 -0
  378. data/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +49 -0
  379. data/frameworks/sproutcore/frameworks/desktop/views/web.js +87 -0
  380. data/frameworks/sproutcore/frameworks/foundation/TESTING +46 -0
  381. data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +504 -0
  382. data/frameworks/sproutcore/frameworks/foundation/controllers/controller.js +44 -0
  383. data/frameworks/sproutcore/frameworks/foundation/controllers/object.js +322 -0
  384. data/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +105 -0
  385. data/frameworks/sproutcore/frameworks/foundation/core.js +144 -0
  386. data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +194 -0
  387. data/frameworks/sproutcore/{english.lproj → frameworks/foundation/english.lproj}/blank.gif +0 -0
  388. data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +81 -0
  389. data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +33 -0
  390. data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +438 -0
  391. data/frameworks/sproutcore/frameworks/foundation/english.lproj/debug/control-test-pane.css +9 -0
  392. data/frameworks/sproutcore/{english.lproj → frameworks/foundation/english.lproj}/images/sproutcore-logo.png +0 -0
  393. data/{clients/sc_test_runner/english.lproj/controls.css → frameworks/sproutcore/frameworks/foundation/english.lproj/inline_editor.css} +0 -0
  394. data/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +31 -0
  395. data/frameworks/sproutcore/frameworks/foundation/english.lproj/static_layout.css +5 -0
  396. data/frameworks/sproutcore/frameworks/foundation/english.lproj/strings.js +15 -0
  397. data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +133 -0
  398. data/frameworks/sproutcore/frameworks/foundation/english.lproj/view.css +51 -0
  399. data/frameworks/sproutcore/frameworks/foundation/ext/object.js +83 -0
  400. data/frameworks/sproutcore/frameworks/foundation/ext/run_loop.js +161 -0
  401. data/frameworks/sproutcore/frameworks/foundation/fixtures/file_exists.json +1 -0
  402. data/frameworks/sproutcore/frameworks/foundation/license.js +19 -0
  403. data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +355 -0
  404. data/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +179 -0
  405. data/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +91 -0
  406. data/frameworks/sproutcore/frameworks/foundation/mixins/control.js +386 -0
  407. data/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +150 -0
  408. data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +491 -0
  409. data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +233 -0
  410. data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +148 -0
  411. data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +334 -0
  412. data/frameworks/sproutcore/frameworks/foundation/mixins/tree_item_content.js +160 -0
  413. data/frameworks/sproutcore/frameworks/foundation/mixins/validatable.js +189 -0
  414. data/frameworks/sproutcore/frameworks/foundation/panes/main.js +51 -0
  415. data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +661 -0
  416. data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +887 -0
  417. data/frameworks/sproutcore/frameworks/foundation/protocols/inline_editor_delegate.js +84 -0
  418. data/frameworks/sproutcore/frameworks/foundation/system/application.js +36 -0
  419. data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +502 -0
  420. data/frameworks/sproutcore/frameworks/foundation/system/browser.js +64 -0
  421. data/frameworks/sproutcore/frameworks/foundation/system/builder.js +210 -0
  422. data/frameworks/sproutcore/frameworks/foundation/system/bundle.js +267 -0
  423. data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +2028 -0
  424. data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +129 -0
  425. data/frameworks/sproutcore/frameworks/foundation/system/datetime.js +915 -0
  426. data/frameworks/sproutcore/frameworks/foundation/system/event.js +849 -0
  427. data/frameworks/sproutcore/frameworks/foundation/system/image_cache.js +432 -0
  428. data/frameworks/sproutcore/frameworks/foundation/system/json.js +440 -0
  429. data/frameworks/sproutcore/frameworks/foundation/system/locale.js +288 -0
  430. data/frameworks/sproutcore/frameworks/foundation/system/page.js +106 -0
  431. data/frameworks/sproutcore/frameworks/foundation/system/ready.js +195 -0
  432. data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +905 -0
  433. data/frameworks/sproutcore/frameworks/foundation/system/request.js +386 -0
  434. data/frameworks/sproutcore/frameworks/foundation/system/responder.js +120 -0
  435. data/frameworks/sproutcore/frameworks/foundation/system/responder_context.js +243 -0
  436. data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +391 -0
  437. data/frameworks/sproutcore/frameworks/foundation/system/routes.js +525 -0
  438. data/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +103 -0
  439. data/frameworks/sproutcore/frameworks/foundation/system/time.js +478 -0
  440. data/frameworks/sproutcore/frameworks/foundation/system/timer.js +549 -0
  441. data/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +233 -0
  442. data/frameworks/sproutcore/frameworks/foundation/system/utils.js +482 -0
  443. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +182 -0
  444. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +193 -0
  445. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +64 -0
  446. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/single_case.js +136 -0
  447. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/empty_case.js +82 -0
  448. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/multiple_case.js +111 -0
  449. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_case.js +193 -0
  450. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_enumerable_case.js +179 -0
  451. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/outline_case.js +108 -0
  452. data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/methods.js +10 -0
  453. data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/ui.js +113 -0
  454. data/frameworks/sproutcore/frameworks/foundation/tests/integration/creating_views.js +113 -0
  455. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/content.js +195 -0
  456. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/displayProperties.js +89 -0
  457. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/keyEquivalents.js +56 -0
  458. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/content.js +168 -0
  459. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +89 -0
  460. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +128 -0
  461. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +17 -0
  462. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/flat_case.js +325 -0
  463. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +718 -0
  464. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/outline_case.js +484 -0
  465. data/frameworks/sproutcore/frameworks/foundation/tests/system/builder.js +42 -0
  466. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +1323 -0
  467. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_dimensions.js +387 -0
  468. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_selector.js +405 -0
  469. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/setClass.js +49 -0
  470. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/within.js +66 -0
  471. data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +252 -0
  472. data/frameworks/sproutcore/frameworks/foundation/tests/system/json.js +14 -0
  473. data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +128 -0
  474. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/begin.js +47 -0
  475. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/element.js +44 -0
  476. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/end.js +119 -0
  477. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/get.js +51 -0
  478. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_attr.js +50 -0
  479. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_basic.js +28 -0
  480. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_className.js +179 -0
  481. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_style.js +100 -0
  482. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/init.js +55 -0
  483. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/join.js +28 -0
  484. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/push_text.js +74 -0
  485. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +45 -0
  486. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/update.js +205 -0
  487. data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +127 -0
  488. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeKeyPane.js +124 -0
  489. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeMainPane.js +68 -0
  490. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/root_responder.js +101 -0
  491. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +238 -0
  492. data/frameworks/sproutcore/frameworks/foundation/tests/system/routes.js +33 -0
  493. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invalidate.js +38 -0
  494. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invokeLater.js +201 -0
  495. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/isPaused.js +71 -0
  496. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/performAction.js +67 -0
  497. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/schedule.js +170 -0
  498. data/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js +24 -0
  499. data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/normalizeURL.js +18 -0
  500. data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/range.js +62 -0
  501. data/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js +35 -0
  502. data/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js +23 -0
  503. data/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js +47 -0
  504. data/frameworks/sproutcore/frameworks/foundation/tests/validators/password.js +13 -0
  505. data/frameworks/sproutcore/frameworks/foundation/tests/validators/validator.js +20 -0
  506. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +10 -0
  507. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +83 -0
  508. data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +52 -0
  509. data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +148 -0
  510. data/frameworks/sproutcore/frameworks/foundation/tests/views/main_pane.js +31 -0
  511. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +113 -0
  512. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/firstResponder.js +148 -0
  513. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/keyPane.js +133 -0
  514. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/sendEvent.js +165 -0
  515. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +76 -0
  516. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +446 -0
  517. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +133 -0
  518. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/convertFrames.js +246 -0
  519. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createChildViews.js +122 -0
  520. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createLayer.js +97 -0
  521. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +85 -0
  522. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +52 -0
  523. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/init.js +50 -0
  524. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +200 -0
  525. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisible.js +51 -0
  526. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisibleInWindow.js +116 -0
  527. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layer.js +150 -0
  528. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutChildViews.js +162 -0
  529. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutDidChange.js +127 -0
  530. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +328 -0
  531. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/parentViewDidChange.js +67 -0
  532. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/prepareContext.js +166 -0
  533. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/removeChild.js +189 -0
  534. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/render.js +83 -0
  535. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/replaceChild.js +29 -0
  536. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayer.js +146 -0
  537. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayerLocation.js +194 -0
  538. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/viewDidResize.js +223 -0
  539. data/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +125 -0
  540. data/frameworks/sproutcore/frameworks/foundation/validators/date.js +52 -0
  541. data/frameworks/sproutcore/frameworks/foundation/validators/email.js +45 -0
  542. data/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +33 -0
  543. data/frameworks/sproutcore/frameworks/foundation/validators/number.js +82 -0
  544. data/frameworks/sproutcore/frameworks/foundation/validators/password.js +86 -0
  545. data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +314 -0
  546. data/frameworks/sproutcore/frameworks/foundation/views/container.js +136 -0
  547. data/frameworks/sproutcore/frameworks/foundation/views/field.js +347 -0
  548. data/frameworks/sproutcore/frameworks/foundation/views/image.js +178 -0
  549. data/frameworks/sproutcore/frameworks/foundation/views/label.js +285 -0
  550. data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +662 -0
  551. data/frameworks/sproutcore/frameworks/foundation/views/view.js +2521 -0
  552. data/frameworks/sproutcore/frameworks/mini/license.js +28 -0
  553. data/frameworks/sproutcore/frameworks/mobile/english.lproj/core.css +12 -0
  554. data/frameworks/sproutcore/frameworks/mobile/lib/index.rhtml +126 -0
  555. data/frameworks/sproutcore/frameworks/mobile/system/root_responder.js +109 -0
  556. data/frameworks/sproutcore/frameworks/mobile/tests/views/button/ui.js +9 -0
  557. data/frameworks/sproutcore/frameworks/mobile/views/button.js +190 -0
  558. data/frameworks/sproutcore/frameworks/runtime/README +12 -0
  559. data/frameworks/sproutcore/frameworks/runtime/core.js +950 -0
  560. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +238 -0
  561. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js +33 -0
  562. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/insertAt.js +121 -0
  563. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js +34 -0
  564. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/popObject.js +50 -0
  565. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/pushObject.js +46 -0
  566. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/rangeObserver.js +371 -0
  567. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeAt.js +100 -0
  568. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js +49 -0
  569. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +94 -0
  570. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/shiftObject.js +50 -0
  571. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/unshiftObject.js +47 -0
  572. data/frameworks/sproutcore/frameworks/runtime/license.js +28 -0
  573. data/frameworks/sproutcore/frameworks/runtime/mixins/array.js +613 -0
  574. data/frameworks/sproutcore/frameworks/runtime/mixins/comparable.js +45 -0
  575. data/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +64 -0
  576. data/frameworks/sproutcore/frameworks/runtime/mixins/delegate_support.js +110 -0
  577. data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1238 -0
  578. data/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +110 -0
  579. data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1315 -0
  580. data/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +141 -0
  581. data/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +173 -0
  582. data/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +172 -0
  583. data/frameworks/sproutcore/frameworks/runtime/protocols/observable_protocol.js +40 -0
  584. data/frameworks/sproutcore/frameworks/runtime/protocols/sparse_array_delegate.js +131 -0
  585. data/frameworks/sproutcore/frameworks/runtime/system/binding.js +943 -0
  586. data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +106 -0
  587. data/frameworks/sproutcore/frameworks/runtime/system/error.js +157 -0
  588. data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +1193 -0
  589. data/frameworks/sproutcore/frameworks/runtime/system/object.js +834 -0
  590. data/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +271 -0
  591. data/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +245 -0
  592. data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +669 -0
  593. data/frameworks/sproutcore/frameworks/runtime/system/set.js +425 -0
  594. data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +379 -0
  595. data/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js +56 -0
  596. data/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js +23 -0
  597. data/frameworks/sproutcore/frameworks/runtime/tests/core/clone.js +84 -0
  598. data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +44 -0
  599. data/frameworks/sproutcore/frameworks/runtime/tests/core/console.js +16 -0
  600. data/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +147 -0
  601. data/frameworks/sproutcore/frameworks/runtime/tests/core/inspect.js +27 -0
  602. data/frameworks/sproutcore/frameworks/runtime/tests/core/isArray.js +25 -0
  603. data/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +38 -0
  604. data/frameworks/sproutcore/frameworks/runtime/tests/core/keys.js +20 -0
  605. data/frameworks/sproutcore/frameworks/runtime/tests/core/makeArray.js +30 -0
  606. data/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +19 -0
  607. data/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +37 -0
  608. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +57 -0
  609. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/comparable.js +44 -0
  610. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +611 -0
  611. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +587 -0
  612. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +132 -0
  613. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +79 -0
  614. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +80 -0
  615. data/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +55 -0
  616. data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +265 -0
  617. data/frameworks/sproutcore/frameworks/runtime/tests/system/error.js +52 -0
  618. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +195 -0
  619. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/addEach.js +49 -0
  620. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/clone.js +43 -0
  621. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +74 -0
  622. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js +42 -0
  623. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js +38 -0
  624. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexBefore.js +38 -0
  625. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +74 -0
  626. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/max.js +40 -0
  627. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js +40 -0
  628. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/rangeStartForIndex.js +36 -0
  629. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +189 -0
  630. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/removeEach.js +49 -0
  631. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/without.js +89 -0
  632. data/frameworks/sproutcore/frameworks/runtime/tests/system/object/base.js +148 -0
  633. data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +339 -0
  634. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +59 -0
  635. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/destroy.js +75 -0
  636. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/objectPropertyDidChange.js +117 -0
  637. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/rangeDidChange.js +110 -0
  638. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/update.js +65 -0
  639. data/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +120 -0
  640. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/add.js +92 -0
  641. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +17 -0
  642. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +85 -0
  643. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/isEqual.js +60 -0
  644. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +87 -0
  645. data/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +292 -0
  646. data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +175 -0
  647. data/frameworks/sproutcore/frameworks/testing/core.js +196 -0
  648. data/frameworks/sproutcore/frameworks/testing/english.lproj/additions.css +8 -0
  649. data/frameworks/sproutcore/frameworks/testing/english.lproj/runner.css +128 -0
  650. data/frameworks/sproutcore/frameworks/testing/english.lproj/testsuite.css +131 -0
  651. data/frameworks/sproutcore/frameworks/testing/extras.js +17 -0
  652. data/frameworks/sproutcore/frameworks/testing/jquery.js +3559 -0
  653. data/frameworks/sproutcore/frameworks/testing/qunit.js +827 -0
  654. data/frameworks/sproutcore/frameworks/testing/system/dump.js +205 -0
  655. data/frameworks/sproutcore/frameworks/testing/system/equiv.js +201 -0
  656. data/frameworks/sproutcore/frameworks/testing/system/plan.js +695 -0
  657. data/frameworks/sproutcore/frameworks/testing/system/runner.js +209 -0
  658. data/frameworks/sproutcore/frameworks/testing/system/suite.js +228 -0
  659. data/frameworks/sproutcore/frameworks/testing/utils.js +62 -0
  660. data/frameworks/sproutcore/lib/index.rhtml +81 -33
  661. data/frameworks/sproutcore/license.js +28 -28
  662. data/frameworks/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +69 -0
  663. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/button.css +41 -0
  664. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/core.css +8 -0
  665. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/backButton.png +0 -0
  666. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/blueButton.png +0 -0
  667. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/cancel.png +0 -0
  668. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/grayButton.png +0 -0
  669. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/leftButton.png +0 -0
  670. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrow.png +0 -0
  671. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrowSel.png +0 -0
  672. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listGroup.png +0 -0
  673. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/loading.gif +0 -0
  674. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/pinstripes.png +0 -0
  675. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/rightButton.png +0 -0
  676. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/selection.png +0 -0
  677. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/thumb.png +0 -0
  678. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggle.png +0 -0
  679. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggleOn.png +0 -0
  680. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolButton.png +0 -0
  681. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolbar.png +0 -0
  682. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/whiteButton.png +0 -0
  683. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/strings.js +15 -0
  684. data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/Data +0 -0
  685. data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Preview.jpg +0 -0
  686. data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Thumbnail.jpg +0 -0
  687. data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/Data +0 -0
  688. data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Preview.jpg +0 -0
  689. data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Thumbnail.jpg +0 -0
  690. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/10.png +0 -0
  691. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/100.png +0 -0
  692. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/102.png +0 -0
  693. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/110.png +0 -0
  694. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/120.png +0 -0
  695. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/127.png +0 -0
  696. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/18.png +0 -0
  697. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/19.png +0 -0
  698. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/2.png +0 -0
  699. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/24.png +0 -0
  700. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/26.png +0 -0
  701. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/27.png +0 -0
  702. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/28.png +0 -0
  703. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/29.png +0 -0
  704. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/30.png +0 -0
  705. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/31.png +0 -0
  706. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/33.png +0 -0
  707. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/37.png +0 -0
  708. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/41.png +0 -0
  709. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/99.png +0 -0
  710. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/10.png +0 -0
  711. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/100.png +0 -0
  712. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/102.png +0 -0
  713. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/110.png +0 -0
  714. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/120.png +0 -0
  715. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/127.png +0 -0
  716. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/18.png +0 -0
  717. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/19.png +0 -0
  718. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/2.png +0 -0
  719. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/24.png +0 -0
  720. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/26.png +0 -0
  721. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/27.png +0 -0
  722. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/28.png +0 -0
  723. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/29.png +0 -0
  724. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/30.png +0 -0
  725. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/31.png +0 -0
  726. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/33.png +0 -0
  727. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/37.png +0 -0
  728. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/41.png +0 -0
  729. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/99.png +0 -0
  730. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/10.png +0 -0
  731. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/100.png +0 -0
  732. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/102.png +0 -0
  733. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/110.png +0 -0
  734. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/120.png +0 -0
  735. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/127.png +0 -0
  736. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/18.png +0 -0
  737. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/19.png +0 -0
  738. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/2.png +0 -0
  739. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/24.png +0 -0
  740. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/26.png +0 -0
  741. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/27.png +0 -0
  742. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/28.png +0 -0
  743. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/29.png +0 -0
  744. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/30.png +0 -0
  745. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/31.png +0 -0
  746. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/33.png +0 -0
  747. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/37.png +0 -0
  748. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/41.png +0 -0
  749. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/99.png +0 -0
  750. data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/10.png +0 -0
  751. data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/18.png +0 -0
  752. data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/19.png +0 -0
  753. data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/2.png +0 -0
  754. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/Data +0 -0
  755. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Preview.jpg +0 -0
  756. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Thumbnail.jpg +0 -0
  757. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/Data +0 -0
  758. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Preview.jpg +0 -0
  759. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Thumbnail.jpg +0 -0
  760. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x-2.psd +0 -0
  761. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
  762. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-sprite.psd +0 -0
  763. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-ysprite.psd +0 -0
  764. data/frameworks/sproutcore/themes/standard_theme/Source/shared-icons.psd +0 -0
  765. data/frameworks/sproutcore/themes/standard_theme/Source/sproutcore-logo.psd +0 -0
  766. data/frameworks/sproutcore/themes/standard_theme/Source/sticky-note.psd +0 -0
  767. data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +327 -0
  768. data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +93 -0
  769. data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +126 -0
  770. data/frameworks/sproutcore/themes/standard_theme/english.lproj/core.css +76 -0
  771. data/frameworks/sproutcore/themes/standard_theme/english.lproj/disclosure.css +57 -0
  772. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
  773. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-sprite.png +0 -0
  774. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/images/sc-theme-ysprite.png +0 -0
  775. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-toolbar-view.png +0 -0
  776. data/frameworks/sproutcore/themes/standard_theme/english.lproj/label.css +11 -0
  777. data/frameworks/sproutcore/themes/standard_theme/english.lproj/list_item.css +30 -0
  778. data/frameworks/sproutcore/themes/standard_theme/english.lproj/menu_item_view.css +3 -0
  779. data/frameworks/sproutcore/themes/standard_theme/english.lproj/pane.css +8 -0
  780. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/background-fat.jpg +0 -0
  781. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/background-thin.jpg +0 -0
  782. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/bottom-edge.png +0 -0
  783. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/bottom-left-corner.png +0 -0
  784. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/bottom-right-corner.png +0 -0
  785. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/left-edge.png +0 -0
  786. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/overlay.png +0 -0
  787. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/right-edge.png +0 -0
  788. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/top-edge.png +0 -0
  789. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/top-left-corner.png +0 -0
  790. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/top-right-corner.png +0 -0
  791. data/frameworks/sproutcore/themes/standard_theme/english.lproj/progress.css +26 -0
  792. data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +149 -0
  793. data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +279 -0
  794. data/frameworks/sproutcore/themes/standard_theme/english.lproj/slider.css +94 -0
  795. data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +27 -0
  796. data/frameworks/sproutcore/themes/standard_theme/english.lproj/tab.css +19 -0
  797. data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +20 -0
  798. data/frameworks/sproutcore/themes/standard_theme/english.lproj/toolbar.css +7 -0
  799. data/gen/Buildfile +16 -0
  800. data/gen/app/Buildfile +36 -0
  801. data/gen/app/README +1 -0
  802. data/gen/app/USAGE +13 -0
  803. data/gen/app/templates/apps/@target_name@/core.js +27 -0
  804. data/gen/app/templates/apps/@target_name@/main.js +30 -0
  805. data/gen/app/templates/apps/@target_name@/resources/loading.rhtml +9 -0
  806. data/gen/app/templates/apps/@target_name@/resources/main_page.js +24 -0
  807. data/gen/controller/Buildfile +18 -0
  808. data/gen/controller/README +1 -0
  809. data/gen/controller/USAGE +13 -0
  810. data/gen/controller/templates/controllers/@filename@.js +18 -0
  811. data/gen/controller/templates/tests/controllers/@filename@.js +15 -0
  812. data/gen/design/Buildfile +23 -0
  813. data/gen/design/README +1 -0
  814. data/gen/design/USAGE +10 -0
  815. data/gen/design/templates/resources/@filename@.js +16 -0
  816. data/gen/framework/Buildfile +36 -0
  817. data/gen/framework/README +1 -0
  818. data/gen/framework/USAGE +13 -0
  819. data/gen/framework/templates/frameworks/@target_name@/core.js +21 -0
  820. data/gen/framework/templates/frameworks/@target_name@/english.lproj/strings.js +15 -0
  821. data/gen/language/Buildfile +26 -0
  822. data/gen/language/README +1 -0
  823. data/gen/language/USAGE +13 -0
  824. data/gen/language/templates/@filename@/strings.js +14 -0
  825. data/gen/model/Buildfile +16 -0
  826. data/gen/model/README +1 -0
  827. data/gen/model/USAGE +15 -0
  828. data/gen/model/templates/fixtures/@filename@.js +35 -0
  829. data/gen/model/templates/models/@filename@.js +19 -0
  830. data/gen/model/templates/tests/models/@filename@.js +15 -0
  831. data/gen/page/Buildfile +36 -0
  832. data/gen/page/README +1 -0
  833. data/gen/page/USAGE +15 -0
  834. data/gen/page/templates/pages/@target_name@/Buildfile +16 -0
  835. data/gen/page/templates/pages/@target_name@/core.js +22 -0
  836. data/gen/page/templates/pages/@target_name@/en.lproj/strings.js +14 -0
  837. data/gen/page/templates/pages/@target_name@/resources/body.css +1 -0
  838. data/gen/page/templates/pages/@target_name@/resources/body.rhtml +7 -0
  839. data/gen/project/Buildfile +45 -0
  840. data/gen/project/INIT +3 -0
  841. data/gen/project/README +1 -0
  842. data/gen/project/USAGE +2 -0
  843. data/gen/project/templates/@filename@/Buildfile +7 -0
  844. data/gen/project/templates/@filename@/README +7 -0
  845. data/gen/test/Buildfile +25 -0
  846. data/gen/test/README +1 -0
  847. data/gen/test/USAGE +12 -0
  848. data/gen/test/templates/tests/@filename@.js +15 -0
  849. data/gen/theme/Buildfile +36 -0
  850. data/gen/theme/README +1 -0
  851. data/gen/theme/USAGE +13 -0
  852. data/gen/theme/templates/themes/@target_name@/resources/theme_styles.css +11 -0
  853. data/gen/view/Buildfile +18 -0
  854. data/gen/view/README +1 -0
  855. data/gen/view/USAGE +13 -0
  856. data/gen/view/templates/tests/views/@filename@.js +15 -0
  857. data/gen/view/templates/views/@filename@.js +18 -0
  858. data/lib/sproutcore/builders/base.rb +91 -0
  859. data/lib/sproutcore/builders/bundle.rb +63 -0
  860. data/lib/sproutcore/builders/combine.rb +37 -0
  861. data/lib/sproutcore/builders/html.rb +205 -0
  862. data/lib/sproutcore/builders/javascript.rb +62 -0
  863. data/lib/sproutcore/builders/minify.rb +133 -0
  864. data/lib/sproutcore/builders/sass.rb +55 -0
  865. data/lib/sproutcore/builders/strings.rb +44 -0
  866. data/lib/sproutcore/builders/stylesheet.rb +40 -0
  867. data/lib/sproutcore/builders/test.rb +59 -0
  868. data/lib/sproutcore/builders/test_index.rb +26 -0
  869. data/lib/sproutcore/buildfile/build_task.rb +33 -0
  870. data/lib/sproutcore/buildfile/buildfile_dsl.rb +162 -0
  871. data/lib/sproutcore/buildfile/cloneable.rb +34 -0
  872. data/lib/sproutcore/buildfile/early_time.rb +30 -0
  873. data/lib/sproutcore/buildfile/invocation_chain.rb +64 -0
  874. data/lib/sproutcore/buildfile/namespace.rb +33 -0
  875. data/lib/sproutcore/buildfile/string_ext.rb +198 -0
  876. data/lib/sproutcore/buildfile/task.rb +304 -0
  877. data/lib/sproutcore/buildfile/task_arguments.rb +86 -0
  878. data/lib/sproutcore/buildfile/task_manager.rb +193 -0
  879. data/lib/sproutcore/buildfile.rb +484 -0
  880. data/lib/sproutcore/deprecated/view_helper.rb +662 -0
  881. data/lib/sproutcore/helpers/capture_helper.rb +9 -1
  882. data/lib/sproutcore/helpers/cssmin.rb +202 -0
  883. data/lib/sproutcore/helpers/dom_id_helper.rb +8 -1
  884. data/lib/sproutcore/helpers/entry_sorter.rb +139 -0
  885. data/lib/sproutcore/helpers/packed_optimizer.rb +102 -0
  886. data/lib/sproutcore/helpers/static_helper.rb +223 -41
  887. data/lib/sproutcore/helpers/tag_helper.rb +73 -1
  888. data/lib/sproutcore/helpers/text_helper.rb +24 -57
  889. data/lib/sproutcore/models/generator.rb +493 -0
  890. data/lib/sproutcore/models/hash_struct.rb +109 -0
  891. data/lib/sproutcore/models/manifest.rb +376 -0
  892. data/lib/sproutcore/models/manifest_entry.rb +252 -0
  893. data/lib/sproutcore/models/project.rb +267 -0
  894. data/lib/sproutcore/models/target.rb +664 -0
  895. data/lib/sproutcore/rack/builder.rb +331 -0
  896. data/lib/sproutcore/rack/dev.rb +51 -0
  897. data/lib/sproutcore/rack/docs.rb +24 -0
  898. data/lib/sproutcore/rack/filesystem.rb +265 -0
  899. data/lib/sproutcore/rack/proxy.rb +100 -0
  900. data/lib/sproutcore/rack/service.rb +155 -0
  901. data/lib/sproutcore/rack/test_runner.rb +24 -0
  902. data/lib/sproutcore/render_engines/erubis.rb +55 -0
  903. data/lib/sproutcore/render_engines/haml.rb +39 -0
  904. data/lib/sproutcore/tools/build.rb +80 -0
  905. data/lib/sproutcore/tools/build_number.rb +23 -0
  906. data/lib/sproutcore/tools/docs.rb +53 -0
  907. data/lib/sproutcore/tools/gen.rb +99 -0
  908. data/lib/sproutcore/tools/init.rb +40 -0
  909. data/lib/sproutcore/tools/manifest.rb +85 -0
  910. data/lib/sproutcore/tools/server.rb +48 -0
  911. data/lib/sproutcore/tools.rb +341 -0
  912. data/lib/sproutcore.rb +141 -18
  913. data/lib/thor/CHANGELOG.rdoc +52 -0
  914. data/lib/thor/LICENSE +20 -0
  915. data/lib/thor/README.markdown +76 -0
  916. data/lib/thor/Rakefile +6 -0
  917. data/lib/thor/Thorfile +45 -0
  918. data/lib/thor/bin/rake2thor +83 -0
  919. data/lib/thor/bin/thor +7 -0
  920. data/lib/thor/lib/thor/error.rb +3 -0
  921. data/lib/thor/lib/thor/options.rb +267 -0
  922. data/lib/thor/lib/thor/ordered_hash.rb +64 -0
  923. data/lib/thor/lib/thor/runner.rb +305 -0
  924. data/lib/thor/lib/thor/task.rb +83 -0
  925. data/lib/thor/lib/thor/task_hash.rb +22 -0
  926. data/lib/thor/lib/thor/tasks/package.rb +18 -0
  927. data/lib/thor/lib/thor/tasks.rb +77 -0
  928. data/lib/thor/lib/thor/util.rb +75 -0
  929. data/lib/thor/lib/thor.rb +170 -0
  930. data/lib/thor/script/destroy +14 -0
  931. data/lib/thor/script/generate +14 -0
  932. data/lib/thor/spec/fixtures/task.thor +10 -0
  933. data/lib/thor/spec/options_spec.rb +271 -0
  934. data/lib/thor/spec/ordered_hash_spec.rb +84 -0
  935. data/lib/thor/spec/spec.opts +1 -0
  936. data/lib/thor/spec/spec_helper.rb +30 -0
  937. data/lib/thor/spec/task_spec.rb +11 -0
  938. data/lib/thor/spec/tasks_spec.rb +28 -0
  939. data/lib/thor/spec/thor_runner_spec.rb +194 -0
  940. data/lib/thor/spec/thor_spec.rb +206 -0
  941. data/lib/thor/spec/util_spec.rb +99 -0
  942. data/lib/thor/task.thor +15 -0
  943. data/lib/thor/thor.gemspec +29 -0
  944. data/spec/buildtasks/build/copy_spec.rb +60 -0
  945. data/spec/buildtasks/build/spec_helper.rb +36 -0
  946. data/spec/buildtasks/manifest/catalog_spec.rb +48 -0
  947. data/spec/buildtasks/manifest/hide_buildfiles_spec.rb +126 -0
  948. data/spec/buildtasks/manifest/localize_spec.rb +97 -0
  949. data/spec/buildtasks/manifest/prepare_build_tasks/bundle_spec.rb +254 -0
  950. data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +246 -0
  951. data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +87 -0
  952. data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +175 -0
  953. data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +65 -0
  954. data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +70 -0
  955. data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +152 -0
  956. data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +98 -0
  957. data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +64 -0
  958. data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +163 -0
  959. data/spec/buildtasks/manifest/prepare_spec.rb +43 -0
  960. data/spec/buildtasks/manifest/spec_helper.rb +35 -0
  961. data/spec/buildtasks/target_spec.rb +270 -0
  962. data/spec/fixtures/builder_tests/Buildfile +20 -0
  963. data/spec/fixtures/builder_tests/apps/bundle_test/bundle.js +1 -0
  964. data/spec/fixtures/builder_tests/apps/combine_test/a.js +1 -0
  965. data/spec/fixtures/builder_tests/apps/combine_test/b.js +1 -0
  966. data/spec/fixtures/builder_tests/apps/combine_test/c.js +1 -0
  967. data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/a.css +1 -0
  968. data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/b.css +1 -0
  969. data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/c.css +1 -0
  970. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/bar1_sample.rhtml +2 -0
  971. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/erb_sample.html.erb +1 -0
  972. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/icons/image.png +0 -0
  973. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/image.jpg +0 -0
  974. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/rhtml_sample.rhtml +1 -0
  975. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/strings.js +4 -0
  976. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/style.css +0 -0
  977. data/spec/fixtures/builder_tests/apps/html_test/french.lproj/french-icons/fr.png +0 -0
  978. data/spec/fixtures/builder_tests/apps/html_test/french.lproj/strings.js +4 -0
  979. data/spec/fixtures/builder_tests/apps/html_test/lib/layout_template.rhtml +1 -0
  980. data/spec/fixtures/builder_tests/apps/html_test/scripts.js +0 -0
  981. data/spec/fixtures/builder_tests/apps/javascript_test/sc_static.js +15 -0
  982. data/spec/fixtures/builder_tests/apps/javascript_test/sc_super.js +4 -0
  983. data/spec/fixtures/builder_tests/apps/javascript_test/strings.js +7 -0
  984. data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +3 -0
  985. data/spec/fixtures/builder_tests/apps/strings_test/lproj/strings.js +8 -0
  986. data/spec/fixtures/builder_tests/apps/stylesheet_test/build_directives.css +9 -0
  987. data/spec/fixtures/builder_tests/apps/stylesheet_test/sc_static.css +12 -0
  988. data/spec/fixtures/builder_tests/apps/test_test/lib/alt_layout.rhtml +1 -0
  989. data/spec/fixtures/builder_tests/apps/test_test/lib/test_layout.rhtml +3 -0
  990. data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test.js +1 -0
  991. data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test2.js +1 -0
  992. data/spec/fixtures/builder_tests/apps/test_test/tests/rhtml_test.rhtml +4 -0
  993. data/spec/fixtures/builder_tests/frameworks/debug/core.js +0 -0
  994. data/spec/fixtures/builder_tests/frameworks/debug/english.lproj/dummy.css +0 -0
  995. data/spec/fixtures/builder_tests/frameworks/dynamic_req_target_1/dynamic_req_js_1.js +0 -0
  996. data/spec/fixtures/builder_tests/frameworks/dynamic_req_target_1/english.lproj/dynamic_req_style_1.css +0 -0
  997. data/spec/fixtures/builder_tests/frameworks/qunit/core.js +0 -0
  998. data/spec/fixtures/builder_tests/frameworks/qunit/english.lproj/dummy.css +0 -0
  999. data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/req_style_1.css +0 -0
  1000. data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/strings.js +4 -0
  1001. data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/test.rhtml +1 -0
  1002. data/spec/fixtures/builder_tests/frameworks/req_target_1/req_js_1.js +0 -0
  1003. data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/req_style_2.css +0 -0
  1004. data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/test.rhtml +1 -0
  1005. data/spec/fixtures/builder_tests/frameworks/req_target_2/javascript.js +1 -0
  1006. data/spec/fixtures/builder_tests/frameworks/req_target_2/lib/alt_layout.rhtml +0 -0
  1007. data/spec/fixtures/builder_tests/frameworks/req_target_2/req_js_2.js +0 -0
  1008. data/spec/fixtures/builder_tests/themes/sample_theme/Buildfile +1 -0
  1009. data/spec/fixtures/buildfiles/basic/Buildfile +16 -0
  1010. data/spec/fixtures/buildfiles/basic/task_module.rake +6 -0
  1011. data/spec/fixtures/buildfiles/installed/Buildfile +7 -0
  1012. data/spec/fixtures/buildfiles/installed/Buildfile2 +5 -0
  1013. data/spec/fixtures/buildfiles/project_test/Buildfile +4 -0
  1014. data/spec/fixtures/buildfiles/project_test/not_project/Buildfile +2 -0
  1015. data/spec/fixtures/buildfiles/project_test/not_project/child/PLACEHOLDER +0 -0
  1016. data/spec/fixtures/entry_for_project/Buildfile +1 -0
  1017. data/spec/fixtures/entry_for_project/apps/test_app/entry.txt +0 -0
  1018. data/spec/fixtures/entry_for_project/apps/test_app/frameworks/nested/PLACEHOLDER +0 -0
  1019. data/spec/fixtures/entry_for_project/frameworks/shared/PLACEHOLDER +0 -0
  1020. data/spec/fixtures/find_targets/custom/Buildfile +8 -0
  1021. data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar1/PLACEHOLDER +0 -0
  1022. data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar2/PLACEHOLDER +0 -0
  1023. data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo1/PLACEHOLDER +0 -0
  1024. data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo2/PLACEHOLDER +0 -0
  1025. data/spec/fixtures/find_targets/custom/foos/custom_foos/Buildfile +5 -0
  1026. data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo1/PLACEHOLDER +0 -0
  1027. data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo2/PLACEHOLDER +0 -0
  1028. data/spec/fixtures/find_targets/custom/foos/custom_foos/foos/not_foo1/PLACEHOLDER +0 -0
  1029. data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar1/PLACEHOLDER +0 -0
  1030. data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar2/PLACEHOLDER +0 -0
  1031. data/spec/fixtures/find_targets/nested/Buildfile +8 -0
  1032. data/spec/fixtures/find_targets/nested/apps/app1/Buildfile +1 -0
  1033. data/spec/fixtures/find_targets/nested/apps/app1/apps/nested_app/PLACEHOLDER +0 -0
  1034. data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework1/PLACEHOLDER +0 -0
  1035. data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework2/PLACEHOLDER +0 -0
  1036. data/spec/fixtures/find_targets/standard/clients/client1/PLACEHOLDER +0 -0
  1037. data/spec/fixtures/find_targets/standard/frameworks/framework1/frameworks/framework1/PLACEHOLDER +0 -0
  1038. data/spec/fixtures/find_targets/standard/frameworks/framework2/PLACEHOLDER +0 -0
  1039. data/spec/fixtures/find_targets/standard/themes/theme1/PLACEHOLDER +0 -0
  1040. data/spec/fixtures/find_targets/standard/themes/theme2/PLACEHOLDER +0 -0
  1041. data/spec/fixtures/languages/apps/caps_long_names/English.lproj/PLACEHOLDER +0 -0
  1042. data/spec/fixtures/languages/apps/caps_long_names/FreNCH.lproj/PLACEHOLDER +0 -0
  1043. data/spec/fixtures/languages/apps/caps_long_names/UnknOWN.lproj/PLACEHOLDER +0 -0
  1044. data/spec/fixtures/languages/apps/long_names/english.lproj/PLACEHOLDER +0 -0
  1045. data/spec/fixtures/languages/apps/long_names/french.lproj/PLACEHOLDER +0 -0
  1046. data/spec/fixtures/languages/apps/long_names/german.lproj/PLACEHOLDER +0 -0
  1047. data/spec/fixtures/languages/apps/long_names/italian.lproj/PLACEHOLDER +0 -0
  1048. data/spec/fixtures/languages/apps/long_names/japanese.lproj/PLACEHOLDER +0 -0
  1049. data/spec/fixtures/languages/apps/long_names/spanish.lproj/PLACEHOLDER +0 -0
  1050. data/spec/fixtures/languages/apps/long_names/unknown.lproj/PLACEHOLDER +0 -0
  1051. data/spec/fixtures/languages/apps/no_names/PLACEHOLDER +0 -0
  1052. data/spec/fixtures/languages/apps/short_names/de.lproj/PLACEHOLDER +0 -0
  1053. data/spec/fixtures/languages/apps/short_names/en-CA.lproj/PLACEHOLDER +0 -0
  1054. data/spec/fixtures/languages/apps/short_names/en-GB.lproj/PLACEHOLDER +0 -0
  1055. data/spec/fixtures/languages/apps/short_names/en-US.lproj/PLACEHOLDER +0 -0
  1056. data/spec/fixtures/languages/apps/short_names/en.lproj/PLACEHOLDER +0 -0
  1057. data/spec/fixtures/languages/apps/short_names/es.lproj/PLACEHOLDER +0 -0
  1058. data/spec/fixtures/languages/apps/short_names/foo.lproj/PLACEHOLDER +0 -0
  1059. data/spec/fixtures/languages/apps/short_names/fr.lproj/PLACEHOLDER +0 -0
  1060. data/spec/fixtures/languages/apps/short_names/it.lproj/PLACEHOLDER +0 -0
  1061. data/spec/fixtures/languages/apps/short_names/ja.lproj/PLACEHOLDER +0 -0
  1062. data/spec/fixtures/ordered_entries/apps/no_requires/1.js +1 -0
  1063. data/spec/fixtures/ordered_entries/apps/no_requires/B.js +1 -0
  1064. data/spec/fixtures/ordered_entries/apps/no_requires/a/a.js +1 -0
  1065. data/spec/fixtures/ordered_entries/apps/no_requires/a/b.js +1 -0
  1066. data/spec/fixtures/ordered_entries/apps/no_requires/a.js +1 -0
  1067. data/spec/fixtures/ordered_entries/apps/no_requires/b/a.js +1 -0
  1068. data/spec/fixtures/ordered_entries/apps/no_requires/c.js +1 -0
  1069. data/spec/fixtures/ordered_entries/apps/no_requires/core.js +1 -0
  1070. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/B.css +0 -0
  1071. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/a.css +0 -0
  1072. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/b.css +0 -0
  1073. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a.css +0 -0
  1074. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/b/a.css +0 -0
  1075. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/c.css +0 -0
  1076. data/spec/fixtures/ordered_entries/apps/no_requires/lproj/strings.js +1 -0
  1077. data/spec/fixtures/ordered_entries/apps/no_requires/utils.js +1 -0
  1078. data/spec/fixtures/ordered_entries/apps/with_requires/a.js +2 -0
  1079. data/spec/fixtures/ordered_entries/apps/with_requires/b.js +3 -0
  1080. data/spec/fixtures/ordered_entries/apps/with_requires/c.js +2 -0
  1081. data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/a.css +2 -0
  1082. data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/b.css +2 -0
  1083. data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/c.css +2 -0
  1084. data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/d.js +1 -0
  1085. data/spec/fixtures/real_world/Buildfile +12 -0
  1086. data/spec/fixtures/real_world/apps/account/README +1 -0
  1087. data/spec/fixtures/real_world/apps/calendar/README +1 -0
  1088. data/spec/fixtures/real_world/apps/contacts/README_BEFORE_EDITING +1 -0
  1089. data/spec/fixtures/real_world/apps/files/README +1 -0
  1090. data/spec/fixtures/real_world/apps/mail/README +1 -0
  1091. data/spec/fixtures/real_world/apps/mobile_photos/README +1 -0
  1092. data/spec/fixtures/real_world/apps/photos/README +1 -0
  1093. data/spec/fixtures/real_world/apps/uploader/README +1 -0
  1094. data/spec/fixtures/real_world/frameworks/core_files/PLACEHOLDER +0 -0
  1095. data/spec/fixtures/real_world/frameworks/core_photos/PLACEHOLDER +0 -0
  1096. data/spec/fixtures/real_world/frameworks/shared/PLACEHOLDER +0 -0
  1097. data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +26 -0
  1098. data/spec/fixtures/real_world/frameworks/sproutcore/README +1 -0
  1099. data/spec/fixtures/real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER +0 -0
  1100. data/spec/fixtures/real_world/frameworks/sproutcore/apps/test_runner/PLACEHOLDER +0 -0
  1101. data/spec/fixtures/real_world/frameworks/sproutcore/core.js +0 -0
  1102. data/spec/fixtures/real_world/frameworks/sproutcore/debug/debug-resource.html +0 -0
  1103. data/spec/fixtures/real_world/frameworks/sproutcore/debug/sample_debug.js +0 -0
  1104. data/spec/fixtures/real_world/frameworks/sproutcore/demo2.js +0 -0
  1105. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/debug/sample_debug-loc.js +0 -0
  1106. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.css +4 -0
  1107. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.html +1 -0
  1108. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo2.sass +0 -0
  1109. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.haml +0 -0
  1110. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.html.erb +1 -0
  1111. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.rhtml +0 -0
  1112. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/fixtures/sample_fixtures-loc.js +0 -0
  1113. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/has_require.css +4 -0
  1114. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_require.css +1 -0
  1115. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_sc_resource.rhtml +1 -0
  1116. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/protocols/sample-loc.js +0 -0
  1117. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.css +6 -0
  1118. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.rhtml +3 -0
  1119. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/strings.js +1 -0
  1120. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/tests/sample-loc.js +0 -0
  1121. data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample-json-fixture.json +1 -0
  1122. data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample_fixtures.js +0 -0
  1123. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/application/PLACEHOLDER +0 -0
  1124. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/costello/core.js +0 -0
  1125. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/data_store/PLACEHOLDER +0 -0
  1126. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/debug/PLACEHOLDER +0 -0
  1127. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/desktop/PLACEHOLDER +0 -0
  1128. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/empty_theme/PLACEHOLDER +0 -0
  1129. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/foundation/PLACEHOLDER +0 -0
  1130. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/mobile/PLACEHOLDER +0 -0
  1131. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/qunit/PLACEHOLDER +0 -0
  1132. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/uploader/PLACEHOLDER +0 -0
  1133. data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/french-resource.js +0 -0
  1134. data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/strings.js +1 -0
  1135. data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/german-resource.js +0 -0
  1136. data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/strings.js +0 -0
  1137. data/spec/fixtures/real_world/frameworks/sproutcore/has_require.js +4 -0
  1138. data/spec/fixtures/real_world/frameworks/sproutcore/lib/index.html +1 -0
  1139. data/spec/fixtures/real_world/frameworks/sproutcore/no_require.js +1 -0
  1140. data/spec/fixtures/real_world/frameworks/sproutcore/protocols/sample.js +0 -0
  1141. data/spec/fixtures/real_world/frameworks/sproutcore/resources/boo.png +0 -0
  1142. data/spec/fixtures/real_world/frameworks/sproutcore/sc_resource.js +6 -0
  1143. data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample1.js +0 -0
  1144. data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample2.js +0 -0
  1145. data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.js +0 -0
  1146. data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.rhtml +1 -0
  1147. data/spec/fixtures/real_world/frameworks/sproutcore/themes/standard_theme/README +0 -0
  1148. data/spec/fixtures/real_world/frameworks/sproutcore/views/view.js +1 -0
  1149. data/spec/fixtures/real_world/generators/sample_custom/Buildfile +0 -0
  1150. data/spec/fixtures/recursive_project/Buildfile +8 -0
  1151. data/spec/fixtures/recursive_project/frameworks/sproutcore/frameworks/costello/PLACEHOLDER +0 -0
  1152. data/spec/lib/builders/bundle_spec.rb +294 -0
  1153. data/spec/lib/builders/combine_spec.rb +67 -0
  1154. data/spec/lib/builders/html_spec.rb +579 -0
  1155. data/spec/lib/builders/javascript_spec.rb +81 -0
  1156. data/spec/lib/builders/sass_spec.rb +43 -0
  1157. data/spec/lib/builders/spec_helper.rb +30 -0
  1158. data/spec/lib/builders/strings_spec.rb +52 -0
  1159. data/spec/lib/builders/stylesheet_spec.rb +63 -0
  1160. data/spec/lib/builders/test_index_spec.rb +44 -0
  1161. data/spec/lib/builders/test_spec.rb +136 -0
  1162. data/spec/lib/buildfile/config_for_spec.rb +81 -0
  1163. data/spec/lib/buildfile/define_spec.rb +59 -0
  1164. data/spec/lib/buildfile/dup_spec.rb +65 -0
  1165. data/spec/lib/buildfile/invoke_spec.rb +130 -0
  1166. data/spec/lib/buildfile/load_spec.rb +49 -0
  1167. data/spec/lib/buildfile/task/dup_spec.rb +55 -0
  1168. data/spec/lib/buildfile/task_defined_spec.rb +17 -0
  1169. data/spec/lib/buildfile_commands/build_task_spec.rb +19 -0
  1170. data/spec/lib/buildfile_commands/config_spec.rb +97 -0
  1171. data/spec/lib/buildfile_commands/import_spec.rb +17 -0
  1172. data/spec/lib/buildfile_commands/namespace_spec.rb +18 -0
  1173. data/spec/lib/buildfile_commands/proxies_spec.rb +38 -0
  1174. data/spec/lib/buildfile_commands/replace_task_spec.rb +29 -0
  1175. data/spec/lib/buildfile_commands/task_spec.rb +36 -0
  1176. data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +26 -0
  1177. data/spec/lib/models/hash_struct/deep_clone_spec.rb +27 -0
  1178. data/spec/lib/models/hash_struct/has_options_spec.rb +32 -0
  1179. data/spec/lib/models/hash_struct/hash_spec.rb +64 -0
  1180. data/spec/lib/models/hash_struct/merge_spec.rb +26 -0
  1181. data/spec/lib/models/hash_struct/method_missing.rb +41 -0
  1182. data/spec/lib/models/manifest/add_entry_spec.rb +36 -0
  1183. data/spec/lib/models/manifest/add_transform_spec.rb +91 -0
  1184. data/spec/lib/models/manifest/build_spec.rb +78 -0
  1185. data/spec/lib/models/manifest/entry_for_spec.rb +94 -0
  1186. data/spec/lib/models/manifest/find_entry.rb +97 -0
  1187. data/spec/lib/models/manifest/prepare_spec.rb +62 -0
  1188. data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +31 -0
  1189. data/spec/lib/models/manifest_entry/prepare_spec.rb +54 -0
  1190. data/spec/lib/models/project/add_target_spec.rb +44 -0
  1191. data/spec/lib/models/project/buildfile_spec.rb +35 -0
  1192. data/spec/lib/models/project/find_targets_for_spec.rb +78 -0
  1193. data/spec/lib/models/project/load_nearest_project_spec.rb +23 -0
  1194. data/spec/lib/models/project/target_for_spec.rb +33 -0
  1195. data/spec/lib/models/project/targets_spec.rb +62 -0
  1196. data/spec/lib/models/target/compute_build_number_spec.rb +125 -0
  1197. data/spec/lib/models/target/config_spec.rb +30 -0
  1198. data/spec/lib/models/target/expand_required_targets_spec.rb +48 -0
  1199. data/spec/lib/models/target/installed_languages_spec.rb +47 -0
  1200. data/spec/lib/models/target/lproj_for_spec.rb +38 -0
  1201. data/spec/lib/models/target/manifest_for_spec.rb +42 -0
  1202. data/spec/lib/models/target/parent_target_spec.rb +21 -0
  1203. data/spec/lib/models/target/prepare_spec.rb +53 -0
  1204. data/spec/lib/models/target/required_targets_spec.rb +119 -0
  1205. data/spec/lib/models/target/target_for_spec.rb +56 -0
  1206. data/spec/lib/tools/build_number_spec.rb +28 -0
  1207. data/spec/lib/tools/gen_spec.rb +207 -0
  1208. data/spec/lib/tools/tools_spec.rb +78 -0
  1209. data/spec/spec.opts +3 -0
  1210. data/spec/spec_helper.rb +137 -6
  1211. data/sproutcore-abbot.gemspec +1582 -0
  1212. data/vendor/github_gem_lint.rb +22 -0
  1213. data/{jsdoc → vendor/jsdoc}/README.txt +0 -0
  1214. data/vendor/jsdoc/app/frame/Chain.js +102 -0
  1215. data/vendor/jsdoc/app/frame/Dumper.js +144 -0
  1216. data/vendor/jsdoc/app/frame/Hash.js +47 -0
  1217. data/vendor/jsdoc/app/frame/Link.js +142 -0
  1218. data/vendor/jsdoc/app/frame/Namespace.js +10 -0
  1219. data/vendor/jsdoc/app/frame/Opt.js +134 -0
  1220. data/vendor/jsdoc/app/frame/Reflection.js +26 -0
  1221. data/vendor/jsdoc/app/frame/String.js +93 -0
  1222. data/vendor/jsdoc/app/frame/Testrun.js +129 -0
  1223. data/vendor/jsdoc/app/frame.js +33 -0
  1224. data/vendor/jsdoc/app/handlers/FOODOC.js +26 -0
  1225. data/{jsdoc → vendor/jsdoc}/app/handlers/XMLDOC/DomReader.js +0 -0
  1226. data/{jsdoc → vendor/jsdoc}/app/handlers/XMLDOC/XMLDoc.js +0 -0
  1227. data/{jsdoc → vendor/jsdoc}/app/handlers/XMLDOC/XMLParse.js +0 -0
  1228. data/vendor/jsdoc/app/handlers/XMLDOC.js +26 -0
  1229. data/vendor/jsdoc/app/lib/JSDOC/DocComment.js +200 -0
  1230. data/vendor/jsdoc/app/lib/JSDOC/DocTag.js +294 -0
  1231. data/vendor/jsdoc/app/lib/JSDOC/JsDoc.js +162 -0
  1232. data/vendor/jsdoc/app/lib/JSDOC/JsPlate.js +100 -0
  1233. data/vendor/jsdoc/app/lib/JSDOC/Lang.js +144 -0
  1234. data/vendor/jsdoc/app/lib/JSDOC/Parser.js +109 -0
  1235. data/vendor/jsdoc/app/lib/JSDOC/PluginManager.js +33 -0
  1236. data/vendor/jsdoc/app/lib/JSDOC/Symbol.js +681 -0
  1237. data/vendor/jsdoc/app/lib/JSDOC/SymbolSet.js +226 -0
  1238. data/vendor/jsdoc/app/lib/JSDOC/TextStream.js +41 -0
  1239. data/vendor/jsdoc/app/lib/JSDOC/Token.js +18 -0
  1240. data/vendor/jsdoc/app/lib/JSDOC/TokenReader.js +332 -0
  1241. data/vendor/jsdoc/app/lib/JSDOC/TokenStream.js +133 -0
  1242. data/vendor/jsdoc/app/lib/JSDOC/Util.js +32 -0
  1243. data/vendor/jsdoc/app/lib/JSDOC/Walker.js +453 -0
  1244. data/vendor/jsdoc/app/lib/JSDOC.js +98 -0
  1245. data/vendor/jsdoc/app/main.js +74 -0
  1246. data/vendor/jsdoc/app/plugins/commentSrcJson.js +19 -0
  1247. data/vendor/jsdoc/app/plugins/frameworkPrototype.js +16 -0
  1248. data/vendor/jsdoc/app/plugins/functionCall.js +10 -0
  1249. data/vendor/jsdoc/app/plugins/publishSrcHilite.js +62 -0
  1250. data/{jsdoc → vendor/jsdoc}/app/plugins/sproutcoreTags.js +0 -0
  1251. data/vendor/jsdoc/app/plugins/symbolLink.js +9 -0
  1252. data/vendor/jsdoc/app/plugins/tagParamConfig.js +31 -0
  1253. data/vendor/jsdoc/app/plugins/tagSynonyms.js +43 -0
  1254. data/vendor/jsdoc/app/run.js +346 -0
  1255. data/vendor/jsdoc/app/t/TestDoc.js +144 -0
  1256. data/{jsdoc → vendor/jsdoc/app}/t/runner.js +0 -0
  1257. data/{jsdoc → vendor/jsdoc/app}/test/addon.js +0 -0
  1258. data/{jsdoc → vendor/jsdoc/app}/test/anon_inner.js +0 -0
  1259. data/vendor/jsdoc/app/test/augments.js +31 -0
  1260. data/vendor/jsdoc/app/test/augments2.js +26 -0
  1261. data/vendor/jsdoc/app/test/borrows.js +41 -0
  1262. data/vendor/jsdoc/app/test/borrows2.js +23 -0
  1263. data/{jsdoc → vendor/jsdoc/app}/test/config.js +0 -0
  1264. data/vendor/jsdoc/app/test/constructs.js +18 -0
  1265. data/{jsdoc → vendor/jsdoc/app}/test/encoding.js +0 -0
  1266. data/{jsdoc → vendor/jsdoc/app}/test/encoding_other.js +0 -0
  1267. data/vendor/jsdoc/app/test/functions_anon.js +39 -0
  1268. data/vendor/jsdoc/app/test/functions_nested.js +33 -0
  1269. data/vendor/jsdoc/app/test/global.js +13 -0
  1270. data/vendor/jsdoc/app/test/globals.js +25 -0
  1271. data/vendor/jsdoc/app/test/ignore.js +10 -0
  1272. data/{jsdoc → vendor/jsdoc/app}/test/inner.js +0 -0
  1273. data/vendor/jsdoc/app/test/jsdoc_test.js +477 -0
  1274. data/vendor/jsdoc/app/test/lend.js +33 -0
  1275. data/vendor/jsdoc/app/test/memberof.js +20 -0
  1276. data/vendor/jsdoc/app/test/memberof_constructor.js +15 -0
  1277. data/vendor/jsdoc/app/test/name.js +19 -0
  1278. data/vendor/jsdoc/app/test/namespace_nested.js +23 -0
  1279. data/{jsdoc → vendor/jsdoc/app}/test/nocode.js +0 -0
  1280. data/vendor/jsdoc/app/test/oblit_anon.js +20 -0
  1281. data/vendor/jsdoc/app/test/overview.js +20 -0
  1282. data/vendor/jsdoc/app/test/param_inline.js +37 -0
  1283. data/{jsdoc → vendor/jsdoc/app}/test/params_optional.js +0 -0
  1284. data/vendor/jsdoc/app/test/prototype.js +17 -0
  1285. data/{jsdoc → vendor/jsdoc/app}/test/prototype_nested.js +0 -0
  1286. data/vendor/jsdoc/app/test/prototype_oblit.js +13 -0
  1287. data/vendor/jsdoc/app/test/prototype_oblit_constructor.js +24 -0
  1288. data/vendor/jsdoc/app/test/public.js +10 -0
  1289. data/{jsdoc → vendor/jsdoc/app}/test/shared.js +0 -0
  1290. data/{jsdoc → vendor/jsdoc/app}/test/shared2.js +0 -0
  1291. data/vendor/jsdoc/app/test/shortcuts.js +22 -0
  1292. data/vendor/jsdoc/app/test/static_this.js +13 -0
  1293. data/vendor/jsdoc/app/test/synonyms.js +23 -0
  1294. data/{jsdoc → vendor/jsdoc/app}/test/tosource.js +0 -0
  1295. data/vendor/jsdoc/app/test/variable_redefine.js +14 -0
  1296. data/vendor/jsdoc/app/test.js +304 -0
  1297. data/{jsdoc → vendor/jsdoc}/changes.txt +0 -0
  1298. data/{jsdoc → vendor/jsdoc}/conf/sample.conf +0 -0
  1299. data/{jsdoc → vendor/jsdoc}/java/build.xml +0 -0
  1300. data/{jsdoc → vendor/jsdoc}/java/build_1.4.xml +0 -0
  1301. data/{jsdoc → vendor/jsdoc}/java/classes/js.jar +0 -0
  1302. data/{jsdoc → vendor/jsdoc}/java/src/JsDebugRun.java +0 -0
  1303. data/{jsdoc → vendor/jsdoc}/java/src/JsRun.java +0 -0
  1304. data/{jsdoc → vendor/jsdoc}/jsdebug.jar +0 -0
  1305. data/{jsdoc → vendor/jsdoc}/jsrun.jar +0 -0
  1306. data/{jsdoc → vendor/jsdoc}/t/TestDoc.js +0 -0
  1307. data/vendor/jsdoc/t/runner.js +13 -0
  1308. data/vendor/jsdoc/test/addon.js +24 -0
  1309. data/vendor/jsdoc/test/anon_inner.js +14 -0
  1310. data/{jsdoc → vendor/jsdoc}/test/augments.js +0 -0
  1311. data/{jsdoc → vendor/jsdoc}/test/augments2.js +0 -0
  1312. data/{jsdoc → vendor/jsdoc}/test/borrows.js +0 -0
  1313. data/{jsdoc → vendor/jsdoc}/test/borrows2.js +0 -0
  1314. data/vendor/jsdoc/test/config.js +22 -0
  1315. data/{jsdoc → vendor/jsdoc}/test/constructs.js +0 -0
  1316. data/vendor/jsdoc/test/encoding.js +10 -0
  1317. data/vendor/jsdoc/test/encoding_other.js +12 -0
  1318. data/{jsdoc → vendor/jsdoc}/test/functions_anon.js +0 -0
  1319. data/{jsdoc → vendor/jsdoc}/test/functions_nested.js +0 -0
  1320. data/{jsdoc → vendor/jsdoc}/test/global.js +0 -0
  1321. data/{jsdoc → vendor/jsdoc}/test/globals.js +0 -0
  1322. data/{jsdoc → vendor/jsdoc}/test/ignore.js +0 -0
  1323. data/vendor/jsdoc/test/inner.js +16 -0
  1324. data/{jsdoc → vendor/jsdoc}/test/jsdoc_test.js +0 -0
  1325. data/{jsdoc → vendor/jsdoc}/test/lend.js +0 -0
  1326. data/{jsdoc → vendor/jsdoc}/test/memberof.js +0 -0
  1327. data/{jsdoc → vendor/jsdoc}/test/memberof_constructor.js +0 -0
  1328. data/{jsdoc → vendor/jsdoc}/test/name.js +0 -0
  1329. data/{jsdoc → vendor/jsdoc}/test/namespace_nested.js +0 -0
  1330. data/vendor/jsdoc/test/nocode.js +13 -0
  1331. data/{jsdoc → vendor/jsdoc}/test/oblit_anon.js +0 -0
  1332. data/{jsdoc → vendor/jsdoc}/test/overview.js +0 -0
  1333. data/{jsdoc → vendor/jsdoc}/test/param_inline.js +0 -0
  1334. data/vendor/jsdoc/test/params_optional.js +8 -0
  1335. data/{jsdoc → vendor/jsdoc}/test/prototype.js +0 -0
  1336. data/vendor/jsdoc/test/prototype_nested.js +9 -0
  1337. data/{jsdoc → vendor/jsdoc}/test/prototype_oblit.js +0 -0
  1338. data/{jsdoc → vendor/jsdoc}/test/prototype_oblit_constructor.js +0 -0
  1339. data/{jsdoc → vendor/jsdoc}/test/public.js +0 -0
  1340. data/vendor/jsdoc/test/shared.js +42 -0
  1341. data/vendor/jsdoc/test/shared2.js +2 -0
  1342. data/{jsdoc → vendor/jsdoc}/test/shortcuts.js +0 -0
  1343. data/{jsdoc → vendor/jsdoc}/test/static_this.js +0 -0
  1344. data/{jsdoc → vendor/jsdoc}/test/synonyms.js +0 -0
  1345. data/vendor/jsdoc/test/tosource.js +23 -0
  1346. data/{jsdoc → vendor/jsdoc}/test/variable_redefine.js +0 -0
  1347. data/{jsdoc → vendor/jsdoc}/test.js +0 -0
  1348. data/{yui_compressor → vendor/yui-compressor}/yuicompressor-2.4.2.jar +0 -0
  1349. metadata +1537 -431
  1350. data/License.txt +0 -20
  1351. data/Manifest.txt +0 -415
  1352. data/app_generators/sproutcore/USAGE +0 -4
  1353. data/app_generators/sproutcore/sproutcore_generator.rb +0 -68
  1354. data/app_generators/sproutcore/templates/README +0 -80
  1355. data/app_generators/sproutcore/templates/sc-config +0 -93
  1356. data/bin/sc-ide +0 -278
  1357. data/bin/sc-install +0 -101
  1358. data/bin/sc-remove +0 -99
  1359. data/bin/sc-update +0 -99
  1360. data/clients/sc_docs/HISTORY +0 -3
  1361. data/clients/sc_docs/README +0 -6
  1362. data/clients/sc_docs/controllers/docs.js +0 -150
  1363. data/clients/sc_docs/core.js +0 -19
  1364. data/clients/sc_docs/english.lproj/body.css +0 -112
  1365. data/clients/sc_docs/english.lproj/body.rhtml +0 -58
  1366. data/clients/sc_docs/english.lproj/no_docs.rhtml +0 -8
  1367. data/clients/sc_docs/english.lproj/strings.js +0 -14
  1368. data/clients/sc_docs/english.lproj/tabs.rhtml +0 -16
  1369. data/clients/sc_docs/fixtures/doc.js +0 -11
  1370. data/clients/sc_docs/main.js +0 -26
  1371. data/clients/sc_docs/models/doc.js +0 -15
  1372. data/clients/sc_docs/tests/controllers/docs.rhtml +0 -20
  1373. data/clients/sc_docs/tests/models/doc.rhtml +0 -20
  1374. data/clients/sc_docs/tests/views/doc_frame.rhtml +0 -20
  1375. data/clients/sc_docs/tests/views/doc_label_view.rhtml +0 -20
  1376. data/clients/sc_docs/views/doc_frame.js +0 -33
  1377. data/clients/sc_docs/views/doc_label.js +0 -20
  1378. data/clients/sc_test_runner/HISTORY +0 -3
  1379. data/clients/sc_test_runner/README +0 -4
  1380. data/clients/sc_test_runner/controllers/runner.js +0 -203
  1381. data/clients/sc_test_runner/core.js +0 -19
  1382. data/clients/sc_test_runner/english.lproj/body.css +0 -91
  1383. data/clients/sc_test_runner/english.lproj/body.rhtml +0 -76
  1384. data/clients/sc_test_runner/english.lproj/icons/small/next.png +0 -0
  1385. data/clients/sc_test_runner/english.lproj/icons/small/reset.png +0 -0
  1386. data/clients/sc_test_runner/english.lproj/images/gradients.png +0 -0
  1387. data/clients/sc_test_runner/english.lproj/images/toolbar.png +0 -0
  1388. data/clients/sc_test_runner/english.lproj/no_tests.rhtml +0 -5
  1389. data/clients/sc_test_runner/english.lproj/strings.js +0 -14
  1390. data/clients/sc_test_runner/fixtures/test.js +0 -12
  1391. data/clients/sc_test_runner/main.js +0 -21
  1392. data/clients/sc_test_runner/models/test.js +0 -27
  1393. data/clients/sc_test_runner/views/runner_frame.js +0 -74
  1394. data/clients/sc_test_runner/views/test_label.js +0 -20
  1395. data/config/hoe.rb +0 -72
  1396. data/config/requirements.rb +0 -17
  1397. data/frameworks/prototype/HISTORY +0 -3
  1398. data/frameworks/prototype/README +0 -2
  1399. data/frameworks/prototype/prototype.js +0 -4223
  1400. data/frameworks/sproutcore/controllers/array.js +0 -409
  1401. data/frameworks/sproutcore/controllers/collection.js +0 -203
  1402. data/frameworks/sproutcore/controllers/controller.js +0 -323
  1403. data/frameworks/sproutcore/controllers/object.js +0 -401
  1404. data/frameworks/sproutcore/core.js +0 -636
  1405. data/frameworks/sproutcore/debug/trace.js +0 -81
  1406. data/frameworks/sproutcore/debug/unittest.js +0 -626
  1407. data/frameworks/sproutcore/drag/drag.js +0 -788
  1408. data/frameworks/sproutcore/drag/drag_data_source.js +0 -40
  1409. data/frameworks/sproutcore/drag/drag_source.js +0 -75
  1410. data/frameworks/sproutcore/drag/drop_target.js +0 -160
  1411. data/frameworks/sproutcore/english.lproj/buttons.css +0 -694
  1412. data/frameworks/sproutcore/english.lproj/core.css +0 -145
  1413. data/frameworks/sproutcore/english.lproj/detect-browser +0 -44
  1414. data/frameworks/sproutcore/english.lproj/icons.css +0 -227
  1415. data/frameworks/sproutcore/english.lproj/images/indicator.gif +0 -0
  1416. data/frameworks/sproutcore/english.lproj/images/sc-theme-sprite.png +0 -0
  1417. data/frameworks/sproutcore/english.lproj/menu.css +0 -122
  1418. data/frameworks/sproutcore/english.lproj/panes.css +0 -136
  1419. data/frameworks/sproutcore/english.lproj/picker.css +0 -22
  1420. data/frameworks/sproutcore/english.lproj/splitview.css +0 -83
  1421. data/frameworks/sproutcore/english.lproj/strings.js +0 -20
  1422. data/frameworks/sproutcore/english.lproj/tab.css +0 -23
  1423. data/frameworks/sproutcore/english.lproj/tests.css +0 -67
  1424. data/frameworks/sproutcore/english.lproj/theme.css +0 -502
  1425. data/frameworks/sproutcore/foundation/animator.js +0 -679
  1426. data/frameworks/sproutcore/foundation/application.js +0 -228
  1427. data/frameworks/sproutcore/foundation/benchmark.js +0 -244
  1428. data/frameworks/sproutcore/foundation/binding.js +0 -385
  1429. data/frameworks/sproutcore/foundation/date.js +0 -357
  1430. data/frameworks/sproutcore/foundation/enumerator.js +0 -105
  1431. data/frameworks/sproutcore/foundation/error.js +0 -84
  1432. data/frameworks/sproutcore/foundation/input_manager.js +0 -165
  1433. data/frameworks/sproutcore/foundation/json.js +0 -296
  1434. data/frameworks/sproutcore/foundation/mock.js +0 -42
  1435. data/frameworks/sproutcore/foundation/node_descriptor.js +0 -71
  1436. data/frameworks/sproutcore/foundation/object.js +0 -875
  1437. data/frameworks/sproutcore/foundation/page.js +0 -67
  1438. data/frameworks/sproutcore/foundation/path_module.js +0 -431
  1439. data/frameworks/sproutcore/foundation/responder.js +0 -313
  1440. data/frameworks/sproutcore/foundation/routes.js +0 -375
  1441. data/frameworks/sproutcore/foundation/run_loop.js +0 -322
  1442. data/frameworks/sproutcore/foundation/set.js +0 -222
  1443. data/frameworks/sproutcore/foundation/string.js +0 -319
  1444. data/frameworks/sproutcore/foundation/timer.js +0 -405
  1445. data/frameworks/sproutcore/foundation/undo_manager.js +0 -186
  1446. data/frameworks/sproutcore/foundation/utils.js +0 -320
  1447. data/frameworks/sproutcore/globals/panels.js +0 -182
  1448. data/frameworks/sproutcore/globals/popups.js +0 -61
  1449. data/frameworks/sproutcore/globals/window.js +0 -498
  1450. data/frameworks/sproutcore/lib/button_views.rb +0 -330
  1451. data/frameworks/sproutcore/lib/collection_view.rb +0 -83
  1452. data/frameworks/sproutcore/lib/core_views.rb +0 -326
  1453. data/frameworks/sproutcore/lib/form_views.rb +0 -253
  1454. data/frameworks/sproutcore/lib/menu_views.rb +0 -93
  1455. data/frameworks/sproutcore/mixins/array.js +0 -265
  1456. data/frameworks/sproutcore/mixins/collection_view_delegate.js +0 -201
  1457. data/frameworks/sproutcore/mixins/control.js +0 -265
  1458. data/frameworks/sproutcore/mixins/delegate_support.js +0 -66
  1459. data/frameworks/sproutcore/mixins/editable.js +0 -144
  1460. data/frameworks/sproutcore/mixins/enumerable.js +0 -1002
  1461. data/frameworks/sproutcore/mixins/inline_editor_delegate.js +0 -82
  1462. data/frameworks/sproutcore/mixins/observable.js +0 -1060
  1463. data/frameworks/sproutcore/mixins/scrollable.js +0 -246
  1464. data/frameworks/sproutcore/mixins/selection_support.js +0 -160
  1465. data/frameworks/sproutcore/mixins/validatable.js +0 -152
  1466. data/frameworks/sproutcore/models/collection.js +0 -421
  1467. data/frameworks/sproutcore/models/record.js +0 -811
  1468. data/frameworks/sproutcore/models/store.js +0 -352
  1469. data/frameworks/sproutcore/panes/dialog.js +0 -16
  1470. data/frameworks/sproutcore/panes/manager.js +0 -164
  1471. data/frameworks/sproutcore/panes/menu.js +0 -45
  1472. data/frameworks/sproutcore/panes/overlay.js +0 -235
  1473. data/frameworks/sproutcore/panes/pane.js +0 -117
  1474. data/frameworks/sproutcore/panes/panel.js +0 -19
  1475. data/frameworks/sproutcore/panes/picker.js +0 -46
  1476. data/frameworks/sproutcore/server/rails_server.js +0 -79
  1477. data/frameworks/sproutcore/server/rest_server.js +0 -177
  1478. data/frameworks/sproutcore/server/server.js +0 -629
  1479. data/frameworks/sproutcore/tests/controllers/array.rhtml +0 -126
  1480. data/frameworks/sproutcore/tests/controllers/controller.rhtml +0 -273
  1481. data/frameworks/sproutcore/tests/controllers/object.rhtml +0 -353
  1482. data/frameworks/sproutcore/tests/core/guidFor.rhtml +0 -114
  1483. data/frameworks/sproutcore/tests/foundation/application.rhtml +0 -125
  1484. data/frameworks/sproutcore/tests/foundation/array.rhtml +0 -220
  1485. data/frameworks/sproutcore/tests/foundation/object.rhtml +0 -69
  1486. data/frameworks/sproutcore/tests/foundation/set.rhtml +0 -254
  1487. data/frameworks/sproutcore/tests/foundation/timer/invalidate.rhtml +0 -33
  1488. data/frameworks/sproutcore/tests/foundation/timer/invokeLater.rhtml +0 -145
  1489. data/frameworks/sproutcore/tests/foundation/timer/isPaused.rhtml +0 -70
  1490. data/frameworks/sproutcore/tests/foundation/timer/schedule.rhtml +0 -145
  1491. data/frameworks/sproutcore/tests/globals/window.rhtml +0 -45
  1492. data/frameworks/sproutcore/tests/mixins/enumerable.rhtml +0 -421
  1493. data/frameworks/sproutcore/tests/mixins/observable.rhtml +0 -127
  1494. data/frameworks/sproutcore/tests/models/collection.rhtml +0 -160
  1495. data/frameworks/sproutcore/tests/models/model.rhtml +0 -373
  1496. data/frameworks/sproutcore/tests/panes/pane.rhtml +0 -88
  1497. data/frameworks/sproutcore/tests/views/checkbox.rhtml +0 -21
  1498. data/frameworks/sproutcore/tests/views/collection/base.rhtml +0 -211
  1499. data/frameworks/sproutcore/tests/views/collection/incremental_rendering.rhtml +0 -260
  1500. data/frameworks/sproutcore/tests/views/collection/source_list_rendering.rhtml +0 -232
  1501. data/frameworks/sproutcore/tests/views/image_cell.rhtml +0 -19
  1502. data/frameworks/sproutcore/tests/views/label_item.rhtml +0 -19
  1503. data/frameworks/sproutcore/tests/views/list.rhtml +0 -20
  1504. data/frameworks/sproutcore/tests/views/list_item.rhtml +0 -20
  1505. data/frameworks/sproutcore/tests/views/popup_button.rhtml +0 -116
  1506. data/frameworks/sproutcore/tests/views/slider.rhtml +0 -20
  1507. data/frameworks/sproutcore/tests/views/text_cell.rhtml +0 -19
  1508. data/frameworks/sproutcore/tests/views/text_field.rhtml +0 -37
  1509. data/frameworks/sproutcore/tests/views/view/clippingFrame.rhtml +0 -401
  1510. data/frameworks/sproutcore/tests/views/view/frame.rhtml +0 -357
  1511. data/frameworks/sproutcore/tests/views/view/innerFrame.rhtml +0 -366
  1512. data/frameworks/sproutcore/tests/views/view/isVisibleInWindow.rhtml +0 -148
  1513. data/frameworks/sproutcore/tests/views/view/scrollFrame.rhtml +0 -467
  1514. data/frameworks/sproutcore/validators/credit_card.js +0 -112
  1515. data/frameworks/sproutcore/validators/date.js +0 -50
  1516. data/frameworks/sproutcore/validators/email.js +0 -47
  1517. data/frameworks/sproutcore/validators/not_empty.js +0 -34
  1518. data/frameworks/sproutcore/validators/number.js +0 -69
  1519. data/frameworks/sproutcore/validators/password.js +0 -89
  1520. data/frameworks/sproutcore/validators/validator.js +0 -314
  1521. data/frameworks/sproutcore/views/button/button.js +0 -478
  1522. data/frameworks/sproutcore/views/button/checkbox.js +0 -29
  1523. data/frameworks/sproutcore/views/button/disclosure.js +0 -42
  1524. data/frameworks/sproutcore/views/button/radio.js +0 -29
  1525. data/frameworks/sproutcore/views/collection/collection.js +0 -2764
  1526. data/frameworks/sproutcore/views/collection/grid.js +0 -251
  1527. data/frameworks/sproutcore/views/collection/image_cell.js +0 -125
  1528. data/frameworks/sproutcore/views/collection/list.js +0 -162
  1529. data/frameworks/sproutcore/views/collection/source_list.js +0 -458
  1530. data/frameworks/sproutcore/views/collection/table.js +0 -118
  1531. data/frameworks/sproutcore/views/container.js +0 -67
  1532. data/frameworks/sproutcore/views/error_explanation.js +0 -58
  1533. data/frameworks/sproutcore/views/field/checkbox_field.js +0 -40
  1534. data/frameworks/sproutcore/views/field/field.js +0 -218
  1535. data/frameworks/sproutcore/views/field/radio_field.js +0 -122
  1536. data/frameworks/sproutcore/views/field/select_field.js +0 -307
  1537. data/frameworks/sproutcore/views/field/text_field.js +0 -251
  1538. data/frameworks/sproutcore/views/field/textarea_field.js +0 -32
  1539. data/frameworks/sproutcore/views/filter_button.js +0 -29
  1540. data/frameworks/sproutcore/views/form.js +0 -597
  1541. data/frameworks/sproutcore/views/image.js +0 -255
  1542. data/frameworks/sproutcore/views/inline_text_field.js +0 -427
  1543. data/frameworks/sproutcore/views/label.js +0 -243
  1544. data/frameworks/sproutcore/views/list_item.js +0 -516
  1545. data/frameworks/sproutcore/views/menu_item.js +0 -97
  1546. data/frameworks/sproutcore/views/pagination.js +0 -62
  1547. data/frameworks/sproutcore/views/popup_button.js +0 -90
  1548. data/frameworks/sproutcore/views/popup_menu.js +0 -139
  1549. data/frameworks/sproutcore/views/progress.js +0 -125
  1550. data/frameworks/sproutcore/views/radio_group.js +0 -48
  1551. data/frameworks/sproutcore/views/scroll.js +0 -74
  1552. data/frameworks/sproutcore/views/segmented.js +0 -105
  1553. data/frameworks/sproutcore/views/slider.js +0 -134
  1554. data/frameworks/sproutcore/views/source_list_group.js +0 -130
  1555. data/frameworks/sproutcore/views/spinner.js +0 -11
  1556. data/frameworks/sproutcore/views/split.js +0 -312
  1557. data/frameworks/sproutcore/views/split_divider.js +0 -112
  1558. data/frameworks/sproutcore/views/tab.js +0 -128
  1559. data/frameworks/sproutcore/views/toolbar.js +0 -29
  1560. data/frameworks/sproutcore/views/view.js +0 -2301
  1561. data/jsdoc/app/frame/Chain.js +0 -102
  1562. data/jsdoc/app/frame/Dumper.js +0 -144
  1563. data/jsdoc/app/frame/Hash.js +0 -47
  1564. data/jsdoc/app/frame/Link.js +0 -142
  1565. data/jsdoc/app/frame/Namespace.js +0 -10
  1566. data/jsdoc/app/frame/Opt.js +0 -134
  1567. data/jsdoc/app/frame/Reflection.js +0 -26
  1568. data/jsdoc/app/frame/String.js +0 -93
  1569. data/jsdoc/app/frame/Testrun.js +0 -129
  1570. data/jsdoc/app/frame.js +0 -33
  1571. data/jsdoc/app/handlers/FOODOC.js +0 -26
  1572. data/jsdoc/app/handlers/XMLDOC.js +0 -26
  1573. data/jsdoc/app/lib/JSDOC/DocComment.js +0 -200
  1574. data/jsdoc/app/lib/JSDOC/DocTag.js +0 -294
  1575. data/jsdoc/app/lib/JSDOC/JsDoc.js +0 -180
  1576. data/jsdoc/app/lib/JSDOC/JsPlate.js +0 -100
  1577. data/jsdoc/app/lib/JSDOC/Lang.js +0 -144
  1578. data/jsdoc/app/lib/JSDOC/Parser.js +0 -109
  1579. data/jsdoc/app/lib/JSDOC/PluginManager.js +0 -33
  1580. data/jsdoc/app/lib/JSDOC/Symbol.js +0 -600
  1581. data/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -220
  1582. data/jsdoc/app/lib/JSDOC/TextStream.js +0 -41
  1583. data/jsdoc/app/lib/JSDOC/Token.js +0 -18
  1584. data/jsdoc/app/lib/JSDOC/TokenReader.js +0 -323
  1585. data/jsdoc/app/lib/JSDOC/TokenStream.js +0 -133
  1586. data/jsdoc/app/lib/JSDOC/Util.js +0 -32
  1587. data/jsdoc/app/lib/JSDOC/Walker.js +0 -416
  1588. data/jsdoc/app/lib/JSDOC.js +0 -97
  1589. data/jsdoc/app/main.js +0 -74
  1590. data/jsdoc/app/plugins/commentSrcJson.js +0 -19
  1591. data/jsdoc/app/plugins/frameworkPrototype.js +0 -16
  1592. data/jsdoc/app/plugins/functionCall.js +0 -10
  1593. data/jsdoc/app/plugins/publishSrcHilite.js +0 -62
  1594. data/jsdoc/app/plugins/symbolLink.js +0 -9
  1595. data/jsdoc/app/plugins/tagParamConfig.js +0 -31
  1596. data/jsdoc/app/plugins/tagSynonyms.js +0 -43
  1597. data/jsdoc/app/run.js +0 -346
  1598. data/jsdoc/templates/sproutcore/allclasses.tmpl +0 -17
  1599. data/jsdoc/templates/sproutcore/allfiles.tmpl +0 -56
  1600. data/jsdoc/templates/sproutcore/class.tmpl +0 -423
  1601. data/jsdoc/templates/sproutcore/index.tmpl +0 -55
  1602. data/jsdoc/templates/sproutcore/publish.js +0 -333
  1603. data/jsdoc/templates/sproutcore/static/default.css +0 -191
  1604. data/jsdoc/templates/sproutcore/static/index.html +0 -19
  1605. data/jsdoc/templates/sproutcore/symbol.tmpl +0 -35
  1606. data/lib/sproutcore/build_tools/html_builder.rb +0 -163
  1607. data/lib/sproutcore/build_tools/resource_builder.rb +0 -256
  1608. data/lib/sproutcore/build_tools/test_template.rhtml +0 -12
  1609. data/lib/sproutcore/build_tools.rb +0 -44
  1610. data/lib/sproutcore/bundle.rb +0 -802
  1611. data/lib/sproutcore/bundle_installer.rb +0 -270
  1612. data/lib/sproutcore/bundle_manifest.rb +0 -574
  1613. data/lib/sproutcore/cssmin.rb +0 -195
  1614. data/lib/sproutcore/generator_helper.rb +0 -185
  1615. data/lib/sproutcore/helpers.rb +0 -3
  1616. data/lib/sproutcore/jsdoc.rb +0 -45
  1617. data/lib/sproutcore/jsmin.rb +0 -247
  1618. data/lib/sproutcore/library.rb +0 -479
  1619. data/lib/sproutcore/merb/bundle_controller.rb +0 -297
  1620. data/lib/sproutcore/merb/router.rb +0 -50
  1621. data/lib/sproutcore/merb.rb +0 -22
  1622. data/lib/sproutcore/renderers/erubis.rb +0 -43
  1623. data/lib/sproutcore/renderers/haml.rb +0 -28
  1624. data/lib/sproutcore/renderers/sass.rb +0 -42
  1625. data/lib/sproutcore/version.rb +0 -9
  1626. data/lib/sproutcore/view_helpers.rb +0 -656
  1627. data/sc-config +0 -16
  1628. data/sc_generators/client/README +0 -3
  1629. data/sc_generators/client/USAGE +0 -11
  1630. data/sc_generators/client/client_generator.rb +0 -45
  1631. data/sc_generators/client/templates/core.js +0 -16
  1632. data/sc_generators/client/templates/english.lproj/body.css +0 -147
  1633. data/sc_generators/client/templates/english.lproj/body.rhtml +0 -18
  1634. data/sc_generators/client/templates/english.lproj/strings.js +0 -13
  1635. data/sc_generators/client/templates/main.js +0 -35
  1636. data/sc_generators/controller/USAGE +0 -15
  1637. data/sc_generators/controller/controller_generator.rb +0 -51
  1638. data/sc_generators/controller/templates/controller.js +0 -21
  1639. data/sc_generators/controller/templates/test.rhtml +0 -22
  1640. data/sc_generators/framework/README +0 -6
  1641. data/sc_generators/framework/USAGE +0 -11
  1642. data/sc_generators/framework/framework_generator.rb +0 -53
  1643. data/sc_generators/framework/templates/core.js +0 -20
  1644. data/sc_generators/framework/templates/english.lproj/strings.js +0 -13
  1645. data/sc_generators/language/USAGE +0 -13
  1646. data/sc_generators/language/language_generator.rb +0 -47
  1647. data/sc_generators/language/templates/strings.js +0 -13
  1648. data/sc_generators/model/USAGE +0 -23
  1649. data/sc_generators/model/model_generator.rb +0 -55
  1650. data/sc_generators/model/templates/fixture.js +0 -43
  1651. data/sc_generators/model/templates/model.js +0 -20
  1652. data/sc_generators/model/templates/test.rhtml +0 -21
  1653. data/sc_generators/test/USAGE +0 -15
  1654. data/sc_generators/test/templates/test.rhtml +0 -21
  1655. data/sc_generators/test/test_generator.rb +0 -47
  1656. data/sc_generators/view/USAGE +0 -15
  1657. data/sc_generators/view/templates/test.rhtml +0 -21
  1658. data/sc_generators/view/templates/view.js +0 -20
  1659. data/sc_generators/view/view_generator.rb +0 -51
  1660. data/script/destroy +0 -14
  1661. data/script/generate +0 -14
  1662. data/script/txt2html +0 -74
  1663. data/setup.rb +0 -1585
  1664. data/spec/sproutcore_spec.rb +0 -11
  1665. data/tasks/deployment.rake +0 -47
  1666. data/tasks/environment.rake +0 -7
  1667. data/tasks/rspec.rake +0 -21
  1668. data/tasks/website.rake +0 -17
@@ -0,0 +1,2775 @@
1
+ // ==========================================================================
2
+ // Project: SproutCore - JavaScript Application Framework
3
+ // Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
4
+ // Portions ©2008-2009 Apple Inc. All rights reserved.
5
+ // License: Licened under MIT license (see license.js)
6
+ // ==========================================================================
7
+
8
+ sc_require('mixins/collection_view_delegate') ;
9
+ sc_require('views/list_item');
10
+
11
+ /**
12
+ Special drag operation passed to delegate if the collection view proposes
13
+ to perform a reorder event.
14
+ */
15
+ SC.DRAG_REORDER = 0x0010 ;
16
+
17
+ /** Indicates that selection points should be selected using horizontal
18
+ orientation.
19
+ */
20
+ SC.HORIZONTAL_ORIENTATION = 'horizontal';
21
+
22
+ /** Selection points should be selected using vertical orientation. */
23
+ SC.VERTICAL_ORIENTATION = 'vertical' ;
24
+
25
+ SC.BENCHMARK_RELOAD = NO ;
26
+
27
+ /**
28
+ @class
29
+
30
+ TODO: Document SC.CollectionView
31
+
32
+ Renders a collection of views from a source array of model objects.
33
+
34
+ The CollectionView is the root view class for rendering collections of
35
+ views based on a source array of objects. It can automatically create the
36
+ and layout the views, including displaying them in groups. It also
37
+ handles event input for the entire collection.
38
+
39
+ To use CollectionView, just create the view and set the 'content' property
40
+ to an array of objects. (Note that if you setup a binding, it will
41
+ always transform content to an array.) The view will create instances of
42
+ exampleView to render the array. You can also bind to the selection
43
+ property if you want to monitor selection. (be sure to set the isEnabled
44
+ property to allow selection.)
45
+
46
+ @extends SC.View
47
+ @extends SC.CollectionViewDelegate
48
+ @extends SC.CollectionContent
49
+ @since SproutCore 0.9
50
+ */
51
+ SC.CollectionView = SC.View.extend(
52
+ SC.CollectionViewDelegate,
53
+ SC.CollectionContent,
54
+ /** @scope SC.CollectionView.prototype */ {
55
+
56
+ classNames: ['sc-collection-view'],
57
+
58
+ ACTION_DELAY: 200,
59
+
60
+ // ......................................
61
+ // PROPERTIES
62
+ //
63
+
64
+ /**
65
+ An array of content objects
66
+
67
+ This array should contain the content objects you want the collection view
68
+ to display. An item view (based on the exampleView view class) will be
69
+ created for each content object, in the order the content objects appear
70
+ in this array.
71
+
72
+ If you make the collection editable, the collection view will also modify
73
+ this array using the observable array methods of SC.Array.
74
+
75
+ Usually you will want to bind this property to a controller property
76
+ that actually contains the array of objects you to display.
77
+
78
+ @type {SC.Array}
79
+ */
80
+ content: null,
81
+
82
+ /** @private */
83
+ contentBindingDefault: SC.Binding.multiple(),
84
+
85
+ /**
86
+ The current length of the content.
87
+
88
+ @property
89
+ @type {Numer}
90
+ */
91
+ length: 0,
92
+
93
+ /**
94
+ The set of indexes that are currently tracked by the collection view.
95
+ This property is used to determine the range of items the collection view
96
+ should monitor for changes.
97
+
98
+ The default implementation of this property returns an index set covering
99
+ the entire range of the content. It changes automatically whenever the
100
+ length changes.
101
+
102
+ Note that the returned index set for this property will always be frozen.
103
+ To change the nowShowing index set, you must create a new index set and
104
+ apply it.
105
+
106
+ @property
107
+ @type {SC.IndexSet}
108
+ */
109
+ nowShowing: function() {
110
+ var ret = this.computeNowShowing();
111
+ return ret ? ret.frozenCopy() : null;
112
+ }.property('length', 'clippingFrame').cacheable(),
113
+
114
+ /**
115
+ Indexes of selected content objects. This SC.SelectionSet is modified
116
+ automatically by the collection view when the user changes the selection
117
+ on the collection.
118
+
119
+ Any item views representing content objects in this set will have their
120
+ isSelected property set to YES automatically.
121
+
122
+ @type {SC.SelectionSet}
123
+ */
124
+ selection: null,
125
+
126
+ /**
127
+ Allow user to select content using the mouse and keyboard.
128
+
129
+ Set this property to NO to disallow the user from selecting items. If you
130
+ have items in your selectedIndexes property, they will still be reflected
131
+ visually.
132
+
133
+ @type {Boolean}
134
+ */
135
+ isSelectable: YES,
136
+
137
+ /** @private */
138
+ isSelectableBindingDefault: SC.Binding.bool(),
139
+
140
+ /**
141
+ Enable or disable the view.
142
+
143
+ The collection view will set the isEnabled property of its item views to
144
+ reflect the same view of this property. Whenever isEnabled is false,
145
+ the collection view will also be not selectable or editable, regardless of
146
+ the settings for isEditable & isSelectable.
147
+
148
+ @type {Boolean}
149
+ */
150
+ isEnabled: YES,
151
+
152
+ /** @private */
153
+ isEnabledBindingDefault: SC.Binding.bool(),
154
+
155
+ /**
156
+ Allow user to edit content views.
157
+
158
+ The collection view will set the isEditable property on its item views to
159
+ reflect the same value of this property. Whenever isEditable is false,
160
+ the user will not be able to reorder, add, or delete items regardless of
161
+ the canReorderContent and canDeleteContent and isDropTarget properties.
162
+
163
+ @type {Boolean}
164
+ */
165
+ isEditable: YES,
166
+
167
+ /** @private */
168
+ isEditableBindingDefault: SC.Binding.bool(),
169
+
170
+ /**
171
+ Allow user to reorder items using drag and drop.
172
+
173
+ If true, the user will can use drag and drop to reorder items in the list.
174
+ If you also accept drops, this will allow the user to drop items into
175
+ specific points in the list. Otherwise items will be added to the end.
176
+
177
+ @type {Boolean}
178
+ */
179
+ canReorderContent: NO,
180
+
181
+ /** @private */
182
+ canReorderContentBindingDefault: SC.Binding.bool(),
183
+
184
+ /**
185
+ Allow the user to delete items using the delete key
186
+
187
+ If true the user will be allowed to delete selected items using the delete
188
+ key. Otherwise deletes will not be permitted.
189
+
190
+ @type {Boolean}
191
+ */
192
+ canDeleteContent: NO,
193
+
194
+ /** @private */
195
+ canDeleteContentBindingDefault: SC.Binding.bool(),
196
+
197
+ /**
198
+ Allow user to edit the content by double clicking on it or hitting return.
199
+ This will only work if isEditable is YES and the item view implements
200
+ the beginEditing() method.
201
+
202
+ @type {Boolean}
203
+ */
204
+ canEditContent: NO,
205
+
206
+ /** @private */
207
+ canEditContentBindingDefault: SC.Binding.bool(),
208
+
209
+ /**
210
+ Accept drops for data other than reordering.
211
+
212
+ Setting this property to return true when the view is instantiated will
213
+ cause it to be registered as a drop target, activating the other drop
214
+ machinery.
215
+
216
+ @type {Boolean}
217
+ */
218
+ isDropTarget: NO,
219
+
220
+ /**
221
+ Use toggle selection instead of normal click behavior.
222
+
223
+ If set to true, then selection will use a toggle instead of the normal
224
+ click behavior. Command modifiers will be ignored and instead clicking
225
+ once will select an item and clicking on it again will deselect it.
226
+
227
+ @type {Boolean}
228
+ */
229
+ useToggleSelection: NO,
230
+
231
+ /**
232
+ Trigger the action method on a single click.
233
+
234
+ Normally, clicking on an item view in a collection will select the content
235
+ object and double clicking will trigger the action method on the
236
+ collection view.
237
+
238
+ If you set this property to YES, then clicking on a view will both select
239
+ it (if isSelected is true) and trigger the action method.
240
+
241
+ Use this if you are using the collection view as a menu of items.
242
+
243
+ @property {Boolean}
244
+ */
245
+ actOnSelect: NO,
246
+
247
+
248
+ /**
249
+ Select an item immediately on mouse down
250
+
251
+ Normally as soon as you begin a click the item will be selected.
252
+
253
+ In some UI scenarios, you might want to prevent selection until
254
+ the mouse is released, so you can perform, for instance, a drag operation
255
+ without actually selecting the target item.
256
+
257
+ @property {Boolean}
258
+ */
259
+ selectOnMouseDown: YES,
260
+
261
+ /**
262
+ The view class to use when creating new item views.
263
+
264
+ The collection view will automatically create an instance of the view
265
+ class you set here for each item in its content array. You should provide
266
+ your own subclass for this property to display the type of content you
267
+ want.
268
+
269
+ For best results, the view you set here should understand the following
270
+ properties:
271
+
272
+ - *content* The content object from the content array your view should display
273
+ - *isEnabled* True if the view should appear enabled
274
+ - *isSelected* True if the view should appear selected
275
+
276
+ In general you do not want your child views to actually respond to mouse
277
+ and keyboard events themselves. It is better to let the collection view
278
+ do that.
279
+
280
+ If you do implement your own event handlers such as mouseDown or mouseUp,
281
+ you should be sure to actually call the same method on the collection view
282
+ to give it the chance to perform its own selection housekeeping.
283
+
284
+ @property {SC.View}
285
+ */
286
+ exampleView: SC.ListItemView,
287
+
288
+ /**
289
+ If set, this key will be used to get the example view for a given
290
+ content object. The exampleView property will be ignored.
291
+
292
+ @property {String}
293
+ */
294
+ contentExampleViewKey: null,
295
+
296
+ /**
297
+ The view class to use when creating new group item views.
298
+
299
+ The collection view will automatically create an instance of the view
300
+ class you set here for each item in its content array. You should provide
301
+ your own subclass for this property to display the type of content you
302
+ want.
303
+
304
+ If you leave this set to null then the regular example view will be used
305
+ with the isGroupView property set to YES on the item view.
306
+
307
+ @property {SC.View}
308
+ */
309
+ groupExampleView: null,
310
+
311
+ /**
312
+ If set, this key will be used to get the example view for a given
313
+ content object. The groupExampleView property will be ignored.
314
+
315
+ @property {String}
316
+ */
317
+ contentGroupExampleViewKey: null,
318
+
319
+ /**
320
+ Invoked when the user double clicks on an item (or single clicks of
321
+ actOnSelect is true)
322
+
323
+ Set this to the name of the action you want to send down the
324
+ responder chain when the user double clicks on an item (or single clicks
325
+ if actOnSelect is true). You can optionally specify a specific target as
326
+ well using the target property.
327
+
328
+ If you do not specify an action, then the collection view will also try to
329
+ invoke the action named on the target item view.
330
+
331
+ Older versions of SproutCore expected the action property to contain an
332
+ actual function that would be run. This format is still supported but is
333
+ deprecated for future use. You should generally use the responder chain
334
+ to handle your action for you.
335
+
336
+ @property {String}
337
+ */
338
+ action: null,
339
+
340
+ /**
341
+ Optional target to send the action to when the user double clicks.
342
+
343
+ If you set the action property to the name of an action, you can
344
+ optionally specify the target object you want the action to be sent to.
345
+ This can be either an actual object or a property path that will resolve
346
+ to an object at the time that the action is invoked.
347
+
348
+ This property is ignored if you use the deprecated approach of making the
349
+ action property a function.
350
+
351
+ @property {String|Object}
352
+ */
353
+ target: null,
354
+
355
+ /**
356
+ Property on content items to use for display.
357
+
358
+ Built-in item views such as the LabelViews and ImageViews will use the
359
+ value of this property as a key on the content object to determine the
360
+ value they should display.
361
+
362
+ For example, if you set contentValueKey to 'name' and set the
363
+ exampleView to an SC.LabelView, then the label views created by the
364
+ colleciton view will display the value of the content.name.
365
+
366
+ If you are writing your own custom item view for a collection, you can
367
+ get this behavior automatically by including the SC.Control mixin on your
368
+ view. You can also ignore this property if you like. The collection view
369
+ itself does not use this property to impact rendering.
370
+
371
+ @property {String}
372
+ */
373
+ contentValueKey: null,
374
+
375
+ /**
376
+ Enables keyboard-based navigate, deletion, etc. if set to true.
377
+ */
378
+ acceptsFirstResponder: NO,
379
+
380
+ /**
381
+ Changing this property value by default will cause the CollectionView to
382
+ add/remove an 'active' class name to the root element.
383
+
384
+ @type Boolean
385
+ */
386
+ isActive: NO,
387
+
388
+ // ..........................................................
389
+ // SUBCLASS METHODS
390
+ //
391
+
392
+ /**
393
+ Override to return the computed layout dimensions of the collection view.
394
+ You can omit any dimensions you don't care about setting in your
395
+ computed value.
396
+
397
+ This layout is automatically applied whenever the content changes.
398
+
399
+ If you don't care about computing the layout at all, you can return null.
400
+
401
+ @returns {Hash} layout properties
402
+ */
403
+ computeLayout: function() { return null; },
404
+
405
+ /**
406
+ Override to compute the layout of the itemView for the content at the
407
+ specified index. This layout will be applied to the view just before it
408
+ is rendered.
409
+
410
+ @param {Number} contentIndex the index of content beind rendered by
411
+ itemView
412
+ @returns {Hash} a view layout
413
+ */
414
+ layoutForContentIndex: function(contentIndex) {
415
+ return null ;
416
+ },
417
+
418
+ /**
419
+ Override to return an IndexSet with the indexes that are at least
420
+ partially visible in the passed rectangle. This method is used by the
421
+ default implementation of computeNowShowing() to determine the new
422
+ nowShowing range after a scroll.
423
+
424
+ Override this method to implement incremental rendering.
425
+
426
+ The default simply returns the current content length.
427
+
428
+ @param {Rect} rect the visible rect
429
+ @returns {SC.IndexSet} now showing indexes
430
+ */
431
+ contentIndexesInRect: function(rect) {
432
+ return SC.IndexSet.create(0, this.get('length'));
433
+ },
434
+
435
+ /**
436
+ Compute the nowShowing index set. The default implementation simply
437
+ returns the full range. Override to implement incremental rendering.
438
+
439
+ You should not normally call this method yourself. Instead get the
440
+ nowShowing property.
441
+
442
+ @returns {SC.IndexSet} new now showing range
443
+ */
444
+ computeNowShowing: function() {
445
+ var r = this.contentIndexesInRect(this.get('clippingFrame')),
446
+ content = SC.makeArray(this.get('content')),
447
+ len = content.get('length');
448
+
449
+ // default show all.
450
+ if (!r) r = SC.IndexSet.create(0, len);
451
+
452
+ // make sure the index set doesn't contain any indexes greater than the
453
+ // actual content.
454
+ if (r.get('max') > len) r.remove(len, r.get('max')-len);
455
+
456
+ return r ;
457
+ },
458
+
459
+ /**
460
+ Override to show the insertion point during a drag.
461
+
462
+ Called during a drag to show the insertion point. Passed value is the
463
+ item view that you should display the insertion point before. If the
464
+ passed value is null, then you should show the insertion point AFTER that
465
+ last item view returned by the itemViews property.
466
+
467
+ Once this method is called, you are guaranteed to also recieve a call to
468
+ hideInsertionPoint() at some point in the future.
469
+
470
+ The default implementation of this method does nothing.
471
+
472
+ @param itemView {SC.ClassicView} view the insertion point should appear directly before. If null, show insertion point at end.
473
+ @param dropOperation {Number} the drop operation. will be SC.DROP_BEFORE, SC.DROP_AFTER, or SC.DROP_ON
474
+
475
+ @returns {void}
476
+ */
477
+ showInsertionPoint: function(itemView, dropOperation) {
478
+ },
479
+
480
+ /**
481
+ Override to hide the insertion point when a drag ends.
482
+
483
+ Called during a drag to hide the insertion point. This will be called
484
+ when the user exits the view, cancels the drag or completes the drag. It
485
+ will not be called when the insertion point changes during a drag.
486
+
487
+ You should expect to receive one or more calls to
488
+ showInsertionPointBefore() during a drag followed by at least one call to
489
+ this method at the end. Your method should not raise an error if it is
490
+ called more than once.
491
+
492
+ @returns {void}
493
+ */
494
+ hideInsertionPoint: function() {
495
+ },
496
+
497
+ // ..........................................................
498
+ // DELEGATE SUPPORT
499
+ //
500
+
501
+
502
+ /**
503
+ Delegate used to implement fine-grained control over collection view
504
+ behaviors.
505
+
506
+ You can assign a delegate object to this property that will be consulted
507
+ for various decisions regarding drag and drop, selection behavior, and
508
+ even rendering. The object you place here must implement some or all of
509
+ the SC.CollectionViewDelegate mixin.
510
+
511
+ If you do not supply a delegate but the content object you set implements
512
+ the SC.CollectionViewDelegate mixin, then the content will be
513
+ automatically set as the delegate. Usually you will work with a
514
+ CollectionView in this way rather than setting a delegate explicitly.
515
+
516
+ @type {SC.CollectionViewDelegate}
517
+ */
518
+ delegate: null,
519
+
520
+ /**
521
+ The delegate responsible for handling selection changes. This property
522
+ will be either the delegate, content, or the collection view itself,
523
+ whichever implements the SC.CollectionViewDelegate mixin.
524
+
525
+ @property
526
+ @type {Object}
527
+ */
528
+ selectionDelegate: function() {
529
+ var del = this.get('delegate'), content = this.get('content');
530
+ return this.delegateFor('isCollectionViewDelegate', del, content);
531
+ }.property('delegate', 'content').cacheable(),
532
+
533
+ /**
534
+ The delegate responsible for providing additional display information
535
+ about the content. If you bind a collection view to a controller, this
536
+ the content will usually also be the content delegate, though you
537
+ could implement your own delegate if you prefer.
538
+
539
+ @property
540
+ @type {Object}
541
+ */
542
+ contentDelegate: function() {
543
+ var del = this.get('delegate'), content = this.get('content');
544
+ return this.delegateFor('isCollectionContent', del, content);
545
+ }.property('delegate', 'content').cacheable(),
546
+
547
+ // ..........................................................
548
+ // CONTENT CHANGES
549
+ //
550
+
551
+ /**
552
+ Called whenever the content array or an item in the content array or a
553
+ property on an item in the content array changes. Reloads the appropriate
554
+ item view when the content array itself changes or calls
555
+ contentPropertyDidChange() if a property changes.
556
+
557
+ Normally you will not call this method directly though you may override
558
+ it if you need to change the way changes to observed ranges are handled.
559
+
560
+ @param {SC.Array} content the content array generating the change
561
+ @param {Object} object the changed object
562
+ @param {String} key the changed property or '[]' or an array change
563
+ @param {SC.IndexSet} indexes affected indexes or null for all items
564
+ @returns {void}
565
+ */
566
+ contentRangeDidChange: function(content, object, key, indexes) {
567
+ if (!object && (key === '[]')) {
568
+ this.reload(indexes); // note: if indexes == null, reloads all
569
+ } else {
570
+ this.contentPropertyDidChange(object, key, indexes);
571
+ }
572
+ },
573
+
574
+ /**
575
+ Called whenever a property on an item in the content array changes. This
576
+ is only called if you have set observesContentProperties to YES.
577
+
578
+ Override this property if you want to do some custom work whenever a
579
+ property on a content object changes.
580
+
581
+ The default implementation does nothing.
582
+
583
+ @param {Object} target the object that changed
584
+ @param {String} key the property that changed value
585
+ @param {SC.IndexSet} indexes the indexes in the content array affected
586
+ @returns {void}
587
+ */
588
+ contentPropertyDidChange: function(target, key, indexes) {
589
+ // Default Does Nothing
590
+ },
591
+
592
+ /**
593
+ Called whenever the view needs to updates it's contentRangeObserver to
594
+ reflect the current nowShowing index set. You will not usually call this
595
+ method yourself but you may override it if you need to provide some
596
+ custom range observer behavior.
597
+
598
+ Note that if you do implement this method, you are expected to maintain
599
+ the range observer object yourself. If a range observer has not been
600
+ created yet, this method should create it. If an observer already exists
601
+ this method should udpate it.
602
+
603
+ When you create a new range observer, the oberver must eventually call
604
+ contentRangeDidChange() for the collection view to function properly.
605
+
606
+ If you override this method you probably also need to override
607
+ destroyRangeObserver() to cleanup any existing range observer.
608
+
609
+ @returns {void}
610
+ */
611
+ updateContentRangeObserver: function() {
612
+ var nowShowing = this.get('nowShowing'),
613
+ observer = this._cv_contentRangeObserver,
614
+ content = this.get('content');
615
+
616
+ if (!content) return ; // nothing to do
617
+
618
+ if (observer) {
619
+ content.updateRangeObserver(observer, nowShowing);
620
+ } else {
621
+ var func = this.contentRangeDidChange;
622
+ observer = content.addRangeObserver(nowShowing, this, func, null);
623
+ this._cv_contentRangeObserver = observer ;
624
+ }
625
+
626
+ },
627
+
628
+ /**
629
+ Called whever the view needs to invalidate the current content range
630
+ observer. This is called whenever the content array changes. You will
631
+ not usually call this method yourself but you may override it if you
632
+ provide your own range observer behavior.
633
+
634
+ Note that if you override this method you should probably also override
635
+ updateRangeObserver() to create or update a range oberver as needed.
636
+
637
+ @returns {void}
638
+ */
639
+ removeContentRangeObserver: function() {
640
+ var content = this.get('content'),
641
+ observer = this._cv_contentRangeObserver ;
642
+
643
+ if (observer) {
644
+ if (content) content.removeRangeObserver(observer);
645
+ this._cv_contentRangeObserver = null ;
646
+ }
647
+ },
648
+
649
+ /**
650
+ Called whenever the content length changes. This will invalidate the
651
+ length property of the view itself causing the nowShowing to recompute
652
+ which will in turn update the UI accordingly.
653
+
654
+ @returns {void}
655
+ */
656
+ contentLengthDidChange: function() {
657
+ var content = this.get('content');
658
+ this.set('length', content ? content.get('length') : 0);
659
+ },
660
+
661
+ /** @private
662
+ Whenever content property changes to a new value:
663
+
664
+ - remove any old observers
665
+ - setup new observers (maybe wait until end of runloop to do this?)
666
+ - recalc height/reload content
667
+ - set content as delegate if delegate was old content
668
+ - reset selection
669
+
670
+ Whenever content array mutates:
671
+
672
+ - possibly stop observing property changes on objects, observe new objs
673
+ - reload effected item views
674
+ - update layout for receiver
675
+ */
676
+ _cv_contentDidChange: function() {
677
+ var content = this.get('content'),
678
+ lfunc = this.contentLengthDidChange ;
679
+
680
+ if (content === this._content) return this; // nothing to do
681
+
682
+ // cleanup old content
683
+ this.removeContentRangeObserver();
684
+ if (this._content) {
685
+ this._content.removeObserver('length', this, lfunc);
686
+ }
687
+
688
+ // cache
689
+ this._content = content;
690
+
691
+ // add new observers - range observer will be added lazily
692
+ if (content) {
693
+ content.addObserver('length', this, lfunc);
694
+ }
695
+
696
+ // notify all items changed
697
+ this.contentLengthDidChange();
698
+ this.contentRangeDidChange(content, null, '[]', null);
699
+
700
+ }.observes('content'),
701
+
702
+ // ..........................................................
703
+ // ITEM VIEWS
704
+ //
705
+
706
+ /** @private
707
+
708
+ The indexes that need to be reloaded. Must be one of YES, NO, or an
709
+ SC.IndexSet.
710
+
711
+ */
712
+ _invalidIndexes: NO,
713
+
714
+ /**
715
+ Regenerates the item views for the content items at the specified indexes.
716
+ If you pass null instead of an index set, regenerates all item views.
717
+
718
+ This method is called automatically whenever the content array changes in
719
+ an observable way, but you can call its yourself also if you need to
720
+ refresh the collection view for some reason.
721
+
722
+ Note that if the length of the content is shorter than the child views
723
+ and you call this method, then the child views will be removed no matter
724
+ what the index.
725
+
726
+ @param {SC.IndexSet} indexes
727
+ @returns {SC.CollectionView} receiver
728
+ */
729
+ reload: function(indexes) {
730
+ var invalid = this._invalidIndexes ;
731
+ if (indexes && invalid !== YES) {
732
+ if (invalid) invalid.add(indexes);
733
+ else invalid = this._invalidIndexes = indexes.clone();
734
+
735
+ } else this._invalidIndexes = YES ; // force a total reload
736
+
737
+ if (this.get('isVisibleInWindow')) this.invokeOnce(this.reloadIfNeeded);
738
+
739
+ return this ;
740
+ },
741
+
742
+ /**
743
+ Invoked once per runloop to actually reload any needed item views.
744
+ You can call this method at any time to actually force the reload to
745
+ happen immediately if any item views need to be reloaded.
746
+
747
+ Note that this method will also invoke two other callback methods if you
748
+ define them on your subclass:
749
+
750
+ - *willReload()* is called just before the items are reloaded
751
+ - *didReload()* is called jsut after items are reloaded
752
+
753
+ You can use these two methods to setup and teardown caching, which may
754
+ reduce overall cost of a reload. Each method will be passed an index set
755
+ of items that are reloaded or null if all items are reloaded.
756
+
757
+ @returns {SC.CollectionView} receiver
758
+ */
759
+ reloadIfNeeded: function() {
760
+ var invalid = this._invalidIndexes;
761
+ if (!invalid || !this.get('isVisibleInWindow')) return this ; // delay
762
+ this._invalidIndexes = NO ;
763
+
764
+ var content = this.get('content'),
765
+ len = content ? content.get('length'): 0,
766
+ layout = this.computeLayout(),
767
+ bench = SC.BENCHMARK_RELOAD,
768
+ nowShowing = this.get('nowShowing'),
769
+ itemViews = this._sc_itemViews,
770
+ containerView = this.get('containerView') || this,
771
+ views, idx, cvlen, view, childViews, layer ;
772
+
773
+ // if the set is defined but it contains the entire nowShowing range, just
774
+ // replace
775
+ if (invalid.isIndexSet && invalid.contains(nowShowing)) invalid = YES ;
776
+ if (this.willReload) this.willReload(invalid === YES ? null : invalid);
777
+
778
+ // if an index set, just update indexes
779
+ if (invalid.isIndexSet) {
780
+ childViews = containerView.get('childViews');
781
+ cvlen = childViews.get('length');
782
+
783
+ if (bench) {
784
+ SC.Benchmark.start(bench="%@#reloadIfNeeded (Partial)".fmt(this),YES);
785
+ }
786
+
787
+ invalid.forEach(function(idx) {
788
+
789
+ // get the existing item view, if there is one
790
+ var existing = itemViews ? itemViews[idx] : null;
791
+
792
+ // if nowShowing, then reload the item view.
793
+ if (nowShowing.contains(idx)) {
794
+ view = this.itemViewForContentIndex(idx, YES);
795
+ if (existing && existing.parentView === containerView) {
796
+
797
+ // if the existing view has a layer, remove it immediately from
798
+ // the parent. This is necessary because the old and new views
799
+ // will use the same layerId
800
+ layer = existing.get('layer');
801
+ if (layer && layer.parentNode) {
802
+ layer.parentNode.removeChild(layer);
803
+ }
804
+ layer = null ; // avoid leaks
805
+
806
+ containerView.replaceChild(view, existing);
807
+ } else {
808
+ containerView.appendChild(view);
809
+ }
810
+
811
+ // if not nowShowing, then remove the item view if needed
812
+ } else if (existing && existing.parentView === containerView) {
813
+ delete itemViews[idx];
814
+ containerView.removeChild(existing);
815
+ }
816
+ },this);
817
+
818
+ if (bench) SC.Benchmark.end(bench);
819
+
820
+ // if set is NOT defined, replace entire content with nowShowing
821
+ } else {
822
+
823
+ if (bench) {
824
+ SC.Benchmark.start(bench="%@#reloadIfNeeded (Full)".fmt(this),YES);
825
+ }
826
+
827
+ // truncate cached item views since they will all be removed from the
828
+ // container anyway.
829
+ if (itemViews) itemViews.length = 0 ;
830
+
831
+ views = [];
832
+ nowShowing.forEach(function(idx) {
833
+ views.push(this.itemViewForContentIndex(idx, YES));
834
+ }, this);
835
+
836
+ // below is an optimized version of:
837
+ //this.replaceAllChildren(views);
838
+ containerView.beginPropertyChanges();
839
+ containerView.destroyLayer().removeAllChildren();
840
+ containerView.set('childViews', views); // quick swap
841
+ containerView.replaceLayer();
842
+ containerView.endPropertyChanges();
843
+
844
+ if (bench) SC.Benchmark.end(bench);
845
+
846
+ }
847
+
848
+ // adjust my own layout if computed
849
+ if (layout) this.adjust(layout);
850
+ if (this.didReload) this.didReload(invalid === YES ? null : invalid);
851
+
852
+
853
+ return this ;
854
+ },
855
+
856
+ displayProperties: 'isFirstResponder isEnabled isActive'.w(),
857
+
858
+ /** @private
859
+ If we're asked to render the receiver view for the first time but the
860
+ child views still need to be added, go ahead and add them.
861
+ */
862
+ render: function(context, firstTime) {
863
+ if (firstTime && this._needsReload) this.reloadIfNeeded ;
864
+
865
+ // add classes for other state.
866
+ context.setClass('focus', this.get('isFirstResponder'));
867
+ context.setClass('disabled', !this.get('isEnabled'));
868
+ context.setClass('active', this.get('isActive'));
869
+
870
+ return sc_super();
871
+ },
872
+
873
+
874
+ _TMP_ATTRS: {},
875
+ _COLLECTION_CLASS_NAMES: 'sc-collection-item'.w(),
876
+ _GROUP_COLLECTION_CLASS_NAMES: 'sc-collection-item sc-group-item'.w(),
877
+
878
+ /**
879
+ Returns the item view for the content object at the specified index. Call
880
+ this method instead of accessing child views directly whenever you need
881
+ to get the view associated with a content index.
882
+
883
+ Although this method take two parameters, you should almost always call
884
+ it with just the content index. The other two parameters are used
885
+ internally by the CollectionView.
886
+
887
+ If you need to change the way the collection view manages item views
888
+ you can override this method as well. If you just want to change the
889
+ default options used when creating item views, override createItemView()
890
+ instead.
891
+
892
+ Note that if you override this method, then be sure to implement this
893
+ method so that it uses a cache to return the same item view for a given
894
+ index unless "force" is YES. In that case, generate a new item view and
895
+ replace the old item view in your cache with the new item view.
896
+
897
+ @param {Number} idx the content index
898
+ @param {Boolean} rebuild internal use only
899
+ @returns {SC.View} instantiated view
900
+ */
901
+ itemViewForContentIndex: function(idx, rebuild) {
902
+
903
+ // return from cache if possible
904
+ var content = this.get('content'),
905
+ itemViews = this._sc_itemViews,
906
+ item = content.objectAt(idx),
907
+ del = this.get('contentDelegate'),
908
+ groupIndexes = del.contentGroupIndexes(this, content),
909
+ isGroupView = NO,
910
+ key, ret, E, layout, layerId;
911
+
912
+ // use cache if available
913
+ if (!itemViews) itemViews = this._sc_itemViews = [] ;
914
+ if (!rebuild && (ret = itemViews[idx])) return ret ;
915
+
916
+ // otherwise generate...
917
+
918
+ // first, determine the class to use
919
+ isGroupView = groupIndexes && groupIndexes.contains(idx);
920
+ if (isGroupView) isGroupView = del.contentIndexIsGroup(this, content,idx);
921
+ if (isGroupView) {
922
+ key = this.get('contentGroupExampleViewKey');
923
+ if (key && item) E = item.get(key);
924
+ if (!E) E = this.get('groupExampleView') || this.get('exampleView');
925
+
926
+ } else {
927
+ key = this.get('contentExampleViewKey');
928
+ if (key && item) E = item.get(key);
929
+ if (!E) E = this.get('exampleView');
930
+ }
931
+
932
+ // collect some other state
933
+ var attrs = this._TMP_ATTRS;
934
+ attrs.contentIndex = idx;
935
+ attrs.content = item ;
936
+ attrs.owner = attrs.displayDelegate = this;
937
+ attrs.parentView = this.get('containerView') || this ;
938
+ attrs.page = this.page ;
939
+ attrs.layerId = this.layerIdFor(idx, item);
940
+ attrs.isEnabled = del.contentIndexIsEnabled(this, content, idx);
941
+ attrs.isSelected = del.contentIndexIsSelected(this, content, idx);
942
+ attrs.outlineLevel = del.contentIndexOutlineLevel(this, content, idx);
943
+ attrs.disclosureState = del.contentIndexDisclosureState(this, content, idx);
944
+ attrs.isGroupView = isGroupView;
945
+ attrs.isVisibleInWindow = this.isVisibleInWindow;
946
+ if (isGroupView) attrs.classNames = this._GROUP_COLLECTION_CLASS_NAMES;
947
+ else attrs.classNames = this._COLLECTION_CLASS_NAMES;
948
+
949
+ layout = this.layoutForContentIndex(idx);
950
+ if (layout) {
951
+ attrs.layout = layout;
952
+ } else {
953
+ delete attrs.layout ;
954
+ }
955
+
956
+ ret = this.createItemView(E, idx, attrs);
957
+ itemViews[idx] = ret ;
958
+ return ret ;
959
+ },
960
+
961
+ _TMP_LAYERID: [],
962
+
963
+ /**
964
+ Primitive to instantiate an item view. You will be passed the class
965
+ and a content index. You can override this method to perform any other
966
+ one time setup.
967
+
968
+ Note that item views may be created somewhat frequently so keep this fast.
969
+
970
+ *IMPORTANT:* The attrs hash passed is reused each time this method is
971
+ called. If you add properties to this hash be sure to delete them before
972
+ returning from this method.
973
+
974
+ @param {Class} exampleClass example view class
975
+ @param {Number} idx the content index
976
+ @param {Hash} attrs expected attributes
977
+ @returns {SC.View} item view instance
978
+ */
979
+ createItemView: function(exampleClass, idx, attrs) {
980
+ return exampleClass.create(attrs);
981
+ },
982
+
983
+ /**
984
+ Generates a layerId for the passed index and item. Usually the default
985
+ implementation is suitable.
986
+
987
+ @param {Number} idx the content index
988
+ @returns {String} layer id, must be suitable for use in HTML id attribute
989
+ */
990
+ layerIdFor: function(idx) {
991
+ var ret = this._TMP_LAYERID;
992
+ ret[0] = SC.guidFor(this);
993
+ ret[1] = idx;
994
+ return ret.join('-');
995
+ },
996
+
997
+ /**
998
+ Extracts the content index from the passed layerID. If the layer id does
999
+ not belong to the receiver or if no value could be extracted, returns NO.
1000
+
1001
+ @param {String} id the layer id
1002
+ */
1003
+ contentIndexForLayerId: function(id) {
1004
+ if (!id || !(id = id.toString())) return null ; // nothing to do
1005
+
1006
+ var base = this._baseLayerId;
1007
+ if (!base) base = this._baseLayerId = SC.guidFor(this)+"-";
1008
+
1009
+ // no match
1010
+ if ((id.length <= base.length) || (id.indexOf(base) !== 0)) return null ;
1011
+ var ret = Number(id.slice(id.lastIndexOf('-')+1));
1012
+ return isNaN(ret) ? null : ret ;
1013
+ },
1014
+
1015
+
1016
+ /**
1017
+ Find the first content item view for the passed event.
1018
+
1019
+ This method will go up the view chain, starting with the view that was the
1020
+ target of the passed event, looking for a child item. This will become
1021
+ the view that is selected by the mouse event.
1022
+
1023
+ This method only works for mouseDown & mouseUp events. mouseMoved events
1024
+ do not have a target.
1025
+
1026
+ @param {SC.Event} evt An event
1027
+ @returns {SC.View} the item view or null
1028
+ */
1029
+ itemViewForEvent: function(evt) {
1030
+ var responder = this.getPath('pane.rootResponder') ;
1031
+ if (!responder) return null ; // fast path
1032
+
1033
+ var base = SC.guidFor(this) + '-',
1034
+ baseLen = base.length,
1035
+ element = evt.target,
1036
+ layer = this.get('layer'),
1037
+ contentIndex = null,
1038
+ id, itemView, ret ;
1039
+
1040
+ // walk up the element hierarchy until we find this or an element with an
1041
+ // id matching the base guid (i.e. a collection item)
1042
+ while (element && element !== document && element !== layer) {
1043
+ id = element ? element.getAttribute('id') : null ;
1044
+ if (id && (contentIndex = this.contentIndexForLayerId(id)) !== null) {
1045
+ break;
1046
+ }
1047
+ element = element.parentNode ;
1048
+ }
1049
+
1050
+ // no matching element found?
1051
+ if (contentIndex===null || (element === layer)) {
1052
+ element = layer = null; // avoid memory leaks
1053
+ return null;
1054
+ }
1055
+
1056
+ // okay, found the DOM node for the view, go ahead and create it
1057
+ // first, find the contentIndex
1058
+ if (contentIndex >= this.get('length')) {
1059
+ throw "layout for item view %@ was found when item view does not exist (%@)".fmt(id, this);
1060
+ }
1061
+
1062
+ return this.itemViewForContentIndex(contentIndex);
1063
+ },
1064
+
1065
+ // ..........................................................
1066
+ // DISCLOSURE SUPPORT
1067
+ //
1068
+
1069
+ /**
1070
+ Expands any items in the passed selection array that have a disclosure
1071
+ state.
1072
+
1073
+ @param {SC.IndexSet} indexes the indexes to expand
1074
+ @returns {SC.CollectionView} receiver
1075
+ */
1076
+ expand: function(indexes) {
1077
+ if (!indexes) return this; // nothing to do
1078
+ var del = this.get('contentDelegate'),
1079
+ content = this.get('content');
1080
+
1081
+ indexes.forEach(function(i) {
1082
+ var state = del.contentIndexDisclosureState(this, content, i);
1083
+ if (state === SC.BRANCH_CLOSED) del.contentIndexExpand(this,content,i);
1084
+ }, this);
1085
+ return this;
1086
+ },
1087
+
1088
+ /**
1089
+ Collapses any items in the passed selection array that have a disclosure
1090
+ state.
1091
+
1092
+ @param {SC.IndexSet} indexes the indexes to expand
1093
+ @returns {SC.CollectionView} receiver
1094
+ */
1095
+ collapse: function(indexes) {
1096
+ if (!indexes) return this; // nothing to do
1097
+ var del = this.get('contentDelegate'),
1098
+ content = this.get('content');
1099
+
1100
+ indexes.forEach(function(i) {
1101
+ var state = del.contentIndexDisclosureState(this, content, i);
1102
+ if (state === SC.BRANCH_OPEN) del.contentIndexCollapse(this,content,i);
1103
+ }, this);
1104
+ return this;
1105
+ },
1106
+
1107
+ // ..........................................................
1108
+ // SELECTION SUPPORT
1109
+ //
1110
+
1111
+ /** @private
1112
+
1113
+ Called whenever the selection object is changed to a new value. Begins
1114
+ observing the selection for changes.
1115
+
1116
+ */
1117
+ _cv_selectionDidChange: function() {
1118
+ var sel = this.get('selection'),
1119
+ last = this._cv_selection,
1120
+ func = this._cv_selectionContentDidChange;
1121
+
1122
+ if (sel === last) return this; // nothing to do
1123
+ if (last) last.removeObserver('[]', this, func);
1124
+ if (sel) sel.addObserver('[]', this, func);
1125
+
1126
+ this._cv_selection = sel ;
1127
+ this._cv_selectionContentDidChange();
1128
+ }.observes('selection'),
1129
+
1130
+ /** @private
1131
+
1132
+ Called whenever the selection object or its content changes. This will
1133
+ repaint any items that changed their selection state.
1134
+
1135
+ */
1136
+ _cv_selectionContentDidChange: function() {
1137
+ var sel = this.get('selection'),
1138
+ last = this._cv_selindexes, // clone of last known indexes
1139
+ content = this.get('content'),
1140
+ diff ;
1141
+
1142
+ // save new last
1143
+ this._cv_selindexes = sel ? sel.frozenCopy() : null;
1144
+
1145
+ // determine which indexes are now invalid
1146
+ if (last) last = last.indexSetForSource(content);
1147
+ if (sel) sel = sel.indexSetForSource(content);
1148
+
1149
+ if (sel && last) diff = sel.without(last).add(last.without(sel));
1150
+ else diff = sel || last;
1151
+
1152
+ if (diff && diff.get('length')>0) this.reloadSelectionIndexes(diff);
1153
+ },
1154
+
1155
+ /** @private
1156
+ Contains the current item views that need their selection to be repainted.
1157
+ This may be either NO, YES, or an IndexSet.
1158
+ */
1159
+ _invalidSelection: NO,
1160
+
1161
+ /**
1162
+ Called whenever the selection changes. The passed index set will contain
1163
+ any affected indexes including those indexes that were previously
1164
+ selected and now should be deselected.
1165
+
1166
+ Pass null to reload the selection state for all items.
1167
+
1168
+ @param {SC.IndexSet} indexes affected indexes
1169
+ @returns {SC.CollectionView} reciever
1170
+ */
1171
+ reloadSelectionIndexes: function(indexes) {
1172
+ var invalid = this._invalidSelection ;
1173
+ if (indexes && (invalid !== YES)) {
1174
+ if (invalid) invalid.add(indexes)
1175
+ else invalid = this._invalidSelection = indexes.copy();
1176
+
1177
+ } else this._invalidSelection = YES ; // force a total reload
1178
+
1179
+ if (this.get('isVisibleInWindow')) {
1180
+ this.invokeOnce(this.reloadSelectionIndexesIfNeeded);
1181
+ }
1182
+
1183
+ return this ;
1184
+ },
1185
+
1186
+ /**
1187
+ Reloads the selection state if needed on any dirty indexes. Normally this
1188
+ will run once at the end of the runloop, but you can force the item views
1189
+ to reload their selection immediately by calling this method.
1190
+
1191
+ You can also override this method if needed to change the way the
1192
+ selection is reloaded on item views. The default behavior will simply
1193
+ find any item views in the nowShowing range that are affected and
1194
+ modify them.
1195
+
1196
+ @returns {SC.CollectionView} receiver
1197
+ */
1198
+ reloadSelectionIndexesIfNeeded: function() {
1199
+ var invalid = this._invalidSelection;
1200
+ if (!invalid || !this.get('isVisibleInWindow')) return this ;
1201
+
1202
+ var nowShowing = this.get('nowShowing'),
1203
+ reload = this._invalidIndexes,
1204
+ content = this.get('content'),
1205
+ sel = this.get('selection');
1206
+
1207
+ this._invalidSelection = NO; // reset invalid
1208
+
1209
+ // fast path. if we are going to reload everything anyway, just forget
1210
+ // about it. Also if we don't have a nowShowing, nothing to do.
1211
+ if (reload === YES || !nowShowing) return this ;
1212
+
1213
+ // if invalid is YES instead of index set, just reload everything
1214
+ if (invalid === YES) invalid = nowShowing;
1215
+
1216
+ // if we will reload some items anyway, don't bother
1217
+ if (reload && reload.isIndexSet) invalid = invalid.without(reload);
1218
+
1219
+ // iterate through each item and set the isSelected state.
1220
+ invalid.forEach(function(idx) {
1221
+ if (!nowShowing.contains(idx)) return; // not showing
1222
+ var view = this.itemViewForContentIndex(idx, NO);
1223
+ if (view) view.set('isSelected', sel ? sel.contains(content, idx) : NO);
1224
+ },this);
1225
+
1226
+ return this ;
1227
+ },
1228
+
1229
+ /**
1230
+ Selection primitive. Selects the passed IndexSet of items, optionally
1231
+ extending the current selection. If extend is NO or not passed then this
1232
+ will replace the selection with the passed value. Otherwise the indexes
1233
+ will be added to the current selection.
1234
+
1235
+ @param {Number|SC.IndexSet} indexes index or indexes to select
1236
+ @param extend {Boolean} optionally extend the selection
1237
+ @returns {SC.CollectionView} receiver
1238
+ */
1239
+ select: function(indexes, extend) {
1240
+
1241
+ var content = this.get('content'),
1242
+ del = this.get('selectionDelegate'),
1243
+ cdel = this.get('contentDelegate'),
1244
+ groupIndexes = cdel.contentGroupIndexes(this, content),
1245
+ sel;
1246
+
1247
+ if(!this.get('isSelectable')) return this;
1248
+
1249
+ // normalize
1250
+ if (SC.typeOf(indexes) === SC.T_NUMBER) {
1251
+ indexes = SC.IndexSet.create(indexes, 1);
1252
+ }
1253
+
1254
+ // if we are passed an empty index set or null, clear the selection.
1255
+ if (indexes && indexes.get('length')>0) {
1256
+
1257
+ // first remove any group indexes - these can never be selected
1258
+ if (groupIndexes && groupIndexes.get('length')>0) {
1259
+ indexes = indexes.copy().remove(groupIndexes);
1260
+ }
1261
+
1262
+ // give the delegate a chance to alter the items
1263
+ indexes = del.collectionViewShouldSelectIndexes(this, indexes, extend);
1264
+ if (!indexes || indexes.get('length')===0) return this; // nothing to do
1265
+
1266
+ } else indexes = null;
1267
+
1268
+ // build the selection object, merging if needed
1269
+ if (extend && (sel = this.get('selection'))) sel = sel.copy();
1270
+ else sel = SC.SelectionSet.create();
1271
+ if (indexes) sel.add(content, indexes);
1272
+
1273
+ // give delegate one last chance
1274
+ sel = del.collectionViewSelectionForProposedSelection(this, sel);
1275
+ if (!sel) sel = SC.SelectionSet.create(); // empty
1276
+
1277
+ // if we're not extending the selection, clear the selection anchor
1278
+ this._selectionAnchor = null ;
1279
+ this.set('selection', sel.freeze()) ;
1280
+ return this;
1281
+ },
1282
+
1283
+ /**
1284
+ Primtive to remove the indexes from the selection.
1285
+
1286
+ @param {Number|SC.IndexSet} indexes index or indexes to select
1287
+ @returns {SC.CollectionView} receiver
1288
+ */
1289
+ deselect: function(indexes) {
1290
+
1291
+ var sel = this.get('selection'),
1292
+ content = this.get('content'),
1293
+ del = this.get('selectionDelegate');
1294
+
1295
+ if(!this.get('isSelectable')) return this;
1296
+ if (!sel || sel.get('length')===0) return this; // nothing to do
1297
+
1298
+ // normalize
1299
+ if (SC.typeOf(indexes) === SC.T_NUMBER) {
1300
+ indexes = SC.IndexSet.create(indexes, 1);
1301
+ }
1302
+
1303
+ // give the delegate a chance to alter the items
1304
+ indexes = del.collectionViewShouldDeselectIndexes(this, indexes) ;
1305
+ if (!indexes || indexes.get('length')===0) return this; // nothing to do
1306
+
1307
+ // now merge change - note we expect sel && indexes to not be null
1308
+ sel = sel.copy().remove(content, indexes);
1309
+ sel = del.collectionViewSelectionForProposedSelection(this, sel);
1310
+ if (!sel) sel = SC.SelectionSet.create(); // empty
1311
+
1312
+ this.set('selection', sel.freeze()) ;
1313
+ return this ;
1314
+ },
1315
+
1316
+ /** @private
1317
+ Finds the next selectable item, up to content length, by asking the
1318
+ delegate. If a non-selectable item is found, the index is skipped. If
1319
+ no item is found, selection index is returned unmodified.
1320
+
1321
+ Return value will always be in the range of the bottom of the current
1322
+ selection index and the proposed index.
1323
+
1324
+ @param {Number} proposedIndex the desired index to select
1325
+ @param {Number} bottom optional bottom of selection use as fallback
1326
+ @returns {Number} next selectable index.
1327
+ */
1328
+ _findNextSelectableItemFromIndex: function(proposedIndex, bottom) {
1329
+
1330
+ var lim = this.get('length'),
1331
+ range = SC.IndexSet.create(),
1332
+ content = this.get('content'),
1333
+ del = this.get('selectionDelegate'),
1334
+ cdel = this.get('contentDelegate'),
1335
+ groupIndexes = cdel.contentGroupIndexes(this, content),
1336
+ ret, sel ;
1337
+
1338
+ // fast path
1339
+ if (!groupIndexes && (del.collectionViewShouldSelectIndexes === this.collectionViewShouldSelectIndexes)) {
1340
+ return proposedIndex;
1341
+ }
1342
+
1343
+ // loop forwards looking for an index that is allowed by delegate
1344
+ // we could alternatively just pass the whole range but this might be
1345
+ // slow for the delegate
1346
+ while (proposedIndex < lim) {
1347
+ if (!groupIndexes || !groupIndexes.contains(proposedIndex)) {
1348
+ range.add(proposedIndex);
1349
+ ret = del.collectionViewShouldSelectIndexes(this, range);
1350
+ if (ret && ret.get('length') >= 1) return proposedIndex ;
1351
+ range.remove(proposedIndex);
1352
+ }
1353
+ proposedIndex++;
1354
+ }
1355
+
1356
+ // if nothing was found, return top of selection
1357
+ if (bottom === undefined) {
1358
+ sel = this.get('selection');
1359
+ bottom = sel ? sel.get('max') : -1 ;
1360
+ }
1361
+ return bottom ;
1362
+ },
1363
+
1364
+ /** @private
1365
+ Finds the previous selectable item, up to the first item, by asking the
1366
+ delegate. If a non-selectable item is found, the index is skipped. If
1367
+ no item is found, selection index is returned unmodified.
1368
+
1369
+ @param {Integer} proposedIndex the desired index to select
1370
+ @returns {Integer} the previous selectable index. This will always be in the range of the top of the current selection index and the proposed index.
1371
+ @private
1372
+ */
1373
+ _findPreviousSelectableItemFromIndex: function(proposedIndex, top) {
1374
+ var range = SC.IndexSet.create(),
1375
+ content = this.get('content'),
1376
+ del = this.get('selectionDelegate'),
1377
+ cdel = this.get('contentDelegate'),
1378
+ groupIndexes = cdel.contentGroupIndexes(this, content),
1379
+ ret ;
1380
+
1381
+ if (SC.none(proposedIndex)) proposedIndex = -1;
1382
+
1383
+ // fast path
1384
+ if (!groupIndexes && (del.collectionViewShouldSelectIndexes === this.collectionViewShouldSelectIndexes)) {
1385
+ return proposedIndex;
1386
+ }
1387
+
1388
+ // loop backwards looking for an index that is allowed by delegate
1389
+ // we could alternatively just pass the whole range but this might be
1390
+ // slow for the delegate
1391
+ while (proposedIndex >= 0) {
1392
+ if (!groupIndexes || !groupIndexes.contains(proposedIndex)) {
1393
+ range.add(proposedIndex);
1394
+ ret = del.collectionViewShouldSelectIndexes(this, range);
1395
+ if (ret && ret.get('length') >= 1) return proposedIndex ;
1396
+ range.remove(proposedIndex);
1397
+ }
1398
+ proposedIndex--;
1399
+ }
1400
+
1401
+ // if nothing was found, return top of selection
1402
+ if (top === undefined) {
1403
+ var sel = this.get('selection');
1404
+ top = sel ? sel.get('min') : -1 ;
1405
+ }
1406
+ if (SC.none(top)) top = -1;
1407
+ return top ;
1408
+ },
1409
+
1410
+ /**
1411
+ Select one or more items before the current selection, optionally
1412
+ extending the current selection. Also scrolls the selected item into
1413
+ view.
1414
+
1415
+ Selection does not wrap around.
1416
+
1417
+ @param extend {Boolean} (Optional) If true, the selection will be extended
1418
+ instead of replaced. Defaults to false.
1419
+ @param numberOfItems {Integer} (Optional) The number of previous to be
1420
+ selected. Defaults to 1
1421
+ @returns {SC.CollectionView} receiver
1422
+ */
1423
+ selectPreviousItem: function(extend, numberOfItems) {
1424
+ if (SC.none(numberOfItems)) numberOfItems = 1 ;
1425
+ if (SC.none(extend)) extend = false ;
1426
+
1427
+ var sel = this.get('selection'),
1428
+ content = this.get('content');
1429
+ if (sel) sel = sel.indexSetForSource(content);
1430
+
1431
+ var selTop = sel ? sel.get('min') : -1,
1432
+ selBottom = sel ? sel.get('max')-1 : -1,
1433
+ anchor = this._selectionAnchor;
1434
+ if (SC.none(anchor)) anchor = selTop;
1435
+
1436
+ // if extending, then we need to do some fun stuff to build the array
1437
+ if (extend) {
1438
+
1439
+ // If the selBottom is after the anchor, then reduce the selection
1440
+ if (selBottom > anchor) {
1441
+ selBottom = selBottom - numberOfItems ;
1442
+
1443
+ // otherwise, select the previous item from the top
1444
+ } else {
1445
+ selTop = this._findPreviousSelectableItemFromIndex(selTop - numberOfItems);
1446
+ }
1447
+
1448
+ // Ensure we are not out of bounds
1449
+ if (SC.none(selTop) || (selTop < 0)) selTop = 0 ;
1450
+ if (selBottom < selTop) selBottom = selTop ;
1451
+
1452
+ // if not extending, just select the item previous to the selTop
1453
+ } else {
1454
+ selTop = this._findPreviousSelectableItemFromIndex(selTop - numberOfItems);
1455
+ if (SC.none(selTop) || (selTop < 0)) selTop = 0 ;
1456
+ selBottom = selTop ;
1457
+ anchor = null ;
1458
+ }
1459
+
1460
+ var scrollToIndex = selTop ;
1461
+
1462
+ // now build new selection
1463
+ sel = SC.IndexSet.create(selTop, selBottom+1-selTop);
1464
+
1465
+ // ensure that the item is visible and set the selection
1466
+ this.scrollToContentIndex(scrollToIndex) ;
1467
+ this.select(sel) ;
1468
+ this._selectionAnchor = anchor ;
1469
+ return this ;
1470
+ },
1471
+
1472
+ /**
1473
+ Select one or more items following the current selection, optionally
1474
+ extending the current selection. Also scrolls to selected item.
1475
+
1476
+ Selection does not wrap around.
1477
+
1478
+ @param extend {Boolean} (Optional) If true, the selection will be extended
1479
+ instead of replaced. Defaults to false.
1480
+ @param numberOfItems {Integer} (Optional) The number of items to be
1481
+ selected. Defaults to 1.
1482
+ @returns {SC.CollectionView} receiver
1483
+ */
1484
+ selectNextItem: function(extend, numberOfItems) {
1485
+ if (SC.none(numberOfItems)) numberOfItems = 1 ;
1486
+ if (SC.none(extend)) extend = false ;
1487
+
1488
+ var sel = this.get('selection'),
1489
+ content = this.get('content');
1490
+ if (sel) sel = sel.indexSetForSource(content);
1491
+
1492
+ var selTop = sel ? sel.get('min') : -1,
1493
+ selBottom = sel ? sel.get('max')-1 : -1,
1494
+ anchor = this._selectionAnchor,
1495
+ lim = this.get('length');
1496
+
1497
+ if (SC.none(anchor)) anchor = selTop;
1498
+
1499
+ // if extending, then we need to do some fun stuff to build the array
1500
+ if (extend) {
1501
+
1502
+ // If the selTop is before the anchor, then reduce the selection
1503
+ if (selTop < anchor) {
1504
+ selTop = selTop + numberOfItems ;
1505
+
1506
+ // otherwise, select the next item after the bottom
1507
+ } else {
1508
+ selBottom = this._findNextSelectableItemFromIndex(selBottom + numberOfItems, selBottom);
1509
+ }
1510
+
1511
+ // Ensure we are not out of bounds
1512
+ if (selBottom >= lim) selBottom = lim-1;
1513
+ if (selTop > selBottom) selTop = selBottom ;
1514
+
1515
+ // if not extending, just select the item next to the selBottom
1516
+ } else {
1517
+ selBottom = this._findNextSelectableItemFromIndex(selBottom + numberOfItems, selBottom);
1518
+
1519
+ if (selBottom >= lim) selBottom = lim-1;
1520
+ selTop = selBottom ;
1521
+ anchor = null ;
1522
+ }
1523
+
1524
+ var scrollToIndex = selBottom ;
1525
+
1526
+ // now build new selection
1527
+ sel = SC.IndexSet.create(selTop, selBottom-selTop+1);
1528
+
1529
+ // ensure that the item is visible and set the selection
1530
+ this.scrollToContentIndex(scrollToIndex) ;
1531
+ this.select(sel) ;
1532
+ this._selectionAnchor = anchor ;
1533
+ return this ;
1534
+ },
1535
+
1536
+ /**
1537
+ Deletes the selected content if canDeleteContent is YES. This will invoke
1538
+ delegate methods to provide fine-grained control. Returns YES if the
1539
+ deletion was possible, even if none actually occurred.
1540
+
1541
+ @returns {Boolean} YES if deletion is possible.
1542
+ */
1543
+ deleteSelection: function() {
1544
+ // perform some basic checks...
1545
+ if (!this.get('canDeleteContent')) return NO;
1546
+
1547
+ var sel = this.get('selection'),
1548
+ content = this.get('content'),
1549
+ del = this.get('selectionDelegate'),
1550
+ indexes = sel&&content ? sel.indexSetForSource(content) : null;
1551
+
1552
+ if (!content || !indexes || indexes.get('length') === 0) return NO ;
1553
+
1554
+ // let the delegate decide what to actually delete. If this returns an
1555
+ // empty index set or null, just do nothing.
1556
+ indexes = del.collectionViewShouldDeleteIndexes(this, indexes);
1557
+ if (!indexes || indexes.get('length') === 0) return NO ;
1558
+
1559
+ // now have the delegate (or us) perform the deletion. The default
1560
+ // delegate implementation just uses standard SC.Array methods to do the
1561
+ // right thing.
1562
+ del.collectionViewDeleteContent(this, this.get('content'), indexes);
1563
+
1564
+ // also, fix up the selection by removing the actual items we removed
1565
+ // set selection directly instead of calling select() since we are just
1566
+ // fixing up the selection.
1567
+
1568
+ this.selectPreviousItem(false, 1) ;
1569
+
1570
+ return YES ;
1571
+ },
1572
+
1573
+ // ..........................................................
1574
+ // SCROLLING
1575
+ //
1576
+
1577
+ /**
1578
+ Scroll the rootElement (if needed) to ensure that the item is visible.
1579
+
1580
+ @param {Number} contentIndex The index of the item to scroll to
1581
+ @returns {SC.CollectionView} receiver
1582
+ */
1583
+ scrollToContentIndex: function(contentIndex) {
1584
+ var itemView = this.itemViewForContentIndex(contentIndex) ;
1585
+ if (itemView) this.scrollToItemView(itemView) ;
1586
+ return this;
1587
+ },
1588
+
1589
+ /**
1590
+ Scroll to the passed item view. If the item view is not visible on screen
1591
+ this method will not work.
1592
+
1593
+ @param {SC.View} view The item view to scroll to
1594
+ @returns {SC.CollectionView} receiver
1595
+ */
1596
+ scrollToItemView: function(view) {
1597
+ if (!view.get('parentView')) return this; // nothing to do
1598
+ if (!view.get('layer')) {
1599
+ if (this.get('layer')) view.updateLayerLocation();
1600
+ else return this; // nothing to do
1601
+ }
1602
+
1603
+ var scrollable = this;
1604
+ while (scrollable && !scrollable.isPane) {
1605
+ if (scrollable.get('isScrollable')) scrollable.scrollToVisible(view);
1606
+ scrollable = scrollable.get('parentView');
1607
+ }
1608
+ return this ;
1609
+ },
1610
+
1611
+ // ..........................................................
1612
+ // KEYBOARD EVENTS
1613
+ //
1614
+
1615
+ /** @private */
1616
+ keyDown: function(evt) {
1617
+ var ret = this.interpretKeyEvents(evt) ;
1618
+ return !ret ? NO : ret ;
1619
+ },
1620
+
1621
+ /** @private */
1622
+ keyUp: function() { return true; },
1623
+
1624
+ /** @private
1625
+ Handle select all keyboard event.
1626
+ */
1627
+ selectAll: function(evt) {
1628
+ var content = this.get('content'),
1629
+ sel = content ? SC.IndexSet.create(0, content.get('length')) : null;
1630
+ this.select(sel, NO) ;
1631
+ return YES ;
1632
+ },
1633
+
1634
+ /** @private
1635
+ Handle delete keyboard event.
1636
+ */
1637
+ deleteBackward: function(evt) {
1638
+ return this.deleteSelection() ;
1639
+ },
1640
+
1641
+ /** @private
1642
+ Handle delete keyboard event.
1643
+ */
1644
+ deleteForward: function(evt) {
1645
+ return this.deleteSelection() ;
1646
+ },
1647
+
1648
+ /** @private
1649
+ Selects the same item on the next row or moves down one if itemsPerRow = 1
1650
+ */
1651
+ moveDown: function(sender, evt) {
1652
+ this.selectNextItem(false, this.get('itemsPerRow') || 1) ;
1653
+ this._cv_performSelectAction(null, evt, this.ACTION_DELAY);
1654
+ return true ;
1655
+ },
1656
+
1657
+ /** @private
1658
+ Selects the same item on the next row or moves up one if itemsPerRow = 1
1659
+ */
1660
+ moveUp: function(sender, evt) {
1661
+ this.selectPreviousItem(false, this.get('itemsPerRow') || 1) ;
1662
+ this._cv_performSelectAction(null, evt, this.ACTION_DELAY);
1663
+ return true ;
1664
+ },
1665
+
1666
+ /** @private
1667
+ Selects the previous item if itemsPerRow > 1. Otherwise does nothing.
1668
+ If item is expandable, will collapse.
1669
+ */
1670
+ moveLeft: function(sender, evt) {
1671
+ if ((this.get('itemsPerRow') || 1) > 1) {
1672
+ this.selectPreviousItem(false, 1);
1673
+ this._cv_performSelectAction(null, evt, this.ACTION_DELAY);
1674
+
1675
+ } else {
1676
+ var sel = this.get('selection'),
1677
+ content = this.get('content'),
1678
+ indexes = sel ? sel.indexSetForSource(content) : null;
1679
+
1680
+ // Collapse the element if it is expanded. However, if there is exactly
1681
+ // one item selected and the item is already collapsed or is a leaf
1682
+ // node, then select the (expanded) parent element instead as a
1683
+ // convenience to the user.
1684
+ if ( indexes ) {
1685
+ var del = undefined, // We'll load it lazily
1686
+ selectParent = false,
1687
+ index = undefined;
1688
+
1689
+ if ( indexes.get('length') === 1 ) {
1690
+ index = indexes.get('firstObject');
1691
+ del = this.get('contentDelegate');
1692
+ var state = del.contentIndexDisclosureState(this, content, index);
1693
+ if (state !== SC.BRANCH_OPEN) selectParent = true;
1694
+ }
1695
+
1696
+ if ( selectParent ) {
1697
+ // TODO: PERFORMANCE: It would be great to have a function like
1698
+ // SC.CollectionView.selectParentItem() or something similar
1699
+ // for performance reasons. But since we don't currently
1700
+ // have such a function, let's just iterate through the
1701
+ // previous items until we find the first one with a outline
1702
+ // level of one less than the selected item.
1703
+ var desiredOutlineLevel = del.contentIndexOutlineLevel(this, content, index) - 1;
1704
+ if ( desiredOutlineLevel >= 0 ) {
1705
+ var parentIndex = -1;
1706
+ while ( parentIndex < 0 ) {
1707
+ var previousItemIndex = this._findPreviousSelectableItemFromIndex(index - 1);
1708
+ if (previousItemIndex < 0 ) return false; // Sanity-check.
1709
+ index = previousItemIndex;
1710
+ var outlineLevel = del.contentIndexOutlineLevel(this, content, index);
1711
+ if ( outlineLevel === desiredOutlineLevel ) {
1712
+ parentIndex = previousItemIndex;
1713
+ }
1714
+ }
1715
+
1716
+ // If we found the parent, select it now.
1717
+ if ( parentIndex !== -1 ) {
1718
+ this.select(index);
1719
+ }
1720
+ }
1721
+ }
1722
+ else {
1723
+ this.collapse(indexes);
1724
+ }
1725
+ }
1726
+ }
1727
+
1728
+ return true ;
1729
+ },
1730
+
1731
+ /** @private
1732
+ Selects the next item if itemsPerRow > 1. Otherwise does nothing.
1733
+ */
1734
+ moveRight: function(sender, evt) {
1735
+ if ((this.get('itemsPerRow') || 1) > 1) {
1736
+ this.selectNextItem(false, 1) ;
1737
+ this._cv_performSelectAction(null, evt, this.ACTION_DELAY);
1738
+ } else {
1739
+ var sel = this.get('selection'),
1740
+ content = this.get('content'),
1741
+ indexes = sel ? sel.indexSetForSource(content) : null;
1742
+ if (indexes) this.expand(indexes);
1743
+ }
1744
+
1745
+ return true ;
1746
+ },
1747
+
1748
+ /** @private */
1749
+ moveDownAndModifySelection: function(sender, evt) {
1750
+ this.selectNextItem(true, this.get('itemsPerRow') || 1) ;
1751
+ this._cv_performSelectAction(null, evt, this.ACTION_DELAY);
1752
+ return true ;
1753
+ },
1754
+
1755
+ /** @private */
1756
+ moveUpAndModifySelection: function(sender, evt) {
1757
+ this.selectPreviousItem(true, this.get('itemsPerRow') || 1) ;
1758
+ this._cv_performSelectAction(null, evt, this.ACTION_DELAY);
1759
+ return true ;
1760
+ },
1761
+
1762
+ /** @private
1763
+ Selects the previous item if itemsPerRow > 1. Otherwise does nothing.
1764
+ */
1765
+ moveLeftAndModifySelection: function(sender, evt) {
1766
+ if ((this.get('itemsPerRow') || 1) > 1) {
1767
+ this.selectPreviousItem(true, 1) ;
1768
+ this._cv_performSelectAction(null, evt, this.ACTION_DELAY);
1769
+ }
1770
+ return true ;
1771
+ },
1772
+
1773
+ /** @private
1774
+ Selects the next item if itemsPerRow > 1. Otherwise does nothing.
1775
+ */
1776
+ moveRightAndModifySelection: function(sender, evt) {
1777
+ if ((this.get('itemsPerRow') || 1) > 1) {
1778
+ this.selectNextItem(true, 1) ;
1779
+ this._cv_performSelectAction(null, evt, this.ACTION_DELAY);
1780
+ }
1781
+ return true ;
1782
+ },
1783
+
1784
+
1785
+
1786
+ /** @private
1787
+ if content value is editable and we have one item selected, then edit.
1788
+ otherwise, invoke action.
1789
+ */
1790
+ insertNewline: function(sender, evt) {
1791
+ var canEdit = this.get('isEditable') && this.get('canEditContent'),
1792
+ sel, content, set, idx, itemView;
1793
+
1794
+ // first make sure we have a single item selected; get idx
1795
+ if (canEdit) {
1796
+ sel = this.get('selection') ;
1797
+ content = this.get('content');
1798
+ if (sel && sel.get('length') === 1) {
1799
+ set = sel.indexSetForSource(content);
1800
+ idx = set ? set.get('min') : -1;
1801
+ canEdit = idx>=0;
1802
+ }
1803
+ }
1804
+
1805
+ // next find itemView and ensure it supports editing
1806
+ if (canEdit) {
1807
+ itemView = this.itemViewForContentIndex(idx);
1808
+ canEdit = itemView && SC.typeOf(itemView.beginEditing)===SC.T_FUNCTION;
1809
+ }
1810
+
1811
+ // ok, we can edit..
1812
+ if (canEdit) {
1813
+ this.scrollToContentIndex(idx);
1814
+ itemView = this.itemViewForContentIndex(idx); // just in case
1815
+ itemView.beginEditing();
1816
+
1817
+ // invoke action
1818
+ } else {
1819
+ this.invokeLater(this._cv_action, 0, itemView, null) ;
1820
+ }
1821
+
1822
+ return YES ; // always handle
1823
+ },
1824
+
1825
+ // ..........................................................
1826
+ // MOUSE EVENTS
1827
+ //
1828
+
1829
+ /** @private
1830
+ Handles mouse down events on the collection view or on any of its
1831
+ children.
1832
+
1833
+ The default implementation of this method can handle a wide variety
1834
+ of user behaviors depending on how you have configured the various
1835
+ options for the collection view.
1836
+
1837
+ @param ev {Event} the mouse down event
1838
+ @returns {Boolean} Usually YES.
1839
+ */
1840
+ mouseDown: function(ev) {
1841
+
1842
+ // When the user presses the mouse down, we don't do much just yet.
1843
+ // Instead, we just need to save a bunch of state about the mouse down
1844
+ // so we can choose the right thing to do later.
1845
+
1846
+ // Toggle selection only triggers on mouse up. Do nothing.
1847
+ if (this.get('useToggleSelection')) return true;
1848
+
1849
+ // find the actual view the mouse was pressed down on. This will call
1850
+ // hitTest() on item views so they can implement non-square detection
1851
+ // modes. -- once we have an item view, get its content object as well.
1852
+ var itemView = this.itemViewForEvent(ev),
1853
+ content = this.get('content'),
1854
+ contentIndex = itemView ? itemView.get('contentIndex') : -1,
1855
+ info, anchor ;
1856
+
1857
+ info = this.mouseDownInfo = {
1858
+ event: ev,
1859
+ itemView: itemView,
1860
+ contentIndex: contentIndex,
1861
+ at: Date.now()
1862
+ };
1863
+
1864
+ // become first responder if possible.
1865
+ this.becomeFirstResponder() ;
1866
+
1867
+ // recieved a mouseDown on the collection element, but not on one of the
1868
+ // childItems... unless we do not allow empty selections, set it to empty.
1869
+ if (!itemView) {
1870
+ if (this.get('allowDeselectAll')) this.select(null, false);
1871
+ return YES ;
1872
+ }
1873
+
1874
+ // collection some basic setup info
1875
+ var sel = this.get('selection'), isSelected, modifierKeyPressed;
1876
+ if (sel) sel = sel.indexSetForSource(content);
1877
+
1878
+ isSelected = sel ? sel.contains(contentIndex) : NO;
1879
+ info.modifierKeyPressed = modifierKeyPressed = ev.ctrlKey || ev.metaKey ;
1880
+
1881
+ // holding down a modifier key while clicking a selected item should
1882
+ // deselect that item...deselect and bail.
1883
+ if (modifierKeyPressed && isSelected) {
1884
+ info.shouldDeselect = contentIndex >= 0;
1885
+
1886
+ // if the shiftKey was pressed, then we want to extend the selection
1887
+ // from the last selected item
1888
+ } else if (ev.shiftKey && sel && sel.get('length') > 0) {
1889
+ sel = this._findSelectionExtendedByShift(sel, contentIndex);
1890
+ anchor = this._selectionAnchor ;
1891
+ this.select(sel) ;
1892
+ this._selectionAnchor = anchor; //save the anchor
1893
+
1894
+ // If no modifier key was pressed, then clicking on the selected item
1895
+ // should clear the selection and reselect only the clicked on item.
1896
+ } else if (!modifierKeyPressed && isSelected) {
1897
+ info.shouldReselect = contentIndex >= 0;
1898
+
1899
+ // Otherwise, if selecting on mouse down, simply select the clicked on
1900
+ // item, adding it to the current selection if a modifier key was pressed.
1901
+ } else {
1902
+ if (this.get("selectOnMouseDown")) {
1903
+ this.select(contentIndex, modifierKeyPressed);
1904
+ } else {
1905
+ info.shouldSelect = contentIndex >= 0 ;
1906
+ }
1907
+ }
1908
+
1909
+ // saved for extend by shift ops.
1910
+ info.previousContentIndex = contentIndex;
1911
+
1912
+ return YES;
1913
+ },
1914
+
1915
+ /** @private */
1916
+ mouseUp: function(ev) {
1917
+
1918
+ var view = this.itemViewForEvent(ev),
1919
+ info = this.mouseDownInfo,
1920
+ contentIndex, sel, isSelected, canEdit, itemView, content, idx;
1921
+
1922
+ if (this.get('useToggleSelection')) {
1923
+ if (!view) return ; // do nothing when clicked outside of elements
1924
+
1925
+ // determine if item is selected. If so, then go on.
1926
+ sel = this.get('selection') ;
1927
+ contentIndex = (view) ? view.get('contentIndex') : -1 ;
1928
+ isSelected = sel && sel.include(contentIndex) ;
1929
+
1930
+ if (isSelected) this.deselect(contentIndex) ;
1931
+ else this.select(contentIndex, YES) ;
1932
+
1933
+ } else if(info) {
1934
+ idx = info.contentIndex;
1935
+ contentIndex = (view) ? view.get('contentIndex') : -1 ;
1936
+
1937
+ // this will be set if the user simply clicked on an unselected item and
1938
+ // selectOnMouseDown was NO.
1939
+ if (info.shouldSelect) this.select(idx, info.modifierKeyPressed);
1940
+
1941
+ // This is true if the user clicked on a selected item with a modifier
1942
+ // key pressed.
1943
+ if (info.shouldDeselect) this.deselect(idx);
1944
+
1945
+ // This is true if the user clicked on a selected item without a
1946
+ // modifier-key pressed. When this happens we try to begin editing
1947
+ // on the content. If that is not allowed, then simply clear the
1948
+ // selection and reselect the clicked on item.
1949
+ if (info.shouldReselect) {
1950
+
1951
+ //debugger ;
1952
+ // - contentValueIsEditable is true
1953
+ canEdit = this.get('isEditable') && this.get('canEditContent') ;
1954
+
1955
+ // - the user clicked on an item that was already selected
1956
+ // ^ this is the only way shouldReset is set to YES
1957
+
1958
+ // - is the only item selected
1959
+ if (canEdit) {
1960
+ sel = this.get('selection') ;
1961
+ canEdit = sel && (sel.get('length') === 1);
1962
+ }
1963
+
1964
+ // - the item view responds to contentHitTest() and returns YES.
1965
+ // - the item view responds to beginEditing and returns YES.
1966
+ if (canEdit) {
1967
+ itemView = this.itemViewForContentIndex(idx) ;
1968
+ canEdit = itemView && (!itemView.contentHitTest || itemView.contentHitTest(ev)) ;
1969
+ canEdit = (canEdit && itemView.beginEditing) ? itemView.beginEditing() : NO ;
1970
+ }
1971
+
1972
+ // if cannot edit, schedule a reselect (but give doubleClick a chance)
1973
+ if (!canEdit) {
1974
+ if (this._cv_reselectTimer) this._cv_reselectTimer.invalidate() ;
1975
+ this._cv_reselectTimer = this.invokeLater(this.select, 300, idx, false) ;
1976
+ }
1977
+ }
1978
+
1979
+ this._cleanupMouseDown() ;
1980
+ }
1981
+
1982
+ // handle actions on editing
1983
+ this._cv_performSelectAction(view, ev, 0, ev.clickCount);
1984
+
1985
+ return NO; // bubble event to allow didDoubleClick to be called...
1986
+ },
1987
+
1988
+ /** @private */
1989
+ _cleanupMouseDown: function() {
1990
+
1991
+ // delete items explicitly to avoid leaks on IE
1992
+ var info = this.mouseDownInfo, key;
1993
+ if (info) {
1994
+ for(key in info) {
1995
+ if (!info.hasOwnProperty(key)) continue;
1996
+ delete info[key];
1997
+ }
1998
+ }
1999
+ this.mouseDownInfo = null;
2000
+ },
2001
+
2002
+ /** @private */
2003
+ mouseMoved: function(ev) {
2004
+ var view = this.itemViewForEvent(ev),
2005
+ last = this._lastHoveredItem ;
2006
+
2007
+ // handle hover events.
2008
+ if (view !== last) {
2009
+ if (last && last.mouseOut) last.mouseOut(ev);
2010
+ if (view && view.mouseOver) view.mouseOver(ev);
2011
+ }
2012
+ this._lastHoveredItem = view ;
2013
+
2014
+ if (view && view.mouseMoved) view.mouseMoved(ev);
2015
+ return YES;
2016
+ },
2017
+
2018
+ /** @private */
2019
+ mouseOut: function(ev) {
2020
+ var view = this._lastHoveredItem ;
2021
+ this._lastHoveredItem = null ;
2022
+ if (view && view.mouseOut) view.mouseOut(ev) ;
2023
+ return YES ;
2024
+ },
2025
+
2026
+ /** @private */
2027
+ _findSelectionExtendedByShift: function(sel, contentIndex) {
2028
+
2029
+ // fast path. if we don't have a selection, just select index
2030
+ if (!sel || sel.get('length')===0) {
2031
+ return SC.IndexSet.create(contentIndex);
2032
+ }
2033
+
2034
+ // if we do have a selection, then figure out how to extend it.
2035
+ var content = this.get('content'),
2036
+ lim = content.get('length')-1,
2037
+ min = sel.get('min'),
2038
+ max = sel.get('max')-1,
2039
+ info = this.mouseDownInfo,
2040
+ anchor = this._selectionAnchor ;
2041
+ if (SC.none(anchor)) anchor = -1;
2042
+
2043
+ // clicked before the current selection set... extend it's beginning...
2044
+ if (contentIndex < min) {
2045
+ min = contentIndex;
2046
+ if (anchor<0) this._selectionAnchor = anchor = max; //anchor at end
2047
+
2048
+ // clicked after the current selection set... extend it's ending...
2049
+ } else if (contentIndex > max) {
2050
+ max = contentIndex;
2051
+ if (anchor<0) this._selectionAnchor = anchor = min; // anchor at start
2052
+
2053
+ // clicked inside the selection set... need to determine where the last
2054
+ // selection was and use that as an anchor.
2055
+ } else if (contentIndex >= min && contentIndex <= max) {
2056
+ if (anchor<0) this._selectionAnchor = anchor = min; //anchor at start
2057
+
2058
+ if (contentIndex === anchor) min = max = contentIndex ;
2059
+ else if (contentIndex > anchor) {
2060
+ min = anchor;
2061
+ max = contentIndex ;
2062
+ } else if (contentIndex < anchor) {
2063
+ min = contentIndex;
2064
+ max = anchor ;
2065
+ }
2066
+ }
2067
+
2068
+ return SC.IndexSet.create(min, max - min + 1);
2069
+ },
2070
+
2071
+ // ......................................
2072
+ // DRAG AND DROP SUPPORT
2073
+ //
2074
+
2075
+ /**
2076
+ When reordering its content, the collection view will store its reorder
2077
+ data using this special data type. The data type is unique to each
2078
+ collection view instance. You can use this data type to detect reorders
2079
+ if necessary.
2080
+
2081
+ @property
2082
+ @type String
2083
+ */
2084
+ reorderDataType: function() {
2085
+ return 'SC.CollectionView.Reorder.%@'.fmt(SC.guidFor(this)) ;
2086
+ }.property().cacheable(),
2087
+
2088
+ /**
2089
+ This property is set to the IndexSet of content objects that are the
2090
+ subject of a drag whenever a drag is initiated on the collection view.
2091
+ You can consult this property when implementing your collection view
2092
+ delegate methods, but otherwise you should not use this property in your
2093
+ code.
2094
+
2095
+ @type SC.IndexSet
2096
+ */
2097
+ dragContent: null,
2098
+
2099
+ /**
2100
+ This property is set to the proposed insertion index during a call to
2101
+ collectionViewValidateDragOperation(). Your delegate implementations can
2102
+ change the value of this property to enforce a drop some in some other
2103
+ location.
2104
+
2105
+ @type Number
2106
+ */
2107
+ proposedInsertionIndex: null,
2108
+
2109
+ /**
2110
+ This property is set to the proposed drop operation during a call to
2111
+ collectionViewValidateDragOperation(). Your delegate implementations can
2112
+ change the value of this property to enforce a different type of drop
2113
+ operation.
2114
+
2115
+ @type Number
2116
+ @property
2117
+ */
2118
+ proposedDropOperation: null,
2119
+
2120
+ /** @private
2121
+ mouseDragged event handler. Initiates a drag if the following conditions
2122
+ are met:
2123
+
2124
+ - collectionViewShouldBeginDrag() returns YES *OR*
2125
+ - the above method is not implemented and canReorderContent is true.
2126
+ - the dragDataTypes property returns a non-empty array
2127
+ - a mouse down event was saved by the mouseDown method.
2128
+ */
2129
+ mouseDragged: function(ev) {
2130
+
2131
+ var del = this.get('selectionDelegate'),
2132
+ content = this.get('content'),
2133
+ sel = this.get('selection'),
2134
+ info = this.mouseDownInfo,
2135
+ dragContent, dragDataTypes, dragView;
2136
+
2137
+ // if the mouse down event was cleared, there is nothing to do; return.
2138
+ if (!info || info.contentIndex<0) return YES ;
2139
+
2140
+ // Don't do anything unless the user has been dragging for 123msec
2141
+ if ((Date.now() - info.at) < 123) return YES ;
2142
+
2143
+ // OK, they must be serious, decide if a drag will be allowed.
2144
+ if (del.collectionViewShouldBeginDrag(this)) {
2145
+
2146
+ // First, get the selection to drag. Drag an array of selected
2147
+ // items appearing in this collection, in the order of the
2148
+ // collection.
2149
+ //
2150
+ // Compute the dragContent - the indexes we will be dragging.
2151
+ // if we don't select on mouse down, then the selection has not been
2152
+ // updated to whatever the user clicked. Instead use
2153
+ // mouse down content.
2154
+ if (!this.get("selectOnMouseDown")) {
2155
+ dragContent = SC.IndexSet.create(info.contentIndex);
2156
+ } else dragContent = sel ? sel.indexSetForSource(content) : null;
2157
+ if (!dragContent) return YES; // nothing to drag
2158
+
2159
+ dragContent = { content: content, indexes: dragContent };
2160
+ this.set('dragContent', dragContent) ;
2161
+
2162
+ // Get the set of data types supported by the delegate. If this returns
2163
+ // a null or empty array and reordering content is not also supported
2164
+ // then do not start the drag.
2165
+ dragDataTypes = this.get('dragDataTypes');
2166
+ if (dragDataTypes && dragDataTypes.get('length') > 0) {
2167
+
2168
+ // Build the drag view to use for the ghost drag. This
2169
+ // should essentially contain any visible drag items.
2170
+ dragView = del.collectionViewDragViewFor(this, dragContent.indexes);
2171
+ if (!dragView) dragView = this._cv_dragViewFor(dragContent.indexes);
2172
+
2173
+ // Make sure the dragView has created its layer.
2174
+ dragView.createLayer();
2175
+
2176
+ // Initiate the drag
2177
+ SC.Drag.start({
2178
+ event: info.event,
2179
+ source: this,
2180
+ dragView: dragView,
2181
+ ghost: NO,
2182
+ ghostActsLikeCursor: del.ghostActsLikeCursor,
2183
+ slideBack: YES,
2184
+ dataSource: this
2185
+ });
2186
+
2187
+ // Also use this opportunity to clean up since mouseUp won't
2188
+ // get called.
2189
+ this._cleanupMouseDown() ;
2190
+ this._lastInsertionIndex = null ;
2191
+
2192
+ // Drag was not allowed by the delegate, so bail.
2193
+ } else this.set('dragContent', null) ;
2194
+
2195
+ return YES ;
2196
+ }
2197
+ },
2198
+
2199
+ /** @private
2200
+ Compute a default drag view by grabbing the raw layers and inserting them
2201
+ into a drag view.
2202
+ */
2203
+ _cv_dragViewFor: function(dragContent) {
2204
+ // find only the indexes that are in both dragContent and nowShowing.
2205
+ var indexes = this.get('nowShowing').without(dragContent);
2206
+ indexes = this.get('nowShowing').without(indexes);
2207
+
2208
+ var dragLayer = this.get('layer').cloneNode(false);
2209
+ var view = SC.View.create({ layer: dragLayer, parentView: this });
2210
+
2211
+ // cleanup weird stuff that might make the drag look out of place
2212
+ SC.$(dragLayer).css('backgroundColor', 'transparent')
2213
+ .css('border', 'none')
2214
+ .css('top', 0).css('left', 0);
2215
+
2216
+ indexes.forEach(function(i) {
2217
+ var itemView = this.itemViewForContentIndex(i),
2218
+ isSelected, layer;
2219
+
2220
+ // render item view without isSelected state.
2221
+ if (itemView) {
2222
+ isSelected = itemView.get('isSelected');
2223
+ itemView.set('isSelected', NO);
2224
+
2225
+ itemView.updateLayerIfNeeded();
2226
+ layer = itemView.get('layer');
2227
+ if (layer) layer = layer.cloneNode(true);
2228
+
2229
+ itemView.set('isSelected', isSelected);
2230
+ itemView.updateLayerIfNeeded();
2231
+ }
2232
+
2233
+ if (layer) dragLayer.appendChild(layer);
2234
+ layer = null;
2235
+
2236
+ }, this);
2237
+
2238
+ dragLayer = null;
2239
+ return view ;
2240
+ },
2241
+
2242
+
2243
+ /**
2244
+ Implements the drag data source protocol for the collection view. This
2245
+ property will consult the collection view delegate if one is provided. It
2246
+ will also do the right thing if you have set canReorderContent to YES.
2247
+
2248
+ @property
2249
+ @type Array
2250
+ */
2251
+ dragDataTypes: function() {
2252
+ // consult delegate.
2253
+ var del = this.get('selectionDelegate'),
2254
+ ret = del.collectionViewDragDataTypes(this),
2255
+ key ;
2256
+
2257
+ if (this.get('canReorderContent')) {
2258
+ ret = ret ? ret.copy() : [];
2259
+ key = this.get('reorderDataType');
2260
+ if (ret.indexOf(key) < 0) ret.push(key);
2261
+ }
2262
+
2263
+ return ret ? ret : [];
2264
+ }.property(),
2265
+
2266
+ /**
2267
+ Implements the drag data source protocol method. The implementation of
2268
+ this method will consult the collection view delegate if one has been
2269
+ provided. It also respects the canReoderContent method.
2270
+ */
2271
+ dragDataForType: function(drag, dataType) {
2272
+
2273
+ // if this is a reorder, then return drag content.
2274
+ if (this.get('canReorderContent')) {
2275
+ if (dataType === this.get('reorderDataType')) {
2276
+ return this.get('dragContent') ;
2277
+ }
2278
+ }
2279
+
2280
+ // otherwise, just pass along to the delegate
2281
+ var del = this.get('selectionDelegate');
2282
+ return del.collectionViewDragDataForType(this, drag, dataType);
2283
+ },
2284
+
2285
+ /**
2286
+ Implements the SC.DropTarget interface. The default implementation will
2287
+ consult the collection view delegate, if you implement those methods.
2288
+
2289
+ This method is called once when the drag enters the view area. It's
2290
+ return value will be stored on the drag object as allowedDragOperations,
2291
+ possibly further constrained by the drag source.
2292
+
2293
+ @param {SC.Drag} drag the drag object
2294
+ @param {SC.Event} evt the event triggering this change, if available
2295
+ @returns {Number} logical OR'd mask of allowed drag operations.
2296
+ */
2297
+ computeDragOperations: function(drag, evt) {
2298
+
2299
+ // the proposed drag operation is DRAG_REORDER only if we can reorder
2300
+ // content and the drag contains reorder content.
2301
+ var op = SC.DRAG_NONE,
2302
+ del = this.get('selectionDelegate');
2303
+
2304
+ if (this.get('canReorderContent')) {
2305
+ if (drag.get('dataTypes').indexOf(this.get('reorderDataType')) >= 0) {
2306
+ op = SC.DRAG_REORDER ;
2307
+ }
2308
+ }
2309
+
2310
+ // Now pass this onto the delegate.
2311
+ op = del.collectionViewComputeDragOperations(this, drag, op);
2312
+ if (op & SC.DRAG_REORDER) op = SC.DRAG_MOVE ;
2313
+
2314
+ return op ;
2315
+ },
2316
+
2317
+ /** @private
2318
+ Determines the allowed drop operation insertion point, operation type,
2319
+ and the drag operation to be performed. Used by dragUpdated() and
2320
+ performDragOperation().
2321
+
2322
+ @param {SC.Drag} drag the drag object
2323
+ @param {SC.Event} evt source of this request, if available
2324
+ @param {Number} dragOp allowed drag operation mask
2325
+ Returns three params: [drop index, drop operation, allowed drag ops]
2326
+ */
2327
+ _computeDropOperationState: function(drag, evt, dragOp) {
2328
+
2329
+ // get the insertion index for this location. This can be computed
2330
+ // by a subclass using whatever method. This method is not expected to
2331
+ // do any data valdidation, just to map the location to an insertion
2332
+ // index.
2333
+ var loc = this.convertFrameFromView(drag.get('location'), null),
2334
+ dropOp = SC.DROP_BEFORE,
2335
+ del = this.get('selectionDelegate'),
2336
+ canReorder = this.get('canReorderContent'),
2337
+ objects, content, isPreviousInDrag, isNextInDrag, len;
2338
+
2339
+ // STEP 1: Try with a DROP_ON option -- send straight to delegate if
2340
+ // supported by view.
2341
+
2342
+ // get the computed insertion index and possibly drop operation.
2343
+ // prefer to drop ON.
2344
+ var idx = this.insertionIndexForLocation(loc, SC.DROP_ON) ;
2345
+ if (SC.typeOf(idx) === SC.T_ARRAY) {
2346
+ dropOp = idx[1] ; // order matters here
2347
+ idx = idx[0] ;
2348
+ }
2349
+
2350
+ // if the return drop operation is DROP_ON, then just check it with the
2351
+ // delegate method. If the delegate method does not support dropping on,
2352
+ // then it will return DRAG_NONE, in which case we will try again with
2353
+ // drop before.
2354
+ if (dropOp === SC.DROP_ON) {
2355
+
2356
+ // Now save the insertion index and the dropOp. This may be changed by
2357
+ // the collection delegate.
2358
+ this.set('proposedInsertionIndex', idx) ;
2359
+ this.set('proposedDropOperation', dropOp) ;
2360
+ dragOp = del.collectionViewValidateDragOperation(this, drag, dragOp, idx, dropOp) ;
2361
+ idx = this.get('proposedInsertionIndex') ;
2362
+ dropOp = this.get('proposedDropOperation') ;
2363
+ this._dropInsertionIndex = this._dropOperation = null ;
2364
+
2365
+ // The delegate is OK with a drop on also, so just return.
2366
+ if (dragOp !== SC.DRAG_NONE) return [idx, dropOp, dragOp] ;
2367
+
2368
+ // The delegate is NOT OK with a drop on, try to get the insertion
2369
+ // index again, but this time prefer SC.DROP_BEFORE, then let the
2370
+ // rest of the method run...
2371
+ else {
2372
+ dropOp = SC.DROP_BEFORE ;
2373
+ idx = this.insertionIndexForLocation(loc, SC.DROP_BEFORE) ;
2374
+ if (SC.typeOf(idx) === SC.T_ARRAY) {
2375
+ dropOp = idx[1] ; // order matters here
2376
+ idx = idx[0] ;
2377
+ }
2378
+ }
2379
+ }
2380
+
2381
+ // if this is a reorder drag, set the proposed op to SC.DRAG_REORDER and
2382
+ // validate the insertion point. This only works if the insertion point
2383
+ // is DROP_BEFORE or DROP_AFTER. DROP_ON is not handled by reordering
2384
+ // content.
2385
+ if ((idx >= 0) && canReorder && (dropOp !== SC.DROP_ON)) {
2386
+
2387
+ objects = drag.dataForType(this.get('reorderDataType')) ;
2388
+ if (objects) {
2389
+ content = this.get('content') ;
2390
+
2391
+ // if the insertion index is in between two items in the drag itself,
2392
+ // then this is not allowed. Either use the last insertion index or
2393
+ // find the first index that is not in between selections. Stop when
2394
+ // we get to the beginning.
2395
+ if (dropOp === SC.DROP_BEFORE) {
2396
+ isPreviousInDrag = objects.indexes.contains(idx-1);
2397
+ isNextInDrag = objects.indexes.contains(idx);
2398
+ } else {
2399
+ isPreviousInDrag = objects.indexes.contains(idx);
2400
+ isNextInDrag = objects.indexes.contains(idx-1);
2401
+ }
2402
+
2403
+ if (isPreviousInDrag && isNextInDrag) {
2404
+ if (SC.none(this._lastInsertionIndex)) {
2405
+ if (dropOp === SC.DROP_BEFORE) {
2406
+ while ((idx >= 0) && objects.indexes.contains(idx)) idx--;
2407
+ } else {
2408
+ len = content ? content.get('length') : 0;
2409
+ while ((idx < len) && objects.indexes.contains(idx)) idx++;
2410
+ }
2411
+ } else idx = this._lastInsertionIndex ;
2412
+ }
2413
+
2414
+ // If we found a valid insertion point to reorder at, then set the op
2415
+ // to custom DRAG_REORDER.
2416
+ if (idx >= 0) dragOp = SC.DRAG_REORDER ;
2417
+ }
2418
+ }
2419
+
2420
+ // Now save the insertion index and the dropOp. This may be changed by
2421
+ // the collection delegate.
2422
+ this.set('proposedInsertionIndex', idx) ;
2423
+ this.set('proposedDropOperation', dropOp) ;
2424
+ dragOp = del.collectionViewValidateDragOperation(this, drag, dragOp, idx, dropOp) ;
2425
+ idx = this.get('proposedInsertionIndex') ;
2426
+ dropOp = this.get('proposedDropOperation') ;
2427
+ this._dropInsertionIndex = this._dropOperation = null ;
2428
+
2429
+ // return generated state
2430
+ return [idx, dropOp, dragOp] ;
2431
+ },
2432
+
2433
+ /**
2434
+ Implements the SC.DropTarget interface. The default implementation will
2435
+ determine the drop location and then consult the collection view delegate
2436
+ if you implement those methods. Otherwise it will handle reordering
2437
+ content on its own.
2438
+ */
2439
+ dragUpdated: function(drag, evt) {
2440
+
2441
+ var op = drag.get('allowedDragOperations'),
2442
+ state = this._computeDropOperationState(drag, evt, op),
2443
+ idx = state[0], dropOp = state[1], dragOp = state[2];
2444
+
2445
+ // if the insertion index or dropOp have changed, update the insertion
2446
+ // point
2447
+ if (dragOp !== SC.DRAG_NONE) {
2448
+ if ((this._lastInsertionIndex !== idx) || (this._lastDropOperation !== dropOp)) {
2449
+ var itemView = this.itemViewForContentIndex(idx) ;
2450
+ this.showInsertionPoint(itemView, dropOp) ;
2451
+ }
2452
+
2453
+ this._lastInsertionIndex = idx ;
2454
+ this._lastDropOperation = dropOp ;
2455
+ } else {
2456
+ this.hideInsertionPoint() ;
2457
+ this._lastInsertionIndex = this._lastDropOperation = null ;
2458
+ }
2459
+
2460
+ // Normalize drag operation to the standard kinds accepted by the drag
2461
+ // system.
2462
+ return (dragOp & SC.DRAG_REORDER) ? SC.DRAG_MOVE : dragOp;
2463
+ },
2464
+
2465
+ /**
2466
+ Implements the SC.DropTarget protocol. Hides any visible insertion
2467
+ point and clears some cached values.
2468
+ */
2469
+ dragExited: function() {
2470
+ this.hideInsertionPoint() ;
2471
+ this._lastInsertionIndex = this._lastDropOperation = null ;
2472
+ },
2473
+
2474
+ /**
2475
+ Implements the SC.DropTarget protocol.
2476
+ */
2477
+ acceptDragOperation: function(drag, op) { return YES; },
2478
+
2479
+ /**
2480
+ Implements the SC.DropTarget protocol. Consults the collection view
2481
+ delegate to actually perform the operation unless the operation is
2482
+ reordering content.
2483
+ */
2484
+ performDragOperation: function(drag, op) {
2485
+ // Get the correct insertion point, drop operation, etc.
2486
+ var state = this._computeDropOperationState(drag, null, op),
2487
+ idx = state[0], dropOp = state[1], dragOp = state[2],
2488
+ del = this.get('selectionDelegate'),
2489
+ performed, objects, data, content, shift;
2490
+
2491
+ // The dragOp is the kinds of ops allowed. The drag operation must
2492
+ // be included in that set.
2493
+ if (dragOp & SC.DRAG_REORDER) {
2494
+ op = (op & SC.DRAG_MOVE) ? SC.DRAG_REORDER : SC.DRAG_NONE ;
2495
+ } else op = op & dragOp ;
2496
+
2497
+ // If no allowed drag operation could be found, just return.
2498
+ if (op === SC.DRAG_NONE) return op;
2499
+
2500
+ // Some operation is allowed through, give the delegate a chance to
2501
+ // handle it.
2502
+ performed = del.collectionViewPerformDragOperation(this, drag, op, idx, dropOp) ;
2503
+
2504
+ // If the delegate did not handle the drag (i.e. returned SC.DRAG_NONE),
2505
+ // and the op type is REORDER, then do the reorder here.
2506
+ if ((performed === SC.DRAG_NONE) && (op & SC.DRAG_REORDER)) {
2507
+
2508
+ data = drag.dataForType(this.get('reorderDataType')) ;
2509
+ if (!data) return SC.DRAG_NONE ;
2510
+
2511
+ content = this.get('content') ;
2512
+ content.beginPropertyChanges(); // suspend notifications
2513
+
2514
+ // get each object, then remove it from the content. they will be
2515
+ // added again later.
2516
+ objects = [];
2517
+ shift = 0;
2518
+ data.indexes.forEach(function(i) {
2519
+ objects.push(content.objectAt(i-shift));
2520
+ content.removeAt(i-shift);
2521
+ shift++;
2522
+ if (i < idx) idx--;
2523
+ if ((dropOp === SC.DROP_AFTER) && (i === idx)) idx--;
2524
+ }, this);
2525
+
2526
+ // now insert objects into new insertion locaiton
2527
+ content.replace(idx, 0, objects);
2528
+ this.select(SC.IndexSet.create(idx, objects.length));
2529
+ content.endPropertyChanges(); // restart notifications
2530
+
2531
+ // make the op into its actual value
2532
+ op = SC.DRAG_MOVE ;
2533
+ }
2534
+
2535
+ return op;
2536
+ },
2537
+
2538
+ /**
2539
+ Default delegate method implementation, returns YES if canReorderContent
2540
+ is also true.
2541
+ */
2542
+ collectionViewShouldBeginDrag: function(view) {
2543
+ return this.get('canReorderContent') ;
2544
+ },
2545
+
2546
+
2547
+ // ..........................................................
2548
+ // INSERTION POINT
2549
+ //
2550
+
2551
+
2552
+ /**
2553
+ Get the preferred insertion point for the given location, including
2554
+ an insertion preference of before, after or on the named index.
2555
+
2556
+ You can implement this method in a subclass if you like to perform a
2557
+ more efficient check. The default implementation will loop through the
2558
+ item views looking for the first view to "switch sides" in the orientation
2559
+ you specify.
2560
+
2561
+ This method should return an array with two values. The first value is
2562
+ the insertion point index and the second value is the drop operation,
2563
+ which should be one of SC.DROP_BEFORE, SC.DROP_AFTER, or SC.DROP_ON.
2564
+
2565
+ The preferred drop operation passed in should be used as a hint as to
2566
+ the type of operation the view would prefer to receive. If the
2567
+ dropOperation is SC.DROP_ON, then you should return a DROP_ON mode if
2568
+ possible. Otherwise, you should never return DROP_ON.
2569
+
2570
+ For compatibility, you can also return just the insertion index. If you
2571
+ do this, then the collction view will assume the drop operation is
2572
+ SC.DROP_BEFORE.
2573
+
2574
+ If an insertion is NOT allowed, you should return -1 as the insertion
2575
+ point. In this case, the drop operation will be ignored.
2576
+
2577
+ @param loc {Point} the mouse location.
2578
+ @param dropOperation {DropOp} the preferred drop operation.
2579
+ @returns {Array} [proposed drop index, drop operation]
2580
+ */
2581
+ insertionIndexForLocation: function(loc, dropOperation) {
2582
+ var ret = 0 ;
2583
+
2584
+ // var content = this.get('content'),
2585
+ // nowShowing = this.get('nowShowing'),
2586
+ // orient = this.get('insertionOrientation'),
2587
+ // lastSide = null,
2588
+ // ret = null,
2589
+ // itemView, curSide, f;
2590
+ //
2591
+ // for(var idx=0; ((ret === null) && (idx<content.length)); idx++) {
2592
+ // // itemView = this.itemViewForContent(content.objectAt(idx));
2593
+ // itemView = this.itemViewForContentIndex(idx);
2594
+ // f = this.convertFrameFromView(itemView.get('frame'), itemView) ;
2595
+ //
2596
+ // // if we are a horizontal orientation, look for the first item that
2597
+ // // will "switch sides" on the x path an the maxY is greater than Y.
2598
+ // // This assumes you will flow top to bottom, but it should work if you
2599
+ // // flow LTR or RTL.
2600
+ // if (orient == SC.HORIZONTAL_ORIENTATION) {
2601
+ // if (SC.maxY(f) > loc.y) {
2602
+ // curSide = (SC.maxX(f) < loc.x) ? -1 : 1 ;
2603
+ // } else curSide = null ;
2604
+ //
2605
+ // // if we are a vertical orientation, look for the first item that
2606
+ // // will "switch sides" on the y path and the maxX is greater than X.
2607
+ // // This assumes you will flow LTR, but it should work if you flow
2608
+ // // bottom to top or top to bottom.
2609
+ // } else {
2610
+ // if (SC.minX(f) < loc.x) {
2611
+ // curSide = (SC.maxY(f) < loc.y) ? -1 : 1 ;
2612
+ // } else curSide = null ;
2613
+ // }
2614
+ //
2615
+ // // if we "switched" sides then return this item view.
2616
+ // if (curSide !== null) {
2617
+ //
2618
+ // // OK, we found an item view, while we have this data, decide if
2619
+ // // we should insert before or after the view
2620
+ // if ((lastSide !== null) && (curSide != lastSide)) {
2621
+ // ret = idx ;
2622
+ // if (orient == SC.HORIZONTAL_ORIENTATION) {
2623
+ // if (SC.midX(f) < loc.x) ret++ ;
2624
+ // } else {
2625
+ // if (SC.midY(f) < loc.y) ret++ ;
2626
+ // }
2627
+ // }
2628
+ // lastSide =curSide ;
2629
+ // }
2630
+ // }
2631
+ //
2632
+ // // Handle some edge cases
2633
+ // if ((ret === null) || (ret < 0)) ret = 0 ;
2634
+ // if (ret > content.length) ret = content.length ;
2635
+
2636
+ // Done. Phew. Return.
2637
+ return ret;
2638
+ },
2639
+
2640
+ // ..........................................................
2641
+ // INTERNAL SUPPORT
2642
+ //
2643
+
2644
+ /** @private - when we become visible, reload if needed. */
2645
+ _cv_isVisibleInWindowDidChange: function() {
2646
+ if (this.get('isVisibleInWindow')) {
2647
+ if (this._invalidIndexes) this.invokeOnce(this.reloadIfNeeded);
2648
+ if (this._invalidSelection) {
2649
+ this.invokeOnce(this.reloadSelectionIndexesIfNeeded);
2650
+ }
2651
+ }
2652
+ }.observes('isVisibleInWindow'),
2653
+
2654
+
2655
+ /**
2656
+ Default delegate method implementation, returns YES if isSelectable
2657
+ is also true.
2658
+ */
2659
+ collectionViewShouldSelectItem: function(view, item) {
2660
+ return this.get('isSelectable') ;
2661
+ },
2662
+
2663
+ _TMP_DIFF1: SC.IndexSet.create(),
2664
+ _TMP_DIFF2: SC.IndexSet.create(),
2665
+
2666
+ /** @private
2667
+
2668
+ Whenever the nowShowing range changes, update the range observer on the
2669
+ content item and instruct the view to reload any indexes that are not in
2670
+ the previous nowShowing range.
2671
+
2672
+ */
2673
+ _cv_nowShowingDidChange: function() {
2674
+ var nowShowing = this.get('nowShowing'),
2675
+ last = this._sccv_lastNowShowing,
2676
+ diff, diff1, diff2;
2677
+
2678
+ // find the differences between the two
2679
+ // NOTE: reuse a TMP IndexSet object to avoid creating lots of objects
2680
+ // during scrolling
2681
+ if (last && nowShowing && (last !== nowShowing)) {
2682
+ diff1 = this._TMP_DIFF1.add(last).remove(nowShowing);
2683
+ diff2 = this._TMP_DIFF2.add(nowShowing).remove(last);
2684
+ diff = diff1.add(diff2);
2685
+ } else diff = last || nowShowing ;
2686
+
2687
+ // if nowShowing has actually changed, then update
2688
+ if (diff && diff.get('length') > 0) {
2689
+ this._sccv_lastNowShowing = nowShowing ? nowShowing.frozenCopy() : null;
2690
+ this.updateContentRangeObserver();
2691
+ this.reload(diff);
2692
+ }
2693
+
2694
+ // cleanup tmp objects
2695
+ if (diff1) diff1.clear();
2696
+ if (diff2) diff2.clear();
2697
+
2698
+ }.observes('nowShowing'),
2699
+
2700
+ init: function() {
2701
+ sc_super();
2702
+ if (this.get('canReorderContent')) this._cv_canReorderContentDidChange();
2703
+ this._sccv_lastNowShowing = this.get('nowShowing').clone();
2704
+ if (this.content) this._cv_contentDidChange();
2705
+ if (this.selection) this._cv_selectionDidChange();
2706
+ },
2707
+
2708
+ /** @private
2709
+ Become a drop target whenever reordering content is enabled.
2710
+ */
2711
+ _cv_canReorderContentDidChange: function() {
2712
+ if (this.get('canReorderContent')) {
2713
+ if (!this.get('isDropTarget')) this.set('isDropTarget', YES);
2714
+ SC.Drag.addDropTarget(this);
2715
+ }
2716
+ }.observes('canReorderContent'),
2717
+
2718
+ /** @private
2719
+ Fires an action after a selection if enabled.
2720
+
2721
+ if actOnSelect is YES, then try to invoke the action, passing the
2722
+ current selection (saved as a separate array so that a change in sel
2723
+ in the meantime will not be lost)
2724
+ */
2725
+ _cv_performSelectAction: function(view, ev, delay, clickCount) {
2726
+ var sel;
2727
+ if (delay === undefined) delay = 0 ;
2728
+ if (clickCount === undefined) clickCount = 1;
2729
+ if ((clickCount>1) || this.get('actOnSelect')) {
2730
+ if (this._cv_reselectTimer) this._cv_reselectTimer.invalidate() ;
2731
+ sel = this.get('selection');
2732
+ sel = sel ? sel.toArray() : [];
2733
+ if (this._cv_actionTimer) this._cv_actionTimer.invalidate();
2734
+ this._cv_actionTimer = this.invokeLater(this._cv_action, delay, view, ev, sel) ;
2735
+ }
2736
+ },
2737
+
2738
+ /** @private
2739
+ Perform the action. Supports legacy behavior as well as newer style
2740
+ action dispatch.
2741
+ */
2742
+ _cv_action: function(view, evt, context) {
2743
+ var action = this.get('action');
2744
+ var target = this.get('target') || null;
2745
+
2746
+ this._cv_actionTimer = null;
2747
+ if (action) {
2748
+ // if the action is a function, just call it
2749
+ if (SC.typeOf(action) === SC.T_FUNCTION) return this.action(view, evt) ;
2750
+
2751
+ // otherwise, use the new sendAction style
2752
+ var pane = this.get('pane') ;
2753
+ if (pane) {
2754
+ pane.rootResponder.sendAction(action, target, this, pane, context);
2755
+ }
2756
+ // SC.app.sendAction(action, target, this) ;
2757
+
2758
+ // if no action is specified, then trigger the support action,
2759
+ // if supported.
2760
+ } else if (!view) {
2761
+ return ; // nothing to do
2762
+
2763
+ // if the target view has its own internal action handler,
2764
+ // trigger that.
2765
+ } else if (SC.typeOf(view._action) == SC.T_FUNCTION) {
2766
+ return view._action(evt) ;
2767
+
2768
+ // otherwise call the action method to support older styles.
2769
+ } else if (SC.typeOf(view.action) == SC.T_FUNCTION) {
2770
+ return view.action(evt) ;
2771
+ }
2772
+ }
2773
+
2774
+
2775
+ });