luca 0.9.8 → 0.9.9

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 (310) hide show
  1. data/CHANGELOG +49 -0
  2. data/Gemfile +8 -1
  3. data/Gemfile.lock +97 -53
  4. data/Guardfile +3 -25
  5. data/README.md +5 -16
  6. data/ROADMAP +15 -9
  7. data/Rakefile +24 -75
  8. data/app.rb +10 -42
  9. data/app/assets/javascripts/luca/basic.coffee +1 -1
  10. data/app/assets/javascripts/luca/components/application.coffee +187 -104
  11. data/app/assets/javascripts/luca/components/collection_view.coffee +115 -51
  12. data/app/assets/javascripts/luca/components/controller.coffee +87 -10
  13. data/app/assets/javascripts/luca/components/fields/base.coffee +74 -13
  14. data/app/assets/javascripts/luca/components/fields/button_field.coffee +60 -13
  15. data/app/assets/javascripts/luca/components/fields/checkbox_array.coffee +12 -7
  16. data/app/assets/javascripts/luca/components/fields/select_field.coffee +82 -23
  17. data/app/assets/javascripts/luca/components/fields/text_area_field.coffee +25 -10
  18. data/app/assets/javascripts/luca/components/fields/text_field.coffee +9 -3
  19. data/app/assets/javascripts/luca/components/form_view.coffee +105 -33
  20. data/app/assets/javascripts/luca/components/grid_layout_view.coffee +42 -0
  21. data/app/assets/javascripts/luca/components/index.coffee +6 -0
  22. data/app/assets/javascripts/luca/components/nav_bar.coffee +60 -6
  23. data/app/assets/javascripts/luca/components/page.coffee +70 -0
  24. data/app/assets/javascripts/luca/components/simple_collection_view.coffee +10 -0
  25. data/app/assets/javascripts/luca/components/table_view.coffee +7 -3
  26. data/app/assets/javascripts/luca/components/table_view_scrollable.coffee +23 -0
  27. data/app/assets/javascripts/luca/concerns/collection_event_bindings.coffee +4 -1
  28. data/app/assets/javascripts/luca/concerns/development_tool_helpers.coffee +23 -14
  29. data/app/assets/javascripts/luca/concerns/dom_helpers.coffee +2 -2
  30. data/app/assets/javascripts/luca/concerns/filterable.coffee +8 -11
  31. data/app/assets/javascripts/luca/concerns/form_model_bindings.coffee +20 -0
  32. data/app/assets/javascripts/luca/concerns/modal_view.coffee +40 -15
  33. data/app/assets/javascripts/luca/concerns/query_collection_bindings.coffee +7 -1
  34. data/app/assets/javascripts/luca/concerns/state_model.coffee +40 -26
  35. data/app/assets/javascripts/luca/concerns/templating.coffee +3 -1
  36. data/app/assets/javascripts/luca/config.coffee +5 -0
  37. data/app/assets/javascripts/luca/containers/card_view.coffee +87 -52
  38. data/app/assets/javascripts/luca/containers/container.coffee +305 -108
  39. data/app/assets/javascripts/luca/containers/modal_view.coffee +9 -9
  40. data/app/assets/javascripts/luca/containers/page_controller.coffee +25 -0
  41. data/app/assets/javascripts/luca/containers/panel_toolbar.coffee +5 -6
  42. data/app/assets/javascripts/luca/containers/tab_view.coffee +19 -10
  43. data/app/assets/javascripts/luca/containers/viewport.coffee +12 -16
  44. data/app/assets/javascripts/luca/core/collection.coffee +19 -5
  45. data/app/assets/javascripts/luca/core/events.coffee +5 -5
  46. data/app/assets/javascripts/luca/core/model.coffee +1 -1
  47. data/app/assets/javascripts/luca/core/panel.coffee +18 -6
  48. data/app/assets/javascripts/luca/core/registry/component_definition.coffee +2 -1
  49. data/app/assets/javascripts/luca/core/registry/meta_data.coffee +2 -0
  50. data/app/assets/javascripts/luca/core/registry/registry.coffee +14 -11
  51. data/app/assets/javascripts/luca/core/templates.coffee +5 -1
  52. data/app/assets/javascripts/luca/core/view.coffee +200 -47
  53. data/app/assets/javascripts/luca/dependencies.coffee +2 -0
  54. data/app/assets/javascripts/luca/development/code_sync_manager.coffee +173 -0
  55. data/app/assets/javascripts/luca/development/component.coffee +76 -0
  56. data/app/assets/javascripts/luca/development/components.coffee +57 -0
  57. data/app/assets/javascripts/luca/development/console.coffee +1 -1
  58. data/app/assets/javascripts/luca/development/index.coffee +4 -1
  59. data/app/assets/javascripts/luca/framework.coffee +7 -3
  60. data/app/assets/javascripts/luca/index.coffee +2 -1
  61. data/app/assets/javascripts/luca/managers/collection_manager.coffee +2 -3
  62. data/app/assets/javascripts/luca/managers/index.coffee +1 -1
  63. data/app/assets/javascripts/luca/managers/socket_manager.coffee +31 -8
  64. data/app/assets/javascripts/luca/templates/components/nav_bar.jst.ejs +16 -1
  65. data/app/assets/javascripts/luca/templates/containers/tab_view.jst.ejs +1 -1
  66. data/app/assets/javascripts/luca/util/index.coffee +1 -0
  67. data/app/assets/javascripts/luca/util/keybindings.coffee +24 -0
  68. data/app/assets/javascripts/luca/util/logging.coffee +15 -0
  69. data/app/assets/javascripts/luca/util/luca.coffee +9 -1
  70. data/app/assets/stylesheets/luca/components/table_view.scss +85 -0
  71. data/app/assets/stylesheets/luca/components/viewport.scss +0 -4
  72. data/app/assets/stylesheets/luca/containers/container.scss +8 -0
  73. data/app/assets/stylesheets/luca/index.css +2 -2
  74. data/bin/luca +14 -0
  75. data/config.ru +1 -2
  76. data/docs/framework.json +1 -0
  77. data/docs/luca-framework-documentation.js +1 -0
  78. data/docs/{application.md → old/application.md} +0 -0
  79. data/docs/{collection.md → old/collection.md} +0 -0
  80. data/docs/{collection_manager.md → old/collection_manager.md} +0 -0
  81. data/docs/{container_philosophy.md → old/container_philosophy.md} +0 -0
  82. data/docs/{event_binding_helpers.md → old/event_binding_helpers.md} +0 -0
  83. data/docs/{method_caching_and_computed_properties.md → old/method_caching_and_computed_properties.md} +0 -0
  84. data/docs/{view.md → old/view.md} +0 -0
  85. data/lib/generators/luca/application/templates/javascripts/dependencies.coffee +2 -5
  86. data/lib/guard/luca.rb +84 -0
  87. data/lib/luca.rb +25 -1
  88. data/lib/luca/asset_compiler.rb +117 -0
  89. data/lib/luca/cli.rb +68 -0
  90. data/lib/luca/cli/generate.rb +37 -0
  91. data/lib/luca/cli/server.rb +20 -0
  92. data/lib/luca/cli/sync.rb +40 -0
  93. data/lib/luca/cli/watch.rb +16 -0
  94. data/lib/luca/collection.rb +64 -0
  95. data/lib/luca/collection/endpoint.rb +38 -0
  96. data/lib/luca/collection/file_backend.rb +121 -0
  97. data/lib/luca/collection/redis_backend.rb +153 -0
  98. data/lib/luca/compiled_asset.rb +61 -0
  99. data/lib/luca/component_definition.rb +356 -0
  100. data/lib/luca/luca_application.rb +258 -0
  101. data/lib/luca/project.rb +73 -0
  102. data/lib/luca/project_harness.rb +96 -0
  103. data/lib/luca/rails.rb +5 -3
  104. data/lib/luca/rails/engine.rb +8 -0
  105. data/lib/luca/rails/version.rb +1 -2
  106. data/lib/luca/server.rb +7 -0
  107. data/lib/luca/stylesheet.rb +35 -0
  108. data/lib/luca/template.rb +2 -0
  109. data/lib/luca/template_asset.rb +64 -0
  110. data/lib/luca/version.rb +3 -0
  111. data/lib/luca/watcher.rb +72 -0
  112. data/lib/railties/luca/tasks.rake +7 -0
  113. data/site/.bundle/config +2 -0
  114. data/site/.gitignore +5 -0
  115. data/site/.rvmrc +1 -0
  116. data/site/CHANGELOG.md +41 -0
  117. data/site/DOCS.md +41 -0
  118. data/site/Gemfile +8 -0
  119. data/site/Gemfile.lock +134 -0
  120. data/site/LICENSE.md +19 -0
  121. data/site/config.rb +84 -0
  122. data/site/helpers/site_helpers.rb +20 -0
  123. data/site/html5bp-docs/README.md +38 -0
  124. data/site/html5bp-docs/contribute.md +104 -0
  125. data/site/html5bp-docs/crossdomain.md +21 -0
  126. data/site/html5bp-docs/css.md +135 -0
  127. data/site/html5bp-docs/extend.md +507 -0
  128. data/site/html5bp-docs/faq.md +77 -0
  129. data/site/html5bp-docs/htaccess.md +323 -0
  130. data/site/html5bp-docs/html.md +170 -0
  131. data/site/html5bp-docs/js.md +31 -0
  132. data/site/html5bp-docs/misc.md +25 -0
  133. data/site/html5bp-docs/usage.md +109 -0
  134. data/site/readme.md +47 -0
  135. data/site/source/.htaccess +540 -0
  136. data/site/source/404.html +157 -0
  137. data/site/source/app/assets/javascripts/dependencies.js.coffee +6 -0
  138. data/site/source/app/assets/javascripts/docs-docs.js +1 -0
  139. data/site/source/app/assets/javascripts/docs/application.coffee +64 -0
  140. data/site/source/app/assets/javascripts/docs/collections/docs_documentation.coffee +17 -0
  141. data/site/source/app/assets/javascripts/docs/collections/github_repositories.coffee +7 -0
  142. data/site/source/app/assets/javascripts/docs/collections/index.coffee +1 -0
  143. data/site/source/app/assets/javascripts/docs/collections/luca_documentation.coffee +17 -0
  144. data/site/source/app/assets/javascripts/docs/collections/public_gists.coffee +4 -0
  145. data/site/source/app/assets/javascripts/docs/config.coffee +5 -0
  146. data/site/source/app/assets/javascripts/docs/index.coffee +12 -0
  147. data/site/source/app/assets/javascripts/docs/lib/router.coffee +3 -0
  148. data/{spec/components/application_spec.coffee → site/source/app/assets/javascripts/docs/lib/util.coffee} +0 -0
  149. data/site/source/app/assets/javascripts/docs/models/component.coffee +99 -0
  150. data/site/source/app/assets/javascripts/docs/models/github_repository.coffee +3 -0
  151. data/site/source/app/assets/javascripts/docs/models/index.coffee +1 -0
  152. data/site/source/app/assets/javascripts/docs/templates/component_documentation.jst.ejs +55 -0
  153. data/site/source/app/assets/javascripts/docs/templates/examples_browser/overview.jst.ejs +4 -0
  154. data/site/source/app/assets/javascripts/docs/templates/examples_browser/selector.jst.ejs +11 -0
  155. data/site/source/app/assets/javascripts/docs/templates/github_repository.jst.ejs +4 -0
  156. data/site/source/app/assets/javascripts/docs/templates/layouts/main.jst.ejs +4 -0
  157. data/site/source/app/assets/javascripts/docs/templates/left_navigation.jst.ejs +5 -0
  158. data/site/source/app/assets/javascripts/docs/templates/pages/getting_started.jst.ejs +78 -0
  159. data/site/source/app/assets/javascripts/docs/templates/pages/home.jst.ejs +57 -0
  160. data/site/source/app/assets/javascripts/docs/views/components/code_editor.coffee +45 -0
  161. data/{spec/components/collection_loader_view_spec.coffee → site/source/app/assets/javascripts/docs/views/components/code_editor/index.coffee} +0 -0
  162. data/site/source/app/assets/javascripts/docs/views/components/component_documentation.coffee +72 -0
  163. data/site/source/app/assets/javascripts/docs/views/index.coffee +3 -0
  164. data/site/source/app/assets/javascripts/docs/views/pages/browse_source.coffee +46 -0
  165. data/site/source/app/assets/javascripts/docs/views/pages/browse_source/details.coffee +37 -0
  166. data/site/source/app/assets/javascripts/docs/views/pages/browse_source/list.coffee +31 -0
  167. data/site/source/app/assets/javascripts/docs/views/pages/component_editor.coffee +10 -0
  168. data/site/source/app/assets/javascripts/docs/views/pages/examples_browser.coffee +102 -0
  169. data/site/source/app/assets/javascripts/docs/views/pages/examples_browser/docs.coffee +12 -0
  170. data/site/source/app/assets/javascripts/docs/views/pages/examples_browser/source.coffee +13 -0
  171. data/site/source/app/assets/javascripts/docs/views/pages/home.coffee +10 -0
  172. data/site/source/app/assets/javascripts/docs/views/views/api_browser/index.coffee +43 -0
  173. data/site/source/app/assets/javascripts/docs/views/views/collection_view_examples/grid_layout_view_example.coffee +14 -0
  174. data/site/source/app/assets/javascripts/docs/views/views/collection_view_examples/table_view_example.coffee +39 -0
  175. data/site/source/app/assets/javascripts/docs/views/views/form_view_examples/basic_example.coffee +38 -0
  176. data/site/source/app/assets/javascripts/docs/views/views/form_view_examples/complex_layout.coffee +110 -0
  177. data/site/source/app/assets/javascripts/docs/views/views/top_navigation.coffee +6 -0
  178. data/site/source/app/assets/javascripts/luca-docs.js +1 -0
  179. data/site/source/app/assets/javascripts/luca-framework-documentation.js +1 -0
  180. data/site/source/app/assets/javascripts/site.js.coffee +4 -0
  181. data/site/source/app/assets/javascripts/vendor/codemirror.js +4786 -0
  182. data/site/source/app/assets/javascripts/vendor/coffeescript.js +346 -0
  183. data/site/source/app/assets/javascripts/vendor/css.js +465 -0
  184. data/site/source/app/assets/javascripts/vendor/htmlmixed.js +84 -0
  185. data/site/source/app/assets/javascripts/vendor/javascript.js +422 -0
  186. data/site/source/app/assets/javascripts/vendor/js-beautify.js +1353 -0
  187. data/site/source/app/assets/javascripts/vendor/modernizr-2.6.1.min.js +4 -0
  188. data/site/source/app/assets/javascripts/vendor/vim.js +2511 -0
  189. data/site/source/app/assets/stylesheets/docs/api-browser.css.scss +5 -0
  190. data/site/source/app/assets/stylesheets/docs/application.css.scss +35 -0
  191. data/site/source/app/assets/stylesheets/docs/browse-source.css.scss +5 -0
  192. data/site/source/app/assets/stylesheets/docs/scrollable-table.css.scss +5 -0
  193. data/site/source/app/assets/stylesheets/site.css.scss +2 -0
  194. data/site/source/app/assets/stylesheets/vendor/codemirror.css +240 -0
  195. data/site/source/app/assets/stylesheets/vendor/prettify-tomorrow-night-bright.css +160 -0
  196. data/site/source/app/assets/stylesheets/vendor/twilight.css +26 -0
  197. data/site/source/crossdomain.xml +15 -0
  198. data/site/source/documentation.html.haml +1 -0
  199. data/site/source/favicon_base.png +0 -0
  200. data/site/source/humans.txt +15 -0
  201. data/site/source/images/background.png +0 -0
  202. data/site/source/images/middleman.png +0 -0
  203. data/site/source/index.html.haml +1 -0
  204. data/site/source/layouts/layout.haml +55 -0
  205. data/site/source/readme.md +63 -0
  206. data/site/source/robots.txt +3 -0
  207. data/spec/{components/grid_view_spec.coffee → javascripts/components/application_spec.coffee} +0 -0
  208. data/spec/{components/pagination_control_spec.coffee → javascripts/components/collection_loader_view_spec.coffee} +0 -0
  209. data/spec/{components → javascripts/components}/collection_view_spec.coffee +1 -1
  210. data/spec/{components → javascripts/components}/controller_spec.coffee +0 -0
  211. data/spec/{components → javascripts/components}/fields/checkbox_array_spec.coffee +0 -0
  212. data/spec/javascripts/components/form_view_spec.coffee +162 -0
  213. data/spec/{components/record_manager_spec.coffee → javascripts/components/grid_view_spec.coffee} +0 -0
  214. data/spec/{components → javascripts/components}/multi_collection_view_spec.coffee +0 -0
  215. data/spec/{components/template_spec.coffee → javascripts/components/pagination_control_spec.coffee} +0 -0
  216. data/spec/{concerns/paginatable_spec.coffee → javascripts/components/record_manager_spec.coffee} +0 -0
  217. data/spec/{components → javascripts/components}/table_view_spec.coffee +0 -0
  218. data/spec/{containers/modal_view_spec.coffee → javascripts/components/template_spec.coffee} +0 -0
  219. data/spec/{concerns → javascripts/concerns}/collection_event_bindings_spec.coffee +0 -0
  220. data/spec/{concerns → javascripts/concerns}/dom_helpers_spec.coffee +0 -0
  221. data/spec/{concerns → javascripts/concerns}/filterable_spec.coffee +0 -0
  222. data/spec/{concerns → javascripts/concerns}/model_presenter_spec.coffee +0 -0
  223. data/spec/{containers/panel_view_spec.coffee → javascripts/concerns/paginatable_spec.coffee} +0 -0
  224. data/spec/{concerns → javascripts/concerns}/state_model_spec.coffee +5 -0
  225. data/spec/javascripts/containers/card_view_spec.coffee +108 -0
  226. data/spec/{containers/tab_view_spec.coffee → javascripts/containers/modal_view_spec.coffee} +0 -0
  227. data/spec/{containers/viewport_spec.coffee → javascripts/containers/panel_view_spec.coffee} +0 -0
  228. data/spec/{core/observer_spec.coffee → javascripts/containers/tab_view_spec.coffee} +0 -0
  229. data/spec/{managers/socket_manager_spec.coffee → javascripts/containers/viewport_spec.coffee} +0 -0
  230. data/spec/{core → javascripts/core}/collection_spec.coffee +1 -1
  231. data/spec/{core → javascripts/core}/concerns_spec.coffee +0 -0
  232. data/spec/{core → javascripts/core}/container_spec.coffee +0 -0
  233. data/spec/{core → javascripts/core}/define_spec.coffee +0 -0
  234. data/spec/{core → javascripts/core}/events_spec.coffee +0 -0
  235. data/spec/{core → javascripts/core}/field_spec.coffee +0 -0
  236. data/spec/{core → javascripts/core}/framework_spec.coffee +0 -0
  237. data/spec/{core → javascripts/core}/model_spec.coffee +0 -0
  238. data/spec/javascripts/core/observer_spec.coffee +0 -0
  239. data/spec/{core → javascripts/core}/util_spec.coffee +0 -0
  240. data/spec/{core → javascripts/core}/view_spec.coffee +51 -39
  241. data/spec/{dependencies → javascripts/dependencies}/index.coffee +0 -0
  242. data/spec/{dependencies → javascripts/dependencies}/jasmine-html.js +0 -0
  243. data/spec/{dependencies → javascripts/dependencies}/jasmine.js +0 -0
  244. data/spec/{dependencies → javascripts/dependencies}/sinon.js +0 -0
  245. data/spec/{helper.coffee → javascripts/helper.coffee} +0 -0
  246. data/spec/{managers → javascripts/managers}/collection_manager_spec.coffee +0 -0
  247. data/spec/javascripts/managers/socket_manager_spec.coffee +0 -0
  248. data/spec/lib/component_definition_spec.rb +63 -0
  249. data/spec/lib/input_compiler_spec.rb +9 -0
  250. data/spec/lib/luca_application_spec.rb +30 -0
  251. data/spec/support/fixtures/application.coffee +45 -0
  252. data/spec/support/fixtures/component.coffee +34 -0
  253. data/tutorials/component-definitions.md +0 -0
  254. data/tutorials/component-definitions/01_intro.md +0 -0
  255. data/tutorials/component-driven-design.md +140 -0
  256. data/tutorials/structure-of-a-project.md +63 -0
  257. data/vendor/assets/javascripts/backbone-min.js +37 -33
  258. data/vendor/assets/javascripts/backbone-query.min.js +1 -1
  259. data/vendor/assets/javascripts/hogan.js +707 -0
  260. data/vendor/assets/javascripts/jquery.js +5 -4
  261. data/vendor/assets/javascripts/keymaster.min.js +4 -0
  262. data/vendor/assets/javascripts/luca-dependencies.min.js +8 -0
  263. data/vendor/assets/javascripts/luca-development.min.js +1 -0
  264. data/vendor/assets/javascripts/luca-spec.js +6 -6
  265. data/vendor/assets/javascripts/luca-ui.js +7386 -0
  266. data/vendor/assets/javascripts/luca-ui.min.js +5 -0
  267. data/vendor/assets/javascripts/luca.full.min.js +12 -0
  268. data/vendor/assets/javascripts/luca.min.js +5 -0
  269. data/vendor/assets/javascripts/underscore-min.js +1 -5
  270. data/vendor/assets/javascripts/underscore-string.min.js +1 -1
  271. data/vendor/assets/stylesheets/luca-components.css +202 -0
  272. data/vendor/assets/stylesheets/luca-development.css +23 -0
  273. data/vendor/assets/stylesheets/luca-ui.css +198 -0
  274. metadata +324 -94
  275. data/app/assets/javascripts/luca/components/base_toolbar.coffee +0 -17
  276. data/app/assets/javascripts/luca/components/form_button_toolbar.coffee +0 -28
  277. data/app/assets/javascripts/luca/components/grid_view.coffee +0 -269
  278. data/app/assets/javascripts/luca/components/page_controller.coffee +0 -7
  279. data/app/assets/javascripts/luca/components/template.coffee +0 -5
  280. data/app/assets/javascripts/luca/components/toolbar_dialog.coffee +0 -25
  281. data/lib/luca/code_browser.rb +0 -55
  282. data/lib/luca/command_line.rb +0 -69
  283. data/lib/luca/component_documentation.rb +0 -72
  284. data/site/assets/bootstrap.min.js +0 -7
  285. data/site/assets/dependencies.js +0 -94
  286. data/site/assets/glyphicons-halflings-white.png +0 -0
  287. data/site/assets/glyphicons-halflings.png +0 -0
  288. data/site/assets/luca-ui-bootstrap.css +0 -1331
  289. data/site/assets/luca-ui-bootstrap.js +0 -9
  290. data/site/assets/luca-ui-development-tools.css +0 -234
  291. data/site/assets/luca-ui-development-tools.js +0 -18561
  292. data/site/assets/luca-ui-development-tools.min.js +0 -15
  293. data/site/assets/luca-ui-full.min.js +0 -8
  294. data/site/assets/luca-ui.min.js +0 -4
  295. data/site/assets/sandbox.css +0 -62
  296. data/site/assets/sandbox.js +0 -469
  297. data/site/docs/application.html +0 -41
  298. data/site/docs/caching.html +0 -43
  299. data/site/docs/collection.html +0 -75
  300. data/site/docs/collection_manager.html +0 -71
  301. data/site/docs/containers.html +0 -118
  302. data/site/docs/events.html +0 -153
  303. data/site/docs/view.html +0 -128
  304. data/site/img/glyphicons-halflings-white.png +0 -0
  305. data/site/img/glyphicons-halflings.png +0 -0
  306. data/site/index.html +0 -20
  307. data/site/source-map.js +0 -1
  308. data/spec/components/form_view_spec.coffee +0 -84
  309. data/spec/containers/card_view_spec.coffee +0 -50
  310. data/spec/luca-spec.coffee +0 -9
@@ -1,13 +1,13 @@
1
- _.def("Luca.ModalView").extends("Luca.Container").with
1
+ view = Luca.register "Luca.containers.ModalView"
2
+ view.extends "Luca.Container"
2
3
 
4
+ view.publicConfiguration
3
5
  closeOnEscape: true
4
-
5
6
  showOnInitialize: false
6
-
7
7
  backdrop: false
8
+ className: "modal"
8
9
 
9
- className: "luca-ui-container modal"
10
-
10
+ view.publicMethods
11
11
  container: ()->
12
12
  $('body')
13
13
 
@@ -27,10 +27,10 @@ _.def("Luca.ModalView").extends("Luca.Container").with
27
27
  $('body').append( @$el )
28
28
 
29
29
  @$el.modal
30
- backdrop: @backdrop is true
31
- keyboard: @closeOnEscape is true
32
- show: @showOnInitialize is true
30
+ backdrop: !!(@backdrop is true)
31
+ keyboard: !!(@closeOnEscape is true)
32
+ show: !!(@showOnInitialize is true)
33
33
 
34
34
  @
35
35
 
36
- _.def("Luca.containers.ModalView").extends("Luca.ModalView").with()
36
+ view.register()
@@ -0,0 +1,25 @@
1
+ # The PageController container is a special type of container whose components or pages
2
+ # will always monopolize the entire element's display and where only one page or component
3
+ # will be visible at a time. The PageController is typically going to be at the very root
4
+ # of every application, and will be directly integrated with the application's router.
5
+ # A typical application hierarchy will be an abstract `Viewport` with a single top level
6
+ # `PageController` named 'main_controller'.
7
+ #
8
+ # - Viewport / Application
9
+ # - Router. ( maps urls to named pages on the controller )
10
+ # - Main Page Controller
11
+ # - Pages
12
+ # - Named views / containers
13
+ view = Luca.register "Luca.containers.PageController"
14
+ view.extends "Luca.Container"
15
+
16
+ view.privateMethods
17
+ initialize: (@options={})->
18
+ @components ||= @pages || @options.pages
19
+ for component in @components
20
+ component.components ||= component.pages
21
+
22
+ Luca.Container::initialize.apply(@, arguments)
23
+
24
+ view.register()
25
+
@@ -19,10 +19,6 @@ panelToolbar.defines
19
19
  # color options are primary, info, success, warning, danger, inverse
20
20
  buttons:[]
21
21
 
22
- className: "luca-ui-toolbar btn-toolbar"
23
-
24
- well: true
25
-
26
22
  orientation: 'top'
27
23
 
28
24
  autoBindEventHandlers: true
@@ -79,7 +75,7 @@ panelToolbar.defines
79
75
  @
80
76
 
81
77
 
82
- make = Backbone.View::make
78
+ make = Luca.View::make
83
79
 
84
80
  buildButton = (config, wrap=true)->
85
81
  if config.ctype? or config.type?
@@ -134,7 +130,10 @@ buildButton = (config, wrap=true)->
134
130
  buttonAttributes["class"] += " dropdown-toggle"
135
131
  buttonAttributes["data-toggle"] = "dropdown"
136
132
 
137
- dropdownItems = _(config.dropdown).map (dropdownItem)=>
133
+ dropdownItems = for dropdownItem in config.dropdown
134
+ if _.isObject(dropdownItem)
135
+ dropdownItem = _.values(dropdownItem).reverse()
136
+
138
137
  link = make "a", {}, dropdownItem[1]
139
138
  make "li", {"data-eventId": dropdownItem[0]}, link
140
139
 
@@ -1,6 +1,6 @@
1
- _.def('Luca.containers.TabView').extends('Luca.containers.CardView').with
2
-
3
1
  tabView = Luca.register "Luca.containers.TabView"
2
+ tabView.extends "Luca.containers.CardView"
3
+
4
4
  tabView.triggers "before:select",
5
5
  "after:select"
6
6
 
@@ -12,7 +12,8 @@ tabView.privateConfiguration
12
12
  additionalClassNames: 'tabbable'
13
13
  navClass: "nav-tabs"
14
14
  bodyTemplate: "containers/tab_view"
15
- bodyEl: "div.tab-content"
15
+ bodyClassName: "tab-content"
16
+ skipGetterMethods: true
16
17
 
17
18
  tabView.defines
18
19
  initialize: (@options={})->
@@ -40,9 +41,9 @@ tabView.defines
40
41
  afterRender: ()->
41
42
  Luca.containers.CardView::afterRender?.apply @, arguments
42
43
  tabContainerId = @tabContainer().attr("id")
43
- @registerEvent("click ##{ tabContainerId } li a", "select")
44
+ @registerEvent("click ##{ tabContainerId } li a", "tabSelectClickHandler")
44
45
 
45
- if Luca.config.enableBoostrap and (@tab_position is "left" or @tab_position is "right")
46
+ if Luca.config.enableBootstrap and (@tab_position is "left" or @tab_position is "right")
46
47
  @tabContainerWrapper().addClass("span2")
47
48
  @tabContentWrapper().addClass("span9")
48
49
 
@@ -63,13 +64,17 @@ tabView.defines
63
64
  @tabSelectors().removeClass('active')
64
65
  @activeTabSelector().addClass('active')
65
66
 
66
- select: (e)->
67
- e.preventDefault()
68
-
67
+ tabSelectClickHandler: (e)->
68
+ e?.preventDefault()
69
69
  me = my = $( e.target )
70
+ me = my ||= @tabSelectors()[0]
71
+ tabName = my.parent().data('target')
70
72
 
73
+ @select(tabName)
74
+
75
+ select: (tabName=0)->
71
76
  @trigger "before:select", @
72
- @activate my.parent().data('target')
77
+ @activate(tabName)
73
78
  @trigger "after:select", @
74
79
 
75
80
  componentElements: ()->
@@ -85,4 +90,8 @@ tabView.defines
85
90
  @$("ul.#{ @navClass }", @tabContainerWrapper() )
86
91
 
87
92
  tabSelectors: ()->
88
- @$( 'li.tab-selector', @tabContainer() )
93
+ @$( 'li.tab-selector', @tabContainer() )
94
+
95
+ bodyTemplateVars: ()->
96
+ cid: @cid
97
+ navClass: @navClass
@@ -1,23 +1,22 @@
1
- _.def('Luca.containers.Viewport').extend('Luca.containers.CardView').with
2
-
3
- activeItem: 0
4
-
5
- additionalClassNames: 'luca-ui-viewport'
1
+ viewport = Luca.register "Luca.containers.Viewport"
2
+ viewport.extends "Luca.Container"
6
3
 
4
+ viewport.defines
7
5
  fullscreen: true
8
-
9
6
  fluid: false
10
7
 
8
+ applyWrapper: true
11
9
 
12
10
  initialize: (@options={})->
13
11
  _.extend @, @options
14
12
 
15
- if Luca.config.enableBoostrap is true
16
- @wrapperClass = if @fluid is true then Luca.containers.Viewport.fluidWrapperClass else Luca.containers.Viewport.defaultWrapperClass
13
+ if Luca.config.enableBoostrap is true and @applyWrapper is true
14
+ @wrapperClass = if @fluid is true then Luca.config.fluidWrapperClass else Luca.config.wrapperClass
17
15
 
18
16
  Luca.Container::initialize.apply(@, arguments)
19
17
 
20
- @enableFullscreen() if @fullscreen is true
18
+ if @fullscreen is true
19
+ @enableFullscreen()
21
20
 
22
21
  enableFluid: ()-> @enableWrapper()
23
22
 
@@ -40,10 +39,7 @@ _.def('Luca.containers.Viewport').extend('Luca.containers.CardView').with
40
39
  @$el.removeClass('fullscreen-enabled')
41
40
 
42
41
  beforeRender: ()->
43
- Luca.containers.CardView::beforeRender?.apply(@, arguments)
44
-
45
- #if Luca.config.enableBoostrap and @topNav and @fullscreen
46
- # $('body').css('padding','40px')
42
+ Luca.Container::beforeRender?.apply(@, arguments)
47
43
 
48
44
  @renderTopNavigation() if @topNav?
49
45
  @renderBottomNavigation() if @bottomNav?
@@ -55,7 +51,7 @@ _.def('Luca.containers.Viewport').extend('Luca.containers.CardView').with
55
51
  @$el.width()
56
52
 
57
53
  afterRender: ()->
58
- Luca.containers.CardView::after?.apply(@, arguments)
54
+ Luca.Container::afterRender?.apply(@, arguments)
59
55
 
60
56
  if Luca.config.enableBoostrap is true and @containerClassName
61
57
  @$el.children().wrap('<div class="#{ containerClassName }" />')
@@ -79,5 +75,5 @@ _.def('Luca.containers.Viewport').extend('Luca.containers.CardView').with
79
75
  # IMPLEMENT
80
76
 
81
77
 
82
- Luca.containers.Viewport.defaultWrapperClass = 'row'
83
- Luca.containers.Viewport.fluidWrapperClass = 'row-fluid'
78
+ Luca.containers.Viewport.defaultWrapperClass = Luca.config.wrapperClass || 'container'
79
+ Luca.containers.Viewport.fluidWrapperClass = Luca.config.fluidWrapperClass || 'container-fluid'
@@ -1,4 +1,4 @@
1
- collection = Luca.define 'Luca.Collection'
1
+ collection = Luca.register 'Luca.Collection'
2
2
  collection.extends 'Backbone.QueryCollection'
3
3
  collection.includes 'Luca.Events'
4
4
 
@@ -6,13 +6,13 @@ collection.triggers "after:initialize",
6
6
  "before:fetch",
7
7
  "after:response"
8
8
 
9
- collection.defines
9
+ collection.publicConfiguration
10
10
  model: Luca.Model
11
11
  # cachedMethods refers to a list of methods on the collection
12
12
  # whose value gets cached once it is ran. the collection then
13
13
  # binds to change, add, remove, and reset events and then expires
14
14
  # the cached value once these events are fired.
15
-
15
+ #
16
16
  # cachedMethods expects an array of strings representing the method name
17
17
  # or objects containing @method and @resetEvents properties. by default
18
18
  # @resetEvents are 'add','remove',reset' and 'change'.
@@ -22,6 +22,17 @@ collection.defines
22
22
  # and return the filtered results that way, then set this to true
23
23
  remoteFilter: false
24
24
 
25
+ # setting a cache key to a string, or to a function which returns
26
+ # a string, will determine where the collections' models are pulled
27
+ # from if they are available on page load. also known as "bootstrapping"
28
+ # your collections with data. The cache key will look in whatever object
29
+ # is set in Luca.config.modelBootstrap for its models.
30
+ cache_key: undefined
31
+
32
+ # Which CollectionManager should we register with? Expects either a string
33
+ # which will get resolved into a global variable, or a
34
+ manager: undefined
35
+
25
36
  initialize: (models=[], @options)->
26
37
  _.extend @, @options
27
38
  @_reset()
@@ -44,7 +55,7 @@ collection.defines
44
55
  @name ||= @registerAs
45
56
  @manager ||= @registerWith
46
57
 
47
- @manager = if _.isFunction(@manager) then @manager() else @manager
58
+ @manager = Luca.util.read(@manager) if @manager?
48
59
 
49
60
  # if they specify a
50
61
  if @name and not @manager
@@ -248,7 +259,7 @@ collection.defines
248
259
  wrapped()
249
260
  @unbind "reset", @
250
261
 
251
- unless @fetching or not options.autoFetch
262
+ unless @fetching or not !!options.autoFetch
252
263
  @fetch()
253
264
 
254
265
  # ifLoaded is equivalent to binding to the reset trigger with
@@ -346,6 +357,9 @@ collection.defines
346
357
  else
347
358
  @models
348
359
 
360
+ collection.register()
361
+
362
+
349
363
  # Global Collection Observer
350
364
  _.extend Luca.Collection.prototype,
351
365
  trigger: ()->
@@ -68,7 +68,7 @@ class Luca.EventRelayer
68
68
  trigger = _( [prefix,eventId] ).compact().join(':')
69
69
  args.unshift(trigger)
70
70
  @trigger.apply(@, args)
71
- , target
71
+ , target
72
72
 
73
73
 
74
74
  Luca.Events =
@@ -88,14 +88,14 @@ Luca.Events =
88
88
  @bind trigger, onceFn
89
89
 
90
90
 
91
- Luca.EventsExt =
91
+ Luca.EventsExt =
92
92
  waitUntil:(trigger, context)->
93
93
  @waitFor.call(@, trigger, context )
94
-
94
+
95
95
  waitFor: (trigger, context)->
96
96
  self = @
97
- proxy =
98
- on:(target)->
97
+ proxy =
98
+ on:(target)->
99
99
  target.waitFor.call(target,trigger,context)
100
100
  and:(runList...)->
101
101
  for fn in runList
@@ -1,4 +1,4 @@
1
- model = Luca.define 'Luca.Model'
1
+ model = Luca.register 'Luca.Model'
2
2
 
3
3
  model.extends 'Backbone.Model'
4
4
 
@@ -7,8 +7,6 @@ panel.replaces "Luca.Panel"
7
7
 
8
8
  panel.extends "Luca.View"
9
9
 
10
- #panel.mixesIn "LoadMaskable"
11
-
12
10
  panel.configuration
13
11
  topToolbar: undefined
14
12
  bottomToolbar: undefined
@@ -56,7 +54,7 @@ panel.publicMethods
56
54
  @$bodyEl().empty()
57
55
 
58
56
  $html: (content)->
59
- @$bodyEl().html( content )
57
+ if content? then @$bodyEl().html( content ) else @$bodyEl().html()
60
58
 
61
59
  $append: (content)->
62
60
  @$bodyEl().append(content)
@@ -79,7 +77,6 @@ panel.privateMethods
79
77
  el = Luca.util.read( config.container )
80
78
  el ||= Luca.util.read( config.targetEl )
81
79
 
82
- console.log "Rendering toolbar to", config, el
83
80
  Luca.Panel.attachToolbar.call(@, config, el )
84
81
 
85
82
  panel.classMethods
@@ -88,16 +85,31 @@ panel.classMethods
88
85
  config.type ||= config.ctype ||= @toolbarType || "panel_toolbar"
89
86
 
90
87
  config.additionalClassNames = "#{ Luca.config.toolbarContainerClass } #{ config.orientation }"
91
-
88
+
92
89
  toolbar = Luca.util.lazyComponent( config )
90
+ # TEMP
91
+ # Do this properly
92
+ if config.orientation is "bottom"
93
+ @getBottomToolbar ||= ()-> toolbar
94
+
95
+ if config.orientation is "top"
96
+ @getTopToolbar ||= ()-> toolbar
97
+
98
+ if config.orientation is "right"
99
+ @getRightToolbar ||= ()-> toolbar
100
+
101
+ if config.orientation is "left"
102
+ @getLeftToolbar ||= ()-> toolbar
93
103
 
94
104
  hasBody = @bodyClassName or @bodyTagName
95
105
 
106
+ action = config.attachmentAction
96
107
  # there will be a body panel inside of the views $el
97
108
  # so just place the toolbar before, or after the body
98
- action = switch config.orientation
109
+ action ||= switch config.orientation
99
110
  when "top", "left"
100
111
  if hasBody and not targetEl?.length > 0 then "before" else "prepend"
112
+
101
113
  when "bottom", "right"
102
114
  if hasBody and not targetEl?.length > 0 then "after" else "append"
103
115
 
@@ -234,7 +234,8 @@ class ComponentDefinition
234
234
  componentType = "model" if Luca.isModelPrototype( definition )
235
235
 
236
236
  # automatically register this with the component registry
237
- Luca.registerComponent( _.string.underscored(@componentId), @componentName, componentType)
237
+ type_alias = _.string.underscored(@componentId)
238
+ Luca.registerComponent( type_alias, @componentName, componentType)
238
239
 
239
240
  @defined = true
240
241
 
@@ -22,6 +22,8 @@ class MetaDataProxy
22
22
  "class configuration" : []
23
23
  "class interface" : []
24
24
 
25
+ className: ()->
26
+ @meta["display name"]
25
27
  superClass: ()->
26
28
  Luca.util.resolve(@meta["super class name"])
27
29
 
@@ -30,7 +30,6 @@ Luca.registry.typeAliases =
30
30
  multi: "collection_multi_view"
31
31
  table: "table_view"
32
32
 
33
-
34
33
  # When you use _.def to define a component, you say
35
34
  # which class it extends() from, and with() which enhancements.
36
35
  # We register that component class for you:
@@ -39,24 +38,23 @@ Luca.registerComponent = (component, prototypeName, componentType="view")->
39
38
 
40
39
  switch componentType
41
40
  when "model"
41
+ existing = registry.model_classes[ component ]
42
42
  registry.model_classes[ component ] = prototypeName
43
43
  when "collection"
44
+ existing = registry.collection_classes[ component ]
44
45
  registry.collection_classes[ component ] = prototypeName
46
+ when "view"
47
+ existing = registry.classes[ component ]
48
+ registry.classes[ component ] = prototypeName
45
49
  else
50
+ existing = registry.classes[ component ]
46
51
  registry.classes[ component ] = prototypeName
47
52
 
48
- Luca.development_mode_register = (component, prototypeName)->
49
- existing = registry.classes[component]
50
-
51
- if Luca.enableDevelopmentTools is true and existing?
52
- prototypeDefinition = Luca.util.resolve( existing, window)
53
-
53
+ if existing? and Luca.config.developmentMode is true
54
54
  liveInstances = Luca.registry.findInstancesByClassName( prototypeName )
55
+ if liveInstances.length > 0
56
+ existingInstance.refreshEventBindings?() for existingInstance in liveInstances
55
57
 
56
- _( liveInstances ).each (instance)->
57
- instance?.refreshCode?.call(instance, prototypeDefinition)
58
-
59
- Luca.registerComponent( component, prototypeName )
60
58
 
61
59
  # We create a @ctype alias for this component definition, and register
62
60
  # the class in a registry.
@@ -123,6 +121,11 @@ Luca.registry.classes = (toString=false)->
123
121
  Luca.registry.find = (search)->
124
122
  Luca.util.resolve(search) || Luca.define.findDefinition(search)
125
123
 
124
+ Luca.remove = Luca.registry.removeInstance = (cacheKey)->
125
+ return unless cacheKey?
126
+ _( componentCacheStore.name_index ).delete( cacheKey )
127
+ _( componentCacheStore.cid_index ).delete( cacheKey )
128
+
126
129
  Luca.cache = Luca.registry.cacheInstance = (cacheKey, object)->
127
130
  return unless cacheKey?
128
131
  return object if object?.doNotCache is true