elabs 4.0.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +9 -0
- data/.node-version +1 -1
- data/.rubocop.yml +4 -0
- data/.stylelintrc.yml +12 -2
- data/CHANGELOG.md +81 -12
- data/Gemfile +1 -1
- data/Gemfile.lock +96 -94
- data/README.md +2 -0
- data/ROADMAP.md +4 -2
- data/app/assets/config/elabs_manifest.js +2 -1
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.eot +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.svg +1148 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.ttf +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.woff +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.woff2 +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.eot +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.svg +467 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.ttf +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.woff +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.woff2 +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.eot +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.svg +2231 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.ttf +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.woff +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.woff2 +0 -0
- data/app/assets/fonts/elabs/OpenSans/Apache License.txt +201 -0
- data/app/assets/fonts/elabs/OpenSans/OpenSans-Bold.ttf +0 -0
- data/app/assets/fonts/elabs/OpenSans/OpenSans-Light.ttf +0 -0
- data/app/assets/fonts/elabs/OpenSans/OpenSans-Regular.ttf +0 -0
- data/app/assets/fonts/elabs/OpenSans/OpenSans-Semibold.ttf +0 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.eot +0 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.svg +51 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.ttf +0 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.woff +0 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.woff2 +0 -0
- data/app/assets/images/elabs/preview_placeholder.png +0 -0
- data/app/assets/images/elabs/preview_placeholder_nsfw.png +0 -0
- data/app/assets/javascripts/elabs/announcements.js +33 -0
- data/app/assets/javascripts/elabs/application.js.erb +17 -14
- data/app/assets/javascripts/elabs/forms.js +0 -1
- data/app/assets/javascripts/elabs/helpers-markdown.js +2 -2
- data/app/assets/javascripts/elabs/helpers.js +17 -0
- data/app/assets/javascripts/elabs/menu.js +5 -0
- data/app/assets/stylesheets/elabs/_fonts.scss +32 -0
- data/app/assets/stylesheets/elabs/_variables.scss +286 -5
- data/app/assets/stylesheets/elabs/app/components/_act.scss +83 -0
- data/app/assets/stylesheets/elabs/app/components/_announcement.scss +41 -0
- data/app/assets/stylesheets/elabs/app/components/_classifier_types.scss +43 -0
- data/app/assets/stylesheets/elabs/app/components/_comment.scss +29 -0
- data/app/assets/stylesheets/elabs/app/components/_content_relations.scss +53 -0
- data/app/assets/stylesheets/elabs/app/components/_content_statuses.scss +39 -0
- data/app/assets/stylesheets/elabs/app/components/_content_types.scss +41 -0
- data/app/assets/stylesheets/elabs/app/components/_git_cards.scss +122 -0
- data/app/assets/stylesheets/elabs/app/elements/_alerts.scss +3 -0
- data/app/assets/stylesheets/elabs/app/elements/_badges.scss +17 -0
- data/app/assets/stylesheets/elabs/app/elements/_buttons.scss +34 -0
- data/app/assets/stylesheets/elabs/app/elements/_dropdowns.scss +78 -0
- data/app/assets/stylesheets/elabs/app/elements/_empty.scss +31 -0
- data/app/assets/stylesheets/elabs/app/elements/_errors.scss +15 -0
- data/app/assets/stylesheets/elabs/app/elements/_filter_link.scss +23 -0
- data/app/assets/stylesheets/elabs/app/elements/_fixed_links.scss +19 -0
- data/app/assets/stylesheets/elabs/app/elements/_forms.scss +123 -0
- data/app/assets/stylesheets/elabs/app/elements/_icons.scss +74 -0
- data/app/assets/stylesheets/elabs/app/{_medias.scss → elements/_medias.scss} +2 -0
- data/app/assets/stylesheets/elabs/app/{_modals.scss → elements/_modals.scss} +8 -4
- data/app/assets/stylesheets/elabs/app/elements/_nsfw.scss +41 -0
- data/app/assets/stylesheets/elabs/app/{_pagination.scss → elements/_pagination.scss} +0 -0
- data/app/assets/stylesheets/elabs/app/{_tables.scss → elements/_tables.scss} +2 -2
- data/app/assets/stylesheets/elabs/app/elements/_tabs.scss +73 -0
- data/app/assets/stylesheets/elabs/app/helpers/_cards.scss +80 -0
- data/app/assets/stylesheets/elabs/app/helpers/_containers.scss +7 -0
- data/app/assets/stylesheets/elabs/app/helpers/_states.scss +3 -0
- data/app/assets/stylesheets/elabs/app/{_helpers.scss → helpers/_typo.scss} +6 -4
- data/app/assets/stylesheets/elabs/app/layouts/_acts.scss +25 -0
- data/app/assets/stylesheets/elabs/app/layouts/_classifiers.scss +32 -0
- data/app/assets/stylesheets/elabs/app/{_comments.scss → layouts/_comments.scss} +0 -2
- data/app/assets/stylesheets/elabs/app/layouts/_devise.scss +65 -0
- data/app/assets/stylesheets/elabs/app/layouts/_layout.scss +40 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page.scss +14 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_content.scss +13 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_footer.scss +20 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_header.scss +146 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_menu.scss +232 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_messages.scss +4 -0
- data/app/assets/stylesheets/elabs/app/layouts/_private_layout.scss +78 -0
- data/app/assets/stylesheets/elabs/app/{_typo.scss → layouts/_typo.scss} +3 -0
- data/app/assets/stylesheets/elabs/app/mixins/_classifier_card.scss +43 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content_card.scss +103 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content_full.scss +158 -0
- data/app/assets/stylesheets/elabs/app/mixins/{_content-inline.scss → _content_inline.scss} +0 -0
- data/app/assets/stylesheets/elabs/lib/_codemirror.scss +2 -2
- data/app/assets/stylesheets/elabs/{_colors.scss → lib/_colors_reference.scss} +0 -52
- data/app/assets/stylesheets/elabs/lib/_license_icons.scss +121 -0
- data/app/assets/stylesheets/elabs/lib/fontawesome/_fontawesome.scss +1 -1
- data/app/assets/stylesheets/elabs/lib/fontawesome/_fonts.scss +18 -18
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss.scss +1 -1
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss_variables.scss +227 -0
- data/app/assets/stylesheets/elabs/style.scss +62 -57
- data/app/controllers/elabs/admin/admin_application_controller.rb +1 -1
- data/app/controllers/elabs/admin/announcements_controller.rb +71 -0
- data/app/controllers/elabs/concerns/elabs_controller.rb +3 -0
- data/app/controllers/elabs/content_application_controller.rb +4 -0
- data/app/controllers/elabs/elabs_public_controller.rb +15 -0
- data/app/controllers/elabs/languages_controller.rb +1 -5
- data/app/controllers/elabs/member/comments_controller.rb +42 -0
- data/app/controllers/elabs/member/member_application_controller.rb +1 -1
- data/app/controllers/elabs/reports_controller.rb +2 -0
- data/app/helpers/elabs/acts_helper.rb +7 -2
- data/app/helpers/elabs/application_helper.rb +8 -50
- data/app/helpers/elabs/content_filters_helper.rb +17 -24
- data/app/helpers/elabs/content_helper.rb +8 -35
- data/app/helpers/elabs/content_renderer_helper.rb +4 -112
- data/app/helpers/elabs/form_helper.rb +11 -11
- data/app/helpers/elabs/icons_helper.rb +63 -0
- data/app/helpers/elabs/{admin_content_helper.rb → links_admin_helper.rb} +1 -1
- data/app/helpers/elabs/links_helper.rb +58 -0
- data/app/helpers/elabs/{member_content_helper.rb → links_member_helper.rb} +2 -2
- data/app/helpers/elabs/notification_helper.rb +17 -3
- data/app/helpers/elabs/shortcodes_helper.rb +108 -0
- data/app/helpers/elabs/thumbnails_helper.rb +1 -1
- data/app/models/elabs/album.rb +14 -0
- data/app/models/elabs/announcement.rb +33 -0
- data/app/models/elabs/article.rb +14 -0
- data/app/models/elabs/comment.rb +10 -4
- data/app/models/elabs/note.rb +14 -0
- data/app/models/elabs/project.rb +12 -0
- data/app/models/elabs/report.rb +1 -0
- data/app/models/elabs/upload.rb +16 -0
- data/app/models/elabs/user.rb +2 -1
- data/app/views/elabs/acts/_filters.html.haml +3 -2
- data/app/views/elabs/acts/index.html.haml +2 -13
- data/app/views/elabs/admin/announcements/_announcement.json.jbuilder +10 -0
- data/app/views/elabs/admin/announcements/_form.html.haml +52 -0
- data/app/views/elabs/admin/announcements/edit.html.haml +3 -0
- data/app/views/elabs/admin/announcements/index.html.haml +28 -0
- data/app/views/elabs/admin/announcements/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/announcements/new.html.haml +3 -0
- data/app/views/elabs/admin/licenses/index.html.haml +2 -2
- data/app/views/elabs/admin/uploads/_upload.json.jbuilder +3 -3
- data/app/views/elabs/albums/_card_content.html.haml +8 -0
- data/app/views/elabs/albums/_filters.html.haml +5 -3
- data/app/views/elabs/albums/index.html.haml +1 -1
- data/app/views/elabs/albums/show.html.haml +38 -29
- data/app/views/elabs/articles/_filters.html.haml +5 -3
- data/app/views/elabs/articles/index.html.haml +1 -1
- data/app/views/elabs/articles/show.html.haml +33 -25
- data/app/views/elabs/auth/confirmations/new.html.haml +1 -1
- data/app/views/elabs/auth/passwords/edit.html.haml +1 -1
- data/app/views/elabs/auth/passwords/new.html.haml +1 -1
- data/app/views/elabs/auth/registrations/new.html.haml +7 -2
- data/app/views/elabs/auth/sessions/_new.html.haml +1 -1
- data/app/views/elabs/auth/unlocks/new.html.haml +1 -1
- data/app/views/elabs/comments/_comments.html.haml +29 -20
- data/app/views/elabs/comments/_form.html.haml +40 -36
- data/app/views/elabs/languages/_filters.html.haml +3 -5
- data/app/views/elabs/languages/index.html.haml +12 -13
- data/app/views/elabs/languages/show.html.haml +36 -31
- data/app/views/elabs/layouts/_announcements.html.haml +9 -0
- data/app/views/elabs/layouts/_content_associations.html.haml +89 -0
- data/app/views/elabs/layouts/_content_card.html.haml +41 -0
- data/app/views/elabs/layouts/_flash_messages.html.haml +4 -0
- data/app/views/elabs/layouts/_footer.html.haml +18 -10
- data/app/views/elabs/layouts/_form_honeypot.html.haml +12 -0
- data/app/views/elabs/layouts/_hidden_entry.html.haml +1 -1
- data/app/views/elabs/layouts/_hidden_entry_full.html.haml +4 -2
- data/app/views/elabs/layouts/_hidden_entry_inline.html.haml +1 -1
- data/app/views/elabs/layouts/_language_menu.html.haml +2 -2
- data/app/views/elabs/layouts/_menu.html.haml +58 -75
- data/app/views/elabs/layouts/_menu_admin.html.haml +40 -0
- data/app/views/elabs/layouts/_menu_member.html.haml +57 -0
- data/app/views/elabs/layouts/application.html.haml +24 -13
- data/app/views/elabs/layouts/application_admin.html.haml +33 -0
- data/app/views/elabs/layouts/application_member.html.haml +36 -0
- data/app/views/elabs/layouts/{lists → content_classifiers_lists}/_albums.html.haml +0 -0
- data/app/views/elabs/layouts/{lists → content_classifiers_lists}/_projects.html.haml +0 -0
- data/app/views/elabs/layouts/{lists → content_classifiers_lists}/_tags.html.haml +0 -0
- data/app/views/elabs/layouts/{_shortcode_infinite_loop.html.haml → shortcodes/_infinite_loop.html.haml} +1 -1
- data/app/views/elabs/layouts/{_shortcode_infinite_loop_inline.html.haml → shortcodes/_infinite_loop_inline.html.haml} +0 -0
- data/app/views/elabs/layouts/{_shortcode_missing_content.html.haml → shortcodes/_missing_content.html.haml} +1 -1
- data/app/views/elabs/layouts/{_shortcode_missing_content_inline.html.haml → shortcodes/_missing_content_inline.html.haml} +0 -0
- data/app/views/elabs/layouts/shortcodes/_open_to_see.html.haml +2 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_github_repo_card.html.haml +1 -1
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_github_repo_inline.html.haml +0 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_github_user_card.html.haml +0 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_group_card.html.haml +1 -1
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_repo_card.html.haml +1 -1
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_repo_inline.html.haml +0 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_user_card.html.haml +1 -1
- data/app/views/elabs/layouts/shortcodes/widgets/vue/_all_widgets.html.haml +5 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_github_repo_card_vue.html.haml +8 -8
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_github_user_card_vue.html.haml +5 -5
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_gitlab_group_card_vue.html.haml +5 -5
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_gitlab_repo_card_vue.html.haml +8 -8
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_gitlab_user_card_vue.html.haml +4 -4
- data/app/views/elabs/licenses/_filters.html.haml +3 -2
- data/app/views/elabs/licenses/index.html.haml +14 -12
- data/app/views/elabs/licenses/show.html.haml +40 -34
- data/app/views/elabs/member/albums/_form.html.haml +1 -43
- data/app/views/elabs/member/articles/_form.html.haml +1 -39
- data/app/views/elabs/member/layouts/_form_commons.html.haml +55 -0
- data/app/views/elabs/member/notes/_form.html.haml +1 -39
- data/app/views/elabs/member/preferences/edit.html.haml +1 -2
- data/app/views/elabs/member/projects/_form.html.haml +3 -38
- data/app/views/elabs/member/uploads/_form.html.haml +1 -42
- data/app/views/elabs/member/uploads/_upload.json.jbuilder +3 -3
- data/app/views/elabs/member/users/edit.html.haml +3 -4
- data/app/views/elabs/notes/_filters.html.haml +5 -3
- data/app/views/elabs/notes/index.html.haml +1 -1
- data/app/views/elabs/notes/show.html.haml +33 -25
- data/app/views/elabs/projects/_filters.html.haml +5 -3
- data/app/views/elabs/projects/index.html.haml +1 -1
- data/app/views/elabs/projects/show.html.haml +68 -62
- data/app/views/elabs/reports/_form.html.haml +2 -0
- data/app/views/elabs/tags/_filters.html.haml +3 -2
- data/app/views/elabs/tags/index.html.haml +11 -11
- data/app/views/elabs/tags/show.html.haml +31 -28
- data/app/views/elabs/uploads/_filters.html.haml +5 -3
- data/app/views/elabs/uploads/_preview.html.haml +5 -4
- data/app/views/elabs/uploads/_thumbnail.html.haml +9 -0
- data/app/views/elabs/uploads/_upload.json.jbuilder +3 -3
- data/app/views/elabs/uploads/index.html.haml +1 -1
- data/app/views/elabs/uploads/show.html.haml +45 -39
- data/app/views/elabs/users/_filters.html.haml +3 -2
- data/app/views/elabs/users/_user.html.haml +3 -3
- data/app/views/elabs/users/show.html.haml +48 -43
- data/config/routes.rb +13 -8
- data/db/migrate/20181025084232_add_archived_field_to_comments.rb +5 -0
- data/db/migrate/20181026071743_delete_comment_notifications.rb +5 -0
- data/db/migrate/20181030063505_create_announcements.rb +14 -0
- data/docs/CODEOWNERS +10 -0
- data/docs/migrating.md +16 -1
- data/docs/shortcodes_guide.md +51 -0
- data/lib/assets/javascripts/README-highlight.js.md +5 -5
- data/lib/assets/javascripts/highlight.js-9.13.1/highlight.pack.js +2 -0
- data/lib/assets/stylesheets/{highlight.js-9.12.0 → highlight.js-9.13.1}/styles/atelier-sulphurpool-light.css +0 -0
- data/lib/elabs.rb +8 -0
- data/lib/elabs/version.rb +1 -1
- data/lib/generators/elabs/{devise_views_generator.rb → devise_mailer_views_generator.rb} +2 -2
- data/lib/generators/elabs/images_generator.rb +24 -0
- data/lib/generators/elabs/required_assets_generator.rb +0 -2
- data/lib/generators/templates/elabs.rb +3 -0
- data/locale/app.pot +132 -19
- data/locale/en/app.edit.po +130 -17
- data/locale/en/app.po +130 -17
- data/locale/fr/app.edit.po +145 -28
- data/locale/fr/app.po +141 -27
- data/package.json +10 -12
- data/yarn.lock +885 -668
- metadata +136 -97
- data/app/assets/stylesheets/elabs/_icons.scss +0 -17
- data/app/assets/stylesheets/elabs/app/_acts.scss +0 -69
- data/app/assets/stylesheets/elabs/app/_alerts.scss +0 -3
- data/app/assets/stylesheets/elabs/app/_badges.scss +0 -11
- data/app/assets/stylesheets/elabs/app/_buttons.scss +0 -29
- data/app/assets/stylesheets/elabs/app/_content.scss +0 -25
- data/app/assets/stylesheets/elabs/app/_content_statuses.scss +0 -32
- data/app/assets/stylesheets/elabs/app/_content_uploads.scss +0 -39
- data/app/assets/stylesheets/elabs/app/_empty.scss +0 -19
- data/app/assets/stylesheets/elabs/app/_errors.scss +0 -9
- data/app/assets/stylesheets/elabs/app/_filter_links.scss +0 -27
- data/app/assets/stylesheets/elabs/app/_forms.scss +0 -74
- data/app/assets/stylesheets/elabs/app/_languages.scss +0 -6
- data/app/assets/stylesheets/elabs/app/_layout.scss +0 -206
- data/app/assets/stylesheets/elabs/app/_licenses.scss +0 -6
- data/app/assets/stylesheets/elabs/app/_link-to-top.scss +0 -8
- data/app/assets/stylesheets/elabs/app/_tabs.scss +0 -54
- data/app/assets/stylesheets/elabs/app/_tags.scss +0 -6
- data/app/assets/stylesheets/elabs/app/_toolbars.scss +0 -3
- data/app/assets/stylesheets/elabs/app/_users.scss +0 -21
- data/app/assets/stylesheets/elabs/app/admin-members/_forms.scss +0 -13
- data/app/assets/stylesheets/elabs/app/admin-members/_indexes.scss +0 -46
- data/app/assets/stylesheets/elabs/app/admin-members/_layout.scss +0 -17
- data/app/assets/stylesheets/elabs/app/areas/_devise.scss +0 -31
- data/app/assets/stylesheets/elabs/app/components/_cards.scss +0 -16
- data/app/assets/stylesheets/elabs/app/components/_container.scss +0 -4
- data/app/assets/stylesheets/elabs/app/mixins/_classifier-card.scss +0 -16
- data/app/assets/stylesheets/elabs/app/mixins/_content-card.scss +0 -72
- data/app/assets/stylesheets/elabs/app/mixins/_content-full.scss +0 -77
- data/app/assets/stylesheets/elabs/app/widgets/_git-cards.scss +0 -88
- data/app/assets/stylesheets/elabs/lib/fontawesome/_icons.scss +0 -1118
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss-variables.scss +0 -239
- data/app/views/elabs/albums/_album.html.haml +0 -38
- data/app/views/elabs/articles/_article.html.haml +0 -30
- data/app/views/elabs/languages/_associations.html.haml +0 -61
- data/app/views/elabs/layouts/_shortcode_open_to_see.html.haml +0 -2
- data/app/views/elabs/layouts/admin_application.html.haml +0 -21
- data/app/views/elabs/layouts/member_application.html.haml +0 -24
- data/app/views/elabs/layouts/widgets/vue/_all_widgets.html.haml +0 -5
- data/app/views/elabs/licenses/_associations.html.haml +0 -61
- data/app/views/elabs/notes/_note.html.haml +0 -31
- data/app/views/elabs/projects/_associations.html.haml +0 -54
- data/app/views/elabs/projects/_project.html.haml +0 -29
- data/app/views/elabs/tags/_associations.html.haml +0 -61
- data/app/views/elabs/uploads/_upload.html.haml +0 -41
- data/app/views/elabs/users/_associations.html.haml +0 -61
- data/db/seeds.rb +0 -10
- data/db/seeds_development.rb +0 -21
- data/db/seeds_production.rb +0 -0
- data/lib/assets/javascripts/codemirror-5.39.2/addon/mode/overlay.js +0 -90
- data/lib/assets/javascripts/codemirror-5.39.2/lib/codemirror.js +0 -9684
- data/lib/assets/javascripts/codemirror-5.39.2/mode/clike/clike.js +0 -834
- data/lib/assets/javascripts/codemirror-5.39.2/mode/css/css.js +0 -832
- data/lib/assets/javascripts/codemirror-5.39.2/mode/gfm/gfm.js +0 -129
- data/lib/assets/javascripts/codemirror-5.39.2/mode/htmlmixed/htmlmixed.js +0 -152
- data/lib/assets/javascripts/codemirror-5.39.2/mode/javascript/javascript.js +0 -896
- data/lib/assets/javascripts/codemirror-5.39.2/mode/markdown/markdown.js +0 -882
- data/lib/assets/javascripts/codemirror-5.39.2/mode/meta.js +0 -217
- data/lib/assets/javascripts/codemirror-5.39.2/mode/xml/xml.js +0 -402
- data/lib/assets/javascripts/highlight.js-9.12.0/highlight.pack.js +0 -2
- data/lib/assets/stylesheets/codemirror-5.39.2/lib/codemirror.css +0 -346
- data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-dark.css +0 -38
- data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-light.css +0 -38
@@ -1,217 +0,0 @@
|
|
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.modeInfo = [
|
15
|
-
{name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
|
16
|
-
{name: "PGP", mimes: ["application/pgp", "application/pgp-encrypted", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["asc", "pgp", "sig"]},
|
17
|
-
{name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]},
|
18
|
-
{name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
|
19
|
-
{name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
|
20
|
-
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h", "ino"]},
|
21
|
-
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
|
22
|
-
{name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
|
23
|
-
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
|
24
|
-
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]},
|
25
|
-
{name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
|
26
|
-
{name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
|
27
|
-
{name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/},
|
28
|
-
{name: "CoffeeScript", mimes: ["application/vnd.coffeescript", "text/coffeescript", "text/x-coffeescript"], mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
|
29
|
-
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
|
30
|
-
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
|
31
|
-
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
|
32
|
-
{name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]},
|
33
|
-
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
|
34
|
-
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
|
35
|
-
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
|
36
|
-
{name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]},
|
37
|
-
{name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]},
|
38
|
-
{name: "Django", mime: "text/x-django", mode: "django"},
|
39
|
-
{name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/},
|
40
|
-
{name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]},
|
41
|
-
{name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
|
42
|
-
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
|
43
|
-
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
|
44
|
-
{name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]},
|
45
|
-
{name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
|
46
|
-
{name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
|
47
|
-
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
|
48
|
-
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
|
49
|
-
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
|
50
|
-
{name: "Esper", mime: "text/x-esper", mode: "sql"},
|
51
|
-
{name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
|
52
|
-
{name: "FCL", mime: "text/x-fcl", mode: "fcl"},
|
53
|
-
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
|
54
|
-
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
|
55
|
-
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
|
56
|
-
{name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
|
57
|
-
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
|
58
|
-
{name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i},
|
59
|
-
{name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
|
60
|
-
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"], file: /^Jenkinsfile$/},
|
61
|
-
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
|
62
|
-
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
|
63
|
-
{name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]},
|
64
|
-
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
|
65
|
-
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
|
66
|
-
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
|
67
|
-
{name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm", "handlebars", "hbs"], alias: ["xhtml"]},
|
68
|
-
{name: "HTTP", mime: "message/http", mode: "http"},
|
69
|
-
{name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]},
|
70
|
-
{name: "Pug", mime: "text/x-pug", mode: "pug", ext: ["jade", "pug"], alias: ["jade"]},
|
71
|
-
{name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]},
|
72
|
-
{name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]},
|
73
|
-
{name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
|
74
|
-
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
|
75
|
-
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
|
76
|
-
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
|
77
|
-
{name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
|
78
|
-
{name: "Jinja2", mime: "null", mode: "jinja2"},
|
79
|
-
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
|
80
|
-
{name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
|
81
|
-
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
|
82
|
-
{name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
|
83
|
-
{name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
|
84
|
-
{name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
|
85
|
-
{name: "mIRC", mime: "text/mirc", mode: "mirc"},
|
86
|
-
{name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
|
87
|
-
{name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]},
|
88
|
-
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
|
89
|
-
{name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]},
|
90
|
-
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
91
|
-
{name: "mbox", mime: "application/mbox", mode: "mbox", ext: ["mbox"]},
|
92
|
-
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
93
|
-
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
|
94
|
-
{name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
|
95
|
-
{name: "NTriples", mimes: ["application/n-triples", "application/n-quads", "text/n-triples"],
|
96
|
-
mode: "ntriples", ext: ["nt", "nq"]},
|
97
|
-
{name: "Objective-C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"], alias: ["objective-c", "objc"]},
|
98
|
-
{name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
|
99
|
-
{name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
|
100
|
-
{name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]},
|
101
|
-
{name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
|
102
|
-
{name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
|
103
|
-
{name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
|
104
|
-
{name: "PHP", mimes: ["text/x-php", "application/x-httpd-php", "application/x-httpd-php-open"], mode: "php", ext: ["php", "php3", "php4", "php5", "php7", "phtml"]},
|
105
|
-
{name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
|
106
|
-
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
|
107
|
-
{name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
|
108
|
-
{name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]},
|
109
|
-
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
|
110
|
-
{name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]},
|
111
|
-
{name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], file: /^(BUCK|BUILD)$/},
|
112
|
-
{name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
|
113
|
-
{name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
|
114
|
-
{name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r", "R"], alias: ["rscript"]},
|
115
|
-
{name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]},
|
116
|
-
{name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"},
|
117
|
-
{name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]},
|
118
|
-
{name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]},
|
119
|
-
{name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]},
|
120
|
-
{name: "SAS", mime: "text/x-sas", mode: "sas", ext: ["sas"]},
|
121
|
-
{name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]},
|
122
|
-
{name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
|
123
|
-
{name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
|
124
|
-
{name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
|
125
|
-
{name: "Shell", mimes: ["text/x-sh", "application/x-sh"], mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
|
126
|
-
{name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
|
127
|
-
{name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
|
128
|
-
{name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
|
129
|
-
{name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]},
|
130
|
-
{name: "Solr", mime: "text/x-solr", mode: "solr"},
|
131
|
-
{name: "SML", mime: "text/x-sml", mode: "mllike", ext: ["sml", "sig", "fun", "smackspec"]},
|
132
|
-
{name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]},
|
133
|
-
{name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
|
134
|
-
{name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
|
135
|
-
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
|
136
|
-
{name: "SQLite", mime: "text/x-sqlite", mode: "sql"},
|
137
|
-
{name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
|
138
|
-
{name: "Stylus", mime: "text/x-styl", mode: "stylus", ext: ["styl"]},
|
139
|
-
{name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
|
140
|
-
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
|
141
|
-
{name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx", "tex"], alias: ["tex"]},
|
142
|
-
{name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v", "sv", "svh"]},
|
143
|
-
{name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
|
144
|
-
{name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
|
145
|
-
{name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
|
146
|
-
{name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
|
147
|
-
{name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
|
148
|
-
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
|
149
|
-
{name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
|
150
|
-
{name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
|
151
|
-
{name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
|
152
|
-
{name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
|
153
|
-
{name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
|
154
|
-
{name: "TypeScript-JSX", mime: "text/typescript-jsx", mode: "jsx", ext: ["tsx"], alias: ["tsx"]},
|
155
|
-
{name: "Twig", mime: "text/x-twig", mode: "twig"},
|
156
|
-
{name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"]},
|
157
|
-
{name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
|
158
|
-
{name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
|
159
|
-
{name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
|
160
|
-
{name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
|
161
|
-
{name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]},
|
162
|
-
{name: "Vue.js Component", mimes: ["script/x-vue", "text/x-vue"], mode: "vue", ext: ["vue"]},
|
163
|
-
{name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd", "svg"], alias: ["rss", "wsdl", "xsd"]},
|
164
|
-
{name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
|
165
|
-
{name: "Yacas", mime: "text/x-yacas", mode: "yacas", ext: ["ys"]},
|
166
|
-
{name: "YAML", mimes: ["text/x-yaml", "text/yaml"], mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]},
|
167
|
-
{name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
|
168
|
-
{name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
|
169
|
-
{name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]},
|
170
|
-
{name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]}
|
171
|
-
];
|
172
|
-
// Ensure all modes have a mime property for backwards compatibility
|
173
|
-
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
174
|
-
var info = CodeMirror.modeInfo[i];
|
175
|
-
if (info.mimes) info.mime = info.mimes[0];
|
176
|
-
}
|
177
|
-
|
178
|
-
CodeMirror.findModeByMIME = function(mime) {
|
179
|
-
mime = mime.toLowerCase();
|
180
|
-
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
181
|
-
var info = CodeMirror.modeInfo[i];
|
182
|
-
if (info.mime == mime) return info;
|
183
|
-
if (info.mimes) for (var j = 0; j < info.mimes.length; j++)
|
184
|
-
if (info.mimes[j] == mime) return info;
|
185
|
-
}
|
186
|
-
if (/\+xml$/.test(mime)) return CodeMirror.findModeByMIME("application/xml")
|
187
|
-
if (/\+json$/.test(mime)) return CodeMirror.findModeByMIME("application/json")
|
188
|
-
};
|
189
|
-
|
190
|
-
CodeMirror.findModeByExtension = function(ext) {
|
191
|
-
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
192
|
-
var info = CodeMirror.modeInfo[i];
|
193
|
-
if (info.ext) for (var j = 0; j < info.ext.length; j++)
|
194
|
-
if (info.ext[j] == ext) return info;
|
195
|
-
}
|
196
|
-
};
|
197
|
-
|
198
|
-
CodeMirror.findModeByFileName = function(filename) {
|
199
|
-
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
200
|
-
var info = CodeMirror.modeInfo[i];
|
201
|
-
if (info.file && info.file.test(filename)) return info;
|
202
|
-
}
|
203
|
-
var dot = filename.lastIndexOf(".");
|
204
|
-
var ext = dot > -1 && filename.substring(dot + 1, filename.length);
|
205
|
-
if (ext) return CodeMirror.findModeByExtension(ext);
|
206
|
-
};
|
207
|
-
|
208
|
-
CodeMirror.findModeByName = function(name) {
|
209
|
-
name = name.toLowerCase();
|
210
|
-
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
211
|
-
var info = CodeMirror.modeInfo[i];
|
212
|
-
if (info.name.toLowerCase() == name) return info;
|
213
|
-
if (info.alias) for (var j = 0; j < info.alias.length; j++)
|
214
|
-
if (info.alias[j].toLowerCase() == name) return info;
|
215
|
-
}
|
216
|
-
};
|
217
|
-
});
|
@@ -1,402 +0,0 @@
|
|
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 htmlConfig = {
|
15
|
-
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
16
|
-
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
17
|
-
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
18
|
-
'track': true, 'wbr': true, 'menuitem': true},
|
19
|
-
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
20
|
-
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
21
|
-
'th': true, 'tr': true},
|
22
|
-
contextGrabbers: {
|
23
|
-
'dd': {'dd': true, 'dt': true},
|
24
|
-
'dt': {'dd': true, 'dt': true},
|
25
|
-
'li': {'li': true},
|
26
|
-
'option': {'option': true, 'optgroup': true},
|
27
|
-
'optgroup': {'optgroup': true},
|
28
|
-
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
29
|
-
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
30
|
-
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
31
|
-
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
32
|
-
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
33
|
-
'rp': {'rp': true, 'rt': true},
|
34
|
-
'rt': {'rp': true, 'rt': true},
|
35
|
-
'tbody': {'tbody': true, 'tfoot': true},
|
36
|
-
'td': {'td': true, 'th': true},
|
37
|
-
'tfoot': {'tbody': true},
|
38
|
-
'th': {'td': true, 'th': true},
|
39
|
-
'thead': {'tbody': true, 'tfoot': true},
|
40
|
-
'tr': {'tr': true}
|
41
|
-
},
|
42
|
-
doNotIndent: {"pre": true},
|
43
|
-
allowUnquoted: true,
|
44
|
-
allowMissing: true,
|
45
|
-
caseFold: true
|
46
|
-
}
|
47
|
-
|
48
|
-
var xmlConfig = {
|
49
|
-
autoSelfClosers: {},
|
50
|
-
implicitlyClosed: {},
|
51
|
-
contextGrabbers: {},
|
52
|
-
doNotIndent: {},
|
53
|
-
allowUnquoted: false,
|
54
|
-
allowMissing: false,
|
55
|
-
allowMissingTagName: false,
|
56
|
-
caseFold: false
|
57
|
-
}
|
58
|
-
|
59
|
-
CodeMirror.defineMode("xml", function(editorConf, config_) {
|
60
|
-
var indentUnit = editorConf.indentUnit
|
61
|
-
var config = {}
|
62
|
-
var defaults = config_.htmlMode ? htmlConfig : xmlConfig
|
63
|
-
for (var prop in defaults) config[prop] = defaults[prop]
|
64
|
-
for (var prop in config_) config[prop] = config_[prop]
|
65
|
-
|
66
|
-
// Return variables for tokenizers
|
67
|
-
var type, setStyle;
|
68
|
-
|
69
|
-
function inText(stream, state) {
|
70
|
-
function chain(parser) {
|
71
|
-
state.tokenize = parser;
|
72
|
-
return parser(stream, state);
|
73
|
-
}
|
74
|
-
|
75
|
-
var ch = stream.next();
|
76
|
-
if (ch == "<") {
|
77
|
-
if (stream.eat("!")) {
|
78
|
-
if (stream.eat("[")) {
|
79
|
-
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
80
|
-
else return null;
|
81
|
-
} else if (stream.match("--")) {
|
82
|
-
return chain(inBlock("comment", "-->"));
|
83
|
-
} else if (stream.match("DOCTYPE", true, true)) {
|
84
|
-
stream.eatWhile(/[\w\._\-]/);
|
85
|
-
return chain(doctype(1));
|
86
|
-
} else {
|
87
|
-
return null;
|
88
|
-
}
|
89
|
-
} else if (stream.eat("?")) {
|
90
|
-
stream.eatWhile(/[\w\._\-]/);
|
91
|
-
state.tokenize = inBlock("meta", "?>");
|
92
|
-
return "meta";
|
93
|
-
} else {
|
94
|
-
type = stream.eat("/") ? "closeTag" : "openTag";
|
95
|
-
state.tokenize = inTag;
|
96
|
-
return "tag bracket";
|
97
|
-
}
|
98
|
-
} else if (ch == "&") {
|
99
|
-
var ok;
|
100
|
-
if (stream.eat("#")) {
|
101
|
-
if (stream.eat("x")) {
|
102
|
-
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
103
|
-
} else {
|
104
|
-
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
105
|
-
}
|
106
|
-
} else {
|
107
|
-
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
108
|
-
}
|
109
|
-
return ok ? "atom" : "error";
|
110
|
-
} else {
|
111
|
-
stream.eatWhile(/[^&<]/);
|
112
|
-
return null;
|
113
|
-
}
|
114
|
-
}
|
115
|
-
inText.isInText = true;
|
116
|
-
|
117
|
-
function inTag(stream, state) {
|
118
|
-
var ch = stream.next();
|
119
|
-
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
120
|
-
state.tokenize = inText;
|
121
|
-
type = ch == ">" ? "endTag" : "selfcloseTag";
|
122
|
-
return "tag bracket";
|
123
|
-
} else if (ch == "=") {
|
124
|
-
type = "equals";
|
125
|
-
return null;
|
126
|
-
} else if (ch == "<") {
|
127
|
-
state.tokenize = inText;
|
128
|
-
state.state = baseState;
|
129
|
-
state.tagName = state.tagStart = null;
|
130
|
-
var next = state.tokenize(stream, state);
|
131
|
-
return next ? next + " tag error" : "tag error";
|
132
|
-
} else if (/[\'\"]/.test(ch)) {
|
133
|
-
state.tokenize = inAttribute(ch);
|
134
|
-
state.stringStartCol = stream.column();
|
135
|
-
return state.tokenize(stream, state);
|
136
|
-
} else {
|
137
|
-
stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
|
138
|
-
return "word";
|
139
|
-
}
|
140
|
-
}
|
141
|
-
|
142
|
-
function inAttribute(quote) {
|
143
|
-
var closure = function(stream, state) {
|
144
|
-
while (!stream.eol()) {
|
145
|
-
if (stream.next() == quote) {
|
146
|
-
state.tokenize = inTag;
|
147
|
-
break;
|
148
|
-
}
|
149
|
-
}
|
150
|
-
return "string";
|
151
|
-
};
|
152
|
-
closure.isInAttribute = true;
|
153
|
-
return closure;
|
154
|
-
}
|
155
|
-
|
156
|
-
function inBlock(style, terminator) {
|
157
|
-
return function(stream, state) {
|
158
|
-
while (!stream.eol()) {
|
159
|
-
if (stream.match(terminator)) {
|
160
|
-
state.tokenize = inText;
|
161
|
-
break;
|
162
|
-
}
|
163
|
-
stream.next();
|
164
|
-
}
|
165
|
-
return style;
|
166
|
-
}
|
167
|
-
}
|
168
|
-
|
169
|
-
function doctype(depth) {
|
170
|
-
return function(stream, state) {
|
171
|
-
var ch;
|
172
|
-
while ((ch = stream.next()) != null) {
|
173
|
-
if (ch == "<") {
|
174
|
-
state.tokenize = doctype(depth + 1);
|
175
|
-
return state.tokenize(stream, state);
|
176
|
-
} else if (ch == ">") {
|
177
|
-
if (depth == 1) {
|
178
|
-
state.tokenize = inText;
|
179
|
-
break;
|
180
|
-
} else {
|
181
|
-
state.tokenize = doctype(depth - 1);
|
182
|
-
return state.tokenize(stream, state);
|
183
|
-
}
|
184
|
-
}
|
185
|
-
}
|
186
|
-
return "meta";
|
187
|
-
};
|
188
|
-
}
|
189
|
-
|
190
|
-
function Context(state, tagName, startOfLine) {
|
191
|
-
this.prev = state.context;
|
192
|
-
this.tagName = tagName;
|
193
|
-
this.indent = state.indented;
|
194
|
-
this.startOfLine = startOfLine;
|
195
|
-
if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
196
|
-
this.noIndent = true;
|
197
|
-
}
|
198
|
-
function popContext(state) {
|
199
|
-
if (state.context) state.context = state.context.prev;
|
200
|
-
}
|
201
|
-
function maybePopContext(state, nextTagName) {
|
202
|
-
var parentTagName;
|
203
|
-
while (true) {
|
204
|
-
if (!state.context) {
|
205
|
-
return;
|
206
|
-
}
|
207
|
-
parentTagName = state.context.tagName;
|
208
|
-
if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
|
209
|
-
!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
210
|
-
return;
|
211
|
-
}
|
212
|
-
popContext(state);
|
213
|
-
}
|
214
|
-
}
|
215
|
-
|
216
|
-
function baseState(type, stream, state) {
|
217
|
-
if (type == "openTag") {
|
218
|
-
state.tagStart = stream.column();
|
219
|
-
return tagNameState;
|
220
|
-
} else if (type == "closeTag") {
|
221
|
-
return closeTagNameState;
|
222
|
-
} else {
|
223
|
-
return baseState;
|
224
|
-
}
|
225
|
-
}
|
226
|
-
function tagNameState(type, stream, state) {
|
227
|
-
if (type == "word") {
|
228
|
-
state.tagName = stream.current();
|
229
|
-
setStyle = "tag";
|
230
|
-
return attrState;
|
231
|
-
} else if (config.allowMissingTagName && type == "endTag") {
|
232
|
-
setStyle = "tag bracket";
|
233
|
-
return attrState(type, stream, state);
|
234
|
-
} else {
|
235
|
-
setStyle = "error";
|
236
|
-
return tagNameState;
|
237
|
-
}
|
238
|
-
}
|
239
|
-
function closeTagNameState(type, stream, state) {
|
240
|
-
if (type == "word") {
|
241
|
-
var tagName = stream.current();
|
242
|
-
if (state.context && state.context.tagName != tagName &&
|
243
|
-
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
244
|
-
popContext(state);
|
245
|
-
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
|
246
|
-
setStyle = "tag";
|
247
|
-
return closeState;
|
248
|
-
} else {
|
249
|
-
setStyle = "tag error";
|
250
|
-
return closeStateErr;
|
251
|
-
}
|
252
|
-
} else if (config.allowMissingTagName && type == "endTag") {
|
253
|
-
setStyle = "tag bracket";
|
254
|
-
return closeState(type, stream, state);
|
255
|
-
} else {
|
256
|
-
setStyle = "error";
|
257
|
-
return closeStateErr;
|
258
|
-
}
|
259
|
-
}
|
260
|
-
|
261
|
-
function closeState(type, _stream, state) {
|
262
|
-
if (type != "endTag") {
|
263
|
-
setStyle = "error";
|
264
|
-
return closeState;
|
265
|
-
}
|
266
|
-
popContext(state);
|
267
|
-
return baseState;
|
268
|
-
}
|
269
|
-
function closeStateErr(type, stream, state) {
|
270
|
-
setStyle = "error";
|
271
|
-
return closeState(type, stream, state);
|
272
|
-
}
|
273
|
-
|
274
|
-
function attrState(type, _stream, state) {
|
275
|
-
if (type == "word") {
|
276
|
-
setStyle = "attribute";
|
277
|
-
return attrEqState;
|
278
|
-
} else if (type == "endTag" || type == "selfcloseTag") {
|
279
|
-
var tagName = state.tagName, tagStart = state.tagStart;
|
280
|
-
state.tagName = state.tagStart = null;
|
281
|
-
if (type == "selfcloseTag" ||
|
282
|
-
config.autoSelfClosers.hasOwnProperty(tagName)) {
|
283
|
-
maybePopContext(state, tagName);
|
284
|
-
} else {
|
285
|
-
maybePopContext(state, tagName);
|
286
|
-
state.context = new Context(state, tagName, tagStart == state.indented);
|
287
|
-
}
|
288
|
-
return baseState;
|
289
|
-
}
|
290
|
-
setStyle = "error";
|
291
|
-
return attrState;
|
292
|
-
}
|
293
|
-
function attrEqState(type, stream, state) {
|
294
|
-
if (type == "equals") return attrValueState;
|
295
|
-
if (!config.allowMissing) setStyle = "error";
|
296
|
-
return attrState(type, stream, state);
|
297
|
-
}
|
298
|
-
function attrValueState(type, stream, state) {
|
299
|
-
if (type == "string") return attrContinuedState;
|
300
|
-
if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
|
301
|
-
setStyle = "error";
|
302
|
-
return attrState(type, stream, state);
|
303
|
-
}
|
304
|
-
function attrContinuedState(type, stream, state) {
|
305
|
-
if (type == "string") return attrContinuedState;
|
306
|
-
return attrState(type, stream, state);
|
307
|
-
}
|
308
|
-
|
309
|
-
return {
|
310
|
-
startState: function(baseIndent) {
|
311
|
-
var state = {tokenize: inText,
|
312
|
-
state: baseState,
|
313
|
-
indented: baseIndent || 0,
|
314
|
-
tagName: null, tagStart: null,
|
315
|
-
context: null}
|
316
|
-
if (baseIndent != null) state.baseIndent = baseIndent
|
317
|
-
return state
|
318
|
-
},
|
319
|
-
|
320
|
-
token: function(stream, state) {
|
321
|
-
if (!state.tagName && stream.sol())
|
322
|
-
state.indented = stream.indentation();
|
323
|
-
|
324
|
-
if (stream.eatSpace()) return null;
|
325
|
-
type = null;
|
326
|
-
var style = state.tokenize(stream, state);
|
327
|
-
if ((style || type) && style != "comment") {
|
328
|
-
setStyle = null;
|
329
|
-
state.state = state.state(type || style, stream, state);
|
330
|
-
if (setStyle)
|
331
|
-
style = setStyle == "error" ? style + " error" : setStyle;
|
332
|
-
}
|
333
|
-
return style;
|
334
|
-
},
|
335
|
-
|
336
|
-
indent: function(state, textAfter, fullLine) {
|
337
|
-
var context = state.context;
|
338
|
-
// Indent multi-line strings (e.g. css).
|
339
|
-
if (state.tokenize.isInAttribute) {
|
340
|
-
if (state.tagStart == state.indented)
|
341
|
-
return state.stringStartCol + 1;
|
342
|
-
else
|
343
|
-
return state.indented + indentUnit;
|
344
|
-
}
|
345
|
-
if (context && context.noIndent) return CodeMirror.Pass;
|
346
|
-
if (state.tokenize != inTag && state.tokenize != inText)
|
347
|
-
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
348
|
-
// Indent the starts of attribute names.
|
349
|
-
if (state.tagName) {
|
350
|
-
if (config.multilineTagIndentPastTag !== false)
|
351
|
-
return state.tagStart + state.tagName.length + 2;
|
352
|
-
else
|
353
|
-
return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
|
354
|
-
}
|
355
|
-
if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
356
|
-
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
357
|
-
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
358
|
-
while (context) {
|
359
|
-
if (context.tagName == tagAfter[2]) {
|
360
|
-
context = context.prev;
|
361
|
-
break;
|
362
|
-
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
363
|
-
context = context.prev;
|
364
|
-
} else {
|
365
|
-
break;
|
366
|
-
}
|
367
|
-
}
|
368
|
-
} else if (tagAfter) { // Opening tag spotted
|
369
|
-
while (context) {
|
370
|
-
var grabbers = config.contextGrabbers[context.tagName];
|
371
|
-
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
372
|
-
context = context.prev;
|
373
|
-
else
|
374
|
-
break;
|
375
|
-
}
|
376
|
-
}
|
377
|
-
while (context && context.prev && !context.startOfLine)
|
378
|
-
context = context.prev;
|
379
|
-
if (context) return context.indent + indentUnit;
|
380
|
-
else return state.baseIndent || 0;
|
381
|
-
},
|
382
|
-
|
383
|
-
electricInput: /<\/[\s\w:]+>$/,
|
384
|
-
blockCommentStart: "<!--",
|
385
|
-
blockCommentEnd: "-->",
|
386
|
-
|
387
|
-
configuration: config.htmlMode ? "html" : "xml",
|
388
|
-
helperType: config.htmlMode ? "html" : "xml",
|
389
|
-
|
390
|
-
skipAttribute: function(state) {
|
391
|
-
if (state.state == attrValueState)
|
392
|
-
state.state = attrState
|
393
|
-
}
|
394
|
-
};
|
395
|
-
});
|
396
|
-
|
397
|
-
CodeMirror.defineMIME("text/xml", "xml");
|
398
|
-
CodeMirror.defineMIME("application/xml", "xml");
|
399
|
-
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
400
|
-
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
401
|
-
|
402
|
-
});
|