sproutit-sproutcore 1.0.203 → 1.0.20090721145236

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