luca 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +49 -0
- data/Gemfile +8 -1
- data/Gemfile.lock +97 -53
- data/Guardfile +3 -25
- data/README.md +5 -16
- data/ROADMAP +15 -9
- data/Rakefile +24 -75
- data/app.rb +10 -42
- data/app/assets/javascripts/luca/basic.coffee +1 -1
- data/app/assets/javascripts/luca/components/application.coffee +187 -104
- data/app/assets/javascripts/luca/components/collection_view.coffee +115 -51
- data/app/assets/javascripts/luca/components/controller.coffee +87 -10
- data/app/assets/javascripts/luca/components/fields/base.coffee +74 -13
- data/app/assets/javascripts/luca/components/fields/button_field.coffee +60 -13
- data/app/assets/javascripts/luca/components/fields/checkbox_array.coffee +12 -7
- data/app/assets/javascripts/luca/components/fields/select_field.coffee +82 -23
- data/app/assets/javascripts/luca/components/fields/text_area_field.coffee +25 -10
- data/app/assets/javascripts/luca/components/fields/text_field.coffee +9 -3
- data/app/assets/javascripts/luca/components/form_view.coffee +105 -33
- data/app/assets/javascripts/luca/components/grid_layout_view.coffee +42 -0
- data/app/assets/javascripts/luca/components/index.coffee +6 -0
- data/app/assets/javascripts/luca/components/nav_bar.coffee +60 -6
- data/app/assets/javascripts/luca/components/page.coffee +70 -0
- data/app/assets/javascripts/luca/components/simple_collection_view.coffee +10 -0
- data/app/assets/javascripts/luca/components/table_view.coffee +7 -3
- data/app/assets/javascripts/luca/components/table_view_scrollable.coffee +23 -0
- data/app/assets/javascripts/luca/concerns/collection_event_bindings.coffee +4 -1
- data/app/assets/javascripts/luca/concerns/development_tool_helpers.coffee +23 -14
- data/app/assets/javascripts/luca/concerns/dom_helpers.coffee +2 -2
- data/app/assets/javascripts/luca/concerns/filterable.coffee +8 -11
- data/app/assets/javascripts/luca/concerns/form_model_bindings.coffee +20 -0
- data/app/assets/javascripts/luca/concerns/modal_view.coffee +40 -15
- data/app/assets/javascripts/luca/concerns/query_collection_bindings.coffee +7 -1
- data/app/assets/javascripts/luca/concerns/state_model.coffee +40 -26
- data/app/assets/javascripts/luca/concerns/templating.coffee +3 -1
- data/app/assets/javascripts/luca/config.coffee +5 -0
- data/app/assets/javascripts/luca/containers/card_view.coffee +87 -52
- data/app/assets/javascripts/luca/containers/container.coffee +305 -108
- data/app/assets/javascripts/luca/containers/modal_view.coffee +9 -9
- data/app/assets/javascripts/luca/containers/page_controller.coffee +25 -0
- data/app/assets/javascripts/luca/containers/panel_toolbar.coffee +5 -6
- data/app/assets/javascripts/luca/containers/tab_view.coffee +19 -10
- data/app/assets/javascripts/luca/containers/viewport.coffee +12 -16
- data/app/assets/javascripts/luca/core/collection.coffee +19 -5
- data/app/assets/javascripts/luca/core/events.coffee +5 -5
- data/app/assets/javascripts/luca/core/model.coffee +1 -1
- data/app/assets/javascripts/luca/core/panel.coffee +18 -6
- data/app/assets/javascripts/luca/core/registry/component_definition.coffee +2 -1
- data/app/assets/javascripts/luca/core/registry/meta_data.coffee +2 -0
- data/app/assets/javascripts/luca/core/registry/registry.coffee +14 -11
- data/app/assets/javascripts/luca/core/templates.coffee +5 -1
- data/app/assets/javascripts/luca/core/view.coffee +200 -47
- data/app/assets/javascripts/luca/dependencies.coffee +2 -0
- data/app/assets/javascripts/luca/development/code_sync_manager.coffee +173 -0
- data/app/assets/javascripts/luca/development/component.coffee +76 -0
- data/app/assets/javascripts/luca/development/components.coffee +57 -0
- data/app/assets/javascripts/luca/development/console.coffee +1 -1
- data/app/assets/javascripts/luca/development/index.coffee +4 -1
- data/app/assets/javascripts/luca/framework.coffee +7 -3
- data/app/assets/javascripts/luca/index.coffee +2 -1
- data/app/assets/javascripts/luca/managers/collection_manager.coffee +2 -3
- data/app/assets/javascripts/luca/managers/index.coffee +1 -1
- data/app/assets/javascripts/luca/managers/socket_manager.coffee +31 -8
- data/app/assets/javascripts/luca/templates/components/nav_bar.jst.ejs +16 -1
- data/app/assets/javascripts/luca/templates/containers/tab_view.jst.ejs +1 -1
- data/app/assets/javascripts/luca/util/index.coffee +1 -0
- data/app/assets/javascripts/luca/util/keybindings.coffee +24 -0
- data/app/assets/javascripts/luca/util/logging.coffee +15 -0
- data/app/assets/javascripts/luca/util/luca.coffee +9 -1
- data/app/assets/stylesheets/luca/components/table_view.scss +85 -0
- data/app/assets/stylesheets/luca/components/viewport.scss +0 -4
- data/app/assets/stylesheets/luca/containers/container.scss +8 -0
- data/app/assets/stylesheets/luca/index.css +2 -2
- data/bin/luca +14 -0
- data/config.ru +1 -2
- data/docs/framework.json +1 -0
- data/docs/luca-framework-documentation.js +1 -0
- data/docs/{application.md → old/application.md} +0 -0
- data/docs/{collection.md → old/collection.md} +0 -0
- data/docs/{collection_manager.md → old/collection_manager.md} +0 -0
- data/docs/{container_philosophy.md → old/container_philosophy.md} +0 -0
- data/docs/{event_binding_helpers.md → old/event_binding_helpers.md} +0 -0
- data/docs/{method_caching_and_computed_properties.md → old/method_caching_and_computed_properties.md} +0 -0
- data/docs/{view.md → old/view.md} +0 -0
- data/lib/generators/luca/application/templates/javascripts/dependencies.coffee +2 -5
- data/lib/guard/luca.rb +84 -0
- data/lib/luca.rb +25 -1
- data/lib/luca/asset_compiler.rb +117 -0
- data/lib/luca/cli.rb +68 -0
- data/lib/luca/cli/generate.rb +37 -0
- data/lib/luca/cli/server.rb +20 -0
- data/lib/luca/cli/sync.rb +40 -0
- data/lib/luca/cli/watch.rb +16 -0
- data/lib/luca/collection.rb +64 -0
- data/lib/luca/collection/endpoint.rb +38 -0
- data/lib/luca/collection/file_backend.rb +121 -0
- data/lib/luca/collection/redis_backend.rb +153 -0
- data/lib/luca/compiled_asset.rb +61 -0
- data/lib/luca/component_definition.rb +356 -0
- data/lib/luca/luca_application.rb +258 -0
- data/lib/luca/project.rb +73 -0
- data/lib/luca/project_harness.rb +96 -0
- data/lib/luca/rails.rb +5 -3
- data/lib/luca/rails/engine.rb +8 -0
- data/lib/luca/rails/version.rb +1 -2
- data/lib/luca/server.rb +7 -0
- data/lib/luca/stylesheet.rb +35 -0
- data/lib/luca/template.rb +2 -0
- data/lib/luca/template_asset.rb +64 -0
- data/lib/luca/version.rb +3 -0
- data/lib/luca/watcher.rb +72 -0
- data/lib/railties/luca/tasks.rake +7 -0
- data/site/.bundle/config +2 -0
- data/site/.gitignore +5 -0
- data/site/.rvmrc +1 -0
- data/site/CHANGELOG.md +41 -0
- data/site/DOCS.md +41 -0
- data/site/Gemfile +8 -0
- data/site/Gemfile.lock +134 -0
- data/site/LICENSE.md +19 -0
- data/site/config.rb +84 -0
- data/site/helpers/site_helpers.rb +20 -0
- data/site/html5bp-docs/README.md +38 -0
- data/site/html5bp-docs/contribute.md +104 -0
- data/site/html5bp-docs/crossdomain.md +21 -0
- data/site/html5bp-docs/css.md +135 -0
- data/site/html5bp-docs/extend.md +507 -0
- data/site/html5bp-docs/faq.md +77 -0
- data/site/html5bp-docs/htaccess.md +323 -0
- data/site/html5bp-docs/html.md +170 -0
- data/site/html5bp-docs/js.md +31 -0
- data/site/html5bp-docs/misc.md +25 -0
- data/site/html5bp-docs/usage.md +109 -0
- data/site/readme.md +47 -0
- data/site/source/.htaccess +540 -0
- data/site/source/404.html +157 -0
- data/site/source/app/assets/javascripts/dependencies.js.coffee +6 -0
- data/site/source/app/assets/javascripts/docs-docs.js +1 -0
- data/site/source/app/assets/javascripts/docs/application.coffee +64 -0
- data/site/source/app/assets/javascripts/docs/collections/docs_documentation.coffee +17 -0
- data/site/source/app/assets/javascripts/docs/collections/github_repositories.coffee +7 -0
- data/site/source/app/assets/javascripts/docs/collections/index.coffee +1 -0
- data/site/source/app/assets/javascripts/docs/collections/luca_documentation.coffee +17 -0
- data/site/source/app/assets/javascripts/docs/collections/public_gists.coffee +4 -0
- data/site/source/app/assets/javascripts/docs/config.coffee +5 -0
- data/site/source/app/assets/javascripts/docs/index.coffee +12 -0
- data/site/source/app/assets/javascripts/docs/lib/router.coffee +3 -0
- data/{spec/components/application_spec.coffee → site/source/app/assets/javascripts/docs/lib/util.coffee} +0 -0
- data/site/source/app/assets/javascripts/docs/models/component.coffee +99 -0
- data/site/source/app/assets/javascripts/docs/models/github_repository.coffee +3 -0
- data/site/source/app/assets/javascripts/docs/models/index.coffee +1 -0
- data/site/source/app/assets/javascripts/docs/templates/component_documentation.jst.ejs +55 -0
- data/site/source/app/assets/javascripts/docs/templates/examples_browser/overview.jst.ejs +4 -0
- data/site/source/app/assets/javascripts/docs/templates/examples_browser/selector.jst.ejs +11 -0
- data/site/source/app/assets/javascripts/docs/templates/github_repository.jst.ejs +4 -0
- data/site/source/app/assets/javascripts/docs/templates/layouts/main.jst.ejs +4 -0
- data/site/source/app/assets/javascripts/docs/templates/left_navigation.jst.ejs +5 -0
- data/site/source/app/assets/javascripts/docs/templates/pages/getting_started.jst.ejs +78 -0
- data/site/source/app/assets/javascripts/docs/templates/pages/home.jst.ejs +57 -0
- data/site/source/app/assets/javascripts/docs/views/components/code_editor.coffee +45 -0
- data/{spec/components/collection_loader_view_spec.coffee → site/source/app/assets/javascripts/docs/views/components/code_editor/index.coffee} +0 -0
- data/site/source/app/assets/javascripts/docs/views/components/component_documentation.coffee +72 -0
- data/site/source/app/assets/javascripts/docs/views/index.coffee +3 -0
- data/site/source/app/assets/javascripts/docs/views/pages/browse_source.coffee +46 -0
- data/site/source/app/assets/javascripts/docs/views/pages/browse_source/details.coffee +37 -0
- data/site/source/app/assets/javascripts/docs/views/pages/browse_source/list.coffee +31 -0
- data/site/source/app/assets/javascripts/docs/views/pages/component_editor.coffee +10 -0
- data/site/source/app/assets/javascripts/docs/views/pages/examples_browser.coffee +102 -0
- data/site/source/app/assets/javascripts/docs/views/pages/examples_browser/docs.coffee +12 -0
- data/site/source/app/assets/javascripts/docs/views/pages/examples_browser/source.coffee +13 -0
- data/site/source/app/assets/javascripts/docs/views/pages/home.coffee +10 -0
- data/site/source/app/assets/javascripts/docs/views/views/api_browser/index.coffee +43 -0
- data/site/source/app/assets/javascripts/docs/views/views/collection_view_examples/grid_layout_view_example.coffee +14 -0
- data/site/source/app/assets/javascripts/docs/views/views/collection_view_examples/table_view_example.coffee +39 -0
- data/site/source/app/assets/javascripts/docs/views/views/form_view_examples/basic_example.coffee +38 -0
- data/site/source/app/assets/javascripts/docs/views/views/form_view_examples/complex_layout.coffee +110 -0
- data/site/source/app/assets/javascripts/docs/views/views/top_navigation.coffee +6 -0
- data/site/source/app/assets/javascripts/luca-docs.js +1 -0
- data/site/source/app/assets/javascripts/luca-framework-documentation.js +1 -0
- data/site/source/app/assets/javascripts/site.js.coffee +4 -0
- data/site/source/app/assets/javascripts/vendor/codemirror.js +4786 -0
- data/site/source/app/assets/javascripts/vendor/coffeescript.js +346 -0
- data/site/source/app/assets/javascripts/vendor/css.js +465 -0
- data/site/source/app/assets/javascripts/vendor/htmlmixed.js +84 -0
- data/site/source/app/assets/javascripts/vendor/javascript.js +422 -0
- data/site/source/app/assets/javascripts/vendor/js-beautify.js +1353 -0
- data/site/source/app/assets/javascripts/vendor/modernizr-2.6.1.min.js +4 -0
- data/site/source/app/assets/javascripts/vendor/vim.js +2511 -0
- data/site/source/app/assets/stylesheets/docs/api-browser.css.scss +5 -0
- data/site/source/app/assets/stylesheets/docs/application.css.scss +35 -0
- data/site/source/app/assets/stylesheets/docs/browse-source.css.scss +5 -0
- data/site/source/app/assets/stylesheets/docs/scrollable-table.css.scss +5 -0
- data/site/source/app/assets/stylesheets/site.css.scss +2 -0
- data/site/source/app/assets/stylesheets/vendor/codemirror.css +240 -0
- data/site/source/app/assets/stylesheets/vendor/prettify-tomorrow-night-bright.css +160 -0
- data/site/source/app/assets/stylesheets/vendor/twilight.css +26 -0
- data/site/source/crossdomain.xml +15 -0
- data/site/source/documentation.html.haml +1 -0
- data/site/source/favicon_base.png +0 -0
- data/site/source/humans.txt +15 -0
- data/site/source/images/background.png +0 -0
- data/site/source/images/middleman.png +0 -0
- data/site/source/index.html.haml +1 -0
- data/site/source/layouts/layout.haml +55 -0
- data/site/source/readme.md +63 -0
- data/site/source/robots.txt +3 -0
- data/spec/{components/grid_view_spec.coffee → javascripts/components/application_spec.coffee} +0 -0
- data/spec/{components/pagination_control_spec.coffee → javascripts/components/collection_loader_view_spec.coffee} +0 -0
- data/spec/{components → javascripts/components}/collection_view_spec.coffee +1 -1
- data/spec/{components → javascripts/components}/controller_spec.coffee +0 -0
- data/spec/{components → javascripts/components}/fields/checkbox_array_spec.coffee +0 -0
- data/spec/javascripts/components/form_view_spec.coffee +162 -0
- data/spec/{components/record_manager_spec.coffee → javascripts/components/grid_view_spec.coffee} +0 -0
- data/spec/{components → javascripts/components}/multi_collection_view_spec.coffee +0 -0
- data/spec/{components/template_spec.coffee → javascripts/components/pagination_control_spec.coffee} +0 -0
- data/spec/{concerns/paginatable_spec.coffee → javascripts/components/record_manager_spec.coffee} +0 -0
- data/spec/{components → javascripts/components}/table_view_spec.coffee +0 -0
- data/spec/{containers/modal_view_spec.coffee → javascripts/components/template_spec.coffee} +0 -0
- data/spec/{concerns → javascripts/concerns}/collection_event_bindings_spec.coffee +0 -0
- data/spec/{concerns → javascripts/concerns}/dom_helpers_spec.coffee +0 -0
- data/spec/{concerns → javascripts/concerns}/filterable_spec.coffee +0 -0
- data/spec/{concerns → javascripts/concerns}/model_presenter_spec.coffee +0 -0
- data/spec/{containers/panel_view_spec.coffee → javascripts/concerns/paginatable_spec.coffee} +0 -0
- data/spec/{concerns → javascripts/concerns}/state_model_spec.coffee +5 -0
- data/spec/javascripts/containers/card_view_spec.coffee +108 -0
- data/spec/{containers/tab_view_spec.coffee → javascripts/containers/modal_view_spec.coffee} +0 -0
- data/spec/{containers/viewport_spec.coffee → javascripts/containers/panel_view_spec.coffee} +0 -0
- data/spec/{core/observer_spec.coffee → javascripts/containers/tab_view_spec.coffee} +0 -0
- data/spec/{managers/socket_manager_spec.coffee → javascripts/containers/viewport_spec.coffee} +0 -0
- data/spec/{core → javascripts/core}/collection_spec.coffee +1 -1
- data/spec/{core → javascripts/core}/concerns_spec.coffee +0 -0
- data/spec/{core → javascripts/core}/container_spec.coffee +0 -0
- data/spec/{core → javascripts/core}/define_spec.coffee +0 -0
- data/spec/{core → javascripts/core}/events_spec.coffee +0 -0
- data/spec/{core → javascripts/core}/field_spec.coffee +0 -0
- data/spec/{core → javascripts/core}/framework_spec.coffee +0 -0
- data/spec/{core → javascripts/core}/model_spec.coffee +0 -0
- data/spec/javascripts/core/observer_spec.coffee +0 -0
- data/spec/{core → javascripts/core}/util_spec.coffee +0 -0
- data/spec/{core → javascripts/core}/view_spec.coffee +51 -39
- data/spec/{dependencies → javascripts/dependencies}/index.coffee +0 -0
- data/spec/{dependencies → javascripts/dependencies}/jasmine-html.js +0 -0
- data/spec/{dependencies → javascripts/dependencies}/jasmine.js +0 -0
- data/spec/{dependencies → javascripts/dependencies}/sinon.js +0 -0
- data/spec/{helper.coffee → javascripts/helper.coffee} +0 -0
- data/spec/{managers → javascripts/managers}/collection_manager_spec.coffee +0 -0
- data/spec/javascripts/managers/socket_manager_spec.coffee +0 -0
- data/spec/lib/component_definition_spec.rb +63 -0
- data/spec/lib/input_compiler_spec.rb +9 -0
- data/spec/lib/luca_application_spec.rb +30 -0
- data/spec/support/fixtures/application.coffee +45 -0
- data/spec/support/fixtures/component.coffee +34 -0
- data/tutorials/component-definitions.md +0 -0
- data/tutorials/component-definitions/01_intro.md +0 -0
- data/tutorials/component-driven-design.md +140 -0
- data/tutorials/structure-of-a-project.md +63 -0
- data/vendor/assets/javascripts/backbone-min.js +37 -33
- data/vendor/assets/javascripts/backbone-query.min.js +1 -1
- data/vendor/assets/javascripts/hogan.js +707 -0
- data/vendor/assets/javascripts/jquery.js +5 -4
- data/vendor/assets/javascripts/keymaster.min.js +4 -0
- data/vendor/assets/javascripts/luca-dependencies.min.js +8 -0
- data/vendor/assets/javascripts/luca-development.min.js +1 -0
- data/vendor/assets/javascripts/luca-spec.js +6 -6
- data/vendor/assets/javascripts/luca-ui.js +7386 -0
- data/vendor/assets/javascripts/luca-ui.min.js +5 -0
- data/vendor/assets/javascripts/luca.full.min.js +12 -0
- data/vendor/assets/javascripts/luca.min.js +5 -0
- data/vendor/assets/javascripts/underscore-min.js +1 -5
- data/vendor/assets/javascripts/underscore-string.min.js +1 -1
- data/vendor/assets/stylesheets/luca-components.css +202 -0
- data/vendor/assets/stylesheets/luca-development.css +23 -0
- data/vendor/assets/stylesheets/luca-ui.css +198 -0
- metadata +324 -94
- data/app/assets/javascripts/luca/components/base_toolbar.coffee +0 -17
- data/app/assets/javascripts/luca/components/form_button_toolbar.coffee +0 -28
- data/app/assets/javascripts/luca/components/grid_view.coffee +0 -269
- data/app/assets/javascripts/luca/components/page_controller.coffee +0 -7
- data/app/assets/javascripts/luca/components/template.coffee +0 -5
- data/app/assets/javascripts/luca/components/toolbar_dialog.coffee +0 -25
- data/lib/luca/code_browser.rb +0 -55
- data/lib/luca/command_line.rb +0 -69
- data/lib/luca/component_documentation.rb +0 -72
- data/site/assets/bootstrap.min.js +0 -7
- data/site/assets/dependencies.js +0 -94
- data/site/assets/glyphicons-halflings-white.png +0 -0
- data/site/assets/glyphicons-halflings.png +0 -0
- data/site/assets/luca-ui-bootstrap.css +0 -1331
- data/site/assets/luca-ui-bootstrap.js +0 -9
- data/site/assets/luca-ui-development-tools.css +0 -234
- data/site/assets/luca-ui-development-tools.js +0 -18561
- data/site/assets/luca-ui-development-tools.min.js +0 -15
- data/site/assets/luca-ui-full.min.js +0 -8
- data/site/assets/luca-ui.min.js +0 -4
- data/site/assets/sandbox.css +0 -62
- data/site/assets/sandbox.js +0 -469
- data/site/docs/application.html +0 -41
- data/site/docs/caching.html +0 -43
- data/site/docs/collection.html +0 -75
- data/site/docs/collection_manager.html +0 -71
- data/site/docs/containers.html +0 -118
- data/site/docs/events.html +0 -153
- data/site/docs/view.html +0 -128
- data/site/img/glyphicons-halflings-white.png +0 -0
- data/site/img/glyphicons-halflings.png +0 -0
- data/site/index.html +0 -20
- data/site/source-map.js +0 -1
- data/spec/components/form_view_spec.coffee +0 -84
- data/spec/containers/card_view_spec.coffee +0 -50
- data/spec/luca-spec.coffee +0 -9
@@ -1,17 +0,0 @@
|
|
1
|
-
_.def('Luca.components.Toolbar').extends('Luca.Container').with
|
2
|
-
|
3
|
-
toolbar = Luca.register "Luca.components.Toolbar"
|
4
|
-
toolbar.extends "Luca.Container"
|
5
|
-
|
6
|
-
toolbar.defines
|
7
|
-
className: 'luca-ui-toolbar toolbar'
|
8
|
-
|
9
|
-
position: 'bottom'
|
10
|
-
|
11
|
-
prepareComponents: ()->
|
12
|
-
_( @components ).each (component)=>
|
13
|
-
component.container = @$el
|
14
|
-
|
15
|
-
render: ()->
|
16
|
-
$(@container).append(@el)
|
17
|
-
@
|
@@ -1,28 +0,0 @@
|
|
1
|
-
toolbar = Luca.register "Luca.components.FormButtonToolbar"
|
2
|
-
toolbar.extends "Luca.components.Toolbar"
|
3
|
-
|
4
|
-
toolbar.defines
|
5
|
-
className: 'luca-ui-form-toolbar form-actions'
|
6
|
-
|
7
|
-
position: 'bottom'
|
8
|
-
|
9
|
-
includeReset: false
|
10
|
-
|
11
|
-
render: ()->
|
12
|
-
$(@container).append(@el)
|
13
|
-
@
|
14
|
-
|
15
|
-
initialize: (@options={})->
|
16
|
-
Luca.components.Toolbar.prototype.initialize.apply @, arguments
|
17
|
-
|
18
|
-
@components = [
|
19
|
-
ctype: 'button_field'
|
20
|
-
label: 'Submit'
|
21
|
-
class: 'btn submit-button'
|
22
|
-
]
|
23
|
-
|
24
|
-
if @includeReset
|
25
|
-
@components.push
|
26
|
-
ctype: 'button_field'
|
27
|
-
label: 'Reset'
|
28
|
-
class: 'btn reset-button'
|
@@ -1,269 +0,0 @@
|
|
1
|
-
_.def('Luca.components.GridView').extend('Luca.Panel').with
|
2
|
-
|
3
|
-
bodyTemplate: "components/grid_view"
|
4
|
-
|
5
|
-
autoBindEventHandlers: true
|
6
|
-
|
7
|
-
events:
|
8
|
-
"dblclick table tbody tr" : "double_click_handler"
|
9
|
-
"click table tbody tr": "click_handler"
|
10
|
-
|
11
|
-
className: 'luca-ui-g-view'
|
12
|
-
|
13
|
-
rowClass: "luca-ui-g-row"
|
14
|
-
|
15
|
-
wrapperClass: "luca-ui-g-view-wrapper"
|
16
|
-
|
17
|
-
# add whatever additional container classes you want
|
18
|
-
# to be applied to the wrapper here
|
19
|
-
additionalWrapperClasses: []
|
20
|
-
|
21
|
-
# add additional style declarations to the wrapper if you like
|
22
|
-
# these will be added by jquery.css and accept the same syntax
|
23
|
-
wrapperStyles: {}
|
24
|
-
|
25
|
-
scrollable: true
|
26
|
-
|
27
|
-
emptyText: 'No Results To display.'
|
28
|
-
|
29
|
-
# available options are striped, condensed, bordered
|
30
|
-
# or any combination of these, split up by space
|
31
|
-
tableStyle: 'striped'
|
32
|
-
|
33
|
-
# we have to specify height to make the scrollable table portion work
|
34
|
-
defaultHeight: 285
|
35
|
-
|
36
|
-
# unless we specify the width ourselves
|
37
|
-
# the width of the grid will automatically be set to the width of the container
|
38
|
-
# and if it can't be determined, then it will be set to the default
|
39
|
-
defaultWidth: 756
|
40
|
-
|
41
|
-
# the grid should never outgrow its container
|
42
|
-
maxWidth: undefined
|
43
|
-
|
44
|
-
# hooks is configuration sugar
|
45
|
-
# the before:grid:render trigger
|
46
|
-
# will automatically fire the
|
47
|
-
# beforeGridRender function
|
48
|
-
hooks:[
|
49
|
-
"before:grid:render"
|
50
|
-
"before:render:header"
|
51
|
-
"before:render:row"
|
52
|
-
"after:grid:render"
|
53
|
-
"row:double:click"
|
54
|
-
"row:click"
|
55
|
-
"after:collection:load"
|
56
|
-
]
|
57
|
-
|
58
|
-
initialize: (@options={})->
|
59
|
-
_.extend @, @options
|
60
|
-
_.extend @, Luca.concerns.Deferrable
|
61
|
-
|
62
|
-
@loadMask = Luca.config.enableBoostrap unless @loadMask?
|
63
|
-
@loadMaskEl ||= ".luca-ui-g-view-body" if @loadMask is true
|
64
|
-
|
65
|
-
Luca.Panel::initialize.apply(@, arguments)
|
66
|
-
|
67
|
-
@configure_collection(true)
|
68
|
-
|
69
|
-
@collection.bind "before:fetch", ()=>
|
70
|
-
@trigger "enable:loadmask" if @loadMask is true
|
71
|
-
|
72
|
-
@collection.bind "reset", (collection) =>
|
73
|
-
@refresh()
|
74
|
-
@trigger "disable:loadmask" if @loadMask is true
|
75
|
-
@trigger "after:collection:load", collection
|
76
|
-
|
77
|
-
# if a model changes, then we will update the row's contents
|
78
|
-
# by rerendering that row's cells
|
79
|
-
@collection.bind "change", (model)=>
|
80
|
-
return unless @rendered is true
|
81
|
-
|
82
|
-
try
|
83
|
-
rowEl = @getRowEl( model.id || model.get('id') || model.cid )
|
84
|
-
cells = @render_row(model, @collection.indexOf(model), cellsOnly: true )
|
85
|
-
$( rowEl ).html( cells.join(" ") )
|
86
|
-
catch error
|
87
|
-
console.log "Error in change handler for GridView.collection", error, @, model
|
88
|
-
|
89
|
-
beforeRender: ()->
|
90
|
-
Luca.Panel::beforeRender?.apply(@, arguments)
|
91
|
-
|
92
|
-
@trigger "before:grid:render", @
|
93
|
-
|
94
|
-
@table = @$ 'table.luca-ui-g-view'
|
95
|
-
@header = @$ "thead"
|
96
|
-
@body = @$ "tbody"
|
97
|
-
@footer = @$ "tfoot"
|
98
|
-
@wrapper = @$ ".#{ @wrapperClass }"
|
99
|
-
|
100
|
-
@applyCssClasses()
|
101
|
-
|
102
|
-
@setDimensions() if @scrollable
|
103
|
-
|
104
|
-
@renderHeader()
|
105
|
-
|
106
|
-
@emptyMessage()
|
107
|
-
|
108
|
-
$(@container).append @$el
|
109
|
-
|
110
|
-
afterRender: ()->
|
111
|
-
Luca.Panel::afterRender?.apply(@, arguments)
|
112
|
-
|
113
|
-
@rendered = true
|
114
|
-
@refresh()
|
115
|
-
@trigger "after:grid:render", @
|
116
|
-
|
117
|
-
applyCssClasses: ()->
|
118
|
-
@$el.addClass 'scrollable-g-view' if @scrollable
|
119
|
-
|
120
|
-
_( @additionalWrapperClasses ).each (containerClass)=>
|
121
|
-
@wrapper?.addClass( containerClass )
|
122
|
-
|
123
|
-
if Luca.config.enableBoostrap
|
124
|
-
@table.addClass('table')
|
125
|
-
|
126
|
-
_( @tableStyle?.split(" ") ).each (style)=>
|
127
|
-
@table.addClass("table-#{ style }")
|
128
|
-
|
129
|
-
setDimensions: (offset)->
|
130
|
-
@height ||= @defaultHeight
|
131
|
-
|
132
|
-
@$('.luca-ui-g-view-body').height( @height )
|
133
|
-
@$('tbody.scrollable').height( @height - 23 )
|
134
|
-
|
135
|
-
@container_width = do => $(@container).width()
|
136
|
-
|
137
|
-
@width ||= if @container_width > 0 then @container_width else @defaultWidth
|
138
|
-
|
139
|
-
# don't let the grid outgrow its maxWidth
|
140
|
-
@width = _([@width, (@maxWidth || @width)]).max()
|
141
|
-
|
142
|
-
@$('.luca-ui-g-view-body').width @width
|
143
|
-
@$('.luca-ui-g-view-body table').width @width
|
144
|
-
|
145
|
-
@setDefaultColumnWidths()
|
146
|
-
|
147
|
-
resize: (newWidth)->
|
148
|
-
difference = newWidth - @width
|
149
|
-
@width = newWidth
|
150
|
-
|
151
|
-
@$('.luca-ui-g-view-body').width( @width )
|
152
|
-
@$('.luca-ui-g-view-body table').width( @width )
|
153
|
-
|
154
|
-
if @columns.length > 0
|
155
|
-
distribution = difference / @columns.length
|
156
|
-
|
157
|
-
_(@columns).each (col,index)=>
|
158
|
-
column = $(".column-#{ index }", @el )
|
159
|
-
column.width( col.width = col.width + distribution )
|
160
|
-
|
161
|
-
padLastColumn: ()->
|
162
|
-
configured_column_widths = _(@columns).inject (sum, column)->
|
163
|
-
sum = (column.width) + sum
|
164
|
-
, 0
|
165
|
-
|
166
|
-
unused_width = @width - configured_column_widths
|
167
|
-
|
168
|
-
if unused_width > 0
|
169
|
-
@lastColumn().width += unused_width
|
170
|
-
|
171
|
-
setDefaultColumnWidths: ()->
|
172
|
-
default_column_width = if @columns.length > 0 then @width / @columns.length else 200
|
173
|
-
|
174
|
-
_( @columns ).each (column)->
|
175
|
-
parseInt(column.width ||= default_column_width)
|
176
|
-
|
177
|
-
@padLastColumn()
|
178
|
-
|
179
|
-
lastColumn: ()->
|
180
|
-
@columns[ @columns.length - 1 ]
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
emptyMessage: (text="")->
|
185
|
-
text ||= @emptyText
|
186
|
-
@body.html('')
|
187
|
-
@body.append Luca.templates["components/grid_view_empty_text"](colspan:@columns.length,text:text)
|
188
|
-
|
189
|
-
refresh: ()->
|
190
|
-
@body.html('')
|
191
|
-
@collection.each (model,index)=>
|
192
|
-
@render_row.apply(@, [model,index])
|
193
|
-
|
194
|
-
if @collection.models.length == 0
|
195
|
-
@emptyMessage()
|
196
|
-
|
197
|
-
ifLoaded: (fn, scope)->
|
198
|
-
scope ||= @
|
199
|
-
fn ||= ()-> true
|
200
|
-
|
201
|
-
@collection.ifLoaded(fn,scope)
|
202
|
-
|
203
|
-
applyFilter: (values, options={auto:true,refresh:true})->
|
204
|
-
@collection.applyFilter(values, options)
|
205
|
-
|
206
|
-
renderHeader: ()->
|
207
|
-
@trigger "before:render:header"
|
208
|
-
|
209
|
-
headers = _(@columns).map (column,column_index) =>
|
210
|
-
# temporary hack for scrollable grid dimensions.
|
211
|
-
style = if column.width then "width:#{ column.width }px;" else ""
|
212
|
-
|
213
|
-
"<th style='#{ style }' class='column-#{ column_index }'>#{ column.header}</th>"
|
214
|
-
|
215
|
-
@header.append("<tr>#{ headers }</tr>")
|
216
|
-
|
217
|
-
getRowEl: (id)->
|
218
|
-
@$ "[data-record-id=#{ id }]", 'table'
|
219
|
-
|
220
|
-
render_row: (row,row_index, options={})->
|
221
|
-
rowClass = @rowClass
|
222
|
-
|
223
|
-
model_id = if row?.get and row?.attributes then row.get('id') else ''
|
224
|
-
|
225
|
-
@trigger "before:render:row", row, row_index
|
226
|
-
|
227
|
-
cells = _( @columns ).map (column,col_index) =>
|
228
|
-
value = @cell_renderer(row, column, col_index)
|
229
|
-
style = if column.width then "width:#{ column.width }px;" else ""
|
230
|
-
|
231
|
-
display = if _.isUndefined(value) then "" else value
|
232
|
-
|
233
|
-
"<td style='#{ style }' class='column-#{ col_index }'>#{ display }</td>"
|
234
|
-
|
235
|
-
return cells if options.cellsOnly
|
236
|
-
|
237
|
-
altClass = ''
|
238
|
-
if @alternateRowClasses
|
239
|
-
altClass = if row_index % 2 is 0 then "even" else "odd"
|
240
|
-
|
241
|
-
content = "<tr data-record-id='#{ model_id }' data-row-index='#{ row_index }' class='#{ rowClass } #{ altClass }' id='row-#{ row_index }'>#{ cells }</tr>"
|
242
|
-
|
243
|
-
return content if options.contentOnly is true
|
244
|
-
|
245
|
-
@body?.append(content)
|
246
|
-
|
247
|
-
cell_renderer: (row, column, columnIndex )->
|
248
|
-
if _.isFunction column.renderer
|
249
|
-
return column.renderer.apply @, [row,column,columnIndex]
|
250
|
-
else if column.data.match(/\w+\.\w+/)
|
251
|
-
source = row.attributes || row
|
252
|
-
return Luca.util.nestedValue( column.data, source )
|
253
|
-
else
|
254
|
-
return row.get?( column.data ) || row[ column.data ]
|
255
|
-
|
256
|
-
double_click_handler: (e)->
|
257
|
-
me = my = $( e.currentTarget )
|
258
|
-
rowIndex = my.data('row-index')
|
259
|
-
record = @collection.at( rowIndex )
|
260
|
-
@trigger "row:double:click", @, record, rowIndex
|
261
|
-
|
262
|
-
click_handler: (e)->
|
263
|
-
me = my = $( e.currentTarget )
|
264
|
-
rowIndex = my.data('row-index')
|
265
|
-
record = @collection.at( rowIndex )
|
266
|
-
@trigger "row:click", @, record, rowIndex
|
267
|
-
|
268
|
-
$(".#{ @rowClass }", @body ).removeClass('selected-row')
|
269
|
-
me.addClass('selected-row')
|
@@ -1,25 +0,0 @@
|
|
1
|
-
_.def("Luca.components.ToolbarDialog").extends("Luca.View").with
|
2
|
-
className:"luca-ui-toolbar-dialog span well"
|
3
|
-
|
4
|
-
styles:
|
5
|
-
"position" : "absolute"
|
6
|
-
"z-Index" : "3000"
|
7
|
-
"float" : "left"
|
8
|
-
|
9
|
-
initialize: (@options={})->
|
10
|
-
@_super("initialize", @, arguments)
|
11
|
-
|
12
|
-
createWrapper: ()->
|
13
|
-
@make "div",
|
14
|
-
class: "component-picker span4 well"
|
15
|
-
style:
|
16
|
-
"position: absolute; z-index:12000"
|
17
|
-
|
18
|
-
show: ()->
|
19
|
-
@$el.parent().show()
|
20
|
-
|
21
|
-
hide: ()->
|
22
|
-
@$el.parent().hide()
|
23
|
-
|
24
|
-
toggle: ()->
|
25
|
-
@$el.parent().toggle()
|
data/lib/luca/code_browser.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'sinatra/base'
|
2
|
-
|
3
|
-
module Luca
|
4
|
-
class CodeBrowser < Sinatra::Base
|
5
|
-
|
6
|
-
class << self
|
7
|
-
attr_accessor :source_locations, :source_map
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.look_for_source_in location=""
|
11
|
-
@source_locations ||= []
|
12
|
-
@source_locations << "#{ location }/**/*.coffee" if File.exists?(location)
|
13
|
-
|
14
|
-
@source_locations
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.map_source
|
18
|
-
@source_map = {}
|
19
|
-
|
20
|
-
(self.source_locations || []).map do |location|
|
21
|
-
files = Dir.glob( location )
|
22
|
-
files.inject( @source_map ) do |memo, file|
|
23
|
-
definitions = IO.read(file).lines.to_a.grep /_\.def/
|
24
|
-
|
25
|
-
definitions.each do |definition|
|
26
|
-
component = definition.match(/_\.def\(['"](.+)['"]\)\./)
|
27
|
-
|
28
|
-
if component and component[1]
|
29
|
-
componentId = component[1].gsub(/['"].*$/,'')
|
30
|
-
memo[ componentId ] = file if componentId
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
memo
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
@source_map
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.lookup_component component=""
|
42
|
-
map_source[ component ]
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.get_component_source file=""
|
46
|
-
IO.read( file ) rescue ""
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.get_source_for component=""
|
50
|
-
path_to_file = lookup_component( component )
|
51
|
-
get_component_source( path_to_file )
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
55
|
-
end
|
data/lib/luca/command_line.rb
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
require 'optparse'
|
2
|
-
|
3
|
-
module Luca
|
4
|
-
class CommandLine
|
5
|
-
BANNER = <<-EOS
|
6
|
-
luca-ui generator
|
7
|
-
|
8
|
-
used to generate an application skeleton, or components
|
9
|
-
|
10
|
-
example:
|
11
|
-
|
12
|
-
luca new MyApp
|
13
|
-
|
14
|
-
EOS
|
15
|
-
|
16
|
-
attr_accessor :keystore, :arguments
|
17
|
-
|
18
|
-
GRAMMAR = %w{}
|
19
|
-
|
20
|
-
def initialize arguments=[]
|
21
|
-
arguments = arguments.split if arguments.is_a? String
|
22
|
-
parse_options arguments
|
23
|
-
|
24
|
-
if !@options[:action]
|
25
|
-
puts @option_parser.banner
|
26
|
-
exit
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def options
|
31
|
-
@options
|
32
|
-
end
|
33
|
-
|
34
|
-
def parse_options arguments=[]
|
35
|
-
@options = {}
|
36
|
-
|
37
|
-
@option_parser = OptionParser.new do |opts|
|
38
|
-
opts.separator ""
|
39
|
-
opts.separator "Actions:"
|
40
|
-
|
41
|
-
opts.on("-n",'--new APPLICATION_NAME','Create a new luca-ui app skeleton') do |s|
|
42
|
-
@options[:action] = "new"
|
43
|
-
end
|
44
|
-
|
45
|
-
opts.separator ""
|
46
|
-
opts.separator "Common Options:"
|
47
|
-
|
48
|
-
opts.on_tail("-h","--help",'You are looking at it') do
|
49
|
-
puts opts
|
50
|
-
exit
|
51
|
-
end
|
52
|
-
|
53
|
-
opts.on_tail('-v','--version','display Sentry version') do
|
54
|
-
puts "Luca Version #{ Luca::VERSION }"
|
55
|
-
exit
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
@option_parser.banner = BANNER
|
60
|
-
|
61
|
-
arguments.collect! do |arg|
|
62
|
-
GRAMMAR.include?(arg.downcase) ? "--#{ arg.downcase }" : arg
|
63
|
-
end
|
64
|
-
|
65
|
-
@option_parser.parse!( arguments )
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
end
|