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,169 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Tag-closer extension for CodeMirror.
|
6
|
+
*
|
7
|
+
* This extension adds an "autoCloseTags" option that can be set to
|
8
|
+
* either true to get the default behavior, or an object to further
|
9
|
+
* configure its behavior.
|
10
|
+
*
|
11
|
+
* These are supported options:
|
12
|
+
*
|
13
|
+
* `whenClosing` (default true)
|
14
|
+
* Whether to autoclose when the '/' of a closing tag is typed.
|
15
|
+
* `whenOpening` (default true)
|
16
|
+
* Whether to autoclose the tag when the final '>' of an opening
|
17
|
+
* tag is typed.
|
18
|
+
* `dontCloseTags` (default is empty tags for HTML, none for XML)
|
19
|
+
* An array of tag names that should not be autoclosed.
|
20
|
+
* `indentTags` (default is block tags for HTML, none for XML)
|
21
|
+
* An array of tag names that should, when opened, cause a
|
22
|
+
* blank line to be added inside the tag, and the blank line and
|
23
|
+
* closing line to be indented.
|
24
|
+
*
|
25
|
+
* See demos/closetag.html for a usage example.
|
26
|
+
*/
|
27
|
+
|
28
|
+
(function(mod) {
|
29
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
30
|
+
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
|
31
|
+
else if (typeof define == "function" && define.amd) // AMD
|
32
|
+
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
|
33
|
+
else // Plain browser env
|
34
|
+
mod(CodeMirror);
|
35
|
+
})(function(CodeMirror) {
|
36
|
+
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
|
37
|
+
if (old != CodeMirror.Init && old)
|
38
|
+
cm.removeKeyMap("autoCloseTags");
|
39
|
+
if (!val) return;
|
40
|
+
var map = {name: "autoCloseTags"};
|
41
|
+
if (typeof val != "object" || val.whenClosing)
|
42
|
+
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
|
43
|
+
if (typeof val != "object" || val.whenOpening)
|
44
|
+
map["'>'"] = function(cm) { return autoCloseGT(cm); };
|
45
|
+
cm.addKeyMap(map);
|
46
|
+
});
|
47
|
+
|
48
|
+
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
|
49
|
+
"source", "track", "wbr"];
|
50
|
+
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
|
51
|
+
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
|
52
|
+
|
53
|
+
function autoCloseGT(cm) {
|
54
|
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
55
|
+
var ranges = cm.listSelections(), replacements = [];
|
56
|
+
for (var i = 0; i < ranges.length; i++) {
|
57
|
+
if (!ranges[i].empty()) return CodeMirror.Pass;
|
58
|
+
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
59
|
+
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
60
|
+
if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
|
61
|
+
|
62
|
+
var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
|
63
|
+
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
|
64
|
+
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
|
65
|
+
|
66
|
+
var tagName = state.tagName;
|
67
|
+
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
68
|
+
var lowerTagName = tagName.toLowerCase();
|
69
|
+
// Don't process the '>' at the end of an end-tag or self-closing tag
|
70
|
+
if (!tagName ||
|
71
|
+
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
|
72
|
+
tok.type == "tag" && state.type == "closeTag" ||
|
73
|
+
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
|
74
|
+
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
|
75
|
+
closingTagExists(cm, tagName, pos, state, true))
|
76
|
+
return CodeMirror.Pass;
|
77
|
+
|
78
|
+
var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
79
|
+
replacements[i] = {indent: indent,
|
80
|
+
text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
|
81
|
+
newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
|
82
|
+
}
|
83
|
+
|
84
|
+
for (var i = ranges.length - 1; i >= 0; i--) {
|
85
|
+
var info = replacements[i];
|
86
|
+
cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
|
87
|
+
var sel = cm.listSelections().slice(0);
|
88
|
+
sel[i] = {head: info.newPos, anchor: info.newPos};
|
89
|
+
cm.setSelections(sel);
|
90
|
+
if (info.indent) {
|
91
|
+
cm.indentLine(info.newPos.line, null, true);
|
92
|
+
cm.indentLine(info.newPos.line + 1, null, true);
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
function autoCloseCurrent(cm, typingSlash) {
|
98
|
+
var ranges = cm.listSelections(), replacements = [];
|
99
|
+
var head = typingSlash ? "/" : "</";
|
100
|
+
for (var i = 0; i < ranges.length; i++) {
|
101
|
+
if (!ranges[i].empty()) return CodeMirror.Pass;
|
102
|
+
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
103
|
+
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
104
|
+
if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
|
105
|
+
tok.start != pos.ch - 1))
|
106
|
+
return CodeMirror.Pass;
|
107
|
+
// Kludge to get around the fact that we are not in XML mode
|
108
|
+
// when completing in JS/CSS snippet in htmlmixed mode. Does not
|
109
|
+
// work for other XML embedded languages (there is no general
|
110
|
+
// way to go from a mixed mode to its current XML state).
|
111
|
+
var replacement;
|
112
|
+
if (inner.mode.name != "xml") {
|
113
|
+
if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
|
114
|
+
replacement = head + "script";
|
115
|
+
else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
|
116
|
+
replacement = head + "style";
|
117
|
+
else
|
118
|
+
return CodeMirror.Pass;
|
119
|
+
} else {
|
120
|
+
if (!state.context || !state.context.tagName ||
|
121
|
+
closingTagExists(cm, state.context.tagName, pos, state))
|
122
|
+
return CodeMirror.Pass;
|
123
|
+
replacement = head + state.context.tagName;
|
124
|
+
}
|
125
|
+
if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
|
126
|
+
replacements[i] = replacement;
|
127
|
+
}
|
128
|
+
cm.replaceSelections(replacements);
|
129
|
+
ranges = cm.listSelections();
|
130
|
+
for (var i = 0; i < ranges.length; i++)
|
131
|
+
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
|
132
|
+
cm.indentLine(ranges[i].head.line);
|
133
|
+
}
|
134
|
+
|
135
|
+
function autoCloseSlash(cm) {
|
136
|
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
137
|
+
return autoCloseCurrent(cm, true);
|
138
|
+
}
|
139
|
+
|
140
|
+
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
|
141
|
+
|
142
|
+
function indexOf(collection, elt) {
|
143
|
+
if (collection.indexOf) return collection.indexOf(elt);
|
144
|
+
for (var i = 0, e = collection.length; i < e; ++i)
|
145
|
+
if (collection[i] == elt) return i;
|
146
|
+
return -1;
|
147
|
+
}
|
148
|
+
|
149
|
+
// If xml-fold is loaded, we use its functionality to try and verify
|
150
|
+
// whether a given tag is actually unclosed.
|
151
|
+
function closingTagExists(cm, tagName, pos, state, newTag) {
|
152
|
+
if (!CodeMirror.scanForClosingTag) return false;
|
153
|
+
var end = Math.min(cm.lastLine() + 1, pos.line + 500);
|
154
|
+
var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
155
|
+
if (!nextClose || nextClose.tag != tagName) return false;
|
156
|
+
var cx = state.context;
|
157
|
+
// If the immediate wrapping context contains onCx instances of
|
158
|
+
// the same tag, a closing tag only exists if there are at least
|
159
|
+
// that many closing tags of that type following.
|
160
|
+
for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx;
|
161
|
+
pos = nextClose.to;
|
162
|
+
for (var i = 1; i < onCx; i++) {
|
163
|
+
var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
164
|
+
if (!next || next.tag != tagName) return false;
|
165
|
+
pos = next.to;
|
166
|
+
}
|
167
|
+
return true;
|
168
|
+
}
|
169
|
+
});
|
@@ -0,0 +1,51 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,
|
15
|
+
emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,
|
16
|
+
unorderedListRE = /[*+-]\s/;
|
17
|
+
|
18
|
+
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
|
19
|
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
20
|
+
var ranges = cm.listSelections(), replacements = [];
|
21
|
+
for (var i = 0; i < ranges.length; i++) {
|
22
|
+
var pos = ranges[i].head;
|
23
|
+
var eolState = cm.getStateAfter(pos.line);
|
24
|
+
var inList = eolState.list !== false;
|
25
|
+
var inQuote = eolState.quote !== 0;
|
26
|
+
|
27
|
+
var line = cm.getLine(pos.line), match = listRE.exec(line);
|
28
|
+
if (!ranges[i].empty() || (!inList && !inQuote) || !match) {
|
29
|
+
cm.execCommand("newlineAndIndent");
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
if (emptyListRE.test(line)) {
|
33
|
+
cm.replaceRange("", {
|
34
|
+
line: pos.line, ch: 0
|
35
|
+
}, {
|
36
|
+
line: pos.line, ch: pos.ch + 1
|
37
|
+
});
|
38
|
+
replacements[i] = "\n";
|
39
|
+
} else {
|
40
|
+
var indent = match[1], after = match[5];
|
41
|
+
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
|
42
|
+
? match[2]
|
43
|
+
: (parseInt(match[3], 10) + 1) + match[4];
|
44
|
+
|
45
|
+
replacements[i] = "\n" + indent + bullet + after;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
cm.replaceSelections(replacements);
|
50
|
+
};
|
51
|
+
});
|
@@ -0,0 +1,120 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
13
|
+
(document.documentMode == null || document.documentMode < 8);
|
14
|
+
|
15
|
+
var Pos = CodeMirror.Pos;
|
16
|
+
|
17
|
+
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
18
|
+
|
19
|
+
function findMatchingBracket(cm, where, strict, config) {
|
20
|
+
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
21
|
+
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
22
|
+
if (!match) return null;
|
23
|
+
var dir = match.charAt(1) == ">" ? 1 : -1;
|
24
|
+
if (strict && (dir > 0) != (pos == where.ch)) return null;
|
25
|
+
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
|
26
|
+
|
27
|
+
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
|
28
|
+
if (found == null) return null;
|
29
|
+
return {from: Pos(where.line, pos), to: found && found.pos,
|
30
|
+
match: found && found.ch == match.charAt(0), forward: dir > 0};
|
31
|
+
}
|
32
|
+
|
33
|
+
// bracketRegex is used to specify which type of bracket to scan
|
34
|
+
// should be a regexp, e.g. /[[\]]/
|
35
|
+
//
|
36
|
+
// Note: If "where" is on an open bracket, then this bracket is ignored.
|
37
|
+
//
|
38
|
+
// Returns false when no bracket was found, null when it reached
|
39
|
+
// maxScanLines and gave up
|
40
|
+
function scanForBracket(cm, where, dir, style, config) {
|
41
|
+
var maxScanLen = (config && config.maxScanLineLength) || 10000;
|
42
|
+
var maxScanLines = (config && config.maxScanLines) || 1000;
|
43
|
+
|
44
|
+
var stack = [];
|
45
|
+
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
|
46
|
+
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
47
|
+
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
48
|
+
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
49
|
+
var line = cm.getLine(lineNo);
|
50
|
+
if (!line) continue;
|
51
|
+
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
|
52
|
+
if (line.length > maxScanLen) continue;
|
53
|
+
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
|
54
|
+
for (; pos != end; pos += dir) {
|
55
|
+
var ch = line.charAt(pos);
|
56
|
+
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
57
|
+
var match = matching[ch];
|
58
|
+
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
59
|
+
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
60
|
+
else stack.pop();
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
|
65
|
+
}
|
66
|
+
|
67
|
+
function matchBrackets(cm, autoclear, config) {
|
68
|
+
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
69
|
+
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
70
|
+
var marks = [], ranges = cm.listSelections();
|
71
|
+
for (var i = 0; i < ranges.length; i++) {
|
72
|
+
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);
|
73
|
+
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
|
74
|
+
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
75
|
+
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
|
76
|
+
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
|
77
|
+
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
if (marks.length) {
|
82
|
+
// Kludge to work around the IE bug from issue #1193, where text
|
83
|
+
// input stops going to the textare whever this fires.
|
84
|
+
if (ie_lt8 && cm.state.focused) cm.focus();
|
85
|
+
|
86
|
+
var clear = function() {
|
87
|
+
cm.operation(function() {
|
88
|
+
for (var i = 0; i < marks.length; i++) marks[i].clear();
|
89
|
+
});
|
90
|
+
};
|
91
|
+
if (autoclear) setTimeout(clear, 800);
|
92
|
+
else return clear;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
var currentlyHighlighted = null;
|
97
|
+
function doMatchBrackets(cm) {
|
98
|
+
cm.operation(function() {
|
99
|
+
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
100
|
+
currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
101
|
+
});
|
102
|
+
}
|
103
|
+
|
104
|
+
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
105
|
+
if (old && old != CodeMirror.Init)
|
106
|
+
cm.off("cursorActivity", doMatchBrackets);
|
107
|
+
if (val) {
|
108
|
+
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
109
|
+
cm.on("cursorActivity", doMatchBrackets);
|
110
|
+
}
|
111
|
+
});
|
112
|
+
|
113
|
+
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
114
|
+
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){
|
115
|
+
return findMatchingBracket(this, pos, strict, config);
|
116
|
+
});
|
117
|
+
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
|
118
|
+
return scanForBracket(this, pos, dir, style, config);
|
119
|
+
});
|
120
|
+
});
|
@@ -0,0 +1,66 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
|
15
|
+
if (old && old != CodeMirror.Init) {
|
16
|
+
cm.off("cursorActivity", doMatchTags);
|
17
|
+
cm.off("viewportChange", maybeUpdateMatch);
|
18
|
+
clear(cm);
|
19
|
+
}
|
20
|
+
if (val) {
|
21
|
+
cm.state.matchBothTags = typeof val == "object" && val.bothTags;
|
22
|
+
cm.on("cursorActivity", doMatchTags);
|
23
|
+
cm.on("viewportChange", maybeUpdateMatch);
|
24
|
+
doMatchTags(cm);
|
25
|
+
}
|
26
|
+
});
|
27
|
+
|
28
|
+
function clear(cm) {
|
29
|
+
if (cm.state.tagHit) cm.state.tagHit.clear();
|
30
|
+
if (cm.state.tagOther) cm.state.tagOther.clear();
|
31
|
+
cm.state.tagHit = cm.state.tagOther = null;
|
32
|
+
}
|
33
|
+
|
34
|
+
function doMatchTags(cm) {
|
35
|
+
cm.state.failedTagMatch = false;
|
36
|
+
cm.operation(function() {
|
37
|
+
clear(cm);
|
38
|
+
if (cm.somethingSelected()) return;
|
39
|
+
var cur = cm.getCursor(), range = cm.getViewport();
|
40
|
+
range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
|
41
|
+
var match = CodeMirror.findMatchingTag(cm, cur, range);
|
42
|
+
if (!match) return;
|
43
|
+
if (cm.state.matchBothTags) {
|
44
|
+
var hit = match.at == "open" ? match.open : match.close;
|
45
|
+
if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"});
|
46
|
+
}
|
47
|
+
var other = match.at == "close" ? match.open : match.close;
|
48
|
+
if (other)
|
49
|
+
cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
|
50
|
+
else
|
51
|
+
cm.state.failedTagMatch = true;
|
52
|
+
});
|
53
|
+
}
|
54
|
+
|
55
|
+
function maybeUpdateMatch(cm) {
|
56
|
+
if (cm.state.failedTagMatch) doMatchTags(cm);
|
57
|
+
}
|
58
|
+
|
59
|
+
CodeMirror.commands.toMatchingTag = function(cm) {
|
60
|
+
var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
|
61
|
+
if (found) {
|
62
|
+
var other = found.at == "close" ? found.open : found.close;
|
63
|
+
if (other) cm.extendSelection(other.to, other.from);
|
64
|
+
}
|
65
|
+
};
|
66
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
|
13
|
+
if (prev == CodeMirror.Init) prev = false;
|
14
|
+
if (prev && !val)
|
15
|
+
cm.removeOverlay("trailingspace");
|
16
|
+
else if (!prev && val)
|
17
|
+
cm.addOverlay({
|
18
|
+
token: function(stream) {
|
19
|
+
for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
|
20
|
+
if (i > stream.pos) { stream.pos = i; return null; }
|
21
|
+
stream.pos = l;
|
22
|
+
return "trailingspace";
|
23
|
+
},
|
24
|
+
name: "trailingspace"
|
25
|
+
});
|
26
|
+
});
|
27
|
+
});
|
@@ -0,0 +1,105 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.registerHelper("fold", "brace", function(cm, start) {
|
15
|
+
var line = start.line, lineText = cm.getLine(line);
|
16
|
+
var startCh, tokenType;
|
17
|
+
|
18
|
+
function findOpening(openCh) {
|
19
|
+
for (var at = start.ch, pass = 0;;) {
|
20
|
+
var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1);
|
21
|
+
if (found == -1) {
|
22
|
+
if (pass == 1) break;
|
23
|
+
pass = 1;
|
24
|
+
at = lineText.length;
|
25
|
+
continue;
|
26
|
+
}
|
27
|
+
if (pass == 1 && found < start.ch) break;
|
28
|
+
tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
|
29
|
+
if (!/^(comment|string)/.test(tokenType)) return found + 1;
|
30
|
+
at = found - 1;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
var startToken = "{", endToken = "}", startCh = findOpening("{");
|
35
|
+
if (startCh == null) {
|
36
|
+
startToken = "[", endToken = "]";
|
37
|
+
startCh = findOpening("[");
|
38
|
+
}
|
39
|
+
|
40
|
+
if (startCh == null) return;
|
41
|
+
var count = 1, lastLine = cm.lastLine(), end, endCh;
|
42
|
+
outer: for (var i = line; i <= lastLine; ++i) {
|
43
|
+
var text = cm.getLine(i), pos = i == line ? startCh : 0;
|
44
|
+
for (;;) {
|
45
|
+
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
|
46
|
+
if (nextOpen < 0) nextOpen = text.length;
|
47
|
+
if (nextClose < 0) nextClose = text.length;
|
48
|
+
pos = Math.min(nextOpen, nextClose);
|
49
|
+
if (pos == text.length) break;
|
50
|
+
if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) {
|
51
|
+
if (pos == nextOpen) ++count;
|
52
|
+
else if (!--count) { end = i; endCh = pos; break outer; }
|
53
|
+
}
|
54
|
+
++pos;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
if (end == null || line == end && endCh == startCh) return;
|
58
|
+
return {from: CodeMirror.Pos(line, startCh),
|
59
|
+
to: CodeMirror.Pos(end, endCh)};
|
60
|
+
});
|
61
|
+
|
62
|
+
CodeMirror.registerHelper("fold", "import", function(cm, start) {
|
63
|
+
function hasImport(line) {
|
64
|
+
if (line < cm.firstLine() || line > cm.lastLine()) return null;
|
65
|
+
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
|
66
|
+
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
|
67
|
+
if (start.type != "keyword" || start.string != "import") return null;
|
68
|
+
// Now find closing semicolon, return its position
|
69
|
+
for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) {
|
70
|
+
var text = cm.getLine(i), semi = text.indexOf(";");
|
71
|
+
if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)};
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
var start = start.line, has = hasImport(start), prev;
|
76
|
+
if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1))
|
77
|
+
return null;
|
78
|
+
for (var end = has.end;;) {
|
79
|
+
var next = hasImport(end.line + 1);
|
80
|
+
if (next == null) break;
|
81
|
+
end = next.end;
|
82
|
+
}
|
83
|
+
return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end};
|
84
|
+
});
|
85
|
+
|
86
|
+
CodeMirror.registerHelper("fold", "include", function(cm, start) {
|
87
|
+
function hasInclude(line) {
|
88
|
+
if (line < cm.firstLine() || line > cm.lastLine()) return null;
|
89
|
+
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
|
90
|
+
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
|
91
|
+
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
|
92
|
+
}
|
93
|
+
|
94
|
+
var start = start.line, has = hasInclude(start);
|
95
|
+
if (has == null || hasInclude(start - 1) != null) return null;
|
96
|
+
for (var end = start;;) {
|
97
|
+
var next = hasInclude(end + 1);
|
98
|
+
if (next == null) break;
|
99
|
+
++end;
|
100
|
+
}
|
101
|
+
return {from: CodeMirror.Pos(start, has + 1),
|
102
|
+
to: cm.clipPos(CodeMirror.Pos(end))};
|
103
|
+
});
|
104
|
+
|
105
|
+
});
|