lanes 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.jshintrc +3 -0
- data/Gemfile +9 -0
- data/Guardfile +15 -0
- data/LICENSE-MIT.txt +21 -0
- data/README.md +15 -0
- data/Rakefile +74 -0
- data/bin/lanes +5 -0
- data/client/images/ajax-loader.gif +0 -0
- data/client/images/dataTables/Sorting icons.psd +0 -0
- data/client/images/dataTables/back_disabled.png +0 -0
- data/client/images/dataTables/back_enabled.png +0 -0
- data/client/images/dataTables/back_enabled_hover.png +0 -0
- data/client/images/dataTables/favicon.ico +0 -0
- data/client/images/dataTables/forward_disabled.png +0 -0
- data/client/images/dataTables/forward_enabled.png +0 -0
- data/client/images/dataTables/forward_enabled_hover.png +0 -0
- data/client/images/dataTables/loading-background.png +0 -0
- data/client/images/dataTables/sort_asc.png +0 -0
- data/client/images/dataTables/sort_asc_disabled.png +0 -0
- data/client/images/dataTables/sort_both.png +0 -0
- data/client/images/dataTables/sort_desc.png +0 -0
- data/client/images/dataTables/sort_desc_disabled.png +0 -0
- data/client/images/logo-sm.png +0 -0
- data/client/javascripts/component/Base.coffee +39 -0
- data/client/javascripts/component/ChoicesInput.coffee +47 -0
- data/client/javascripts/component/Grid.coffee +199 -0
- data/client/javascripts/component/ModalDialog.coffee +44 -0
- data/client/javascripts/component/PopOver.coffee +52 -0
- data/client/javascripts/component/RadioGroup.coffee +59 -0
- data/client/javascripts/component/RecordFinder.coffee +143 -0
- data/client/javascripts/component/SelectField.coffee +43 -0
- data/client/javascripts/component/TaggedField.coffee +27 -0
- data/client/javascripts/component/grid/Editor.coffee +65 -0
- data/client/javascripts/component/grid/PopOverEditor.coffee +29 -0
- data/client/javascripts/component/grid/RowEditor.coffee +31 -0
- data/client/javascripts/component/grid/popover-editor.html +18 -0
- data/client/javascripts/component/grid/row-editor.html +16 -0
- data/client/javascripts/component/grid.html +4 -0
- data/client/javascripts/component/index.js +5 -0
- data/client/javascripts/component/modal.html +17 -0
- data/client/javascripts/component/popover.html +5 -0
- data/client/javascripts/component/record-finder/clause.skr +35 -0
- data/client/javascripts/component/record-finder/dialog.skr +4 -0
- data/client/javascripts/component/record-finder/field.skr +8 -0
- data/client/javascripts/data/Bootstrap.coffee +8 -0
- data/client/javascripts/data/ChangeSet.coffee +50 -0
- data/client/javascripts/data/Collection.coffee +111 -0
- data/client/javascripts/data/Config.coffee +15 -0
- data/client/javascripts/data/Model.coffee +269 -0
- data/client/javascripts/data/PubSub.coffee +68 -0
- data/client/javascripts/data/Query.coffee +184 -0
- data/client/javascripts/data/Roles.coffee +91 -0
- data/client/javascripts/data/Screens.coffee +157 -0
- data/client/javascripts/data/Sync.coffee +62 -0
- data/client/javascripts/data/User.coffee +70 -0
- data/client/javascripts/data/index.js +7 -0
- data/client/javascripts/data/mixins/HasCodeField.coffee +13 -0
- data/client/javascripts/extension/Base.coffee +9 -0
- data/client/javascripts/extension/Extensions.coffee +17 -0
- data/client/javascripts/extension/GlAccounts.coffee +9 -0
- data/client/javascripts/extension/index.js +6 -0
- data/client/javascripts/extension/load.js.erb +3 -0
- data/client/javascripts/lanes-complete.js +3 -0
- data/client/javascripts/lanes-workspace.js +1 -0
- data/client/javascripts/lib/MakeBaseClass.coffee +55 -0
- data/client/javascripts/lib/ModuleSupport.coffee +22 -0
- data/client/javascripts/lib/Templates.coffee +47 -0
- data/client/javascripts/lib/create-namespace.js +0 -0
- data/client/javascripts/lib/debounce.coffee +15 -0
- data/client/javascripts/lib/defer.coffee +7 -0
- data/client/javascripts/lib/el.js +115 -0
- data/client/javascripts/lib/index.js +9 -0
- data/client/javascripts/lib/loader.coffee +95 -0
- data/client/javascripts/lib/namespace.coffee +9 -0
- data/client/javascripts/lib/noConflict.coffee +14 -0
- data/client/javascripts/lib/promise_helpers.coffee +4 -0
- data/client/javascripts/lib/results.coffee +15 -0
- data/client/javascripts/lib/underscore.inflection.js +210 -0
- data/client/javascripts/lib/utilFunctions.coffee +51 -0
- data/client/javascripts/plugins/ResizeSensor.js +144 -0
- data/client/javascripts/plugins/index.js +4 -0
- data/client/javascripts/plugins/overlay.coffee +41 -0
- data/client/javascripts/plugins/trigger.coffee +15 -0
- data/client/javascripts/vendor/bootstrap/affix.js +142 -0
- data/client/javascripts/vendor/bootstrap/alert.js +92 -0
- data/client/javascripts/vendor/bootstrap/button.js +110 -0
- data/client/javascripts/vendor/bootstrap/carousel.js +223 -0
- data/client/javascripts/vendor/bootstrap/collapse.js +170 -0
- data/client/javascripts/vendor/bootstrap/dropdown.js +151 -0
- data/client/javascripts/vendor/bootstrap/modal.js +280 -0
- data/client/javascripts/vendor/bootstrap/popover.js +113 -0
- data/client/javascripts/vendor/bootstrap/scrollspy.js +170 -0
- data/client/javascripts/vendor/bootstrap/tab.js +128 -0
- data/client/javascripts/vendor/bootstrap/tooltip.js +457 -0
- data/client/javascripts/vendor/bootstrap/transition.js +59 -0
- data/client/javascripts/vendor/dataTables/dataTables.bootstrap.js +156 -0
- data/client/javascripts/vendor/dataTables/dataTables.scroller.js +1185 -0
- data/client/javascripts/vendor/dataTables/datatables.responsive.js +666 -0
- data/client/javascripts/vendor/dataTables/index.js +2 -0
- data/client/javascripts/vendor/dataTables/jquery.dataTables.js +14380 -0
- data/client/javascripts/vendor/jquery-2.js +9190 -0
- data/client/javascripts/vendor/jquery.tap.js +401 -0
- data/client/javascripts/vendor/magicsuggest.js +1565 -0
- data/client/javascripts/vendor/message-bus.js +285 -0
- data/client/javascripts/vendor/modern-stack.js +14 -0
- data/client/javascripts/vendor/packaged.js +13769 -0
- data/client/javascripts/view/Assets.coffee +9 -0
- data/client/javascripts/view/Base.coffee +231 -0
- data/client/javascripts/view/FormBindings.coffee +98 -0
- data/client/javascripts/view/Functions.coffee +13 -0
- data/client/javascripts/view/Helpers.coffee +77 -0
- data/client/javascripts/view/InterfaceState.coffee +88 -0
- data/client/javascripts/view/Keys.coffee +59 -0
- data/client/javascripts/view/ModelObserver.coffee +31 -0
- data/client/javascripts/view/ModelUpdate.coffee +8 -0
- data/client/javascripts/view/PubSub.coffee +29 -0
- data/client/javascripts/view/RenderContext.coffee +32 -0
- data/client/javascripts/view/SaveNotify.coffee +30 -0
- data/client/javascripts/view/Screen.coffee +30 -0
- data/client/javascripts/view/TimedHighlight.coffee +38 -0
- data/client/javascripts/view/TimedMask.coffee +65 -0
- data/client/javascripts/view/_button.html +3 -0
- data/client/javascripts/view/_toolbar.html +27 -0
- data/client/javascripts/view/index.js +10 -0
- data/client/javascripts/view/mixins/ScreenChangeListener.coffee +43 -0
- data/client/javascripts/view/model-update.html +13 -0
- data/client/javascripts/view/screen-definitions.js.erb +7 -0
- data/client/javascripts/workspace/ActiveScreensSwitcher.coffee +117 -0
- data/client/javascripts/workspace/Instance.es6 +60 -0
- data/client/javascripts/workspace/Layout.coffee +18 -0
- data/client/javascripts/workspace/LoginDialog.coffee +33 -0
- data/client/javascripts/workspace/Navbar.coffee +44 -0
- data/client/javascripts/workspace/Pages.coffee +46 -0
- data/client/javascripts/workspace/ScreensMenu.coffee +126 -0
- data/client/javascripts/workspace/index.js +12 -0
- data/client/javascripts/workspace/layout.html +4 -0
- data/client/javascripts/workspace/login-dialog.html +16 -0
- data/client/javascripts/workspace/menu.html +356 -0
- data/client/javascripts/workspace/menu_toggle.html +9 -0
- data/client/javascripts/workspace/navbar.html +19 -0
- data/client/javascripts/workspace/pages.html +6 -0
- data/client/javascripts/workspace/screens-menu.html +11 -0
- data/client/javascripts/workspace/screens-switcher.html +7 -0
- data/client/javascripts/workspace/tab.html +0 -0
- data/client/screens/user-management/UserEditScreen.coffee +21 -0
- data/client/screens/user-management/UserManagement.coffee +24 -0
- data/client/screens/user-management/grid-popover-editor.html +33 -0
- data/client/screens/user-management/index.css +4 -0
- data/client/screens/user-management/index.js +2 -0
- data/client/screens/user-management/user-management-styles.scss +7 -0
- data/client/screens/user-management/user-management.html +8 -0
- data/client/stylesheets/compoonents/all.scss +6 -0
- data/client/stylesheets/compoonents/changes-notification.scss +44 -0
- data/client/stylesheets/compoonents/grid-editors.scss +65 -0
- data/client/stylesheets/compoonents/grid.scss +301 -0
- data/client/stylesheets/compoonents/modal-dialog.scss +23 -0
- data/client/stylesheets/compoonents/record-finder.scss +71 -0
- data/client/stylesheets/compoonents/suggest.scss +266 -0
- data/client/stylesheets/fonts/icomoon.eot +0 -0
- data/client/stylesheets/fonts/icomoon.svg +160 -0
- data/client/stylesheets/fonts/icomoon.ttf +0 -0
- data/client/stylesheets/fonts/icomoon.woff +0 -0
- data/client/stylesheets/fonts/selection.json +3565 -0
- data/client/stylesheets/fonts/style.css +451 -0
- data/client/stylesheets/fonts.scss +38 -0
- data/client/stylesheets/forms.scss +75 -0
- data/client/stylesheets/index.css +4 -0
- data/client/stylesheets/keybindings.scss +6 -0
- data/client/stylesheets/lanes-workspace.scss +17 -0
- data/client/stylesheets/layout.scss +272 -0
- data/client/stylesheets/plugins/all.scss +2 -0
- data/client/stylesheets/plugins/overlay.scss +63 -0
- data/client/stylesheets/plugins/resize-sensor.scss +24 -0
- data/client/stylesheets/screens.scss +66 -0
- data/client/stylesheets/tabs.scss +148 -0
- data/client/stylesheets/vendor/bootstrap/_alerts.scss +68 -0
- data/client/stylesheets/vendor/bootstrap/_badges.scss +57 -0
- data/client/stylesheets/vendor/bootstrap/_breadcrumbs.scss +26 -0
- data/client/stylesheets/vendor/bootstrap/_button-groups.scss +240 -0
- data/client/stylesheets/vendor/bootstrap/_buttons.scss +157 -0
- data/client/stylesheets/vendor/bootstrap/_carousel.scss +243 -0
- data/client/stylesheets/vendor/bootstrap/_close.scss +35 -0
- data/client/stylesheets/vendor/bootstrap/_code.scss +68 -0
- data/client/stylesheets/vendor/bootstrap/_component-animations.scss +35 -0
- data/client/stylesheets/vendor/bootstrap/_dropdowns.scss +215 -0
- data/client/stylesheets/vendor/bootstrap/_forms.scss +538 -0
- data/client/stylesheets/vendor/bootstrap/_glyphicons.scss +237 -0
- data/client/stylesheets/vendor/bootstrap/_grid.scss +84 -0
- data/client/stylesheets/vendor/bootstrap/_input-groups.scss +166 -0
- data/client/stylesheets/vendor/bootstrap/_jumbotron.scss +48 -0
- data/client/stylesheets/vendor/bootstrap/_labels.scss +66 -0
- data/client/stylesheets/vendor/bootstrap/_list-group.scss +132 -0
- data/client/stylesheets/vendor/bootstrap/_media.scss +56 -0
- data/client/stylesheets/vendor/bootstrap/_mixins.scss +39 -0
- data/client/stylesheets/vendor/bootstrap/_modals.scss +150 -0
- data/client/stylesheets/vendor/bootstrap/_navbar.scss +659 -0
- data/client/stylesheets/vendor/bootstrap/_navs.scss +242 -0
- data/client/stylesheets/vendor/bootstrap/_normalize.scss +425 -0
- data/client/stylesheets/vendor/bootstrap/_pager.scss +55 -0
- data/client/stylesheets/vendor/bootstrap/_pagination.scss +88 -0
- data/client/stylesheets/vendor/bootstrap/_panels.scss +243 -0
- data/client/stylesheets/vendor/bootstrap/_popovers.scss +133 -0
- data/client/stylesheets/vendor/bootstrap/_print.scss +101 -0
- data/client/stylesheets/vendor/bootstrap/_progress-bars.scss +105 -0
- data/client/stylesheets/vendor/bootstrap/_responsive-embed.scss +34 -0
- data/client/stylesheets/vendor/bootstrap/_responsive-utilities.scss +174 -0
- data/client/stylesheets/vendor/bootstrap/_scaffolding.scss +150 -0
- data/client/stylesheets/vendor/bootstrap/_tables.scss +233 -0
- data/client/stylesheets/vendor/bootstrap/_theme.scss +258 -0
- data/client/stylesheets/vendor/bootstrap/_thumbnails.scss +38 -0
- data/client/stylesheets/vendor/bootstrap/_tooltip.scss +95 -0
- data/client/stylesheets/vendor/bootstrap/_type.scss +304 -0
- data/client/stylesheets/vendor/bootstrap/_utilities.scss +57 -0
- data/client/stylesheets/vendor/bootstrap/_variables.scss +850 -0
- data/client/stylesheets/vendor/bootstrap/_wells.scss +29 -0
- data/client/stylesheets/vendor/bootstrap/bootstrap.scss +50 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_alerts.scss +14 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_background-variant.scss +11 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_border-radius.scss +18 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_buttons.scss +50 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_center-block.scss +7 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_clearfix.scss +22 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_forms.scss +84 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_gradients.scss +58 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_grid-framework.scss +81 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_grid.scss +122 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_hide-text.scss +21 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_image.scss +34 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_labels.scss +12 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_list-group.scss +31 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_nav-divider.scss +10 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_nav-vertical-align.scss +9 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_opacity.scss +8 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_pagination.scss +23 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_panels.scss +24 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_progress-bar.scss +10 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_reset-filter.scss +8 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_resize.scss +6 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_responsive-visibility.scss +21 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_size.scss +10 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_tab-focus.scss +9 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_table-row.scss +28 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_text-emphasis.scss +11 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_text-overflow.scss +8 -0
- data/client/stylesheets/vendor/bootstrap/mixins/_vendor-prefixes.scss +219 -0
- data/client/stylesheets/vendor/bootstrap-custom-grid.scss +85 -0
- data/client/stylesheets/vendor/bootstrap-custom-modals.scss +150 -0
- data/client/stylesheets/vendor/bootstrap.scss +69 -0
- data/client/stylesheets/vendor/dataTables.scss +4 -0
- data/config/database.yml +9 -0
- data/config/puma.rb +7 -0
- data/config.ru +4 -0
- data/db/migrate/20140615031600_create_hip_users.rb +17 -0
- data/db/seed.rb +37 -0
- data/foo/Gemfile +5 -0
- data/foo/Guardfile +13 -0
- data/foo/foo/Gemfile +5 -0
- data/foo/foo/lib/foo.rb +7 -0
- data/foo/lib/foo/version.rb +3 -0
- data/foo/lib/foo.rb +8 -0
- data/lanes.gemspec +54 -0
- data/lib/generators/lanes/migrations/install_generator.rb +42 -0
- data/lib/lanes/access/locked_fields.rb +43 -0
- data/lib/lanes/access/role.rb +58 -0
- data/lib/lanes/access/role_collection.rb +75 -0
- data/lib/lanes/access/roles/administrator.rb +25 -0
- data/lib/lanes/access/roles/support.rb +13 -0
- data/lib/lanes/access/user_maint_screen.rb +32 -0
- data/lib/lanes/access.rb +50 -0
- data/lib/lanes/api/asset_pipeline.rb +59 -0
- data/lib/lanes/api/authentication_helper.rb +21 -0
- data/lib/lanes/api/authentication_provider.rb +45 -0
- data/lib/lanes/api/controller.rb +290 -0
- data/lib/lanes/api/default_routes.rb +35 -0
- data/lib/lanes/api/eco.js +516 -0
- data/lib/lanes/api/error_formatter.rb +37 -0
- data/lib/lanes/api/helper_methods.rb +32 -0
- data/lib/lanes/api/javascript_processor.rb +116 -0
- data/lib/lanes/api/pub_sub.rb +33 -0
- data/lib/lanes/api/request_wrapper.rb +42 -0
- data/lib/lanes/api/root.rb +103 -0
- data/lib/lanes/api/skr_templates.rb +60 -0
- data/lib/lanes/api/test_specs.rb +59 -0
- data/lib/lanes/api/updates.rb +38 -0
- data/lib/lanes/api.rb +27 -0
- data/lib/lanes/cli.rb +13 -0
- data/lib/lanes/concerns/all.rb +16 -0
- data/lib/lanes/concerns/api_path.rb +21 -0
- data/lib/lanes/concerns/association_extensions.rb +85 -0
- data/lib/lanes/concerns/attr_accessor_with_default.rb +62 -0
- data/lib/lanes/concerns/code_identifier.rb +43 -0
- data/lib/lanes/concerns/export_associations.rb +52 -0
- data/lib/lanes/concerns/export_join_tables.rb +39 -0
- data/lib/lanes/concerns/export_methods.rb +104 -0
- data/lib/lanes/concerns/export_scope.rb +66 -0
- data/lib/lanes/concerns/exported_limit_evaluator.rb +17 -0
- data/lib/lanes/concerns/immutable_model.rb +32 -0
- data/lib/lanes/concerns/locked_fields.rb +84 -0
- data/lib/lanes/concerns/pub_sub.rb +105 -0
- data/lib/lanes/concerns/queries.rb +20 -0
- data/lib/lanes/concerns/random_hash_code.rb +40 -0
- data/lib/lanes/concerns/sanitize_api_data.rb +15 -0
- data/lib/lanes/concerns/set_attribute_data.rb +154 -0
- data/lib/lanes/concerns/track_modifications.rb +51 -0
- data/lib/lanes/concerns/visible_id_identifier.rb +53 -0
- data/lib/lanes/configuration.rb +85 -0
- data/lib/lanes/db/migration_helpers.rb +178 -0
- data/lib/lanes/db/migrations.rb +13 -0
- data/lib/lanes/db/seed.rb +27 -0
- data/lib/lanes/db.rb +86 -0
- data/lib/lanes/environment.rb +19 -0
- data/lib/lanes/extension.rb +72 -0
- data/lib/lanes/generators/app/Gemfile +5 -0
- data/lib/lanes/generators/app/Guardfile +13 -0
- data/lib/lanes/generators/app/Rakefile +9 -0
- data/lib/lanes/generators/app/config/database.yml +9 -0
- data/lib/lanes/generators/app/config.ru +4 -0
- data/lib/lanes/generators/app/lib/main_class/version.rb +3 -0
- data/lib/lanes/generators/app/lib/main_class.rb +8 -0
- data/lib/lanes/generators/app.rb +36 -0
- data/lib/lanes/guard_tasks.rb +44 -0
- data/lib/lanes/logger.rb +37 -0
- data/lib/lanes/model.rb +26 -0
- data/lib/lanes/numbers.rb +72 -0
- data/lib/lanes/rails_engine.rb +5 -0
- data/lib/lanes/screens.rb +126 -0
- data/lib/lanes/spec_asset_expander.rb +43 -0
- data/lib/lanes/strings.rb +56 -0
- data/lib/lanes/user.rb +127 -0
- data/lib/lanes/validators/all.rb +2 -0
- data/lib/lanes/validators/email.rb +17 -0
- data/lib/lanes/validators/set.rb +18 -0
- data/lib/lanes/version.rb +5 -0
- data/lib/lanes.rb +22 -0
- data/npm-build/README +1 -0
- data/npm-build/compile.coffee +15 -0
- data/npm-build/package.json +59 -0
- data/npm-build/shims/underscore.js +1416 -0
- data/npm-build/template.js +33 -0
- data/public/javascripts/jasmine_examples/Player.js +22 -0
- data/public/javascripts/jasmine_examples/Song.js +7 -0
- data/spec/api/javascript_processor_spec.rb +107 -0
- data/spec/api/user_spec.rb +52 -0
- data/spec/client/component/ChoicesInputSpec.coffee +12 -0
- data/spec/client/component/foo_spec.coffee +4 -0
- data/spec/client/foo_spec.js +0 -0
- data/spec/client/jasmine_examples/PlayerSpec.js +0 -0
- data/spec/client/support/jasmine.yml +128 -0
- data/spec/client/support/jasmine_helper.rb +15 -0
- data/spec/concerns/api_path_spec.rb +14 -0
- data/spec/concerns/association_extensions_spec.rb +30 -0
- data/spec/concerns/attr_accessor_with_default_spec.rb +57 -0
- data/spec/concerns/code_identifier_spec.rb +45 -0
- data/spec/concerns/export_associations_spec.rb +7 -0
- data/spec/concerns/export_methods_spec.rb +43 -0
- data/spec/concerns/export_scope_spec.rb +15 -0
- data/spec/concerns/exported_limits_spec.rb +47 -0
- data/spec/concerns/pub_sub_spec.rb +83 -0
- data/spec/concerns/set_attribute_data_spec.rb +66 -0
- data/spec/configuration_spec.rb +26 -0
- data/spec/fixtures/lanes/users.yml +13 -0
- data/spec/helpers/.gitkeep +0 -0
- data/spec/helpers/SpecHelper.js +18 -0
- data/spec/locked_fields_spec.rb +27 -0
- data/spec/numbers_spec.rb +26 -0
- data/spec/role_collection_spec.rb +19 -0
- data/spec/spec_helper.rb +163 -0
- data/spec/strings_spec.rb +41 -0
- data/spec/testing_models.rb +54 -0
- data/spec/user_role_spec.rb +7 -0
- data/spec/user_spec.rb +53 -0
- data/tasks/migrations.rake +22 -0
- data/tasks/publish.rake +8 -0
- data/views/index.erb +29 -0
- data/views/specs.erb +25 -0
- data/yard_ext/all.rb +9 -0
- data/yard_ext/code_identifier_handler.rb +33 -0
- data/yard_ext/concern_meta_methods.rb +60 -0
- data/yard_ext/config_options.rb +27 -0
- data/yard_ext/exported_scope.rb +4 -0
- data/yard_ext/immutable_handler.rb +17 -0
- data/yard_ext/json_attr_accessor.rb +22 -0
- data/yard_ext/locked_fields_handler.rb +21 -0
- data/yard_ext/templates/default/layout/html/layout.erb +20 -0
- data/yard_ext/templates/default/method_details/html/github_link.erb +1 -0
- data/yard_ext/templates/default/method_details/setup.rb +3 -0
- data/yard_ext/validators.rb +1 -0
- data/yard_ext/visible_id_handler.rb +38 -0
- metadata +772 -0
@@ -0,0 +1,457 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: tooltip.js v3.2.0
|
3
|
+
* http://getbootstrap.com/javascript/#tooltip
|
4
|
+
* Inspired by the original jQuery.tipsy by Jason Frame
|
5
|
+
* ========================================================================
|
6
|
+
* Copyright 2011-2014 Twitter, Inc.
|
7
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
8
|
+
* ======================================================================== */
|
9
|
+
|
10
|
+
|
11
|
+
+function ($) {
|
12
|
+
'use strict';
|
13
|
+
|
14
|
+
// TOOLTIP PUBLIC CLASS DEFINITION
|
15
|
+
// ===============================
|
16
|
+
|
17
|
+
var Tooltip = function (element, options) {
|
18
|
+
this.type =
|
19
|
+
this.options =
|
20
|
+
this.enabled =
|
21
|
+
this.timeout =
|
22
|
+
this.hoverState =
|
23
|
+
this.$element = null
|
24
|
+
|
25
|
+
this.init('tooltip', element, options)
|
26
|
+
}
|
27
|
+
|
28
|
+
Tooltip.VERSION = '3.2.0'
|
29
|
+
|
30
|
+
Tooltip.DEFAULTS = {
|
31
|
+
animation: true,
|
32
|
+
placement: 'top',
|
33
|
+
selector: false,
|
34
|
+
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
35
|
+
trigger: 'hover focus',
|
36
|
+
title: '',
|
37
|
+
delay: 0,
|
38
|
+
html: false,
|
39
|
+
container: false,
|
40
|
+
viewport: {
|
41
|
+
selector: 'body',
|
42
|
+
padding: 0
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
Tooltip.prototype.init = function (type, element, options) {
|
47
|
+
this.enabled = true
|
48
|
+
this.type = type
|
49
|
+
this.$element = $(element)
|
50
|
+
this.options = this.getOptions(options)
|
51
|
+
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
|
52
|
+
|
53
|
+
var triggers = this.options.trigger.split(' ')
|
54
|
+
|
55
|
+
for (var i = triggers.length; i--;) {
|
56
|
+
var trigger = triggers[i]
|
57
|
+
|
58
|
+
if (trigger == 'click') {
|
59
|
+
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
60
|
+
} else if (trigger != 'manual') {
|
61
|
+
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
62
|
+
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
63
|
+
|
64
|
+
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
65
|
+
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
this.options.selector ?
|
70
|
+
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
71
|
+
this.fixTitle()
|
72
|
+
}
|
73
|
+
|
74
|
+
Tooltip.prototype.getDefaults = function () {
|
75
|
+
return Tooltip.DEFAULTS
|
76
|
+
}
|
77
|
+
|
78
|
+
Tooltip.prototype.getOptions = function (options) {
|
79
|
+
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
80
|
+
|
81
|
+
if (options.delay && typeof options.delay == 'number') {
|
82
|
+
options.delay = {
|
83
|
+
show: options.delay,
|
84
|
+
hide: options.delay
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
return options
|
89
|
+
}
|
90
|
+
|
91
|
+
Tooltip.prototype.getDelegateOptions = function () {
|
92
|
+
var options = {}
|
93
|
+
var defaults = this.getDefaults()
|
94
|
+
|
95
|
+
this._options && $.each(this._options, function (key, value) {
|
96
|
+
if (defaults[key] != value) options[key] = value
|
97
|
+
})
|
98
|
+
|
99
|
+
return options
|
100
|
+
}
|
101
|
+
|
102
|
+
Tooltip.prototype.enter = function (obj) {
|
103
|
+
var self = obj instanceof this.constructor ?
|
104
|
+
obj : $(obj.currentTarget).data('bs.' + this.type)
|
105
|
+
|
106
|
+
if (!self) {
|
107
|
+
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
108
|
+
$(obj.currentTarget).data('bs.' + this.type, self)
|
109
|
+
}
|
110
|
+
|
111
|
+
clearTimeout(self.timeout)
|
112
|
+
|
113
|
+
self.hoverState = 'in'
|
114
|
+
|
115
|
+
if (!self.options.delay || !self.options.delay.show) return self.show()
|
116
|
+
|
117
|
+
self.timeout = setTimeout(function () {
|
118
|
+
if (self.hoverState == 'in') self.show()
|
119
|
+
}, self.options.delay.show)
|
120
|
+
}
|
121
|
+
|
122
|
+
Tooltip.prototype.leave = function (obj) {
|
123
|
+
var self = obj instanceof this.constructor ?
|
124
|
+
obj : $(obj.currentTarget).data('bs.' + this.type)
|
125
|
+
|
126
|
+
if (!self) {
|
127
|
+
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
128
|
+
$(obj.currentTarget).data('bs.' + this.type, self)
|
129
|
+
}
|
130
|
+
|
131
|
+
clearTimeout(self.timeout)
|
132
|
+
|
133
|
+
self.hoverState = 'out'
|
134
|
+
|
135
|
+
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
136
|
+
|
137
|
+
self.timeout = setTimeout(function () {
|
138
|
+
if (self.hoverState == 'out') self.hide()
|
139
|
+
}, self.options.delay.hide)
|
140
|
+
}
|
141
|
+
|
142
|
+
Tooltip.prototype.show = function () {
|
143
|
+
var e = $.Event('show.bs.' + this.type)
|
144
|
+
|
145
|
+
if (this.hasContent() && this.enabled) {
|
146
|
+
this.$element.trigger(e)
|
147
|
+
|
148
|
+
var inDom = $.contains(document.documentElement, this.$element[0])
|
149
|
+
if (e.isDefaultPrevented() || !inDom) return
|
150
|
+
var that = this
|
151
|
+
|
152
|
+
var $tip = this.tip()
|
153
|
+
|
154
|
+
var tipId = this.getUID(this.type)
|
155
|
+
|
156
|
+
this.setContent()
|
157
|
+
$tip.attr('id', tipId)
|
158
|
+
this.$element.attr('aria-describedby', tipId)
|
159
|
+
|
160
|
+
if (this.options.animation) $tip.addClass('fade')
|
161
|
+
|
162
|
+
var placement = typeof this.options.placement == 'function' ?
|
163
|
+
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
164
|
+
this.options.placement
|
165
|
+
|
166
|
+
var autoToken = /\s?auto?\s?/i
|
167
|
+
var autoPlace = autoToken.test(placement)
|
168
|
+
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
169
|
+
|
170
|
+
$tip
|
171
|
+
.detach()
|
172
|
+
.css({ top: 0, left: 0, display: 'block' })
|
173
|
+
.addClass(placement)
|
174
|
+
.data('bs.' + this.type, this)
|
175
|
+
|
176
|
+
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
177
|
+
|
178
|
+
var pos = this.getPosition()
|
179
|
+
var actualWidth = $tip[0].offsetWidth
|
180
|
+
var actualHeight = $tip[0].offsetHeight
|
181
|
+
|
182
|
+
if (autoPlace) {
|
183
|
+
var orgPlacement = placement
|
184
|
+
var $parent = this.$element.parent()
|
185
|
+
var parentDim = this.getPosition($parent)
|
186
|
+
|
187
|
+
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - parentDim.scroll > parentDim.height ? 'top' :
|
188
|
+
placement == 'top' && pos.top - parentDim.scroll - actualHeight < 0 ? 'bottom' :
|
189
|
+
placement == 'right' && pos.right + actualWidth > parentDim.width ? 'left' :
|
190
|
+
placement == 'left' && pos.left - actualWidth < parentDim.left ? 'right' :
|
191
|
+
placement
|
192
|
+
|
193
|
+
$tip
|
194
|
+
.removeClass(orgPlacement)
|
195
|
+
.addClass(placement)
|
196
|
+
}
|
197
|
+
|
198
|
+
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
199
|
+
|
200
|
+
this.applyPlacement(calculatedOffset, placement)
|
201
|
+
|
202
|
+
var complete = function () {
|
203
|
+
that.$element.trigger('shown.bs.' + that.type)
|
204
|
+
that.hoverState = null
|
205
|
+
}
|
206
|
+
|
207
|
+
$.support.transition && this.$tip.hasClass('fade') ?
|
208
|
+
$tip
|
209
|
+
.one('bsTransitionEnd', complete)
|
210
|
+
.emulateTransitionEnd(150) :
|
211
|
+
complete()
|
212
|
+
}
|
213
|
+
}
|
214
|
+
|
215
|
+
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
216
|
+
var $tip = this.tip()
|
217
|
+
var width = $tip[0].offsetWidth
|
218
|
+
var height = $tip[0].offsetHeight
|
219
|
+
|
220
|
+
// manually read margins because getBoundingClientRect includes difference
|
221
|
+
var marginTop = parseInt($tip.css('margin-top'), 10)
|
222
|
+
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
223
|
+
|
224
|
+
// we must check for NaN for ie 8/9
|
225
|
+
if (isNaN(marginTop)) marginTop = 0
|
226
|
+
if (isNaN(marginLeft)) marginLeft = 0
|
227
|
+
|
228
|
+
offset.top = offset.top + marginTop
|
229
|
+
offset.left = offset.left + marginLeft
|
230
|
+
|
231
|
+
// $.fn.offset doesn't round pixel values
|
232
|
+
// so we use setOffset directly with our own function B-0
|
233
|
+
$.offset.setOffset($tip[0], $.extend({
|
234
|
+
using: function (props) {
|
235
|
+
$tip.css({
|
236
|
+
top: Math.round(props.top),
|
237
|
+
left: Math.round(props.left)
|
238
|
+
})
|
239
|
+
}
|
240
|
+
}, offset), 0)
|
241
|
+
|
242
|
+
$tip.addClass('in')
|
243
|
+
|
244
|
+
// check to see if placing tip in new offset caused the tip to resize itself
|
245
|
+
var actualWidth = $tip[0].offsetWidth
|
246
|
+
var actualHeight = $tip[0].offsetHeight
|
247
|
+
|
248
|
+
if (placement == 'top' && actualHeight != height) {
|
249
|
+
offset.top = offset.top + height - actualHeight
|
250
|
+
}
|
251
|
+
|
252
|
+
var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
|
253
|
+
|
254
|
+
if (delta.left) offset.left += delta.left
|
255
|
+
else offset.top += delta.top
|
256
|
+
|
257
|
+
var arrowDelta = delta.left ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
|
258
|
+
var arrowPosition = delta.left ? 'left' : 'top'
|
259
|
+
var arrowOffsetPosition = delta.left ? 'offsetWidth' : 'offsetHeight'
|
260
|
+
|
261
|
+
$tip.offset(offset)
|
262
|
+
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition)
|
263
|
+
}
|
264
|
+
|
265
|
+
Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
|
266
|
+
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
|
267
|
+
}
|
268
|
+
|
269
|
+
Tooltip.prototype.setContent = function () {
|
270
|
+
var $tip = this.tip()
|
271
|
+
var title = this.getTitle()
|
272
|
+
|
273
|
+
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
274
|
+
$tip.removeClass('fade in top bottom left right')
|
275
|
+
}
|
276
|
+
|
277
|
+
Tooltip.prototype.hide = function () {
|
278
|
+
var that = this
|
279
|
+
var $tip = this.tip()
|
280
|
+
var e = $.Event('hide.bs.' + this.type)
|
281
|
+
|
282
|
+
this.$element.removeAttr('aria-describedby')
|
283
|
+
|
284
|
+
function complete() {
|
285
|
+
if (that.hoverState != 'in') $tip.detach()
|
286
|
+
that.$element.trigger('hidden.bs.' + that.type)
|
287
|
+
}
|
288
|
+
|
289
|
+
this.$element.trigger(e)
|
290
|
+
|
291
|
+
if (e.isDefaultPrevented()) return
|
292
|
+
|
293
|
+
$tip.removeClass('in')
|
294
|
+
|
295
|
+
$.support.transition && this.$tip.hasClass('fade') ?
|
296
|
+
$tip
|
297
|
+
.one('bsTransitionEnd', complete)
|
298
|
+
.emulateTransitionEnd(150) :
|
299
|
+
complete()
|
300
|
+
|
301
|
+
this.hoverState = null
|
302
|
+
|
303
|
+
return this
|
304
|
+
}
|
305
|
+
|
306
|
+
Tooltip.prototype.fixTitle = function () {
|
307
|
+
var $e = this.$element
|
308
|
+
if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
|
309
|
+
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
310
|
+
}
|
311
|
+
}
|
312
|
+
|
313
|
+
Tooltip.prototype.hasContent = function () {
|
314
|
+
return this.getTitle()
|
315
|
+
}
|
316
|
+
|
317
|
+
Tooltip.prototype.getPosition = function ($element) {
|
318
|
+
$element = $element || this.$element
|
319
|
+
var el = $element[0]
|
320
|
+
var isBody = el.tagName == 'BODY'
|
321
|
+
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
|
322
|
+
scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
|
323
|
+
width: isBody ? $(window).width() : $element.outerWidth(),
|
324
|
+
height: isBody ? $(window).height() : $element.outerHeight()
|
325
|
+
}, isBody ? { top: 0, left: 0 } : $element.offset())
|
326
|
+
}
|
327
|
+
|
328
|
+
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
329
|
+
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
330
|
+
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
331
|
+
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
332
|
+
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
333
|
+
|
334
|
+
}
|
335
|
+
|
336
|
+
Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
|
337
|
+
var delta = { top: 0, left: 0 }
|
338
|
+
if (!this.$viewport) return delta
|
339
|
+
|
340
|
+
var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
|
341
|
+
var viewportDimensions = this.getPosition(this.$viewport)
|
342
|
+
|
343
|
+
if (/right|left/.test(placement)) {
|
344
|
+
var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
|
345
|
+
var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
|
346
|
+
if (topEdgeOffset < viewportDimensions.top) { // top overflow
|
347
|
+
delta.top = viewportDimensions.top - topEdgeOffset
|
348
|
+
} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
|
349
|
+
delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
|
350
|
+
}
|
351
|
+
} else {
|
352
|
+
var leftEdgeOffset = pos.left - viewportPadding
|
353
|
+
var rightEdgeOffset = pos.left + viewportPadding + actualWidth
|
354
|
+
if (leftEdgeOffset < viewportDimensions.left) { // left overflow
|
355
|
+
delta.left = viewportDimensions.left - leftEdgeOffset
|
356
|
+
} else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
|
357
|
+
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
|
358
|
+
}
|
359
|
+
}
|
360
|
+
|
361
|
+
return delta
|
362
|
+
}
|
363
|
+
|
364
|
+
Tooltip.prototype.getTitle = function () {
|
365
|
+
var title
|
366
|
+
var $e = this.$element
|
367
|
+
var o = this.options
|
368
|
+
|
369
|
+
title = $e.attr('data-original-title')
|
370
|
+
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
371
|
+
|
372
|
+
return title
|
373
|
+
}
|
374
|
+
|
375
|
+
Tooltip.prototype.getUID = function (prefix) {
|
376
|
+
do prefix += ~~(Math.random() * 1000000)
|
377
|
+
while (document.getElementById(prefix))
|
378
|
+
return prefix
|
379
|
+
}
|
380
|
+
|
381
|
+
Tooltip.prototype.tip = function () {
|
382
|
+
return (this.$tip = this.$tip || $(this.options.template))
|
383
|
+
}
|
384
|
+
|
385
|
+
Tooltip.prototype.arrow = function () {
|
386
|
+
return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
|
387
|
+
}
|
388
|
+
|
389
|
+
Tooltip.prototype.validate = function () {
|
390
|
+
if (!this.$element[0].parentNode) {
|
391
|
+
this.hide()
|
392
|
+
this.$element = null
|
393
|
+
this.options = null
|
394
|
+
}
|
395
|
+
}
|
396
|
+
|
397
|
+
Tooltip.prototype.enable = function () {
|
398
|
+
this.enabled = true
|
399
|
+
}
|
400
|
+
|
401
|
+
Tooltip.prototype.disable = function () {
|
402
|
+
this.enabled = false
|
403
|
+
}
|
404
|
+
|
405
|
+
Tooltip.prototype.toggleEnabled = function () {
|
406
|
+
this.enabled = !this.enabled
|
407
|
+
}
|
408
|
+
|
409
|
+
Tooltip.prototype.toggle = function (e) {
|
410
|
+
var self = this
|
411
|
+
if (e) {
|
412
|
+
self = $(e.currentTarget).data('bs.' + this.type)
|
413
|
+
if (!self) {
|
414
|
+
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
|
415
|
+
$(e.currentTarget).data('bs.' + this.type, self)
|
416
|
+
}
|
417
|
+
}
|
418
|
+
|
419
|
+
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
420
|
+
}
|
421
|
+
|
422
|
+
Tooltip.prototype.destroy = function () {
|
423
|
+
clearTimeout(this.timeout)
|
424
|
+
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
425
|
+
}
|
426
|
+
|
427
|
+
|
428
|
+
// TOOLTIP PLUGIN DEFINITION
|
429
|
+
// =========================
|
430
|
+
|
431
|
+
function Plugin(option) {
|
432
|
+
return this.each(function () {
|
433
|
+
var $this = $(this)
|
434
|
+
var data = $this.data('bs.tooltip')
|
435
|
+
var options = typeof option == 'object' && option
|
436
|
+
|
437
|
+
if (!data && option == 'destroy') return
|
438
|
+
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
439
|
+
if (typeof option == 'string') data[option]()
|
440
|
+
})
|
441
|
+
}
|
442
|
+
|
443
|
+
var old = $.fn.tooltip
|
444
|
+
|
445
|
+
$.fn.tooltip = Plugin
|
446
|
+
$.fn.tooltip.Constructor = Tooltip
|
447
|
+
|
448
|
+
|
449
|
+
// TOOLTIP NO CONFLICT
|
450
|
+
// ===================
|
451
|
+
|
452
|
+
$.fn.tooltip.noConflict = function () {
|
453
|
+
$.fn.tooltip = old
|
454
|
+
return this
|
455
|
+
}
|
456
|
+
|
457
|
+
}(jQuery);
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: transition.js v3.2.0
|
3
|
+
* http://getbootstrap.com/javascript/#transitions
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
14
|
+
// ============================================================
|
15
|
+
|
16
|
+
function transitionEnd() {
|
17
|
+
var el = document.createElement('bootstrap')
|
18
|
+
|
19
|
+
var transEndEventNames = {
|
20
|
+
WebkitTransition : 'webkitTransitionEnd',
|
21
|
+
MozTransition : 'transitionend',
|
22
|
+
OTransition : 'oTransitionEnd otransitionend',
|
23
|
+
transition : 'transitionend'
|
24
|
+
}
|
25
|
+
|
26
|
+
for (var name in transEndEventNames) {
|
27
|
+
if (el.style[name] !== undefined) {
|
28
|
+
return { end: transEndEventNames[name] }
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
return false // explicit for ie8 ( ._.)
|
33
|
+
}
|
34
|
+
|
35
|
+
// http://blog.alexmaccaw.com/css-transitions
|
36
|
+
$.fn.emulateTransitionEnd = function (duration) {
|
37
|
+
var called = false
|
38
|
+
var $el = this
|
39
|
+
$(this).one('bsTransitionEnd', function () { called = true })
|
40
|
+
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
41
|
+
setTimeout(callback, duration)
|
42
|
+
return this
|
43
|
+
}
|
44
|
+
|
45
|
+
$(function () {
|
46
|
+
$.support.transition = transitionEnd()
|
47
|
+
|
48
|
+
if (!$.support.transition) return
|
49
|
+
|
50
|
+
$.event.special.bsTransitionEnd = {
|
51
|
+
bindType: $.support.transition.end,
|
52
|
+
delegateType: $.support.transition.end,
|
53
|
+
handle: function (e) {
|
54
|
+
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
|
55
|
+
}
|
56
|
+
}
|
57
|
+
})
|
58
|
+
|
59
|
+
}(jQuery);
|
@@ -0,0 +1,156 @@
|
|
1
|
+
/* Set the defaults for DataTables initialisation */
|
2
|
+
$.extend( true, $.fn.dataTable.defaults, {
|
3
|
+
"sDom":
|
4
|
+
"<'row'<'col-xs-6'l><'col-xs-6'f>r>"+
|
5
|
+
"t"+
|
6
|
+
"<'row'<'col-xs-6'i><'col-xs-6'p>>",
|
7
|
+
"oLanguage": {
|
8
|
+
"sLengthMenu": "_MENU_ records per page"
|
9
|
+
}
|
10
|
+
} );
|
11
|
+
|
12
|
+
|
13
|
+
/* Default class modification */
|
14
|
+
$.extend( $.fn.dataTableExt.oStdClasses, {
|
15
|
+
"sWrapper": "dataTables_wrapper form-inline",
|
16
|
+
"sFilterInput": "form-control input-sm",
|
17
|
+
"sTable": "table table-striped",
|
18
|
+
"sLengthSelect": "form-control input-sm"
|
19
|
+
} );
|
20
|
+
|
21
|
+
// In 1.10 we use the pagination renderers to draw the Bootstrap paging,
|
22
|
+
// rather than custom plug-in
|
23
|
+
if ( $.fn.dataTable.Api ) {
|
24
|
+
|
25
|
+
$.fn.dataTable.defaults.renderer = 'bootstrap';
|
26
|
+
$.fn.dataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {
|
27
|
+
var api = new $.fn.dataTable.Api( settings );
|
28
|
+
|
29
|
+
var classes = settings.oClasses;
|
30
|
+
var lang = settings.oLanguage.oPaginate;
|
31
|
+
var btnDisplay, btnClass;
|
32
|
+
|
33
|
+
var attach = function( container, buttons ) {
|
34
|
+
var i, ien, node, button;
|
35
|
+
var clickHandler = function ( e ) {
|
36
|
+
e.preventDefault();
|
37
|
+
if ( e.data.action !== 'ellipsis' ) {
|
38
|
+
api.page( e.data.action ).draw( false );
|
39
|
+
}
|
40
|
+
};
|
41
|
+
|
42
|
+
for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
|
43
|
+
button = buttons[i];
|
44
|
+
|
45
|
+
if ( $.isArray( button ) ) {
|
46
|
+
attach( container, button );
|
47
|
+
}
|
48
|
+
else {
|
49
|
+
btnDisplay = '';
|
50
|
+
btnClass = '';
|
51
|
+
|
52
|
+
switch ( button ) {
|
53
|
+
case 'ellipsis':
|
54
|
+
btnDisplay = '…';
|
55
|
+
btnClass = 'disabled';
|
56
|
+
break;
|
57
|
+
|
58
|
+
case 'first':
|
59
|
+
btnDisplay = lang.sFirst;
|
60
|
+
btnClass = button + (page > 0 ?
|
61
|
+
'' : ' disabled');
|
62
|
+
break;
|
63
|
+
|
64
|
+
case 'previous':
|
65
|
+
btnDisplay = lang.sPrevious;
|
66
|
+
btnClass = button + (page > 0 ?
|
67
|
+
'' : ' disabled');
|
68
|
+
break;
|
69
|
+
|
70
|
+
case 'next':
|
71
|
+
btnDisplay = lang.sNext;
|
72
|
+
btnClass = button + (page < pages-1 ?
|
73
|
+
'' : ' disabled');
|
74
|
+
break;
|
75
|
+
|
76
|
+
case 'last':
|
77
|
+
btnDisplay = lang.sLast;
|
78
|
+
btnClass = button + (page < pages-1 ?
|
79
|
+
'' : ' disabled');
|
80
|
+
break;
|
81
|
+
|
82
|
+
default:
|
83
|
+
btnDisplay = button + 1;
|
84
|
+
btnClass = page === button ?
|
85
|
+
'active' : '';
|
86
|
+
break;
|
87
|
+
}
|
88
|
+
|
89
|
+
if ( btnDisplay ) {
|
90
|
+
node = $('<li>', {
|
91
|
+
'class': classes.sPageButton+' '+btnClass,
|
92
|
+
'aria-controls': settings.sTableId,
|
93
|
+
'tabindex': settings.iTabIndex,
|
94
|
+
'id': idx === 0 && typeof button === 'string' ?
|
95
|
+
settings.sTableId +'_'+ button :
|
96
|
+
null
|
97
|
+
} )
|
98
|
+
.append( $('<a>', {
|
99
|
+
'href': '#'
|
100
|
+
} )
|
101
|
+
.html( btnDisplay )
|
102
|
+
)
|
103
|
+
.appendTo( container );
|
104
|
+
|
105
|
+
settings.oApi._fnBindAction(
|
106
|
+
node, {action: button}, clickHandler
|
107
|
+
);
|
108
|
+
}
|
109
|
+
}
|
110
|
+
}
|
111
|
+
};
|
112
|
+
|
113
|
+
attach(
|
114
|
+
$(host).empty().html('<ul class="pagination"/>').children('ul'),
|
115
|
+
buttons
|
116
|
+
);
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
/*
|
122
|
+
* TableTools Bootstrap compatibility
|
123
|
+
* Required TableTools 2.1+
|
124
|
+
*/
|
125
|
+
if ( $.fn.DataTable.TableTools ) {
|
126
|
+
// Set the classes that TableTools uses to something suitable for Bootstrap
|
127
|
+
$.extend( true, $.fn.DataTable.TableTools.classes, {
|
128
|
+
"container": "DTTT btn-group",
|
129
|
+
"buttons": {
|
130
|
+
"normal": "btn btn-default",
|
131
|
+
"disabled": "disabled"
|
132
|
+
},
|
133
|
+
"collection": {
|
134
|
+
"container": "DTTT_dropdown dropdown-menu",
|
135
|
+
"buttons": {
|
136
|
+
"normal": "",
|
137
|
+
"disabled": "disabled"
|
138
|
+
}
|
139
|
+
},
|
140
|
+
"print": {
|
141
|
+
"info": "DTTT_print_info modal"
|
142
|
+
},
|
143
|
+
"select": {
|
144
|
+
"row": "active"
|
145
|
+
}
|
146
|
+
} );
|
147
|
+
|
148
|
+
// Have the collection use a bootstrap compatible dropdown
|
149
|
+
$.extend( true, $.fn.DataTable.TableTools.DEFAULTS.oTags, {
|
150
|
+
"collection": {
|
151
|
+
"container": "ul",
|
152
|
+
"button": "li",
|
153
|
+
"liner": "a"
|
154
|
+
}
|
155
|
+
} );
|
156
|
+
}
|