glebtv-ckeditor 4.6.0 → 4.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +15 -22
- data/MIT-LICENSE +0 -0
- data/README.md +2 -325
- data/Rakefile +1 -2
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_add.jpg +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_add.png +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_del.png +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_more.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/preloader.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/avi.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/ckfnothumb.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/doc.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/docx.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/exe.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/gz.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/htm.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/jpg.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/mp3.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/mpg.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/pdf.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/psd.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/rar.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/swf.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/tar.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/txt.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/unknown.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/wmv.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/xls.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/xlsx.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/zip.gif +0 -0
- data/app/assets/javascripts/ckeditor/application.js +0 -0
- data/app/assets/javascripts/ckeditor/config.js.erb +1 -2
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/{application.js.erb → application.js} +4 -6
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.endless-scroll.js +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.tmpl.min.js +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/rails.js +0 -0
- data/app/assets/javascripts/ckeditor/init.js.erb +0 -0
- data/app/assets/stylesheets/ckeditor/application.css +1 -1
- data/app/assets/stylesheets/ckeditor/filebrowser/uploader.scss +172 -0
- data/app/controllers/ckeditor/application_controller.rb +9 -10
- data/app/controllers/ckeditor/attachment_files_controller.rb +11 -12
- data/app/controllers/ckeditor/pictures_controller.rb +10 -12
- data/app/helpers/ckeditor/application_helper.rb +1 -10
- data/app/views/ckeditor/attachment_files/index.html.erb +5 -5
- data/app/views/ckeditor/pictures/index.html.erb +5 -5
- data/app/views/ckeditor/shared/_asset.html.erb +18 -21
- data/app/views/ckeditor/shared/_asset_tmpl.html.erb +17 -20
- data/app/views/layouts/ckeditor/application.html.erb +3 -3
- data/config/locales/en.ckeditor.yml +0 -0
- data/config/locales/ru.ckeditor.yml +0 -0
- data/config/routes.rb +2 -2
- data/lib/ckeditor.rb +42 -34
- data/lib/ckeditor/asset_response.rb +74 -25
- data/lib/ckeditor/backend/carrierwave.rb +8 -5
- data/lib/ckeditor/backend/dragonfly.rb +5 -3
- data/lib/ckeditor/backend/paperclip.rb +15 -22
- data/lib/ckeditor/backend/refile.rb +6 -4
- data/lib/ckeditor/helpers/controllers.rb +15 -20
- data/lib/ckeditor/helpers/form_builder.rb +1 -1
- data/lib/ckeditor/helpers/form_helper.rb +0 -0
- data/lib/ckeditor/helpers/view_helper.rb +0 -0
- data/lib/ckeditor/hooks/cancan.rb +0 -2
- data/lib/ckeditor/hooks/formtastic.rb +2 -2
- data/lib/ckeditor/hooks/pundit.rb +1 -4
- data/lib/ckeditor/hooks/simple_form.rb +9 -14
- data/lib/ckeditor/http.rb +9 -11
- data/lib/ckeditor/orm/active_record.rb +1 -3
- data/lib/ckeditor/orm/base.rb +5 -5
- data/lib/ckeditor/orm/mongoid.rb +4 -6
- data/lib/ckeditor/paginatable.rb +3 -1
- data/lib/ckeditor/rails.rb +39 -0
- data/lib/ckeditor/text_area.rb +16 -15
- data/lib/ckeditor/utils.rb +45 -39
- data/lib/ckeditor/utils/content_type_detector.rb +7 -10
- data/lib/ckeditor/utils/javascript_code.rb +8 -3
- data/lib/ckeditor/version.rb +2 -2
- data/lib/generators/ckeditor/install_generator.rb +52 -30
- data/lib/generators/ckeditor/pundit_policy_generator.rb +1 -3
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +2 -2
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +6 -10
- data/lib/generators/ckeditor/templates/active_record/carrierwave/migration_versioned.rb +22 -0
- data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/asset.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/attachment_file.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb +4 -4
- data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +6 -10
- data/lib/generators/ckeditor/templates/active_record/dragonfly/migration_versioned.rb +23 -0
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/asset.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +3 -3
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +5 -5
- data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +2 -5
- data/lib/generators/ckeditor/templates/active_record/paperclip/migration_versioned.rb +23 -0
- data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/asset.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/attachment_file.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/picture.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +7 -12
- data/lib/generators/ckeditor/templates/active_record/refile/migration_versioned.rb +23 -0
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +0 -0
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +4 -4
- data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +4 -5
- data/lib/generators/ckeditor/templates/ckeditor.rb +16 -7
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +2 -2
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +1 -1
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +1 -1
- data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/asset.rb +0 -0
- data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb +5 -5
- data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb +5 -5
- data/lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb +2 -2
- data/lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb +2 -2
- data/lib/glebtv-ckeditor.rb +0 -0
- data/lib/tasks/ckeditor.rake +6 -14
- data/test/controllers/attachment_files_controller_test.rb +0 -0
- data/test/controllers/pictures_controller_test.rb +0 -0
- data/test/dummy/Rakefile +0 -0
- data/test/dummy/app/assets/javascripts/application.js +0 -0
- data/test/dummy/app/assets/stylesheets/application.css +0 -0
- data/test/dummy/app/assets/stylesheets/scaffold.css +0 -0
- data/test/dummy/app/controllers/application_controller.rb +0 -0
- data/test/dummy/app/controllers/posts_controller.rb +0 -0
- data/test/dummy/app/helpers/application_helper.rb +0 -0
- data/test/dummy/app/helpers/posts_helper.rb +0 -0
- data/test/dummy/app/models/post.rb +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +0 -0
- data/test/dummy/app/views/posts/_form.html.erb +0 -0
- data/test/dummy/app/views/posts/edit.html.erb +0 -0
- data/test/dummy/app/views/posts/index.html.erb +0 -0
- data/test/dummy/app/views/posts/new.html.erb +0 -0
- data/test/dummy/app/views/posts/show.html.erb +0 -0
- data/test/dummy/config.ru +0 -0
- data/test/dummy/config/application.rb +0 -0
- data/test/dummy/config/boot.rb +0 -0
- data/test/dummy/config/database.yml +0 -0
- data/test/dummy/config/environment.rb +0 -0
- data/test/dummy/config/environments/development.rb +0 -0
- data/test/dummy/config/environments/production.rb +0 -0
- data/test/dummy/config/environments/test.rb +0 -0
- data/test/dummy/config/initializers/assets.rb +1 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/test/dummy/config/initializers/ckeditor.rb +0 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -0
- data/test/dummy/config/initializers/inflections.rb +0 -0
- data/test/dummy/config/initializers/mime_types.rb +0 -0
- data/test/dummy/config/initializers/paperclip.rb +3 -0
- data/test/dummy/config/initializers/session_store.rb +0 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -0
- data/test/dummy/config/locales/en.yml +0 -0
- data/test/dummy/config/mongoid.yml +0 -0
- data/test/dummy/config/routes.rb +0 -0
- data/test/dummy/config/secrets.yml +0 -0
- data/test/dummy/db/migrate/20110623120047_create_posts.rb +0 -0
- data/test/dummy/public/404.html +0 -0
- data/test/dummy/public/422.html +0 -0
- data/test/dummy/public/500.html +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -0
- data/test/dummy/test/fixtures/files/rails.png +0 -0
- data/test/dummy/test/fixtures/files/rails.tar.gz +0 -0
- data/test/functional/posts_controller_test.rb +2 -3
- data/test/generators/install_generator_test.rb +2 -2
- data/test/integration/navigation_test.rb +0 -0
- data/test/models/attachment_file_test.rb +3 -8
- data/test/models/ckeditor_test.rb +1 -1
- data/test/models/picture_test.rb +0 -0
- data/test/models/utils_test.rb +6 -6
- data/test/orm/active_record.rb +0 -0
- data/test/orm/mongoid.rb +0 -0
- data/test/support/helpers.rb +0 -0
- data/test/support/integration_case.rb +0 -0
- data/test/support/raw_post.rb +0 -0
- data/test/support/routes.txt +0 -0
- data/test/test_helper.rb +1 -1
- data/vendor/assets/javascripts/ckeditor/CHANGES.md +1358 -0
- data/vendor/assets/javascripts/ckeditor/README.md +39 -0
- data/vendor/assets/javascripts/ckeditor/build-config.js +31 -30
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +709 -675
- data/vendor/assets/javascripts/ckeditor/config.js +10 -0
- data/vendor/assets/javascripts/ckeditor/contents.css +208 -0
- data/vendor/assets/javascripts/ckeditor/lang/en.js +4 -4
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +4 -4
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +5 -5
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +3 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +6 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +230 -74
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/abcdef.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +2 -3
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/icecoder.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/material.css +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +0 -2
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/seti.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/yeti.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +4 -3
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +23 -23
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/hidpi/loremipsum.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/loremipsum.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/en.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/ru.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +13 -7
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +49 -39
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/dialog.css +23 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +33 -19
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +6 -1
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +92 -23
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +81 -82
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon-hdpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +2 -1
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +448 -448
- data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +1632 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/github-top.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/header-bg.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/header-separator.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/navigation-tip.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/index.html +128 -0
- data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +53 -0
- data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +17 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +85 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/api.html +210 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +59 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +204 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +59 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/sample.jpg +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +7 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +508 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +48 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +190 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +144 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +106 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/swfobject.js +19 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +283 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +224 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/index.html +131 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +314 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +124 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +113 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +103 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +209 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +76 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +60 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +59 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +357 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +50 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +16 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +78 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +235 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +72 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +122 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +80 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +234 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/css/fontello.css +55 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +10 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/config.json +28 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.svg +14 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +446 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +13 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +9 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +33 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +14 -0
- data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/LICENSE.md → samples/toolbarconfigurator/lib/codemirror/LICENSE} +19 -21
- data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/css → samples/toolbarconfigurator/lib/codemirror}/codemirror.css +325 -341
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +288 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +25 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +36 -0
- data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/js/addon/hint → samples/toolbarconfigurator/lib/codemirror}/show-hint.css +38 -36
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +16 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/arrow.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/readme.md +7 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons16.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons16.svg +2374 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons32.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons32.svg +2722 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/locations.json +145 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/skin.js +10 -0
- data/vendor/assets/javascripts/ckeditor/styles.js +1 -1
- metadata +182 -177
- data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.erb +0 -128
- data/app/views/rails_admin/main/_form_ck_editor.html.haml +0 -10
- data/app/views/rails_admin/main/_form_ck_editorml.html.haml +0 -11
- data/config/locales/bg.ckeditor.yml +0 -9
- data/config/locales/cs.ckeditor.yml +0 -9
- data/config/locales/de.ckeditor.yml +0 -9
- data/config/locales/el-GR.cdkeditor.yml +0 -9
- data/config/locales/es.ckeditor.yml +0 -9
- data/config/locales/fr.ckeditor.yml +0 -9
- data/config/locales/hu.ckeditor.yml +0 -9
- data/config/locales/it.ckeditor.yml +0 -9
- data/config/locales/ja.ckeditor.yml +0 -9
- data/config/locales/nb.ckeditor.yml +0 -9
- data/config/locales/nl.ckeditor.yml +0 -9
- data/config/locales/pl.ckeditor.yml +0 -9
- data/config/locales/pt-BR.ckeditor.yml +0 -9
- data/config/locales/pt-PT.ckeditor.yml +0 -9
- data/config/locales/sv-SE.ckeditor.yml +0 -9
- data/config/locales/tr.ckeditor.yml +0 -9
- data/config/locales/uk.ckeditor.yml +0 -9
- data/config/locales/zh-CN.ckeditor.yml +0 -9
- data/config/locales/zh-TW.ckeditor.yml +0 -9
- data/lib/ckeditor/engine.rb +0 -46
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +0 -183
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/comment.js +0 -206
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/continuecomment.js +0 -85
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.css +0 -32
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +0 -157
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +0 -202
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +0 -169
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +0 -51
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +0 -122
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchtags.js +0 -66
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/trailingspace.js +0 -27
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +0 -105
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/comment-fold.js +0 -59
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +0 -150
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.css +0 -20
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.js +0 -146
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/indent-fold.js +0 -44
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/markdown-fold.js +0 -49
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +0 -182
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +0 -43
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +0 -226
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/anyword-hint.js +0 -41
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/css-hint.js +0 -60
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/html-hint.js +0 -348
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/javascript-hint.js +0 -155
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.js +0 -438
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/sql-hint.js +0 -271
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/xml-hint.js +0 -110
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/loadmode.js +0 -64
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex.js +0 -123
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex_test.js +0 -33
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/overlay.js +0 -85
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/simple.js +0 -213
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/jump-to-line.js +0 -49
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +0 -165
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.css +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.js +0 -97
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +0 -252
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +0 -189
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/active-line.js +0 -74
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/mark-selection.js +0 -118
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/selection-pointer.js +0 -98
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify-html.js +0 -952
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.js +0 -2087
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +0 -9109
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/bbcode.js +0 -137
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/index.html +0 -73
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/bbcodemixed.js +0 -161
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/index.html +0 -128
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/clike.js +0 -785
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/index.html +0 -360
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/scala.html +0 -767
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/test.js +0 -55
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/css.js +0 -825
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss.html +0 -103
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss_test.js +0 -17
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/index.html +0 -75
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less.html +0 -152
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less_test.js +0 -54
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss.html +0 -157
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss_test.js +0 -110
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/test.js +0 -200
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/htmlembedded.js +0 -28
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/index.html +0 -60
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/htmlmixed.js +0 -152
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/index.html +0 -89
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/index.html +0 -114
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/javascript.js +0 -784
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/json-ld.html +0 -72
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/test.js +0 -247
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/typescript.html +0 -61
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/index.html +0 -64
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/php.js +0 -234
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/test.js +0 -154
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/index.html +0 -61
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/test.js +0 -51
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/xml.js +0 -394
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/LICENSE.md +0 -15
@@ -1,202 +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
|
-
var defaults = {
|
13
|
-
pairs: "()[]{}''\"\"",
|
14
|
-
triples: "",
|
15
|
-
explode: "[]{}"
|
16
|
-
};
|
17
|
-
|
18
|
-
var Pos = CodeMirror.Pos;
|
19
|
-
|
20
|
-
CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
|
21
|
-
if (old && old != CodeMirror.Init) {
|
22
|
-
cm.removeKeyMap(keyMap);
|
23
|
-
cm.state.closeBrackets = null;
|
24
|
-
}
|
25
|
-
if (val) {
|
26
|
-
cm.state.closeBrackets = val;
|
27
|
-
cm.addKeyMap(keyMap);
|
28
|
-
}
|
29
|
-
});
|
30
|
-
|
31
|
-
function getOption(conf, name) {
|
32
|
-
if (name == "pairs" && typeof conf == "string") return conf;
|
33
|
-
if (typeof conf == "object" && conf[name] != null) return conf[name];
|
34
|
-
return defaults[name];
|
35
|
-
}
|
36
|
-
|
37
|
-
var bind = defaults.pairs + "`";
|
38
|
-
var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
|
39
|
-
for (var i = 0; i < bind.length; i++)
|
40
|
-
keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i));
|
41
|
-
|
42
|
-
function handler(ch) {
|
43
|
-
return function(cm) { return handleChar(cm, ch); };
|
44
|
-
}
|
45
|
-
|
46
|
-
function getConfig(cm) {
|
47
|
-
var deflt = cm.state.closeBrackets;
|
48
|
-
if (!deflt) return null;
|
49
|
-
var mode = cm.getModeAt(cm.getCursor());
|
50
|
-
return mode.closeBrackets || deflt;
|
51
|
-
}
|
52
|
-
|
53
|
-
function handleBackspace(cm) {
|
54
|
-
var conf = getConfig(cm);
|
55
|
-
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
56
|
-
|
57
|
-
var pairs = getOption(conf, "pairs");
|
58
|
-
var ranges = cm.listSelections();
|
59
|
-
for (var i = 0; i < ranges.length; i++) {
|
60
|
-
if (!ranges[i].empty()) return CodeMirror.Pass;
|
61
|
-
var around = charsAround(cm, ranges[i].head);
|
62
|
-
if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
63
|
-
}
|
64
|
-
for (var i = ranges.length - 1; i >= 0; i--) {
|
65
|
-
var cur = ranges[i].head;
|
66
|
-
cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete");
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
function handleEnter(cm) {
|
71
|
-
var conf = getConfig(cm);
|
72
|
-
var explode = conf && getOption(conf, "explode");
|
73
|
-
if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;
|
74
|
-
|
75
|
-
var ranges = cm.listSelections();
|
76
|
-
for (var i = 0; i < ranges.length; i++) {
|
77
|
-
if (!ranges[i].empty()) return CodeMirror.Pass;
|
78
|
-
var around = charsAround(cm, ranges[i].head);
|
79
|
-
if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
80
|
-
}
|
81
|
-
cm.operation(function() {
|
82
|
-
cm.replaceSelection("\n\n", null);
|
83
|
-
cm.execCommand("goCharLeft");
|
84
|
-
ranges = cm.listSelections();
|
85
|
-
for (var i = 0; i < ranges.length; i++) {
|
86
|
-
var line = ranges[i].head.line;
|
87
|
-
cm.indentLine(line, null, true);
|
88
|
-
cm.indentLine(line + 1, null, true);
|
89
|
-
}
|
90
|
-
});
|
91
|
-
}
|
92
|
-
|
93
|
-
function contractSelection(sel) {
|
94
|
-
var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;
|
95
|
-
return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),
|
96
|
-
head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};
|
97
|
-
}
|
98
|
-
|
99
|
-
function handleChar(cm, ch) {
|
100
|
-
var conf = getConfig(cm);
|
101
|
-
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
102
|
-
|
103
|
-
var pairs = getOption(conf, "pairs");
|
104
|
-
var pos = pairs.indexOf(ch);
|
105
|
-
if (pos == -1) return CodeMirror.Pass;
|
106
|
-
var triples = getOption(conf, "triples");
|
107
|
-
|
108
|
-
var identical = pairs.charAt(pos + 1) == ch;
|
109
|
-
var ranges = cm.listSelections();
|
110
|
-
var opening = pos % 2 == 0;
|
111
|
-
|
112
|
-
var type;
|
113
|
-
for (var i = 0; i < ranges.length; i++) {
|
114
|
-
var range = ranges[i], cur = range.head, curType;
|
115
|
-
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
|
116
|
-
if (opening && !range.empty()) {
|
117
|
-
curType = "surround";
|
118
|
-
} else if ((identical || !opening) && next == ch) {
|
119
|
-
if (identical && stringStartsAfter(cm, cur))
|
120
|
-
curType = "both";
|
121
|
-
else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
|
122
|
-
curType = "skipThree";
|
123
|
-
else
|
124
|
-
curType = "skip";
|
125
|
-
} else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
|
126
|
-
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&
|
127
|
-
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
|
128
|
-
curType = "addFour";
|
129
|
-
} else if (identical) {
|
130
|
-
if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both";
|
131
|
-
else return CodeMirror.Pass;
|
132
|
-
} else if (opening && (cm.getLine(cur.line).length == cur.ch ||
|
133
|
-
isClosingBracket(next, pairs) ||
|
134
|
-
/\s/.test(next))) {
|
135
|
-
curType = "both";
|
136
|
-
} else {
|
137
|
-
return CodeMirror.Pass;
|
138
|
-
}
|
139
|
-
if (!type) type = curType;
|
140
|
-
else if (type != curType) return CodeMirror.Pass;
|
141
|
-
}
|
142
|
-
|
143
|
-
var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
|
144
|
-
var right = pos % 2 ? ch : pairs.charAt(pos + 1);
|
145
|
-
cm.operation(function() {
|
146
|
-
if (type == "skip") {
|
147
|
-
cm.execCommand("goCharRight");
|
148
|
-
} else if (type == "skipThree") {
|
149
|
-
for (var i = 0; i < 3; i++)
|
150
|
-
cm.execCommand("goCharRight");
|
151
|
-
} else if (type == "surround") {
|
152
|
-
var sels = cm.getSelections();
|
153
|
-
for (var i = 0; i < sels.length; i++)
|
154
|
-
sels[i] = left + sels[i] + right;
|
155
|
-
cm.replaceSelections(sels, "around");
|
156
|
-
sels = cm.listSelections().slice();
|
157
|
-
for (var i = 0; i < sels.length; i++)
|
158
|
-
sels[i] = contractSelection(sels[i]);
|
159
|
-
cm.setSelections(sels);
|
160
|
-
} else if (type == "both") {
|
161
|
-
cm.replaceSelection(left + right, null);
|
162
|
-
cm.triggerElectric(left + right);
|
163
|
-
cm.execCommand("goCharLeft");
|
164
|
-
} else if (type == "addFour") {
|
165
|
-
cm.replaceSelection(left + left + left + left, "before");
|
166
|
-
cm.execCommand("goCharRight");
|
167
|
-
}
|
168
|
-
});
|
169
|
-
}
|
170
|
-
|
171
|
-
function isClosingBracket(ch, pairs) {
|
172
|
-
var pos = pairs.lastIndexOf(ch);
|
173
|
-
return pos > -1 && pos % 2 == 1;
|
174
|
-
}
|
175
|
-
|
176
|
-
function charsAround(cm, pos) {
|
177
|
-
var str = cm.getRange(Pos(pos.line, pos.ch - 1),
|
178
|
-
Pos(pos.line, pos.ch + 1));
|
179
|
-
return str.length == 2 ? str : null;
|
180
|
-
}
|
181
|
-
|
182
|
-
// Project the token type that will exists after the given char is
|
183
|
-
// typed, and use it to determine whether it would cause the start
|
184
|
-
// of a string token.
|
185
|
-
function enteringString(cm, pos, ch) {
|
186
|
-
var line = cm.getLine(pos.line);
|
187
|
-
var token = cm.getTokenAt(pos);
|
188
|
-
if (/\bstring2?\b/.test(token.type)) return false;
|
189
|
-
var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
|
190
|
-
stream.pos = stream.start = token.start;
|
191
|
-
for (;;) {
|
192
|
-
var type1 = cm.getMode().token(stream, token.state);
|
193
|
-
if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1);
|
194
|
-
stream.start = stream.pos;
|
195
|
-
}
|
196
|
-
}
|
197
|
-
|
198
|
-
function stringStartsAfter(cm, pos) {
|
199
|
-
var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))
|
200
|
-
return /\bstring/.test(token.type) && token.start == pos.ch
|
201
|
-
}
|
202
|
-
});
|
@@ -1,169 +0,0 @@
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
-
|
4
|
-
/**
|
5
|
-
* Tag-closer extension for CodeMirror.
|
6
|
-
*
|
7
|
-
* This extension adds an "autoCloseTags" option that can be set to
|
8
|
-
* either true to get the default behavior, or an object to further
|
9
|
-
* configure its behavior.
|
10
|
-
*
|
11
|
-
* These are supported options:
|
12
|
-
*
|
13
|
-
* `whenClosing` (default true)
|
14
|
-
* Whether to autoclose when the '/' of a closing tag is typed.
|
15
|
-
* `whenOpening` (default true)
|
16
|
-
* Whether to autoclose the tag when the final '>' of an opening
|
17
|
-
* tag is typed.
|
18
|
-
* `dontCloseTags` (default is empty tags for HTML, none for XML)
|
19
|
-
* An array of tag names that should not be autoclosed.
|
20
|
-
* `indentTags` (default is block tags for HTML, none for XML)
|
21
|
-
* An array of tag names that should, when opened, cause a
|
22
|
-
* blank line to be added inside the tag, and the blank line and
|
23
|
-
* closing line to be indented.
|
24
|
-
*
|
25
|
-
* See demos/closetag.html for a usage example.
|
26
|
-
*/
|
27
|
-
|
28
|
-
(function(mod) {
|
29
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
30
|
-
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
|
31
|
-
else if (typeof define == "function" && define.amd) // AMD
|
32
|
-
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
|
33
|
-
else // Plain browser env
|
34
|
-
mod(CodeMirror);
|
35
|
-
})(function(CodeMirror) {
|
36
|
-
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
|
37
|
-
if (old != CodeMirror.Init && old)
|
38
|
-
cm.removeKeyMap("autoCloseTags");
|
39
|
-
if (!val) return;
|
40
|
-
var map = {name: "autoCloseTags"};
|
41
|
-
if (typeof val != "object" || val.whenClosing)
|
42
|
-
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
|
43
|
-
if (typeof val != "object" || val.whenOpening)
|
44
|
-
map["'>'"] = function(cm) { return autoCloseGT(cm); };
|
45
|
-
cm.addKeyMap(map);
|
46
|
-
});
|
47
|
-
|
48
|
-
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
|
49
|
-
"source", "track", "wbr"];
|
50
|
-
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
|
51
|
-
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
|
52
|
-
|
53
|
-
function autoCloseGT(cm) {
|
54
|
-
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
55
|
-
var ranges = cm.listSelections(), replacements = [];
|
56
|
-
for (var i = 0; i < ranges.length; i++) {
|
57
|
-
if (!ranges[i].empty()) return CodeMirror.Pass;
|
58
|
-
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
59
|
-
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
60
|
-
if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
|
61
|
-
|
62
|
-
var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
|
63
|
-
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
|
64
|
-
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
|
65
|
-
|
66
|
-
var tagName = state.tagName;
|
67
|
-
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
68
|
-
var lowerTagName = tagName.toLowerCase();
|
69
|
-
// Don't process the '>' at the end of an end-tag or self-closing tag
|
70
|
-
if (!tagName ||
|
71
|
-
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
|
72
|
-
tok.type == "tag" && state.type == "closeTag" ||
|
73
|
-
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
|
74
|
-
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
|
75
|
-
closingTagExists(cm, tagName, pos, state, true))
|
76
|
-
return CodeMirror.Pass;
|
77
|
-
|
78
|
-
var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
79
|
-
replacements[i] = {indent: indent,
|
80
|
-
text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
|
81
|
-
newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
|
82
|
-
}
|
83
|
-
|
84
|
-
for (var i = ranges.length - 1; i >= 0; i--) {
|
85
|
-
var info = replacements[i];
|
86
|
-
cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
|
87
|
-
var sel = cm.listSelections().slice(0);
|
88
|
-
sel[i] = {head: info.newPos, anchor: info.newPos};
|
89
|
-
cm.setSelections(sel);
|
90
|
-
if (info.indent) {
|
91
|
-
cm.indentLine(info.newPos.line, null, true);
|
92
|
-
cm.indentLine(info.newPos.line + 1, null, true);
|
93
|
-
}
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
function autoCloseCurrent(cm, typingSlash) {
|
98
|
-
var ranges = cm.listSelections(), replacements = [];
|
99
|
-
var head = typingSlash ? "/" : "</";
|
100
|
-
for (var i = 0; i < ranges.length; i++) {
|
101
|
-
if (!ranges[i].empty()) return CodeMirror.Pass;
|
102
|
-
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
103
|
-
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
104
|
-
if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
|
105
|
-
tok.start != pos.ch - 1))
|
106
|
-
return CodeMirror.Pass;
|
107
|
-
// Kludge to get around the fact that we are not in XML mode
|
108
|
-
// when completing in JS/CSS snippet in htmlmixed mode. Does not
|
109
|
-
// work for other XML embedded languages (there is no general
|
110
|
-
// way to go from a mixed mode to its current XML state).
|
111
|
-
var replacement;
|
112
|
-
if (inner.mode.name != "xml") {
|
113
|
-
if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
|
114
|
-
replacement = head + "script";
|
115
|
-
else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
|
116
|
-
replacement = head + "style";
|
117
|
-
else
|
118
|
-
return CodeMirror.Pass;
|
119
|
-
} else {
|
120
|
-
if (!state.context || !state.context.tagName ||
|
121
|
-
closingTagExists(cm, state.context.tagName, pos, state))
|
122
|
-
return CodeMirror.Pass;
|
123
|
-
replacement = head + state.context.tagName;
|
124
|
-
}
|
125
|
-
if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
|
126
|
-
replacements[i] = replacement;
|
127
|
-
}
|
128
|
-
cm.replaceSelections(replacements);
|
129
|
-
ranges = cm.listSelections();
|
130
|
-
for (var i = 0; i < ranges.length; i++)
|
131
|
-
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
|
132
|
-
cm.indentLine(ranges[i].head.line);
|
133
|
-
}
|
134
|
-
|
135
|
-
function autoCloseSlash(cm) {
|
136
|
-
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
137
|
-
return autoCloseCurrent(cm, true);
|
138
|
-
}
|
139
|
-
|
140
|
-
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
|
141
|
-
|
142
|
-
function indexOf(collection, elt) {
|
143
|
-
if (collection.indexOf) return collection.indexOf(elt);
|
144
|
-
for (var i = 0, e = collection.length; i < e; ++i)
|
145
|
-
if (collection[i] == elt) return i;
|
146
|
-
return -1;
|
147
|
-
}
|
148
|
-
|
149
|
-
// If xml-fold is loaded, we use its functionality to try and verify
|
150
|
-
// whether a given tag is actually unclosed.
|
151
|
-
function closingTagExists(cm, tagName, pos, state, newTag) {
|
152
|
-
if (!CodeMirror.scanForClosingTag) return false;
|
153
|
-
var end = Math.min(cm.lastLine() + 1, pos.line + 500);
|
154
|
-
var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
155
|
-
if (!nextClose || nextClose.tag != tagName) return false;
|
156
|
-
var cx = state.context;
|
157
|
-
// If the immediate wrapping context contains onCx instances of
|
158
|
-
// the same tag, a closing tag only exists if there are at least
|
159
|
-
// that many closing tags of that type following.
|
160
|
-
for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx;
|
161
|
-
pos = nextClose.to;
|
162
|
-
for (var i = 1; i < onCx; i++) {
|
163
|
-
var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
164
|
-
if (!next || next.tag != tagName) return false;
|
165
|
-
pos = next.to;
|
166
|
-
}
|
167
|
-
return true;
|
168
|
-
}
|
169
|
-
});
|
@@ -1,51 +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 listRE = /^(\s*)(>[> ]*|- \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,
|
15
|
-
emptyListRE = /^(\s*)(>[> ]*|- \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,
|
16
|
-
unorderedListRE = /[*+-]\s/;
|
17
|
-
|
18
|
-
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
|
19
|
-
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
20
|
-
var ranges = cm.listSelections(), replacements = [];
|
21
|
-
for (var i = 0; i < ranges.length; i++) {
|
22
|
-
var pos = ranges[i].head;
|
23
|
-
var eolState = cm.getStateAfter(pos.line);
|
24
|
-
var inList = eolState.list !== false;
|
25
|
-
var inQuote = eolState.quote !== 0;
|
26
|
-
|
27
|
-
var line = cm.getLine(pos.line), match = listRE.exec(line);
|
28
|
-
if (!ranges[i].empty() || (!inList && !inQuote) || !match) {
|
29
|
-
cm.execCommand("newlineAndIndent");
|
30
|
-
return;
|
31
|
-
}
|
32
|
-
if (emptyListRE.test(line)) {
|
33
|
-
cm.replaceRange("", {
|
34
|
-
line: pos.line, ch: 0
|
35
|
-
}, {
|
36
|
-
line: pos.line, ch: pos.ch + 1
|
37
|
-
});
|
38
|
-
replacements[i] = "\n";
|
39
|
-
} else {
|
40
|
-
var indent = match[1], after = match[5];
|
41
|
-
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
|
42
|
-
? match[2].replace("x", " ")
|
43
|
-
: (parseInt(match[3], 10) + 1) + match[4];
|
44
|
-
|
45
|
-
replacements[i] = "\n" + indent + bullet + after;
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
49
|
-
cm.replaceSelections(replacements);
|
50
|
-
};
|
51
|
-
});
|
@@ -1,122 +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
|
-
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
13
|
-
(document.documentMode == null || document.documentMode < 8);
|
14
|
-
|
15
|
-
var Pos = CodeMirror.Pos;
|
16
|
-
|
17
|
-
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
18
|
-
|
19
|
-
function findMatchingBracket(cm, where, strict, config) {
|
20
|
-
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
21
|
-
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
22
|
-
if (!match) return null;
|
23
|
-
var dir = match.charAt(1) == ">" ? 1 : -1;
|
24
|
-
if (strict && (dir > 0) != (pos == where.ch)) return null;
|
25
|
-
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
|
26
|
-
|
27
|
-
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
|
28
|
-
if (found == null) return null;
|
29
|
-
return {from: Pos(where.line, pos), to: found && found.pos,
|
30
|
-
match: found && found.ch == match.charAt(0), forward: dir > 0};
|
31
|
-
}
|
32
|
-
|
33
|
-
// bracketRegex is used to specify which type of bracket to scan
|
34
|
-
// should be a regexp, e.g. /[[\]]/
|
35
|
-
//
|
36
|
-
// Note: If "where" is on an open bracket, then this bracket is ignored.
|
37
|
-
//
|
38
|
-
// Returns false when no bracket was found, null when it reached
|
39
|
-
// maxScanLines and gave up
|
40
|
-
function scanForBracket(cm, where, dir, style, config) {
|
41
|
-
var maxScanLen = (config && config.maxScanLineLength) || 10000;
|
42
|
-
var maxScanLines = (config && config.maxScanLines) || 1000;
|
43
|
-
|
44
|
-
var stack = [];
|
45
|
-
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
|
46
|
-
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
47
|
-
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
48
|
-
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
49
|
-
var line = cm.getLine(lineNo);
|
50
|
-
if (!line) continue;
|
51
|
-
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
|
52
|
-
if (line.length > maxScanLen) continue;
|
53
|
-
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
|
54
|
-
for (; pos != end; pos += dir) {
|
55
|
-
var ch = line.charAt(pos);
|
56
|
-
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
57
|
-
var match = matching[ch];
|
58
|
-
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
59
|
-
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
60
|
-
else stack.pop();
|
61
|
-
}
|
62
|
-
}
|
63
|
-
}
|
64
|
-
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
|
65
|
-
}
|
66
|
-
|
67
|
-
function matchBrackets(cm, autoclear, config) {
|
68
|
-
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
69
|
-
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
70
|
-
var marks = [], ranges = cm.listSelections();
|
71
|
-
for (var i = 0; i < ranges.length; i++) {
|
72
|
-
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);
|
73
|
-
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
|
74
|
-
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
75
|
-
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
|
76
|
-
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
|
77
|
-
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
if (marks.length) {
|
82
|
-
// Kludge to work around the IE bug from issue #1193, where text
|
83
|
-
// input stops going to the textare whever this fires.
|
84
|
-
if (ie_lt8 && cm.state.focused) cm.focus();
|
85
|
-
|
86
|
-
var clear = function() {
|
87
|
-
cm.operation(function() {
|
88
|
-
for (var i = 0; i < marks.length; i++) marks[i].clear();
|
89
|
-
});
|
90
|
-
};
|
91
|
-
if (autoclear) setTimeout(clear, 800);
|
92
|
-
else return clear;
|
93
|
-
}
|
94
|
-
}
|
95
|
-
|
96
|
-
var currentlyHighlighted = null;
|
97
|
-
function doMatchBrackets(cm) {
|
98
|
-
cm.operation(function() {
|
99
|
-
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
100
|
-
currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
101
|
-
});
|
102
|
-
}
|
103
|
-
|
104
|
-
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
105
|
-
if (old && old != CodeMirror.Init) {
|
106
|
-
cm.off("cursorActivity", doMatchBrackets);
|
107
|
-
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
108
|
-
}
|
109
|
-
if (val) {
|
110
|
-
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
111
|
-
cm.on("cursorActivity", doMatchBrackets);
|
112
|
-
}
|
113
|
-
});
|
114
|
-
|
115
|
-
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
116
|
-
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){
|
117
|
-
return findMatchingBracket(this, pos, strict, config);
|
118
|
-
});
|
119
|
-
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
|
120
|
-
return scanForBracket(this, pos, dir, style, config);
|
121
|
-
});
|
122
|
-
});
|