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
@@ -0,0 +1,26 @@
1
+ .cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/
2
+ .cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/
3
+
4
+ .cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; }
5
+ .cm-s-twilight .CodeMirror-linenumber { color: #aaa; }
6
+ .cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; }
7
+
8
+ .cm-s-twilight .cm-keyword { color: #f9ee98; } /**/
9
+ .cm-s-twilight .cm-atom { color: #FC0; }
10
+ .cm-s-twilight .cm-number { color: #ca7841; } /**/
11
+ .cm-s-twilight .cm-def { color: #8DA6CE; }
12
+ .cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/
13
+ .cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/
14
+ .cm-s-twilight .cm-operator { color: #cda869; } /**/
15
+ .cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/
16
+ .cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/
17
+ .cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/
18
+ .cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/
19
+ .cm-s-twilight .cm-error { border-bottom: 1px solid red; }
20
+ .cm-s-twilight .cm-builtin { color: #cda869; } /*?*/
21
+ .cm-s-twilight .cm-tag { color: #997643; } /**/
22
+ .cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/
23
+ .cm-s-twilight .cm-header { color: #FF6400; }
24
+ .cm-s-twilight .cm-hr { color: #AEAEAE; }
25
+ .cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/
26
+
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0"?>
2
+ <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
3
+ <cross-domain-policy>
4
+ <!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
5
+
6
+ <!-- Most restrictive policy: -->
7
+ <site-control permitted-cross-domain-policies="none"/>
8
+
9
+ <!-- Least restrictive policy: -->
10
+ <!--
11
+ <site-control permitted-cross-domain-policies="all"/>
12
+ <allow-access-from domain="*" to-ports="*" secure="false"/>
13
+ <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
14
+ -->
15
+ </cross-domain-policy>
@@ -0,0 +1 @@
1
+ %h1 Documentation
Binary file
@@ -0,0 +1,15 @@
1
+ # humanstxt.org/
2
+ # The humans responsible & technology colophon
3
+
4
+ # TEAM
5
+
6
+ <name> -- <role> -- <twitter>
7
+
8
+ # THANKS
9
+
10
+ <name>
11
+
12
+ # TECHNOLOGY COLOPHON
13
+
14
+ HTML5, CSS3
15
+ jQuery, Modernizr
Binary file
Binary file
@@ -0,0 +1 @@
1
+ #viewport
@@ -0,0 +1,55 @@
1
+ !!!5
2
+ /[if lt IE 7] <html class="no-js lt-ie9 lt-ie8 lt-ie7">
3
+ /[if IE 7] <html class="no-js lt-ie9 lt-ie8">
4
+ /[if IE 8] <html class="no-js lt-ie9">
5
+ %html.no-js
6
+ %head
7
+ %meta{:charset => "utf-8"}
8
+ %meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}
9
+
10
+ -# To set titles and descriptions globally and for each individual page, see /DOCS.md
11
+ %title Better Backbone.js Apps with Luca
12
+ %meta{:content => page_description, :name => "description"}
13
+
14
+ %meta{:content => "width=device-width", :name => "viewport"}
15
+
16
+ = javascript_include_tag "vendor/modernizr-2.6.1.min"
17
+ %link{:rel=>"stylesheet",:href=>"//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css"}
18
+ %link{:rel=>"stylesheet",:href=>"//netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css"}
19
+ %link{:rel=>"stylesheet",:href=>"//datapimp.github.com/luca/vendor/assets/stylesheets/luca-ui.css"}
20
+
21
+ = stylesheet_link_tag "site"
22
+ %body
23
+ #main-nav.navbar.navbar-inverse.navbar-fixed-top
24
+ .navbar-inner
25
+ .container-fluid
26
+ %button.btn.btn-navbar{:type=>"button","data-toggle"=>"collapse","data-target"=>".nav-collapse"}
27
+ %span.icon-bar
28
+ %span.icon-bar
29
+ %span.icon-bar
30
+ %a.brand{:href=>"#"} Luca
31
+ .nav-collapse.collapse
32
+ %ul.nav
33
+ %li{"data-page"=>"home"}
34
+ %a.active{:href=>"#"} Home
35
+ %li{"data-page"=>"getting_started"}
36
+ %a{:href=>"#get-started"} Get Started
37
+ %li{"data-page"=>"browse_source"}
38
+ %a{:href=>"#docs"} Documentation
39
+ %li{"data-page"=>"examples_browser"}
40
+ %a{:href=>"#examples"} Examples
41
+ %li{"data-page"=>"component_editor"}
42
+ %a{:href=>"#component_editor"} Component Editor
43
+
44
+ .container-fluid{:style=>"padding-top:40px;"}
45
+ = yield
46
+
47
+ %script{:type=>"text/javascript",:src=>"//datapimp.github.com/luca/vendor/assets/javascripts/luca-dependencies.min.js"}
48
+ %script{:type=>"text/javascript",:src=>"//datapimp.github.com/luca/vendor/assets/javascripts/luca.min.js"}
49
+ %script{:type=>"text/javascript",:src=>"//datapimp.github.com/luca/vendor/assets/javascripts/luca-development.min.js"}
50
+ %script{:type=>"text/javascript",:src=>"//cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js"}
51
+ %script{:type=>"text/javascript",:src=>"//cdnjs.cloudflare.com/ajax/libs/coffee-script/1.4.0/coffee-script.min.js"}
52
+ %script{:type=>"text/javascript",:src=>"//cdnjs.cloudflare.com/ajax/libs/less.js/1.3.3/less.min.js"}
53
+
54
+ = javascript_include_tag "dependencies"
55
+ = javascript_include_tag "site"
@@ -0,0 +1,63 @@
1
+ # [HTML5 Boilerplate](http://html5boilerplate.com)
2
+
3
+ HTML5 Boilerplate is a professional front-end template for building fast,
4
+ robust, and adaptable web apps or sites.
5
+
6
+ This project is the product of many years of iterative development and combined
7
+ community knowledge. It does not impose a specific development philosophy or
8
+ framework, so you're free to architect your code in the way that you want.
9
+
10
+ * Source: [https://github.com/h5bp/html5-boilerplate](https://github.com/h5bp/html5-boilerplate)
11
+ * Homepage: [http://html5boilerplate.com](http://html5boilerplate.com)
12
+ * Twitter: [@h5bp](http://twitter.com/h5bp)
13
+
14
+
15
+ ## Quick start
16
+
17
+ Choose one of the following options:
18
+
19
+ 1. Download the latest stable release from
20
+ [html5boilerplate.com](http://html5boilerplate.com/) or a custom build from
21
+ [Initializr](http://www.initializr.com).
22
+ 2. Clone the git repo — `git clone
23
+ https://github.com/h5bp/html5-boilerplate.git` - and checkout the tagged
24
+ release you'd like to use.
25
+
26
+
27
+ ## Features
28
+
29
+ * HTML5 ready. Use the new elements with confidence.
30
+ * Cross-browser compatible (Chrome, Opera, Safari, Firefox 3.6+, IE6+).
31
+ * Designed with progressive enhancement in mind.
32
+ * Includes [Normalize.css](http://necolas.github.com/normalize.css/) for CSS
33
+ normalizations and common bug fixes.
34
+ * The latest [jQuery](http://jquery.com/) via CDN, with a local fallback.
35
+ * The latest [Modernizr](http://modernizr.com/) build for feature detection.
36
+ * IE-specific classes for easier cross-browser control.
37
+ * Placeholder CSS Media Queries.
38
+ * Useful CSS helpers.
39
+ * Default print CSS, performance optimized.
40
+ * Protection against any stray `console.log` causing JavaScript errors in
41
+ IE6/7.
42
+ * An optimized Google Analytics snippet.
43
+ * Apache server caching, compression, and other configuration defaults for
44
+ Grade-A performance.
45
+ * Cross-domain Ajax and Flash.
46
+ * "Delete-key friendly." Easy to strip out parts you don't need.
47
+ * Extensive inline and accompanying documentation.
48
+
49
+
50
+ ## Documentation
51
+
52
+ Take a look at the [documentation table of
53
+ contents](/h5bp/html5-boilerplate/blob/master/doc/README.md). This
54
+ documentation is bundled with the project, which makes it readily available for
55
+ offline reading and provides a useful starting point for any documentation
56
+ you want to write about your project.
57
+
58
+
59
+ ## Contributing
60
+
61
+ Anyone and everyone is welcome to
62
+ [contribute](/h5bp/html5-boilerplate/blob/master/doc/contribute.md). Hundreds
63
+ of developers have helped make the HTML5 Boilerplate what it is today.
@@ -0,0 +1,3 @@
1
+ # robotstxt.org/
2
+
3
+ User-agent: *
@@ -38,7 +38,7 @@ describe 'The Collection View', ->
38
38
  expect( query.filter ).toEqual 'value'
39
39
 
40
40
  it "should render the attributes in the specified list elements", ->
41
- expect( @view.$html() ).toContain('value_one')
41
+ expect( @view.$html().match(/value_one/) ).toBeTruthy()
42
42
 
43
43
  it "should render each of the attributes", ->
44
44
  expect( @view.$('li.custom-class').length ).toEqual 2
@@ -0,0 +1,162 @@
1
+ describe 'The Form View', ->
2
+ beforeEach ->
3
+ FormView = Luca.components.FormView.extend
4
+ components:[
5
+ ctype: 'hidden_field'
6
+ name: 'id'
7
+ ,
8
+
9
+ ctype: "text_field",
10
+ label: "Field Two"
11
+ name: "field2"
12
+ ,
13
+ ctype: "text_field",
14
+ label: "Field One"
15
+ name: "field1"
16
+ ,
17
+ ctype: "checkbox_field"
18
+ label: "Field Three"
19
+ name: "field3"
20
+ ,
21
+ name: "field4"
22
+ label: "Field Four"
23
+ ctype: "text_area_field"
24
+ ,
25
+ name: "field5"
26
+ ctype: "button_field"
27
+ label: "Click Me"
28
+ ]
29
+
30
+ Model = Backbone.Model.extend
31
+ schema:
32
+ field0: "hidden"
33
+ field2: "text"
34
+ field1: "text"
35
+ field3: "boolean"
36
+ field4: "blob"
37
+ field5:
38
+ collection: "sample"
39
+
40
+ @form = new FormView()
41
+ @model = new Model(field0:1,field1:"jonathan",field3:true,field4:"what up player?")
42
+
43
+ afterEach ->
44
+ @form = undefined
45
+ @model = undefined
46
+
47
+ it "should create a form", ->
48
+ expect( @form ).toBeDefined()
49
+
50
+ it "should have access to all of the fields", ->
51
+ @form.render()
52
+ expect( @form.getFields().length ).toEqual 6
53
+
54
+ it "should load the model", ->
55
+ @form.loadModel(@model)
56
+ expect( @form.currentModel() ).toEqual @model
57
+
58
+ it "should set the field values from the model when loaded", ->
59
+ @form.render()
60
+ @form.loadModel(@model)
61
+ values = @form.getValues()
62
+ expect( values.field1 ).toEqual "jonathan"
63
+
64
+ it "should render the components within the body element", ->
65
+ @form.render()
66
+ expect( @form.$bodyEl().is('.form-view-body') ).toEqual true
67
+
68
+ it "should assign the components to render inside of the body", ->
69
+ @form.render()
70
+ expect( @form.$bodyEl().html() ).toContain "Field Four"
71
+
72
+ it "should allow me to set the values of the form fields with a hash", ->
73
+ @form.render()
74
+ @form.setValues(field1:"yes",field2:"no")
75
+ values = @form.getValues()
76
+
77
+ expect( values.field1 ).toEqual "yes"
78
+ expect( values.field2 ).toEqual "no"
79
+
80
+ it "should sync the model with the form field values", ->
81
+ @form.render()
82
+ @form.loadModel(@model)
83
+ @form.setValues(field1:"yes")
84
+ expect( @form.getValues().field1 ).toEqual "yes"
85
+
86
+ describe 'Dirty Tracking', ->
87
+ Luca.register("Luca.components.DirtyForm").extends("Luca.components.FormView").defines
88
+ trackDirtyState: true
89
+ components:[
90
+ type: "text"
91
+ name: "dirty_field"
92
+ ]
93
+
94
+ beforeEach ->
95
+ (@dirtyForm = new Luca.components.DirtyForm()).render()
96
+
97
+
98
+ it "should be stateful", ->
99
+ expect( @dirtyForm.state ).toBeDefined()
100
+ expect( @dirtyForm.state.set('dirty', true) )
101
+ expect( @dirtyForm ).toHaveTriggered("state:change:dirty")
102
+
103
+ it "should start off in a clean state", ->
104
+ dirty = @dirtyForm.isDirty()
105
+ expect( dirty ).not.toBeTruthy()
106
+
107
+ it "should become dirty if a field changes", ->
108
+ @dirtyForm.getField('dirty_field').trigger("on:change")
109
+ dirty = @dirtyForm.isDirty()
110
+ expect( dirty ).toBeTruthy()
111
+
112
+ it "should trigger a state change event", ->
113
+ @dirtyForm.getField('dirty_field').trigger("on:change")
114
+ expect( @dirtyForm ).toHaveTriggered('state:change:dirty')
115
+
116
+ it "should bubble up field change events", ->
117
+ @dirtyForm.getField('dirty_field').trigger("on:change")
118
+ expect( @dirtyForm ).toHaveTriggered('field:change')
119
+
120
+ it "should become clean on a reset", ->
121
+ @dirtyForm.getField('dirty_field').trigger("on:change")
122
+ @dirtyForm.reset()
123
+ dirty = @dirtyForm.isDirty()
124
+ expect( dirty ).not.toBeTruthy()
125
+
126
+ describe 'Model Binding', ->
127
+ Luca.register("Luca.FormModel").extends("Luca.Model").defines(defaults:model_field:"value")
128
+
129
+ form = Luca.register('Luca.components.ModelBoundForm')
130
+
131
+ form.extends("Luca.components.FormView")
132
+
133
+ form.defines
134
+ trackModelChanges: true
135
+ components:[
136
+ type: "text"
137
+ name: "model_field"
138
+ ]
139
+
140
+ beforeEach ->
141
+ @modelForm = new Luca.components.ModelBoundForm()
142
+ @formModel = new Luca.FormModel()
143
+ @modelForm.render()
144
+ @modelForm.loadModel(@formModel)
145
+
146
+ it "should trigger a state change event", ->
147
+ expect( @modelForm ).toHaveTriggered("state:change:currentModel")
148
+
149
+ it "should not bind to model changes by default", ->
150
+ expect( Luca.components.FormView::trackModelChanges ).not.toBeTruthy()
151
+
152
+ it "should be setup to track model changes", ->
153
+ expect( @modelForm.trackModelChanges ).toBeTruthy()
154
+
155
+ it "should change the model's value when the form applies itself", ->
156
+ @modelForm.setValues('model_field':"smooth, baby")
157
+ @modelForm.applyFormValuesToModel()
158
+ expect( @modelForm.getField('model_field').getValue() ).toEqual 'smooth, baby'
159
+
160
+ it "should change the field's value when the underlying model changes", ->
161
+ @formModel.set('model_field', 'haha')
162
+ expect( @modelForm.getValues().model_field ).toEqual 'haha'
@@ -26,6 +26,11 @@ describe 'The State Model Concern', ->
26
26
  view = new Luca.components.StatefulView()
27
27
  expect( view.state.toJSON() ).toEqual key1:"val1", key2: "val2"
28
28
 
29
+ it "should define a get/set method on the view which effect state", ->
30
+ view = new Luca.components.StatefulView()
31
+ view.set('testsetter', 'works')
32
+ expect( view.get('testsetter') ).toEqual('works')
33
+
29
34
  describe 'State Change Event Bindings', ->
30
35
  it "should trigger state change events on the view", ->
31
36
  view = new Luca.components.StatefulView()
@@ -0,0 +1,108 @@
1
+ describe "The Card View", ->
2
+ beforeEach ->
3
+ @cardView = new Luca.containers.CardView
4
+ visible: true
5
+ activeItem: 0
6
+ afterCardSwitch: sinon.spy()
7
+ beforeCardSwitch: sinon.spy()
8
+ components:[
9
+ markup: "component one"
10
+ name: "one"
11
+ one: true
12
+ firstActivation: sinon.spy()
13
+ activation: sinon.spy()
14
+ deactivation: sinon.spy()
15
+ afterInitialize: ()->
16
+ @on "activation", @oneSpy ||= sinon.spy()
17
+ ,
18
+ markup: "component two"
19
+ name: "two"
20
+ two: true
21
+ firstActivation: sinon.spy()
22
+ activation: sinon.spy()
23
+ ,
24
+ markup: "component three"
25
+ name: "three"
26
+ three: true
27
+ ]
28
+
29
+ @cardView.render()
30
+
31
+ it "should create three card elements", ->
32
+ expect( @cardView.componentElements().length ).toEqual 3
33
+
34
+ it "should hide all but one of the card elements", ->
35
+ display = _( @cardView.$('.luca-ui-card') ).map (el)-> $(el).css('display')
36
+ expect( display ).toEqual(['block','none','none'])
37
+
38
+ it "should be able to find the cards by name", ->
39
+ expect( @cardView.find("one") ).toBeDefined()
40
+ expect( @cardView.find("one").one ).toEqual true
41
+
42
+ it "should start with the first component active", ->
43
+ expect( @cardView.activeComponent()?.name ).toEqual "one"
44
+
45
+ it "should be able to activate components by name", ->
46
+ @cardView.activate("two")
47
+ expect( @cardView.activeComponent()?.name ).toEqual "two"
48
+
49
+ it "shouldn't fire first activation on a component that hasn't been activated", ->
50
+ expect( @cardView.find("two")?.firstActivation ).not.toHaveBeenCalled()
51
+ expect( @cardView.find("two") ).not.toHaveTriggered("first:activation")
52
+ expect( @cardView.find("two").previously_activated ).not.toBeTruthy()
53
+
54
+ it "should fire firstActivation on a component", ->
55
+ @cardView.activate("two")
56
+ expect( @cardView.find("two") ).toHaveTriggered("first:activation")
57
+ expect( @cardView.find("two")?.firstActivation ).toHaveBeenCalled()
58
+ expect( @cardView.find("two").previously_activated ).toBeTruthy()
59
+
60
+ it "should fire deactivation on a component", ->
61
+ @cardView.find("one").spiedEvents = {}
62
+ @cardView.activate("two")
63
+ expect( @cardView.find("one") ).toHaveTriggered("deactivation")
64
+
65
+ it "should only fire first activation once", ->
66
+ @cardView.activate("two")
67
+ @cardView.activate("one")
68
+ @cardView.activate("two")
69
+ expect( @cardView.find("two").firstActivation.callCount ).toEqual(1)
70
+
71
+ it "should fire the first activation hook on the default card", ->
72
+ expect( @cardView.find("one").firstActivation.callCount ).toEqual(1)
73
+
74
+ it "should fire the activation hook on the default card", ->
75
+ expect( @cardView.find("one").activation.callCount ).toEqual(1)
76
+
77
+ it "should only fire the activation hook once upon activation", ->
78
+ @cardView.activate("two")
79
+ expect( @cardView.find("two").activation.callCount ).toEqual(1)
80
+
81
+ it "should only fire the deactivation hook once upon deactivation", ->
82
+ @cardView.activate("two")
83
+ expect( @cardView.find("one").deactivation.callCount ).toEqual(1)
84
+
85
+ it "should fire the beforeCardSwitch hook", ->
86
+ @cardView.activate("two")
87
+ expect( @cardView.beforeCardSwitch ).toHaveBeenCalled()
88
+
89
+ it "should fire the afterCardSwitch hook", ->
90
+ @cardView.activate("two")
91
+ expect( @cardView.afterCardSwitch ).toHaveBeenCalled()
92
+
93
+ it "should allow me to next through the cards", ->
94
+ @cardView.next()
95
+ expect(@cardView.activeComponent().name ).toEqual("two")
96
+
97
+ it "should allow me to previous through the cards", ->
98
+ @cardView.activate("two")
99
+ @cardView.previous()
100
+ expect(@cardView.activeComponent().name).toEqual("one")
101
+
102
+ it "should allow me to cycle through the cards", ->
103
+ @cardView.cycle()
104
+ expect(@cardView.activeComponent().name ).toEqual("two")
105
+ @cardView.cycle()
106
+ expect(@cardView.activeComponent().name ).toEqual("three")
107
+ @cardView.cycle()
108
+ expect(@cardView.activeComponent().name ).toEqual("one")