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,50 @@
|
|
1
|
+
module Vapid
|
2
|
+
class Template
|
3
|
+
# HTML parser and DOM walker
|
4
|
+
#
|
5
|
+
# @todo Possibly use something other than Nokogiri, since it automatically adds DOCTYPE, etc
|
6
|
+
class Parser
|
7
|
+
attr_accessor :doc
|
8
|
+
|
9
|
+
def initialize(html, initial_context)
|
10
|
+
@doc = Nokogiri::HTML(html)
|
11
|
+
@context_stack = [initial_context]
|
12
|
+
end
|
13
|
+
|
14
|
+
def walk(node = doc_root, set_context: nil, &block)
|
15
|
+
if node.group?
|
16
|
+
context = set_context.present? ? set_context.call(node.group_expr) : node.group_expr
|
17
|
+
push_context(context)
|
18
|
+
end
|
19
|
+
|
20
|
+
yield(node, *@context_stack) if node.directives?
|
21
|
+
|
22
|
+
next_node = node.first_child
|
23
|
+
while next_node
|
24
|
+
walk(next_node, set_context: set_context, &block)
|
25
|
+
next_node = next_node.next_sibling
|
26
|
+
end
|
27
|
+
|
28
|
+
pop_context if node.group?
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_html
|
32
|
+
@doc.to_html
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def doc_root
|
38
|
+
Node.new(@doc.first_element_child)
|
39
|
+
end
|
40
|
+
|
41
|
+
def push_context(context)
|
42
|
+
@context_stack.unshift(context)
|
43
|
+
end
|
44
|
+
|
45
|
+
def pop_context
|
46
|
+
@context_stack.shift
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Semantic Org
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# CSS Distribution
|
2
|
+
|
3
|
+
This repository is automatically synced with the main [Semantic UI](https://github.com/Semantic-Org/Semantic-UI) repository to provide lightweight CSS only version of Semantic UI.
|
4
|
+
|
5
|
+
This package **does not support theming** and includes generated CSS files of the default theme only.
|
6
|
+
|
7
|
+
You can view more on Semantic UI at [LearnSemantic.com](http://www.learnsemantic.com) and [Semantic-UI.com](http://www.semantic-ui.com)
|
@@ -0,0 +1,252 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.2.9 - Accordion
|
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
|
+
Accordion
|
14
|
+
*******************************/
|
15
|
+
|
16
|
+
.ui.accordion,
|
17
|
+
.ui.accordion .accordion {
|
18
|
+
max-width: 100%;
|
19
|
+
}
|
20
|
+
.ui.accordion .accordion {
|
21
|
+
margin: 1em 0em 0em;
|
22
|
+
padding: 0em;
|
23
|
+
}
|
24
|
+
|
25
|
+
/* Title */
|
26
|
+
.ui.accordion .title,
|
27
|
+
.ui.accordion .accordion .title {
|
28
|
+
cursor: pointer;
|
29
|
+
}
|
30
|
+
|
31
|
+
/* Default Styling */
|
32
|
+
.ui.accordion .title:not(.ui) {
|
33
|
+
padding: 0.5em 0em;
|
34
|
+
font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
35
|
+
font-size: 1em;
|
36
|
+
color: rgba(0, 0, 0, 0.87);
|
37
|
+
}
|
38
|
+
|
39
|
+
/* Content */
|
40
|
+
.ui.accordion .title ~ .content,
|
41
|
+
.ui.accordion .accordion .title ~ .content {
|
42
|
+
display: none;
|
43
|
+
}
|
44
|
+
|
45
|
+
/* Default Styling */
|
46
|
+
.ui.accordion:not(.styled) .title ~ .content:not(.ui),
|
47
|
+
.ui.accordion:not(.styled) .accordion .title ~ .content:not(.ui) {
|
48
|
+
margin: '';
|
49
|
+
padding: 0.5em 0em 1em;
|
50
|
+
}
|
51
|
+
.ui.accordion:not(.styled) .title ~ .content:not(.ui):last-child {
|
52
|
+
padding-bottom: 0em;
|
53
|
+
}
|
54
|
+
|
55
|
+
/* Arrow */
|
56
|
+
.ui.accordion .title .dropdown.icon,
|
57
|
+
.ui.accordion .accordion .title .dropdown.icon {
|
58
|
+
display: inline-block;
|
59
|
+
float: none;
|
60
|
+
opacity: 1;
|
61
|
+
width: 1.25em;
|
62
|
+
height: 1em;
|
63
|
+
margin: 0em 0.25rem 0em 0rem;
|
64
|
+
padding: 0em;
|
65
|
+
font-size: 1em;
|
66
|
+
-webkit-transition: opacity 0.1s ease, -webkit-transform 0.1s ease;
|
67
|
+
transition: opacity 0.1s ease, -webkit-transform 0.1s ease;
|
68
|
+
transition: transform 0.1s ease, opacity 0.1s ease;
|
69
|
+
transition: transform 0.1s ease, opacity 0.1s ease, -webkit-transform 0.1s ease;
|
70
|
+
vertical-align: baseline;
|
71
|
+
-webkit-transform: none;
|
72
|
+
transform: none;
|
73
|
+
}
|
74
|
+
|
75
|
+
/*--------------
|
76
|
+
Coupling
|
77
|
+
---------------*/
|
78
|
+
|
79
|
+
|
80
|
+
/* Menu */
|
81
|
+
.ui.accordion.menu .item .title {
|
82
|
+
display: block;
|
83
|
+
padding: 0em;
|
84
|
+
}
|
85
|
+
.ui.accordion.menu .item .title > .dropdown.icon {
|
86
|
+
float: right;
|
87
|
+
margin: 0.21425em 0em 0em 1em;
|
88
|
+
-webkit-transform: rotate(180deg);
|
89
|
+
transform: rotate(180deg);
|
90
|
+
}
|
91
|
+
|
92
|
+
/* Header */
|
93
|
+
.ui.accordion .ui.header .dropdown.icon {
|
94
|
+
font-size: 1em;
|
95
|
+
margin: 0em 0.25rem 0em 0rem;
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
/*******************************
|
100
|
+
States
|
101
|
+
*******************************/
|
102
|
+
|
103
|
+
.ui.accordion .active.title .dropdown.icon,
|
104
|
+
.ui.accordion .accordion .active.title .dropdown.icon {
|
105
|
+
-webkit-transform: rotate(90deg);
|
106
|
+
transform: rotate(90deg);
|
107
|
+
}
|
108
|
+
.ui.accordion.menu .item .active.title > .dropdown.icon {
|
109
|
+
-webkit-transform: rotate(90deg);
|
110
|
+
transform: rotate(90deg);
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
/*******************************
|
115
|
+
Types
|
116
|
+
*******************************/
|
117
|
+
|
118
|
+
|
119
|
+
/*--------------
|
120
|
+
Styled
|
121
|
+
---------------*/
|
122
|
+
|
123
|
+
.ui.styled.accordion {
|
124
|
+
width: 600px;
|
125
|
+
}
|
126
|
+
.ui.styled.accordion,
|
127
|
+
.ui.styled.accordion .accordion {
|
128
|
+
border-radius: 0.28571429rem;
|
129
|
+
background: #FFFFFF;
|
130
|
+
box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15), 0px 0px 0px 1px rgba(34, 36, 38, 0.15);
|
131
|
+
}
|
132
|
+
.ui.styled.accordion .title,
|
133
|
+
.ui.styled.accordion .accordion .title {
|
134
|
+
margin: 0em;
|
135
|
+
padding: 0.75em 1em;
|
136
|
+
color: rgba(0, 0, 0, 0.4);
|
137
|
+
font-weight: bold;
|
138
|
+
border-top: 1px solid rgba(34, 36, 38, 0.15);
|
139
|
+
-webkit-transition: background 0.1s ease, color 0.1s ease;
|
140
|
+
transition: background 0.1s ease, color 0.1s ease;
|
141
|
+
}
|
142
|
+
.ui.styled.accordion > .title:first-child,
|
143
|
+
.ui.styled.accordion .accordion .title:first-child {
|
144
|
+
border-top: none;
|
145
|
+
}
|
146
|
+
|
147
|
+
/* Content */
|
148
|
+
.ui.styled.accordion .content,
|
149
|
+
.ui.styled.accordion .accordion .content {
|
150
|
+
margin: 0em;
|
151
|
+
padding: 0.5em 1em 1.5em;
|
152
|
+
}
|
153
|
+
.ui.styled.accordion .accordion .content {
|
154
|
+
padding: 0em;
|
155
|
+
padding: 0.5em 1em 1.5em;
|
156
|
+
}
|
157
|
+
|
158
|
+
/* Hover */
|
159
|
+
.ui.styled.accordion .title:hover,
|
160
|
+
.ui.styled.accordion .active.title,
|
161
|
+
.ui.styled.accordion .accordion .title:hover,
|
162
|
+
.ui.styled.accordion .accordion .active.title {
|
163
|
+
background: transparent;
|
164
|
+
color: rgba(0, 0, 0, 0.87);
|
165
|
+
}
|
166
|
+
.ui.styled.accordion .accordion .title:hover,
|
167
|
+
.ui.styled.accordion .accordion .active.title {
|
168
|
+
background: transparent;
|
169
|
+
color: rgba(0, 0, 0, 0.87);
|
170
|
+
}
|
171
|
+
|
172
|
+
/* Active */
|
173
|
+
.ui.styled.accordion .active.title {
|
174
|
+
background: transparent;
|
175
|
+
color: rgba(0, 0, 0, 0.95);
|
176
|
+
}
|
177
|
+
.ui.styled.accordion .accordion .active.title {
|
178
|
+
background: transparent;
|
179
|
+
color: rgba(0, 0, 0, 0.95);
|
180
|
+
}
|
181
|
+
|
182
|
+
|
183
|
+
/*******************************
|
184
|
+
States
|
185
|
+
*******************************/
|
186
|
+
|
187
|
+
|
188
|
+
/*--------------
|
189
|
+
Active
|
190
|
+
---------------*/
|
191
|
+
|
192
|
+
.ui.accordion .active.content,
|
193
|
+
.ui.accordion .accordion .active.content {
|
194
|
+
display: block;
|
195
|
+
}
|
196
|
+
|
197
|
+
|
198
|
+
/*******************************
|
199
|
+
Variations
|
200
|
+
*******************************/
|
201
|
+
|
202
|
+
|
203
|
+
/*--------------
|
204
|
+
Fluid
|
205
|
+
---------------*/
|
206
|
+
|
207
|
+
.ui.fluid.accordion,
|
208
|
+
.ui.fluid.accordion .accordion {
|
209
|
+
width: 100%;
|
210
|
+
}
|
211
|
+
|
212
|
+
/*--------------
|
213
|
+
Inverted
|
214
|
+
---------------*/
|
215
|
+
|
216
|
+
.ui.inverted.accordion .title:not(.ui) {
|
217
|
+
color: rgba(255, 255, 255, 0.9);
|
218
|
+
}
|
219
|
+
|
220
|
+
|
221
|
+
/*******************************
|
222
|
+
Theme Overrides
|
223
|
+
*******************************/
|
224
|
+
|
225
|
+
@font-face {
|
226
|
+
font-family: 'Accordion';
|
227
|
+
src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB5AAAAC8AAAAYGNtYXAPfOIKAAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zryj6HgAAAFwAAAAyGhlYWT/0IhHAAACOAAAADZoaGVhApkB5wAAAnAAAAAkaG10eAJuABIAAAKUAAAAGGxvY2EAjABWAAACrAAAAA5tYXhwAAgAFgAAArwAAAAgbmFtZfC1n04AAALcAAABPHBvc3QAAwAAAAAEGAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQASAEkAtwFuABMAADc0PwE2FzYXFh0BFAcGJwYvASY1EgaABQgHBQYGBQcIBYAG2wcGfwcBAQcECf8IBAcBAQd/BgYAAAAAAQAAAEkApQFuABMAADcRNDc2MzIfARYVFA8BBiMiJyY1AAUGBwgFgAYGgAUIBwYFWwEACAUGBoAFCAcFgAYGBQcAAAABAAAAAQAAqWYls18PPPUACwIAAAAAAM/9o+4AAAAAz/2j7gAAAAAAtwFuAAAACAACAAAAAAAAAAEAAAHg/+AAAAIAAAAAAAC3AAEAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAQAAAAC3ABIAtwAAAAAAAAAKABQAHgBCAGQAAAABAAAABgAUAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype'), url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAASwAAoAAAAABGgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAAS0AAAEtFpovuE9TLzIAAAIkAAAAYAAAAGAIIweQY21hcAAAAoQAAABMAAAATA984gpnYXNwAAAC0AAAAAgAAAAIAAAAEGhlYWQAAALYAAAANgAAADb/0IhHaGhlYQAAAxAAAAAkAAAAJAKZAedobXR4AAADNAAAABgAAAAYAm4AEm1heHAAAANMAAAABgAAAAYABlAAbmFtZQAAA1QAAAE8AAABPPC1n05wb3N0AAAEkAAAACAAAAAgAAMAAAEABAQAAQEBB3JhdGluZwABAgABADr4HAL4GwP4GAQeCgAZU/+Lix4KABlT/4uLDAeLa/iU+HQFHQAAAHkPHQAAAH4RHQAAAAkdAAABJBIABwEBBw0PERQZHnJhdGluZ3JhdGluZ3UwdTF1MjB1RjBEOXVGMERBAAACAYkABAAGAQEEBwoNVp38lA78lA78lA77lA773Z33bxWLkI2Qj44I9xT3FAWOj5CNkIuQi4+JjoePiI2Gi4YIi/uUBYuGiYeHiIiHh4mGi4aLho2Ijwj7FPcUBYeOiY+LkAgO+92L5hWL95QFi5CNkI6Oj4+PjZCLkIuQiY6HCPcU+xQFj4iNhouGi4aJh4eICPsU+xQFiIeGiYaLhouHjYePiI6Jj4uQCA74lBT4lBWLDAoAAAAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAEAADfYOJZfDzz1AAsCAAAAAADP/aPuAAAAAM/9o+4AAAAAALcBbgAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAAAtwABAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAEAAAAAtwASALcAAAAAUAAABgAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff');
|
228
|
+
font-weight: normal;
|
229
|
+
font-style: normal;
|
230
|
+
}
|
231
|
+
|
232
|
+
/* Dropdown Icon */
|
233
|
+
.ui.accordion .title .dropdown.icon,
|
234
|
+
.ui.accordion .accordion .title .dropdown.icon {
|
235
|
+
font-family: Accordion;
|
236
|
+
line-height: 1;
|
237
|
+
-webkit-backface-visibility: hidden;
|
238
|
+
backface-visibility: hidden;
|
239
|
+
font-weight: normal;
|
240
|
+
font-style: normal;
|
241
|
+
text-align: center;
|
242
|
+
}
|
243
|
+
.ui.accordion .title .dropdown.icon:before,
|
244
|
+
.ui.accordion .accordion .title .dropdown.icon:before {
|
245
|
+
content: '\f0da' /*rtl:'\f0d9'*/;
|
246
|
+
}
|
247
|
+
|
248
|
+
|
249
|
+
/*******************************
|
250
|
+
User Overrides
|
251
|
+
*******************************/
|
252
|
+
|
@@ -0,0 +1,610 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.2.9 - Accordion
|
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.accordion = 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
|
+
requestAnimationFrame = window.requestAnimationFrame
|
34
|
+
|| window.mozRequestAnimationFrame
|
35
|
+
|| window.webkitRequestAnimationFrame
|
36
|
+
|| window.msRequestAnimationFrame
|
37
|
+
|| function(callback) { setTimeout(callback, 0); },
|
38
|
+
|
39
|
+
returnedValue
|
40
|
+
;
|
41
|
+
$allModules
|
42
|
+
.each(function() {
|
43
|
+
var
|
44
|
+
settings = ( $.isPlainObject(parameters) )
|
45
|
+
? $.extend(true, {}, $.fn.accordion.settings, parameters)
|
46
|
+
: $.extend({}, $.fn.accordion.settings),
|
47
|
+
|
48
|
+
className = settings.className,
|
49
|
+
namespace = settings.namespace,
|
50
|
+
selector = settings.selector,
|
51
|
+
error = settings.error,
|
52
|
+
|
53
|
+
eventNamespace = '.' + namespace,
|
54
|
+
moduleNamespace = 'module-' + namespace,
|
55
|
+
moduleSelector = $allModules.selector || '',
|
56
|
+
|
57
|
+
$module = $(this),
|
58
|
+
$title = $module.find(selector.title),
|
59
|
+
$content = $module.find(selector.content),
|
60
|
+
|
61
|
+
element = this,
|
62
|
+
instance = $module.data(moduleNamespace),
|
63
|
+
observer,
|
64
|
+
module
|
65
|
+
;
|
66
|
+
|
67
|
+
module = {
|
68
|
+
|
69
|
+
initialize: function() {
|
70
|
+
module.debug('Initializing', $module);
|
71
|
+
module.bind.events();
|
72
|
+
if(settings.observeChanges) {
|
73
|
+
module.observeChanges();
|
74
|
+
}
|
75
|
+
module.instantiate();
|
76
|
+
},
|
77
|
+
|
78
|
+
instantiate: function() {
|
79
|
+
instance = module;
|
80
|
+
$module
|
81
|
+
.data(moduleNamespace, module)
|
82
|
+
;
|
83
|
+
},
|
84
|
+
|
85
|
+
destroy: function() {
|
86
|
+
module.debug('Destroying previous instance', $module);
|
87
|
+
$module
|
88
|
+
.off(eventNamespace)
|
89
|
+
.removeData(moduleNamespace)
|
90
|
+
;
|
91
|
+
},
|
92
|
+
|
93
|
+
refresh: function() {
|
94
|
+
$title = $module.find(selector.title);
|
95
|
+
$content = $module.find(selector.content);
|
96
|
+
},
|
97
|
+
|
98
|
+
observeChanges: function() {
|
99
|
+
if('MutationObserver' in window) {
|
100
|
+
observer = new MutationObserver(function(mutations) {
|
101
|
+
module.debug('DOM tree modified, updating selector cache');
|
102
|
+
module.refresh();
|
103
|
+
});
|
104
|
+
observer.observe(element, {
|
105
|
+
childList : true,
|
106
|
+
subtree : true
|
107
|
+
});
|
108
|
+
module.debug('Setting up mutation observer', observer);
|
109
|
+
}
|
110
|
+
},
|
111
|
+
|
112
|
+
bind: {
|
113
|
+
events: function() {
|
114
|
+
module.debug('Binding delegated events');
|
115
|
+
$module
|
116
|
+
.on(settings.on + eventNamespace, selector.trigger, module.event.click)
|
117
|
+
;
|
118
|
+
}
|
119
|
+
},
|
120
|
+
|
121
|
+
event: {
|
122
|
+
click: function() {
|
123
|
+
module.toggle.call(this);
|
124
|
+
}
|
125
|
+
},
|
126
|
+
|
127
|
+
toggle: function(query) {
|
128
|
+
var
|
129
|
+
$activeTitle = (query !== undefined)
|
130
|
+
? (typeof query === 'number')
|
131
|
+
? $title.eq(query)
|
132
|
+
: $(query).closest(selector.title)
|
133
|
+
: $(this).closest(selector.title),
|
134
|
+
$activeContent = $activeTitle.next($content),
|
135
|
+
isAnimating = $activeContent.hasClass(className.animating),
|
136
|
+
isActive = $activeContent.hasClass(className.active),
|
137
|
+
isOpen = (isActive && !isAnimating),
|
138
|
+
isOpening = (!isActive && isAnimating)
|
139
|
+
;
|
140
|
+
module.debug('Toggling visibility of content', $activeTitle);
|
141
|
+
if(isOpen || isOpening) {
|
142
|
+
if(settings.collapsible) {
|
143
|
+
module.close.call($activeTitle);
|
144
|
+
}
|
145
|
+
else {
|
146
|
+
module.debug('Cannot close accordion content collapsing is disabled');
|
147
|
+
}
|
148
|
+
}
|
149
|
+
else {
|
150
|
+
module.open.call($activeTitle);
|
151
|
+
}
|
152
|
+
},
|
153
|
+
|
154
|
+
open: function(query) {
|
155
|
+
var
|
156
|
+
$activeTitle = (query !== undefined)
|
157
|
+
? (typeof query === 'number')
|
158
|
+
? $title.eq(query)
|
159
|
+
: $(query).closest(selector.title)
|
160
|
+
: $(this).closest(selector.title),
|
161
|
+
$activeContent = $activeTitle.next($content),
|
162
|
+
isAnimating = $activeContent.hasClass(className.animating),
|
163
|
+
isActive = $activeContent.hasClass(className.active),
|
164
|
+
isOpen = (isActive || isAnimating)
|
165
|
+
;
|
166
|
+
if(isOpen) {
|
167
|
+
module.debug('Accordion already open, skipping', $activeContent);
|
168
|
+
return;
|
169
|
+
}
|
170
|
+
module.debug('Opening accordion content', $activeTitle);
|
171
|
+
settings.onOpening.call($activeContent);
|
172
|
+
if(settings.exclusive) {
|
173
|
+
module.closeOthers.call($activeTitle);
|
174
|
+
}
|
175
|
+
$activeTitle
|
176
|
+
.addClass(className.active)
|
177
|
+
;
|
178
|
+
$activeContent
|
179
|
+
.stop(true, true)
|
180
|
+
.addClass(className.animating)
|
181
|
+
;
|
182
|
+
if(settings.animateChildren) {
|
183
|
+
if($.fn.transition !== undefined && $module.transition('is supported')) {
|
184
|
+
$activeContent
|
185
|
+
.children()
|
186
|
+
.transition({
|
187
|
+
animation : 'fade in',
|
188
|
+
queue : false,
|
189
|
+
useFailSafe : true,
|
190
|
+
debug : settings.debug,
|
191
|
+
verbose : settings.verbose,
|
192
|
+
duration : settings.duration
|
193
|
+
})
|
194
|
+
;
|
195
|
+
}
|
196
|
+
else {
|
197
|
+
$activeContent
|
198
|
+
.children()
|
199
|
+
.stop(true, true)
|
200
|
+
.animate({
|
201
|
+
opacity: 1
|
202
|
+
}, settings.duration, module.resetOpacity)
|
203
|
+
;
|
204
|
+
}
|
205
|
+
}
|
206
|
+
$activeContent
|
207
|
+
.slideDown(settings.duration, settings.easing, function() {
|
208
|
+
$activeContent
|
209
|
+
.removeClass(className.animating)
|
210
|
+
.addClass(className.active)
|
211
|
+
;
|
212
|
+
module.reset.display.call(this);
|
213
|
+
settings.onOpen.call(this);
|
214
|
+
settings.onChange.call(this);
|
215
|
+
})
|
216
|
+
;
|
217
|
+
},
|
218
|
+
|
219
|
+
close: function(query) {
|
220
|
+
var
|
221
|
+
$activeTitle = (query !== undefined)
|
222
|
+
? (typeof query === 'number')
|
223
|
+
? $title.eq(query)
|
224
|
+
: $(query).closest(selector.title)
|
225
|
+
: $(this).closest(selector.title),
|
226
|
+
$activeContent = $activeTitle.next($content),
|
227
|
+
isAnimating = $activeContent.hasClass(className.animating),
|
228
|
+
isActive = $activeContent.hasClass(className.active),
|
229
|
+
isOpening = (!isActive && isAnimating),
|
230
|
+
isClosing = (isActive && isAnimating)
|
231
|
+
;
|
232
|
+
if((isActive || isOpening) && !isClosing) {
|
233
|
+
module.debug('Closing accordion content', $activeContent);
|
234
|
+
settings.onClosing.call($activeContent);
|
235
|
+
$activeTitle
|
236
|
+
.removeClass(className.active)
|
237
|
+
;
|
238
|
+
$activeContent
|
239
|
+
.stop(true, true)
|
240
|
+
.addClass(className.animating)
|
241
|
+
;
|
242
|
+
if(settings.animateChildren) {
|
243
|
+
if($.fn.transition !== undefined && $module.transition('is supported')) {
|
244
|
+
$activeContent
|
245
|
+
.children()
|
246
|
+
.transition({
|
247
|
+
animation : 'fade out',
|
248
|
+
queue : false,
|
249
|
+
useFailSafe : true,
|
250
|
+
debug : settings.debug,
|
251
|
+
verbose : settings.verbose,
|
252
|
+
duration : settings.duration
|
253
|
+
})
|
254
|
+
;
|
255
|
+
}
|
256
|
+
else {
|
257
|
+
$activeContent
|
258
|
+
.children()
|
259
|
+
.stop(true, true)
|
260
|
+
.animate({
|
261
|
+
opacity: 0
|
262
|
+
}, settings.duration, module.resetOpacity)
|
263
|
+
;
|
264
|
+
}
|
265
|
+
}
|
266
|
+
$activeContent
|
267
|
+
.slideUp(settings.duration, settings.easing, function() {
|
268
|
+
$activeContent
|
269
|
+
.removeClass(className.animating)
|
270
|
+
.removeClass(className.active)
|
271
|
+
;
|
272
|
+
module.reset.display.call(this);
|
273
|
+
settings.onClose.call(this);
|
274
|
+
settings.onChange.call(this);
|
275
|
+
})
|
276
|
+
;
|
277
|
+
}
|
278
|
+
},
|
279
|
+
|
280
|
+
closeOthers: function(index) {
|
281
|
+
var
|
282
|
+
$activeTitle = (index !== undefined)
|
283
|
+
? $title.eq(index)
|
284
|
+
: $(this).closest(selector.title),
|
285
|
+
$parentTitles = $activeTitle.parents(selector.content).prev(selector.title),
|
286
|
+
$activeAccordion = $activeTitle.closest(selector.accordion),
|
287
|
+
activeSelector = selector.title + '.' + className.active + ':visible',
|
288
|
+
activeContent = selector.content + '.' + className.active + ':visible',
|
289
|
+
$openTitles,
|
290
|
+
$nestedTitles,
|
291
|
+
$openContents
|
292
|
+
;
|
293
|
+
if(settings.closeNested) {
|
294
|
+
$openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
|
295
|
+
$openContents = $openTitles.next($content);
|
296
|
+
}
|
297
|
+
else {
|
298
|
+
$openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
|
299
|
+
$nestedTitles = $activeAccordion.find(activeContent).find(activeSelector).not($parentTitles);
|
300
|
+
$openTitles = $openTitles.not($nestedTitles);
|
301
|
+
$openContents = $openTitles.next($content);
|
302
|
+
}
|
303
|
+
if( ($openTitles.length > 0) ) {
|
304
|
+
module.debug('Exclusive enabled, closing other content', $openTitles);
|
305
|
+
$openTitles
|
306
|
+
.removeClass(className.active)
|
307
|
+
;
|
308
|
+
$openContents
|
309
|
+
.removeClass(className.animating)
|
310
|
+
.stop(true, true)
|
311
|
+
;
|
312
|
+
if(settings.animateChildren) {
|
313
|
+
if($.fn.transition !== undefined && $module.transition('is supported')) {
|
314
|
+
$openContents
|
315
|
+
.children()
|
316
|
+
.transition({
|
317
|
+
animation : 'fade out',
|
318
|
+
useFailSafe : true,
|
319
|
+
debug : settings.debug,
|
320
|
+
verbose : settings.verbose,
|
321
|
+
duration : settings.duration
|
322
|
+
})
|
323
|
+
;
|
324
|
+
}
|
325
|
+
else {
|
326
|
+
$openContents
|
327
|
+
.children()
|
328
|
+
.stop(true, true)
|
329
|
+
.animate({
|
330
|
+
opacity: 0
|
331
|
+
}, settings.duration, module.resetOpacity)
|
332
|
+
;
|
333
|
+
}
|
334
|
+
}
|
335
|
+
$openContents
|
336
|
+
.slideUp(settings.duration , settings.easing, function() {
|
337
|
+
$(this).removeClass(className.active);
|
338
|
+
module.reset.display.call(this);
|
339
|
+
})
|
340
|
+
;
|
341
|
+
}
|
342
|
+
},
|
343
|
+
|
344
|
+
reset: {
|
345
|
+
|
346
|
+
display: function() {
|
347
|
+
module.verbose('Removing inline display from element', this);
|
348
|
+
$(this).css('display', '');
|
349
|
+
if( $(this).attr('style') === '') {
|
350
|
+
$(this)
|
351
|
+
.attr('style', '')
|
352
|
+
.removeAttr('style')
|
353
|
+
;
|
354
|
+
}
|
355
|
+
},
|
356
|
+
|
357
|
+
opacity: function() {
|
358
|
+
module.verbose('Removing inline opacity from element', this);
|
359
|
+
$(this).css('opacity', '');
|
360
|
+
if( $(this).attr('style') === '') {
|
361
|
+
$(this)
|
362
|
+
.attr('style', '')
|
363
|
+
.removeAttr('style')
|
364
|
+
;
|
365
|
+
}
|
366
|
+
},
|
367
|
+
|
368
|
+
},
|
369
|
+
|
370
|
+
setting: function(name, value) {
|
371
|
+
module.debug('Changing setting', name, value);
|
372
|
+
if( $.isPlainObject(name) ) {
|
373
|
+
$.extend(true, settings, name);
|
374
|
+
}
|
375
|
+
else if(value !== undefined) {
|
376
|
+
if($.isPlainObject(settings[name])) {
|
377
|
+
$.extend(true, settings[name], value);
|
378
|
+
}
|
379
|
+
else {
|
380
|
+
settings[name] = value;
|
381
|
+
}
|
382
|
+
}
|
383
|
+
else {
|
384
|
+
return settings[name];
|
385
|
+
}
|
386
|
+
},
|
387
|
+
internal: function(name, value) {
|
388
|
+
module.debug('Changing internal', name, value);
|
389
|
+
if(value !== undefined) {
|
390
|
+
if( $.isPlainObject(name) ) {
|
391
|
+
$.extend(true, module, name);
|
392
|
+
}
|
393
|
+
else {
|
394
|
+
module[name] = value;
|
395
|
+
}
|
396
|
+
}
|
397
|
+
else {
|
398
|
+
return module[name];
|
399
|
+
}
|
400
|
+
},
|
401
|
+
debug: function() {
|
402
|
+
if(!settings.silent && settings.debug) {
|
403
|
+
if(settings.performance) {
|
404
|
+
module.performance.log(arguments);
|
405
|
+
}
|
406
|
+
else {
|
407
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
408
|
+
module.debug.apply(console, arguments);
|
409
|
+
}
|
410
|
+
}
|
411
|
+
},
|
412
|
+
verbose: function() {
|
413
|
+
if(!settings.silent && settings.verbose && settings.debug) {
|
414
|
+
if(settings.performance) {
|
415
|
+
module.performance.log(arguments);
|
416
|
+
}
|
417
|
+
else {
|
418
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
419
|
+
module.verbose.apply(console, arguments);
|
420
|
+
}
|
421
|
+
}
|
422
|
+
},
|
423
|
+
error: function() {
|
424
|
+
if(!settings.silent) {
|
425
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
426
|
+
module.error.apply(console, arguments);
|
427
|
+
}
|
428
|
+
},
|
429
|
+
performance: {
|
430
|
+
log: function(message) {
|
431
|
+
var
|
432
|
+
currentTime,
|
433
|
+
executionTime,
|
434
|
+
previousTime
|
435
|
+
;
|
436
|
+
if(settings.performance) {
|
437
|
+
currentTime = new Date().getTime();
|
438
|
+
previousTime = time || currentTime;
|
439
|
+
executionTime = currentTime - previousTime;
|
440
|
+
time = currentTime;
|
441
|
+
performance.push({
|
442
|
+
'Name' : message[0],
|
443
|
+
'Arguments' : [].slice.call(message, 1) || '',
|
444
|
+
'Element' : element,
|
445
|
+
'Execution Time' : executionTime
|
446
|
+
});
|
447
|
+
}
|
448
|
+
clearTimeout(module.performance.timer);
|
449
|
+
module.performance.timer = setTimeout(module.performance.display, 500);
|
450
|
+
},
|
451
|
+
display: function() {
|
452
|
+
var
|
453
|
+
title = settings.name + ':',
|
454
|
+
totalTime = 0
|
455
|
+
;
|
456
|
+
time = false;
|
457
|
+
clearTimeout(module.performance.timer);
|
458
|
+
$.each(performance, function(index, data) {
|
459
|
+
totalTime += data['Execution Time'];
|
460
|
+
});
|
461
|
+
title += ' ' + totalTime + 'ms';
|
462
|
+
if(moduleSelector) {
|
463
|
+
title += ' \'' + moduleSelector + '\'';
|
464
|
+
}
|
465
|
+
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
466
|
+
console.groupCollapsed(title);
|
467
|
+
if(console.table) {
|
468
|
+
console.table(performance);
|
469
|
+
}
|
470
|
+
else {
|
471
|
+
$.each(performance, function(index, data) {
|
472
|
+
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
473
|
+
});
|
474
|
+
}
|
475
|
+
console.groupEnd();
|
476
|
+
}
|
477
|
+
performance = [];
|
478
|
+
}
|
479
|
+
},
|
480
|
+
invoke: function(query, passedArguments, context) {
|
481
|
+
var
|
482
|
+
object = instance,
|
483
|
+
maxDepth,
|
484
|
+
found,
|
485
|
+
response
|
486
|
+
;
|
487
|
+
passedArguments = passedArguments || queryArguments;
|
488
|
+
context = element || context;
|
489
|
+
if(typeof query == 'string' && object !== undefined) {
|
490
|
+
query = query.split(/[\. ]/);
|
491
|
+
maxDepth = query.length - 1;
|
492
|
+
$.each(query, function(depth, value) {
|
493
|
+
var camelCaseValue = (depth != maxDepth)
|
494
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
495
|
+
: query
|
496
|
+
;
|
497
|
+
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
498
|
+
object = object[camelCaseValue];
|
499
|
+
}
|
500
|
+
else if( object[camelCaseValue] !== undefined ) {
|
501
|
+
found = object[camelCaseValue];
|
502
|
+
return false;
|
503
|
+
}
|
504
|
+
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
505
|
+
object = object[value];
|
506
|
+
}
|
507
|
+
else if( object[value] !== undefined ) {
|
508
|
+
found = object[value];
|
509
|
+
return false;
|
510
|
+
}
|
511
|
+
else {
|
512
|
+
module.error(error.method, query);
|
513
|
+
return false;
|
514
|
+
}
|
515
|
+
});
|
516
|
+
}
|
517
|
+
if ( $.isFunction( found ) ) {
|
518
|
+
response = found.apply(context, passedArguments);
|
519
|
+
}
|
520
|
+
else if(found !== undefined) {
|
521
|
+
response = found;
|
522
|
+
}
|
523
|
+
if($.isArray(returnedValue)) {
|
524
|
+
returnedValue.push(response);
|
525
|
+
}
|
526
|
+
else if(returnedValue !== undefined) {
|
527
|
+
returnedValue = [returnedValue, response];
|
528
|
+
}
|
529
|
+
else if(response !== undefined) {
|
530
|
+
returnedValue = response;
|
531
|
+
}
|
532
|
+
return found;
|
533
|
+
}
|
534
|
+
};
|
535
|
+
if(methodInvoked) {
|
536
|
+
if(instance === undefined) {
|
537
|
+
module.initialize();
|
538
|
+
}
|
539
|
+
module.invoke(query);
|
540
|
+
}
|
541
|
+
else {
|
542
|
+
if(instance !== undefined) {
|
543
|
+
instance.invoke('destroy');
|
544
|
+
}
|
545
|
+
module.initialize();
|
546
|
+
}
|
547
|
+
})
|
548
|
+
;
|
549
|
+
return (returnedValue !== undefined)
|
550
|
+
? returnedValue
|
551
|
+
: this
|
552
|
+
;
|
553
|
+
};
|
554
|
+
|
555
|
+
$.fn.accordion.settings = {
|
556
|
+
|
557
|
+
name : 'Accordion',
|
558
|
+
namespace : 'accordion',
|
559
|
+
|
560
|
+
silent : false,
|
561
|
+
debug : false,
|
562
|
+
verbose : false,
|
563
|
+
performance : true,
|
564
|
+
|
565
|
+
on : 'click', // event on title that opens accordion
|
566
|
+
|
567
|
+
observeChanges : true, // whether accordion should automatically refresh on DOM insertion
|
568
|
+
|
569
|
+
exclusive : true, // whether a single accordion content panel should be open at once
|
570
|
+
collapsible : true, // whether accordion content can be closed
|
571
|
+
closeNested : false, // whether nested content should be closed when a panel is closed
|
572
|
+
animateChildren : true, // whether children opacity should be animated
|
573
|
+
|
574
|
+
duration : 350, // duration of animation
|
575
|
+
easing : 'easeOutQuad', // easing equation for animation
|
576
|
+
|
577
|
+
|
578
|
+
onOpening : function(){}, // callback before open animation
|
579
|
+
onOpen : function(){}, // callback after open animation
|
580
|
+
onClosing : function(){}, // callback before closing animation
|
581
|
+
onClose : function(){}, // callback after closing animation
|
582
|
+
onChange : function(){}, // callback after closing or opening animation
|
583
|
+
|
584
|
+
error: {
|
585
|
+
method : 'The method you called is not defined'
|
586
|
+
},
|
587
|
+
|
588
|
+
className : {
|
589
|
+
active : 'active',
|
590
|
+
animating : 'animating'
|
591
|
+
},
|
592
|
+
|
593
|
+
selector : {
|
594
|
+
accordion : '.accordion',
|
595
|
+
title : '.title',
|
596
|
+
trigger : '.title',
|
597
|
+
content : '.content'
|
598
|
+
}
|
599
|
+
|
600
|
+
};
|
601
|
+
|
602
|
+
// Adds easing
|
603
|
+
$.extend( $.easing, {
|
604
|
+
easeOutQuad: function (x, t, b, c, d) {
|
605
|
+
return -c *(t/=d)*(t-2) + b;
|
606
|
+
}
|
607
|
+
});
|
608
|
+
|
609
|
+
})( jQuery, window, document );
|
610
|
+
|