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,2521 @@
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('system/browser');
9
+ sc_require('system/event');
10
+ sc_require('system/cursor');
11
+ sc_require('system/responder') ;
12
+
13
+ sc_require('mixins/string') ;
14
+
15
+ SC.viewKey = SC.guidKey + "_view" ;
16
+
17
+ /** Select a horizontal layout for various views.*/
18
+ SC.LAYOUT_HORIZONTAL = 'sc-layout-horizontal';
19
+
20
+ /** Select a vertical layout for various views.*/
21
+ SC.LAYOUT_VERTICAL = 'sc-layout-vertical';
22
+
23
+ /** @private */
24
+ SC._VIEW_DEFAULT_DIMS = 'marginTop marginLeft'.w();
25
+
26
+ /**
27
+ Layout properties needed to anchor a view to the top.
28
+ */
29
+ SC.ANCHOR_TOP = { top: 0 };
30
+
31
+ /**
32
+ Layout properties needed to anchor a view to the left.
33
+ */
34
+ SC.ANCHOR_LEFT = { left: 0 };
35
+
36
+ /*
37
+ Layout properties to anchor a view to the top left
38
+ */
39
+ SC.ANCHOR_TOP_LEFT = { top: 0, left: 0 };
40
+
41
+ /**
42
+ Layout properties to anchoe view to the bottom.
43
+ */
44
+ SC.ANCHOR_BOTTOM = { bottom: 0 };
45
+
46
+ /**
47
+ Layout properties to anchor a view to the right.
48
+ */
49
+ SC.ANCHOR_RIGHT = { right: 0 } ;
50
+
51
+ /**
52
+ Layout properties to anchor a view to the bottom right.
53
+ */
54
+ SC.ANCHOR_BOTTOM_RIGHT = { bottom: 0, right: 0 };
55
+
56
+ /**
57
+ Layout properties to take up the full width of a parent view.
58
+ */
59
+ SC.FULL_WIDTH = { left: 0, right: 0 };
60
+
61
+ /**
62
+ Layout properties to take up the full height of a parent view.
63
+ */
64
+ SC.FULL_HEIGHT = { top: 0, bottom: 0 };
65
+
66
+ /**
67
+ Layout properties to center. Note that you must also specify a width and
68
+ height for this to work.
69
+ */
70
+ SC.ANCHOR_CENTER = { centerX: 0, centerY: 0 };
71
+
72
+ /**
73
+ Layout property for width, height
74
+ */
75
+
76
+ SC.LAYOUT_AUTO = 'auto';
77
+
78
+ /** @private - custom array used for child views */
79
+ SC.EMPTY_CHILD_VIEWS_ARRAY = [];
80
+ SC.EMPTY_CHILD_VIEWS_ARRAY.needsClone = YES;
81
+
82
+ /**
83
+ @class
84
+
85
+ Base class for managing a view. View's provide two functions:
86
+
87
+ 1. They translate state and events into drawing instructions for the
88
+ web browser and
89
+
90
+ 2. They act as first responders for incoming keyboard, mouse, and
91
+ touch events.
92
+
93
+ h2. View Initialization
94
+
95
+ When a view is setup, there are several methods you can override that
96
+ will be called at different times depending on how your view is created.
97
+ Here is a guide to which method you want to override and when:
98
+
99
+ - *init:* override this method for any general object setup (such as
100
+ observers, starting timers and animations, etc) that you need to happen
101
+ everytime the view is created, regardless of whether or not its layer
102
+ exists yet.
103
+
104
+ - *render:* override this method to generate or update your HTML to reflect
105
+ the current state of your view. This method is called both when your view
106
+ is first created and later anytime it needs to be updated.
107
+
108
+ - *didCreateLayer:* the render() method is used to generate new HTML.
109
+ Override this method to perform any additional setup on the DOM you might
110
+ need to do after creating the view. For example, if you need to listen
111
+ for events.
112
+
113
+ - *willDestroyLayer:* if you implement didCreateLayer() to setup event
114
+ listeners, you should implement this method as well to remove the same
115
+ just before the DOM for your view is destroyed.
116
+
117
+ - *updateLayer:* Normally, when a view needs to update its content, it will
118
+ re-render the view using the render() method. If you would like to
119
+ override this behavior with your own custom updating code, you can
120
+ replace updateLayer() with your own implementation instead.
121
+
122
+ @extends SC.Responder
123
+ @extends SC.DelegateSupport
124
+ @since SproutCore 1.0
125
+ */
126
+ SC.View = SC.Responder.extend(SC.DelegateSupport,
127
+ /** @scope SC.View.prototype */ {
128
+
129
+ concatenatedProperties: 'outlets displayProperties layoutProperties classNames renderMixin didCreateLayerMixin willDestroyLayerMixin'.w(),
130
+
131
+ /**
132
+ The current pane.
133
+ @property {SC.Pane}
134
+ */
135
+ pane: function() {
136
+ var view = this ;
137
+ while (view && !view.isPane) view = view.get('parentView') ;
138
+ return view ;
139
+ }.property('parentView').cacheable(),
140
+
141
+ /**
142
+ The page this view was instantiated from. This is set by the page object
143
+ during instantiation.
144
+
145
+ @property {SC.Page}
146
+ */
147
+ page: null,
148
+
149
+ /**
150
+ The current split view this view is embedded in (may be null).
151
+ @property {SC.SplitView}
152
+ */
153
+ splitView: function() {
154
+ var view = this ;
155
+ while (view && !view.isSplitView) view = view.get('parentView') ;
156
+ return view ;
157
+ }.property('parentView').cacheable(),
158
+
159
+ /**
160
+ If the view is currently inserted into the DOM of a parent view, this
161
+ property will point to the parent of the view.
162
+ */
163
+ parentView: null,
164
+
165
+ /**
166
+ Optional background color. Will be applied to the view's element if
167
+ set. This property is intended for one-off views that need a background
168
+ element. If you plan to create many view instances it is probably better
169
+ to use CSS.
170
+
171
+ @property {String}
172
+ */
173
+ backgroundColor: null,
174
+
175
+ // ..........................................................
176
+ // IS ENABLED SUPPORT
177
+ //
178
+
179
+ /**
180
+ Set to true when the item is enabled. Note that changing this value
181
+ will also alter the isVisibleInWindow property for this view and any
182
+ child views.
183
+
184
+ Note that if you apply the SC.Control mixin, changing this property will
185
+ also automatically add or remove a 'disabled' CSS class name as well.
186
+
187
+ This property is observable and bindable.
188
+
189
+ @property {Boolean}
190
+ */
191
+ isEnabled: YES,
192
+ isEnabledBindingDefault: SC.Binding.oneWay().bool(),
193
+
194
+ /**
195
+ Computed property returns YES if the view and all of its parent views
196
+ are enabled in the pane. You should use this property when deciding
197
+ whether to respond to an incoming event or not.
198
+
199
+ This property is not observable.
200
+
201
+ @property {Boolean}
202
+ */
203
+ isEnabledInPane: function() {
204
+ var ret = this.get('isEnabled'), pv ;
205
+ if (ret && (pv = this.get('parentView'))) ret = pv.get('isEnabledInPane');
206
+ return ret ;
207
+ }.property('parentView', 'isEnabled'),
208
+
209
+ // ..........................................................
210
+ // IS VISIBLE IN WINDOW SUPPORT
211
+ //
212
+
213
+ /**
214
+ The isVisible property determines if the view is shown in the view
215
+ hierarchy it is a part of. A view can have isVisible == YES and still have
216
+ isVisibleInWindow == NO. This occurs, for instance, when a parent view has
217
+ isVisible == NO. Default is YES.
218
+
219
+ The isVisible property is considered part of the layout and so changing it
220
+ will trigger a layout update.
221
+
222
+ @property {Boolean}
223
+ */
224
+ isVisible: YES,
225
+ isVisibleBindingDefault: SC.Binding.bool(),
226
+
227
+ /**
228
+ YES only if the view and all of its parent views are currently visible
229
+ in the window. This property is used to optimize certain behaviors in
230
+ the view. For example, updates to the view layer are not performed
231
+ if the view until the view becomes visible in the window.
232
+ */
233
+ isVisibleInWindow: NO,
234
+
235
+ /**
236
+ Recomputes the isVisibleInWindow property based on the visibility of the
237
+ view and its parent. If the recomputed value differs from the current
238
+ isVisibleInWindow state, this method will also call
239
+ recomputIsVisibleInWindow() on its child views as well. As an optional
240
+ optimization, you can pass the isVisibleInWindow state of the parentView
241
+ if you already know it.
242
+
243
+ You will not generally need to call or override this method yourself. It
244
+ is used by the SC.View hierarchy to relay window visibility changes up
245
+ and down the chain.
246
+
247
+ @property {Boolean} parentViewIsVisible
248
+ @returns {SC.View} receiver
249
+ */
250
+ recomputeIsVisibleInWindow: function(parentViewIsVisible) {
251
+ var last = this.get('isVisibleInWindow') ;
252
+ var cur = this.get('isVisible'), parentView ;
253
+
254
+ // isVisibleInWindow = isVisible && parentView.isVisibleInWindow
255
+ // this approach only goes up to the parentView if necessary.
256
+ if (cur) {
257
+ cur = (parentViewIsVisible === undefined) ?
258
+ ((parentView=this.get('parentView')) ?
259
+ parentView.get('isVisibleInWindow') : NO) : parentViewIsVisible ;
260
+ }
261
+
262
+ // if the state has changed, update it and notify children
263
+ if (last !== cur) {
264
+ this.set('isVisibleInWindow', cur) ;
265
+ this._needsVisibiltyChange = YES ; // update even if we aren't visible
266
+
267
+ var childViews = this.get('childViews'), len = childViews.length, idx;
268
+ for(idx=0;idx<len;idx++) {
269
+ childViews[idx].recomputeIsVisibleInWindow(cur);
270
+ }
271
+
272
+ // if we just became visible, update layer + layout if needed...
273
+ if (cur) {
274
+ if (this.parentViewDidResize) this.parentViewDidResize();
275
+
276
+ if (this.get('childViewsNeedLayout')) {
277
+ this.invokeOnce(this.layoutChildViewsIfNeeded);
278
+ }
279
+ }
280
+
281
+ this.set('layerNeedsUpdate', YES) ;
282
+
283
+ // if we were firstResponder, resign firstResponder also if no longer
284
+ // visible.
285
+ if (!cur && this.get('isFirstResponder')) this.resignFirstResponder();
286
+
287
+ }
288
+ return this ;
289
+ }.observes('isVisible'),
290
+
291
+ // ..........................................................
292
+ // CHILD VIEW SUPPORT
293
+ //
294
+
295
+ /**
296
+ Array of child views. You should never edit this array directly unless
297
+ you are implementing createChildViews(). Most of the time, you should
298
+ use the accessor methods such as appendChild(), insertBefore() and
299
+ removeChild().
300
+
301
+ @property {Array}
302
+ */
303
+ childViews: SC.EMPTY_CHILD_VIEWS_ARRAY,
304
+
305
+ /**
306
+ Insert the view into the the receiver's childNodes array.
307
+
308
+ The view will be added to the childNodes array before the beforeView. If
309
+ beforeView is null, then the view will be added to the end of the array.
310
+ This will also add the view's rootElement DOM node to the receivers
311
+ containerElement DOM node as a child.
312
+
313
+ If the specified view already belongs to another parent, it will be
314
+ removed from that view first.
315
+
316
+ @param {SC.View} view
317
+ @param {SC.View} beforeView
318
+ @returns {SC.View} the receiver
319
+ */
320
+ insertBefore: function(view, beforeView) {
321
+ view.beginPropertyChanges(); // limit notifications
322
+
323
+ // remove view from old parent if needed. Also notify views.
324
+ if (view.get('parentView')) view.removeFromParent() ;
325
+ if (this.willAddChild) this.willAddChild(view, beforeView) ;
326
+ if (view.willAddToParent) view.willAddToParent(this, beforeView) ;
327
+
328
+ // set parentView of child
329
+ view.set('parentView', this);
330
+
331
+ // add to childView's array.
332
+ var idx, childViews = this.get('childViews') ;
333
+ if (childViews.needsClone) this.set(childViews = []);
334
+ idx = (beforeView) ? childViews.indexOf(beforeView) : childViews.length;
335
+ if (idx<0) idx = childViews.length ;
336
+ childViews.insertAt(idx, view) ;
337
+
338
+ // The DOM will need some fixing up, note this on the view.
339
+ view.parentViewDidChange() ;
340
+ view.layoutDidChange() ;
341
+
342
+ // notify views
343
+ if (this.didAddChild) this.didAddChild(view, beforeView) ;
344
+ if (view.didAddToParent) view.didAddToParent(this, beforeView) ;
345
+
346
+ view.endPropertyChanges();
347
+
348
+ return this ;
349
+ },
350
+
351
+ /**
352
+ Removes the child view from the parent view.
353
+
354
+ @param {SC.View} view
355
+ @returns {SC.View} receiver
356
+ */
357
+ removeChild: function(view) {
358
+ if (!view) return this; // nothing to do
359
+ if (view.parentView !== this) {
360
+ throw "%@.removeChild(%@) must belong to parent".fmt(this,view);
361
+ }
362
+
363
+ // notify views
364
+ if (view.willRemoveFromParent) view.willRemoveFromParent() ;
365
+ if (this.willRemoveChild) this.willRemoveChild(view) ;
366
+
367
+ // update parent node
368
+ view.set('parentView', null) ;
369
+
370
+ // remove view from childViews array.
371
+ var childViews = this.get('childViews') ;
372
+ var idx = childViews.indexOf(view) ;
373
+ if (idx>=0) childViews.removeAt(idx);
374
+
375
+ // The DOM will need some fixing up, note this on the view.
376
+ view.parentViewDidChange() ;
377
+
378
+ // notify views
379
+ if (this.didRemoveChild) this.didRemoveChild(view);
380
+ if (view.didRemoveFromParent) view.didRemoveFromParent(this) ;
381
+
382
+ return this ;
383
+ },
384
+
385
+ /**
386
+ Removes all children from the parentView.
387
+
388
+ @returns {SC.View} receiver
389
+ */
390
+ removeAllChildren: function() {
391
+ var childViews = this.get('childViews'), view ;
392
+ while (view = childViews.objectAt(childViews.get('length')-1)) {
393
+ this.removeChild(view) ;
394
+ }
395
+ return this ;
396
+ },
397
+
398
+ /**
399
+ Removes the view from its parentView, if one is found. Otherwise
400
+ does nothing.
401
+
402
+ @returns {SC.View} receiver
403
+ */
404
+ removeFromParent: function() {
405
+ var parent = this.get('parentView') ;
406
+ if (parent) parent.removeChild(this) ;
407
+ return this ;
408
+ },
409
+
410
+ /**
411
+ Replace the oldView with the specified view in the receivers childNodes
412
+ array. This will also replace the DOM node of the oldView with the DOM
413
+ node of the new view in the receivers DOM.
414
+
415
+ If the specified view already belongs to another parent, it will be
416
+ removed from that view first.
417
+
418
+ @param view {SC.View} the view to insert in the DOM
419
+ @param view {SC.View} the view to remove from the DOM.
420
+ @returns {SC.View} the receiver
421
+ */
422
+ replaceChild: function(view, oldView) {
423
+ // suspend notifications
424
+ view.beginPropertyChanges();
425
+ oldView.beginPropertyChanges();
426
+ this.beginPropertyChanges();
427
+
428
+ this.insertBefore(view,oldView).removeChild(oldView) ;
429
+
430
+ // resume notifications
431
+ this.endPropertyChanges();
432
+ oldView.endPropertyChanges();
433
+ view.endPropertyChanges();
434
+
435
+ return this;
436
+ },
437
+
438
+ /**
439
+ Replaces the current array of child views with the new array of child
440
+ views.
441
+
442
+ @param {Array} views views you want to add
443
+ @returns {SC.View} receiver
444
+ */
445
+ replaceAllChildren: function(views) {
446
+ var len = views.get('length'), idx;
447
+
448
+ this.beginPropertyChanges();
449
+ this.destroyLayer().removeAllChildren();
450
+ for(idx=0;idx<len;idx++) this.appendChild(views.objectAt(idx));
451
+ this.replaceLayer();
452
+ this.endPropertyChanges();
453
+
454
+ return this ;
455
+ },
456
+
457
+ /**
458
+ Appends the specified view to the end of the receivers childViews array.
459
+ This is equivalent to calling insertBefore(view, null);
460
+
461
+ @param view {SC.View} the view to insert
462
+ @returns {SC.View} the receiver
463
+ */
464
+ appendChild: function(view) {
465
+ return this.insertBefore(view, null);
466
+ },
467
+
468
+ /**
469
+ This method is called whenever the receiver's parentView has changed.
470
+ The default implementation of this method marks the view's display
471
+ location as dirty so that it will update at the end of the run loop.
472
+
473
+ You will not usually need to override or call this method yourself, though
474
+ if you manually patch the parentView hierarchy for some reason, you should
475
+ call this method to notify the view that it's parentView has changed.
476
+
477
+ @returns {SC.View} receiver
478
+ */
479
+ parentViewDidChange: function() {
480
+ this.recomputeIsVisibleInWindow() ;
481
+
482
+ this.set('layerLocationNeedsUpdate', YES) ;
483
+ this.invokeOnce(this.updateLayerLocationIfNeeded) ;
484
+
485
+ return this ;
486
+ }.observes('isVisible'),
487
+
488
+ // ..........................................................
489
+ // LAYER SUPPORT
490
+ //
491
+
492
+ /**
493
+ Returns the current layer for the view. The layer for a view is only
494
+ generated when the view first becomes visible in the window and even
495
+ then it will not be computed until you request this layer property.
496
+
497
+ If the layer is not actually set on the view itself, then the layer will
498
+ be found by calling this.findLayerInParentLayer().
499
+
500
+ You can also set the layer by calling set on this property.
501
+
502
+ @property {DOMElement} the layer
503
+ */
504
+ layer: function(key, value) {
505
+ if (value !== undefined) {
506
+ this._view_layer = value ;
507
+
508
+ // no layer...attempt to discover it...
509
+ } else {
510
+ value = this._view_layer;
511
+ if (!value) {
512
+ var parent = this.get('parentView');
513
+ if (parent) parent = parent.get('layer');
514
+ if (parent) {
515
+ this._view_layer = value = this.findLayerInParentLayer(parent);
516
+ }
517
+ parent = null ; // avoid memory leak
518
+ }
519
+ }
520
+ return value ;
521
+ }.property('isVisibleInWindow').cacheable(),
522
+
523
+ /**
524
+ Get a CoreQuery object for this view's layer, or pass in a selector string
525
+ to get a CoreQuery object for a DOM node nested within this layer.
526
+
527
+ @param {String} sel a CoreQuery-compatible selector string
528
+ @returns {SC.CoreQuery} the CoreQuery object for the DOM node
529
+ */
530
+ $: function(sel) {
531
+ var ret, layer = this.get('layer') ;
532
+ // note: SC.$([]) returns an empty CoreQuery object. SC.$() would
533
+ // return an object selecting the document.
534
+ ret = !layer ? SC.$([]) : (sel === undefined) ? SC.$(layer) : SC.$(sel, layer) ;
535
+ layer = null ; // avoid memory leak
536
+ return ret ;
537
+ },
538
+
539
+ /**
540
+ Returns the DOM element that should be used to hold child views when they
541
+ are added/remove via DOM manipulation. The default implementation simply
542
+ returns the layer itself. You can override this to return a DOM element
543
+ within the layer.
544
+
545
+ @property {DOMElement} the container layer
546
+ */
547
+ containerLayer: function() {
548
+ return this.get('layer') ;
549
+ }.property('layer').cacheable(),
550
+
551
+ /**
552
+ The ID to use when trying to locate the layer in the DOM. If you do not
553
+ set the layerId explicitly, then the view's GUID will be used instead.
554
+ This ID must be set at the time the view is created.
555
+
556
+ @property {String}
557
+ @readOnly
558
+ */
559
+ layerId: function() {
560
+ return SC.guidFor(this) ;
561
+ }.property().cacheable(),
562
+
563
+ /**
564
+ Attempts to discover the layer in the parent layer. The default
565
+ implementation looks for an element with an ID of layerId (or the view's
566
+ guid if layerId is null). You can override this method to provide your
567
+ own form of lookup. For example, if you want to discover your layer using
568
+ a CSS class name instead of an ID.
569
+
570
+ @param {DOMElement} parentLayer the parent's DOM layer
571
+ @returns {DOMElement} the discovered layer
572
+ */
573
+ findLayerInParentLayer: function(parentLayer) {
574
+ var layerId = this.get('layerId') ;
575
+ var node, i, ilen,found, elem;
576
+
577
+ // first, let's try the fast path...
578
+ if(parentLayer.getElementById) elem = parentLayer.getElementById(layerId) ;
579
+ else elem = document.getElementById(layerId) ;
580
+
581
+ // TODO: use code generation to only really do this check on IE
582
+ if (SC.browser.msie && elem && elem.id !== layerId) elem = null ;
583
+
584
+ // if browser supports querySelector use that.
585
+ if (!elem && parentLayer.querySelector) {
586
+ // TODO: make querySelector work on all platforms...
587
+ // elem = parentLayer.querySelector('#' + layerId)[0];
588
+ }
589
+
590
+ // if no element was found the fast way, search down the parentLayer for
591
+ // the element. This code should not be invoked very often. Usually a
592
+ // DOM element will be discovered by the first method above.
593
+ // This code uses a BFS algorithm as is expected to find the layer right
594
+ // below the parent.
595
+ if (!elem) {
596
+ elem = parentLayer.firstChild ;
597
+ var q=[];
598
+ q.push(parentLayer);
599
+ while(q.length!==0){
600
+ node=q[0];
601
+ q.shift();
602
+ if(node.id==layerId){
603
+ found=true;
604
+ elem=node;
605
+ break;
606
+ }
607
+ for(i=0, ilen=node.childNodes.length; i<ilen; i++){
608
+ q.push(node.childNodes[i]);
609
+ }
610
+ }
611
+ if(!found) elem=null;
612
+ }
613
+
614
+ return elem;
615
+ },
616
+
617
+ /**
618
+ This method is invoked whenever a display property changes. It will set
619
+ the layerNeedsUpdate method to YES. If you need to perform additional
620
+ setup whenever the display changes, you can override this method as well.
621
+
622
+ @returns {SC.View} receiver
623
+ */
624
+ displayDidChange: function() {
625
+ this.set('layerNeedsUpdate', YES) ;
626
+ return this;
627
+ },
628
+
629
+ /**
630
+ Setting this property to YES will cause the updateLayerIfNeeded method to
631
+ be invoked at the end of the runloop. You can also force a view to update
632
+ sooner by calling updateLayerIfNeeded() directly. The method will update
633
+ the layer only if this property is YES.
634
+
635
+ @property {Boolean}
636
+ @test in updateLayer
637
+ */
638
+ layerNeedsUpdate: NO,
639
+
640
+ /** @private
641
+ Schedules the updateLayerIfNeeded method to run at the end of the runloop
642
+ if layerNeedsUpdate is set to YES.
643
+ */
644
+ _view_layerNeedsUpdateDidChange: function() {
645
+ if (this.get('layerNeedsUpdate')) {
646
+ this.invokeOnce(this.updateLayerIfNeeded) ;
647
+ }
648
+ }.observes('layerNeedsUpdate'),
649
+
650
+ /**
651
+ Updates the layer only if the view is visible onscreen and if
652
+ layerNeedsUpdate is set to YES. Normally you will not invoke this method
653
+ directly. Instead you set the layerNeedsUpdate property to YES and this
654
+ method will be called once at the end of the runloop.
655
+
656
+ If you need to update view's layer sooner than the end of the runloop, you
657
+ can call this method directly. If your view is not visible in the window
658
+ but you want it to update anyway, then call this method, passing YES for
659
+ the 'force' parameter.
660
+
661
+ You should not override this method. Instead override updateLayer() or
662
+ render().
663
+
664
+ @param {Boolean} isVisible if true assume view is visible even if it is not.
665
+ @returns {SC.View} receiver
666
+ @test in updateLayer
667
+ */
668
+ updateLayerIfNeeded: function() {
669
+ var viz = this.get('isVisibleInWindow') ;
670
+ if ((viz || this._needsVisibiltyChange) && this.get('layerNeedsUpdate')) {
671
+ this._needsVisibiltyChange = NO ;
672
+ // only update a layer if it already exists
673
+ if (this.get('layer')) {
674
+ this.beginPropertyChanges() ;
675
+ this.set('layerNeedsUpdate', NO) ;
676
+ this.updateLayer() ;
677
+ this.endPropertyChanges() ;
678
+ }
679
+ }
680
+ else this.set('layerNeedsUpdate', NO) ;
681
+ return this ;
682
+ },
683
+
684
+ /**
685
+ This is the core method invoked to update a view layer whenever it has
686
+ changed. This method simply creates a render context focused on the
687
+ layer element and then calls your render() method.
688
+
689
+ You will not usually call or override this method directly. Instead you
690
+ should set the layerNeedsUpdate property to YES to cause this method to
691
+ run at the end of the run loop, or you can call updateLayerIfNeeded()
692
+ to force the layer to update immediately.
693
+
694
+ Instead of overriding this method, consider overidding the render() method
695
+ instead, which is called both when creating and updating a layer. If you
696
+ do not want your render() method called when updating a layer, then you
697
+ should override this method instead.
698
+
699
+ @returns {SC.View} receiver
700
+ */
701
+ updateLayer: function() {
702
+ var context = this.renderContext(this.get('layer')) ;
703
+ this.prepareContext(context, NO) ;
704
+ context.update() ;
705
+ if (this.didUpdateLayer) this.didUpdateLayer(); // call to update DOM
706
+ return this ;
707
+ },
708
+
709
+ /**
710
+ Creates a new renderContext with the passed tagName or element. You
711
+ can override this method to provide further customization to the context
712
+ if needed. Normally you will not need to call or override this method.
713
+
714
+ @returns {SC.RenderContext}
715
+ */
716
+ renderContext: function(tagNameOrElement) {
717
+ return SC.RenderContext(tagNameOrElement) ;
718
+ },
719
+
720
+ /**
721
+ Creates the layer by creating a renderContext and invoking the view's
722
+ render() method. This will only create the layer if the layer does not
723
+ already exist.
724
+
725
+ When you create a layer, it is expected that your render() method will
726
+ also render the HTML for all child views as well. This method will
727
+ notify the view along with any of its childViews that its layer has been
728
+ created.
729
+
730
+ @returns {SC.View} receiver
731
+ */
732
+ createLayer: function() {
733
+ if (this.get('layer')) return this ; // nothing to do
734
+
735
+ var context = this.renderContext(this.get('tagName')) ;
736
+
737
+ // now prepare the content like normal.
738
+ this.prepareContext(context, YES) ;
739
+ this.set('layer', context.element()) ;
740
+
741
+ // now notify the view and its child views..
742
+ this._notifyDidCreateLayer() ;
743
+
744
+ return this ;
745
+ },
746
+
747
+ /** @private -
748
+ Invokes the receivers didCreateLayer() method if it exists and then
749
+ invokes the same on all child views.
750
+ */
751
+ _notifyDidCreateLayer: function() {
752
+ if (this.didCreateLayer) this.didCreateLayer() ;
753
+ var mixins = this.didCreateLayerMixin, len, idx ;
754
+ if (mixins) {
755
+ len = mixins.length ;
756
+ for (idx=0; idx<len; ++idx) mixins[idx].call(this) ;
757
+ }
758
+
759
+ var childViews = this.get('childViews') ;
760
+ len = childViews.length ;
761
+ for (idx=0; idx<len; ++idx) {
762
+ if (!childViews[idx]) continue;
763
+ childViews[idx]._notifyDidCreateLayer() ;
764
+ }
765
+ },
766
+
767
+ /**
768
+ Destroys any existing layer along with the layer for any child views as
769
+ well. If the view does not currently have a layer, then this method will
770
+ do nothing.
771
+
772
+ If you implement willDestroyLayer() on your view or if any mixins
773
+ implement willDestroLayerMixin(), then this method will be invoked on your
774
+ view before your layer is destroyed to give you a chance to clean up any
775
+ event handlers, etc.
776
+
777
+ If you write a willDestroyLayer() handler, you can assume that your
778
+ didCreateLayer() handler was called earlier for the same layer.
779
+
780
+ Normally you will not call or override this method yourself, but you may
781
+ want to implement the above callbacks when it is run.
782
+
783
+ @returns {SC.View} receiver
784
+ */
785
+ destroyLayer: function() {
786
+ var layer = this.get('layer') ;
787
+ if (layer) {
788
+ // Now notify the view and its child views. It will also set the
789
+ // layer property to null.
790
+ this._notifyWillDestroyLayer() ;
791
+
792
+ // do final cleanup
793
+ if (layer.parentNode) layer.parentNode.removeChild(layer) ;
794
+ layer = null ;
795
+ }
796
+ return this ;
797
+ },
798
+
799
+ /**
800
+ Destroys and recreates the current layer. This can be more efficient than
801
+ modifying individual child views.
802
+
803
+ @returns {SC.View} receiver
804
+ */
805
+ replaceLayer: function() {
806
+ this.destroyLayer();
807
+ this.set('layerLocationNeedsUpdate', YES) ;
808
+ this.invokeOnce(this.updateLayerLocationIfNeeded) ;
809
+ },
810
+
811
+ /** @private -
812
+ Invokes willDestroyLayer() on view and child views. Then sets layer to
813
+ null for receiver.
814
+ */
815
+ _notifyWillDestroyLayer: function() {
816
+ if (this.willDestroyLayer) this.willDestroyLayer() ;
817
+ var mixins = this.willDestroyLayerMixin, len, idx ;
818
+ if (mixins) {
819
+ len = mixins.length ;
820
+ for (idx=0; idx<len; ++idx) mixins[idx].call(this) ;
821
+ }
822
+
823
+ var childViews = this.get('childViews') ;
824
+ len = childViews.length ;
825
+ for (idx=0; idx<len; ++idx) childViews[idx]._notifyWillDestroyLayer() ;
826
+
827
+ this.set('layer', null) ;
828
+ },
829
+
830
+ /**
831
+ Invoked by createLayer() and updateLayer() to actually render a context.
832
+ This method calls the render() method on your view along with any
833
+ renderMixin() methods supplied by mixins you might have added.
834
+
835
+ You should not override this method directly. However, you might call
836
+ this method if you choose to override updateLayer() or createLayer().
837
+
838
+ @param {SC.RenderContext} context the render context
839
+ @param {Boolean} firstTime YES if this is creating a layer
840
+ @returns {void}
841
+ */
842
+ prepareContext: function(context, firstTime) {
843
+ var mixins, len, idx, layerId, bgcolor, cursor ;
844
+
845
+ // do some initial setup only needed at create time.
846
+ if (firstTime) {
847
+ // TODO: seems like things will break later if SC.guidFor(this) is used
848
+
849
+ layerId = this.layerId ? this.get('layerId') : SC.guidFor(this) ;
850
+ context.id(layerId).classNames(this.get('classNames'), YES) ;
851
+ this.renderLayout(context, firstTime) ;
852
+ }else{
853
+ context.resetClassNames();
854
+ context.classNames(this.get('classNames'), YES);
855
+ }
856
+
857
+ // do some standard setup...
858
+ if (this.get('isTextSelectable')) context.addClass('allow-select') ;
859
+ if (!this.get('isEnabled')) context.addClass('disabled') ;
860
+ if (!this.get('isVisible')) context.addClass('hidden') ;
861
+ if (this.get('isFirstResponder')) context.addClass('focus');
862
+
863
+ bgcolor = this.get('backgroundColor');
864
+ if (bgcolor) context.addStyle('backgroundColor', bgcolor);
865
+
866
+ cursor = this.get('cursor') ;
867
+ if (cursor) context.addClass(cursor.get('className')) ;
868
+
869
+ this.beginPropertyChanges() ;
870
+ this.set('layerNeedsUpdate', NO) ;
871
+ this.render(context, firstTime) ;
872
+ if (mixins = this.renderMixin) {
873
+ len = mixins.length;
874
+ for(idx=0; idx<len; ++idx) mixins[idx].call(this, context, firstTime) ;
875
+ }
876
+ this.endPropertyChanges() ;
877
+ },
878
+
879
+ /**
880
+ Your render method should invoke this method to render any child views,
881
+ especially if this is the first time the view will be rendered. This will
882
+ walk down the childView chain, rendering all of the children in a nested
883
+ way.
884
+
885
+ @param {SC.RenderContext} context the context
886
+ @param {Boolean} firstName true if the layer is being created
887
+ @returns {SC.RenderContext} the render context
888
+ @test in render
889
+ */
890
+ renderChildViews: function(context, firstTime) {
891
+ var cv = this.get('childViews'), len = cv.length, idx, view ;
892
+ for (idx=0; idx<len; ++idx) {
893
+ view = cv[idx] ;
894
+ if (!view) continue;
895
+ context = context.begin(view.get('tagName')) ;
896
+ view.prepareContext(context, firstTime) ;
897
+ context = context.end() ;
898
+ }
899
+ return context ;
900
+ },
901
+
902
+ /**
903
+ Invoked whenever your view needs to be rendered, including when the view's
904
+ layer is first created and any time in the future when it needs to be
905
+ updated.
906
+
907
+ You will normally override this method in your subclassed views to
908
+ provide whatever drawing functionality you will need in order to
909
+ render your content.
910
+
911
+ You can use the passed firstTime property to determine whether or not
912
+ you need to completely re-render the view or only update the surrounding
913
+ HTML.
914
+
915
+ The default implementation of this method simply calls renderChildViews()
916
+ if this is the first time you are rendering, or null otherwise.
917
+
918
+ @param {SC.RenderContext} context the render context
919
+ @param {Boolean} firstTime YES if this is creating a layer
920
+ @returns {void}
921
+ */
922
+ render: function(context, firstTime) {
923
+ if (firstTime) this.renderChildViews(context, firstTime) ;
924
+ },
925
+
926
+ // ..........................................................
927
+ // STANDARD RENDER PROPERTIES
928
+ //
929
+
930
+ /**
931
+ Tag name for the view's outer element. The tag name is only used when
932
+ a layer is first created. If you change the tagName for an element, you
933
+ must destroy and recreate the view layer.
934
+
935
+ @property {String}
936
+ */
937
+ tagName: 'div',
938
+
939
+ /**
940
+ Standard CSS class names to apply to the view's outer element. This
941
+ property automatically inherits any class names defined by the view's
942
+ superclasses as well.
943
+
944
+ @property {Array}
945
+ */
946
+ classNames: ['sc-view'],
947
+
948
+ /**
949
+ Tool tip property that will be set to the title attribute on the HTML
950
+ rendered element.
951
+
952
+ @property {String}
953
+ */
954
+ toolTip: null,
955
+
956
+ /**
957
+ Determines if the user can select text within the view. Normally this is
958
+ set to NO to disable text selection. You should set this to YES if you
959
+ are creating a view that includes editable text. Otherwise, settings this
960
+ to YES will probably make your controls harder to use and it is not
961
+ recommended.
962
+
963
+ @property {Boolean}
964
+ @readOnly
965
+ */
966
+ isTextSelectable: NO,
967
+
968
+ /**
969
+ You can set this array to include any properties that should immediately
970
+ invalidate the display. The display will be automatically invalidated
971
+ when one of these properties change.
972
+
973
+ @property {Array}
974
+ @readOnly
975
+ */
976
+ displayProperties: ['isFirstResponder', 'isVisible'],
977
+
978
+ /**
979
+ You can set this to an SC.Cursor instance; it's className will
980
+ automatically be added to the layer's classNames. The cursor is only used
981
+ when a layer is first created. If you change the cursor for an element,
982
+ you must destroy and recreate the view layer.
983
+
984
+ @property {SC.Cursor}
985
+ */
986
+ cursor: null,
987
+
988
+ // ..........................................................
989
+ // LAYER LOCATION
990
+ //
991
+
992
+ /**
993
+ Set to YES when the view's layer location is dirty. You can call
994
+ updateLayerLocationIfNeeded() to clear this flag if it is set.
995
+
996
+ @property {Boolean}
997
+ */
998
+ layerLocationNeedsUpdate: NO,
999
+
1000
+ /**
1001
+ Calls updateLayerLocation(), but only if the view's layer location
1002
+ currently needs to be updated. This method is called automatically at
1003
+ the end of a run loop if you have called parentViewDidChange() at some
1004
+ point.
1005
+
1006
+ @property {Boolean} force This property is ignored.
1007
+ @returns {SC.View} receiver
1008
+ @test in updateLayerLocation
1009
+ */
1010
+ updateLayerLocationIfNeeded: function(force) {
1011
+ if (this.get('layerLocationNeedsUpdate')) {
1012
+ this.set('layerLocationNeedsUpdate', NO) ;
1013
+ this.updateLayerLocation() ;
1014
+ }
1015
+ return this ;
1016
+ },
1017
+
1018
+ /**
1019
+ This method is called when a view changes its location in the view
1020
+ hierarchy. This method will update the underlying DOM-location of the
1021
+ layer so that it reflects the new location.
1022
+
1023
+ @returns {SC.View} receiver
1024
+ */
1025
+ updateLayerLocation: function() {
1026
+ // collect some useful value
1027
+ // if there is no node for some reason, just exit
1028
+ var node = this.get('layer') ;
1029
+ var parentView = this.get('parentView') ;
1030
+ var parentNode = parentView ? parentView.get('containerLayer') : null ;
1031
+
1032
+ // remove node from current parentNode if the node does not match the new
1033
+ // parent node.
1034
+ if (node && node.parentNode && node.parentNode !== parentNode) {
1035
+ node.parentNode.removeChild(node);
1036
+ }
1037
+
1038
+ // CASE 1: no new parentView. just remove from parent (above).
1039
+ if (!parentView) {
1040
+ if (node && node.parentNode) node.parentNode.removeChild(node);
1041
+
1042
+ // CASE 2: parentView has no layer, view has layer. destroy layer
1043
+ // CASE 3: parentView has no layer, view has no layer, nothing to do
1044
+ } else if (!parentNode) {
1045
+ if (node) {
1046
+ if (node.parentNode) node.parentNode.removeChild(node);
1047
+ this.destroyLayer();
1048
+ }
1049
+
1050
+ // CASE 4: parentView has layer, view has no layer. create layer & add
1051
+ // CASE 5: parentView has layer, view has layer. move layer
1052
+ } else {
1053
+ if (!node) {
1054
+ this.createLayer() ;
1055
+ node = this.get('layer') ;
1056
+ }
1057
+
1058
+ var siblings = parentView.get('childViews') ;
1059
+ var nextView = siblings.objectAt(siblings.indexOf(this)+1) ;
1060
+ var nextNode = (nextView) ? nextView.get('layer') : null ;
1061
+
1062
+ // before we add to parent node, make sure that the nextNode exists...
1063
+ if (nextView && (!nextNode || nextNode.parentNode!==parentNode)) {
1064
+ nextView.updateLayerLocationIfNeeded() ;
1065
+ nextNode = nextView.get('layer') ;
1066
+ }
1067
+
1068
+ // add to parentNode if needed. If we do add, then also notify view
1069
+ // that its parentView has resized since joining a parentView has the
1070
+ // same effect.
1071
+ if ((node.parentNode!==parentNode) || (node.nextSibling!==nextNode)) {
1072
+ parentNode.insertBefore(node, nextNode) ;
1073
+ if (this.parentViewDidResize) this.parentViewDidResize() ;
1074
+ }
1075
+ }
1076
+
1077
+ parentNode = parentView = node = null ; // avoid memory leaks
1078
+ return this ;
1079
+ },
1080
+
1081
+ // .......................................................
1082
+ // SC.RESPONDER SUPPORT
1083
+ //
1084
+
1085
+ /** @property
1086
+ The nextResponder is usually the parentView.
1087
+ */
1088
+ nextResponder: function() {
1089
+ return this.get('parentView') ;
1090
+ }.property('parentView').cacheable(),
1091
+
1092
+
1093
+ /** @property
1094
+ Set to YES if your view is willing to accept first responder status. This
1095
+ is used when calculcating key responder loop.
1096
+ */
1097
+ acceptsFirstResponder: NO,
1098
+
1099
+ // ..........................................................
1100
+ // KEY RESPONDER
1101
+ //
1102
+
1103
+ /** @property
1104
+ YES if the view is currently first responder and the pane the view belongs
1105
+ to is also key pane. While this property is set, you should expect to
1106
+ receive keyboard events.
1107
+ */
1108
+ isKeyResponder: NO,
1109
+
1110
+ /**
1111
+ This method is invoked just before you lost the key responder status. The passed view is the view that is about to gain keyResponder status. This gives you a chance to do any early setup.
1112
+
1113
+ Remember that you can gain/lose key responder status either because another view in the same pane is becoming first responder or because another pane is about to become key.
1114
+
1115
+ @param {SC.Responder} responder
1116
+ */
1117
+ willLoseKeyResponderTo: function(responder) {},
1118
+
1119
+ /**
1120
+ This method is invoked just before you become the key responder. The passed view is the view that is about to lose keyResponder status. You can use this to do any setup before the view changes.
1121
+
1122
+ Remember that you can gain/lose key responder status either because another view in the same pane is becoming first responder or because another pane is about to become key.
1123
+
1124
+ @param {SC.Responder} responder
1125
+ */
1126
+ willBecomeKeyResponderFrom: function(responder) {},
1127
+
1128
+ /**
1129
+ Invokved just after the responder loses key responder status.
1130
+ */
1131
+ didLoseKeyResponderTo: function(responder) {},
1132
+
1133
+ /**
1134
+ Invoked just after the responder gains key responder status.
1135
+ */
1136
+ didBecomeKeyResponderFrom: function(responder) {},
1137
+
1138
+ /**
1139
+ This method will process a key input event, attempting to convert it to an appropriate action method and sending it up the responder chain. The event is converted using the SC.KEY_BINDINGS hash, which maps key events into method names. If no key binding is found, then the key event will be passed along using an insertText() method.
1140
+
1141
+ @param {SC.Event} event
1142
+ @returns {Object} object that handled event, if any
1143
+ */
1144
+ interpretKeyEvents: function(event) {
1145
+ var codes = event.commandCodes(), cmd = codes[0], chr = codes[1];
1146
+
1147
+ if (!cmd && !chr) return null ; //nothing to do.
1148
+
1149
+ // if this is a command key, try to do something about it.
1150
+ if (cmd) {
1151
+ var methodName = SC.MODIFIED_KEY_BINDINGS[cmd] || SC.BASE_KEY_BINDINGS[cmd.match(/[^_]+$/)[0]];
1152
+ if (methodName) {
1153
+ var target = this, pane = this.get('pane'), handler = null;
1154
+ while(target && !(handler = target.tryToPerform(methodName, event))){
1155
+ target = (target===pane)? null: target.get('nextResponder') ;
1156
+ }
1157
+ return handler ;
1158
+ }
1159
+ }
1160
+
1161
+ if (chr && this.respondsTo('insertText')) {
1162
+ // if we haven't returned yet and there is plain text, then do an insert
1163
+ // of the text. Since this is not an action, do not send it up the
1164
+ // responder chain.
1165
+ return this.insertText(chr);
1166
+ }
1167
+
1168
+ return null ; //nothing to do.
1169
+ },
1170
+
1171
+ /**
1172
+ This method is invoked by interpretKeyEvents() when you receive a key event matching some plain text. You can use this to actually insert the text into your application, if needed.
1173
+
1174
+ @param {SC.Event} event
1175
+ @returns {Object} receiver or object that handled event
1176
+ */
1177
+ insertText: function(chr) {
1178
+ return this ;
1179
+ },
1180
+
1181
+ /**
1182
+ Recursively travels down the view hierarchy looking for a view that
1183
+ implements the key equivalent (returning to YES to indicate it handled
1184
+ the event). You can override this method to handle specific key
1185
+ equivalents yourself.
1186
+
1187
+ The keystring is a string description of the key combination pressed.
1188
+ The evt is the event itself. If you handle the equivalent, return YES.
1189
+ Otherwise, you should just return sc_super.
1190
+
1191
+ @param {String} keystring
1192
+ @param {SC.Event} evt
1193
+ @returns {Boolean}
1194
+ */
1195
+ performKeyEquivalent: function(keystring, evt) {
1196
+ var ret = NO,
1197
+ childViews = this.get('childViews'),
1198
+ len = childViews.length,
1199
+ idx = -1 ;
1200
+ while (!ret && (++idx < len)) {
1201
+ ret = childViews[idx].performKeyEquivalent(keystring, evt) ;
1202
+ }
1203
+ return ret ;
1204
+ },
1205
+
1206
+ /**
1207
+ Optionally points to the next key view that should gain focus when tabbing
1208
+ through an interface. If this is not set, then the next key view will
1209
+ be set automatically to the next child.
1210
+ */
1211
+ nextKeyView: null,
1212
+
1213
+ /**
1214
+ Computes the next valid key view, possibly returning the receiver or null.
1215
+ This is the next key view that acceptsFirstResponder.
1216
+
1217
+ @property
1218
+ @type SC.View
1219
+ */
1220
+ nextValidKeyView: function() {
1221
+ var seen = SC.CoreSet.create(),
1222
+ ret = this._computeNextValidKeyView(seen);
1223
+ seen.destroy();
1224
+ return ret ;
1225
+ }.property('nextKeyView'),
1226
+
1227
+ _computeNextValidKeyView: function(seen) {
1228
+ var ret = this.get('nextKeyView'),
1229
+ pv, cv, idx;
1230
+
1231
+ seen.add(this); // avoid cycles
1232
+
1233
+ // find next sibling
1234
+ if (!ret) {
1235
+ pv = this.get('parentView');
1236
+ cv = pv ? pv.get('childViews') : null;
1237
+ idx = cv ? cv.indexOf(this) : -1 ;
1238
+
1239
+ // get next child if possible
1240
+ if (idx<0) ret = null;
1241
+ else if (idx+1 >= cv.get('length')) ret = cv.objectAt(0);
1242
+ else ret = cv.objectAt(idx+1);
1243
+ }
1244
+
1245
+ // if next view does not accept responder then get nextValidKeyView...
1246
+ if (ret && !ret.get('acceptsFirstResponder')) {
1247
+ if (seen.contains(ret)) ret = null;
1248
+ else ret = ret._computeNextValidKeyView(seen);
1249
+ }
1250
+
1251
+ return ret ;
1252
+ },
1253
+
1254
+ /**
1255
+ Optionally points to the previous key view that should gain focus when
1256
+ tabbing through the interface. If this is not set then the previous
1257
+ key view will be set automatically to the previous child.
1258
+ */
1259
+ previousKeyView: null,
1260
+
1261
+ /**
1262
+ Computes the previous valid key view, possibly returning the receiver or
1263
+ null. This is the previous key view that acceptsFirstResponder.
1264
+
1265
+ @property
1266
+ @type SC.View
1267
+ */
1268
+ previousValidKeyView: function() {
1269
+ var seen = SC.CoreSet.create(),
1270
+ ret = this._computePreviousValidKeyView(seen);
1271
+ seen.destroy();
1272
+ return ret ;
1273
+ }.property('previousKeyView'),
1274
+
1275
+ _computePreviousValidKeyView: function(seen) {
1276
+ var ret = this.get('previousKeyView'),
1277
+ pv, cv, idx;
1278
+
1279
+ seen.add(this); // avoid cycles
1280
+
1281
+ // find previous sibling
1282
+ if (!ret) {
1283
+ pv = this.get('parentView');
1284
+ cv = pv ? pv.get('childViews') : null;
1285
+ idx = cv ? cv.indexOf(this) : -1 ;
1286
+
1287
+ // get next child if possible
1288
+ if (idx<0) ret = null;
1289
+ else if (idx > 0) ret = cv.objectAt(idx-1);
1290
+ else ret = cv.objectAt(cv.get('length')-1);
1291
+ }
1292
+
1293
+ // if next view does not accept responder then get nextValidKeyView...
1294
+ if (ret && !ret.get('acceptsFirstResponder')) {
1295
+ if (seen.contains(ret)) ret = null;
1296
+ else ret = ret._computePreviousValidKeyView(seen);
1297
+ }
1298
+
1299
+ return ret ;
1300
+ },
1301
+
1302
+ // .......................................................
1303
+ // CORE DISPLAY METHODS
1304
+ //
1305
+
1306
+ /** @private
1307
+ Setup a view, but do not finish waking it up.
1308
+ - configure childViews
1309
+ - generate DOM + plug in outlets/childViews unless rootElement is defined
1310
+ - register the view with the global views hash, which is used for mgmt
1311
+ */
1312
+ init: function() {
1313
+ var parentView, path, root, idx, len, lp, dp ;
1314
+
1315
+ sc_super() ;
1316
+
1317
+ // register for event handling now if we're not a materialized view
1318
+ // (materialized views register themselves as needed)
1319
+ if (!this.get('isMaterialized')) {
1320
+ SC.View.views[this.get('layerId')] = this ;
1321
+ }
1322
+
1323
+ // setup child views. be sure to clone the child views array first
1324
+ this.childViews = this.childViews ? this.childViews.slice() : [] ;
1325
+ this.createChildViews() ; // setup child Views
1326
+
1327
+ // register display property observers ..
1328
+ // TODO: Optimize into class setup
1329
+ dp = this.get('displayProperties') ;
1330
+ idx = dp.length ;
1331
+ while (--idx >= 0) {
1332
+ this.addObserver(dp[idx], this, this.displayDidChange) ;
1333
+ }
1334
+
1335
+ // register for drags
1336
+ if (this.get('isDropTarget')) SC.Drag.addDropTarget(this) ;
1337
+
1338
+ // register scroll views for autoscroll during drags
1339
+ if (this.get('isScrollable')) SC.Drag.addScrollableView(this) ;
1340
+ },
1341
+
1342
+ /**
1343
+ Wakes up the view. The default implementation immediately syncs any
1344
+ bindings, which may cause the view to need its display updated. You
1345
+ can override this method to perform any additional setup. Be sure to
1346
+ call sc_super to setup bindings and to call awake on childViews.
1347
+
1348
+ It is best to awake a view before you add it to the DOM. This way when
1349
+ the DOM is generated, it will have the correct initial values and will
1350
+ not require any additional setup.
1351
+
1352
+ @returns {void}
1353
+ */
1354
+ awake: function() {
1355
+ sc_super();
1356
+ var childViews = this.get('childViews'), len = childViews.length, idx ;
1357
+ for (idx=0; idx<len; ++idx) {
1358
+ if (!childViews[idx]) continue ;
1359
+ childViews[idx].awake() ;
1360
+ }
1361
+ },
1362
+
1363
+ /**
1364
+ You must call this method on a view to destroy the view (and all of its
1365
+ child views). This will remove the view from any parent node, then make
1366
+ sure that the DOM element managed by the view can be released by the
1367
+ memory manager.
1368
+ */
1369
+ destroy: function() {
1370
+ if (this.get('isDestroyed')) return this; // nothing to do
1371
+
1372
+ sc_super();
1373
+
1374
+ // remove from parent if found
1375
+ this.removeFromParent() ;
1376
+ this._destroy(); // core destroy method
1377
+
1378
+ // unregister for drags
1379
+ if (this.get('isDropTarget')) SC.Drag.removeDropTarget(this) ;
1380
+
1381
+ // unregister for autoscroll during drags
1382
+ if (this.get('isScrollable')) SC.Drag.removeScrollableView(this) ;
1383
+ return this; // done with cleanup
1384
+ },
1385
+
1386
+ _destroy: function() {
1387
+ if (this.get('isDestroyed')) return this ; // nothing to do
1388
+
1389
+ // destroy the layer -- this will avoid each child view destroying
1390
+ // the layer over and over again...
1391
+ this.destroyLayer() ;
1392
+
1393
+ // first destroy any children.
1394
+ var childViews = this.get('childViews'), len = childViews.length, idx ;
1395
+ if (len) {
1396
+ childViews = childViews.slice() ;
1397
+ for (idx=0; idx<len; ++idx) childViews[idx]._destroy() ;
1398
+ }
1399
+
1400
+ // next remove view from global hash
1401
+ delete SC.View.views[this.get('layerId')] ;
1402
+ delete this._CQ ;
1403
+ delete this.page ;
1404
+
1405
+ // mark as destroyed so we don't do this again
1406
+ this.set('isDestroyed', YES) ;
1407
+ return this ;
1408
+ },
1409
+
1410
+ /**
1411
+ This method is called when your view is first created to setup any child
1412
+ views that are already defined on your class. If any are found, it will
1413
+ instantiate them for you.
1414
+
1415
+ The default implementation of this method simply steps through your
1416
+ childViews array, which is expects to either be empty or to contain View
1417
+ designs that can be instantiated
1418
+
1419
+ Alternatively, you can implement this method yourself in your own
1420
+ subclasses to look for views defined on specific properties and then build
1421
+ a childViews array yourself.
1422
+
1423
+ Note that when you implement this method yourself, you should never
1424
+ instantiate views directly. Instead, you should use
1425
+ this.createChildView() method instead. This method can be much faster in
1426
+ a production environment than creating views yourself.
1427
+
1428
+ @returns {SC.View} receiver
1429
+ */
1430
+ createChildViews: function() {
1431
+ var childViews = this.get('childViews'),
1432
+ len = childViews.length,
1433
+ idx, key, views, view ;
1434
+
1435
+ this.beginPropertyChanges() ;
1436
+
1437
+ // swap the array
1438
+ for (idx=0; idx<len; ++idx) {
1439
+ if (key = (view = childViews[idx])) {
1440
+
1441
+ // is this is a key name, lookup view class
1442
+ if (typeof key === SC.T_STRING) {
1443
+ view = this[key];
1444
+ } else key = null ;
1445
+
1446
+ if (!view) {
1447
+ console.error ("No view with name "+key+" has been found in "+this.toString());
1448
+ // skip this one.
1449
+ continue;
1450
+ }
1451
+
1452
+ if (view.isClass) {
1453
+ view = this.createChildView(view) ; // instantiate if needed
1454
+ if (key) this[key] = view ; // save on key name if passed
1455
+ }
1456
+ }
1457
+ childViews[idx] = view;
1458
+ }
1459
+
1460
+ this.endPropertyChanges() ;
1461
+ return this ;
1462
+ },
1463
+
1464
+ /**
1465
+ Instantiates a view to be added to the childViews array during view
1466
+ initialization. You generally will not call this method directly unless
1467
+ you are overriding createChildViews(). Note that this method will
1468
+ automatically configure the correct settings on the new view instance to
1469
+ act as a child of the parent.
1470
+
1471
+ @param {Class} viewClass
1472
+ @param {Hash} attrs optional attributes to add
1473
+ @returns {SC.View} new instance
1474
+ @test in createChildViews
1475
+ */
1476
+ createChildView: function(view, attrs) {
1477
+ // attrs should always exist...
1478
+ if (!attrs) attrs = {} ;
1479
+ attrs.owner = attrs.parentView = this ;
1480
+ attrs.isVisibleInWindow = this.get('isVisibleInWindow');
1481
+ if (!attrs.page) attrs.page = this.page ;
1482
+
1483
+ // Now add this to the attributes and create.
1484
+ view = view.create(attrs) ;
1485
+ return view ;
1486
+ },
1487
+
1488
+ // ...........................................
1489
+ // LAYOUT
1490
+ //
1491
+
1492
+ /**
1493
+ This convenience method will take the current layout, apply any changes
1494
+ you pass and set it again. It is more convenient than having to do this
1495
+ yourself sometimes.
1496
+
1497
+ You can pass just a key/value pair or a hash with several pairs. You can
1498
+ also pass a null value to delete a property.
1499
+
1500
+ This method will avoid actually setting the layout if the value you pass
1501
+ does not edit the layout.
1502
+
1503
+ @param {String|Hash} key
1504
+ @param {Object} value
1505
+ @returns {SC.View} receiver
1506
+ */
1507
+ adjust: function(key, value) {
1508
+ var layout = SC.clone(this.get('layout')), didChange = NO, cur ;
1509
+
1510
+ if (key === undefined) return this ; // nothing to do.
1511
+
1512
+ // handle string case
1513
+ if (SC.typeOf(key) === SC.T_STRING) {
1514
+ cur = layout[key] ;
1515
+ if (SC.none(value)) {
1516
+ if (cur !== undefined) didChange = YES ;
1517
+ delete layout[key] ;
1518
+ } else {
1519
+ if (cur !== value) didChange = YES ;
1520
+ layout[key] = value ;
1521
+ }
1522
+
1523
+ // handle hash -- do it this way to avoid creating memory unless needed
1524
+ } else {
1525
+ var hash = key;
1526
+ for(key in hash) {
1527
+ if (!hash.hasOwnProperty(key)) continue;
1528
+ value = hash[key] ;
1529
+ cur = layout[key] ;
1530
+
1531
+ if (value === null) {
1532
+ if (cur !== undefined) didChange = YES ;
1533
+ delete layout[key] ;
1534
+ } else if (value !== undefined) {
1535
+ if (cur !== value) didChange = YES ;
1536
+ layout[key] = value ;
1537
+ }
1538
+ }
1539
+ }
1540
+
1541
+ // now set adjusted layout
1542
+ if (didChange) this.set('layout', layout) ;
1543
+
1544
+ return this ;
1545
+ },
1546
+
1547
+ /**
1548
+ The layout describes how you want your view to be positions on the
1549
+ screen. You can define the following properties:
1550
+
1551
+ - left: the left edge
1552
+ - top: the top edge
1553
+ - right: the right edge
1554
+ - bottom: the bottom edge
1555
+ - height: the height
1556
+ - width: the width
1557
+ - centerX: an offset from center X
1558
+ - centerY: an offset from center Y
1559
+ - minWidth: a minimum width
1560
+ - minHeight: a minimum height
1561
+ - maxWidth: a maximum width
1562
+ - maxHeight: a maximum height
1563
+
1564
+ Note that you can only use certain combinations to set layout. For
1565
+ example, you may set left/right or left/width, but not left/width/right,
1566
+ since that combination doesn't make sense.
1567
+
1568
+ Likewise, you may set a minWidth/minHeight, or maxWidth/maxHeight, but
1569
+ if you also set the width/height explicitly, then those constraints won't
1570
+ matter as much.
1571
+
1572
+ Layout is designed to maximize reliance on the browser's rendering
1573
+ engine to keep your app up to date.
1574
+
1575
+ @test in layoutStyle
1576
+ */
1577
+ layout: { top: 0, left: 0, bottom: 0, right: 0 },
1578
+
1579
+ /**
1580
+ Converts a frame from the receiver's offset to the target offset. Both
1581
+ the receiver and the target must belong to the same pane. If you pass
1582
+ null, the conversion will be to the pane level.
1583
+
1584
+ Note that the context of a view's frame is the view's parent frame. In
1585
+ other words, if you want to convert the frame of your view to the global
1586
+ frame, then you should do:
1587
+
1588
+ {{{
1589
+ var pv = this.get('parentView'), frame = this.get('frame');
1590
+ var newFrame = pv ? pv.convertFrameToView(frame, null) : frame;
1591
+ }}}
1592
+
1593
+ @param {Rect} frame the source frame
1594
+ @param {SC.View} targetView the target view to convert to
1595
+ @returns {Rect} converted frame
1596
+ @test in converFrames
1597
+ */
1598
+ convertFrameToView: function(frame, targetView) {
1599
+ var myX=0, myY=0, targetX=0, targetY=0, view = this, f ;
1600
+
1601
+ // walk up this side
1602
+ while (view) {
1603
+ f = view.get('frame'); myX += f.x; myY += f.y ;
1604
+ view = view.get('layoutView') ;
1605
+ }
1606
+
1607
+ // walk up other size
1608
+ if (targetView) {
1609
+ view = targetView ;
1610
+ while (view) {
1611
+ f = view.get('frame'); targetX += f.x; targetY += f.y ;
1612
+ view = view.get('layoutView') ;
1613
+ }
1614
+ }
1615
+
1616
+ // now we can figure how to translate the origin.
1617
+ myX = frame.x + myX - targetX ;
1618
+ myY = frame.y + myY - targetY ;
1619
+ return { x: myX, y: myY, width: frame.width, height: frame.height } ;
1620
+ },
1621
+
1622
+ /**
1623
+ Converts a frame offset in the coordinates of another view system to the
1624
+ reciever's view.
1625
+
1626
+ Note that the convext of a view's frame is relative to the view's
1627
+ parentFrame. For example, if you want to convert the frame of view that
1628
+ belongs to another view to the receiver's frame you would do:
1629
+
1630
+ {{{
1631
+ var frame = view.get('frame');
1632
+ var newFrame = this.convertFrameFromView(frame, view.get('parentView'));
1633
+ }}}
1634
+
1635
+ @param {Rect} frame the source frame
1636
+ @param {SC.View} targetView the target view to convert to
1637
+ @returns {Rect} converted frame
1638
+ @test in converFrames
1639
+ */
1640
+ convertFrameFromView: function(frame, targetView) {
1641
+ var myX=0, myY=0, targetX=0, targetY=0, view = this, next, f ;
1642
+
1643
+ // walk up this side
1644
+ while (view) {
1645
+ f = view.get('frame'); myX += f.x; myY += f.y ;
1646
+ view = view.get('parentView') ;
1647
+ }
1648
+
1649
+ // walk up other size
1650
+ if (targetView) {
1651
+ view = targetView ;
1652
+ while(view) {
1653
+ f = view.get('frame'); targetX += f.x; targetY += f.y ;
1654
+ view = view.get('parentView') ;
1655
+ }
1656
+ }
1657
+
1658
+ // now we can figure how to translate the origin.
1659
+ myX = frame.x - myX + targetX ;
1660
+ myY = frame.y - myY + targetY ;
1661
+ return { x: myX, y: myY, width: frame.width, height: frame.height } ;
1662
+ },
1663
+
1664
+ /**
1665
+ Frame describes the current bounding rect for your view. This is always
1666
+ measured from the top-left corner of the parent view.
1667
+
1668
+ @property {Rect}
1669
+ @test in layoutStyle
1670
+ */
1671
+ frame: function() {
1672
+ return this.computeFrameWithParentFrame(null) ;
1673
+ }.property('layout').cacheable(),
1674
+
1675
+ /**
1676
+ Computes what the frame of this view would be if the parent were resized
1677
+ to the passed dimensions. You can use this method to project the size of
1678
+ a frame based on the resize behavior of the parent.
1679
+
1680
+ This method is used especially by the scroll view to automatically
1681
+ calculate when scrollviews should be visible.
1682
+
1683
+ Passing null for the parent dimensions will use the actual current
1684
+ parent dimensions. This is the same method used to calculate the current
1685
+ frame when it changes.
1686
+
1687
+ @param {Rect} pdim the projected parent dimensions
1688
+ @returns {Rect} the computed frame
1689
+ */
1690
+ computeFrameWithParentFrame: function(pdim) {
1691
+ var layout = this.get('layout') ;
1692
+ var f = {} , error, layer, AUTO = SC.LAYOUT_AUTO;
1693
+ var stLayout = this.get('useStaticLayout') ;
1694
+
1695
+ if (layout.width !== undefined &&
1696
+ layout.width === SC.LAYOUT_AUTO &&
1697
+ stLayout !== undefined && !stLayout) {
1698
+ error = SC.Error.desc("%@.layout() you cannot use width:auto if staticLayout is disabled".fmt(this),"%@".fmt(this), -1) ;
1699
+ console.error(error.toString()) ;
1700
+ throw error ;
1701
+ }
1702
+
1703
+ if (layout.height !== undefined &&
1704
+ layout.height === SC.LAYOUT_AUTO &&
1705
+ stLayout !== undefined && !stLayout) {
1706
+ error = SC.Error.desc("%@.layout() you cannot use height:auto if staticLayout is disabled".fmt(this),"%@".fmt(this), -1) ;
1707
+ console.error(error.toString()) ;
1708
+ throw error ;
1709
+ }
1710
+
1711
+ // handle left aligned and left/right
1712
+ if (!SC.none(layout.left)) {
1713
+ f.x = Math.floor(layout.left) ;
1714
+ if (layout.width !== undefined) {
1715
+ if(layout.width === AUTO) f.width = AUTO ;
1716
+ else f.width = Math.floor(layout.width) ;
1717
+ } else { // better have layout.right!
1718
+ if (!pdim) pdim = this.computeParentDimensions(layout) ;
1719
+ f.width = Math.floor(pdim.width - f.x - (layout.right || 0)) ;
1720
+ }
1721
+
1722
+ // handle right aligned
1723
+ } else if (!SC.none(layout.right)) {
1724
+ if (!pdim) pdim = this.computeParentDimensions(layout) ;
1725
+ if (SC.none(layout.width)) {
1726
+ f.width = pdim.width - layout.right ;
1727
+ f.x = 0 ;
1728
+ } else {
1729
+ if(layout.width === AUTO) f.width = AUTO ;
1730
+ else f.width = Math.floor(layout.width || 0) ;
1731
+ f.x = Math.floor(pdim.width - layout.right - f.width) ;
1732
+ }
1733
+
1734
+ // handle centered
1735
+ } else if (!SC.none(layout.centerX)) {
1736
+ if (!pdim) pdim = this.computeParentDimensions(layout) ;
1737
+ if(layout.width === AUTO) f.width = AUTO ;
1738
+ else f.width = Math.floor(layout.width || 0) ;
1739
+ f.x = Math.floor((pdim.width - f.width)/2 + layout.centerX) ;
1740
+ } else {
1741
+ f.x = 0 ; // fallback
1742
+ if (SC.none(layout.width)) {
1743
+ if (!pdim) pdim = this.computeParentDimensions(layout) ;
1744
+ f.width = Math.floor(pdim.width) ;
1745
+ } else {
1746
+ if(layout.width === AUTO) f.width = AUTO ;
1747
+ else f.width = Math.floor(layout.width || 0) ;
1748
+ }
1749
+ }
1750
+
1751
+ // handle top aligned and top/bottom
1752
+ if (!SC.none(layout.top)) {
1753
+ f.y = Math.floor(layout.top) ;
1754
+ if (layout.height !== undefined) {
1755
+ if(layout.height === AUTO) f.height = AUTO ;
1756
+ else f.height = Math.floor(layout.height) ;
1757
+ } else { // better have layout.bottm!
1758
+ if (!pdim) pdim = this.computeParentDimensions(layout) ;
1759
+ f.height = Math.floor(pdim.height - f.y - (layout.bottom || 0)) ;
1760
+ }
1761
+
1762
+ // handle bottom aligned
1763
+ } else if (!SC.none(layout.bottom)) {
1764
+ if (!pdim) pdim = this.computeParentDimensions(layout) ;
1765
+ if (SC.none(layout.height)) {
1766
+ f.height = pdim.height - layout.bottom ;
1767
+ f.y = 0 ;
1768
+ } else {
1769
+ if(layout.height === AUTO) f.height = AUTO ;
1770
+ else f.height = Math.floor(layout.height || 0) ;
1771
+ f.y = Math.floor(pdim.height - layout.bottom - f.height) ;
1772
+ }
1773
+
1774
+ // handle centered
1775
+ } else if (!SC.none(layout.centerY)) {
1776
+ if (!pdim) pdim = this.computeParentDimensions(layout) ;
1777
+ if(layout.height === AUTO) f.height = AUTO ;
1778
+ else f.height = Math.floor(layout.height || 0) ;
1779
+ f.y = Math.floor((pdim.height - f.height)/2 + layout.centerY) ;
1780
+
1781
+ // fallback
1782
+ } else {
1783
+ f.y = 0 ; // fallback
1784
+ if (SC.none(layout.height)) {
1785
+ if (!pdim) pdim = this.computeParentDimensions(layout) ;
1786
+ f.height = Math.floor(pdim.height) ;
1787
+ } else {
1788
+ if(layout.height === AUTO) f.height = AUTO ;
1789
+ else f.height = Math.floor(layout.height || 0) ;
1790
+ }
1791
+ }
1792
+
1793
+ // if width or height were set to auto and we have a layer, try lookup
1794
+ if (f.height === AUTO || f.width === AUTO) {
1795
+ layer = this.get('layer');
1796
+ if (f.height === AUTO) f.height = layer ? layer.clientHeight : 0;
1797
+ if (f.width === AUTO) f.width = layer ? layer.clientWidth : 0;
1798
+ }
1799
+
1800
+ // make sure the width/height fix min/max...
1801
+ if (!SC.none(layout.maxHeight) && (f.height > layout.maxHeight)) {
1802
+ f.height = layout.maxHeight ;
1803
+ }
1804
+
1805
+ if (!SC.none(layout.minHeight) && (f.height < layout.minHeight)) {
1806
+ f.height = layout.minHeight ;
1807
+ }
1808
+
1809
+ if (!SC.none(layout.maxWidth) && (f.width > layout.maxWidth)) {
1810
+ f.width = layout.maxWidth ;
1811
+ }
1812
+
1813
+ if (!SC.none(layout.minWidth) && (f.width < layout.minWidth)) {
1814
+ f.width = layout.minWidth ;
1815
+ }
1816
+
1817
+ // make sure width/height are never < 0
1818
+ if (f.height < 0) f.height = 0 ;
1819
+ if (f.width < 0) f.width = 0 ;
1820
+
1821
+ return f;
1822
+ },
1823
+
1824
+ computeParentDimensions: function(frame) {
1825
+ var ret, pv = this.get('parentView'), pf = (pv) ? pv.get('frame') : null ;
1826
+
1827
+ if (pf) {
1828
+ ret = { width: pf.width, height: pf.height };
1829
+ } else {
1830
+ var f = frame ;
1831
+ ret = {
1832
+ width: (f.left || 0) + (f.width || 0) + (f.right || 0),
1833
+ height: (f.top || 0) + (f.height || 0) + (f.bottom || 0)
1834
+ };
1835
+ }
1836
+ return ret ;
1837
+ },
1838
+
1839
+ /**
1840
+ The clipping frame returns the visible portion of the view, taking into
1841
+ account the clippingFrame of the parent view. Keep in mind that the
1842
+ clippingFrame is in the context of the view itself, not it's parent view.
1843
+
1844
+ Normally this will be calculate based on the intersection of your own
1845
+ clippingFrame and your parentView's clippingFrame.
1846
+
1847
+ @property {Rect}
1848
+ */
1849
+ clippingFrame: function() {
1850
+ var pv= this.get('parentView'), f = this.get('frame'), ret = f ;
1851
+ if (pv) {
1852
+ pv = pv.get('clippingFrame') ;
1853
+ ret = SC.intersectRects(pv, f) ;
1854
+ }
1855
+ ret.x -= f.x ;
1856
+ ret.y -= f.y ;
1857
+ return ret ;
1858
+ }.property('parentView', 'frame').cacheable(),
1859
+
1860
+ /** @private
1861
+ Whenever the clippingFrame changes, this observer will fire, notifying
1862
+ child views that their frames have also changed.
1863
+ */
1864
+ _sc_view_clippingFrameDidChange: function() {
1865
+ var cvs = this.get('childViews'), len = cvs.length, idx, cv ;
1866
+ for (idx=0; idx<len; ++idx) {
1867
+ cv = cvs[idx] ;
1868
+ if (!cv.hasStaticLayout) cv.notifyPropertyChange('clippingFrame') ;
1869
+ }
1870
+ }.observes('clippingFrame'),
1871
+
1872
+ /**
1873
+ This method may be called on your view whenever the parent view resizes.
1874
+
1875
+ The default version of this method will reset the frame and then call
1876
+ viewDidResize(). You will not usually override this method, but you may
1877
+ override the viewDidResize() method.
1878
+
1879
+ @returns {void}
1880
+ @test in viewDidResize
1881
+ */
1882
+ parentViewDidResize: function() {
1883
+ var layout = this.get('layout') ;
1884
+
1885
+ // only resizes if the layout does something other than left/top - fixed
1886
+ // size.
1887
+ var isFixed = (
1888
+ (layout.left !== undefined) && (layout.top !== undefined) &&
1889
+ (layout.width !== undefined) && (layout.height !== undefined)
1890
+ );
1891
+
1892
+ if (!isFixed) {
1893
+ this.notifyPropertyChange('frame') ;
1894
+ this.viewDidResize() ;
1895
+ }
1896
+ },
1897
+
1898
+ /**
1899
+ This method is invoked on your view when the view resizes due to a layout
1900
+ change or due to the parent view resizing. You can override this method
1901
+ to implement your own layout if you like, such as performing a grid
1902
+ layout.
1903
+
1904
+ The default implementation simply calls parentViewDidResize on all of
1905
+ your children.
1906
+
1907
+ @returns {void}
1908
+ */
1909
+ viewDidResize: function() {
1910
+ var cv = this.childViews, len = cv.length, idx, view ;
1911
+ for (idx=0; idx<len; ++idx) {
1912
+ view = cv[idx] ;
1913
+ if (view.parentViewDidResize) view.parentViewDidResize() ;
1914
+ }
1915
+ }.observes('layout'),
1916
+
1917
+ // Implementation note: As a general rule, paired method calls, such as
1918
+ // beginLiveResize/endLiveResize that are called recursively on the tree
1919
+ // should reverse the order when doing the final half of the call. This
1920
+ // ensures that the calls are propertly nested for any cleanup routines.
1921
+ //
1922
+ // -> View A.beginXXX()
1923
+ // -> View B.beginXXX()
1924
+ // -> View C.begitXXX()
1925
+ // -> View D.beginXXX()
1926
+ //
1927
+ // ...later on, endXXX methods are called in reverse order of beginXXX...
1928
+ //
1929
+ // <- View D.endXXX()
1930
+ // <- View C.endXXX()
1931
+ // <- View B.endXXX()
1932
+ // <- View A.endXXX()
1933
+ //
1934
+ // See the two methods below for an example implementation.
1935
+
1936
+ /**
1937
+ Call this method when you plan to begin a live resize. This will
1938
+ notify the receiver view and any of its children that are interested
1939
+ that the resize is about to begin.
1940
+
1941
+ @returns {SC.View} receiver
1942
+ @test in viewDidResize
1943
+ */
1944
+ beginLiveResize: function() {
1945
+ // call before children have been notified...
1946
+ if (this.willBeginLiveResize) this.willBeginLiveResize() ;
1947
+
1948
+ // notify children in order
1949
+ var ary = this.get('childViews'), len = ary.length, idx, view ;
1950
+ for (idx=0; idx<len; ++idx) {
1951
+ view = ary[idx] ;
1952
+ if (view.beginLiveResize) view.beginLiveResize();
1953
+ }
1954
+ return this ;
1955
+ },
1956
+
1957
+ /**
1958
+ Call this method when you are finished with a live resize. This will
1959
+ notify the receiver view and any of its children that are interested
1960
+ that the live resize has ended.
1961
+
1962
+ @returns {SC.View} receiver
1963
+ @test in viewDidResize
1964
+ */
1965
+ endLiveResize: function() {
1966
+ // notify children in *reverse* order
1967
+ var ary = this.get('childViews'), len = ary.length, idx, view ;
1968
+ for (idx=len-1; idx>=0; --idx) { // loop backwards
1969
+ view = ary[idx] ;
1970
+ if (view.endLiveResize) view.endLiveResize() ;
1971
+ }
1972
+
1973
+ // call *after* all children have been notified...
1974
+ if (this.didEndLiveResize) this.didEndLiveResize() ;
1975
+ return this ;
1976
+ },
1977
+
1978
+ /**
1979
+ layoutStyle describes the current styles to be written to your element
1980
+ based on the layout you defined. Both layoutStyle and frame reset when
1981
+ you edit the layout property. Both are read only.
1982
+
1983
+ Computes the layout style settings needed for the current anchor.
1984
+
1985
+ @property {Hash}
1986
+ @readOnly
1987
+ */
1988
+ layoutStyle: function() {
1989
+ var layout = this.get('layout'), ret = {}, pdim = null, error, AUTO = SC.LAYOUT_AUTO;
1990
+ var stLayout = this.get('useStaticLayout');
1991
+
1992
+ if (layout.width !== undefined &&
1993
+ layout.width === SC.LAYOUT_AUTO &&
1994
+ !stLayout) {
1995
+ error= SC.Error.desc("%@.layout() you cannot use width:auto if staticLayout is disabled".fmt(this),"%@".fmt(this),-1);
1996
+ console.error(error.toString()) ;
1997
+ throw error ;
1998
+ }
1999
+
2000
+ if (layout.height !== undefined &&
2001
+ layout.height === SC.LAYOUT_AUTO &&
2002
+ !stLayout) {
2003
+ error = SC.Error.desc("%@.layout() you cannot use height:auto if staticLayout is disabled".fmt(this),"%@".fmt(this),-1);
2004
+ console.error(error.toString()) ;
2005
+ throw error ;
2006
+ }
2007
+
2008
+ // X DIRECTION
2009
+
2010
+ // handle left aligned and left/right
2011
+ if (!SC.none(layout.left)) {
2012
+ ret.left = Math.floor(layout.left);
2013
+ if (layout.width !== undefined) {
2014
+ if(layout.width === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
2015
+ else ret.width = Math.floor(layout.width) ;
2016
+ ret.right = null ;
2017
+ } else {
2018
+ ret.width = null ;
2019
+ ret.right = Math.floor(layout.right || 0) ;
2020
+ }
2021
+ ret.marginLeft = 0 ;
2022
+
2023
+ // handle right aligned
2024
+ } else if (!SC.none(layout.right)) {
2025
+ ret.right = Math.floor(layout.right) ;
2026
+ ret.marginLeft = 0 ;
2027
+
2028
+ if (SC.none(layout.width)) {
2029
+ ret.left = 0;
2030
+ ret.width = null;
2031
+ } else {
2032
+ ret.left = null ;
2033
+ if(layout.width === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
2034
+ else ret.width = Math.floor(layout.width || 0) ;
2035
+ }
2036
+
2037
+ // handle centered
2038
+ } else if (!SC.none(layout.centerX)) {
2039
+ ret.left = "50%";
2040
+ ret.width = Math.floor(layout.width || 0) ;
2041
+ ret.marginLeft = Math.floor(layout.centerX - ret.width/2) ;
2042
+ ret.right = null ;
2043
+
2044
+ // if width defined, assume top/left of zero
2045
+ } else if (!SC.none(layout.width)) {
2046
+ ret.left = 0;
2047
+ ret.right = null;
2048
+ if(layout.width === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
2049
+ else ret.width = Math.floor(layout.width);
2050
+ ret.marginLeft = 0;
2051
+
2052
+ // fallback, full width.
2053
+ } else {
2054
+ ret.left = 0;
2055
+ ret.right = 0;
2056
+ ret.width = null ;
2057
+ ret.marginLeft= 0;
2058
+ }
2059
+
2060
+
2061
+ // handle min/max
2062
+ ret.minWidth = (layout.minWidth === undefined) ? null : layout.minWidth ;
2063
+ ret.maxWidth = (layout.maxWidth === undefined) ? null : layout.maxWidth ;
2064
+
2065
+ // Y DIRECTION
2066
+
2067
+ // handle left aligned and left/right
2068
+ if (!SC.none(layout.top)) {
2069
+ ret.top = Math.floor(layout.top);
2070
+ if (layout.height !== undefined) {
2071
+ if(layout.height === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
2072
+ else ret.height = Math.floor(layout.height) ;
2073
+ ret.bottom = null ;
2074
+ } else {
2075
+ ret.height = null ;
2076
+ ret.bottom = Math.floor(layout.bottom || 0) ;
2077
+ }
2078
+ ret.marginTop = 0 ;
2079
+
2080
+ // handle right aligned
2081
+ } else if (!SC.none(layout.bottom)) {
2082
+ ret.marginTop = 0 ;
2083
+ ret.bottom = Math.floor(layout.bottom) ;
2084
+ if (SC.none(layout.height)) {
2085
+ ret.top = 0;
2086
+ ret.height = null ;
2087
+ } else {
2088
+ ret.top = null ;
2089
+ if(layout.height === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
2090
+ else ret.height = Math.floor(layout.height || 0) ;
2091
+ }
2092
+
2093
+ // handle centered
2094
+ } else if (!SC.none(layout.centerY)) {
2095
+ ret.top = "50%";
2096
+ ret.height = Math.floor(layout.height || 0) ;
2097
+ ret.marginTop = Math.floor(layout.centerY - ret.height/2) ;
2098
+ ret.bottom = null ;
2099
+
2100
+ } else if (!SC.none(layout.height)) {
2101
+ ret.top = 0;
2102
+ ret.bottom = null;
2103
+ if(layout.height === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
2104
+ else ret.height = Math.floor(layout.height || 0) ;
2105
+ ret.marginTop = 0;
2106
+
2107
+ // fallback, full width.
2108
+ } else {
2109
+ ret.top = 0;
2110
+ ret.bottom = 0;
2111
+ ret.height = null ;
2112
+ ret.marginTop= 0;
2113
+ }
2114
+
2115
+ // handle min/max
2116
+ ret.minHeight = (layout.minHeight === undefined) ?
2117
+ null :
2118
+ layout.minHeight ;
2119
+ ret.maxHeight = (layout.maxHeight === undefined) ?
2120
+ null :
2121
+ layout.maxHeight ;
2122
+
2123
+ // if zIndex is set, use it. otherwise let default shine through
2124
+ ret.zIndex = SC.none(layout.zIndex) ? null : layout.zIndex.toString();
2125
+
2126
+ // if backgroundPosition is set, use it.
2127
+ // otherwise let default shine through
2128
+ ret.backgroundPosition = SC.none(layout.backgroundPosition) ?
2129
+ null :
2130
+ layout.backgroundPosition.toString() ;
2131
+
2132
+ // set default values to null to allow built-in CSS to shine through
2133
+ // currently applies only to marginLeft & marginTop
2134
+ var dims = SC._VIEW_DEFAULT_DIMS, loc = dims.length, x;
2135
+ while(--loc >=0) {
2136
+ x = dims[loc];
2137
+ if (ret[x]===0) ret[x]=null;
2138
+ }
2139
+
2140
+ // convert any numbers into a number + "px".
2141
+ for(var key in ret) {
2142
+ var value = ret[key];
2143
+ if (typeof value === SC.T_NUMBER) ret[key] = (value + "px");
2144
+ }
2145
+ return ret ;
2146
+ }.property().cacheable(),
2147
+
2148
+ /**
2149
+ The view responsible for laying out this view. The default version
2150
+ returns the current parent view.
2151
+ */
2152
+ layoutView: function() {
2153
+ return this.get('parentView') ;
2154
+ }.property('parentView').cacheable(),
2155
+
2156
+ /**
2157
+ This method is called whenever a property changes that invalidates the
2158
+ layout of the view. Changing the layout will do this automatically, but
2159
+ you can add others if you want.
2160
+
2161
+ @returns {SC.View} receiver
2162
+ */
2163
+ layoutDidChange: function() {
2164
+ this.beginPropertyChanges() ;
2165
+ if (this.frame) this.notifyPropertyChange('frame') ;
2166
+ this.notifyPropertyChange('layoutStyle') ;
2167
+ this.endPropertyChanges() ;
2168
+
2169
+ // notify layoutView...
2170
+ var layoutView = this.get('layoutView');
2171
+ if (layoutView) {
2172
+ layoutView.set('childViewsNeedLayout', YES);
2173
+ layoutView.layoutDidChangeFor(this) ;
2174
+ if (layoutView.get('childViewsNeedLayout')) {
2175
+ layoutView.invokeOnce(layoutView.layoutChildViewsIfNeeded);
2176
+ }
2177
+ }
2178
+
2179
+ return this ;
2180
+ }.observes('layout'),
2181
+
2182
+ /**
2183
+ This this property to YES whenever the view needs to layout its child
2184
+ views. Normally this property is set automatically whenever the layout
2185
+ property for a child view changes.
2186
+
2187
+ @property {Boolean}
2188
+ */
2189
+ childViewsNeedLayout: NO,
2190
+
2191
+ /**
2192
+ One of two methods that are invoked whenever one of your childViews
2193
+ layout changes. This method is invoked everytime a child view's layout
2194
+ changes to give you a chance to record the information about the view.
2195
+
2196
+ Since this method may be called many times during a single run loop, you
2197
+ should keep this method pretty short. The other method called when layout
2198
+ changes, layoutChildViews(), is invoked only once at the end of
2199
+ the run loop. You should do any expensive operations (including changing
2200
+ a childView's actual layer) in this other method.
2201
+
2202
+ Note that if as a result of running this method you decide that you do not
2203
+ need your layoutChildViews() method run later, you can set the
2204
+ childViewsNeedsLayout property to NO from this method and the layout
2205
+ method will not be called layer.
2206
+
2207
+ @param {SC.View} childView the view whose layout has changed.
2208
+ @returns {void}
2209
+ */
2210
+ layoutDidChangeFor: function(childView) {
2211
+ var set = this._needLayoutViews ;
2212
+ if (!set) set = this._needLayoutViews = SC.CoreSet.create();
2213
+ set.add(childView);
2214
+ },
2215
+
2216
+ /**
2217
+ Called your layout method if the view currently needs to layout some
2218
+ child views.
2219
+
2220
+ @param {Boolean} isVisible if true assume view is visible even if it is not.
2221
+ @returns {SC.View} receiver
2222
+ @test in layoutChildViews
2223
+ */
2224
+ layoutChildViewsIfNeeded: function(isVisible) {
2225
+ if (!isVisible) isVisible = this.get('isVisibleInWindow');
2226
+ if (isVisible && this.get('childViewsNeedLayout')) {
2227
+ this.set('childViewsNeedLayout', NO);
2228
+ this.layoutChildViews();
2229
+ }
2230
+ return this ;
2231
+ },
2232
+
2233
+ /**
2234
+ Applies the current layout to the layer. This method is usually only
2235
+ called once per runloop. You can override this method to provide your
2236
+ own layout updating method if you want, though usually the better option
2237
+ is to override the layout method from the parent view.
2238
+
2239
+ The default implementation of this method simply calls the renderLayout()
2240
+ method on the views that need layout.
2241
+
2242
+ @returns {void}
2243
+ */
2244
+ layoutChildViews: function() {
2245
+ var set = this._needLayoutViews, len = set ? set.length : 0, idx;
2246
+ var view, context, layer;
2247
+ for(idx=0;idx<len;idx++) {
2248
+ view = set[idx];
2249
+ view.updateLayout();
2250
+ }
2251
+ view = context = layer = null ; // cleanup
2252
+ set.clear(); // reset & reuse
2253
+ },
2254
+
2255
+ /**
2256
+ Invoked by the layoutChildViews method to update the layout on a
2257
+ particular view. This method creates a render context and calls the
2258
+ renderLayout() method, which is probably what you want to override instead
2259
+ of this.
2260
+
2261
+ You will not usually override this method, but you may call it if you
2262
+ implement layoutChildViews() in a view yourself.
2263
+
2264
+ @returns {SC.View} receiver
2265
+ @test in layoutChildViews
2266
+ */
2267
+ updateLayout: function() {
2268
+ var layer = this.get('layer'), context;
2269
+ if (layer) {
2270
+ context = this.renderContext(layer);
2271
+ this.renderLayout(context);
2272
+ context.update();
2273
+ }
2274
+ layer = null ;
2275
+ return this ;
2276
+ },
2277
+
2278
+ /**
2279
+ Default method called by the layout view to actually apply the current
2280
+ layout to the layer. The default implementation simply assigns the
2281
+ current layoutStyle to the layer. This method is also called whenever
2282
+ the layer is first created.
2283
+
2284
+ @param {SC.RenderContext} the render context
2285
+ @returns {void}
2286
+ @test in layoutChildViews
2287
+ */
2288
+ renderLayout: function(context, firstTime) {
2289
+ context.addStyle(this.get('layoutStyle'));
2290
+ },
2291
+
2292
+ /** walk like a duck */
2293
+ isView: YES,
2294
+
2295
+ /**
2296
+ Default method called when a selectstart event is triggered. This event is
2297
+ only supported by IE. Used in sproutcore to disable text selection and
2298
+ IE8 accelerators. The accelerators will be enabled only in
2299
+ text selectable views. In FF and Safari we use the css style 'allow-select'.
2300
+
2301
+ If you want to enable text selection in certain controls is recommended
2302
+ to override this function to always return YES , instead of setting
2303
+ isTextSelectable to true.
2304
+
2305
+ For example in textfield you dont want to enable textSelection on the text
2306
+ hint only on the actual text you are entering. You can achieve that by
2307
+ only overriding this method.
2308
+
2309
+ @param evt {SC.Event} the selectstart event
2310
+ @returns YES if selectable
2311
+ */
2312
+ selectStart: function(evt) {
2313
+ return this.get('isTextSelectable');
2314
+ }
2315
+
2316
+ });
2317
+
2318
+ SC.View.mixin(/** @scope SC.View */ {
2319
+
2320
+ /** @private walk like a duck -- used by SC.Page */
2321
+ isViewClass: YES,
2322
+
2323
+ /**
2324
+ This method works just like extend() except that it will also preserve
2325
+ the passed attributes in case you want to use a view builder later, if
2326
+ needed.
2327
+
2328
+ @param {Hash} attrs Attributes to add to view
2329
+ @returns {Class} SC.View subclass to create
2330
+ @function
2331
+ */
2332
+ design: function() {
2333
+ if (this.isDesign) return this; // only run design one time
2334
+ var ret = this.extend.apply(this, arguments);
2335
+ ret.isDesign = YES ;
2336
+ if (SC.ViewDesigner) {
2337
+ SC.ViewDesigner.didLoadDesign(ret, this, SC.A(arguments));
2338
+ }
2339
+ return ret ;
2340
+ },
2341
+
2342
+ /**
2343
+ Helper applies the layout to the prototype.
2344
+ */
2345
+ layout: function(layout) {
2346
+ this.prototype.layout = layout ;
2347
+ return this ;
2348
+ },
2349
+
2350
+ /**
2351
+ Helper applies the classNames to the prototype
2352
+ */
2353
+ classNames: function(sc) {
2354
+ sc = (this.prototype.classNames || []).concat(sc);
2355
+ this.prototype.classNames = sc;
2356
+ return this ;
2357
+ },
2358
+
2359
+ /**
2360
+ Help applies the tagName
2361
+ */
2362
+ tagName: function(tg) {
2363
+ this.prototype.tagName = tg;
2364
+ return this ;
2365
+ },
2366
+
2367
+ /**
2368
+ Helper adds the childView
2369
+ */
2370
+ childView: function(cv) {
2371
+ var childViews = this.prototype.childViews || [];
2372
+ if (childViews === this.superclass.prototype.childViews) {
2373
+ childViews = childViews.slice();
2374
+ }
2375
+ childViews.push(cv) ;
2376
+ this.prototype.childViews = childViews;
2377
+ return this ;
2378
+ },
2379
+
2380
+ /**
2381
+ Helper adds a binding to a design
2382
+ */
2383
+ bind: function(keyName, path) {
2384
+ var p = this.prototype, s = this.superclass.prototype;
2385
+ var bindings = p._bindings ;
2386
+ if (!bindings || bindings === s._bindings) {
2387
+ bindings = p._bindings = (bindings || []).slice() ;
2388
+ }
2389
+
2390
+ keyName = keyName + "Binding";
2391
+ p[keyName] = path ;
2392
+ bindings.push(keyName);
2393
+
2394
+ return this ;
2395
+ },
2396
+
2397
+ /**
2398
+ Helper sets a generic property on a design.
2399
+ */
2400
+ prop: function(keyName, value) {
2401
+ this.prototype[keyName] = value;
2402
+ return this ;
2403
+ },
2404
+
2405
+ /**
2406
+ Used to construct a localization for a view. The default implementation
2407
+ will simply return the passed attributes.
2408
+ */
2409
+ localization: function(attrs, rootElement) {
2410
+ // add rootElement
2411
+ if (rootElement) attrs.rootElement = SC.$(rootElement).get(0);
2412
+ return attrs;
2413
+ },
2414
+
2415
+ /**
2416
+ Creates a view instance, first finding the DOM element you name and then
2417
+ using that as the root element. You should not use this method very
2418
+ often, but it is sometimes useful if you want to attach to already
2419
+ existing HTML.
2420
+
2421
+ @param {String|Element} element
2422
+ @param {Hash} attrs
2423
+ @returns {SC.View} instance
2424
+ */
2425
+ viewFor: function(element, attrs) {
2426
+ var args = SC.$A(arguments); // prepare to edit
2427
+ if (SC.none(element)) {
2428
+ args.shift(); // remove if no element passed
2429
+ } else args[0] = { rootElement: SC.$(element).get(0) } ;
2430
+ var ret = this.create.apply(this, arguments) ;
2431
+ args = args[0] = null;
2432
+ return ret ;
2433
+ },
2434
+
2435
+ /**
2436
+ Create a new view with the passed attributes hash. If you have the
2437
+ Designer module loaded, this will also create a peer designer if needed.
2438
+ */
2439
+ create: function() {
2440
+ var C=this, ret = new C(arguments);
2441
+ if (SC.ViewDesigner) {
2442
+ SC.ViewDesigner.didCreateView(ret, SC.$A(arguments));
2443
+ }
2444
+ return ret ;
2445
+ },
2446
+
2447
+ /**
2448
+ Applies the passed localization hash to the component views. Call this
2449
+ method before you call create(). Returns the receiver. Typically you
2450
+ will do something like this:
2451
+
2452
+ view = SC.View.design({...}).loc(localizationHash).create();
2453
+
2454
+ @param {Hash} loc
2455
+ @param rootElement {String} optional rootElement with prepped HTML
2456
+ @returns {SC.View} receiver
2457
+ */
2458
+ loc: function(loc) {
2459
+ var childLocs = loc.childViews;
2460
+ delete loc.childViews; // clear out child views before applying to attrs
2461
+
2462
+ this.applyLocalizedAttributes(loc) ;
2463
+ if (SC.ViewDesigner) {
2464
+ SC.ViewDesigner.didLoadLocalization(this, SC.$A(arguments));
2465
+ }
2466
+
2467
+ // apply localization recursively to childViews
2468
+ var childViews = this.prototype.childViews, idx = childViews.length;
2469
+ while(--idx>=0) {
2470
+ var viewClass = childViews[idx];
2471
+ loc = childLocs[idx];
2472
+ if (loc && viewClass && viewClass.loc) viewClass.loc(loc) ;
2473
+ }
2474
+
2475
+ return this; // done!
2476
+ },
2477
+
2478
+ /**
2479
+ Internal method actually updates the localizated attributes on the view
2480
+ class. This is overloaded in design mode to also save the attributes.
2481
+ */
2482
+ applyLocalizedAttributes: function(loc) {
2483
+ SC.mixin(this.prototype, loc) ;
2484
+ },
2485
+
2486
+ views: {}
2487
+
2488
+ }) ;
2489
+
2490
+ // .......................................................
2491
+ // OUTLET BUILDER
2492
+ //
2493
+
2494
+ /**
2495
+ Generates a computed property that will look up the passed property path
2496
+ the first time you try to get the value. Use this whenever you want to
2497
+ define an outlet that points to another view or object. The root object
2498
+ used for the path will be the receiver.
2499
+ */
2500
+ SC.outlet = function(path) {
2501
+ return function(key) {
2502
+ return (this[key] = SC.objectForPropertyPath(path, this)) ;
2503
+ }.property();
2504
+ };
2505
+
2506
+ /** @private on unload clear cached divs. */
2507
+ SC.View.unload = function() {
2508
+
2509
+ // delete view items this way to ensure the views are cleared. The hash
2510
+ // itself may be owned by multiple view subclasses.
2511
+ var views = SC.View.views;
2512
+ if (views) {
2513
+ for(var key in views) {
2514
+ if (!views.hasOwnProperty(key)) continue ;
2515
+ delete views[key];
2516
+ }
2517
+ }
2518
+
2519
+ } ;
2520
+
2521
+ SC.Event.add(window, 'unload', SC.View, SC.View.unload) ;