elabs 2.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.eslintrc.yml +26 -0
- data/.gitignore +49 -0
- data/.gitlab-ci.yml +93 -0
- data/.haml-lint.yml +4 -0
- data/.node-version +1 -0
- data/.rspec +1 -0
- data/.rubocop.yml +59 -0
- data/.ruby-version +1 -0
- data/.simplecov +5 -0
- data/.stylelintrc.yml +218 -0
- data/CHANGELOG.md +273 -0
- data/CODE_OF_CONDUCT.md +78 -0
- data/Gemfile +75 -0
- data/Gemfile.lock +376 -0
- data/LICENSE +21 -0
- data/LICENSES.md +6 -0
- data/README.md +41 -0
- data/ROADMAP.md +61 -0
- data/Rakefile +32 -0
- data/app/assets/config/elabs_manifest.js +3 -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/application.js +27 -0
- data/app/assets/javascripts/elabs/helpers-codemirror.js +29 -0
- data/app/assets/javascripts/elabs/helpers-markdown.js +42 -0
- data/app/assets/javascripts/elabs/helpers.js +17 -0
- data/app/assets/javascripts/elabs/modals.js +19 -0
- data/app/assets/javascripts/elabs/tabs.js +32 -0
- data/app/assets/stylesheets/elabs/_colors.scss +345 -0
- data/app/assets/stylesheets/elabs/_icons.scss +9 -0
- data/app/assets/stylesheets/elabs/_variables.scss +13 -0
- data/app/assets/stylesheets/elabs/app/_acts.scss +58 -0
- data/app/assets/stylesheets/elabs/app/_alerts.scss +3 -0
- data/app/assets/stylesheets/elabs/app/_buttons.scss +21 -0
- data/app/assets/stylesheets/elabs/app/_comments.scss +1 -0
- data/app/assets/stylesheets/elabs/app/_content.scss +10 -0
- data/app/assets/stylesheets/elabs/app/_content_uploads.scss +39 -0
- data/app/assets/stylesheets/elabs/app/_empty.scss +19 -0
- data/app/assets/stylesheets/elabs/app/_errors.scss +9 -0
- data/app/assets/stylesheets/elabs/app/_filter_links.scss +27 -0
- data/app/assets/stylesheets/elabs/app/_forms.scss +69 -0
- data/app/assets/stylesheets/elabs/app/_helpers.scss +3 -0
- data/app/assets/stylesheets/elabs/app/_languages.scss +6 -0
- data/app/assets/stylesheets/elabs/app/_layout.scss +194 -0
- data/app/assets/stylesheets/elabs/app/_licenses.scss +6 -0
- data/app/assets/stylesheets/elabs/app/_link-to-top.scss +8 -0
- data/app/assets/stylesheets/elabs/app/_medias.scss +12 -0
- data/app/assets/stylesheets/elabs/app/_modals.scss +53 -0
- data/app/assets/stylesheets/elabs/app/_nsfw.scss +5 -0
- data/app/assets/stylesheets/elabs/app/_pagination.scss +16 -0
- data/app/assets/stylesheets/elabs/app/_tabs.scss +54 -0
- data/app/assets/stylesheets/elabs/app/_tags.scss +6 -0
- data/app/assets/stylesheets/elabs/app/_toolbars.scss +3 -0
- data/app/assets/stylesheets/elabs/app/_users.scss +6 -0
- data/app/assets/stylesheets/elabs/app/admin-members/_forms.scss +6 -0
- data/app/assets/stylesheets/elabs/app/admin-members/_indexes.scss +70 -0
- data/app/assets/stylesheets/elabs/app/admin-members/_layout.scss +17 -0
- data/app/assets/stylesheets/elabs/app/areas/_devise.scss +31 -0
- data/app/assets/stylesheets/elabs/app/components/_cards.scss +16 -0
- data/app/assets/stylesheets/elabs/app/components/_container.scss +4 -0
- data/app/assets/stylesheets/elabs/app/mixins/_classifier-card.scss +16 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content-card.scss +58 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content-full.scss +39 -0
- data/app/assets/stylesheets/elabs/app/mixins/_icon.scss +9 -0
- data/app/assets/stylesheets/elabs/application.css +14 -0
- data/app/assets/stylesheets/elabs/lib/_codemirror.scss +26 -0
- data/app/assets/stylesheets/elabs/lib/fontawesome/_fontawesome.scss +38 -0
- data/app/assets/stylesheets/elabs/lib/fontawesome/_fonts.scss +42 -0
- data/app/assets/stylesheets/elabs/lib/fontawesome/_icons.scss +1118 -0
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss-variables.scss +230 -0
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss.scss +59 -0
- data/app/assets/stylesheets/elabs/style.scss +72 -0
- data/app/controllers/elabs/acts_controller.rb +12 -0
- data/app/controllers/elabs/admin/admin_application_controller.rb +19 -0
- data/app/controllers/elabs/admin/admin_content_application_controller.rb +66 -0
- data/app/controllers/elabs/admin/albums_controller.rb +10 -0
- data/app/controllers/elabs/admin/articles_controller.rb +10 -0
- data/app/controllers/elabs/admin/languages_controller.rb +77 -0
- data/app/controllers/elabs/admin/licenses_controller.rb +77 -0
- data/app/controllers/elabs/admin/notes_controller.rb +10 -0
- data/app/controllers/elabs/admin/projects_controller.rb +10 -0
- data/app/controllers/elabs/admin/reports_controller.rb +34 -0
- data/app/controllers/elabs/admin/tags_controller.rb +56 -0
- data/app/controllers/elabs/admin/uploads_controller.rb +10 -0
- data/app/controllers/elabs/admin/users_controller.rb +43 -0
- data/app/controllers/elabs/albums_controller.rb +26 -0
- data/app/controllers/elabs/articles_controller.rb +25 -0
- data/app/controllers/elabs/auth/callbacks_controller.rb +38 -0
- data/app/controllers/elabs/auth/confirmations_controller.rb +43 -0
- data/app/controllers/elabs/auth/passwords_controller.rb +47 -0
- data/app/controllers/elabs/auth/registrations_controller.rb +70 -0
- data/app/controllers/elabs/auth/sessions_controller.rb +36 -0
- data/app/controllers/elabs/auth/unlocks_controller.rb +38 -0
- data/app/controllers/elabs/concerns/elabs_controller.rb +18 -0
- data/app/controllers/elabs/concerns/localizable.rb +11 -0
- data/app/controllers/elabs/concerns/reportable.rb +17 -0
- data/app/controllers/elabs/content_application_controller.rb +45 -0
- data/app/controllers/elabs/elabs_application_controller.rb +95 -0
- data/app/controllers/elabs/languages_controller.rb +36 -0
- data/app/controllers/elabs/licenses_controller.rb +31 -0
- data/app/controllers/elabs/member/albums_controller.rb +11 -0
- data/app/controllers/elabs/member/articles_controller.rb +11 -0
- data/app/controllers/elabs/member/member_application_controller.rb +12 -0
- data/app/controllers/elabs/member/member_content_application_controller.rb +128 -0
- data/app/controllers/elabs/member/notes_controller.rb +11 -0
- data/app/controllers/elabs/member/preferences_controller.rb +36 -0
- data/app/controllers/elabs/member/projects_controller.rb +11 -0
- data/app/controllers/elabs/member/uploads_controller.rb +11 -0
- data/app/controllers/elabs/member/users_controller.rb +28 -0
- data/app/controllers/elabs/notes_controller.rb +25 -0
- data/app/controllers/elabs/projects_controller.rb +30 -0
- data/app/controllers/elabs/reports_controller.rb +36 -0
- data/app/controllers/elabs/tags_controller.rb +36 -0
- data/app/controllers/elabs/uploads_controller.rb +24 -0
- data/app/controllers/elabs/users_controller.rb +36 -0
- data/app/helpers/elabs/acts_helper.rb +22 -0
- data/app/helpers/elabs/admin_content_helper.rb +54 -0
- data/app/helpers/elabs/application_helper.rb +54 -0
- data/app/helpers/elabs/content_filters_helper.rb +97 -0
- data/app/helpers/elabs/content_renderer_helper.rb +13 -0
- data/app/helpers/elabs/member_content_helper.rb +47 -0
- data/app/helpers/elabs/thumbnails_helper.rb +28 -0
- data/app/helpers/elabs/time_helper.rb +19 -0
- data/app/helpers/elabs/uploads_helper.rb +19 -0
- data/app/jobs/elabs/application_job.rb +4 -0
- data/app/mailers/elabs/application_mailer.rb +6 -0
- data/app/models/elabs/act.rb +7 -0
- data/app/models/elabs/album.rb +24 -0
- data/app/models/elabs/albums_tag.rb +21 -0
- data/app/models/elabs/albums_upload.rb +21 -0
- data/app/models/elabs/application_content_record.rb +10 -0
- data/app/models/elabs/application_record.rb +5 -0
- data/app/models/elabs/article.rb +23 -0
- data/app/models/elabs/articles_tag.rb +21 -0
- data/app/models/elabs/comment.rb +12 -0
- data/app/models/elabs/concerns/actable_entity.rb +52 -0
- data/app/models/elabs/concerns/content_entity.rb +70 -0
- data/app/models/elabs/concerns/countable_entity.rb +81 -0
- data/app/models/elabs/concerns/taggable.rb +33 -0
- data/app/models/elabs/language.rb +17 -0
- data/app/models/elabs/license.rb +15 -0
- data/app/models/elabs/note.rb +21 -0
- data/app/models/elabs/notes_tag.rb +21 -0
- data/app/models/elabs/preference.rb +9 -0
- data/app/models/elabs/project.rb +25 -0
- data/app/models/elabs/projects_album.rb +21 -0
- data/app/models/elabs/projects_article.rb +21 -0
- data/app/models/elabs/projects_note.rb +21 -0
- data/app/models/elabs/projects_tag.rb +21 -0
- data/app/models/elabs/projects_upload.rb +21 -0
- data/app/models/elabs/report.rb +11 -0
- data/app/models/elabs/tag.rb +18 -0
- data/app/models/elabs/upload.rb +28 -0
- data/app/models/elabs/uploads_tag.rb +21 -0
- data/app/models/elabs/user.rb +30 -0
- data/app/validators/elabs/associated_author_validator.rb +11 -0
- data/app/views/elabs/acts/_act.json.jbuilder +2 -0
- data/app/views/elabs/acts/_filters.html.haml +3 -0
- data/app/views/elabs/acts/index.html.haml +27 -0
- data/app/views/elabs/acts/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/albums/_album.json.jbuilder +2 -0
- data/app/views/elabs/admin/albums/index.html.haml +43 -0
- data/app/views/elabs/admin/albums/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/articles/_article.json.jbuilder +2 -0
- data/app/views/elabs/admin/articles/index.html.haml +41 -0
- data/app/views/elabs/admin/articles/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/languages/_form.html.haml +18 -0
- data/app/views/elabs/admin/languages/_language.json.jbuilder +2 -0
- data/app/views/elabs/admin/languages/edit.html.haml +6 -0
- data/app/views/elabs/admin/languages/index.html.haml +34 -0
- data/app/views/elabs/admin/languages/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/languages/new.html.haml +3 -0
- data/app/views/elabs/admin/licenses/_form.html.haml +25 -0
- data/app/views/elabs/admin/licenses/_license.json.jbuilder +2 -0
- data/app/views/elabs/admin/licenses/edit.html.haml +6 -0
- data/app/views/elabs/admin/licenses/index.html.haml +42 -0
- data/app/views/elabs/admin/licenses/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/licenses/new.html.haml +3 -0
- data/app/views/elabs/admin/notes/_note.json.jbuilder +2 -0
- data/app/views/elabs/admin/notes/index.html.haml +40 -0
- data/app/views/elabs/admin/notes/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/projects/_project.json.jbuilder +2 -0
- data/app/views/elabs/admin/projects/index.html.haml +45 -0
- data/app/views/elabs/admin/projects/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/reports/index.html.haml +27 -0
- data/app/views/elabs/admin/reports/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/tags/_form.html.haml +17 -0
- data/app/views/elabs/admin/tags/_tag.json.jbuilder +2 -0
- data/app/views/elabs/admin/tags/edit.html.haml +6 -0
- data/app/views/elabs/admin/tags/index.html.haml +27 -0
- data/app/views/elabs/admin/tags/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/uploads/_upload.json.jbuilder +2 -0
- data/app/views/elabs/admin/uploads/index.html.haml +45 -0
- data/app/views/elabs/admin/uploads/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/users/_admin_user.json.jbuilder +2 -0
- data/app/views/elabs/admin/users/index.html.haml +33 -0
- data/app/views/elabs/admin/users/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/users/show.html.haml +26 -0
- data/app/views/elabs/admin/users/show.json.jbuilder +1 -0
- data/app/views/elabs/albums/_album.html.haml +38 -0
- data/app/views/elabs/albums/_album.json.jbuilder +2 -0
- data/app/views/elabs/albums/_filters.html.haml +8 -0
- data/app/views/elabs/albums/index.html.haml +9 -0
- data/app/views/elabs/albums/index.json.jbuilder +1 -0
- data/app/views/elabs/albums/show.html.haml +60 -0
- data/app/views/elabs/albums/show.json.jbuilder +1 -0
- data/app/views/elabs/articles/_article.html.haml +30 -0
- data/app/views/elabs/articles/_article.json.jbuilder +2 -0
- data/app/views/elabs/articles/_filters.html.haml +8 -0
- data/app/views/elabs/articles/index.html.haml +9 -0
- data/app/views/elabs/articles/index.json.jbuilder +1 -0
- data/app/views/elabs/articles/show.html.haml +45 -0
- data/app/views/elabs/articles/show.json.jbuilder +1 -0
- data/app/views/elabs/auth/confirmations/new.html.haml +26 -0
- data/app/views/elabs/auth/passwords/edit.html.haml +31 -0
- data/app/views/elabs/auth/passwords/new.html.haml +23 -0
- data/app/views/elabs/auth/registrations/edit.html.haml +48 -0
- data/app/views/elabs/auth/registrations/new.html.haml +34 -0
- data/app/views/elabs/auth/sessions/_new.html.haml +15 -0
- data/app/views/elabs/auth/sessions/new.html.haml +8 -0
- data/app/views/elabs/auth/shared/_links.html.haml +16 -0
- data/app/views/elabs/auth/unlocks/new.html.haml +23 -0
- data/app/views/elabs/comments/_comment.json.jbuilder +2 -0
- data/app/views/elabs/comments/_comments.html.haml +21 -0
- data/app/views/elabs/comments/_form.html.haml +31 -0
- data/app/views/elabs/languages/_associations.html.haml +51 -0
- data/app/views/elabs/languages/_filters.html.haml +6 -0
- data/app/views/elabs/languages/_language.json.jbuilder +2 -0
- data/app/views/elabs/languages/index.html.haml +33 -0
- data/app/views/elabs/languages/index.json.jbuilder +1 -0
- data/app/views/elabs/languages/show.html.haml +38 -0
- data/app/views/elabs/languages/show.json.jbuilder +1 -0
- data/app/views/elabs/layouts/_empty.html.haml +3 -0
- data/app/views/elabs/layouts/_footer.html.haml +6 -0
- data/app/views/elabs/layouts/_hidden_entry.html.haml +6 -0
- data/app/views/elabs/layouts/_hidden_entry_full.html.haml +6 -0
- data/app/views/elabs/layouts/_language_menu.html.haml +2 -0
- data/app/views/elabs/layouts/_menu.html.haml +72 -0
- data/app/views/elabs/layouts/admin_application.html.haml +21 -0
- data/app/views/elabs/layouts/application.html.haml +37 -0
- data/app/views/elabs/layouts/lists/_albums.html.haml +10 -0
- data/app/views/elabs/layouts/lists/_projects.html.haml +10 -0
- data/app/views/elabs/layouts/lists/_tags.html.haml +9 -0
- data/app/views/elabs/layouts/mailer.html.haml +8 -0
- data/app/views/elabs/layouts/mailer.text.haml +1 -0
- data/app/views/elabs/layouts/member_application.html.haml +21 -0
- data/app/views/elabs/licenses/_associations.html.haml +51 -0
- data/app/views/elabs/licenses/_filters.html.haml +3 -0
- data/app/views/elabs/licenses/_license.json.jbuilder +2 -0
- data/app/views/elabs/licenses/index.html.haml +27 -0
- data/app/views/elabs/licenses/index.json.jbuilder +1 -0
- data/app/views/elabs/licenses/show.html.haml +44 -0
- data/app/views/elabs/licenses/show.json.jbuilder +1 -0
- data/app/views/elabs/member/albums/_album.json.jbuilder +2 -0
- data/app/views/elabs/member/albums/_form.html.haml +64 -0
- data/app/views/elabs/member/albums/edit.html.haml +6 -0
- data/app/views/elabs/member/albums/index.html.haml +49 -0
- data/app/views/elabs/member/albums/index.json.jbuilder +1 -0
- data/app/views/elabs/member/albums/new.html.haml +3 -0
- data/app/views/elabs/member/articles/_article.json.jbuilder +2 -0
- data/app/views/elabs/member/articles/_form.html.haml +70 -0
- data/app/views/elabs/member/articles/edit.html.haml +6 -0
- data/app/views/elabs/member/articles/index.html.haml +47 -0
- data/app/views/elabs/member/articles/index.json.jbuilder +1 -0
- data/app/views/elabs/member/articles/new.html.haml +3 -0
- data/app/views/elabs/member/layouts/_empty.html.haml +4 -0
- data/app/views/elabs/member/layouts/_markdown-preview.html.haml +8 -0
- data/app/views/elabs/member/notes/_form.html.haml +54 -0
- data/app/views/elabs/member/notes/_note.json.jbuilder +2 -0
- data/app/views/elabs/member/notes/edit.html.haml +6 -0
- data/app/views/elabs/member/notes/index.html.haml +47 -0
- data/app/views/elabs/member/notes/index.json.jbuilder +1 -0
- data/app/views/elabs/member/notes/new.html.haml +3 -0
- data/app/views/elabs/member/preferences/_form.html.haml +20 -0
- data/app/views/elabs/member/preferences/edit.html.haml +3 -0
- data/app/views/elabs/member/projects/_form.html.haml +71 -0
- data/app/views/elabs/member/projects/_project.json.jbuilder +2 -0
- data/app/views/elabs/member/projects/edit.html.haml +6 -0
- data/app/views/elabs/member/projects/index.html.haml +53 -0
- data/app/views/elabs/member/projects/index.json.jbuilder +1 -0
- data/app/views/elabs/member/projects/new.html.haml +3 -0
- data/app/views/elabs/member/uploads/_form.html.haml +67 -0
- data/app/views/elabs/member/uploads/_upload.json.jbuilder +2 -0
- data/app/views/elabs/member/uploads/edit.html.haml +6 -0
- data/app/views/elabs/member/uploads/index.html.haml +61 -0
- data/app/views/elabs/member/uploads/index.json.jbuilder +1 -0
- data/app/views/elabs/member/uploads/new.html.haml +3 -0
- data/app/views/elabs/member/users/_form.html.haml +38 -0
- data/app/views/elabs/notes/_filters.html.haml +7 -0
- data/app/views/elabs/notes/_note.html.haml +31 -0
- data/app/views/elabs/notes/_note.json.jbuilder +2 -0
- data/app/views/elabs/notes/index.html.haml +9 -0
- data/app/views/elabs/notes/index.json.jbuilder +1 -0
- data/app/views/elabs/notes/show.html.haml +44 -0
- data/app/views/elabs/notes/show.json.jbuilder +1 -0
- data/app/views/elabs/projects/_associations.html.haml +46 -0
- data/app/views/elabs/projects/_filters.html.haml +8 -0
- data/app/views/elabs/projects/_project.html.haml +29 -0
- data/app/views/elabs/projects/index.html.haml +9 -0
- data/app/views/elabs/projects/index.json.jbuilder +1 -0
- data/app/views/elabs/projects/show.html.haml +71 -0
- data/app/views/elabs/projects/show.json.jbuilder +1 -0
- data/app/views/elabs/reports/_form.html.haml +29 -0
- data/app/views/elabs/tags/_associations.html.haml +51 -0
- data/app/views/elabs/tags/_filters.html.haml +3 -0
- data/app/views/elabs/tags/_tag.json.jbuilder +2 -0
- data/app/views/elabs/tags/index.html.haml +26 -0
- data/app/views/elabs/tags/index.json.jbuilder +1 -0
- data/app/views/elabs/tags/show.html.haml +34 -0
- data/app/views/elabs/tags/show.json.jbuilder +1 -0
- data/app/views/elabs/uploads/_filters.html.haml +7 -0
- data/app/views/elabs/uploads/_player.html.haml +10 -0
- data/app/views/elabs/uploads/_preview.html.haml +17 -0
- data/app/views/elabs/uploads/_upload.html.haml +41 -0
- data/app/views/elabs/uploads/_upload.json.jbuilder +2 -0
- data/app/views/elabs/uploads/index.html.haml +9 -0
- data/app/views/elabs/uploads/index.json.jbuilder +1 -0
- data/app/views/elabs/uploads/show.html.haml +58 -0
- data/app/views/elabs/uploads/show.json.jbuilder +1 -0
- data/app/views/elabs/users/_associations.html.haml +51 -0
- data/app/views/elabs/users/_filters.html.haml +4 -0
- data/app/views/elabs/users/_user.html.haml +31 -0
- data/app/views/elabs/users/_user.json.jbuilder +2 -0
- data/app/views/elabs/users/index.html.haml +7 -0
- data/app/views/elabs/users/index.json.jbuilder +1 -0
- data/app/views/elabs/users/show.html.haml +48 -0
- data/app/views/elabs/users/show.json.jbuilder +1 -0
- data/bin/rails +14 -0
- data/config.ru +5 -0
- data/config/brakeman.ignore +124 -0
- data/config/brakeman.yml +3 -0
- data/config/cucumber.yml +9 -0
- data/config/routes.rb +116 -0
- data/db/migrate/20180813000000_devise_update_users.rb +15 -0
- data/db/migrate/20180813000001_create_languages.rb +16 -0
- data/db/migrate/20180813000002_create_tags.rb +14 -0
- data/db/migrate/20180813000004_create_licenses.rb +17 -0
- data/db/migrate/20180813000005_create_reports.rb +15 -0
- data/db/migrate/20180813000006_create_comments.rb +15 -0
- data/db/migrate/20180813000007_create_acts.rb +10 -0
- data/db/migrate/20180813000008_create_preferences.rb +13 -0
- data/db/migrate/20180813000009_create_active_storage_tables.active_storage.rb +26 -0
- data/db/migrate/20180813000010_create_albums.rb +23 -0
- data/db/migrate/20180813000011_create_articles.rb +23 -0
- data/db/migrate/20180813000012_create_notes.rb +21 -0
- data/db/migrate/20180813000013_create_uploads.rb +26 -0
- data/db/migrate/20180813000014_create_projects.rb +44 -0
- data/db/seeds.rb +10 -0
- data/db/seeds_development.rb +21 -0
- data/db/seeds_production.rb +0 -0
- data/docs/contributing.md +52 -0
- data/docs/cucumber_terms.md +9 -0
- data/docs/migrating.md +4 -0
- data/docs/overriding.md +20 -0
- data/docs/setup.md +136 -0
- data/docs/tips.md +13 -0
- data/elabs.gemspec +25 -0
- data/lib/assets/javascripts/README-highlight.js.md +39 -0
- data/lib/assets/javascripts/codemirror-5.39.2/addon/mode/overlay.js +90 -0
- data/lib/assets/javascripts/codemirror-5.39.2/lib/codemirror.js +9684 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/clike/clike.js +834 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/css/css.js +832 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/gfm/gfm.js +129 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/htmlmixed/htmlmixed.js +152 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/javascript/javascript.js +896 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/markdown/markdown.js +882 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/meta.js +217 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/xml/xml.js +402 -0
- data/lib/assets/javascripts/highlight.js-9.12.0/highlight.pack.js +2 -0
- data/lib/assets/javascripts/markdown-it-8.4.2.min.js +1 -0
- data/lib/assets/stylesheets/codemirror-5.39.2/lib/codemirror.css +346 -0
- data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-dark.css +38 -0
- data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-light.css +38 -0
- data/lib/assets/stylesheets/highlight.js-9.12.0/styles/atelier-sulphurpool-light.css +69 -0
- data/lib/elabs.rb +41 -0
- data/lib/elabs/engine.rb +5 -0
- data/lib/elabs/version.rb +3 -0
- data/lib/generators/elabs/assets_generator.rb +36 -0
- data/lib/generators/elabs/devise_views_generator.rb +24 -0
- data/lib/generators/elabs/install_generator.rb +26 -0
- data/lib/generators/elabs/required_assets_generator.rb +26 -0
- data/lib/generators/elabs/views_generator.rb +25 -0
- data/lib/generators/templates/elabs.rb +25 -0
- data/lib/generators/templates/fast_gettext.rb +3 -0
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/cucumber.rake +75 -0
- data/lib/tasks/elabs_tasks.rake +4 -0
- data/lib/tasks/factory_bot.rake +14 -0
- data/lib/tasks/wipe.rake +31 -0
- data/locale/app.pot +1124 -0
- data/locale/devise_strings.rb +88 -0
- data/locale/en/app.edit.po +1123 -0
- data/locale/en/app.po +1123 -0
- data/locale/en/app.po.time_stamp +0 -0
- data/locale/fr/app.edit.po +1126 -0
- data/locale/fr/app.po +1125 -0
- data/locale/fr/app.po.time_stamp +0 -0
- data/locale/model_attributes.rb +85 -0
- data/package.json +22 -0
- data/script/cucumber +10 -0
- data/tmp/pids/.keep +0 -0
- data/yarn.lock +2759 -0
- metadata +463 -0
@@ -0,0 +1,217 @@
|
|
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
|
+
});
|
@@ -0,0 +1,402 @@
|
|
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
|
+
});
|