vapid 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,10 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.2.9 - Visibility
|
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
|
+
!function(e,n,o,t){"use strict";n="undefined"!=typeof n&&n.Math==Math?n:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.visibility=function(i){var s,c=e(this),r=c.selector||"",a=(new Date).getTime(),l=[],d=arguments[0],u="string"==typeof d,f=[].slice.call(arguments,1),b=c.length,m=0;return c.each(function(){var c,g,p,v,h=e.isPlainObject(i)?e.extend(!0,{},e.fn.visibility.settings,i):e.extend({},e.fn.visibility.settings),P=h.className,x=h.namespace,C=h.error,y=h.metadata,R="."+x,V="module-"+x,S=e(n),k=e(this),T=e(h.context),O=(k.selector||"",k.data(V)),A=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(e){setTimeout(e,0)},z=this,w=!1;v={initialize:function(){v.debug("Initializing",h),v.setup.cache(),v.should.trackChanges()&&("image"==h.type&&v.setup.image(),"fixed"==h.type&&v.setup.fixed(),h.observeChanges&&v.observeChanges(),v.bind.events()),v.save.position(),v.is.visible()||v.error(C.visible,k),h.initialCheck&&v.checkVisibility(),v.instantiate()},instantiate:function(){v.debug("Storing instance",v),k.data(V,v),O=v},destroy:function(){v.verbose("Destroying previous module"),p&&p.disconnect(),g&&g.disconnect(),S.off("load"+R,v.event.load).off("resize"+R,v.event.resize),T.off("scroll"+R,v.event.scroll).off("scrollchange"+R,v.event.scrollchange),"fixed"==h.type&&(v.resetFixed(),v.remove.placeholder()),k.off(R).removeData(V)},observeChanges:function(){"MutationObserver"in n&&(g=new MutationObserver(v.event.contextChanged),p=new MutationObserver(v.event.changed),g.observe(o,{childList:!0,subtree:!0}),p.observe(z,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",p))},bind:{events:function(){v.verbose("Binding visibility events to scroll and resize"),h.refreshOnLoad&&S.on("load"+R,v.event.load),S.on("resize"+R,v.event.resize),T.off("scroll"+R).on("scroll"+R,v.event.scroll).on("scrollchange"+R,v.event.scrollchange)}},event:{changed:function(e){v.verbose("DOM tree modified, updating visibility calculations"),v.timer=setTimeout(function(){v.verbose("DOM tree modified, updating sticky menu"),v.refresh()},100)},contextChanged:function(n){[].forEach.call(n,function(n){n.removedNodes&&[].forEach.call(n.removedNodes,function(n){(n==z||e(n).find(z).length>0)&&(v.debug("Element removed from DOM, tearing down events"),v.destroy())})})},resize:function(){v.debug("Window resized"),h.refreshOnResize&&A(v.refresh)},load:function(){v.debug("Page finished loading"),A(v.refresh)},scroll:function(){h.throttle?(clearTimeout(v.timer),v.timer=setTimeout(function(){T.triggerHandler("scrollchange"+R,[T.scrollTop()])},h.throttle)):A(function(){T.triggerHandler("scrollchange"+R,[T.scrollTop()])})},scrollchange:function(e,n){v.checkVisibility(n)}},precache:function(n,t){n instanceof Array||(n=[n]);for(var i=n.length,s=0,c=[],r=o.createElement("img"),a=function(){s++,s>=n.length&&e.isFunction(t)&&t()};i--;)r=o.createElement("img"),r.onload=a,r.onerror=a,r.src=n[i],c.push(r)},enableCallbacks:function(){v.debug("Allowing callbacks to occur"),w=!1},disableCallbacks:function(){v.debug("Disabling all callbacks temporarily"),w=!0},should:{trackChanges:function(){return u?(v.debug("One time query, no need to bind events"),!1):(v.debug("Callbacks being attached"),!0)}},setup:{cache:function(){v.cache={occurred:{},screen:{},element:{}}},image:function(){var e=k.data(y.src);e&&(v.verbose("Lazy loading image",e),h.once=!0,h.observeChanges=!1,h.onOnScreen=function(){v.debug("Image on screen",z),v.precache(e,function(){v.set.image(e,function(){m++,m==b&&h.onAllLoaded.call(this),h.onLoad.call(this)})})})},fixed:function(){v.debug("Setting up fixed"),h.once=!1,h.observeChanges=!1,h.initialCheck=!0,h.refreshOnLoad=!0,i.transition||(h.transition=!1),v.create.placeholder(),v.debug("Added placeholder",c),h.onTopPassed=function(){v.debug("Element passed, adding fixed position",k),v.show.placeholder(),v.set.fixed(),h.transition&&e.fn.transition!==t&&k.transition(h.transition,h.duration)},h.onTopPassedReverse=function(){v.debug("Element returned to position, removing fixed",k),v.hide.placeholder(),v.remove.fixed()}}},create:{placeholder:function(){v.verbose("Creating fixed position placeholder"),c=k.clone(!1).css("display","none").addClass(P.placeholder).insertAfter(k)}},show:{placeholder:function(){v.verbose("Showing placeholder"),c.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){v.verbose("Hiding placeholder"),c.css("display","none").css("visibility","")}},set:{fixed:function(){v.verbose("Setting element to fixed position"),k.addClass(P.fixed).css({position:"fixed",top:h.offset+"px",left:"auto",zIndex:h.zIndex}),h.onFixed.call(z)},image:function(n,o){if(k.attr("src",n),h.transition)if(e.fn.transition!==t){if(k.hasClass(P.visible))return void v.debug("Transition already occurred on this image, skipping animation");k.transition(h.transition,h.duration,o)}else k.fadeIn(h.duration,o);else k.show()}},is:{onScreen:function(){var e=v.get.elementCalculations();return e.onScreen},offScreen:function(){var e=v.get.elementCalculations();return e.offScreen},visible:function(){return!(!v.cache||!v.cache.element)&&!(0===v.cache.element.width&&0===v.cache.element.offset.top)}},refresh:function(){v.debug("Refreshing constants (width/height)"),"fixed"==h.type&&v.resetFixed(),v.reset(),v.save.position(),h.checkOnRefresh&&v.checkVisibility(),h.onRefresh.call(z)},resetFixed:function(){v.remove.fixed(),v.remove.occurred()},reset:function(){v.verbose("Resetting all cached values"),e.isPlainObject(v.cache)&&(v.cache.screen={},v.cache.element={})},checkVisibility:function(e){v.verbose("Checking visibility of element",v.cache.element),!w&&v.is.visible()&&(v.save.scroll(e),v.save.calculations(),v.passed(),v.passingReverse(),v.topVisibleReverse(),v.bottomVisibleReverse(),v.topPassedReverse(),v.bottomPassedReverse(),v.onScreen(),v.offScreen(),v.passing(),v.topVisible(),v.bottomVisible(),v.topPassed(),v.bottomPassed(),h.onUpdate&&h.onUpdate.call(z,v.get.elementCalculations()))},passed:function(n,o){var i=v.get.elementCalculations();if(n&&o)h.onPassed[n]=o;else{if(n!==t)return v.get.pixelsPassed(n)>i.pixelsPassed;i.passing&&e.each(h.onPassed,function(e,n){i.bottomVisible||i.pixelsPassed>v.get.pixelsPassed(e)?v.execute(n,e):h.once||v.remove.occurred(n)})}},onScreen:function(e){var n=v.get.elementCalculations(),o=e||h.onOnScreen,i="onScreen";if(e&&(v.debug("Adding callback for onScreen",e),h.onOnScreen=e),n.onScreen?v.execute(o,i):h.once||v.remove.occurred(i),e!==t)return n.onOnScreen},offScreen:function(e){var n=v.get.elementCalculations(),o=e||h.onOffScreen,i="offScreen";if(e&&(v.debug("Adding callback for offScreen",e),h.onOffScreen=e),n.offScreen?v.execute(o,i):h.once||v.remove.occurred(i),e!==t)return n.onOffScreen},passing:function(e){var n=v.get.elementCalculations(),o=e||h.onPassing,i="passing";if(e&&(v.debug("Adding callback for passing",e),h.onPassing=e),n.passing?v.execute(o,i):h.once||v.remove.occurred(i),e!==t)return n.passing},topVisible:function(e){var n=v.get.elementCalculations(),o=e||h.onTopVisible,i="topVisible";if(e&&(v.debug("Adding callback for top visible",e),h.onTopVisible=e),n.topVisible?v.execute(o,i):h.once||v.remove.occurred(i),e===t)return n.topVisible},bottomVisible:function(e){var n=v.get.elementCalculations(),o=e||h.onBottomVisible,i="bottomVisible";if(e&&(v.debug("Adding callback for bottom visible",e),h.onBottomVisible=e),n.bottomVisible?v.execute(o,i):h.once||v.remove.occurred(i),e===t)return n.bottomVisible},topPassed:function(e){var n=v.get.elementCalculations(),o=e||h.onTopPassed,i="topPassed";if(e&&(v.debug("Adding callback for top passed",e),h.onTopPassed=e),n.topPassed?v.execute(o,i):h.once||v.remove.occurred(i),e===t)return n.topPassed},bottomPassed:function(e){var n=v.get.elementCalculations(),o=e||h.onBottomPassed,i="bottomPassed";if(e&&(v.debug("Adding callback for bottom passed",e),h.onBottomPassed=e),n.bottomPassed?v.execute(o,i):h.once||v.remove.occurred(i),e===t)return n.bottomPassed},passingReverse:function(e){var n=v.get.elementCalculations(),o=e||h.onPassingReverse,i="passingReverse";if(e&&(v.debug("Adding callback for passing reverse",e),h.onPassingReverse=e),n.passing?h.once||v.remove.occurred(i):v.get.occurred("passing")&&v.execute(o,i),e!==t)return!n.passing},topVisibleReverse:function(e){var n=v.get.elementCalculations(),o=e||h.onTopVisibleReverse,i="topVisibleReverse";if(e&&(v.debug("Adding callback for top visible reverse",e),h.onTopVisibleReverse=e),n.topVisible?h.once||v.remove.occurred(i):v.get.occurred("topVisible")&&v.execute(o,i),e===t)return!n.topVisible},bottomVisibleReverse:function(e){var n=v.get.elementCalculations(),o=e||h.onBottomVisibleReverse,i="bottomVisibleReverse";if(e&&(v.debug("Adding callback for bottom visible reverse",e),h.onBottomVisibleReverse=e),n.bottomVisible?h.once||v.remove.occurred(i):v.get.occurred("bottomVisible")&&v.execute(o,i),e===t)return!n.bottomVisible},topPassedReverse:function(e){var n=v.get.elementCalculations(),o=e||h.onTopPassedReverse,i="topPassedReverse";if(e&&(v.debug("Adding callback for top passed reverse",e),h.onTopPassedReverse=e),n.topPassed?h.once||v.remove.occurred(i):v.get.occurred("topPassed")&&v.execute(o,i),e===t)return!n.onTopPassed},bottomPassedReverse:function(e){var n=v.get.elementCalculations(),o=e||h.onBottomPassedReverse,i="bottomPassedReverse";if(e&&(v.debug("Adding callback for bottom passed reverse",e),h.onBottomPassedReverse=e),n.bottomPassed?h.once||v.remove.occurred(i):v.get.occurred("bottomPassed")&&v.execute(o,i),e===t)return!n.bottomPassed},execute:function(e,n){var o=v.get.elementCalculations(),t=v.get.screenCalculations();e=e||!1,e&&(h.continuous?(v.debug("Callback being called continuously",n,o),e.call(z,o,t)):v.get.occurred(n)||(v.debug("Conditions met",n,o),e.call(z,o,t))),v.save.occurred(n)},remove:{fixed:function(){v.debug("Removing fixed position"),k.removeClass(P.fixed).css({position:"",top:"",left:"",zIndex:""}),h.onUnfixed.call(z)},placeholder:function(){v.debug("Removing placeholder content"),c&&c.remove()},occurred:function(e){if(e){var n=v.cache.occurred;n[e]!==t&&n[e]===!0&&(v.debug("Callback can now be called again",e),v.cache.occurred[e]=!1)}else v.cache.occurred={}}},save:{calculations:function(){v.verbose("Saving all calculations necessary to determine positioning"),v.save.direction(),v.save.screenCalculations(),v.save.elementCalculations()},occurred:function(e){e&&(v.cache.occurred[e]!==t&&v.cache.occurred[e]===!0||(v.verbose("Saving callback occurred",e),v.cache.occurred[e]=!0))},scroll:function(e){e=e+h.offset||T.scrollTop()+h.offset,v.cache.scroll=e},direction:function(){var e,n=v.get.scroll(),o=v.get.lastScroll();return e=n>o&&o?"down":n<o&&o?"up":"static",v.cache.direction=e,v.cache.direction},elementPosition:function(){var e=v.cache.element,n=v.get.screenSize();return v.verbose("Saving element position"),e.fits=e.height<n.height,e.offset=k.offset(),e.width=k.outerWidth(),e.height=k.outerHeight(),v.cache.element=e,e},elementCalculations:function(){var e=v.get.screenCalculations(),n=v.get.elementPosition();return h.includeMargin?(n.margin={},n.margin.top=parseInt(k.css("margin-top"),10),n.margin.bottom=parseInt(k.css("margin-bottom"),10),n.top=n.offset.top-n.margin.top,n.bottom=n.offset.top+n.height+n.margin.bottom):(n.top=n.offset.top,n.bottom=n.offset.top+n.height),n.topVisible=e.bottom>=n.top,n.topPassed=e.top>=n.top,n.bottomVisible=e.bottom>=n.bottom,n.bottomPassed=e.top>=n.bottom,n.pixelsPassed=0,n.percentagePassed=0,n.onScreen=n.topVisible&&!n.bottomPassed,n.passing=n.topPassed&&!n.bottomPassed,n.offScreen=!n.onScreen,n.passing&&(n.pixelsPassed=e.top-n.top,n.percentagePassed=(e.top-n.top)/n.height),v.cache.element=n,v.verbose("Updated element calculations",n),n},screenCalculations:function(){var e=v.get.scroll();return v.save.direction(),v.cache.screen.top=e,v.cache.screen.bottom=e+v.cache.screen.height,v.cache.screen},screenSize:function(){v.verbose("Saving window position"),v.cache.screen={height:T.height()}},position:function(){v.save.screenSize(),v.save.elementPosition()}},get:{pixelsPassed:function(e){var n=v.get.elementCalculations();return e.search("%")>-1?n.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return v.cache.occurred!==t&&(v.cache.occurred[e]||!1)},direction:function(){return v.cache.direction===t&&v.save.direction(),v.cache.direction},elementPosition:function(){return v.cache.element===t&&v.save.elementPosition(),v.cache.element},elementCalculations:function(){return v.cache.element===t&&v.save.elementCalculations(),v.cache.element},screenCalculations:function(){return v.cache.screen===t&&v.save.screenCalculations(),v.cache.screen},screenSize:function(){return v.cache.screen===t&&v.save.screenSize(),v.cache.screen},scroll:function(){return v.cache.scroll===t&&v.save.scroll(),v.cache.scroll},lastScroll:function(){return v.cache.screen===t?(v.debug("First scroll event, no last scroll could be found"),!1):v.cache.screen.top}},setting:function(n,o){if(e.isPlainObject(n))e.extend(!0,h,n);else{if(o===t)return h[n];h[n]=o}},internal:function(n,o){if(e.isPlainObject(n))e.extend(!0,v,n);else{if(o===t)return v[n];v[n]=o}},debug:function(){!h.silent&&h.debug&&(h.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,h.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!h.silent&&h.verbose&&h.debug&&(h.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),v.verbose.apply(console,arguments)))},error:function(){h.silent||(v.error=Function.prototype.bind.call(console.error,console,h.name+":"),v.error.apply(console,arguments))},performance:{log:function(e){var n,o,t;h.performance&&(n=(new Date).getTime(),t=a||n,o=n-t,a=n,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:z,"Execution Time":o})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var n=h.name+":",o=0;a=!1,clearTimeout(v.performance.timer),e.each(l,function(e,n){o+=n["Execution Time"]}),n+=" "+o+"ms",r&&(n+=" '"+r+"'"),(console.group!==t||console.table!==t)&&l.length>0&&(console.groupCollapsed(n),console.table?console.table(l):e.each(l,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(n,o,i){var c,r,a,l=O;return o=o||f,i=z||i,"string"==typeof n&&l!==t&&(n=n.split(/[\. ]/),c=n.length-1,e.each(n,function(o,i){var s=o!=c?i+n[o+1].charAt(0).toUpperCase()+n[o+1].slice(1):n;if(e.isPlainObject(l[s])&&o!=c)l=l[s];else{if(l[s]!==t)return r=l[s],!1;if(!e.isPlainObject(l[i])||o==c)return l[i]!==t?(r=l[i],!1):(v.error(C.method,n),!1);l=l[i]}})),e.isFunction(r)?a=r.apply(i,o):r!==t&&(a=r),e.isArray(s)?s.push(a):s!==t?s=[s,a]:a!==t&&(s=a),r}},u?(O===t&&v.initialize(),O.save.scroll(),O.save.calculations(),v.invoke(d)):(O!==t&&O.invoke("destroy"),v.initialize())}),s!==t?s:this},e.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:n,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"placeholder",visible:"visible"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document);
|
@@ -0,0 +1,517 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 2.0.0 - Visit
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Copyright 2015 Contributors
|
7
|
+
* Released under the MIT license
|
8
|
+
* http://opensource.org/licenses/MIT
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
|
12
|
+
;(function ($, window, document, undefined) {
|
13
|
+
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
$.visit = $.fn.visit = function(parameters) {
|
17
|
+
var
|
18
|
+
$allModules = $.isFunction(this)
|
19
|
+
? $(window)
|
20
|
+
: $(this),
|
21
|
+
moduleSelector = $allModules.selector || '',
|
22
|
+
|
23
|
+
time = new Date().getTime(),
|
24
|
+
performance = [],
|
25
|
+
|
26
|
+
query = arguments[0],
|
27
|
+
methodInvoked = (typeof query == 'string'),
|
28
|
+
queryArguments = [].slice.call(arguments, 1),
|
29
|
+
returnedValue
|
30
|
+
;
|
31
|
+
$allModules
|
32
|
+
.each(function() {
|
33
|
+
var
|
34
|
+
settings = ( $.isPlainObject(parameters) )
|
35
|
+
? $.extend(true, {}, $.fn.visit.settings, parameters)
|
36
|
+
: $.extend({}, $.fn.visit.settings),
|
37
|
+
|
38
|
+
error = settings.error,
|
39
|
+
namespace = settings.namespace,
|
40
|
+
|
41
|
+
eventNamespace = '.' + namespace,
|
42
|
+
moduleNamespace = namespace + '-module',
|
43
|
+
|
44
|
+
$module = $(this),
|
45
|
+
$displays = $(),
|
46
|
+
|
47
|
+
element = this,
|
48
|
+
instance = $module.data(moduleNamespace),
|
49
|
+
module
|
50
|
+
;
|
51
|
+
module = {
|
52
|
+
|
53
|
+
initialize: function() {
|
54
|
+
if(settings.count) {
|
55
|
+
module.store(settings.key.count, settings.count);
|
56
|
+
}
|
57
|
+
else if(settings.id) {
|
58
|
+
module.add.id(settings.id);
|
59
|
+
}
|
60
|
+
else if(settings.increment && methodInvoked !== 'increment') {
|
61
|
+
module.increment();
|
62
|
+
}
|
63
|
+
module.add.display($module);
|
64
|
+
module.instantiate();
|
65
|
+
},
|
66
|
+
|
67
|
+
instantiate: function() {
|
68
|
+
module.verbose('Storing instance of visit module', module);
|
69
|
+
instance = module;
|
70
|
+
$module
|
71
|
+
.data(moduleNamespace, module)
|
72
|
+
;
|
73
|
+
},
|
74
|
+
|
75
|
+
destroy: function() {
|
76
|
+
module.verbose('Destroying instance');
|
77
|
+
$module
|
78
|
+
.removeData(moduleNamespace)
|
79
|
+
;
|
80
|
+
},
|
81
|
+
|
82
|
+
increment: function(id) {
|
83
|
+
var
|
84
|
+
currentValue = module.get.count(),
|
85
|
+
newValue = +(currentValue) + 1
|
86
|
+
;
|
87
|
+
if(id) {
|
88
|
+
module.add.id(id);
|
89
|
+
}
|
90
|
+
else {
|
91
|
+
if(newValue > settings.limit && !settings.surpass) {
|
92
|
+
newValue = settings.limit;
|
93
|
+
}
|
94
|
+
module.debug('Incrementing visits', newValue);
|
95
|
+
module.store(settings.key.count, newValue);
|
96
|
+
}
|
97
|
+
},
|
98
|
+
|
99
|
+
decrement: function(id) {
|
100
|
+
var
|
101
|
+
currentValue = module.get.count(),
|
102
|
+
newValue = +(currentValue) - 1
|
103
|
+
;
|
104
|
+
if(id) {
|
105
|
+
module.remove.id(id);
|
106
|
+
}
|
107
|
+
else {
|
108
|
+
module.debug('Removing visit');
|
109
|
+
module.store(settings.key.count, newValue);
|
110
|
+
}
|
111
|
+
},
|
112
|
+
|
113
|
+
get: {
|
114
|
+
count: function() {
|
115
|
+
return +(module.retrieve(settings.key.count)) || 0;
|
116
|
+
},
|
117
|
+
idCount: function(ids) {
|
118
|
+
ids = ids || module.get.ids();
|
119
|
+
return ids.length;
|
120
|
+
},
|
121
|
+
ids: function(delimitedIDs) {
|
122
|
+
var
|
123
|
+
idArray = []
|
124
|
+
;
|
125
|
+
delimitedIDs = delimitedIDs || module.retrieve(settings.key.ids);
|
126
|
+
if(typeof delimitedIDs === 'string') {
|
127
|
+
idArray = delimitedIDs.split(settings.delimiter);
|
128
|
+
}
|
129
|
+
module.verbose('Found visited ID list', idArray);
|
130
|
+
return idArray;
|
131
|
+
},
|
132
|
+
storageOptions: function(data) {
|
133
|
+
var
|
134
|
+
options = {}
|
135
|
+
;
|
136
|
+
if(settings.expires) {
|
137
|
+
options.expires = settings.expires;
|
138
|
+
}
|
139
|
+
if(settings.domain) {
|
140
|
+
options.domain = settings.domain;
|
141
|
+
}
|
142
|
+
if(settings.path) {
|
143
|
+
options.path = settings.path;
|
144
|
+
}
|
145
|
+
return options;
|
146
|
+
}
|
147
|
+
},
|
148
|
+
|
149
|
+
has: {
|
150
|
+
visited: function(id, ids) {
|
151
|
+
var
|
152
|
+
visited = false
|
153
|
+
;
|
154
|
+
ids = ids || module.get.ids();
|
155
|
+
if(id !== undefined && ids) {
|
156
|
+
$.each(ids, function(index, value){
|
157
|
+
if(value == id) {
|
158
|
+
visited = true;
|
159
|
+
}
|
160
|
+
});
|
161
|
+
}
|
162
|
+
return visited;
|
163
|
+
}
|
164
|
+
},
|
165
|
+
|
166
|
+
set: {
|
167
|
+
count: function(value) {
|
168
|
+
module.store(settings.key.count, value);
|
169
|
+
},
|
170
|
+
ids: function(value) {
|
171
|
+
module.store(settings.key.ids, value);
|
172
|
+
}
|
173
|
+
},
|
174
|
+
|
175
|
+
reset: function() {
|
176
|
+
module.store(settings.key.count, 0);
|
177
|
+
module.store(settings.key.ids, null);
|
178
|
+
},
|
179
|
+
|
180
|
+
add: {
|
181
|
+
id: function(id) {
|
182
|
+
var
|
183
|
+
currentIDs = module.retrieve(settings.key.ids),
|
184
|
+
newIDs = (currentIDs === undefined || currentIDs === '')
|
185
|
+
? id
|
186
|
+
: currentIDs + settings.delimiter + id
|
187
|
+
;
|
188
|
+
if( module.has.visited(id) ) {
|
189
|
+
module.debug('Unique content already visited, not adding visit', id, currentIDs);
|
190
|
+
}
|
191
|
+
else if(id === undefined) {
|
192
|
+
module.debug('ID is not defined');
|
193
|
+
}
|
194
|
+
else {
|
195
|
+
module.debug('Adding visit to unique content', id);
|
196
|
+
module.store(settings.key.ids, newIDs);
|
197
|
+
}
|
198
|
+
module.set.count( module.get.idCount() );
|
199
|
+
},
|
200
|
+
display: function(selector) {
|
201
|
+
var
|
202
|
+
$element = $(selector)
|
203
|
+
;
|
204
|
+
if($element.length > 0 && !$.isWindow($element[0])) {
|
205
|
+
module.debug('Updating visit count for element', $element);
|
206
|
+
$displays = ($displays.length > 0)
|
207
|
+
? $displays.add($element)
|
208
|
+
: $element
|
209
|
+
;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
},
|
213
|
+
|
214
|
+
remove: {
|
215
|
+
id: function(id) {
|
216
|
+
var
|
217
|
+
currentIDs = module.get.ids(),
|
218
|
+
newIDs = []
|
219
|
+
;
|
220
|
+
if(id !== undefined && currentIDs !== undefined) {
|
221
|
+
module.debug('Removing visit to unique content', id, currentIDs);
|
222
|
+
$.each(currentIDs, function(index, value){
|
223
|
+
if(value !== id) {
|
224
|
+
newIDs.push(value);
|
225
|
+
}
|
226
|
+
});
|
227
|
+
newIDs = newIDs.join(settings.delimiter);
|
228
|
+
module.store(settings.key.ids, newIDs );
|
229
|
+
}
|
230
|
+
module.set.count( module.get.idCount() );
|
231
|
+
}
|
232
|
+
},
|
233
|
+
|
234
|
+
check: {
|
235
|
+
limit: function(value) {
|
236
|
+
value = value || module.get.count();
|
237
|
+
if(settings.limit) {
|
238
|
+
if(value >= settings.limit) {
|
239
|
+
module.debug('Pages viewed exceeded limit, firing callback', value, settings.limit);
|
240
|
+
settings.onLimit.call(element, value);
|
241
|
+
}
|
242
|
+
module.debug('Limit not reached', value, settings.limit);
|
243
|
+
settings.onChange.call(element, value);
|
244
|
+
}
|
245
|
+
module.update.display(value);
|
246
|
+
}
|
247
|
+
},
|
248
|
+
|
249
|
+
update: {
|
250
|
+
display: function(value) {
|
251
|
+
value = value || module.get.count();
|
252
|
+
if($displays.length > 0) {
|
253
|
+
module.debug('Updating displayed view count', $displays);
|
254
|
+
$displays.html(value);
|
255
|
+
}
|
256
|
+
}
|
257
|
+
},
|
258
|
+
|
259
|
+
store: function(key, value) {
|
260
|
+
var
|
261
|
+
options = module.get.storageOptions(value)
|
262
|
+
;
|
263
|
+
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
|
264
|
+
window.localStorage.setItem(key, value);
|
265
|
+
module.debug('Value stored using local storage', key, value);
|
266
|
+
}
|
267
|
+
else if($.cookie !== undefined) {
|
268
|
+
$.cookie(key, value, options);
|
269
|
+
module.debug('Value stored using cookie', key, value, options);
|
270
|
+
}
|
271
|
+
else {
|
272
|
+
module.error(error.noCookieStorage);
|
273
|
+
return;
|
274
|
+
}
|
275
|
+
if(key == settings.key.count) {
|
276
|
+
module.check.limit(value);
|
277
|
+
}
|
278
|
+
},
|
279
|
+
retrieve: function(key, value) {
|
280
|
+
var
|
281
|
+
storedValue
|
282
|
+
;
|
283
|
+
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
|
284
|
+
storedValue = window.localStorage.getItem(key);
|
285
|
+
}
|
286
|
+
// get by cookie
|
287
|
+
else if($.cookie !== undefined) {
|
288
|
+
storedValue = $.cookie(key);
|
289
|
+
}
|
290
|
+
else {
|
291
|
+
module.error(error.noCookieStorage);
|
292
|
+
}
|
293
|
+
if(storedValue == 'undefined' || storedValue == 'null' || storedValue === undefined || storedValue === null) {
|
294
|
+
storedValue = undefined;
|
295
|
+
}
|
296
|
+
return storedValue;
|
297
|
+
},
|
298
|
+
|
299
|
+
setting: function(name, value) {
|
300
|
+
if( $.isPlainObject(name) ) {
|
301
|
+
$.extend(true, settings, name);
|
302
|
+
}
|
303
|
+
else if(value !== undefined) {
|
304
|
+
settings[name] = value;
|
305
|
+
}
|
306
|
+
else {
|
307
|
+
return settings[name];
|
308
|
+
}
|
309
|
+
},
|
310
|
+
internal: function(name, value) {
|
311
|
+
module.debug('Changing internal', name, value);
|
312
|
+
if(value !== undefined) {
|
313
|
+
if( $.isPlainObject(name) ) {
|
314
|
+
$.extend(true, module, name);
|
315
|
+
}
|
316
|
+
else {
|
317
|
+
module[name] = value;
|
318
|
+
}
|
319
|
+
}
|
320
|
+
else {
|
321
|
+
return module[name];
|
322
|
+
}
|
323
|
+
},
|
324
|
+
debug: function() {
|
325
|
+
if(settings.debug) {
|
326
|
+
if(settings.performance) {
|
327
|
+
module.performance.log(arguments);
|
328
|
+
}
|
329
|
+
else {
|
330
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
331
|
+
module.debug.apply(console, arguments);
|
332
|
+
}
|
333
|
+
}
|
334
|
+
},
|
335
|
+
verbose: function() {
|
336
|
+
if(settings.verbose && settings.debug) {
|
337
|
+
if(settings.performance) {
|
338
|
+
module.performance.log(arguments);
|
339
|
+
}
|
340
|
+
else {
|
341
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
342
|
+
module.verbose.apply(console, arguments);
|
343
|
+
}
|
344
|
+
}
|
345
|
+
},
|
346
|
+
error: function() {
|
347
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
348
|
+
module.error.apply(console, arguments);
|
349
|
+
},
|
350
|
+
performance: {
|
351
|
+
log: function(message) {
|
352
|
+
var
|
353
|
+
currentTime,
|
354
|
+
executionTime,
|
355
|
+
previousTime
|
356
|
+
;
|
357
|
+
if(settings.performance) {
|
358
|
+
currentTime = new Date().getTime();
|
359
|
+
previousTime = time || currentTime;
|
360
|
+
executionTime = currentTime - previousTime;
|
361
|
+
time = currentTime;
|
362
|
+
performance.push({
|
363
|
+
'Name' : message[0],
|
364
|
+
'Arguments' : [].slice.call(message, 1) || '',
|
365
|
+
'Element' : element,
|
366
|
+
'Execution Time' : executionTime
|
367
|
+
});
|
368
|
+
}
|
369
|
+
clearTimeout(module.performance.timer);
|
370
|
+
module.performance.timer = setTimeout(module.performance.display, 500);
|
371
|
+
},
|
372
|
+
display: function() {
|
373
|
+
var
|
374
|
+
title = settings.name + ':',
|
375
|
+
totalTime = 0
|
376
|
+
;
|
377
|
+
time = false;
|
378
|
+
clearTimeout(module.performance.timer);
|
379
|
+
$.each(performance, function(index, data) {
|
380
|
+
totalTime += data['Execution Time'];
|
381
|
+
});
|
382
|
+
title += ' ' + totalTime + 'ms';
|
383
|
+
if(moduleSelector) {
|
384
|
+
title += ' \'' + moduleSelector + '\'';
|
385
|
+
}
|
386
|
+
if($allModules.length > 1) {
|
387
|
+
title += ' ' + '(' + $allModules.length + ')';
|
388
|
+
}
|
389
|
+
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
390
|
+
console.groupCollapsed(title);
|
391
|
+
if(console.table) {
|
392
|
+
console.table(performance);
|
393
|
+
}
|
394
|
+
else {
|
395
|
+
$.each(performance, function(index, data) {
|
396
|
+
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
397
|
+
});
|
398
|
+
}
|
399
|
+
console.groupEnd();
|
400
|
+
}
|
401
|
+
performance = [];
|
402
|
+
}
|
403
|
+
},
|
404
|
+
invoke: function(query, passedArguments, context) {
|
405
|
+
var
|
406
|
+
object = instance,
|
407
|
+
maxDepth,
|
408
|
+
found,
|
409
|
+
response
|
410
|
+
;
|
411
|
+
passedArguments = passedArguments || queryArguments;
|
412
|
+
context = element || context;
|
413
|
+
if(typeof query == 'string' && object !== undefined) {
|
414
|
+
query = query.split(/[\. ]/);
|
415
|
+
maxDepth = query.length - 1;
|
416
|
+
$.each(query, function(depth, value) {
|
417
|
+
var camelCaseValue = (depth != maxDepth)
|
418
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
419
|
+
: query
|
420
|
+
;
|
421
|
+
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
422
|
+
object = object[camelCaseValue];
|
423
|
+
}
|
424
|
+
else if( object[camelCaseValue] !== undefined ) {
|
425
|
+
found = object[camelCaseValue];
|
426
|
+
return false;
|
427
|
+
}
|
428
|
+
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
429
|
+
object = object[value];
|
430
|
+
}
|
431
|
+
else if( object[value] !== undefined ) {
|
432
|
+
found = object[value];
|
433
|
+
return false;
|
434
|
+
}
|
435
|
+
else {
|
436
|
+
return false;
|
437
|
+
}
|
438
|
+
});
|
439
|
+
}
|
440
|
+
if ( $.isFunction( found ) ) {
|
441
|
+
response = found.apply(context, passedArguments);
|
442
|
+
}
|
443
|
+
else if(found !== undefined) {
|
444
|
+
response = found;
|
445
|
+
}
|
446
|
+
if($.isArray(returnedValue)) {
|
447
|
+
returnedValue.push(response);
|
448
|
+
}
|
449
|
+
else if(returnedValue !== undefined) {
|
450
|
+
returnedValue = [returnedValue, response];
|
451
|
+
}
|
452
|
+
else if(response !== undefined) {
|
453
|
+
returnedValue = response;
|
454
|
+
}
|
455
|
+
return found;
|
456
|
+
}
|
457
|
+
};
|
458
|
+
if(methodInvoked) {
|
459
|
+
if(instance === undefined) {
|
460
|
+
module.initialize();
|
461
|
+
}
|
462
|
+
module.invoke(query);
|
463
|
+
}
|
464
|
+
else {
|
465
|
+
if(instance !== undefined) {
|
466
|
+
instance.invoke('destroy');
|
467
|
+
}
|
468
|
+
module.initialize();
|
469
|
+
}
|
470
|
+
|
471
|
+
})
|
472
|
+
;
|
473
|
+
return (returnedValue !== undefined)
|
474
|
+
? returnedValue
|
475
|
+
: this
|
476
|
+
;
|
477
|
+
};
|
478
|
+
|
479
|
+
$.fn.visit.settings = {
|
480
|
+
|
481
|
+
name : 'Visit',
|
482
|
+
|
483
|
+
debug : false,
|
484
|
+
verbose : false,
|
485
|
+
performance : true,
|
486
|
+
|
487
|
+
namespace : 'visit',
|
488
|
+
|
489
|
+
increment : false,
|
490
|
+
surpass : false,
|
491
|
+
count : false,
|
492
|
+
limit : false,
|
493
|
+
|
494
|
+
delimiter : '&',
|
495
|
+
storageMethod : 'localstorage',
|
496
|
+
|
497
|
+
key : {
|
498
|
+
count : 'visit-count',
|
499
|
+
ids : 'visit-ids'
|
500
|
+
},
|
501
|
+
|
502
|
+
expires : 30,
|
503
|
+
domain : false,
|
504
|
+
path : '/',
|
505
|
+
|
506
|
+
onLimit : function() {},
|
507
|
+
onChange : function() {},
|
508
|
+
|
509
|
+
error : {
|
510
|
+
method : 'The method you called is not defined',
|
511
|
+
missingPersist : 'Using the persist setting requires the inclusion of PersistJS',
|
512
|
+
noCookieStorage : 'The default storage cookie requires $.cookie to be included.'
|
513
|
+
}
|
514
|
+
|
515
|
+
};
|
516
|
+
|
517
|
+
})( jQuery, window , document );
|