luca 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +38 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +27 -0
- data/README.md +45 -42
- data/ROADMAP +6 -29
- data/{assets → app/assets}/images/glyphicons-halflings-white.png +0 -0
- data/{assets → app/assets}/images/glyphicons-halflings.png +0 -0
- data/app/assets/javascripts/luca/basic.coffee +8 -0
- data/{src → app/assets/javascripts/luca}/components/application.coffee +153 -40
- data/{src → app/assets/javascripts/luca}/components/base_toolbar.coffee +2 -2
- data/{src → app/assets/javascripts/luca}/components/collection_loader_view.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/collection_view.coffee +45 -104
- data/app/assets/javascripts/luca/components/controller.coffee +99 -0
- data/{src/core/field.coffee → app/assets/javascripts/luca/components/fields/base.coffee} +1 -1
- data/{src → app/assets/javascripts/luca}/components/fields/button_field.coffee +1 -2
- data/{src → app/assets/javascripts/luca}/components/fields/checkbox_array.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/fields/checkbox_field.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/fields/file_upload_field.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/fields/hidden_field.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/fields/label_field.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/fields/select_field.coffee +8 -4
- data/{src → app/assets/javascripts/luca}/components/fields/text_area_field.coffee +3 -2
- data/{src → app/assets/javascripts/luca}/components/fields/text_field.coffee +2 -3
- data/{src → app/assets/javascripts/luca}/components/fields/type_ahead_field.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/form_button_toolbar.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/form_view.coffee +111 -44
- data/{src → app/assets/javascripts/luca}/components/grid_view.coffee +6 -6
- data/{src → app/assets/javascripts/luca}/components/index.coffee +0 -0
- data/app/assets/javascripts/luca/components/load_mask.coffee +8 -0
- data/app/assets/javascripts/luca/components/multi_collection_view.coffee +92 -0
- data/{src → app/assets/javascripts/luca}/components/nav_bar.coffee +5 -1
- data/app/assets/javascripts/luca/components/page_controller.coffee +7 -0
- data/{src → app/assets/javascripts/luca}/components/pagination_control.coffee +13 -13
- data/{src → app/assets/javascripts/luca}/components/record_manager.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/router.coffee +6 -1
- data/app/assets/javascripts/luca/components/table_view.coffee +89 -0
- data/{src → app/assets/javascripts/luca}/components/template.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/components/toolbar_dialog.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/concerns/application_event_bindings.coffee +1 -1
- data/app/assets/javascripts/luca/concerns/collection_event_bindings.coffee +44 -0
- data/{src → app/assets/javascripts/luca}/concerns/deferrable.coffee +1 -2
- data/{src/plugins → app/assets/javascripts/luca/concerns}/development_tool_helpers.coffee +1 -1
- data/{src → app/assets/javascripts/luca}/concerns/dom_helpers.coffee +10 -7
- data/{src → app/assets/javascripts/luca}/concerns/enhanced_properties.coffee +0 -0
- data/app/assets/javascripts/luca/concerns/filterable.coffee +104 -0
- data/{src → app/assets/javascripts/luca}/concerns/grid_layout.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/concerns/loadmaskable.coffee +17 -11
- data/{src → app/assets/javascripts/luca}/concerns/local_storage.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/concerns/modal_view.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/concerns/model_presenter.coffee +0 -0
- data/{src → app/assets/javascripts/luca}/concerns/paginatable.coffee +6 -14
- data/app/assets/javascripts/luca/concerns/query_collection_bindings.coffee +46 -0
- data/app/assets/javascripts/luca/concerns/sortable.coffee +69 -0
- data/app/assets/javascripts/luca/concerns/state_model.coffee +44 -0
- data/{src → app/assets/javascripts/luca}/concerns/templating.coffee +4 -1
- data/app/assets/javascripts/luca/config.coffee +49 -0
- data/{src → app/assets/javascripts/luca}/containers/card_view.coffee +30 -13
- data/{src/core → app/assets/javascripts/luca/containers}/container.coffee +57 -18
- data/app/assets/javascripts/luca/containers/index.coffee +2 -0
- data/{src → app/assets/javascripts/luca}/containers/modal_view.coffee +1 -1
- data/{src → app/assets/javascripts/luca}/containers/panel_toolbar.coffee +1 -1
- data/{src → app/assets/javascripts/luca}/containers/tab_view.coffee +1 -1
- data/{src → app/assets/javascripts/luca}/containers/viewport.coffee +4 -4
- data/{src → app/assets/javascripts/luca}/core/collection.coffee +58 -49
- data/{src/plugins → app/assets/javascripts/luca/core}/events.coffee +34 -2
- data/app/assets/javascripts/luca/core/index.coffee +12 -0
- data/{src → app/assets/javascripts/luca}/core/model.coffee +1 -1
- data/{src → app/assets/javascripts/luca}/core/observer.coffee +0 -0
- data/app/assets/javascripts/luca/core/panel.coffee +112 -0
- data/app/assets/javascripts/luca/core/registry/component_definition.coffee +318 -0
- data/{src → app/assets/javascripts/luca/core/registry}/concerns.coffee +0 -0
- data/app/assets/javascripts/luca/core/registry/index.coffee +4 -0
- data/app/assets/javascripts/luca/core/registry/meta_data.coffee +97 -0
- data/{src/core → app/assets/javascripts/luca/core/registry}/registry.coffee +10 -6
- data/app/assets/javascripts/luca/core/templates.coffee +47 -0
- data/{src → app/assets/javascripts/luca}/core/view.coffee +69 -11
- data/app/assets/javascripts/luca/dependencies.coffee +7 -0
- data/{src/tools → app/assets/javascripts/luca/development}/code_mirror_field.coffee +2 -1
- data/{src/tools → app/assets/javascripts/luca/development}/console.coffee +6 -5
- data/app/assets/javascripts/luca/development/index.coffee +2 -0
- data/{src → app/assets/javascripts/luca}/framework.coffee +74 -90
- data/app/assets/javascripts/luca/index.coffee +8 -0
- data/{src → app/assets/javascripts/luca}/managers/collection_manager.coffee +16 -7
- data/app/assets/javascripts/luca/managers/index.coffee +2 -0
- data/app/assets/javascripts/luca/managers/socket_manager.coffee +66 -0
- data/{src → app/assets/javascripts/luca}/templates/components/bootstrap_form_controls.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/components/collection_loader_view.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/components/form_alert.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/components/grid_view.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/components/grid_view_empty_text.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/components/load_mask.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/components/nav_bar.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/components/pagination.jst.ejs +0 -0
- data/{src/templates → app/assets/javascripts/luca/templates/components}/table_view.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/containers/basic.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/containers/tab_selector_container.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/containers/tab_view.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/containers/toolbar_wrapper.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/fields/button_field.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/fields/button_field_link.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/fields/checkbox_array.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/fields/checkbox_array_item.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/fields/checkbox_field.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/fields/file_upload_field.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/fields/hidden_field.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/fields/select_field.jst.ejs +0 -0
- data/{src → app/assets/javascripts/luca}/templates/fields/text_area_field.jst.ejs +1 -1
- data/{src → app/assets/javascripts/luca}/templates/fields/text_field.jst.ejs +1 -1
- data/app/assets/javascripts/luca/util/deprecations.coffee +18 -0
- data/app/assets/javascripts/luca/util/index.coffee +3 -0
- data/app/assets/javascripts/luca/util/logging.coffee +15 -0
- data/{src/util.coffee → app/assets/javascripts/luca/util/luca.coffee} +20 -4
- data/{src/core → app/assets/javascripts/luca/util}/script_loader.coffee +0 -0
- data/app/assets/javascripts/luca-ui.js +1 -0
- data/{src/stylesheets → app/assets/stylesheets/luca}/components/checkbox_array.scss +0 -0
- data/app/assets/stylesheets/luca/components/form_view.scss +7 -0
- data/{src/stylesheets → app/assets/stylesheets/luca}/components/grid_view.scss +0 -0
- data/{src/stylesheets → app/assets/stylesheets/luca}/components/load_mask.scss +0 -0
- data/{src/stylesheets → app/assets/stylesheets/luca}/components/viewport.scss +0 -0
- data/{src/stylesheets → app/assets/stylesheets/luca}/containers/container.scss +0 -0
- data/{src/stylesheets → app/assets/stylesheets/luca}/containers/modal_view.scss +0 -0
- data/{src/stylesheets → app/assets/stylesheets/luca}/containers/panels.scss +0 -0
- data/{src/stylesheets → app/assets/stylesheets/luca}/containers/tab_view.scss +0 -0
- data/{src/stylesheets/tools → app/assets/stylesheets/luca/development}/console.scss +0 -0
- data/app/assets/stylesheets/luca/development/index.css +3 -0
- data/app/assets/stylesheets/luca/index.css +4 -0
- data/{src/stylesheets → app/assets/stylesheets/luca}/normalize.scss +0 -0
- data/app.rb +2 -4
- data/lib/generators/luca/application/application_generator.rb +12 -8
- data/lib/generators/luca/application/templates/controller.rb +0 -2
- data/lib/generators/luca/application/templates/index.html.erb +12 -0
- data/lib/generators/luca/application/templates/index.html.haml +1 -0
- data/lib/generators/luca/application/templates/javascripts/application.coffee +18 -0
- data/lib/generators/luca/application/templates/javascripts/collection_manager.coffee +2 -0
- data/lib/generators/luca/application/templates/javascripts/config.coffee +3 -0
- data/lib/generators/luca/application/templates/javascripts/{dependencies.js.coffee → dependencies.coffee} +1 -0
- data/lib/generators/luca/application/templates/javascripts/home.jst.ejs +2 -0
- data/lib/generators/luca/application/templates/javascripts/index.coffee +15 -0
- data/lib/generators/luca/application/templates/javascripts/router.coffee +4 -0
- data/lib/luca/component_documentation.rb +72 -0
- data/lib/luca/rails/engine.rb +4 -0
- data/lib/luca/rails/version.rb +1 -1
- data/lib/luca.rb +1 -1
- data/lib/railties/luca/tasks.rake +31 -0
- data/luca.gemspec +1 -0
- data/spec/components/controller_spec.coffee +62 -0
- data/spec/components/form_view_spec.coffee +4 -0
- data/spec/concerns/collection_event_bindings_spec.coffee +15 -0
- data/spec/concerns/dom_helpers_spec.coffee +2 -2
- data/spec/concerns/filterable_spec.coffee +4 -4
- data/spec/concerns/state_model_spec.coffee +50 -0
- data/spec/core/collection_spec.coffee +25 -0
- data/spec/{concerns_spec.coffee → core/concerns_spec.coffee} +0 -0
- data/spec/core/container_spec.coffee +57 -5
- data/spec/core/define_spec.coffee +116 -0
- data/spec/core/events_spec.coffee +26 -0
- data/spec/core/field_spec.coffee +4 -0
- data/spec/{framework_spec.coffee → core/framework_spec.coffee} +31 -2
- data/spec/{util_spec.coffee → core/util_spec.coffee} +2 -2
- data/spec/core/view_spec.coffee +65 -1
- data/spec/dependencies/index.coffee +3 -0
- data/{assets/javascripts → spec}/dependencies/jasmine-html.js +0 -0
- data/{assets/javascripts → spec}/dependencies/jasmine.js +0 -0
- data/{assets/javascripts → spec}/dependencies/sinon.js +0 -0
- data/spec/luca-spec.coffee +9 -0
- data/vendor/assets/javascripts/backbone-ext.js +21 -0
- data/vendor/assets/javascripts/backbone-min.js +38 -0
- data/vendor/assets/javascripts/backbone-query.min.js +1 -0
- data/vendor/assets/javascripts/bootstrap.min.js +7 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/codemirror-coffeescript.js +0 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/codemirror-css.js +0 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/codemirror-html.js +0 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/codemirror-javascript.js +0 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/codemirror-less.js +0 -0
- data/vendor/assets/javascripts/codemirror-ui.js +503 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/codemirror-vim.js +0 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/codemirror.js +0 -0
- data/vendor/assets/javascripts/inflections.js +656 -0
- data/vendor/assets/javascripts/jasmine-html.js +190 -0
- data/vendor/assets/javascripts/jasmine.js +2476 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/jquery.js +0 -0
- data/vendor/assets/javascripts/luca-spec.js +11 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/modal.js +0 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/modernizr.min.js +0 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/prettify.js +0 -0
- data/vendor/assets/javascripts/sinon.js +3469 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/spin-min.js +0 -0
- data/{assets/javascripts/dependencies → vendor/assets/javascripts}/underscore-min.js +0 -0
- data/vendor/assets/javascripts/underscore-string.min.js +1 -0
- data/vendor/assets/stylesheets/bootstrap-responsive.min.css +9 -0
- data/vendor/assets/stylesheets/bootstrap.min.css +9 -0
- data/{assets → vendor/assets}/stylesheets/codemirror-blackboard.css +0 -0
- data/{assets → vendor/assets}/stylesheets/codemirror-monokai.css +0 -0
- data/{assets → vendor/assets}/stylesheets/codemirror.css +0 -0
- data/{assets → vendor/assets}/stylesheets/jasmine.css +0 -0
- data/vendor/assets/stylesheets/luca-ui.css +0 -601
- data/views/jasmine.erb +2 -2
- metadata +190 -299
- data/assets/javascripts/dependencies/backbone-min.js +0 -37
- data/assets/javascripts/dependencies/backbone-query.min.js +0 -1
- data/assets/javascripts/dependencies/bootstrap.min.js +0 -7
- data/assets/javascripts/dependencies/coffee-script.js +0 -12189
- data/assets/javascripts/dependencies/underscore-string.min.js +0 -14
- data/assets/javascripts/dependencies.coffee +0 -5
- data/assets/javascripts/luca/index.coffee +0 -1
- data/assets/javascripts/luca-templates.js +0 -1
- data/assets/javascripts/luca-ui-base.coffee +0 -1
- data/assets/javascripts/luca-ui-bootstrap.js +0 -1
- data/assets/javascripts/luca-ui-development-tools.coffee +0 -9
- data/assets/javascripts/luca-ui-full.js +0 -3
- data/assets/javascripts/luca-ui-spec.coffee +0 -2
- data/assets/javascripts/luca-ui.js +0 -3
- data/assets/javascripts/sandbox/application.coffee +0 -57
- data/assets/javascripts/sandbox/config.coffee +0 -7
- data/assets/javascripts/sandbox/router.coffee +0 -24
- data/assets/javascripts/sandbox/templates/builder/component_list.luca +0 -1
- data/assets/javascripts/sandbox/templates/builder.luca +0 -2
- data/assets/javascripts/sandbox/templates/main.luca +0 -53
- data/assets/javascripts/sandbox/templates/sandbox/docs_index.luca +0 -1
- data/assets/javascripts/sandbox/templates/sandbox/navigation.luca +0 -8
- data/assets/javascripts/sandbox/templates/sandbox/readme.luca +0 -30
- data/assets/javascripts/sandbox/templates/sandbox.luca +0 -1
- data/assets/javascripts/sandbox/views/builder/builder_canvas.coffee +0 -3
- data/assets/javascripts/sandbox/views/builder/builder_editor.coffee +0 -6
- data/assets/javascripts/sandbox/views/builder/component_list.coffee +0 -38
- data/assets/javascripts/sandbox/views/builder/project_browser.coffee +0 -14
- data/assets/javascripts/sandbox/views/builder.coffee +0 -133
- data/assets/javascripts/sandbox/views/docs_controller.coffee +0 -7
- data/assets/javascripts/sandbox/views/inspector/instance_filter.coffee +0 -18
- data/assets/javascripts/sandbox/views/inspector/instance_list.coffee +0 -0
- data/assets/javascripts/sandbox/views/inspector.coffee +0 -11
- data/assets/javascripts/sandbox/views/top_navigation.coffee +0 -4
- data/assets/javascripts/sandbox.coffee +0 -7
- data/assets/javascripts/spec-dependencies.coffee +0 -4
- data/assets/stylesheets/bootstrap-responsive.min.css +0 -2
- data/assets/stylesheets/bootstrap.min.css +0 -727
- data/assets/stylesheets/luca-ui-bootstrap.css +0 -4
- data/assets/stylesheets/luca-ui-development-tools.css +0 -5
- data/assets/stylesheets/luca-ui-full.css +0 -3
- data/assets/stylesheets/luca-ui-spec.css +0 -3
- data/assets/stylesheets/luca-ui.css +0 -3
- data/assets/stylesheets/prettify.css +0 -40
- data/assets/stylesheets/sandbox/builder.scss +0 -79
- data/assets/stylesheets/sandbox/sandbox.scss +0 -18
- data/assets/stylesheets/sandbox.css +0 -3
- data/assets/stylesheets/themes/amelia-bootstrap.css +0 -826
- data/assets/stylesheets/themes/slate-bootstrap.css +0 -797
- data/assets/stylesheets/themes/superhero-bootstrap.css +0 -830
- data/lib/generators/luca/application/templates/javascripts/application.js +0 -28
- data/lib/generators/luca/application/templates/javascripts/application.js.coffee +0 -20
- data/lib/generators/luca/application/templates/javascripts/config.js +0 -15
- data/lib/generators/luca/application/templates/javascripts/config.js.coffee +0 -9
- data/lib/generators/luca/application/templates/javascripts/dependencies.js +0 -5
- data/lib/generators/luca/application/templates/javascripts/index.js +0 -9
- data/lib/generators/luca/application/templates/javascripts/index.js.coffee +0 -9
- data/lib/generators/luca/application/templates/javascripts/main.js +0 -8
- data/lib/generators/luca/application/templates/javascripts/main.js.coffee +0 -3
- data/lib/generators/luca/application/templates/javascripts/main.jst.ejs +0 -1
- data/lib/generators/luca/application/templates/javascripts/router.js +0 -12
- data/lib/generators/luca/application/templates/javascripts/router.js.coffee +0 -7
- data/spec/containers/column_view_spec.coffee +0 -0
- data/spec/containers/split_view_spec.coffee +0 -0
- data/spec/define_spec.coffee +0 -13
- data/src/components/controller.coffee +0 -65
- data/src/components/load_mask.coffee +0 -3
- data/src/components/multi_collection_view.coffee +0 -121
- data/src/components/page_controller.coffee +0 -2
- data/src/components/table_view.coffee +0 -62
- data/src/concerns/collection_event_bindings.coffee +0 -26
- data/src/concerns/filterable.coffee +0 -82
- data/src/concerns/state_model.coffee +0 -16
- data/src/containers/column_view.coffee +0 -42
- data/src/containers/page_view.coffee +0 -2
- data/src/containers/panel_view.coffee +0 -23
- data/src/containers/split_view.coffee +0 -8
- data/src/core/core.coffee +0 -0
- data/src/core/meta_data.coffee +0 -37
- data/src/core/panel.coffee +0 -118
- data/src/define.coffee +0 -170
- data/src/index.coffee +0 -25
- data/src/managers/socket_manager.coffee +0 -54
- data/src/samples/definition.coffee +0 -49
- data/src/stylesheets/base.scss +0 -0
- data/src/stylesheets/components/form_view.scss +0 -59
- data/src/stylesheets/components/toolbar.scss +0 -0
- data/src/stylesheets/tools/class_browser.scss +0 -32
- data/src/stylesheets/tools/code_editor.scss +0 -24
- data/src/stylesheets/tools/component_tester.scss +0 -26
- data/src/tools/application_inspector.coffee +0 -2
- data/src/tools/code_editor.coffee +0 -258
- data/src/tools/coffee_script_editor.coffee +0 -82
- data/src/tools/collection_inspector.coffee +0 -4
- data/src/tools/collections/components.coffee +0 -59
- data/src/tools/collections/instances.coffee +0 -15
- data/src/tools/component_tester.coffee +0 -462
- data/src/tools/models/components.coffee +0 -25
- data/src/tools/models/instance.coffee +0 -2
- data/src/tools/templates/component_tester/help.luca +0 -14
- data/vendor/assets/javascripts/luca-ui-base.js +0 -5304
- data/vendor/assets/javascripts/luca-ui-bootstrap.js +0 -9
- data/vendor/assets/javascripts/luca-ui-development-tools.js +0 -18561
- data/vendor/assets/javascripts/luca-ui-development-tools.min.js +0 -15
- data/vendor/assets/javascripts/luca-ui-full.js +0 -6319
- data/vendor/assets/javascripts/luca-ui-full.min.js +0 -9
- data/vendor/assets/javascripts/luca-ui-spec.js +0 -6815
- data/vendor/assets/javascripts/luca-ui-templates.js +0 -92
- data/vendor/assets/javascripts/luca-ui.js +0 -6234
- data/vendor/assets/javascripts/luca-ui.min.js +0 -5
- data/vendor/assets/luca-ui/base.css +0 -85
- data/vendor/assets/luca-ui/components/application.js +0 -91
- data/vendor/assets/luca-ui/components/base_toolbar.js +0 -23
- data/vendor/assets/luca-ui/components/controller.js +0 -38
- data/vendor/assets/luca-ui/components/fields/button_field.js +0 -45
- data/vendor/assets/luca-ui/components/fields/checkbox_field.js +0 -43
- data/vendor/assets/luca-ui/components/fields/file_upload_field.js +0 -20
- data/vendor/assets/luca-ui/components/fields/hidden_field.js +0 -20
- data/vendor/assets/luca-ui/components/fields/select_field.js +0 -97
- data/vendor/assets/luca-ui/components/fields/text_area_field.js +0 -48
- data/vendor/assets/luca-ui/components/fields/text_field.js +0 -46
- data/vendor/assets/luca-ui/components/fields/type_ahead_field.js +0 -13
- data/vendor/assets/luca-ui/components/form_button_toolbar.js +0 -32
- data/vendor/assets/luca-ui/components/form_view.css +0 -32
- data/vendor/assets/luca-ui/components/form_view.js +0 -207
- data/vendor/assets/luca-ui/components/grid_view.css +0 -76
- data/vendor/assets/luca-ui/components/grid_view.js +0 -202
- data/vendor/assets/luca-ui/components/record_manager.js +0 -207
- data/vendor/assets/luca-ui/components/router.js +0 -36
- data/vendor/assets/luca-ui/components/template.js +0 -26
- data/vendor/assets/luca-ui/components/toolbar.css +0 -11
- data/vendor/assets/luca-ui/containers/card_view.js +0 -98
- data/vendor/assets/luca-ui/containers/column_view.js +0 -52
- data/vendor/assets/luca-ui/containers/container.css +0 -3
- data/vendor/assets/luca-ui/containers/modal_view.css +0 -0
- data/vendor/assets/luca-ui/containers/modal_view.js +0 -87
- data/vendor/assets/luca-ui/containers/panel_view.js +0 -34
- data/vendor/assets/luca-ui/containers/split_view.js +0 -13
- data/vendor/assets/luca-ui/containers/tab_view.css +0 -16
- data/vendor/assets/luca-ui/containers/tab_view.js +0 -80
- data/vendor/assets/luca-ui/containers/viewport.js +0 -18
- data/vendor/assets/luca-ui/core/collection.js +0 -221
- data/vendor/assets/luca-ui/core/container.js +0 -205
- data/vendor/assets/luca-ui/core/field.js +0 -59
- data/vendor/assets/luca-ui/core/observer.js +0 -42
- data/vendor/assets/luca-ui/core/view.js +0 -127
- data/vendor/assets/luca-ui/framework.js +0 -110
- data/vendor/assets/luca-ui/index.js +0 -5
- data/vendor/assets/luca-ui/managers/collection_manager.js +0 -98
- data/vendor/assets/luca-ui/managers/socket_manager.js +0 -52
- data/vendor/assets/luca-ui/modules/deferrable.js +0 -21
- data/vendor/assets/luca-ui/modules/local_storage.js +0 -81
- data/vendor/assets/luca-ui/normalize.css +0 -359
- data/vendor/assets/luca-ui/stylesheets/base.css +0 -85
- data/vendor/assets/luca-ui/stylesheets/components/form_view.css +0 -32
- data/vendor/assets/luca-ui/stylesheets/components/grid_view.css +0 -76
- data/vendor/assets/luca-ui/stylesheets/components/toolbar.css +0 -11
- data/vendor/assets/luca-ui/stylesheets/containers/container.css +0 -3
- data/vendor/assets/luca-ui/stylesheets/containers/modal_view.css +0 -0
- data/vendor/assets/luca-ui/stylesheets/containers/tab_view.css +0 -16
- data/vendor/assets/luca-ui/stylesheets/normalize.css +0 -359
- data/vendor/assets/luca-ui/templates/components/bootstrap_form_controls.js +0 -4
- data/vendor/assets/luca-ui/templates/components/form_view.js +0 -4
- data/vendor/assets/luca-ui/templates/components/grid_view.js +0 -4
- data/vendor/assets/luca-ui/templates/components/grid_view_empty_text.js +0 -4
- data/vendor/assets/luca-ui/templates/containers/basic.js +0 -4
- data/vendor/assets/luca-ui/templates/containers/tab_selector_container.js +0 -4
- data/vendor/assets/luca-ui/templates/containers/tab_view.js +0 -4
- data/vendor/assets/luca-ui/templates/containers/toolbar_wrapper.js +0 -4
- data/vendor/assets/luca-ui/templates/fields/button_field.js +0 -4
- data/vendor/assets/luca-ui/templates/fields/button_field_link.js +0 -4
- data/vendor/assets/luca-ui/templates/fields/checkbox_field.js +0 -4
- data/vendor/assets/luca-ui/templates/fields/file_upload_field.js +0 -4
- data/vendor/assets/luca-ui/templates/fields/hidden_field.js +0 -4
- data/vendor/assets/luca-ui/templates/fields/select_field.js +0 -4
- data/vendor/assets/luca-ui/templates/fields/text_area_field.js +0 -4
- data/vendor/assets/luca-ui/templates/fields/text_field.js +0 -4
- data/vendor/assets/luca-ui/templates/sample/contents.js +0 -4
- data/vendor/assets/luca-ui/templates/sample/welcome.js +0 -4
@@ -1,205 +0,0 @@
|
|
1
|
-
(function() {
|
2
|
-
|
3
|
-
Luca.core.Container = Luca.View.extend({
|
4
|
-
className: 'luca-ui-container',
|
5
|
-
componentClass: 'luca-ui-panel',
|
6
|
-
isContainer: true,
|
7
|
-
hooks: ["before:components", "before:layout", "after:components", "after:layout", "first:activation"],
|
8
|
-
rendered: false,
|
9
|
-
components: [],
|
10
|
-
initialize: function(options) {
|
11
|
-
this.options = options != null ? options : {};
|
12
|
-
_.extend(this, this.options);
|
13
|
-
this.setupHooks(Luca.core.Container.prototype.hooks);
|
14
|
-
return Luca.View.prototype.initialize.apply(this, arguments);
|
15
|
-
},
|
16
|
-
beforeRender: function() {
|
17
|
-
this.debug("container before render");
|
18
|
-
this.doLayout();
|
19
|
-
return this.doComponents();
|
20
|
-
},
|
21
|
-
doLayout: function() {
|
22
|
-
this.debug("container do layout");
|
23
|
-
this.trigger("before:layout", this);
|
24
|
-
this.prepareLayout();
|
25
|
-
return this.trigger("after:layout", this);
|
26
|
-
},
|
27
|
-
doComponents: function() {
|
28
|
-
this.debug("container do components");
|
29
|
-
this.trigger("before:components", this, this.components);
|
30
|
-
this.prepareComponents();
|
31
|
-
this.createComponents();
|
32
|
-
this.renderComponents();
|
33
|
-
return this.trigger("after:components", this, this.components);
|
34
|
-
},
|
35
|
-
applyPanelConfig: function(panel, panelIndex) {
|
36
|
-
var config, style_declarations;
|
37
|
-
style_declarations = [];
|
38
|
-
if (panel.height) {
|
39
|
-
style_declarations.push("height: " + (_.isNumber(panel.height) ? panel.height + 'px' : panel.height));
|
40
|
-
}
|
41
|
-
if (panel.width) {
|
42
|
-
style_declarations.push("width: " + (_.isNumber(panel.width) ? panel.width + 'px' : panel.width));
|
43
|
-
}
|
44
|
-
if (panel.float) style_declarations.push("float: " + panel.float);
|
45
|
-
return config = {
|
46
|
-
classes: (panel != null ? panel.classes : void 0) || this.componentClass,
|
47
|
-
id: "" + this.cid + "-" + panelIndex,
|
48
|
-
style: style_declarations.join(';')
|
49
|
-
};
|
50
|
-
},
|
51
|
-
prepareLayout: function() {
|
52
|
-
var _this = this;
|
53
|
-
this.debug("container prepare layout");
|
54
|
-
this.componentContainers = _(this.components).map(function(component, index) {
|
55
|
-
return _this.applyPanelConfig.apply(_this, [component, index]);
|
56
|
-
});
|
57
|
-
if (this.appendContainers) {
|
58
|
-
return _(this.componentContainers).each(function(container) {
|
59
|
-
return _this.$el.append(Luca.templates["containers/basic"](container));
|
60
|
-
});
|
61
|
-
}
|
62
|
-
},
|
63
|
-
prepareComponents: function() {
|
64
|
-
var _this = this;
|
65
|
-
this.debug("container prepare components");
|
66
|
-
return this.components = _(this.components).map(function(object, index) {
|
67
|
-
var panel;
|
68
|
-
panel = _this.componentContainers[index];
|
69
|
-
object.container = _this.appendContainers ? "#" + panel.id : _this.el;
|
70
|
-
return object;
|
71
|
-
});
|
72
|
-
},
|
73
|
-
createComponents: function() {
|
74
|
-
var map,
|
75
|
-
_this = this;
|
76
|
-
this.debug("container create components");
|
77
|
-
map = this.componentIndex = {
|
78
|
-
name_index: {},
|
79
|
-
cid_index: {}
|
80
|
-
};
|
81
|
-
this.components = _(this.components).map(function(object, index) {
|
82
|
-
var component;
|
83
|
-
component = _.isObject(object) && object.render && object.trigger ? object : (object.ctype || (object.ctype = Luca.defaultComponentType || "template"), Luca.util.lazyComponent(object));
|
84
|
-
if (!component.container && component.options.container) {
|
85
|
-
component.container = component.options.container;
|
86
|
-
}
|
87
|
-
if (map && (component.cid != null)) map.cid_index[component.cid] = index;
|
88
|
-
if (map && (component.name != null)) {
|
89
|
-
map.name_index[component.name] = index;
|
90
|
-
}
|
91
|
-
return component;
|
92
|
-
});
|
93
|
-
return this.debug("components created", this.components);
|
94
|
-
},
|
95
|
-
renderComponents: function(debugMode) {
|
96
|
-
var _this = this;
|
97
|
-
this.debugMode = debugMode != null ? debugMode : "";
|
98
|
-
this.debug("container render components");
|
99
|
-
return _(this.components).each(function(component) {
|
100
|
-
component.getParent = function() {
|
101
|
-
return _this;
|
102
|
-
};
|
103
|
-
$(component.container).append($(component.el));
|
104
|
-
try {
|
105
|
-
return component.render();
|
106
|
-
} catch (e) {
|
107
|
-
console.log("Error Rendering Component " + (component.name || component.cid), component);
|
108
|
-
console.log(e.message);
|
109
|
-
return console.log(e.stack);
|
110
|
-
}
|
111
|
-
});
|
112
|
-
},
|
113
|
-
firstActivation: function() {
|
114
|
-
var _this = this;
|
115
|
-
return _(this.components).each(function(component) {
|
116
|
-
var activator, _ref;
|
117
|
-
activator = _this;
|
118
|
-
if ((component != null ? component.previously_activated : void 0) !== true) {
|
119
|
-
if (component != null) {
|
120
|
-
if ((_ref = component.trigger) != null) {
|
121
|
-
_ref.apply(component, ["first:activation", [component, activator]]);
|
122
|
-
}
|
123
|
-
}
|
124
|
-
return component.previously_activated = true;
|
125
|
-
}
|
126
|
-
});
|
127
|
-
},
|
128
|
-
select: function(attribute, value, deep) {
|
129
|
-
var components;
|
130
|
-
if (deep == null) deep = false;
|
131
|
-
components = _(this.components).map(function(component) {
|
132
|
-
var matches, test;
|
133
|
-
matches = [];
|
134
|
-
test = component[attribute];
|
135
|
-
if (test === value) matches.push(component);
|
136
|
-
if (deep === true && component.isContainer === true) {
|
137
|
-
matches.push(component.select(attribute, value, true));
|
138
|
-
}
|
139
|
-
return _.compact(matches);
|
140
|
-
});
|
141
|
-
return _.flatten(components);
|
142
|
-
},
|
143
|
-
findComponentByName: function(name, deep) {
|
144
|
-
if (deep == null) deep = false;
|
145
|
-
return this.findComponent(name, "name_index", deep);
|
146
|
-
},
|
147
|
-
findComponentById: function(id, deep) {
|
148
|
-
if (deep == null) deep = false;
|
149
|
-
return this.findComponent(id, "cid_index", deep);
|
150
|
-
},
|
151
|
-
findComponent: function(needle, haystack, deep) {
|
152
|
-
var component, position, sub_container, _ref, _ref2;
|
153
|
-
if (haystack == null) haystack = "name";
|
154
|
-
if (deep == null) deep = false;
|
155
|
-
position = (_ref = this.componentIndex) != null ? _ref[haystack][needle] : void 0;
|
156
|
-
component = (_ref2 = this.components) != null ? _ref2[position] : void 0;
|
157
|
-
if (component) return component;
|
158
|
-
if (deep === true) {
|
159
|
-
sub_container = _(this.components).detect(function(component) {
|
160
|
-
return component != null ? typeof component.findComponent === "function" ? component.findComponent(needle, haystack, true) : void 0 : void 0;
|
161
|
-
});
|
162
|
-
return sub_container != null ? typeof sub_container.findComponent === "function" ? sub_container.findComponent(needle, haystack, true) : void 0 : void 0;
|
163
|
-
}
|
164
|
-
},
|
165
|
-
eachComponent: function(fn, deep) {
|
166
|
-
var _this = this;
|
167
|
-
if (deep == null) deep = true;
|
168
|
-
return _(this.components).each(function(component) {
|
169
|
-
var _ref;
|
170
|
-
fn.apply(component, [component]);
|
171
|
-
if (deep) {
|
172
|
-
return component != null ? (_ref = component.eachComponent) != null ? _ref.apply(component, [fn, deep]) : void 0 : void 0;
|
173
|
-
}
|
174
|
-
});
|
175
|
-
},
|
176
|
-
indexOf: function(name) {
|
177
|
-
var names;
|
178
|
-
names = _(this.components).pluck('name');
|
179
|
-
return _(names).indexOf(name);
|
180
|
-
},
|
181
|
-
activeComponent: function() {
|
182
|
-
if (!this.activeItem) return this;
|
183
|
-
return this.components[this.activeItem];
|
184
|
-
},
|
185
|
-
componentElements: function() {
|
186
|
-
return $("." + this.componentClass, this.el);
|
187
|
-
},
|
188
|
-
getComponent: function(needle) {
|
189
|
-
return this.components[needle];
|
190
|
-
},
|
191
|
-
rootComponent: function() {
|
192
|
-
return !(this.getParent != null);
|
193
|
-
},
|
194
|
-
getRootComponent: function() {
|
195
|
-
if (this.rootComponent()) {
|
196
|
-
return this;
|
197
|
-
} else {
|
198
|
-
return this.getParent().getRootComponent();
|
199
|
-
}
|
200
|
-
}
|
201
|
-
});
|
202
|
-
|
203
|
-
Luca.register("container", "Luca.core.Container");
|
204
|
-
|
205
|
-
}).call(this);
|
@@ -1,59 +0,0 @@
|
|
1
|
-
(function() {
|
2
|
-
|
3
|
-
Luca.core.Field = Luca.View.extend({
|
4
|
-
className: 'luca-ui-text-field luca-ui-field',
|
5
|
-
isField: true,
|
6
|
-
template: 'fields/text_field',
|
7
|
-
labelAlign: 'top',
|
8
|
-
hooks: ["before:validation", "after:validation", "on:change"],
|
9
|
-
statuses: ["warning", "error", "success"],
|
10
|
-
initialize: function(options) {
|
11
|
-
var _ref;
|
12
|
-
this.options = options != null ? options : {};
|
13
|
-
_.extend(this, this.options);
|
14
|
-
Luca.View.prototype.initialize.apply(this, arguments);
|
15
|
-
this.input_id || (this.input_id = _.uniqueId('field'));
|
16
|
-
this.input_name || (this.input_name = this.name);
|
17
|
-
this.helperText || (this.helperText = "");
|
18
|
-
if (this.required && !((_ref = this.label) != null ? _ref.match(/^\*/) : void 0)) {
|
19
|
-
this.label || (this.label = "*" + this.label);
|
20
|
-
}
|
21
|
-
this.inputStyles || (this.inputStyles = "");
|
22
|
-
if (this.disabled) this.disable();
|
23
|
-
this.updateState(this.state);
|
24
|
-
return this.placeHolder || (this.placeHolder = "");
|
25
|
-
},
|
26
|
-
beforeRender: function() {
|
27
|
-
if (Luca.enableBootstrap) this.$el.addClass('control-group');
|
28
|
-
if (this.required) this.$el.addClass('required');
|
29
|
-
this.$el.html(Luca.templates[this.template](this));
|
30
|
-
return this.input = $('input', this.el);
|
31
|
-
},
|
32
|
-
change_handler: function(e) {
|
33
|
-
return this.trigger("on:change", this, e);
|
34
|
-
},
|
35
|
-
disable: function() {
|
36
|
-
return $("input", this.el).attr('disabled', true);
|
37
|
-
},
|
38
|
-
enable: function() {
|
39
|
-
return $("input", this.el).attr('disabled', false);
|
40
|
-
},
|
41
|
-
getValue: function() {
|
42
|
-
return this.input.attr('value');
|
43
|
-
},
|
44
|
-
render: function() {
|
45
|
-
return $(this.container).append(this.$el);
|
46
|
-
},
|
47
|
-
setValue: function(value) {
|
48
|
-
return this.input.attr('value', value);
|
49
|
-
},
|
50
|
-
updateState: function(state) {
|
51
|
-
var _this = this;
|
52
|
-
return _(this.statuses).each(function(cls) {
|
53
|
-
_this.$el.removeClass(cls);
|
54
|
-
return _this.$el.addClass(state);
|
55
|
-
});
|
56
|
-
}
|
57
|
-
});
|
58
|
-
|
59
|
-
}).call(this);
|
@@ -1,42 +0,0 @@
|
|
1
|
-
(function() {
|
2
|
-
var __slice = Array.prototype.slice;
|
3
|
-
|
4
|
-
Luca.Observer = (function() {
|
5
|
-
|
6
|
-
function Observer(options) {
|
7
|
-
var _this = this;
|
8
|
-
this.options = options != null ? options : {};
|
9
|
-
_.extend(this, Backbone.Events);
|
10
|
-
this.type = this.options.type;
|
11
|
-
if (this.options.debugAll) {
|
12
|
-
this.bind("event", function() {
|
13
|
-
var args, t;
|
14
|
-
t = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
|
15
|
-
return console.log("Observed " + _this.type + " " + (t.name || t.id || t.cid), t, _(args).flatten());
|
16
|
-
});
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
Observer.prototype.relay = function() {
|
21
|
-
var args, triggerer;
|
22
|
-
triggerer = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
|
23
|
-
this.trigger("event", triggerer, args);
|
24
|
-
return this.trigger("event:" + args[0], triggerer, args.slice(1));
|
25
|
-
};
|
26
|
-
|
27
|
-
return Observer;
|
28
|
-
|
29
|
-
})();
|
30
|
-
|
31
|
-
Luca.Observer.enableObservers = function(options) {
|
32
|
-
if (options == null) options = {};
|
33
|
-
Luca.enableGlobalObserver = true;
|
34
|
-
Luca.ViewObserver = new Luca.Observer(_.extend(options, {
|
35
|
-
type: "view"
|
36
|
-
}));
|
37
|
-
return Luca.CollectionObserver = new Luca.Observer(_.extend(options, {
|
38
|
-
type: "collection"
|
39
|
-
}));
|
40
|
-
};
|
41
|
-
|
42
|
-
}).call(this);
|
@@ -1,127 +0,0 @@
|
|
1
|
-
(function() {
|
2
|
-
|
3
|
-
Luca.View = Backbone.View.extend({
|
4
|
-
base: 'Luca.View'
|
5
|
-
});
|
6
|
-
|
7
|
-
Luca.View.originalExtend = Backbone.View.extend;
|
8
|
-
|
9
|
-
Luca.View.extend = function(definition) {
|
10
|
-
var _base;
|
11
|
-
_base = definition.render;
|
12
|
-
_base || (_base = function() {
|
13
|
-
var container;
|
14
|
-
container = _.isFunction(this.container) ? this.container() : this.container;
|
15
|
-
if (!($(container) && this.$el)) return this;
|
16
|
-
$(container).append(this.$el);
|
17
|
-
return this;
|
18
|
-
});
|
19
|
-
definition.render = function() {
|
20
|
-
var _this = this;
|
21
|
-
if (this.deferrable) {
|
22
|
-
this.trigger("before:render", this);
|
23
|
-
this.deferrable.bind(this.deferrable_event, _.once(function() {
|
24
|
-
_base.apply(_this, arguments);
|
25
|
-
return _this.trigger("after:render", _this);
|
26
|
-
}));
|
27
|
-
if (!this.deferrable_trigger) this.immediate_trigger = true;
|
28
|
-
if (this.immediate_trigger === true) {
|
29
|
-
return this.deferrable.fetch();
|
30
|
-
} else {
|
31
|
-
return this.bind(this.deferrable_trigger, _.once(function() {
|
32
|
-
return _this.deferrable.fetch();
|
33
|
-
}));
|
34
|
-
}
|
35
|
-
} else {
|
36
|
-
this.trigger("before:render", this);
|
37
|
-
_base.apply(this, arguments);
|
38
|
-
return this.trigger("after:render", this);
|
39
|
-
}
|
40
|
-
};
|
41
|
-
return Luca.View.originalExtend.apply(this, [definition]);
|
42
|
-
};
|
43
|
-
|
44
|
-
_.extend(Luca.View.prototype, {
|
45
|
-
debug: function() {
|
46
|
-
var message, _i, _len, _results;
|
47
|
-
if (!(this.debugMode || (window.LucaDebugMode != null))) return;
|
48
|
-
_results = [];
|
49
|
-
for (_i = 0, _len = arguments.length; _i < _len; _i++) {
|
50
|
-
message = arguments[_i];
|
51
|
-
_results.push(console.log([this.name || this.cid, message]));
|
52
|
-
}
|
53
|
-
return _results;
|
54
|
-
},
|
55
|
-
trigger: function() {
|
56
|
-
if (Luca.enableGlobalObserver) {
|
57
|
-
Luca.ViewObserver || (Luca.ViewObserver = new Luca.Observer({
|
58
|
-
type: "view"
|
59
|
-
}));
|
60
|
-
Luca.ViewObserver.relay(this, arguments);
|
61
|
-
}
|
62
|
-
return Backbone.View.prototype.trigger.apply(this, arguments);
|
63
|
-
},
|
64
|
-
hooks: ["after:initialize", "before:render", "after:render", "first:activation", "activation", "deactivation"],
|
65
|
-
deferrable_event: "reset",
|
66
|
-
initialize: function(options) {
|
67
|
-
var unique,
|
68
|
-
_this = this;
|
69
|
-
this.options = options != null ? options : {};
|
70
|
-
_.extend(this, this.options);
|
71
|
-
if (this.name != null) this.cid = _.uniqueId(this.name);
|
72
|
-
Luca.cache(this.cid, this);
|
73
|
-
unique = _(Luca.View.prototype.hooks.concat(this.hooks)).uniq();
|
74
|
-
this.setupHooks(unique);
|
75
|
-
if (this.autoBindEventHandlers === true) {
|
76
|
-
_(this.events).each(function(handler, event) {
|
77
|
-
if (_.isString(handler)) return _.bindAll(_this, handler);
|
78
|
-
});
|
79
|
-
}
|
80
|
-
this.trigger("after:initialize", this);
|
81
|
-
return this.registerCollectionEvents();
|
82
|
-
},
|
83
|
-
$container: function() {
|
84
|
-
return $(this.container);
|
85
|
-
},
|
86
|
-
setupHooks: function(set) {
|
87
|
-
var _this = this;
|
88
|
-
set || (set = this.hooks);
|
89
|
-
return _(set).each(function(event) {
|
90
|
-
var fn, parts, prefix;
|
91
|
-
parts = event.split(':');
|
92
|
-
prefix = parts.shift();
|
93
|
-
parts = _(parts).map(function(p) {
|
94
|
-
return _.capitalize(p);
|
95
|
-
});
|
96
|
-
fn = prefix + parts.join('');
|
97
|
-
return _this.bind(event, function() {
|
98
|
-
if (_this[fn]) return _this[fn].apply(_this, arguments);
|
99
|
-
});
|
100
|
-
});
|
101
|
-
},
|
102
|
-
getCollectionManager: function() {
|
103
|
-
var _ref;
|
104
|
-
return this.collectionManager || ((_ref = Luca.CollectionManager.get) != null ? _ref.call() : void 0);
|
105
|
-
},
|
106
|
-
registerCollectionEvents: function() {
|
107
|
-
var manager,
|
108
|
-
_this = this;
|
109
|
-
manager = this.getCollectionManager();
|
110
|
-
return _(this.collectionEvents).each(function(handler, signature) {
|
111
|
-
var collection, event, key, _ref;
|
112
|
-
_ref = signature.split(" "), key = _ref[0], event = _ref[1];
|
113
|
-
collection = _this["" + key + "Collection"] = manager.getOrCreate(key);
|
114
|
-
if (!collection) throw "Could not find collection specified by " + key;
|
115
|
-
if (_.isString(handler)) handler = _this[handler];
|
116
|
-
if (!_.isFunction(handler)) throw "invalid collectionEvents configuration";
|
117
|
-
try {
|
118
|
-
return collection.bind(event, handler);
|
119
|
-
} catch (e) {
|
120
|
-
console.log("Error Binding To Collection in registerCollectionEvents", _this);
|
121
|
-
throw e;
|
122
|
-
}
|
123
|
-
});
|
124
|
-
}
|
125
|
-
});
|
126
|
-
|
127
|
-
}).call(this);
|
@@ -1,110 +0,0 @@
|
|
1
|
-
(function() {
|
2
|
-
|
3
|
-
_.mixin(_.string);
|
4
|
-
|
5
|
-
window.Luca = {
|
6
|
-
VERSION: "0.6.1",
|
7
|
-
core: {},
|
8
|
-
containers: {},
|
9
|
-
components: {},
|
10
|
-
modules: {},
|
11
|
-
fields: {},
|
12
|
-
util: {},
|
13
|
-
registry: {
|
14
|
-
classes: {},
|
15
|
-
namespaces: ["Luca.containers", "Luca.components"]
|
16
|
-
},
|
17
|
-
component_cache: {
|
18
|
-
cid_index: {},
|
19
|
-
name_index: {}
|
20
|
-
}
|
21
|
-
};
|
22
|
-
|
23
|
-
Luca.enableBootstrap = true;
|
24
|
-
|
25
|
-
Luca.registry.addNamespace = function(identifier) {
|
26
|
-
Luca.registry.namespaces.push(identifier);
|
27
|
-
return Luca.registry.namespaces = _(Luca.registry.namespaces).uniq();
|
28
|
-
};
|
29
|
-
|
30
|
-
Luca.cache = function(needle, component) {
|
31
|
-
var lookup_id;
|
32
|
-
if (component != null) Luca.component_cache.cid_index[needle] = component;
|
33
|
-
component = Luca.component_cache.cid_index[needle];
|
34
|
-
if ((component != null ? component.component_name : void 0) != null) {
|
35
|
-
Luca.component_cache.name_index[component.component_name] = component.cid;
|
36
|
-
} else if ((component != null ? component.name : void 0) != null) {
|
37
|
-
Luca.component_cache.name_index[component.name] = component.cid;
|
38
|
-
}
|
39
|
-
if (component != null) return component;
|
40
|
-
lookup_id = Luca.component_cache.name_index[needle];
|
41
|
-
return Luca.component_cache.cid_index[lookup_id];
|
42
|
-
};
|
43
|
-
|
44
|
-
Luca.util.nestedValue = function(accessor, source_object) {
|
45
|
-
return _(accessor.split(/\./)).inject(function(obj, key) {
|
46
|
-
return obj = obj != null ? obj[key] : void 0;
|
47
|
-
}, source_object);
|
48
|
-
};
|
49
|
-
|
50
|
-
Luca.registry.lookup = function(ctype) {
|
51
|
-
var c, className, parents;
|
52
|
-
c = Luca.registry.classes[ctype];
|
53
|
-
if (c != null) return c;
|
54
|
-
className = _.camelize(_.capitalize(ctype));
|
55
|
-
parents = _(Luca.registry.namespaces).map(function(namespace) {
|
56
|
-
return Luca.util.nestedValue(namespace, window || global);
|
57
|
-
});
|
58
|
-
return _.first(_.compact(_(parents).map(function(parent) {
|
59
|
-
return parent[className];
|
60
|
-
})));
|
61
|
-
};
|
62
|
-
|
63
|
-
Luca.util.lazyComponent = function(config) {
|
64
|
-
var componentClass, constructor, ctype;
|
65
|
-
ctype = config.ctype;
|
66
|
-
componentClass = Luca.registry.lookup(ctype);
|
67
|
-
if (!componentClass) {
|
68
|
-
throw "Invalid Component Type: " + ctype + ". Did you forget to register it?";
|
69
|
-
}
|
70
|
-
constructor = eval(componentClass);
|
71
|
-
return new constructor(config);
|
72
|
-
};
|
73
|
-
|
74
|
-
Luca.register = function(component, constructor_class) {
|
75
|
-
var exists;
|
76
|
-
exists = Luca.registry.classes[component];
|
77
|
-
if (exists != null) {
|
78
|
-
throw "Can not register component with the signature " + component + ". Already exists";
|
79
|
-
} else {
|
80
|
-
return Luca.registry.classes[component] = constructor_class;
|
81
|
-
}
|
82
|
-
};
|
83
|
-
|
84
|
-
Luca.available_templates = function(filter) {
|
85
|
-
var available;
|
86
|
-
if (filter == null) filter = "";
|
87
|
-
available = _(Luca.templates).keys();
|
88
|
-
if (filter.length > 0) {
|
89
|
-
return _(available).select(function(tmpl) {
|
90
|
-
return tmpl.match(filter);
|
91
|
-
});
|
92
|
-
} else {
|
93
|
-
return available;
|
94
|
-
}
|
95
|
-
};
|
96
|
-
|
97
|
-
Luca.util.isIE = function() {
|
98
|
-
try {
|
99
|
-
Object.defineProperty({}, '', {});
|
100
|
-
return false;
|
101
|
-
} catch (e) {
|
102
|
-
return true;
|
103
|
-
}
|
104
|
-
};
|
105
|
-
|
106
|
-
$((function() {
|
107
|
-
return $('body').addClass('luca-ui-enabled');
|
108
|
-
})());
|
109
|
-
|
110
|
-
}).call(this);
|
@@ -1,98 +0,0 @@
|
|
1
|
-
(function() {
|
2
|
-
var instances;
|
3
|
-
|
4
|
-
instances = [];
|
5
|
-
|
6
|
-
Luca.CollectionManager = (function() {
|
7
|
-
|
8
|
-
CollectionManager.prototype.__collections = {};
|
9
|
-
|
10
|
-
function CollectionManager(options) {
|
11
|
-
this.options = options != null ? options : {};
|
12
|
-
_.extend(this, this.options);
|
13
|
-
_.extend(this, Backbone.Events);
|
14
|
-
instances.push(this);
|
15
|
-
}
|
16
|
-
|
17
|
-
CollectionManager.prototype.add = function(key, collection) {
|
18
|
-
return this.currentScope()[key] = collection;
|
19
|
-
};
|
20
|
-
|
21
|
-
CollectionManager.prototype.allCollections = function() {
|
22
|
-
return _(this.currentScope()).values();
|
23
|
-
};
|
24
|
-
|
25
|
-
CollectionManager.prototype.create = function(key, collectionOptions, initialModels, private) {
|
26
|
-
var CollectionClass, collection;
|
27
|
-
if (collectionOptions == null) collectionOptions = {};
|
28
|
-
if (initialModels == null) initialModels = [];
|
29
|
-
if (private == null) private = false;
|
30
|
-
CollectionClass = collectionOptions.base;
|
31
|
-
CollectionClass || (CollectionClass = this.guessCollectionClass(key));
|
32
|
-
if (private || collectionOptions.private) {
|
33
|
-
collectionOptions.registerWith = "";
|
34
|
-
}
|
35
|
-
collection = new CollectionClass(initialModels, collectionOptions);
|
36
|
-
this.add(key, collection);
|
37
|
-
return collection;
|
38
|
-
};
|
39
|
-
|
40
|
-
CollectionManager.prototype.collectionNamespace = Luca.Collection.namespace;
|
41
|
-
|
42
|
-
CollectionManager.prototype.currentScope = function() {
|
43
|
-
var current_scope, _base;
|
44
|
-
if (current_scope = this.getScope()) {
|
45
|
-
return (_base = this.__collections)[current_scope] || (_base[current_scope] = {});
|
46
|
-
} else {
|
47
|
-
return this.__collections;
|
48
|
-
}
|
49
|
-
};
|
50
|
-
|
51
|
-
CollectionManager.prototype.each = function(fn) {
|
52
|
-
return _(this.all()).each(fn);
|
53
|
-
};
|
54
|
-
|
55
|
-
CollectionManager.prototype.get = function(key) {
|
56
|
-
return this.currentScope()[key];
|
57
|
-
};
|
58
|
-
|
59
|
-
CollectionManager.prototype.getScope = function() {
|
60
|
-
return;
|
61
|
-
};
|
62
|
-
|
63
|
-
CollectionManager.prototype.getOrCreate = function(key, collectionOptions, initialModels) {
|
64
|
-
if (collectionOptions == null) collectionOptions = {};
|
65
|
-
if (initialModels == null) initialModels = [];
|
66
|
-
return this.get(key) || this.create(key, collectionOptions, initialModels, false);
|
67
|
-
};
|
68
|
-
|
69
|
-
CollectionManager.prototype.guessCollectionClass = function(key) {
|
70
|
-
var classified, guess;
|
71
|
-
classified = _(key).chain().capitalize().camelize().value();
|
72
|
-
guess = (this.collectionNamespace || (window || global))[classified];
|
73
|
-
return guess;
|
74
|
-
};
|
75
|
-
|
76
|
-
CollectionManager.prototype.private = function(key, collectionOptions, initialModels) {
|
77
|
-
if (collectionOptions == null) collectionOptions = {};
|
78
|
-
if (initialModels == null) initialModels = [];
|
79
|
-
return this.create(key, collectionOptions, initialModels, true);
|
80
|
-
};
|
81
|
-
|
82
|
-
return CollectionManager;
|
83
|
-
|
84
|
-
})();
|
85
|
-
|
86
|
-
Luca.CollectionManager.destroyAll = function() {
|
87
|
-
return instances = [];
|
88
|
-
};
|
89
|
-
|
90
|
-
Luca.CollectionManager.instances = function() {
|
91
|
-
return instances;
|
92
|
-
};
|
93
|
-
|
94
|
-
Luca.CollectionManager.get = function() {
|
95
|
-
return _(instances).last();
|
96
|
-
};
|
97
|
-
|
98
|
-
}).call(this);
|
@@ -1,52 +0,0 @@
|
|
1
|
-
(function() {
|
2
|
-
|
3
|
-
Luca.SocketManager = (function() {
|
4
|
-
|
5
|
-
function SocketManager(options) {
|
6
|
-
this.options = options != null ? options : {};
|
7
|
-
_.extend(Backbone.Events);
|
8
|
-
this.loadTransport();
|
9
|
-
}
|
10
|
-
|
11
|
-
SocketManager.prototype.connect = function() {
|
12
|
-
switch (this.options.provider) {
|
13
|
-
case "socket.io":
|
14
|
-
return this.socket = io.connect(this.options.socket_host);
|
15
|
-
case "faye.js":
|
16
|
-
return this.socket = new Faye.Client(this.options.socket_host);
|
17
|
-
}
|
18
|
-
};
|
19
|
-
|
20
|
-
SocketManager.prototype.transportLoaded = function() {
|
21
|
-
return this.connect();
|
22
|
-
};
|
23
|
-
|
24
|
-
SocketManager.prototype.transport_script = function() {
|
25
|
-
switch (this.options.provider) {
|
26
|
-
case "socket.io":
|
27
|
-
return "" + this.options.transport_host + "/socket.io/socket.io.js";
|
28
|
-
case "faye.js":
|
29
|
-
return "" + this.options.transport_host + "/faye.js";
|
30
|
-
}
|
31
|
-
};
|
32
|
-
|
33
|
-
SocketManager.prototype.loadTransport = function() {
|
34
|
-
var script,
|
35
|
-
_this = this;
|
36
|
-
script = document.createElement('script');
|
37
|
-
script.setAttribute("type", "text/javascript");
|
38
|
-
script.setAttribute("src", this.transport_script());
|
39
|
-
script.onload = this.transportLoaded;
|
40
|
-
if (Luca.util.isIE()) {
|
41
|
-
script.onreadystatechange = function() {
|
42
|
-
if (script.readyState === "loaded") return _this.transportLoaded();
|
43
|
-
};
|
44
|
-
}
|
45
|
-
return document.getElementsByTagName('head')[0].appendChild(script);
|
46
|
-
};
|
47
|
-
|
48
|
-
return SocketManager;
|
49
|
-
|
50
|
-
})();
|
51
|
-
|
52
|
-
}).call(this);
|