glebtv-ckeditor 4.0.2.7 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +5 -195
- data/{vendor → app}/assets/javascripts/ckeditor/CHANGES.md +56 -0
- data/{vendor → app}/assets/javascripts/ckeditor/LICENSE.md +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/README.md +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/build-config.js +0 -0
- data/app/assets/javascripts/ckeditor/ckeditor.js +881 -0
- data/{vendor → app}/assets/javascripts/ckeditor/config.js.erb +0 -0
- data/app/assets/javascripts/ckeditor/contents.css +103 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_add.jpg +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_add.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_del.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_more.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/preloader.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/avi.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/ckfnothumb.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/doc.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/docx.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/exe.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/gz.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/htm.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/jpg.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/mp3.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/mpg.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/pdf.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/psd.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/rar.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/swf.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/tar.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/txt.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/unknown.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/wmv.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/xls.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/xlsx.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/zip.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/application.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.min.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.tmpl.min.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/rails.js +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css +118 -0
- data/app/assets/javascripts/ckeditor/{init.js → init.js.erb} +1 -1
- data/{vendor → app}/assets/javascripts/ckeditor/lang/en.js +1 -1
- data/{vendor → app}/assets/javascripts/ckeditor/lang/ru.js +1 -1
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/ckcss.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/css/styles.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/dialogs/ckcss.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/lang/en.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/lang/ru.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/plugin.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/LoremIpsum/images/icon.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/LoremIpsum/images/icon1.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/LoremIpsum/plugin.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +38 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.css +246 -245
- data/app/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoComplete.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoFormat.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/icons/CommentSelectedRange.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/SearchCode.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/icons/UncommentSelectedRange.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +81 -76
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +52 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +1 -2
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuecomment.js +44 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +25 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +31 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +32 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +64 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +131 -131
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +8 -9
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +264 -132
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +1 -0
- data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/css.js +337 -235
- data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/htmlmixed.js +0 -0
- data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/javascript.js +17 -6
- data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/xml.js +9 -5
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +4 -2
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +146 -34
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +0 -1
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +0 -1
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +1 -1
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +5 -5
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +43 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/icons/bgcolor.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/icons/textcolor.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/lang/en.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/lang/ru.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/plugin.js +6 -2
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/lang/en.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/lang/ru.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/plugin.js +1 -1
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +10 -9
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/font/lang/en.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/font/lang/ru.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/font/plugin.js +5 -2
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/dialogs/hs.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/icon.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/lang/en.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/lang/ru.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/plugin.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/readme.txt +0 -0
- data/app/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -0
- data/app/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +43 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +15 -15
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/mediaembed/images/icon.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/oembed/images/icon.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.js +68 -0
- data/app/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.min.js +68 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/panelbutton/plugin.js +0 -0
- data/app/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +31 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/README.md +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +0 -0
- data/app/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +21 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/README.md +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +0 -0
- data/app/assets/javascripts/ckeditor/samples/ajax.html +82 -0
- data/app/assets/javascripts/ckeditor/samples/api.html +207 -0
- data/app/assets/javascripts/ckeditor/samples/appendto.html +57 -0
- data/app/assets/javascripts/ckeditor/samples/assets/inlineall/logo.png +0 -0
- data/app/assets/javascripts/ckeditor/samples/assets/outputxhtml/outputxhtml.css +204 -0
- data/app/assets/javascripts/ckeditor/samples/assets/posteddata.php +59 -0
- data/app/assets/javascripts/ckeditor/samples/assets/sample.css +3 -0
- data/app/assets/javascripts/ckeditor/samples/assets/sample.jpg +0 -0
- data/app/assets/javascripts/ckeditor/samples/assets/uilanguages/languages.js +7 -0
- data/app/assets/javascripts/ckeditor/samples/datafiltering.html +401 -0
- data/app/assets/javascripts/ckeditor/samples/divreplace.html +141 -0
- data/app/assets/javascripts/ckeditor/samples/index.html +125 -0
- data/app/assets/javascripts/ckeditor/samples/inlineall.html +311 -0
- data/app/assets/javascripts/ckeditor/samples/inlinebycode.html +122 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/dialog/assets/my_dialog.js +48 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/dialog/dialog.html +187 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/enterkey/enterkey.html +103 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/swfobject.js +18 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputforflash.html +280 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputhtml.html +221 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/magicline/magicline.html +207 -0
- data/{vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples → app/assets/javascripts/ckeditor/samples/plugins/stylesheetparser}/assets/sample.css +70 -70
- data/{vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples → app/assets/javascripts/ckeditor/samples/plugins/stylesheetparser}/stylesheetparser.html +82 -82
- data/app/assets/javascripts/ckeditor/samples/plugins/toolbar/toolbar.html +232 -0
- data/app/assets/javascripts/ckeditor/samples/plugins/wysiwygarea/fullpage.html +77 -0
- data/app/assets/javascripts/ckeditor/samples/readonly.html +73 -0
- data/app/assets/javascripts/ckeditor/samples/replacebyclass.html +57 -0
- data/app/assets/javascripts/ckeditor/samples/replacebycode.html +56 -0
- data/app/assets/javascripts/ckeditor/samples/sample.css +339 -0
- data/app/assets/javascripts/ckeditor/samples/sample.js +33 -0
- data/app/assets/javascripts/ckeditor/samples/sample_posteddata.php +16 -0
- data/app/assets/javascripts/ckeditor/samples/tabindex.html +75 -0
- data/app/assets/javascripts/ckeditor/samples/uicolor.html +69 -0
- data/app/assets/javascripts/ckeditor/samples/uilanguages.html +119 -0
- data/app/assets/javascripts/ckeditor/samples/xhtmlstyle.html +231 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +5 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_opera.css +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/editor.css +1 -1
- data/{vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css → app/assets/javascripts/ckeditor/skins/moono/editor_gecko.css} +1 -1
- data/{vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css → app/assets/javascripts/ckeditor/skins/moono/editor_ie.css} +1 -1
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +1 -1
- data/app/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +5 -0
- data/{vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css → app/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css} +1 -1
- data/app/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/images/arrow.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/images/mini.png +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/readme.md +0 -0
- data/{vendor → app}/assets/javascripts/ckeditor/styles.js +1 -2
- data/app/controllers/ckeditor/application_controller.rb +6 -12
- data/app/controllers/ckeditor/attachment_files_controller.rb +6 -2
- data/app/controllers/ckeditor/pictures_controller.rb +6 -2
- data/app/views/ckeditor/shared/_asset.html.erb +4 -4
- data/app/views/ckeditor/shared/_asset_tmpl.html.erb +1 -1
- data/lib/ckeditor.rb +91 -19
- data/lib/ckeditor/engine.rb +5 -8
- data/lib/ckeditor/helpers/controllers.rb +7 -3
- data/lib/ckeditor/helpers/form_builder.rb +1 -1
- data/lib/ckeditor/helpers/form_helper.rb +12 -15
- data/lib/ckeditor/helpers/view_helper.rb +1 -1
- data/lib/ckeditor/hooks/cancan.rb +46 -0
- data/lib/ckeditor/hooks/simple_form.rb +11 -0
- data/lib/ckeditor/orm/active_record.rb +1 -3
- data/lib/ckeditor/orm/base.rb +4 -0
- data/lib/ckeditor/orm/mongoid.rb +1 -3
- data/lib/ckeditor/utils.rb +25 -8
- data/lib/ckeditor/version.rb +2 -2
- data/lib/generators/ckeditor/install_generator.rb +2 -2
- 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 +4 -4
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +4 -4
- data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +4 -4
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +8 -8
- data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +6 -6
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +1 -7
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +1 -7
- data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +3 -3
- data/lib/generators/ckeditor/templates/ckeditor.rb +3 -0
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +1 -1
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +4 -4
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +4 -4
- data/test/dummy/app/views/posts/_form.html.erb +3 -3
- data/test/dummy/script/rails +0 -0
- data/test/functional/posts_controller_test.rb +3 -3
- metadata +346 -321
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +0 -830
- data/vendor/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.sass +0 -102
- data/vendor/assets/javascripts/ckeditor/plugins/code/code/code.js +0 -48
- data/vendor/assets/javascripts/ckeditor/plugins/code/images/code.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/code/plugin.js +0 -17
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +0 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +0 -29
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +0 -28
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/foldcode/foldcode.js +0 -183
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +0 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +0 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +0 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +0 -1
- data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +0 -41
- data/vendor/assets/javascripts/ckeditor/plugins/mediaembed/plugin.js +0 -67
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/de.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/en.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/fr.js +0 -14
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/nl.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/ru.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.js +0 -912
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.min.js +0 -1
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/plugin.js +0 -102
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +0 -31
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +0 -13
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +0 -138
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +0 -20
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +0 -689
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +0 -1245
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
window.CodeMirror=function(){"use strict";function n(t,i){var r,o,e,u,s;if(!(this instanceof n))return new n(t,i);this.options=i=i||{};for(r in nf)!i.hasOwnProperty(r)&&nf.hasOwnProperty(r)&&(i[r]=nf[r]);he(i),o=typeof i.value=="string"?0:i.value.first,e=this.display=al(t,o),e.wrapper.CodeMirror=this,cs(this),i.autofocus&&!ee&&b(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new ns},hs(this),i.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),u=i.value,typeof u=="string"&&(u=new d(i.value,i.mode)),f(this,cc)(this,u),w&&setTimeout(tt(wt,this,!0),20),sa(this);try{s=document.activeElement==e.input}catch(h){}s||i.autofocus&&!ee?setTimeout(tt(bt,this),20):ge(this),f(this,function(){var n,t;for(n in ni)ni.propertyIsEnumerable(n)&&ni[n](this,i[n],oo);for(t=0;t<rf.length;++t)rf[t](this)})()}function al(n,t){var r={},u=r.input=i("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;"),f;return nt?u.style.width="1000px":u.setAttribute("wrap","off"),nr&&(u.style.border="1px solid black"),u.setAttribute("autocorrect","off"),u.setAttribute("autocapitalize","off"),r.inputDiv=i("div",[u],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),r.scrollbarH=i("div",[i("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),r.scrollbarV=i("div",[i("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),r.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler"),r.lineDiv=i("div"),r.selectionDiv=i("div",null,null,"position: relative; z-index: 1"),r.cursor=i("div"," ","CodeMirror-cursor"),r.otherCursor=i("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"),r.measure=i("div",null,"CodeMirror-measure"),r.lineSpace=i("div",[r.measure,r.selectionDiv,r.lineDiv,r.cursor,r.otherCursor],null,"position: relative; outline: none"),r.mover=i("div",[i("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=i("div",[r.mover],"CodeMirror-sizer"),r.heightForcer=i("div",null,null,"position: absolute; height: "+di+"px; width: 1px;"),r.gutters=i("div",null,"CodeMirror-gutters"),r.lineGutter=null,f=i("div",[r.sizer,r.heightForcer,r.gutters],null,"position: relative; min-height: 100%"),r.scroller=i("div",[f],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=i("div",[r.inputDiv,r.scrollbarH,r.scrollbarV,r.scrollbarFiller,r.scroller],"CodeMirror"),fi&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),n.appendChild?n.appendChild(r.wrapper):n(r.wrapper),nr&&(u.style.width="0px"),nt||(r.scroller.draggable=!0),fe?(r.inputDiv.style.height="1px",r.inputDiv.style.position="absolute"):fi&&(r.scrollbarH.style.minWidth=r.scrollbarV.style.minWidth="18px"),r.viewOffset=r.lastSizeC=0,r.showingFrom=r.showingTo=t,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.prevInput="",r.alignWidgets=!1,r.pollingFast=!1,r.poll=new ns,r.draggingText=!1,r.cachedCharWidth=r.cachedTextHeight=null,r.measureLineCache=[],r.measureLineCachePos=0,r.inaccurateSelection=!1,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r}function fu(t){t.doc.mode=n.getMode(t.options,t.doc.modeOption),t.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),t.doc.frontier=t.doc.first,hu(t,100),t.state.modeGen++,t.curOp&&l(t)}function vl(n){n.options.lineWrapping?(n.display.wrapper.className+=" CodeMirror-wrap",n.display.sizer.style.minWidth=""):(n.display.wrapper.className=n.display.wrapper.className.replace(" CodeMirror-wrap",""),se(n)),ss(n),l(n),oi(n),setTimeout(function(){ls(n.display,n.doc.height)},100)}function os(n){var t=fr(n.display),i=n.options.lineWrapping,r=i&&Math.max(5,n.display.scroller.clientWidth/ks(n.display)-3);return function(u){return ii(n.doc,u)?0:i?(Math.ceil(u.text.length/r)||1)*t:t}}function ss(n){var t=n.doc,i=os(n);t.iter(function(n){var t=i(n);t!=n.height&&rt(n,t)})}function yl(n){var t=it[n.options.keyMap].style;n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(t?" cm-keymap-"+t:"")}function hs(n){n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+n.options.theme.replace(/(^|\s)\s*/g," cm-s-"),oi(n)}function rr(n){cs(n),l(n)}function cs(n){var r=n.display.gutters,e=n.options.gutters,t,u,f;for(df(r),t=0;t<e.length;++t)u=e[t],f=r.appendChild(i("div",null,"CodeMirror-gutter "+u)),u=="CodeMirror-linenumbers"&&(n.display.lineGutter=f,f.style.width=(n.display.lineNumWidth||1)+"px");r.style.display=t?"":"none"}function eu(n,t){var f,e,u,i;if(t.height==0)return 0;for(f=t.text.length,u=t;e=ef(u);)i=e.find(),u=r(n,i.from.line),f+=i.from.ch-i.to.ch;for(u=t;e=kr(u);)i=e.find(),f-=u.text.length-i.from.ch,u=r(n,i.to.line),f+=u.text.length-i.to.ch;return f}function se(n){var t=n.display,i=n.doc;t.maxLine=r(i,i.first),t.maxLineLength=eu(i,t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=eu(i,n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}function he(n){for(var i=!1,t=0;t<n.gutters.length;++t)n.gutters[t]=="CodeMirror-linenumbers"&&(n.lineNumbers?i=!0:n.gutters.splice(t--,1));!i&&n.lineNumbers&&n.gutters.push("CodeMirror-linenumbers")}function ls(n,t){var u=t+ps(n);n.sizer.style.minHeight=n.heightForcer.style.top=u+"px";var f=Math.max(u,n.scroller.scrollHeight),i=n.scroller.scrollWidth>n.scroller.clientWidth,r=f>n.scroller.clientHeight;r?(n.scrollbarV.style.display="block",n.scrollbarV.style.bottom=i?ne(n.measure)+"px":"0",n.scrollbarV.firstChild.style.height=f-n.scroller.clientHeight+n.scrollbarV.clientHeight+"px"):n.scrollbarV.style.display="",i?(n.scrollbarH.style.display="block",n.scrollbarH.style.right=r?ne(n.measure)+"px":"0",n.scrollbarH.firstChild.style.width=n.scroller.scrollWidth-n.scroller.clientWidth+n.scrollbarH.clientWidth+"px"):n.scrollbarH.style.display="",i&&r?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=n.scrollbarFiller.style.width=ne(n.measure)+"px"):n.scrollbarFiller.style.display="",sl&&ne(n.measure)===0&&(n.scrollbarV.style.minWidth=n.scrollbarH.style.minHeight=hl?"18px":"12px")}function ce(n,t,i){var r=n.scroller.scrollTop,u=n.wrapper.clientHeight,f;return typeof i=="number"?r=i:i&&(r=i.top,u=i.bottom-i.top),r=Math.floor(r-cu(n)),f=Math.ceil(r+u),{from:lf(t,r),to:lf(t,f)}}function as(n){var t=n.display,i,r,u;if(t.alignWidgets||t.gutters.firstChild&&n.options.fixedGutter){var f=ae(t)-t.scroller.scrollLeft+n.doc.scrollLeft,e=t.gutters.offsetWidth,o=f+"px";for(i=t.lineDiv.firstChild;i;i=i.nextSibling)if(i.alignable)for(r=0,u=i.alignable;r<u.length;++r)u[r].style.left=o;n.options.fixedGutter&&(t.gutters.style.left=f+e+"px")}}function pl(n){if(!n.options.lineNumbers)return!1;var u=n.doc,r=le(n.options,u.first+u.size-1),t=n.display;if(r.length!=t.lineNumChars){var f=t.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=f.firstChild.offsetWidth,o=f.offsetWidth-e;return t.lineGutter.style.width="",t.lineNumInnerWidth=Math.max(e,t.lineGutter.offsetWidth-o),t.lineNumWidth=t.lineNumInnerWidth+o,t.lineNumChars=t.lineNumInnerWidth?r.length:-1,t.lineGutter.style.width=t.lineNumWidth+"px",!0}return!1}function le(n,t){return String(n.lineNumberFormatter(t+n.firstLineNumber))}function ae(n){return c(n.scroller).left-c(n.sizer).left}function ou(n,t,i){var u=n.display.showingFrom,f=n.display.showingTo,r=vs(n,t,i);return r&&(ft(n,"update",n),(n.display.showingFrom!=u||n.display.showingTo!=f)&&ft(n,"viewportChange",n,n.display.showingFrom,n.display.showingTo)),ye(n),ls(n.display,n.doc.height),r}function vs(n,t,i){var u=n.display,e=n.doc,y,et,d,l,ot,nt,b,s,k,st,tt,a,v,it,ut,ft,p,f;if(!u.wrapper.clientWidth){u.showingFrom=u.showingTo=e.first,u.viewOffset=0;return}if(y=ce(u,e,i),t.length!=0||!(y.from>u.showingFrom)||!(y.to<u.showingTo)){if(pl(n)&&(t=[{from:e.first,to:e.first+e.size}]),et=u.sizer.style.marginLeft=u.gutters.offsetWidth+"px",u.scrollbarH.style.left=n.options.fixedGutter?et:"0",d=Infinity,n.options.lineNumbers)for(f=0;f<t.length;++f)if(t[f].diff){d=t[f].from;break}var w=e.first+e.size,h=Math.max(y.from-n.options.viewportMargin,e.first),o=Math.min(w,y.to+n.options.viewportMargin);if(u.showingFrom<h&&h-u.showingFrom<20&&(h=Math.max(e.first,u.showingFrom)),u.showingTo>o&&u.showingTo-o<20&&(o=Math.min(w,u.showingTo)),ir)for(h=g(pi(e,r(e,h)));o<w&&ii(e,r(e,o));)++o;if(l=[{from:Math.max(u.showingFrom,e.first),to:Math.min(u.showingTo,w)}],l=l[0].from>=l[0].to?[]:wl(l,t),ir)for(f=0;f<l.length;++f)for(s=l[f];ot=kr(r(e,s.to-1));)if(nt=ot.find().from.line,nt>s.from)s.to=nt;else{l.splice(f--,1);break}for(b=0,f=0;f<l.length;++f)s=l[f],s.from<h&&(s.from=h),s.to>o&&(s.to=o),s.from>=s.to?l.splice(f--,1):b+=s.to-s.from;if(b==o-h&&h==u.showingFrom&&o==u.showingTo){ys(n);return}for(l.sort(function(n,t){return n.from-t.from}),k=document.activeElement,b<(o-h)*.7&&(u.lineDiv.style.display="none"),kl(n,h,o,l,d),u.lineDiv.style.display="",document.activeElement!=k&&k.offsetHeight&&k.focus(),st=h!=u.showingFrom||o!=u.showingTo||u.lastSizeC!=u.wrapper.clientHeight,st&&(u.lastSizeC=u.wrapper.clientHeight),u.showingFrom=h,u.showingTo=o,hu(n,100),tt=u.lineDiv.offsetTop,a=u.lineDiv.firstChild;a;a=a.nextSibling)if(a.lineObj&&(fi?(it=a.offsetTop+a.offsetHeight,v=it-tt,tt=it):(ut=c(a),v=ut.bottom-ut.top),ft=a.lineObj.height-v,v<2&&(v=fr(u)),(ft>.001||ft<-.001)&&(rt(a.lineObj,v),p=a.lineObj.widgets,p)))for(f=0;f<p.length;++f)p[f].height=p[f].node.offsetHeight;return ys(n),ce(u,e,i).to>o&&vs(n,[],i),!0}}function ys(n){var t=n.display.viewOffset=bi(n,r(n.doc,n.display.showingFrom));n.display.mover.style.top=t+"px"}function wl(n,t){for(var o,h,i,f=0,s=t.length||0;f<s;++f){var r=t[f],u=[],e=r.diff||0;for(o=0,h=n.length;o<h;++o)i=n[o],r.to<=i.from&&r.diff?u.push({from:i.from+e,to:i.to+e}):r.to<=i.from||r.from>=i.to?u.push(i):(r.from>i.from&&u.push({from:i.from,to:r.from}),r.to<i.to&&u.push({from:r.to+e,to:i.to+e}));n=u}return n}function bl(n){for(var i=n.display,u={},f={},t=i.gutters.firstChild,r=0;t;t=t.nextSibling,++r)u[n.options.gutters[r]]=t.offsetLeft,f[n.options.gutters[r]]=t.offsetWidth;return{fixedPos:ae(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:u,gutterWidth:f,wrapperWidth:i.wrapper.clientWidth}}function kl(n,t,r,u,f){function c(t){var i=t.nextSibling;return nt&&ei&&n.display.currentWheelTarget==t?(t.style.display="none",t.lineObj=null):t.parentNode.removeChild(t),i}var l=bl(n),a=n.display,v=n.options.lineNumbers,h,e,s,o;for(u.length||nt&&n.display.currentWheelTarget||df(a.lineDiv),h=a.lineDiv,e=h.firstChild,s=u.shift(),o=t,n.doc.iter(t,r,function(t){var y,r,p,d,k,a,w,b;if(s&&s.to==o&&(s=u.shift()),ii(n.doc,t)){if(t.height!=0&&rt(t,0),t.widgets&&e.previousSibling)for(y=0;y<t.widgets.length;++y)t.widgets[y].showIfHidden&&(r=e.previousSibling,/pre/i.test(r.nodeName)&&(p=i("div",null,null,"position: relative"),r.parentNode.replaceChild(p,r),p.appendChild(r),r=p),d=r.appendChild(i("div",[t.widgets[y].node],"CodeMirror-linewidget")),ve(t.widgets[y],d,r,l))}else if(s&&s.from<=o&&s.to>o){while(e.lineObj!=t)e=c(e);v&&f<=o&&e.lineNumber&&nl(e.lineNumber,le(n.options,o)),e=e.nextSibling}else{if(t.widgets)for(k=0,a=e;a&&k<20;++k,a=a.nextSibling)if(a.lineObj==t&&/div/i.test(a.nodeName)){w=a;break}if(b=dl(n,t,o,l,w),b!=w)h.insertBefore(b,e);else{while(e!=w)e=c(e);e=e.nextSibling}b.lineObj=t}++o});e;)e=c(e)}function dl(n,t,r,u,f){var v=vo(n,t),c=t.gutterMarkers,it=n.display,e,w,b,h,tt,k,d,l,y,a,g,o,nt,s,p;if(!n.options.lineNumbers&&!c&&!t.bgClass&&!t.wrapClass&&!t.widgets)return v;if(f){for(f.alignable=null,w=!0,b=0,h=f.firstChild;h;h=tt)if(tt=h.nextSibling,/\bCodeMirror-linewidget\b/.test(h.className)){for(o=0,k=!0;o<t.widgets.length;++o)if(s=t.widgets[o],d=!1,s.above||(d=k,k=!1),s.node==h.firstChild){ve(s,h,f,u),++b,d&&f.insertBefore(v,h);break}if(o==t.widgets.length){w=!1;break}}else f.removeChild(h);w&&b==t.widgets.length&&(e=f,f.className=t.wrapClass||"")}if(e||(e=i("div",null,t.wrapClass,"position: relative"),e.appendChild(v)),t.bgClass&&e.insertBefore(i("div",null,t.bgClass+" CodeMirror-linebackground"),e.firstChild),(n.options.lineNumbers||c)&&(l=e.insertBefore(i("div",null,null,"position: absolute; left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px"),e.firstChild),n.options.fixedGutter&&(e.alignable||(e.alignable=[])).push(l),!n.options.lineNumbers||c&&c["CodeMirror-linenumbers"]||(e.lineNumber=l.appendChild(i("div",le(n.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+u.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.lineNumInnerWidth+"px"))),c))for(y=0;y<n.options.gutters.length;++y)a=n.options.gutters[y],g=c.hasOwnProperty(a)&&c[a],g&&l.appendChild(i("div",[g],"CodeMirror-gutter-elt","left: "+u.gutterLeft[a]+"px; width: "+u.gutterWidth[a]+"px"));if(fi&&(e.style.zIndex=2),t.widgets&&e!=f)for(o=0,nt=t.widgets;o<nt.length;++o)s=nt[o],p=i("div",[s.node],"CodeMirror-linewidget"),ve(s,p,e,u),s.above?e.insertBefore(p,n.options.lineNumbers&&t.height!=0?l:v):e.appendChild(p),ft(s,"redraw");return e}function ve(n,t,i,r){if(n.noHScroll){(i.alignable||(i.alignable=[])).push(t);var u=r.wrapperWidth;t.style.left=r.fixedPos+"px",n.coverGutter||(u-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=u+"px"}n.coverGutter&&(t.style.zIndex=5,t.style.position="relative",n.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function ye(n){var t=n.display,i=s(n.doc.sel.from,n.doc.sel.to);i||n.options.showCursorWhenSelecting?gl(n):t.cursor.style.display=t.otherCursor.style.display="none",i?t.selectionDiv.style.display="none":na(n);var r=st(n,n.doc.sel.head,"div"),u=c(t.wrapper),f=c(t.lineDiv);t.inputDiv.style.top=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+f.top-u.top))+"px",t.inputDiv.style.left=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+f.left-u.left))+"px"}function gl(n){var t=n.display,i=st(n,n.doc.sel.head,"div");t.cursor.style.left=i.left+"px",t.cursor.style.top=i.top+"px",t.cursor.style.height=Math.max(0,i.bottom-i.top)*n.options.cursorHeight+"px",t.cursor.style.display="",i.other?(t.otherCursor.style.display="",t.otherCursor.style.left=i.other.left+"px",t.otherCursor.style.top=i.other.top+"px",t.otherCursor.style.height=(i.other.bottom-i.other.top)*.85+"px"):t.otherCursor.style.display="none"}function na(n){function l(n,t,r,u){t<0&&(t=0),w.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+n+"px; top: "+t+"px; width: "+(r==null?b-n:r)+"px; height: "+(u-t)+"px"))}function a(i,u,f,e){function v(r){return be(n,t(i,r),"div",s)}var s=r(c,i),a=s.text.length,o=e?Infinity:-Infinity;return dv(ut(s),u||0,f==null?a:f,function(n,t,i){var c=v(i=="rtl"?t-1:n),r=v(i=="rtl"?n:t-1),s=c.left,y=r.right;r.top-c.top>3&&(l(s,c.top,null,c.bottom),s=h,c.bottom<r.top&&l(s,c.bottom,null,r.top)),f==null&&t==a&&(y=b),u==null&&n==0&&(s=h),o=e?Math.min(r.top,o):Math.max(r.bottom,o),s<h+1&&(s=h),l(s,r.top,y-s,r.bottom)}),o}var s=n.display,c=n.doc,u=n.doc.sel,w=document.createDocumentFragment(),b=s.lineSpace.offsetWidth,h=ra(n.display),e,o,v,y,p;if(u.from.line==u.to.line)a(u.from.line,u.from.ch,u.to.ch);else{for(var k=r(c,u.from.line),d=k,g,f=[u.from.line,u.from.ch],nt;g=kr(d);){if(e=g.find(),f.push(e.from.ch,e.to.line,e.to.ch),e.to.line==u.to.line){f.push(u.to.ch),nt=!0;break}d=r(c,e.to.line)}if(nt)for(o=0;o<f.length;o+=3)a(f[o],f[o+1],f[o+2]);else p=r(c,u.to.line),v=u.from.ch?a(u.from.line,u.from.ch,null,!1):bi(n,k)-s.viewOffset,y=u.to.ch?a(u.to.line,ef(p)?null:0,u.to.ch,!0):bi(n,p)-s.viewOffset,v<y&&l(h,v,null,y)}et(s.selectionDiv,w),s.selectionDiv.style.display=""}function su(n){var t=n.display,i;clearInterval(t.blinker),i=!0,t.cursor.style.visibility=t.otherCursor.style.visibility="",t.blinker=setInterval(function(){t.cursor.offsetHeight&&(t.cursor.style.visibility=t.otherCursor.style.visibility=(i=!i)?"":"hidden")},n.options.cursorBlinkRate)}function hu(n,t){n.doc.mode.startState&&n.doc.frontier<n.display.showingTo&&n.state.highlight.set(t,tt(ta,n))}function ta(n){var t=n.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=n.display.showingTo)){var e=+new Date+n.options.workTime,r=yi(t.mode,ur(n,t.frontier)),i=[],u;t.iter(t.frontier,Math.min(t.first+t.size,n.display.showingTo+500),function(f){var o,h,s;if(t.frontier>=n.display.showingFrom){for(o=f.styles,f.styles=rc(n,f,r),h=!o||o.length!=f.styles.length,s=0;!h&&s<o.length;++s)h=o[s]!=f.styles[s];h&&(u&&u.end==t.frontier?u.end++:i.push(u={start:t.frontier,end:t.frontier+1})),f.stateAfter=yi(t.mode,r)}else uc(n,f,r),f.stateAfter=t.frontier%5==0?yi(t.mode,r):null;return++t.frontier,+new Date>e?(hu(n,n.options.workDelay),!0):void 0}),i.length&&f(n,function(){for(var n=0;n<i.length;++n)l(this,i[n].start,i[n].end)})()}}function ia(n,t){for(var s,u,f=n.doc,e,o,i=t,h=t-100;i>h;--i){if(i<=f.first)return f.first;if(e=r(f,i-1),e.stateAfter)return i;o=gi(e.text,null,n.options.tabSize),(u==null||s>o)&&(u=i-1,s=o)}return u}function ur(n,t){var u=n.doc,e=n.display,i,f;return u.mode.startState?(i=ia(n,t),f=i>u.first&&r(u,i-1).stateAfter,f=f?yi(u.mode,f):wh(u.mode),u.iter(i,t,function(r){uc(n,r,f);var o=i==t-1||i%5==0||i>=e.showingFrom&&i<e.showingTo;r.stateAfter=o?yi(u.mode,f):null,++i}),f):!0}function cu(n){return n.lineSpace.offsetTop}function ps(n){return n.mover.offsetHeight-n.lineSpace.offsetHeight}function ra(n){var t=et(n.measure,i("pre",null,null,"text-align: left")).appendChild(i("span","x"));return t.offsetLeft}function pe(n,t,i,r){var e=-1,f,u;for(r=r||we(n,t),f=i;;f+=e){if(u=r[f],u)break;e<0&&f==0&&(e=1)}return{left:f<i?u.right:u.left,right:f>i?u.left:u.right,top:u.top,bottom:u.bottom}}function ws(n,t){for(var u=n.display.measureLineCache,i,r=0;r<u.length;++r)if(i=u[r],i.text==t.text&&i.markedSpans==t.markedSpans&&n.display.scroller.clientWidth==i.width&&i.classes==t.textClass+"|"+t.bgClass+"|"+t.wrapClass)return i.measure}function we(n,t){var i=ws(n,t),r,u;return i||(i=ua(n,t),r=n.display.measureLineCache,u={text:t.text,width:n.display.scroller.clientWidth,markedSpans:t.markedSpans,measure:i,classes:t.textClass+"|"+t.bgClass+"|"+t.wrapClass},r.length==16?r[++n.display.measureLineCachePos%16]=u:r.push(u)),i}function ua(n,t){var v=n.display,k=kc(t.text.length),e=vo(n,t,k),ut,g,u,l,a,nt,r,o,tt;if(w&&!fi&&!n.options.lineWrapping&&e.childNodes.length>100){var it=document.createDocumentFragment(),rt=10,d=e.childNodes.length;for(r=0,ut=Math.ceil(d/rt);r<ut;++r){for(g=i("div",null,null,"display: inline-block"),u=0;u<rt&&d;++u)g.appendChild(e.firstChild),--d;it.appendChild(g)}e.appendChild(it)}et(v.measure,e);var y=c(v.lineDiv),f=[],p=kc(t.text.length),ft=e.offsetHeight;for(yt&&v.measure.first!=e&&et(v.measure,e),r=0;r<k.length;++r)if(o=k[r]){var b=c(o),s=Math.max(0,b.top-y.top),h=Math.min(b.bottom-y.top,ft);for(u=0;u<f.length;u+=2)if((l=f[u],a=f[u+1],!(l>h)&&!(a<s))&&(l<=s&&a>=h||s<=l&&h>=a||Math.min(h,a)-Math.max(s,l)>=h-s>>1)){f[u]=Math.min(s,l),f[u+1]=Math.max(h,a);break}u==f.length&&f.push(s,h),nt=b.right,o.measureRight&&(nt=c(o.measureRight).left),p[r]={left:b.left-y.left,right:nt-y.left,top:u}}for(r=0;r<p.length;++r)(o=p[r])&&(tt=o.top,o.top=f[tt],o.bottom=f[tt+1]);return p}function fa(n,t){var e=!1,i,r,u,f,o;if(t.markedSpans)for(i=0;i<t.markedSpans;++i)r=t.markedSpans[i],r.collapsed&&(r.to==null||r.to==t.text.length)&&(e=!0);return(u=!e&&ws(n,t),u)?pe(n,t,t.text.length,u).right:(f=vo(n,t),o=f.appendChild(te(n.display.measure)),et(n.display.measure,f),c(o).right-c(n.display.lineDiv).left)}function oi(n){n.display.measureLineCache.length=n.display.measureLineCachePos=0,n.display.cachedCharWidth=n.display.cachedTextHeight=null,n.display.maxLineChanged=!0,n.display.lineNumChars=null}function bs(n,t,i,r){var u,e,f,o,s;if(t.widgets)for(u=0;u<t.widgets.length;++u)t.widgets[u].above&&(e=sf(t.widgets[u]),i.top+=e,i.bottom+=e);return r=="line"?i:(r||(r="local"),f=bi(n,t),r!="local"&&(f-=n.display.viewOffset),r=="page"&&(o=c(n.display.lineSpace),f+=o.top+(window.pageYOffset||(document.documentElement||document.body).scrollTop),s=o.left+(window.pageXOffset||(document.documentElement||document.body).scrollLeft),i.left+=s,i.right+=s),i.top+=f,i.bottom+=f,i)}function ea(n,t,i){var r,u,f,e;return i=="div"?t:(r=t.left,u=t.top,i=="page"&&(r-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,u-=window.pageYOffset||(document.documentElement||document.body).scrollTop),f=c(n.display.lineSpace),r-=f.left,u-=f.top,i!="local"&&i||(e=c(n.display.wrapper),r-=e.left,u-=e.top),{left:r,top:u})}function be(n,t,i,u){return u||(u=r(n.doc,t.line)),bs(n,u,pe(n,u,t.ch),i)}function st(n,t,i,u,f){function a(t,r){var e=pe(n,u,t,f);return r?e.left=e.right:e.right=e.left,bs(n,u,e,i)}var h,o,p,v,w,l,s,c,y,b,k,e;if(u=u||r(n.doc,t.line),f||(f=we(n,u)),h=ut(u),o=t.ch,!h)return a(o);for(w=h[0].level,l=0;l<h.length;++l){if(s=h[l],c=s.level%2,s.from<o&&s.to>o)return a(o,c);if(b=c?s.to:s.from,k=c?s.from:s.to,b==o)y=l&&s.level<(e=h[l-1]).level?a(e.level%2?e.from:e.to-1,!0):a(c&&s.from!=s.to?o-1:o),c==w?p=y:v=y;else if(k==o){if(e=l<h.length-1&&h[l+1],!c&&e&&e.from==e.to)continue;y=e&&s.level<e.level?a(e.level%2?e.to-1:e.from):a(c?o:o-1,!0),c==w?p=y:v=y}}return(w&&!o&&(v=a(h[0].to-1)),!p)?v:(v&&(p.other=v),p)}function lu(n,i,r){var u=new t(n,i);return r&&(u.outside=!0),u}function ke(n,t,i){var u=n.doc,f,e;if(i+=n.display.viewOffset,i<0)return lu(u.first,0,!0);if(f=lf(u,i),e=u.first+u.size-1,f>e)return lu(u.first+u.size-1,r(u,e).text.length,!0);for(t<0&&(t=0);;){var s=r(u,f),h=oa(n,s,f,t,i),o=kr(s),c=o&&o.find();if(o&&h.ch>=c.from.ch)f=c.to.line;else return h}}function oa(n,i,r,u,f){function p(u){var f=st(n,t(r,u),"line",i,ft);return(h=!0,g>f.bottom)?f.left-nt:g<f.top?f.left+nt:(h=!1,f.left)}var g=f-bi(n,i),h=!1,nt=2*n.display.wrapper.clientWidth,ft=we(n,i),tt=ut(i),w=i.text.length,e=ie(i),o=re(i),it=p(e),rt=h,l=p(o),b=h,a,v,k,c,s,d,y;if(u>l)return lu(r,o,b);for(;;){if(tt?o==e||o==us(i,e,1):o-e<=1){for(a=u-it<l-u,v=a?e:o;kf.test(i.text.charAt(v));)++v;return k=lu(r,v,a?rt:b),k.after=a,k}if(c=Math.ceil(w/2),s=e+c,tt)for(s=e,d=0;d<c;++d)s=us(i,s,1);y=p(s),y>u?(o=s,l=y,(b=h)&&(l+=1e3),w-=c):(e=s,it=y,rt=h,w=c)}}function fr(n){var r,t;if(n.cachedTextHeight!=null)return n.cachedTextHeight;if(pt==null){for(pt=i("pre"),r=0;r<49;++r)pt.appendChild(document.createTextNode("x")),pt.appendChild(i("br"));pt.appendChild(document.createTextNode("x"))}return et(n.measure,pt),t=pt.offsetHeight/50,t>3&&(n.cachedTextHeight=t),df(n.measure),t||1}function ks(n){var r,u,t;return n.cachedCharWidth!=null?n.cachedCharWidth:(r=i("span","x"),u=i("pre",[r]),et(n.measure,u),t=r.offsetWidth,t>2&&(n.cachedCharWidth=t),t||10)}function si(n){n.curOp={changes:[],updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,updateMaxLine:!1,updateScrollPos:!1,id:++ds},iu++||(at=[])}function hi(n){var t=n.curOp,s=n.doc,r=n.display,l,c,u,a,f,e,o,h,i;if(n.curOp=null,t.updateMaxLine&&se(n),r.maxLineChanged&&!n.options.lineWrapping&&(l=fa(n,r.maxLine),r.sizer.style.minWidth=Math.max(0,l+3+di)+"px",r.maxLineChanged=!1,c=Math.max(0,r.sizer.offsetLeft+r.sizer.offsetWidth-r.scroller.clientWidth),c<s.scrollLeft&&!t.updateScrollPos&&li(n,Math.min(r.scroller.scrollLeft,c),!0)),t.updateScrollPos?u=t.updateScrollPos:t.selectionChanged&&r.scroller.clientHeight&&(f=st(n,s.sel.head),u=uo(n,f.left,f.top,f.left,f.bottom)),(t.changes.length||u&&u.scrollTop!=null)&&(a=ou(n,t.changes,u&&u.scrollTop),n.display.scroller.offsetHeight&&(n.doc.scrollTop=n.display.scroller.scrollTop)),!a&&t.selectionChanged&&ye(n),t.updateScrollPos?(r.scroller.scrollTop=r.scrollbarV.scrollTop=s.scrollTop=u.scrollTop,r.scroller.scrollLeft=r.scrollbarH.scrollLeft=s.scrollLeft=u.scrollLeft,as(n)):u&&ka(n),t.selectionChanged&&su(n),n.state.focused&&t.updateInput&&wt(n,t.userSelChange),e=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers,e)for(i=0;i<e.length;++i)e[i].lines.length||y(e[i],"hide");if(o)for(i=0;i<o.length;++i)o[i].lines.length&&y(o[i],"unhide");if(--iu||(h=at,at=null),t.textChanged&&y(n,"change",n,t.textChanged),t.selectionChanged&&y(n,"cursorActivity",n),h)for(i=0;i<h.length;++i)h[i]()}function f(n,t){return function(){var i=n||this,r=!i.curOp,u;r&&si(i);try{u=t.apply(i,arguments)}finally{r&&hi(i)}return u}}function er(n){return function(){var t=this.cm&&!this.cm.curOp,i;t&&si(this.cm);try{i=n.apply(this,arguments)}finally{t&&hi(this.cm)}return i}}function gs(n,t){var i=!n.curOp,r;i&&si(n);try{r=t()}finally{i&&hi(n)}return r}function l(n,t,i,r){t==null&&(t=n.doc.first),i==null&&(i=n.doc.first+n.doc.size),n.curOp.changes.push({from:t,to:i,diff:r})}function au(n){n.display.pollingFast||n.display.poll.set(n.options.pollInterval,function(){de(n),n.state.focused&&au(n)})}function or(n){function i(){var r=de(n);r||t?(n.display.pollingFast=!1,au(n)):(t=!0,n.display.poll.set(60,i))}var t=!1;n.display.pollingFast=!0,n.display.poll.set(20,i)}function de(n){var c=n.display.input,o=n.display.prevInput,a=n.doc,h=a.sel,i,l,u,v,e,f,y;if(!n.state.focused||kv(c)||sr(n)||(i=c.value,i==o&&s(h.from,h.to)))return!1;if(w&&i&&c.selectionStart===0)return wt(n,!0),!1;for(l=!n.curOp,l&&si(n),h.shift=!1,u=0,v=Math.min(o.length,i.length);u<v&&o[u]==i[u];)++u;return e=h.from,f=h.to,u<o.length?e=t(e.line,e.ch-(o.length-u)):n.state.overwrite&&s(e,f)&&!n.state.pasteIncoming&&(f=t(f.line,Math.min(r(a,f.line).text.length,f.ch+(i.length-u)))),y=n.curOp.updateInput,ai(n.doc,{from:e,to:f,text:vt(i.slice(u)),origin:n.state.pasteIncoming?"paste":"+input"},"end"),n.curOp.updateInput=y,i.length>1e3||i.indexOf("\n")>-1?c.value=n.display.prevInput="":n.display.prevInput=i,l&&hi(n),n.state.pasteIncoming=!1,!0}function wt(n,t){var r,u,i=n.doc;s(i.sel.from,i.sel.to)?t&&(n.display.prevInput=n.display.input.value=""):(n.display.prevInput="",r=il&&(i.sel.to.line-i.sel.from.line>100||(u=n.getSelection()).length>1e3),n.display.input.value=r?"-":u||n.getSelection(),n.state.focused&&bc(n.display.input)),n.display.inaccurateSelection=r}function b(n){n.options.readOnly=="nocursor"||ee&&document.activeElement==n.display.input||n.display.input.focus()}function sr(n){return n.options.readOnly||n.doc.cantEdit}function sa(n){function i(){n.state.focused&&setTimeout(tt(b,n),0)}function r(){t.cachedCharWidth=t.cachedTextHeight=null,oi(n),gs(n,tt(l,n))}function u(){for(var n=t.wrapper.parentNode;n&&n!=document.body;n=n.parentNode);n?setTimeout(u,5e3):ht(window,"resize",r)}function o(t){n.options.onDragEvent&&n.options.onDragEvent(n,tu(t))||pf(t)}function s(){t.inaccurateSelection&&(t.prevInput="",t.inaccurateSelection=!1,t.input.value=n.getSelection(),bc(t.input))}var t=n.display;e(t.scroller,"mousedown",f(n,ha)),e(t.scroller,"dblclick",f(n,a)),e(t.lineSpace,"selectstart",function(n){ci(t,n)||a(n)}),oe||e(t.scroller,"contextmenu",function(t){fh(n,t)}),e(t.scroller,"scroll",function(){t.scroller.clientHeight&&(cr(n,t.scroller.scrollTop),li(n,t.scroller.scrollLeft,!0),y(n,"scroll",n))}),e(t.scrollbarV,"scroll",function(){t.scroller.clientHeight&&cr(n,t.scrollbarV.scrollTop)}),e(t.scrollbarH,"scroll",function(){t.scroller.clientHeight&&li(n,t.scrollbarH.scrollLeft)}),e(t.scroller,"mousewheel",function(t){nh(n,t)}),e(t.scroller,"DOMMouseScroll",function(t){nh(n,t)}),e(t.scrollbarH,"mousedown",i),e(t.scrollbarV,"mousedown",i),e(t.wrapper,"scroll",function(){t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),e(window,"resize",r),setTimeout(u,5e3),e(t.input,"keyup",f(n,function(t){n.options.onKeyEvent&&n.options.onKeyEvent(n,tu(t))||t.keyCode==16&&(n.doc.sel.shift=!1)})),e(t.input,"input",tt(or,n)),e(t.input,"keydown",f(n,uh)),e(t.input,"keypress",f(n,ya)),e(t.input,"focus",tt(bt,n)),e(t.input,"blur",tt(ge,n)),n.options.dragDrop&&(e(t.scroller,"dragstart",function(t){aa(n,t)}),e(t.scroller,"dragenter",o),e(t.scroller,"dragover",o),e(t.scroller,"drop",f(n,ca))),e(t.scroller,"paste",function(i){ci(t,i)||(b(n),or(n))}),e(t.input,"paste",function(){n.state.pasteIncoming=!0,or(n)}),e(t.input,"cut",s),e(t.input,"copy",s),fe&&e(t.sizer,"mouseup",function(){document.activeElement==t.input&&t.input.blur(),b(n)})}function ci(n,t){for(var i=ko(t);i!=n.wrapper;i=i.parentNode)if(!i||/\bCodeMirror-(?:line)?widget\b/.test(i.className)||i.parentNode==n.sizer&&i!=n.mover)return!0}function hr(n,t,i){var r=n.display,u,e,o,f;if(!i&&(u=ko(t),u==r.scrollbarH||u==r.scrollbarH.firstChild||u==r.scrollbarV||u==r.scrollbarV.firstChild||u==r.scrollbarFiller))return null;f=c(r.lineSpace);try{e=t.clientX,o=t.clientY}catch(t){return null}return ke(n,e-f.left,o-f.top)}function ha(n){function at(n){if(p=="single"){v(i.doc,u(y,o),n);return}if(d=u(y,d),rt=u(y,rt),p=="double"){var f=ph(r(y,n.line).text,n);h(n,d)?v(i.doc,f.from,rt):v(i.doc,d,f.to)}else p=="triple"&&(h(n,d)?v(i.doc,rt,u(y,t(n.line,0))):v(i.doc,d,u(y,t(n.line+1,0))))}function st(n){var e=++ut,t=hr(i,n,!0),r,u;t&&(s(t,et)?(u=n.clientY<ot.top?-20:n.clientY>ot.bottom?20:0,u&&setTimeout(f(i,function(){ut==e&&(l.scroller.scrollTop+=u,st(n))}),50)):(i.state.focused||bt(i),et=t,at(t),r=ce(l,y),(t.line>=r.to||t.line<r.from)&&setTimeout(f(i,function(){ut==e&&st(n)}),150)))}function vt(n){ut=Infinity;var t=hr(i,n);t&&at(t),a(n),b(i),ht(document,"mousemove",ct),ht(document,"mouseup",lt)}var i=this,l=i.display,y=i.doc,k=y.sel,o,it,p,ft,et,g,d,rt,ot,ut,ct,lt;if(k.shift=n.shiftKey,ci(l,n)){nt||(l.scroller.draggable=!1,setTimeout(function(){l.scroller.draggable=!0},100));return}if(!la(i,n)){o=hr(i,n);switch(pc(n)){case 3:oe&&fh.call(i,i,n);return;case 2:o&&v(i.doc,o),setTimeout(tt(b,i),20),a(n);return}if(!o){ko(n)==l.scroller&&a(n);return}if(i.state.focused||bt(i),it=+new Date,p="single",yu&&yu.time>it-400&&s(yu.pos,o)?(p="triple",a(n),setTimeout(tt(b,i),20),da(i,o.line)):vu&&vu.time>it-400&&s(vu.pos,o)?(p="double",yu={time:it,pos:o},a(n),ft=ph(r(y,o.line).text,o),v(i.doc,ft.from,ft.to)):vu={time:it,pos:o},et=o,i.options.dragDrop&&tl&&!sr(i)&&!s(k.from,k.to)&&!h(o,k.from)&&!h(k.to,o)&&p=="single"){g=f(i,function(t){nt&&(l.scroller.draggable=!1),i.state.draggingText=!1,ht(document,"mouseup",g),ht(l.scroller,"drop",g),Math.abs(n.clientX-t.clientX)+Math.abs(n.clientY-t.clientY)<10&&(a(t),v(i.doc,o),b(i))}),nt&&(l.scroller.draggable=!0),i.state.draggingText=g,l.scroller.dragDrop&&l.scroller.dragDrop(),e(document,"mouseup",g),e(l.scroller,"drop",g);return}a(n),p=="single"&&v(i.doc,u(y,o)),d=k.from,rt=k.to,ot=c(l.wrapper),ut=0,ct=f(i,function(n){w||pc(n)?st(n):vt(n)}),lt=f(i,vt),e(document,"mousemove",ct),e(document,"mouseup",lt)}}function ca(n){var t=this,i,f,e,r,s,c;if(!ci(t.display,n)&&(!t.options.onDragEvent||!t.options.onDragEvent(t,tu(n)))&&(a(n),i=hr(t,n,!0),f=n.dataTransfer.files,i&&!sr(t)))if(f&&f.length&&window.FileReader&&window.File){var o=f.length,r=Array(o),l=0,v=function(n,f){var e=new FileReader;e.onload=function(){r[f]=e.result,++l==o&&(i=u(t.doc,i),ai(t.doc,{from:i,to:i,text:vt(r.join("\n")),origin:"paste"},"around"))},e.readAsText(n)};for(e=0;e<o;++e)v(f[e],e)}else{if(t.state.draggingText&&!(h(i,t.doc.sel.from)||h(t.doc.sel.to,i))){t.state.draggingText(n),setTimeout(tt(b,t),20);return}try{r=n.dataTransfer.getData("Text"),r&&(s=t.doc.sel.from,c=t.doc.sel.to,lt(t.doc,i,i),t.state.draggingText&&kt(t.doc,"",s,c,"paste"),t.replaceSelection(r,null,"paste"),b(t),bt(t))}catch(n){}}}function la(n,t){var r=n.display,f,u,e,i,o,s,h;try{f=t.clientX,u=t.clientY}catch(t){return!1}if(f>=Math.floor(c(r.gutters).right))return!1;if((a(t),!ki(n,"gutterClick"))||(e=c(r.lineDiv),u>e.bottom))return!0;for(u-=e.top-r.viewOffset,i=0;i<n.options.gutters.length;++i)if(o=r.gutters.childNodes[i],o&&c(o).right>=f){s=lf(n.doc,u),h=n.options.gutters[i],ft(n,"gutterClick",n,s,h,t);break}return!0}function aa(n,t){var u,r;ci(n.display,t)||(u=n.getSelection(),t.dataTransfer.setData("Text",u),t.dataTransfer.setDragImage&&(r=i("img",null,null,"position: fixed; left: 0; top: 0;"),ot&&(r.width=r.height=1,n.display.wrapper.appendChild(r),r._top=r.offsetTop),ue&&(n.display.dragImg?r=n.display.dragImg:(n.display.dragImg=r,r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",n.display.wrapper.appendChild(r))),t.dataTransfer.setDragImage(r,0,0),ot&&r.parentNode.removeChild(r)))}function cr(n,t){Math.abs(n.doc.scrollTop-t)<2||(n.doc.scrollTop=t,ui||ou(n,[],t),n.display.scroller.scrollTop!=t&&(n.display.scroller.scrollTop=t),n.display.scrollbarV.scrollTop!=t&&(n.display.scrollbarV.scrollTop=t),ui&&ou(n,[]))}function li(n,t,i){(i?t==n.doc.scrollLeft:Math.abs(n.doc.scrollLeft-t)<2)||(t=Math.min(t,n.display.scroller.scrollWidth-n.display.scroller.clientWidth),n.doc.scrollLeft=t,as(n),n.display.scroller.scrollLeft!=t&&(n.display.scroller.scrollLeft=t),n.display.scrollbarH.scrollLeft!=t&&(n.display.scrollbarH.scrollLeft=t))}function nh(n,t){var f=t.wheelDeltaX,u=t.wheelDeltaY,e,i,r;if(f==null&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(f=t.detail),u==null&&t.detail&&t.axis==t.VERTICAL_AXIS?u=t.detail:u==null&&(u=t.wheelDelta),u&&ei&&nt)for(e=t.target;e!=r;e=e.parentNode)if(e.lineObj){n.display.currentWheelTarget=e;break}if(i=n.display,r=i.scroller,f&&!ui&&!ot&&k!=null){u&&cr(n,Math.max(0,Math.min(r.scrollTop+u*k,r.scrollHeight-r.clientHeight))),li(n,Math.max(0,Math.min(r.scrollLeft+f*k,r.scrollWidth-r.clientWidth))),a(t),i.wheelStartX=null;return}if(u&&k!=null){var s=u*k,o=n.doc.scrollTop,h=o+i.wrapper.clientHeight;s<0?o=Math.max(0,o+s-50):h=Math.min(n.doc.height,h+s+50),ou(n,[],{top:o,bottom:h})}lr<20&&(i.wheelStartX==null?(i.wheelStartX=r.scrollLeft,i.wheelStartY=r.scrollTop,i.wheelDX=f,i.wheelDY=u,setTimeout(function(){if(i.wheelStartX!=null){var n=r.scrollLeft-i.wheelStartX,t=r.scrollTop-i.wheelStartY,u=t&&i.wheelDY&&t/i.wheelDY||n&&i.wheelDX&&n/i.wheelDX;(i.wheelStartX=i.wheelStartY=null,u)&&(k=(k*lr+u)/(lr+1),++lr)}},200)):(i.wheelDX+=f,i.wheelDY+=u))}function pu(n,t,i){if(typeof t=="string"&&(t=uf[t],!t))return!1;n.display.pollingFast&&de(n)&&(n.display.pollingFast=!1);var r=n.doc,f=r.sel.shift,u=!1;try{sr(n)&&(n.state.suppressEdits=!0),i&&(r.sel.shift=!1),u=t(n)!=go}finally{r.sel.shift=f,n.state.suppressEdits=!1}return u}function th(n){var t=n.state.keyMaps.slice(0);return n.options.extraKeys&&t.push(n.options.extraKeys),t.push(n.options.keyMap),t}function rh(n,t){var e=ho(n.options.keyMap),u=e.auto,r,i,f;return(clearTimeout(ih),u&&!bh(t)&&(ih=setTimeout(function(){ho(n.options.keyMap)==e&&(n.options.keyMap=u.call?u.call(null,n):u)},50)),r=kh(t,!0),i=!1,!r)?!1:(f=th(n),i=t.shiftKey?vr("Shift-"+r,f,function(t){return pu(n,t,!0)})||vr(r,f,function(t){if(typeof t=="string"&&/^go[A-Z]/.test(t))return pu(n,t)}):vr(r,f,function(t){return pu(n,t)}),i=="stop"&&(i=!1),i&&(a(t),su(n),yt&&(t.oldKeyCode=t.keyCode,t.keyCode=0)),i)}function va(n,t,i){var r=vr("'"+i+"'",th(n),function(t){return pu(n,t,!0)});return r&&(a(t),su(n)),r}function uh(n){var t=this,i,r;(t.state.focused||bt(t),w&&n.keyCode==27&&(n.returnValue=!1),t.options.onKeyEvent&&t.options.onKeyEvent(t,tu(n)))||(i=n.keyCode,t.doc.sel.shift=i==16||n.shiftKey,r=rh(t,n),ot&&(wu=r?i:null,r||i!=88||il||!(ei?n.metaKey:n.ctrlKey)||t.replaceSelection("")))}function ya(n){var t=this,i,r,u;if(!t.options.onKeyEvent||!t.options.onKeyEvent(t,tu(n))){if(i=n.keyCode,r=n.charCode,ot&&i==wu){wu=null,a(n);return}(ot&&(!n.which||n.which<10)||fe)&&rh(t,n)||(u=String.fromCharCode(r==null?i:r),this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!sr(this)&&this.doc.mode.electricChars.indexOf(u)>-1&&setTimeout(f(t,function(){du(t,t.doc.sel.to.line,"smart")}),75),va(t,n,u))||or(t)}}function bt(n){n.options.readOnly!="nocursor"&&(n.state.focused||(y(n,"focus",n),n.state.focused=!0,n.display.wrapper.className.search(/\bCodeMirror-focused\b/)==-1&&(n.display.wrapper.className+=" CodeMirror-focused"),wt(n,!0)),au(n),su(n))}function ge(n){n.state.focused&&(y(n,"blur",n),n.state.focused=!1,n.display.wrapper.className=n.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(n.display.blinker),setTimeout(function(){n.state.focused||(n.doc.sel.shift=!1)},150)}function fh(n,t){function a(){var u,e,t;i.inputDiv.style.position="relative",i.input.style.cssText=l,yt&&(i.scrollbarV.scrollTop=i.scroller.scrollTop=c),au(n),i.input.selectionStart!=null&&(!w||yt)&&(clearTimeout(no),u=i.input.value=" "+(s(r.from,r.to)?"":i.input.value),e=0,i.prevInput=" ",i.input.selectionStart=1,i.input.selectionEnd=u.length,t=function(){i.prevInput==" "&&i.input.selectionStart==0?f(n,uf.selectAll)(n):e++<10?no=setTimeout(t,500):wt(n)},no=setTimeout(t,200))}var i=n.display,r=n.doc.sel,u,c,l,o;ci(i,t)||(u=hr(n,t),c=i.scroller.scrollTop,u&&!ot)&&((s(r.from,r.to)||h(u,r.from)||!h(u,r.to))&&f(n,lt)(n.doc,u,u),l=i.input.style.cssText,i.inputDiv.style.position="absolute",i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",b(n),wt(n,!0),s(r.from,r.to)&&(i.input.value=i.prevInput=" "),oe?(pf(t),o=function(){ht(window,"mouseup",o),setTimeout(a,20)},e(window,"mouseup",o)):setTimeout(a,50))}function to(n){return t(n.from.line+n.text.length-1,p(n.text).length+(n.text.length==1?n.from.ch:0))}function eh(n,i,f){var e,s,o,c;return h(i.from,f)?(e=i.text.length-1-(i.to.line-i.from.line),f.line>i.to.line+e)?(s=f.line-e,o=n.first+n.size-1,s>o)?t(o,r(n,o).text.length):bu(f,r(n,s).text.length):f.line==i.to.line+e?bu(f,p(i.text).length+(i.text.length==1?i.from.ch:0)+r(n,i.to.line).text.length-i.to.ch):(c=f.line-i.from.line,bu(f,i.text[c].length+(c?0:i.from.ch))):u(n,f)}function io(n,i,r){var u,f;return r&&typeof r=="object"?{anchor:eh(n,i,r.anchor),head:eh(n,i,r.head)}:r=="start"?{anchor:i.from,head:i.from}:(u=to(i),r=="around")?{anchor:i.from,head:u}:r=="end"?{anchor:u,head:u}:(f=function(n){if(h(n,i.from))return n;if(!h(i.to,n))return u;var f=n.line+i.text.length-(i.to.line-i.from.line)-1,r=n.ch;return n.line==i.to.line&&(r+=u.ch-i.to.ch),t(f,r)},{anchor:f(n.sel.anchor),head:f(n.sel.head)})}function pa(n,t){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,update:function(t,i,r,f){t&&(this.from=u(n,t)),i&&(this.to=u(n,i)),r&&(this.text=r),f!==undefined&&(this.origin=f)},cancel:function(){this.canceled=!0}};return(y(n,"beforeChange",n,i),n.cm&&y(n.cm,"beforeChange",n.cm,i),i.canceled)?null:{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ai(n,t,i,r){var u,e;if(n.cm){if(!n.cm.curOp)return f(n.cm,ai)(n,t,i,r);if(n.cm.state.suppressEdits)return}if(!ki(n,"beforeChange")&&(!n.cm||!ki(n.cm,"beforeChange"))||(t=pa(n,t),t))if(u=es&&!r&&uv(n,t.from,t.to),u){for(e=u.length-1;e>=1;--e)ro(n,{from:u[e].from,to:u[e].to,text:[""]});u.length&&ro(n,{from:u[0].from,to:u[0].to,text:t.text},i)}else ro(n,t,i)}function ro(n,t,i){var u=io(n,t,i),r;av(n,t,u,n.cm?n.cm.curOp.id:NaN),ar(n,t,u,co(n,t)),r=[],wi(n,function(n,i){i||ct(r,n.history)!=-1||(vc(n.history,t),r.push(n.history)),ar(n,t,null,co(n,t))})}function oh(n,t){var u,i,e,f,r,s,o;if((!n.cm||!n.cm.state.suppressEdits)&&(u=n.history,i=(t=="undo"?u.done:u.undone).pop(),i))for(u.dirtyCounter+=t=="undo"?-1:1,e={changes:[],anchorBefore:i.anchorAfter,headBefore:i.headAfter,anchorAfter:i.anchorBefore,headAfter:i.headBefore},(t=="undo"?u.undone:u.done).push(e),f=i.changes.length-1;f>=0;--f)r=i.changes[f],r.origin=t,e.changes.push(bo(n,r)),s=f?io(n,r,null):{anchor:i.anchorBefore,head:i.headBefore},ar(n,r,s,dh(n,r)),o=[],wi(n,function(n,t){t||ct(o,n.history)!=-1||(vc(n.history,r),o.push(n.history)),ar(n,r,null,dh(n,r))})}function sh(n,i){function r(n){return t(n.line+i,n.ch)}n.first+=i,n.cm&&l(n.cm,n.first,n.first,i),n.sel.head=r(n.sel.head),n.sel.anchor=r(n.sel.anchor),n.sel.from=r(n.sel.from),n.sel.to=r(n.sel.to)}function ar(n,i,u,e){var s,o;if(n.cm&&!n.cm.curOp)return f(n.cm,ar)(n,i,u,e);if(i.to.line<n.first){sh(n,i.text.length-1-(i.to.line-i.from.line));return}i.from.line>n.lastLine()||(i.from.line<n.first&&(s=i.text.length-1-(n.first-i.from.line),sh(n,s),i={from:t(n.first,0),to:t(i.to.line+s,i.to.ch),text:[p(i.text)],origin:i.origin}),o=n.lastLine(),i.to.line>o&&(i={from:i.from,to:t(o,r(n,o).text.length),text:[i.text[0]],origin:i.origin}),i.removed=po(n,i.from,i.to),u||(u=io(n,i,null)),n.cm?wa(n.cm,i,e,u):yo(n,i,e,u))}function wa(n,t,i,u){var f=n.doc,o=n.display,e=t.from,h=t.to,c=!1,a=e.line,y,v,s;if(n.options.lineWrapping||(a=g(pi(f,r(f,e.line))),f.iter(a,h.line+1,function(n){if(n==o.maxLine)return c=!0,!0})),yo(f,t,i,u,os(n)),n.options.lineWrapping||(f.iter(a,e.line+t.text.length,function(n){var t=eu(f,n);t>o.maxLineLength&&(o.maxLine=n,o.maxLineLength=t,o.maxLineChanged=!0,c=!1)}),c&&(n.curOp.updateMaxLine=!0)),f.frontier=Math.min(f.frontier,e.line),hu(n,400),y=t.text.length-(h.line-e.line)-1,l(n,e.line,h.line+1,y),ki(n,"change"))if(v={from:e,to:h,text:t.text,removed:t.removed,origin:t.origin},n.curOp.textChanged){for(s=n.curOp.textChanged;s.next;s=s.next);s.next=v}else n.curOp.textChanged=v}function kt(n,t,i,r,u){if(r||(r=i),h(r,i)){var f=r;r=i,i=f}typeof t=="string"&&(t=vt(t)),ai(n,{from:i,to:r,text:t,origin:u},null)}function t(n,i){if(!(this instanceof t))return new t(n,i);this.line=n,this.ch=i}function s(n,t){return n.line==t.line&&n.ch==t.ch}function h(n,t){return n.line<t.line||n.line==t.line&&n.ch<t.ch}function dt(n){return t(n.line,n.ch)}function hh(n,t){return Math.max(n.first,Math.min(t,n.first+n.size-1))}function u(n,i){if(i.line<n.first)return t(n.first,0);var u=n.first+n.size-1;return i.line>u?t(u,r(n,u).text.length):bu(i,r(n,i.line).text.length)}function bu(n,i){var r=n.ch;return r==null||r>i?t(n.line,i):r<0?t(n.line,0):n}function gt(n,t){return t>=n.first&&t<n.first+n.size}function v(n,t,i,r){var u,f;n.sel.shift||n.sel.extend?(u=n.sel.anchor,i&&(f=h(t,u),f!=h(i,u)?(u=t,t=i):f!=h(t,i)&&(t=i)),lt(n,u,t,r)):lt(n,t,i||t,r),n.cm&&(n.cm.curOp.userSelChange=!0)}function ba(n,t,i){var r={anchor:t,head:i};return y(n,"beforeSelectionChange",n,r),n.cm&&y(n.cm,"beforeSelectionChange",n.cm,r),r.anchor=u(n,r.anchor),r.head=u(n,r.head),r}function lt(n,t,i,r,u){var e,f,o;((!u&&ki(n,"beforeSelectionChange")||n.cm&&ki(n.cm,"beforeSelectionChange"))&&(e=ba(n,t,i),i=e.head,t=e.anchor),f=n.sel,f.goalColumn=null,(u||!s(t,f.anchor))&&(t=ku(n,t,r,u!="push")),(u||!s(i,f.head))&&(i=ku(n,i,r,u!="push")),s(f.anchor,t)&&s(f.head,i))||(f.anchor=t,f.head=i,o=h(i,t),f.from=o?i:t,f.to=o?t:i,n.cm&&(n.cm.curOp.updateInput=n.cm.curOp.selectionChanged=!0),ft(n,"cursorActivity",n))}function ch(n){lt(n.doc,n.doc.sel.from,n.doc.sel.to,null,"push")}function ku(n,i,f,e){var w=!1,h=i,p=f||1,a,v,c,l,o;n.cantEdit=!1;n:for(;;){if(a=r(n,h.line),a.markedSpans)for(v=0;v<a.markedSpans.length;++v)if(c=a.markedSpans[v],l=c.marker,(c.from==null||(l.inclusiveLeft?c.from<=h.ch:c.from<h.ch))&&(c.to==null||(l.inclusiveRight?c.to>=h.ch:c.to>h.ch))){if(e&&(y(l,"beforeCursorEnter"),l.explicitlyCleared))if(a.markedSpans){--v;continue}else break;if(!l.atomic)continue;if(o=l.find()[p<0?"from":"to"],s(o,h)&&(o.ch+=p,o.ch<0?o=o.line>n.first?u(n,t(o.line-1)):null:o.ch>a.text.length&&(o=o.line<n.first+n.size-1?t(o.line+1,0):null),!o)){if(w)return e?(n.cantEdit=!0,t(n.first,0)):ku(n,i,f,!0);w=!0,o=i,p=-p}h=o;continue n}return h}}function ka(n){var i=lh(n,n.doc.sel.head),u;if(n.state.focused){var t=n.display,f=c(t.sizer),r=null,e=cu(n.display);i.top+e+f.top<0?r=!0:i.bottom+e+f.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r==null||cl||(u=t.cursor.style.display=="none",u&&(t.cursor.style.display="",t.cursor.style.left=i.left+"px",t.cursor.style.top=i.top-t.viewOffset+"px"),t.cursor.scrollIntoView(r),u&&(t.cursor.style.display="none"))}}function lh(n,t,i){for(i==null&&(i=0);;){var f=!1,r=st(n,t),u=uo(n,r.left,r.top-i,r.left,r.bottom+i),e=n.doc.scrollTop,o=n.doc.scrollLeft;if(u.scrollTop!=null&&(cr(n,u.scrollTop),Math.abs(n.doc.scrollTop-e)>1&&(f=!0)),u.scrollLeft!=null&&(li(n,u.scrollLeft),Math.abs(n.doc.scrollLeft-o)>1&&(f=!0)),!f)return r}}function ah(n,t,i,r,u){var f=uo(n,t,i,r,u);f.scrollTop!=null&&cr(n,f.scrollTop),f.scrollLeft!=null&&li(n,f.scrollLeft)}function uo(n,t,i,r,u){var f=n.display,o=cu(f),h,c,s,l;i+=o,u+=o;var a=f.scroller.clientHeight-di,v=f.scroller.scrollTop,e={},y=n.doc.height+ps(f),p=i<o+10,w=u+o>y-10;return i<v?e.scrollTop=p?0:Math.max(0,i):u>v+a&&(e.scrollTop=(w?y:u)-a),h=f.scroller.clientWidth-di,c=f.scroller.scrollLeft,t+=f.gutters.offsetWidth,r+=f.gutters.offsetWidth,s=f.gutters.offsetWidth,l=t<s+10,t<c+s||l?(l&&(t=0),e.scrollLeft=Math.max(0,t-10-s)):r>h+c-3&&(e.scrollLeft=r+10-h),e}function fo(n,t,i){n.curOp.updateScrollPos={scrollLeft:t,scrollTop:i}}function vh(n,t,i){var r=n.curOp.updateScrollPos||(n.curOp.updateScrollPos={scrollLeft:n.doc.scrollLeft,scrollTop:n.doc.scrollTop}),u=n.display.scroller;r.scrollTop=Math.max(0,Math.min(u.scrollHeight-u.clientHeight,r.scrollTop+i)),r.scrollLeft=Math.max(0,Math.min(u.scrollWidth-u.clientWidth,r.scrollLeft+t))}function du(n,i,u,f){var l=n.doc,y,s,c,v;u||(u="add"),u=="smart"&&(n.doc.mode.indent?y=ur(n,i):u="prev");var h=n.options.tabSize,o=r(l,i),p=gi(o.text,null,h),a=o.text.match(/^\s*/)[0],e;if(u=="smart"&&(e=n.doc.mode.indent(y,o.text.slice(a.length),o.text),e==go)){if(!f)return;u="prev"}if(u=="prev"?e=i>l.first?gi(r(l,i-1).text,null,h):0:u=="add"?e=p+n.options.indentUnit:u=="subtract"&&(e=p-n.options.indentUnit),e=Math.max(0,e),s="",c=0,n.options.indentWithTabs)for(v=Math.floor(e/h);v;--v)c+=h,s+="\t";c<e&&(s+=wc(e-c)),s!=a&&kt(n.doc,s,t(i,0),t(i,a.length),"+input"),o.stateAfter=null}function gu(n,t,i){var u=t,f=t,e=n.doc;if(typeof t=="number"?f=r(e,hh(e,t)):u=g(t),u==null)return null;if(i(f,u))l(n,u,u+1);else return null;return f}function eo(n,i,u,f,e){function k(){var t=c+u;return t<n.first||t>=n.first+n.size?y=!1:(c=t,s=r(n,t))}function h(n){var t=(e?us:ul)(s,o,u,!0);if(t==null)if(!n&&k())o=e?(u<0?re:ie)(s):u<0?s.text.length:0;else return y=!1;else o=t;return!0}var c=i.line,o=i.ch,s=r(n,c),y=!0,l,b,a,p,v,w;if(f=="char")h();else if(f=="column")h(!0);else if(f=="word"||f=="group")for(l=null,b=f=="group",a=!0;;a=!1){if(u<0&&!h(!a))break;if(p=s.text.charAt(o)||"\n",v=bf(p)?"w":b?/\s/.test(p)?null:"p":null,l&&l!=v){u<0&&(u=1,h());break}if(v&&(l=v),u>0&&!h(!a))break}return w=ku(n,t(c,o),u,!0),y||(w.hitSide=!0),w}function yh(n,t,i,r){var o=n.doc,s=t.left,u,e,f;for(r=="page"?(e=Math.min(n.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=t.top+i*(e-(i<0?1.5:.5)*fr(n.display))):r=="line"&&(u=i>0?t.bottom+3:t.top-3);;){if(f=ke(n,s,u),!f.outside)break;if(i<0?u<=0:u>=o.height){f.hitSide=!0;break}u+=i*5}return f}function ph(n,i){var r=i.ch,u=i.ch,f,e;if(n){for(i.after===!1||u==n.length?--r:++u,f=n.charAt(r),e=bf(f)?bf:/\s/.test(f)?function(n){return/\s/.test(n)}:function(n){return!/\s/.test(n)&&!bf(n)};r>0&&e(n.charAt(r-1));)--r;while(u<n.length&&e(n.charAt(u)))++u}return{from:t(i.line,r),to:t(i.line,u)}}function da(n,i){v(n.doc,t(i,0),u(n.doc,t(i+1,0)))}function o(t,i,r,u){n.defaults[t]=i,r&&(ni[t]=u?function(n,t,i){i!=oo&&r(n,t,i)}:r)}function yi(n,t){var r,u,i;if(t===!0)return t;if(n.copyState)return n.copyState(t);r={};for(u in t)i=t[u],i instanceof Array&&(i=i.concat([])),r[u]=i;return r}function wh(n,t,i){return n.startState?n.startState(t,i):!0}function ho(n){return typeof n=="string"?it[n]:n}function vr(n,t,i){function u(t){var f,r,e,s,o;if(t=ho(t),f=t[n],f===!1)return"stop";if(f!=null&&i(f))return!0;if(t.nofallthrough)return"stop";if(r=t.fallthrough,r==null)return!1;if(Object.prototype.toString.call(r)!="[object Array]")return u(r);for(e=0,s=r.length;e<s;++e)if(o=u(r[e]),o)return o;return!1}for(var f,r=0;r<t.length;++r)if(f=u(t[r]),f)return f}function bh(n){var t=ri[n.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function kh(n,t){var i=ri[n.keyCode];return i==null||n.altGraphKey?!1:(n.altKey&&(i="Alt-"+i),(fs?n.metaKey:n.ctrlKey)&&(i="Ctrl-"+i),(fs?n.ctrlKey:n.metaKey)&&(i="Cmd-"+i),!t&&n.shiftKey&&(i="Shift-"+i),i)}function yr(n,t){this.pos=this.start=0,this.string=n,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0}function ti(n,t){this.lines=[],this.type=t,this.doc=n}function pr(n,t,r,u,o){var s;if(u&&u.shared)return ga(n,t,r,u,o);if(n.cm&&!n.cm.curOp)return f(n.cm,pr)(n,t,r,u,o);if(s=new ti(n,o),o=="range"&&!h(t,r))return s;u&&wf(u,s),s.replacedWith&&(s.collapsed=!0,s.replacedWith=i("span",[s.replacedWith],"CodeMirror-widget")),s.collapsed&&(ir=!0);var a=t.line,v=0,y,p,c=n.cm,w;if(n.iter(a,r.line+1,function(i){c&&s.collapsed&&!c.options.lineWrapping&&pi(n,i)==c.display.maxLine&&(w=!0);var u={from:null,to:null,marker:s};v+=i.text.length,a==t.line&&(u.from=t.ch,v-=t.ch),a==r.line&&(u.to=r.ch,v-=i.text.length-r.ch),s.collapsed&&(a==r.line&&(p=ff(i,r.ch)),a==t.line?y=ff(i,t.ch):rt(i,0)),tv(i,u),++a}),s.collapsed&&n.iter(t.line,r.line+1,function(t){ii(n,t)&&rt(t,0)}),s.clearOnEnter&&e(s,"beforeCursorEnter",function(){s.clear()}),s.readOnly&&(es=!0,(n.history.done.length||n.history.undone.length)&&n.clearHistory()),s.collapsed){if(y!=p)throw new Error("Inserting collapsed marker overlapping an existing one");s.size=v,s.atomic=!0}return c&&(w&&(c.curOp.updateMaxLine=!0),(s.className||s.startStyle||s.endStyle||s.collapsed)&&l(c,t.line,r.line+1),s.atomic&&ch(c)),s}function wr(n,t){this.markers=n,this.primary=t;for(var i=0,r=this;i<n.length;++i)n[i].parent=this,e(n[i],"clear",function(){r.clear()})}function ga(n,t,i,r,f){r=wf(r),r.shared=!1;var e=[pr(n,t,i,r,f)],o=e[0],s=r.replacedWith;return wi(n,function(n){s&&(r.replacedWith=s.cloneNode(!0)),e.push(pr(n,u(n,t),u(n,i),r,f));for(var h=0;h<n.linked.length;++h)if(n.linked[h].isParent)return;o=p(e)}),new wr(e,o)}function br(n,t){var i,r;if(n)for(i=0;i<n.length;++i)if(r=n[i],r.marker==t)return r}function nv(n,t){for(var r,i=0;i<n.length;++i)n[i]!=t&&(r||(r=[])).push(n[i]);return r}function tv(n,t){n.markedSpans=n.markedSpans?n.markedSpans.concat([t]):[t],t.marker.attachLine(n)}function iv(n,t,i){var u,e,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t);!s&&(f.type!="bookmark"||r.from!=t||i&&r.marker.insertLeft)||(o=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t),(e||(e=[])).push({from:r.from,to:o?null:r.to,marker:f}))}return e}function rv(n,t,i){var u,e,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t);(s||f.type=="bookmark"&&r.from==t&&(!i||r.marker.insertLeft))&&(o=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t),(e||(e=[])).push({from:o?null:r.from-t,to:r.to==null?null:r.to-t,marker:f}))}return e}function co(n,t){var w=gt(n,t.from.line)&&r(n,t.from.line).markedSpans,b=gt(n,t.to.line)&&r(n,t.to.line).markedSpans,u,e,l,v,y,i;if(!w&&!b)return null;var a=t.from.ch,d=t.to.ch,k=s(t.from,t.to),f=iv(w,a,k),o=rv(b,d,k),h=t.text.length==1,c=p(t.text).length+(h?a:0);if(f)for(i=0;i<f.length;++i)u=f[i],u.to==null&&(e=br(o,u.marker),e?h&&(u.to=e.to==null?null:e.to+c):u.to=a);if(o)for(i=0;i<o.length;++i)u=o[i],u.to!=null&&(u.to+=c),u.from==null?(e=br(f,u.marker),e||(u.from=c,h&&(f||(f=[])).push(u))):(u.from+=c,h&&(f||(f=[])).push(u));if(l=[f],!h){if(v=t.text.length-2,v>0&&f)for(i=0;i<f.length;++i)f[i].to==null&&(y||(y=[])).push({from:null,to:null,marker:f[i].marker});for(i=0;i<v;++i)l.push(y);l.push(o)}return l}function dh(n,t){var i=yv(n,t),s=co(n,t),r,f,u,e,h,o;if(!i)return s;if(!s)return i;for(r=0;r<i.length;++r)if(f=i[r],u=s[r],f&&u)n:for(e=0;e<u.length;++e){for(h=u[e],o=0;o<f.length;++o)if(f[o].marker==h.marker)continue n;f.push(h)}else u&&(i[r]=u);return i}function uv(n,t,i){var f=null,e,l,a,r,o,u,c;if(n.iter(t.line,i.line+1,function(n){var t,i;if(n.markedSpans)for(t=0;t<n.markedSpans.length;++t)i=n.markedSpans[t].marker,i.readOnly&&(!f||ct(f,i)==-1)&&(f||(f=[])).push(i)}),!f)return null;for(e=[{from:t,to:i}],l=0;l<f.length;++l)for(a=f[l],r=a.find(),o=0;o<e.length;++o)(u=e[o],h(u.to,r.from)||h(r.to,u.from))||(c=[o,1],(h(u.from,r.from)||!a.inclusiveLeft&&s(u.from,r.from))&&c.push({from:u.from,to:r.from}),(h(r.to,u.to)||!a.inclusiveRight&&s(u.to,r.to))&&c.push({from:r.to,to:u.to}),e.splice.apply(e,c),o+=c.length-1);return e}function ff(n,t){var f=ir&&n.markedSpans,r,i,u;if(f)for(u=0;u<f.length;++u)(i=f[u],i.marker.collapsed)&&(i.from==null||i.from<t)&&(i.to==null||i.to>t)&&(!r||r.width<i.marker.width)&&(r=i.marker);return r}function ef(n){return ff(n,-1)}function kr(n){return ff(n,n.text.length+1)}function pi(n,t){for(var i;i=ef(t);)t=r(n,i.find().from.line);return t}function ii(n,t){var u=ir&&t.markedSpans,i,r;if(u)for(r=0;r<u.length;++r)if((i=u[r],i.marker.collapsed)&&(i.from==null||i.from==0&&i.marker.inclusiveLeft&&lo(n,t,i)))return!0}function lo(n,t,i){var o,e,u,f;if(i.to==null)return o=i.marker.find().to,e=r(n,o.line),lo(n,e,br(e.markedSpans,i.marker));if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(f=0;f<t.markedSpans.length;++f)if(u=t.markedSpans[f],u.marker.collapsed&&u.from==i.to&&(u.marker.inclusiveLeft||i.marker.inclusiveRight)&&lo(n,t,u))return!0}function gh(n){var i=n.markedSpans,t;if(i){for(t=0;t<i.length;++t)i[t].marker.detachLine(n);n.markedSpans=null}}function nc(n,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(n);n.markedSpans=t}}function tc(n){return function(){var t=!this.cm.curOp,i;t&&si(this.cm);try{i=n.apply(this,arguments)}finally{t&&hi(this.cm)}return i}}function sf(n){return n.height!=null?n.height:(n.node.parentNode&&n.node.parentNode.nodeType==1||et(n.cm.display.measure,i("div",[n.node],null,"position: relative")),n.height=n.node.offsetHeight)}function fv(n,t,i,r){var u=new of(n,i,r);return u.noHScroll&&(n.display.alignWidgets=!0),gu(n,t,function(t){if((t.widgets||(t.widgets=[])).push(u),u.line=t,!ii(n.doc,t)||u.showIfHidden){var i=bi(n,t)<n.display.scroller.scrollTop;rt(t,t.height+sf(u)),i&&vh(n,0,u.height)}return!0}),u}function dr(n,t,i){var r={text:n};return nc(r,t),r.height=i?i(r):1,r}function ev(n,t,i,r){n.text=t,n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null),n.order!=null&&(n.order=null),gh(n),nc(n,i);var u=r?r(n):1;u!=n.height&&rt(n,u)}function ov(n){n.parent=null,gh(n)}function ic(n,t,i,r,u){var o=i.flattenSpans,h,c;o==null&&(o=n.options.flattenSpans);var e="",s=null,f=new yr(t,n.options.tabSize);for(t==""&&i.blankLine&&i.blankLine(r);!f.eol();)h=i.token(f,r),f.pos>5e3&&(o=!1,f.pos=Math.min(t.length,f.start+5e4),h=null),c=f.current(),f.start=f.pos,o&&s==h?e=e+c:(e&&u(e,s),e=c,s=h);e&&u(e,s)}function rc(n,t,i){var u=[n.state.modeGen],f,e,r;for(ic(n,t.text,n.doc.mode,i,function(n,t){u.push(n,t)}),f=0;f<n.state.overlays.length;++f)e=n.state.overlays[f],r=1,ic(n,t.text,e.mode,!0,function(n,t){for(var f=r,o=n.length,s,i;o;)i=u[r],s=i.length,s<=o?o-=s:(u.splice(r,1,i.slice(0,o),u[r+1],i.slice(o)),o=0),r+=2;if(t)if(e.opaque)u.splice(f,r-f,n,t),r=f+2;else for(;f<r;f+=2)i=u[f+1],u[f+1]=i?i+" "+t:t});return u}function sv(n,t){return t.styles&&t.styles[0]==n.state.modeGen||(t.styles=rc(n,t,t.stateAfter=ur(n,g(t)))),t.styles}function uc(n,t,i){var u=n.doc.mode,r=new yr(t.text,n.options.tabSize);for(t.text==""&&u.blankLine&&u.blankLine(i);!r.eol()&&r.pos<=5e3;)u.token(r,i),r.start=r.pos}function fc(n){return n?ao[n]||(ao[n]="cm-"+n.replace(/ +/g," cm-")):null}function vo(n,t,u){for(var b,e=t,a,k,v=!0,f,c,o,s,l,p,h;b=ef(e);)v=!1,e=r(n.doc,b.find().from.line),a||(a=e);f={pre:i("pre"),col:0,pos:0,display:!u,measure:null,addedOne:!1,cm:n},e.textClass&&(f.pre.className=e.textClass);do f.measure=e==t&&u,f.pos=0,f.addToken=f.measure?hv:ec,(w||nt)&&n.getOption("lineWrapping")&&(f.addToken=cv(f.addToken)),u&&k&&e!=t&&!f.addedOne&&(u[0]=f.pre.appendChild(te(n.display.measure)),f.addedOne=!0),c=lv(e,f,sv(n,e)),k=e==a,c&&(e=r(n.doc,c.to.line),v=!1);while(c);return u&&!f.addedOne&&(u[0]=f.pre.appendChild(v?i("span"," "):te(n.display.measure))),f.pre.firstChild||ii(n.doc,t)||f.pre.appendChild(document.createTextNode(" ")),u&&w&&(o=ut(e))&&(s=o.length-1,o[s].from==o[s].to&&--s,l=o[s],p=o[s-1],l.from+1==l.to&&p&&l.level<p.level&&(h=u[f.pos-1],h&&h.parentNode.insertBefore(h.measureRight=te(n.display.measure),h.nextSibling))),y(n,"renderLine",n,t,f.pre),f.pre}function ec(n,t,r,u,f){var e,o,s,h,l,a,v,c;if(t){if(hf.test(t))for(e=document.createDocumentFragment(),o=0;;){if(hf.lastIndex=o,s=hf.exec(t),h=s?s.index-o:t.length-o,h&&(e.appendChild(document.createTextNode(t.slice(o,o+h))),n.col+=h),!s)break;o+=h+1,s[0]=="\t"?(l=n.cm.options.tabSize,a=l-n.col%l,e.appendChild(i("span",wc(a),"cm-tab")),n.col+=a):(v=i("span","•","cm-invalidchar"),v.title="\\u"+s[0].charCodeAt(0).toString(16),e.appendChild(v),n.col+=1)}else n.col+=t.length,e=document.createTextNode(t);if(r||u||f||n.measure)return c=r||"",u&&(c+=u),f&&(c+=f),n.pre.appendChild(i("span",[e],c));n.pre.appendChild(e)}}function hv(n,t,r,u,f){for(var s=n.cm.options.lineWrapping,o,h,c,e=0;e<t.length;++e)o=t.charAt(e),h=e==0,o>="�"&&o<"�"&&e<t.length-1?(o=t.slice(e,e+2),++e):e&&s&&uu.test(t.slice(e-1,e+1))&&n.pre.appendChild(i("wbr")),c=n.measure[n.pos]=ec(n,o,r,h&&u,e==t.length-1&&f),w&&s&&o==" "&&e&&!/\s/.test(t.charAt(e-1))&&e<t.length-1&&!/\s/.test(t.charAt(e+1))&&(c.style.whiteSpace="normal"),n.pos+=o.length;t.length&&(n.addedOne=!0)}function cv(n){function t(n){for(var i=" ",t=0;t<n.length-2;++t)i+=t%2?" ":" ";return i+" "}return function(i,r,u,f,e){return n(i,r.replace(/ {3,}/,t),u,f,e)}}function oc(n,t,i){i&&(n.display||(i=i.cloneNode(!0)),n.pre.appendChild(i),n.measure&&t&&(n.measure[n.pos]=i,n.addedOne=!0)),n.pos+=t}function lv(n,t,i){var b=n.markedSpans,s,y,p,u,e,c,w,g;if(!b){for(s=1;s<i.length;s+=2)t.addToken(t,i[s],fc(i[s+1]));return}for(var nt=n.text,k=nt.length,r=0,s=1,h="",d,o=0,l,a,v,f;;){if(o==r){for(l=a=v="",f=null,o=Infinity,y=null,p=0;p<b.length;++p)u=b[p],e=u.marker,u.from<=r&&(u.to==null||u.to>r)?(u.to!=null&&o>u.to&&(o=u.to,a=""),e.className&&(l+=" "+e.className),e.startStyle&&u.from==r&&(v+=" "+e.startStyle),e.endStyle&&u.to==o&&(a+=" "+e.endStyle),e.collapsed&&(!f||f.marker.width<e.width)&&(f=u)):u.from>r&&o>u.from&&(o=u.from),e.type=="bookmark"&&u.from==r&&e.replacedWith&&(y=e.replacedWith);if(f&&(f.from||0)==r&&(oc(t,(f.to==null?k:f.to)-r,f.from!=null&&f.marker.replacedWith),f.to==null))return f.marker.find();y&&!f&&oc(t,0,y)}if(r>=k)break;for(c=Math.min(k,o);;){if(h){if(w=r+h.length,f||(g=w>c?h.slice(0,c-r):h,t.addToken(t,g,d?d+l:l,v,r+g.length==o?a:"")),w>=c){h=h.slice(c-r),r=c;break}r=w,v=""}h=i[s++],d=fc(i[s++])}}}function yo(n,t,i,u,f){function l(n){return i?i[n]:null}function v(n,i,r){ev(n,i,r,f),ft(n,"change",n,t)}var o=t.from,a=t.to,s=t.text,h=r(n,o.line),y=r(n,a.line),k=p(s),d=l(s.length-1),w=a.line-o.line;if(o.ch==0&&a.ch==0&&k==""){for(var e=0,b=s.length-1,c=[];e<b;++e)c.push(dr(s[e],l(e),f));v(y,y.text,d),w&&n.remove(o.line,w),c.length&&n.insert(o.line,c)}else if(h==y)if(s.length==1)v(h,h.text.slice(0,o.ch)+k+h.text.slice(a.ch),d);else{for(var c=[],e=1,b=s.length-1;e<b;++e)c.push(dr(s[e],l(e),f));c.push(dr(k+h.text.slice(a.ch),d,f)),v(h,h.text.slice(0,o.ch)+s[0],l(0)),n.insert(o.line+1,c)}else if(s.length==1)v(h,h.text.slice(0,o.ch)+s[0]+y.text.slice(a.ch),l(0)),n.remove(o.line+1,w);else{v(h,h.text.slice(0,o.ch)+s[0],l(0)),v(y,k+y.text.slice(a.ch),d);for(var e=1,b=s.length-1,c=[];e<b;++e)c.push(dr(s[e],l(e),f));w>1&&n.remove(o.line+1,w-1),n.insert(o.line+1,c)}ft(n,"change",n,t),lt(n,u.anchor,u.head,null,!0)}function cf(n){this.lines=n,this.parent=null;for(var t=0,r=n.length,i=0;t<r;++t)n[t].parent=this,i+=n[t].height;this.height=i}function gr(n){var r,u,t,f,i;for(this.children=n,r=0,u=0,t=0,f=n.length;t<f;++t)i=n[t],r+=i.chunkSize(),u+=i.height,i.parent=this;this.size=r,this.height=u,this.parent=null}function wi(n,t,i){function r(n,u,f){var o,e,s;if(n.linked)for(o=0;o<n.linked.length;++o)(e=n.linked[o],e.doc!=u)&&(s=f&&e.sharedHist,!i||s)&&(t(e.doc,s),r(e.doc,n,s))}r(n,null,!0)}function cc(n,t){if(t.cm)throw new Error("This document is already in use.");n.doc=t,t.cm=n,ss(n),fu(n),n.options.lineWrapping||se(n),n.options.mode=t.modeOption,l(n)}function r(n,t){var i,r,u;for(t-=n.first;!n.lines;)for(i=0;;++i){if(r=n.children[i],u=r.chunkSize(),t<u){n=r;break}t-=u}return n.lines[t]}function po(n,t,i){var u=[],r=t.line;return n.iter(t.line,i.line+1,function(n){var f=n.text;r==i.line&&(f=f.slice(0,i.ch)),r==t.line&&(f=f.slice(t.ch)),u.push(f),++r}),u}function wo(n,t,i){var r=[];return n.iter(t,i,function(n){r.push(n.text)}),r}function rt(n,t){for(var r=t-n.height,i=n;i;i=i.parent)i.height+=r}function g(n){var i,u,t,r;if(n.parent==null)return null;for(i=n.parent,u=ct(i.lines,n),t=i.parent;t;i=t,t=t.parent)for(r=0;;++r){if(t.children[r]==i)break;u+=t.children[r].chunkSize()}return u+i.first}function lf(n,t){var f=n.first,u,e,i,r,s,o;n:do{for(i=0,r=n.children.length;i<r;++i){if(u=n.children[i],e=u.height,t<e){n=u;continue n}t-=e,f+=u.chunkSize()}return f}while(!n.lines);for(i=0,r=n.lines.length;i<r;++i){if(s=n.lines[i],o=s.height,t<o)break;t-=o}return f+i}function bi(n,t){var f,r,e,u,i,o;for(t=pi(n.doc,t),f=0,r=t.parent,i=0;i<r.lines.length;++i)if(e=r.lines[i],e==t)break;else f+=e.height;for(u=r.parent;u;r=u,u=r.parent)for(i=0;i<u.children.length;++i)if(o=u.children[i],o==r)break;else f+=o.height;return f}function ut(n){var t=n.order;return t==null&&(t=n.order=fl(n.text)),t}function af(){return{done:[],undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,dirtyCounter:0}}function lc(n,t,i,r){var u=t["spans_"+n.id],f=0;n.iter(Math.max(n.first,i),Math.min(n.first+n.size,r),function(i){i.markedSpans&&((u||(u=t["spans_"+n.id]={}))[f]=i.markedSpans),++f})}function bo(n,t){var i={from:t.from,to:to(t),text:po(n,t.from,t.to)};return lc(n,i,t.from.line,t.to.line+1),wi(n,function(n){lc(n,i,t.from.line,t.to.line+1)},!0),i}function av(n,t,i,r){var u=n.history,e,f,o;if(u.undone.length=0,e=+new Date,f=p(u.done),f&&(u.lastOp==r||u.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&u.lastTime>e-600||t.origin.charAt(0)=="*")))o=p(f.changes),s(t.from,t.to)&&s(t.from,o.to)?o.to=to(t):f.changes.push(bo(n,t)),f.anchorAfter=i.anchor,f.headAfter=i.head;else{for(f={changes:[bo(n,t)],anchorBefore:n.sel.anchor,headBefore:n.sel.head,anchorAfter:i.anchor,headAfter:i.head},u.done.push(f);u.done.length>u.undoDepth;)u.done.shift();u.dirtyCounter<0?u.dirtyCounter=NaN:u.dirtyCounter++}u.lastTime=e,u.lastOp=r,u.lastOrigin=t.origin}function vv(n){if(!n)return null;for(var i=0,t;i<n.length;++i)n[i].marker.explicitlyCleared?t||(t=n.slice(0,i)):t&&t.push(n[i]);return t?t.length?t:null:n}function yv(n,t){var u=t["spans_"+n.id],i,r;if(!u)return null;for(i=0,r=[];i<t.text.length;++i)r.push(vv(u[i]));return r}function vf(n,t){for(var e,i,c,u,f=0,o=[];f<n.length;++f){var r=n[f],h=r.changes,s=[];for(o.push({changes:s,anchorBefore:r.anchorBefore,headBefore:r.headBefore,anchorAfter:r.anchorAfter,headAfter:r.headAfter}),e=0;e<h.length;++e)if(i=h[e],s.push({from:i.from,to:i.to,text:i.text}),t)for(u in i)(c=u.match(/^spans_(\d+)$/))&&ct(t,Number(c[1]))>-1&&(p(s)[u]=i[u],delete i[u])}return o}function yf(n,t,i,r){i<n.line?n.line+=r:t<n.line&&(n.line=t,n.ch=0)}function ac(n,t,i,r){for(var u,s,o,f,e=0;e<n.length;++e){for(u=n[e],s=!0,o=0;o<u.changes.length;++o)if(f=u.changes[o],u.copied||(f.from=dt(f.from),f.to=dt(f.to)),i<f.from.line)f.from.line+=r,f.to.line+=r;else if(t<=f.to.line){s=!1;break}u.copied||(u.anchorBefore=dt(u.anchorBefore),u.headBefore=dt(u.headBefore),u.anchorAfter=dt(u.anchorAfter),u.readAfter=dt(u.headAfter),u.copied=!0),s?(yf(u.anchorBefore),yf(u.headBefore),yf(u.anchorAfter),yf(u.headAfter)):(n.splice(0,e+1),e=0)}}function vc(n,t){var i=t.from.line,r=t.to.line,u=t.text.length-(r-i)-1;ac(n.done,i,r,u),ac(n.undone,i,r,u)}function pv(){pf(this)}function tu(n){return n.stop||(n.stop=pv),n}function a(n){n.preventDefault?n.preventDefault():n.returnValue=!1}function yc(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function pf(n){a(n),yc(n)}function ko(n){return n.target||n.srcElement}function pc(n){var t=n.which;return t==null&&(n.button&1?t=1:n.button&2?t=3:n.button&4&&(t=2)),ei&&n.ctrlKey&&t==1&&(t=3),t}function e(n,t,i){if(n.addEventListener)n.addEventListener(t,i,!1);else if(n.attachEvent)n.attachEvent("on"+t,i);else{var r=n._handlers||(n._handlers={}),u=r[t]||(r[t]=[]);u.push(i)}}function ht(n,t,i){var r,u;if(n.removeEventListener)n.removeEventListener(t,i,!1);else if(n.detachEvent)n.detachEvent("on"+t,i);else{if(r=n._handlers&&n._handlers[t],!r)return;for(u=0;u<r.length;++u)if(r[u]==i){r.splice(u,1);break}}}function y(n,t){var r=n._handlers&&n._handlers[t],u,i;if(r)for(u=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,u)}function ft(n,t){function f(n){return function(){n.apply(null,u)}}var r=n._handlers&&n._handlers[t],u,i;if(r)for(u=Array.prototype.slice.call(arguments,2),at||(++iu,at=[],setTimeout(wv,0)),i=0;i<r.length;++i)at.push(f(r[i]))}function wv(){var t,n;for(--iu,t=at,at=null,n=0;n<t.length;++n)t[n]()}function ki(n,t){var i=n._handlers&&n._handlers[t];return i&&i.length>0}function ns(){this.id=null}function gi(n,t,i,r,u){t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length));for(var e=r||0,f=u||0;e<t;++e)n.charAt(e)=="\t"?f+=i-f%i:++f;return f}function wc(n){while(ru.length<=n)ru.push(p(ru)+" ");return ru[n]}function p(n){return n[n.length-1]}function bc(n){nr?(n.selectionStart=0,n.selectionEnd=n.value.length):n.select()}function ct(n,t){if(n.indexOf)return n.indexOf(t);for(var i=0,r=n.length;i<r;++i)if(n[i]==t)return i;return-1}function bv(n,t){function i(){}i.prototype=n;var r=new i;return t&&wf(t,r),r}function wf(n,t){t||(t={});for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t}function kc(n){for(var t=[],i=0;i<n;++i)t.push(undefined);return t}function tt(n){var t=Array.prototype.slice.call(arguments,1);return function(){return n.apply(null,t)}}function bf(n){return/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||dc.test(n))}function gc(n){for(var t in n)if(n.hasOwnProperty(t)&&n[t])return!1;return!0}function i(n,t,i,r){var u=document.createElement(n),f;if(i&&(u.className=i),r&&(u.style.cssText=r),typeof t=="string")nl(u,t);else if(t)for(f=0;f<t.length;++f)u.appendChild(t[f]);return u}function df(n){for(var t=n.childNodes.length;t>0;--t)n.removeChild(n.firstChild);return n}function et(n,t){return df(n).appendChild(t)}function nl(n,t){yt?(n.innerHTML="",n.appendChild(document.createTextNode(t))):n.textContent=t}function c(n){return n.getBoundingClientRect()}function ne(n){if(gf!=null)return gf;var t=i("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return et(n,t),t.offsetWidth&&(gf=t.offsetHeight-t.clientHeight),gf||0}function te(n){if(ts==null){var t=i("span","");et(n,i("span",[t,document.createTextNode("x")])),n.firstChild.offsetHeight!=0&&(ts=t.offsetWidth<=1&&t.offsetHeight>2&&!fi)}return ts?i("span",""):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function dv(n,t,i,r){var f,u;if(!n)return r(t,i,"ltr");for(f=0;f<n.length;++f)u=n[f],(u.from<i&&u.to>t||t==i&&u.to==t)&&r(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr")}function is(n){return n.level%2?n.to:n.from}function rs(n){return n.level%2?n.from:n.to}function ie(n){var t=ut(n);return t?is(t[0]):0}function re(n){var t=ut(n);return t?rs(p(t)):n.text.length}function rl(n,i){var e=r(n.doc,i),u=pi(n.doc,e),f,o;return u!=e&&(i=g(u)),f=ut(u),o=f?f[0].level%2?re(u):ie(u):0,t(i,o)}function gv(n,i){for(var e,u,f,o;e=kr(u=r(n.doc,i));)i=e.find().to.line;return f=ut(u),o=f?f[0].level%2?ie(u):re(u):u.text.length,t(i,o)}function us(n,t,i,r){var e=ut(n),s,h,o,u,c,f;if(!e)return ul(n,t,i,r);for(s=r?function(t,i){do t+=i;while(t>0&&kf.test(n.text.charAt(t)));return t}:function(n,t){return n+t},h=e[0].level,o=0;o<e.length;++o)if(u=e[o],c=u.level%2==h,u.from<t&&u.to>t||c&&(u.from==t||u.to==t))break;for(f=s(t,u.level%2?-i:i);f!=null;)if(u.level%2==h)if(f<u.from||f>u.to)u=e[o+=i],f=u&&(i>0==u.level%2?s(u.to,-1):s(u.from,1));else break;else if(f==is(u))u=e[--o],f=u&&rs(u);else if(f==rs(u))u=e[++o],f=u&&is(u);else break;return f<0||f>n.text.length?null:f}function ul(n,t,i,r){var u=t+i;if(r)while(u>0&&kf.test(n.text.charAt(u)))u+=i;return u<0||u>n.text.length?null:u}var ui=/gecko\/\d/i.test(navigator.userAgent),w=/MSIE \d/.test(navigator.userAgent),fi=w&&(document.documentMode==null||document.documentMode<8),yt=w&&(document.documentMode==null||document.documentMode<9),nt=/WebKit\//.test(navigator.userAgent),el=nt&&/Qt\/\d+\.\d+/.test(navigator.userAgent),ol=/Chrome\//.test(navigator.userAgent),ot=/Opera\//.test(navigator.userAgent),ue=/Apple Computer/.test(navigator.vendor),fe=/KHTML\//.test(navigator.userAgent),sl=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),hl=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),cl=/PhantomJS/.test(navigator.userAgent),nr=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ee=nr||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ei=nr||/Mac/.test(navigator.platform),ll=/windows/i.test(navigator.platform),tr=ot&&navigator.userAgent.match(/Version\/(\d*\.\d*)/),pt,ds,vu,yu,lr,k,ih,wu,no,ni,nf,oo,so,tf,vi,rf,uf,it,of,ao,hf,sc,d,hc,nu,at,iu,di,go,ru,dc,kf,tl,uu,gf,ts,vt,fl;tr&&(tr=Number(tr[1]));var fs=ei&&(el||ot&&(tr==null||tr<12.11)),oe=ui||w&&!yt,es=!1,ir=!1;ds=0,lr=0,k=null,w?k=-.53:ui?k=15:ol?k=-.7:ue&&(k=-1/3),wu=null,n.Pos=t,n.prototype={focus:function(){window.focus(),b(this),bt(this),or(this)},setOption:function(n,t){var i=this.options,r=i[n];(i[n]!=t||n=="mode")&&(i[n]=t,ni.hasOwnProperty(n)&&f(this,ni[n])(this,t,r))},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,t){this.state.keyMaps[t?"push":"unshift"](n)},removeKeyMap:function(n){for(var i=this.state.keyMaps,t=0;t<i.length;++t)if((typeof n=="string"?i[t].name:i[t])==n)return i.splice(t,1),!0},addOverlay:f(null,function(t,i){var r=t.token?t:n.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:i&&i.opaque}),this.state.modeGen++,l(this)}),removeOverlay:f(null,function(n){for(var i=this.state.overlays,t=0;t<i.length;++t)if(i[t].modeSpec==n){i.splice(t,1),this.state.modeGen++,l(this);return}}),indentLine:f(null,function(n,t,i){typeof t!="string"&&(t=t==null?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),gt(this.doc,n)&&du(this,n,t,i)}),indentSelection:f(null,function(n){var t=this.doc.sel,r,i;if(s(t.from,t.to))return du(this,t.from.line,n);for(r=t.to.line-(t.to.ch?0:1),i=t.from.line;i<=r;++i)du(this,i,n)}),getTokenAt:function(n){var f=this.doc,i;n=u(f,n);for(var e=ur(this,n.line),o=this.doc.mode,s=r(f,n.line),t=new yr(s.text,this.options.tabSize);t.pos<n.ch&&!t.eol();)t.start=t.pos,i=o.token(t,e);return{start:t.start,end:t.pos,string:t.current(),className:i||null,type:i||null,state:e}},getStateAfter:function(n){var t=this.doc;return n=hh(t,n==null?t.first+t.size-1:n),ur(this,n+1)},cursorCoords:function(n,t){var r,i=this.doc.sel;return r=n==null?i.head:typeof n=="object"?u(this.doc,n):n?i.from:i.to,st(this,r,t||"page")},charCoords:function(n,t){return be(this,u(this.doc,n),t||"page")},coordsChar:function(n,t){return n=ea(this,n,t||"page"),ke(this,n.left,n.top)},defaultTextHeight:function(){return fr(this.display)},defaultCharWidth:function(){return ks(this.display)},setGutterMarker:f(null,function(n,t,i){return gu(this,n,function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&gc(r)&&(n.gutterMarkers=null),!0})}),clearGutter:f(null,function(n){var i=this,r=i.doc,t=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[n]&&(r.gutterMarkers[n]=null,l(i,t,t+1),gc(r.gutterMarkers)&&(r.gutterMarkers=null)),++t})}),addLineClass:f(null,function(n,t,i){return gu(this,n,function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":"wrapClass";if(n[r]){if(new RegExp("\\b"+i+"\\b").test(n[r]))return!1;n[r]+=" "+i}else n[r]=i;return!0})}),removeLineClass:f(null,function(n,t,i){return gu(this,n,function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":"wrapClass",u=n[r],f;if(u)if(i==null)n[r]=null;else{if(f=u.replace(new RegExp("^"+i+"\\b\\s*|\\s*\\b"+i+"\\b"),""),f==u)return!1;n[r]=f||null}else return!1;return!0})}),addLineWidget:f(null,function(n,t,i){return fv(this,n,t,i)}),removeLineWidget:function(n){n.clear()},lineInfo:function(n){var t;if(typeof n=="number"){if(!gt(this.doc,n)||(t=n,n=r(this.doc,n),!n))return null}else if(t=g(n),t==null)return null;return{line:t,handle:n,text:n.text,gutterMarkers:n.gutterMarkers,textClass:n.textClass,bgClass:n.bgClass,wrapClass:n.wrapClass,widgets:n.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(n,t,i,r,f){var o=this.display,s,e,h,c;n=st(this,u(this.doc,n)),s=n.bottom,e=n.left,t.style.position="absolute",o.sizer.appendChild(t),r=="over"?s=n.top:(r=="above"||r=="near")&&(h=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth),(r=="above"||n.bottom+t.offsetHeight>h)&&n.top>t.offsetHeight?s=n.top-t.offsetHeight:n.bottom+t.offsetHeight<=h&&(s=n.bottom),e+t.offsetWidth>c&&(e=c-t.offsetWidth)),t.style.top=s+cu(o)+"px",t.style.left=t.style.right="",f=="right"?(e=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):(f=="left"?e=0:f=="middle"&&(e=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=e+"px"),i&&ah(this,e,s,e+t.offsetWidth,s+t.offsetHeight)},triggerOnKeyDown:f(null,uh),execCommand:function(n){return uf[n](this)},findPosH:function(n,t,i,r){var o=1,e,f;for(t<0&&(o=-1,t=-t),e=0,f=u(this.doc,n);e<t;++e)if(f=eo(this.doc,f,o,i,r),f.hitSide)break;return f},moveH:f(null,function(n,t){var i=this.doc.sel,r;r=i.shift||i.extend||s(i.from,i.to)?eo(this.doc,i.head,n,t,this.options.rtlMoveVisually):n<0?i.from:i.to,v(this.doc,r,r,n)}),deleteH:f(null,function(n,t){var i=this.doc.sel;s(i.from,i.to)?kt(this.doc,"",i.from,eo(this.doc,i.head,n,t,!1),"+delete"):kt(this.doc,"",i.from,i.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(n,t,i,r){var h=1,o=r,s,f,e;for(t<0&&(h=-1,t=-t),s=0,f=u(this.doc,n);s<t;++s)if(e=st(this,f,"div"),o==null?o=e.left:e.left=o,f=yh(this,e,h,i),f.hitSide)break;return f},moveV:f(null,function(n,t){var i=this.doc.sel,r=st(this,i.head,"div"),u;i.goalColumn!=null&&(r.left=i.goalColumn),u=yh(this,r,n,t),t=="page"&&vh(this,0,be(this,u,"div").top-r.top),v(this.doc,u,u,n),i.goalColumn=r.left}),toggleOverwrite:function(){(this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite","")},hasFocus:function(){return this.state.focused},scrollTo:f(null,function(n,t){fo(this,n,t)}),getScrollInfo:function(){var n=this.display.scroller,t=di;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-t,width:n.scrollWidth-t,clientHeight:n.clientHeight-t,clientWidth:n.clientWidth-t}},scrollIntoView:function(n,i){typeof n=="number"&&(n=t(n,0)),n&&n.line==null?ah(this,n.left,n.top-i,n.right,n.bottom+i):(n=n?u(this.doc,n):this.doc.sel.head,lh(this,n,i))},setSize:function(n,t){function i(n){return typeof n=="number"||/^\d+$/.test(String(n))?n+"px":n}n!=null&&(this.display.wrapper.style.width=i(n)),t!=null&&(this.display.wrapper.style.height=i(t)),this.refresh()},on:function(n,t){e(this,n,t)},off:function(n,t){ht(this,n,t)},operation:function(n){return gs(this,n)},refresh:f(null,function(){oi(this),fo(this,this.doc.scrollLeft,this.doc.scrollTop),l(this)}),swapDoc:f(null,function(n){var t=this.doc;return t.cm=null,cc(this,n),oi(this),fo(this,n.scrollLeft,n.scrollTop),t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ni=n.optionHandlers={},nf=n.defaults={},oo=n.Init={toString:function(){return"CodeMirror.Init"}},o("value","",function(n,t){n.setValue(t)},!0),o("mode",null,function(n,t){n.doc.modeOption=t,fu(n)},!0),o("indentUnit",2,fu,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(n){fu(n),oi(n),l(n)},!0),o("electricChars",!0),o("rtlMoveVisually",!ll),o("theme","default",function(n){hs(n),rr(n)},!0),o("keyMap","default",yl),o("extraKeys",null),o("onKeyEvent",null),o("onDragEvent",null),o("lineWrapping",!1,vl,!0),o("gutters",[],function(n){he(n.options),rr(n)},!0),o("fixedGutter",!0,function(n,t){n.display.gutters.style.left=t?ae(n.display)+"px":"0",n.refresh()},!0),o("lineNumbers",!1,function(n){he(n.options),rr(n)},!0),o("firstLineNumber",1,rr,!0),o("lineNumberFormatter",function(n){return n},rr,!0),o("showCursorWhenSelecting",!1,ye,!0),o("readOnly",!1,function(n,t){t=="nocursor"?(ge(n),n.display.input.blur()):t||wt(n,!0)}),o("dragDrop",!0),o("cursorBlinkRate",530),o("cursorHeight",1),o("workTime",100),o("workDelay",100),o("flattenSpans",!0),o("pollInterval",100),o("undoDepth",40,function(n,t){n.doc.history.undoDepth=t}),o("viewportMargin",10,function(n){n.refresh()},!0),o("tabindex",null,function(n,t){n.display.input.tabIndex=t||""}),o("autofocus",null),so=n.modes={},tf=n.mimeModes={},n.defineMode=function(t,i){if(n.defaults.mode||t=="null"||(n.defaults.mode=t),arguments.length>2){i.dependencies=[];for(var r=2;r<arguments.length;++r)i.dependencies.push(arguments[r])}so[t]=i},n.defineMIME=function(n,t){tf[n]=t},n.resolveMode=function(t){if(typeof t=="string"&&tf.hasOwnProperty(t))t=tf[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return n.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},n.getMode=function(t,i){var e,r,f,u;if(i=n.resolveMode(i),e=so[i.name],!e)return n.getMode(t,"text/plain");if(r=e(t,i),vi.hasOwnProperty(i.name)){f=vi[i.name];for(u in f)f.hasOwnProperty(u)&&(r.hasOwnProperty(u)&&(r["_"+u]=r[u]),r[u]=f[u])}return r.name=i.name,r},n.defineMode("null",function(){return{token:function(n){n.skipToEnd()}}}),n.defineMIME("text/plain","null"),vi=n.modeExtensions={},n.extendMode=function(n,t){var i=vi.hasOwnProperty(n)?vi[n]:vi[n]={};wf(t,i)},n.defineExtension=function(t,i){n.prototype[t]=i},n.defineOption=o,rf=[],n.defineInitHook=function(n){rf.push(n)},n.copyState=yi,n.startState=wh,n.innerMode=function(n,t){while(n.innerMode){var i=n.innerMode(t);t=i.state,n=i.mode}return i||{mode:n,state:t}},uf=n.commands={selectAll:function(n){n.setSelection(t(n.firstLine(),0),t(n.lastLine()))},killLine:function(n){var i=n.getCursor(!0),r=n.getCursor(!1),u=!s(i,r);u||n.getLine(i.line).length!=i.ch?n.replaceRange("",i,u?r:t(i.line),"+delete"):n.replaceRange("",i,t(i.line+1,0),"+delete")},deleteLine:function(n){var i=n.getCursor().line;n.replaceRange("",t(i,0),t(i),"+delete")},undo:function(n){n.undo()},redo:function(n){n.redo()},goDocStart:function(n){n.extendSelection(t(n.firstLine(),0))},goDocEnd:function(n){n.extendSelection(t(n.lastLine()))},goLineStart:function(n){n.extendSelection(rl(n,n.getCursor().line))},goLineStartSmart:function(n){var i=n.getCursor(),r=rl(n,i.line),f=n.getLineHandle(r.line),e=ut(f),u,o;e&&e[0].level!=0?n.extendSelection(r):(u=Math.max(0,f.text.search(/\S/)),o=i.line==r.line&&i.ch<=u&&i.ch,n.extendSelection(t(r.line,o?0:u)))},goLineEnd:function(n){n.extendSelection(gv(n,n.getCursor().line))},goLineRight:function(n){var t=n.charCoords(n.getCursor(),"div").top+5;n.extendSelection(n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div"))},goLineLeft:function(n){var t=n.charCoords(n.getCursor(),"div").top+5;n.extendSelection(n.coordsChar({left:0,top:t},"div"))},goLineUp:function(n){n.moveV(-1,"line")},goLineDown:function(n){n.moveV(1,"line")},goPageUp:function(n){n.moveV(-1,"page")},goPageDown:function(n){n.moveV(1,"page")},goCharLeft:function(n){n.moveH(-1,"char")},goCharRight:function(n){n.moveH(1,"char")},goColumnLeft:function(n){n.moveH(-1,"column")},goColumnRight:function(n){n.moveH(1,"column")},goWordLeft:function(n){n.moveH(-1,"word")},goGroupRight:function(n){n.moveH(1,"group")},goGroupLeft:function(n){n.moveH(-1,"group")},goWordRight:function(n){n.moveH(1,"word")},delCharBefore:function(n){n.deleteH(-1,"char")},delCharAfter:function(n){n.deleteH(1,"char")},delWordBefore:function(n){n.deleteH(-1,"word")},delWordAfter:function(n){n.deleteH(1,"word")},delGroupBefore:function(n){n.deleteH(-1,"group")},delGroupAfter:function(n){n.deleteH(1,"group")},indentAuto:function(n){n.indentSelection("smart")},indentMore:function(n){n.indentSelection("add")},indentLess:function(n){n.indentSelection("subtract")},insertTab:function(n){n.replaceSelection("\t","end","+input")},defaultTab:function(n){n.somethingSelected()?n.indentSelection("add"):n.replaceSelection("\t","end","+input")},transposeChars:function(n){var i=n.getCursor(),r=n.getLine(i.line);i.ch>0&&i.ch<r.length-1&&n.replaceRange(r.charAt(i.ch)+r.charAt(i.ch-1),t(i.line,i.ch-1),t(i.line,i.ch+1))},newlineAndIndent:function(n){f(n,function(){n.replaceSelection("\n","end","+input"),n.indentLine(n.getCursor().line,null,!0)})()},toggleOverwrite:function(n){n.toggleOverwrite()}},it=n.keyMap={},it.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},it.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},it.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},it["default"]=ei?it.macDefault:it.pcDefault,it.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},n.lookupKey=vr,n.isModifierKey=bh,n.keyName=kh,n.fromTextArea=function(t,i){function f(){t.value=r.getValue()}var o,u,s,h,r;if(i||(i={}),i.value=t.value,!i.tabindex&&t.tabindex&&(i.tabindex=t.tabindex),!i.placeholder&&t.placeholder&&(i.placeholder=t.placeholder),i.autofocus==null){o=document.body;try{o=document.activeElement}catch(c){}i.autofocus=o==t||t.getAttribute("autofocus")!=null&&o==document.body}if(t.form&&(e(t.form,"submit",f),!i.leaveSubmitMethodAlone)){u=t.form,s=u.submit;try{h=u.submit=function(){f(),u.submit=s,u.submit(),u.submit=h}}catch(c){}}return t.style.display="none",r=n(function(n){t.parentNode.insertBefore(n,t.nextSibling)},i),r.save=f,r.getTextArea=function(){return t},r.toTextArea=function(){f(),t.parentNode.removeChild(r.getWrapperElement()),t.style.display="",t.form&&(ht(t.form,"submit",f),typeof t.form.submit=="function"&&(t.form.submit=s))},r},yr.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(n){var t=this.string.charAt(this.pos),i;return i=typeof n=="string"?t==n:t&&(n.test?n.test(t):n(t)),i?(++this.pos,t):void 0},eatWhile:function(n){for(var t=this.pos;this.eat(n););return this.pos>t},eatSpace:function(){for(var n=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>n},skipToEnd:function(){this.pos=this.string.length},skipTo:function(n){var t=this.string.indexOf(n,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(n){this.pos-=n},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=gi(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue},indentation:function(){return gi(this.string,null,this.tabSize)},match:function(n,t,i){var u,f,r;if(typeof n=="string"){if(u=function(n){return i?n.toLowerCase():n},f=this.string.substr(this.pos,n.length),u(f)==u(n))return t!==!1&&(this.pos+=n.length),!0}else return(r=this.string.slice(this.pos).match(n),r&&r.index>0)?null:(r&&t!==!1&&(this.pos+=r[0].length),r)},current:function(){return this.string.slice(this.start,this.pos)}},n.StringStream=yr,n.TextMarker=ti,ti.prototype.clear=function(){var n,f,r,e,i,u,t,o,s;if(!this.explicitlyCleared){for(n=this.doc.cm,f=n&&!n.curOp,f&&si(n),r=null,e=null,t=0;t<this.lines.length;++t)i=this.lines[t],u=br(i.markedSpans,this),u.to!=null&&(e=g(i)),i.markedSpans=nv(i.markedSpans,u),u.from!=null?r=g(i):this.collapsed&&!ii(this.doc,i)&&n&&rt(i,fr(n.display));if(n&&this.collapsed&&!n.options.lineWrapping)for(t=0;t<this.lines.length;++t)o=pi(n.doc,this.lines[t]),s=eu(n.doc,o),s>n.display.maxLineLength&&(n.display.maxLine=o,n.display.maxLineLength=s,n.display.maxLineChanged=!0);r!=null&&n&&l(n,r,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.collapsed&&this.doc.cantEdit&&(this.doc.cantEdit=!1,n&&ch(n)),f&&hi(n),ft(this,"clear")}},ti.prototype.find=function(){for(var i,e,u,n,f,r=0;r<this.lines.length;++r)u=this.lines[r],n=br(u.markedSpans,this),(n.from!=null||n.to!=null)&&(f=g(u),n.from!=null&&(i=t(f,n.from)),n.to!=null&&(e=t(f,n.to)));return this.type=="bookmark"?i:i&&{from:i,to:e}},ti.prototype.getOptions=function(n){var t=this.replacedWith;return{className:this.className,inclusiveLeft:this.inclusiveLeft,inclusiveRight:this.inclusiveRight,atomic:this.atomic,collapsed:this.collapsed,replacedWith:n?t&&t.cloneNode(!0):t,readOnly:this.readOnly,startStyle:this.startStyle,endStyle:this.endStyle}},ti.prototype.attachLine=function(n){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&ct(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(n)},ti.prototype.detachLine=function(n){if(this.lines.splice(ct(this.lines,n),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},n.SharedTextMarker=wr,wr.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var n=0;n<this.markers.length;++n)this.markers[n].clear();ft(this,"clear")}},wr.prototype.find=function(){return this.primary.find()},wr.prototype.getOptions=function(n){var t=this.primary.getOptions(n);return t.shared=!0,t},of=n.LineWidget=function(n,t,i){for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.cm=n,this.node=t},of.prototype.clear=tc(function(){var n=this.line.widgets,i=g(this.line),t;if(i!=null&&n){for(t=0;t<n.length;++t)n[t]==this&&n.splice(t--,1);n.length||(this.line.widgets=null),rt(this.line,Math.max(0,this.line.height-sf(this))),l(this.cm,i,i+1)}}),of.prototype.changed=tc(function(){var i=this.height,n,t;(this.height=null,n=sf(this)-i,n)&&(rt(this.line,this.line.height+n),t=g(this.line),l(this.cm,t,t+1))}),ao={},hf=/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g,cf.prototype={chunkSize:function(){return this.lines.length},removeInner:function(n,t){for(var r,i=n,u=n+t;i<u;++i)r=this.lines[i],this.height-=r.height,ov(r),ft(r,"delete");this.lines.splice(n,t)},collapse:function(n){n.splice.apply(n,[n.length,0].concat(this.lines))},insertInner:function(n,t,i){this.height+=i,this.lines=this.lines.slice(0,n).concat(t).concat(this.lines.slice(n));for(var r=0,u=t.length;r<u;++r)t[r].parent=this},iterN:function(n,t,i){for(var r=n+t;n<r;++n)if(i(this.lines[n]))return!0}},gr.prototype={chunkSize:function(){return this.size},removeInner:function(n,t){var r,i,u,f,o,e;for(this.size-=t,r=0;r<this.children.length;++r)if(i=this.children[r],u=i.chunkSize(),n<u){if(f=Math.min(t,u-n),o=i.height,i.removeInner(n,f),this.height-=o-i.height,u==f&&(this.children.splice(r--,1),i.parent=null),(t-=f)==0)break;n=0}else n-=u;this.size-t<25&&(e=[],this.collapse(e),this.children=[new cf(e)],this.children[0].parent=this)},collapse:function(n){for(var t=0,i=this.children.length;t<i;++t)this.children[t].collapse(n)},insertInner:function(n,t,i){var u,o,r,e,s,f;for(this.size+=t.length,this.height+=i,u=0,o=this.children.length;u<o;++u){if(r=this.children[u],e=r.chunkSize(),n<=e){if(r.insertInner(n,t,i),r.lines&&r.lines.length>50){while(r.lines.length>50)s=r.lines.splice(r.lines.length-25,25),f=new cf(s),r.height-=f.height,this.children.splice(u+1,0,f),f.parent=this;this.maybeSpill()}break}n-=e}},maybeSpill:function(){var n,r,t,i,u;if(!(this.children.length<=10)){n=this;do r=n.children.splice(n.children.length-5,5),t=new gr(r),n.parent?(n.size-=t.size,n.height-=t.height,u=ct(n.parent.children,n),n.parent.children.splice(u+1,0,t)):(i=new gr(n.children),i.parent=n,n.children=[i,t],n=i),t.parent=n.parent;while(n.children.length>10);n.parent.maybeSpill()}},iterN:function(n,t,i){for(var f,u,e,r=0,o=this.children.length;r<o;++r)if(f=this.children[r],u=f.chunkSize(),n<u){if(e=Math.min(t,u-n),f.iterN(n,e,i))return!0;if((t-=e)==0)break;n=0}else n-=u}},sc=0,d=n.Doc=function(n,i,r){if(!(this instanceof d))return new d(n,i,r);r==null&&(r=0),gr.call(this,[new cf([dr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.history=af(),this.frontier=r;var u=t(r,0);this.sel={from:u,to:u,head:u,anchor:u,shift:!1,extend:!1,goalColumn:null},this.id=++sc,this.modeOption=i,typeof n=="string"&&(n=vt(n)),yo(this,{from:u,to:u,text:n},null,{head:u,anchor:u})},d.prototype=bv(gr.prototype,{iter:function(n,t,i){i?this.iterN(n-this.first,t-n,i):this.iterN(this.first,this.first+this.size,n)},insert:function(n,t){for(var r=0,i=0,u=t.length;i<u;++i)r+=t[i].height;this.insertInner(n-this.first,t,r)},remove:function(n,t){this.removeInner(n-this.first,t)},getValue:function(n){var t=wo(this,this.first,this.first+this.size);return n===!1?t:t.join(n||"\n")},setValue:function(n){var i=t(this.first,0),u=this.first+this.size-1;ai(this,{from:i,to:t(u,r(this,u).text.length),text:vt(n),origin:"setValue"},{head:i,anchor:i},!0)},replaceRange:function(n,t,i,r){t=u(this,t),i=i?u(this,i):t,kt(this,n,t,i,r)},getRange:function(n,t,i){var r=po(this,u(this,n),u(this,t));return i===!1?r:r.join(i||"\n")},getLine:function(n){var t=this.getLineHandle(n);return t&&t.text},setLine:function(n,i){gt(this,n)&&kt(this,i,t(n,0),u(this,t(n)))},removeLine:function(n){gt(this,n)&&kt(this,"",t(n,0),u(this,t(n+1,0)))},getLineHandle:function(n){if(gt(this,n))return r(this,n)},getLineNumber:function(n){return g(n)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(n){return u(this,n)},getCursor:function(n){var t=this.sel,i;return i=n==null||n=="head"?t.head:n=="anchor"?t.anchor:n=="end"||n===!1?t.to:t.from,dt(i)},somethingSelected:function(){return!s(this.sel.head,this.sel.anchor)},setCursor:er(function(n,i,r){var f=u(this,typeof n=="number"?t(n,i||0):n);r?v(this,f):lt(this,f,f)}),setSelection:er(function(n,t){lt(this,u(this,n),u(this,t||n))}),extendSelection:er(function(n,t){v(this,u(this,n),t&&u(this,t))}),getSelection:function(n){return this.getRange(this.sel.from,this.sel.to,n)},replaceSelection:function(n,t,i){ai(this,{from:this.sel.from,to:this.sel.to,text:vt(n),origin:i},t||"around")},undo:er(function(){oh(this,"undo")}),redo:er(function(){oh(this,"redo")}),setExtending:function(n){this.sel.extend=n},historySize:function(){var n=this.history;return{undo:n.done.length,redo:n.undone.length}},clearHistory:function(){this.history=af()},markClean:function(){this.history.dirtyCounter=0,this.history.lastOp=this.history.lastOrigin=null},isClean:function(){return this.history.dirtyCounter==0},getHistory:function(){return{done:vf(this.history.done),undone:vf(this.history.undone)}},setHistory:function(n){var t=this.history=af();t.done=n.done.slice(0),t.undone=n.undone.slice(0)},markText:function(n,t,i){return pr(this,u(this,n),u(this,t),i,"range")},setBookmark:function(n,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft};return n=u(this,n),pr(this,n,n,i,"bookmark")},findMarksAt:function(n){var e,i,f,t;if(n=u(this,n),e=[],i=r(this,n.line).markedSpans,i)for(f=0;f<i.length;++f)t=i[f],(t.from==null||t.from<=n.ch)&&(t.to==null||t.to>=n.ch)&&e.push(t.marker.parent||t.marker);return e},getAllMarks:function(){var n=[];return this.iter(function(t){var r=t.markedSpans,i;if(r)for(i=0;i<r.length;++i)r[i].from!=null&&n.push(r[i].marker)}),n},posFromIndex:function(n){var i,r=this.first;return this.iter(function(t){var u=t.text.length+1;if(u>n)return i=n,!0;n-=u,++r}),u(this,t(r,i))},indexFromPos:function(n){n=u(this,n);var t=n.ch;return n.line<this.first||n.ch<0?0:(this.iter(this.first,n.line,function(n){t+=n.text.length+1}),t)},copy:function(n){var t=new d(wo(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn},n&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(n){var t,r,i;return n||(n={}),t=this.first,r=this.first+this.size,n.from!=null&&n.from>t&&(t=n.from),n.to!=null&&n.to<r&&(r=n.to),i=new d(wo(this,t,r),n.mode||this.modeOption,t),n.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:n.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:n.sharedHist}],i},unlinkDoc:function(t){var i,u,r;if(t instanceof n&&(t=t.doc),this.linked)for(i=0;i<this.linked.length;++i)if(u=this.linked[i],u.doc==t){this.linked.splice(i,1),t.unlinkDoc(this);break}t.history==this.history&&(r=[t.id],wi(t,function(n){r.push(n.id)},!0),t.history=af(),t.history.done=vf(this.history.done,r),t.history.undone=vf(this.history.undone,r))},iterLinkedDocs:function(n){wi(this,n)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),d.prototype.eachLine=d.prototype.iter,hc="iter insert remove copy getEditor".split(" ");for(nu in d.prototype)d.prototype.hasOwnProperty(nu)&&ct(hc,nu)<0&&(n.prototype[nu]=function(n){return function(){return n.apply(this.doc,arguments)}}(d.prototype[nu]));n.e_stop=pf,n.e_preventDefault=a,n.e_stopPropagation=yc,iu=0,n.on=e,n.off=ht,n.signal=y,di=30,go=n.Pass={toString:function(){return"CodeMirror.Pass"}},ns.prototype={set:function(n,t){clearTimeout(this.id),this.id=setTimeout(t,n)}},n.countColumn=gi,ru=[""],dc=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/,kf=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/,n.replaceGetRect=function(n){c=n},tl=function(){if(yt)return!1;var n=i("div");return"draggable"in n||"dragDrop"in n}(),uu=/^$/,ui?uu=/$'/:ue&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?uu=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:nt&&(uu=/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.]|\?[\w~`@#$%\^&*(_=+{[|><]/),vt="\n\nb".split(/\n/).length!=3?function(n){for(var i=0,f=[],e=n.length,t,r,u;i<=e;)t=n.indexOf("\n",i),t==-1&&(t=n.length),r=n.slice(i,n.charAt(t-1)=="\r"?t-1:t),u=r.indexOf("\r"),u!=-1?(f.push(r.slice(0,u)),i+=u+1):(f.push(r),i=t+1);return f}:function(n){return n.split(/\r\n?|\n/)},n.splitLines=vt;var kv=window.getSelection?function(n){try{return n.selectionStart!=n.selectionEnd}catch(t){return!1}}:function(n){try{var t=n.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=n?!1:t.compareEndPoints("StartToEnd",t)!=0},il=function(){var n=i("div");return"oncopy"in n?!0:(n.setAttribute("oncopy","return;"),typeof n.oncopy=="function")}(),ri={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return n.keyNames=ri,function(){for(var n=0;n<10;n++)ri[n+48]=String(n);for(n=65;n<=90;n++)ri[n]=String.fromCharCode(n);for(n=1;n<=12;n++)ri[n+111]=ri[n+63235]="F"+n}(),fl=function(){function o(n){return n<=255?f.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1791?e.charAt(n-1536):1792<=n&&n<=2220?"r":"L"}var f="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",e="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",s=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,i=/[LRr]/,r=/[Lb1n]/,u=/[1n]/,n="L";return function(f){var a,h,w,g,b,c,v,y,d,e,tt,k,nt,l,it;if(!s.test(f))return!1;for(a=f.length,h=[],e=0;e<a;++e)h.push(c=o(f.charCodeAt(e)));for(e=0,w=n;e<a;++e)c=h[e],c=="m"?h[e]=w:w=c;for(e=0,b=n;e<a;++e)c=h[e],c=="1"&&b=="r"?h[e]="n":i.test(c)&&(b=c,c=="r"&&(h[e]="R"));for(e=1,w=h[0];e<a-1;++e)c=h[e],c=="+"&&w=="1"&&h[e+1]=="1"?h[e]="1":c==","&&w==h[e+1]&&(w=="1"||w=="n")&&(h[e]=w),w=c;for(e=0;e<a;++e)if(c=h[e],c==",")h[e]="N";else if(c=="%"){for(v=e+1;v<a&&h[v]=="%";++v);for(g=e&&h[e-1]=="!"||v<a-1&&h[v]=="1"?"1":"N",l=e;l<v;++l)h[l]=g;e=v-1}for(e=0,b=n;e<a;++e)c=h[e],b=="L"&&c=="1"?h[e]="L":i.test(c)&&(b=c);for(e=0;e<a;++e)if(t.test(h[e])){for(v=e+1;v<a&&t.test(h[v]);++v);var rt=(e?h[e-1]:n)=="L",ut=(v<a-1?h[v]:n)=="L",g=rt||ut?"L":"R";for(l=e;l<v;++l)h[l]=g;e=v-1}for(y=[],e=0;e<a;)if(r.test(h[e])){for(tt=e,++e;e<a&&r.test(h[e]);++e);y.push({from:tt,to:e,level:0})}else{for(k=e,nt=y.length,++e;e<a&&h[e]!="L";++e);for(l=k;l<e;)if(u.test(h[l])){for(k<l&&y.splice(nt,0,{from:k,to:l,level:1}),it=l,++l;l<e&&u.test(h[l]);++l);y.splice(nt,0,{from:it,to:l,level:2}),k=l}else++l;k<e&&y.splice(nt,0,{from:k,to:e,level:1})}return y[0].level==1&&(d=f.match(/^\s+/))&&(y[0].from=d[0].length,y.unshift({from:0,to:d[0].length,level:0})),p(y).level==1&&(d=f.match(/\s+$/))&&(p(y).to-=d[0].length,y.push({from:a-d[0].length,to:a,level:0})),y[0].level!=p(y).level&&y.push({from:a,to:a,level:y[0].level}),y}}(),n.version="3.11",n}()
|
@@ -0,0 +1 @@
|
|
1
|
+
CodeMirror.defineMode("xml",function(config,parserConfig){function inText(stream,state){function chain(parser){return state.tokenize=parser,parser(stream,state)}var ch=stream.next(),isClose,c,ok;if(ch=="<"){if(stream.eat("!"))return stream.eat("[")?stream.match("CDATA[")?chain(inBlock("atom","]\]>")):null:stream.match("--")?chain(inBlock("comment","-->")):stream.match("DOCTYPE",!0,!0)?(stream.eatWhile(/[\w\._\-]/),chain(doctype(1))):null;if(stream.eat("?"))return stream.eatWhile(/[\w\._\-]/),state.tokenize=inBlock("meta","?>"),"meta";for(isClose=stream.eat("/"),tagName="";c=stream.eat(/[^\s\u00a0=<>\"\'\/?]/);)tagName+=c;return tagName?(type=isClose?"closeTag":"openTag",state.tokenize=inTag,"tag"):"error"}return ch=="&"?(ok=stream.eat("#")?stream.eat("x")?stream.eatWhile(/[a-fA-F\d]/)&&stream.eat(";"):stream.eatWhile(/[\d]/)&&stream.eat(";"):stream.eatWhile(/[\w\.\-:]/)&&stream.eat(";"),ok?"atom":"error"):(stream.eatWhile(/[^&<]/),null)}function inTag(stream,state){var ch=stream.next();return ch==">"||ch=="/"&&stream.eat(">")?(state.tokenize=inText,type=ch==">"?"endTag":"selfcloseTag","tag"):ch=="="?(type="equals",null):/[\'\"]/.test(ch)?(state.tokenize=inAttribute(ch),state.tokenize(stream,state)):(stream.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function inAttribute(quote){return function(stream,state){while(!stream.eol())if(stream.next()==quote){state.tokenize=inTag;break}return"string"}}function inBlock(style,terminator){return function(stream,state){while(!stream.eol()){if(stream.match(terminator)){state.tokenize=inText;break}stream.next()}return style}}function doctype(depth){return function(stream,state){for(var ch;(ch=stream.next())!=null;){if(ch=="<")return state.tokenize=doctype(depth+1),state.tokenize(stream,state);if(ch==">")if(depth==1){state.tokenize=inText;break}else return state.tokenize=doctype(depth-1),state.tokenize(stream,state)}return"meta"}}function pass(){for(var i=arguments.length-1;i>=0;i--)curState.cc.push(arguments[i])}function cont(){return pass.apply(null,arguments),!0}function pushContext(tagName,startOfLine){var noIndent=Kludges.doNotIndent.hasOwnProperty(tagName)||curState.context&&curState.context.noIndent;curState.context={prev:curState.context,tagName:tagName,indent:curState.indented,startOfLine:startOfLine,noIndent:noIndent}}function popContext(){curState.context&&(curState.context=curState.context.prev)}function element(type){if(type=="openTag")return curState.tagName=tagName,curState.tagStart=curStream.column(),cont(attributes,endtag(curState.startOfLine));if(type=="closeTag"){var err=!1;return curState.context?curState.context.tagName!=tagName&&(Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())&&popContext(),err=!curState.context||curState.context.tagName!=tagName):err=!0,err&&(setStyle="error"),cont(endclosetag(err))}return cont()}function endtag(startOfLine){return function(type){var tagName=curState.tagName;return(curState.tagName=curState.tagStart=null,type=="selfcloseTag"||type=="endTag"&&Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))?(maybePopContext(tagName.toLowerCase()),cont()):type=="endTag"?(maybePopContext(tagName.toLowerCase()),pushContext(tagName,startOfLine),cont()):cont()}}function endclosetag(err){return function(type){return(err&&(setStyle="error"),type=="endTag")?(popContext(),cont()):(setStyle="error",cont(arguments.callee))}}function maybePopContext(nextTagName){for(var parentTagName;;){if(!curState.context)return;if(parentTagName=curState.context.tagName.toLowerCase(),!Kludges.contextGrabbers.hasOwnProperty(parentTagName)||!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName))return;popContext()}}function attributes(type){return type=="word"?(setStyle="attribute",cont(attribute,attributes)):type=="endTag"||type=="selfcloseTag"?pass():(setStyle="error",cont(attributes))}function attribute(type){return type=="equals"?cont(attvalue,attributes):(Kludges.allowMissing?type=="word"&&(setStyle="attribute"):setStyle="error",type=="endTag"||type=="selfcloseTag"?pass():cont())}function attvalue(type){return type=="string"?cont(attvaluemaybe):type=="word"&&Kludges.allowUnquoted?(setStyle="string",cont()):(setStyle="error",type=="endTag"||type=="selfCloseTag"?pass():cont())}function attvaluemaybe(type){return type=="string"?cont(attvaluemaybe):pass()}var indentUnit=config.indentUnit,multilineTagIndentFactor=parserConfig.multilineTagIndentFactor||1,Kludges=parserConfig.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},alignCDATA=parserConfig.alignCDATA,tagName,type,curState,curStream,setStyle;return{startState:function(){return{tokenize:inText,cc:[],indented:0,startOfLine:!0,tagName:null,tagStart:null,context:null}},token:function(stream,state){var style,comb;if(!state.tagName&&stream.sol()&&(state.startOfLine=!0,state.indented=stream.indentation()),stream.eatSpace())return null;if(setStyle=type=tagName=null,style=state.tokenize(stream,state),state.type=type,(style||type)&&style!="comment")for(curState=state,curStream=stream;;)if(comb=state.cc.pop()||element,comb(type||style))break;return state.startOfLine=!1,setStyle||style},indent:function(state,textAfter,fullLine){var context=state.context;if(state.tokenize!=inTag&&state.tokenize!=inText||context&&context.noIndent)return fullLine?fullLine.match(/^(\s*)/)[0].length:0;if(state.tagName)return state.tagStart+indentUnit*multilineTagIndentFactor;if(alignCDATA&&/<!\[CDATA\[/.test(textAfter))return 0;for(context&&/^<\//.test(textAfter)&&(context=context.prev);context&&!context.startOfLine;)context=context.prev;return context?context.indent+indentUnit:0},electricChars:"/",configuration:parserConfig.htmlMode?"html":"xml"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),CodeMirror.defineMode("css",function(config){return CodeMirror.getMode(config,"text/css")}),CodeMirror.defineMode("css-base",function(config,parserConfig){"use strict";function ret(style,tp){return type=tp,style}function tokenBase(stream,state){var ch=stream.next(),result;if(hooks[ch]&&(result=hooks[ch](stream,state),result!==!1))return result;if(ch=="@")return stream.eatWhile(/[\w\\\-]/),ret("def",stream.current());if(ch=="=")ret(null,"compare");else{if((ch=="~"||ch=="|")&&stream.eat("="))return ret(null,"compare");if(ch=='"'||ch=="'")return state.tokenize=tokenString(ch),state.tokenize(stream,state);if(ch=="#")return stream.eatWhile(/[\w\\\-]/),ret("atom","hash");if(ch=="!")return stream.match(/^\s*\w*/),ret("keyword","important");if(/\d/.test(ch))return stream.eatWhile(/[\w.%]/),ret("number","unit");if(ch==="-"){if(/\d/.test(stream.peek()))return stream.eatWhile(/[\w.%]/),ret("number","unit");if(stream.match(/^[^-]+-/))return ret("meta","meta")}else return/[,+>*\/]/.test(ch)?ret(null,"select-op"):ch=="."&&stream.match(/^-?[_a-z][_a-z0-9-]*/i)?ret("qualifier","qualifier"):ch==":"?ret("operator",ch):/[;{}\[\]\(\)]/.test(ch)?ret(null,ch):ch=="u"&&stream.match("rl(")?(stream.backUp(1),state.tokenize=tokenParenthesized,ret("property","variable")):(stream.eatWhile(/[\w\\\-]/),ret("property","variable"))}}function tokenString(quote,nonInclusive){return function(stream,state){for(var escaped=!1,ch;(ch=stream.next())!=null;){if(ch==quote&&!escaped)break;escaped=!escaped&&ch=="\\"}return escaped||(nonInclusive&&stream.backUp(1),state.tokenize=tokenBase),ret("string","string")}}function tokenParenthesized(stream,state){return stream.next(),state.tokenize=stream.match(/\s*[\"\']/,!1)?tokenBase:tokenString(")",!0),ret(null,"(")}var indentUnit=config.indentUnit,hooks=parserConfig.hooks||{},atMediaTypes=parserConfig.atMediaTypes||{},atMediaFeatures=parserConfig.atMediaFeatures||{},propertyKeywords=parserConfig.propertyKeywords||{},colorKeywords=parserConfig.colorKeywords||{},valueKeywords=parserConfig.valueKeywords||{},allowNested=!!parserConfig.allowNested,type=null;return{startState:function(base){return{tokenize:tokenBase,baseIndent:base||0,stack:[]}},token:function(stream,state){var style,context,newContext,lastState;return(state.tokenize=state.tokenize||tokenBase,state.tokenize==tokenBase&&stream.eatSpace())?null:(style=state.tokenize(stream,state),style&&typeof style!="string"&&(style=ret(style[0],style[1])),context=state.stack[state.stack.length-1],style=="variable")?(type=="variable-definition"&&state.stack.push("propertyValue"),"variable-2"):(style=="property"?context=="propertyValue"?style=valueKeywords[stream.current()]?"string-2":colorKeywords[stream.current()]?"keyword":"variable-2":context=="rule"?propertyKeywords[stream.current()]||(style+=" error"):context=="block"?style=propertyKeywords[stream.current()]?"property":colorKeywords[stream.current()]?"keyword":valueKeywords[stream.current()]?"string-2":"tag":context&&context!="@media{"?context=="@media"?style=atMediaTypes[stream.current()]?"attribute":/^(only|not)$/i.test(stream.current())?"keyword":stream.current().toLowerCase()=="and"?"error":atMediaFeatures[stream.current()]?"error":"attribute error":context=="@mediaType"?style=atMediaTypes[stream.current()]?"attribute":stream.current().toLowerCase()=="and"?"operator":/^(only|not)$/i.test(stream.current())?"error":atMediaFeatures[stream.current()]?"error":"error":context=="@mediaType("?propertyKeywords[stream.current()]||(atMediaTypes[stream.current()]?style="error":stream.current().toLowerCase()=="and"?style="operator":/^(only|not)$/i.test(stream.current())?style="error":style+=" error"):style="error":style="tag":style=="atom"?context&&context!="@media{"&&context!="block"?context=="propertyValue"?/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())||(style+=" error"):style="error":style="builtin":context=="@media"&&type=="{"&&(style="error"),type=="{"?context=="@media"||context=="@mediaType"?(state.stack.pop(),state.stack[state.stack.length-1]="@media{"):(newContext=allowNested?"block":"rule",state.stack.push(newContext)):type=="}"?(lastState=state.stack[state.stack.length-1],lastState=="interpolation"&&(style="operator"),state.stack.pop(),context=="propertyValue"&&state.stack.pop()):type=="interpolation"?state.stack.push("interpolation"):type=="@media"?state.stack.push("@media"):context=="@media"&&/\b(keyword|attribute)\b/.test(style)?state.stack.push("@mediaType"):context=="@mediaType"&&stream.current()==","?state.stack.pop():context=="@mediaType"&&type=="("?state.stack.push("@mediaType("):context=="@mediaType("&&type==")"?state.stack.pop():(context=="rule"||context=="block")&&type==":"?state.stack.push("propertyValue"):context=="propertyValue"&&type==";"&&state.stack.pop(),style)},indent:function(state,textAfter){var n=state.stack.length;return/^\}/.test(textAfter)&&(n-=state.stack[state.stack.length-1]=="propertyValue"?2:1),state.baseIndent+n*indentUnit},electricChars:"}"}}),function(){function keySet(array){for(var keys={},i=0;i<array.length;++i)keys[array[i]]=!0;return keys}function tokenCComment(stream,state){for(var maybeEnd=!1,ch;(ch=stream.next())!=null;){if(maybeEnd&&ch=="/"){state.tokenize=null;break}maybeEnd=ch=="*"}return["comment","comment"]}var atMediaTypes=keySet(["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),atMediaFeatures=keySet(["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"]),propertyKeywords=keySet(["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-shadow","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"]),colorKeywords=keySet(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua"]),valueKeywords=keySet(["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","overlay","overline","padding","padding-box","painted","paused","persian","plus-darker","plus-lighter","pointer","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","white","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"]);CodeMirror.defineMIME("text/css",{atMediaTypes:atMediaTypes,atMediaFeatures:atMediaFeatures,propertyKeywords:propertyKeywords,colorKeywords:colorKeywords,valueKeywords:valueKeywords,hooks:{"<":function(stream,state){function tokenSGMLComment(stream,state){for(var dashes=0,ch;(ch=stream.next())!=null;){if(dashes>=2&&ch==">"){state.tokenize=null;break}dashes=ch=="-"?dashes+1:0}return["comment","comment"]}if(stream.eat("!"))return state.tokenize=tokenSGMLComment,tokenSGMLComment(stream,state)},"/":function(stream,state){return stream.eat("*")?(state.tokenize=tokenCComment,tokenCComment(stream,state)):!1}},name:"css-base"}),CodeMirror.defineMIME("text/x-scss",{atMediaTypes:atMediaTypes,atMediaFeatures:atMediaFeatures,propertyKeywords:propertyKeywords,colorKeywords:colorKeywords,valueKeywords:valueKeywords,allowNested:!0,hooks:{$:function(stream){return(stream.match(/^[\w-]+/),stream.peek()==":")?["variable","variable-definition"]:["variable","variable"]},"/":function(stream,state){return stream.eat("/")?(stream.skipToEnd(),["comment","comment"]):stream.eat("*")?(state.tokenize=tokenCComment,tokenCComment(stream,state)):["operator","operator"]},"#":function(stream){return stream.eat("{")?["operator","interpolation"]:(stream.eatWhile(/[\w\\\-]/),["atom","hash"])}},name:"css-base"})}(),CodeMirror.defineMode("htmlmixed",function(config,parserConfig){function html(stream,state){var tagName=state.htmlState.tagName,style=htmlMode.token(stream,state.htmlState),scriptType,i,tp;if(tagName=="script"&&/\btag\b/.test(style)&&stream.current()==">"){for(scriptType=stream.string.slice(Math.max(0,stream.pos-100),stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i),scriptType=scriptType?scriptType[1]:"",scriptType&&/[\"\']/.test(scriptType.charAt(0))&&(scriptType=scriptType.slice(1,scriptType.length-1)),i=0;i<scriptTypes.length;++i)if(tp=scriptTypes[i],typeof tp.matches=="string"?scriptType==tp.matches:tp.matches.test(scriptType)){tp.mode&&(state.token=script,state.localMode=tp.mode,state.localState=tp.mode.startState&&tp.mode.startState(htmlMode.indent(state.htmlState,"")));break}}else tagName=="style"&&/\btag\b/.test(style)&&stream.current()==">"&&(state.token=css,state.localMode=cssMode,state.localState=cssMode.startState(htmlMode.indent(state.htmlState,"")));return style}function maybeBackup(stream,pat,style){var cur=stream.current(),close=cur.search(pat),m;return close>-1?stream.backUp(cur.length-close):(m=cur.match(/<\/?$/))&&(stream.backUp(cur.length),stream.match(pat,!1)||stream.match(cur[0])),style}function script(stream,state){return stream.match(/^<\/\s*script\s*>/i,!1)?(state.token=html,state.localState=state.localMode=null,html(stream,state)):maybeBackup(stream,/<\/\s*script\s*>/,state.localMode.token(stream,state.localState))}function css(stream,state){return stream.match(/^<\/\s*style\s*>/i,!1)?(state.token=html,state.localState=state.localMode=null,html(stream,state)):maybeBackup(stream,/<\/\s*style\s*>/,cssMode.token(stream,state.localState))}var htmlMode=CodeMirror.getMode(config,{name:"xml",htmlMode:!0}),cssMode=CodeMirror.getMode(config,"css"),scriptTypes=[],scriptTypesConf=parserConfig&&parserConfig.scriptTypes,i,conf;if(scriptTypes.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:CodeMirror.getMode(config,"javascript")}),scriptTypesConf)for(i=0;i<scriptTypesConf.length;++i)conf=scriptTypesConf[i],scriptTypes.push({matches:conf.matches,mode:conf.mode&&CodeMirror.getMode(config,conf.mode)});return scriptTypes.push({matches:/./,mode:CodeMirror.getMode(config,"text/plain")}),{startState:function(){var state=htmlMode.startState();return{token:html,localMode:null,localState:null,htmlState:state}},copyState:function(state){if(state.localState)var local=CodeMirror.copyState(state.localMode,state.localState);return{token:state.token,localMode:state.localMode,localState:local,htmlState:CodeMirror.copyState(htmlMode,state.htmlState)}},token:function(stream,state){return state.token(stream,state)},indent:function(state,textAfter){return!state.localMode||/^\s*<\//.test(textAfter)?htmlMode.indent(state.htmlState,textAfter):state.localMode.indent?state.localMode.indent(state.localState,textAfter):CodeMirror.Pass},electricChars:"/{}:",innerMode:function(state){return{state:state.localState||state.htmlState,mode:state.localMode||htmlMode}}}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed");
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){function n(n,t,i){var u=n.getWrapperElement(),r;return r=u.appendChild(document.createElement("div")),r.className=i?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top",r.innerHTML=t,r}CodeMirror.defineExtension("openDialog",function(t,i,r){function f(){s||(s=!0,e.parentNode.removeChild(e))}var e=n(this,t,r&&r.bottom),s=!1,h=this,u=e.getElementsByTagName("input")[0],o;if(u){CodeMirror.on(u,"keydown",function(n){r&&r.onKeyDown&&r.onKeyDown(n,u.value,f)||(n.keyCode==13||n.keyCode==27)&&(CodeMirror.e_stop(n),f(),h.focus(),n.keyCode==13&&i(u.value))});if(r&&r.onKeyUp)CodeMirror.on(u,"keyup",function(n){r.onKeyUp(n,u.value,f)});r&&r.value&&(u.value=r.value),u.focus();CodeMirror.on(u,"blur",f)}else if(o=e.getElementsByTagName("button")[0]){CodeMirror.on(o,"click",function(){f(),h.focus()});o.focus();CodeMirror.on(o,"blur",f)}return f}),CodeMirror.defineExtension("openConfirm",function(t,i,r){function l(){h||(h=!0,e.parentNode.removeChild(e),c.focus())}var e=n(this,t,r&&r.bottom),o=e.getElementsByTagName("button"),h=!1,c=this,s=1,u,f;for(o[0].focus(),u=0;u<o.length;++u){f=o[u],function(n){CodeMirror.on(f,"click",function(t){CodeMirror.e_preventDefault(t),l(),n&&n(c)})}(i[u]);CodeMirror.on(f,"blur",function(){--s,setTimeout(function(){s<=0&&l()},200)});CodeMirror.on(f,"focus",function(){++s})}})})(),function(){function s(n){return typeof n=="string"?{token:function(t){if(t.match(n))return"searching";t.next(),t.skipTo(n.charAt(0))||t.skipToEnd()}}:{token:function(t){if(t.match(n))return"searching";while(!t.eol())if(t.next(),t.match(n,!1))break}}}function h(){this.posFrom=this.posTo=this.query=null,this.overlay=null}function t(n){return n._searchState||(n._searchState=new h)}function n(n,t,i){return n.getSearchCursor(t,i,typeof t=="string"&&t==t.toLowerCase())}function i(n,t,i,r){n.openDialog?n.openDialog(t,r):r(prompt(i,""))}function c(n,t,i,r){n.openConfirm?n.openConfirm(t,r):confirm(i)&&r[0]()}function f(n){var t=n.match(/^\/(.*)\/([a-z]*)$/);return t?new RegExp(t[1],t[2].indexOf("i")==-1?"":"i"):n}function r(n,r){var u=t(n);if(u.query)return e(n,r);i(n,l,"Search for:",function(t){n.operation(function(){t&&!u.query&&(u.query=f(t),n.removeOverlay(u.overlay),u.overlay=s(t),n.addOverlay(u.overlay),u.posFrom=u.posTo=n.getCursor(),e(n,r))})})}function e(i,r){i.operation(function(){var f=t(i),u=n(i,f.query,r?f.posFrom:f.posTo);(u.find(r)||(u=n(i,f.query,r?CodeMirror.Pos(i.lastLine()):CodeMirror.Pos(i.firstLine(),0)),u.find(r)))&&(i.setSelection(u.from(),u.to()),f.posFrom=u.from(),f.posTo=u.to())})}function u(n){n.operation(function(){var i=t(n);i.query&&(i.query=null,n.removeOverlay(i.overlay))})}function o(t,r){i(t,a,"Replace:",function(e){e&&(e=f(e),i(t,v,"Replace with:",function(i){if(r)t.operation(function(){for(var u,r=n(t,e);r.findNext();)typeof e!="string"?(u=t.getRange(r.from(),r.to()).match(e),r.replace(i.replace(/\$(\d)/,function(n,t){return u[t]}))):r.replace(i)});else{u(t);var f=n(t,e,t.getCursor()),o=function(){var i=f.from(),r;((r=f.findNext())||(f=n(t,e),(r=f.findNext())&&(!i||f.from().line!=i.line||f.from().ch!=i.ch)))&&(t.setSelection(f.from(),f.to()),c(t,y,"Replace?",[function(){s(r)},o]))},s=function(n){f.replace(typeof e=="string"?i:i.replace(/\$(\d)/,function(t,i){return n[i]})),o()};o()}}))})}var l='Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)<\/span>',a='Replace: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)<\/span>',v='With: <input type="text" style="width: 10em"/>',y="Replace? <button>Yes<\/button> <button>No<\/button> <button>Stop<\/button>";CodeMirror.commands.find=function(n){u(n),r(n)},CodeMirror.commands.findNext=r,CodeMirror.commands.findPrev=function(n){r(n,!0)},CodeMirror.commands.clearSearch=u,CodeMirror.commands.replace=o,CodeMirror.commands.replaceAll=function(n){o(n,!0)}}(),function(){function t(t,i,r,u){if(this.atOccurrence=!1,this.cm=t,u==null&&typeof i=="string"&&(u=!1),r=r?t.clipPos(r):n(0,0),this.pos={from:r,to:r},typeof i!="string")i.global||(i=new RegExp(i.source,i.ignoreCase?"ig":"g")),this.matches=function(r,u){var e,s,f,o,h;if(r)for(i.lastIndex=0,e=t.getLine(u.line).slice(0,u.ch),s=0;;){if(i.lastIndex=s,h=i.exec(e),!h)break;f=h,o=f.index,s=f.index+1}else{i.lastIndex=u.ch;var e=t.getLine(u.line),f=i.exec(e),o=f&&f.index}if(f&&f[0])return{from:n(u.line,o),to:n(u.line,o+f[0].length),match:f}};else{u&&(i=i.toLowerCase());var e=u?function(n){return n.toLowerCase()}:function(n){return n},f=i.split("\n");this.matches=f.length==1?i.length?function(r,u){var s=e(t.getLine(u.line)),o=i.length,f;if(r?u.ch>=o&&(f=s.lastIndexOf(i,u.ch-o))!=-1:(f=s.indexOf(i,u.ch))!=-1)return{from:n(u.line,f),to:n(u.line,f+o)}}:function(){}:function(i,r){var s=r.line,h=i?f.length-1:0,u=f[h],o=e(t.getLine(s)),c=i?o.indexOf(u)+u.length:o.lastIndexOf(u),l,a,v;if(!(i?c>=r.ch||c!=u.length:c<=r.ch||c!=o.length-u.length))for(;;){if(i?!s:s==t.lineCount()-1)return;if(o=e(t.getLine(s+=i?-1:1)),u=f[i?--h:++h],h>0&&h<f.length-1){if(o!=u)return;continue}return(l=i?o.lastIndexOf(u):o.indexOf(u)+u.length,i?l!=o.length-u.length:l!=u.length)?void 0:(a=n(r.line,c),v=n(s,l),{from:i?v:a,to:i?a:v})}}}}var n=CodeMirror.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){function f(t){var i=n(t,0);return u.pos={from:i,to:i},u.atOccurrence=!1,!1}for(var u=this,i=this.cm.clipPos(t?this.pos.from:this.pos.to),r;;){if(this.pos=this.matches(t,i))return this.pos.from&&this.pos.to||console.log(this.matches,this.pos),this.atOccurrence=!0,this.pos.match||!0;if(t){if(!i.line)return f(0);i=n(i.line-1,this.cm.getLine(i.line-1).length)}else{if(r=this.cm.lineCount(),i.line==r-1)return f(r);i=n(i.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t){if(this.atOccurrence){var i=CodeMirror.splitLines(t);this.cm.replaceRange(i,this.pos.from,this.pos.to),this.pos.to=n(this.pos.from.line+i.length-1,i[i.length-1].length+(i.length==1?this.pos.from.ch:0))}}},CodeMirror.defineExtension("getSearchCursor",function(n,i,r){return new t(this,n,i,r)})}()
|
@@ -1,204 +1,30 @@
|
|
1
1
|
CodeMirror.defineMode("css", function(config) {
|
2
|
-
|
3
|
-
|
4
|
-
var atMediaTypes = keySet([
|
5
|
-
"all", "aural", "braille", "handheld", "print", "projection", "screen",
|
6
|
-
"tty", "tv", "embossed"
|
7
|
-
]);
|
8
|
-
|
9
|
-
var atMediaFeatures = keySet([
|
10
|
-
"width", "min-width", "max-width", "height", "min-height", "max-height",
|
11
|
-
"device-width", "min-device-width", "max-device-width", "device-height",
|
12
|
-
"min-device-height", "max-device-height", "aspect-ratio",
|
13
|
-
"min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
|
14
|
-
"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
|
15
|
-
"max-color", "color-index", "min-color-index", "max-color-index",
|
16
|
-
"monochrome", "min-monochrome", "max-monochrome", "resolution",
|
17
|
-
"min-resolution", "max-resolution", "scan", "grid"
|
18
|
-
]);
|
2
|
+
return CodeMirror.getMode(config, "text/css");
|
3
|
+
});
|
19
4
|
|
20
|
-
|
21
|
-
|
22
|
-
"alignment-baseline", "anchor-point", "animation", "animation-delay",
|
23
|
-
"animation-direction", "animation-duration", "animation-iteration-count",
|
24
|
-
"animation-name", "animation-play-state", "animation-timing-function",
|
25
|
-
"appearance", "azimuth", "backface-visibility", "background",
|
26
|
-
"background-attachment", "background-clip", "background-color",
|
27
|
-
"background-image", "background-origin", "background-position",
|
28
|
-
"background-repeat", "background-size", "baseline-shift", "binding",
|
29
|
-
"bleed", "bookmark-label", "bookmark-level", "bookmark-state",
|
30
|
-
"bookmark-target", "border", "border-bottom", "border-bottom-color",
|
31
|
-
"border-bottom-left-radius", "border-bottom-right-radius",
|
32
|
-
"border-bottom-style", "border-bottom-width", "border-collapse",
|
33
|
-
"border-color", "border-image", "border-image-outset",
|
34
|
-
"border-image-repeat", "border-image-slice", "border-image-source",
|
35
|
-
"border-image-width", "border-left", "border-left-color",
|
36
|
-
"border-left-style", "border-left-width", "border-radius", "border-right",
|
37
|
-
"border-right-color", "border-right-style", "border-right-width",
|
38
|
-
"border-spacing", "border-style", "border-top", "border-top-color",
|
39
|
-
"border-top-left-radius", "border-top-right-radius", "border-top-style",
|
40
|
-
"border-top-width", "border-width", "bottom", "box-decoration-break",
|
41
|
-
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
|
42
|
-
"caption-side", "clear", "clip", "color", "color-profile", "column-count",
|
43
|
-
"column-fill", "column-gap", "column-rule", "column-rule-color",
|
44
|
-
"column-rule-style", "column-rule-width", "column-span", "column-width",
|
45
|
-
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
|
46
|
-
"cue-after", "cue-before", "cursor", "direction", "display",
|
47
|
-
"dominant-baseline", "drop-initial-after-adjust",
|
48
|
-
"drop-initial-after-align", "drop-initial-before-adjust",
|
49
|
-
"drop-initial-before-align", "drop-initial-size", "drop-initial-value",
|
50
|
-
"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
|
51
|
-
"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
|
52
|
-
"float", "float-offset", "font", "font-feature-settings", "font-family",
|
53
|
-
"font-kerning", "font-language-override", "font-size", "font-size-adjust",
|
54
|
-
"font-stretch", "font-style", "font-synthesis", "font-variant",
|
55
|
-
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
56
|
-
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
|
57
|
-
"font-weight", "grid-cell", "grid-column", "grid-column-align",
|
58
|
-
"grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow",
|
59
|
-
"grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span",
|
60
|
-
"grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens",
|
61
|
-
"icon", "image-orientation", "image-rendering", "image-resolution",
|
62
|
-
"inline-box-align", "justify-content", "left", "letter-spacing",
|
63
|
-
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
|
64
|
-
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
65
|
-
"list-style-image", "list-style-position", "list-style-type", "margin",
|
66
|
-
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
67
|
-
"marker-offset", "marks", "marquee-direction", "marquee-loop",
|
68
|
-
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
69
|
-
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
|
70
|
-
"nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline",
|
71
|
-
"outline-color", "outline-offset", "outline-style", "outline-width",
|
72
|
-
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
|
73
|
-
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
|
74
|
-
"page", "page-break-after", "page-break-before", "page-break-inside",
|
75
|
-
"page-policy", "pause", "pause-after", "pause-before", "perspective",
|
76
|
-
"perspective-origin", "pitch", "pitch-range", "play-during", "position",
|
77
|
-
"presentation-level", "punctuation-trim", "quotes", "rendering-intent",
|
78
|
-
"resize", "rest", "rest-after", "rest-before", "richness", "right",
|
79
|
-
"rotation", "rotation-point", "ruby-align", "ruby-overhang",
|
80
|
-
"ruby-position", "ruby-span", "size", "speak", "speak-as", "speak-header",
|
81
|
-
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
|
82
|
-
"tab-size", "table-layout", "target", "target-name", "target-new",
|
83
|
-
"target-position", "text-align", "text-align-last", "text-decoration",
|
84
|
-
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
|
85
|
-
"text-decoration-style", "text-emphasis", "text-emphasis-color",
|
86
|
-
"text-emphasis-position", "text-emphasis-style", "text-height",
|
87
|
-
"text-indent", "text-justify", "text-outline", "text-shadow",
|
88
|
-
"text-space-collapse", "text-transform", "text-underline-position",
|
89
|
-
"text-wrap", "top", "transform", "transform-origin", "transform-style",
|
90
|
-
"transition", "transition-delay", "transition-duration",
|
91
|
-
"transition-property", "transition-timing-function", "unicode-bidi",
|
92
|
-
"vertical-align", "visibility", "voice-balance", "voice-duration",
|
93
|
-
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
|
94
|
-
"voice-volume", "volume", "white-space", "widows", "width", "word-break",
|
95
|
-
"word-spacing", "word-wrap", "z-index"
|
96
|
-
]);
|
5
|
+
CodeMirror.defineMode("css-base", function(config, parserConfig) {
|
6
|
+
"use strict";
|
97
7
|
|
98
|
-
var
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
"arabic-indic", "armenian", "asterisks", "auto", "avoid", "background",
|
108
|
-
"backwards", "baseline", "below", "bidi-override", "binary", "bengali",
|
109
|
-
"blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
|
110
|
-
"both", "bottom", "break-all", "break-word", "button", "button-bevel",
|
111
|
-
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",
|
112
|
-
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
|
113
|
-
"cell", "center", "checkbox", "circle", "cjk-earthly-branch",
|
114
|
-
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
|
115
|
-
"col-resize", "collapse", "compact", "condensed", "contain", "content",
|
116
|
-
"content-box", "context-menu", "continuous", "copy", "cover", "crop",
|
117
|
-
"cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal",
|
118
|
-
"decimal-leading-zero", "default", "default-button", "destination-atop",
|
119
|
-
"destination-in", "destination-out", "destination-over", "devanagari",
|
120
|
-
"disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted",
|
121
|
-
"double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
|
122
|
-
"element", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
|
123
|
-
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
|
124
|
-
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
|
125
|
-
"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
|
126
|
-
"ethiopic-halehame-gez", "ethiopic-halehame-om-et",
|
127
|
-
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
|
128
|
-
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et",
|
129
|
-
"ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed",
|
130
|
-
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes",
|
131
|
-
"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
|
132
|
-
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
|
133
|
-
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
|
134
|
-
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
|
135
|
-
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
|
136
|
-
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
|
137
|
-
"inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",
|
138
|
-
"italic", "justify", "kannada", "katakana", "katakana-iroha", "khmer",
|
139
|
-
"landscape", "lao", "large", "larger", "left", "level", "lighter",
|
140
|
-
"line-through", "linear", "lines", "list-item", "listbox", "listitem",
|
141
|
-
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
|
142
|
-
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
|
143
|
-
"lower-roman", "lowercase", "ltr", "malayalam", "match",
|
144
|
-
"media-controls-background", "media-current-time-display",
|
145
|
-
"media-fullscreen-button", "media-mute-button", "media-play-button",
|
146
|
-
"media-return-to-realtime-button", "media-rewind-button",
|
147
|
-
"media-seek-back-button", "media-seek-forward-button", "media-slider",
|
148
|
-
"media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
|
149
|
-
"media-volume-slider-container", "media-volume-sliderthumb", "medium",
|
150
|
-
"menu", "menulist", "menulist-button", "menulist-text",
|
151
|
-
"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
|
152
|
-
"mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
|
153
|
-
"narrower", "navy", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
|
154
|
-
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
|
155
|
-
"ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
|
156
|
-
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
|
157
|
-
"outside", "overlay", "overline", "padding", "padding-box", "painted",
|
158
|
-
"paused", "persian", "plus-darker", "plus-lighter", "pointer", "portrait",
|
159
|
-
"pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",
|
160
|
-
"radio", "read-only", "read-write", "read-write-plaintext-only", "relative",
|
161
|
-
"repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",
|
162
|
-
"ridge", "right", "round", "row-resize", "rtl", "run-in", "running",
|
163
|
-
"s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield",
|
164
|
-
"searchfield-cancel-button", "searchfield-decoration",
|
165
|
-
"searchfield-results-button", "searchfield-results-decoration",
|
166
|
-
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
167
|
-
"single", "skip-white-space", "slide", "slider-horizontal",
|
168
|
-
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
|
169
|
-
"small", "small-caps", "small-caption", "smaller", "solid", "somali",
|
170
|
-
"source-atop", "source-in", "source-out", "source-over", "space", "square",
|
171
|
-
"square-button", "start", "static", "status-bar", "stretch", "stroke",
|
172
|
-
"sub", "subpixel-antialiased", "super", "sw-resize", "table",
|
173
|
-
"table-caption", "table-cell", "table-column", "table-column-group",
|
174
|
-
"table-footer-group", "table-header-group", "table-row", "table-row-group",
|
175
|
-
"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
|
176
|
-
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
|
177
|
-
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
|
178
|
-
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
|
179
|
-
"transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
|
180
|
-
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
|
181
|
-
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
|
182
|
-
"vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
|
183
|
-
"visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider",
|
184
|
-
"window", "windowframe", "windowtext", "x-large", "x-small", "xor",
|
185
|
-
"xx-large", "xx-small", "yellow"
|
186
|
-
]);
|
8
|
+
var indentUnit = config.indentUnit,
|
9
|
+
hooks = parserConfig.hooks || {},
|
10
|
+
atMediaTypes = parserConfig.atMediaTypes || {},
|
11
|
+
atMediaFeatures = parserConfig.atMediaFeatures || {},
|
12
|
+
propertyKeywords = parserConfig.propertyKeywords || {},
|
13
|
+
colorKeywords = parserConfig.colorKeywords || {},
|
14
|
+
valueKeywords = parserConfig.valueKeywords || {},
|
15
|
+
allowNested = !!parserConfig.allowNested,
|
16
|
+
type = null;
|
187
17
|
|
188
|
-
function
|
189
|
-
function ret(style, tp) {type = tp; return style;}
|
18
|
+
function ret(style, tp) { type = tp; return style; }
|
190
19
|
|
191
20
|
function tokenBase(stream, state) {
|
192
21
|
var ch = stream.next();
|
193
|
-
if (ch
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
}
|
198
|
-
else if (ch == "<" && stream.eat("!")) {
|
199
|
-
state.tokenize = tokenSGMLComment;
|
200
|
-
return tokenSGMLComment(stream, state);
|
22
|
+
if (hooks[ch]) {
|
23
|
+
// result[0] is style and result[1] is type
|
24
|
+
var result = hooks[ch](stream, state);
|
25
|
+
if (result !== false) return result;
|
201
26
|
}
|
27
|
+
if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());}
|
202
28
|
else if (ch == "=") ret(null, "compare");
|
203
29
|
else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");
|
204
30
|
else if (ch == "\"" || ch == "'") {
|
@@ -248,30 +74,6 @@ CodeMirror.defineMode("css", function(config) {
|
|
248
74
|
}
|
249
75
|
}
|
250
76
|
|
251
|
-
function tokenCComment(stream, state) {
|
252
|
-
var maybeEnd = false, ch;
|
253
|
-
while ((ch = stream.next()) != null) {
|
254
|
-
if (maybeEnd && ch == "/") {
|
255
|
-
state.tokenize = tokenBase;
|
256
|
-
break;
|
257
|
-
}
|
258
|
-
maybeEnd = (ch == "*");
|
259
|
-
}
|
260
|
-
return ret("comment", "comment");
|
261
|
-
}
|
262
|
-
|
263
|
-
function tokenSGMLComment(stream, state) {
|
264
|
-
var dashes = 0, ch;
|
265
|
-
while ((ch = stream.next()) != null) {
|
266
|
-
if (dashes >= 2 && ch == ">") {
|
267
|
-
state.tokenize = tokenBase;
|
268
|
-
break;
|
269
|
-
}
|
270
|
-
dashes = (ch == "-") ? dashes + 1 : 0;
|
271
|
-
}
|
272
|
-
return ret("comment", "comment");
|
273
|
-
}
|
274
|
-
|
275
77
|
function tokenString(quote, nonInclusive) {
|
276
78
|
return function(stream, state) {
|
277
79
|
var escaped = false, ch;
|
@@ -305,59 +107,64 @@ CodeMirror.defineMode("css", function(config) {
|
|
305
107
|
},
|
306
108
|
|
307
109
|
token: function(stream, state) {
|
308
|
-
|
110
|
+
|
309
111
|
// Use these terms when applicable (see http://www.xanthir.com/blog/b4E50)
|
310
|
-
//
|
112
|
+
//
|
311
113
|
// rule** or **ruleset:
|
312
114
|
// A selector + braces combo, or an at-rule.
|
313
|
-
//
|
115
|
+
//
|
314
116
|
// declaration block:
|
315
117
|
// A sequence of declarations.
|
316
|
-
//
|
118
|
+
//
|
317
119
|
// declaration:
|
318
120
|
// A property + colon + value combo.
|
319
|
-
//
|
121
|
+
//
|
320
122
|
// property value:
|
321
123
|
// The entire value of a property.
|
322
|
-
//
|
124
|
+
//
|
323
125
|
// component value:
|
324
126
|
// A single piece of a property value. Like the 5px in
|
325
127
|
// text-shadow: 0 0 5px blue;. Can also refer to things that are
|
326
128
|
// multiple terms, like the 1-4 terms that make up the background-size
|
327
129
|
// portion of the background shorthand.
|
328
|
-
//
|
130
|
+
//
|
329
131
|
// term:
|
330
132
|
// The basic unit of author-facing CSS, like a single number (5),
|
331
133
|
// dimension (5px), string ("foo"), or function. Officially defined
|
332
134
|
// by the CSS 2.1 grammar (look for the 'term' production)
|
333
|
-
//
|
334
|
-
//
|
135
|
+
//
|
136
|
+
//
|
335
137
|
// simple selector:
|
336
138
|
// A single atomic selector, like a type selector, an attr selector, a
|
337
139
|
// class selector, etc.
|
338
|
-
//
|
140
|
+
//
|
339
141
|
// compound selector:
|
340
142
|
// One or more simple selectors without a combinator. div.example is
|
341
143
|
// compound, div > .example is not.
|
342
|
-
//
|
144
|
+
//
|
343
145
|
// complex selector:
|
344
146
|
// One or more compound selectors chained with combinators.
|
345
|
-
//
|
147
|
+
//
|
346
148
|
// combinator:
|
347
149
|
// The parts of selectors that express relationships. There are four
|
348
150
|
// currently - the space (descendant combinator), the greater-than
|
349
151
|
// bracket (child combinator), the plus sign (next sibling combinator),
|
350
152
|
// and the tilda (following sibling combinator).
|
351
|
-
//
|
153
|
+
//
|
352
154
|
// sequence of selectors:
|
353
155
|
// One or more of the named type of selector chained with commas.
|
354
156
|
|
157
|
+
state.tokenize = state.tokenize || tokenBase;
|
355
158
|
if (state.tokenize == tokenBase && stream.eatSpace()) return null;
|
356
159
|
var style = state.tokenize(stream, state);
|
160
|
+
if (style && typeof style != "string") style = ret(style[0], style[1]);
|
357
161
|
|
358
162
|
// Changing style returned based on context
|
359
163
|
var context = state.stack[state.stack.length-1];
|
360
|
-
if (style == "
|
164
|
+
if (style == "variable") {
|
165
|
+
if (type == "variable-definition") state.stack.push("propertyValue");
|
166
|
+
return "variable-2";
|
167
|
+
} else if (style == "property") {
|
361
168
|
if (context == "propertyValue"){
|
362
169
|
if (valueKeywords[stream.current()]) {
|
363
170
|
style = "string-2";
|
@@ -370,6 +177,18 @@ CodeMirror.defineMode("css", function(config) {
|
|
370
177
|
if (!propertyKeywords[stream.current()]) {
|
371
178
|
style += " error";
|
372
179
|
}
|
180
|
+
} else if (context == "block") {
|
181
|
+
// if a value is present in both property, value, or color, the order
|
182
|
+
// of preference is property -> color -> value
|
183
|
+
if (propertyKeywords[stream.current()]) {
|
184
|
+
style = "property";
|
185
|
+
} else if (colorKeywords[stream.current()]) {
|
186
|
+
style = "keyword";
|
187
|
+
} else if (valueKeywords[stream.current()]) {
|
188
|
+
style = "string-2";
|
189
|
+
} else {
|
190
|
+
style = "tag";
|
191
|
+
}
|
373
192
|
} else if (!context || context == "@media{") {
|
374
193
|
style = "tag";
|
375
194
|
} else if (context == "@media") {
|
@@ -415,7 +234,7 @@ CodeMirror.defineMode("css", function(config) {
|
|
415
234
|
style = "error";
|
416
235
|
}
|
417
236
|
} else if (style == "atom") {
|
418
|
-
if(!context || context == "@media{") {
|
237
|
+
if(!context || context == "@media{" || context == "block") {
|
419
238
|
style = "builtin";
|
420
239
|
} else if (context == "propertyValue") {
|
421
240
|
if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
|
@@ -434,19 +253,25 @@ CodeMirror.defineMode("css", function(config) {
|
|
434
253
|
state.stack.pop();
|
435
254
|
state.stack[state.stack.length-1] = "@media{";
|
436
255
|
}
|
437
|
-
else
|
256
|
+
else {
|
257
|
+
var newContext = allowNested ? "block" : "rule";
|
258
|
+
state.stack.push(newContext);
|
259
|
+
}
|
438
260
|
}
|
439
261
|
else if (type == "}") {
|
262
|
+
var lastState = state.stack[state.stack.length - 1];
|
263
|
+
if (lastState == "interpolation") style = "operator";
|
440
264
|
state.stack.pop();
|
441
265
|
if (context == "propertyValue") state.stack.pop();
|
442
266
|
}
|
267
|
+
else if (type == "interpolation") state.stack.push("interpolation");
|
443
268
|
else if (type == "@media") state.stack.push("@media");
|
444
269
|
else if (context == "@media" && /\b(keyword|attribute)\b/.test(style))
|
445
270
|
state.stack.push("@mediaType");
|
446
271
|
else if (context == "@mediaType" && stream.current() == ",") state.stack.pop();
|
447
272
|
else if (context == "@mediaType" && type == "(") state.stack.push("@mediaType(");
|
448
273
|
else if (context == "@mediaType(" && type == ")") state.stack.pop();
|
449
|
-
else if (context == "rule" && type == ":") state.stack.push("propertyValue");
|
274
|
+
else if ((context == "rule" || context == "block") && type == ":") state.stack.push("propertyValue");
|
450
275
|
else if (context == "propertyValue" && type == ";") state.stack.pop();
|
451
276
|
return style;
|
452
277
|
},
|
@@ -462,4 +287,281 @@ CodeMirror.defineMode("css", function(config) {
|
|
462
287
|
};
|
463
288
|
});
|
464
289
|
|
465
|
-
|
290
|
+
(function() {
|
291
|
+
function keySet(array) {
|
292
|
+
var keys = {};
|
293
|
+
for (var i = 0; i < array.length; ++i) {
|
294
|
+
keys[array[i]] = true;
|
295
|
+
}
|
296
|
+
return keys;
|
297
|
+
}
|
298
|
+
|
299
|
+
var atMediaTypes = keySet([
|
300
|
+
"all", "aural", "braille", "handheld", "print", "projection", "screen",
|
301
|
+
"tty", "tv", "embossed"
|
302
|
+
]);
|
303
|
+
|
304
|
+
var atMediaFeatures = keySet([
|
305
|
+
"width", "min-width", "max-width", "height", "min-height", "max-height",
|
306
|
+
"device-width", "min-device-width", "max-device-width", "device-height",
|
307
|
+
"min-device-height", "max-device-height", "aspect-ratio",
|
308
|
+
"min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
|
309
|
+
"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
|
310
|
+
"max-color", "color-index", "min-color-index", "max-color-index",
|
311
|
+
"monochrome", "min-monochrome", "max-monochrome", "resolution",
|
312
|
+
"min-resolution", "max-resolution", "scan", "grid"
|
313
|
+
]);
|
314
|
+
|
315
|
+
var propertyKeywords = keySet([
|
316
|
+
"align-content", "align-items", "align-self", "alignment-adjust",
|
317
|
+
"alignment-baseline", "anchor-point", "animation", "animation-delay",
|
318
|
+
"animation-direction", "animation-duration", "animation-iteration-count",
|
319
|
+
"animation-name", "animation-play-state", "animation-timing-function",
|
320
|
+
"appearance", "azimuth", "backface-visibility", "background",
|
321
|
+
"background-attachment", "background-clip", "background-color",
|
322
|
+
"background-image", "background-origin", "background-position",
|
323
|
+
"background-repeat", "background-size", "baseline-shift", "binding",
|
324
|
+
"bleed", "bookmark-label", "bookmark-level", "bookmark-state",
|
325
|
+
"bookmark-target", "border", "border-bottom", "border-bottom-color",
|
326
|
+
"border-bottom-left-radius", "border-bottom-right-radius",
|
327
|
+
"border-bottom-style", "border-bottom-width", "border-collapse",
|
328
|
+
"border-color", "border-image", "border-image-outset",
|
329
|
+
"border-image-repeat", "border-image-slice", "border-image-source",
|
330
|
+
"border-image-width", "border-left", "border-left-color",
|
331
|
+
"border-left-style", "border-left-width", "border-radius", "border-right",
|
332
|
+
"border-right-color", "border-right-style", "border-right-width",
|
333
|
+
"border-spacing", "border-style", "border-top", "border-top-color",
|
334
|
+
"border-top-left-radius", "border-top-right-radius", "border-top-style",
|
335
|
+
"border-top-width", "border-width", "bottom", "box-decoration-break",
|
336
|
+
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
|
337
|
+
"caption-side", "clear", "clip", "color", "color-profile", "column-count",
|
338
|
+
"column-fill", "column-gap", "column-rule", "column-rule-color",
|
339
|
+
"column-rule-style", "column-rule-width", "column-span", "column-width",
|
340
|
+
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
|
341
|
+
"cue-after", "cue-before", "cursor", "direction", "display",
|
342
|
+
"dominant-baseline", "drop-initial-after-adjust",
|
343
|
+
"drop-initial-after-align", "drop-initial-before-adjust",
|
344
|
+
"drop-initial-before-align", "drop-initial-size", "drop-initial-value",
|
345
|
+
"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
|
346
|
+
"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
|
347
|
+
"float", "float-offset", "font", "font-feature-settings", "font-family",
|
348
|
+
"font-kerning", "font-language-override", "font-size", "font-size-adjust",
|
349
|
+
"font-stretch", "font-style", "font-synthesis", "font-variant",
|
350
|
+
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
351
|
+
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
|
352
|
+
"font-weight", "grid-cell", "grid-column", "grid-column-align",
|
353
|
+
"grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow",
|
354
|
+
"grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span",
|
355
|
+
"grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens",
|
356
|
+
"icon", "image-orientation", "image-rendering", "image-resolution",
|
357
|
+
"inline-box-align", "justify-content", "left", "letter-spacing",
|
358
|
+
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
|
359
|
+
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
360
|
+
"list-style-image", "list-style-position", "list-style-type", "margin",
|
361
|
+
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
362
|
+
"marker-offset", "marks", "marquee-direction", "marquee-loop",
|
363
|
+
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
364
|
+
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
|
365
|
+
"nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline",
|
366
|
+
"outline-color", "outline-offset", "outline-style", "outline-width",
|
367
|
+
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
|
368
|
+
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
|
369
|
+
"page", "page-break-after", "page-break-before", "page-break-inside",
|
370
|
+
"page-policy", "pause", "pause-after", "pause-before", "perspective",
|
371
|
+
"perspective-origin", "pitch", "pitch-range", "play-during", "position",
|
372
|
+
"presentation-level", "punctuation-trim", "quotes", "rendering-intent",
|
373
|
+
"resize", "rest", "rest-after", "rest-before", "richness", "right",
|
374
|
+
"rotation", "rotation-point", "ruby-align", "ruby-overhang",
|
375
|
+
"ruby-position", "ruby-span", "size", "speak", "speak-as", "speak-header",
|
376
|
+
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
|
377
|
+
"tab-size", "table-layout", "target", "target-name", "target-new",
|
378
|
+
"target-position", "text-align", "text-align-last", "text-decoration",
|
379
|
+
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
|
380
|
+
"text-decoration-style", "text-emphasis", "text-emphasis-color",
|
381
|
+
"text-emphasis-position", "text-emphasis-style", "text-height",
|
382
|
+
"text-indent", "text-justify", "text-outline", "text-shadow",
|
383
|
+
"text-space-collapse", "text-transform", "text-underline-position",
|
384
|
+
"text-wrap", "top", "transform", "transform-origin", "transform-style",
|
385
|
+
"transition", "transition-delay", "transition-duration",
|
386
|
+
"transition-property", "transition-timing-function", "unicode-bidi",
|
387
|
+
"vertical-align", "visibility", "voice-balance", "voice-duration",
|
388
|
+
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
|
389
|
+
"voice-volume", "volume", "white-space", "widows", "width", "word-break",
|
390
|
+
"word-spacing", "word-wrap", "z-index"
|
391
|
+
]);
|
392
|
+
|
393
|
+
var colorKeywords = keySet([
|
394
|
+
"black", "silver", "gray", "white", "maroon", "red", "purple", "fuchsia",
|
395
|
+
"green", "lime", "olive", "yellow", "navy", "blue", "teal", "aqua"
|
396
|
+
]);
|
397
|
+
|
398
|
+
var valueKeywords = keySet([
|
399
|
+
"above", "absolute", "activeborder", "activecaption", "afar",
|
400
|
+
"after-white-space", "ahead", "alias", "all", "all-scroll", "alternate",
|
401
|
+
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
|
402
|
+
"arabic-indic", "armenian", "asterisks", "auto", "avoid", "background",
|
403
|
+
"backwards", "baseline", "below", "bidi-override", "binary", "bengali",
|
404
|
+
"blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
|
405
|
+
"both", "bottom", "break-all", "break-word", "button", "button-bevel",
|
406
|
+
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",
|
407
|
+
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
|
408
|
+
"cell", "center", "checkbox", "circle", "cjk-earthly-branch",
|
409
|
+
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
|
410
|
+
"col-resize", "collapse", "compact", "condensed", "contain", "content",
|
411
|
+
"content-box", "context-menu", "continuous", "copy", "cover", "crop",
|
412
|
+
"cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal",
|
413
|
+
"decimal-leading-zero", "default", "default-button", "destination-atop",
|
414
|
+
"destination-in", "destination-out", "destination-over", "devanagari",
|
415
|
+
"disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted",
|
416
|
+
"double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
|
417
|
+
"element", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
|
418
|
+
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
|
419
|
+
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
|
420
|
+
"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
|
421
|
+
"ethiopic-halehame-gez", "ethiopic-halehame-om-et",
|
422
|
+
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
|
423
|
+
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et",
|
424
|
+
"ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed",
|
425
|
+
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes",
|
426
|
+
"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
|
427
|
+
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
|
428
|
+
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
|
429
|
+
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
|
430
|
+
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
|
431
|
+
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
|
432
|
+
"inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",
|
433
|
+
"italic", "justify", "kannada", "katakana", "katakana-iroha", "khmer",
|
434
|
+
"landscape", "lao", "large", "larger", "left", "level", "lighter",
|
435
|
+
"line-through", "linear", "lines", "list-item", "listbox", "listitem",
|
436
|
+
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
|
437
|
+
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
|
438
|
+
"lower-roman", "lowercase", "ltr", "malayalam", "match",
|
439
|
+
"media-controls-background", "media-current-time-display",
|
440
|
+
"media-fullscreen-button", "media-mute-button", "media-play-button",
|
441
|
+
"media-return-to-realtime-button", "media-rewind-button",
|
442
|
+
"media-seek-back-button", "media-seek-forward-button", "media-slider",
|
443
|
+
"media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
|
444
|
+
"media-volume-slider-container", "media-volume-sliderthumb", "medium",
|
445
|
+
"menu", "menulist", "menulist-button", "menulist-text",
|
446
|
+
"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
|
447
|
+
"mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
|
448
|
+
"narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
|
449
|
+
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
|
450
|
+
"ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
|
451
|
+
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
|
452
|
+
"outside", "overlay", "overline", "padding", "padding-box", "painted",
|
453
|
+
"paused", "persian", "plus-darker", "plus-lighter", "pointer", "portrait",
|
454
|
+
"pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",
|
455
|
+
"radio", "read-only", "read-write", "read-write-plaintext-only", "relative",
|
456
|
+
"repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",
|
457
|
+
"ridge", "right", "round", "row-resize", "rtl", "run-in", "running",
|
458
|
+
"s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield",
|
459
|
+
"searchfield-cancel-button", "searchfield-decoration",
|
460
|
+
"searchfield-results-button", "searchfield-results-decoration",
|
461
|
+
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
462
|
+
"single", "skip-white-space", "slide", "slider-horizontal",
|
463
|
+
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
|
464
|
+
"small", "small-caps", "small-caption", "smaller", "solid", "somali",
|
465
|
+
"source-atop", "source-in", "source-out", "source-over", "space", "square",
|
466
|
+
"square-button", "start", "static", "status-bar", "stretch", "stroke",
|
467
|
+
"sub", "subpixel-antialiased", "super", "sw-resize", "table",
|
468
|
+
"table-caption", "table-cell", "table-column", "table-column-group",
|
469
|
+
"table-footer-group", "table-header-group", "table-row", "table-row-group",
|
470
|
+
"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
|
471
|
+
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
|
472
|
+
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
|
473
|
+
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
|
474
|
+
"transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
|
475
|
+
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
|
476
|
+
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
|
477
|
+
"vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
|
478
|
+
"visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider",
|
479
|
+
"window", "windowframe", "windowtext", "x-large", "x-small", "xor",
|
480
|
+
"xx-large", "xx-small"
|
481
|
+
]);
|
482
|
+
|
483
|
+
function tokenCComment(stream, state) {
|
484
|
+
var maybeEnd = false, ch;
|
485
|
+
while ((ch = stream.next()) != null) {
|
486
|
+
if (maybeEnd && ch == "/") {
|
487
|
+
state.tokenize = null;
|
488
|
+
break;
|
489
|
+
}
|
490
|
+
maybeEnd = (ch == "*");
|
491
|
+
}
|
492
|
+
return ["comment", "comment"];
|
493
|
+
}
|
494
|
+
|
495
|
+
CodeMirror.defineMIME("text/css", {
|
496
|
+
atMediaTypes: atMediaTypes,
|
497
|
+
atMediaFeatures: atMediaFeatures,
|
498
|
+
propertyKeywords: propertyKeywords,
|
499
|
+
colorKeywords: colorKeywords,
|
500
|
+
valueKeywords: valueKeywords,
|
501
|
+
hooks: {
|
502
|
+
"<": function(stream, state) {
|
503
|
+
function tokenSGMLComment(stream, state) {
|
504
|
+
var dashes = 0, ch;
|
505
|
+
while ((ch = stream.next()) != null) {
|
506
|
+
if (dashes >= 2 && ch == ">") {
|
507
|
+
state.tokenize = null;
|
508
|
+
break;
|
509
|
+
}
|
510
|
+
dashes = (ch == "-") ? dashes + 1 : 0;
|
511
|
+
}
|
512
|
+
return ["comment", "comment"];
|
513
|
+
}
|
514
|
+
if (stream.eat("!")) {
|
515
|
+
state.tokenize = tokenSGMLComment;
|
516
|
+
return tokenSGMLComment(stream, state);
|
517
|
+
}
|
518
|
+
},
|
519
|
+
"/": function(stream, state) {
|
520
|
+
if (stream.eat("*")) {
|
521
|
+
state.tokenize = tokenCComment;
|
522
|
+
return tokenCComment(stream, state);
|
523
|
+
}
|
524
|
+
return false;
|
525
|
+
}
|
526
|
+
},
|
527
|
+
name: "css-base"
|
528
|
+
});
|
529
|
+
|
530
|
+
CodeMirror.defineMIME("text/x-scss", {
|
531
|
+
atMediaTypes: atMediaTypes,
|
532
|
+
atMediaFeatures: atMediaFeatures,
|
533
|
+
propertyKeywords: propertyKeywords,
|
534
|
+
colorKeywords: colorKeywords,
|
535
|
+
valueKeywords: valueKeywords,
|
536
|
+
allowNested: true,
|
537
|
+
hooks: {
|
538
|
+
"$": function(stream) {
|
539
|
+
stream.match(/^[\w-]+/);
|
540
|
+
if (stream.peek() == ":") {
|
541
|
+
return ["variable", "variable-definition"];
|
542
|
+
}
|
543
|
+
return ["variable", "variable"];
|
544
|
+
},
|
545
|
+
"/": function(stream, state) {
|
546
|
+
if (stream.eat("/")) {
|
547
|
+
stream.skipToEnd();
|
548
|
+
return ["comment", "comment"];
|
549
|
+
} else if (stream.eat("*")) {
|
550
|
+
state.tokenize = tokenCComment;
|
551
|
+
return tokenCComment(stream, state);
|
552
|
+
} else {
|
553
|
+
return ["operator", "operator"];
|
554
|
+
}
|
555
|
+
},
|
556
|
+
"#": function(stream) {
|
557
|
+
if (stream.eat("{")) {
|
558
|
+
return ["operator", "interpolation"];
|
559
|
+
} else {
|
560
|
+
stream.eatWhile(/[\w\\\-]/);
|
561
|
+
return ["atom", "hash"];
|
562
|
+
}
|
563
|
+
}
|
564
|
+
},
|
565
|
+
name: "css-base"
|
566
|
+
});
|
567
|
+
})();
|