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,9 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.2.9 - Comment
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Released under the MIT license
|
7
|
+
* http://opensource.org/licenses/MIT
|
8
|
+
*
|
9
|
+
*/.ui.comments{margin:1.5em 0;max-width:650px}.ui.comments:first-child{margin-top:0}.ui.comments:last-child{margin-bottom:0}.ui.comments .comment{position:relative;background:0 0;margin:.5em 0 0;padding:.5em 0 0;border:none;border-top:none;line-height:1.2}.ui.comments .comment:first-child{margin-top:0;padding-top:0}.ui.comments .comment .comments{margin:0 0 .5em .5em;padding:1em 0 1em 1em}.ui.comments .comment .comments:before{position:absolute;top:0;left:0}.ui.comments .comment .comments .comment{border:none;border-top:none;background:0 0}.ui.comments .comment .avatar{display:block;width:2.5em;height:auto;float:left;margin:.2em 0 0}.ui.comments .comment .avatar img,.ui.comments .comment img.avatar{display:block;margin:0 auto;width:100%;height:100%;border-radius:.25rem}.ui.comments .comment>.content{display:block}.ui.comments .comment>.avatar~.content{margin-left:3.5em}.ui.comments .comment .author{font-size:1em;color:rgba(0,0,0,.87);font-weight:700}.ui.comments .comment a.author{cursor:pointer}.ui.comments .comment a.author:hover{color:#1e70bf}.ui.comments .comment .metadata{display:inline-block;margin-left:.5em;color:rgba(0,0,0,.4);font-size:.875em}.ui.comments .comment .metadata>*{display:inline-block;margin:0 .5em 0 0}.ui.comments .comment .metadata>:last-child{margin-right:0}.ui.comments .comment .text{margin:.25em 0 .5em;font-size:1em;word-wrap:break-word;color:rgba(0,0,0,.87);line-height:1.3}.ui.comments .comment .actions{font-size:.875em}.ui.comments .comment .actions a{cursor:pointer;display:inline-block;margin:0 .75em 0 0;color:rgba(0,0,0,.4)}.ui.comments .comment .actions a:last-child{margin-right:0}.ui.comments .comment .actions a.active,.ui.comments .comment .actions a:hover{color:rgba(0,0,0,.8)}.ui.comments>.reply.form{margin-top:1em}.ui.comments .comment .reply.form{width:100%;margin-top:1em}.ui.comments .reply.form textarea{font-size:1em;height:12em}.ui.collapsed.comments,.ui.comments .collapsed.comment,.ui.comments .collapsed.comments{display:none}.ui.threaded.comments .comment .comments{margin:-1.5em 0 -1em 1.25em;padding:3em 0 2em 2.25em;box-shadow:-1px 0 0 rgba(34,36,38,.15)}.ui.minimal.comments .comment .actions{opacity:0;position:absolute;top:0;right:0;left:auto;-webkit-transition:opacity .2s ease;transition:opacity .2s ease;-webkit-transition-delay:.1s;transition-delay:.1s}.ui.minimal.comments .comment>.content:hover>.actions{opacity:1}.ui.mini.comments{font-size:.78571429rem}.ui.tiny.comments{font-size:.85714286rem}.ui.small.comments{font-size:.92857143rem}.ui.comments{font-size:1rem}.ui.large.comments{font-size:1.14285714rem}.ui.big.comments{font-size:1.28571429rem}.ui.huge.comments{font-size:1.42857143rem}.ui.massive.comments{font-size:1.71428571rem}
|
@@ -0,0 +1,147 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.2.9 - Container
|
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
|
+
|
12
|
+
/*******************************
|
13
|
+
Container
|
14
|
+
*******************************/
|
15
|
+
|
16
|
+
|
17
|
+
/* All Sizes */
|
18
|
+
.ui.container {
|
19
|
+
display: block;
|
20
|
+
max-width: 100% !important;
|
21
|
+
}
|
22
|
+
|
23
|
+
/* Mobile */
|
24
|
+
@media only screen and (max-width: 767px) {
|
25
|
+
.ui.container {
|
26
|
+
width: auto !important;
|
27
|
+
margin-left: 1em !important;
|
28
|
+
margin-right: 1em !important;
|
29
|
+
}
|
30
|
+
.ui.grid.container {
|
31
|
+
width: auto !important;
|
32
|
+
}
|
33
|
+
.ui.relaxed.grid.container {
|
34
|
+
width: auto !important;
|
35
|
+
}
|
36
|
+
.ui.very.relaxed.grid.container {
|
37
|
+
width: auto !important;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
/* Tablet */
|
42
|
+
@media only screen and (min-width: 768px) and (max-width: 991px) {
|
43
|
+
.ui.container {
|
44
|
+
width: 723px;
|
45
|
+
margin-left: auto !important;
|
46
|
+
margin-right: auto !important;
|
47
|
+
}
|
48
|
+
.ui.grid.container {
|
49
|
+
width: calc( 723px + 2rem ) !important;
|
50
|
+
}
|
51
|
+
.ui.relaxed.grid.container {
|
52
|
+
width: calc( 723px + 3rem ) !important;
|
53
|
+
}
|
54
|
+
.ui.very.relaxed.grid.container {
|
55
|
+
width: calc( 723px + 5rem ) !important;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
/* Small Monitor */
|
60
|
+
@media only screen and (min-width: 992px) and (max-width: 1199px) {
|
61
|
+
.ui.container {
|
62
|
+
width: 933px;
|
63
|
+
margin-left: auto !important;
|
64
|
+
margin-right: auto !important;
|
65
|
+
}
|
66
|
+
.ui.grid.container {
|
67
|
+
width: calc( 933px + 2rem ) !important;
|
68
|
+
}
|
69
|
+
.ui.relaxed.grid.container {
|
70
|
+
width: calc( 933px + 3rem ) !important;
|
71
|
+
}
|
72
|
+
.ui.very.relaxed.grid.container {
|
73
|
+
width: calc( 933px + 5rem ) !important;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
/* Large Monitor */
|
78
|
+
@media only screen and (min-width: 1200px) {
|
79
|
+
.ui.container {
|
80
|
+
width: 1127px;
|
81
|
+
margin-left: auto !important;
|
82
|
+
margin-right: auto !important;
|
83
|
+
}
|
84
|
+
.ui.grid.container {
|
85
|
+
width: calc( 1127px + 2rem ) !important;
|
86
|
+
}
|
87
|
+
.ui.relaxed.grid.container {
|
88
|
+
width: calc( 1127px + 3rem ) !important;
|
89
|
+
}
|
90
|
+
.ui.very.relaxed.grid.container {
|
91
|
+
width: calc( 1127px + 5rem ) !important;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
/*******************************
|
97
|
+
Types
|
98
|
+
*******************************/
|
99
|
+
|
100
|
+
|
101
|
+
/* Text Container */
|
102
|
+
.ui.text.container {
|
103
|
+
font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
104
|
+
max-width: 700px !important;
|
105
|
+
line-height: 1.5;
|
106
|
+
}
|
107
|
+
.ui.text.container {
|
108
|
+
font-size: 1.14285714rem;
|
109
|
+
}
|
110
|
+
|
111
|
+
/* Fluid */
|
112
|
+
.ui.fluid.container {
|
113
|
+
width: 100%;
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
/*******************************
|
118
|
+
Variations
|
119
|
+
*******************************/
|
120
|
+
|
121
|
+
.ui[class*="left aligned"].container {
|
122
|
+
text-align: left;
|
123
|
+
}
|
124
|
+
.ui[class*="center aligned"].container {
|
125
|
+
text-align: center;
|
126
|
+
}
|
127
|
+
.ui[class*="right aligned"].container {
|
128
|
+
text-align: right;
|
129
|
+
}
|
130
|
+
.ui.justified.container {
|
131
|
+
text-align: justify;
|
132
|
+
-webkit-hyphens: auto;
|
133
|
+
-ms-hyphens: auto;
|
134
|
+
hyphens: auto;
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
/*******************************
|
139
|
+
Theme Overrides
|
140
|
+
*******************************/
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
/*******************************
|
145
|
+
Site Overrides
|
146
|
+
*******************************/
|
147
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.2.9 - Container
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Released under the MIT license
|
7
|
+
* http://opensource.org/licenses/MIT
|
8
|
+
*
|
9
|
+
*/.ui.container{display:block;max-width:100%!important}@media only screen and (max-width:767px){.ui.container{width:auto!important;margin-left:1em!important;margin-right:1em!important}.ui.grid.container{width:auto!important}.ui.relaxed.grid.container{width:auto!important}.ui.very.relaxed.grid.container{width:auto!important}}@media only screen and (min-width:768px) and (max-width:991px){.ui.container{width:723px;margin-left:auto!important;margin-right:auto!important}.ui.grid.container{width:calc(723px + 2rem)!important}.ui.relaxed.grid.container{width:calc(723px + 3rem)!important}.ui.very.relaxed.grid.container{width:calc(723px + 5rem)!important}}@media only screen and (min-width:992px) and (max-width:1199px){.ui.container{width:933px;margin-left:auto!important;margin-right:auto!important}.ui.grid.container{width:calc(933px + 2rem)!important}.ui.relaxed.grid.container{width:calc(933px + 3rem)!important}.ui.very.relaxed.grid.container{width:calc(933px + 5rem)!important}}@media only screen and (min-width:1200px){.ui.container{width:1127px;margin-left:auto!important;margin-right:auto!important}.ui.grid.container{width:calc(1127px + 2rem)!important}.ui.relaxed.grid.container{width:calc(1127px + 3rem)!important}.ui.very.relaxed.grid.container{width:calc(1127px + 5rem)!important}}.ui.text.container{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;max-width:700px!important;line-height:1.5}.ui.text.container{font-size:1.14285714rem}.ui.fluid.container{width:100%}.ui[class*="left aligned"].container{text-align:left}.ui[class*="center aligned"].container{text-align:center}.ui[class*="right aligned"].container{text-align:right}.ui.justified.container{text-align:justify;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}
|
@@ -0,0 +1,200 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.2.9 - Dimmer
|
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
|
+
|
12
|
+
/*******************************
|
13
|
+
Dimmer
|
14
|
+
*******************************/
|
15
|
+
|
16
|
+
.dimmable:not(.body) {
|
17
|
+
position: relative;
|
18
|
+
}
|
19
|
+
.ui.dimmer {
|
20
|
+
display: none;
|
21
|
+
position: absolute;
|
22
|
+
top: 0em !important;
|
23
|
+
left: 0em !important;
|
24
|
+
width: 100%;
|
25
|
+
height: 100%;
|
26
|
+
text-align: center;
|
27
|
+
vertical-align: middle;
|
28
|
+
background-color: rgba(0, 0, 0, 0.85);
|
29
|
+
opacity: 0;
|
30
|
+
line-height: 1;
|
31
|
+
-webkit-animation-fill-mode: both;
|
32
|
+
animation-fill-mode: both;
|
33
|
+
-webkit-animation-duration: 0.5s;
|
34
|
+
animation-duration: 0.5s;
|
35
|
+
-webkit-transition: background-color 0.5s linear;
|
36
|
+
transition: background-color 0.5s linear;
|
37
|
+
-webkit-user-select: none;
|
38
|
+
-moz-user-select: none;
|
39
|
+
-ms-user-select: none;
|
40
|
+
user-select: none;
|
41
|
+
will-change: opacity;
|
42
|
+
z-index: 1000;
|
43
|
+
}
|
44
|
+
|
45
|
+
/* Dimmer Content */
|
46
|
+
.ui.dimmer > .content {
|
47
|
+
width: 100%;
|
48
|
+
height: 100%;
|
49
|
+
display: table;
|
50
|
+
-webkit-user-select: text;
|
51
|
+
-moz-user-select: text;
|
52
|
+
-ms-user-select: text;
|
53
|
+
user-select: text;
|
54
|
+
}
|
55
|
+
.ui.dimmer > .content > * {
|
56
|
+
display: table-cell;
|
57
|
+
vertical-align: middle;
|
58
|
+
color: #FFFFFF;
|
59
|
+
}
|
60
|
+
|
61
|
+
/* Loose Coupling */
|
62
|
+
.ui.segment > .ui.dimmer {
|
63
|
+
border-radius: inherit !important;
|
64
|
+
}
|
65
|
+
|
66
|
+
|
67
|
+
/*******************************
|
68
|
+
States
|
69
|
+
*******************************/
|
70
|
+
|
71
|
+
.animating.dimmable:not(body),
|
72
|
+
.dimmed.dimmable:not(body) {
|
73
|
+
overflow: hidden;
|
74
|
+
}
|
75
|
+
.dimmed.dimmable > .ui.animating.dimmer,
|
76
|
+
.dimmed.dimmable > .ui.visible.dimmer,
|
77
|
+
.ui.active.dimmer {
|
78
|
+
display: block;
|
79
|
+
opacity: 1;
|
80
|
+
}
|
81
|
+
.ui.disabled.dimmer {
|
82
|
+
width: 0 !important;
|
83
|
+
height: 0 !important;
|
84
|
+
}
|
85
|
+
|
86
|
+
|
87
|
+
/*******************************
|
88
|
+
Variations
|
89
|
+
*******************************/
|
90
|
+
|
91
|
+
|
92
|
+
/*--------------
|
93
|
+
Page
|
94
|
+
---------------*/
|
95
|
+
|
96
|
+
.ui.page.dimmer {
|
97
|
+
position: fixed;
|
98
|
+
-webkit-transform-style: '';
|
99
|
+
transform-style: '';
|
100
|
+
-webkit-perspective: 2000px;
|
101
|
+
perspective: 2000px;
|
102
|
+
-webkit-transform-origin: center center;
|
103
|
+
transform-origin: center center;
|
104
|
+
}
|
105
|
+
body.animating.in.dimmable,
|
106
|
+
body.dimmed.dimmable {
|
107
|
+
overflow: hidden;
|
108
|
+
}
|
109
|
+
body.dimmable > .dimmer {
|
110
|
+
position: fixed;
|
111
|
+
}
|
112
|
+
|
113
|
+
/*--------------
|
114
|
+
Blurring
|
115
|
+
---------------*/
|
116
|
+
|
117
|
+
.blurring.dimmable > :not(.dimmer) {
|
118
|
+
-webkit-filter: blur(0px) grayscale(0);
|
119
|
+
filter: blur(0px) grayscale(0);
|
120
|
+
-webkit-transition: 800ms -webkit-filter ease;
|
121
|
+
transition: 800ms -webkit-filter ease;
|
122
|
+
transition: 800ms filter ease;
|
123
|
+
transition: 800ms filter ease, 800ms -webkit-filter ease;
|
124
|
+
}
|
125
|
+
.blurring.dimmed.dimmable > :not(.dimmer) {
|
126
|
+
-webkit-filter: blur(5px) grayscale(0.7);
|
127
|
+
filter: blur(5px) grayscale(0.7);
|
128
|
+
}
|
129
|
+
|
130
|
+
/* Dimmer Color */
|
131
|
+
.blurring.dimmable > .dimmer {
|
132
|
+
background-color: rgba(0, 0, 0, 0.6);
|
133
|
+
}
|
134
|
+
.blurring.dimmable > .inverted.dimmer {
|
135
|
+
background-color: rgba(255, 255, 255, 0.6);
|
136
|
+
}
|
137
|
+
|
138
|
+
/*--------------
|
139
|
+
Aligned
|
140
|
+
---------------*/
|
141
|
+
|
142
|
+
.ui.dimmer > .top.aligned.content > * {
|
143
|
+
vertical-align: top;
|
144
|
+
}
|
145
|
+
.ui.dimmer > .bottom.aligned.content > * {
|
146
|
+
vertical-align: bottom;
|
147
|
+
}
|
148
|
+
|
149
|
+
/*--------------
|
150
|
+
Inverted
|
151
|
+
---------------*/
|
152
|
+
|
153
|
+
.ui.inverted.dimmer {
|
154
|
+
background-color: rgba(255, 255, 255, 0.85);
|
155
|
+
}
|
156
|
+
.ui.inverted.dimmer > .content > * {
|
157
|
+
color: #FFFFFF;
|
158
|
+
}
|
159
|
+
|
160
|
+
/*--------------
|
161
|
+
Simple
|
162
|
+
---------------*/
|
163
|
+
|
164
|
+
|
165
|
+
/* Displays without javascript */
|
166
|
+
.ui.simple.dimmer {
|
167
|
+
display: block;
|
168
|
+
overflow: hidden;
|
169
|
+
opacity: 1;
|
170
|
+
width: 0%;
|
171
|
+
height: 0%;
|
172
|
+
z-index: -100;
|
173
|
+
background-color: rgba(0, 0, 0, 0);
|
174
|
+
}
|
175
|
+
.dimmed.dimmable > .ui.simple.dimmer {
|
176
|
+
overflow: visible;
|
177
|
+
opacity: 1;
|
178
|
+
width: 100%;
|
179
|
+
height: 100%;
|
180
|
+
background-color: rgba(0, 0, 0, 0.85);
|
181
|
+
z-index: 1;
|
182
|
+
}
|
183
|
+
.ui.simple.inverted.dimmer {
|
184
|
+
background-color: rgba(255, 255, 255, 0);
|
185
|
+
}
|
186
|
+
.dimmed.dimmable > .ui.simple.inverted.dimmer {
|
187
|
+
background-color: rgba(255, 255, 255, 0.85);
|
188
|
+
}
|
189
|
+
|
190
|
+
|
191
|
+
/*******************************
|
192
|
+
Theme Overrides
|
193
|
+
*******************************/
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
/*******************************
|
198
|
+
User Overrides
|
199
|
+
*******************************/
|
200
|
+
|
@@ -0,0 +1,708 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.2.9 - Dimmer
|
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.dimmer = function(parameters) {
|
23
|
+
var
|
24
|
+
$allModules = $(this),
|
25
|
+
|
26
|
+
time = new Date().getTime(),
|
27
|
+
performance = [],
|
28
|
+
|
29
|
+
query = arguments[0],
|
30
|
+
methodInvoked = (typeof query == 'string'),
|
31
|
+
queryArguments = [].slice.call(arguments, 1),
|
32
|
+
|
33
|
+
returnedValue
|
34
|
+
;
|
35
|
+
|
36
|
+
$allModules
|
37
|
+
.each(function() {
|
38
|
+
var
|
39
|
+
settings = ( $.isPlainObject(parameters) )
|
40
|
+
? $.extend(true, {}, $.fn.dimmer.settings, parameters)
|
41
|
+
: $.extend({}, $.fn.dimmer.settings),
|
42
|
+
|
43
|
+
selector = settings.selector,
|
44
|
+
namespace = settings.namespace,
|
45
|
+
className = settings.className,
|
46
|
+
error = settings.error,
|
47
|
+
|
48
|
+
eventNamespace = '.' + namespace,
|
49
|
+
moduleNamespace = 'module-' + namespace,
|
50
|
+
moduleSelector = $allModules.selector || '',
|
51
|
+
|
52
|
+
clickEvent = ('ontouchstart' in document.documentElement)
|
53
|
+
? 'touchstart'
|
54
|
+
: 'click',
|
55
|
+
|
56
|
+
$module = $(this),
|
57
|
+
$dimmer,
|
58
|
+
$dimmable,
|
59
|
+
|
60
|
+
element = this,
|
61
|
+
instance = $module.data(moduleNamespace),
|
62
|
+
module
|
63
|
+
;
|
64
|
+
|
65
|
+
module = {
|
66
|
+
|
67
|
+
preinitialize: function() {
|
68
|
+
if( module.is.dimmer() ) {
|
69
|
+
|
70
|
+
$dimmable = $module.parent();
|
71
|
+
$dimmer = $module;
|
72
|
+
}
|
73
|
+
else {
|
74
|
+
$dimmable = $module;
|
75
|
+
if( module.has.dimmer() ) {
|
76
|
+
if(settings.dimmerName) {
|
77
|
+
$dimmer = $dimmable.find(selector.dimmer).filter('.' + settings.dimmerName);
|
78
|
+
}
|
79
|
+
else {
|
80
|
+
$dimmer = $dimmable.find(selector.dimmer);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
else {
|
84
|
+
$dimmer = module.create();
|
85
|
+
}
|
86
|
+
module.set.variation();
|
87
|
+
}
|
88
|
+
},
|
89
|
+
|
90
|
+
initialize: function() {
|
91
|
+
module.debug('Initializing dimmer', settings);
|
92
|
+
|
93
|
+
module.bind.events();
|
94
|
+
module.set.dimmable();
|
95
|
+
module.instantiate();
|
96
|
+
},
|
97
|
+
|
98
|
+
instantiate: function() {
|
99
|
+
module.verbose('Storing instance of module', module);
|
100
|
+
instance = module;
|
101
|
+
$module
|
102
|
+
.data(moduleNamespace, instance)
|
103
|
+
;
|
104
|
+
},
|
105
|
+
|
106
|
+
destroy: function() {
|
107
|
+
module.verbose('Destroying previous module', $dimmer);
|
108
|
+
module.unbind.events();
|
109
|
+
module.remove.variation();
|
110
|
+
$dimmable
|
111
|
+
.off(eventNamespace)
|
112
|
+
;
|
113
|
+
},
|
114
|
+
|
115
|
+
bind: {
|
116
|
+
events: function() {
|
117
|
+
if(settings.on == 'hover') {
|
118
|
+
$dimmable
|
119
|
+
.on('mouseenter' + eventNamespace, module.show)
|
120
|
+
.on('mouseleave' + eventNamespace, module.hide)
|
121
|
+
;
|
122
|
+
}
|
123
|
+
else if(settings.on == 'click') {
|
124
|
+
$dimmable
|
125
|
+
.on(clickEvent + eventNamespace, module.toggle)
|
126
|
+
;
|
127
|
+
}
|
128
|
+
if( module.is.page() ) {
|
129
|
+
module.debug('Setting as a page dimmer', $dimmable);
|
130
|
+
module.set.pageDimmer();
|
131
|
+
}
|
132
|
+
|
133
|
+
if( module.is.closable() ) {
|
134
|
+
module.verbose('Adding dimmer close event', $dimmer);
|
135
|
+
$dimmable
|
136
|
+
.on(clickEvent + eventNamespace, selector.dimmer, module.event.click)
|
137
|
+
;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
},
|
141
|
+
|
142
|
+
unbind: {
|
143
|
+
events: function() {
|
144
|
+
$module
|
145
|
+
.removeData(moduleNamespace)
|
146
|
+
;
|
147
|
+
$dimmable
|
148
|
+
.off(eventNamespace)
|
149
|
+
;
|
150
|
+
}
|
151
|
+
},
|
152
|
+
|
153
|
+
event: {
|
154
|
+
click: function(event) {
|
155
|
+
module.verbose('Determining if event occured on dimmer', event);
|
156
|
+
if( $dimmer.find(event.target).length === 0 || $(event.target).is(selector.content) ) {
|
157
|
+
module.hide();
|
158
|
+
event.stopImmediatePropagation();
|
159
|
+
}
|
160
|
+
}
|
161
|
+
},
|
162
|
+
|
163
|
+
addContent: function(element) {
|
164
|
+
var
|
165
|
+
$content = $(element)
|
166
|
+
;
|
167
|
+
module.debug('Add content to dimmer', $content);
|
168
|
+
if($content.parent()[0] !== $dimmer[0]) {
|
169
|
+
$content.detach().appendTo($dimmer);
|
170
|
+
}
|
171
|
+
},
|
172
|
+
|
173
|
+
create: function() {
|
174
|
+
var
|
175
|
+
$element = $( settings.template.dimmer() )
|
176
|
+
;
|
177
|
+
if(settings.dimmerName) {
|
178
|
+
module.debug('Creating named dimmer', settings.dimmerName);
|
179
|
+
$element.addClass(settings.dimmerName);
|
180
|
+
}
|
181
|
+
$element
|
182
|
+
.appendTo($dimmable)
|
183
|
+
;
|
184
|
+
return $element;
|
185
|
+
},
|
186
|
+
|
187
|
+
show: function(callback) {
|
188
|
+
callback = $.isFunction(callback)
|
189
|
+
? callback
|
190
|
+
: function(){}
|
191
|
+
;
|
192
|
+
module.debug('Showing dimmer', $dimmer, settings);
|
193
|
+
if( (!module.is.dimmed() || module.is.animating()) && module.is.enabled() ) {
|
194
|
+
module.animate.show(callback);
|
195
|
+
settings.onShow.call(element);
|
196
|
+
settings.onChange.call(element);
|
197
|
+
}
|
198
|
+
else {
|
199
|
+
module.debug('Dimmer is already shown or disabled');
|
200
|
+
}
|
201
|
+
},
|
202
|
+
|
203
|
+
hide: function(callback) {
|
204
|
+
callback = $.isFunction(callback)
|
205
|
+
? callback
|
206
|
+
: function(){}
|
207
|
+
;
|
208
|
+
if( module.is.dimmed() || module.is.animating() ) {
|
209
|
+
module.debug('Hiding dimmer', $dimmer);
|
210
|
+
module.animate.hide(callback);
|
211
|
+
settings.onHide.call(element);
|
212
|
+
settings.onChange.call(element);
|
213
|
+
}
|
214
|
+
else {
|
215
|
+
module.debug('Dimmer is not visible');
|
216
|
+
}
|
217
|
+
},
|
218
|
+
|
219
|
+
toggle: function() {
|
220
|
+
module.verbose('Toggling dimmer visibility', $dimmer);
|
221
|
+
if( !module.is.dimmed() ) {
|
222
|
+
module.show();
|
223
|
+
}
|
224
|
+
else {
|
225
|
+
module.hide();
|
226
|
+
}
|
227
|
+
},
|
228
|
+
|
229
|
+
animate: {
|
230
|
+
show: function(callback) {
|
231
|
+
callback = $.isFunction(callback)
|
232
|
+
? callback
|
233
|
+
: function(){}
|
234
|
+
;
|
235
|
+
if(settings.useCSS && $.fn.transition !== undefined && $dimmer.transition('is supported')) {
|
236
|
+
if(settings.opacity !== 'auto') {
|
237
|
+
module.set.opacity();
|
238
|
+
}
|
239
|
+
$dimmer
|
240
|
+
.transition({
|
241
|
+
animation : settings.transition + ' in',
|
242
|
+
queue : false,
|
243
|
+
duration : module.get.duration(),
|
244
|
+
useFailSafe : true,
|
245
|
+
onStart : function() {
|
246
|
+
module.set.dimmed();
|
247
|
+
},
|
248
|
+
onComplete : function() {
|
249
|
+
module.set.active();
|
250
|
+
callback();
|
251
|
+
}
|
252
|
+
})
|
253
|
+
;
|
254
|
+
}
|
255
|
+
else {
|
256
|
+
module.verbose('Showing dimmer animation with javascript');
|
257
|
+
module.set.dimmed();
|
258
|
+
if(settings.opacity == 'auto') {
|
259
|
+
settings.opacity = 0.8;
|
260
|
+
}
|
261
|
+
$dimmer
|
262
|
+
.stop()
|
263
|
+
.css({
|
264
|
+
opacity : 0,
|
265
|
+
width : '100%',
|
266
|
+
height : '100%'
|
267
|
+
})
|
268
|
+
.fadeTo(module.get.duration(), settings.opacity, function() {
|
269
|
+
$dimmer.removeAttr('style');
|
270
|
+
module.set.active();
|
271
|
+
callback();
|
272
|
+
})
|
273
|
+
;
|
274
|
+
}
|
275
|
+
},
|
276
|
+
hide: function(callback) {
|
277
|
+
callback = $.isFunction(callback)
|
278
|
+
? callback
|
279
|
+
: function(){}
|
280
|
+
;
|
281
|
+
if(settings.useCSS && $.fn.transition !== undefined && $dimmer.transition('is supported')) {
|
282
|
+
module.verbose('Hiding dimmer with css');
|
283
|
+
$dimmer
|
284
|
+
.transition({
|
285
|
+
animation : settings.transition + ' out',
|
286
|
+
queue : false,
|
287
|
+
duration : module.get.duration(),
|
288
|
+
useFailSafe : true,
|
289
|
+
onStart : function() {
|
290
|
+
module.remove.dimmed();
|
291
|
+
},
|
292
|
+
onComplete : function() {
|
293
|
+
module.remove.active();
|
294
|
+
callback();
|
295
|
+
}
|
296
|
+
})
|
297
|
+
;
|
298
|
+
}
|
299
|
+
else {
|
300
|
+
module.verbose('Hiding dimmer with javascript');
|
301
|
+
module.remove.dimmed();
|
302
|
+
$dimmer
|
303
|
+
.stop()
|
304
|
+
.fadeOut(module.get.duration(), function() {
|
305
|
+
module.remove.active();
|
306
|
+
$dimmer.removeAttr('style');
|
307
|
+
callback();
|
308
|
+
})
|
309
|
+
;
|
310
|
+
}
|
311
|
+
}
|
312
|
+
},
|
313
|
+
|
314
|
+
get: {
|
315
|
+
dimmer: function() {
|
316
|
+
return $dimmer;
|
317
|
+
},
|
318
|
+
duration: function() {
|
319
|
+
if(typeof settings.duration == 'object') {
|
320
|
+
if( module.is.active() ) {
|
321
|
+
return settings.duration.hide;
|
322
|
+
}
|
323
|
+
else {
|
324
|
+
return settings.duration.show;
|
325
|
+
}
|
326
|
+
}
|
327
|
+
return settings.duration;
|
328
|
+
}
|
329
|
+
},
|
330
|
+
|
331
|
+
has: {
|
332
|
+
dimmer: function() {
|
333
|
+
if(settings.dimmerName) {
|
334
|
+
return ($module.find(selector.dimmer).filter('.' + settings.dimmerName).length > 0);
|
335
|
+
}
|
336
|
+
else {
|
337
|
+
return ( $module.find(selector.dimmer).length > 0 );
|
338
|
+
}
|
339
|
+
}
|
340
|
+
},
|
341
|
+
|
342
|
+
is: {
|
343
|
+
active: function() {
|
344
|
+
return $dimmer.hasClass(className.active);
|
345
|
+
},
|
346
|
+
animating: function() {
|
347
|
+
return ( $dimmer.is(':animated') || $dimmer.hasClass(className.animating) );
|
348
|
+
},
|
349
|
+
closable: function() {
|
350
|
+
if(settings.closable == 'auto') {
|
351
|
+
if(settings.on == 'hover') {
|
352
|
+
return false;
|
353
|
+
}
|
354
|
+
return true;
|
355
|
+
}
|
356
|
+
return settings.closable;
|
357
|
+
},
|
358
|
+
dimmer: function() {
|
359
|
+
return $module.hasClass(className.dimmer);
|
360
|
+
},
|
361
|
+
dimmable: function() {
|
362
|
+
return $module.hasClass(className.dimmable);
|
363
|
+
},
|
364
|
+
dimmed: function() {
|
365
|
+
return $dimmable.hasClass(className.dimmed);
|
366
|
+
},
|
367
|
+
disabled: function() {
|
368
|
+
return $dimmable.hasClass(className.disabled);
|
369
|
+
},
|
370
|
+
enabled: function() {
|
371
|
+
return !module.is.disabled();
|
372
|
+
},
|
373
|
+
page: function () {
|
374
|
+
return $dimmable.is('body');
|
375
|
+
},
|
376
|
+
pageDimmer: function() {
|
377
|
+
return $dimmer.hasClass(className.pageDimmer);
|
378
|
+
}
|
379
|
+
},
|
380
|
+
|
381
|
+
can: {
|
382
|
+
show: function() {
|
383
|
+
return !$dimmer.hasClass(className.disabled);
|
384
|
+
}
|
385
|
+
},
|
386
|
+
|
387
|
+
set: {
|
388
|
+
opacity: function(opacity) {
|
389
|
+
var
|
390
|
+
color = $dimmer.css('background-color'),
|
391
|
+
colorArray = color.split(','),
|
392
|
+
isRGB = (colorArray && colorArray.length == 3),
|
393
|
+
isRGBA = (colorArray && colorArray.length == 4)
|
394
|
+
;
|
395
|
+
opacity = settings.opacity === 0 ? 0 : settings.opacity || opacity;
|
396
|
+
if(isRGB || isRGBA) {
|
397
|
+
colorArray[3] = opacity + ')';
|
398
|
+
color = colorArray.join(',');
|
399
|
+
}
|
400
|
+
else {
|
401
|
+
color = 'rgba(0, 0, 0, ' + opacity + ')';
|
402
|
+
}
|
403
|
+
module.debug('Setting opacity to', opacity);
|
404
|
+
$dimmer.css('background-color', color);
|
405
|
+
},
|
406
|
+
active: function() {
|
407
|
+
$dimmer.addClass(className.active);
|
408
|
+
},
|
409
|
+
dimmable: function() {
|
410
|
+
$dimmable.addClass(className.dimmable);
|
411
|
+
},
|
412
|
+
dimmed: function() {
|
413
|
+
$dimmable.addClass(className.dimmed);
|
414
|
+
},
|
415
|
+
pageDimmer: function() {
|
416
|
+
$dimmer.addClass(className.pageDimmer);
|
417
|
+
},
|
418
|
+
disabled: function() {
|
419
|
+
$dimmer.addClass(className.disabled);
|
420
|
+
},
|
421
|
+
variation: function(variation) {
|
422
|
+
variation = variation || settings.variation;
|
423
|
+
if(variation) {
|
424
|
+
$dimmer.addClass(variation);
|
425
|
+
}
|
426
|
+
}
|
427
|
+
},
|
428
|
+
|
429
|
+
remove: {
|
430
|
+
active: function() {
|
431
|
+
$dimmer
|
432
|
+
.removeClass(className.active)
|
433
|
+
;
|
434
|
+
},
|
435
|
+
dimmed: function() {
|
436
|
+
$dimmable.removeClass(className.dimmed);
|
437
|
+
},
|
438
|
+
disabled: function() {
|
439
|
+
$dimmer.removeClass(className.disabled);
|
440
|
+
},
|
441
|
+
variation: function(variation) {
|
442
|
+
variation = variation || settings.variation;
|
443
|
+
if(variation) {
|
444
|
+
$dimmer.removeClass(variation);
|
445
|
+
}
|
446
|
+
}
|
447
|
+
},
|
448
|
+
|
449
|
+
setting: function(name, value) {
|
450
|
+
module.debug('Changing setting', name, value);
|
451
|
+
if( $.isPlainObject(name) ) {
|
452
|
+
$.extend(true, settings, name);
|
453
|
+
}
|
454
|
+
else if(value !== undefined) {
|
455
|
+
if($.isPlainObject(settings[name])) {
|
456
|
+
$.extend(true, settings[name], value);
|
457
|
+
}
|
458
|
+
else {
|
459
|
+
settings[name] = value;
|
460
|
+
}
|
461
|
+
}
|
462
|
+
else {
|
463
|
+
return settings[name];
|
464
|
+
}
|
465
|
+
},
|
466
|
+
internal: function(name, value) {
|
467
|
+
if( $.isPlainObject(name) ) {
|
468
|
+
$.extend(true, module, name);
|
469
|
+
}
|
470
|
+
else if(value !== undefined) {
|
471
|
+
module[name] = value;
|
472
|
+
}
|
473
|
+
else {
|
474
|
+
return module[name];
|
475
|
+
}
|
476
|
+
},
|
477
|
+
debug: function() {
|
478
|
+
if(!settings.silent && settings.debug) {
|
479
|
+
if(settings.performance) {
|
480
|
+
module.performance.log(arguments);
|
481
|
+
}
|
482
|
+
else {
|
483
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
484
|
+
module.debug.apply(console, arguments);
|
485
|
+
}
|
486
|
+
}
|
487
|
+
},
|
488
|
+
verbose: function() {
|
489
|
+
if(!settings.silent && settings.verbose && settings.debug) {
|
490
|
+
if(settings.performance) {
|
491
|
+
module.performance.log(arguments);
|
492
|
+
}
|
493
|
+
else {
|
494
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
495
|
+
module.verbose.apply(console, arguments);
|
496
|
+
}
|
497
|
+
}
|
498
|
+
},
|
499
|
+
error: function() {
|
500
|
+
if(!settings.silent) {
|
501
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
502
|
+
module.error.apply(console, arguments);
|
503
|
+
}
|
504
|
+
},
|
505
|
+
performance: {
|
506
|
+
log: function(message) {
|
507
|
+
var
|
508
|
+
currentTime,
|
509
|
+
executionTime,
|
510
|
+
previousTime
|
511
|
+
;
|
512
|
+
if(settings.performance) {
|
513
|
+
currentTime = new Date().getTime();
|
514
|
+
previousTime = time || currentTime;
|
515
|
+
executionTime = currentTime - previousTime;
|
516
|
+
time = currentTime;
|
517
|
+
performance.push({
|
518
|
+
'Name' : message[0],
|
519
|
+
'Arguments' : [].slice.call(message, 1) || '',
|
520
|
+
'Element' : element,
|
521
|
+
'Execution Time' : executionTime
|
522
|
+
});
|
523
|
+
}
|
524
|
+
clearTimeout(module.performance.timer);
|
525
|
+
module.performance.timer = setTimeout(module.performance.display, 500);
|
526
|
+
},
|
527
|
+
display: function() {
|
528
|
+
var
|
529
|
+
title = settings.name + ':',
|
530
|
+
totalTime = 0
|
531
|
+
;
|
532
|
+
time = false;
|
533
|
+
clearTimeout(module.performance.timer);
|
534
|
+
$.each(performance, function(index, data) {
|
535
|
+
totalTime += data['Execution Time'];
|
536
|
+
});
|
537
|
+
title += ' ' + totalTime + 'ms';
|
538
|
+
if(moduleSelector) {
|
539
|
+
title += ' \'' + moduleSelector + '\'';
|
540
|
+
}
|
541
|
+
if($allModules.length > 1) {
|
542
|
+
title += ' ' + '(' + $allModules.length + ')';
|
543
|
+
}
|
544
|
+
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
545
|
+
console.groupCollapsed(title);
|
546
|
+
if(console.table) {
|
547
|
+
console.table(performance);
|
548
|
+
}
|
549
|
+
else {
|
550
|
+
$.each(performance, function(index, data) {
|
551
|
+
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
552
|
+
});
|
553
|
+
}
|
554
|
+
console.groupEnd();
|
555
|
+
}
|
556
|
+
performance = [];
|
557
|
+
}
|
558
|
+
},
|
559
|
+
invoke: function(query, passedArguments, context) {
|
560
|
+
var
|
561
|
+
object = instance,
|
562
|
+
maxDepth,
|
563
|
+
found,
|
564
|
+
response
|
565
|
+
;
|
566
|
+
passedArguments = passedArguments || queryArguments;
|
567
|
+
context = element || context;
|
568
|
+
if(typeof query == 'string' && object !== undefined) {
|
569
|
+
query = query.split(/[\. ]/);
|
570
|
+
maxDepth = query.length - 1;
|
571
|
+
$.each(query, function(depth, value) {
|
572
|
+
var camelCaseValue = (depth != maxDepth)
|
573
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
574
|
+
: query
|
575
|
+
;
|
576
|
+
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
577
|
+
object = object[camelCaseValue];
|
578
|
+
}
|
579
|
+
else if( object[camelCaseValue] !== undefined ) {
|
580
|
+
found = object[camelCaseValue];
|
581
|
+
return false;
|
582
|
+
}
|
583
|
+
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
584
|
+
object = object[value];
|
585
|
+
}
|
586
|
+
else if( object[value] !== undefined ) {
|
587
|
+
found = object[value];
|
588
|
+
return false;
|
589
|
+
}
|
590
|
+
else {
|
591
|
+
module.error(error.method, query);
|
592
|
+
return false;
|
593
|
+
}
|
594
|
+
});
|
595
|
+
}
|
596
|
+
if ( $.isFunction( found ) ) {
|
597
|
+
response = found.apply(context, passedArguments);
|
598
|
+
}
|
599
|
+
else if(found !== undefined) {
|
600
|
+
response = found;
|
601
|
+
}
|
602
|
+
if($.isArray(returnedValue)) {
|
603
|
+
returnedValue.push(response);
|
604
|
+
}
|
605
|
+
else if(returnedValue !== undefined) {
|
606
|
+
returnedValue = [returnedValue, response];
|
607
|
+
}
|
608
|
+
else if(response !== undefined) {
|
609
|
+
returnedValue = response;
|
610
|
+
}
|
611
|
+
return found;
|
612
|
+
}
|
613
|
+
};
|
614
|
+
|
615
|
+
module.preinitialize();
|
616
|
+
|
617
|
+
if(methodInvoked) {
|
618
|
+
if(instance === undefined) {
|
619
|
+
module.initialize();
|
620
|
+
}
|
621
|
+
module.invoke(query);
|
622
|
+
}
|
623
|
+
else {
|
624
|
+
if(instance !== undefined) {
|
625
|
+
instance.invoke('destroy');
|
626
|
+
}
|
627
|
+
module.initialize();
|
628
|
+
}
|
629
|
+
})
|
630
|
+
;
|
631
|
+
|
632
|
+
return (returnedValue !== undefined)
|
633
|
+
? returnedValue
|
634
|
+
: this
|
635
|
+
;
|
636
|
+
};
|
637
|
+
|
638
|
+
$.fn.dimmer.settings = {
|
639
|
+
|
640
|
+
name : 'Dimmer',
|
641
|
+
namespace : 'dimmer',
|
642
|
+
|
643
|
+
silent : false,
|
644
|
+
debug : false,
|
645
|
+
verbose : false,
|
646
|
+
performance : true,
|
647
|
+
|
648
|
+
// name to distinguish between multiple dimmers in context
|
649
|
+
dimmerName : false,
|
650
|
+
|
651
|
+
// whether to add a variation type
|
652
|
+
variation : false,
|
653
|
+
|
654
|
+
// whether to bind close events
|
655
|
+
closable : 'auto',
|
656
|
+
|
657
|
+
// whether to use css animations
|
658
|
+
useCSS : true,
|
659
|
+
|
660
|
+
// css animation to use
|
661
|
+
transition : 'fade',
|
662
|
+
|
663
|
+
// event to bind to
|
664
|
+
on : false,
|
665
|
+
|
666
|
+
// overriding opacity value
|
667
|
+
opacity : 'auto',
|
668
|
+
|
669
|
+
// transition durations
|
670
|
+
duration : {
|
671
|
+
show : 500,
|
672
|
+
hide : 500
|
673
|
+
},
|
674
|
+
|
675
|
+
onChange : function(){},
|
676
|
+
onShow : function(){},
|
677
|
+
onHide : function(){},
|
678
|
+
|
679
|
+
error : {
|
680
|
+
method : 'The method you called is not defined.'
|
681
|
+
},
|
682
|
+
|
683
|
+
className : {
|
684
|
+
active : 'active',
|
685
|
+
animating : 'animating',
|
686
|
+
dimmable : 'dimmable',
|
687
|
+
dimmed : 'dimmed',
|
688
|
+
dimmer : 'dimmer',
|
689
|
+
disabled : 'disabled',
|
690
|
+
hide : 'hide',
|
691
|
+
pageDimmer : 'page',
|
692
|
+
show : 'show'
|
693
|
+
},
|
694
|
+
|
695
|
+
selector: {
|
696
|
+
dimmer : '> .ui.dimmer',
|
697
|
+
content : '.ui.dimmer > .content, .ui.dimmer > .content > .center'
|
698
|
+
},
|
699
|
+
|
700
|
+
template: {
|
701
|
+
dimmer: function() {
|
702
|
+
return $('<div />').attr('class', 'ui dimmer');
|
703
|
+
}
|
704
|
+
}
|
705
|
+
|
706
|
+
};
|
707
|
+
|
708
|
+
})( jQuery, window, document );
|