vapid 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.gitmodules +6 -0
- data/.rspec +2 -0
- data/.rubocop.yml +133 -0
- data/.travis.yml +5 -0
- data/Gemfile +10 -0
- data/README.md +37 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/vapid +7 -0
- data/lib/vapid.rb +24 -0
- data/lib/vapid/assets/javascripts/vapid/admin.coffee +2 -0
- data/lib/vapid/assets/stylesheets/vapid/admin.scss +72 -0
- data/lib/vapid/builder.rb +70 -0
- data/lib/vapid/cli.rb +96 -0
- data/lib/vapid/controllers/admin_controller.rb +282 -0
- data/lib/vapid/controllers/project_controller.rb +41 -0
- data/lib/vapid/db/migrate/20170202182310_create_groups.rb +12 -0
- data/lib/vapid/db/migrate/20170202183017_create_records.rb +11 -0
- data/lib/vapid/db/migrate/20170202185150_create_users.rb +11 -0
- data/lib/vapid/directive.rb +168 -0
- data/lib/vapid/directives.rb +30 -0
- data/lib/vapid/directives/audio.rb +27 -0
- data/lib/vapid/directives/group.rb +71 -0
- data/lib/vapid/directives/hide.rb +11 -0
- data/lib/vapid/directives/href.rb +11 -0
- data/lib/vapid/directives/image.rb +14 -0
- data/lib/vapid/directives/richtext.rb +15 -0
- data/lib/vapid/directives/show.rb +11 -0
- data/lib/vapid/directives/text.rb +24 -0
- data/lib/vapid/directives/video.rb +28 -0
- data/lib/vapid/generator_template/.gitignore +21 -0
- data/lib/vapid/generator_template/Gemfile.tt +13 -0
- data/lib/vapid/generator_template/README.md +0 -0
- data/lib/vapid/generator_template/assets/favicon.ico +0 -0
- data/lib/vapid/generator_template/assets/images/.keep +0 -0
- data/lib/vapid/generator_template/assets/javascripts/.keep +0 -0
- data/lib/vapid/generator_template/assets/stylesheets/.keep +0 -0
- data/lib/vapid/generator_template/assets/stylesheets/application.css +120 -0
- data/lib/vapid/generator_template/config.ru +3 -0
- data/lib/vapid/generator_template/config/database.yml +12 -0
- data/lib/vapid/generator_template/config/settings.yml.tt +11 -0
- data/lib/vapid/generator_template/templates/index.html.erb +25 -0
- data/lib/vapid/generator_template/templates/layouts/default.html.erb +22 -0
- data/lib/vapid/models.rb +18 -0
- data/lib/vapid/models/group.rb +36 -0
- data/lib/vapid/models/record.rb +30 -0
- data/lib/vapid/models/user.rb +16 -0
- data/lib/vapid/server.rb +93 -0
- data/lib/vapid/settings.rb +13 -0
- data/lib/vapid/template.rb +79 -0
- data/lib/vapid/template/node.rb +91 -0
- data/lib/vapid/template/parser.rb +50 -0
- data/lib/vapid/vendor/semantic-ui/.versions +4 -0
- data/lib/vapid/vendor/semantic-ui/LICENSE +22 -0
- data/lib/vapid/vendor/semantic-ui/README.md +7 -0
- data/lib/vapid/vendor/semantic-ui/components/accordion.css +252 -0
- data/lib/vapid/vendor/semantic-ui/components/accordion.js +610 -0
- data/lib/vapid/vendor/semantic-ui/components/accordion.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/accordion.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/ad.css +275 -0
- data/lib/vapid/vendor/semantic-ui/components/ad.min.css +10 -0
- data/lib/vapid/vendor/semantic-ui/components/api.js +1167 -0
- data/lib/vapid/vendor/semantic-ui/components/api.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/breadcrumb.css +124 -0
- data/lib/vapid/vendor/semantic-ui/components/breadcrumb.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/button.css +3450 -0
- data/lib/vapid/vendor/semantic-ui/components/button.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/card.css +964 -0
- data/lib/vapid/vendor/semantic-ui/components/card.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/checkbox.css +625 -0
- data/lib/vapid/vendor/semantic-ui/components/checkbox.js +831 -0
- data/lib/vapid/vendor/semantic-ui/components/checkbox.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/checkbox.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/colorize.js +274 -0
- data/lib/vapid/vendor/semantic-ui/components/colorize.min.js +11 -0
- data/lib/vapid/vendor/semantic-ui/components/comment.css +270 -0
- data/lib/vapid/vendor/semantic-ui/components/comment.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/container.css +147 -0
- data/lib/vapid/vendor/semantic-ui/components/container.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/dimmer.css +200 -0
- data/lib/vapid/vendor/semantic-ui/components/dimmer.js +708 -0
- data/lib/vapid/vendor/semantic-ui/components/dimmer.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/dimmer.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/divider.css +260 -0
- data/lib/vapid/vendor/semantic-ui/components/divider.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/dropdown.css +1442 -0
- data/lib/vapid/vendor/semantic-ui/components/dropdown.js +3767 -0
- data/lib/vapid/vendor/semantic-ui/components/dropdown.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/dropdown.min.js +11 -0
- data/lib/vapid/vendor/semantic-ui/components/embed.css +166 -0
- data/lib/vapid/vendor/semantic-ui/components/embed.js +696 -0
- data/lib/vapid/vendor/semantic-ui/components/embed.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/embed.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/feed.css +296 -0
- data/lib/vapid/vendor/semantic-ui/components/feed.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/flag.css +1031 -0
- data/lib/vapid/vendor/semantic-ui/components/flag.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/form.css +1067 -0
- data/lib/vapid/vendor/semantic-ui/components/form.js +1603 -0
- data/lib/vapid/vendor/semantic-ui/components/form.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/form.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/grid.css +2002 -0
- data/lib/vapid/vendor/semantic-ui/components/grid.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/header.css +721 -0
- data/lib/vapid/vendor/semantic-ui/components/header.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/icon.css +3292 -0
- data/lib/vapid/vendor/semantic-ui/components/icon.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/image.css +306 -0
- data/lib/vapid/vendor/semantic-ui/components/image.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/input.css +510 -0
- data/lib/vapid/vendor/semantic-ui/components/input.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/item.css +486 -0
- data/lib/vapid/vendor/semantic-ui/components/item.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/label.css +1307 -0
- data/lib/vapid/vendor/semantic-ui/components/label.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/list.css +951 -0
- data/lib/vapid/vendor/semantic-ui/components/list.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/loader.css +347 -0
- data/lib/vapid/vendor/semantic-ui/components/loader.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/menu.css +2002 -0
- data/lib/vapid/vendor/semantic-ui/components/menu.min.css +1 -0
- data/lib/vapid/vendor/semantic-ui/components/message.css +477 -0
- data/lib/vapid/vendor/semantic-ui/components/message.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/modal.css +502 -0
- data/lib/vapid/vendor/semantic-ui/components/modal.js +913 -0
- data/lib/vapid/vendor/semantic-ui/components/modal.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/modal.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/nag.css +147 -0
- data/lib/vapid/vendor/semantic-ui/components/nag.js +507 -0
- data/lib/vapid/vendor/semantic-ui/components/nag.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/nag.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/popup.css +733 -0
- data/lib/vapid/vendor/semantic-ui/components/popup.js +1475 -0
- data/lib/vapid/vendor/semantic-ui/components/popup.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/popup.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/progress.css +516 -0
- data/lib/vapid/vendor/semantic-ui/components/progress.js +931 -0
- data/lib/vapid/vendor/semantic-ui/components/progress.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/progress.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/rail.css +152 -0
- data/lib/vapid/vendor/semantic-ui/components/rail.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/rating.css +263 -0
- data/lib/vapid/vendor/semantic-ui/components/rating.js +508 -0
- data/lib/vapid/vendor/semantic-ui/components/rating.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/rating.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/reset.css +424 -0
- data/lib/vapid/vendor/semantic-ui/components/reset.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/reveal.css +284 -0
- data/lib/vapid/vendor/semantic-ui/components/reveal.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/search.css +408 -0
- data/lib/vapid/vendor/semantic-ui/components/search.js +1442 -0
- data/lib/vapid/vendor/semantic-ui/components/search.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/search.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/segment.css +798 -0
- data/lib/vapid/vendor/semantic-ui/components/segment.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/shape.css +157 -0
- data/lib/vapid/vendor/semantic-ui/components/shape.js +921 -0
- data/lib/vapid/vendor/semantic-ui/components/shape.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/shape.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/sidebar.css +634 -0
- data/lib/vapid/vendor/semantic-ui/components/sidebar.js +1036 -0
- data/lib/vapid/vendor/semantic-ui/components/sidebar.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/sidebar.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/site.css +160 -0
- data/lib/vapid/vendor/semantic-ui/components/site.js +487 -0
- data/lib/vapid/vendor/semantic-ui/components/site.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/site.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/state.js +708 -0
- data/lib/vapid/vendor/semantic-ui/components/state.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/statistic.css +569 -0
- data/lib/vapid/vendor/semantic-ui/components/statistic.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/step.css +623 -0
- data/lib/vapid/vendor/semantic-ui/components/step.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/sticky.css +78 -0
- data/lib/vapid/vendor/semantic-ui/components/sticky.js +942 -0
- data/lib/vapid/vendor/semantic-ui/components/sticky.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/sticky.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/tab.css +91 -0
- data/lib/vapid/vendor/semantic-ui/components/tab.js +952 -0
- data/lib/vapid/vendor/semantic-ui/components/tab.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/tab.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/table.css +1108 -0
- data/lib/vapid/vendor/semantic-ui/components/table.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/transition.css +1964 -0
- data/lib/vapid/vendor/semantic-ui/components/transition.js +1095 -0
- data/lib/vapid/vendor/semantic-ui/components/transition.min.css +9 -0
- data/lib/vapid/vendor/semantic-ui/components/transition.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/video.css +125 -0
- data/lib/vapid/vendor/semantic-ui/components/video.js +532 -0
- data/lib/vapid/vendor/semantic-ui/components/video.min.css +10 -0
- data/lib/vapid/vendor/semantic-ui/components/video.min.js +11 -0
- data/lib/vapid/vendor/semantic-ui/components/visibility.js +1288 -0
- data/lib/vapid/vendor/semantic-ui/components/visibility.min.js +10 -0
- data/lib/vapid/vendor/semantic-ui/components/visit.js +517 -0
- data/lib/vapid/vendor/semantic-ui/components/visit.min.js +11 -0
- data/lib/vapid/vendor/semantic-ui/package.js +34 -0
- data/lib/vapid/vendor/semantic-ui/package.json +20 -0
- data/lib/vapid/vendor/semantic-ui/semantic.css +36844 -0
- data/lib/vapid/vendor/semantic-ui/semantic.js +22617 -0
- data/lib/vapid/vendor/semantic-ui/semantic.min.css +364 -0
- data/lib/vapid/vendor/semantic-ui/semantic.min.js +19 -0
- data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.eot +0 -0
- data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.otf +0 -0
- data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.svg +2671 -0
- data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.ttf +0 -0
- data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.woff +0 -0
- data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.woff2 +0 -0
- data/lib/vapid/vendor/semantic-ui/themes/default/assets/images/flags.png +0 -0
- data/lib/vapid/vendor/trix/.blade.yml +45 -0
- data/lib/vapid/vendor/trix/.github/ISSUE_TEMPLATE.md +13 -0
- data/lib/vapid/vendor/trix/.gitignore +3 -0
- data/lib/vapid/vendor/trix/.ruby-version +1 -0
- data/lib/vapid/vendor/trix/.travis.yml +6 -0
- data/lib/vapid/vendor/trix/CONDUCT.md +79 -0
- data/lib/vapid/vendor/trix/Gemfile +17 -0
- data/lib/vapid/vendor/trix/Gemfile.lock +152 -0
- data/lib/vapid/vendor/trix/LICENSE +20 -0
- data/lib/vapid/vendor/trix/README.md +382 -0
- data/lib/vapid/vendor/trix/assets/index.html +55 -0
- data/lib/vapid/vendor/trix/assets/trix-core.coffee +2 -0
- data/lib/vapid/vendor/trix/assets/trix.coffee +3 -0
- data/lib/vapid/vendor/trix/assets/trix.scss +5 -0
- data/lib/vapid/vendor/trix/assets/trix/banner/index.coffee.erb +3 -0
- data/lib/vapid/vendor/trix/assets/trix/banner/index.scss.erb +3 -0
- data/lib/vapid/vendor/trix/assets/trix/banner/index.txt.erb +3 -0
- data/lib/vapid/vendor/trix/assets/trix/images/README.md +6 -0
- data/lib/vapid/vendor/trix/assets/trix/images/attach.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/bold.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/bullets.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/code.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/heading_1.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/italic.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/link.svg +6 -0
- data/lib/vapid/vendor/trix/assets/trix/images/nesting_level_decrease.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/nesting_level_increase.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/numbers.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/quote.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/redo.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/remove.svg +4 -0
- data/lib/vapid/vendor/trix/assets/trix/images/strike.svg +6 -0
- data/lib/vapid/vendor/trix/assets/trix/images/trash.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/images/undo.svg +5 -0
- data/lib/vapid/vendor/trix/assets/trix/stylesheets/attachments.scss +112 -0
- data/lib/vapid/vendor/trix/assets/trix/stylesheets/content.scss +88 -0
- data/lib/vapid/vendor/trix/assets/trix/stylesheets/editor.scss +8 -0
- data/lib/vapid/vendor/trix/assets/trix/stylesheets/icons.scss +14 -0
- data/lib/vapid/vendor/trix/assets/trix/stylesheets/media-queries.scss +7 -0
- data/lib/vapid/vendor/trix/assets/trix/stylesheets/toolbar.scss +194 -0
- data/lib/vapid/vendor/trix/bin/blade +16 -0
- data/lib/vapid/vendor/trix/bin/ci +21 -0
- data/lib/vapid/vendor/trix/bin/rackup +16 -0
- data/lib/vapid/vendor/trix/bin/rake +16 -0
- data/lib/vapid/vendor/trix/bin/release +139 -0
- data/lib/vapid/vendor/trix/bin/setup +69 -0
- data/lib/vapid/vendor/trix/bin/update-status-image +100 -0
- data/lib/vapid/vendor/trix/bower.json +34 -0
- data/lib/vapid/vendor/trix/config.ru +32 -0
- data/lib/vapid/vendor/trix/dist/trix-core.js +11 -0
- data/lib/vapid/vendor/trix/dist/trix.css +286 -0
- data/lib/vapid/vendor/trix/dist/trix.js +20 -0
- data/lib/vapid/vendor/trix/package.json +29 -0
- data/lib/vapid/vendor/trix/polyfills/polyfills.coffee +3 -0
- data/lib/vapid/vendor/trix/polyfills/set.coffee +24 -0
- data/lib/vapid/vendor/trix/polyfills/vendor/CustomElements.js +1029 -0
- data/lib/vapid/vendor/trix/polyfills/vendor/README.md +2 -0
- data/lib/vapid/vendor/trix/polyfills/vendor/promise.js +228 -0
- data/lib/vapid/vendor/trix/src/trix/VERSION +1 -0
- data/lib/vapid/vendor/trix/src/trix/config/block_attributes.coffee +37 -0
- data/lib/vapid/vendor/trix/src/trix/config/css.coffee +12 -0
- data/lib/vapid/vendor/trix/src/trix/config/file_size_formatting.coffee +22 -0
- data/lib/vapid/vendor/trix/src/trix/config/index.coffee +9 -0
- data/lib/vapid/vendor/trix/src/trix/config/lang.coffee +26 -0
- data/lib/vapid/vendor/trix/src/trix/config/selection_elements.coffee +26 -0
- data/lib/vapid/vendor/trix/src/trix/config/serialization.coffee +63 -0
- data/lib/vapid/vendor/trix/src/trix/config/text_attributes.coffee +25 -0
- data/lib/vapid/vendor/trix/src/trix/config/toolbar.coffee +41 -0
- data/lib/vapid/vendor/trix/src/trix/config/undo_interval.coffee +7 -0
- data/lib/vapid/vendor/trix/src/trix/controllers/attachment_editor_controller.coffee +104 -0
- data/lib/vapid/vendor/trix/src/trix/controllers/composition_controller.coffee +117 -0
- data/lib/vapid/vendor/trix/src/trix/controllers/controller.coffee +3 -0
- data/lib/vapid/vendor/trix/src/trix/controllers/editor_controller.coffee +369 -0
- data/lib/vapid/vendor/trix/src/trix/controllers/input/composition_input.coffee +57 -0
- data/lib/vapid/vendor/trix/src/trix/controllers/input_controller.coffee +473 -0
- data/lib/vapid/vendor/trix/src/trix/controllers/toolbar_controller.coffee +173 -0
- data/lib/vapid/vendor/trix/src/trix/core/basic_object.coffee +44 -0
- data/lib/vapid/vendor/trix/src/trix/core/collections/element_store.coffee +21 -0
- data/lib/vapid/vendor/trix/src/trix/core/collections/hash.coffee +98 -0
- data/lib/vapid/vendor/trix/src/trix/core/collections/index.coffee +4 -0
- data/lib/vapid/vendor/trix/src/trix/core/collections/object_group.coffee +37 -0
- data/lib/vapid/vendor/trix/src/trix/core/collections/object_map.coffee +10 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/arrays.coffee +34 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/config.coffee +23 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/custom_elements.coffee +45 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/dom.coffee +185 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/extend.coffee +4 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/functions.coffee +3 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/global.coffee +23 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/index.coffee +10 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/objects.coffee +11 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/ranges.coffee +33 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/selection.coffee +25 -0
- data/lib/vapid/vendor/trix/src/trix/core/helpers/strings.coffee +46 -0
- data/lib/vapid/vendor/trix/src/trix/core/index.coffee +4 -0
- data/lib/vapid/vendor/trix/src/trix/core/object.coffee +33 -0
- data/lib/vapid/vendor/trix/src/trix/core/utilities/index.coffee +2 -0
- data/lib/vapid/vendor/trix/src/trix/core/utilities/operation.coffee +37 -0
- data/lib/vapid/vendor/trix/src/trix/core/utilities/utf16_string.coffee +93 -0
- data/lib/vapid/vendor/trix/src/trix/elements/trix_editor_element.coffee +166 -0
- data/lib/vapid/vendor/trix/src/trix/elements/trix_toolbar_element.coffee +28 -0
- data/lib/vapid/vendor/trix/src/trix/index.coffee.erb +14 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/control_element.coffee +60 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/debugger.coffee +104 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/element.coffee +86 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/index.coffee +17 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/polyfills/vendor/details-element-polyfill.js +5 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/templates/debug.jst.eco +17 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/templates/document.jst.eco +33 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/templates/performance.jst.eco +10 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/templates/render.jst.eco +1 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/templates/selection.jst.eco +5 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/templates/undo.jst.eco +13 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/view.coffee +58 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/views/debug_view.coffee +33 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/views/document_view.coffee +12 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/views/performance_view.coffee +51 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/views/render_view.coffee +21 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/views/selection_view.coffee +33 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/views/undo_view.coffee +12 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/deserializer.coffee +55 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/index.coffee +5 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/player.coffee +60 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/player_controller.coffee +43 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/player_element.coffee +32 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/player_view.coffee +133 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/recorder.coffee +82 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/recording.coffee +54 -0
- data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/serializer.coffee +61 -0
- data/lib/vapid/vendor/trix/src/trix/models/attachment.coffee +157 -0
- data/lib/vapid/vendor/trix/src/trix/models/attachment_manager.coffee +24 -0
- data/lib/vapid/vendor/trix/src/trix/models/attachment_piece.coffee +47 -0
- data/lib/vapid/vendor/trix/src/trix/models/block.coffee +230 -0
- data/lib/vapid/vendor/trix/src/trix/models/composition.coffee +521 -0
- data/lib/vapid/vendor/trix/src/trix/models/document.coffee +538 -0
- data/lib/vapid/vendor/trix/src/trix/models/editor.coffee +141 -0
- data/lib/vapid/vendor/trix/src/trix/models/html_parser.coffee +335 -0
- data/lib/vapid/vendor/trix/src/trix/models/line_break_insertion.coffee +31 -0
- data/lib/vapid/vendor/trix/src/trix/models/location_mapper.coffee +156 -0
- data/lib/vapid/vendor/trix/src/trix/models/managed_attachment.coffee +28 -0
- data/lib/vapid/vendor/trix/src/trix/models/piece.coffee +95 -0
- data/lib/vapid/vendor/trix/src/trix/models/point_mapper.coffee +28 -0
- data/lib/vapid/vendor/trix/src/trix/models/selection_manager.coffee +129 -0
- data/lib/vapid/vendor/trix/src/trix/models/splittable_list.coffee +168 -0
- data/lib/vapid/vendor/trix/src/trix/models/string_piece.coffee +49 -0
- data/lib/vapid/vendor/trix/src/trix/models/text.coffee +168 -0
- data/lib/vapid/vendor/trix/src/trix/models/undo_manager.coffee +40 -0
- data/lib/vapid/vendor/trix/src/trix/observers/mutation_observer.coffee +131 -0
- data/lib/vapid/vendor/trix/src/trix/observers/selection_change_observer.coffee +56 -0
- data/lib/vapid/vendor/trix/src/trix/operations/file_verification_operation.coffee +15 -0
- data/lib/vapid/vendor/trix/src/trix/operations/image_preload_operation.coffee +15 -0
- data/lib/vapid/vendor/trix/src/trix/views/attachment_view.coffee +99 -0
- data/lib/vapid/vendor/trix/src/trix/views/block_view.coffee +37 -0
- data/lib/vapid/vendor/trix/src/trix/views/document_view.coffee +68 -0
- data/lib/vapid/vendor/trix/src/trix/views/object_group_view.coffee +23 -0
- data/lib/vapid/vendor/trix/src/trix/views/object_view.coffee +86 -0
- data/lib/vapid/vendor/trix/src/trix/views/piece_view.coffee +97 -0
- data/lib/vapid/vendor/trix/src/trix/views/previewable_attachment_view.coffee +49 -0
- data/lib/vapid/vendor/trix/src/trix/views/text_view.coffee +30 -0
- data/lib/vapid/vendor/trix/test/.gitignore +1 -0
- data/lib/vapid/vendor/trix/test/src/system/attachment_test.coffee +70 -0
- data/lib/vapid/vendor/trix/test/src/system/basic_input_test.coffee +68 -0
- data/lib/vapid/vendor/trix/test/src/system/block_formatting_test.coffee +602 -0
- data/lib/vapid/vendor/trix/test/src/system/caching_test.coffee +21 -0
- data/lib/vapid/vendor/trix/test/src/system/composition_input_test.coffee +138 -0
- data/lib/vapid/vendor/trix/test/src/system/cursor_movement_test.coffee +54 -0
- data/lib/vapid/vendor/trix/test/src/system/custom_element_test.coffee +314 -0
- data/lib/vapid/vendor/trix/test/src/system/html_loading_test.coffee +62 -0
- data/lib/vapid/vendor/trix/test/src/system/html_replacement_test.coffee +101 -0
- data/lib/vapid/vendor/trix/test/src/system/installation_process_test.coffee +59 -0
- data/lib/vapid/vendor/trix/test/src/system/list_formatting_test.coffee +70 -0
- data/lib/vapid/vendor/trix/test/src/system/mutation_input_test.coffee +73 -0
- data/lib/vapid/vendor/trix/test/src/system/pasting_test.coffee +215 -0
- data/lib/vapid/vendor/trix/test/src/system/text_formatting_test.coffee +151 -0
- data/lib/vapid/vendor/trix/test/src/system/undo_test.coffee +48 -0
- data/lib/vapid/vendor/trix/test/src/test.coffee +16 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/assertions.coffee +38 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/editor_helpers.coffee +37 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_empty.jst.eco +1 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_html.jst.eco +2 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_in_table.jst.eco +7 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_block_styles.jst.eco +6 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_bold_styles.jst.eco +7 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_image.jst.eco +2 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_styled_content.jst.eco +7 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_toolbar_and_input.jst.eco +5 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/fixtures.coffee +536 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/logo.png +0 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/index.coffee +18 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/input_helpers.coffee +183 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/selection_helpers.coffee +91 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/test_helpers.coffee +72 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/test_stubs.coffee +31 -0
- data/lib/vapid/vendor/trix/test/src/test_helpers/toolbar_helpers.coffee +45 -0
- data/lib/vapid/vendor/trix/test/src/unit/attachment_test.coffee +23 -0
- data/lib/vapid/vendor/trix/test/src/unit/block_test.coffee +22 -0
- data/lib/vapid/vendor/trix/test/src/unit/composition_test.coffee +13 -0
- data/lib/vapid/vendor/trix/test/src/unit/document_test.coffee +11 -0
- data/lib/vapid/vendor/trix/test/src/unit/document_view_test.coffee +6 -0
- data/lib/vapid/vendor/trix/test/src/unit/html_parser_test.coffee +162 -0
- data/lib/vapid/vendor/trix/test/src/unit/location_mapper_test.coffee +185 -0
- data/lib/vapid/vendor/trix/test/src/unit/mutation_observer_test.coffee +84 -0
- data/lib/vapid/vendor/trix/test/src/unit/serialization_test.coffee +7 -0
- data/lib/vapid/vendor/trix/test/src/unit/string_change_summary_test.coffee +57 -0
- data/lib/vapid/vendor/trix/test/src/unit/text_test.coffee +19 -0
- data/lib/vapid/vendor/trix/test/vendor/rangy-core.js +3845 -0
- data/lib/vapid/vendor/trix/test/vendor/rangy-textrange.js +1930 -0
- data/lib/vapid/version.rb +4 -0
- data/lib/vapid/views/admin/install.html.erb +19 -0
- data/lib/vapid/views/admin/login.html.erb +11 -0
- data/lib/vapid/views/admin/overview/index.html.erb +1 -0
- data/lib/vapid/views/admin/records/_form.erb +9 -0
- data/lib/vapid/views/admin/records/edit.html.erb +5 -0
- data/lib/vapid/views/admin/records/index.html.erb +38 -0
- data/lib/vapid/views/admin/records/new.html.erb +3 -0
- data/lib/vapid/views/errors/404.html.erb +1 -0
- data/lib/vapid/views/errors/500.html.erb +1 -0
- data/lib/vapid/views/layouts/admin.html.erb +41 -0
- data/lib/vapid/views/layouts/admin_form.html.erb +22 -0
- data/lib/vapid/views/layouts/error.html.erb +11 -0
- data/vapid.gemspec +48 -0
- metadata +811 -0
@@ -0,0 +1,1036 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.2.9 - Sidebar
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Released under the MIT license
|
7
|
+
* http://opensource.org/licenses/MIT
|
8
|
+
*
|
9
|
+
*/
|
10
|
+
|
11
|
+
;(function ($, window, document, undefined) {
|
12
|
+
|
13
|
+
"use strict";
|
14
|
+
|
15
|
+
window = (typeof window != 'undefined' && window.Math == Math)
|
16
|
+
? window
|
17
|
+
: (typeof self != 'undefined' && self.Math == Math)
|
18
|
+
? self
|
19
|
+
: Function('return this')()
|
20
|
+
;
|
21
|
+
|
22
|
+
$.fn.sidebar = function(parameters) {
|
23
|
+
var
|
24
|
+
$allModules = $(this),
|
25
|
+
$window = $(window),
|
26
|
+
$document = $(document),
|
27
|
+
$html = $('html'),
|
28
|
+
$head = $('head'),
|
29
|
+
|
30
|
+
moduleSelector = $allModules.selector || '',
|
31
|
+
|
32
|
+
time = new Date().getTime(),
|
33
|
+
performance = [],
|
34
|
+
|
35
|
+
query = arguments[0],
|
36
|
+
methodInvoked = (typeof query == 'string'),
|
37
|
+
queryArguments = [].slice.call(arguments, 1),
|
38
|
+
|
39
|
+
requestAnimationFrame = window.requestAnimationFrame
|
40
|
+
|| window.mozRequestAnimationFrame
|
41
|
+
|| window.webkitRequestAnimationFrame
|
42
|
+
|| window.msRequestAnimationFrame
|
43
|
+
|| function(callback) { setTimeout(callback, 0); },
|
44
|
+
|
45
|
+
returnedValue
|
46
|
+
;
|
47
|
+
|
48
|
+
$allModules
|
49
|
+
.each(function() {
|
50
|
+
var
|
51
|
+
settings = ( $.isPlainObject(parameters) )
|
52
|
+
? $.extend(true, {}, $.fn.sidebar.settings, parameters)
|
53
|
+
: $.extend({}, $.fn.sidebar.settings),
|
54
|
+
|
55
|
+
selector = settings.selector,
|
56
|
+
className = settings.className,
|
57
|
+
namespace = settings.namespace,
|
58
|
+
regExp = settings.regExp,
|
59
|
+
error = settings.error,
|
60
|
+
|
61
|
+
eventNamespace = '.' + namespace,
|
62
|
+
moduleNamespace = 'module-' + namespace,
|
63
|
+
|
64
|
+
$module = $(this),
|
65
|
+
$context = $(settings.context),
|
66
|
+
|
67
|
+
$sidebars = $module.children(selector.sidebar),
|
68
|
+
$fixed = $context.children(selector.fixed),
|
69
|
+
$pusher = $context.children(selector.pusher),
|
70
|
+
$style,
|
71
|
+
|
72
|
+
element = this,
|
73
|
+
instance = $module.data(moduleNamespace),
|
74
|
+
|
75
|
+
elementNamespace,
|
76
|
+
id,
|
77
|
+
currentScroll,
|
78
|
+
transitionEvent,
|
79
|
+
|
80
|
+
module
|
81
|
+
;
|
82
|
+
|
83
|
+
module = {
|
84
|
+
|
85
|
+
initialize: function() {
|
86
|
+
module.debug('Initializing sidebar', parameters);
|
87
|
+
|
88
|
+
module.create.id();
|
89
|
+
|
90
|
+
transitionEvent = module.get.transitionEvent();
|
91
|
+
|
92
|
+
if(module.is.ios()) {
|
93
|
+
module.set.ios();
|
94
|
+
}
|
95
|
+
|
96
|
+
// avoids locking rendering if initialized in onReady
|
97
|
+
if(settings.delaySetup) {
|
98
|
+
requestAnimationFrame(module.setup.layout);
|
99
|
+
}
|
100
|
+
else {
|
101
|
+
module.setup.layout();
|
102
|
+
}
|
103
|
+
|
104
|
+
requestAnimationFrame(function() {
|
105
|
+
module.setup.cache();
|
106
|
+
});
|
107
|
+
|
108
|
+
module.instantiate();
|
109
|
+
},
|
110
|
+
|
111
|
+
instantiate: function() {
|
112
|
+
module.verbose('Storing instance of module', module);
|
113
|
+
instance = module;
|
114
|
+
$module
|
115
|
+
.data(moduleNamespace, module)
|
116
|
+
;
|
117
|
+
},
|
118
|
+
|
119
|
+
create: {
|
120
|
+
id: function() {
|
121
|
+
id = (Math.random().toString(16) + '000000000').substr(2,8);
|
122
|
+
elementNamespace = '.' + id;
|
123
|
+
module.verbose('Creating unique id for element', id);
|
124
|
+
}
|
125
|
+
},
|
126
|
+
|
127
|
+
destroy: function() {
|
128
|
+
module.verbose('Destroying previous module for', $module);
|
129
|
+
$module
|
130
|
+
.off(eventNamespace)
|
131
|
+
.removeData(moduleNamespace)
|
132
|
+
;
|
133
|
+
if(module.is.ios()) {
|
134
|
+
module.remove.ios();
|
135
|
+
}
|
136
|
+
// bound by uuid
|
137
|
+
$context.off(elementNamespace);
|
138
|
+
$window.off(elementNamespace);
|
139
|
+
$document.off(elementNamespace);
|
140
|
+
},
|
141
|
+
|
142
|
+
event: {
|
143
|
+
clickaway: function(event) {
|
144
|
+
var
|
145
|
+
clickedInPusher = ($pusher.find(event.target).length > 0 || $pusher.is(event.target)),
|
146
|
+
clickedContext = ($context.is(event.target))
|
147
|
+
;
|
148
|
+
if(clickedInPusher) {
|
149
|
+
module.verbose('User clicked on dimmed page');
|
150
|
+
module.hide();
|
151
|
+
}
|
152
|
+
if(clickedContext) {
|
153
|
+
module.verbose('User clicked on dimmable context (scaled out page)');
|
154
|
+
module.hide();
|
155
|
+
}
|
156
|
+
},
|
157
|
+
touch: function(event) {
|
158
|
+
//event.stopPropagation();
|
159
|
+
},
|
160
|
+
containScroll: function(event) {
|
161
|
+
if(element.scrollTop <= 0) {
|
162
|
+
element.scrollTop = 1;
|
163
|
+
}
|
164
|
+
if((element.scrollTop + element.offsetHeight) >= element.scrollHeight) {
|
165
|
+
element.scrollTop = element.scrollHeight - element.offsetHeight - 1;
|
166
|
+
}
|
167
|
+
},
|
168
|
+
scroll: function(event) {
|
169
|
+
if( $(event.target).closest(selector.sidebar).length === 0 ) {
|
170
|
+
event.preventDefault();
|
171
|
+
}
|
172
|
+
}
|
173
|
+
},
|
174
|
+
|
175
|
+
bind: {
|
176
|
+
clickaway: function() {
|
177
|
+
module.verbose('Adding clickaway events to context', $context);
|
178
|
+
if(settings.closable) {
|
179
|
+
$context
|
180
|
+
.on('click' + elementNamespace, module.event.clickaway)
|
181
|
+
.on('touchend' + elementNamespace, module.event.clickaway)
|
182
|
+
;
|
183
|
+
}
|
184
|
+
},
|
185
|
+
scrollLock: function() {
|
186
|
+
if(settings.scrollLock) {
|
187
|
+
module.debug('Disabling page scroll');
|
188
|
+
$window
|
189
|
+
.on('DOMMouseScroll' + elementNamespace, module.event.scroll)
|
190
|
+
;
|
191
|
+
}
|
192
|
+
module.verbose('Adding events to contain sidebar scroll');
|
193
|
+
$document
|
194
|
+
.on('touchmove' + elementNamespace, module.event.touch)
|
195
|
+
;
|
196
|
+
$module
|
197
|
+
.on('scroll' + eventNamespace, module.event.containScroll)
|
198
|
+
;
|
199
|
+
}
|
200
|
+
},
|
201
|
+
unbind: {
|
202
|
+
clickaway: function() {
|
203
|
+
module.verbose('Removing clickaway events from context', $context);
|
204
|
+
$context.off(elementNamespace);
|
205
|
+
},
|
206
|
+
scrollLock: function() {
|
207
|
+
module.verbose('Removing scroll lock from page');
|
208
|
+
$document.off(elementNamespace);
|
209
|
+
$window.off(elementNamespace);
|
210
|
+
$module.off('scroll' + eventNamespace);
|
211
|
+
}
|
212
|
+
},
|
213
|
+
|
214
|
+
add: {
|
215
|
+
inlineCSS: function() {
|
216
|
+
var
|
217
|
+
width = module.cache.width || $module.outerWidth(),
|
218
|
+
height = module.cache.height || $module.outerHeight(),
|
219
|
+
isRTL = module.is.rtl(),
|
220
|
+
direction = module.get.direction(),
|
221
|
+
distance = {
|
222
|
+
left : width,
|
223
|
+
right : -width,
|
224
|
+
top : height,
|
225
|
+
bottom : -height
|
226
|
+
},
|
227
|
+
style
|
228
|
+
;
|
229
|
+
|
230
|
+
if(isRTL){
|
231
|
+
module.verbose('RTL detected, flipping widths');
|
232
|
+
distance.left = -width;
|
233
|
+
distance.right = width;
|
234
|
+
}
|
235
|
+
|
236
|
+
style = '<style>';
|
237
|
+
|
238
|
+
if(direction === 'left' || direction === 'right') {
|
239
|
+
module.debug('Adding CSS rules for animation distance', width);
|
240
|
+
style += ''
|
241
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .fixed,'
|
242
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .pusher {'
|
243
|
+
+ ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
244
|
+
+ ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
245
|
+
+ ' }'
|
246
|
+
;
|
247
|
+
}
|
248
|
+
else if(direction === 'top' || direction == 'bottom') {
|
249
|
+
style += ''
|
250
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .fixed,'
|
251
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .pusher {'
|
252
|
+
+ ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
253
|
+
+ ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
254
|
+
+ ' }'
|
255
|
+
;
|
256
|
+
}
|
257
|
+
|
258
|
+
/* IE is only browser not to create context with transforms */
|
259
|
+
/* https://www.w3.org/Bugs/Public/show_bug.cgi?id=16328 */
|
260
|
+
if( module.is.ie() ) {
|
261
|
+
if(direction === 'left' || direction === 'right') {
|
262
|
+
module.debug('Adding CSS rules for animation distance', width);
|
263
|
+
style += ''
|
264
|
+
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher:after {'
|
265
|
+
+ ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
266
|
+
+ ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
267
|
+
+ ' }'
|
268
|
+
;
|
269
|
+
}
|
270
|
+
else if(direction === 'top' || direction == 'bottom') {
|
271
|
+
style += ''
|
272
|
+
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher:after {'
|
273
|
+
+ ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
274
|
+
+ ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
275
|
+
+ ' }'
|
276
|
+
;
|
277
|
+
}
|
278
|
+
/* opposite sides visible forces content overlay */
|
279
|
+
style += ''
|
280
|
+
+ ' body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after,'
|
281
|
+
+ ' body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {'
|
282
|
+
+ ' -webkit-transform: translate3d(0px, 0, 0);'
|
283
|
+
+ ' transform: translate3d(0px, 0, 0);'
|
284
|
+
+ ' }'
|
285
|
+
;
|
286
|
+
}
|
287
|
+
style += '</style>';
|
288
|
+
$style = $(style)
|
289
|
+
.appendTo($head)
|
290
|
+
;
|
291
|
+
module.debug('Adding sizing css to head', $style);
|
292
|
+
}
|
293
|
+
},
|
294
|
+
|
295
|
+
refresh: function() {
|
296
|
+
module.verbose('Refreshing selector cache');
|
297
|
+
$context = $(settings.context);
|
298
|
+
$sidebars = $context.children(selector.sidebar);
|
299
|
+
$pusher = $context.children(selector.pusher);
|
300
|
+
$fixed = $context.children(selector.fixed);
|
301
|
+
module.clear.cache();
|
302
|
+
},
|
303
|
+
|
304
|
+
refreshSidebars: function() {
|
305
|
+
module.verbose('Refreshing other sidebars');
|
306
|
+
$sidebars = $context.children(selector.sidebar);
|
307
|
+
},
|
308
|
+
|
309
|
+
repaint: function() {
|
310
|
+
module.verbose('Forcing repaint event');
|
311
|
+
element.style.display = 'none';
|
312
|
+
var ignored = element.offsetHeight;
|
313
|
+
element.scrollTop = element.scrollTop;
|
314
|
+
element.style.display = '';
|
315
|
+
},
|
316
|
+
|
317
|
+
setup: {
|
318
|
+
cache: function() {
|
319
|
+
module.cache = {
|
320
|
+
width : $module.outerWidth(),
|
321
|
+
height : $module.outerHeight(),
|
322
|
+
rtl : ($module.css('direction') == 'rtl')
|
323
|
+
};
|
324
|
+
},
|
325
|
+
layout: function() {
|
326
|
+
if( $context.children(selector.pusher).length === 0 ) {
|
327
|
+
module.debug('Adding wrapper element for sidebar');
|
328
|
+
module.error(error.pusher);
|
329
|
+
$pusher = $('<div class="pusher" />');
|
330
|
+
$context
|
331
|
+
.children()
|
332
|
+
.not(selector.omitted)
|
333
|
+
.not($sidebars)
|
334
|
+
.wrapAll($pusher)
|
335
|
+
;
|
336
|
+
module.refresh();
|
337
|
+
}
|
338
|
+
if($module.nextAll(selector.pusher).length === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
|
339
|
+
module.debug('Moved sidebar to correct parent element');
|
340
|
+
module.error(error.movedSidebar, element);
|
341
|
+
$module.detach().prependTo($context);
|
342
|
+
module.refresh();
|
343
|
+
}
|
344
|
+
module.clear.cache();
|
345
|
+
module.set.pushable();
|
346
|
+
module.set.direction();
|
347
|
+
}
|
348
|
+
},
|
349
|
+
|
350
|
+
attachEvents: function(selector, event) {
|
351
|
+
var
|
352
|
+
$toggle = $(selector)
|
353
|
+
;
|
354
|
+
event = $.isFunction(module[event])
|
355
|
+
? module[event]
|
356
|
+
: module.toggle
|
357
|
+
;
|
358
|
+
if($toggle.length > 0) {
|
359
|
+
module.debug('Attaching sidebar events to element', selector, event);
|
360
|
+
$toggle
|
361
|
+
.on('click' + eventNamespace, event)
|
362
|
+
;
|
363
|
+
}
|
364
|
+
else {
|
365
|
+
module.error(error.notFound, selector);
|
366
|
+
}
|
367
|
+
},
|
368
|
+
|
369
|
+
show: function(callback) {
|
370
|
+
callback = $.isFunction(callback)
|
371
|
+
? callback
|
372
|
+
: function(){}
|
373
|
+
;
|
374
|
+
if(module.is.hidden()) {
|
375
|
+
module.refreshSidebars();
|
376
|
+
if(settings.overlay) {
|
377
|
+
module.error(error.overlay);
|
378
|
+
settings.transition = 'overlay';
|
379
|
+
}
|
380
|
+
module.refresh();
|
381
|
+
if(module.othersActive()) {
|
382
|
+
module.debug('Other sidebars currently visible');
|
383
|
+
if(settings.exclusive) {
|
384
|
+
// if not overlay queue animation after hide
|
385
|
+
if(settings.transition != 'overlay') {
|
386
|
+
module.hideOthers(module.show);
|
387
|
+
return;
|
388
|
+
}
|
389
|
+
else {
|
390
|
+
module.hideOthers();
|
391
|
+
}
|
392
|
+
}
|
393
|
+
else {
|
394
|
+
settings.transition = 'overlay';
|
395
|
+
}
|
396
|
+
}
|
397
|
+
module.pushPage(function() {
|
398
|
+
callback.call(element);
|
399
|
+
settings.onShow.call(element);
|
400
|
+
});
|
401
|
+
settings.onChange.call(element);
|
402
|
+
settings.onVisible.call(element);
|
403
|
+
}
|
404
|
+
else {
|
405
|
+
module.debug('Sidebar is already visible');
|
406
|
+
}
|
407
|
+
},
|
408
|
+
|
409
|
+
hide: function(callback) {
|
410
|
+
callback = $.isFunction(callback)
|
411
|
+
? callback
|
412
|
+
: function(){}
|
413
|
+
;
|
414
|
+
if(module.is.visible() || module.is.animating()) {
|
415
|
+
module.debug('Hiding sidebar', callback);
|
416
|
+
module.refreshSidebars();
|
417
|
+
module.pullPage(function() {
|
418
|
+
callback.call(element);
|
419
|
+
settings.onHidden.call(element);
|
420
|
+
});
|
421
|
+
settings.onChange.call(element);
|
422
|
+
settings.onHide.call(element);
|
423
|
+
}
|
424
|
+
},
|
425
|
+
|
426
|
+
othersAnimating: function() {
|
427
|
+
return ($sidebars.not($module).filter('.' + className.animating).length > 0);
|
428
|
+
},
|
429
|
+
othersVisible: function() {
|
430
|
+
return ($sidebars.not($module).filter('.' + className.visible).length > 0);
|
431
|
+
},
|
432
|
+
othersActive: function() {
|
433
|
+
return(module.othersVisible() || module.othersAnimating());
|
434
|
+
},
|
435
|
+
|
436
|
+
hideOthers: function(callback) {
|
437
|
+
var
|
438
|
+
$otherSidebars = $sidebars.not($module).filter('.' + className.visible),
|
439
|
+
sidebarCount = $otherSidebars.length,
|
440
|
+
callbackCount = 0
|
441
|
+
;
|
442
|
+
callback = callback || function(){};
|
443
|
+
$otherSidebars
|
444
|
+
.sidebar('hide', function() {
|
445
|
+
callbackCount++;
|
446
|
+
if(callbackCount == sidebarCount) {
|
447
|
+
callback();
|
448
|
+
}
|
449
|
+
})
|
450
|
+
;
|
451
|
+
},
|
452
|
+
|
453
|
+
toggle: function() {
|
454
|
+
module.verbose('Determining toggled direction');
|
455
|
+
if(module.is.hidden()) {
|
456
|
+
module.show();
|
457
|
+
}
|
458
|
+
else {
|
459
|
+
module.hide();
|
460
|
+
}
|
461
|
+
},
|
462
|
+
|
463
|
+
pushPage: function(callback) {
|
464
|
+
var
|
465
|
+
transition = module.get.transition(),
|
466
|
+
$transition = (transition === 'overlay' || module.othersActive())
|
467
|
+
? $module
|
468
|
+
: $pusher,
|
469
|
+
animate,
|
470
|
+
dim,
|
471
|
+
transitionEnd
|
472
|
+
;
|
473
|
+
callback = $.isFunction(callback)
|
474
|
+
? callback
|
475
|
+
: function(){}
|
476
|
+
;
|
477
|
+
if(settings.transition == 'scale down') {
|
478
|
+
module.scrollToTop();
|
479
|
+
}
|
480
|
+
module.set.transition(transition);
|
481
|
+
module.repaint();
|
482
|
+
animate = function() {
|
483
|
+
module.bind.clickaway();
|
484
|
+
module.add.inlineCSS();
|
485
|
+
module.set.animating();
|
486
|
+
module.set.visible();
|
487
|
+
};
|
488
|
+
dim = function() {
|
489
|
+
module.set.dimmed();
|
490
|
+
};
|
491
|
+
transitionEnd = function(event) {
|
492
|
+
if( event.target == $transition[0] ) {
|
493
|
+
$transition.off(transitionEvent + elementNamespace, transitionEnd);
|
494
|
+
module.remove.animating();
|
495
|
+
module.bind.scrollLock();
|
496
|
+
callback.call(element);
|
497
|
+
}
|
498
|
+
};
|
499
|
+
$transition.off(transitionEvent + elementNamespace);
|
500
|
+
$transition.on(transitionEvent + elementNamespace, transitionEnd);
|
501
|
+
requestAnimationFrame(animate);
|
502
|
+
if(settings.dimPage && !module.othersVisible()) {
|
503
|
+
requestAnimationFrame(dim);
|
504
|
+
}
|
505
|
+
},
|
506
|
+
|
507
|
+
pullPage: function(callback) {
|
508
|
+
var
|
509
|
+
transition = module.get.transition(),
|
510
|
+
$transition = (transition == 'overlay' || module.othersActive())
|
511
|
+
? $module
|
512
|
+
: $pusher,
|
513
|
+
animate,
|
514
|
+
transitionEnd
|
515
|
+
;
|
516
|
+
callback = $.isFunction(callback)
|
517
|
+
? callback
|
518
|
+
: function(){}
|
519
|
+
;
|
520
|
+
module.verbose('Removing context push state', module.get.direction());
|
521
|
+
|
522
|
+
module.unbind.clickaway();
|
523
|
+
module.unbind.scrollLock();
|
524
|
+
|
525
|
+
animate = function() {
|
526
|
+
module.set.transition(transition);
|
527
|
+
module.set.animating();
|
528
|
+
module.remove.visible();
|
529
|
+
if(settings.dimPage && !module.othersVisible()) {
|
530
|
+
$pusher.removeClass(className.dimmed);
|
531
|
+
}
|
532
|
+
};
|
533
|
+
transitionEnd = function(event) {
|
534
|
+
if( event.target == $transition[0] ) {
|
535
|
+
$transition.off(transitionEvent + elementNamespace, transitionEnd);
|
536
|
+
module.remove.animating();
|
537
|
+
module.remove.transition();
|
538
|
+
module.remove.inlineCSS();
|
539
|
+
if(transition == 'scale down' || (settings.returnScroll && module.is.mobile()) ) {
|
540
|
+
module.scrollBack();
|
541
|
+
}
|
542
|
+
callback.call(element);
|
543
|
+
}
|
544
|
+
};
|
545
|
+
$transition.off(transitionEvent + elementNamespace);
|
546
|
+
$transition.on(transitionEvent + elementNamespace, transitionEnd);
|
547
|
+
requestAnimationFrame(animate);
|
548
|
+
},
|
549
|
+
|
550
|
+
scrollToTop: function() {
|
551
|
+
module.verbose('Scrolling to top of page to avoid animation issues');
|
552
|
+
currentScroll = $(window).scrollTop();
|
553
|
+
$module.scrollTop(0);
|
554
|
+
window.scrollTo(0, 0);
|
555
|
+
},
|
556
|
+
|
557
|
+
scrollBack: function() {
|
558
|
+
module.verbose('Scrolling back to original page position');
|
559
|
+
window.scrollTo(0, currentScroll);
|
560
|
+
},
|
561
|
+
|
562
|
+
clear: {
|
563
|
+
cache: function() {
|
564
|
+
module.verbose('Clearing cached dimensions');
|
565
|
+
module.cache = {};
|
566
|
+
}
|
567
|
+
},
|
568
|
+
|
569
|
+
set: {
|
570
|
+
|
571
|
+
// ios only (scroll on html not document). This prevent auto-resize canvas/scroll in ios
|
572
|
+
ios: function() {
|
573
|
+
$html.addClass(className.ios);
|
574
|
+
},
|
575
|
+
|
576
|
+
// container
|
577
|
+
pushed: function() {
|
578
|
+
$context.addClass(className.pushed);
|
579
|
+
},
|
580
|
+
pushable: function() {
|
581
|
+
$context.addClass(className.pushable);
|
582
|
+
},
|
583
|
+
|
584
|
+
// pusher
|
585
|
+
dimmed: function() {
|
586
|
+
$pusher.addClass(className.dimmed);
|
587
|
+
},
|
588
|
+
|
589
|
+
// sidebar
|
590
|
+
active: function() {
|
591
|
+
$module.addClass(className.active);
|
592
|
+
},
|
593
|
+
animating: function() {
|
594
|
+
$module.addClass(className.animating);
|
595
|
+
},
|
596
|
+
transition: function(transition) {
|
597
|
+
transition = transition || module.get.transition();
|
598
|
+
$module.addClass(transition);
|
599
|
+
},
|
600
|
+
direction: function(direction) {
|
601
|
+
direction = direction || module.get.direction();
|
602
|
+
$module.addClass(className[direction]);
|
603
|
+
},
|
604
|
+
visible: function() {
|
605
|
+
$module.addClass(className.visible);
|
606
|
+
},
|
607
|
+
overlay: function() {
|
608
|
+
$module.addClass(className.overlay);
|
609
|
+
}
|
610
|
+
},
|
611
|
+
remove: {
|
612
|
+
|
613
|
+
inlineCSS: function() {
|
614
|
+
module.debug('Removing inline css styles', $style);
|
615
|
+
if($style && $style.length > 0) {
|
616
|
+
$style.remove();
|
617
|
+
}
|
618
|
+
},
|
619
|
+
|
620
|
+
// ios scroll on html not document
|
621
|
+
ios: function() {
|
622
|
+
$html.removeClass(className.ios);
|
623
|
+
},
|
624
|
+
|
625
|
+
// context
|
626
|
+
pushed: function() {
|
627
|
+
$context.removeClass(className.pushed);
|
628
|
+
},
|
629
|
+
pushable: function() {
|
630
|
+
$context.removeClass(className.pushable);
|
631
|
+
},
|
632
|
+
|
633
|
+
// sidebar
|
634
|
+
active: function() {
|
635
|
+
$module.removeClass(className.active);
|
636
|
+
},
|
637
|
+
animating: function() {
|
638
|
+
$module.removeClass(className.animating);
|
639
|
+
},
|
640
|
+
transition: function(transition) {
|
641
|
+
transition = transition || module.get.transition();
|
642
|
+
$module.removeClass(transition);
|
643
|
+
},
|
644
|
+
direction: function(direction) {
|
645
|
+
direction = direction || module.get.direction();
|
646
|
+
$module.removeClass(className[direction]);
|
647
|
+
},
|
648
|
+
visible: function() {
|
649
|
+
$module.removeClass(className.visible);
|
650
|
+
},
|
651
|
+
overlay: function() {
|
652
|
+
$module.removeClass(className.overlay);
|
653
|
+
}
|
654
|
+
},
|
655
|
+
|
656
|
+
get: {
|
657
|
+
direction: function() {
|
658
|
+
if($module.hasClass(className.top)) {
|
659
|
+
return className.top;
|
660
|
+
}
|
661
|
+
else if($module.hasClass(className.right)) {
|
662
|
+
return className.right;
|
663
|
+
}
|
664
|
+
else if($module.hasClass(className.bottom)) {
|
665
|
+
return className.bottom;
|
666
|
+
}
|
667
|
+
return className.left;
|
668
|
+
},
|
669
|
+
transition: function() {
|
670
|
+
var
|
671
|
+
direction = module.get.direction(),
|
672
|
+
transition
|
673
|
+
;
|
674
|
+
transition = ( module.is.mobile() )
|
675
|
+
? (settings.mobileTransition == 'auto')
|
676
|
+
? settings.defaultTransition.mobile[direction]
|
677
|
+
: settings.mobileTransition
|
678
|
+
: (settings.transition == 'auto')
|
679
|
+
? settings.defaultTransition.computer[direction]
|
680
|
+
: settings.transition
|
681
|
+
;
|
682
|
+
module.verbose('Determined transition', transition);
|
683
|
+
return transition;
|
684
|
+
},
|
685
|
+
transitionEvent: function() {
|
686
|
+
var
|
687
|
+
element = document.createElement('element'),
|
688
|
+
transitions = {
|
689
|
+
'transition' :'transitionend',
|
690
|
+
'OTransition' :'oTransitionEnd',
|
691
|
+
'MozTransition' :'transitionend',
|
692
|
+
'WebkitTransition' :'webkitTransitionEnd'
|
693
|
+
},
|
694
|
+
transition
|
695
|
+
;
|
696
|
+
for(transition in transitions){
|
697
|
+
if( element.style[transition] !== undefined ){
|
698
|
+
return transitions[transition];
|
699
|
+
}
|
700
|
+
}
|
701
|
+
}
|
702
|
+
},
|
703
|
+
|
704
|
+
is: {
|
705
|
+
|
706
|
+
ie: function() {
|
707
|
+
var
|
708
|
+
isIE11 = (!(window.ActiveXObject) && 'ActiveXObject' in window),
|
709
|
+
isIE = ('ActiveXObject' in window)
|
710
|
+
;
|
711
|
+
return (isIE11 || isIE);
|
712
|
+
},
|
713
|
+
|
714
|
+
ios: function() {
|
715
|
+
var
|
716
|
+
userAgent = navigator.userAgent,
|
717
|
+
isIOS = userAgent.match(regExp.ios),
|
718
|
+
isMobileChrome = userAgent.match(regExp.mobileChrome)
|
719
|
+
;
|
720
|
+
if(isIOS && !isMobileChrome) {
|
721
|
+
module.verbose('Browser was found to be iOS', userAgent);
|
722
|
+
return true;
|
723
|
+
}
|
724
|
+
else {
|
725
|
+
return false;
|
726
|
+
}
|
727
|
+
},
|
728
|
+
mobile: function() {
|
729
|
+
var
|
730
|
+
userAgent = navigator.userAgent,
|
731
|
+
isMobile = userAgent.match(regExp.mobile)
|
732
|
+
;
|
733
|
+
if(isMobile) {
|
734
|
+
module.verbose('Browser was found to be mobile', userAgent);
|
735
|
+
return true;
|
736
|
+
}
|
737
|
+
else {
|
738
|
+
module.verbose('Browser is not mobile, using regular transition', userAgent);
|
739
|
+
return false;
|
740
|
+
}
|
741
|
+
},
|
742
|
+
hidden: function() {
|
743
|
+
return !module.is.visible();
|
744
|
+
},
|
745
|
+
visible: function() {
|
746
|
+
return $module.hasClass(className.visible);
|
747
|
+
},
|
748
|
+
// alias
|
749
|
+
open: function() {
|
750
|
+
return module.is.visible();
|
751
|
+
},
|
752
|
+
closed: function() {
|
753
|
+
return module.is.hidden();
|
754
|
+
},
|
755
|
+
vertical: function() {
|
756
|
+
return $module.hasClass(className.top);
|
757
|
+
},
|
758
|
+
animating: function() {
|
759
|
+
return $context.hasClass(className.animating);
|
760
|
+
},
|
761
|
+
rtl: function () {
|
762
|
+
if(module.cache.rtl === undefined) {
|
763
|
+
module.cache.rtl = ($module.css('direction') == 'rtl');
|
764
|
+
}
|
765
|
+
return module.cache.rtl;
|
766
|
+
}
|
767
|
+
},
|
768
|
+
|
769
|
+
setting: function(name, value) {
|
770
|
+
module.debug('Changing setting', name, value);
|
771
|
+
if( $.isPlainObject(name) ) {
|
772
|
+
$.extend(true, settings, name);
|
773
|
+
}
|
774
|
+
else if(value !== undefined) {
|
775
|
+
if($.isPlainObject(settings[name])) {
|
776
|
+
$.extend(true, settings[name], value);
|
777
|
+
}
|
778
|
+
else {
|
779
|
+
settings[name] = value;
|
780
|
+
}
|
781
|
+
}
|
782
|
+
else {
|
783
|
+
return settings[name];
|
784
|
+
}
|
785
|
+
},
|
786
|
+
internal: function(name, value) {
|
787
|
+
if( $.isPlainObject(name) ) {
|
788
|
+
$.extend(true, module, name);
|
789
|
+
}
|
790
|
+
else if(value !== undefined) {
|
791
|
+
module[name] = value;
|
792
|
+
}
|
793
|
+
else {
|
794
|
+
return module[name];
|
795
|
+
}
|
796
|
+
},
|
797
|
+
debug: function() {
|
798
|
+
if(!settings.silent && settings.debug) {
|
799
|
+
if(settings.performance) {
|
800
|
+
module.performance.log(arguments);
|
801
|
+
}
|
802
|
+
else {
|
803
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
804
|
+
module.debug.apply(console, arguments);
|
805
|
+
}
|
806
|
+
}
|
807
|
+
},
|
808
|
+
verbose: function() {
|
809
|
+
if(!settings.silent && settings.verbose && settings.debug) {
|
810
|
+
if(settings.performance) {
|
811
|
+
module.performance.log(arguments);
|
812
|
+
}
|
813
|
+
else {
|
814
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
815
|
+
module.verbose.apply(console, arguments);
|
816
|
+
}
|
817
|
+
}
|
818
|
+
},
|
819
|
+
error: function() {
|
820
|
+
if(!settings.silent) {
|
821
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
822
|
+
module.error.apply(console, arguments);
|
823
|
+
}
|
824
|
+
},
|
825
|
+
performance: {
|
826
|
+
log: function(message) {
|
827
|
+
var
|
828
|
+
currentTime,
|
829
|
+
executionTime,
|
830
|
+
previousTime
|
831
|
+
;
|
832
|
+
if(settings.performance) {
|
833
|
+
currentTime = new Date().getTime();
|
834
|
+
previousTime = time || currentTime;
|
835
|
+
executionTime = currentTime - previousTime;
|
836
|
+
time = currentTime;
|
837
|
+
performance.push({
|
838
|
+
'Name' : message[0],
|
839
|
+
'Arguments' : [].slice.call(message, 1) || '',
|
840
|
+
'Element' : element,
|
841
|
+
'Execution Time' : executionTime
|
842
|
+
});
|
843
|
+
}
|
844
|
+
clearTimeout(module.performance.timer);
|
845
|
+
module.performance.timer = setTimeout(module.performance.display, 500);
|
846
|
+
},
|
847
|
+
display: function() {
|
848
|
+
var
|
849
|
+
title = settings.name + ':',
|
850
|
+
totalTime = 0
|
851
|
+
;
|
852
|
+
time = false;
|
853
|
+
clearTimeout(module.performance.timer);
|
854
|
+
$.each(performance, function(index, data) {
|
855
|
+
totalTime += data['Execution Time'];
|
856
|
+
});
|
857
|
+
title += ' ' + totalTime + 'ms';
|
858
|
+
if(moduleSelector) {
|
859
|
+
title += ' \'' + moduleSelector + '\'';
|
860
|
+
}
|
861
|
+
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
862
|
+
console.groupCollapsed(title);
|
863
|
+
if(console.table) {
|
864
|
+
console.table(performance);
|
865
|
+
}
|
866
|
+
else {
|
867
|
+
$.each(performance, function(index, data) {
|
868
|
+
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
869
|
+
});
|
870
|
+
}
|
871
|
+
console.groupEnd();
|
872
|
+
}
|
873
|
+
performance = [];
|
874
|
+
}
|
875
|
+
},
|
876
|
+
invoke: function(query, passedArguments, context) {
|
877
|
+
var
|
878
|
+
object = instance,
|
879
|
+
maxDepth,
|
880
|
+
found,
|
881
|
+
response
|
882
|
+
;
|
883
|
+
passedArguments = passedArguments || queryArguments;
|
884
|
+
context = element || context;
|
885
|
+
if(typeof query == 'string' && object !== undefined) {
|
886
|
+
query = query.split(/[\. ]/);
|
887
|
+
maxDepth = query.length - 1;
|
888
|
+
$.each(query, function(depth, value) {
|
889
|
+
var camelCaseValue = (depth != maxDepth)
|
890
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
891
|
+
: query
|
892
|
+
;
|
893
|
+
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
894
|
+
object = object[camelCaseValue];
|
895
|
+
}
|
896
|
+
else if( object[camelCaseValue] !== undefined ) {
|
897
|
+
found = object[camelCaseValue];
|
898
|
+
return false;
|
899
|
+
}
|
900
|
+
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
901
|
+
object = object[value];
|
902
|
+
}
|
903
|
+
else if( object[value] !== undefined ) {
|
904
|
+
found = object[value];
|
905
|
+
return false;
|
906
|
+
}
|
907
|
+
else {
|
908
|
+
module.error(error.method, query);
|
909
|
+
return false;
|
910
|
+
}
|
911
|
+
});
|
912
|
+
}
|
913
|
+
if ( $.isFunction( found ) ) {
|
914
|
+
response = found.apply(context, passedArguments);
|
915
|
+
}
|
916
|
+
else if(found !== undefined) {
|
917
|
+
response = found;
|
918
|
+
}
|
919
|
+
if($.isArray(returnedValue)) {
|
920
|
+
returnedValue.push(response);
|
921
|
+
}
|
922
|
+
else if(returnedValue !== undefined) {
|
923
|
+
returnedValue = [returnedValue, response];
|
924
|
+
}
|
925
|
+
else if(response !== undefined) {
|
926
|
+
returnedValue = response;
|
927
|
+
}
|
928
|
+
return found;
|
929
|
+
}
|
930
|
+
}
|
931
|
+
;
|
932
|
+
|
933
|
+
if(methodInvoked) {
|
934
|
+
if(instance === undefined) {
|
935
|
+
module.initialize();
|
936
|
+
}
|
937
|
+
module.invoke(query);
|
938
|
+
}
|
939
|
+
else {
|
940
|
+
if(instance !== undefined) {
|
941
|
+
module.invoke('destroy');
|
942
|
+
}
|
943
|
+
module.initialize();
|
944
|
+
}
|
945
|
+
});
|
946
|
+
|
947
|
+
return (returnedValue !== undefined)
|
948
|
+
? returnedValue
|
949
|
+
: this
|
950
|
+
;
|
951
|
+
};
|
952
|
+
|
953
|
+
$.fn.sidebar.settings = {
|
954
|
+
|
955
|
+
name : 'Sidebar',
|
956
|
+
namespace : 'sidebar',
|
957
|
+
|
958
|
+
silent : false,
|
959
|
+
debug : false,
|
960
|
+
verbose : false,
|
961
|
+
performance : true,
|
962
|
+
|
963
|
+
transition : 'auto',
|
964
|
+
mobileTransition : 'auto',
|
965
|
+
|
966
|
+
defaultTransition : {
|
967
|
+
computer: {
|
968
|
+
left : 'uncover',
|
969
|
+
right : 'uncover',
|
970
|
+
top : 'overlay',
|
971
|
+
bottom : 'overlay'
|
972
|
+
},
|
973
|
+
mobile: {
|
974
|
+
left : 'uncover',
|
975
|
+
right : 'uncover',
|
976
|
+
top : 'overlay',
|
977
|
+
bottom : 'overlay'
|
978
|
+
}
|
979
|
+
},
|
980
|
+
|
981
|
+
context : 'body',
|
982
|
+
exclusive : false,
|
983
|
+
closable : true,
|
984
|
+
dimPage : true,
|
985
|
+
scrollLock : false,
|
986
|
+
returnScroll : false,
|
987
|
+
delaySetup : false,
|
988
|
+
|
989
|
+
duration : 500,
|
990
|
+
|
991
|
+
onChange : function(){},
|
992
|
+
onShow : function(){},
|
993
|
+
onHide : function(){},
|
994
|
+
|
995
|
+
onHidden : function(){},
|
996
|
+
onVisible : function(){},
|
997
|
+
|
998
|
+
className : {
|
999
|
+
active : 'active',
|
1000
|
+
animating : 'animating',
|
1001
|
+
dimmed : 'dimmed',
|
1002
|
+
ios : 'ios',
|
1003
|
+
pushable : 'pushable',
|
1004
|
+
pushed : 'pushed',
|
1005
|
+
right : 'right',
|
1006
|
+
top : 'top',
|
1007
|
+
left : 'left',
|
1008
|
+
bottom : 'bottom',
|
1009
|
+
visible : 'visible'
|
1010
|
+
},
|
1011
|
+
|
1012
|
+
selector: {
|
1013
|
+
fixed : '.fixed',
|
1014
|
+
omitted : 'script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed',
|
1015
|
+
pusher : '.pusher',
|
1016
|
+
sidebar : '.ui.sidebar'
|
1017
|
+
},
|
1018
|
+
|
1019
|
+
regExp: {
|
1020
|
+
ios : /(iPad|iPhone|iPod)/g,
|
1021
|
+
mobileChrome : /(CriOS)/g,
|
1022
|
+
mobile : /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g
|
1023
|
+
},
|
1024
|
+
|
1025
|
+
error : {
|
1026
|
+
method : 'The method you called is not defined.',
|
1027
|
+
pusher : 'Had to add pusher element. For optimal performance make sure body content is inside a pusher element',
|
1028
|
+
movedSidebar : 'Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag',
|
1029
|
+
overlay : 'The overlay setting is no longer supported, use animation: overlay',
|
1030
|
+
notFound : 'There were no elements that matched the specified selector'
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
};
|
1034
|
+
|
1035
|
+
|
1036
|
+
})( jQuery, window, document );
|