luca 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,4 @@
1
+ <h3>Luca Component Examples</h3>
2
+ <p>Here is a collection of components developed using the Luca framework. They make use of the Github API as their data source, and show off some of the neat things you can do with the components you develop.</p>
3
+ <p>For each example, you can see the component in action as it is used, view the source code for the component, and see the documentation that gets generated from your component definition files.</p>
4
+ <p>The first example is the <a href="#examples/api_browser">API Browser</a> which is a simple component that allows you to view the formatted JSON output from an API endpoint that you enter. Use the tabs to the left to browse through the examples.</p>
@@ -0,0 +1,11 @@
1
+ <ul class="panel-selector nav nav-pills">
2
+ <li class="active component">
3
+ <a class="link" data-index=0 data-navigate-to="#examples/<%= example_name %>/component">Component</a>
4
+ </li>
5
+ <li class="source">
6
+ <a class="link" data-index=1 data-navigate-to="#examples/<%= example_name %>/source">Source</a>
7
+ </li>
8
+ <li class="documentation">
9
+ <a class="link" data-index=2 data-navigate-to="#examples/<%= example_name %>/documentation">Documentation</a>
10
+ </li>
11
+ </ul>
@@ -0,0 +1,4 @@
1
+ <div class="github-repository">
2
+ <i class="icon icon-github" />
3
+ <span class="name"><%= model.get('name') %></span>
4
+ </div>
@@ -0,0 +1,4 @@
1
+ <div class="row-fluid">
2
+ <div class="span3" data-region="left"></div>
3
+ <div class="span9" data-region="right"></div>
4
+ </div>
@@ -0,0 +1,5 @@
1
+ <ul class="nav nav-pills stacked">
2
+ <li>
3
+ <a href="#">What</a>
4
+ </li>
5
+ </ul>
@@ -0,0 +1,78 @@
1
+ <h2>1.) Include the libraries</h2>
2
+ <h4>Download the files and serve them yourself:</h4>
3
+ <a href="//datapimp.github.com/luca/downloads/luca-latest.zip">Zip (96k)</a>
4
+ <p>The depencies file includes underscore 1.4.4, backbone 0.9.9, jquery 1.9, underscore.string, and backbone-query. You will need to bring your own bootstrap.</p>
5
+
6
+ <h4>Include the files from the CDN</h4>
7
+
8
+ <pre><code>&lt;html&gt;
9
+ &lt;head&gt;
10
+ ...
11
+ &lt;link rel="stylesheet" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" /&gt;
12
+ &lt;link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" /&gt;
13
+ &lt;link rel="stylesheet" href="//datapimp.github.com/luca/vendor/assets/stylesheets/luca-ui.css" /&gt;
14
+ &lt;/head&gt;
15
+ &lt;body&gt;
16
+ ...
17
+ &lt;script type="text/javascript" src="//datapimp.github.com/luca/vendor/assets/javascripts/luca-dependencies.min.js"&gt;&lt;/script&gt;
18
+ &lt;script type="text/javascript" src="//datapimp.github.com/luca/vendor/assets/javascripts/luca.min.js"&gt;&lt;/script&gt;
19
+ &lt;/body&gt;
20
+ &lt;/html&gt;
21
+ </code></pre>
22
+
23
+ <h4>Use the Ruby gem in your Rails app</h4>
24
+
25
+ <pre><code># Gemfile.lock
26
+ gem 'luca'
27
+ gem 'bootstrap-rails'
28
+ </code></pre>
29
+
30
+ <p>Including the luca gem makes everything available via the asset pipeline. </p>
31
+
32
+ <pre><code># application.coffee
33
+ #= require luca-dependencies.min
34
+ #= require luca.min
35
+ </code></pre>
36
+
37
+ <p>We depend on the bootstrap css externally.</p>
38
+
39
+ <pre><code>/*
40
+ *= require twitter/bootstrap
41
+ *= require luca-ui.css
42
+ */
43
+ </code></pre>
44
+
45
+ <h2>2.) Generate your application</h2>
46
+
47
+ <p>The luca gem ships with a rails generator to generate an application skeleton. You can run it:
48
+ rails g luca:application sample </p>
49
+
50
+ <p>Doing this will generate an application skeleton for you:</p>
51
+
52
+ <pre><code>- app/assets/javascripts/sample
53
+ - collections
54
+ - lib
55
+ - collection_manager.coffee
56
+ - router.coffee
57
+ - models
58
+ - views
59
+ - application.coffee
60
+ - config.coffee
61
+ - index.coffee
62
+ </code></pre>
63
+
64
+ <h2>3.) Start developing</h2>
65
+
66
+ <p>The style we use to develop Luca applications is to develop all of our components and views as encpasulated modules. We start with the smallest units, and then build them up into components using containers, and then build them into pages which are controlled by the main Application. </p>
67
+ <ul class="nav">
68
+ <li>
69
+ <a href="#samples">View some examples</a>
70
+ </li>
71
+ <li>
72
+ <a href="#tutorials">Follow some tutorials</a>
73
+ </li>
74
+ <li>
75
+ <a href="#docs">Read the auto-generated documentation</a>
76
+ </li>
77
+ </ul>
78
+ </ul>
@@ -0,0 +1,57 @@
1
+ <div class="hero-unit">
2
+ <h1>Luca</h1>
3
+ <p>A framework and tools for building well architected client side applications.</p>
4
+ <p>Based on <a href="http://backbonejs.org">Backbone.js</a> and <a href="http://twitter.github.com/bootstrap">Twitter Bootstrap</a>.</p>
5
+ <a class="btn btn-large btn-primary" href="//datapimp.gitub.com/luca/downloads/luca-latest.zip">Download</a>
6
+
7
+ <ul class="links">
8
+ <li>
9
+ <i class="icon icon-github" />
10
+ <a href="https://github.com/datapimp/luca">Github Project</a>
11
+ </li>
12
+ <li>
13
+ <a href="#examples">Examples</a>
14
+ </li>
15
+ <li>
16
+ <a href="#contribute">Contribute</a>
17
+ </li>
18
+ <li>
19
+ Version <%= Luca.VERSION %>
20
+ </li>
21
+ </ul>
22
+
23
+ </div>
24
+
25
+ <div id="features" class="row-fluid">
26
+ <div class="span4">
27
+ <h3><i class="icon icon-coffee" /> Coffeescript, player.</h3>
28
+ <p>
29
+ Luca allows you to write most of your app in Coffeescript. Most of the structural markup is taken care of for you, and Bootstrap handles a lot of CSS styling for you already. We find that this allows us to develop apps and focus primarily on their functionality and interaction first.
30
+ </p>
31
+
32
+ <p>This also makes it very easy to render your app on the client and on the server.</p>
33
+ </div>
34
+ <div class="span4">
35
+ <h3><i class="icon icon-sitemap" /> Component Driven Design</h3>
36
+ <p>Luca encourages you to design your app as a library of components: re-usable, well encapsulated interface elements with their own concerns. Luca provides ways of joining components together to form more complex pieces which get integrated into the pages of your application.</p>
37
+ <p>As your app grows to a certain level, you will find that you have built up a large library of patterns and tools that you can begin to develop new features very quickly without having to solve the same design problems over and over.</p>
38
+ </div>
39
+ <div class="span4">
40
+ <h3><i class="icon icon-wrench" /> Developer Tools</h3>
41
+ <p>Luca comes with a variety of tools that make developing large browser applications much easier. </p>
42
+ <ul class="nav">
43
+ <li><a href="#">Code Sync</a></li>
44
+ <li><a href="#">Generated Documentation</a></li>
45
+ <li><a href="#">In browser prototype</a></li>
46
+ </ul>
47
+ </div>
48
+ </div>
49
+
50
+ <div>
51
+ A labor of love by <a href="http://twitter.com/soederpop">@soederpop</a> for my son and my comrades at <a href="https://benchprep.com">@benchprep</a>. MIT Licensed.
52
+ </div>
53
+
54
+ <div>
55
+ <a href="https://github.com/datapimp/luca/issues">Issues</a>
56
+ <a href="https://github.com/datapimp/luca/blob/master/CHANGELOG">Changelog</a>
57
+ </div>
@@ -0,0 +1,45 @@
1
+ view = Luca.register "Docs.views.CodeEditor"
2
+ view.extends "Luca.View"
3
+
4
+ view.privateConfiguration
5
+ tagName: "textarea"
6
+
7
+ view.publicConfiguration
8
+ # CodeMirror option. This will control which theme is applied
9
+ # to the editor. Make sure the CSS for this theme has been loaded.
10
+ theme: "twilight"
11
+
12
+ # How many spaces a block should be indented.
13
+ indentUnit: 2
14
+
15
+ # Whether to use the context-sensitive indentation that the mode provides
16
+ smartIndent: true
17
+
18
+ # Which language will we be editing? Support for coffeescript,
19
+ # html, javascript, css, sass, less come out of the box
20
+ mode: "coffeescript"
21
+
22
+ # which keymap to use? default, or vim
23
+ keyMap: "default"
24
+
25
+ # whether or not to wrap lines when they reach past the set limit
26
+ lineWrapping: false
27
+
28
+ view.privateConfiguration
29
+ codeMirrorOptions: {}
30
+ codeMirrorConfigKeys:[
31
+ "theme"
32
+ "indentUnit"
33
+ "smartIndent"
34
+ "mode"
35
+ "keyMap"
36
+ "lineWrapping"
37
+ ]
38
+
39
+ view.privateMethods
40
+ afterRender: ()->
41
+ defaults = _(@).pick( @codeMirrorConfigKeys... )
42
+ options = _(@codeMirrorOptions).defaults(defaults)
43
+ @codeMirror = window.CodeMirror.fromTextArea( @$el[0], options)
44
+
45
+ view.register()
@@ -0,0 +1,72 @@
1
+ view = Docs.register "Docs.views.ComponentDocumentation"
2
+ view.extends "Luca.View"
3
+
4
+ view.privateConfiguration
5
+ bodyTemplate: "component_documentation"
6
+
7
+ # If set to true, we will render the source code
8
+ # for the component in addition to all of the information
9
+ # about the methods and properties
10
+ displaySource: false
11
+
12
+ # If set to true, we will render the header documentation
13
+ # that is contained in the component
14
+ displayHeader: false
15
+
16
+ view.publicMethods
17
+ # Loads a component definition from the documentation objects that
18
+ # are generated by the Luca gem's Luca::LucaApplication#export tool.
19
+ # These objects are the result of parsing component definition files
20
+ # and determining the public and private properties and methods, and
21
+ # the documentation that is rendered from their comments.
22
+ loadComponent: (@component)->
23
+ @reset()
24
+
25
+ for section in ["private", "public"]
26
+ @renderMethodGroup(section)
27
+ @renderPropertyGroup(section)
28
+
29
+ @$('.source').hide()
30
+
31
+ if @displayHeader is true
32
+ @$('.header-documentation').show()
33
+ @$('.header-documentation').html( @component.get("header_documentation") )
34
+
35
+ if @displaySource is true
36
+ @$('.source').show()
37
+ @$('pre.source').html( @component.contentsWithoutHeader() )
38
+
39
+ @$('pre').addClass('prettyprint')
40
+
41
+ view.privateMethods
42
+ reset: ()->
43
+ @$('.table tbody').empty()
44
+ @$('.properties,.methods').hide()
45
+ @$('.header-documentation').hide()
46
+
47
+ renderMethodGroup: (group="public")->
48
+ source = @component?.documentation()?.details["#{ group }Methods"]
49
+ return if _.isEmpty(source)
50
+ prototype = Luca.util.resolve(@component.get("class_name"))?.prototype
51
+ list = @$(".methods.#{ group }").show().find('.table tbody')
52
+
53
+ for method, details of source when _.isFunction(prototype[method])
54
+ details ||= {}
55
+ arg_details = _( details.arguments ).reduce (memo,pair)->
56
+ memo += "#{ pair.argument }"
57
+ memo += "= #{ pair.value || 'undefined' }" if pair.value?
58
+ memo += "<br/>"
59
+ , ""
60
+ list.append "<tr><td>#{ method }</td><td>#{ arg_details }</td><td>#{ details.documentation || "" }</td></tr>"
61
+
62
+ renderPropertyGroup: (group="public")->
63
+ source = @component?.documentation()?.details["#{ group }Properties"]
64
+ return if _.isEmpty(source)
65
+ prototype = Luca.util.resolve(@component.get("class_name"))?.prototype
66
+ list = @$(".properties.#{ group }").show().find('.table tbody')
67
+
68
+ for method, details of source when not _.isFunction(prototype[method])
69
+ details ||= {}
70
+ list.append "<tr><td>#{ method }</td><td>#{ details.default || "" }</td><td>#{ details.documentation || "" }</td></tr>"
71
+
72
+ view.register()
@@ -0,0 +1,3 @@
1
+ #= require_tree ./components
2
+ #= require_tree ./views
3
+ #= require_tree ./pages
@@ -0,0 +1,46 @@
1
+ #= require_tree ./browse_source
2
+ #= require_self
3
+ view = Docs.register "Docs.views.BrowseSource"
4
+ view.extends "Luca.Container"
5
+
6
+ view.configuration
7
+ autoBindEventHandlers: true
8
+ events:
9
+ "click .docs-component-list a.link" : "selectComponent"
10
+
11
+ view.contains
12
+ component: "component_list"
13
+ ,
14
+ component: "component_details"
15
+
16
+ view.privateMethods
17
+
18
+ index: ()->
19
+ @selectComponent(@getComponentList().getCollection().at(0))
20
+
21
+ show: (componentName)->
22
+ component = @getComponentList().getCollection().detect (model)->
23
+ model.get("class_name") is componentName
24
+
25
+ return @index() unless component?
26
+
27
+ @selectComponent(component)
28
+
29
+ selectComponent: (e)->
30
+ list = @getComponentList()
31
+ details = @getComponentDetails()
32
+
33
+ if Luca.isBackboneModel(e)
34
+ model = e
35
+ index = list.getCollection().indexOf(model)
36
+ row = list.$("tr[data-index='#{ index }']")
37
+ else
38
+ $target = @$(e.target)
39
+ row = $target.parents('tr').eq(0)
40
+ index = row.data('index')
41
+ model = list.getCollection().at(index)
42
+
43
+ list.$('tr').removeClass('info')
44
+ row.addClass('info')
45
+ details.load(model)
46
+
@@ -0,0 +1,37 @@
1
+ view = Docs.register "Docs.views.ComponentDetails"
2
+ view.extends "Luca.Container"
3
+
4
+ view.configuration
5
+ rowFluid: true
6
+
7
+ view.contains
8
+ role: "documentation"
9
+ span: 5
10
+ loadComponent: (model)->
11
+ @$el.empty()
12
+ @$el.append("<h2>#{ model.get('class_name') }</h2>")
13
+ @$el.append("<div class='header-documentation'>#{ model.get('header_documentation') }</div>")
14
+ ,
15
+ type: "component_documentation"
16
+ role: "details"
17
+ displaySource: true
18
+ span: 7
19
+
20
+ view.defines
21
+ afterRender: ()->
22
+ @getDetails().$el.hide()
23
+ @getDocumentation().$el.hide()
24
+
25
+ load: (model)->
26
+ @getDetails().$el.show()
27
+ @getDocumentation().$el.show()
28
+
29
+ @getDetails().loadComponent(model)
30
+ @getDocumentation().loadComponent(model)
31
+
32
+ @prettyPrint()
33
+
34
+ # Applies syntax highlighting to all pre elements
35
+ prettyPrint: ()->
36
+ @$('pre').addClass('prettyprint')
37
+ window.prettyPrint?()
@@ -0,0 +1,31 @@
1
+ view = Docs.register "Docs.views.ComponentList"
2
+ view.extends "Luca.components.ScrollableTable"
3
+ view.defines
4
+ paginatable: false
5
+ maxHeight: 200
6
+ collection: "luca_documentation"
7
+ columns:[
8
+ reader: "class_name"
9
+ width: "20%"
10
+ renderer: (name)->
11
+ "<a class='link'>#{ name }</a>"
12
+ ,
13
+ reader: "class_name"
14
+ header: "Extends From"
15
+ width: "20%"
16
+ renderer: (className)->
17
+ if component = Luca.util.resolve(className)
18
+ name = component.prototype.componentMetaData()?.meta["super class name"]
19
+ "<a class='link'>#{ name }</a>"
20
+ ,
21
+ reader: "type_alias"
22
+ header: "Shortcut"
23
+ width: "10%"
24
+ ,
25
+ reader: "defined_in_file"
26
+ header: "<i class='icon icon-github'/> Github"
27
+ renderer: (file)->
28
+ shortened = file.split("javascripts/luca/")[1]
29
+ "<a href='https://github.com/datapimp/luca/blob/master/app/assets/javascripts/luca/#{ shortened }'>#{ shortened }</a>"
30
+ ]
31
+
@@ -0,0 +1,10 @@
1
+ view = Docs.register "Docs.views.ComponentEditor"
2
+ view.extends "Luca.Container"
3
+
4
+ view.contains
5
+ type: "code_editor"
6
+
7
+ view.defines
8
+ index: ()->
9
+ 1
10
+
@@ -0,0 +1,102 @@
1
+ #= require_tree ./examples_browser
2
+ #= require_self
3
+
4
+ page = Docs.register "Docs.views.ExamplesBrowser"
5
+ page.extends "Luca.containers.TabView"
6
+
7
+ page.contains
8
+ title: "API Browser"
9
+ type: "api_browser"
10
+ name: "api_browser"
11
+ ,
12
+ title: "Basic FormView"
13
+ type: "basic_form_view"
14
+ name: "basic_form_view"
15
+ ,
16
+ title: "Complex Layout FormView"
17
+ type: "complex_layout_form"
18
+ name: "complex_layout_form"
19
+ ,
20
+ title: "Scrollable Table"
21
+ type: "table_view_example"
22
+ name: "table_view_example"
23
+ ,
24
+ title: "Grid Layout CollectionView"
25
+ type: "grid_layout_view_example"
26
+ name: "grid_layout_view_example"
27
+
28
+ page.privateConfiguration
29
+ activeCard: 0
30
+ tab_position: "left"
31
+ defaults:
32
+ activation: ()->
33
+ Docs().router.navigate("#examples/#{ @name }/component", false)
34
+
35
+ page.privateMethods
36
+ # Hack
37
+ afterSelect: _.debounce ()->
38
+ if active = @activeComponent()
39
+ active.findComponentByName?("component")?.runExample?()
40
+ , 10
41
+
42
+ wrapExampleComponents: ()->
43
+ wrapped = []
44
+
45
+ wrapped = _(@components).map (component,index)->
46
+ title: component.title
47
+ name: component.name
48
+ autoBindEventHandlers: true
49
+ events:
50
+ "click a.link[data-navigate-to]" : "selectPanel"
51
+
52
+ selectPanel: (e)->
53
+ $target = @$(e.target)
54
+ link = $target.data("navigate-to")
55
+ index = $target.data("index")
56
+ @$('.panel-selector li').removeClass("active")
57
+ $target.parent('li').addClass("active")
58
+ @getViewSelector().activate(index)
59
+ Docs().router.navigate(link, false)
60
+
61
+ components:[
62
+ type: "card"
63
+ role: "view_selector"
64
+ afterInitialize: ()->
65
+ @$el.append("<h3>#{ component.title } Example</h3>")
66
+ components:[
67
+ type: component.type
68
+ name: "component"
69
+ activation: ()->
70
+ @runExample?()
71
+ ,
72
+ type: "example_source"
73
+ example: component.name
74
+ name: "source"
75
+ ,
76
+ type: "example_docs"
77
+ example: component.name
78
+ name: "documentation"
79
+ ]
80
+ ,
81
+ bodyTemplate: "examples_browser/selector"
82
+ bodyTemplateVars: ()->
83
+ example_name: component.name
84
+ ]
85
+
86
+ @components = wrapped
87
+ @components.unshift title: "Overview", bodyTemplate: "examples_browser/overview"
88
+
89
+ afterInitialize: ()->
90
+ @wrapExampleComponents()
91
+
92
+ page.publicMethods
93
+ show: (exampleName=0, view="component")->
94
+ @activate exampleName, false, ()->
95
+ @getViewSelector().activate(view)
96
+ @$("li").removeClass("active")
97
+ @$("li.#{view}").addClass("active")
98
+
99
+ index: ()->
100
+ @show()
101
+
102
+ page.register()