active_admin_pro 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/LICENSE +20 -0
- data/README.md +5 -0
- data/Rakefile +34 -0
- data/app/assets/javascripts/active_admin_pro.js +41 -0
- data/app/assets/javascripts/active_admin_pro/actions/new.js +8 -0
- data/app/assets/javascripts/active_admin_pro/actions/show.js +12 -0
- data/app/assets/javascripts/active_admin_pro/components/codemirror_input.js +92 -0
- data/app/assets/javascripts/active_admin_pro/components/flashes.js +9 -0
- data/app/assets/javascripts/active_admin_pro/components/link.js +23 -0
- data/app/assets/javascripts/active_admin_pro/components/phone_input.js +52 -0
- data/app/assets/javascripts/active_admin_pro/components/select_input.js +31 -0
- data/app/assets/javascripts/active_admin_pro/components/sortable_handle.js +8 -0
- data/app/assets/javascripts/active_admin_pro/components/summernote_input.js +132 -0
- data/app/assets/javascripts/active_admin_pro/components/text_input.js +47 -0
- data/app/assets/javascripts/active_admin_pro/components/time_zone_input.js +51 -0
- data/app/assets/javascripts/active_admin_pro/components/title_to_slug.js +16 -0
- data/app/assets/stylesheets/active_admin_pro.scss +20 -0
- data/app/assets/stylesheets/active_admin_pro/breakpoints.scss +3 -0
- data/app/assets/stylesheets/active_admin_pro/components/_input_variables.scss +9 -0
- data/app/assets/stylesheets/active_admin_pro/components/actions.scss +13 -0
- data/app/assets/stylesheets/active_admin_pro/components/boolean_input.scss +13 -0
- data/app/assets/stylesheets/active_admin_pro/components/button.scss +7 -0
- data/app/assets/stylesheets/active_admin_pro/components/check_boxes_input.scss +38 -0
- data/app/assets/stylesheets/active_admin_pro/components/codemirror_input.scss +53 -0
- data/app/assets/stylesheets/active_admin_pro/components/comments.scss +17 -0
- data/app/assets/stylesheets/active_admin_pro/components/datepicker.scss +108 -0
- data/app/assets/stylesheets/active_admin_pro/components/dialog.scss +66 -0
- data/app/assets/stylesheets/active_admin_pro/components/dropdown_menu_button.scss +40 -0
- data/app/assets/stylesheets/active_admin_pro/components/fieldset.scss +26 -0
- data/app/assets/stylesheets/active_admin_pro/components/file_input.scss +27 -0
- data/app/assets/stylesheets/active_admin_pro/components/has_many_fields.scss +4 -0
- data/app/assets/stylesheets/active_admin_pro/components/inline_errors.scss +7 -0
- data/app/assets/stylesheets/active_admin_pro/components/link.scss +16 -0
- data/app/assets/stylesheets/active_admin_pro/components/panel.scss +62 -0
- data/app/assets/stylesheets/active_admin_pro/components/phone_input.scss +31 -0
- data/app/assets/stylesheets/active_admin_pro/components/radio_input.scss +38 -0
- data/app/assets/stylesheets/active_admin_pro/components/segmented_control.scss +41 -0
- data/app/assets/stylesheets/active_admin_pro/components/select_input.scss +42 -0
- data/app/assets/stylesheets/active_admin_pro/components/sortable_handle.scss +21 -0
- data/app/assets/stylesheets/active_admin_pro/components/string_input.scss +85 -0
- data/app/assets/stylesheets/active_admin_pro/components/summernote_input.scss +190 -0
- data/app/assets/stylesheets/active_admin_pro/components/table.scss +100 -0
- data/app/assets/stylesheets/active_admin_pro/components/text_input.scss +55 -0
- data/app/assets/stylesheets/active_admin_pro/functions/color.scss +130 -0
- data/app/assets/stylesheets/active_admin_pro/functions/text-color.scss +35 -0
- data/app/assets/stylesheets/active_admin_pro/layout/actions/comments.scss +14 -0
- data/app/assets/stylesheets/active_admin_pro/layout/actions/index.scss +88 -0
- data/app/assets/stylesheets/active_admin_pro/layout/actions/show.scss +25 -0
- data/app/assets/stylesheets/active_admin_pro/layout/body.scss +60 -0
- data/app/assets/stylesheets/active_admin_pro/layout/desktop/action_items.scss +32 -0
- data/app/assets/stylesheets/active_admin_pro/layout/desktop/actions/comments.scss +10 -0
- data/app/assets/stylesheets/active_admin_pro/layout/desktop/active_admin_content.scss +22 -0
- data/app/assets/stylesheets/active_admin_pro/layout/desktop/breadcrumbs.scss +57 -0
- data/app/assets/stylesheets/active_admin_pro/layout/desktop/navigation.scss +197 -0
- data/app/assets/stylesheets/active_admin_pro/layout/desktop/sidebar.scss +5 -0
- data/app/assets/stylesheets/active_admin_pro/layout/desktop/title_bar.scss +24 -0
- data/app/assets/stylesheets/active_admin_pro/layout/desktop/wrapper.scss +5 -0
- data/app/assets/stylesheets/active_admin_pro/layout/filters.scss +41 -0
- data/app/assets/stylesheets/active_admin_pro/layout/flashes.scss +52 -0
- data/app/assets/stylesheets/active_admin_pro/layout/footer.scss +3 -0
- data/app/assets/stylesheets/active_admin_pro/layout/mobile/actions/index.scss +7 -0
- data/app/assets/stylesheets/active_admin_pro/layout/tablet/actions/dashboard.scss +105 -0
- data/app/assets/stylesheets/active_admin_pro/layout/tablet/actions/index.scss +20 -0
- data/app/assets/stylesheets/active_admin_pro/layout/tablet/actions/show.scss +78 -0
- data/app/assets/stylesheets/active_admin_pro/layout/tablet/active_admin_content.scss +9 -0
- data/app/assets/stylesheets/active_admin_pro/layout/tablet/flashes.scss +5 -0
- data/app/assets/stylesheets/active_admin_pro/layout/tablet/navigation.scss +48 -0
- data/app/assets/stylesheets/active_admin_pro/layout/tablet/title_bar.scss +53 -0
- data/app/assets/stylesheets/active_admin_pro/mixins/button.scss +48 -0
- data/app/assets/stylesheets/active_admin_pro/variables.scss +10 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon.scss +87 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/_bourbon-deprecated-upcoming.scss +411 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_border-color.scss +26 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_border-radius.scss +48 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_border-style.scss +25 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_border-width.scss +25 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_buttons.scss +64 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_clearfix.scss +25 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_ellipsis.scss +30 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_font-stacks.scss +31 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_hide-text.scss +27 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_margin.scss +26 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_padding.scss +26 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_position.scss +48 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_prefixer.scss +66 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_retina-image.scss +25 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_size.scss +51 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_text-inputs.scss +113 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_timing-functions.scss +34 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_triangle.scss +63 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_word-wrap.scss +29 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_animation.scss +43 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_appearance.scss +3 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_backface-visibility.scss +3 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_background-image.scss +42 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_background.scss +55 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_border-image.scss +59 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_calc.scss +4 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_columns.scss +47 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_filter.scss +4 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_flex-box.scss +287 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_font-face.scss +24 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_font-feature-settings.scss +4 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_hidpi-media-query.scss +10 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_hyphens.scss +4 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_image-rendering.scss +14 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_keyframes.scss +36 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_linear-gradient.scss +38 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_perspective.scss +8 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_placeholder.scss +8 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_radial-gradient.scss +39 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_selection.scss +42 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_text-decoration.scss +19 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_transform.scss +15 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_transition.scss +71 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_user-select.scss +3 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_assign-inputs.scss +11 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_contains-falsy.scss +20 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_contains.scss +26 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_is-length.scss +11 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_is-light.scss +21 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_is-number.scss +11 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_is-size.scss +13 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_modular-scale.scss +69 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_px-to-em.scss +13 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_px-to-rem.scss +15 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_shade.scss +24 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_strip-units.scss +17 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_tint.scss +24 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_transition-property-name.scss +22 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_unpack.scss +27 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_convert-units.scss +21 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_directional-values.scss +96 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_font-source-declaration.scss +43 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_gradient-positions-parser.scss +13 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_linear-angle-parser.scss +25 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_linear-gradient-parser.scss +41 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_linear-positions-parser.scss +61 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_linear-side-corner-parser.scss +31 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_radial-arg-parser.scss +69 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_radial-gradient-parser.scss +50 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_radial-positions-parser.scss +18 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_render-gradients.scss +26 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_shape-size-stripper.scss +10 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_str-to-num.scss +50 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/settings/_asset-pipeline.scss +7 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/settings/_prefixer.scss +9 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/settings/_px-to-em.scss +1 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat.scss +22 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/_neat-helpers.scss +8 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/functions/_new-breakpoint.scss +49 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/functions/_private.scss +108 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_box-sizing.scss +11 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_direction-context.scss +31 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_display-context.scss +26 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_fill-parent.scss +22 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_media.scss +92 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_omega.scss +91 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_outer-container.scss +36 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_pad.scss +23 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_private.scss +35 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_row.scss +53 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_shift.scss +48 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_span-columns.scss +90 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_to-deprecate.scss +105 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_visual-grid.scss +40 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/settings/_disable-warnings.scss +11 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/settings/_grid.scss +53 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/neat/settings/_visual-grid.scss +25 -0
- data/app/assets/stylesheets/active_admin_pro/vendor/normalize.css +423 -0
- data/app/assets/stylesheets/codemirror/themes/activeadmin_pro.scss +117 -0
- data/app/inputs/codemirror_input.rb +27 -0
- data/app/inputs/datepicker_input.rb +16 -0
- data/app/inputs/phone_input.rb +5 -0
- data/app/inputs/summernote_input.rb +5 -0
- data/app/inputs/time_zone_input.rb +43 -0
- data/app/models/activeadmin_pro/summernote_image.rb +5 -0
- data/config/initializers/active_admin.rb +50 -0
- data/config/locales/en.yml +55 -0
- data/lib/active_admin_pro/admin_user/admin_user.rb +52 -0
- data/lib/active_admin_pro/engine.rb +8 -0
- data/lib/active_admin_pro/summernote_image/summernote_image.rb +61 -0
- data/lib/active_admin_pro/user/user.rb +53 -0
- data/lib/active_admin_pro/version.rb +3 -0
- data/lib/activeadmin_pro.rb +9 -0
- data/lib/generators/activeadmin_pro/install_generator.rb +14 -0
- data/lib/tasks/activeadmin_pro_tasks.rake +4 -0
- data/spec/spec_helper.rb +34 -0
- data/vendor/assets/javascripts/bootstrap.js +1243 -0
- data/vendor/assets/javascripts/codemirror.js +8887 -0
- data/vendor/assets/javascripts/codemirror/addons/comment/comment.js +183 -0
- data/vendor/assets/javascripts/codemirror/addons/comment/continuecomment.js +85 -0
- data/vendor/assets/javascripts/codemirror/addons/dialog/dialog.css +32 -0
- data/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js +157 -0
- data/vendor/assets/javascripts/codemirror/addons/display/autorefresh.js +47 -0
- data/vendor/assets/javascripts/codemirror/addons/display/fullscreen.css +6 -0
- data/vendor/assets/javascripts/codemirror/addons/display/fullscreen.js +41 -0
- data/vendor/assets/javascripts/codemirror/addons/display/panel.js +112 -0
- data/vendor/assets/javascripts/codemirror/addons/display/placeholder.js +60 -0
- data/vendor/assets/javascripts/codemirror/addons/display/rulers.js +63 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +195 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/closetag.js +169 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/continuelist.js +51 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/matchbrackets.js +120 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/matchtags.js +66 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/trailingspace.js +27 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js +105 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js +57 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/foldcode.js +149 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.css +20 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js +146 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js +44 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/markdown-fold.js +49 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js +182 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/anyword-hint.js +41 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/css-hint.js +60 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/html-hint.js +348 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/javascript-hint.js +146 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.css +38 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js +386 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js +254 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/xml-hint.js +110 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js +41 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/css-lint.js +35 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/html-lint.js +46 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/javascript-lint.js +136 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/json-lint.js +31 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/lint.css +73 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/lint.js +231 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/yaml-lint.js +28 -0
- data/vendor/assets/javascripts/codemirror/addons/merge/merge.css +112 -0
- data/vendor/assets/javascripts/codemirror/addons/merge/merge.js +775 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/loadmode.js +64 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js +123 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/multiplex_test.js +33 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/overlay.js +85 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/simple.js +213 -0
- data/vendor/assets/javascripts/codemirror/addons/runmode/colorize.js +40 -0
- data/vendor/assets/javascripts/codemirror/addons/runmode/runmode-standalone.js +157 -0
- data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.js +72 -0
- data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js +178 -0
- data/vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js +115 -0
- data/vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js +46 -0
- data/vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.css +66 -0
- data/vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js +147 -0
- data/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js +128 -0
- data/vendor/assets/javascripts/codemirror/addons/search/matchesonscrollbar.css +8 -0
- data/vendor/assets/javascripts/codemirror/addons/search/matchesonscrollbar.js +97 -0
- data/vendor/assets/javascripts/codemirror/addons/search/search.js +228 -0
- data/vendor/assets/javascripts/codemirror/addons/search/searchcursor.js +189 -0
- data/vendor/assets/javascripts/codemirror/addons/selection/active-line.js +71 -0
- data/vendor/assets/javascripts/codemirror/addons/selection/mark-selection.js +118 -0
- data/vendor/assets/javascripts/codemirror/addons/selection/selection-pointer.js +98 -0
- data/vendor/assets/javascripts/codemirror/addons/tern/tern.css +87 -0
- data/vendor/assets/javascripts/codemirror/addons/tern/tern.js +700 -0
- data/vendor/assets/javascripts/codemirror/addons/tern/worker.js +44 -0
- data/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js +139 -0
- data/vendor/assets/javascripts/codemirror/modes/coffeescript.js +366 -0
- data/vendor/assets/javascripts/codemirror/modes/css.js +823 -0
- data/vendor/assets/javascripts/codemirror/modes/diff.js +47 -0
- data/vendor/assets/javascripts/codemirror/modes/dockerfile.js +79 -0
- data/vendor/assets/javascripts/codemirror/modes/gfm.js +130 -0
- data/vendor/assets/javascripts/codemirror/modes/go.js +185 -0
- data/vendor/assets/javascripts/codemirror/modes/haml.js +159 -0
- data/vendor/assets/javascripts/codemirror/modes/handlebars.js +53 -0
- data/vendor/assets/javascripts/codemirror/modes/htmlembedded.js +28 -0
- data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +150 -0
- data/vendor/assets/javascripts/codemirror/modes/javascript.js +708 -0
- data/vendor/assets/javascripts/codemirror/modes/markdown.js +792 -0
- data/vendor/assets/javascripts/codemirror/modes/nginx.js +178 -0
- data/vendor/assets/javascripts/codemirror/modes/php.js +234 -0
- data/vendor/assets/javascripts/codemirror/modes/python.js +358 -0
- data/vendor/assets/javascripts/codemirror/modes/ruby.js +285 -0
- data/vendor/assets/javascripts/codemirror/modes/rust.js +58 -0
- data/vendor/assets/javascripts/codemirror/modes/sass.js +414 -0
- data/vendor/assets/javascripts/codemirror/modes/shell.js +139 -0
- data/vendor/assets/javascripts/codemirror/modes/xml.js +385 -0
- data/vendor/assets/javascripts/codemirror/modes/yaml.js +117 -0
- data/vendor/assets/javascripts/intl-tel-input.js +963 -0
- data/vendor/assets/javascripts/intl-tel-utils.js +480 -0
- data/vendor/assets/javascripts/slug.js +212 -0
- data/vendor/assets/javascripts/summernote.js +6939 -0
- data/vendor/assets/stylesheets/codemirror.css +334 -0
- data/vendor/assets/stylesheets/codemirror/themes/base16-dark.css +38 -0
- data/vendor/assets/stylesheets/codemirror/themes/base16-light.css +38 -0
- data/vendor/assets/stylesheets/codemirror/themes/dracula.css +41 -0
- data/vendor/assets/stylesheets/codemirror/themes/material.css +53 -0
- data/vendor/assets/stylesheets/codemirror/themes/monokai.css +35 -0
- data/vendor/assets/stylesheets/codemirror/themes/solarized.css +163 -0
- data/vendor/assets/stylesheets/codemirror/themes/vibrant-ink.css +34 -0
- data/vendor/assets/stylesheets/intl-tel-input.scss +1054 -0
- data/vendor/assets/stylesheets/summernote-bs3.css +5425 -0
- data/vendor/assets/stylesheets/summernote.css +1 -0
- metadata +604 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
ActiveAdmin.register User do
|
2
|
+
permit_params :name, :email, :password
|
3
|
+
|
4
|
+
filter :name
|
5
|
+
filter :email
|
6
|
+
|
7
|
+
index do
|
8
|
+
selectable_column
|
9
|
+
id_column
|
10
|
+
column :name
|
11
|
+
column :email
|
12
|
+
actions
|
13
|
+
end
|
14
|
+
|
15
|
+
form do |f|
|
16
|
+
inputs "#{t('activerecord.models.user', count: 1)} Details" do
|
17
|
+
input :name
|
18
|
+
input :email
|
19
|
+
input :password if f.object.new_record?
|
20
|
+
end
|
21
|
+
actions
|
22
|
+
end
|
23
|
+
|
24
|
+
show do
|
25
|
+
attributes_table do
|
26
|
+
row :name
|
27
|
+
row :email
|
28
|
+
row :sign_in_count
|
29
|
+
row :current_sign_in_at
|
30
|
+
row :last_sign_in_at
|
31
|
+
row :current_sign_in_ip
|
32
|
+
row :last_sign_in_ip
|
33
|
+
row :created_at
|
34
|
+
row :updated_at
|
35
|
+
end
|
36
|
+
active_admin_comments
|
37
|
+
end
|
38
|
+
|
39
|
+
member_action :become, method: :post do
|
40
|
+
sign_in(resource, bypass: true)
|
41
|
+
redirect_to "/"
|
42
|
+
end
|
43
|
+
|
44
|
+
action_item :become_user, only: :show do
|
45
|
+
# The path `become_admin_user_path` is confusing as
|
46
|
+
# hell because we're not signing in as an admin user.
|
47
|
+
# Here's what's up:
|
48
|
+
# The member action is: `become`
|
49
|
+
# The namespace is: `admin`
|
50
|
+
# The controller is: `user`
|
51
|
+
link_to("Become User", become_admin_user_path(user), method: :post)
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module ActiveAdminPro
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path("../../../..", __FILE__)
|
4
|
+
# Install the active_admin_pro require to active_admin.js.
|
5
|
+
def install_javascript
|
6
|
+
# FIXME: Implement
|
7
|
+
end
|
8
|
+
|
9
|
+
# Install the active_admin_pro require to active_admin.scss.
|
10
|
+
def install_stylesheet
|
11
|
+
# FIXME: Implement
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= "test"
|
3
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
4
|
+
require "capybara/rspec"
|
5
|
+
require "database_cleaner"
|
6
|
+
require "factory_girl_rails"
|
7
|
+
require "rspec/rails"
|
8
|
+
require "rspec/autorun"
|
9
|
+
Rails.backtrace_cleaner.remove_silencers!
|
10
|
+
|
11
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
12
|
+
# in spec/support/ and its subdirectories.
|
13
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f }
|
14
|
+
|
15
|
+
# Checks for pending migrations before tests are run.
|
16
|
+
# If you are not using ActiveRecord, you can remove this line.
|
17
|
+
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
18
|
+
|
19
|
+
RSpec.configure do |config|
|
20
|
+
config.mock_with :rspec
|
21
|
+
config.use_transactional_fixtures = true
|
22
|
+
config.infer_base_class_for_anonymous_controllers = false
|
23
|
+
config.order = "random"
|
24
|
+
config.include FactoryGirl::Syntax::Methods
|
25
|
+
|
26
|
+
config.before(:suite) do
|
27
|
+
begin
|
28
|
+
DatabaseCleaner.start
|
29
|
+
FactoryGirl.lint
|
30
|
+
ensure
|
31
|
+
DatabaseCleaner.clean
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,1243 @@
|
|
1
|
+
/*!
|
2
|
+
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
3
|
+
* Copyright 2011-2015 Twitter, Inc.
|
4
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
5
|
+
*/
|
6
|
+
|
7
|
+
/*!
|
8
|
+
* Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=03e3e4179392b60c42cd)
|
9
|
+
* Config saved to config.json and https://gist.github.com/03e3e4179392b60c42cd
|
10
|
+
*/
|
11
|
+
if (typeof jQuery === 'undefined') {
|
12
|
+
throw new Error('Bootstrap\'s JavaScript requires jQuery')
|
13
|
+
}
|
14
|
+
+function ($) {
|
15
|
+
'use strict';
|
16
|
+
var version = $.fn.jquery.split(' ')[0].split('.')
|
17
|
+
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
|
18
|
+
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
|
19
|
+
}
|
20
|
+
}(jQuery);
|
21
|
+
|
22
|
+
/* ========================================================================
|
23
|
+
* Bootstrap: alert.js v3.3.5
|
24
|
+
* http://getbootstrap.com/javascript/#alerts
|
25
|
+
* ========================================================================
|
26
|
+
* Copyright 2011-2015 Twitter, Inc.
|
27
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
28
|
+
* ======================================================================== */
|
29
|
+
|
30
|
+
|
31
|
+
+function ($) {
|
32
|
+
'use strict';
|
33
|
+
|
34
|
+
// ALERT CLASS DEFINITION
|
35
|
+
// ======================
|
36
|
+
|
37
|
+
var dismiss = '[data-dismiss="alert"]'
|
38
|
+
var Alert = function (el) {
|
39
|
+
$(el).on('click', dismiss, this.close)
|
40
|
+
}
|
41
|
+
|
42
|
+
Alert.VERSION = '3.3.5'
|
43
|
+
|
44
|
+
Alert.TRANSITION_DURATION = 150
|
45
|
+
|
46
|
+
Alert.prototype.close = function (e) {
|
47
|
+
var $this = $(this)
|
48
|
+
var selector = $this.attr('data-target')
|
49
|
+
|
50
|
+
if (!selector) {
|
51
|
+
selector = $this.attr('href')
|
52
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
53
|
+
}
|
54
|
+
|
55
|
+
var $parent = $(selector)
|
56
|
+
|
57
|
+
if (e) e.preventDefault()
|
58
|
+
|
59
|
+
if (!$parent.length) {
|
60
|
+
$parent = $this.closest('.alert')
|
61
|
+
}
|
62
|
+
|
63
|
+
$parent.trigger(e = $.Event('close.bs.alert'))
|
64
|
+
|
65
|
+
if (e.isDefaultPrevented()) return
|
66
|
+
|
67
|
+
$parent.removeClass('in')
|
68
|
+
|
69
|
+
function removeElement() {
|
70
|
+
// detach from parent, fire event then clean up data
|
71
|
+
$parent.detach().trigger('closed.bs.alert').remove()
|
72
|
+
}
|
73
|
+
|
74
|
+
$.support.transition && $parent.hasClass('fade') ?
|
75
|
+
$parent
|
76
|
+
.one('bsTransitionEnd', removeElement)
|
77
|
+
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
|
78
|
+
removeElement()
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
// ALERT PLUGIN DEFINITION
|
83
|
+
// =======================
|
84
|
+
|
85
|
+
function Plugin(option) {
|
86
|
+
return this.each(function () {
|
87
|
+
var $this = $(this)
|
88
|
+
var data = $this.data('bs.alert')
|
89
|
+
|
90
|
+
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
91
|
+
if (typeof option == 'string') data[option].call($this)
|
92
|
+
})
|
93
|
+
}
|
94
|
+
|
95
|
+
var old = $.fn.alert
|
96
|
+
|
97
|
+
$.fn.alert = Plugin
|
98
|
+
$.fn.alert.Constructor = Alert
|
99
|
+
|
100
|
+
|
101
|
+
// ALERT NO CONFLICT
|
102
|
+
// =================
|
103
|
+
|
104
|
+
$.fn.alert.noConflict = function () {
|
105
|
+
$.fn.alert = old
|
106
|
+
return this
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
// ALERT DATA-API
|
111
|
+
// ==============
|
112
|
+
|
113
|
+
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
114
|
+
|
115
|
+
}(jQuery);
|
116
|
+
|
117
|
+
/* ========================================================================
|
118
|
+
* Bootstrap: dropdown.js v3.3.5
|
119
|
+
* http://getbootstrap.com/javascript/#dropdowns
|
120
|
+
* ========================================================================
|
121
|
+
* Copyright 2011-2015 Twitter, Inc.
|
122
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
123
|
+
* ======================================================================== */
|
124
|
+
|
125
|
+
|
126
|
+
+function ($) {
|
127
|
+
'use strict';
|
128
|
+
|
129
|
+
// DROPDOWN CLASS DEFINITION
|
130
|
+
// =========================
|
131
|
+
|
132
|
+
var backdrop = '.dropdown-backdrop'
|
133
|
+
var toggle = '[data-toggle="dropdown"]'
|
134
|
+
var Dropdown = function (element) {
|
135
|
+
$(element).on('click.bs.dropdown', this.toggle)
|
136
|
+
}
|
137
|
+
|
138
|
+
Dropdown.VERSION = '3.3.5'
|
139
|
+
|
140
|
+
function getParent($this) {
|
141
|
+
var selector = $this.attr('data-target')
|
142
|
+
|
143
|
+
if (!selector) {
|
144
|
+
selector = $this.attr('href')
|
145
|
+
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
146
|
+
}
|
147
|
+
|
148
|
+
var $parent = selector && $(selector)
|
149
|
+
|
150
|
+
return $parent && $parent.length ? $parent : $this.parent()
|
151
|
+
}
|
152
|
+
|
153
|
+
function clearMenus(e) {
|
154
|
+
if (e && e.which === 3) return
|
155
|
+
$(backdrop).remove()
|
156
|
+
$(toggle).each(function () {
|
157
|
+
var $this = $(this)
|
158
|
+
var $parent = getParent($this)
|
159
|
+
var relatedTarget = { relatedTarget: this }
|
160
|
+
|
161
|
+
if (!$parent.hasClass('open')) return
|
162
|
+
|
163
|
+
if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
|
164
|
+
|
165
|
+
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
166
|
+
|
167
|
+
if (e.isDefaultPrevented()) return
|
168
|
+
|
169
|
+
$this.attr('aria-expanded', 'false')
|
170
|
+
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
171
|
+
})
|
172
|
+
}
|
173
|
+
|
174
|
+
Dropdown.prototype.toggle = function (e) {
|
175
|
+
var $this = $(this)
|
176
|
+
|
177
|
+
if ($this.is('.disabled, :disabled')) return
|
178
|
+
|
179
|
+
var $parent = getParent($this)
|
180
|
+
var isActive = $parent.hasClass('open')
|
181
|
+
|
182
|
+
clearMenus()
|
183
|
+
|
184
|
+
if (!isActive) {
|
185
|
+
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
186
|
+
// if mobile we use a backdrop because click events don't delegate
|
187
|
+
$(document.createElement('div'))
|
188
|
+
.addClass('dropdown-backdrop')
|
189
|
+
.insertAfter($(this))
|
190
|
+
.on('click', clearMenus)
|
191
|
+
}
|
192
|
+
|
193
|
+
var relatedTarget = { relatedTarget: this }
|
194
|
+
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
195
|
+
|
196
|
+
if (e.isDefaultPrevented()) return
|
197
|
+
|
198
|
+
$this
|
199
|
+
.trigger('focus')
|
200
|
+
.attr('aria-expanded', 'true')
|
201
|
+
|
202
|
+
$parent
|
203
|
+
.toggleClass('open')
|
204
|
+
.trigger('shown.bs.dropdown', relatedTarget)
|
205
|
+
}
|
206
|
+
|
207
|
+
return false
|
208
|
+
}
|
209
|
+
|
210
|
+
Dropdown.prototype.keydown = function (e) {
|
211
|
+
if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
|
212
|
+
|
213
|
+
var $this = $(this)
|
214
|
+
|
215
|
+
e.preventDefault()
|
216
|
+
e.stopPropagation()
|
217
|
+
|
218
|
+
if ($this.is('.disabled, :disabled')) return
|
219
|
+
|
220
|
+
var $parent = getParent($this)
|
221
|
+
var isActive = $parent.hasClass('open')
|
222
|
+
|
223
|
+
if (!isActive && e.which != 27 || isActive && e.which == 27) {
|
224
|
+
if (e.which == 27) $parent.find(toggle).trigger('focus')
|
225
|
+
return $this.trigger('click')
|
226
|
+
}
|
227
|
+
|
228
|
+
var desc = ' li:not(.disabled):visible a'
|
229
|
+
var $items = $parent.find('.dropdown-menu' + desc)
|
230
|
+
|
231
|
+
if (!$items.length) return
|
232
|
+
|
233
|
+
var index = $items.index(e.target)
|
234
|
+
|
235
|
+
if (e.which == 38 && index > 0) index-- // up
|
236
|
+
if (e.which == 40 && index < $items.length - 1) index++ // down
|
237
|
+
if (!~index) index = 0
|
238
|
+
|
239
|
+
$items.eq(index).trigger('focus')
|
240
|
+
}
|
241
|
+
|
242
|
+
|
243
|
+
// DROPDOWN PLUGIN DEFINITION
|
244
|
+
// ==========================
|
245
|
+
|
246
|
+
function Plugin(option) {
|
247
|
+
return this.each(function () {
|
248
|
+
var $this = $(this)
|
249
|
+
var data = $this.data('bs.dropdown')
|
250
|
+
|
251
|
+
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
252
|
+
if (typeof option == 'string') data[option].call($this)
|
253
|
+
})
|
254
|
+
}
|
255
|
+
|
256
|
+
var old = $.fn.dropdown
|
257
|
+
|
258
|
+
$.fn.dropdown = Plugin
|
259
|
+
$.fn.dropdown.Constructor = Dropdown
|
260
|
+
|
261
|
+
|
262
|
+
// DROPDOWN NO CONFLICT
|
263
|
+
// ====================
|
264
|
+
|
265
|
+
$.fn.dropdown.noConflict = function () {
|
266
|
+
$.fn.dropdown = old
|
267
|
+
return this
|
268
|
+
}
|
269
|
+
|
270
|
+
|
271
|
+
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
272
|
+
// ===================================
|
273
|
+
|
274
|
+
$(document)
|
275
|
+
.on('click.bs.dropdown.data-api', clearMenus)
|
276
|
+
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
277
|
+
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
278
|
+
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
|
279
|
+
.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
|
280
|
+
|
281
|
+
}(jQuery);
|
282
|
+
|
283
|
+
/* ========================================================================
|
284
|
+
* Bootstrap: modal.js v3.3.5
|
285
|
+
* http://getbootstrap.com/javascript/#modals
|
286
|
+
* ========================================================================
|
287
|
+
* Copyright 2011-2015 Twitter, Inc.
|
288
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
289
|
+
* ======================================================================== */
|
290
|
+
|
291
|
+
|
292
|
+
+function ($) {
|
293
|
+
'use strict';
|
294
|
+
|
295
|
+
// MODAL CLASS DEFINITION
|
296
|
+
// ======================
|
297
|
+
|
298
|
+
var Modal = function (element, options) {
|
299
|
+
this.options = options
|
300
|
+
this.$body = $(document.body)
|
301
|
+
this.$element = $(element)
|
302
|
+
this.$dialog = this.$element.find('.modal-dialog')
|
303
|
+
this.$backdrop = null
|
304
|
+
this.isShown = null
|
305
|
+
this.originalBodyPad = null
|
306
|
+
this.scrollbarWidth = 0
|
307
|
+
this.ignoreBackdropClick = false
|
308
|
+
|
309
|
+
if (this.options.remote) {
|
310
|
+
this.$element
|
311
|
+
.find('.modal-content')
|
312
|
+
.load(this.options.remote, $.proxy(function () {
|
313
|
+
this.$element.trigger('loaded.bs.modal')
|
314
|
+
}, this))
|
315
|
+
}
|
316
|
+
}
|
317
|
+
|
318
|
+
Modal.VERSION = '3.3.5'
|
319
|
+
|
320
|
+
Modal.TRANSITION_DURATION = 300
|
321
|
+
Modal.BACKDROP_TRANSITION_DURATION = 150
|
322
|
+
|
323
|
+
Modal.DEFAULTS = {
|
324
|
+
backdrop: true,
|
325
|
+
keyboard: true,
|
326
|
+
show: true
|
327
|
+
}
|
328
|
+
|
329
|
+
Modal.prototype.toggle = function (_relatedTarget) {
|
330
|
+
return this.isShown ? this.hide() : this.show(_relatedTarget)
|
331
|
+
}
|
332
|
+
|
333
|
+
Modal.prototype.show = function (_relatedTarget) {
|
334
|
+
var that = this
|
335
|
+
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
336
|
+
|
337
|
+
this.$element.trigger(e)
|
338
|
+
|
339
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
340
|
+
|
341
|
+
this.isShown = true
|
342
|
+
|
343
|
+
this.checkScrollbar()
|
344
|
+
this.setScrollbar()
|
345
|
+
this.$body.addClass('modal-open')
|
346
|
+
|
347
|
+
this.escape()
|
348
|
+
this.resize()
|
349
|
+
|
350
|
+
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
351
|
+
|
352
|
+
this.$dialog.on('mousedown.dismiss.bs.modal', function () {
|
353
|
+
that.$element.one('mouseup.dismiss.bs.modal', function (e) {
|
354
|
+
if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
|
355
|
+
})
|
356
|
+
})
|
357
|
+
|
358
|
+
this.backdrop(function () {
|
359
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
360
|
+
|
361
|
+
if (!that.$element.parent().length) {
|
362
|
+
that.$element.appendTo(that.$body) // don't move modals dom position
|
363
|
+
}
|
364
|
+
|
365
|
+
that.$element
|
366
|
+
.show()
|
367
|
+
.scrollTop(0)
|
368
|
+
|
369
|
+
that.adjustDialog()
|
370
|
+
|
371
|
+
if (transition) {
|
372
|
+
that.$element[0].offsetWidth // force reflow
|
373
|
+
}
|
374
|
+
|
375
|
+
that.$element.addClass('in')
|
376
|
+
|
377
|
+
that.enforceFocus()
|
378
|
+
|
379
|
+
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
380
|
+
|
381
|
+
transition ?
|
382
|
+
that.$dialog // wait for modal to slide in
|
383
|
+
.one('bsTransitionEnd', function () {
|
384
|
+
that.$element.trigger('focus').trigger(e)
|
385
|
+
})
|
386
|
+
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
387
|
+
that.$element.trigger('focus').trigger(e)
|
388
|
+
})
|
389
|
+
}
|
390
|
+
|
391
|
+
Modal.prototype.hide = function (e) {
|
392
|
+
if (e) e.preventDefault()
|
393
|
+
|
394
|
+
e = $.Event('hide.bs.modal')
|
395
|
+
|
396
|
+
this.$element.trigger(e)
|
397
|
+
|
398
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
399
|
+
|
400
|
+
this.isShown = false
|
401
|
+
|
402
|
+
this.escape()
|
403
|
+
this.resize()
|
404
|
+
|
405
|
+
$(document).off('focusin.bs.modal')
|
406
|
+
|
407
|
+
this.$element
|
408
|
+
.removeClass('in')
|
409
|
+
.off('click.dismiss.bs.modal')
|
410
|
+
.off('mouseup.dismiss.bs.modal')
|
411
|
+
|
412
|
+
this.$dialog.off('mousedown.dismiss.bs.modal')
|
413
|
+
|
414
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
415
|
+
this.$element
|
416
|
+
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
|
417
|
+
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
418
|
+
this.hideModal()
|
419
|
+
}
|
420
|
+
|
421
|
+
Modal.prototype.enforceFocus = function () {
|
422
|
+
$(document)
|
423
|
+
.off('focusin.bs.modal') // guard against infinite focus loop
|
424
|
+
.on('focusin.bs.modal', $.proxy(function (e) {
|
425
|
+
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
426
|
+
this.$element.trigger('focus')
|
427
|
+
}
|
428
|
+
}, this))
|
429
|
+
}
|
430
|
+
|
431
|
+
Modal.prototype.escape = function () {
|
432
|
+
if (this.isShown && this.options.keyboard) {
|
433
|
+
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
|
434
|
+
e.which == 27 && this.hide()
|
435
|
+
}, this))
|
436
|
+
} else if (!this.isShown) {
|
437
|
+
this.$element.off('keydown.dismiss.bs.modal')
|
438
|
+
}
|
439
|
+
}
|
440
|
+
|
441
|
+
Modal.prototype.resize = function () {
|
442
|
+
if (this.isShown) {
|
443
|
+
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
|
444
|
+
} else {
|
445
|
+
$(window).off('resize.bs.modal')
|
446
|
+
}
|
447
|
+
}
|
448
|
+
|
449
|
+
Modal.prototype.hideModal = function () {
|
450
|
+
var that = this
|
451
|
+
this.$element.hide()
|
452
|
+
this.backdrop(function () {
|
453
|
+
that.$body.removeClass('modal-open')
|
454
|
+
that.resetAdjustments()
|
455
|
+
that.resetScrollbar()
|
456
|
+
that.$element.trigger('hidden.bs.modal')
|
457
|
+
})
|
458
|
+
}
|
459
|
+
|
460
|
+
Modal.prototype.removeBackdrop = function () {
|
461
|
+
this.$backdrop && this.$backdrop.remove()
|
462
|
+
this.$backdrop = null
|
463
|
+
}
|
464
|
+
|
465
|
+
Modal.prototype.backdrop = function (callback) {
|
466
|
+
var that = this
|
467
|
+
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
468
|
+
|
469
|
+
if (this.isShown && this.options.backdrop) {
|
470
|
+
var doAnimate = $.support.transition && animate
|
471
|
+
|
472
|
+
this.$backdrop = $(document.createElement('div'))
|
473
|
+
.addClass('modal-backdrop ' + animate)
|
474
|
+
.appendTo(this.$body)
|
475
|
+
|
476
|
+
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
477
|
+
if (this.ignoreBackdropClick) {
|
478
|
+
this.ignoreBackdropClick = false
|
479
|
+
return
|
480
|
+
}
|
481
|
+
if (e.target !== e.currentTarget) return
|
482
|
+
this.options.backdrop == 'static'
|
483
|
+
? this.$element[0].focus()
|
484
|
+
: this.hide()
|
485
|
+
}, this))
|
486
|
+
|
487
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
488
|
+
|
489
|
+
this.$backdrop.addClass('in')
|
490
|
+
|
491
|
+
if (!callback) return
|
492
|
+
|
493
|
+
doAnimate ?
|
494
|
+
this.$backdrop
|
495
|
+
.one('bsTransitionEnd', callback)
|
496
|
+
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
497
|
+
callback()
|
498
|
+
|
499
|
+
} else if (!this.isShown && this.$backdrop) {
|
500
|
+
this.$backdrop.removeClass('in')
|
501
|
+
|
502
|
+
var callbackRemove = function () {
|
503
|
+
that.removeBackdrop()
|
504
|
+
callback && callback()
|
505
|
+
}
|
506
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
507
|
+
this.$backdrop
|
508
|
+
.one('bsTransitionEnd', callbackRemove)
|
509
|
+
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
510
|
+
callbackRemove()
|
511
|
+
|
512
|
+
} else if (callback) {
|
513
|
+
callback()
|
514
|
+
}
|
515
|
+
}
|
516
|
+
|
517
|
+
// these following methods are used to handle overflowing modals
|
518
|
+
|
519
|
+
Modal.prototype.handleUpdate = function () {
|
520
|
+
this.adjustDialog()
|
521
|
+
}
|
522
|
+
|
523
|
+
Modal.prototype.adjustDialog = function () {
|
524
|
+
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
|
525
|
+
|
526
|
+
this.$element.css({
|
527
|
+
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
528
|
+
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
|
529
|
+
})
|
530
|
+
}
|
531
|
+
|
532
|
+
Modal.prototype.resetAdjustments = function () {
|
533
|
+
this.$element.css({
|
534
|
+
paddingLeft: '',
|
535
|
+
paddingRight: ''
|
536
|
+
})
|
537
|
+
}
|
538
|
+
|
539
|
+
Modal.prototype.checkScrollbar = function () {
|
540
|
+
var fullWindowWidth = window.innerWidth
|
541
|
+
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
|
542
|
+
var documentElementRect = document.documentElement.getBoundingClientRect()
|
543
|
+
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
|
544
|
+
}
|
545
|
+
this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
|
546
|
+
this.scrollbarWidth = this.measureScrollbar()
|
547
|
+
}
|
548
|
+
|
549
|
+
Modal.prototype.setScrollbar = function () {
|
550
|
+
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
551
|
+
this.originalBodyPad = document.body.style.paddingRight || ''
|
552
|
+
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
|
553
|
+
}
|
554
|
+
|
555
|
+
Modal.prototype.resetScrollbar = function () {
|
556
|
+
this.$body.css('padding-right', this.originalBodyPad)
|
557
|
+
}
|
558
|
+
|
559
|
+
Modal.prototype.measureScrollbar = function () { // thx walsh
|
560
|
+
var scrollDiv = document.createElement('div')
|
561
|
+
scrollDiv.className = 'modal-scrollbar-measure'
|
562
|
+
this.$body.append(scrollDiv)
|
563
|
+
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
|
564
|
+
this.$body[0].removeChild(scrollDiv)
|
565
|
+
return scrollbarWidth
|
566
|
+
}
|
567
|
+
|
568
|
+
|
569
|
+
// MODAL PLUGIN DEFINITION
|
570
|
+
// =======================
|
571
|
+
|
572
|
+
function Plugin(option, _relatedTarget) {
|
573
|
+
return this.each(function () {
|
574
|
+
var $this = $(this)
|
575
|
+
var data = $this.data('bs.modal')
|
576
|
+
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
577
|
+
|
578
|
+
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
579
|
+
if (typeof option == 'string') data[option](_relatedTarget)
|
580
|
+
else if (options.show) data.show(_relatedTarget)
|
581
|
+
})
|
582
|
+
}
|
583
|
+
|
584
|
+
var old = $.fn.modal
|
585
|
+
|
586
|
+
$.fn.modal = Plugin
|
587
|
+
$.fn.modal.Constructor = Modal
|
588
|
+
|
589
|
+
|
590
|
+
// MODAL NO CONFLICT
|
591
|
+
// =================
|
592
|
+
|
593
|
+
$.fn.modal.noConflict = function () {
|
594
|
+
$.fn.modal = old
|
595
|
+
return this
|
596
|
+
}
|
597
|
+
|
598
|
+
|
599
|
+
// MODAL DATA-API
|
600
|
+
// ==============
|
601
|
+
|
602
|
+
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
603
|
+
var $this = $(this)
|
604
|
+
var href = $this.attr('href')
|
605
|
+
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
|
606
|
+
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
607
|
+
|
608
|
+
if ($this.is('a')) e.preventDefault()
|
609
|
+
|
610
|
+
$target.one('show.bs.modal', function (showEvent) {
|
611
|
+
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
|
612
|
+
$target.one('hidden.bs.modal', function () {
|
613
|
+
$this.is(':visible') && $this.trigger('focus')
|
614
|
+
})
|
615
|
+
})
|
616
|
+
Plugin.call($target, option, this)
|
617
|
+
})
|
618
|
+
|
619
|
+
}(jQuery);
|
620
|
+
|
621
|
+
/* ========================================================================
|
622
|
+
* Bootstrap: tooltip.js v3.3.5
|
623
|
+
* http://getbootstrap.com/javascript/#tooltip
|
624
|
+
* Inspired by the original jQuery.tipsy by Jason Frame
|
625
|
+
* ========================================================================
|
626
|
+
* Copyright 2011-2015 Twitter, Inc.
|
627
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
628
|
+
* ======================================================================== */
|
629
|
+
|
630
|
+
|
631
|
+
+function ($) {
|
632
|
+
'use strict';
|
633
|
+
|
634
|
+
// TOOLTIP PUBLIC CLASS DEFINITION
|
635
|
+
// ===============================
|
636
|
+
|
637
|
+
var Tooltip = function (element, options) {
|
638
|
+
this.type = null
|
639
|
+
this.options = null
|
640
|
+
this.enabled = null
|
641
|
+
this.timeout = null
|
642
|
+
this.hoverState = null
|
643
|
+
this.$element = null
|
644
|
+
this.inState = null
|
645
|
+
|
646
|
+
this.init('tooltip', element, options)
|
647
|
+
}
|
648
|
+
|
649
|
+
Tooltip.VERSION = '3.3.5'
|
650
|
+
|
651
|
+
Tooltip.TRANSITION_DURATION = 150
|
652
|
+
|
653
|
+
Tooltip.DEFAULTS = {
|
654
|
+
animation: true,
|
655
|
+
placement: 'top',
|
656
|
+
selector: false,
|
657
|
+
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
658
|
+
trigger: 'hover focus',
|
659
|
+
title: '',
|
660
|
+
delay: 0,
|
661
|
+
html: false,
|
662
|
+
container: false,
|
663
|
+
viewport: {
|
664
|
+
selector: 'body',
|
665
|
+
padding: 0
|
666
|
+
}
|
667
|
+
}
|
668
|
+
|
669
|
+
Tooltip.prototype.init = function (type, element, options) {
|
670
|
+
this.enabled = true
|
671
|
+
this.type = type
|
672
|
+
this.$element = $(element)
|
673
|
+
this.options = this.getOptions(options)
|
674
|
+
this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
|
675
|
+
this.inState = { click: false, hover: false, focus: false }
|
676
|
+
|
677
|
+
if (this.$element[0] instanceof document.constructor && !this.options.selector) {
|
678
|
+
throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
|
679
|
+
}
|
680
|
+
|
681
|
+
var triggers = this.options.trigger.split(' ')
|
682
|
+
|
683
|
+
for (var i = triggers.length; i--;) {
|
684
|
+
var trigger = triggers[i]
|
685
|
+
|
686
|
+
if (trigger == 'click') {
|
687
|
+
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
688
|
+
} else if (trigger != 'manual') {
|
689
|
+
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
690
|
+
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
691
|
+
|
692
|
+
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
693
|
+
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
694
|
+
}
|
695
|
+
}
|
696
|
+
|
697
|
+
this.options.selector ?
|
698
|
+
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
699
|
+
this.fixTitle()
|
700
|
+
}
|
701
|
+
|
702
|
+
Tooltip.prototype.getDefaults = function () {
|
703
|
+
return Tooltip.DEFAULTS
|
704
|
+
}
|
705
|
+
|
706
|
+
Tooltip.prototype.getOptions = function (options) {
|
707
|
+
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
708
|
+
|
709
|
+
if (options.delay && typeof options.delay == 'number') {
|
710
|
+
options.delay = {
|
711
|
+
show: options.delay,
|
712
|
+
hide: options.delay
|
713
|
+
}
|
714
|
+
}
|
715
|
+
|
716
|
+
return options
|
717
|
+
}
|
718
|
+
|
719
|
+
Tooltip.prototype.getDelegateOptions = function () {
|
720
|
+
var options = {}
|
721
|
+
var defaults = this.getDefaults()
|
722
|
+
|
723
|
+
this._options && $.each(this._options, function (key, value) {
|
724
|
+
if (defaults[key] != value) options[key] = value
|
725
|
+
})
|
726
|
+
|
727
|
+
return options
|
728
|
+
}
|
729
|
+
|
730
|
+
Tooltip.prototype.enter = function (obj) {
|
731
|
+
var self = obj instanceof this.constructor ?
|
732
|
+
obj : $(obj.currentTarget).data('bs.' + this.type)
|
733
|
+
|
734
|
+
if (!self) {
|
735
|
+
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
736
|
+
$(obj.currentTarget).data('bs.' + this.type, self)
|
737
|
+
}
|
738
|
+
|
739
|
+
if (obj instanceof $.Event) {
|
740
|
+
self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
|
741
|
+
}
|
742
|
+
|
743
|
+
if (self.tip().hasClass('in') || self.hoverState == 'in') {
|
744
|
+
self.hoverState = 'in'
|
745
|
+
return
|
746
|
+
}
|
747
|
+
|
748
|
+
clearTimeout(self.timeout)
|
749
|
+
|
750
|
+
self.hoverState = 'in'
|
751
|
+
|
752
|
+
if (!self.options.delay || !self.options.delay.show) return self.show()
|
753
|
+
|
754
|
+
self.timeout = setTimeout(function () {
|
755
|
+
if (self.hoverState == 'in') self.show()
|
756
|
+
}, self.options.delay.show)
|
757
|
+
}
|
758
|
+
|
759
|
+
Tooltip.prototype.isInStateTrue = function () {
|
760
|
+
for (var key in this.inState) {
|
761
|
+
if (this.inState[key]) return true
|
762
|
+
}
|
763
|
+
|
764
|
+
return false
|
765
|
+
}
|
766
|
+
|
767
|
+
Tooltip.prototype.leave = function (obj) {
|
768
|
+
var self = obj instanceof this.constructor ?
|
769
|
+
obj : $(obj.currentTarget).data('bs.' + this.type)
|
770
|
+
|
771
|
+
if (!self) {
|
772
|
+
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
773
|
+
$(obj.currentTarget).data('bs.' + this.type, self)
|
774
|
+
}
|
775
|
+
|
776
|
+
if (obj instanceof $.Event) {
|
777
|
+
self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
|
778
|
+
}
|
779
|
+
|
780
|
+
if (self.isInStateTrue()) return
|
781
|
+
|
782
|
+
clearTimeout(self.timeout)
|
783
|
+
|
784
|
+
self.hoverState = 'out'
|
785
|
+
|
786
|
+
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
787
|
+
|
788
|
+
self.timeout = setTimeout(function () {
|
789
|
+
if (self.hoverState == 'out') self.hide()
|
790
|
+
}, self.options.delay.hide)
|
791
|
+
}
|
792
|
+
|
793
|
+
Tooltip.prototype.show = function () {
|
794
|
+
var e = $.Event('show.bs.' + this.type)
|
795
|
+
|
796
|
+
if (this.hasContent() && this.enabled) {
|
797
|
+
this.$element.trigger(e)
|
798
|
+
|
799
|
+
var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
|
800
|
+
if (e.isDefaultPrevented() || !inDom) return
|
801
|
+
var that = this
|
802
|
+
|
803
|
+
var $tip = this.tip()
|
804
|
+
|
805
|
+
var tipId = this.getUID(this.type)
|
806
|
+
|
807
|
+
this.setContent()
|
808
|
+
$tip.attr('id', tipId)
|
809
|
+
this.$element.attr('aria-describedby', tipId)
|
810
|
+
|
811
|
+
if (this.options.animation) $tip.addClass('fade')
|
812
|
+
|
813
|
+
var placement = typeof this.options.placement == 'function' ?
|
814
|
+
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
815
|
+
this.options.placement
|
816
|
+
|
817
|
+
var autoToken = /\s?auto?\s?/i
|
818
|
+
var autoPlace = autoToken.test(placement)
|
819
|
+
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
820
|
+
|
821
|
+
$tip
|
822
|
+
.detach()
|
823
|
+
.css({ top: 0, left: 0, display: 'block' })
|
824
|
+
.addClass(placement)
|
825
|
+
.data('bs.' + this.type, this)
|
826
|
+
|
827
|
+
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
828
|
+
this.$element.trigger('inserted.bs.' + this.type)
|
829
|
+
|
830
|
+
var pos = this.getPosition()
|
831
|
+
var actualWidth = $tip[0].offsetWidth
|
832
|
+
var actualHeight = $tip[0].offsetHeight
|
833
|
+
|
834
|
+
if (autoPlace) {
|
835
|
+
var orgPlacement = placement
|
836
|
+
var viewportDim = this.getPosition(this.$viewport)
|
837
|
+
|
838
|
+
placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
|
839
|
+
placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
|
840
|
+
placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
|
841
|
+
placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
|
842
|
+
placement
|
843
|
+
|
844
|
+
$tip
|
845
|
+
.removeClass(orgPlacement)
|
846
|
+
.addClass(placement)
|
847
|
+
}
|
848
|
+
|
849
|
+
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
850
|
+
|
851
|
+
this.applyPlacement(calculatedOffset, placement)
|
852
|
+
|
853
|
+
var complete = function () {
|
854
|
+
var prevHoverState = that.hoverState
|
855
|
+
that.$element.trigger('shown.bs.' + that.type)
|
856
|
+
that.hoverState = null
|
857
|
+
|
858
|
+
if (prevHoverState == 'out') that.leave(that)
|
859
|
+
}
|
860
|
+
|
861
|
+
$.support.transition && this.$tip.hasClass('fade') ?
|
862
|
+
$tip
|
863
|
+
.one('bsTransitionEnd', complete)
|
864
|
+
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
865
|
+
complete()
|
866
|
+
}
|
867
|
+
}
|
868
|
+
|
869
|
+
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
870
|
+
var $tip = this.tip()
|
871
|
+
var width = $tip[0].offsetWidth
|
872
|
+
var height = $tip[0].offsetHeight
|
873
|
+
|
874
|
+
// manually read margins because getBoundingClientRect includes difference
|
875
|
+
var marginTop = parseInt($tip.css('margin-top'), 10)
|
876
|
+
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
877
|
+
|
878
|
+
// we must check for NaN for ie 8/9
|
879
|
+
if (isNaN(marginTop)) marginTop = 0
|
880
|
+
if (isNaN(marginLeft)) marginLeft = 0
|
881
|
+
|
882
|
+
offset.top += marginTop
|
883
|
+
offset.left += marginLeft
|
884
|
+
|
885
|
+
// $.fn.offset doesn't round pixel values
|
886
|
+
// so we use setOffset directly with our own function B-0
|
887
|
+
$.offset.setOffset($tip[0], $.extend({
|
888
|
+
using: function (props) {
|
889
|
+
$tip.css({
|
890
|
+
top: Math.round(props.top),
|
891
|
+
left: Math.round(props.left)
|
892
|
+
})
|
893
|
+
}
|
894
|
+
}, offset), 0)
|
895
|
+
|
896
|
+
$tip.addClass('in')
|
897
|
+
|
898
|
+
// check to see if placing tip in new offset caused the tip to resize itself
|
899
|
+
var actualWidth = $tip[0].offsetWidth
|
900
|
+
var actualHeight = $tip[0].offsetHeight
|
901
|
+
|
902
|
+
if (placement == 'top' && actualHeight != height) {
|
903
|
+
offset.top = offset.top + height - actualHeight
|
904
|
+
}
|
905
|
+
|
906
|
+
var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
|
907
|
+
|
908
|
+
if (delta.left) offset.left += delta.left
|
909
|
+
else offset.top += delta.top
|
910
|
+
|
911
|
+
var isVertical = /top|bottom/.test(placement)
|
912
|
+
var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
|
913
|
+
var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
|
914
|
+
|
915
|
+
$tip.offset(offset)
|
916
|
+
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
|
917
|
+
}
|
918
|
+
|
919
|
+
Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
|
920
|
+
this.arrow()
|
921
|
+
.css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
|
922
|
+
.css(isVertical ? 'top' : 'left', '')
|
923
|
+
}
|
924
|
+
|
925
|
+
Tooltip.prototype.setContent = function () {
|
926
|
+
var $tip = this.tip()
|
927
|
+
var title = this.getTitle()
|
928
|
+
|
929
|
+
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
930
|
+
$tip.removeClass('fade in top bottom left right')
|
931
|
+
}
|
932
|
+
|
933
|
+
Tooltip.prototype.hide = function (callback) {
|
934
|
+
var that = this
|
935
|
+
var $tip = $(this.$tip)
|
936
|
+
var e = $.Event('hide.bs.' + this.type)
|
937
|
+
|
938
|
+
function complete() {
|
939
|
+
if (that.hoverState != 'in') $tip.detach()
|
940
|
+
that.$element
|
941
|
+
.removeAttr('aria-describedby')
|
942
|
+
.trigger('hidden.bs.' + that.type)
|
943
|
+
callback && callback()
|
944
|
+
}
|
945
|
+
|
946
|
+
this.$element.trigger(e)
|
947
|
+
|
948
|
+
if (e.isDefaultPrevented()) return
|
949
|
+
|
950
|
+
$tip.removeClass('in')
|
951
|
+
|
952
|
+
$.support.transition && $tip.hasClass('fade') ?
|
953
|
+
$tip
|
954
|
+
.one('bsTransitionEnd', complete)
|
955
|
+
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
956
|
+
complete()
|
957
|
+
|
958
|
+
this.hoverState = null
|
959
|
+
|
960
|
+
return this
|
961
|
+
}
|
962
|
+
|
963
|
+
Tooltip.prototype.fixTitle = function () {
|
964
|
+
var $e = this.$element
|
965
|
+
if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
|
966
|
+
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
967
|
+
}
|
968
|
+
}
|
969
|
+
|
970
|
+
Tooltip.prototype.hasContent = function () {
|
971
|
+
return this.getTitle()
|
972
|
+
}
|
973
|
+
|
974
|
+
Tooltip.prototype.getPosition = function ($element) {
|
975
|
+
$element = $element || this.$element
|
976
|
+
|
977
|
+
var el = $element[0]
|
978
|
+
var isBody = el.tagName == 'BODY'
|
979
|
+
|
980
|
+
var elRect = el.getBoundingClientRect()
|
981
|
+
if (elRect.width == null) {
|
982
|
+
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
|
983
|
+
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
|
984
|
+
}
|
985
|
+
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
|
986
|
+
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
987
|
+
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
988
|
+
|
989
|
+
return $.extend({}, elRect, scroll, outerDims, elOffset)
|
990
|
+
}
|
991
|
+
|
992
|
+
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
993
|
+
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
994
|
+
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
995
|
+
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
996
|
+
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
997
|
+
|
998
|
+
}
|
999
|
+
|
1000
|
+
Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
|
1001
|
+
var delta = { top: 0, left: 0 }
|
1002
|
+
if (!this.$viewport) return delta
|
1003
|
+
|
1004
|
+
var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
|
1005
|
+
var viewportDimensions = this.getPosition(this.$viewport)
|
1006
|
+
|
1007
|
+
if (/right|left/.test(placement)) {
|
1008
|
+
var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
|
1009
|
+
var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
|
1010
|
+
if (topEdgeOffset < viewportDimensions.top) { // top overflow
|
1011
|
+
delta.top = viewportDimensions.top - topEdgeOffset
|
1012
|
+
} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
|
1013
|
+
delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
|
1014
|
+
}
|
1015
|
+
} else {
|
1016
|
+
var leftEdgeOffset = pos.left - viewportPadding
|
1017
|
+
var rightEdgeOffset = pos.left + viewportPadding + actualWidth
|
1018
|
+
if (leftEdgeOffset < viewportDimensions.left) { // left overflow
|
1019
|
+
delta.left = viewportDimensions.left - leftEdgeOffset
|
1020
|
+
} else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
|
1021
|
+
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
|
1022
|
+
}
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
return delta
|
1026
|
+
}
|
1027
|
+
|
1028
|
+
Tooltip.prototype.getTitle = function () {
|
1029
|
+
var title
|
1030
|
+
var $e = this.$element
|
1031
|
+
var o = this.options
|
1032
|
+
|
1033
|
+
title = $e.attr('data-original-title')
|
1034
|
+
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
1035
|
+
|
1036
|
+
return title
|
1037
|
+
}
|
1038
|
+
|
1039
|
+
Tooltip.prototype.getUID = function (prefix) {
|
1040
|
+
do prefix += ~~(Math.random() * 1000000)
|
1041
|
+
while (document.getElementById(prefix))
|
1042
|
+
return prefix
|
1043
|
+
}
|
1044
|
+
|
1045
|
+
Tooltip.prototype.tip = function () {
|
1046
|
+
if (!this.$tip) {
|
1047
|
+
this.$tip = $(this.options.template)
|
1048
|
+
if (this.$tip.length != 1) {
|
1049
|
+
throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
|
1050
|
+
}
|
1051
|
+
}
|
1052
|
+
return this.$tip
|
1053
|
+
}
|
1054
|
+
|
1055
|
+
Tooltip.prototype.arrow = function () {
|
1056
|
+
return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
Tooltip.prototype.enable = function () {
|
1060
|
+
this.enabled = true
|
1061
|
+
}
|
1062
|
+
|
1063
|
+
Tooltip.prototype.disable = function () {
|
1064
|
+
this.enabled = false
|
1065
|
+
}
|
1066
|
+
|
1067
|
+
Tooltip.prototype.toggleEnabled = function () {
|
1068
|
+
this.enabled = !this.enabled
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
Tooltip.prototype.toggle = function (e) {
|
1072
|
+
var self = this
|
1073
|
+
if (e) {
|
1074
|
+
self = $(e.currentTarget).data('bs.' + this.type)
|
1075
|
+
if (!self) {
|
1076
|
+
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
|
1077
|
+
$(e.currentTarget).data('bs.' + this.type, self)
|
1078
|
+
}
|
1079
|
+
}
|
1080
|
+
|
1081
|
+
if (e) {
|
1082
|
+
self.inState.click = !self.inState.click
|
1083
|
+
if (self.isInStateTrue()) self.enter(self)
|
1084
|
+
else self.leave(self)
|
1085
|
+
} else {
|
1086
|
+
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
1087
|
+
}
|
1088
|
+
}
|
1089
|
+
|
1090
|
+
Tooltip.prototype.destroy = function () {
|
1091
|
+
var that = this
|
1092
|
+
clearTimeout(this.timeout)
|
1093
|
+
this.hide(function () {
|
1094
|
+
that.$element.off('.' + that.type).removeData('bs.' + that.type)
|
1095
|
+
if (that.$tip) {
|
1096
|
+
that.$tip.detach()
|
1097
|
+
}
|
1098
|
+
that.$tip = null
|
1099
|
+
that.$arrow = null
|
1100
|
+
that.$viewport = null
|
1101
|
+
})
|
1102
|
+
}
|
1103
|
+
|
1104
|
+
|
1105
|
+
// TOOLTIP PLUGIN DEFINITION
|
1106
|
+
// =========================
|
1107
|
+
|
1108
|
+
function Plugin(option) {
|
1109
|
+
return this.each(function () {
|
1110
|
+
var $this = $(this)
|
1111
|
+
var data = $this.data('bs.tooltip')
|
1112
|
+
var options = typeof option == 'object' && option
|
1113
|
+
|
1114
|
+
if (!data && /destroy|hide/.test(option)) return
|
1115
|
+
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
1116
|
+
if (typeof option == 'string') data[option]()
|
1117
|
+
})
|
1118
|
+
}
|
1119
|
+
|
1120
|
+
var old = $.fn.tooltip
|
1121
|
+
|
1122
|
+
$.fn.tooltip = Plugin
|
1123
|
+
$.fn.tooltip.Constructor = Tooltip
|
1124
|
+
|
1125
|
+
|
1126
|
+
// TOOLTIP NO CONFLICT
|
1127
|
+
// ===================
|
1128
|
+
|
1129
|
+
$.fn.tooltip.noConflict = function () {
|
1130
|
+
$.fn.tooltip = old
|
1131
|
+
return this
|
1132
|
+
}
|
1133
|
+
|
1134
|
+
}(jQuery);
|
1135
|
+
|
1136
|
+
/* ========================================================================
|
1137
|
+
* Bootstrap: popover.js v3.3.5
|
1138
|
+
* http://getbootstrap.com/javascript/#popovers
|
1139
|
+
* ========================================================================
|
1140
|
+
* Copyright 2011-2015 Twitter, Inc.
|
1141
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1142
|
+
* ======================================================================== */
|
1143
|
+
|
1144
|
+
|
1145
|
+
+function ($) {
|
1146
|
+
'use strict';
|
1147
|
+
|
1148
|
+
// POPOVER PUBLIC CLASS DEFINITION
|
1149
|
+
// ===============================
|
1150
|
+
|
1151
|
+
var Popover = function (element, options) {
|
1152
|
+
this.init('popover', element, options)
|
1153
|
+
}
|
1154
|
+
|
1155
|
+
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
1156
|
+
|
1157
|
+
Popover.VERSION = '3.3.5'
|
1158
|
+
|
1159
|
+
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
1160
|
+
placement: 'right',
|
1161
|
+
trigger: 'click',
|
1162
|
+
content: '',
|
1163
|
+
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
1164
|
+
})
|
1165
|
+
|
1166
|
+
|
1167
|
+
// NOTE: POPOVER EXTENDS tooltip.js
|
1168
|
+
// ================================
|
1169
|
+
|
1170
|
+
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
1171
|
+
|
1172
|
+
Popover.prototype.constructor = Popover
|
1173
|
+
|
1174
|
+
Popover.prototype.getDefaults = function () {
|
1175
|
+
return Popover.DEFAULTS
|
1176
|
+
}
|
1177
|
+
|
1178
|
+
Popover.prototype.setContent = function () {
|
1179
|
+
var $tip = this.tip()
|
1180
|
+
var title = this.getTitle()
|
1181
|
+
var content = this.getContent()
|
1182
|
+
|
1183
|
+
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
1184
|
+
$tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
|
1185
|
+
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
1186
|
+
](content)
|
1187
|
+
|
1188
|
+
$tip.removeClass('fade top bottom left right in')
|
1189
|
+
|
1190
|
+
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
1191
|
+
// this manually by checking the contents.
|
1192
|
+
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
1193
|
+
}
|
1194
|
+
|
1195
|
+
Popover.prototype.hasContent = function () {
|
1196
|
+
return this.getTitle() || this.getContent()
|
1197
|
+
}
|
1198
|
+
|
1199
|
+
Popover.prototype.getContent = function () {
|
1200
|
+
var $e = this.$element
|
1201
|
+
var o = this.options
|
1202
|
+
|
1203
|
+
return $e.attr('data-content')
|
1204
|
+
|| (typeof o.content == 'function' ?
|
1205
|
+
o.content.call($e[0]) :
|
1206
|
+
o.content)
|
1207
|
+
}
|
1208
|
+
|
1209
|
+
Popover.prototype.arrow = function () {
|
1210
|
+
return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
|
1211
|
+
}
|
1212
|
+
|
1213
|
+
|
1214
|
+
// POPOVER PLUGIN DEFINITION
|
1215
|
+
// =========================
|
1216
|
+
|
1217
|
+
function Plugin(option) {
|
1218
|
+
return this.each(function () {
|
1219
|
+
var $this = $(this)
|
1220
|
+
var data = $this.data('bs.popover')
|
1221
|
+
var options = typeof option == 'object' && option
|
1222
|
+
|
1223
|
+
if (!data && /destroy|hide/.test(option)) return
|
1224
|
+
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
1225
|
+
if (typeof option == 'string') data[option]()
|
1226
|
+
})
|
1227
|
+
}
|
1228
|
+
|
1229
|
+
var old = $.fn.popover
|
1230
|
+
|
1231
|
+
$.fn.popover = Plugin
|
1232
|
+
$.fn.popover.Constructor = Popover
|
1233
|
+
|
1234
|
+
|
1235
|
+
// POPOVER NO CONFLICT
|
1236
|
+
// ===================
|
1237
|
+
|
1238
|
+
$.fn.popover.noConflict = function () {
|
1239
|
+
$.fn.popover = old
|
1240
|
+
return this
|
1241
|
+
}
|
1242
|
+
|
1243
|
+
}(jQuery);
|