luca 0.9.89 → 0.9.91

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/CHANGELOG +11 -1
  2. data/Gemfile +5 -2
  3. data/Gemfile.lock +84 -56
  4. data/Rakefile +10 -2
  5. data/app/assets/javascripts/luca/components/application.coffee +82 -89
  6. data/app/assets/javascripts/luca/components/collection_view.coffee +9 -5
  7. data/app/assets/javascripts/luca/components/controller.coffee +72 -11
  8. data/app/assets/javascripts/luca/components/fields/base.coffee +61 -8
  9. data/app/assets/javascripts/luca/components/fields/button_field.coffee +53 -7
  10. data/app/assets/javascripts/luca/components/fields/checkbox_array.coffee +12 -7
  11. data/app/assets/javascripts/luca/components/fields/text_field.coffee +1 -1
  12. data/app/assets/javascripts/luca/components/form_view.coffee +2 -2
  13. data/app/assets/javascripts/luca/components/grid_layout_view.coffee +0 -1
  14. data/app/assets/javascripts/luca/components/page.coffee +1 -0
  15. data/app/assets/javascripts/luca/components/table_view.coffee +2 -2
  16. data/app/assets/javascripts/luca/concerns/dom_helpers.coffee +2 -2
  17. data/app/assets/javascripts/luca/containers/card_view.coffee +84 -54
  18. data/app/assets/javascripts/luca/containers/container.coffee +126 -46
  19. data/app/assets/javascripts/luca/containers/modal_view.coffee +9 -9
  20. data/app/assets/javascripts/luca/containers/page_controller.coffee +25 -0
  21. data/app/assets/javascripts/luca/containers/panel_toolbar.coffee +1 -1
  22. data/app/assets/javascripts/luca/containers/viewport.coffee +2 -5
  23. data/app/assets/javascripts/luca/core/collection.coffee +18 -4
  24. data/app/assets/javascripts/luca/core/model.coffee +1 -1
  25. data/app/assets/javascripts/luca/core/panel.coffee +1 -1
  26. data/app/assets/javascripts/luca/core/view.coffee +26 -7
  27. data/app/assets/javascripts/luca/development/code_sync_manager.coffee +51 -4
  28. data/app/assets/javascripts/luca/development/console.coffee +1 -1
  29. data/app/assets/javascripts/luca/framework.coffee +1 -1
  30. data/app/assets/javascripts/luca/index.coffee +1 -0
  31. data/app/assets/javascripts/luca/util/luca.coffee +2 -1
  32. data/app/assets/stylesheets/luca/components/viewport.scss +0 -4
  33. data/bin/luca +14 -0
  34. data/docs/framework.json +1 -1
  35. data/docs/luca-framework-documentation.js +1 -0
  36. data/lib/luca/cli/generate.rb +37 -0
  37. data/lib/luca/cli/server.rb +20 -0
  38. data/lib/luca/cli/sync.rb +40 -0
  39. data/lib/luca/cli/watch.rb +16 -0
  40. data/lib/luca/cli.rb +68 -0
  41. data/lib/luca/collection/endpoint.rb +1 -0
  42. data/lib/luca/component_definition.rb +23 -5
  43. data/lib/luca/luca_application.rb +18 -7
  44. data/lib/luca/rails/version.rb +1 -1
  45. data/lib/luca/server.rb +7 -0
  46. data/lib/luca/stylesheet.rb +2 -3
  47. data/lib/luca/version.rb +3 -0
  48. data/lib/luca/watcher.rb +72 -0
  49. data/lib/luca.rb +8 -1
  50. data/luca.gemspec +14 -7
  51. data/site/.bundle/config +2 -0
  52. data/site/.gitignore +5 -0
  53. data/site/.rvmrc +1 -0
  54. data/site/CHANGELOG.md +41 -0
  55. data/site/DOCS.md +41 -0
  56. data/site/Gemfile +8 -0
  57. data/site/Gemfile.lock +134 -0
  58. data/site/LICENSE.md +19 -0
  59. data/site/config.rb +84 -0
  60. data/site/helpers/site_helpers.rb +20 -0
  61. data/site/html5bp-docs/README.md +38 -0
  62. data/site/html5bp-docs/contribute.md +104 -0
  63. data/site/html5bp-docs/crossdomain.md +21 -0
  64. data/site/html5bp-docs/css.md +135 -0
  65. data/site/html5bp-docs/extend.md +507 -0
  66. data/site/html5bp-docs/faq.md +77 -0
  67. data/site/html5bp-docs/htaccess.md +323 -0
  68. data/site/html5bp-docs/html.md +170 -0
  69. data/site/html5bp-docs/js.md +31 -0
  70. data/site/html5bp-docs/misc.md +25 -0
  71. data/site/html5bp-docs/usage.md +109 -0
  72. data/site/readme.md +47 -0
  73. data/site/source/.htaccess +540 -0
  74. data/site/source/404.html +157 -0
  75. data/site/source/app/assets/javascripts/dependencies.js.coffee +6 -0
  76. data/site/source/app/assets/javascripts/docs/application.coffee +64 -0
  77. data/site/source/app/assets/javascripts/docs/collections/docs_documentation.coffee +17 -0
  78. data/site/source/app/assets/javascripts/docs/collections/github_repositories.coffee +7 -0
  79. data/site/source/app/assets/javascripts/docs/collections/index.coffee +1 -0
  80. data/site/source/app/assets/javascripts/docs/collections/luca_documentation.coffee +17 -0
  81. data/site/source/app/assets/javascripts/docs/collections/public_gists.coffee +4 -0
  82. data/site/source/app/assets/javascripts/docs/config.coffee +5 -0
  83. data/site/source/app/assets/javascripts/docs/index.coffee +12 -0
  84. data/site/source/app/assets/javascripts/docs/lib/router.coffee +3 -0
  85. data/site/source/app/assets/javascripts/docs/lib/util.coffee +0 -0
  86. data/site/source/app/assets/javascripts/docs/models/component.coffee +99 -0
  87. data/site/source/app/assets/javascripts/docs/models/github_repository.coffee +3 -0
  88. data/site/source/app/assets/javascripts/docs/models/index.coffee +1 -0
  89. data/site/source/app/assets/javascripts/docs/templates/component_documentation.jst.ejs +55 -0
  90. data/site/source/app/assets/javascripts/docs/templates/examples_browser/overview.jst.ejs +4 -0
  91. data/site/source/app/assets/javascripts/docs/templates/examples_browser/selector.jst.ejs +11 -0
  92. data/site/source/app/assets/javascripts/docs/templates/github_repository.jst.ejs +4 -0
  93. data/site/source/app/assets/javascripts/docs/templates/layouts/main.jst.ejs +4 -0
  94. data/site/source/app/assets/javascripts/docs/templates/left_navigation.jst.ejs +5 -0
  95. data/site/source/app/assets/javascripts/docs/templates/pages/getting_started.jst.ejs +78 -0
  96. data/site/source/app/assets/javascripts/docs/templates/pages/home.jst.ejs +57 -0
  97. data/site/source/app/assets/javascripts/docs/views/components/code_editor/index.coffee +0 -0
  98. data/site/source/app/assets/javascripts/docs/views/components/code_editor.coffee +45 -0
  99. data/site/source/app/assets/javascripts/docs/views/components/component_documentation.coffee +72 -0
  100. data/site/source/app/assets/javascripts/docs/views/index.coffee +3 -0
  101. data/site/source/app/assets/javascripts/docs/views/pages/browse_source/details.coffee +37 -0
  102. data/site/source/app/assets/javascripts/docs/views/pages/browse_source/list.coffee +31 -0
  103. data/site/source/app/assets/javascripts/docs/views/pages/browse_source.coffee +46 -0
  104. data/site/source/app/assets/javascripts/docs/views/pages/component_editor.coffee +10 -0
  105. data/site/source/app/assets/javascripts/docs/views/pages/examples_browser/docs.coffee +12 -0
  106. data/site/source/app/assets/javascripts/docs/views/pages/examples_browser/source.coffee +13 -0
  107. data/site/source/app/assets/javascripts/docs/views/pages/examples_browser.coffee +102 -0
  108. data/site/source/app/assets/javascripts/docs/views/pages/home.coffee +10 -0
  109. data/site/source/app/assets/javascripts/docs/views/views/api_browser/index.coffee +43 -0
  110. data/site/source/app/assets/javascripts/docs/views/views/collection_view_examples/grid_layout_view_example.coffee +14 -0
  111. data/site/source/app/assets/javascripts/docs/views/views/collection_view_examples/table_view_example.coffee +39 -0
  112. data/site/source/app/assets/javascripts/docs/views/views/form_view_examples/basic_example.coffee +38 -0
  113. data/site/source/app/assets/javascripts/docs/views/views/form_view_examples/complex_layout.coffee +110 -0
  114. data/site/source/app/assets/javascripts/docs/views/views/top_navigation.coffee +6 -0
  115. data/site/source/app/assets/javascripts/docs-docs.js +1 -0
  116. data/site/source/app/assets/javascripts/luca-docs.js +1 -0
  117. data/site/source/app/assets/javascripts/luca-framework-documentation.js +1 -0
  118. data/site/source/app/assets/javascripts/site.js.coffee +4 -0
  119. data/site/source/app/assets/javascripts/vendor/codemirror.js +4786 -0
  120. data/site/source/app/assets/javascripts/vendor/coffeescript.js +346 -0
  121. data/site/source/app/assets/javascripts/vendor/css.js +465 -0
  122. data/site/source/app/assets/javascripts/vendor/htmlmixed.js +84 -0
  123. data/site/source/app/assets/javascripts/vendor/javascript.js +422 -0
  124. data/site/source/app/assets/javascripts/vendor/js-beautify.js +1353 -0
  125. data/site/source/app/assets/javascripts/vendor/modernizr-2.6.1.min.js +4 -0
  126. data/site/source/app/assets/javascripts/vendor/vim.js +2511 -0
  127. data/site/source/app/assets/stylesheets/docs/api-browser.css.scss +5 -0
  128. data/site/source/app/assets/stylesheets/docs/application.css.scss +35 -0
  129. data/site/source/app/assets/stylesheets/docs/browse-source.css.scss +5 -0
  130. data/site/source/app/assets/stylesheets/docs/scrollable-table.css.scss +5 -0
  131. data/site/source/app/assets/stylesheets/site.css.scss +2 -0
  132. data/site/source/app/assets/stylesheets/vendor/codemirror.css +240 -0
  133. data/site/source/app/assets/stylesheets/vendor/prettify-tomorrow-night-bright.css +160 -0
  134. data/site/source/app/assets/stylesheets/vendor/twilight.css +26 -0
  135. data/site/source/crossdomain.xml +15 -0
  136. data/site/source/documentation.html.haml +1 -0
  137. data/site/source/favicon_base.png +0 -0
  138. data/site/source/humans.txt +15 -0
  139. data/site/source/images/background.png +0 -0
  140. data/site/source/images/middleman.png +0 -0
  141. data/site/source/index.html.haml +1 -0
  142. data/site/source/layouts/layout.haml +55 -0
  143. data/site/source/readme.md +63 -0
  144. data/site/source/robots.txt +3 -0
  145. data/spec/javascripts/components/collection_view_spec.coffee +1 -1
  146. data/spec/javascripts/containers/card_view_spec.coffee +58 -5
  147. data/spec/javascripts/core/collection_spec.coffee +1 -1
  148. data/spec/javascripts/core/view_spec.coffee +2 -2
  149. data/vendor/assets/javascripts/backbone-min.js +37 -33
  150. data/vendor/assets/javascripts/backbone-query.min.js +1 -1
  151. data/vendor/assets/javascripts/jquery.js +5 -4
  152. data/vendor/assets/javascripts/luca-dependencies.min.js +8 -6
  153. data/vendor/assets/javascripts/luca-development.min.js +1 -1
  154. data/vendor/assets/javascripts/luca.full.min.js +12 -10
  155. data/vendor/assets/javascripts/luca.min.js +5 -5
  156. data/vendor/assets/javascripts/underscore-min.js +1 -5
  157. data/vendor/assets/javascripts/underscore-string.min.js +1 -1
  158. data/vendor/assets/stylesheets/luca-components.css +0 -2
  159. data/vendor/assets/stylesheets/luca-development.css +1 -1
  160. metadata +215 -39
  161. data/app/assets/javascripts/luca/components/page_controller.coffee +0 -3
  162. data/app/assets/javascripts/luca/core/collection_view.coffee +0 -150
  163. data/site/assets/bootstrap.min.js +0 -7
  164. data/site/assets/dependencies.js +0 -94
  165. data/site/assets/glyphicons-halflings-white.png +0 -0
  166. data/site/assets/glyphicons-halflings.png +0 -0
  167. data/site/assets/luca-ui-bootstrap.css +0 -1331
  168. data/site/assets/luca-ui-bootstrap.js +0 -9
  169. data/site/assets/luca-ui-development-tools.css +0 -234
  170. data/site/assets/luca-ui-development-tools.js +0 -18561
  171. data/site/assets/luca-ui-development-tools.min.js +0 -15
  172. data/site/assets/luca-ui-full.min.js +0 -8
  173. data/site/assets/luca-ui.min.js +0 -4
  174. data/site/assets/sandbox.css +0 -62
  175. data/site/assets/sandbox.js +0 -469
  176. data/site/docs/application.html +0 -41
  177. data/site/docs/caching.html +0 -43
  178. data/site/docs/collection.html +0 -75
  179. data/site/docs/collection_manager.html +0 -71
  180. data/site/docs/containers.html +0 -118
  181. data/site/docs/events.html +0 -153
  182. data/site/docs/view.html +0 -128
  183. data/site/img/glyphicons-halflings-white.png +0 -0
  184. data/site/img/glyphicons-halflings.png +0 -0
  185. data/site/index.html +0 -20
  186. data/site/source-map.js +0 -1
@@ -0,0 +1,157 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Page Not Found :(</title>
6
+ <style>
7
+ ::-moz-selection {
8
+ background: #b3d4fc;
9
+ text-shadow: none;
10
+ }
11
+
12
+ ::selection {
13
+ background: #b3d4fc;
14
+ text-shadow: none;
15
+ }
16
+
17
+ html {
18
+ padding: 30px 10px;
19
+ font-size: 20px;
20
+ line-height: 1.4;
21
+ color: #737373;
22
+ background: #f0f0f0;
23
+ -webkit-text-size-adjust: 100%;
24
+ -ms-text-size-adjust: 100%;
25
+ }
26
+
27
+ html,
28
+ input {
29
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
30
+ }
31
+
32
+ body {
33
+ max-width: 500px;
34
+ _width: 500px;
35
+ padding: 30px 20px 50px;
36
+ border: 1px solid #b3b3b3;
37
+ border-radius: 4px;
38
+ margin: 0 auto;
39
+ box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
40
+ background: #fcfcfc;
41
+ }
42
+
43
+ h1 {
44
+ margin: 0 10px;
45
+ font-size: 50px;
46
+ text-align: center;
47
+ }
48
+
49
+ h1 span {
50
+ color: #bbb;
51
+ }
52
+
53
+ h3 {
54
+ margin: 1.5em 0 0.5em;
55
+ }
56
+
57
+ p {
58
+ margin: 1em 0;
59
+ }
60
+
61
+ ul {
62
+ padding: 0 0 0 40px;
63
+ margin: 1em 0;
64
+ }
65
+
66
+ .container {
67
+ max-width: 380px;
68
+ _width: 380px;
69
+ margin: 0 auto;
70
+ }
71
+
72
+ /* google search */
73
+
74
+ #goog-fixurl ul {
75
+ list-style: none;
76
+ padding: 0;
77
+ margin: 0;
78
+ }
79
+
80
+ #goog-fixurl form {
81
+ margin: 0;
82
+ }
83
+
84
+ #goog-wm-qt,
85
+ #goog-wm-sb {
86
+ border: 1px solid #bbb;
87
+ font-size: 16px;
88
+ line-height: normal;
89
+ vertical-align: top;
90
+ color: #444;
91
+ border-radius: 2px;
92
+ }
93
+
94
+ #goog-wm-qt {
95
+ width: 220px;
96
+ height: 20px;
97
+ padding: 5px;
98
+ margin: 5px 10px 0 0;
99
+ box-shadow: inset 0 1px 1px #ccc;
100
+ }
101
+
102
+ #goog-wm-sb {
103
+ display: inline-block;
104
+ height: 32px;
105
+ padding: 0 10px;
106
+ margin: 5px 0 0;
107
+ white-space: nowrap;
108
+ cursor: pointer;
109
+ background-color: #f5f5f5;
110
+ background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1);
111
+ background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1);
112
+ background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1);
113
+ background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1);
114
+ -webkit-appearance: none;
115
+ -moz-appearance: none;
116
+ appearance: none;
117
+ *overflow: visible;
118
+ *display: inline;
119
+ *zoom: 1;
120
+ }
121
+
122
+ #goog-wm-sb:hover,
123
+ #goog-wm-sb:focus {
124
+ border-color: #aaa;
125
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
126
+ background-color: #f8f8f8;
127
+ }
128
+
129
+ #goog-wm-qt:hover,
130
+ #goog-wm-qt:focus {
131
+ border-color: #105cb6;
132
+ outline: 0;
133
+ color: #222;
134
+ }
135
+
136
+ input::-moz-focus-inner {
137
+ padding: 0;
138
+ border: 0;
139
+ }
140
+ </style>
141
+ </head>
142
+ <body>
143
+ <div class="container">
144
+ <h1>Not found <span>:(</span></h1>
145
+ <p>Sorry, but the page you were trying to view does not exist.</p>
146
+ <p>It looks like this was the result of either:</p>
147
+ <ul>
148
+ <li>a mistyped address</li>
149
+ <li>an out-of-date link</li>
150
+ </ul>
151
+ <script>
152
+ var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host;
153
+ </script>
154
+ <script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
155
+ </div>
156
+ </body>
157
+ </html>
@@ -0,0 +1,6 @@
1
+ #= require ./vendor/codemirror
2
+ #= require ./vendor/css
3
+ #= require ./vendor/coffeescript
4
+ #= require ./vendor/javascript
5
+ #= require ./vendor/vim
6
+ #= require ./vendor/htmlmixed
@@ -0,0 +1,64 @@
1
+ app = Docs.register "Docs.Application"
2
+ app.extends "Luca.Application"
3
+ app.configuration
4
+ version: 1
5
+ el: "#viewport"
6
+ fluid: true
7
+ fullscreen: true
8
+ applyWrapper: false
9
+ name: "DocsApp"
10
+
11
+ app.configuration
12
+ collectionManager:
13
+ initialCollections:[
14
+ "luca_documentation"
15
+ "docs_documentation"
16
+ ]
17
+
18
+ router: "Docs.Router"
19
+
20
+ routes:
21
+ "": "home#index"
22
+ "docs": "browse_source#index"
23
+ "docs/:component_name": "browse_source#show"
24
+ "get-started": "getting_started#index"
25
+ "examples": "examples_browser#index"
26
+ "examples/:example_name/:section": "examples_browser#show"
27
+ "examples/:example_name": "examples_browser#show"
28
+ "component_editor": "component_editor#index"
29
+
30
+ stateChangeEvents:
31
+ "page": "onPageChange"
32
+
33
+ app.privateMethods
34
+ mainNavElement: ()->
35
+ @_mainNavEl ||= $('#main-nav ul.nav')
36
+
37
+ afterRender: ()->
38
+ Luca.Application::afterRender?.apply(@, arguments)
39
+ if window.location.host.match /localhost/
40
+ @codeSyncManager = new Luca.CodeSyncManager({}, host:"//localhost:9292/faye", channel:"/luca-code-sync")
41
+ @codeSyncManager.trigger("ready")
42
+
43
+ _onPageChange: _.debounce (state, newPage)->
44
+ $('li', @mainNavElement()).removeClass 'active'
45
+ $("li[data-page='#{ newPage }']", @mainNavElement()).addClass 'active'
46
+ , 10
47
+
48
+ app.contains
49
+ component: "home"
50
+ ,
51
+ component: "browse_source"
52
+ ,
53
+ component: "examples_browser"
54
+ ,
55
+ component: "component_editor"
56
+ ,
57
+ name: "getting_started"
58
+ type: "page"
59
+ layout: "pages/getting_started"
60
+ index: _.once ()->
61
+ @$('pre').addClass('prettyprint')
62
+ window.prettyPrint()
63
+
64
+ app.register()
@@ -0,0 +1,17 @@
1
+ collection = Docs.register "Docs.collections.DocsDocumentation"
2
+ collection.extends "Luca.Collection"
3
+ collection.defines
4
+ model: Docs.models.Component
5
+ appNamespace: "Docs"
6
+
7
+ getSource: ()->
8
+ Luca.util.resolve("#{ @appNamespace }.documentation")
9
+
10
+ fetch: ()->
11
+ models = _( @getSource() ).sortBy("class_name")
12
+ found = {}
13
+ models = for model in models when not found[ model.class_name ]
14
+ found[ model.class_name ] = true
15
+ model
16
+
17
+ @reset(models)
@@ -0,0 +1,7 @@
1
+ collection = Docs.register "Docs.collections.GithubRepositories"
2
+ collection.extends "Luca.Collection"
3
+ collection.defines
4
+ model: Docs.models.GithubRepository
5
+ url: ()->
6
+ "https://api.github.com/users/datapimp/repos"
7
+
@@ -0,0 +1 @@
1
+ #= require_tree .
@@ -0,0 +1,17 @@
1
+ collection = Docs.register "Docs.collections.LucaDocumentation"
2
+ collection.extends "Luca.Collection"
3
+ collection.defines
4
+ model: Docs.models.Component
5
+ appNamespace: "Luca"
6
+
7
+ getSource: ()->
8
+ Luca.util.resolve("#{ @appNamespace }.documentation")
9
+
10
+ fetch: ()->
11
+ models = _( @getSource() ).sortBy("class_name")
12
+ found = {}
13
+ models = for model in models when not found[ model.class_name ]
14
+ found[ model.class_name ] = true
15
+ model
16
+
17
+ @reset(models)
@@ -0,0 +1,4 @@
1
+ collection = Docs.register "Docs.collections.PublicGists"
2
+ collection.extends "Luca.Collection"
3
+ collection.defines
4
+ fetch: Backbone.Collection::fetch
@@ -0,0 +1,5 @@
1
+ Luca.initialize "Docs",
2
+ baseParams: false
3
+ modelBootstrap: false
4
+ codeSyncChannel: "/luca-code-sync"
5
+ codeSyncHost: "//localhost:9292/faye"
@@ -0,0 +1,12 @@
1
+ #= require ./config
2
+ #= require_tree ./lib
3
+ #= require_tree ./templates
4
+ #= require ./models
5
+ #= require ./collections
6
+ #= require ./views
7
+ #= require ./application
8
+ #= require_self
9
+
10
+ Docs.onReady ()->
11
+ DocsApp = new Docs.Application()
12
+ DocsApp.boot()
@@ -0,0 +1,3 @@
1
+ router = Docs.register "Docs.Router"
2
+ router.extends "Luca.Router"
3
+ router.defines()
@@ -0,0 +1,99 @@
1
+ model = Docs.register "Docs.models.Component"
2
+ model.extends "Luca.Model"
3
+
4
+ model.configuration
5
+ defaults:
6
+ class_name: undefined
7
+ superClass: undefined
8
+ asset_id: undefined
9
+ source_file_contents: ""
10
+ defined_in_file: ""
11
+
12
+ model.defines
13
+ idAttribute: "class_name"
14
+
15
+ contentsWithoutHeader: ()->
16
+ startsAt = @get("starts_on_line") || 0
17
+ contents = @get("source_file_contents").split("\n")
18
+ count = contents.length
19
+
20
+ if startsAt > 0
21
+ startsAt = startsAt - 1
22
+
23
+ contents.slice(startsAt, count).join("\n")
24
+
25
+ documentation: ()->
26
+ base = _( @toJSON() ).pick 'header_documentation', 'class_name', 'defined_in_file'
27
+
28
+ _.extend base, @metaData(),
29
+ componentGroup: @componentGroup()
30
+ componentType: @componentType()
31
+ componentTypeAlias: @componentTypeAlias()
32
+ details:
33
+ publicMethods: @methodDocumentationFor("publicMethods")
34
+ privateMethods: @methodDocumentationFor("privateMethods")
35
+ privateProperties: @propertyDocumentationFor("privateProperties","privateConfiguration")
36
+ publicProperties: @propertyDocumentationFor("publicProperties","publicConfiguration")
37
+
38
+ methodDocumentationFor: (groups...)->
39
+ documentationSource = _.extend({}, @get("defines_methods"))
40
+ result = {}
41
+
42
+ for group in groups
43
+ if list = @metaData()?[ group ]?()
44
+ _.extend result, _(list).reduce (memo, methodOrProperty)->
45
+ memo[ methodOrProperty ] = documentationSource[ methodOrProperty ]
46
+ memo
47
+ , {}
48
+
49
+ result
50
+
51
+ propertyDocumentationFor: (groups...)->
52
+ documentationSource = _.extend({}, @get("defines_properties"))
53
+ result = {}
54
+
55
+ for group in groups
56
+ if list = @metaData()?[ group ]?()
57
+ _.extend result, _(list).reduce (memo, methodOrProperty)->
58
+ memo[ methodOrProperty ] = documentationSource[ methodOrProperty ]
59
+ memo
60
+ , {}
61
+
62
+ result
63
+
64
+ url: ()->
65
+ "/project/components/#{ Luca.namespace }/#{ @classNameId() }"
66
+
67
+ metaData: ()->
68
+ Luca.util.resolve( @get("class_name") )?.prototype.componentMetaData()
69
+
70
+ classNameId: ()->
71
+ @get("class_name").replace(/\./g,'__')
72
+
73
+ componentGroup: ()->
74
+ parts = @get('class_name').split('.')
75
+ parts.slice(0,2).join('.')
76
+
77
+ componentType: ()->
78
+ type = "view"
79
+ parts = @get('class_name').split('.')
80
+
81
+ switch group = parts[1]
82
+ when "collections" then "collection"
83
+ when "models" then "model"
84
+ when ("views" || "components" || "pages") then "view"
85
+
86
+ return if group?
87
+
88
+ if componentPrototype = Luca.util.resolve( @get("class_name") )
89
+ return "view" if Luca.isViewPrototype( componentPrototype:: )
90
+ return "collection" if Luca.isCollectionPrototype( componentPrototype:: )
91
+ return "model" if Luca.isModelProtoype( componentPrototype:: )
92
+
93
+ # meh, but what about Router?
94
+ "view"
95
+
96
+ componentTypeAlias: ()->
97
+ parts = @get('class_name').split('.')
98
+ name = parts.pop()
99
+ _.str.underscored( name )
@@ -0,0 +1,3 @@
1
+ model = Docs.register "Docs.models.GithubRepository"
2
+ model.extends "Luca.Model"
3
+ model.register()
@@ -0,0 +1 @@
1
+ #= require_tree .
@@ -0,0 +1,55 @@
1
+ <div class="component-documentation-wrapper">
2
+ <div class="header-documentation"></div>
3
+ <div class="public properties">
4
+ <h4>Public Configuration</h4>
5
+ <table class="table table-condensed table-striped">
6
+ <thead>
7
+ <th width="15%">Property</th>
8
+ <th width="15%">Defaults</th>
9
+ <th width="70%">Documentation</th>
10
+ </thead>
11
+ <tbody>
12
+ </tbody>
13
+ </table>
14
+ </div>
15
+ <div class="public methods">
16
+ <h4>Public Methods</h4>
17
+ <table class="table table-condensed table-striped">
18
+ <thead>
19
+ <th width="15%">Method</th>
20
+ <th width="15%">Args</th>
21
+ <th width="70%">Documentation</th>
22
+ </thead>
23
+ <tbody>
24
+ </tbody>
25
+ </table>
26
+ </div>
27
+
28
+ <div class="private properties">
29
+ <h4>Private Configuration</h4>
30
+ <table class="table table-condensed table-striped">
31
+ <thead>
32
+ <th width="15%">Property</th>
33
+ <th width="15%">Defaults</th>
34
+ <th width="70%">Documentation</th>
35
+ </thead>
36
+ <tbody>
37
+ </tbody>
38
+ </table>
39
+ </div>
40
+ <div class="private methods">
41
+ <h4>Private Methods</h4>
42
+ <table class="table table-condensed table-striped">
43
+ <thead>
44
+ <th width="15%">Method</th>
45
+ <th width="15%">Args</th>
46
+ <th width="70%">Documentation</th>
47
+ </thead>
48
+ <tbody>
49
+ </tbody>
50
+ </table>
51
+ </div>
52
+
53
+ <h4 class="source">Source</h4>
54
+ <pre class="source pre-scrollable prettyprint"></pre>
55
+ </div>
@@ -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>