Version Description
- Fixed plugin translations being loaded
- Increase default snippets per page so that all are usually shown
- Fixed description field not being imported
- Updated German translation by Mario Siegmann
- Fixed issue with CodeMirror rubyblue theme [#]
- Added query var to disable snippet execution. To use, add
?snippets-safe-mode=true
to the URL - Fixed snippet fields not importing
- Updated CodeMirror to version 5.17.0
- Fixed a minor XSS vulnerability discovered by Burak Kelebek [#]
Download this release
Release Info
Developer | bungeshea |
Plugin | Code Snippets |
Version | 2.7.0 |
Comparing to | |
See all releases |
Code changes from version 2.6.1 to 2.7.0
- code-snippets.php +7 -7
- css/min/cmthemes/icecoder.css +1 -1
- css/min/cmthemes/night.css +1 -1
- css/min/cmthemes/panda-syntax.css +1 -0
- css/min/cmthemes/solarized.css +1 -1
- css/min/codemirror.css +1 -1
- css/min/edit.css +1 -1
- js/min/codemirror.js +7 -7
- languages/code-snippets-de_DE.mo +0 -0
- languages/code-snippets-de_DE.po +276 -222
- languages/code-snippets.pot +33 -29
- php/admin-menus/class-import-menu.php +4 -2
- php/class-admin.php +1 -1
- php/class-code-snippets.php +19 -1
- php/class-contextual-help.php +16 -25
- php/class-list-table.php +4 -4
- php/class-shortcode.php +0 -1
- php/editor.php +1 -1
- php/functions.php +1 -1
- php/snippet-ops.php +24 -2
- php/views/edit.php +1 -3
- readme.txt +18 -2
code-snippets.php
CHANGED
@@ -3,15 +3,15 @@
|
|
3 |
/**
|
4 |
* Code Snippets - An easy, clean and simple way to add code snippets to your site.
|
5 |
*
|
6 |
-
* If you're interested in helping to develop Code Snippets, or perhaps
|
7 |
-
*
|
8 |
*
|
9 |
* @package Code_Snippets
|
|
|
|
|
|
|
10 |
* @version 2.6.1
|
11 |
-
* @author Shea Bunge <http://bungeshea.com/>
|
12 |
-
* @copyright Copyright (c) 2012-2015, Shea Bunge
|
13 |
* @link https://github.com/sheabunge/code-snippets
|
14 |
-
* @license http://opensource.org/licenses/MIT
|
15 |
*/
|
16 |
|
17 |
/*
|
@@ -20,7 +20,7 @@ Plugin URI: https://github.com/sheabunge/code-snippets
|
|
20 |
Description: An easy, clean and simple way to add code snippets to your site. No need to edit to your theme's functions.php file again!
|
21 |
Author: Shea Bunge
|
22 |
Author URI: https://bungeshea.com
|
23 |
-
Version: 2.
|
24 |
License: MIT
|
25 |
License URI: license.txt
|
26 |
Text Domain: code-snippets
|
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
42 |
* @since 2.0
|
43 |
* @var string A PHP-standardized version number string
|
44 |
*/
|
45 |
-
define( 'CODE_SNIPPETS_VERSION', '2.
|
46 |
|
47 |
/**
|
48 |
* The full path to the main file of this plugin
|
3 |
/**
|
4 |
* Code Snippets - An easy, clean and simple way to add code snippets to your site.
|
5 |
*
|
6 |
+
* If you're interested in helping to develop Code Snippets, or perhaps contribute
|
7 |
+
* to the localization, please see https://github.com/sheabunge/code-snippets
|
8 |
*
|
9 |
* @package Code_Snippets
|
10 |
+
* @author Shea Bunge <shea@bungeshea.com>
|
11 |
+
* @copyright 2012-2016 Shea Bunge
|
12 |
+
* @license MIT http://opensource.org/licenses/MIT
|
13 |
* @version 2.6.1
|
|
|
|
|
14 |
* @link https://github.com/sheabunge/code-snippets
|
|
|
15 |
*/
|
16 |
|
17 |
/*
|
20 |
Description: An easy, clean and simple way to add code snippets to your site. No need to edit to your theme's functions.php file again!
|
21 |
Author: Shea Bunge
|
22 |
Author URI: https://bungeshea.com
|
23 |
+
Version: 2.7.0
|
24 |
License: MIT
|
25 |
License URI: license.txt
|
26 |
Text Domain: code-snippets
|
42 |
* @since 2.0
|
43 |
* @var string A PHP-standardized version number string
|
44 |
*/
|
45 |
+
define( 'CODE_SNIPPETS_VERSION', '2.7.0' );
|
46 |
|
47 |
/**
|
48 |
* The full path to the main file of this plugin
|
css/min/cmthemes/icecoder.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-icecoder{color:#666;background:#
|
1 |
+
.cm-s-icecoder{color:#666;background:#1d1d1b}.cm-s-icecoder span.cm-keyword{color:#eee;font-weight:700}.cm-s-icecoder span.cm-atom{color:#e1c76e}.cm-s-icecoder span.cm-number{color:#6cb5d9}.cm-s-icecoder span.cm-def{color:#b9ca4a}.cm-s-icecoder span.cm-variable{color:#6cb5d9}.cm-s-icecoder span.cm-variable-2{color:#cc1e5c}.cm-s-icecoder span.cm-variable-3{color:#f9602c}.cm-s-icecoder span.cm-property{color:#eee}.cm-s-icecoder span.cm-operator{color:#9179bb}.cm-s-icecoder span.cm-comment{color:#97a3aa}.cm-s-icecoder span.cm-string{color:#b9ca4a}.cm-s-icecoder span.cm-string-2{color:#6cb5d9}.cm-s-icecoder span.cm-meta,.cm-s-icecoder span.cm-qualifier{color:#555}.cm-s-icecoder span.cm-builtin{color:#214e7b}.cm-s-icecoder span.cm-bracket{color:#cc7}.cm-s-icecoder span.cm-tag{color:#e8e8e8}.cm-s-icecoder span.cm-attribute{color:#099}.cm-s-icecoder span.cm-header{color:#6a0d6a}.cm-s-icecoder span.cm-quote{color:#186718}.cm-s-icecoder span.cm-hr{color:#888}.cm-s-icecoder span.cm-link{color:#e1c76e}.cm-s-icecoder span.cm-error{color:#d00}.cm-s-icecoder .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-icecoder div.CodeMirror-selected{color:#fff;background:#037}.cm-s-icecoder .CodeMirror-gutters{background:#1d1d1b;min-width:41px;border-right:0}.cm-s-icecoder .CodeMirror-linenumber{color:#555;cursor:default}.cm-s-icecoder .CodeMirror-matchingbracket{color:#fff!important;background:#555!important}.cm-s-icecoder .CodeMirror-activeline-background{background:#000}
|
css/min/cmthemes/night.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-night.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-night div.CodeMirror-selected{background:#447}.cm-s-night .CodeMirror-line::selection,.cm-s-night .CodeMirror-line>span::selection,.cm-s-night .CodeMirror-line>span>span::selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-line::-moz-selection,.cm-s-night .CodeMirror-line>span::-moz-selection,.cm-s-night .CodeMirror-line>span>span::-moz-selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-night .CodeMirror-guttermarker{color:#fff}.cm-s-night .CodeMirror-guttermarker-subtle{color:#bbb}.cm-s-night .CodeMirror-linenumber{color:#f8f8f8}.cm-s-night .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-night span.cm-atom{color:#845dc4}.cm-s-night span.cm-number,.cm-s-night span.cm-attribute{color:#ffd500}.cm-s-night span.cm-keyword{color:#599eff}.cm-s-night span.cm-string{color:#37f14a}.cm-s-night span.cm-meta{color:#7678e2}.cm-s-night span.cm-variable-2,.cm-s-night span.cm-tag{color:#99b2ff}.cm-s-night span.cm-variable-3,.cm-s-night span.cm-def{color:#fff}.cm-s-night span.cm-bracket{color:#8da6ce}.cm-s-night span.cm-
|
1 |
+
.cm-s-night.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-night div.CodeMirror-selected{background:#447}.cm-s-night .CodeMirror-line::selection,.cm-s-night .CodeMirror-line>span::selection,.cm-s-night .CodeMirror-line>span>span::selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-line::-moz-selection,.cm-s-night .CodeMirror-line>span::-moz-selection,.cm-s-night .CodeMirror-line>span>span::-moz-selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-night .CodeMirror-guttermarker{color:#fff}.cm-s-night .CodeMirror-guttermarker-subtle{color:#bbb}.cm-s-night .CodeMirror-linenumber{color:#f8f8f8}.cm-s-night .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-night span.cm-comment{color:#8900d1}.cm-s-night span.cm-atom{color:#845dc4}.cm-s-night span.cm-number,.cm-s-night span.cm-attribute{color:#ffd500}.cm-s-night span.cm-keyword{color:#599eff}.cm-s-night span.cm-string{color:#37f14a}.cm-s-night span.cm-meta{color:#7678e2}.cm-s-night span.cm-variable-2,.cm-s-night span.cm-tag{color:#99b2ff}.cm-s-night span.cm-variable-3,.cm-s-night span.cm-def{color:#fff}.cm-s-night span.cm-bracket{color:#8da6ce}.cm-s-night span.cm-builtin,.cm-s-night span.cm-special{color:#ff9e59}.cm-s-night span.cm-link{color:#845dc4}.cm-s-night span.cm-error{color:#9d1e15}.cm-s-night .CodeMirror-activeline-background{background:#1c005a}.cm-s-night .CodeMirror-matchingbracket{outline:1px solid gray;color:#fff!important}
|
css/min/cmthemes/panda-syntax.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cm-s-panda-syntax{font-family:'Operator Mono','Source Sans Pro',Menlo,Monaco,Consolas,Courier New,monospace;background:#292a2b;color:#e6e6e6}.cm-s-panda-syntax .CodeMirror-activeline-background{background:#404954}.cm-s-panda-syntax .cm-comment{font-style:italic;color:#676b79}.cm-s-panda-syntax .cm-string,.cm-s-panda-syntax .cm-string-2{color:#19f9d8}.cm-s-panda-syntax .cm-number,.cm-s-panda-syntax .cm-atom{color:#ffb86c}.cm-s-panda-syntax .cm-keyword,.cm-s-panda-syntax .cm-keyword-2{color:#ff75b5}.cm-s-panda-syntax .cm-keyword-3{color:#b084eb}.cm-s-panda-syntax .cm-variable{color:#ff9ac1}.cm-s-panda-syntax .cm-variable-2{color:#e6e6e6}.cm-s-panda-syntax .cm-variable-3{color:#82b1ff}.cm-s-panda-syntax .cm-def{color:#e6e6e6}.cm-s-panda-syntax .cm-def-2{font-style:italic;color:#ffcc95}.cm-s-panda-syntax .cm-property{color:#6fc1ff}.cm-s-panda-syntax .cm-matchingbracket,.CodeMirror .CodeMirror-matchingbracket{color:#e6e6e6!important;border-bottom:1px dotted #19f9d8;padding-bottom:2px}.cm-s-panda-syntax .CodeMirror-gutters{background:#292a2b;color:#757575;border:none}.cm-s-panda-syntax .CodeMirror-guttermarker,.cm-s-panda-syntax .CodeMirror-guttermarker-subtle{color:#757575}.cm-s-panda-syntax .CodeMirror-linenumber{color:#757575;padding-right:10px}.cm-s-panda-syntax .CodeMirror-cursor{border-left:1px solid #757575}.cm-s-panda-syntax.CodeMirror-focused div.CodeMirror-selected{background:rgba(255,255,255,.25)}.cm-s-panda-syntax .CodeMirror-line::selection,.cm-s-panda-syntax .CodeMirror-line>span::selection,.cm-s-panda-syntax .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-panda-syntax .CodeMirror-line::-moz-selection,.cm-s-panda-syntax .CodeMirror-line>span::-moz-selection,.cm-s-panda-syntax .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-panda-syntax .CodeMirror-activeline-background{background:rgba(99,123,156,.125)}
|
css/min/cmthemes/solarized.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-header{color:#586e75}.cm-s-solarized .cm-quote{color:#93a1a1}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom,.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-variable-3{color:#6c71c4}.cm-s-solarized .cm-property{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-hr{color:transparent;border-top:1px solid #586e75;display:block}.cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}.cm-s-solarized .cm-special{color:#6c71c4}.cm-s-solarized .cm-em{color:#999;text-decoration:underline;text-decoration-style:dotted}.cm-s-solarized .cm-strong{color:#eee}.cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{color:#586e75;border-bottom:1px dotted #dc322f}.cm-s-solarized.cm-s-dark div.CodeMirror-selected{background:#073642}.cm-s-solarized.cm-s-dark.CodeMirror ::selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection,.cm-s-dark .CodeMirror-line>span::-moz-selection,.cm-s-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-light div.CodeMirror-selected{background:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-line::selection,.cm-s-light .CodeMirror-line>span::selection,.cm-s-light .CodeMirror-line>span>span::selection{background:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection,.cm-s-ligh .CodeMirror-line>span::-moz-selection,.cm-s-ligh .CodeMirror-line>span>span::-moz-selection{background:#eee8d5}.cm-s-solarized.CodeMirror{-moz-box-shadow:inset 7px 0 12px -6px #000;-webkit-box-shadow:inset 7px 0 12px -6px #000;box-shadow:inset 7px 0 12px -6px #000}.cm-s-solarized .CodeMirror-gutters{border-right:
|
1 |
+
.solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-header{color:#586e75}.cm-s-solarized .cm-quote{color:#93a1a1}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom,.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-variable-3{color:#6c71c4}.cm-s-solarized .cm-property{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-hr{color:transparent;border-top:1px solid #586e75;display:block}.cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}.cm-s-solarized .cm-special{color:#6c71c4}.cm-s-solarized .cm-em{color:#999;text-decoration:underline;text-decoration-style:dotted}.cm-s-solarized .cm-strong{color:#eee}.cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{color:#586e75;border-bottom:1px dotted #dc322f}.cm-s-solarized.cm-s-dark div.CodeMirror-selected{background:#073642}.cm-s-solarized.cm-s-dark.CodeMirror ::selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection,.cm-s-dark .CodeMirror-line>span::-moz-selection,.cm-s-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-light div.CodeMirror-selected{background:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-line::selection,.cm-s-light .CodeMirror-line>span::selection,.cm-s-light .CodeMirror-line>span>span::selection{background:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection,.cm-s-ligh .CodeMirror-line>span::-moz-selection,.cm-s-ligh .CodeMirror-line>span>span::-moz-selection{background:#eee8d5}.cm-s-solarized.CodeMirror{-moz-box-shadow:inset 7px 0 12px -6px #000;-webkit-box-shadow:inset 7px 0 12px -6px #000;box-shadow:inset 7px 0 12px -6px #000}.cm-s-solarized .CodeMirror-gutters{border-right:0}.cm-s-solarized.cm-s-dark .CodeMirror-gutters{background-color:#073642}.cm-s-solarized.cm-s-dark .CodeMirror-linenumber{color:#586e75;text-shadow:#021014 0 -1px}.cm-s-solarized.cm-s-light .CodeMirror-gutters{background-color:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-linenumber{color:#839496}.cm-s-solarized .CodeMirror-linenumber{padding:0 5px}.cm-s-solarized .CodeMirror-guttermarker-subtle{color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker{color:#ddd}.cm-s-solarized.cm-s-light .CodeMirror-guttermarker{color:#cb4b16}.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text{color:#586e75}.cm-s-solarized .CodeMirror-cursor{border-left:1px solid #819090}.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor{background:#fdf6e3}.cm-s-solarized.cm-s-light .cm-animate-fat-cursor{background-color:#fdf6e3}.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor{background:#586e75}.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor{background-color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background{background:rgba(255,255,255,.06)}.cm-s-solarized.cm-s-light .CodeMirror-activeline-background{background:rgba(0,0,0,.06)}
|
css/min/codemirror.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1)infinite;-moz-animation:blink 1.06s steps(1)infinite;animation:blink 1.06s steps(1)infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px;*zoom:1;*display:inline}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}
|
1 |
+
.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1)infinite;-moz-animation:blink 1.06s steps(1)infinite;animation:blink 1.06s steps(1)infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px;*zoom:1;*display:inline}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}
|
css/min/edit.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.form-table th{width:auto}h3{margin:1em 0}label{cursor:auto}label[for='snippet_description'] h3 div{position:absolute}ul.tagit{background-color:#fff!important}.submit .button{margin-right:.5em}.snippet-scope div{margin-right:30px;display:inline-block}.CodeMirror{width:100%;height:auto!important;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-sizer{min-height:300px!important}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}
|
1 |
+
.form-table th{width:auto}h3{margin:1em 0}label{cursor:auto}label[for='snippet_description'] h3 div{position:absolute}ul.tagit{background-color:#fff!important}.submit .button{margin-right:.5em}.snippet-scope div{margin-right:30px;display:inline-block}.CodeMirror{width:100%;height:auto!important;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-sizer{min-height:300px!important}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff!important}
|
js/min/codemirror.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);(this||window).CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d?Ke(d):{},Ke($f,d,!1),n(d);var e=d.value;"string"==typeof e&&(e=new wg(e,d.mode,null,d.lineSeparator)),this.doc=e;var f=new a.inputStyles[d.inputStyle](this),g=this.display=new b(c,e,f);g.wrapper.CodeMirror=this,j(this),h(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!Cf&&g.input.focus(),r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new De,keySeq:null,specialChars:null};var i=this;sf&&11>tf&&setTimeout(function(){i.display.input.reset(!0)},20),Qb(this),We(),ub(this),this.curOp.forceUpdate=!0,Xd(this,e),d.autofocus&&!Cf||i.hasFocus()?setTimeout(Le(qc,this),20):rc(this);for(var k in _f)_f.hasOwnProperty(k)&&_f[k](this,d[k],ag);w(this),d.finishInit&&d.finishInit(this);for(var l=0;l<eg.length;++l)eg[l](this);wb(this),uf&&d.lineWrapping&&"optimizelegibility"==getComputedStyle(g.lineDiv).textRendering&&(g.lineDiv.style.textRendering="auto")}function b(a,b,c){var d=this;this.input=c,d.scrollbarFiller=Pe("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=Pe("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=Pe("div",null,"CodeMirror-code"),d.selectionDiv=Pe("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=Pe("div",null,"CodeMirror-cursors"),d.measure=Pe("div",null,"CodeMirror-measure"),d.lineMeasure=Pe("div",null,"CodeMirror-measure"),d.lineSpace=Pe("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none"),d.mover=Pe("div",[Pe("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=Pe("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=Pe("div",null,null,"position: absolute; height: "+Hg+"px; width: 1px;"),d.gutters=Pe("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=Pe("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=Pe("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),sf&&8>tf&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),uf||pf&&Cf||(d.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(d.wrapper):a(d.wrapper)),d.viewFrom=d.viewTo=b.first,d.reportedViewFrom=d.reportedViewTo=b.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,c.init(d)}function c(b){b.doc.mode=a.getMode(b.options,b.doc.modeOption),d(b)}function d(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Na(a,100),a.state.modeGen++,a.curOp&&Jb(a)}function e(a){a.options.lineWrapping?(Yg(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Xg(a.display.wrapper,"CodeMirror-wrap"),m(a)),g(a),Jb(a),hb(a),setTimeout(function(){s(a)},100)}function f(a){var b=sb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/tb(a.display)-3);return function(e){if(vd(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function g(a){var b=a.doc,c=f(a);b.iter(function(a){var b=c(a);b!=a.height&&_d(a,b)})}function h(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hb(a)}function i(a){j(a),Jb(a),setTimeout(function(){v(a)},20)}function j(a){var b=a.display.gutters,c=a.options.gutters;Qe(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(Pe("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none",k(a)}function k(a){var b=a.display.gutters.offsetWidth;a.display.sizer.style.marginLeft=b+"px"}function l(a){if(0==a.height)return 0;for(var b,c=a.text.length,d=a;b=od(d);){var e=b.find(0,!0);d=e.from.line,c+=e.from.ch-e.to.ch}for(d=a;b=pd(d);){var e=b.find(0,!0);c-=d.text.length-e.from.ch,d=e.to.line,c+=d.text.length-e.to.ch}return c}function m(a){var b=a.display,c=a.doc;b.maxLine=Yd(c,c.first),b.maxLineLength=l(b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var c=l(a);c>b.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Ge(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Sa(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Ua(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function p(a,b,c){this.cm=c;var d=this.vert=Pe("div",[Pe("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=Pe("div",[Pe("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d),a(e),Cg(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")}),Cg(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,sf&&8>tf&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function r(b){b.display.scrollbars&&(b.display.scrollbars.clear(),b.display.scrollbars.addClass&&Xg(b.display.wrapper,b.display.scrollbars.addClass)),b.display.scrollbars=new a.scrollbarModel[b.options.scrollbarStyle](function(a){b.display.wrapper.insertBefore(a,b.display.scrollbarFiller),Cg(a,"mousedown",function(){b.state.focused&&setTimeout(function(){b.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,c){"horizontal"==c?ec(b,a):dc(b,a)},b),b.display.scrollbars.addClass&&Yg(b.display.wrapper,b.display.scrollbars.addClass)}function s(a,b){b||(b=o(a));var c=a.display.barWidth,d=a.display.barHeight;t(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&F(a),t(a,o(a)),c=a.display.barWidth,d=a.display.barHeight}function t(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function u(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Ra(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=be(b,d),g=be(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;f>h?(f=h,g=be(b,ce(Yd(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=be(b,ce(Yd(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function v(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=y(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&c[g].gutter&&(c[g].gutter.style.left=f);var h=c[g].alignable;if(h)for(var i=0;i<h.length;i++)h[i].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function w(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=x(a.options,b.first+b.size-1),d=a.display;if(c.length!=d.lineNumChars){var e=d.measure.appendChild(Pe("div",[Pe("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),f=e.firstChild.offsetWidth,g=e.offsetWidth-f;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(f,d.lineGutter.offsetWidth-g)+1,d.lineNumWidth=d.lineNumInnerWidth+g,d.lineNumChars=d.lineNumInnerWidth?c.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",k(a),!0}return!1}function x(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function y(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function z(a,b,c){var d=a.display;this.viewport=b,this.visible=u(d,a.doc,b),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=Va(a),this.force=c,this.dims=H(a),this.events=[]}function A(a){var b=a.display;!b.scrollbarsClipped&&b.scroller.offsetWidth&&(b.nativeBarWidth=b.scroller.offsetWidth-b.scroller.clientWidth,b.heightForcer.style.height=Ua(a)+"px",b.sizer.style.marginBottom=-b.nativeBarWidth+"px",b.sizer.style.borderRightWidth=Ua(a)+"px",b.scrollbarsClipped=!0)}function B(a,b){var c=a.display,d=a.doc;if(b.editorIsHidden)return Lb(a),!1;if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Pb(a))return!1;w(a)&&(Lb(a),b.dims=H(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFrom<f&&f-c.viewFrom<20&&(f=Math.max(d.first,c.viewFrom)),c.viewTo>g&&c.viewTo-g<20&&(g=Math.min(e,c.viewTo)),Jf&&(f=td(a.doc,f),g=ud(a.doc,g));var h=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;Ob(a,f,g),c.viewOffset=ce(Yd(a.doc,c.viewFrom)),a.display.mover.style.top=c.viewOffset+"px";var i=Pb(a);if(!h&&0==i&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;var j=Se();return i>4&&(c.lineDiv.style.display="none"),I(a,c.updateLineNumbers,b.dims),i>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,j&&Se()!=j&&j.offsetHeight&&j.focus(),Qe(c.cursorDiv),Qe(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,h&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,Na(a,400)),c.updateLineNumbers=null,!0}function C(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Va(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Sa(a.display)-Wa(a),c.top)}),b.visible=u(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&B(a,b);d=!1){F(a);var e=o(a);Ia(a),E(a,e),s(a,e)}b.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function D(a,b){var c=new z(a,b);if(B(a,c)){F(a),C(a,c);var d=o(a);Ia(a),E(a,d),s(a,d),c.finish()}}function E(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px",a.display.gutters.style.height=Math.max(c+Ua(a),b.clientHeight)+"px"}function F(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;d<b.view.length;d++){var e,f=b.view[d];if(!f.hidden){if(sf&&8>tf){var g=f.node.offsetTop+f.node.offsetHeight;e=g-c,c=g}else{var h=f.node.getBoundingClientRect();e=h.bottom-h.top}var i=f.line.height-e;if(2>e&&(e=sb(b)),(i>.001||-.001>i)&&(_d(f.line,e),G(f.line),f.rest))for(var j=0;j<f.rest.length;j++)G(f.rest[j])}}}function G(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.parentNode.offsetHeight}function H(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:y(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function I(a,b,c){function d(b){var c=b.nextSibling;return uf&&Df&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b),c}for(var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,i=e.view,j=e.viewFrom,k=0;k<i.length;k++){var l=i[k];if(l.hidden);else if(l.node&&l.node.parentNode==g){for(;h!=l.node;)h=d(h);var m=f&&null!=b&&j>=b&&l.lineNumber;l.changes&&(Ge(l.changes,"gutter")>-1&&(m=!1),J(a,l,j,c)),m&&(Qe(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(x(a.options,j)))),h=l.node.nextSibling}else{var n=R(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function J(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];"text"==f?N(a,b):"gutter"==f?P(a,b,c,d):"class"==f?O(b):"widget"==f&&Q(a,b,d)}b.changes=null}function K(a){return a.node==a.text&&(a.node=Pe("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),sf&&8>tf&&(a.node.style.zIndex=2)),a.node}function L(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=K(a);a.background=c.insertBefore(Pe("div",null,b),c.firstChild)}}function M(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Ld(a,b)}function N(a,b){var c=b.text.className,d=M(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,O(b)):c&&(b.text.className=c)}function O(a){L(a),a.line.wrapClass?K(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function P(a,b,c,d){if(b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null),b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null),b.line.gutterClass){var e=K(b);b.gutterBackground=Pe("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px"),e.insertBefore(b.gutterBackground,b.text)}var f=b.line.gutterMarkers;if(a.options.lineNumbers||f){var e=K(b),g=b.gutter=Pe("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px");if(a.display.input.setUneditable(g),e.insertBefore(g,b.text),b.line.gutterClass&&(g.className+=" "+b.line.gutterClass),!a.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(Pe("div",x(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),f)for(var h=0;h<a.options.gutters.length;++h){var i=a.options.gutters[h],j=f.hasOwnProperty(i)&&f[i];j&&g.appendChild(Pe("div",[j],"CodeMirror-gutter-elt","left: "+d.gutterLeft[i]+"px; width: "+d.gutterWidth[i]+"px"))}}}function Q(a,b,c){b.alignable&&(b.alignable=null);for(var d,e=b.node.firstChild;e;e=d){var d=e.nextSibling;"CodeMirror-linewidget"==e.className&&b.node.removeChild(e)}S(a,b,c)}function R(a,b,c,d){var e=M(a,b);return b.text=b.node=e.pre,e.bgClass&&(b.bgClass=e.bgClass),e.textClass&&(b.textClass=e.textClass),O(b),P(a,b,c,d),S(a,b,d),b.node}function S(a,b,c){if(T(a,b.line,b,c,!0),b.rest)for(var d=0;d<b.rest.length;d++)T(a,b.rest[d],b,c,!1)}function T(a,b,c,d,e){if(b.widgets)for(var f=K(c),g=0,h=b.widgets;g<h.length;++g){var i=h[g],j=Pe("div",[i.node],"CodeMirror-linewidget");i.handleMouseEvents||j.setAttribute("cm-ignore-events","true"),U(i,j,c,d),a.display.input.setUneditable(j),e&&i.above?f.insertBefore(j,c.gutter||c.text):f.appendChild(j),xe(i,"redraw")}}function U(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function V(a){return Kf(a.line,a.ch)}function W(a,b){return Lf(a,b)<0?b:a}function X(a,b){return Lf(a,b)<0?a:b}function Y(a){a.state.focused||(a.display.input.focus(),qc(a))}function Z(a,b,c,d,e){var f=a.doc;a.display.shift=!1,d||(d=f.sel);var g=a.state.pasteIncoming||"paste"==e,h=f.splitLines(b),i=null;if(g&&d.ranges.length>1)if(Mf&&Mf.join("\n")==b){if(d.ranges.length%Mf.length==0){i=[];for(var j=0;j<Mf.length;j++)i.push(f.splitLines(Mf[j]))}}else h.length==d.ranges.length&&(i=He(h,function(a){return[a]}));for(var j=d.ranges.length-1;j>=0;j--){var k=d.ranges[j],l=k.from(),m=k.to();k.empty()&&(c&&c>0?l=Kf(l.line,l.ch-c):a.state.overwrite&&!g&&(m=Kf(m.line,Math.min(Yd(f,m.line).text.length,m.ch+Fe(h).length))));var n=a.curOp.updateInput,o={from:l,to:m,text:i?i[j%i.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};zc(a.doc,o),xe(a,"inputRead",a,o)}b&&!g&&_(a,b),Lc(a),a.curOp.updateInput=n,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function $(a,b){var c=a.clipboardData&&a.clipboardData.getData("text/plain");return c?(a.preventDefault(),b.isReadOnly()||b.options.disableInput||Db(b,function(){Z(b,c,0,null,"paste")}),!0):void 0}function _(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;d>=0;d--){var e=c.ranges[d];if(!(e.head.ch>100||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars){for(var h=0;h<f.electricChars.length;h++)if(b.indexOf(f.electricChars.charAt(h))>-1){g=Nc(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(Yd(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Nc(a,e.head.line,"smart"));g&&xe(a,"electricInput",a,e.head.line)}}}function aa(a){for(var b=[],c=[],d=0;d<a.doc.sel.ranges.length;d++){var e=a.doc.sel.ranges[d].head.line,f={anchor:Kf(e,0),head:Kf(e+1,0)};c.push(f),b.push(a.getRange(f.anchor,f.head))}return{text:b,ranges:c}}function ba(a){a.setAttribute("autocorrect","off"),a.setAttribute("autocapitalize","off"),a.setAttribute("spellcheck","false")}function ca(a){this.cm=a,this.prevInput="",this.pollingFast=!1,this.polling=new De,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function da(){var a=Pe("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),b=Pe("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return uf?a.style.width="1000px":a.setAttribute("wrap","off"),Bf&&(a.style.border="1px solid black"),ba(a),b}function ea(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new De,this.gracePeriod=!1}function fa(a,b){var c=_a(a,b.line);if(!c||c.hidden)return null;var d=Yd(a.doc,b.line),e=Ya(c,d,b.line),f=de(d),g="left";if(f){var h=jf(f,b.ch);g=h%2?"right":"left"}var i=cb(e.map,b.ch,g);return i.offset="right"==i.collapse?i.end:i.start,i}function ga(a,b){return b&&(a.bad=!0),a}function ha(a,b,c){var d;if(b==a.display.lineDiv){if(d=a.display.lineDiv.childNodes[c],!d)return ga(a.clipPos(Kf(a.display.viewTo-1)),!0);b=null,c=0}else for(d=b;;d=d.parentNode){if(!d||d==a.display.lineDiv)return null;if(d.parentNode&&d.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==d)return ia(f,b,c)}}function ia(a,b,c){function d(b,c,d){for(var e=-1;e<(k?k.length:0);e++)for(var f=0>e?j.map:k[e],g=0;g<f.length;g+=3){var h=f[g+2];if(h==b||h==c){var i=ae(0>e?a.line:a.rest[e]),l=f[g]+d;return(0>d||h!=b)&&(l=f[g+(d?1:0)]),Kf(i,l)}}}var e=a.text.firstChild,f=!1;if(!b||!Ug(e,b))return ga(Kf(ae(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b)){var g=a.rest?Fe(a.rest):a.line;return ga(Kf(ae(g),g.text.length),f)}var h=3==b.nodeType?b:null,i=b;for(h||1!=b.childNodes.length||3!=b.firstChild.nodeType||(h=b.firstChild,c&&(c=h.nodeValue.length));i.parentNode!=e;)i=i.parentNode;var j=a.measure,k=j.maps,l=d(h,i,c);if(l)return ga(l,f);for(var m=i.nextSibling,n=h?h.nodeValue.length-c:0;m;m=m.nextSibling){if(l=d(m,m.firstChild,0))return ga(Kf(l.line,l.ch-n),f);n+=m.textContent.length}for(var o=i.previousSibling,n=c;o;o=o.previousSibling){if(l=d(o,o.firstChild,-1))return ga(Kf(l.line,l.ch+n),f);n+=m.textContent.length}}function ja(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return""==c&&(c=b.textContent.replace(/\u200b/g,"")),void(h+=c);var k,l=b.getAttribute("cm-marker");if(l){var m=a.findMarks(Kf(d,0),Kf(e+1,0),f(+l));return void(m.length&&(k=m[0].find())&&(h+=Zd(a.doc,k.from,k.to).join(j)))}if("false"==b.getAttribute("contenteditable"))return;for(var n=0;n<b.childNodes.length;n++)g(b.childNodes[n]);/^(pre|div|p)$/i.test(b.nodeName)&&(i=!0)}else if(3==b.nodeType){var o=b.nodeValue;if(!o)return;i&&(h+=j,i=!1),h+=o}}for(var h="",i=!1,j=a.doc.lineSeparator();g(b),b!=c;)b=b.nextSibling;return h}function ka(a,b){this.ranges=a,this.primIndex=b}function la(a,b){this.anchor=a,this.head=b}function ma(a,b){var c=a[b];a.sort(function(a,b){return Lf(a.from(),b.from())}),b=Ge(a,c);for(var d=1;d<a.length;d++){var e=a[d],f=a[d-1];if(Lf(f.to(),e.from())>=0){var g=X(f.from(),e.from()),h=W(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new la(i?h:g,i?g:h))}}return new ka(a,b)}function na(a,b){return new ka([new la(a,b||a)],0)}function oa(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function pa(a,b){if(b.line<a.first)return Kf(a.first,0);var c=a.first+a.size-1;return b.line>c?Kf(c,Yd(a,c).text.length):qa(b,Yd(a,b.line).text.length)}function qa(a,b){var c=a.ch;return null==c||c>b?Kf(a.line,b):0>c?Kf(a.line,0):a}function ra(a,b){return b>=a.first&&b<a.first+a.size}function sa(a,b){for(var c=[],d=0;d<b.length;d++)c[d]=pa(a,b[d]);return c}function ta(a,b,c,d){if(a.cm&&a.cm.display.shift||a.extend){var e=b.anchor;if(d){var f=Lf(c,e)<0;f!=Lf(d,e)<0?(e=c,c=d):f!=Lf(c,d)<0&&(c=d)}return new la(e,c)}return new la(d||c,c)}function ua(a,b,c,d){Aa(a,new ka([ta(a,a.sel.primary(),b,c)],0),d)}function va(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=ta(a,a.sel.ranges[e],b[e],null);var f=ma(d,a.sel.primIndex);Aa(a,f,c)}function wa(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c,Aa(a,ma(e,a.sel.primIndex),d)}function xa(a,b,c,d){Aa(a,na(b,c),d)}function ya(a,b,c){var d={ranges:b.ranges,update:function(b){this.ranges=[];for(var c=0;c<b.length;c++)this.ranges[c]=new la(pa(a,b[c].anchor),pa(a,b[c].head))},origin:c&&c.origin};return Fg(a,"beforeSelectionChange",a,d),a.cm&&Fg(a.cm,"beforeSelectionChange",a.cm,d),d.ranges!=b.ranges?ma(d.ranges,d.ranges.length-1):b}function za(a,b,c){var d=a.history.done,e=Fe(d);e&&e.ranges?(d[d.length-1]=b,Ba(a,b,c)):Aa(a,b,c)}function Aa(a,b,c){Ba(a,b,c),ke(a,a.sel,a.cm?a.cm.curOp.id:NaN,c)}function Ba(a,b,c){(Be(a,"beforeSelectionChange")||a.cm&&Be(a.cm,"beforeSelectionChange"))&&(b=ya(a,b,c));var d=c&&c.bias||(Lf(b.primary().head,a.sel.primary().head)<0?-1:1);Ca(a,Ea(a,b,d,!0)),c&&c.scroll===!1||!a.cm||Lc(a.cm)}function Ca(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,Ae(a.cm)),xe(a,"cursorActivity",a))}function Da(a){Ca(a,Ea(a,a.sel,null,!1),Jg)}function Ea(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=b.ranges[f],h=b.ranges.length==a.sel.ranges.length&&a.sel.ranges[f],i=Ga(a,g.anchor,h&&h.anchor,c,d),j=Ga(a,g.head,h&&h.head,c,d);(e||i!=g.anchor||j!=g.head)&&(e||(e=b.ranges.slice(0,f)),e[f]=new la(i,j))}return e?ma(e,b.primIndex):b}function Fa(a,b,c,d,e){var f=Yd(a,b.line);if(f.markedSpans)for(var g=0;g<f.markedSpans.length;++g){var h=f.markedSpans[g],i=h.marker;if((null==h.from||(i.inclusiveLeft?h.from<=b.ch:h.from<b.ch))&&(null==h.to||(i.inclusiveRight?h.to>=b.ch:h.to>b.ch))){if(e&&(Fg(i,"beforeCursorEnter"),i.explicitlyCleared)){if(f.markedSpans){--g;continue}break}if(!i.atomic)continue;if(c){var j,k=i.find(0>d?1:-1);if((0>d?i.inclusiveRight:i.inclusiveLeft)&&(k=Ha(a,k,-d,f)),k&&k.line==b.line&&(j=Lf(k,c))&&(0>d?0>j:j>0))return Fa(a,k,b,d,e)}var l=i.find(0>d?-1:1);return(0>d?i.inclusiveLeft:i.inclusiveRight)&&(l=Ha(a,l,d,f)),l?Fa(a,l,b,d,e):null}}return b}function Ga(a,b,c,d,e){var f=d||1,g=Fa(a,b,c,f,e)||!e&&Fa(a,b,c,f,!0)||Fa(a,b,c,-f,e)||!e&&Fa(a,b,c,-f,!0);return g?g:(a.cantEdit=!0,Kf(a.first,0))}function Ha(a,b,c,d){return 0>c&&0==b.ch?b.line>a.first?pa(a,Kf(b.line-1)):null:c>0&&b.ch==(d||Yd(a,b.line)).text.length?b.line<a.first+a.size-1?Kf(b.line+1,0):null:new Kf(b.line,b.ch+c)}function Ia(a){a.display.input.showSelection(a.display.input.prepareSelection())}function Ja(a,b){for(var c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),g=0;g<c.sel.ranges.length;g++)if(b!==!1||g!=c.sel.primIndex){var h=c.sel.ranges[g],i=h.empty();(i||a.options.showCursorWhenSelecting)&&Ka(a,h.head,e),i||La(a,h,f)}return d}function Ka(a,b,c){var d=nb(a,b,"div",null,null,!a.options.singleCursorHeightPerLine),e=c.appendChild(Pe("div"," ","CodeMirror-cursor"));if(e.style.left=d.left+"px",e.style.top=d.top+"px",e.style.height=Math.max(0,d.bottom-d.top)*a.options.cursorHeight+"px",d.other){var f=c.appendChild(Pe("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));f.style.display="",f.style.left=d.other.left+"px",f.style.top=d.other.top+"px",f.style.height=.85*(d.other.bottom-d.other.top)+"px"}}function La(a,b,c){function d(a,b,c,d){0>b&&(b=0),b=Math.round(b),d=Math.round(d),h.appendChild(Pe("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return mb(a,Kf(b,c),"div",l,d)}var h,i,l=Yd(g,b),m=l.text.length;return _e(de(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottom<l.top&&d(n,p.bottom,null,l.top)),null==e&&b==m&&(o=k),(!h||p.top<h.top||p.top==h.top&&p.left<h.left)&&(h=p),(!i||l.bottom>i.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=Ta(a.display),j=i.left,k=Math.max(f.sizerWidth,Va(a)-f.sizer.offsetLeft)-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=Yd(g,l.line),o=Yd(g,m.line),p=rd(n)==rd(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top<r.top-2?(d(q.right,q.top,null,q.bottom),d(j,r.top,r.left,r.bottom)):d(q.right,q.top,r.left-q.right,q.bottom)),q.bottom<r.top&&d(j,q.bottom,null,r.top)}c.appendChild(h)}function Ma(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="",a.options.cursorBlinkRate>0?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Na(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,Le(Oa,a))}function Oa(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=gg(b.mode,Qa(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength,i=Hd(a,f,h?gg(b.mode,d):d,!0);f.styles=i.styles;var j=f.styleClasses,k=i.classes;k?f.styleClasses=k:j&&(f.styleClasses=null);for(var l=!g||g.length!=f.styles.length||j!=k&&(!j||!k||j.bgClass!=k.bgClass||j.textClass!=k.textClass),m=0;!l&&m<g.length;++m)l=g[m]!=f.styles[m];l&&e.push(b.frontier),f.stateAfter=h?d:gg(b.mode,d)}else f.text.length<=a.options.maxHighlightLength&&Jd(a,f.text,d),f.stateAfter=b.frontier%5==0?gg(b.mode,d):null;return++b.frontier,+new Date>c?(Na(a,a.options.workDelay),!0):void 0}),e.length&&Db(a,function(){for(var b=0;b<e.length;b++)Kb(a,e[b],"text")})}}function Pa(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=Yd(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Mg(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Qa(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Pa(a,b,c),g=f>d.first&&Yd(d,f-1).stateAfter;return g=g?gg(d.mode,g):hg(d.mode),d.iter(f,b,function(c){Jd(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f<e.viewTo;c.stateAfter=h?gg(d.mode,g):null,++f}),c&&(d.frontier=f),g}function Ra(a){return a.lineSpace.offsetTop}function Sa(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function Ta(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=Re(a.measure,Pe("pre","x")),c=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,d={left:parseInt(c.paddingLeft),right:parseInt(c.paddingRight)};return isNaN(d.left)||isNaN(d.right)||(a.cachedPaddingH=d),d}function Ua(a){return Hg-a.display.nativeBarWidth}function Va(a){return a.display.scroller.clientWidth-Ua(a)-a.display.barWidth}function Wa(a){return a.display.scroller.clientHeight-Ua(a)-a.display.barHeight}function Xa(a,b,c){var d=a.options.lineWrapping,e=d&&Va(a);if(!b.measure.heights||d&&b.measure.width!=e){var f=b.measure.heights=[];if(d){b.measure.width=e;for(var g=b.text.firstChild.getClientRects(),h=0;h<g.length-1;h++){var i=g[h],j=g[h+1];Math.abs(i.bottom-j.bottom)>2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Ya(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;d<a.rest.length;d++)if(a.rest[d]==b)return{map:a.measure.maps[d],cache:a.measure.caches[d]};for(var d=0;d<a.rest.length;d++)if(ae(a.rest[d])>c)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function Za(a,b){b=rd(b);var c=ae(b),d=a.display.externalMeasured=new Hb(a.doc,b,c);d.lineN=c;var e=d.built=Ld(a,d);return d.text=e.pre,Re(a.display.lineMeasure,e.pre),d}function $a(a,b,c,d){return bb(a,ab(a,b),c,d)}function _a(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[Mb(a,b)];var c=a.display.externalMeasured;return c&&b>=c.lineN&&b<c.lineN+c.size?c:void 0}function ab(a,b){var c=ae(b),d=_a(a,c);d&&!d.text?d=null:d&&d.changes&&(J(a,d,c,H(a)),a.curOp.forceUpdate=!0),d||(d=Za(a,b));var e=Ya(d,b,c);return{line:b,view:d,rect:null,map:e.map,cache:e.cache,before:e.before,hasHeights:!1}}function bb(a,b,c,d,e){b.before&&(c=-1);var f,g=c+(d||"");return b.cache.hasOwnProperty(g)?f=b.cache[g]:(b.rect||(b.rect=b.view.text.getBoundingClientRect()),b.hasHeights||(Xa(a,b.view,b.rect),b.hasHeights=!0),f=db(a,b,c,d),f.bogus||(b.cache[g]=f)),{left:f.left,right:f.right,top:e?f.rtop:f.top,bottom:e?f.rbottom:f.bottom}}function cb(a,b,c){for(var d,e,f,g,h=0;h<a.length;h+=3){var i=a[h],j=a[h+1];if(i>b?(e=0,f=1,g="left"):j>b?(e=b-i,f=e+1):(h==a.length-3||b==j&&a[h+3]>b)&&(f=j-i,e=f-1,b>=j&&(g="right")),null!=e){if(d=a[h+2],i==j&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=a[(h-=3)+2],g="left";if("right"==c&&e==j-i)for(;h<a.length-3&&a[h+3]==a[h+4]&&!a[h+5].insertLeft;)d=a[(h+=3)+2],
|
2 |
-
g="right";break}}return{node:d,start:e,end:f,collapse:g,coverStart:i,coverEnd:j}}function db(a,b,c,d){var e,f=cb(b.map,c,d),g=f.node,h=f.start,i=f.end,j=f.collapse;if(3==g.nodeType){for(var k=0;4>k;k++){for(;h&&Oe(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+i<f.coverEnd&&Oe(b.line.text.charAt(f.coverStart+i));)++i;if(sf&&9>tf&&0==h&&i==f.coverEnd-f.coverStart)e=g.parentNode.getBoundingClientRect();else if(sf&&a.options.lineWrapping){var l=Qg(g,h,i).getClientRects();e=l.length?l["right"==d?l.length-1:0]:Qf}else e=Qg(g,h,i).getBoundingClientRect()||Qf;if(e.left||e.right||0==h)break;i=h,h-=1,j="right"}sf&&11>tf&&(e=eb(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(sf&&9>tf&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+tb(a.display),top:m.top,bottom:m.bottom}:Qf}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,k=0;k<q.length-1&&!(p<q[k]);k++);var r=k?q[k-1]:0,s=q[k],t={left:("right"==j?e.right:e.left)-b.rect.left,right:("left"==j?e.left:e.right)-b.rect.left,top:r,bottom:s};return e.left||e.right||(t.bogus=!0),a.options.singleCursorHeightPerLine||(t.rtop=n,t.rbottom=o),t}function eb(a,b){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!$e(a))return b;var c=screen.logicalXDPI/screen.deviceXDPI,d=screen.logicalYDPI/screen.deviceYDPI;return{left:b.left*c,right:b.right*c,top:b.top*d,bottom:b.bottom*d}}function fb(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function gb(a){a.display.externalMeasure=null,Qe(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)fb(a.display.view[b])}function hb(a){gb(a),a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function ib(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function jb(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function kb(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=yd(b.widgets[e]);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=ce(b);if("local"==d?g+=Ra(a.display):g-=a.display.viewOffset,"page"==d||"window"==d){var h=a.display.lineSpace.getBoundingClientRect();g+=h.top+("window"==d?0:jb());var i=h.left+("window"==d?0:ib());c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function lb(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=ib(),e-=jb();else if("local"==c||!c){var f=a.display.sizer.getBoundingClientRect();d+=f.left,e+=f.top}var g=a.display.lineSpace.getBoundingClientRect();return{left:d-g.left,top:e-g.top}}function mb(a,b,c,d,e){return d||(d=Yd(a.doc,b.line)),kb(a,d,$a(a,d,b.ch,e),c)}function nb(a,b,c,d,e,f){function g(b,g){var h=bb(a,e,b,g?"right":"left",f);return g?h.left=h.right:h.right=h.left,kb(a,d,h,c)}function h(a,b){var c=i[b],d=c.level%2;return a==af(c)&&b&&c.level<i[b-1].level?(c=i[--b],a=bf(c)-(c.level%2?0:1),d=!0):a==bf(c)&&b<i.length-1&&c.level<i[b+1].level&&(c=i[++b],a=af(c)-c.level%2,d=!1),d&&a==c.to&&a>c.from?g(a-1):g(a,d)}d=d||Yd(a.doc,b.line),e||(e=ab(a,d));var i=de(d),j=b.ch;if(!i)return g(j);var k=jf(i,j),l=h(j,k);return null!=eh&&(l.other=h(j,eh)),l}function ob(a,b){var c=0,b=pa(a.doc,b);a.options.lineWrapping||(c=tb(a.display)*b.ch);var d=Yd(a.doc,b.line),e=ce(d)+Ra(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function pb(a,b,c,d){var e=Kf(a,b);return e.xRel=d,c&&(e.outside=!0),e}function qb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return pb(d.first,0,!0,-1);var e=be(d,c),f=d.first+d.size-1;if(e>f)return pb(d.first+d.size-1,Yd(d,f).text.length,!0,1);0>b&&(b=0);for(var g=Yd(d,e);;){var h=rb(a,g,e,b,c),i=pd(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=ae(g=j.to.line)}}function rb(a,b,c,d,e){function f(d){var e=nb(a,Kf(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:g<e.top?e.left+i:(h=!1,e.left)}var g=e-ce(b),h=!1,i=2*a.display.wrapper.clientWidth,j=ab(a,b),k=de(b),l=b.text.length,m=cf(b),n=df(b),o=f(m),p=h,q=f(n),r=h;if(d>q)return pb(c,n,r,1);for(;;){if(k?n==m||n==lf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Oe(b.text.charAt(s));)++s;var u=pb(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=lf(b,w,1)}var y=f(w);y>d?(n=w,q=y,(r=h)&&(q+=1e3),l=v):(m=w,o=y,p=h,l-=v)}}function sb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Nf){Nf=Pe("pre");for(var b=0;49>b;++b)Nf.appendChild(document.createTextNode("x")),Nf.appendChild(Pe("br"));Nf.appendChild(document.createTextNode("x"))}Re(a.measure,Nf);var c=Nf.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Qe(a.measure),c||1}function tb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Pe("span","xxxxxxxxxx"),c=Pe("pre",[b]);Re(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function ub(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Sf},Rf?Rf.ops.push(a.curOp):a.curOp.ownsGroup=Rf={ops:[a.curOp],delayedCallbacks:[]}}function vb(a){var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c].call(null);for(var d=0;d<a.ops.length;d++){var e=a.ops[d];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++].call(null,e.cm)}}while(c<b.length)}function wb(a){var b=a.curOp,c=b.ownsGroup;if(c)try{vb(c)}finally{Rf=null;for(var d=0;d<c.ops.length;d++)c.ops[d].cm.curOp=null;xb(c)}}function xb(a){for(var b=a.ops,c=0;c<b.length;c++)yb(b[c]);for(var c=0;c<b.length;c++)zb(b[c]);for(var c=0;c<b.length;c++)Ab(b[c]);for(var c=0;c<b.length;c++)Bb(b[c]);for(var c=0;c<b.length;c++)Cb(b[c])}function yb(a){var b=a.cm,c=b.display;A(b),a.updateMaxLine&&m(b),a.mustUpdate=a.viewChanged||a.forceUpdate||null!=a.scrollTop||a.scrollToPos&&(a.scrollToPos.from.line<c.viewFrom||a.scrollToPos.to.line>=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new z(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function zb(a){a.updatedDisplay=a.mustUpdate&&B(a.cm,a.update)}function Ab(a){var b=a.cm,c=b.display;a.updatedDisplay&&F(b),a.barMeasure=o(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=$a(b,c.maxLine,c.maxLine.text.length).left+3,b.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+a.adjustWidthTo+Ua(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Va(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection())}function Bb(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeft<b.doc.scrollLeft&&ec(b,Math.min(b.display.scroller.scrollLeft,a.maxScrollLeft),!0),b.display.maxLineChanged=!1),a.preparedSelection&&b.display.input.showSelection(a.preparedSelection),a.updatedDisplay&&E(b,a.barMeasure),(a.updatedDisplay||a.startHeight!=b.doc.height)&&s(b,a.barMeasure),a.selectionChanged&&Ma(b),b.state.focused&&a.updateInput&&b.display.input.reset(a.typing),!a.focus||a.focus!=Se()||document.hasFocus&&!document.hasFocus()||Y(a.cm)}function Cb(a){var b=a.cm,c=b.display,d=b.doc;if(a.updatedDisplay&&C(b,a.update),null==c.wheelStartX||null==a.scrollTop&&null==a.scrollLeft&&!a.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null==a.scrollTop||c.scroller.scrollTop==a.scrollTop&&!a.forceScroll||(d.scrollTop=Math.max(0,Math.min(c.scroller.scrollHeight-c.scroller.clientHeight,a.scrollTop)),c.scrollbars.setScrollTop(d.scrollTop),c.scroller.scrollTop=d.scrollTop),null==a.scrollLeft||c.scroller.scrollLeft==a.scrollLeft&&!a.forceScroll||(d.scrollLeft=Math.max(0,Math.min(c.scroller.scrollWidth-Va(b),a.scrollLeft)),c.scrollbars.setScrollLeft(d.scrollLeft),c.scroller.scrollLeft=d.scrollLeft,v(b)),a.scrollToPos){var e=Hc(b,pa(d,a.scrollToPos.from),pa(d,a.scrollToPos.to),a.scrollToPos.margin);a.scrollToPos.isCursor&&b.state.focused&&Gc(b,e)}var f=a.maybeHiddenMarkers,g=a.maybeUnhiddenMarkers;if(f)for(var h=0;h<f.length;++h)f[h].lines.length||Fg(f[h],"hide");if(g)for(var h=0;h<g.length;++h)g[h].lines.length&&Fg(g[h],"unhide");c.wrapper.offsetHeight&&(d.scrollTop=b.display.scroller.scrollTop),a.changeObjs&&Fg(b,"changes",b,a.changeObjs),a.update&&a.update.finish()}function Db(a,b){if(a.curOp)return b();ub(a);try{return b()}finally{wb(a)}}function Eb(a,b){return function(){if(a.curOp)return b.apply(a,arguments);ub(a);try{return b.apply(a,arguments)}finally{wb(a)}}}function Fb(a){return function(){if(this.curOp)return a.apply(this,arguments);ub(this);try{return a.apply(this,arguments)}finally{wb(this)}}}function Gb(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);ub(b);try{return a.apply(this,arguments)}finally{wb(b)}}}function Hb(a,b,c){this.line=b,this.rest=sd(b),this.size=this.rest?ae(Fe(this.rest))-c+1:1,this.node=this.text=null,this.hidden=vd(a,b)}function Ib(a,b,c){for(var d,e=[],f=b;c>f;f=d){var g=new Hb(a.doc,Yd(a.doc,f),f);d=f+g.size,e.push(g)}return e}function Jb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Jf&&td(a.doc,b)<e.viewTo&&Lb(a);else if(c<=e.viewFrom)Jf&&ud(a.doc,c+d)>e.viewFrom?Lb(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Lb(a);else if(b<=e.viewFrom){var f=Nb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Lb(a)}else if(c>=e.viewTo){var f=Nb(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Lb(a)}else{var g=Nb(a,b,b,-1),h=Nb(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Ib(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Lb(a)}var i=e.externalMeasured;i&&(c<i.lineN?i.lineN+=d:b<i.lineN+i.size&&(e.externalMeasured=null))}function Kb(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;if(e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null),!(b<d.viewFrom||b>=d.viewTo)){var f=d.view[Mb(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Ge(g,c)&&g.push(c)}}}function Lb(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Mb(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,0>b)return d}function Nb(a,b,c,d){var e,f=Mb(a,b),g=a.display.view;if(!Jf||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;td(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function Ob(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Ib(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Ib(a,b,d.viewFrom).concat(d.view):d.viewFrom<b&&(d.view=d.view.slice(Mb(a,b))),d.viewFrom=b,d.viewTo<c?d.view=d.view.concat(Ib(a,d.viewTo,c)):d.viewTo>c&&(d.view=d.view.slice(0,Mb(a,c)))),d.viewTo=c}function Pb(a){for(var b=a.display.view,c=0,d=0;d<b.length;d++){var e=b[d];e.hidden||e.node&&!e.changes||++c}return c}function Qb(a){function b(){e.activeTouch&&(f=setTimeout(function(){e.activeTouch=null},1e3),g=e.activeTouch,g.end=+new Date)}function c(a){if(1!=a.touches.length)return!1;var b=a.touches[0];return b.radiusX<=1&&b.radiusY<=1}function d(a,b){if(null==b.left)return!0;var c=b.left-a.left,d=b.top-a.top;return c*c+d*d>400}var e=a.display;Cg(e.scroller,"mousedown",Eb(a,Vb)),sf&&11>tf?Cg(e.scroller,"dblclick",Eb(a,function(b){if(!ze(a,b)){var c=Ub(a,b);if(c&&!$b(a,b)&&!Tb(a.display,b)){zg(b);var d=a.findWordAt(c);ua(a.doc,d.anchor,d.head)}}})):Cg(e.scroller,"dblclick",function(b){ze(a,b)||zg(b)}),Hf||Cg(e.scroller,"contextmenu",function(b){sc(a,b)});var f,g={end:0};Cg(e.scroller,"touchstart",function(b){if(!ze(a,b)&&!c(b)){clearTimeout(f);var d=+new Date;e.activeTouch={start:d,moved:!1,prev:d-g.end<=300?g:null},1==b.touches.length&&(e.activeTouch.left=b.touches[0].pageX,e.activeTouch.top=b.touches[0].pageY)}}),Cg(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),Cg(e.scroller,"touchend",function(c){var f=e.activeTouch;if(f&&!Tb(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new la(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new la(Kf(h.line,0),pa(a.doc,Kf(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),zg(c)}b()}),Cg(e.scroller,"touchcancel",b),Cg(e.scroller,"scroll",function(){e.scroller.clientHeight&&(dc(a,e.scroller.scrollTop),ec(a,e.scroller.scrollLeft,!0),Fg(a,"scroll",a))}),Cg(e.scroller,"mousewheel",function(b){fc(a,b)}),Cg(e.scroller,"DOMMouseScroll",function(b){fc(a,b)}),Cg(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(b){ze(a,b)||Bg(b)},over:function(b){ze(a,b)||(bc(a,b),Bg(b))},start:function(b){ac(a,b)},drop:Eb(a,_b),leave:function(){cc(a)}};var h=e.input.getField();Cg(h,"keyup",function(b){nc.call(a,b)}),Cg(h,"keydown",Eb(a,lc)),Cg(h,"keypress",Eb(a,oc)),Cg(h,"focus",Le(qc,a)),Cg(h,"blur",Le(rc,a))}function Rb(b,c,d){var e=d&&d!=a.Init;if(!c!=!e){var f=b.display.dragFunctions,g=c?Cg:Eg;g(b.display.scroller,"dragstart",f.start),g(b.display.scroller,"dragenter",f.enter),g(b.display.scroller,"dragover",f.over),g(b.display.scroller,"dragleave",f.leave),g(b.display.scroller,"drop",f.drop)}}function Sb(a){var b=a.display;(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)&&(b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize())}function Tb(a,b){for(var c=ue(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Ub(a,b,c,d){var e=a.display;if(!c&&"true"==ue(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(b){return null}var i,j=qb(a,f,g);if(d&&1==j.xRel&&(i=Yd(a.doc,j.line).text).length==j.ch){var k=Mg(i,i.length,a.options.tabSize)-i.length;j=Kf(j.line,Math.max(0,Math.round((f-Ta(a.display).left)/tb(a.display))-k))}return j}function Vb(a){var b=this,c=b.display;if(!(ze(b,a)||c.activeTouch&&c.input.supportsTouch())){if(c.shift=a.shiftKey,Tb(c,a))return void(uf||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!$b(b,a)){var d=Ub(b,a);switch(window.focus(),ve(a)){case 1:b.state.selectingText?b.state.selectingText(a):d?Wb(b,a,d):ue(a)==c.scroller&&zg(a);break;case 2:uf&&(b.state.lastMiddleDown=+new Date),d&&ua(b.doc,d),setTimeout(function(){c.input.focus()},20),zg(a);break;case 3:Hf?sc(b,a):pc(b)}}}}function Wb(a,b,c){sf?setTimeout(Le(Y,a),0):a.curOp.focus=Se();var d,e=+new Date;Pf&&Pf.time>e-400&&0==Lf(Pf.pos,c)?d="triple":Of&&Of.time>e-400&&0==Lf(Of.pos,c)?(d="double",Pf={time:e,pos:c}):(d="single",Of={time:e,pos:c});var f,g=a.doc.sel,h=Df?b.metaKey:b.ctrlKey;a.options.dragDrop&&$g&&!a.isReadOnly()&&"single"==d&&(f=g.contains(c))>-1&&(Lf((f=g.ranges[f]).from(),c)<0||c.xRel>0)&&(Lf(f.to(),c)>0||c.xRel<0)?Xb(a,b,c,h):Yb(a,b,c,d,h)}function Xb(a,b,c,d){var e=a.display,f=+new Date,g=Eb(a,function(h){uf&&(e.scroller.draggable=!1),a.state.draggingText=!1,Eg(document,"mouseup",g),Eg(e.scroller,"drop",g),Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)<10&&(zg(h),!d&&+new Date-200<f&&ua(a.doc,c),uf||sf&&9==tf?setTimeout(function(){document.body.focus(),e.input.focus()},20):e.input.focus())});uf&&(e.scroller.draggable=!0),a.state.draggingText=g,e.scroller.dragDrop&&e.scroller.dragDrop(),Cg(document,"mouseup",g),Cg(e.scroller,"drop",g)}function Yb(a,b,c,d,e){function f(b){if(0!=Lf(q,b))if(q=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=Mg(Yd(j,c.line).text,c.ch,f),h=Mg(Yd(j,b.line).text,b.ch,f),i=Math.min(g,h),n=Math.max(g,h),o=Math.min(c.line,b.line),p=Math.min(a.lastLine(),Math.max(c.line,b.line));p>=o;o++){var r=Yd(j,o).text,s=Ng(r,i,f);i==n?e.push(new la(Kf(o,s),Kf(o,s))):r.length>s&&e.push(new la(Kf(o,s),Kf(o,Ng(r,n,f))))}e.length||e.push(new la(c,c)),Aa(j,ma(m.ranges.slice(0,l).concat(e),l),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=a.findWordAt(b);else var w=new la(Kf(b.line,0),pa(j,Kf(b.line+1,0)));Lf(w.anchor,u)>0?(v=w.head,u=X(t.from(),w.anchor)):(v=w.anchor,u=W(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new la(pa(j,u),v),Aa(j,ma(e,l),Kg)}}function g(b){var c=++s,e=Ub(a,b,!0,"rect"==d);if(e)if(0!=Lf(e,q)){a.curOp.focus=Se(),f(e);var h=u(i,j);(e.line>=h.to||e.line<h.from)&&setTimeout(Eb(a,function(){s==c&&g(b)}),150)}else{var k=b.clientY<r.top?-20:b.clientY>r.bottom?20:0;k&&setTimeout(Eb(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(b){a.state.selectingText=!1,s=1/0,zg(b),i.input.focus(),Eg(document,"mousemove",t),Eg(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;zg(b);var k,l,m=j.sel,n=m.ranges;if(e&&!b.shiftKey?(l=j.sel.contains(c),k=l>-1?n[l]:new la(c,c)):(k=j.sel.primary(),l=j.sel.primIndex),b.altKey)d="rect",e||(k=new la(c,c)),c=Ub(a,b,!0,!0),l=-1;else if("double"==d){var o=a.findWordAt(c);k=a.display.shift||j.extend?ta(j,k,o.anchor,o.head):o}else if("triple"==d){var p=new la(Kf(c.line,0),pa(j,Kf(c.line+1,0)));k=a.display.shift||j.extend?ta(j,k,p.anchor,p.head):p}else k=ta(j,k,c);e?-1==l?(l=n.length,Aa(j,ma(n.concat([k]),l),{scroll:!1,origin:"*mouse"})):n.length>1&&n[l].empty()&&"single"==d&&!b.shiftKey?(Aa(j,ma(n.slice(0,l).concat(n.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),m=j.sel):wa(j,l,k,Kg):(l=0,Aa(j,new ka([k],0),Kg),m=j.sel);var q=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Eb(a,function(a){ve(a)?g(a):h(a)}),v=Eb(a,h);a.state.selectingText=v,Cg(document,"mousemove",t),Cg(document,"mouseup",v)}function Zb(a,b,c,d){try{var e=b.clientX,f=b.clientY}catch(b){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&zg(b);var g=a.display,h=g.lineDiv.getBoundingClientRect();if(f>h.bottom||!Be(a,c))return te(b);f-=h.top-g.viewOffset;for(var i=0;i<a.options.gutters.length;++i){var j=g.gutters.childNodes[i];if(j&&j.getBoundingClientRect().right>=e){var k=be(a.doc,f),l=a.options.gutters[i];return Fg(a,c,a,k,l,b),te(b)}}}function $b(a,b){return Zb(a,b,"gutterClick",!0)}function _b(a){var b=this;if(cc(b),!ze(b,a)&&!Tb(b.display,a)){zg(a),sf&&(Tf=+new Date);var c=Ub(b,a,!0),d=a.dataTransfer.files;if(c&&!b.isReadOnly())if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){if(!b.options.allowDropFileTypes||-1!=Ge(b.options.allowDropFileTypes,a.type)){var h=new FileReader;h.onload=Eb(b,function(){var a=h.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a=""),f[d]=a,++g==e){c=pa(b.doc,c);var i={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"};zc(b.doc,i),za(b.doc,na(c,Zf(i)))}}),h.readAsText(a)}},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(function(){b.display.input.focus()},20);try{var f=a.dataTransfer.getData("Text");if(f){if(b.state.draggingText&&!(Df?a.altKey:a.ctrlKey))var j=b.listSelections();if(Ba(b.doc,na(c,c)),j)for(var i=0;i<j.length;++i)Fc(b.doc,"",j[i].anchor,j[i].head,"drag");b.replaceSelection(f,"around","paste"),b.display.input.focus()}}catch(a){}}}}function ac(a,b){if(sf&&(!a.state.draggingText||+new Date-Tf<100))return void Bg(b);if(!ze(a,b)&&!Tb(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.setDragImage&&!yf)){var c=Pe("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",xf&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop),b.dataTransfer.setDragImage(c,0,0),xf&&c.parentNode.removeChild(c)}}function bc(a,b){var c=Ub(a,b);if(c){var d=document.createDocumentFragment();Ka(a,c,d),a.display.dragCursor||(a.display.dragCursor=Pe("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv)),Re(a.display.dragCursor,d)}}function cc(a){a.display.dragCursor&&(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=null)}function dc(a,b){Math.abs(a.doc.scrollTop-b)<2||(a.doc.scrollTop=b,pf||D(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbars.setScrollTop(b),pf&&D(a),Na(a,100))}function ec(a,b,c){(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,v(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function fc(a,b){var c=Wf(b),d=c.x,e=c.y,f=a.display,g=f.scroller,h=g.scrollWidth>g.clientWidth,i=g.scrollHeight>g.clientHeight;if(d&&h||e&&i){if(e&&Df&&uf)a:for(var j=b.target,k=f.view;j!=g;j=j.parentNode)for(var l=0;l<k.length;l++)if(k[l].node==j){a.display.currentWheelTarget=j;break a}if(d&&!pf&&!xf&&null!=Vf)return e&&i&&dc(a,Math.max(0,Math.min(g.scrollTop+e*Vf,g.scrollHeight-g.clientHeight))),ec(a,Math.max(0,Math.min(g.scrollLeft+d*Vf,g.scrollWidth-g.clientWidth))),(!e||e&&i)&&zg(b),void(f.wheelStartX=null);if(e&&null!=Vf){var m=e*Vf,n=a.doc.scrollTop,o=n+f.wrapper.clientHeight;0>m?n=Math.max(0,n+m-50):o=Math.min(a.doc.height,o+m+50),D(a,{top:n,bottom:o})}20>Uf&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(Vf=(Vf*Uf+c)/(Uf+1),++Uf)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function gc(a,b,c){if("string"==typeof b&&(b=ig[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Ig}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function hc(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=kg(b,a.state.keyMaps[d],c,a);if(e)return e}return a.options.extraKeys&&kg(b,a.options.extraKeys,c,a)||kg(b,a.options.keyMap,c,a)}function ic(a,b,c,d){var e=a.state.keySeq;if(e){if(lg(b))return"handled";Xf.set(50,function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())}),b=e+" "+b}var f=hc(a,b,d);return"multi"==f&&(a.state.keySeq=b),"handled"==f&&xe(a,"keyHandled",a,b,c),("handled"==f||"multi"==f)&&(zg(c),Ma(a)),e&&!f&&/\'$/.test(b)?(zg(c),!0):!!f}function jc(a,b){var c=mg(b,!0);return c?b.shiftKey&&!a.state.keySeq?ic(a,"Shift-"+c,b,function(b){return gc(a,b,!0)})||ic(a,c,b,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?gc(a,b):void 0}):ic(a,c,b,function(b){return gc(a,b)}):!1}function kc(a,b,c){return ic(a,"'"+c+"'",b,function(b){return gc(a,b,!0)})}function lc(a){var b=this;if(b.curOp.focus=Se(),!ze(b,a)){sf&&11>tf&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=jc(b,a);xf&&(Yf=d?c:null,!d&&88==c&&!bh&&(Df?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||mc(b)}}function mc(a){function b(a){18!=a.keyCode&&a.altKey||(Xg(c,"CodeMirror-crosshair"),Eg(document,"keyup",b),Eg(document,"mouseover",b))}var c=a.display.lineDiv;Yg(c,"CodeMirror-crosshair"),Cg(document,"keyup",b),Cg(document,"mouseover",b)}function nc(a){16==a.keyCode&&(this.doc.sel.shift=!1),ze(this,a)}function oc(a){var b=this;if(!(Tb(b.display,a)||ze(b,a)||a.ctrlKey&&!a.altKey||Df&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(xf&&c==Yf)return Yf=null,void zg(a);if(!xf||a.which&&!(a.which<10)||!jc(b,a)){var e=String.fromCharCode(null==d?c:d);kc(b,a,e)||b.display.input.onKeyPress(a)}}}function pc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,rc(a))},100)}function qc(a){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(Fg(a,"focus",a),a.state.focused=!0,Yg(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),uf&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Ma(a))}function rc(a){a.state.delayingBlurEvent||(a.state.focused&&(Fg(a,"blur",a),a.state.focused=!1,Xg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function sc(a,b){Tb(a.display,b)||tc(a,b)||ze(a,b,"contextmenu")||a.display.input.onContextMenu(b)}function tc(a,b){return Be(a,"gutterContextMenu")?Zb(a,b,"gutterContextMenu",!1):!1}function uc(a,b){if(Lf(a,b.from)<0)return a;if(Lf(a,b.to)<=0)return Zf(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=Zf(b).ch-b.to.ch),Kf(c,d)}function vc(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new la(uc(e.anchor,b),uc(e.head,b)))}return ma(c,a.sel.primIndex)}function wc(a,b,c){return a.line==b.line?Kf(c.line,a.ch-b.ch+c.ch):Kf(c.line+(a.line-b.line),a.ch)}function xc(a,b,c){for(var d=[],e=Kf(a.first,0),f=e,g=0;g<b.length;g++){var h=b[g],i=wc(h.from,e,f),j=wc(Zf(h),e,f);if(e=h.to,f=j,"around"==c){var k=a.sel.ranges[g],l=Lf(k.head,k.anchor)<0;d[g]=new la(l?j:i,l?i:j)}else d[g]=new la(i,i)}return new ka(d,a.sel.primIndex)}function yc(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(d.update=function(b,c,d,e){b&&(this.from=pa(a,b)),c&&(this.to=pa(a,c)),d&&(this.text=d),void 0!==e&&(this.origin=e)}),Fg(a,"beforeChange",a,d),a.cm&&Fg(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function zc(a,b,c){if(a.cm){if(!a.cm.curOp)return Eb(a.cm,zc)(a,b,c);if(a.cm.state.suppressEdits)return}if(!(Be(a,"beforeChange")||a.cm&&Be(a.cm,"beforeChange"))||(b=yc(a,b,!0))){var d=If&&!c&&hd(a,b.from,b.to);if(d)for(var e=d.length-1;e>=0;--e)Ac(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else Ac(a,b)}}function Ac(a,b){if(1!=b.text.length||""!=b.text[0]||0!=Lf(b.from,b.to)){var c=vc(a,b);ie(a,b,c,a.cm?a.cm.curOp.id:NaN),Dc(a,b,c,ed(a,b));var d=[];Wd(a,function(a,c){c||-1!=Ge(d,a.history)||(se(a.history,b),d.push(a.history)),Dc(a,b,null,ed(a,b))})}}function Bc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i<g.length&&(d=g[i],c?!d.ranges||d.equals(a.sel):d.ranges);i++);if(i!=g.length){for(e.lastOrigin=e.lastSelOrigin=null;d=g.pop(),d.ranges;){if(le(d,h),c&&!d.equals(a.sel))return void Aa(a,d,{clearRedo:!1});f=d}var j=[];le(f,h),h.push({changes:j,generation:e.generation}),e.generation=d.generation||++e.maxGeneration;for(var k=Be(a,"beforeChange")||a.cm&&Be(a.cm,"beforeChange"),i=d.changes.length-1;i>=0;--i){var l=d.changes[i];if(l.origin=b,k&&!yc(a,l,!1))return void(g.length=0);j.push(fe(a,l));var m=i?vc(a,l):Fe(g);Dc(a,l,m,gd(a,l)),!i&&a.cm&&a.cm.scrollIntoView({from:l.from,to:Zf(l)});var n=[];Wd(a,function(a,b){b||-1!=Ge(n,a.history)||(se(a.history,l),n.push(a.history)),Dc(a,l,null,gd(a,l))})}}}}function Cc(a,b){if(0!=b&&(a.first+=b,a.sel=new ka(He(a.sel.ranges,function(a){return new la(Kf(a.anchor.line+b,a.anchor.ch),Kf(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Jb(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)Kb(a.cm,d,"gutter")}}function Dc(a,b,c,d){if(a.cm&&!a.cm.curOp)return Eb(a.cm,Dc)(a,b,c,d);if(b.to.line<a.first)return void Cc(a,b.text.length-1-(b.to.line-b.from.line));if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);Cc(a,e),b={from:Kf(a.first,0),to:Kf(b.to.line+e,b.to.ch),text:[Fe(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:Kf(f,Yd(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=Zd(a,b.from,b.to),c||(c=vc(a,b)),a.cm?Ec(a.cm,b,d):Td(a,b,d),Ba(a,c,Jg)}}function Ec(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=ae(rd(Yd(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&Ae(a),Td(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),Na(a,400);var k=b.text.length-(h.line-g.line)-1;b.full?Jb(a):g.line!=h.line||1!=b.text.length||Sd(a.doc,b)?Jb(a,g.line,h.line+1,k):Kb(a,g.line,"text");var m=Be(a,"changes"),n=Be(a,"change");if(n||m){var o={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};n&&xe(a,"change",a,o),m&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(o)}a.display.selForContextMenu=null}function Fc(a,b,c,d,e){if(d||(d=c),Lf(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=a.splitLines(b)),zc(a,{from:c,to:d,text:b,origin:e})}function Gc(a,b){if(!ze(a,"scrollCursorIntoView")){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!Af){var f=Pe("div","",null,"position: absolute; top: "+(b.top-c.viewOffset-Ra(a.display))+"px; height: "+(b.bottom-b.top+Ua(a)+c.barHeight)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}}function Hc(a,b,c,d){null==d&&(d=0);for(var e=0;5>e;e++){var f=!1,g=nb(a,b),h=c&&c!=b?nb(a,c):g,i=Jc(a,Math.min(g.left,h.left),Math.min(g.top,h.top)-d,Math.max(g.left,h.left),Math.max(g.bottom,h.bottom)+d),j=a.doc.scrollTop,k=a.doc.scrollLeft;if(null!=i.scrollTop&&(dc(a,i.scrollTop),Math.abs(a.doc.scrollTop-j)>1&&(f=!0)),null!=i.scrollLeft&&(ec(a,i.scrollLeft),Math.abs(a.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return g}function Ic(a,b,c,d,e){var f=Jc(a,b,c,d,e);null!=f.scrollTop&&dc(a,f.scrollTop),null!=f.scrollLeft&&ec(a,f.scrollLeft)}function Jc(a,b,c,d,e){var f=a.display,g=sb(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=Wa(a),j={};e-c>i&&(e=c+i);var k=a.doc.height+Sa(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=Va(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0),q=d-b>p;return q&&(d=b+p),10>b?j.scrollLeft=0:o>b?j.scrollLeft=Math.max(0,b-(q?0:10)):d>p+o-3&&(j.scrollLeft=d+(q?0:10)-p),j}function Kc(a,b,c){(null!=b||null!=c)&&Mc(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Lc(a){Mc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Kf(b.line,b.ch-1):b,d=Kf(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Mc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=ob(a,b.from),d=ob(a,b.to),e=Jc(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);
|
3 |
-
a.scrollTo(e.scrollLeft,e.scrollTop)}}function Nc(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Qa(a,b):c="prev");var g=a.options.tabSize,h=Yd(f,b),i=Mg(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text),j==Ig||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Mg(Yd(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=Ee(j-m)),l!=k)return Fc(f,l,Kf(b,0),Kf(b,k.length),"+input"),h.stateAfter=null,!0;for(var n=0;n<f.sel.ranges.length;n++){var o=f.sel.ranges[n];if(o.head.line==b&&o.head.ch<k.length){var m=Kf(b,k.length);wa(f,n,new la(m,m));break}}}function Oc(a,b,c,d){var e=b,f=b;return"number"==typeof b?f=Yd(a,oa(a,b)):e=ae(b),null==e?null:(d(f,e)&&a.cm&&Kb(a.cm,e,c),f)}function Pc(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&Lf(f.from,Fe(d).to)<=0;){var g=d.pop();if(Lf(g.from,f.from)<0){f.from=g.from;break}}d.push(f)}Db(a,function(){for(var b=d.length-1;b>=0;b--)Fc(a.doc,"",d[b].from,d[b].to,"+delete");Lc(a)})}function Qc(a,b,c,d,e){function f(){var b=h+c;return b<a.first||b>=a.first+a.size?!1:(h=b,k=Yd(a,b))}function g(a){var b=(e?lf:mf)(k,i,c,!0);if(null==b){if(a||!f())return!1;i=e?(0>c?df:cf)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=Yd(a,h);if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var l=null,m="group"==d,n=a.cm&&a.cm.getHelper(b,"wordChars"),o=!0;!(0>c)||g(!o);o=!1){var p=k.text.charAt(i)||"\n",q=Me(p,n)?"w":m&&"\n"==p?"n":!m||/\s/.test(p)?null:"p";if(!m||o||q||(q="s"),l&&l!=q){0>c&&(c=1,g());break}if(q&&(l=q),c>0&&!g(!o))break}var r=Ga(a,Kf(h,i),b,j,!0);return Lf(b,r)||(r.hitSide=!0),r}function Rc(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);e=b.top+c*(h-(0>c?1.5:.5)*sb(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=qb(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function Sc(b,c,d,e){a.defaults[b]=c,d&&(_f[b]=e?function(a,b,c){c!=ag&&d(a,b,c)}:d)}function Tc(a){for(var b,c,d,e,f=a.split(/-(?!$)/),a=f[f.length-1],g=0;g<f.length-1;g++){var h=f[g];if(/^(cmd|meta|m)$/i.test(h))e=!0;else if(/^a(lt)?$/i.test(h))b=!0;else if(/^(c|ctrl|control)$/i.test(h))c=!0;else{if(!/^s(hift)$/i.test(h))throw new Error("Unrecognized modifier name: "+h);d=!0}}return b&&(a="Alt-"+a),c&&(a="Ctrl-"+a),e&&(a="Cmd-"+a),d&&(a="Shift-"+a),a}function Uc(a){return"string"==typeof a?jg[a]:a}function Vc(a,b,c,d,e){if(d&&d.shared)return Wc(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return Eb(a.cm,Vc)(a,b,c,d,e);var f=new pg(a,e),g=Lf(b,c);if(d&&Ke(d,f,!1),g>0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Pe("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(qd(a,b.line,b,c,f)||b.line!=c.line&&qd(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");Jf=!0}f.addToHistory&&ie(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&rd(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&_d(a,0),bd(a,new $c(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){vd(a,b)&&_d(b,0)}),f.clearOnEnter&&Cg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(If=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++og,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)Jb(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(var k=b.line;k<=c.line;k++)Kb(j,k,"text");f.atomic&&Da(j.doc),xe(j,"markerAdded",j,f)}return f}function Wc(a,b,c,d,e){d=Ke(d),d.shared=!1;var f=[Vc(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Wd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Vc(a,pa(a,b),pa(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=Fe(f)}),new qg(f,g)}function Xc(a){return a.findMarks(Kf(a.first,0),a.clipPos(Kf(a.lastLine())),function(a){return a.parent})}function Yc(a,b){for(var c=0;c<b.length;c++){var d=b[c],e=d.find(),f=a.clipPos(e.from),g=a.clipPos(e.to);if(Lf(f,g)){var h=Vc(a,f,g,d.primary,d.primary.type);d.markers.push(h),h.parent=d}}}function Zc(a){for(var b=0;b<a.length;b++){var c=a[b],d=[c.primary.doc];Wd(c.primary.doc,function(a){d.push(a)});for(var e=0;e<c.markers.length;e++){var f=c.markers[e];-1==Ge(d,f.doc)&&(f.parent=null,c.markers.splice(e--,1))}}}function $c(a,b,c){this.marker=a,this.from=b,this.to=c}function _c(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function ad(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function bd(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function cd(a,b,c){if(a)for(var d,e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||f.from==b&&"bookmark"==g.type&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(d||(d=[])).push(new $c(g,f.from,i?null:f.to))}}return d}function dd(a,b,c){if(a)for(var d,e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(d||(d=[])).push(new $c(g,i?null:f.from-b,null==f.to?null:f.to-b))}}return d}function ed(a,b){if(b.full)return null;var c=ra(a,b.from.line)&&Yd(a,b.from.line).markedSpans,d=ra(a,b.to.line)&&Yd(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==Lf(b.from,b.to),h=cd(c,e,g),i=dd(d,f,g),j=1==b.text.length,k=Fe(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=_c(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var l=0;l<i.length;++l){var m=i[l];if(null!=m.to&&(m.to+=k),null==m.from){var n=_c(h,m.marker);n||(m.from=k,j&&(h||(h=[])).push(m))}else m.from+=k,j&&(h||(h=[])).push(m)}h&&(h=fd(h)),i&&i!=h&&(i=fd(i));var o=[h];if(!j){var p,q=b.text.length-2;if(q>0&&h)for(var l=0;l<h.length;++l)null==h[l].to&&(p||(p=[])).push(new $c(h[l].marker,null,null));for(var l=0;q>l;++l)o.push(p);o.push(i)}return o}function fd(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&a.splice(b--,1)}return a.length?a:null}function gd(a,b){var c=oe(a,b),d=ed(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function hd(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=Ge(d,c)||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(0),i=0;i<e.length;++i){var j=e[i];if(!(Lf(j.to,h.from)<0||Lf(j.from,h.to)>0)){var k=[i,1],l=Lf(j.from,h.from),m=Lf(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function id(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function jd(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function kd(a){return a.inclusiveLeft?-1:0}function ld(a){return a.inclusiveRight?1:0}function md(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var d=a.find(),e=b.find(),f=Lf(d.from,e.from)||kd(a)-kd(b);if(f)return-f;var g=Lf(d.to,e.to)||ld(a)-ld(b);return g?g:b.id-a.id}function nd(a,b){var c,d=Jf&&a.markedSpans;if(d)for(var e,f=0;f<d.length;++f)e=d[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!c||md(c,e.marker)<0)&&(c=e.marker);return c}function od(a){return nd(a,!0)}function pd(a){return nd(a,!1)}function qd(a,b,c,d,e){var f=Yd(a,b),g=Jf&&f.markedSpans;if(g)for(var h=0;h<g.length;++h){var i=g[h];if(i.marker.collapsed){var j=i.marker.find(0),k=Lf(j.from,c)||kd(i.marker)-kd(e),l=Lf(j.to,d)||ld(i.marker)-ld(e);if(!(k>=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(Lf(j.to,c)>0||i.marker.inclusiveRight&&e.inclusiveLeft)||k>=0&&(Lf(j.from,d)<0||i.marker.inclusiveLeft&&e.inclusiveRight)))return!0}}}function rd(a){for(var b;b=od(a);)a=b.find(-1,!0).line;return a}function sd(a){for(var b,c;b=pd(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function td(a,b){var c=Yd(a,b),d=rd(c);return c==d?b:ae(d)}function ud(a,b){if(b>a.lastLine())return b;var c,d=Yd(a,b);if(!vd(a,d))return b;for(;c=pd(d);)d=c.find(1,!0).line;return ae(d)+1}function vd(a,b){var c=Jf&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&wd(a,b,d))return!0}}function wd(a,b,c){if(null==c.to){var d=c.marker.find(1,!0);return wd(a,d.line,_c(d.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var e,f=0;f<b.markedSpans.length;++f)if(e=b.markedSpans[f],e.marker.collapsed&&!e.marker.widgetNode&&e.from==c.to&&(null==e.to||e.to!=c.from)&&(e.marker.inclusiveLeft||c.marker.inclusiveRight)&&wd(a,b,e))return!0}function xd(a,b,c){ce(b)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Kc(a,null,c)}function yd(a){if(null!=a.height)return a.height;var b=a.doc.cm;if(!b)return 0;if(!Ug(document.body,a.node)){var c="position: relative;";a.coverGutter&&(c+="margin-left: -"+b.display.gutters.offsetWidth+"px;"),a.noHScroll&&(c+="width: "+b.display.wrapper.clientWidth+"px;"),Re(b.display.measure,Pe("div",[a.node],null,c))}return a.height=a.node.parentNode.offsetHeight}function zd(a,b,c,d){var e=new rg(a,c,d),f=a.cm;return f&&e.noHScroll&&(f.display.alignWidgets=!0),Oc(a,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,f&&!vd(a,b)){var d=ce(b)<a.scrollTop;_d(b,b.height+yd(e)),d&&Kc(f,null,e.height),f.curOp.forceUpdate=!0}return!0}),e}function Ad(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),id(a),jd(a,c);var e=d?d(a):1;e!=a.height&&_d(a,e)}function Bd(a){a.parent=null,id(a)}function Cd(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return a}function Dd(b,c){if(b.blankLine)return b.blankLine(c);if(b.innerMode){var d=a.innerMode(b,c);return d.mode.blankLine?d.mode.blankLine(d.state):void 0}}function Ed(b,c,d,e){for(var f=0;10>f;f++){e&&(e[0]=a.innerMode(b,d).mode);var g=b.token(c,d);if(c.pos>c.start)return g}throw new Error("Mode "+b.name+" failed to advance stream.")}function Fd(a,b,c,d){function e(a){return{start:l.start,end:l.pos,string:l.current(),type:f||null,state:a?gg(g.mode,k):k}}var f,g=a.doc,h=g.mode;b=pa(g,b);var i,j=Yd(g,b.line),k=Qa(a,b.line,c),l=new ng(j.text,a.options.tabSize);for(d&&(i=[]);(d||l.pos<b.ch)&&!l.eol();)l.start=l.pos,f=Ed(h,l,k),d&&i.push(e(!0));return d?i:e()}function Gd(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var i,j=0,k=null,l=new ng(b,a.options.tabSize),m=a.options.addModeClass&&[null];for(""==b&&Cd(Dd(c,d),f);!l.eol();){if(l.pos>a.options.maxHighlightLength?(h=!1,g&&Jd(a,b,d,l.pos),l.pos=b.length,i=null):i=Cd(Ed(c,l,d,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;j<l.start;)j=Math.min(l.start,j+5e4),e(j,k);k=i}l.start=l.pos}for(;j<l.pos;){var o=Math.min(l.pos,j+5e4);e(o,k),j=o}}function Hd(a,b,c,d){var e=[a.state.modeGen],f={};Gd(a,b.text,a.doc.mode,c,function(a,b){e.push(a,b)},f,d);for(var g=0;g<a.state.overlays.length;++g){var h=a.state.overlays[g],i=1,j=0;Gd(a,b.text,h.mode,!0,function(a,b){for(var c=i;a>j;){var d=e[i];d>a&&e.splice(i,1,a,e[i+1],d),i+=2,j=Math.min(a,d)}if(b)if(h.opaque)e.splice(c,i-c,a,"cm-overlay "+b),i=c+2;else for(;i>c;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"cm-overlay "+b}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Id(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Qa(a,ae(b)),e=Hd(a,b,b.text.length>a.options.maxHighlightLength?gg(a.doc.mode,d):d);b.stateAfter=d,b.styles=e.styles,e.classes?b.styleClasses=e.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.frontier&&a.doc.frontier++}return b.styles}function Jd(a,b,c,d){var e=a.doc.mode,f=new ng(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&Dd(e,c);!f.eol();)Ed(e,f,c),f.start=f.pos}function Kd(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?ug:tg;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Ld(a,b){var c=Pe("span",null,null,uf?"padding-right: .1px":null),d={pre:Pe("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,splitSpaces:(sf||uf)&&a.getOption("lineWrapping")};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Nd,Ze(a.display.measure)&&(f=de(g))&&(d.addToken=Pd(d.addToken,f)),d.map=[];var h=b!=a.display.externalMeasured&&ae(g);Rd(g,d,Id(a,g,h)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=Ue(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=Ue(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Ye(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return uf&&/\bcm-tab\b/.test(d.content.lastChild.className)&&(d.content.className="cm-tab-wrap-hack"),Fg(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=Ue(d.pre.className,d.textClass||"")),d}function Md(a){var b=Pe("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function Nd(a,b,c,d,e,f,g){if(b){var h=a.splitSpaces?b.replace(/ {3,}/g,Od):b,i=a.cm.state.specialChars,j=!1;if(i.test(b))for(var k=document.createDocumentFragment(),l=0;;){i.lastIndex=l;var m=i.exec(b),n=m?m.index-l:b.length-l;if(n){var o=document.createTextNode(h.slice(l,l+n));sf&&9>tf?k.appendChild(Pe("span",[o])):k.appendChild(o),a.map.push(a.pos,a.pos+n,o),a.col+=n,a.pos+=n}if(!m)break;if(l+=n+1," "==m[0]){var p=a.cm.options.tabSize,q=p-a.col%p,o=k.appendChild(Pe("span",Ee(q),"cm-tab"));o.setAttribute("role","presentation"),o.setAttribute("cm-text"," "),a.col+=q}else if("\r"==m[0]||"\n"==m[0]){var o=k.appendChild(Pe("span","\r"==m[0]?"␍":"","cm-invalidchar"));o.setAttribute("cm-text",m[0]),a.col+=1}else{var o=a.cm.options.specialCharPlaceholder(m[0]);o.setAttribute("cm-text",m[0]),sf&&9>tf?k.appendChild(Pe("span",[o])):k.appendChild(o),a.col+=1}a.map.push(a.pos,a.pos+1,o),a.pos++}else{a.col+=b.length;var k=document.createTextNode(h);a.map.push(a.pos,a.pos+b.length,k),sf&&9>tf&&(j=!0),a.pos+=b.length}if(c||d||e||j||g){var r=c||"";d&&(r+=d),e&&(r+=e);var s=Pe("span",[k],r,g);return f&&(s.title=f),a.content.appendChild(s)}a.content.appendChild(k)}}function Od(a){for(var b=" ",c=0;c<a.length-2;++c)b+=c%2?" ":" ";return b+=" "}function Pd(a,b){return function(c,d,e,f,g,h,i){e=e?e+" cm-force-border":"cm-force-border";for(var j=c.pos,k=j+d.length;;){for(var l=0;l<b.length;l++){var m=b[l];if(m.to>j&&m.from<=j)break}if(m.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,m.to-j),e,f,null,h,i),f=null,d=d.slice(m.to-j),j=m.to}}}function Qd(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e),!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id)),e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e)),a.pos+=b}function Rd(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m,n=e.length,o=0,p=1,q="",r=0;;){if(r==o){i=j=k=l=h="",m=null,r=1/0;for(var s,t=[],u=0;u<d.length;++u){var v=d[u],w=v.marker;"bookmark"==w.type&&v.from==o&&w.widgetNode?t.push(w):v.from<=o&&(null==v.to||v.to>o||w.collapsed&&v.to==o&&v.from==o)?(null!=v.to&&v.to!=o&&r>v.to&&(r=v.to,j=""),w.className&&(i+=" "+w.className),w.css&&(h=(h?h+";":"")+w.css),w.startStyle&&v.from==o&&(k+=" "+w.startStyle),w.endStyle&&v.to==r&&(s||(s=[])).push(w.endStyle,v.to),w.title&&!l&&(l=w.title),w.collapsed&&(!m||md(m.marker,w)<0)&&(m=v)):v.from>o&&r>v.from&&(r=v.from)}if(s)for(var u=0;u<s.length;u+=2)s[u+1]==r&&(j+=" "+s[u]);if(!m||m.from==o)for(var u=0;u<t.length;++u)Qd(b,0,t[u]);if(m&&(m.from||0)==o){if(Qd(b,(null==m.to?n+1:m.to)-o,m.marker,null==m.from),null==m.to)return;m.to==o&&(m=!1)}}if(o>=n)break;for(var x=Math.min(n,r);;){if(q){var y=o+q.length;if(!m){var z=y>x?q.slice(0,x-o):q;b.addToken(b,z,g?g+i:i,k,o+z.length==r?j:"",l,h)}if(y>=x){q=q.slice(x-o),o=x;break}o=y,k=""}q=e.slice(f,f=c[p++]),g=Kd(c[p++],b.cm.options)}}else for(var p=1;p<c.length;p+=2)b.addToken(b,e.slice(f,f=c[p]),Kd(c[p+1],b.cm.options))}function Sd(a,b){return 0==b.from.ch&&0==b.to.ch&&""==Fe(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function Td(a,b,c,d){function e(a){return c?c[a]:null}function f(a,c,e){Ad(a,c,e,d),xe(a,"change",a,b)}function g(a,b){for(var c=a,f=[];b>c;++c)f.push(new sg(j[c],e(c),d));return f}var h=b.from,i=b.to,j=b.text,k=Yd(a,h.line),l=Yd(a,i.line),m=Fe(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Sd(a,b)){var p=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),p.length&&a.insert(h.line,p)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var p=g(1,j.length-1);p.push(new sg(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,p)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var p=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,p)}xe(a,"change",a,b)}function Ud(a){this.lines=a,this.parent=null;for(var b=0,c=0;b<a.length;++b)a[b].parent=this,c+=a[b].height;this.height=c}function Vd(a){this.children=a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d];b+=e.chunkSize(),c+=e.height,e.parent=this}this.size=b,this.height=c,this.parent=null}function Wd(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;(!c||i)&&(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function Xd(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,g(a),c(a),a.options.lineWrapping||m(a),a.options.mode=b.modeOption,Jb(a)}function Yd(a,b){if(b-=a.first,0>b||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function Zd(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function $d(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function _d(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function ae(a){if(null==a.parent)return null;for(var b=a.parent,c=Ge(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function be(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(f>b){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;d<a.lines.length;++d){var g=a.lines[d],h=g.height;if(h>b)break;b-=h}return c+d}function ce(a){a=rd(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;b+=e.height}for(var f=c.parent;f;c=f,f=c.parent)for(var d=0;d<f.children.length;++d){var g=f.children[d];if(g==c)break;b+=g.height}return b}function de(a){var b=a.order;return null==b&&(b=a.order=fh(a.text)),b}function ee(a){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=a||1}function fe(a,b){var c={from:V(b.from),to:Zf(b),text:Zd(a,b.from,b.to)};return me(a,c,b.from.line,b.to.line+1),Wd(a,function(a){me(a,c,b.from.line,b.to.line+1)},!0),c}function ge(a){for(;a.length;){var b=Fe(a);if(!b.ranges)break;a.pop()}}function he(a,b){return b?(ge(a.done),Fe(a.done)):a.done.length&&!Fe(a.done).ranges?Fe(a.done):a.done.length>1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Fe(a.done)):void 0}function ie(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=he(e,e.lastOp==d))){var h=Fe(f.changes);0==Lf(b.from,b.to)&&0==Lf(b.from,h.to)?h.to=Zf(b):f.changes.push(fe(a,b))}else{var i=Fe(e.done);for(i&&i.ranges||le(a.sel,e.done),f={changes:[fe(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=g,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||Fg(a,"historyAdded")}function je(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function ke(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||je(a,f,Fe(e.done),b))?e.done[e.done.length-1]=b:le(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&ge(e.undone)}function le(a,b){var c=Fe(b);c&&c.ranges&&c.equals(a)||b.push(a)}function me(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function ne(a){if(!a)return null;for(var b,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return b?b.length?b:null:a}function oe(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=0,e=[];d<b.text.length;++d)e.push(ne(c[d]));return e}function pe(a,b,c){for(var d=0,e=[];d<a.length;++d){var f=a[d];if(f.ranges)e.push(c?ka.prototype.deepCopy.call(f):f);else{var g=f.changes,h=[];e.push({changes:h});for(var i=0;i<g.length;++i){var j,k=g[i];if(h.push({from:k.from,to:k.to,text:k.text}),b)for(var l in k)(j=l.match(/^spans_(\d+)$/))&&Ge(b,Number(j[1]))>-1&&(Fe(h)[l]=k[l],delete k[l])}}}return e}function qe(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function re(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<f.ranges.length;h++)qe(f.ranges[h].anchor,b,c,d),qe(f.ranges[h].head,b,c,d)}else{for(var h=0;h<f.changes.length;++h){var i=f.changes[h];if(c<i.from.line)i.from=Kf(i.from.line+d,i.from.ch),i.to=Kf(i.to.line+d,i.to.ch);else if(b<=i.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function se(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;re(a.done,c,d,e),re(a.undone,c,d,e)}function te(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function ue(a){return a.target||a.srcElement}function ve(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),Df&&a.ctrlKey&&1==b&&(b=3),b}function we(a,b,c){var d=a._handlers&&a._handlers[b];return c?d&&d.length>0?d.slice():Dg:d||Dg}function xe(a,b){function c(a){return function(){a.apply(null,f)}}var d=we(a,b,!1);if(d.length){var e,f=Array.prototype.slice.call(arguments,2);Rf?e=Rf.delayedCallbacks:Gg?e=Gg:(e=Gg=[],setTimeout(ye,0));for(var g=0;g<d.length;++g)e.push(c(d[g]))}}function ye(){var a=Gg;Gg=null;for(var b=0;b<a.length;++b)a[b]()}function ze(a,b,c){return"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}}),Fg(a,c||b.type,a,b),te(b)||b.codemirrorIgnore}function Ae(a){var b=a._handlers&&a._handlers.cursorActivity;if(b)for(var c=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]),d=0;d<b.length;++d)-1==Ge(c,b[d])&&c.push(b[d])}function Be(a,b){return we(a,b).length>0}function Ce(a){a.prototype.on=function(a,b){Cg(this,a,b)},a.prototype.off=function(a,b){Eg(this,a,b)}}function De(){this.id=null}function Ee(a){for(;Og.length<=a;)Og.push(Fe(Og)+" ");return Og[a]}function Fe(a){return a[a.length-1]}function Ge(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function He(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function Ie(){}function Je(a,b){var c;return Object.create?c=Object.create(a):(Ie.prototype=a,c=new Ie),b&&Ke(b,c),c}function Ke(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||c===!1&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function Le(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function Me(a,b){return b?b.source.indexOf("\\w")>-1&&Sg(a)?!0:b.test(a):Sg(a)}function Ne(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Oe(a){return a.charCodeAt(0)>=768&&Tg.test(a)}function Pe(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function Qe(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function Re(a,b){return Qe(a).appendChild(b)}function Se(){for(var a=document.activeElement;a&&a.root&&a.root.activeElement;)a=a.root.activeElement;return a}function Te(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function Ue(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!Te(c[d]).test(b)&&(b+=" "+c[d]);return b}function Ve(a){if(document.body.getElementsByClassName)for(var b=document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function We(){Zg||(Xe(),Zg=!0)}function Xe(){var a;Cg(window,"resize",function(){null==a&&(a=setTimeout(function(){a=null,Ve(Sb)},100))}),Cg(window,"blur",function(){Ve(rc)})}function Ye(a){if(null==Vg){var b=Pe("span","");Re(a,Pe("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Vg=b.offsetWidth<=1&&b.offsetHeight>2&&!(sf&&8>tf))}var c=Vg?Pe("span",""):Pe("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}function Ze(a){if(null!=Wg)return Wg;var b=Re(a,document.createTextNode("AخA")),c=Qg(b,0,1).getBoundingClientRect();if(!c||c.left==c.right)return!1;var d=Qg(b,1,2).getBoundingClientRect();return Wg=d.right-c.right<3}function $e(a){if(null!=ch)return ch;var b=Re(a,Pe("span","x")),c=b.getBoundingClientRect(),d=Qg(b,0,1).getBoundingClientRect();return ch=Math.abs(c.left-d.left)>1}function _e(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function af(a){return a.level%2?a.to:a.from}function bf(a){return a.level%2?a.from:a.to}function cf(a){var b=de(a);return b?af(b[0]):0}function df(a){var b=de(a);return b?bf(Fe(b)):a.text.length}function ef(a,b){var c=Yd(a.doc,b),d=rd(c);d!=c&&(b=ae(d));var e=de(d),f=e?e[0].level%2?df(d):cf(d):0;return Kf(b,f)}function ff(a,b){for(var c,d=Yd(a.doc,b);c=pd(d);)d=c.find(1,!0).line,b=null;var e=de(d),f=e?e[0].level%2?cf(d):df(d):d.text.length;return Kf(null==b?ae(d):b,f)}function gf(a,b){var c=ef(a,b.line),d=Yd(a.doc,c.line),e=de(d);if(!e||0==e[0].level){var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;return Kf(c.line,g?0:f)}return c}function hf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function jf(a,b){eh=null;for(var c,d=0;d<a.length;++d){var e=a[d];if(e.from<b&&e.to>b)return d;if(e.from==b||e.to==b){if(null!=c)return hf(a,e.level,a[c].level)?(e.from!=e.to&&(eh=c),d):(e.from!=e.to&&(eh=d),c);c=d}}return c}function kf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Oe(a.text.charAt(b)));return b}function lf(a,b,c,d){var e=de(a);if(!e)return mf(a,b,c,d);for(var f=jf(e,b),g=e[f],h=kf(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h<g.to)return h;if(h==g.from||h==g.to)return jf(e,h)==f?h:(g=e[f+=c],c>0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?kf(a,g.to,-1,d):kf(a,g.from,1,d)}}function mf(a,b,c,d){var e=b+c;if(d)for(;e>0&&Oe(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var nf=navigator.userAgent,of=navigator.platform,pf=/gecko\/\d/i.test(nf),qf=/MSIE \d/.test(nf),rf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nf),sf=qf||rf,tf=sf&&(qf?document.documentMode||6:rf[1]),uf=/WebKit\//.test(nf),vf=uf&&/Qt\/\d+\.\d+/.test(nf),wf=/Chrome\//.test(nf),xf=/Opera\//.test(nf),yf=/Apple Computer/.test(navigator.vendor),zf=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(nf),Af=/PhantomJS/.test(nf),Bf=/AppleWebKit/.test(nf)&&/Mobile\/\w+/.test(nf),Cf=Bf||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(nf),Df=Bf||/Mac/.test(of),Ef=/win/i.test(of),Ff=xf&&nf.match(/Version\/(\d*\.\d*)/);Ff&&(Ff=Number(Ff[1])),Ff&&Ff>=15&&(xf=!1,uf=!0);var Gf=Df&&(vf||xf&&(null==Ff||12.11>Ff)),Hf=pf||sf&&tf>=9,If=!1,Jf=!1;p.prototype=Ke({update:function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=a.scrollWidth-a.clientWidth+f+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?d:0,bottom:b?d:0}},setScrollLeft:function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var a=Df&&!zf?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new De,this.disableVert=new De},enableZeroWidthBar:function(a,b){function c(){var d=a.getBoundingClientRect(),e=document.elementFromPoint(d.left+1,d.bottom-1);e!=a?a.style.pointerEvents="none":b.set(1e3,c)}a.style.pointerEvents="auto",b.set(1e3,c)},clear:function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)}},p.prototype),q.prototype=Ke({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},q.prototype),a.scrollbarModel={"native":p,"null":q},z.prototype.signal=function(a,b){Be(a,b)&&this.events.push(arguments)},z.prototype.finish=function(){for(var a=0;a<this.events.length;a++)Fg.apply(null,this.events[a])};var Kf=a.Pos=function(a,b){return this instanceof Kf?(this.line=a,void(this.ch=b)):new Kf(a,b)},Lf=a.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch},Mf=null;ca.prototype=Ke({init:function(a){function b(a){
|
4 |
-
if(!ze(d,a)){if(d.somethingSelected())Mf=d.getSelections(),c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,f.value=Mf.join("\n"),Pg(f));else{if(!d.options.lineWiseCopyCut)return;var b=aa(d);Mf=b.text,"cut"==a.type?d.setSelections(b.ranges,null,Jg):(c.prevInput="",f.value=b.text.join("\n"),Pg(f))}"cut"==a.type&&(d.state.cutIncoming=!0)}}var c=this,d=this.cm,e=this.wrapper=da(),f=this.textarea=e.firstChild;a.wrapper.insertBefore(e,a.wrapper.firstChild),Bf&&(f.style.width="0px"),Cg(f,"input",function(){sf&&tf>=9&&c.hasSelection&&(c.hasSelection=null),c.poll()}),Cg(f,"paste",function(a){ze(d,a)||$(a,d)||(d.state.pasteIncoming=!0,c.fastPoll())}),Cg(f,"cut",b),Cg(f,"copy",b),Cg(a.scroller,"paste",function(b){Tb(a,b)||ze(d,b)||(d.state.pasteIncoming=!0,c.focus())}),Cg(a.lineSpace,"selectstart",function(b){Tb(a,b)||zg(b)}),Cg(f,"compositionstart",function(){var a=d.getCursor("from");c.composing&&c.composing.range.clear(),c.composing={start:a,range:d.markText(a,d.getCursor("to"),{className:"CodeMirror-composing"})}}),Cg(f,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},prepareSelection:function(){var a=this.cm,b=a.display,c=a.doc,d=Ja(a);if(a.options.moveInputWithCursor){var e=nb(a,c.sel.primary().head,"div"),f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,e.top+g.top-f.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,e.left+g.left-f.left))}return d},showSelection:function(a){var b=this.cm,c=b.display;Re(c.cursorDiv,a.cursors),Re(c.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},reset:function(a){if(!this.contextMenuPending){var b,c,d=this.cm,e=d.doc;if(d.somethingSelected()){this.prevInput="";var f=e.sel.primary();b=bh&&(f.to().line-f.from().line>100||(c=d.getSelection()).length>1e3);var g=b?"-":c||d.getSelection();this.textarea.value=g,d.state.focused&&Pg(this.textarea),sf&&tf>=9&&(this.hasSelection=g)}else a||(this.prevInput=this.textarea.value="",sf&&tf>=9&&(this.hasSelection=null));this.inaccurateSelection=b}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Cf||Se()!=this.textarea))try{this.textarea.focus()}catch(a){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var a=this;a.pollingFast||a.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},fastPoll:function(){function a(){var d=c.poll();d||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0,c.polling.set(20,a)},poll:function(){var a=this.cm,b=this.textarea,c=this.prevInput;if(this.contextMenuPending||!a.state.focused||ah(b)&&!c&&!this.composing||a.isReadOnly()||a.options.disableInput||a.state.keySeq)return!1;var d=b.value;if(d==c&&!a.somethingSelected())return!1;if(sf&&tf>=9&&this.hasSelection===d||Df&&/[\uf700-\uf7ff]/.test(d))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var e=d.charCodeAt(0);if(8203!=e||c||(c=""),8666==e)return this.reset(),this.cm.execCommand("undo")}for(var f=0,g=Math.min(c.length,d.length);g>f&&c.charCodeAt(f)==d.charCodeAt(f);)++f;var h=this;return Db(a,function(){Z(a,d.slice(f),c.length-f,null,h.composing?"*compose":null),d.length>1e3||d.indexOf("\n")>-1?b.value=h.prevInput="":h.prevInput=d,h.composing&&(h.composing.range.clear(),h.composing.range=a.markText(h.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){sf&&tf>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b=""+(a?g.value:"");g.value="⇚",g.value=b,d.prevInput=a?"":"",g.selectionStart=1,g.selectionEnd=b.length,f.selForContextMenu=e.doc.sel}}function c(){if(d.contextMenuPending=!1,d.wrapper.style.position="relative",g.style.cssText=k,sf&&9>tf&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!sf||sf&&9>tf)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&""==d.prevInput?Eb(e,ig.selectAll)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):f.input.reset()};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Ub(e,a),i=f.scroller.scrollTop;if(h&&!xf){var j=e.options.resetSelectionOnContextMenu;j&&-1==e.doc.sel.contains(h)&&Eb(e,Aa)(e.doc,na(h),Jg);var k=g.style.cssText;if(d.wrapper.style.position="absolute",g.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: "+(sf?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",uf)var l=window.scrollY;if(f.input.focus(),uf&&window.scrollTo(null,l),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),sf&&tf>=9&&b(),Hf){Bg(a);var m=function(){Eg(window,"mouseup",m),setTimeout(c,20)};Cg(window,"mouseup",m)}else setTimeout(c,50)}},readOnlyChanged:function(a){a||this.reset()},setUneditable:Ie,needsContentAttribute:!1},ca.prototype),ea.prototype=Ke({init:function(a){function b(a){if(!ze(d,a)){if(d.somethingSelected())Mf=d.getSelections(),"cut"==a.type&&d.replaceSelection("",null,"cut");else{if(!d.options.lineWiseCopyCut)return;var b=aa(d);Mf=b.text,"cut"==a.type&&d.operation(function(){d.setSelections(b.ranges,0,Jg),d.replaceSelection("",null,"cut")})}if(a.clipboardData&&!Bf)a.preventDefault(),a.clipboardData.clearData(),a.clipboardData.setData("text/plain",Mf.join("\n"));else{var c=da(),e=c.firstChild;d.display.lineSpace.insertBefore(c,d.display.lineSpace.firstChild),e.value=Mf.join("\n");var f=document.activeElement;Pg(e),setTimeout(function(){d.display.lineSpace.removeChild(c),f.focus()},50)}}}var c=this,d=c.cm,e=c.div=a.lineDiv;ba(e),Cg(e,"paste",function(a){ze(d,a)||$(a,d)}),Cg(e,"compositionstart",function(a){var b=a.data;if(c.composing={sel:d.doc.sel,data:b,startData:b},b){var e=d.doc.sel.primary(),f=d.getLine(e.head.line),g=f.indexOf(b,Math.max(0,e.head.ch-b.length));g>-1&&g<=e.head.ch&&(c.composing.sel=na(Kf(e.head.line,g),Kf(e.head.line,g+b.length)))}}),Cg(e,"compositionupdate",function(a){c.composing.data=a.data}),Cg(e,"compositionend",function(a){var b=c.composing;b&&(a.data==b.startData||/\u200b/.test(a.data)||(b.data=a.data),setTimeout(function(){b.handled||c.applyComposition(b),c.composing==b&&(c.composing=null)},50))}),Cg(e,"touchstart",function(){c.forceCompositionEnd()}),Cg(e,"input",function(){c.composing||(d.isReadOnly()||!c.pollContent())&&Db(c.cm,function(){Jb(d)})}),Cg(e,"copy",b),Cg(e,"cut",b)},prepareSelection:function(){var a=Ja(this.cm,!1);return a.focus=this.cm.state.focused,a},showSelection:function(a){a&&this.cm.display.view.length&&(a.focus&&this.showPrimarySelection(),this.showMultipleSelections(a))},showPrimarySelection:function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=ha(this.cm,a.anchorNode,a.anchorOffset),d=ha(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=Lf(X(c,d),b.from())||0!=Lf(W(c,d),b.to())){var e=fa(this.cm,b.from()),f=fa(this.cm,b.to());if(e||f){var g=this.cm.display.view,h=a.rangeCount&&a.getRangeAt(0);if(e){if(!f){var i=g[g.length-1].measure,j=i.maps?i.maps[i.maps.length-1]:i.map;f={node:j[j.length-1],offset:j[j.length-2]-j[j.length-3]}}}else e={node:g[0].measure.map[2],offset:0};try{var k=Qg(e.node,e.offset,f.offset,f.node)}catch(l){}k&&(!pf&&this.cm.state.focused?(a.collapse(e.node,e.offset),k.collapsed||a.addRange(k)):(a.removeAllRanges(),a.addRange(k)),h&&null==a.anchorNode?a.addRange(h):pf&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation(function(){a.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(a){Re(this.cm.display.cursorDiv,a.cursors),Re(this.cm.display.selectionDiv,a.selection)},rememberSelection:function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},selectionInEditor:function(){var a=window.getSelection();if(!a.rangeCount)return!1;var b=a.getRangeAt(0).commonAncestorContainer;return Ug(this.div,b)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():Db(this.cm,function(){b.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,a)},selectionChanged:function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;this.rememberSelection();var c=ha(b,a.anchorNode,a.anchorOffset),d=ha(b,a.focusNode,a.focusOffset);c&&d&&Db(b,function(){Aa(b.doc,na(c,d),Jg),(c.bad||d.bad)&&(b.curOp.selectionChanged=!0)})}},pollContent:function(){var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();if(d.line<b.viewFrom||e.line>b.viewTo-1)return!1;var f;if(d.line==b.viewFrom||0==(f=Mb(a,d.line)))var g=ae(b.view[0].line),h=b.view[0].node;else var g=ae(b.view[f].line),h=b.view[f-1].node.nextSibling;var i=Mb(a,e.line);if(i==b.view.length-1)var j=b.viewTo-1,k=b.lineDiv.lastChild;else var j=ae(b.view[i+1].line)-1,k=b.view[i+1].node.previousSibling;for(var l=a.doc.splitLines(ja(a,h,k,g,j)),m=Zd(a.doc,Kf(g,0),Kf(j,Yd(a.doc,j).text.length));l.length>1&&m.length>1;)if(Fe(l)==Fe(m))l.pop(),m.pop(),j--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,p=l[0],q=m[0],r=Math.min(p.length,q.length);r>n&&p.charCodeAt(n)==q.charCodeAt(n);)++n;for(var s=Fe(l),t=Fe(m),u=Math.min(s.length-(1==l.length?n:0),t.length-(1==m.length?n:0));u>o&&s.charCodeAt(s.length-o-1)==t.charCodeAt(t.length-o-1);)++o;l[l.length-1]=s.slice(0,s.length-o),l[0]=l[0].slice(n);var v=Kf(g,n),w=Kf(j,m.length?Fe(m).length-o:0);return l.length>1||l[0]||Lf(v,w)?(Fc(a.doc,l,v,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(a){this.cm.isReadOnly()?Eb(this.cm,Jb)(this.cm):a.data&&a.data!=a.startData&&Eb(this.cm,Z)(this.cm,a.data,0,a.sel)},setUneditable:function(a){a.contentEditable="false"},onKeyPress:function(a){a.preventDefault(),this.cm.isReadOnly()||Eb(this.cm,Z)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0)},readOnlyChanged:function(a){this.div.contentEditable=String("nocursor"!=a)},onContextMenu:Ie,resetPosition:Ie,needsContentAttribute:!0},ea.prototype),a.inputStyles={textarea:ca,contenteditable:ea},ka.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b<this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(0!=Lf(c.anchor,d.anchor)||0!=Lf(c.head,d.head))return!1}return!0},deepCopy:function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new la(V(this.ranges[b].anchor),V(this.ranges[b].head));return new ka(a,this.primIndex)},somethingSelected:function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1},contains:function(a,b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=this.ranges[c];if(Lf(b,d.from())>=0&&Lf(a,d.to())<=0)return c}return-1}},la.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return W(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Nf,Of,Pf,Qf={left:0,right:0,top:0,bottom:0},Rf=null,Sf=0,Tf=0,Uf=0,Vf=null;sf?Vf=-.53:pf?Vf=15:wf?Vf=-.7:yf&&(Vf=-1/3);var Wf=function(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;return null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail),null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta),{x:b,y:c}};a.wheelEventPixels=function(a){var b=Wf(a);return b.x*=Vf,b.y*=Vf,b};var Xf=new De,Yf=null,Zf=a.changeEnd=function(a){return a.text?Kf(a.from.line+a.text.length-1,Fe(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,_f.hasOwnProperty(a)&&Eb(this,_f[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](Uc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||b[c].name==a)return b.splice(c,1),!0},addOverlay:Fb(function(b,c){var d=b.token?b:a.getMode(this.options,b);if(d.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:d,modeSpec:b,opaque:c&&c.opaque}),this.state.modeGen++,Jb(this)}),removeOverlay:Fb(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a)return b.splice(c,1),this.state.modeGen++,void Jb(this)}}),indentLine:Fb(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),ra(this.doc,a)&&Nc(this,a,b,c)}),indentSelection:Fb(function(a){for(var b=this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var e=b[d];if(e.empty())e.head.line>c&&(Nc(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Lc(this));else{var f=e.from(),g=e.to(),h=Math.max(c,f.line);c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var i=h;c>i;++i)Nc(this,i,a);var j=this.doc.sel.ranges;0==f.ch&&b.length==j.length&&j[d].from().ch>0&&wa(this.doc,d,new la(f,j[d].to()),Jg)}}}),getTokenAt:function(a,b){return Fd(this,a,b)},getLineTokens:function(a,b){return Fd(this,Kf(a),b,!0)},getTokenTypeAt:function(a){a=pa(this.doc,a);var b,c=Id(this,Yd(this.doc,a.line)),d=0,e=(c.length-1)/2,f=a.ch;if(0==f)b=c[2];else for(;;){var g=d+e>>1;if((g?c[2*g-1]:0)>=f)e=g;else{if(!(c[2*g+1]<f)){b=c[2*g+2];break}d=g+1}}var h=b?b.indexOf("cm-overlay "):-1;return 0>h?b:0==h?null:b.slice(0,h-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!fg.hasOwnProperty(b))return c;var d=fg[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;f<e[b].length;f++){var g=d[e[b][f]];g&&c.push(g)}else e.helperType&&d[e.helperType]?c.push(d[e.helperType]):d[e.name]&&c.push(d[e.name]);for(var f=0;f<d._global.length;f++){var h=d._global[f];h.pred(e,this)&&-1==Ge(c,h.val)&&c.push(h.val)}return c},getStateAfter:function(a,b){var c=this.doc;return a=oa(c,null==a?c.first+c.size-1:a),Qa(this,a+1,b)},cursorCoords:function(a,b){var c,d=this.doc.sel.primary();return c=null==a?d.head:"object"==typeof a?pa(this.doc,a):a?d.from():d.to(),nb(this,c,b||"page")},charCoords:function(a,b){return mb(this,pa(this.doc,a),b||"page")},coordsChar:function(a,b){return a=lb(this,a,b||"page"),qb(this,a.left,a.top)},lineAtHeight:function(a,b){return a=lb(this,{top:a,left:0},b||"page").top,be(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c,d=!1;if("number"==typeof a){var e=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>e&&(a=e,d=!0),c=Yd(this.doc,a)}else c=a;return kb(this,c,{top:0,left:0},b||"page").top+(d?this.doc.height-ce(c):0)},defaultTextHeight:function(){return sb(this.display)},defaultCharWidth:function(){return tb(this.display)},setGutterMarker:Fb(function(a,b,c){return Oc(this.doc,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Ne(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Fb(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Kb(b,d,"gutter"),Ne(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),lineInfo:function(a){if("number"==typeof a){if(!ra(this.doc,a))return null;var b=a;if(a=Yd(this.doc,a),!a)return null}else{var b=ae(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=nb(this,pa(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Ic(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Fb(lc),triggerOnKeyPress:Fb(oc),triggerOnKeyUp:nc,execCommand:function(a){return ig.hasOwnProperty(a)?ig[a].call(null,this):void 0},triggerElectric:Fb(function(a){_(this,a)}),findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=pa(this.doc,a);b>f&&(g=Qc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Fb(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Qc(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Lg)}),deleteH:Fb(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Pc(this,function(c){var e=Qc(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=pa(this.doc,a);b>g;++g){var i=nb(this,h,"div");if(null==f?f=i.left:i.left=f,h=Rc(this,i,e,c),h.hitSide)break}return h},moveV:Fb(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=nb(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Rc(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Kc(c,null,mb(c,i,"div").top-h.top),i},Lg),e.length)for(var g=0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]}),findWordAt:function(a){var b=this.doc,c=Yd(b,a.line).text,d=a.ch,e=a.ch;if(c){var f=this.getHelper(a,"wordChars");(a.xRel<0||e==c.length)&&d?--d:++e;for(var g=c.charAt(d),h=Me(g,f)?function(a){return Me(a,f)}:/\s/.test(g)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!Me(a)};d>0&&h(c.charAt(d-1));)--d;for(;e<c.length&&h(c.charAt(e));)++e}return new la(Kf(a.line,d),Kf(a.line,e))},toggleOverwrite:function(a){(null==a||a!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Yg(this.display.cursorDiv,"CodeMirror-overwrite"):Xg(this.display.cursorDiv,"CodeMirror-overwrite"),Fg(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Se()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Fb(function(a,b){(null!=a||null!=b)&&Mc(this),null!=a&&(this.curOp.scrollLeft=a),null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-Ua(this)-this.display.barHeight,width:a.scrollWidth-Ua(this)-this.display.barWidth,clientHeight:Wa(this),clientWidth:Va(this)}},scrollIntoView:Fb(function(a,b){if(null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:Kf(a,0),to:null}:null==a.from&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=b||0,null!=a.from.line)Mc(this),this.curOp.scrollToPos=a;else{var c=Jc(this,Math.min(a.from.left,a.to.left),Math.min(a.from.top,a.to.top)-a.margin,Math.max(a.from.right,a.to.right),Math.max(a.from.bottom,a.to.bottom)+a.margin);this.scrollTo(c.scrollLeft,c.scrollTop)}}),setSize:Fb(function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}var d=this;null!=a&&(d.display.wrapper.style.width=c(a)),null!=b&&(d.display.wrapper.style.height=c(b)),d.options.lineWrapping&&gb(this);var e=d.display.viewFrom;d.doc.iter(e,d.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){Kb(d,e,"widget");break}++e}),d.curOp.forceUpdate=!0,Fg(d,"refresh",this)}),operation:function(a){return Db(this,a)},refresh:Fb(function(){var a=this.display.cachedTextHeight;Jb(this),this.curOp.forceUpdate=!0,hb(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),k(this),(null==a||Math.abs(a-sb(this.display))>.5)&&g(this),Fg(this,"refresh",this)}),swapDoc:Fb(function(a){var b=this.doc;return b.cm=null,Xd(this,a),hb(this),this.display.input.reset(),this.scrollTo(a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,xe(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ce(a);var $f=a.defaults={},_f=a.optionHandlers={},ag=a.Init={toString:function(){return"CodeMirror.Init"}};Sc("value","",function(a,b){a.setValue(b)},!0),Sc("mode",null,function(a,b){a.doc.modeOption=b,c(a)},!0),Sc("indentUnit",2,c,!0),Sc("indentWithTabs",!1),Sc("smartIndent",!0),Sc("tabSize",4,function(a){d(a),hb(a),Jb(a)},!0),Sc("lineSeparator",null,function(a,b){if(a.doc.lineSep=b,b){var c=[],d=a.doc.first;a.doc.iter(function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(-1==f)break;e=f+b.length,c.push(Kf(d,f))}d++});for(var e=c.length-1;e>=0;e--)Fc(a.doc,b,c[e],Kf(c[e].line,c[e].ch+b.length))}}),Sc("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(b,c,d){b.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),d!=a.Init&&b.refresh()}),Sc("specialCharPlaceholder",Md,function(a){a.refresh()},!0),Sc("electricChars",!0),Sc("inputStyle",Cf?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Sc("rtlMoveVisually",!Ef),Sc("wholeLineUpdateBefore",!0),Sc("theme","default",function(a){h(a),i(a)},!0),Sc("keyMap","default",function(b,c,d){var e=Uc(c),f=d!=a.Init&&Uc(d);f&&f.detach&&f.detach(b,e),e.attach&&e.attach(b,f||null)}),Sc("extraKeys",null),Sc("lineWrapping",!1,e,!0),Sc("gutters",[],function(a){n(a.options),i(a)},!0),Sc("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?y(a.display)+"px":"0",a.refresh()},!0),Sc("coverGutterNextToScrollbar",!1,function(a){s(a)},!0),Sc("scrollbarStyle","native",function(a){r(a),s(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),Sc("lineNumbers",!1,function(a){n(a.options),i(a)},!0),Sc("firstLineNumber",1,i,!0),Sc("lineNumberFormatter",function(a){return a},i,!0),Sc("showCursorWhenSelecting",!1,Ia,!0),Sc("resetSelectionOnContextMenu",!0),Sc("lineWiseCopyCut",!0),Sc("readOnly",!1,function(a,b){"nocursor"==b?(rc(a),a.display.input.blur(),a.display.disabled=!0):a.display.disabled=!1,a.display.input.readOnlyChanged(b)}),Sc("disableInput",!1,function(a,b){b||a.display.input.reset()},!0),Sc("dragDrop",!0,Rb),Sc("allowDropFileTypes",null),Sc("cursorBlinkRate",530),Sc("cursorScrollMargin",0),Sc("cursorHeight",1,Ia,!0),Sc("singleCursorHeightPerLine",!0,Ia,!0),Sc("workTime",100),Sc("workDelay",100),Sc("flattenSpans",!0,d,!0),Sc("addModeClass",!1,d,!0),Sc("pollInterval",100),Sc("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),Sc("historyEventDelay",1250),Sc("viewportMargin",10,function(a){a.refresh()},!0),Sc("maxHighlightLength",1e4,d,!0),Sc("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()}),Sc("tabindex",null,function(a,b){a.display.input.getField().tabIndex=b||""}),Sc("autofocus",null);var bg=a.modes={},cg=a.mimeModes={};a.defineMode=function(b,c){a.defaults.mode||"null"==b||(a.defaults.mode=b),arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),bg[b]=c},a.defineMIME=function(a,b){cg[a]=b},a.resolveMode=function(b){if("string"==typeof b&&cg.hasOwnProperty(b))b=cg[b];else if(b&&"string"==typeof b.name&&cg.hasOwnProperty(b.name)){var c=cg[b.name];"string"==typeof c&&(c={name:c}),b=Je(c,b),b.name=c.name}else if("string"==typeof b&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return"string"==typeof b?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=bg[c.name];if(!d)return a.getMode(b,"text/plain");var e=d(b,c);if(dg.hasOwnProperty(c.name)){var f=dg[c.name];for(var g in f)f.hasOwnProperty(g)&&(e.hasOwnProperty(g)&&(e["_"+g]=e[g]),e[g]=f[g])}if(e.name=c.name,c.helperType&&(e.helperType=c.helperType),c.modeProps)for(var g in c.modeProps)e[g]=c.modeProps[g];return e},a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var dg=a.modeExtensions={};a.extendMode=function(a,b){var c=dg.hasOwnProperty(a)?dg[a]:dg[a]={};Ke(b,c)},a.defineExtension=function(b,c){a.prototype[b]=c},a.defineDocExtension=function(a,b){wg.prototype[a]=b},a.defineOption=Sc;var eg=[];a.defineInitHook=function(a){eg.push(a)};var fg=a.helpers={};a.registerHelper=function(b,c,d){fg.hasOwnProperty(b)||(fg[b]=a[b]={_global:[]}),fg[b][c]=d},a.registerGlobalHelper=function(b,c,d,e){a.registerHelper(b,c,e),fg[b]._global.push({pred:d,val:e})};var gg=a.copyState=function(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c},hg=a.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};a.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var ig=a.commands={selectAll:function(a){a.setSelection(Kf(a.firstLine(),0),Kf(a.lastLine()),Jg)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Jg)},killLine:function(a){Pc(a,function(b){if(b.empty()){var c=Yd(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:Kf(b.head.line+1,0)}:{from:b.head,to:Kf(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){Pc(a,function(b){return{from:Kf(b.from().line,0),to:pa(a.doc,Kf(b.to().line+1,0))}})},delLineLeft:function(a){Pc(a,function(a){return{from:Kf(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){Pc(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return{from:d,to:b.from()}})},delWrappedLineRight:function(a){Pc(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:d}})},undo:function(a){a.undo()},redo:function(a){a.redo()},undoSelection:function(a){a.undoSelection()},redoSelection:function(a){a.redoSelection()},goDocStart:function(a){a.extendSelection(Kf(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(Kf(a.lastLine()))},goLineStart:function(a){a.extendSelectionsBy(function(b){return ef(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){a.extendSelectionsBy(function(b){return gf(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){a.extendSelectionsBy(function(b){return ff(a,b.head.line)},{origin:"+move",bias:-1})},goLineRight:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div")},Lg)},goLineLeft:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:c},"div")},Lg)},goLineLeftSmart:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return d.ch<a.getLine(d.line).search(/\S/)?gf(a,b.head):d},Lg)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection(" ")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),g=Mg(a.getLine(f.line),f.ch,d);b.push(new Array(d-g%d+1).join(" "))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){Db(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d].head,f=Yd(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new Kf(e.line,e.ch-1)),e.ch>0)e=new Kf(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),Kf(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=Yd(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),Kf(e.line-1,g.length-1),Kf(e.line,1),"+transpose")}c.push(new la(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){Db(a,function(){for(var b=a.listSelections().length,c=0;b>c;c++){var d=a.listSelections()[c];a.replaceRange(a.doc.lineSeparator(),d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0)}Lc(a)})},toggleOverwrite:function(a){a.toggleOverwrite()}},jg=a.keyMap={};jg.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},jg.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter",
|
5 |
-
"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","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},jg.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"},jg.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","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","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},jg["default"]=Df?jg.macDefault:jg.pcDefault,a.normalizeKeyMap=function(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if("..."==d){delete a[c];continue}for(var e=He(c.split(" "),Tc),f=0;f<e.length;f++){var g,h;f==e.length-1?(h=e.join(" "),g=d):(h=e.slice(0,f+1).join(" "),g="...");var i=b[h];if(i){if(i!=g)throw new Error("Inconsistent bindings for "+h)}else b[h]=g}delete a[c]}for(var j in b)a[j]=b[j];return a};var kg=a.lookupKey=function(a,b,c,d){b=Uc(b);var e=b.call?b.call(a,d):b[a];if(e===!1)return"nothing";if("..."===e)return"multi";if(null!=e&&c(e))return"handled";if(b.fallthrough){if("[object Array]"!=Object.prototype.toString.call(b.fallthrough))return kg(a,b.fallthrough,c,d);for(var f=0;f<b.fallthrough.length;f++){var g=kg(a,b.fallthrough[f],c,d);if(g)return g}}},lg=a.isModifierKey=function(a){var b="string"==typeof a?a:dh[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b},mg=a.keyName=function(a,b){if(xf&&34==a.keyCode&&a["char"])return!1;var c=dh[a.keyCode],d=c;return null==d||a.altGraphKey?!1:(a.altKey&&"Alt"!=c&&(d="Alt-"+d),(Gf?a.metaKey:a.ctrlKey)&&"Ctrl"!=c&&(d="Ctrl-"+d),(Gf?a.ctrlKey:a.metaKey)&&"Cmd"!=c&&(d="Cmd-"+d),!b&&a.shiftKey&&"Shift"!=c&&(d="Shift-"+d),d)};a.fromTextArea=function(b,c){function d(){b.value=j.getValue()}if(c=c?Ke(c):{},c.value=b.value,!c.tabindex&&b.tabIndex&&(c.tabindex=b.tabIndex),!c.placeholder&&b.placeholder&&(c.placeholder=b.placeholder),null==c.autofocus){var e=Se();c.autofocus=e==b||null!=b.getAttribute("autofocus")&&e==document.body}if(b.form&&(Cg(b.form,"submit",d),!c.leaveSubmitMethodAlone)){var f=b.form,g=f.submit;try{var h=f.submit=function(){d(),f.submit=g,f.submit(),f.submit=h}}catch(i){}}c.finishInit=function(a){a.save=d,a.getTextArea=function(){return b},a.toTextArea=function(){a.toTextArea=isNaN,d(),b.parentNode.removeChild(a.getWrapperElement()),b.style.display="",b.form&&(Eg(b.form,"submit",d),"function"==typeof b.form.submit&&(b.form.submit=g))}},b.style.display="none";var j=a(function(a){b.parentNode.insertBefore(a,b.nextSibling)},c);return j};var ng=a.StringStream=function(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ng.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a)var c=b==a;else var c=b&&(a.test?a.test(b):a(b));return c?(++this.pos,b):void 0},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Mg(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Mg(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Mg(this.string,null,this.tabSize)-(this.lineStart?Mg(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if("string"!=typeof a){var d=this.string.slice(this.pos).match(a);return d&&d.index>0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var og=0,pg=a.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++og};Ce(pg),pg.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&ub(a),Be(this,"clear")){var c=this.find();c&&xe(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;f<this.lines.length;++f){var g=this.lines[f],h=_c(g.markedSpans,this);a&&!this.collapsed?Kb(a,ae(g),"text"):a&&(null!=h.to&&(e=ae(g)),null!=h.from&&(d=ae(g))),g.markedSpans=ad(g.markedSpans,h),null==h.from&&this.collapsed&&!vd(this.doc,g)&&a&&_d(g,sb(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var i=rd(this.lines[f]),j=l(i);j>a.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Jb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Da(a.doc)),a&&xe(a,"markerCleared",a,this),b&&wb(a),this.parent&&this.parent.clear()}},pg.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],g=_c(f.markedSpans,this);if(null!=g.from&&(c=Kf(b?f:ae(f),g.from),-1==a))return c;if(null!=g.to&&(d=Kf(b?f:ae(f),g.to),1==a))return d}return c&&{from:c,to:d}},pg.prototype.changed=function(){var a=this.find(-1,!0),b=this,c=this.doc.cm;a&&c&&Db(c,function(){var d=a.line,e=ae(a.line),f=_a(c,e);if(f&&(fb(f),c.curOp.selectionChanged=c.curOp.forceUpdate=!0),c.curOp.updateMaxLine=!0,!vd(b.doc,d)&&null!=b.height){var g=b.height;b.height=null;var h=yd(b)-g;h&&_d(d,d.height+h)}})},pg.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=Ge(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},pg.prototype.detachLine=function(a){if(this.lines.splice(Ge(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}};var og=0,qg=a.SharedTextMarker=function(a,b){this.markers=a,this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};Ce(qg),qg.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();xe(this,"clear")}},qg.prototype.find=function(a,b){return this.primary.find(a,b)};var rg=a.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.doc=a,this.node=b};Ce(rg),rg.prototype.clear=function(){var a=this.doc.cm,b=this.line.widgets,c=this.line,d=ae(c);if(null!=d&&b){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||(c.widgets=null);var f=yd(this);_d(c,Math.max(0,c.height-f)),a&&Db(a,function(){xd(a,c,-f),Kb(a,d,"widget")})}},rg.prototype.changed=function(){var a=this.height,b=this.doc.cm,c=this.line;this.height=null;var d=yd(this)-a;d&&(_d(c,c.height+d),b&&Db(b,function(){b.curOp.forceUpdate=!0,xd(b,c,d)}))};var sg=a.Line=function(a,b,c){this.text=a,jd(this,b),this.height=c?c(this):1};Ce(sg),sg.prototype.lineNo=function(){return ae(this)};var tg={},ug={};Ud.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;d>c;++c){var e=this.lines[c];this.height-=e.height,Bd(e),xe(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;d<b.length;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;d>a;++a)if(c(this.lines[a]))return!0}},Vd.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(e>a){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Ud))){var h=[];this.collapse(h),this.children=[new Ud(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(f>=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new Ud(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Vd(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=Ge(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Vd(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(f>a){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var vg=0,wg=a.Doc=function(a,b,c,d){if(!(this instanceof wg))return new wg(a,b,c,d);null==c&&(c=0),Vd.call(this,[new Ud([new sg("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var e=Kf(c,0);this.sel=na(e),this.history=new ee(null),this.id=++vg,this.modeOption=b,this.lineSep=d,this.extend=!1,"string"==typeof a&&(a=this.splitLines(a)),Td(this,{from:e,to:e,text:a}),Aa(this,na(e),Jg)};wg.prototype=Je(Vd.prototype,{constructor:wg,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=$d(this,this.first,this.first+this.size);return a===!1?b:b.join(a||this.lineSeparator())},setValue:Gb(function(a){var b=Kf(this.first,0),c=this.first+this.size-1;zc(this,{from:b,to:Kf(c,Yd(this,c).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0),Aa(this,na(b))}),replaceRange:function(a,b,c,d){b=pa(this,b),c=c?pa(this,c):b,Fc(this,a,b,c,d)},getRange:function(a,b,c){var d=Zd(this,pa(this,a),pa(this,b));return c===!1?d:d.join(c||this.lineSeparator())},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},getLineHandle:function(a){return ra(this,a)?Yd(this,a):void 0},getLineNumber:function(a){return ae(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=Yd(this,a)),rd(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return pa(this,a)},getCursor:function(a){var b,c=this.sel.primary();return b=null==a||"head"==a?c.head:"anchor"==a?c.anchor:"end"==a||"to"==a||a===!1?c.to():c.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Gb(function(a,b,c){xa(this,pa(this,"number"==typeof a?Kf(a,b||0):a),null,c)}),setSelection:Gb(function(a,b,c){xa(this,pa(this,a),pa(this,b||a),c)}),extendSelection:Gb(function(a,b,c){ua(this,pa(this,a),b&&pa(this,b),c)}),extendSelections:Gb(function(a,b){va(this,sa(this,a),b)}),extendSelectionsBy:Gb(function(a,b){var c=He(this.sel.ranges,a);va(this,sa(this,c),b)}),setSelections:Gb(function(a,b,c){if(a.length){for(var d=0,e=[];d<a.length;d++)e[d]=new la(pa(this,a[d].anchor),pa(this,a[d].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex)),Aa(this,ma(e,b),c)}}),addSelection:Gb(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new la(pa(this,a),pa(this,b||a))),Aa(this,ma(d,d.length-1),c)}),getSelection:function(a){for(var b,c=this.sel.ranges,d=0;d<c.length;d++){var e=Zd(this,c[d].from(),c[d].to());b=b?b.concat(e):e}return a===!1?b:b.join(a||this.lineSeparator())},getSelections:function(a){for(var b=[],c=this.sel.ranges,d=0;d<c.length;d++){var e=Zd(this,c[d].from(),c[d].to());a!==!1&&(e=e.join(a||this.lineSeparator())),b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:Gb(function(a,b,c){for(var d=[],e=this.sel,f=0;f<e.ranges.length;f++){var g=e.ranges[f];d[f]={from:g.from(),to:g.to(),text:this.splitLines(a[f]),origin:c}}for(var h=b&&"end"!=b&&xc(this,d,b),f=d.length-1;f>=0;f--)zc(this,d[f]);h?za(this,h):this.cm&&Lc(this.cm)}),undo:Gb(function(){Bc(this,"undo")}),redo:Gb(function(){Bc(this,"redo")}),undoSelection:Gb(function(){Bc(this,"undo",!0)}),redoSelection:Gb(function(){Bc(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(var d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new ee(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){return a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:pe(this.history.done),undone:pe(this.history.undone)}},setHistory:function(a){var b=this.history=new ee(this.history.maxGeneration);b.done=pe(a.done.slice(0),null,!0),b.undone=pe(a.undone.slice(0),null,!0)},addLineClass:Gb(function(a,b,c){return Oc(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass";if(a[d]){if(Te(c).test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Gb(function(a,b,c){return Oc(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(Te(c));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Gb(function(a,b,c){return zd(this,a,b,c)}),removeLineWidget:function(a){a.clear()},markText:function(a,b,c){return Vc(this,pa(this,a),pa(this,b),c,c&&c.type||"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};return a=pa(this,a),Vc(this,a,a,c,"bookmark")},findMarksAt:function(a){a=pa(this,a);var b=[],c=Yd(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=pa(this,a),b=pa(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,function(f){var g=f.markedSpans;if(g)for(var h=0;h<g.length;h++){var i=g[h];e==a.line&&a.ch>i.to||null==i.from&&e!=a.line||e==b.line&&i.from>b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e}),d},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first;return this.iter(function(d){var e=d.text.length+1;return e>a?(b=a,!0):(a-=e,void++c)}),pa(this,Kf(c,b))},indexFromPos:function(a){a=pa(this,a);var b=a.ch;return a.line<this.first||a.ch<0?0:(this.iter(this.first,a.line,function(a){b+=a.text.length+1}),b)},copy:function(a){var b=new wg($d(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel=this.sel,b.extend=!1,a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new wg($d(this,b,c),a.mode||this.modeOption,b,this.lineSep);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],Yc(d,Xc(this)),d},unlinkDoc:function(b){if(b instanceof a&&(b=b.doc),this.linked)for(var c=0;c<this.linked.length;++c){var d=this.linked[c];if(d.doc==b){this.linked.splice(c,1),b.unlinkDoc(this),Zc(Xc(this));break}}if(b.history==this.history){var e=[b.id];Wd(b,function(a){e.push(a.id)},!0),b.history=new ee(null),b.history.done=pe(this.history.done,e),b.history.undone=pe(this.history.undone,e)}},iterLinkedDocs:function(a){Wd(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(a){return this.lineSep?a.split(this.lineSep):_g(a)},lineSeparator:function(){return this.lineSep||"\n"}}),wg.prototype.eachLine=wg.prototype.iter;var xg="iter insert remove copy getEditor constructor".split(" ");for(var yg in wg.prototype)wg.prototype.hasOwnProperty(yg)&&Ge(xg,yg)<0&&(a.prototype[yg]=function(a){return function(){return a.apply(this.doc,arguments)}}(wg.prototype[yg]));Ce(wg);var zg=a.e_preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},Ag=a.e_stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},Bg=a.e_stop=function(a){zg(a),Ag(a)},Cg=a.on=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={}),e=d[b]||(d[b]=[]);e.push(c)}},Dg=[],Eg=a.off=function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else for(var d=we(a,b,!1),e=0;e<d.length;++e)if(d[e]==c){d.splice(e,1);break}},Fg=a.signal=function(a,b){var c=we(a,b,!0);if(c.length)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)},Gg=null,Hg=30,Ig=a.Pass={toString:function(){return"CodeMirror.Pass"}},Jg={scroll:!1},Kg={origin:"*mouse"},Lg={origin:"+move"};De.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Mg=a.countColumn=function(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var f=d||0,g=e||0;;){var h=a.indexOf(" ",f);if(0>h||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},Ng=a.findColumn=function(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}},Og=[""],Pg=function(a){a.select()};Bf?Pg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:sf&&(Pg=function(a){try{a.select()}catch(b){}});var Qg,Rg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Sg=a.isWordChar=function(a){return/\w/.test(a)||a>""&&(a.toUpperCase()!=a.toLowerCase()||Rg.test(a))},Tg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Qg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Ug=a.contains=function(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)};sf&&11>tf&&(Se=function(){try{return document.activeElement}catch(a){return document.body}});var Vg,Wg,Xg=a.rmClass=function(a,b){var c=a.className,d=Te(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},Yg=a.addClass=function(a,b){var c=a.className;Te(b).test(c)||(a.className+=(c?" ":"")+b)},Zg=!1,$g=function(){if(sf&&9>tf)return!1;var a=Pe("div");return"draggable"in a||"dragDrop"in a}(),_g=a.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},ah=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},bh=function(){var a=Pe("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),ch=null,dh=a.keyNames={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:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var a=0;10>a;a++)dh[a+48]=dh[a+96]=String(a);for(var a=65;90>=a;a++)dh[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)dh[a+111]=dh[a+63235]="F"+a}();var eh,fh=function(){function a(a){return 247>=a?c.charAt(a):a>=1424&&1524>=a?"R":a>=1536&&1773>=a?d.charAt(a-1536):a>=1774&&2220>=a?"r":a>=8192&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/,j="L";return function(c){if(!e.test(c))return!1;for(var d,k=c.length,l=[],m=0;k>m;++m)l.push(d=a(c.charCodeAt(m)));for(var m=0,n=j;k>m;++m){var d=l[m];"m"==d?l[m]=n:n=d}for(var m=0,o=j;k>m;++m){var d=l[m];"1"==d&&"r"==o?l[m]="n":g.test(d)&&(o=d,"r"==d&&(l[m]="R"))}for(var m=1,n=l[0];k-1>m;++m){var d=l[m];"+"==d&&"1"==n&&"1"==l[m+1]?l[m]="1":","!=d||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=d}for(var m=0;k>m;++m){var d=l[m];if(","==d)l[m]="N";else if("%"==d){for(var p=m+1;k>p&&"%"==l[p];++p);for(var q=m&&"!"==l[m-1]||k>p&&"1"==l[p]?"1":"N",r=m;p>r;++r)l[r]=q;m=p-1}}for(var m=0,o=j;k>m;++m){var d=l[m];"L"==o&&"1"==d?l[m]="L":g.test(d)&&(o=d)}for(var m=0;k>m;++m)if(f.test(l[m])){for(var p=m+1;k>p&&f.test(l[p]);++p);for(var s="L"==(m?l[m-1]:j),t="L"==(k>p?l[p]:j),q=s||t?"L":"R",r=m;p>r;++r)l[r]=q;m=p-1}for(var u,v=[],m=0;k>m;)if(h.test(l[m])){var w=m;for(++m;k>m&&h.test(l[m]);++m);v.push(new b(0,w,m))}else{var x=m,y=v.length;for(++m;k>m&&"L"!=l[m];++m);for(var r=x;m>r;)if(i.test(l[r])){r>x&&v.splice(y,0,new b(1,x,r));var z=r;for(++r;m>r&&i.test(l[r]);++r);v.splice(y,0,new b(2,z,r)),x=r}else++r;m>x&&v.splice(y,0,new b(1,x,m))}return 1==v[0].level&&(u=c.match(/^\s+/))&&(v[0].from=u[0].length,v.unshift(new b(0,0,u[0].length))),1==Fe(v).level&&(u=c.match(/\s+$/))&&(Fe(v).to-=u[0].length,v.push(new b(0,k-u[0].length,k))),2==v[0].level&&v.unshift(new b(1,v[0].to,v[0].to)),v[0].level!=Fe(v).level&&v.push(new b(v[0].level,k,k)),v}}();return a.version="5.11.0",a}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b){return"function"==typeof a?a(b):a.propertyIsEnumerable(b)}function d(a,b){if(!b.startOfLine)return!1;for(var c,e=null;c=a.peek();){if("\\"==c&&a.match(/^.$/)){e=d;break}if("/"==c&&a.match(/^\/[\/\*]/,!1))break;a.next()}return b.tokenize=e,"meta"}function e(a,b){return"variable-3"==b.prevToken?"variable-3":!1}function f(a){return a.eatWhile(/[\w\.']/),"number"}function g(a,b){if(a.backUp(1),a.match(/(R|u8R|uR|UR|LR)/)){var c=a.match(/"([^\s\\()]{0,16})\(/);return c?(b.cpp11RawStringDelim=c[1],b.tokenize=j,j(a,b)):!1}return a.match(/(u8|u|U|L)/)?a.match(/["']/,!1)?"string":!1:(a.next(),!1)}function h(a){var b=/(\w+)::(\w+)$/.exec(a);return b&&b[1]==b[2]}function i(a,b){for(var c;null!=(c=a.next());)if('"'==c&&!a.eat('"')){b.tokenize=null;break}return"string"}function j(a,b){var c=b.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),d=a.match(new RegExp(".*?\\)"+c+'"'));return d?b.tokenize=null:a.skipToEnd(),"string"}function k(b,c){function d(a){if(a)for(var b in a)a.hasOwnProperty(b)&&e.push(b)}"string"==typeof b&&(b=[b]);var e=[];d(c.keywords),d(c.types),d(c.builtin),d(c.atoms),e.length&&(c.helperType=b[0],a.registerHelper("hintWords",b[0],e));for(var f=0;f<b.length;++f)a.defineMIME(b[f],c)}function l(a,b){for(var c=!1;!a.eol();){if(!c&&a.match('"""')){b.tokenize=null;break}c="\\"==a.next()&&!c}return"string"}function m(a){return function(b,c){for(var d,e=!1,f=!1;!b.eol();){if(!a&&!e&&b.match('"')){f=!0;break}if(a&&b.match('"""')){f=!0;break}d=b.next(),!e&&"$"==d&&b.match("{")&&b.skipTo("}"),e=!e&&"\\"==d&&!a}return(f||!a)&&(c.tokenize=null),"string"}}function n(a){return function(b,c){for(var d,e=!1,f=!1;!b.eol();){if(!e&&b.match('"')&&("single"==a||b.match('""'))){f=!0;break}if(!e&&b.match("``")){q=n(a),f=!0;break}d=b.next(),e="single"==a&&!e&&"\\"==d}return f&&(c.tokenize=null),"string"}}a.defineMode("clike",function(b,d){function e(a,b){var d=a.next();if(y[d]){var e=y[d](a,b);if(e!==!1)return e}if('"'==d||"'"==d)return b.tokenize=f(d),b.tokenize(a,b);if(D.test(d))return n=d,null;if(E.test(d)){if(a.backUp(1),a.match(F))return"number";a.next()}if("/"==d){if(a.eat("*"))return b.tokenize=g,g(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(G.test(d))return a.eatWhile(G),"operator";if(a.eatWhile(/[\w\$_\xa1-\uffff]/),C)for(;a.match(C);)a.eatWhile(/[\w\$_\xa1-\uffff]/);var h=a.current();return c(s,h)?(c(v,h)&&(n="newstatement"),c(w,h)&&(o=!0),"keyword"):c(t,h)?"variable-3":c(u,h)?(c(v,h)&&(n="newstatement"),"builtin"):c(x,h)?"atom":"variable"}function f(a){return function(b,c){for(var d,e=!1,f=!1;null!=(d=b.next());){if(d==a&&!e){f=!0;break}e=!e&&"\\"==d}return(f||!e&&!z)&&(c.tokenize=null),"string"}}function g(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=null;break}d="*"==c}return"comment"}function h(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function i(a){return"statement"==a||"switchstatement"==a||"namespace"==a}function j(a,b,c){var d=a.indented;return a.context&&i(a.context.type)&&!i(c)&&(d=a.context.indented),a.context=new h(d,b,c,null,a.context)}function k(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}function l(a,b){return"variable"==b.prevToken||"variable-3"==b.prevToken?!0:/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(a.string.slice(0,a.start))?!0:void 0}function m(a){for(;;){if(!a||"top"==a.type)return!0;if("}"==a.type&&"namespace"!=a.prev.type)return!1;a=a.prev}}var n,o,p=b.indentUnit,q=d.statementIndentUnit||p,r=d.dontAlignCalls,s=d.keywords||{},t=d.types||{},u=d.builtin||{},v=d.blockKeywords||{},w=d.defKeywords||{},x=d.atoms||{},y=d.hooks||{},z=d.multiLineStrings,A=d.indentStatements!==!1,B=d.indentSwitch!==!1,C=d.namespaceSeparator,D=d.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,E=d.numberStart||/[\d\.]/,F=d.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,G=d.isOperatorChar||/[+\-*&%=<>!?|\/]/,H=d.endStatement||/^[;:,]$/;return{startState:function(a){return{tokenize:null,context:new h((a||0)-p,0,"top",!1),indented:0,startOfLine:!0,prevToken:null}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;n=o=null;var f=(b.tokenize||e)(a,b);if("comment"==f||"meta"==f)return f;if(null==c.align&&(c.align=!0),H.test(n))for(;i(b.context.type);)k(b);else if("{"==n)j(b,a.column(),"}");else if("["==n)j(b,a.column(),"]");else if("("==n)j(b,a.column(),")");else if("}"==n){for(;i(c.type);)c=k(b);for("}"==c.type&&(c=k(b));i(c.type);)c=k(b)}else if(n==c.type)k(b);else if(A&&(("}"==c.type||"top"==c.type)&&";"!=n||i(c.type)&&"newstatement"==n)){var g="statement";"newstatement"==n&&B&&"switch"==a.current()?g="switchstatement":"keyword"==f&&"namespace"==a.current()&&(g="namespace"),j(b,a.column(),g)}if("variable"==f&&("def"==b.prevToken||d.typeFirstDefinitions&&l(a,b)&&m(b.context)&&a.match(/^\s*\(/,!1))&&(f="def"),
|
6 |
-
y.token){var h=y.token(a,b,f);void 0!==h&&(f=h)}return"def"==f&&d.styleDefs===!1&&(f="variable"),b.startOfLine=!1,b.prevToken=o?"def":f||n,f},indent:function(b,c){if(b.tokenize!=e&&null!=b.tokenize)return a.Pass;var f=b.context,g=c&&c.charAt(0);if(i(f.type)&&"}"==g&&(f=f.prev),y.indent){var h=y.indent(b,f,c);if("number"==typeof h)return h}var j=g==f.type,k=f.prev&&"switchstatement"==f.prev.type;if(d.allmanIndentation&&/[{(]/.test(g)){for(;"top"!=f.type&&"}"!=f.type;)f=f.prev;return f.indented}return i(f.type)?f.indented+("{"==g?0:q):!f.align||r&&")"==f.type?")"!=f.type||j?f.indented+(j?0:p)+(j||!k||/^(?:case|default)\b/.test(c)?0:p):f.indented+q:f.column+(j?0:1)},electricInput:B?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var o="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",p="int long char short double float unsigned signed void size_t ptrdiff_t";k(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:b(o),types:b(p+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:b("case do else for if switch while struct"),defKeywords:b("struct"),typeFirstDefinitions:!0,atoms:b("null true false"),hooks:{"#":d,"*":e},modeProps:{fold:["brace","include"]}}),k(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:b(o+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:b(p+" bool wchar_t"),blockKeywords:b("catch class do else finally for if struct switch try while"),defKeywords:b("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":d,"*":e,u:g,U:g,L:g,R:g,0:f,1:f,2:f,3:f,4:f,5:f,6:f,7:f,8:f,9:f,token:function(a,b,c){return"variable"!=c||"("!=a.peek()||";"!=b.prevToken&&null!=b.prevToken&&"}"!=b.prevToken||!h(a.current())?void 0:"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),k("text/x-java",{name:"clike",keywords:b("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:b("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:b("catch class do else finally for if switch try while"),defKeywords:b("class interface package enum"),typeFirstDefinitions:!0,atoms:b("true false null"),endStatement:/^[;:]$/,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),k("text/x-csharp",{name:"clike",keywords:b("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:b("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:b("catch class do else finally for foreach if struct switch try while"),defKeywords:b("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=i,i(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),k("text/x-scala",{name:"clike",keywords:b("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:b("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:b("catch class do else finally for forSome if match switch try while"),defKeywords:b("class def object package trait type val var"),atoms:b("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return a.match('""')?(b.tokenize=l,b.tokenize(a,b)):!1},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),k("text/x-kotlin",{name:"clike",keywords:b("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix"),types:b("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,blockKeywords:b("catch class do else finally for if where try while enum"),defKeywords:b("class val var object package interface fun"),atoms:b("true false null this"),hooks:{'"':function(a,b){return b.tokenize=m(a.match('""')),b.tokenize(a,b)}},modeProps:{closeBrackets:{triples:'"'}}}),k(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:b("for while do if else struct"),builtin:b("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:b("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":d},modeProps:{fold:["brace","include"]}}),k("text/x-nesc",{name:"clike",keywords:b(o+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:b(p),blockKeywords:b("case do else for if switch while struct"),atoms:b("null true false"),hooks:{"#":d},modeProps:{fold:["brace","include"]}}),k("text/x-objectivec",{name:"clike",keywords:b(o+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:b(p),atoms:b("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":d,indent:function(a,b,c){return"statement"==b.type&&/^@\w/.test(c)?b.indented:void 0}},modeProps:{fold:"brace"}}),k("text/x-squirrel",{name:"clike",keywords:b("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:b(p),blockKeywords:b("case catch class else for foreach if switch try while"),defKeywords:b("function local class"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":d},modeProps:{fold:["brace","include"]}});var q=null;k("text/x-ceylon",{name:"clike",keywords:b("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(a){var b=a.charAt(0);return b===b.toUpperCase()&&b!==b.toLowerCase()},blockKeywords:b("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:b("class dynamic function interface module object package value"),builtin:b("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:b("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return b.tokenize=n(a.match('""')?"triple":"single"),b.tokenize(a,b)},"`":function(a,b){return q&&a.match("`")?(b.tokenize=q,q=null,b.tokenize(a,b)):!1},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(a,b,c){return"variable"!=c&&"variable-3"!=c||"."!=b.prevToken?void 0:"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b,e){return 0==a.length?d(b):function(f,g){for(var h=a[0],i=0;i<h.length;i++)if(f.match(h[i][0]))return g.tokenize=c(a.slice(1),b),h[i][1];return g.tokenize=d(b,e),"string"}}function d(a,b){return function(c,d){return e(c,d,a,b)}}function e(a,b,d,e){if(e!==!1&&a.match("${",!1)||a.match("{$",!1))return b.tokenize=null,"string";if(e!==!1&&a.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return a.match("[",!1)&&(b.tokenize=c([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],d,e)),a.match(/\-\>\w/,!1)&&(b.tokenize=c([[["->",null]],[[/[\w]+/,"variable"]]],d,e)),"variable-2";for(var f=!1;!a.eol()&&(f||e===!1||!a.match("{$",!1)&&!a.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!f&&a.match(d)){b.tokenize=null,b.tokStack.pop(),b.tokStack.pop();break}f="\\"==a.next()&&!f}return"string"}var f="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",g="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",h="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";a.registerHelper("hintWords","php",[f,g,h].join(" ").split(" ")),a.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:b(f),blockKeywords:b("catch do else elseif for foreach if switch try while finally"),defKeywords:b("class function interface namespace trait"),atoms:b(g),builtin:b(h),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,b){var c;if(c=a.match(/<<\s*/)){var e=a.eat(/['"]/);a.eatWhile(/[\w\.]/);var f=a.current().slice(c[0].length+(e?2:1));if(e&&a.eat(e),f)return(b.tokStack||(b.tokStack=[])).push(f,0),b.tokenize=d(f,"'"!=e),"string"}return!1},"#":function(a){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1},'"':function(a,b){return(b.tokStack||(b.tokStack=[])).push('"',0),b.tokenize=d('"'),"string"},"{":function(a,b){return b.tokStack&&b.tokStack.length&&b.tokStack[b.tokStack.length-1]++,!1},"}":function(a,b){return b.tokStack&&b.tokStack.length>0&&!--b.tokStack[b.tokStack.length-1]&&(b.tokenize=d(b.tokStack[b.tokStack.length-2])),!1}}};a.defineMode("php",function(b,c){function d(b,c){var d=c.curMode==f;if(b.sol()&&c.pending&&'"'!=c.pending&&"'"!=c.pending&&(c.pending=null),d)return d&&null==c.php.tokenize&&b.match("?>")?(c.curMode=e,c.curState=c.html,c.php.context.prev||(c.php=null),"meta"):f.token(b,c.curState);if(b.match(/^<\?\w*/))return c.curMode=f,c.php||(c.php=a.startState(f,e.indent(c.html,""))),c.curState=c.php,"meta";if('"'==c.pending||"'"==c.pending){for(;!b.eol()&&b.next()!=c.pending;);var g="string"}else if(c.pending&&b.pos<c.pending.end){b.pos=c.pending.end;var g=c.pending.style}else var g=e.token(b,c.curState);c.pending&&(c.pending=null);var h,i=b.current(),j=i.search(/<\?/);return-1!=j&&("string"==g&&(h=i.match(/[\'\"]$/))&&!/\?>/.test(i)?c.pending=h[0]:c.pending={end:b.pos,style:g},b.backUp(i.length-j)),g}var e=a.getMode(b,"text/html"),f=a.getMode(b,i);return{startState:function(){var b=a.startState(e),d=c.startOpen?a.startState(f):null;return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var c,d=b.html,g=a.copyState(e,d),h=b.php,i=h&&a.copyState(f,h);return c=b.curMode==e?g:i,{html:g,php:i,curMode:b.curMode,curState:c,pending:b.pending}},token:d,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",i)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b,e,f){if(this.atOccurrence=!1,this.doc=a,null==f&&"string"==typeof b&&(f=!1),e=e?a.clipPos(e):d(0,0),this.pos={from:e,to:e},"string"!=typeof b)b.global||(b=new RegExp(b.source,b.ignoreCase?"ig":"g")),this.matches=function(c,e){if(c){b.lastIndex=0;for(var f,g,h=a.getLine(e.line).slice(0,e.ch),i=0;;){b.lastIndex=i;var j=b.exec(h);if(!j)break;if(f=j,g=f.index,i=f.index+(f[0].length||1),i==h.length)break}var k=f&&f[0].length||0;k||(0==g&&0==h.length?f=void 0:g!=a.getLine(e.line).length&&k++)}else{b.lastIndex=e.ch;var h=a.getLine(e.line),f=b.exec(h),k=f&&f[0].length||0,g=f&&f.index;g+k==h.length||k||(k=1)}return f&&k?{from:d(e.line,g),to:d(e.line,g+k),match:f}:void 0};else{var g=b;f&&(b=b.toLowerCase());var h=f?function(a){return a.toLowerCase()}:function(a){return a},i=b.split("\n");if(1==i.length)b.length?this.matches=function(e,f){if(e){var i=a.getLine(f.line).slice(0,f.ch),j=h(i),k=j.lastIndexOf(b);if(k>-1)return k=c(i,j,k),{from:d(f.line,k),to:d(f.line,k+g.length)}}else{var i=a.getLine(f.line).slice(f.ch),j=h(i),k=j.indexOf(b);if(k>-1)return k=c(i,j,k)+f.ch,{from:d(f.line,k),to:d(f.line,k+g.length)}}}:this.matches=function(){};else{var j=g.split("\n");this.matches=function(b,c){var e=i.length-1;if(b){if(c.line-(i.length-1)<a.firstLine())return;if(h(a.getLine(c.line).slice(0,j[e].length))!=i[i.length-1])return;for(var f=d(c.line,j[e].length),g=c.line-1,k=e-1;k>=1;--k,--g)if(i[k]!=h(a.getLine(g)))return;var l=a.getLine(g),m=l.length-j[0].length;if(h(l.slice(m))!=i[0])return;return{from:d(g,m),to:f}}if(!(c.line+(i.length-1)>a.lastLine())){var l=a.getLine(c.line),m=l.length-j[0].length;if(h(l.slice(m))==i[0]){for(var n=d(c.line,m),g=c.line+1,k=1;e>k;++k,++g)if(i[k]!=h(a.getLine(g)))return;if(h(a.getLine(g).slice(0,j[e].length))==i[e])return{from:n,to:d(g,j[e].length)}}}}}}}function c(a,b,c){if(a.length==b.length)return c;for(var d=Math.min(c,a.length);;){var e=a.slice(0,d).toLowerCase().length;if(c>e)++d;else{if(!(e>c))return d;--d}}}var d=a.Pos;b.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function b(a){var b=d(a,0);return c.pos={from:b,to:b},c.atOccurrence=!1,!1}for(var c=this,e=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,e))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!e.line)return b(0);e=d(e.line-1,this.doc.getLine(e.line-1).length)}else{var f=this.doc.lineCount();if(e.line==f-1)return b(f);e=d(e.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(b,c){if(this.atOccurrence){var e=a.splitLines(b);this.doc.replaceRange(e,this.pos.from,this.pos.to,c),this.pos.to=d(this.pos.from.line+e.length-1,e[e.length-1].length+(1==e.length?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(a,c,d){return new b(this.doc,a,c,d)}),a.defineDocExtension("getSearchCursor",function(a,c,d){return new b(this,a,c,d)}),a.defineExtension("selectMatches",function(b,c){for(var d=[],e=this.getSearchCursor(b,this.getCursor("from"),c);e.findNext()&&!(a.cmpPos(e.to(),this.getCursor("to"))>0);)d.push({anchor:e.from(),head:e.to()});d.length&&this.setSelections(d,0)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b){return"string"==typeof a?a=new RegExp(a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),b?"gi":"g"):a.global||(a=new RegExp(a.source,a.ignoreCase?"gi":"g")),{token:function(b){a.lastIndex=b.pos;var c=a.exec(b.string);return c&&c.index==b.pos?(b.pos+=c[0].length||1,"searching"):void(c?b.pos=c.index:b.skipToEnd())}}}function c(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function d(a){return a.state.search||(a.state.search=new c)}function e(a){return"string"==typeof a&&a==a.toLowerCase()}function f(a,b,c){return a.getSearchCursor(b,c,e(b))}function g(a,b,c,d){a.openDialog(b,d,{value:c,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){o(a)}})}function h(a,b,c,d,e){a.openDialog?a.openDialog(b,e,{value:d,selectValueOnOpen:!0}):e(prompt(c,d))}function i(a,b,c,d){a.openConfirm?a.openConfirm(b,d):confirm(c)&&d[0]()}function j(a){return a.replace(/\\(.)/g,function(a,b){return"n"==b?"\n":"r"==b?"\r":b})}function k(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);if(b)try{a=new RegExp(b[1],-1==b[2].indexOf("i")?"":"i")}catch(c){}else a=j(a);return("string"==typeof a?""==a:a.test(""))&&(a=/x^/),a}function l(a,c,d){c.queryText=d,c.query=k(d),a.removeOverlay(c.overlay,e(c.query)),c.overlay=b(c.query,e(c.query)),a.addOverlay(c.overlay),a.showMatchesOnScrollbar&&(c.annotate&&(c.annotate.clear(),c.annotate=null),c.annotate=a.showMatchesOnScrollbar(c.query,e(c.query)))}function m(b,c,e){var f=d(b);if(f.query)return n(b,c);var i=b.getSelection()||f.lastQuery;if(e&&b.openDialog){var j=null;g(b,r,i,function(c,d){a.e_stop(d),c&&(c!=f.queryText&&l(b,f,c),j&&(j.style.opacity=1),n(b,d.shiftKey,function(a,c){var d;c.line<3&&document.querySelector&&(d=b.display.wrapper.querySelector(".CodeMirror-dialog"))&&d.getBoundingClientRect().bottom-4>b.cursorCoords(c,"window").top&&((j=d).style.opacity=.4)}))})}else h(b,r,"Search for:",i,function(a){a&&!f.query&&b.operation(function(){l(b,f,a),f.posFrom=f.posTo=b.getCursor(),n(b,c)})})}function n(b,c,e){b.operation(function(){
|
7 |
-
var g=d(b),h=f(b,g.query,c?g.posFrom:g.posTo);(h.find(c)||(h=f(b,g.query,c?a.Pos(b.lastLine()):a.Pos(b.firstLine(),0)),h.find(c)))&&(b.setSelection(h.from(),h.to()),b.scrollIntoView({from:h.from(),to:h.to()},20),g.posFrom=h.from(),g.posTo=h.to(),e&&e(h.from(),h.to()))})}function o(a){a.operation(function(){var b=d(a);b.lastQuery=b.query,b.query&&(b.query=b.queryText=null,a.removeOverlay(b.overlay),b.annotate&&(b.annotate.clear(),b.annotate=null))})}function p(a,b,c){a.operation(function(){for(var d=f(a,b);d.findNext();)if("string"!=typeof b){var e=a.getRange(d.from(),d.to()).match(b);d.replace(c.replace(/\$(\d)/g,function(a,b){return e[b]}))}else d.replace(c)})}function q(a,b){if(!a.getOption("readOnly")){var c=a.getSelection()||d(a).lastQuery,e=b?"Replace all:":"Replace:";h(a,e+s,e,c,function(c){c&&(c=k(c),h(a,t,"Replace with:","",function(d){if(d=j(d),b)p(a,c,d);else{o(a);var e=f(a,c,a.getCursor()),g=function(){var b,j=e.from();!(b=e.findNext())&&(e=f(a,c),!(b=e.findNext())||j&&e.from().line==j.line&&e.from().ch==j.ch)||(a.setSelection(e.from(),e.to()),a.scrollIntoView({from:e.from(),to:e.to()}),i(a,u,"Replace?",[function(){h(b)},g,function(){p(a,c,d)}]))},h=function(a){e.replace("string"==typeof c?d:d.replace(/\$(\d)/g,function(b,c){return a[c]})),g()};g()}}))})}}var r='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',s=' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',t='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',u="Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";a.commands.find=function(a){o(a),m(a)},a.commands.findPersistent=function(a){o(a),m(a,!1,!0)},a.commands.findNext=m,a.commands.findPrev=function(a){m(a,!0)},a.commands.clearSearch=o,a.commands.replace=q,a.commands.replaceAll=function(a){q(a,!0)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function b(a,b,d,e){var f=a.getLineHandle(b.line),i=b.ch-1,j=i>=0&&h[f.text.charAt(i)]||h[f.text.charAt(++i)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&k>0!=(i==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,i+1)),m=c(a,g(b.line,i+(k>0?1:0)),k,l||null,e);return null==m?null:{from:g(b.line,i),to:m&&m.pos,match:m&&m.ch==j.charAt(0),forward:k>0}}function c(a,b,c,d,e){for(var f=e&&e.maxScanLineLength||1e4,i=e&&e.maxScanLines||1e3,j=[],k=e&&e.bracketRegex?e.bracketRegex:/[(){}[\]]/,l=c>0?Math.min(b.line+i,a.lastLine()+1):Math.max(a.firstLine()-1,b.line-i),m=b.line;m!=l;m+=c){var n=a.getLine(m);if(n){var o=c>0?0:n.length-1,p=c>0?n.length:-1;if(!(n.length>f))for(m==b.line&&(o=b.ch-(0>c?1:0));o!=p;o+=c){var q=n.charAt(o);if(k.test(q)&&(void 0===d||a.getTokenTypeAt(g(m,o+1))==d)){var r=h[q];if(">"==r.charAt(1)==c>0)j.push(q);else{if(!j.length)return{pos:g(m,o),ch:q};j.pop()}}}}}return m-c==(c>0?a.lastLine():a.firstLine())?!1:null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j<i.length;j++){var k=i[j].empty()&&b(a,i[j].head,!1,d);if(k&&a.getLine(k.from.line).length<=e){var l=k.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";h.push(a.markText(k.from,g(k.from.line,k.from.ch+1),{className:l})),k.to&&a.getLine(k.to.line).length<=e&&h.push(a.markText(k.to,g(k.to.line,k.to.ch+1),{className:l}))}}if(h.length){f&&a.state.focused&&a.focus();var m=function(){a.operation(function(){for(var a=0;a<h.length;a++)h[a].clear()})};if(!c)return m;setTimeout(m,800)}}function e(a){a.operation(function(){i&&(i(),i=null),i=d(a,!1,a.state.matchBrackets)})}var f=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),g=a.Pos,h={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},i=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&b.off("cursorActivity",e),c&&(b.state.matchBrackets="object"==typeof c?c:{},b.on("cursorActivity",e))}),a.defineExtension("matchBrackets",function(){d(this,!0)}),a.defineExtension("findMatchingBracket",function(a,c,d){return b(this,a,c,d)}),a.defineExtension("scanForBracket",function(a,b,d,e){return c(this,a,b,d,e)})});
|
1 |
+
!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);(this||window).CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d?Le(d):{},Le(ag,d,!1),n(d);var e=d.value;"string"==typeof e&&(e=new yg(e,d.mode,null,d.lineSeparator)),this.doc=e;var f=new a.inputStyles[d.inputStyle](this),g=this.display=new b(c,e,f);g.wrapper.CodeMirror=this,j(this),h(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!Df&&g.input.focus(),r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ee,keySeq:null,specialChars:null};var i=this;tf&&11>uf&&setTimeout(function(){i.display.input.reset(!0)},20),Rb(this),Xe(),vb(this),this.curOp.forceUpdate=!0,Yd(this,e),d.autofocus&&!Df||i.hasFocus()?setTimeout(Me(rc,this),20):sc(this);for(var k in bg)bg.hasOwnProperty(k)&&bg[k](this,d[k],cg);w(this),d.finishInit&&d.finishInit(this);for(var l=0;l<gg.length;++l)gg[l](this);xb(this),vf&&d.lineWrapping&&"optimizelegibility"==getComputedStyle(g.lineDiv).textRendering&&(g.lineDiv.style.textRendering="auto")}function b(a,b,c){var d=this;this.input=c,d.scrollbarFiller=Qe("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=Qe("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=Qe("div",null,"CodeMirror-code"),d.selectionDiv=Qe("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=Qe("div",null,"CodeMirror-cursors"),d.measure=Qe("div",null,"CodeMirror-measure"),d.lineMeasure=Qe("div",null,"CodeMirror-measure"),d.lineSpace=Qe("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none"),d.mover=Qe("div",[Qe("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=Qe("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=Qe("div",null,null,"position: absolute; height: "+Jg+"px; width: 1px;"),d.gutters=Qe("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=Qe("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=Qe("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),tf&&8>uf&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),vf||qf&&Df||(d.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(d.wrapper):a(d.wrapper)),d.viewFrom=d.viewTo=b.first,d.reportedViewFrom=d.reportedViewTo=b.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,c.init(d)}function c(b){b.doc.mode=a.getMode(b.options,b.doc.modeOption),d(b)}function d(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Na(a,100),a.state.modeGen++,a.curOp&&Kb(a)}function e(a){a.options.lineWrapping?($g(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Zg(a.display.wrapper,"CodeMirror-wrap"),m(a)),g(a),Kb(a),ib(a),setTimeout(function(){s(a)},100)}function f(a){var b=tb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/ub(a.display)-3);return function(e){if(wd(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function g(a){var b=a.doc,c=f(a);b.iter(function(a){var b=c(a);b!=a.height&&ae(a,b)})}function h(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ib(a)}function i(a){j(a),Kb(a),setTimeout(function(){v(a)},20)}function j(a){var b=a.display.gutters,c=a.options.gutters;Re(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(Qe("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none",k(a)}function k(a){var b=a.display.gutters.offsetWidth;a.display.sizer.style.marginLeft=b+"px"}function l(a){if(0==a.height)return 0;for(var b,c=a.text.length,d=a;b=pd(d);){var e=b.find(0,!0);d=e.from.line,c+=e.from.ch-e.to.ch}for(d=a;b=qd(d);){var e=b.find(0,!0);c-=d.text.length-e.from.ch,d=e.to.line,c+=d.text.length-e.to.ch}return c}function m(a){var b=a.display,c=a.doc;b.maxLine=Zd(c,c.first),b.maxLineLength=l(b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var c=l(a);c>b.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=He(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Sa(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Ua(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function p(a,b,c){this.cm=c;var d=this.vert=Qe("div",[Qe("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=Qe("div",[Qe("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d),a(e),Eg(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")}),Eg(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,tf&&8>uf&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function r(b){b.display.scrollbars&&(b.display.scrollbars.clear(),b.display.scrollbars.addClass&&Zg(b.display.wrapper,b.display.scrollbars.addClass)),b.display.scrollbars=new a.scrollbarModel[b.options.scrollbarStyle](function(a){b.display.wrapper.insertBefore(a,b.display.scrollbarFiller),Eg(a,"mousedown",function(){b.state.focused&&setTimeout(function(){b.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,c){"horizontal"==c?fc(b,a):ec(b,a)},b),b.display.scrollbars.addClass&&$g(b.display.wrapper,b.display.scrollbars.addClass)}function s(a,b){b||(b=o(a));var c=a.display.barWidth,d=a.display.barHeight;t(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&F(a),t(a,o(a)),c=a.display.barWidth,d=a.display.barHeight}function t(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",c.heightForcer.style.borderBottom=d.bottom+"px solid transparent",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function u(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Ra(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=ce(b,d),g=ce(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;f>h?(f=h,g=ce(b,de(Zd(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=ce(b,de(Zd(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function v(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=y(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&c[g].gutter&&(c[g].gutter.style.left=f);var h=c[g].alignable;if(h)for(var i=0;i<h.length;i++)h[i].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function w(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=x(a.options,b.first+b.size-1),d=a.display;if(c.length!=d.lineNumChars){var e=d.measure.appendChild(Qe("div",[Qe("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),f=e.firstChild.offsetWidth,g=e.offsetWidth-f;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(f,d.lineGutter.offsetWidth-g)+1,d.lineNumWidth=d.lineNumInnerWidth+g,d.lineNumChars=d.lineNumInnerWidth?c.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",k(a),!0}return!1}function x(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function y(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function z(a,b,c){var d=a.display;this.viewport=b,this.visible=u(d,a.doc,b),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=Va(a),this.force=c,this.dims=H(a),this.events=[]}function A(a){var b=a.display;!b.scrollbarsClipped&&b.scroller.offsetWidth&&(b.nativeBarWidth=b.scroller.offsetWidth-b.scroller.clientWidth,b.heightForcer.style.height=Ua(a)+"px",b.sizer.style.marginBottom=-b.nativeBarWidth+"px",b.sizer.style.borderRightWidth=Ua(a)+"px",b.scrollbarsClipped=!0)}function B(a,b){var c=a.display,d=a.doc;if(b.editorIsHidden)return Mb(a),!1;if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Qb(a))return!1;w(a)&&(Mb(a),b.dims=H(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFrom<f&&f-c.viewFrom<20&&(f=Math.max(d.first,c.viewFrom)),c.viewTo>g&&c.viewTo-g<20&&(g=Math.min(e,c.viewTo)),Lf&&(f=ud(a.doc,f),g=vd(a.doc,g));var h=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;Pb(a,f,g),c.viewOffset=de(Zd(a.doc,c.viewFrom)),a.display.mover.style.top=c.viewOffset+"px";var i=Qb(a);if(!h&&0==i&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;var j=Te();return i>4&&(c.lineDiv.style.display="none"),I(a,c.updateLineNumbers,b.dims),i>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,j&&Te()!=j&&j.offsetHeight&&j.focus(),Re(c.cursorDiv),Re(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,h&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,Na(a,400)),c.updateLineNumbers=null,!0}function C(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Va(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Sa(a.display)-Wa(a),c.top)}),b.visible=u(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&B(a,b);d=!1){F(a);var e=o(a);Ia(a),s(a,e),E(a,e)}b.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function D(a,b){var c=new z(a,b);if(B(a,c)){F(a),C(a,c);var d=o(a);Ia(a),s(a,d),E(a,d),c.finish()}}function E(a,b){a.display.sizer.style.minHeight=b.docHeight+"px",a.display.heightForcer.style.top=b.docHeight+"px",a.display.gutters.style.height=b.docHeight+a.display.barHeight+Ua(a)+"px"}function F(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;d<b.view.length;d++){var e,f=b.view[d];if(!f.hidden){if(tf&&8>uf){var g=f.node.offsetTop+f.node.offsetHeight;e=g-c,c=g}else{var h=f.node.getBoundingClientRect();e=h.bottom-h.top}var i=f.line.height-e;if(2>e&&(e=tb(b)),(i>.001||-.001>i)&&(ae(f.line,e),G(f.line),f.rest))for(var j=0;j<f.rest.length;j++)G(f.rest[j])}}}function G(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.parentNode.offsetHeight}function H(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:y(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function I(a,b,c){function d(b){var c=b.nextSibling;return vf&&Ef&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b),c}for(var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,i=e.view,j=e.viewFrom,k=0;k<i.length;k++){var l=i[k];if(l.hidden);else if(l.node&&l.node.parentNode==g){for(;h!=l.node;)h=d(h);var m=f&&null!=b&&j>=b&&l.lineNumber;l.changes&&(He(l.changes,"gutter")>-1&&(m=!1),J(a,l,j,c)),m&&(Re(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(x(a.options,j)))),h=l.node.nextSibling}else{var n=R(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function J(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];"text"==f?N(a,b):"gutter"==f?P(a,b,c,d):"class"==f?O(b):"widget"==f&&Q(a,b,d)}b.changes=null}function K(a){return a.node==a.text&&(a.node=Qe("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),tf&&8>uf&&(a.node.style.zIndex=2)),a.node}function L(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=K(a);a.background=c.insertBefore(Qe("div",null,b),c.firstChild)}}function M(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Md(a,b)}function N(a,b){var c=b.text.className,d=M(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,O(b)):c&&(b.text.className=c)}function O(a){L(a),a.line.wrapClass?K(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function P(a,b,c,d){if(b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null),b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null),b.line.gutterClass){var e=K(b);b.gutterBackground=Qe("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px"),e.insertBefore(b.gutterBackground,b.text)}var f=b.line.gutterMarkers;if(a.options.lineNumbers||f){var e=K(b),g=b.gutter=Qe("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px");if(a.display.input.setUneditable(g),e.insertBefore(g,b.text),b.line.gutterClass&&(g.className+=" "+b.line.gutterClass),!a.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(Qe("div",x(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),f)for(var h=0;h<a.options.gutters.length;++h){var i=a.options.gutters[h],j=f.hasOwnProperty(i)&&f[i];j&&g.appendChild(Qe("div",[j],"CodeMirror-gutter-elt","left: "+d.gutterLeft[i]+"px; width: "+d.gutterWidth[i]+"px"))}}}function Q(a,b,c){b.alignable&&(b.alignable=null);for(var d,e=b.node.firstChild;e;e=d){var d=e.nextSibling;"CodeMirror-linewidget"==e.className&&b.node.removeChild(e)}S(a,b,c)}function R(a,b,c,d){var e=M(a,b);return b.text=b.node=e.pre,e.bgClass&&(b.bgClass=e.bgClass),e.textClass&&(b.textClass=e.textClass),O(b),P(a,b,c,d),S(a,b,d),b.node}function S(a,b,c){if(T(a,b.line,b,c,!0),b.rest)for(var d=0;d<b.rest.length;d++)T(a,b.rest[d],b,c,!1)}function T(a,b,c,d,e){if(b.widgets)for(var f=K(c),g=0,h=b.widgets;g<h.length;++g){var i=h[g],j=Qe("div",[i.node],"CodeMirror-linewidget");i.handleMouseEvents||j.setAttribute("cm-ignore-events","true"),U(i,j,c,d),a.display.input.setUneditable(j),e&&i.above?f.insertBefore(j,c.gutter||c.text):f.appendChild(j),ye(i,"redraw")}}function U(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function V(a){return Mf(a.line,a.ch)}function W(a,b){return Nf(a,b)<0?b:a}function X(a,b){return Nf(a,b)<0?a:b}function Y(a){a.state.focused||(a.display.input.focus(),rc(a))}function Z(a,b,c,d,e){var f=a.doc;a.display.shift=!1,d||(d=f.sel);var g=a.state.pasteIncoming||"paste"==e,h=f.splitLines(b),i=null;if(g&&d.ranges.length>1)if(Of&&Of.text.join("\n")==b){if(d.ranges.length%Of.text.length==0){i=[];for(var j=0;j<Of.text.length;j++)i.push(f.splitLines(Of.text[j]))}}else h.length==d.ranges.length&&(i=Ie(h,function(a){return[a]}));for(var j=d.ranges.length-1;j>=0;j--){var k=d.ranges[j],l=k.from(),m=k.to();k.empty()&&(c&&c>0?l=Mf(l.line,l.ch-c):a.state.overwrite&&!g?m=Mf(m.line,Math.min(Zd(f,m.line).text.length,m.ch+Ge(h).length)):Of&&Of.lineWise&&Of.text.join("\n")==b&&(l=m=Mf(l.line,0)));var n=a.curOp.updateInput,o={from:l,to:m,text:i?i[j%i.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};Ac(a.doc,o),ye(a,"inputRead",a,o)}b&&!g&&_(a,b),Mc(a),a.curOp.updateInput=n,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function $(a,b){var c=a.clipboardData&&a.clipboardData.getData("text/plain");return c?(a.preventDefault(),b.isReadOnly()||b.options.disableInput||Eb(b,function(){Z(b,c,0,null,"paste")}),!0):void 0}function _(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;d>=0;d--){var e=c.ranges[d];if(!(e.head.ch>100||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars){for(var h=0;h<f.electricChars.length;h++)if(b.indexOf(f.electricChars.charAt(h))>-1){g=Oc(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(Zd(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Oc(a,e.head.line,"smart"));g&&ye(a,"electricInput",a,e.head.line)}}}function aa(a){for(var b=[],c=[],d=0;d<a.doc.sel.ranges.length;d++){var e=a.doc.sel.ranges[d].head.line,f={anchor:Mf(e,0),head:Mf(e+1,0)};c.push(f),b.push(a.getRange(f.anchor,f.head))}return{text:b,ranges:c}}function ba(a){a.setAttribute("autocorrect","off"),a.setAttribute("autocapitalize","off"),a.setAttribute("spellcheck","false")}function ca(a){this.cm=a,this.prevInput="",this.pollingFast=!1,this.polling=new Ee,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function da(){var a=Qe("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),b=Qe("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return vf?a.style.width="1000px":a.setAttribute("wrap","off"),Cf&&(a.style.border="1px solid black"),ba(a),b}function ea(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ee,this.gracePeriod=!1}function fa(a,b){var c=_a(a,b.line);if(!c||c.hidden)return null;var d=Zd(a.doc,b.line),e=Ya(c,d,b.line),f=ee(d),g="left";if(f){var h=kf(f,b.ch);g=h%2?"right":"left"}var i=cb(e.map,b.ch,g);return i.offset="right"==i.collapse?i.end:i.start,i}function ga(a,b){return b&&(a.bad=!0),a}function ha(a,b,c){var d;if(b==a.display.lineDiv){if(d=a.display.lineDiv.childNodes[c],!d)return ga(a.clipPos(Mf(a.display.viewTo-1)),!0);b=null,c=0}else for(d=b;;d=d.parentNode){if(!d||d==a.display.lineDiv)return null;if(d.parentNode&&d.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==d)return ia(f,b,c)}}function ia(a,b,c){function d(b,c,d){for(var e=-1;e<(k?k.length:0);e++)for(var f=0>e?j.map:k[e],g=0;g<f.length;g+=3){var h=f[g+2];if(h==b||h==c){var i=be(0>e?a.line:a.rest[e]),l=f[g]+d;return(0>d||h!=b)&&(l=f[g+(d?1:0)]),Mf(i,l)}}}var e=a.text.firstChild,f=!1;if(!b||!Wg(e,b))return ga(Mf(be(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b)){var g=a.rest?Ge(a.rest):a.line;return ga(Mf(be(g),g.text.length),f)}var h=3==b.nodeType?b:null,i=b;for(h||1!=b.childNodes.length||3!=b.firstChild.nodeType||(h=b.firstChild,c&&(c=h.nodeValue.length));i.parentNode!=e;)i=i.parentNode;var j=a.measure,k=j.maps,l=d(h,i,c);if(l)return ga(l,f);for(var m=i.nextSibling,n=h?h.nodeValue.length-c:0;m;m=m.nextSibling){if(l=d(m,m.firstChild,0))return ga(Mf(l.line,l.ch-n),f);n+=m.textContent.length}for(var o=i.previousSibling,n=c;o;o=o.previousSibling){if(l=d(o,o.firstChild,-1))return ga(Mf(l.line,l.ch+n),f);n+=m.textContent.length}}function ja(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return""==c&&(c=b.textContent.replace(/\u200b/g,"")),void(h+=c);var k,l=b.getAttribute("cm-marker");if(l){var m=a.findMarks(Mf(d,0),Mf(e+1,0),f(+l));return void(m.length&&(k=m[0].find())&&(h+=$d(a.doc,k.from,k.to).join(j)))}if("false"==b.getAttribute("contenteditable"))return;for(var n=0;n<b.childNodes.length;n++)g(b.childNodes[n]);/^(pre|div|p)$/i.test(b.nodeName)&&(i=!0)}else if(3==b.nodeType){var o=b.nodeValue;if(!o)return;i&&(h+=j,i=!1),h+=o}}for(var h="",i=!1,j=a.doc.lineSeparator();g(b),b!=c;)b=b.nextSibling;return h}function ka(a,b){this.ranges=a,this.primIndex=b}function la(a,b){this.anchor=a,this.head=b}function ma(a,b){var c=a[b];a.sort(function(a,b){return Nf(a.from(),b.from())}),b=He(a,c);for(var d=1;d<a.length;d++){var e=a[d],f=a[d-1];if(Nf(f.to(),e.from())>=0){var g=X(f.from(),e.from()),h=W(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new la(i?h:g,i?g:h))}}return new ka(a,b)}function na(a,b){return new ka([new la(a,b||a)],0)}function oa(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function pa(a,b){if(b.line<a.first)return Mf(a.first,0);var c=a.first+a.size-1;return b.line>c?Mf(c,Zd(a,c).text.length):qa(b,Zd(a,b.line).text.length)}function qa(a,b){var c=a.ch;return null==c||c>b?Mf(a.line,b):0>c?Mf(a.line,0):a}function ra(a,b){return b>=a.first&&b<a.first+a.size}function sa(a,b){for(var c=[],d=0;d<b.length;d++)c[d]=pa(a,b[d]);return c}function ta(a,b,c,d){if(a.cm&&a.cm.display.shift||a.extend){var e=b.anchor;if(d){var f=Nf(c,e)<0;f!=Nf(d,e)<0?(e=c,c=d):f!=Nf(c,d)<0&&(c=d)}return new la(e,c)}return new la(d||c,c)}function ua(a,b,c,d){Aa(a,new ka([ta(a,a.sel.primary(),b,c)],0),d)}function va(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=ta(a,a.sel.ranges[e],b[e],null);var f=ma(d,a.sel.primIndex);Aa(a,f,c)}function wa(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c,Aa(a,ma(e,a.sel.primIndex),d)}function xa(a,b,c,d){Aa(a,na(b,c),d)}function ya(a,b,c){var d={ranges:b.ranges,update:function(b){this.ranges=[];for(var c=0;c<b.length;c++)this.ranges[c]=new la(pa(a,b[c].anchor),pa(a,b[c].head))},origin:c&&c.origin};return Hg(a,"beforeSelectionChange",a,d),a.cm&&Hg(a.cm,"beforeSelectionChange",a.cm,d),d.ranges!=b.ranges?ma(d.ranges,d.ranges.length-1):b}function za(a,b,c){var d=a.history.done,e=Ge(d);e&&e.ranges?(d[d.length-1]=b,Ba(a,b,c)):Aa(a,b,c)}function Aa(a,b,c){Ba(a,b,c),le(a,a.sel,a.cm?a.cm.curOp.id:NaN,c)}function Ba(a,b,c){(Ce(a,"beforeSelectionChange")||a.cm&&Ce(a.cm,"beforeSelectionChange"))&&(b=ya(a,b,c));var d=c&&c.bias||(Nf(b.primary().head,a.sel.primary().head)<0?-1:1);Ca(a,Ea(a,b,d,!0)),c&&c.scroll===!1||!a.cm||Mc(a.cm)}function Ca(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,Be(a.cm)),ye(a,"cursorActivity",a))}function Da(a){Ca(a,Ea(a,a.sel,null,!1),Lg)}function Ea(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=b.ranges[f],h=b.ranges.length==a.sel.ranges.length&&a.sel.ranges[f],i=Ga(a,g.anchor,h&&h.anchor,c,d),j=Ga(a,g.head,h&&h.head,c,d);(e||i!=g.anchor||j!=g.head)&&(e||(e=b.ranges.slice(0,f)),e[f]=new la(i,j))}return e?ma(e,b.primIndex):b}function Fa(a,b,c,d,e){var f=Zd(a,b.line);if(f.markedSpans)for(var g=0;g<f.markedSpans.length;++g){var h=f.markedSpans[g],i=h.marker;if((null==h.from||(i.inclusiveLeft?h.from<=b.ch:h.from<b.ch))&&(null==h.to||(i.inclusiveRight?h.to>=b.ch:h.to>b.ch))){if(e&&(Hg(i,"beforeCursorEnter"),i.explicitlyCleared)){if(f.markedSpans){--g;continue}break}if(!i.atomic)continue;if(c){var j,k=i.find(0>d?1:-1);if((0>d?i.inclusiveRight:i.inclusiveLeft)&&(k=Ha(a,k,-d,k&&k.line==b.line?f:null)),k&&k.line==b.line&&(j=Nf(k,c))&&(0>d?0>j:j>0))return Fa(a,k,b,d,e)}var l=i.find(0>d?-1:1);return(0>d?i.inclusiveLeft:i.inclusiveRight)&&(l=Ha(a,l,d,l.line==b.line?f:null)),l?Fa(a,l,b,d,e):null}}return b}function Ga(a,b,c,d,e){var f=d||1,g=Fa(a,b,c,f,e)||!e&&Fa(a,b,c,f,!0)||Fa(a,b,c,-f,e)||!e&&Fa(a,b,c,-f,!0);return g?g:(a.cantEdit=!0,Mf(a.first,0))}function Ha(a,b,c,d){return 0>c&&0==b.ch?b.line>a.first?pa(a,Mf(b.line-1)):null:c>0&&b.ch==(d||Zd(a,b.line)).text.length?b.line<a.first+a.size-1?Mf(b.line+1,0):null:new Mf(b.line,b.ch+c)}function Ia(a){a.display.input.showSelection(a.display.input.prepareSelection())}function Ja(a,b){for(var c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),g=0;g<c.sel.ranges.length;g++)if(b!==!1||g!=c.sel.primIndex){var h=c.sel.ranges[g];if(!(h.from().line>=a.display.viewTo||h.to().line<a.display.viewFrom)){var i=h.empty();(i||a.options.showCursorWhenSelecting)&&Ka(a,h.head,e),i||La(a,h,f)}}return d}function Ka(a,b,c){var d=ob(a,b,"div",null,null,!a.options.singleCursorHeightPerLine),e=c.appendChild(Qe("div"," ","CodeMirror-cursor"));if(e.style.left=d.left+"px",e.style.top=d.top+"px",e.style.height=Math.max(0,d.bottom-d.top)*a.options.cursorHeight+"px",d.other){var f=c.appendChild(Qe("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));f.style.display="",f.style.left=d.other.left+"px",f.style.top=d.other.top+"px",f.style.height=.85*(d.other.bottom-d.other.top)+"px"}}function La(a,b,c){function d(a,b,c,d){0>b&&(b=0),b=Math.round(b),d=Math.round(d),h.appendChild(Qe("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return nb(a,Mf(b,c),"div",l,d)}var h,i,l=Zd(g,b),m=l.text.length;return af(ee(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottom<l.top&&d(n,p.bottom,null,l.top)),null==e&&b==m&&(o=k),(!h||p.top<h.top||p.top==h.top&&p.left<h.left)&&(h=p),(!i||l.bottom>i.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=Ta(a.display),j=i.left,k=Math.max(f.sizerWidth,Va(a)-f.sizer.offsetLeft)-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=Zd(g,l.line),o=Zd(g,m.line),p=sd(n)==sd(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top<r.top-2?(d(q.right,q.top,null,q.bottom),d(j,r.top,r.left,r.bottom)):d(q.right,q.top,r.left-q.right,q.bottom)),q.bottom<r.top&&d(j,q.bottom,null,r.top)}c.appendChild(h)}function Ma(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="",a.options.cursorBlinkRate>0?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Na(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,Me(Oa,a))}function Oa(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=ig(b.mode,Qa(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength,i=Id(a,f,h?ig(b.mode,d):d,!0);f.styles=i.styles;var j=f.styleClasses,k=i.classes;k?f.styleClasses=k:j&&(f.styleClasses=null);for(var l=!g||g.length!=f.styles.length||j!=k&&(!j||!k||j.bgClass!=k.bgClass||j.textClass!=k.textClass),m=0;!l&&m<g.length;++m)l=g[m]!=f.styles[m];l&&e.push(b.frontier),f.stateAfter=h?d:ig(b.mode,d)}else f.text.length<=a.options.maxHighlightLength&&Kd(a,f.text,d),f.stateAfter=b.frontier%5==0?ig(b.mode,d):null;return++b.frontier,+new Date>c?(Na(a,a.options.workDelay),!0):void 0}),e.length&&Eb(a,function(){for(var b=0;b<e.length;b++)Lb(a,e[b],"text")})}}function Pa(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=Zd(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Og(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Qa(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Pa(a,b,c),g=f>d.first&&Zd(d,f-1).stateAfter;return g=g?ig(d.mode,g):jg(d.mode),d.iter(f,b,function(c){Kd(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f<e.viewTo;c.stateAfter=h?ig(d.mode,g):null,++f}),c&&(d.frontier=f),g}function Ra(a){return a.lineSpace.offsetTop}function Sa(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function Ta(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=Se(a.measure,Qe("pre","x")),c=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,d={left:parseInt(c.paddingLeft),right:parseInt(c.paddingRight)};return isNaN(d.left)||isNaN(d.right)||(a.cachedPaddingH=d),d}function Ua(a){return Jg-a.display.nativeBarWidth}function Va(a){return a.display.scroller.clientWidth-Ua(a)-a.display.barWidth}function Wa(a){return a.display.scroller.clientHeight-Ua(a)-a.display.barHeight}function Xa(a,b,c){var d=a.options.lineWrapping,e=d&&Va(a);if(!b.measure.heights||d&&b.measure.width!=e){var f=b.measure.heights=[];if(d){b.measure.width=e;for(var g=b.text.firstChild.getClientRects(),h=0;h<g.length-1;h++){var i=g[h],j=g[h+1];Math.abs(i.bottom-j.bottom)>2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Ya(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;d<a.rest.length;d++)if(a.rest[d]==b)return{map:a.measure.maps[d],cache:a.measure.caches[d]};for(var d=0;d<a.rest.length;d++)if(be(a.rest[d])>c)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function Za(a,b){b=sd(b);var c=be(b),d=a.display.externalMeasured=new Ib(a.doc,b,c);d.lineN=c;var e=d.built=Md(a,d);return d.text=e.pre,Se(a.display.lineMeasure,e.pre),d}function $a(a,b,c,d){return bb(a,ab(a,b),c,d)}function _a(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[Nb(a,b)];var c=a.display.externalMeasured;return c&&b>=c.lineN&&b<c.lineN+c.size?c:void 0}function ab(a,b){var c=be(b),d=_a(a,c);d&&!d.text?d=null:d&&d.changes&&(J(a,d,c,H(a)),a.curOp.forceUpdate=!0),d||(d=Za(a,b));var e=Ya(d,b,c);return{line:b,view:d,rect:null,map:e.map,cache:e.cache,before:e.before,hasHeights:!1}}function bb(a,b,c,d,e){b.before&&(c=-1);var f,g=c+(d||"");return b.cache.hasOwnProperty(g)?f=b.cache[g]:(b.rect||(b.rect=b.view.text.getBoundingClientRect()),b.hasHeights||(Xa(a,b.view,b.rect),b.hasHeights=!0),f=eb(a,b,c,d),f.bogus||(b.cache[g]=f)),{left:f.left,right:f.right,top:e?f.rtop:f.top,bottom:e?f.rbottom:f.bottom}}function cb(a,b,c){for(var d,e,f,g,h=0;h<a.length;h+=3){var i=a[h],j=a[h+1];if(i>b?(e=0,f=1,g="left"):j>b?(e=b-i,
|
2 |
+
f=e+1):(h==a.length-3||b==j&&a[h+3]>b)&&(f=j-i,e=f-1,b>=j&&(g="right")),null!=e){if(d=a[h+2],i==j&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=a[(h-=3)+2],g="left";if("right"==c&&e==j-i)for(;h<a.length-3&&a[h+3]==a[h+4]&&!a[h+5].insertLeft;)d=a[(h+=3)+2],g="right";break}}return{node:d,start:e,end:f,collapse:g,coverStart:i,coverEnd:j}}function db(a,b){var c=Sf;if("left"==b)for(var d=0;d<a.length&&(c=a[d]).left==c.right;d++);else for(var d=a.length-1;d>=0&&(c=a[d]).left==c.right;d--);return c}function eb(a,b,c,d){var e,f=cb(b.map,c,d),g=f.node,h=f.start,i=f.end,j=f.collapse;if(3==g.nodeType){for(var k=0;4>k;k++){for(;h&&Pe(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+i<f.coverEnd&&Pe(b.line.text.charAt(f.coverStart+i));)++i;if(e=tf&&9>uf&&0==h&&i==f.coverEnd-f.coverStart?g.parentNode.getBoundingClientRect():db(Sg(g,h,i).getClientRects(),d),e.left||e.right||0==h)break;i=h,h-=1,j="right"}tf&&11>uf&&(e=fb(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(tf&&9>uf&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+ub(a.display),top:m.top,bottom:m.bottom}:Sf}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,k=0;k<q.length-1&&!(p<q[k]);k++);var r=k?q[k-1]:0,s=q[k],t={left:("right"==j?e.right:e.left)-b.rect.left,right:("left"==j?e.left:e.right)-b.rect.left,top:r,bottom:s};return e.left||e.right||(t.bogus=!0),a.options.singleCursorHeightPerLine||(t.rtop=n,t.rbottom=o),t}function fb(a,b){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!_e(a))return b;var c=screen.logicalXDPI/screen.deviceXDPI,d=screen.logicalYDPI/screen.deviceYDPI;return{left:b.left*c,right:b.right*c,top:b.top*d,bottom:b.bottom*d}}function gb(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function hb(a){a.display.externalMeasure=null,Re(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)gb(a.display.view[b])}function ib(a){hb(a),a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function jb(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function kb(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function lb(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=zd(b.widgets[e]);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=de(b);if("local"==d?g+=Ra(a.display):g-=a.display.viewOffset,"page"==d||"window"==d){var h=a.display.lineSpace.getBoundingClientRect();g+=h.top+("window"==d?0:kb());var i=h.left+("window"==d?0:jb());c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function mb(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=jb(),e-=kb();else if("local"==c||!c){var f=a.display.sizer.getBoundingClientRect();d+=f.left,e+=f.top}var g=a.display.lineSpace.getBoundingClientRect();return{left:d-g.left,top:e-g.top}}function nb(a,b,c,d,e){return d||(d=Zd(a.doc,b.line)),lb(a,d,$a(a,d,b.ch,e),c)}function ob(a,b,c,d,e,f){function g(b,g){var h=bb(a,e,b,g?"right":"left",f);return g?h.left=h.right:h.right=h.left,lb(a,d,h,c)}function h(a,b){var c=i[b],d=c.level%2;return a==bf(c)&&b&&c.level<i[b-1].level?(c=i[--b],a=cf(c)-(c.level%2?0:1),d=!0):a==cf(c)&&b<i.length-1&&c.level<i[b+1].level&&(c=i[++b],a=bf(c)-c.level%2,d=!1),d&&a==c.to&&a>c.from?g(a-1):g(a,d)}d=d||Zd(a.doc,b.line),e||(e=ab(a,d));var i=ee(d),j=b.ch;if(!i)return g(j);var k=kf(i,j),l=h(j,k);return null!=gh&&(l.other=h(j,gh)),l}function pb(a,b){var c=0,b=pa(a.doc,b);a.options.lineWrapping||(c=ub(a.display)*b.ch);var d=Zd(a.doc,b.line),e=de(d)+Ra(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function qb(a,b,c,d){var e=Mf(a,b);return e.xRel=d,c&&(e.outside=!0),e}function rb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return qb(d.first,0,!0,-1);var e=ce(d,c),f=d.first+d.size-1;if(e>f)return qb(d.first+d.size-1,Zd(d,f).text.length,!0,1);0>b&&(b=0);for(var g=Zd(d,e);;){var h=sb(a,g,e,b,c),i=qd(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=be(g=j.to.line)}}function sb(a,b,c,d,e){function f(d){var e=ob(a,Mf(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:g<e.top?e.left+i:(h=!1,e.left)}var g=e-de(b),h=!1,i=2*a.display.wrapper.clientWidth,j=ab(a,b),k=ee(b),l=b.text.length,m=df(b),n=ef(b),o=f(m),p=h,q=f(n),r=h;if(d>q)return qb(c,n,r,1);for(;;){if(k?n==m||n==mf(b,m,1):1>=n-m){var s=o>d||q-d>=d-o?m:n,t=s==m?p:r,u=d-(s==m?o:q);if(r&&!k&&!/\s/.test(b.text.charAt(s))&&u>0&&s<b.text.length&&j.view.measure.heights.length>1){var v=bb(a,j,s,"right");g<=v.bottom&&g>=v.top&&Math.abs(d-v.right)<u&&(t=!1,s++,u=d-v.right)}for(;Pe(b.text.charAt(s));)++s;var w=qb(c,s,t,-1>u?-1:u>1?1:0);return w}var x=Math.ceil(l/2),y=m+x;if(k){y=m;for(var z=0;x>z;++z)y=mf(b,y,1)}var A=f(y);A>d?(n=y,q=A,(r=h)&&(q+=1e3),l=x):(m=y,o=A,p=h,l-=x)}}function tb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Pf){Pf=Qe("pre");for(var b=0;49>b;++b)Pf.appendChild(document.createTextNode("x")),Pf.appendChild(Qe("br"));Pf.appendChild(document.createTextNode("x"))}Se(a.measure,Pf);var c=Pf.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Re(a.measure),c||1}function ub(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Qe("span","xxxxxxxxxx"),c=Qe("pre",[b]);Se(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function vb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Uf},Tf?Tf.ops.push(a.curOp):a.curOp.ownsGroup=Tf={ops:[a.curOp],delayedCallbacks:[]}}function wb(a){var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c].call(null);for(var d=0;d<a.ops.length;d++){var e=a.ops[d];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++].call(null,e.cm)}}while(c<b.length)}function xb(a){var b=a.curOp,c=b.ownsGroup;if(c)try{wb(c)}finally{Tf=null;for(var d=0;d<c.ops.length;d++)c.ops[d].cm.curOp=null;yb(c)}}function yb(a){for(var b=a.ops,c=0;c<b.length;c++)zb(b[c]);for(var c=0;c<b.length;c++)Ab(b[c]);for(var c=0;c<b.length;c++)Bb(b[c]);for(var c=0;c<b.length;c++)Cb(b[c]);for(var c=0;c<b.length;c++)Db(b[c])}function zb(a){var b=a.cm,c=b.display;A(b),a.updateMaxLine&&m(b),a.mustUpdate=a.viewChanged||a.forceUpdate||null!=a.scrollTop||a.scrollToPos&&(a.scrollToPos.from.line<c.viewFrom||a.scrollToPos.to.line>=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new z(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function Ab(a){a.updatedDisplay=a.mustUpdate&&B(a.cm,a.update)}function Bb(a){var b=a.cm,c=b.display;a.updatedDisplay&&F(b),a.barMeasure=o(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=$a(b,c.maxLine,c.maxLine.text.length).left+3,b.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+a.adjustWidthTo+Ua(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Va(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection(a.focus))}function Cb(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeft<b.doc.scrollLeft&&fc(b,Math.min(b.display.scroller.scrollLeft,a.maxScrollLeft),!0),b.display.maxLineChanged=!1);var c=a.focus&&a.focus==Te()&&(!document.hasFocus||document.hasFocus());a.preparedSelection&&b.display.input.showSelection(a.preparedSelection,c),(a.updatedDisplay||a.startHeight!=b.doc.height)&&s(b,a.barMeasure),a.updatedDisplay&&E(b,a.barMeasure),a.selectionChanged&&Ma(b),b.state.focused&&a.updateInput&&b.display.input.reset(a.typing),c&&Y(a.cm)}function Db(a){var b=a.cm,c=b.display,d=b.doc;if(a.updatedDisplay&&C(b,a.update),null==c.wheelStartX||null==a.scrollTop&&null==a.scrollLeft&&!a.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null==a.scrollTop||c.scroller.scrollTop==a.scrollTop&&!a.forceScroll||(d.scrollTop=Math.max(0,Math.min(c.scroller.scrollHeight-c.scroller.clientHeight,a.scrollTop)),c.scrollbars.setScrollTop(d.scrollTop),c.scroller.scrollTop=d.scrollTop),null==a.scrollLeft||c.scroller.scrollLeft==a.scrollLeft&&!a.forceScroll||(d.scrollLeft=Math.max(0,Math.min(c.scroller.scrollWidth-c.scroller.clientWidth,a.scrollLeft)),c.scrollbars.setScrollLeft(d.scrollLeft),c.scroller.scrollLeft=d.scrollLeft,v(b)),a.scrollToPos){var e=Ic(b,pa(d,a.scrollToPos.from),pa(d,a.scrollToPos.to),a.scrollToPos.margin);a.scrollToPos.isCursor&&b.state.focused&&Hc(b,e)}var f=a.maybeHiddenMarkers,g=a.maybeUnhiddenMarkers;if(f)for(var h=0;h<f.length;++h)f[h].lines.length||Hg(f[h],"hide");if(g)for(var h=0;h<g.length;++h)g[h].lines.length&&Hg(g[h],"unhide");c.wrapper.offsetHeight&&(d.scrollTop=b.display.scroller.scrollTop),a.changeObjs&&Hg(b,"changes",b,a.changeObjs),a.update&&a.update.finish()}function Eb(a,b){if(a.curOp)return b();vb(a);try{return b()}finally{xb(a)}}function Fb(a,b){return function(){if(a.curOp)return b.apply(a,arguments);vb(a);try{return b.apply(a,arguments)}finally{xb(a)}}}function Gb(a){return function(){if(this.curOp)return a.apply(this,arguments);vb(this);try{return a.apply(this,arguments)}finally{xb(this)}}}function Hb(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);vb(b);try{return a.apply(this,arguments)}finally{xb(b)}}}function Ib(a,b,c){this.line=b,this.rest=td(b),this.size=this.rest?be(Ge(this.rest))-c+1:1,this.node=this.text=null,this.hidden=wd(a,b)}function Jb(a,b,c){for(var d,e=[],f=b;c>f;f=d){var g=new Ib(a.doc,Zd(a.doc,f),f);d=f+g.size,e.push(g)}return e}function Kb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Lf&&ud(a.doc,b)<e.viewTo&&Mb(a);else if(c<=e.viewFrom)Lf&&vd(a.doc,c+d)>e.viewFrom?Mb(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Mb(a);else if(b<=e.viewFrom){var f=Ob(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Mb(a)}else if(c>=e.viewTo){var f=Ob(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Mb(a)}else{var g=Ob(a,b,b,-1),h=Ob(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Jb(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Mb(a)}var i=e.externalMeasured;i&&(c<i.lineN?i.lineN+=d:b<i.lineN+i.size&&(e.externalMeasured=null))}function Lb(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;if(e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null),!(b<d.viewFrom||b>=d.viewTo)){var f=d.view[Nb(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==He(g,c)&&g.push(c)}}}function Mb(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Nb(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,0>b)return d}function Ob(a,b,c,d){var e,f=Nb(a,b),g=a.display.view;if(!Lf||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;ud(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function Pb(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Jb(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Jb(a,b,d.viewFrom).concat(d.view):d.viewFrom<b&&(d.view=d.view.slice(Nb(a,b))),d.viewFrom=b,d.viewTo<c?d.view=d.view.concat(Jb(a,d.viewTo,c)):d.viewTo>c&&(d.view=d.view.slice(0,Nb(a,c)))),d.viewTo=c}function Qb(a){for(var b=a.display.view,c=0,d=0;d<b.length;d++){var e=b[d];e.hidden||e.node&&!e.changes||++c}return c}function Rb(a){function b(){e.activeTouch&&(f=setTimeout(function(){e.activeTouch=null},1e3),g=e.activeTouch,g.end=+new Date)}function c(a){if(1!=a.touches.length)return!1;var b=a.touches[0];return b.radiusX<=1&&b.radiusY<=1}function d(a,b){if(null==b.left)return!0;var c=b.left-a.left,d=b.top-a.top;return c*c+d*d>400}var e=a.display;Eg(e.scroller,"mousedown",Fb(a,Wb)),tf&&11>uf?Eg(e.scroller,"dblclick",Fb(a,function(b){if(!Ae(a,b)){var c=Vb(a,b);if(c&&!_b(a,b)&&!Ub(a.display,b)){Bg(b);var d=a.findWordAt(c);ua(a.doc,d.anchor,d.head)}}})):Eg(e.scroller,"dblclick",function(b){Ae(a,b)||Bg(b)}),Jf||Eg(e.scroller,"contextmenu",function(b){tc(a,b)});var f,g={end:0};Eg(e.scroller,"touchstart",function(b){if(!Ae(a,b)&&!c(b)){clearTimeout(f);var d=+new Date;e.activeTouch={start:d,moved:!1,prev:d-g.end<=300?g:null},1==b.touches.length&&(e.activeTouch.left=b.touches[0].pageX,e.activeTouch.top=b.touches[0].pageY)}}),Eg(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),Eg(e.scroller,"touchend",function(c){var f=e.activeTouch;if(f&&!Ub(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new la(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new la(Mf(h.line,0),pa(a.doc,Mf(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),Bg(c)}b()}),Eg(e.scroller,"touchcancel",b),Eg(e.scroller,"scroll",function(){e.scroller.clientHeight&&(ec(a,e.scroller.scrollTop),fc(a,e.scroller.scrollLeft,!0),Hg(a,"scroll",a))}),Eg(e.scroller,"mousewheel",function(b){gc(a,b)}),Eg(e.scroller,"DOMMouseScroll",function(b){gc(a,b)}),Eg(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(b){Ae(a,b)||Dg(b)},over:function(b){Ae(a,b)||(cc(a,b),Dg(b))},start:function(b){bc(a,b)},drop:Fb(a,ac),leave:function(b){Ae(a,b)||dc(a)}};var h=e.input.getField();Eg(h,"keyup",function(b){oc.call(a,b)}),Eg(h,"keydown",Fb(a,mc)),Eg(h,"keypress",Fb(a,pc)),Eg(h,"focus",Me(rc,a)),Eg(h,"blur",Me(sc,a))}function Sb(b,c,d){var e=d&&d!=a.Init;if(!c!=!e){var f=b.display.dragFunctions,g=c?Eg:Gg;g(b.display.scroller,"dragstart",f.start),g(b.display.scroller,"dragenter",f.enter),g(b.display.scroller,"dragover",f.over),g(b.display.scroller,"dragleave",f.leave),g(b.display.scroller,"drop",f.drop)}}function Tb(a){var b=a.display;(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)&&(b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize())}function Ub(a,b){for(var c=ve(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Vb(a,b,c,d){var e=a.display;if(!c&&"true"==ve(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(b){return null}var i,j=rb(a,f,g);if(d&&1==j.xRel&&(i=Zd(a.doc,j.line).text).length==j.ch){var k=Og(i,i.length,a.options.tabSize)-i.length;j=Mf(j.line,Math.max(0,Math.round((f-Ta(a.display).left)/ub(a.display))-k))}return j}function Wb(a){var b=this,c=b.display;if(!(Ae(b,a)||c.activeTouch&&c.input.supportsTouch())){if(c.shift=a.shiftKey,Ub(c,a))return void(vf||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!_b(b,a)){var d=Vb(b,a);switch(window.focus(),we(a)){case 1:b.state.selectingText?b.state.selectingText(a):d?Xb(b,a,d):ve(a)==c.scroller&&Bg(a);break;case 2:vf&&(b.state.lastMiddleDown=+new Date),d&&ua(b.doc,d),setTimeout(function(){c.input.focus()},20),Bg(a);break;case 3:Jf?tc(b,a):qc(b)}}}}function Xb(a,b,c){tf?setTimeout(Me(Y,a),0):a.curOp.focus=Te();var d,e=+new Date;Rf&&Rf.time>e-400&&0==Nf(Rf.pos,c)?d="triple":Qf&&Qf.time>e-400&&0==Nf(Qf.pos,c)?(d="double",Rf={time:e,pos:c}):(d="single",Qf={time:e,pos:c});var f,g=a.doc.sel,h=Ef?b.metaKey:b.ctrlKey;a.options.dragDrop&&ah&&!a.isReadOnly()&&"single"==d&&(f=g.contains(c))>-1&&(Nf((f=g.ranges[f]).from(),c)<0||c.xRel>0)&&(Nf(f.to(),c)>0||c.xRel<0)?Yb(a,b,c,h):Zb(a,b,c,d,h)}function Yb(a,b,c,d){var e=a.display,f=+new Date,g=Fb(a,function(h){vf&&(e.scroller.draggable=!1),a.state.draggingText=!1,Gg(document,"mouseup",g),Gg(e.scroller,"drop",g),Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)<10&&(Bg(h),!d&&+new Date-200<f&&ua(a.doc,c),vf||tf&&9==uf?setTimeout(function(){document.body.focus(),e.input.focus()},20):e.input.focus())});vf&&(e.scroller.draggable=!0),a.state.draggingText=g,g.copy=Ef?b.altKey:b.ctrlKey,e.scroller.dragDrop&&e.scroller.dragDrop(),Eg(document,"mouseup",g),Eg(e.scroller,"drop",g)}function Zb(a,b,c,d,e){function f(b){if(0!=Nf(q,b))if(q=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=Og(Zd(j,c.line).text,c.ch,f),h=Og(Zd(j,b.line).text,b.ch,f),i=Math.min(g,h),n=Math.max(g,h),o=Math.min(c.line,b.line),p=Math.min(a.lastLine(),Math.max(c.line,b.line));p>=o;o++){var r=Zd(j,o).text,s=Pg(r,i,f);i==n?e.push(new la(Mf(o,s),Mf(o,s))):r.length>s&&e.push(new la(Mf(o,s),Mf(o,Pg(r,n,f))))}e.length||e.push(new la(c,c)),Aa(j,ma(m.ranges.slice(0,l).concat(e),l),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=a.findWordAt(b);else var w=new la(Mf(b.line,0),pa(j,Mf(b.line+1,0)));Nf(w.anchor,u)>0?(v=w.head,u=X(t.from(),w.anchor)):(v=w.anchor,u=W(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new la(pa(j,u),v),Aa(j,ma(e,l),Mg)}}function g(b){var c=++s,e=Vb(a,b,!0,"rect"==d);if(e)if(0!=Nf(e,q)){a.curOp.focus=Te(),f(e);var h=u(i,j);(e.line>=h.to||e.line<h.from)&&setTimeout(Fb(a,function(){s==c&&g(b)}),150)}else{var k=b.clientY<r.top?-20:b.clientY>r.bottom?20:0;k&&setTimeout(Fb(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(b){a.state.selectingText=!1,s=1/0,Bg(b),i.input.focus(),Gg(document,"mousemove",t),Gg(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;Bg(b);var k,l,m=j.sel,n=m.ranges;if(e&&!b.shiftKey?(l=j.sel.contains(c),k=l>-1?n[l]:new la(c,c)):(k=j.sel.primary(),l=j.sel.primIndex),Ff?b.shiftKey&&b.metaKey:b.altKey)d="rect",e||(k=new la(c,c)),c=Vb(a,b,!0,!0),l=-1;else if("double"==d){var o=a.findWordAt(c);k=a.display.shift||j.extend?ta(j,k,o.anchor,o.head):o}else if("triple"==d){var p=new la(Mf(c.line,0),pa(j,Mf(c.line+1,0)));k=a.display.shift||j.extend?ta(j,k,p.anchor,p.head):p}else k=ta(j,k,c);e?-1==l?(l=n.length,Aa(j,ma(n.concat([k]),l),{scroll:!1,origin:"*mouse"})):n.length>1&&n[l].empty()&&"single"==d&&!b.shiftKey?(Aa(j,ma(n.slice(0,l).concat(n.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),m=j.sel):wa(j,l,k,Mg):(l=0,Aa(j,new ka([k],0),Mg),m=j.sel);var q=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Fb(a,function(a){we(a)?g(a):h(a)}),v=Fb(a,h);a.state.selectingText=v,Eg(document,"mousemove",t),Eg(document,"mouseup",v)}function $b(a,b,c,d){try{var e=b.clientX,f=b.clientY}catch(b){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Bg(b);var g=a.display,h=g.lineDiv.getBoundingClientRect();if(f>h.bottom||!Ce(a,c))return ue(b);f-=h.top-g.viewOffset;for(var i=0;i<a.options.gutters.length;++i){var j=g.gutters.childNodes[i];if(j&&j.getBoundingClientRect().right>=e){var k=ce(a.doc,f),l=a.options.gutters[i];return Hg(a,c,a,k,l,b),ue(b)}}}function _b(a,b){return $b(a,b,"gutterClick",!0)}function ac(a){var b=this;if(dc(b),!Ae(b,a)&&!Ub(b.display,a)){Bg(a),tf&&(Vf=+new Date);var c=Vb(b,a,!0),d=a.dataTransfer.files;if(c&&!b.isReadOnly())if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){if(!b.options.allowDropFileTypes||-1!=He(b.options.allowDropFileTypes,a.type)){var h=new FileReader;h.onload=Fb(b,function(){var a=h.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a=""),f[d]=a,++g==e){c=pa(b.doc,c);var i={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"};Ac(b.doc,i),za(b.doc,na(c,_f(i)))}}),h.readAsText(a)}},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(function(){b.display.input.focus()},20);try{var f=a.dataTransfer.getData("Text");if(f){if(b.state.draggingText&&!b.state.draggingText.copy)var j=b.listSelections();if(Ba(b.doc,na(c,c)),j)for(var i=0;i<j.length;++i)Gc(b.doc,"",j[i].anchor,j[i].head,"drag");b.replaceSelection(f,"around","paste"),b.display.input.focus()}}catch(a){}}}}function bc(a,b){if(tf&&(!a.state.draggingText||+new Date-Vf<100))return void Dg(b);if(!Ae(a,b)&&!Ub(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setDragImage&&!zf)){var c=Qe("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",yf&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop),b.dataTransfer.setDragImage(c,0,0),yf&&c.parentNode.removeChild(c)}}function cc(a,b){var c=Vb(a,b);if(c){var d=document.createDocumentFragment();Ka(a,c,d),a.display.dragCursor||(a.display.dragCursor=Qe("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv)),Se(a.display.dragCursor,d)}}function dc(a){a.display.dragCursor&&(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=null)}function ec(a,b){Math.abs(a.doc.scrollTop-b)<2||(a.doc.scrollTop=b,qf||D(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbars.setScrollTop(b),qf&&D(a),Na(a,100))}function fc(a,b,c){(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,v(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function gc(a,b){var c=Yf(b),d=c.x,e=c.y,f=a.display,g=f.scroller,h=g.scrollWidth>g.clientWidth,i=g.scrollHeight>g.clientHeight;if(d&&h||e&&i){if(e&&Ef&&vf)a:for(var j=b.target,k=f.view;j!=g;j=j.parentNode)for(var l=0;l<k.length;l++)if(k[l].node==j){a.display.currentWheelTarget=j;break a}if(d&&!qf&&!yf&&null!=Xf)return e&&i&&ec(a,Math.max(0,Math.min(g.scrollTop+e*Xf,g.scrollHeight-g.clientHeight))),fc(a,Math.max(0,Math.min(g.scrollLeft+d*Xf,g.scrollWidth-g.clientWidth))),(!e||e&&i)&&Bg(b),void(f.wheelStartX=null);if(e&&null!=Xf){var m=e*Xf,n=a.doc.scrollTop,o=n+f.wrapper.clientHeight;0>m?n=Math.max(0,n+m-50):o=Math.min(a.doc.height,o+m+50),D(a,{top:n,bottom:o})}20>Wf&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(Xf=(Xf*Wf+c)/(Wf+1),++Wf)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function hc(a,b,c){if("string"==typeof b&&(b=kg[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Kg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function ic(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=mg(b,a.state.keyMaps[d],c,a);if(e)return e}return a.options.extraKeys&&mg(b,a.options.extraKeys,c,a)||mg(b,a.options.keyMap,c,a)}function jc(a,b,c,d){var e=a.state.keySeq;if(e){if(ng(b))return"handled";Zf.set(50,function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())}),b=e+" "+b}var f=ic(a,b,d);return"multi"==f&&(a.state.keySeq=b),"handled"==f&&ye(a,"keyHandled",a,b,c),("handled"==f||"multi"==f)&&(Bg(c),Ma(a)),e&&!f&&/\'$/.test(b)?(Bg(c),!0):!!f}function kc(a,b){var c=og(b,!0);return c?b.shiftKey&&!a.state.keySeq?jc(a,"Shift-"+c,b,function(b){return hc(a,b,!0)})||jc(a,c,b,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?hc(a,b):void 0}):jc(a,c,b,function(b){return hc(a,b)}):!1}function lc(a,b,c){return jc(a,"'"+c+"'",b,function(b){return hc(a,b,!0)})}function mc(a){var b=this;if(b.curOp.focus=Te(),!Ae(b,a)){tf&&11>uf&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=kc(b,a);yf&&($f=d?c:null,!d&&88==c&&!dh&&(Ef?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||nc(b)}}function nc(a){function b(a){18!=a.keyCode&&a.altKey||(Zg(c,"CodeMirror-crosshair"),Gg(document,"keyup",b),Gg(document,"mouseover",b))}var c=a.display.lineDiv;$g(c,"CodeMirror-crosshair"),Eg(document,"keyup",b),Eg(document,"mouseover",b)}function oc(a){16==a.keyCode&&(this.doc.sel.shift=!1),Ae(this,a)}function pc(a){var b=this;if(!(Ub(b.display,a)||Ae(b,a)||a.ctrlKey&&!a.altKey||Ef&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(yf&&c==$f)return $f=null,void Bg(a);if(!yf||a.which&&!(a.which<10)||!kc(b,a)){var e=String.fromCharCode(null==d?c:d);lc(b,a,e)||b.display.input.onKeyPress(a)}}}function qc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,sc(a))},100)}function rc(a){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(Hg(a,"focus",a),a.state.focused=!0,$g(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),vf&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Ma(a))}function sc(a){a.state.delayingBlurEvent||(a.state.focused&&(Hg(a,"blur",a),a.state.focused=!1,Zg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function tc(a,b){Ub(a.display,b)||uc(a,b)||Ae(a,b,"contextmenu")||a.display.input.onContextMenu(b)}function uc(a,b){return Ce(a,"gutterContextMenu")?$b(a,b,"gutterContextMenu",!1):!1}function vc(a,b){if(Nf(a,b.from)<0)return a;if(Nf(a,b.to)<=0)return _f(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=_f(b).ch-b.to.ch),Mf(c,d)}function wc(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new la(vc(e.anchor,b),vc(e.head,b)))}return ma(c,a.sel.primIndex)}function xc(a,b,c){return a.line==b.line?Mf(c.line,a.ch-b.ch+c.ch):Mf(c.line+(a.line-b.line),a.ch)}function yc(a,b,c){for(var d=[],e=Mf(a.first,0),f=e,g=0;g<b.length;g++){var h=b[g],i=xc(h.from,e,f),j=xc(_f(h),e,f);if(e=h.to,f=j,"around"==c){var k=a.sel.ranges[g],l=Nf(k.head,k.anchor)<0;d[g]=new la(l?j:i,l?i:j)}else d[g]=new la(i,i)}return new ka(d,a.sel.primIndex)}function zc(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(d.update=function(b,c,d,e){b&&(this.from=pa(a,b)),c&&(this.to=pa(a,c)),d&&(this.text=d),void 0!==e&&(this.origin=e)}),Hg(a,"beforeChange",a,d),a.cm&&Hg(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function Ac(a,b,c){if(a.cm){if(!a.cm.curOp)return Fb(a.cm,Ac)(a,b,c);if(a.cm.state.suppressEdits)return}if(!(Ce(a,"beforeChange")||a.cm&&Ce(a.cm,"beforeChange"))||(b=zc(a,b,!0))){var d=Kf&&!c&&id(a,b.from,b.to);if(d)for(var e=d.length-1;e>=0;--e)Bc(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else Bc(a,b)}}function Bc(a,b){if(1!=b.text.length||""!=b.text[0]||0!=Nf(b.from,b.to)){var c=wc(a,b);je(a,b,c,a.cm?a.cm.curOp.id:NaN),Ec(a,b,c,fd(a,b));var d=[];Xd(a,function(a,c){c||-1!=He(d,a.history)||(te(a.history,b),d.push(a.history)),Ec(a,b,null,fd(a,b))})}}function Cc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits||c){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i<g.length&&(d=g[i],c?!d.ranges||d.equals(a.sel):d.ranges);i++);if(i!=g.length){for(e.lastOrigin=e.lastSelOrigin=null;d=g.pop(),d.ranges;){if(me(d,h),c&&!d.equals(a.sel))return void Aa(a,d,{clearRedo:!1});f=d}var j=[];me(f,h),h.push({changes:j,generation:e.generation}),e.generation=d.generation||++e.maxGeneration;for(var k=Ce(a,"beforeChange")||a.cm&&Ce(a.cm,"beforeChange"),i=d.changes.length-1;i>=0;--i){var l=d.changes[i];if(l.origin=b,k&&!zc(a,l,!1))return void(g.length=0);j.push(ge(a,l));var m=i?wc(a,l):Ge(g);Ec(a,l,m,hd(a,l)),!i&&a.cm&&a.cm.scrollIntoView({from:l.from,to:_f(l)});var n=[];Xd(a,function(a,b){b||-1!=He(n,a.history)||(te(a.history,l),n.push(a.history)),Ec(a,l,null,hd(a,l))})}}}}function Dc(a,b){if(0!=b&&(a.first+=b,a.sel=new ka(Ie(a.sel.ranges,function(a){return new la(Mf(a.anchor.line+b,a.anchor.ch),Mf(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Kb(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)Lb(a.cm,d,"gutter")}}function Ec(a,b,c,d){if(a.cm&&!a.cm.curOp)return Fb(a.cm,Ec)(a,b,c,d);if(b.to.line<a.first)return void Dc(a,b.text.length-1-(b.to.line-b.from.line));if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);Dc(a,e),b={from:Mf(a.first,0),to:Mf(b.to.line+e,b.to.ch),text:[Ge(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:Mf(f,Zd(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=$d(a,b.from,b.to),c||(c=wc(a,b)),a.cm?Fc(a.cm,b,d):Ud(a,b,d),Ba(a,c,Lg)}}function Fc(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=be(sd(Zd(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&Be(a),Ud(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),Na(a,400);var k=b.text.length-(h.line-g.line)-1;b.full?Kb(a):g.line!=h.line||1!=b.text.length||Td(a.doc,b)?Kb(a,g.line,h.line+1,k):Lb(a,g.line,"text");var m=Ce(a,"changes"),n=Ce(a,"change");if(n||m){var o={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};n&&ye(a,"change",a,o),m&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(o)}a.display.selForContextMenu=null}function Gc(a,b,c,d,e){if(d||(d=c),Nf(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=a.splitLines(b)),Ac(a,{from:c,to:d,text:b,origin:e})}function Hc(a,b){if(!Ae(a,"scrollCursorIntoView")){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!Bf){var f=Qe("div","",null,"position: absolute; top: "+(b.top-c.viewOffset-Ra(a.display))+"px; height: "+(b.bottom-b.top+Ua(a)+c.barHeight)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}}function Ic(a,b,c,d){null==d&&(d=0);for(var e=0;5>e;e++){var f=!1,g=ob(a,b),h=c&&c!=b?ob(a,c):g,i=Kc(a,Math.min(g.left,h.left),Math.min(g.top,h.top)-d,Math.max(g.left,h.left),Math.max(g.bottom,h.bottom)+d),j=a.doc.scrollTop,k=a.doc.scrollLeft;if(null!=i.scrollTop&&(ec(a,i.scrollTop),Math.abs(a.doc.scrollTop-j)>1&&(f=!0)),null!=i.scrollLeft&&(fc(a,i.scrollLeft),Math.abs(a.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return g}function Jc(a,b,c,d,e){var f=Kc(a,b,c,d,e);null!=f.scrollTop&&ec(a,f.scrollTop),null!=f.scrollLeft&&fc(a,f.scrollLeft)}function Kc(a,b,c,d,e){var f=a.display,g=tb(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=Wa(a),j={};e-c>i&&(e=c+i);var k=a.doc.height+Sa(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=Va(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0),q=d-b>p;return q&&(d=b+p),10>b?j.scrollLeft=0:o>b?j.scrollLeft=Math.max(0,b-(q?0:10)):d>p+o-3&&(j.scrollLeft=d+(q?0:10)-p),
|
3 |
+
j}function Lc(a,b,c){(null!=b||null!=c)&&Nc(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Mc(a){Nc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Mf(b.line,b.ch-1):b,d=Mf(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Nc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=pb(a,b.from),d=pb(a,b.to),e=Kc(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Oc(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Qa(a,b):c="prev");var g=a.options.tabSize,h=Zd(f,b),i=Og(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text),j==Kg||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Og(Zd(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=Fe(j-m)),l!=k)return Gc(f,l,Mf(b,0),Mf(b,k.length),"+input"),h.stateAfter=null,!0;for(var n=0;n<f.sel.ranges.length;n++){var o=f.sel.ranges[n];if(o.head.line==b&&o.head.ch<k.length){var m=Mf(b,k.length);wa(f,n,new la(m,m));break}}}function Pc(a,b,c,d){var e=b,f=b;return"number"==typeof b?f=Zd(a,oa(a,b)):e=be(b),null==e?null:(d(f,e)&&a.cm&&Lb(a.cm,e,c),f)}function Qc(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&Nf(f.from,Ge(d).to)<=0;){var g=d.pop();if(Nf(g.from,f.from)<0){f.from=g.from;break}}d.push(f)}Eb(a,function(){for(var b=d.length-1;b>=0;b--)Gc(a.doc,"",d[b].from,d[b].to,"+delete");Mc(a)})}function Rc(a,b,c,d,e){function f(){var b=h+c;return b<a.first||b>=a.first+a.size?!1:(h=b,k=Zd(a,b))}function g(a){var b=(e?mf:nf)(k,i,c,!0);if(null==b){if(a||!f())return!1;i=e?(0>c?ef:df)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=Zd(a,h);if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var l=null,m="group"==d,n=a.cm&&a.cm.getHelper(b,"wordChars"),o=!0;!(0>c)||g(!o);o=!1){var p=k.text.charAt(i)||"\n",q=Ne(p,n)?"w":m&&"\n"==p?"n":!m||/\s/.test(p)?null:"p";if(!m||o||q||(q="s"),l&&l!=q){0>c&&(c=1,g());break}if(q&&(l=q),c>0&&!g(!o))break}var r=Ga(a,Mf(h,i),b,j,!0);return Nf(b,r)||(r.hitSide=!0),r}function Sc(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);e=b.top+c*(h-(0>c?1.5:.5)*tb(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=rb(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function Tc(b,c,d,e){a.defaults[b]=c,d&&(bg[b]=e?function(a,b,c){c!=cg&&d(a,b,c)}:d)}function Uc(a){for(var b,c,d,e,f=a.split(/-(?!$)/),a=f[f.length-1],g=0;g<f.length-1;g++){var h=f[g];if(/^(cmd|meta|m)$/i.test(h))e=!0;else if(/^a(lt)?$/i.test(h))b=!0;else if(/^(c|ctrl|control)$/i.test(h))c=!0;else{if(!/^s(hift)$/i.test(h))throw new Error("Unrecognized modifier name: "+h);d=!0}}return b&&(a="Alt-"+a),c&&(a="Ctrl-"+a),e&&(a="Cmd-"+a),d&&(a="Shift-"+a),a}function Vc(a){return"string"==typeof a?lg[a]:a}function Wc(a,b,c,d,e){if(d&&d.shared)return Xc(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return Fb(a.cm,Wc)(a,b,c,d,e);var f=new rg(a,e),g=Nf(b,c);if(d&&Le(d,f,!1),g>0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Qe("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(rd(a,b.line,b,c,f)||b.line!=c.line&&rd(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lf=!0}f.addToHistory&&je(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&sd(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&ae(a,0),cd(a,new _c(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){wd(a,b)&&ae(b,0)}),f.clearOnEnter&&Eg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(Kf=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++qg,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)Kb(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(var k=b.line;k<=c.line;k++)Lb(j,k,"text");f.atomic&&Da(j.doc),ye(j,"markerAdded",j,f)}return f}function Xc(a,b,c,d,e){d=Le(d),d.shared=!1;var f=[Wc(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Xd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Wc(a,pa(a,b),pa(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=Ge(f)}),new sg(f,g)}function Yc(a){return a.findMarks(Mf(a.first,0),a.clipPos(Mf(a.lastLine())),function(a){return a.parent})}function Zc(a,b){for(var c=0;c<b.length;c++){var d=b[c],e=d.find(),f=a.clipPos(e.from),g=a.clipPos(e.to);if(Nf(f,g)){var h=Wc(a,f,g,d.primary,d.primary.type);d.markers.push(h),h.parent=d}}}function $c(a){for(var b=0;b<a.length;b++){var c=a[b],d=[c.primary.doc];Xd(c.primary.doc,function(a){d.push(a)});for(var e=0;e<c.markers.length;e++){var f=c.markers[e];-1==He(d,f.doc)&&(f.parent=null,c.markers.splice(e--,1))}}}function _c(a,b,c){this.marker=a,this.from=b,this.to=c}function ad(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function bd(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function cd(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function dd(a,b,c){if(a)for(var d,e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||f.from==b&&"bookmark"==g.type&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(d||(d=[])).push(new _c(g,f.from,i?null:f.to))}}return d}function ed(a,b,c){if(a)for(var d,e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(d||(d=[])).push(new _c(g,i?null:f.from-b,null==f.to?null:f.to-b))}}return d}function fd(a,b){if(b.full)return null;var c=ra(a,b.from.line)&&Zd(a,b.from.line).markedSpans,d=ra(a,b.to.line)&&Zd(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==Nf(b.from,b.to),h=dd(c,e,g),i=ed(d,f,g),j=1==b.text.length,k=Ge(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=ad(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var l=0;l<i.length;++l){var m=i[l];if(null!=m.to&&(m.to+=k),null==m.from){var n=ad(h,m.marker);n||(m.from=k,j&&(h||(h=[])).push(m))}else m.from+=k,j&&(h||(h=[])).push(m)}h&&(h=gd(h)),i&&i!=h&&(i=gd(i));var o=[h];if(!j){var p,q=b.text.length-2;if(q>0&&h)for(var l=0;l<h.length;++l)null==h[l].to&&(p||(p=[])).push(new _c(h[l].marker,null,null));for(var l=0;q>l;++l)o.push(p);o.push(i)}return o}function gd(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&a.splice(b--,1)}return a.length?a:null}function hd(a,b){var c=pe(a,b),d=fd(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function id(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=He(d,c)||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(0),i=0;i<e.length;++i){var j=e[i];if(!(Nf(j.to,h.from)<0||Nf(j.from,h.to)>0)){var k=[i,1],l=Nf(j.from,h.from),m=Nf(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function jd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function kd(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function ld(a){return a.inclusiveLeft?-1:0}function md(a){return a.inclusiveRight?1:0}function nd(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var d=a.find(),e=b.find(),f=Nf(d.from,e.from)||ld(a)-ld(b);if(f)return-f;var g=Nf(d.to,e.to)||md(a)-md(b);return g?g:b.id-a.id}function od(a,b){var c,d=Lf&&a.markedSpans;if(d)for(var e,f=0;f<d.length;++f)e=d[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!c||nd(c,e.marker)<0)&&(c=e.marker);return c}function pd(a){return od(a,!0)}function qd(a){return od(a,!1)}function rd(a,b,c,d,e){var f=Zd(a,b),g=Lf&&f.markedSpans;if(g)for(var h=0;h<g.length;++h){var i=g[h];if(i.marker.collapsed){var j=i.marker.find(0),k=Nf(j.from,c)||ld(i.marker)-ld(e),l=Nf(j.to,d)||md(i.marker)-md(e);if(!(k>=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(i.marker.inclusiveRight&&e.inclusiveLeft?Nf(j.to,c)>=0:Nf(j.to,c)>0)||k>=0&&(i.marker.inclusiveRight&&e.inclusiveLeft?Nf(j.from,d)<=0:Nf(j.from,d)<0)))return!0}}}function sd(a){for(var b;b=pd(a);)a=b.find(-1,!0).line;return a}function td(a){for(var b,c;b=qd(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function ud(a,b){var c=Zd(a,b),d=sd(c);return c==d?b:be(d)}function vd(a,b){if(b>a.lastLine())return b;var c,d=Zd(a,b);if(!wd(a,d))return b;for(;c=qd(d);)d=c.find(1,!0).line;return be(d)+1}function wd(a,b){var c=Lf&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&xd(a,b,d))return!0}}function xd(a,b,c){if(null==c.to){var d=c.marker.find(1,!0);return xd(a,d.line,ad(d.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var e,f=0;f<b.markedSpans.length;++f)if(e=b.markedSpans[f],e.marker.collapsed&&!e.marker.widgetNode&&e.from==c.to&&(null==e.to||e.to!=c.from)&&(e.marker.inclusiveLeft||c.marker.inclusiveRight)&&xd(a,b,e))return!0}function yd(a,b,c){de(b)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Lc(a,null,c)}function zd(a){if(null!=a.height)return a.height;var b=a.doc.cm;if(!b)return 0;if(!Wg(document.body,a.node)){var c="position: relative;";a.coverGutter&&(c+="margin-left: -"+b.display.gutters.offsetWidth+"px;"),a.noHScroll&&(c+="width: "+b.display.wrapper.clientWidth+"px;"),Se(b.display.measure,Qe("div",[a.node],null,c))}return a.height=a.node.parentNode.offsetHeight}function Ad(a,b,c,d){var e=new tg(a,c,d),f=a.cm;return f&&e.noHScroll&&(f.display.alignWidgets=!0),Pc(a,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,f&&!wd(a,b)){var d=de(b)<a.scrollTop;ae(b,b.height+zd(e)),d&&Lc(f,null,e.height),f.curOp.forceUpdate=!0}return!0}),e}function Bd(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),jd(a),kd(a,c);var e=d?d(a):1;e!=a.height&&ae(a,e)}function Cd(a){a.parent=null,jd(a)}function Dd(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return a}function Ed(b,c){if(b.blankLine)return b.blankLine(c);if(b.innerMode){var d=a.innerMode(b,c);return d.mode.blankLine?d.mode.blankLine(d.state):void 0}}function Fd(b,c,d,e){for(var f=0;10>f;f++){e&&(e[0]=a.innerMode(b,d).mode);var g=b.token(c,d);if(c.pos>c.start)return g}throw new Error("Mode "+b.name+" failed to advance stream.")}function Gd(a,b,c,d){function e(a){return{start:l.start,end:l.pos,string:l.current(),type:f||null,state:a?ig(g.mode,k):k}}var f,g=a.doc,h=g.mode;b=pa(g,b);var i,j=Zd(g,b.line),k=Qa(a,b.line,c),l=new pg(j.text,a.options.tabSize);for(d&&(i=[]);(d||l.pos<b.ch)&&!l.eol();)l.start=l.pos,f=Fd(h,l,k),d&&i.push(e(!0));return d?i:e()}function Hd(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var i,j=0,k=null,l=new pg(b,a.options.tabSize),m=a.options.addModeClass&&[null];for(""==b&&Dd(Ed(c,d),f);!l.eol();){if(l.pos>a.options.maxHighlightLength?(h=!1,g&&Kd(a,b,d,l.pos),l.pos=b.length,i=null):i=Dd(Fd(c,l,d,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;j<l.start;)j=Math.min(l.start,j+5e4),e(j,k);k=i}l.start=l.pos}for(;j<l.pos;){var o=Math.min(l.pos,j+5e4);e(o,k),j=o}}function Id(a,b,c,d){var e=[a.state.modeGen],f={};Hd(a,b.text,a.doc.mode,c,function(a,b){e.push(a,b)},f,d);for(var g=0;g<a.state.overlays.length;++g){var h=a.state.overlays[g],i=1,j=0;Hd(a,b.text,h.mode,!0,function(a,b){for(var c=i;a>j;){var d=e[i];d>a&&e.splice(i,1,a,e[i+1],d),i+=2,j=Math.min(a,d)}if(b)if(h.opaque)e.splice(c,i-c,a,"cm-overlay "+b),i=c+2;else for(;i>c;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"cm-overlay "+b}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Jd(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Qa(a,be(b)),e=Id(a,b,b.text.length>a.options.maxHighlightLength?ig(a.doc.mode,d):d);b.stateAfter=d,b.styles=e.styles,e.classes?b.styleClasses=e.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.frontier&&a.doc.frontier++}return b.styles}function Kd(a,b,c,d){var e=a.doc.mode,f=new pg(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&Ed(e,c);!f.eol();)Fd(e,f,c),f.start=f.pos}function Ld(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?wg:vg;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Md(a,b){var c=Qe("span",null,null,vf?"padding-right: .1px":null),d={pre:Qe("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:(tf||vf)&&a.getOption("lineWrapping")};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Od,$e(a.display.measure)&&(f=ee(g))&&(d.addToken=Qd(d.addToken,f)),d.map=[];var h=b!=a.display.externalMeasured&&be(g);Sd(g,d,Jd(a,g,h)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=Ve(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=Ve(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Ze(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}if(vf){var i=d.content.lastChild;(/\bcm-tab\b/.test(i.className)||i.querySelector&&i.querySelector(".cm-tab"))&&(d.content.className="cm-tab-wrap-hack")}return Hg(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=Ve(d.pre.className,d.textClass||"")),d}function Nd(a){var b=Qe("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function Od(a,b,c,d,e,f,g){if(b){var h=a.splitSpaces?Pd(b,a.trailingSpace):b,i=a.cm.state.specialChars,j=!1;if(i.test(b))for(var k=document.createDocumentFragment(),l=0;;){i.lastIndex=l;var m=i.exec(b),n=m?m.index-l:b.length-l;if(n){var o=document.createTextNode(h.slice(l,l+n));tf&&9>uf?k.appendChild(Qe("span",[o])):k.appendChild(o),a.map.push(a.pos,a.pos+n,o),a.col+=n,a.pos+=n}if(!m)break;if(l+=n+1," "==m[0]){var p=a.cm.options.tabSize,q=p-a.col%p,o=k.appendChild(Qe("span",Fe(q),"cm-tab"));o.setAttribute("role","presentation"),o.setAttribute("cm-text"," "),a.col+=q}else if("\r"==m[0]||"\n"==m[0]){var o=k.appendChild(Qe("span","\r"==m[0]?"␍":"","cm-invalidchar"));o.setAttribute("cm-text",m[0]),a.col+=1}else{var o=a.cm.options.specialCharPlaceholder(m[0]);o.setAttribute("cm-text",m[0]),tf&&9>uf?k.appendChild(Qe("span",[o])):k.appendChild(o),a.col+=1}a.map.push(a.pos,a.pos+1,o),a.pos++}else{a.col+=b.length;var k=document.createTextNode(h);a.map.push(a.pos,a.pos+b.length,k),tf&&9>uf&&(j=!0),a.pos+=b.length}if(a.trailingSpace=32==h.charCodeAt(b.length-1),c||d||e||j||g){var r=c||"";d&&(r+=d),e&&(r+=e);var s=Qe("span",[k],r,g);return f&&(s.title=f),a.content.appendChild(s)}a.content.appendChild(k)}}function Pd(a,b){if(a.length>1&&!/ /.test(a))return a;for(var c=b,d="",e=0;e<a.length;e++){var f=a.charAt(e);" "!=f||!c||e!=a.length-1&&32!=a.charCodeAt(e+1)||(f=" "),d+=f,c=" "==f}return d}function Qd(a,b){return function(c,d,e,f,g,h,i){e=e?e+" cm-force-border":"cm-force-border";for(var j=c.pos,k=j+d.length;;){for(var l=0;l<b.length;l++){var m=b[l];if(m.to>j&&m.from<=j)break}if(m.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,m.to-j),e,f,null,h,i),f=null,d=d.slice(m.to-j),j=m.to}}}function Rd(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e),!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id)),e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e)),a.pos+=b,a.trailingSpace=!1}function Sd(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m,n=e.length,o=0,p=1,q="",r=0;;){if(r==o){i=j=k=l=h="",m=null,r=1/0;for(var s,t=[],u=0;u<d.length;++u){var v=d[u],w=v.marker;"bookmark"==w.type&&v.from==o&&w.widgetNode?t.push(w):v.from<=o&&(null==v.to||v.to>o||w.collapsed&&v.to==o&&v.from==o)?(null!=v.to&&v.to!=o&&r>v.to&&(r=v.to,j=""),w.className&&(i+=" "+w.className),w.css&&(h=(h?h+";":"")+w.css),w.startStyle&&v.from==o&&(k+=" "+w.startStyle),w.endStyle&&v.to==r&&(s||(s=[])).push(w.endStyle,v.to),w.title&&!l&&(l=w.title),w.collapsed&&(!m||nd(m.marker,w)<0)&&(m=v)):v.from>o&&r>v.from&&(r=v.from)}if(s)for(var u=0;u<s.length;u+=2)s[u+1]==r&&(j+=" "+s[u]);if(!m||m.from==o)for(var u=0;u<t.length;++u)Rd(b,0,t[u]);if(m&&(m.from||0)==o){if(Rd(b,(null==m.to?n+1:m.to)-o,m.marker,null==m.from),null==m.to)return;m.to==o&&(m=!1)}}if(o>=n)break;for(var x=Math.min(n,r);;){if(q){var y=o+q.length;if(!m){var z=y>x?q.slice(0,x-o):q;b.addToken(b,z,g?g+i:i,k,o+z.length==r?j:"",l,h)}if(y>=x){q=q.slice(x-o),o=x;break}o=y,k=""}q=e.slice(f,f=c[p++]),g=Ld(c[p++],b.cm.options)}}else for(var p=1;p<c.length;p+=2)b.addToken(b,e.slice(f,f=c[p]),Ld(c[p+1],b.cm.options))}function Td(a,b){return 0==b.from.ch&&0==b.to.ch&&""==Ge(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function Ud(a,b,c,d){function e(a){return c?c[a]:null}function f(a,c,e){Bd(a,c,e,d),ye(a,"change",a,b)}function g(a,b){for(var c=a,f=[];b>c;++c)f.push(new ug(j[c],e(c),d));return f}var h=b.from,i=b.to,j=b.text,k=Zd(a,h.line),l=Zd(a,i.line),m=Ge(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Td(a,b)){var p=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),p.length&&a.insert(h.line,p)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var p=g(1,j.length-1);p.push(new ug(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,p)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var p=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,p)}ye(a,"change",a,b)}function Vd(a){this.lines=a,this.parent=null;for(var b=0,c=0;b<a.length;++b)a[b].parent=this,c+=a[b].height;this.height=c}function Wd(a){this.children=a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d];b+=e.chunkSize(),c+=e.height,e.parent=this}this.size=b,this.height=c,this.parent=null}function Xd(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;(!c||i)&&(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function Yd(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,g(a),c(a),a.options.lineWrapping||m(a),a.options.mode=b.modeOption,Kb(a)}function Zd(a,b){if(b-=a.first,0>b||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function $d(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function _d(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function ae(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function be(a){if(null==a.parent)return null;for(var b=a.parent,c=He(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function ce(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(f>b){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;d<a.lines.length;++d){var g=a.lines[d],h=g.height;if(h>b)break;b-=h}return c+d}function de(a){a=sd(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;b+=e.height}for(var f=c.parent;f;c=f,f=c.parent)for(var d=0;d<f.children.length;++d){var g=f.children[d];if(g==c)break;b+=g.height}return b}function ee(a){var b=a.order;return null==b&&(b=a.order=hh(a.text)),b}function fe(a){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=a||1}function ge(a,b){var c={from:V(b.from),to:_f(b),text:$d(a,b.from,b.to)};return ne(a,c,b.from.line,b.to.line+1),Xd(a,function(a){ne(a,c,b.from.line,b.to.line+1)},!0),c}function he(a){for(;a.length;){var b=Ge(a);if(!b.ranges)break;a.pop()}}function ie(a,b){return b?(he(a.done),Ge(a.done)):a.done.length&&!Ge(a.done).ranges?Ge(a.done):a.done.length>1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Ge(a.done)):void 0}function je(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=ie(e,e.lastOp==d))){var h=Ge(f.changes);0==Nf(b.from,b.to)&&0==Nf(b.from,h.to)?h.to=_f(b):f.changes.push(ge(a,b))}else{var i=Ge(e.done);for(i&&i.ranges||me(a.sel,e.done),f={changes:[ge(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=g,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||Hg(a,"historyAdded")}function ke(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function le(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||ke(a,f,Ge(e.done),b))?e.done[e.done.length-1]=b:me(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&he(e.undone)}function me(a,b){var c=Ge(b);c&&c.ranges&&c.equals(a)||b.push(a)}function ne(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function oe(a){if(!a)return null;for(var b,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return b?b.length?b:null:a}function pe(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=0,e=[];d<b.text.length;++d)e.push(oe(c[d]));return e}function qe(a,b,c){for(var d=0,e=[];d<a.length;++d){var f=a[d];if(f.ranges)e.push(c?ka.prototype.deepCopy.call(f):f);else{var g=f.changes,h=[];e.push({changes:h});for(var i=0;i<g.length;++i){var j,k=g[i];if(h.push({from:k.from,to:k.to,text:k.text}),b)for(var l in k)(j=l.match(/^spans_(\d+)$/))&&He(b,Number(j[1]))>-1&&(Ge(h)[l]=k[l],delete k[l])}}}return e}function re(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function se(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<f.ranges.length;h++)re(f.ranges[h].anchor,b,c,d),re(f.ranges[h].head,b,c,d)}else{for(var h=0;h<f.changes.length;++h){var i=f.changes[h];if(c<i.from.line)i.from=Mf(i.from.line+d,i.from.ch),i.to=Mf(i.to.line+d,i.to.ch);else if(b<=i.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function te(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;se(a.done,c,d,e),se(a.undone,c,d,e)}function ue(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function ve(a){return a.target||a.srcElement}function we(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),Ef&&a.ctrlKey&&1==b&&(b=3),b}function xe(a,b,c){var d=a._handlers&&a._handlers[b];return c?d&&d.length>0?d.slice():Fg:d||Fg}function ye(a,b){function c(a){return function(){a.apply(null,f)}}var d=xe(a,b,!1);if(d.length){var e,f=Array.prototype.slice.call(arguments,2);Tf?e=Tf.delayedCallbacks:Ig?e=Ig:(e=Ig=[],setTimeout(ze,0));for(var g=0;g<d.length;++g)e.push(c(d[g]))}}function ze(){var a=Ig;Ig=null;for(var b=0;b<a.length;++b)a[b]()}function Ae(a,b,c){return"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}}),Hg(a,c||b.type,a,b),ue(b)||b.codemirrorIgnore}function Be(a){var b=a._handlers&&a._handlers.cursorActivity;if(b)for(var c=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]),d=0;d<b.length;++d)-1==He(c,b[d])&&c.push(b[d])}function Ce(a,b){return xe(a,b).length>0}function De(a){a.prototype.on=function(a,b){Eg(this,a,b)},a.prototype.off=function(a,b){Gg(this,a,b)}}function Ee(){this.id=null}function Fe(a){for(;Qg.length<=a;)Qg.push(Ge(Qg)+" ");return Qg[a]}function Ge(a){return a[a.length-1]}function He(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function Ie(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function Je(){}function Ke(a,b){var c;return Object.create?c=Object.create(a):(Je.prototype=a,c=new Je),b&&Le(b,c),c}function Le(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||c===!1&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function Me(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function Ne(a,b){return b?b.source.indexOf("\\w")>-1&&Ug(a)?!0:b.test(a):Ug(a)}function Oe(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Pe(a){return a.charCodeAt(0)>=768&&Vg.test(a)}function Qe(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function Re(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function Se(a,b){return Re(a).appendChild(b)}function Te(){for(var a=document.activeElement;a&&a.root&&a.root.activeElement;)a=a.root.activeElement;return a}function Ue(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function Ve(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!Ue(c[d]).test(b)&&(b+=" "+c[d]);return b}function We(a){if(document.body.getElementsByClassName)for(var b=document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function Xe(){_g||(Ye(),_g=!0)}function Ye(){var a;Eg(window,"resize",function(){null==a&&(a=setTimeout(function(){a=null,We(Tb)},100))}),Eg(window,"blur",function(){We(sc)})}function Ze(a){if(null==Xg){var b=Qe("span","");Se(a,Qe("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Xg=b.offsetWidth<=1&&b.offsetHeight>2&&!(tf&&8>uf))}var c=Xg?Qe("span",""):Qe("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}function $e(a){if(null!=Yg)return Yg;var b=Se(a,document.createTextNode("AخA")),c=Sg(b,0,1).getBoundingClientRect(),d=Sg(b,1,2).getBoundingClientRect();return Re(a),c&&c.left!=c.right?Yg=d.right-c.right<3:!1}function _e(a){if(null!=eh)return eh;var b=Se(a,Qe("span","x")),c=b.getBoundingClientRect(),d=Sg(b,0,1).getBoundingClientRect();return eh=Math.abs(c.left-d.left)>1}function af(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function bf(a){return a.level%2?a.to:a.from}function cf(a){return a.level%2?a.from:a.to}function df(a){var b=ee(a);return b?bf(b[0]):0}function ef(a){var b=ee(a);return b?cf(Ge(b)):a.text.length}function ff(a,b){var c=Zd(a.doc,b),d=sd(c);d!=c&&(b=be(d));var e=ee(d),f=e?e[0].level%2?ef(d):df(d):0;return Mf(b,f)}function gf(a,b){for(var c,d=Zd(a.doc,b);c=qd(d);)d=c.find(1,!0).line,b=null;var e=ee(d),f=e?e[0].level%2?df(d):ef(d):d.text.length;return Mf(null==b?be(d):b,f)}function hf(a,b){var c=ff(a,b.line),d=Zd(a.doc,c.line),e=ee(d);if(!e||0==e[0].level){var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;return Mf(c.line,g?0:f)}return c}function jf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function kf(a,b){gh=null;for(var c,d=0;d<a.length;++d){var e=a[d];if(e.from<b&&e.to>b)return d;if(e.from==b||e.to==b){if(null!=c)return jf(a,e.level,a[c].level)?(e.from!=e.to&&(gh=c),d):(e.from!=e.to&&(gh=d),c);c=d}}return c}function lf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Pe(a.text.charAt(b)));return b}function mf(a,b,c,d){var e=ee(a);if(!e)return nf(a,b,c,d);for(var f=kf(e,b),g=e[f],h=lf(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h<g.to)return h;if(h==g.from||h==g.to)return kf(e,h)==f?h:(g=e[f+=c],c>0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?lf(a,g.to,-1,d):lf(a,g.from,1,d)}}function nf(a,b,c,d){var e=b+c;if(d)for(;e>0&&Pe(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var of=navigator.userAgent,pf=navigator.platform,qf=/gecko\/\d/i.test(of),rf=/MSIE \d/.test(of),sf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(of),tf=rf||sf,uf=tf&&(rf?document.documentMode||6:sf[1]),vf=/WebKit\//.test(of),wf=vf&&/Qt\/\d+\.\d+/.test(of),xf=/Chrome\//.test(of),yf=/Opera\//.test(of),zf=/Apple Computer/.test(navigator.vendor),Af=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(of),Bf=/PhantomJS/.test(of),Cf=/AppleWebKit/.test(of)&&/Mobile\/\w+/.test(of),Df=Cf||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(of),Ef=Cf||/Mac/.test(pf),Ff=/\bCrOS\b/.test(of),Gf=/win/i.test(pf),Hf=yf&&of.match(/Version\/(\d*\.\d*)/);Hf&&(Hf=Number(Hf[1])),Hf&&Hf>=15&&(yf=!1,vf=!0);var If=Ef&&(wf||yf&&(null==Hf||12.11>Hf)),Jf=qf||tf&&uf>=9,Kf=!1,Lf=!1;p.prototype=Le({update:function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=a.scrollWidth-a.clientWidth+f+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?d:0,bottom:b?d:0}},setScrollLeft:function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var a=Ef&&!Af?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",
|
4 |
+
this.disableHoriz=new Ee,this.disableVert=new Ee},enableZeroWidthBar:function(a,b){function c(){var d=a.getBoundingClientRect(),e=document.elementFromPoint(d.left+1,d.bottom-1);e!=a?a.style.pointerEvents="none":b.set(1e3,c)}a.style.pointerEvents="auto",b.set(1e3,c)},clear:function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)}},p.prototype),q.prototype=Le({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},q.prototype),a.scrollbarModel={"native":p,"null":q},z.prototype.signal=function(a,b){Ce(a,b)&&this.events.push(arguments)},z.prototype.finish=function(){for(var a=0;a<this.events.length;a++)Hg.apply(null,this.events[a])};var Mf=a.Pos=function(a,b){return this instanceof Mf?(this.line=a,void(this.ch=b)):new Mf(a,b)},Nf=a.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch},Of=null;ca.prototype=Le({init:function(a){function b(a){if(!Ae(d,a)){if(d.somethingSelected())Of={lineWise:!1,text:d.getSelections()},c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,f.value=Of.text.join("\n"),Rg(f));else{if(!d.options.lineWiseCopyCut)return;var b=aa(d);Of={lineWise:!0,text:b.text},"cut"==a.type?d.setSelections(b.ranges,null,Lg):(c.prevInput="",f.value=b.text.join("\n"),Rg(f))}"cut"==a.type&&(d.state.cutIncoming=!0)}}var c=this,d=this.cm,e=this.wrapper=da(),f=this.textarea=e.firstChild;a.wrapper.insertBefore(e,a.wrapper.firstChild),Cf&&(f.style.width="0px"),Eg(f,"input",function(){tf&&uf>=9&&c.hasSelection&&(c.hasSelection=null),c.poll()}),Eg(f,"paste",function(a){Ae(d,a)||$(a,d)||(d.state.pasteIncoming=!0,c.fastPoll())}),Eg(f,"cut",b),Eg(f,"copy",b),Eg(a.scroller,"paste",function(b){Ub(a,b)||Ae(d,b)||(d.state.pasteIncoming=!0,c.focus())}),Eg(a.lineSpace,"selectstart",function(b){Ub(a,b)||Bg(b)}),Eg(f,"compositionstart",function(){var a=d.getCursor("from");c.composing&&c.composing.range.clear(),c.composing={start:a,range:d.markText(a,d.getCursor("to"),{className:"CodeMirror-composing"})}}),Eg(f,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},prepareSelection:function(){var a=this.cm,b=a.display,c=a.doc,d=Ja(a);if(a.options.moveInputWithCursor){var e=ob(a,c.sel.primary().head,"div"),f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,e.top+g.top-f.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,e.left+g.left-f.left))}return d},showSelection:function(a){var b=this.cm,c=b.display;Se(c.cursorDiv,a.cursors),Se(c.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},reset:function(a){if(!this.contextMenuPending){var b,c,d=this.cm,e=d.doc;if(d.somethingSelected()){this.prevInput="";var f=e.sel.primary();b=dh&&(f.to().line-f.from().line>100||(c=d.getSelection()).length>1e3);var g=b?"-":c||d.getSelection();this.textarea.value=g,d.state.focused&&Rg(this.textarea),tf&&uf>=9&&(this.hasSelection=g)}else a||(this.prevInput=this.textarea.value="",tf&&uf>=9&&(this.hasSelection=null));this.inaccurateSelection=b}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Df||Te()!=this.textarea))try{this.textarea.focus()}catch(a){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var a=this;a.pollingFast||a.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},fastPoll:function(){function a(){var d=c.poll();d||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0,c.polling.set(20,a)},poll:function(){var a=this.cm,b=this.textarea,c=this.prevInput;if(this.contextMenuPending||!a.state.focused||ch(b)&&!c&&!this.composing||a.isReadOnly()||a.options.disableInput||a.state.keySeq)return!1;var d=b.value;if(d==c&&!a.somethingSelected())return!1;if(tf&&uf>=9&&this.hasSelection===d||Ef&&/[\uf700-\uf7ff]/.test(d))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var e=d.charCodeAt(0);if(8203!=e||c||(c=""),8666==e)return this.reset(),this.cm.execCommand("undo")}for(var f=0,g=Math.min(c.length,d.length);g>f&&c.charCodeAt(f)==d.charCodeAt(f);)++f;var h=this;return Eb(a,function(){Z(a,d.slice(f),c.length-f,null,h.composing?"*compose":null),d.length>1e3||d.indexOf("\n")>-1?b.value=h.prevInput="":h.prevInput=d,h.composing&&(h.composing.range.clear(),h.composing.range=a.markText(h.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){tf&&uf>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b=""+(a?g.value:"");g.value="⇚",g.value=b,d.prevInput=a?"":"",g.selectionStart=1,g.selectionEnd=b.length,f.selForContextMenu=e.doc.sel}}function c(){if(d.contextMenuPending=!1,d.wrapper.style.cssText=l,g.style.cssText=k,tf&&9>uf&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!tf||tf&&9>uf)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&""==d.prevInput?Fb(e,kg.selectAll)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):f.input.reset()};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Vb(e,a),i=f.scroller.scrollTop;if(h&&!yf){var j=e.options.resetSelectionOnContextMenu;j&&-1==e.doc.sel.contains(h)&&Fb(e,Aa)(e.doc,na(h),Lg);var k=g.style.cssText,l=d.wrapper.style.cssText;d.wrapper.style.cssText="position: absolute";var m=d.wrapper.getBoundingClientRect();if(g.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(a.clientY-m.top-5)+"px; left: "+(a.clientX-m.left-5)+"px; z-index: 1000; background: "+(tf?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",vf)var n=window.scrollY;if(f.input.focus(),vf&&window.scrollTo(null,n),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),tf&&uf>=9&&b(),Jf){Dg(a);var o=function(){Gg(window,"mouseup",o),setTimeout(c,20)};Eg(window,"mouseup",o)}else setTimeout(c,50)}},readOnlyChanged:function(a){a||this.reset()},setUneditable:Je,needsContentAttribute:!1},ca.prototype),ea.prototype=Le({init:function(a){function b(a){if(!Ae(d,a)){if(d.somethingSelected())Of={lineWise:!1,text:d.getSelections()},"cut"==a.type&&d.replaceSelection("",null,"cut");else{if(!d.options.lineWiseCopyCut)return;var b=aa(d);Of={lineWise:!0,text:b.text},"cut"==a.type&&d.operation(function(){d.setSelections(b.ranges,0,Lg),d.replaceSelection("",null,"cut")})}if(a.clipboardData&&!Cf)a.preventDefault(),a.clipboardData.clearData(),a.clipboardData.setData("text/plain",Of.text.join("\n"));else{var c=da(),e=c.firstChild;d.display.lineSpace.insertBefore(c,d.display.lineSpace.firstChild),e.value=Of.text.join("\n");var f=document.activeElement;Rg(e),setTimeout(function(){d.display.lineSpace.removeChild(c),f.focus()},50)}}}var c=this,d=c.cm,e=c.div=a.lineDiv;ba(e),Eg(e,"paste",function(a){Ae(d,a)||$(a,d)}),Eg(e,"compositionstart",function(a){var b=a.data;if(c.composing={sel:d.doc.sel,data:b,startData:b},b){var e=d.doc.sel.primary(),f=d.getLine(e.head.line),g=f.indexOf(b,Math.max(0,e.head.ch-b.length));g>-1&&g<=e.head.ch&&(c.composing.sel=na(Mf(e.head.line,g),Mf(e.head.line,g+b.length)))}}),Eg(e,"compositionupdate",function(a){c.composing.data=a.data}),Eg(e,"compositionend",function(a){var b=c.composing;b&&(a.data==b.startData||/\u200b/.test(a.data)||(b.data=a.data),setTimeout(function(){b.handled||c.applyComposition(b),c.composing==b&&(c.composing=null)},50))}),Eg(e,"touchstart",function(){c.forceCompositionEnd()}),Eg(e,"input",function(){c.composing||(d.isReadOnly()||!c.pollContent())&&Eb(c.cm,function(){Kb(d)})}),Eg(e,"copy",b),Eg(e,"cut",b)},prepareSelection:function(){var a=Ja(this.cm,!1);return a.focus=this.cm.state.focused,a},showSelection:function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))},showPrimarySelection:function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=ha(this.cm,a.anchorNode,a.anchorOffset),d=ha(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=Nf(X(c,d),b.from())||0!=Nf(W(c,d),b.to())){var e=fa(this.cm,b.from()),f=fa(this.cm,b.to());if(e||f){var g=this.cm.display.view,h=a.rangeCount&&a.getRangeAt(0);if(e){if(!f){var i=g[g.length-1].measure,j=i.maps?i.maps[i.maps.length-1]:i.map;f={node:j[j.length-1],offset:j[j.length-2]-j[j.length-3]}}}else e={node:g[0].measure.map[2],offset:0};try{var k=Sg(e.node,e.offset,f.offset,f.node)}catch(l){}k&&(!qf&&this.cm.state.focused?(a.collapse(e.node,e.offset),k.collapsed||a.addRange(k)):(a.removeAllRanges(),a.addRange(k)),h&&null==a.anchorNode?a.addRange(h):qf&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation(function(){a.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(a){Se(this.cm.display.cursorDiv,a.cursors),Se(this.cm.display.selectionDiv,a.selection)},rememberSelection:function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},selectionInEditor:function(){var a=window.getSelection();if(!a.rangeCount)return!1;var b=a.getRangeAt(0).commonAncestorContainer;return Wg(this.div,b)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():Eb(this.cm,function(){b.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,a)},selectionChanged:function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;this.rememberSelection();var c=ha(b,a.anchorNode,a.anchorOffset),d=ha(b,a.focusNode,a.focusOffset);c&&d&&Eb(b,function(){Aa(b.doc,na(c,d),Lg),(c.bad||d.bad)&&(b.curOp.selectionChanged=!0)})}},pollContent:function(){var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();if(d.line<b.viewFrom||e.line>b.viewTo-1)return!1;var f;if(d.line==b.viewFrom||0==(f=Nb(a,d.line)))var g=be(b.view[0].line),h=b.view[0].node;else var g=be(b.view[f].line),h=b.view[f-1].node.nextSibling;var i=Nb(a,e.line);if(i==b.view.length-1)var j=b.viewTo-1,k=b.lineDiv.lastChild;else var j=be(b.view[i+1].line)-1,k=b.view[i+1].node.previousSibling;for(var l=a.doc.splitLines(ja(a,h,k,g,j)),m=$d(a.doc,Mf(g,0),Mf(j,Zd(a.doc,j).text.length));l.length>1&&m.length>1;)if(Ge(l)==Ge(m))l.pop(),m.pop(),j--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,p=l[0],q=m[0],r=Math.min(p.length,q.length);r>n&&p.charCodeAt(n)==q.charCodeAt(n);)++n;for(var s=Ge(l),t=Ge(m),u=Math.min(s.length-(1==l.length?n:0),t.length-(1==m.length?n:0));u>o&&s.charCodeAt(s.length-o-1)==t.charCodeAt(t.length-o-1);)++o;l[l.length-1]=s.slice(0,s.length-o),l[0]=l[0].slice(n);var v=Mf(g,n),w=Mf(j,m.length?Ge(m).length-o:0);return l.length>1||l[0]||Nf(v,w)?(Gc(a.doc,l,v,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(a){this.cm.isReadOnly()?Fb(this.cm,Kb)(this.cm):a.data&&a.data!=a.startData&&Fb(this.cm,Z)(this.cm,a.data,0,a.sel)},setUneditable:function(a){a.contentEditable="false"},onKeyPress:function(a){a.preventDefault(),this.cm.isReadOnly()||Fb(this.cm,Z)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0)},readOnlyChanged:function(a){this.div.contentEditable=String("nocursor"!=a)},onContextMenu:Je,resetPosition:Je,needsContentAttribute:!0},ea.prototype),a.inputStyles={textarea:ca,contenteditable:ea},ka.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b<this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(0!=Nf(c.anchor,d.anchor)||0!=Nf(c.head,d.head))return!1}return!0},deepCopy:function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new la(V(this.ranges[b].anchor),V(this.ranges[b].head));return new ka(a,this.primIndex)},somethingSelected:function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1},contains:function(a,b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=this.ranges[c];if(Nf(b,d.from())>=0&&Nf(a,d.to())<=0)return c}return-1}},la.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return W(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Pf,Qf,Rf,Sf={left:0,right:0,top:0,bottom:0},Tf=null,Uf=0,Vf=0,Wf=0,Xf=null;tf?Xf=-.53:qf?Xf=15:xf?Xf=-.7:zf&&(Xf=-1/3);var Yf=function(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;return null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail),null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta),{x:b,y:c}};a.wheelEventPixels=function(a){var b=Yf(a);return b.x*=Xf,b.y*=Xf,b};var Zf=new Ee,$f=null,_f=a.changeEnd=function(a){return a.text?Mf(a.from.line+a.text.length-1,Ge(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,bg.hasOwnProperty(a)&&Fb(this,bg[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](Vc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||b[c].name==a)return b.splice(c,1),!0},addOverlay:Gb(function(b,c){var d=b.token?b:a.getMode(this.options,b);if(d.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:d,modeSpec:b,opaque:c&&c.opaque}),this.state.modeGen++,Kb(this)}),removeOverlay:Gb(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a)return b.splice(c,1),this.state.modeGen++,void Kb(this)}}),indentLine:Gb(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),ra(this.doc,a)&&Oc(this,a,b,c)}),indentSelection:Gb(function(a){for(var b=this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var e=b[d];if(e.empty())e.head.line>c&&(Oc(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Mc(this));else{var f=e.from(),g=e.to(),h=Math.max(c,f.line);c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var i=h;c>i;++i)Oc(this,i,a);var j=this.doc.sel.ranges;0==f.ch&&b.length==j.length&&j[d].from().ch>0&&wa(this.doc,d,new la(f,j[d].to()),Lg)}}}),getTokenAt:function(a,b){return Gd(this,a,b)},getLineTokens:function(a,b){return Gd(this,Mf(a),b,!0)},getTokenTypeAt:function(a){a=pa(this.doc,a);var b,c=Jd(this,Zd(this.doc,a.line)),d=0,e=(c.length-1)/2,f=a.ch;if(0==f)b=c[2];else for(;;){var g=d+e>>1;if((g?c[2*g-1]:0)>=f)e=g;else{if(!(c[2*g+1]<f)){b=c[2*g+2];break}d=g+1}}var h=b?b.indexOf("cm-overlay "):-1;return 0>h?b:0==h?null:b.slice(0,h-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!hg.hasOwnProperty(b))return c;var d=hg[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;f<e[b].length;f++){var g=d[e[b][f]];g&&c.push(g)}else e.helperType&&d[e.helperType]?c.push(d[e.helperType]):d[e.name]&&c.push(d[e.name]);for(var f=0;f<d._global.length;f++){var h=d._global[f];h.pred(e,this)&&-1==He(c,h.val)&&c.push(h.val)}return c},getStateAfter:function(a,b){var c=this.doc;return a=oa(c,null==a?c.first+c.size-1:a),Qa(this,a+1,b)},cursorCoords:function(a,b){var c,d=this.doc.sel.primary();return c=null==a?d.head:"object"==typeof a?pa(this.doc,a):a?d.from():d.to(),ob(this,c,b||"page")},charCoords:function(a,b){return nb(this,pa(this.doc,a),b||"page")},coordsChar:function(a,b){return a=mb(this,a,b||"page"),rb(this,a.left,a.top)},lineAtHeight:function(a,b){return a=mb(this,{top:a,left:0},b||"page").top,ce(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c,d=!1;if("number"==typeof a){var e=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>e&&(a=e,d=!0),c=Zd(this.doc,a)}else c=a;return lb(this,c,{top:0,left:0},b||"page").top+(d?this.doc.height-de(c):0)},defaultTextHeight:function(){return tb(this.display)},defaultCharWidth:function(){return ub(this.display)},setGutterMarker:Gb(function(a,b,c){return Pc(this.doc,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Oe(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Gb(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Lb(b,d,"gutter"),Oe(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),lineInfo:function(a){if("number"==typeof a){if(!ra(this.doc,a))return null;var b=a;if(a=Zd(this.doc,a),!a)return null}else{var b=be(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=ob(this,pa(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Jc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Gb(mc),triggerOnKeyPress:Gb(pc),triggerOnKeyUp:oc,execCommand:function(a){return kg.hasOwnProperty(a)?kg[a].call(null,this):void 0},triggerElectric:Gb(function(a){_(this,a)}),findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=pa(this.doc,a);b>f&&(g=Rc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Gb(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Rc(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Ng)}),deleteH:Gb(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Qc(this,function(c){var e=Rc(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=pa(this.doc,a);b>g;++g){var i=ob(this,h,"div");if(null==f?f=i.left:i.left=f,h=Sc(this,i,e,c),h.hitSide)break}return h},moveV:Gb(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=ob(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Sc(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Lc(c,null,nb(c,i,"div").top-h.top),i},Ng),e.length)for(var g=0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]}),findWordAt:function(a){var b=this.doc,c=Zd(b,a.line).text,d=a.ch,e=a.ch;if(c){var f=this.getHelper(a,"wordChars");(a.xRel<0||e==c.length)&&d?--d:++e;for(var g=c.charAt(d),h=Ne(g,f)?function(a){return Ne(a,f)}:/\s/.test(g)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!Ne(a)};d>0&&h(c.charAt(d-1));)--d;for(;e<c.length&&h(c.charAt(e));)++e}return new la(Mf(a.line,d),Mf(a.line,e))},toggleOverwrite:function(a){(null==a||a!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?$g(this.display.cursorDiv,"CodeMirror-overwrite"):Zg(this.display.cursorDiv,"CodeMirror-overwrite"),Hg(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Te()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Gb(function(a,b){(null!=a||null!=b)&&Nc(this),null!=a&&(this.curOp.scrollLeft=a),null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-Ua(this)-this.display.barHeight,width:a.scrollWidth-Ua(this)-this.display.barWidth,clientHeight:Wa(this),clientWidth:Va(this)}},scrollIntoView:Gb(function(a,b){if(null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:Mf(a,0),to:null}:null==a.from&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=b||0,null!=a.from.line)Nc(this),this.curOp.scrollToPos=a;else{var c=Kc(this,Math.min(a.from.left,a.to.left),Math.min(a.from.top,a.to.top)-a.margin,Math.max(a.from.right,a.to.right),Math.max(a.from.bottom,a.to.bottom)+a.margin);this.scrollTo(c.scrollLeft,c.scrollTop)}}),setSize:Gb(function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}var d=this;null!=a&&(d.display.wrapper.style.width=c(a)),null!=b&&(d.display.wrapper.style.height=c(b)),d.options.lineWrapping&&hb(this);var e=d.display.viewFrom;d.doc.iter(e,d.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){Lb(d,e,"widget");break}++e}),d.curOp.forceUpdate=!0,Hg(d,"refresh",this)}),operation:function(a){return Eb(this,a)},refresh:Gb(function(){var a=this.display.cachedTextHeight;Kb(this),this.curOp.forceUpdate=!0,ib(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),k(this),(null==a||Math.abs(a-tb(this.display))>.5)&&g(this),Hg(this,"refresh",this)}),swapDoc:Gb(function(a){var b=this.doc;return b.cm=null,Yd(this,a),ib(this),this.display.input.reset(),this.scrollTo(a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,ye(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},De(a);var ag=a.defaults={},bg=a.optionHandlers={},cg=a.Init={toString:function(){return"CodeMirror.Init"}};Tc("value","",function(a,b){a.setValue(b)},!0),Tc("mode",null,function(a,b){a.doc.modeOption=b,c(a)},!0),Tc("indentUnit",2,c,!0),Tc("indentWithTabs",!1),Tc("smartIndent",!0),Tc("tabSize",4,function(a){d(a),ib(a),Kb(a)},!0),Tc("lineSeparator",null,function(a,b){if(a.doc.lineSep=b,b){var c=[],d=a.doc.first;a.doc.iter(function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(-1==f)break;e=f+b.length,c.push(Mf(d,f))}d++});for(var e=c.length-1;e>=0;e--)Gc(a.doc,b,c[e],Mf(c[e].line,c[e].ch+b.length))}}),Tc("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(b,c,d){b.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),d!=a.Init&&b.refresh()}),Tc("specialCharPlaceholder",Nd,function(a){a.refresh()},!0),Tc("electricChars",!0),Tc("inputStyle",Df?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Tc("rtlMoveVisually",!Gf),Tc("wholeLineUpdateBefore",!0),Tc("theme","default",function(a){h(a),i(a)},!0),Tc("keyMap","default",function(b,c,d){var e=Vc(c),f=d!=a.Init&&Vc(d);f&&f.detach&&f.detach(b,e),e.attach&&e.attach(b,f||null)}),Tc("extraKeys",null),Tc("lineWrapping",!1,e,!0),Tc("gutters",[],function(a){n(a.options),i(a)},!0),Tc("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?y(a.display)+"px":"0",a.refresh()},!0),Tc("coverGutterNextToScrollbar",!1,function(a){s(a)},!0),Tc("scrollbarStyle","native",function(a){r(a),s(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),Tc("lineNumbers",!1,function(a){n(a.options),i(a)},!0),Tc("firstLineNumber",1,i,!0),Tc("lineNumberFormatter",function(a){return a},i,!0),Tc("showCursorWhenSelecting",!1,Ia,!0),Tc("resetSelectionOnContextMenu",!0),Tc("lineWiseCopyCut",!0),Tc("readOnly",!1,function(a,b){"nocursor"==b?(sc(a),a.display.input.blur(),a.display.disabled=!0):a.display.disabled=!1,a.display.input.readOnlyChanged(b)}),Tc("disableInput",!1,function(a,b){b||a.display.input.reset()},!0),Tc("dragDrop",!0,Sb),Tc("allowDropFileTypes",null),Tc("cursorBlinkRate",530),Tc("cursorScrollMargin",0),Tc("cursorHeight",1,Ia,!0),Tc("singleCursorHeightPerLine",!0,Ia,!0),Tc("workTime",100),Tc("workDelay",100),Tc("flattenSpans",!0,d,!0),Tc("addModeClass",!1,d,!0),Tc("pollInterval",100),Tc("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),Tc("historyEventDelay",1250),Tc("viewportMargin",10,function(a){a.refresh()},!0),Tc("maxHighlightLength",1e4,d,!0),Tc("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()}),Tc("tabindex",null,function(a,b){a.display.input.getField().tabIndex=b||""}),Tc("autofocus",null);var dg=a.modes={},eg=a.mimeModes={};a.defineMode=function(b,c){a.defaults.mode||"null"==b||(a.defaults.mode=b),arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),dg[b]=c},a.defineMIME=function(a,b){eg[a]=b},a.resolveMode=function(b){if("string"==typeof b&&eg.hasOwnProperty(b))b=eg[b];else if(b&&"string"==typeof b.name&&eg.hasOwnProperty(b.name)){var c=eg[b.name];"string"==typeof c&&(c={name:c}),b=Ke(c,b),b.name=c.name}else if("string"==typeof b&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return"string"==typeof b?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=dg[c.name];if(!d)return a.getMode(b,"text/plain");var e=d(b,c);if(fg.hasOwnProperty(c.name)){var f=fg[c.name];for(var g in f)f.hasOwnProperty(g)&&(e.hasOwnProperty(g)&&(e["_"+g]=e[g]),e[g]=f[g])}if(e.name=c.name,c.helperType&&(e.helperType=c.helperType),c.modeProps)for(var g in c.modeProps)e[g]=c.modeProps[g];return e},a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var fg=a.modeExtensions={};a.extendMode=function(a,b){var c=fg.hasOwnProperty(a)?fg[a]:fg[a]={};Le(b,c)},a.defineExtension=function(b,c){a.prototype[b]=c},a.defineDocExtension=function(a,b){yg.prototype[a]=b},a.defineOption=Tc;var gg=[];a.defineInitHook=function(a){gg.push(a)};var hg=a.helpers={};a.registerHelper=function(b,c,d){hg.hasOwnProperty(b)||(hg[b]=a[b]={_global:[]}),hg[b][c]=d},a.registerGlobalHelper=function(b,c,d,e){a.registerHelper(b,c,e),hg[b]._global.push({pred:d,val:e})};var ig=a.copyState=function(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c},jg=a.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};a.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var kg=a.commands={selectAll:function(a){a.setSelection(Mf(a.firstLine(),0),Mf(a.lastLine()),Lg)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Lg)},killLine:function(a){Qc(a,function(b){if(b.empty()){var c=Zd(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:Mf(b.head.line+1,0)}:{from:b.head,to:Mf(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){Qc(a,function(b){return{from:Mf(b.from().line,0),to:pa(a.doc,Mf(b.to().line+1,0))}})},delLineLeft:function(a){Qc(a,function(a){return{from:Mf(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){Qc(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return{from:d,to:b.from()}})},delWrappedLineRight:function(a){Qc(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:d}})},undo:function(a){a.undo()},redo:function(a){a.redo()},undoSelection:function(a){a.undoSelection()},redoSelection:function(a){a.redoSelection()},goDocStart:function(a){a.extendSelection(Mf(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(Mf(a.lastLine()))},goLineStart:function(a){a.extendSelectionsBy(function(b){return ff(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){a.extendSelectionsBy(function(b){return hf(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){a.extendSelectionsBy(function(b){return gf(a,b.head.line)},{origin:"+move",bias:-1})},goLineRight:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div")},Ng)},goLineLeft:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:c},"div")},Ng)},goLineLeftSmart:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return d.ch<a.getLine(d.line).search(/\S/)?hf(a,b.head):d},Ng)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection(" ")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),g=Og(a.getLine(f.line),f.ch,d);b.push(Fe(d-g%d))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){Eb(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d].head,f=Zd(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new Mf(e.line,e.ch-1)),e.ch>0)e=new Mf(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),Mf(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=Zd(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),Mf(e.line-1,g.length-1),Mf(e.line,1),"+transpose");
|
5 |
+
}c.push(new la(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){Eb(a,function(){for(var b=a.listSelections().length,c=0;b>c;c++){var d=a.listSelections()[c];a.replaceRange(a.doc.lineSeparator(),d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0)}Mc(a)})},openLine:function(a){a.replaceSelection("\n","start")},toggleOverwrite:function(a){a.toggleOverwrite()}},lg=a.keyMap={};lg.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},lg.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","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","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},lg.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","Ctrl-O":"openLine"},lg.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","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","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},lg["default"]=Ef?lg.macDefault:lg.pcDefault,a.normalizeKeyMap=function(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if("..."==d){delete a[c];continue}for(var e=Ie(c.split(" "),Uc),f=0;f<e.length;f++){var g,h;f==e.length-1?(h=e.join(" "),g=d):(h=e.slice(0,f+1).join(" "),g="...");var i=b[h];if(i){if(i!=g)throw new Error("Inconsistent bindings for "+h)}else b[h]=g}delete a[c]}for(var j in b)a[j]=b[j];return a};var mg=a.lookupKey=function(a,b,c,d){b=Vc(b);var e=b.call?b.call(a,d):b[a];if(e===!1)return"nothing";if("..."===e)return"multi";if(null!=e&&c(e))return"handled";if(b.fallthrough){if("[object Array]"!=Object.prototype.toString.call(b.fallthrough))return mg(a,b.fallthrough,c,d);for(var f=0;f<b.fallthrough.length;f++){var g=mg(a,b.fallthrough[f],c,d);if(g)return g}}},ng=a.isModifierKey=function(a){var b="string"==typeof a?a:fh[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b},og=a.keyName=function(a,b){if(yf&&34==a.keyCode&&a["char"])return!1;var c=fh[a.keyCode],d=c;return null==d||a.altGraphKey?!1:(a.altKey&&"Alt"!=c&&(d="Alt-"+d),(If?a.metaKey:a.ctrlKey)&&"Ctrl"!=c&&(d="Ctrl-"+d),(If?a.ctrlKey:a.metaKey)&&"Cmd"!=c&&(d="Cmd-"+d),!b&&a.shiftKey&&"Shift"!=c&&(d="Shift-"+d),d)};a.fromTextArea=function(b,c){function d(){b.value=j.getValue()}if(c=c?Le(c):{},c.value=b.value,!c.tabindex&&b.tabIndex&&(c.tabindex=b.tabIndex),!c.placeholder&&b.placeholder&&(c.placeholder=b.placeholder),null==c.autofocus){var e=Te();c.autofocus=e==b||null!=b.getAttribute("autofocus")&&e==document.body}if(b.form&&(Eg(b.form,"submit",d),!c.leaveSubmitMethodAlone)){var f=b.form,g=f.submit;try{var h=f.submit=function(){d(),f.submit=g,f.submit(),f.submit=h}}catch(i){}}c.finishInit=function(a){a.save=d,a.getTextArea=function(){return b},a.toTextArea=function(){a.toTextArea=isNaN,d(),b.parentNode.removeChild(a.getWrapperElement()),b.style.display="",b.form&&(Gg(b.form,"submit",d),"function"==typeof b.form.submit&&(b.form.submit=g))}},b.style.display="none";var j=a(function(a){b.parentNode.insertBefore(a,b.nextSibling)},c);return j};var pg=a.StringStream=function(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};pg.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a)var c=b==a;else var c=b&&(a.test?a.test(b):a(b));return c?(++this.pos,b):void 0},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Og(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Og(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Og(this.string,null,this.tabSize)-(this.lineStart?Og(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if("string"!=typeof a){var d=this.string.slice(this.pos).match(a);return d&&d.index>0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var qg=0,rg=a.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++qg};De(rg),rg.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&vb(a),Ce(this,"clear")){var c=this.find();c&&ye(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;f<this.lines.length;++f){var g=this.lines[f],h=ad(g.markedSpans,this);a&&!this.collapsed?Lb(a,be(g),"text"):a&&(null!=h.to&&(e=be(g)),null!=h.from&&(d=be(g))),g.markedSpans=bd(g.markedSpans,h),null==h.from&&this.collapsed&&!wd(this.doc,g)&&a&&ae(g,tb(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var i=sd(this.lines[f]),j=l(i);j>a.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Kb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Da(a.doc)),a&&ye(a,"markerCleared",a,this),b&&xb(a),this.parent&&this.parent.clear()}},rg.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],g=ad(f.markedSpans,this);if(null!=g.from&&(c=Mf(b?f:be(f),g.from),-1==a))return c;if(null!=g.to&&(d=Mf(b?f:be(f),g.to),1==a))return d}return c&&{from:c,to:d}},rg.prototype.changed=function(){var a=this.find(-1,!0),b=this,c=this.doc.cm;a&&c&&Eb(c,function(){var d=a.line,e=be(a.line),f=_a(c,e);if(f&&(gb(f),c.curOp.selectionChanged=c.curOp.forceUpdate=!0),c.curOp.updateMaxLine=!0,!wd(b.doc,d)&&null!=b.height){var g=b.height;b.height=null;var h=zd(b)-g;h&&ae(d,d.height+h)}})},rg.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=He(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},rg.prototype.detachLine=function(a){if(this.lines.splice(He(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}};var qg=0,sg=a.SharedTextMarker=function(a,b){this.markers=a,this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};De(sg),sg.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();ye(this,"clear")}},sg.prototype.find=function(a,b){return this.primary.find(a,b)};var tg=a.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.doc=a,this.node=b};De(tg),tg.prototype.clear=function(){var a=this.doc.cm,b=this.line.widgets,c=this.line,d=be(c);if(null!=d&&b){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||(c.widgets=null);var f=zd(this);ae(c,Math.max(0,c.height-f)),a&&Eb(a,function(){yd(a,c,-f),Lb(a,d,"widget")})}},tg.prototype.changed=function(){var a=this.height,b=this.doc.cm,c=this.line;this.height=null;var d=zd(this)-a;d&&(ae(c,c.height+d),b&&Eb(b,function(){b.curOp.forceUpdate=!0,yd(b,c,d)}))};var ug=a.Line=function(a,b,c){this.text=a,kd(this,b),this.height=c?c(this):1};De(ug),ug.prototype.lineNo=function(){return be(this)};var vg={},wg={};Vd.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;d>c;++c){var e=this.lines[c];this.height-=e.height,Cd(e),ye(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;d<b.length;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;d>a;++a)if(c(this.lines[a]))return!0}},Wd.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(e>a){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Vd))){var h=[];this.collapse(h),this.children=[new Vd(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(f>=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(var g=e.lines.length%25+25,h=g;h<e.lines.length;){var i=new Vd(e.lines.slice(h,h+=25));e.height-=i.height,this.children.splice(++d,0,i),i.parent=this}e.lines=e.lines.slice(0,g),this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Wd(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=He(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Wd(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(f>a){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var xg=0,yg=a.Doc=function(a,b,c,d){if(!(this instanceof yg))return new yg(a,b,c,d);null==c&&(c=0),Wd.call(this,[new Vd([new ug("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var e=Mf(c,0);this.sel=na(e),this.history=new fe(null),this.id=++xg,this.modeOption=b,this.lineSep=d,this.extend=!1,"string"==typeof a&&(a=this.splitLines(a)),Ud(this,{from:e,to:e,text:a}),Aa(this,na(e),Lg)};yg.prototype=Ke(Wd.prototype,{constructor:yg,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=_d(this,this.first,this.first+this.size);return a===!1?b:b.join(a||this.lineSeparator())},setValue:Hb(function(a){var b=Mf(this.first,0),c=this.first+this.size-1;Ac(this,{from:b,to:Mf(c,Zd(this,c).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0),Aa(this,na(b))}),replaceRange:function(a,b,c,d){b=pa(this,b),c=c?pa(this,c):b,Gc(this,a,b,c,d)},getRange:function(a,b,c){var d=$d(this,pa(this,a),pa(this,b));return c===!1?d:d.join(c||this.lineSeparator())},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},getLineHandle:function(a){return ra(this,a)?Zd(this,a):void 0},getLineNumber:function(a){return be(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=Zd(this,a)),sd(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return pa(this,a)},getCursor:function(a){var b,c=this.sel.primary();return b=null==a||"head"==a?c.head:"anchor"==a?c.anchor:"end"==a||"to"==a||a===!1?c.to():c.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Hb(function(a,b,c){xa(this,pa(this,"number"==typeof a?Mf(a,b||0):a),null,c)}),setSelection:Hb(function(a,b,c){xa(this,pa(this,a),pa(this,b||a),c)}),extendSelection:Hb(function(a,b,c){ua(this,pa(this,a),b&&pa(this,b),c)}),extendSelections:Hb(function(a,b){va(this,sa(this,a),b)}),extendSelectionsBy:Hb(function(a,b){var c=Ie(this.sel.ranges,a);va(this,sa(this,c),b)}),setSelections:Hb(function(a,b,c){if(a.length){for(var d=0,e=[];d<a.length;d++)e[d]=new la(pa(this,a[d].anchor),pa(this,a[d].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex)),Aa(this,ma(e,b),c)}}),addSelection:Hb(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new la(pa(this,a),pa(this,b||a))),Aa(this,ma(d,d.length-1),c)}),getSelection:function(a){for(var b,c=this.sel.ranges,d=0;d<c.length;d++){var e=$d(this,c[d].from(),c[d].to());b=b?b.concat(e):e}return a===!1?b:b.join(a||this.lineSeparator())},getSelections:function(a){for(var b=[],c=this.sel.ranges,d=0;d<c.length;d++){var e=$d(this,c[d].from(),c[d].to());a!==!1&&(e=e.join(a||this.lineSeparator())),b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:Hb(function(a,b,c){for(var d=[],e=this.sel,f=0;f<e.ranges.length;f++){var g=e.ranges[f];d[f]={from:g.from(),to:g.to(),text:this.splitLines(a[f]),origin:c}}for(var h=b&&"end"!=b&&yc(this,d,b),f=d.length-1;f>=0;f--)Ac(this,d[f]);h?za(this,h):this.cm&&Mc(this.cm)}),undo:Hb(function(){Cc(this,"undo")}),redo:Hb(function(){Cc(this,"redo")}),undoSelection:Hb(function(){Cc(this,"undo",!0)}),redoSelection:Hb(function(){Cc(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(var d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new fe(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){return a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:qe(this.history.done),undone:qe(this.history.undone)}},setHistory:function(a){var b=this.history=new fe(this.history.maxGeneration);b.done=qe(a.done.slice(0),null,!0),b.undone=qe(a.undone.slice(0),null,!0)},addLineClass:Hb(function(a,b,c){return Pc(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass";if(a[d]){if(Ue(c).test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Hb(function(a,b,c){return Pc(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(Ue(c));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Hb(function(a,b,c){return Ad(this,a,b,c)}),removeLineWidget:function(a){a.clear()},markText:function(a,b,c){return Wc(this,pa(this,a),pa(this,b),c,c&&c.type||"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};return a=pa(this,a),Wc(this,a,a,c,"bookmark")},findMarksAt:function(a){a=pa(this,a);var b=[],c=Zd(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=pa(this,a),b=pa(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,function(f){var g=f.markedSpans;if(g)for(var h=0;h<g.length;h++){var i=g[h];null!=i.to&&e==a.line&&a.ch>=i.to||null==i.from&&e!=a.line||null!=i.from&&e==b.line&&i.from>=b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e}),d},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first,d=this.lineSeparator().length;return this.iter(function(e){var f=e.text.length+d;return f>a?(b=a,!0):(a-=f,void++c)}),pa(this,Mf(c,b))},indexFromPos:function(a){a=pa(this,a);var b=a.ch;if(a.line<this.first||a.ch<0)return 0;var c=this.lineSeparator().length;return this.iter(this.first,a.line,function(a){b+=a.text.length+c}),b},copy:function(a){var b=new yg(_d(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel=this.sel,b.extend=!1,a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new yg(_d(this,b,c),a.mode||this.modeOption,b,this.lineSep);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],Zc(d,Yc(this)),d},unlinkDoc:function(b){if(b instanceof a&&(b=b.doc),this.linked)for(var c=0;c<this.linked.length;++c){var d=this.linked[c];if(d.doc==b){this.linked.splice(c,1),b.unlinkDoc(this),$c(Yc(this));break}}if(b.history==this.history){var e=[b.id];Xd(b,function(a){e.push(a.id)},!0),b.history=new fe(null),b.history.done=qe(this.history.done,e),b.history.undone=qe(this.history.undone,e)}},iterLinkedDocs:function(a){Xd(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(a){return this.lineSep?a.split(this.lineSep):bh(a)},lineSeparator:function(){return this.lineSep||"\n"}}),yg.prototype.eachLine=yg.prototype.iter;var zg="iter insert remove copy getEditor constructor".split(" ");for(var Ag in yg.prototype)yg.prototype.hasOwnProperty(Ag)&&He(zg,Ag)<0&&(a.prototype[Ag]=function(a){return function(){return a.apply(this.doc,arguments)}}(yg.prototype[Ag]));De(yg);var Bg=a.e_preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},Cg=a.e_stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},Dg=a.e_stop=function(a){Bg(a),Cg(a)},Eg=a.on=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={}),e=d[b]||(d[b]=[]);e.push(c)}},Fg=[],Gg=a.off=function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else for(var d=xe(a,b,!1),e=0;e<d.length;++e)if(d[e]==c){d.splice(e,1);break}},Hg=a.signal=function(a,b){var c=xe(a,b,!0);if(c.length)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)},Ig=null,Jg=30,Kg=a.Pass={toString:function(){return"CodeMirror.Pass"}},Lg={scroll:!1},Mg={origin:"*mouse"},Ng={origin:"+move"};Ee.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Og=a.countColumn=function(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var f=d||0,g=e||0;;){var h=a.indexOf(" ",f);if(0>h||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},Pg=a.findColumn=function(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}},Qg=[""],Rg=function(a){a.select()};Cf?Rg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:tf&&(Rg=function(a){try{a.select()}catch(b){}});var Sg,Tg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ug=a.isWordChar=function(a){return/\w/.test(a)||a>""&&(a.toUpperCase()!=a.toLowerCase()||Tg.test(a))},Vg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Sg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Wg=a.contains=function(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)};tf&&11>uf&&(Te=function(){try{return document.activeElement}catch(a){return document.body}});var Xg,Yg,Zg=a.rmClass=function(a,b){var c=a.className,d=Ue(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},$g=a.addClass=function(a,b){var c=a.className;Ue(b).test(c)||(a.className+=(c?" ":"")+b)},_g=!1,ah=function(){if(tf&&9>uf)return!1;var a=Qe("div");return"draggable"in a||"dragDrop"in a}(),bh=a.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},ch=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},dh=function(){var a=Qe("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),eh=null,fh=a.keyNames={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:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var a=0;10>a;a++)fh[a+48]=fh[a+96]=String(a);for(var a=65;90>=a;a++)fh[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)fh[a+111]=fh[a+63235]="F"+a}();var gh,hh=function(){function a(a){return 247>=a?c.charAt(a):a>=1424&&1524>=a?"R":a>=1536&&1773>=a?d.charAt(a-1536):a>=1774&&2220>=a?"r":a>=8192&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/,j="L";return function(c){if(!e.test(c))return!1;for(var d,k=c.length,l=[],m=0;k>m;++m)l.push(d=a(c.charCodeAt(m)));for(var m=0,n=j;k>m;++m){var d=l[m];"m"==d?l[m]=n:n=d}for(var m=0,o=j;k>m;++m){var d=l[m];"1"==d&&"r"==o?l[m]="n":g.test(d)&&(o=d,"r"==d&&(l[m]="R"))}for(var m=1,n=l[0];k-1>m;++m){var d=l[m];"+"==d&&"1"==n&&"1"==l[m+1]?l[m]="1":","!=d||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=d}for(var m=0;k>m;++m){var d=l[m];if(","==d)l[m]="N";else if("%"==d){for(var p=m+1;k>p&&"%"==l[p];++p);for(var q=m&&"!"==l[m-1]||k>p&&"1"==l[p]?"1":"N",r=m;p>r;++r)l[r]=q;m=p-1}}for(var m=0,o=j;k>m;++m){var d=l[m];"L"==o&&"1"==d?l[m]="L":g.test(d)&&(o=d)}for(var m=0;k>m;++m)if(f.test(l[m])){for(var p=m+1;k>p&&f.test(l[p]);++p);for(var s="L"==(m?l[m-1]:j),t="L"==(k>p?l[p]:j),q=s||t?"L":"R",r=m;p>r;++r)l[r]=q;m=p-1}for(var u,v=[],m=0;k>m;)if(h.test(l[m])){var w=m;for(++m;k>m&&h.test(l[m]);++m);v.push(new b(0,w,m))}else{var x=m,y=v.length;for(++m;k>m&&"L"!=l[m];++m);for(var r=x;m>r;)if(i.test(l[r])){r>x&&v.splice(y,0,new b(1,x,r));var z=r;for(++r;m>r&&i.test(l[r]);++r);v.splice(y,0,new b(2,z,r)),x=r}else++r;m>x&&v.splice(y,0,new b(1,x,m))}return 1==v[0].level&&(u=c.match(/^\s+/))&&(v[0].from=u[0].length,v.unshift(new b(0,0,u[0].length))),1==Ge(v).level&&(u=c.match(/\s+$/))&&(Ge(v).to-=u[0].length,v.push(new b(0,k-u[0].length,k))),2==v[0].level&&v.unshift(new b(1,v[0].to,v[0].to)),v[0].level!=Ge(v).level&&v.push(new b(v[0].level,k,k)),v}}();return a.version="5.17.0",a}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.info=d,this.align=e,this.prev=f}function c(a,c,d,e){var f=a.indented;return a.context&&"statement"!=a.context.type&&"statement"!=d&&(f=a.context.indented),a.context=new b(f,c,d,e,null,a.context)}function d(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}function e(a,b,c){return"variable"==b.prevToken||"variable-3"==b.prevToken?!0:/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(a.string.slice(0,c))?!0:b.typeAtEndOfLine&&a.column()==a.indentation()?!0:void 0}function f(a){for(;;){if(!a||"top"==a.type)return!0;if("}"==a.type&&"namespace"!=a.prev.info)return!1;a=a.prev}}function g(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function h(a,b){return"function"==typeof a?a(b):a.propertyIsEnumerable(b)}function i(a,b){if(!b.startOfLine)return!1;for(var c,d=null;c=a.peek();){if("\\"==c&&a.match(/^.$/)){d=i;break}if("/"==c&&a.match(/^\/[\/\*]/,!1))break;a.next()}return b.tokenize=d,"meta"}function j(a,b){return"variable-3"==b.prevToken?"variable-3":!1}function k(a){return a.eatWhile(/[\w\.']/),"number"}function l(a,b){if(a.backUp(1),a.match(/(R|u8R|uR|UR|LR)/)){var c=a.match(/"([^\s\\()]{0,16})\(/);return c?(b.cpp11RawStringDelim=c[1],b.tokenize=o,o(a,b)):!1}return a.match(/(u8|u|U|L)/)?a.match(/["']/,!1)?"string":!1:(a.next(),!1)}function m(a){var b=/(\w+)::(\w+)$/.exec(a);return b&&b[1]==b[2]}function n(a,b){for(var c;null!=(c=a.next());)if('"'==c&&!a.eat('"')){b.tokenize=null;break}return"string"}function o(a,b){var c=b.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),d=a.match(new RegExp(".*?\\)"+c+'"'));return d?b.tokenize=null:a.skipToEnd(),"string"}function p(b,c){function d(a){if(a)for(var b in a)a.hasOwnProperty(b)&&e.push(b)}"string"==typeof b&&(b=[b]);var e=[];d(c.keywords),d(c.types),d(c.builtin),d(c.atoms),e.length&&(c.helperType=b[0],a.registerHelper("hintWords",b[0],e));for(var f=0;f<b.length;++f)a.defineMIME(b[f],c)}function q(a,b){for(var c=!1;!a.eol();){if(!c&&a.match('"""')){b.tokenize=null;break}c="\\"==a.next()&&!c}return"string"}function r(a){return function(b,c){for(var d,e=!1,f=!1;!b.eol();){if(!a&&!e&&b.match('"')){f=!0;break}if(a&&b.match('"""')){f=!0;break}d=b.next(),!e&&"$"==d&&b.match("{")&&b.skipTo("}"),e=!e&&"\\"==d&&!a}return(f||!a)&&(c.tokenize=null),"string"}}function s(a){return function(b,c){for(var d,e=!1,f=!1;!b.eol();){if(!e&&b.match('"')&&("single"==a||b.match('""'))){f=!0;break}if(!e&&b.match("``")){v=s(a),f=!0;break}d=b.next(),e="single"==a&&!e&&"\\"==d}return f&&(c.tokenize=null),"string"}}a.defineMode("clike",function(g,i){function j(a,b){var c=a.next();if(y[c]){var d=y[c](a,b);if(d!==!1)return d}if('"'==c||"'"==c)return b.tokenize=k(c),b.tokenize(a,b);if(D.test(c))return n=c,null;if(E.test(c)){if(a.backUp(1),a.match(F))return"number";a.next()}if("/"==c){if(a.eat("*"))return b.tokenize=l,l(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(G.test(c)){for(;!a.match(/^\/[\/*]/,!1)&&a.eat(G););return"operator"}if(a.eatWhile(/[\w\$_\xa1-\uffff]/),C)for(;a.match(C);)a.eatWhile(/[\w\$_\xa1-\uffff]/);var e=a.current();return h(s,e)?(h(v,e)&&(n="newstatement"),h(w,e)&&(o=!0),"keyword"):h(t,e)?"variable-3":h(u,e)?(h(v,e)&&(n="newstatement"),"builtin"):h(x,e)?"atom":"variable"}function k(a){return function(b,c){for(var d,e=!1,f=!1;null!=(d=b.next());){if(d==a&&!e){f=!0;break}e=!e&&"\\"==d}return(f||!e&&!z)&&(c.tokenize=null),"string"}}function l(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=null;break}d="*"==c}return"comment"}function m(a,b){i.typeFirstDefinitions&&a.eol()&&f(b.context)&&(b.typeAtEndOfLine=e(a,b,a.pos));
|
6 |
+
}var n,o,p=g.indentUnit,q=i.statementIndentUnit||p,r=i.dontAlignCalls,s=i.keywords||{},t=i.types||{},u=i.builtin||{},v=i.blockKeywords||{},w=i.defKeywords||{},x=i.atoms||{},y=i.hooks||{},z=i.multiLineStrings,A=i.indentStatements!==!1,B=i.indentSwitch!==!1,C=i.namespaceSeparator,D=i.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,E=i.numberStart||/[\d\.]/,F=i.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,G=i.isOperatorChar||/[+\-*&%=<>!?|\/]/,H=i.endStatement||/^[;:,]$/;return{startState:function(a){return{tokenize:null,context:new b((a||0)-p,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(a,b){var g=b.context;if(a.sol()&&(null==g.align&&(g.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return m(a,b),null;n=o=null;var h=(b.tokenize||j)(a,b);if("comment"==h||"meta"==h)return h;if(null==g.align&&(g.align=!0),H.test(n))for(;"statement"==b.context.type;)d(b);else if("{"==n)c(b,a.column(),"}");else if("["==n)c(b,a.column(),"]");else if("("==n)c(b,a.column(),")");else if("}"==n){for(;"statement"==g.type;)g=d(b);for("}"==g.type&&(g=d(b));"statement"==g.type;)g=d(b)}else n==g.type?d(b):A&&(("}"==g.type||"top"==g.type)&&";"!=n||"statement"==g.type&&"newstatement"==n)&&c(b,a.column(),"statement",a.current());if("variable"==h&&("def"==b.prevToken||i.typeFirstDefinitions&&e(a,b,a.start)&&f(b.context)&&a.match(/^\s*\(/,!1))&&(h="def"),y.token){var k=y.token(a,b,h);void 0!==k&&(h=k)}return"def"==h&&i.styleDefs===!1&&(h="variable"),b.startOfLine=!1,b.prevToken=o?"def":h||n,m(a,b),h},indent:function(b,c){if(b.tokenize!=j&&null!=b.tokenize||b.typeAtEndOfLine)return a.Pass;var d=b.context,e=c&&c.charAt(0);if("statement"==d.type&&"}"==e&&(d=d.prev),i.dontIndentStatements)for(;"statement"==d.type&&i.dontIndentStatements.test(d.info);)d=d.prev;if(y.indent){var f=y.indent(b,d,c);if("number"==typeof f)return f}var g=e==d.type,h=d.prev&&"switch"==d.prev.info;if(i.allmanIndentation&&/[{(]/.test(e)){for(;"top"!=d.type&&"}"!=d.type;)d=d.prev;return d.indented}return"statement"==d.type?d.indented+("{"==e?0:q):!d.align||r&&")"==d.type?")"!=d.type||g?d.indented+(g?0:p)+(g||!h||/^(?:case|default)\b/.test(c)?0:p):d.indented+q:d.column+(g?0:1)},electricInput:B?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var t="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",u="int long char short double float unsigned signed void size_t ptrdiff_t";p(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:g(t),types:g(u+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:g("case do else for if switch while struct"),defKeywords:g("struct"),typeFirstDefinitions:!0,atoms:g("null true false"),hooks:{"#":i,"*":j},modeProps:{fold:["brace","include"]}}),p(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:g(t+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:g(u+" bool wchar_t"),blockKeywords:g("catch class do else finally for if struct switch try while"),defKeywords:g("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:g("true false null"),dontIndentStatements:/^template$/,hooks:{"#":i,"*":j,u:l,U:l,L:l,R:l,0:k,1:k,2:k,3:k,4:k,5:k,6:k,7:k,8:k,9:k,token:function(a,b,c){return"variable"!=c||"("!=a.peek()||";"!=b.prevToken&&null!=b.prevToken&&"}"!=b.prevToken||!m(a.current())?void 0:"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),p("text/x-java",{name:"clike",keywords:g("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:g("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:g("catch class do else finally for if switch try while"),defKeywords:g("class interface package enum"),typeFirstDefinitions:!0,atoms:g("true false null"),endStatement:/^[;:]$/,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),p("text/x-csharp",{name:"clike",keywords:g("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:g("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:g("catch class do else finally for foreach if struct switch try while"),defKeywords:g("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:g("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=n,n(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),p("text/x-scala",{name:"clike",keywords:g("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:g("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:g("catch class do else finally for forSome if match switch try while"),defKeywords:g("class def object package trait type val var"),atoms:g("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return a.match('""')?(b.tokenize=q,b.tokenize(a,b)):!1},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(a,c){var d=c.context;return"}"==d.type&&d.align&&a.eat(">")?(c.context=new b(d.indented,d.column,d.type,d.info,null,d.prev),"operator"):!1}},modeProps:{closeBrackets:{triples:'"'}}}),p("text/x-kotlin",{name:"clike",keywords:g("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix"),types:g("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,blockKeywords:g("catch class do else finally for if where try while enum"),defKeywords:g("class val var object package interface fun"),atoms:g("true false null this"),hooks:{'"':function(a,b){return b.tokenize=r(a.match('""')),b.tokenize(a,b)}},modeProps:{closeBrackets:{triples:'"'}}}),p(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:g("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:g("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:g("for while do if else struct"),builtin:g("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:g("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":i},modeProps:{fold:["brace","include"]}}),p("text/x-nesc",{name:"clike",keywords:g(t+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:g(u),blockKeywords:g("case do else for if switch while struct"),atoms:g("null true false"),hooks:{"#":i},modeProps:{fold:["brace","include"]}}),p("text/x-objectivec",{name:"clike",keywords:g(t+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:g(u),atoms:g("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":i,indent:function(a,b,c){return"statement"==b.type&&/^@\w/.test(c)?b.indented:void 0}},modeProps:{fold:"brace"}}),p("text/x-squirrel",{name:"clike",keywords:g("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:g(u),blockKeywords:g("case catch class else for foreach if switch try while"),defKeywords:g("function local class"),typeFirstDefinitions:!0,atoms:g("true false null"),hooks:{"#":i},modeProps:{fold:["brace","include"]}});var v=null;p("text/x-ceylon",{name:"clike",keywords:g("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(a){var b=a.charAt(0);return b===b.toUpperCase()&&b!==b.toLowerCase()},blockKeywords:g("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:g("class dynamic function interface module object package value"),builtin:g("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:g("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return b.tokenize=s(a.match('""')?"triple":"single"),b.tokenize(a,b)},"`":function(a,b){return v&&a.match("`")?(b.tokenize=v,v=null,b.tokenize(a,b)):!1},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(a,b,c){return"variable"!=c&&"variable-3"!=c||"."!=b.prevToken?void 0:"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b,e){return 0==a.length?d(b):function(f,g){for(var h=a[0],i=0;i<h.length;i++)if(f.match(h[i][0]))return g.tokenize=c(a.slice(1),b),h[i][1];return g.tokenize=d(b,e),"string"}}function d(a,b){return function(c,d){return e(c,d,a,b)}}function e(a,b,d,e){if(e!==!1&&a.match("${",!1)||a.match("{$",!1))return b.tokenize=null,"string";if(e!==!1&&a.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return a.match("[",!1)&&(b.tokenize=c([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],d,e)),a.match(/\-\>\w/,!1)&&(b.tokenize=c([[["->",null]],[[/[\w]+/,"variable"]]],d,e)),"variable-2";for(var f=!1;!a.eol()&&(f||e===!1||!a.match("{$",!1)&&!a.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!f&&a.match(d)){b.tokenize=null,b.tokStack.pop(),b.tokStack.pop();break}f="\\"==a.next()&&!f}return"string"}var f="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",g="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",h="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";a.registerHelper("hintWords","php",[f,g,h].join(" ").split(" ")),a.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:b(f),blockKeywords:b("catch do else elseif for foreach if switch try while finally"),defKeywords:b("class function interface namespace trait"),atoms:b(g),builtin:b(h),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,b){var c;if(c=a.match(/<<\s*/)){var e=a.eat(/['"]/);a.eatWhile(/[\w\.]/);var f=a.current().slice(c[0].length+(e?2:1));if(e&&a.eat(e),f)return(b.tokStack||(b.tokStack=[])).push(f,0),b.tokenize=d(f,"'"!=e),"string"}return!1},"#":function(a){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1},'"':function(a,b){return(b.tokStack||(b.tokStack=[])).push('"',0),b.tokenize=d('"'),"string"},"{":function(a,b){return b.tokStack&&b.tokStack.length&&b.tokStack[b.tokStack.length-1]++,!1},"}":function(a,b){return b.tokStack&&b.tokStack.length>0&&!--b.tokStack[b.tokStack.length-1]&&(b.tokenize=d(b.tokStack[b.tokStack.length-2])),!1}}};a.defineMode("php",function(b,c){function d(b,c){var d=c.curMode==f;if(b.sol()&&c.pending&&'"'!=c.pending&&"'"!=c.pending&&(c.pending=null),d)return d&&null==c.php.tokenize&&b.match("?>")?(c.curMode=e,c.curState=c.html,c.php.context.prev||(c.php=null),"meta"):f.token(b,c.curState);if(b.match(/^<\?\w*/))return c.curMode=f,c.php||(c.php=a.startState(f,e.indent(c.html,""))),c.curState=c.php,"meta";if('"'==c.pending||"'"==c.pending){for(;!b.eol()&&b.next()!=c.pending;);var g="string"}else if(c.pending&&b.pos<c.pending.end){b.pos=c.pending.end;var g=c.pending.style}else var g=e.token(b,c.curState);c.pending&&(c.pending=null);var h,i=b.current(),j=i.search(/<\?/);return-1!=j&&("string"==g&&(h=i.match(/[\'\"]$/))&&!/\?>/.test(i)?c.pending=h[0]:c.pending={end:b.pos,style:g},b.backUp(i.length-j)),g}var e=a.getMode(b,"text/html"),f=a.getMode(b,i);return{startState:function(){var b=a.startState(e),d=c.startOpen?a.startState(f):null;return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var c,d=b.html,g=a.copyState(e,d),h=b.php,i=h&&a.copyState(f,h);return c=b.curMode==e?g:i,{html:g,php:i,curMode:b.curMode,curState:c,pending:b.pending}},token:d,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",i)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b,e,f){if(this.atOccurrence=!1,this.doc=a,null==f&&"string"==typeof b&&(f=!1),e=e?a.clipPos(e):d(0,0),this.pos={from:e,to:e},"string"!=typeof b)b.global||(b=new RegExp(b.source,b.ignoreCase?"ig":"g")),this.matches=function(c,e){if(c){b.lastIndex=0;for(var f,g,h=a.getLine(e.line).slice(0,e.ch),i=0;;){b.lastIndex=i;var j=b.exec(h);if(!j)break;if(f=j,g=f.index,i=f.index+(f[0].length||1),i==h.length)break}var k=f&&f[0].length||0;k||(0==g&&0==h.length?f=void 0:g!=a.getLine(e.line).length&&k++)}else{b.lastIndex=e.ch;var h=a.getLine(e.line),f=b.exec(h),k=f&&f[0].length||0,g=f&&f.index;g+k==h.length||k||(k=1)}return f&&k?{from:d(e.line,g),to:d(e.line,g+k),match:f}:void 0};else{var g=b;f&&(b=b.toLowerCase());var h=f?function(a){return a.toLowerCase()}:function(a){return a},i=b.split("\n");if(1==i.length)b.length?this.matches=function(e,f){if(e){var i=a.getLine(f.line).slice(0,f.ch),j=h(i),k=j.lastIndexOf(b);if(k>-1)return k=c(i,j,k),{from:d(f.line,k),to:d(f.line,k+g.length)}}else{var i=a.getLine(f.line).slice(f.ch),j=h(i),k=j.indexOf(b);if(k>-1)return k=c(i,j,k)+f.ch,{from:d(f.line,k),to:d(f.line,k+g.length)}}}:this.matches=function(){};else{var j=g.split("\n");this.matches=function(b,c){var e=i.length-1;if(b){if(c.line-(i.length-1)<a.firstLine())return;if(h(a.getLine(c.line).slice(0,j[e].length))!=i[i.length-1])return;for(var f=d(c.line,j[e].length),g=c.line-1,k=e-1;k>=1;--k,--g)if(i[k]!=h(a.getLine(g)))return;var l=a.getLine(g),m=l.length-j[0].length;if(h(l.slice(m))!=i[0])return;return{from:d(g,m),to:f}}if(!(c.line+(i.length-1)>a.lastLine())){var l=a.getLine(c.line),m=l.length-j[0].length;if(h(l.slice(m))==i[0]){for(var n=d(c.line,m),g=c.line+1,k=1;e>k;++k,++g)if(i[k]!=h(a.getLine(g)))return;if(h(a.getLine(g).slice(0,j[e].length))==i[e])return{from:n,to:d(g,j[e].length)}}}}}}}function c(a,b,c){if(a.length==b.length)return c;for(var d=Math.min(c,a.length);;){var e=a.slice(0,d).toLowerCase().length;if(c>e)++d;else{if(!(e>c))return d;--d}}}var d=a.Pos;b.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function b(a){var b=d(a,0);return c.pos={from:b,to:b},c.atOccurrence=!1,!1}for(var c=this,e=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,e))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!e.line)return b(0);e=d(e.line-1,this.doc.getLine(e.line-1).length)}else{var f=this.doc.lineCount();if(e.line==f-1)return b(f);e=d(e.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(b,c){if(this.atOccurrence){var e=a.splitLines(b);this.doc.replaceRange(e,this.pos.from,this.pos.to,c),this.pos.to=d(this.pos.from.line+e.length-1,e[e.length-1].length+(1==e.length?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(a,c,d){return new b(this.doc,a,c,d)}),a.defineDocExtension("getSearchCursor",function(a,c,d){return new b(this,a,c,d)}),a.defineExtension("selectMatches",function(b,c){for(var d=[],e=this.getSearchCursor(b,this.getCursor("from"),c);e.findNext()&&!(a.cmpPos(e.to(),this.getCursor("to"))>0);)d.push({anchor:e.from(),head:e.to()});d.length&&this.setSelections(d,0)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b){return"string"==typeof a?a=new RegExp(a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),b?"gi":"g"):a.global||(a=new RegExp(a.source,a.ignoreCase?"gi":"g")),
|
7 |
+
{token:function(b){a.lastIndex=b.pos;var c=a.exec(b.string);return c&&c.index==b.pos?(b.pos+=c[0].length||1,"searching"):void(c?b.pos=c.index:b.skipToEnd())}}}function c(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function d(a){return a.state.search||(a.state.search=new c)}function e(a){return"string"==typeof a&&a==a.toLowerCase()}function f(a,b,c){return a.getSearchCursor(b,c,e(b))}function g(a,b,c,d,e){a.openDialog(b,d,{value:c,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){o(a)},onKeyDown:e})}function h(a,b,c,d,e){a.openDialog?a.openDialog(b,e,{value:d,selectValueOnOpen:!0}):e(prompt(c,d))}function i(a,b,c,d){a.openConfirm?a.openConfirm(b,d):confirm(c)&&d[0]()}function j(a){return a.replace(/\\(.)/g,function(a,b){return"n"==b?"\n":"r"==b?"\r":b})}function k(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);if(b)try{a=new RegExp(b[1],-1==b[2].indexOf("i")?"":"i")}catch(c){}else a=j(a);return("string"==typeof a?""==a:a.test(""))&&(a=/x^/),a}function l(a,c,d){c.queryText=d,c.query=k(d),a.removeOverlay(c.overlay,e(c.query)),c.overlay=b(c.query,e(c.query)),a.addOverlay(c.overlay),a.showMatchesOnScrollbar&&(c.annotate&&(c.annotate.clear(),c.annotate=null),c.annotate=a.showMatchesOnScrollbar(c.query,e(c.query)))}function m(b,c,e,f){var i=d(b);if(i.query)return n(b,c);var j=b.getSelection()||i.lastQuery;if(e&&b.openDialog){var k=null,m=function(c,d){a.e_stop(d),c&&(c!=i.queryText&&(l(b,i,c),i.posFrom=i.posTo=b.getCursor()),k&&(k.style.opacity=1),n(b,d.shiftKey,function(a,c){var d;c.line<3&&document.querySelector&&(d=b.display.wrapper.querySelector(".CodeMirror-dialog"))&&d.getBoundingClientRect().bottom-4>b.cursorCoords(c,"window").top&&((k=d).style.opacity=.4)}))};g(b,r,j,m,function(c,e){var f=a.keyMap[b.getOption("keyMap")][a.keyName(c)];"findNext"==f||"findPrev"==f?(a.e_stop(c),l(b,d(b),e),b.execCommand(f)):("find"==f||"findPersistent"==f)&&(a.e_stop(c),m(e,c))}),f&&(l(b,i,j),n(b,c))}else h(b,r,"Search for:",j,function(a){a&&!i.query&&b.operation(function(){l(b,i,a),i.posFrom=i.posTo=b.getCursor(),n(b,c)})})}function n(b,c,e){b.operation(function(){var g=d(b),h=f(b,g.query,c?g.posFrom:g.posTo);(h.find(c)||(h=f(b,g.query,c?a.Pos(b.lastLine()):a.Pos(b.firstLine(),0)),h.find(c)))&&(b.setSelection(h.from(),h.to()),b.scrollIntoView({from:h.from(),to:h.to()},20),g.posFrom=h.from(),g.posTo=h.to(),e&&e(h.from(),h.to()))})}function o(a){a.operation(function(){var b=d(a);b.lastQuery=b.query,b.query&&(b.query=b.queryText=null,a.removeOverlay(b.overlay),b.annotate&&(b.annotate.clear(),b.annotate=null))})}function p(a,b,c){a.operation(function(){for(var d=f(a,b);d.findNext();)if("string"!=typeof b){var e=a.getRange(d.from(),d.to()).match(b);d.replace(c.replace(/\$(\d)/g,function(a,b){return e[b]}))}else d.replace(c)})}function q(a,b){if(!a.getOption("readOnly")){var c=a.getSelection()||d(a).lastQuery,e=b?"Replace all:":"Replace:";h(a,e+s,e,c,function(c){c&&(c=k(c),h(a,t,"Replace with:","",function(d){if(d=j(d),b)p(a,c,d);else{o(a);var e=f(a,c,a.getCursor("from")),g=function(){var b,j=e.from();!(b=e.findNext())&&(e=f(a,c),!(b=e.findNext())||j&&e.from().line==j.line&&e.from().ch==j.ch)||(a.setSelection(e.from(),e.to()),a.scrollIntoView({from:e.from(),to:e.to()}),i(a,u,"Replace?",[function(){h(b)},g,function(){p(a,c,d)}]))},h=function(a){e.replace("string"==typeof c?d:d.replace(/\$(\d)/g,function(b,c){return a[c]})),g()};g()}}))})}}var r='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',s=' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',t='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',u="Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";a.commands.find=function(a){o(a),m(a)},a.commands.findPersistent=function(a){o(a),m(a,!1,!0)},a.commands.findPersistentNext=function(a){m(a,!1,!0,!0)},a.commands.findPersistentPrev=function(a){m(a,!0,!0,!0)},a.commands.findNext=m,a.commands.findPrev=function(a){m(a,!0)},a.commands.clearSearch=o,a.commands.replace=q,a.commands.replaceAll=function(a){q(a,!0)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function b(a,b,d,e){var f=a.getLineHandle(b.line),i=b.ch-1,j=i>=0&&h[f.text.charAt(i)]||h[f.text.charAt(++i)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&k>0!=(i==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,i+1)),m=c(a,g(b.line,i+(k>0?1:0)),k,l||null,e);return null==m?null:{from:g(b.line,i),to:m&&m.pos,match:m&&m.ch==j.charAt(0),forward:k>0}}function c(a,b,c,d,e){for(var f=e&&e.maxScanLineLength||1e4,i=e&&e.maxScanLines||1e3,j=[],k=e&&e.bracketRegex?e.bracketRegex:/[(){}[\]]/,l=c>0?Math.min(b.line+i,a.lastLine()+1):Math.max(a.firstLine()-1,b.line-i),m=b.line;m!=l;m+=c){var n=a.getLine(m);if(n){var o=c>0?0:n.length-1,p=c>0?n.length:-1;if(!(n.length>f))for(m==b.line&&(o=b.ch-(0>c?1:0));o!=p;o+=c){var q=n.charAt(o);if(k.test(q)&&(void 0===d||a.getTokenTypeAt(g(m,o+1))==d)){var r=h[q];if(">"==r.charAt(1)==c>0)j.push(q);else{if(!j.length)return{pos:g(m,o),ch:q};j.pop()}}}}}return m-c==(c>0?a.lastLine():a.firstLine())?!1:null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j<i.length;j++){var k=i[j].empty()&&b(a,i[j].head,!1,d);if(k&&a.getLine(k.from.line).length<=e){var l=k.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";h.push(a.markText(k.from,g(k.from.line,k.from.ch+1),{className:l})),k.to&&a.getLine(k.to.line).length<=e&&h.push(a.markText(k.to,g(k.to.line,k.to.ch+1),{className:l}))}}if(h.length){f&&a.state.focused&&a.focus();var m=function(){a.operation(function(){for(var a=0;a<h.length;a++)h[a].clear()})};if(!c)return m;setTimeout(m,800)}}function e(a){a.operation(function(){i&&(i(),i=null),i=d(a,!1,a.state.matchBrackets)})}var f=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),g=a.Pos,h={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},i=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&b.off("cursorActivity",e),c&&(b.state.matchBrackets="object"==typeof c?c:{},b.on("cursorActivity",e))}),a.defineExtension("matchBrackets",function(){d(this,!0)}),a.defineExtension("findMatchingBracket",function(a,c,d){return b(this,a,c,d)}),a.defineExtension("scanForBracket",function(a,b,d,e){return c(this,a,b,d,e)})});
|
languages/code-snippets-de_DE.mo
CHANGED
Binary file
|
languages/code-snippets-de_DE.po
CHANGED
@@ -1,26 +1,20 @@
|
|
1 |
-
# This German Language File: Copyright (C) 2013 by David Decker of deckerweb.de & genesisthemes.de
|
2 |
-
# This file is distributed under the same license as the Code Snippets Plugin package.
|
3 |
-
#
|
4 |
-
# Weitere deutsche Sprachdateien fuer WordPress-Plugins und -Themes finden Sie unter:
|
5 |
-
# --> http://deckerweb.de/sprachdateien/
|
6 |
-
#
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
-
"Project-Id-Version: Code Snippets
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
"POT-Creation-Date: 2016-01-10 17:19+0100\n"
|
12 |
-
"PO-Revision-Date: 2016-01-
|
13 |
"Last-Translator: Joerg Knoerchen <webmaster@sensorgrafie.de>\n"
|
14 |
-
"Language-Team:
|
15 |
"Language: de_DE\n"
|
16 |
"MIME-Version: 1.0\n"
|
17 |
"Content-Type: text/plain; charset=UTF-8\n"
|
18 |
"Content-Transfer-Encoding: 8bit\n"
|
19 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
20 |
-
"X-Generator: Poedit 1.8.
|
21 |
-
"X-Poedit-SourceCharset:
|
22 |
-
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;
|
23 |
-
"_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
24 |
"X-Poedit-Basepath: ..\n"
|
25 |
"X-Textdomain-Support: yes\n"
|
26 |
"X-Poedit-SearchPath-0: .\n"
|
@@ -30,8 +24,8 @@ msgid "You are not authorized to access this page."
|
|
30 |
msgstr "Du hast keine Berechtigung diese Seite zu betreten."
|
31 |
|
32 |
# @ code-snippets
|
33 |
-
#: php/admin-menus/class-edit-menu.php:13
|
34 |
-
#: php/views/edit.php:25
|
35 |
msgid "Edit Snippet"
|
36 |
msgstr "Codeschnipsel bearbeiten"
|
37 |
|
@@ -47,30 +41,40 @@ msgstr "Neuen Codeschnipsel hinzufügen"
|
|
47 |
|
48 |
#: php/admin-menus/class-edit-menu.php:149
|
49 |
msgid "Don't Panic"
|
50 |
-
msgstr ""
|
51 |
|
52 |
#: php/admin-menus/class-edit-menu.php:150
|
53 |
#, php-format
|
54 |
-
msgid "
|
|
|
55 |
msgstr ""
|
|
|
|
|
56 |
|
57 |
#: php/admin-menus/class-edit-menu.php:152
|
58 |
msgid ""
|
59 |
-
"The previous version of the snippet is unchanged, and the rest of this site
|
60 |
-
"be functioning normally as before."
|
61 |
msgstr ""
|
|
|
|
|
62 |
|
63 |
#: php/admin-menus/class-edit-menu.php:153
|
64 |
msgid ""
|
65 |
-
"Please use the back button in your browser to return to the previous page
|
66 |
-
"to fix the code error."
|
67 |
msgstr ""
|
|
|
|
|
68 |
|
69 |
#: php/admin-menus/class-edit-menu.php:154
|
70 |
msgid ""
|
71 |
-
"If you prefer, you can close this page and discard the changes you just
|
72 |
-
"changes will be made to this site."
|
73 |
msgstr ""
|
|
|
|
|
|
|
74 |
|
75 |
# @ code-snippets
|
76 |
#: php/admin-menus/class-edit-menu.php:279 php/class-list-table.php:324
|
@@ -91,7 +95,7 @@ msgstr "Codeschnipsel überall ausführen"
|
|
91 |
|
92 |
#: php/admin-menus/class-edit-menu.php:333
|
93 |
msgid "Only run in administration area"
|
94 |
-
msgstr ""
|
95 |
|
96 |
#: php/admin-menus/class-edit-menu.php:334
|
97 |
msgid "Only run on site front-end"
|
@@ -103,20 +107,23 @@ msgstr "Bereich"
|
|
103 |
|
104 |
#: php/admin-menus/class-edit-menu.php:358
|
105 |
msgid "Sharing"
|
106 |
-
msgstr ""
|
107 |
|
108 |
#: php/admin-menus/class-edit-menu.php:362
|
109 |
msgid "Allow this snippet to be activated on individual sites on the network"
|
110 |
msgstr ""
|
|
|
|
|
111 |
|
112 |
#: php/admin-menus/class-edit-menu.php:415
|
113 |
#, php-format
|
114 |
msgid "The snippet has been deactivated due to an error on line %d:"
|
115 |
msgstr ""
|
|
|
116 |
|
117 |
#: php/admin-menus/class-edit-menu.php:420
|
118 |
msgid "The snippet has been deactivated due to an error in the code."
|
119 |
-
msgstr ""
|
120 |
|
121 |
#: php/admin-menus/class-edit-menu.php:427
|
122 |
msgid "An error occurred when saving the snippet."
|
@@ -135,16 +142,19 @@ msgstr "Codeschnipsel <strong>aktualisiert</strong>."
|
|
135 |
# @ code-snippets
|
136 |
#: php/admin-menus/class-edit-menu.php:434
|
137 |
msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
|
138 |
-
msgstr "
|
|
|
139 |
|
140 |
# @ code-snippets
|
141 |
#: php/admin-menus/class-edit-menu.php:435
|
142 |
msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
|
143 |
-
msgstr "
|
|
|
144 |
|
145 |
#: php/admin-menus/class-edit-menu.php:436
|
146 |
msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
|
147 |
-
msgstr "
|
|
|
148 |
|
149 |
# @ code-snippets
|
150 |
#: php/admin-menus/class-import-menu.php:15
|
@@ -168,15 +178,17 @@ msgstr "Importiere Codeschnipsel aus einer Code Snippets Export Datei."
|
|
168 |
#: php/admin-menus/class-import-menu.php:88
|
169 |
#, php-format
|
170 |
msgid ""
|
171 |
-
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</
|
|
|
172 |
msgid_plural ""
|
173 |
-
"Successfully imported <strong>%d</strong> snippets. <a href=\"%s\">Have fun
|
|
|
174 |
msgstr[0] ""
|
175 |
-
"Erfolgreicher Import des <strong>%d</strong> Codeschnipsel. <a href=\"%s
|
176 |
-
"Spass!</a>"
|
177 |
msgstr[1] ""
|
178 |
-
"Erfolgreicher Import der <strong>%d</strong> Codeschnipsel. <a href=\"%s
|
179 |
-
"Spass!</a>"
|
180 |
|
181 |
#: php/admin-menus/class-import-menu.php:101
|
182 |
msgid "An error occurred when processing the import file."
|
@@ -188,23 +200,25 @@ msgid "Manage"
|
|
188 |
msgstr "Verwalten"
|
189 |
|
190 |
# @ code-snippets
|
191 |
-
#: php/admin-menus/class-manage-menu.php:23
|
192 |
-
#: php/admin-menus/class-manage-menu.php:
|
|
|
|
|
193 |
msgid "Snippets"
|
194 |
msgstr "Codeschnipsel"
|
195 |
|
196 |
#: php/admin-menus/class-manage-menu.php:75
|
197 |
msgid ""
|
198 |
-
"<strong>Warning:</strong> Safe mode is active and snippets will not execute!
|
199 |
-
"the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-
|
200 |
-
"to turn off safe mode. <a href=\"https://github.com/
|
201 |
-
"Safe-Mode\" target=\"_blank\">Help</a>"
|
202 |
msgstr ""
|
203 |
"<strong>Warnung:</strong> Sicherheitsmodus aktiv! Codeschnipsel werden nicht "
|
204 |
-
"ausgeführt. Entferne den Parameter <code>CODE_SNIPPETS_SAFE_MODE</code> aus
|
205 |
-
"<code>wp-config.php</code> um den Sicherheitsmodus auszuschalten. <a
|
206 |
-
"github.com/sheabunge/code-snippets/wiki/Safe-Mode\" target
|
207 |
-
"(engl.)</a>"
|
208 |
|
209 |
# @ code-snippets
|
210 |
#: php/admin-menus/class-manage-menu.php:81
|
@@ -282,13 +296,14 @@ msgstr "Spenden"
|
|
282 |
|
283 |
#: php/admin.php:190
|
284 |
msgid ""
|
285 |
-
"<strong>Have feedback on Code Snippets?</strong> Please take the time to
|
286 |
-
"short survey on how you use this plugin and what you'd like to see
|
287 |
-
"in the future."
|
288 |
msgstr ""
|
289 |
-
"<strong>Kommentar zu Codeschnipsel?</strong> Nehmen sie sich ein wenig Zeit
|
290 |
-
"beantworten sie bitte eine kurze Umfrage zum Plugin, wie sie es nutzen
|
291 |
-
"Funktionen sie in Zukunft gerne verändert oder hinzugefügt haben
|
|
|
292 |
|
293 |
#: php/admin.php:193
|
294 |
msgid "Take the survey now"
|
@@ -296,15 +311,17 @@ msgstr "An der Umfrage teilnehmen"
|
|
296 |
|
297 |
#: php/class-export.php:87
|
298 |
msgid ""
|
299 |
-
"This is a code snippets export file generated by the Code Snippets WordPress
|
|
|
300 |
msgstr ""
|
301 |
-
"Dies ist eine Codeschnipsel-Export-Datei die durch das Code Snippets
|
302 |
-
"Plugin erstellt wurde."
|
303 |
|
304 |
#: php/class-export.php:89
|
305 |
msgid "To import these snippets a WordPress site follow these steps:"
|
306 |
msgstr ""
|
307 |
-
"Um Codeschnipsel in eine WordPress Seite zu importieren folge diesen
|
|
|
308 |
|
309 |
#: php/class-export.php:90
|
310 |
msgid "1. Log in to that site as an administrator."
|
@@ -312,15 +329,17 @@ msgstr "1. Melde dich als Administrator an."
|
|
312 |
|
313 |
#: php/class-export.php:91
|
314 |
msgid ""
|
315 |
-
"2. Install the Code Snippets plugin using the directions provided at the
|
|
|
316 |
msgstr ""
|
317 |
-
"2. Installiere das Code Snippets Plugin nutze hierzu den Link und die
|
318 |
-
"von oben."
|
319 |
|
320 |
#: php/class-export.php:92
|
321 |
msgid "3. Go to 'Tools: Import' in the WordPress admin panel."
|
322 |
msgstr ""
|
323 |
-
"3. Navigiere zu 'Werkzeuge: Daten importieren' in der WordPress
|
|
|
324 |
|
325 |
#: php/class-export.php:93
|
326 |
msgid "4. Click on the \"Code Snippets\" importer in the list"
|
@@ -332,16 +351,16 @@ msgstr "5. Lade diese Datei über den angebotenen Dialog der Importseite hoch."
|
|
332 |
|
333 |
#: php/class-export.php:95
|
334 |
msgid ""
|
335 |
-
"6. Code Snippets will then import all of the snippets and associated
|
336 |
-
"contained in this file into your site."
|
337 |
msgstr ""
|
338 |
-
"6. Die Codeschnipsel werden neben allen anderen Informationen aus dieser
|
339 |
-
"deine Seite importiert."
|
340 |
|
341 |
#: php/class-export.php:96
|
342 |
msgid ""
|
343 |
-
"7. You will then have to visit the 'Snippets: Manage' admin menu and
|
344 |
-
"desired snippets."
|
345 |
msgstr ""
|
346 |
"7. Nach dem Import besuche die Seite 'Codeschnipsel: Verwalten' im "
|
347 |
"Administrationsmenü und aktiviere die gewünschten Codeschnipsel."
|
@@ -395,6 +414,8 @@ msgid ""
|
|
395 |
"You are about to permanently delete the selected item.\n"
|
396 |
"\t\t\t\t\t'Cancel' to stop, 'OK' to delete."
|
397 |
msgstr ""
|
|
|
|
|
398 |
|
399 |
#: php/class-list-table.php:244
|
400 |
#, php-format
|
@@ -403,7 +424,7 @@ msgstr "Unbenannt #%d"
|
|
403 |
|
404 |
#: php/class-list-table.php:261
|
405 |
msgid "Shared on Network"
|
406 |
-
msgstr ""
|
407 |
|
408 |
# @ code-snippets
|
409 |
#: php/class-list-table.php:322
|
@@ -470,11 +491,11 @@ msgstr "Liste bereinigen"
|
|
470 |
#: php/class-list-table.php:686
|
471 |
#, php-format
|
472 |
msgid ""
|
473 |
-
"You do not appear to have any snippets available at this time. <a href=\"%s
|
474 |
-
"New→</a>"
|
475 |
msgstr ""
|
476 |
-
"Sie scheinen derzeit keine Codeschnipsel in der Verwaltung zu haben. Einen
|
477 |
-
"href=\"%s\">hinzufügen →</a>"
|
478 |
|
479 |
# @ code-snippets
|
480 |
#: php/class-list-table.php:965
|
@@ -504,38 +525,41 @@ msgstr "Weitere Informationen:"
|
|
504 |
|
505 |
#: php/contextual-help.php:20
|
506 |
msgid "About Plugin"
|
507 |
-
msgstr ""
|
508 |
|
509 |
#: php/contextual-help.php:21
|
510 |
msgid "FAQ"
|
511 |
-
msgstr ""
|
512 |
|
513 |
#: php/contextual-help.php:22
|
514 |
msgid "Support Forums"
|
515 |
-
msgstr ""
|
516 |
|
517 |
#: php/contextual-help.php:23
|
518 |
msgid "Plugin Website</a>"
|
519 |
-
msgstr ""
|
520 |
|
521 |
# @ code-snippets
|
522 |
-
#: php/contextual-help.php:36 php/contextual-help.php:67
|
|
|
523 |
msgid "Overview"
|
524 |
msgstr "Übersicht"
|
525 |
|
526 |
# @ code-snippets
|
527 |
#: php/contextual-help.php:38
|
528 |
msgid ""
|
529 |
-
"Snippets are similar to plugins - they both extend and expand the
|
530 |
-
"WordPress. Snippets are more light-weight, just a few lines
|
531 |
-
"as much load on your server. Here you can manage
|
532 |
-
"tasks on them such as activating,
|
|
|
533 |
msgstr ""
|
534 |
"Codeschnipsel sind ähnlich wie Plugins - beide erweitern bzw. verändern die "
|
535 |
-
"Funktionalität. Codeschnipsel sind jedoch weniger komplex und
|
536 |
-
"nur einige Zeilen Code. Damit fällt auch weniger Last auf
|
537 |
-
"können Sie bereits existierende Codeschnipsel
|
538 |
-
"ausführen, wie Aktivieren, Deaktivieren,
|
|
|
539 |
|
540 |
# @ code-snippets
|
541 |
#: php/contextual-help.php:43
|
@@ -545,33 +569,35 @@ msgstr "Sicherheitsmodus"
|
|
545 |
# @ code-snippets
|
546 |
#: php/contextual-help.php:45
|
547 |
msgid ""
|
548 |
-
"Be sure to check your snippets for errors before you activate them, as a
|
549 |
-
"snippet could bring your whole blog down. If your site starts doing
|
550 |
-
"deactivate all your snippets and activate them one at a time."
|
551 |
msgstr ""
|
552 |
-
"Stellen Sie sicher, dass Sie Ihre Codeschnipsel vor dem Aktivieren
|
553 |
-
"Fehlerhafte Codeschnipsel können Ihre gesamte Webseite zum Crash
|
554 |
-
"Ihre Webseite eigenartige Dinge vollführt oder komische
|
555 |
-
"deaktivieren Sie bitte alle Codeschnipsel und aktivieren Sie
|
556 |
-
"anderen."
|
557 |
|
558 |
# @ code-snippets
|
559 |
#: php/contextual-help.php:46
|
560 |
msgid ""
|
561 |
-
"If something goes wrong with a snippet and you can't use WordPress, you can
|
562 |
-
"all snippets to stop executing by adding
|
563 |
-
"true);</code> to your <code>wp-
|
564 |
-
"
|
565 |
-
"replacing <strong>true</
|
|
|
566 |
msgstr ""
|
567 |
-
"Falls etwas schief läuft und Sie WordPress nicht mehr verwenden können -
|
568 |
-
"den Admin-Bereich - können Sie alle Codeschnipsel dieses Plugins von
|
569 |
-
"abhalten, indem Sie folgende Konstante
|
570 |
-
"true );</code> Ihrer WordPress-
|
571 |
-
"hinzufügen. Nachdem Sie den
|
572 |
-
"haben, können Sie den
|
573 |
-
"
|
574 |
-
"<strong>false</strong>
|
|
|
575 |
|
576 |
# @ code-snippets
|
577 |
#: php/contextual-help.php:51
|
@@ -582,41 +608,44 @@ msgstr "Deinstallieren"
|
|
582 |
#: php/contextual-help.php:53
|
583 |
#, php-format
|
584 |
msgid ""
|
585 |
-
"When you delete Code Snippets through the Plugins menu in WordPress it will
|
586 |
-
"up the <code>%1$s</code> table and a few other bits of data stored in
|
587 |
-
"If you want to keep this data (ie: you are only temporally
|
588 |
-
"Snippets) then remove the <code>%2$s</code> folder using
|
|
|
589 |
msgstr ""
|
590 |
"Wenn Sie das Codeschnipsel-Plugin <strong>über das Plugins-Menü in WordPress "
|
591 |
-
"löschen</strong>, wird es die <code>%1$s</code> Tabelle leeren und einige
|
592 |
-
"Einstellungen in Ihrer Datenbank. Falls Sie diese Daten jedoch
|
593 |
-
"anderen Worten: Sie wollen das Plugin nur temporär
|
594 |
-
"Sie den <code>%2$s</code> Ordner lediglich
|
|
|
595 |
|
596 |
# @ code-snippets
|
597 |
#: php/contextual-help.php:54
|
598 |
msgid ""
|
599 |
-
"Even if you're sure that you don't want to use Code Snippets ever again on
|
600 |
-
"WordPress installation, you may want to use the export feature to back
|
601 |
-
"snippets."
|
602 |
msgstr ""
|
603 |
-
"Auch wenn Sie sicher sind, dass Sie das Codeschnipsel-Plugin niemals mehr in
|
604 |
-
"WordPress-Installation verwenden werden, sollten sie vielleicht
|
605 |
-
"Export-Funktion verwenden, um Ihre Codeschnipsel zu
|
|
|
606 |
|
607 |
# @ code-snippets
|
608 |
#: php/contextual-help.php:69
|
609 |
msgid ""
|
610 |
-
"Snippets are similar to plugins - they both extend and expand the
|
611 |
-
"WordPress. Snippets are more light-weight, just a few lines
|
612 |
-
"as much load on your server. Here you can add a new
|
613 |
-
"one."
|
614 |
msgstr ""
|
615 |
"Codeschnipsel sind ähnlich wie Plugins - beide erweitern bzw. verändern die "
|
616 |
-
"Funktionalität. Codeschnipsel sind jedoch weniger komplex und
|
617 |
-
"nur einige Zeilen Code. Damit fällt auch weniger Last auf
|
618 |
-
"können Sie einen neuen Codeschnipsel hinzufügen oder
|
619 |
-
"bearbeiten."
|
620 |
|
621 |
# @ code-snippets
|
622 |
#: php/contextual-help.php:74
|
@@ -625,28 +654,40 @@ msgstr "Codeschnipsel finden"
|
|
625 |
|
626 |
#: php/contextual-help.php:76
|
627 |
msgid ""
|
628 |
-
"Here are some links to websites which host a large number of snippets that
|
629 |
-
"add to your site.\n"
|
630 |
"\t\t\t<ul>\n"
|
631 |
-
"\t\t\t\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress Snippets
|
632 |
-
"Snippets</a></li>\n"
|
633 |
-
"\t\t\t\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP Snipp</a></
|
634 |
-
"
|
635 |
-
"
|
|
|
636 |
"\t\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
637 |
"\t\t\t</ul>"
|
638 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
639 |
|
640 |
# @ code-snippets
|
641 |
#: php/contextual-help.php:83
|
642 |
msgid ""
|
643 |
-
"More places to find snippets, as well as a selection of example snippets,
|
644 |
-
"found in the <a href=\"https://github.com/sheabunge/code-snippets/
|
645 |
-
"snippets\">plugin documentation</a>"
|
646 |
msgstr ""
|
647 |
-
"Weitere Orte, um Codeschnipsel zu finden und ebenso eine Sammlung von
|
648 |
-
"Schnipseln finden Sie in der <a href=\"https://github.com/sheabunge/
|
649 |
-
"wiki/Finding-snippets\">Dokumentation des Plugins</a>."
|
650 |
|
651 |
# @ code-snippets
|
652 |
#: php/contextual-help.php:88
|
@@ -656,40 +697,42 @@ msgstr "Codeschnipsel hinzufügen"
|
|
656 |
# @ code-snippets
|
657 |
#: php/contextual-help.php:90
|
658 |
msgid ""
|
659 |
-
"You need to fill out the name and code fields for your snippet to be added.
|
660 |
-
"the description field will add more information about how your snippet
|
661 |
-
"is does and where you found it, it is completely optional."
|
662 |
msgstr ""
|
663 |
"Sie müssen die Felder für 'Name' und 'Code' ausfüllen, damit der Schnipsel "
|
664 |
-
"hinzugefügt werden kann. Das Beschreibungsfeld ist völlig optional, es wird
|
665 |
-
"sehr empfohlen. Damit können Sie kurz notieren, was der Code
|
666 |
-
"bewahren sich so auf elegante Weise die Übersicht."
|
667 |
|
668 |
# @ code-snippets
|
669 |
#: php/contextual-help.php:91
|
670 |
msgid ""
|
671 |
-
"Please be sure to check that your snippet is valid PHP code and will not
|
672 |
-
"errors before adding it through this page. While doing so will not
|
673 |
-
"straight away, it will help to minimise the chance of a faulty
|
674 |
-
"active on your site."
|
675 |
msgstr ""
|
676 |
"Bitte stellen Sie vor dem Einfügen von Codeschnipseln sicher, dass Ihr "
|
677 |
-
"entsprechender Codeschipsel valider PHP-Code ist und keine Fehler
|
678 |
-
"erhöhen Sie von vornherein die Wahrscheinlichkeit, dass
|
679 |
-
"Codeschnipsel in Ihrer Installation aktiviert werden."
|
680 |
|
681 |
# @ code-snippets
|
682 |
#: php/contextual-help.php:107
|
683 |
msgid ""
|
684 |
-
"Snippets are similar to plugins - they both extend and expand the
|
685 |
-
"WordPress. Snippets are more light-weight, just a few lines
|
686 |
-
"as much load on your server. Here you can load
|
687 |
-
"import file into the database with your
|
|
|
688 |
msgstr ""
|
689 |
"Codeschnipsel sind ähnlich wie Plugins - beide erweitern bzw. verändern die "
|
690 |
-
"Funktionalität. Codeschnipsel sind jedoch weniger komplex und
|
691 |
-
"nur einige Zeilen Code. Damit fällt auch weniger Last auf
|
692 |
-
"können Sie Codeschnipsel aus einer Codeschipsel-XML-
|
|
|
693 |
|
694 |
# @ code-snippets
|
695 |
#: php/contextual-help.php:112
|
@@ -699,25 +742,26 @@ msgstr "Importieren"
|
|
699 |
# @ code-snippets
|
700 |
#: php/contextual-help.php:114
|
701 |
msgid ""
|
702 |
-
"You can load your snippets from a code snippets (.xml) export file using
|
|
|
703 |
msgstr ""
|
704 |
-
"Auf dieser Seite können Sie Ihre Codeschnipsel von einer Codeschnipsel-
|
705 |
-
"(<code>.xml</code>) laden."
|
706 |
|
707 |
# @ code-snippets
|
708 |
#: php/contextual-help.php:115
|
709 |
#, php-format
|
710 |
msgid ""
|
711 |
"Snippets will be added to the database along with your existing snippets. "
|
712 |
-
"Regardless of whether the snippets were active on the previous site,
|
713 |
-
"snippets are always inactive until activated using the <a href=\"%s
|
714 |
-
"Snippets</a> page.</p>"
|
715 |
msgstr ""
|
716 |
"Codeschnipsel werden der Datenbank hinzugefügt, zusammen mit Ihren bereits "
|
717 |
"bestehenden Codeschnipseln. Unabhängig davon, ob diese Codeschnipsel auf der "
|
718 |
-
"vorherigen Installation aktiv waren, sind importierte Codeschnipsel
|
719 |
-
"immer deaktiviert, solange Sie von Ihnen auf der <a href=\"%s
|
720 |
-
"verwalten-Seite</a> aktiviert werden.</p>"
|
721 |
|
722 |
# @ code-snippets
|
723 |
#: php/contextual-help.php:120
|
@@ -728,21 +772,22 @@ msgstr "Exportieren"
|
|
728 |
#: php/contextual-help.php:122
|
729 |
#, php-format
|
730 |
msgid ""
|
731 |
-
"You can save your snippets to a Code Snippets (.xml) export file using the
|
732 |
-
"
|
733 |
msgstr ""
|
734 |
-
"Sie können Ihre Codeschnipsel auch als Codeschnipsel-XML-Exportdatei
|
735 |
-
"über die <a href=\"%s\">Codeschnipsel verwalten-Seite</a>."
|
736 |
|
737 |
#: php/settings/settings-fields.php:42
|
738 |
msgid "Activate by Default"
|
739 |
msgstr "Standardmäßig aktivieren"
|
740 |
|
741 |
#: php/settings/settings-fields.php:44
|
742 |
-
msgid "
|
|
|
743 |
msgstr ""
|
744 |
-
"Legt die 'Speichern und Aktivieren' Schaltfläche als Standard Aktion fest
|
745 |
-
"Speichern eines Codeschnipsel."
|
746 |
|
747 |
#: php/settings/settings-fields.php:49
|
748 |
msgid "Enable Scope Selector"
|
@@ -754,19 +799,19 @@ msgstr "Aktiviere die Bereichswahl bei der Bearbeitung eines Codeschnipsels"
|
|
754 |
|
755 |
#: php/settings/settings-fields.php:56
|
756 |
msgid "Enable Snippet Tags"
|
757 |
-
msgstr ""
|
758 |
|
759 |
#: php/settings/settings-fields.php:58
|
760 |
msgid "Show snippet tags on admin pages"
|
761 |
-
msgstr ""
|
762 |
|
763 |
#: php/settings/settings-fields.php:63
|
764 |
msgid "Enable Snippet Descriptions"
|
765 |
-
msgstr ""
|
766 |
|
767 |
#: php/settings/settings-fields.php:65
|
768 |
msgid "Show snippet descriptions on admin pages"
|
769 |
-
msgstr ""
|
770 |
|
771 |
#: php/settings/settings-fields.php:74
|
772 |
msgid "Row Height"
|
@@ -826,7 +871,8 @@ msgstr "Zeilen umbrechen"
|
|
826 |
|
827 |
#: php/settings/settings-fields.php:135
|
828 |
msgid "Whether the editor should scroll or wrap for long lines."
|
829 |
-
msgstr "
|
|
|
830 |
|
831 |
#: php/settings/settings-fields.php:141
|
832 |
msgid "Line Numbers"
|
@@ -843,7 +889,8 @@ msgstr "Klammern automatisch schliessen."
|
|
843 |
#: php/settings/settings-fields.php:151
|
844 |
msgid "Auto-close brackets and quotes when typed."
|
845 |
msgstr ""
|
846 |
-
"Vervollständigt und schliesst Klammern und Anführungszeichen während der
|
|
|
847 |
|
848 |
#: php/settings/settings-fields.php:157
|
849 |
msgid "Highlight Selection Matches"
|
@@ -852,7 +899,8 @@ msgstr "Auswahlhervorhebung"
|
|
852 |
#: php/settings/settings-fields.php:158
|
853 |
msgid "Highlight all instances of a currently selected word."
|
854 |
msgstr ""
|
855 |
-
"Eine Auswahl an anderen Stellen hervorheben an denen die Auswahl ebenfalls
|
|
|
856 |
|
857 |
#: php/settings/settings.php:68
|
858 |
msgid "General"
|
@@ -909,29 +957,30 @@ msgstr ""
|
|
909 |
# @ code-snippets
|
910 |
#: php/views/import.php:21
|
911 |
msgid ""
|
912 |
-
"Howdy! Upload your Code Snippets export file and we’ll import the
|
913 |
-
"this site."
|
914 |
msgstr ""
|
915 |
-
"Servus! Laden Sie hier Ihre Codeschnipsel-XML-Exportdatei hoch und wir
|
916 |
-
"Codeschnipsel dieser Installation hinzufügen."
|
917 |
|
918 |
# @ code-snippets
|
919 |
#: php/views/import.php:23
|
920 |
#, php-format
|
921 |
msgid ""
|
922 |
-
"You will need to go to the <a href=\"%s\">Manage Snippets</a> page to
|
923 |
-
"imported snippets."
|
924 |
msgstr ""
|
925 |
-
"Danach müssen Sie zur <a href=\"%s\">Codeschnispel verwalten-Seite</a> gehen
|
926 |
-
"die importierten Codeschnipsel entsprechend aktivieren."
|
927 |
|
928 |
# @ code-snippets
|
929 |
#: php/views/import.php:25
|
930 |
msgid ""
|
931 |
-
"Choose a Code Snippets (.xml) file to upload, then click Upload file and
|
|
|
932 |
msgstr ""
|
933 |
-
"Wählen Sie eine Codeschnipsel-XML-Datei zum Hochladen, klicken Sie dann auf
|
934 |
-
"hochladen & importieren'."
|
935 |
|
936 |
# @ code-snippets
|
937 |
#: php/views/import.php:32
|
@@ -958,29 +1007,32 @@ msgstr "Installierte Codeschnipsel suchen"
|
|
958 |
|
959 |
# @ code-snippets
|
960 |
#~ msgid ""
|
961 |
-
#~ "Here are some links to websites which host a large number of snippets
|
962 |
-
#~ "can add to your site.\n"
|
963 |
#~ "\t\t<ul>\n"
|
964 |
-
#~ "\t\t\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress Snippets
|
965 |
-
#~ "Snippets</a></li>\n"
|
966 |
-
#~ "\t\t\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP Snipp</a></
|
967 |
-
#~ "
|
968 |
-
#~ "
|
|
|
969 |
#~ "\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
970 |
#~ "\t\t</ul>"
|
971 |
#~ msgstr ""
|
972 |
-
#~ "Hier sind einige Links zu Webseiten, welche eine große Anzahl von
|
973 |
-
#~ "Codeschnipseln anbieten, die Sie vielleicht für Ihre Webseite
|
974 |
-
#~ "Bitte seien Sie äußerst vorsichtig mit fremden
|
975 |
-
#~ "immer den Anbieter/ Herausgeber. Setzen
|
|
|
976 |
#~ "\\\t\\\t<ul>\n"
|
977 |
-
#~ "\\\t\\\t\\\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress
|
978 |
-
#~ "\">WP-Snippets</a></li>\n"
|
979 |
-
#~ "\\\t\\\t\\\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP
|
|
|
|
|
|
|
|
|
980 |
#~ "li>\n"
|
981 |
-
#~ "\\\t\\\t\\\t<li><a href=\"http://www.catswhocode.com/blog/snippets\" title="
|
982 |
-
#~ "\"Cats Who Code Snippet Library\">Cats Who Code</a></li>\n"
|
983 |
-
#~ "\\\t\\\t\\\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
984 |
#~ "\\\t\\\t</ul>"
|
985 |
|
986 |
# @ code-snippets
|
@@ -988,16 +1040,16 @@ msgstr "Installierte Codeschnipsel suchen"
|
|
988 |
#~ "<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
989 |
#~ "\">WordPress Extend</a>"
|
990 |
#~ msgstr ""
|
991 |
-
#~ "<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank
|
992 |
-
#~ "Seite bei WordPress.org</a>"
|
993 |
|
994 |
# @ code-snippets
|
995 |
#~ msgid ""
|
996 |
-
#~ "<a href=\"http://wordpress.org/support/plugin/code-snippets\" target
|
997 |
-
#~ "\">Support Forums</a>"
|
998 |
#~ msgstr ""
|
999 |
-
#~ "<a href=\"http://wordpress.org/support/plugin/code-snippets\" target
|
1000 |
-
#~ "\">Offizielles Support-Forum (Engl.)</a>"
|
1001 |
|
1002 |
# @ code-snippets
|
1003 |
#~ msgid ""
|
@@ -1018,8 +1070,8 @@ msgstr "Installierte Codeschnipsel suchen"
|
|
1018 |
#~ "<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
1019 |
#~ "\">WordPress Extend</a></p>"
|
1020 |
#~ msgstr ""
|
1021 |
-
#~ "<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank
|
1022 |
-
#~ "Seite auf WordPress.org</a></p>"
|
1023 |
|
1024 |
# @ code-snippets
|
1025 |
#~ msgid ""
|
@@ -1044,8 +1096,8 @@ msgstr "Installierte Codeschnipsel suchen"
|
|
1044 |
|
1045 |
# @ code-snippets
|
1046 |
#~ msgid ""
|
1047 |
-
#~ "An easy, clean and simple way to add code snippets to your site. No need
|
1048 |
-
#~ "to your theme's functions.php file again!"
|
1049 |
#~ msgstr ""
|
1050 |
#~ "Auf einfache, saubere und elegante Weise Codeschnipsel für Ihre Webseite "
|
1051 |
#~ "hinzufügen. Änderungen an der 'functions.php' des Themes sind nicht mehr "
|
@@ -1061,7 +1113,8 @@ msgstr "Installierte Codeschnipsel suchen"
|
|
1061 |
|
1062 |
# @ code-snippets
|
1063 |
#~ msgid "Please provide a name for the snippet and its code."
|
1064 |
-
#~ msgstr "
|
|
|
1065 |
|
1066 |
# @ code-snippets
|
1067 |
#~ msgid "(Optional)"
|
@@ -1074,7 +1127,8 @@ msgstr "Installierte Codeschnipsel suchen"
|
|
1074 |
# @ code-snippets
|
1075 |
#~ msgid "Import snippets from a <strong>Code Snippets</strong> export file"
|
1076 |
#~ msgstr ""
|
1077 |
-
#~ "Codeschnipsel aus einer <strong>Code Snippets</strong>-Exportdatei
|
|
|
1078 |
|
1079 |
# @ code-snippets
|
1080 |
#~ msgid "Imported <strong>%d</strong> snippet."
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: Code Snippets v2.6.0\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: 2016-01-10 17:19+0100\n"
|
6 |
+
"PO-Revision-Date: 2016-01-10 17:37+0100\n"
|
7 |
"Last-Translator: Joerg Knoerchen <webmaster@sensorgrafie.de>\n"
|
8 |
+
"Language-Team: Mario Siegmann <mario_siegmann@web.de>\n"
|
9 |
"Language: de_DE\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
14 |
+
"X-Generator: Poedit 1.8.6\n"
|
15 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
|
17 |
+
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
18 |
"X-Poedit-Basepath: ..\n"
|
19 |
"X-Textdomain-Support: yes\n"
|
20 |
"X-Poedit-SearchPath-0: .\n"
|
24 |
msgstr "Du hast keine Berechtigung diese Seite zu betreten."
|
25 |
|
26 |
# @ code-snippets
|
27 |
+
#: php/admin-menus/class-edit-menu.php:13
|
28 |
+
#: php/admin-menus/class-edit-menu.php:14 php/views/edit.php:25
|
29 |
msgid "Edit Snippet"
|
30 |
msgstr "Codeschnipsel bearbeiten"
|
31 |
|
41 |
|
42 |
#: php/admin-menus/class-edit-menu.php:149
|
43 |
msgid "Don't Panic"
|
44 |
+
msgstr "Keine Panik"
|
45 |
|
46 |
#: php/admin-menus/class-edit-menu.php:150
|
47 |
#, php-format
|
48 |
+
msgid ""
|
49 |
+
"The code snippet you are trying to save produced a fatal error on line %d:"
|
50 |
msgstr ""
|
51 |
+
"Der Codeschnipsel, den Sie versuchen zu speichern, produziert einen fatalen "
|
52 |
+
"Fehler in Zeile %d:"
|
53 |
|
54 |
#: php/admin-menus/class-edit-menu.php:152
|
55 |
msgid ""
|
56 |
+
"The previous version of the snippet is unchanged, and the rest of this site "
|
57 |
+
"should be functioning normally as before."
|
58 |
msgstr ""
|
59 |
+
"Die vorherige Version dieses Codeschnipsels ist unverändert und der Rest der "
|
60 |
+
"Seite sollte normal wie zuvor funktionieren."
|
61 |
|
62 |
#: php/admin-menus/class-edit-menu.php:153
|
63 |
msgid ""
|
64 |
+
"Please use the back button in your browser to return to the previous page "
|
65 |
+
"and try to fix the code error."
|
66 |
msgstr ""
|
67 |
+
"Bitte nutzen Sie die Zurück-Schaltfläche in Ihrem Browser um zur vorherigen "
|
68 |
+
"Seite zurückzukehren und versuchen Sie den Fehler zu korrigieren."
|
69 |
|
70 |
#: php/admin-menus/class-edit-menu.php:154
|
71 |
msgid ""
|
72 |
+
"If you prefer, you can close this page and discard the changes you just "
|
73 |
+
"made. No changes will be made to this site."
|
74 |
msgstr ""
|
75 |
+
"Wenn Sie möchten, können Sie diese Seite schließen und die gerade "
|
76 |
+
"durchgeführten Änderungen verwerfen. Es werden keine Änderungen an dieser "
|
77 |
+
"Website vorgenommen."
|
78 |
|
79 |
# @ code-snippets
|
80 |
#: php/admin-menus/class-edit-menu.php:279 php/class-list-table.php:324
|
95 |
|
96 |
#: php/admin-menus/class-edit-menu.php:333
|
97 |
msgid "Only run in administration area"
|
98 |
+
msgstr "Nur im Administrationsbereich ausführen"
|
99 |
|
100 |
#: php/admin-menus/class-edit-menu.php:334
|
101 |
msgid "Only run on site front-end"
|
107 |
|
108 |
#: php/admin-menus/class-edit-menu.php:358
|
109 |
msgid "Sharing"
|
110 |
+
msgstr "Teilen"
|
111 |
|
112 |
#: php/admin-menus/class-edit-menu.php:362
|
113 |
msgid "Allow this snippet to be activated on individual sites on the network"
|
114 |
msgstr ""
|
115 |
+
"Diesem Codeschnipsel erlauben, auf individuellen Seiten im Netzwerk "
|
116 |
+
"aktiviert zu werden"
|
117 |
|
118 |
#: php/admin-menus/class-edit-menu.php:415
|
119 |
#, php-format
|
120 |
msgid "The snippet has been deactivated due to an error on line %d:"
|
121 |
msgstr ""
|
122 |
+
"Der Codeschnipsel deaktiviert wurde aufgrund eines Fehlers in Zeile %d:"
|
123 |
|
124 |
#: php/admin-menus/class-edit-menu.php:420
|
125 |
msgid "The snippet has been deactivated due to an error in the code."
|
126 |
+
msgstr "Der Codeschnipsel wurde aufgrund eines Fehlers im Code deaktiviert."
|
127 |
|
128 |
#: php/admin-menus/class-edit-menu.php:427
|
129 |
msgid "An error occurred when saving the snippet."
|
142 |
# @ code-snippets
|
143 |
#: php/admin-menus/class-edit-menu.php:434
|
144 |
msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
|
145 |
+
msgstr ""
|
146 |
+
"Codeschnipsel <strong>hinzugefügt</strong> und <strong>aktiviert</strong>."
|
147 |
|
148 |
# @ code-snippets
|
149 |
#: php/admin-menus/class-edit-menu.php:435
|
150 |
msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
|
151 |
+
msgstr ""
|
152 |
+
"Codeschnipsel <strong>aktualisiert</strong> und <strong>aktiviert</strong>."
|
153 |
|
154 |
#: php/admin-menus/class-edit-menu.php:436
|
155 |
msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
|
156 |
+
msgstr ""
|
157 |
+
"Codeschnipsel <strong>aktualisiert</strong> und <strong>deaktiviert</strong>."
|
158 |
|
159 |
# @ code-snippets
|
160 |
#: php/admin-menus/class-import-menu.php:15
|
178 |
#: php/admin-menus/class-import-menu.php:88
|
179 |
#, php-format
|
180 |
msgid ""
|
181 |
+
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</"
|
182 |
+
"a>"
|
183 |
msgid_plural ""
|
184 |
+
"Successfully imported <strong>%d</strong> snippets. <a href=\"%s\">Have fun!"
|
185 |
+
"</a>"
|
186 |
msgstr[0] ""
|
187 |
+
"Erfolgreicher Import des <strong>%d</strong> Codeschnipsel. <a href=\"%s"
|
188 |
+
"\">Viel Spass!</a>"
|
189 |
msgstr[1] ""
|
190 |
+
"Erfolgreicher Import der <strong>%d</strong> Codeschnipsel. <a href=\"%s"
|
191 |
+
"\">Viel Spass!</a>"
|
192 |
|
193 |
#: php/admin-menus/class-import-menu.php:101
|
194 |
msgid "An error occurred when processing the import file."
|
200 |
msgstr "Verwalten"
|
201 |
|
202 |
# @ code-snippets
|
203 |
+
#: php/admin-menus/class-manage-menu.php:23
|
204 |
+
#: php/admin-menus/class-manage-menu.php:39
|
205 |
+
#: php/admin-menus/class-manage-menu.php:40 php/admin.php:56
|
206 |
+
#: php/views/manage.php:19
|
207 |
msgid "Snippets"
|
208 |
msgstr "Codeschnipsel"
|
209 |
|
210 |
#: php/admin-menus/class-manage-menu.php:75
|
211 |
msgid ""
|
212 |
+
"<strong>Warning:</strong> Safe mode is active and snippets will not execute! "
|
213 |
+
"Remove the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-"
|
214 |
+
"config.php</code> to turn off safe mode. <a href=\"https://github.com/"
|
215 |
+
"sheabunge/code-snippets/wiki/Safe-Mode\" target=\"_blank\">Help</a>"
|
216 |
msgstr ""
|
217 |
"<strong>Warnung:</strong> Sicherheitsmodus aktiv! Codeschnipsel werden nicht "
|
218 |
+
"ausgeführt. Entferne den Parameter <code>CODE_SNIPPETS_SAFE_MODE</code> aus "
|
219 |
+
"deiner <code>wp-config.php</code> um den Sicherheitsmodus auszuschalten. <a "
|
220 |
+
"href=\"https://github.com/sheabunge/code-snippets/wiki/Safe-Mode\" target="
|
221 |
+
"\"_blank\">Hilfe hierzu (engl.)</a>"
|
222 |
|
223 |
# @ code-snippets
|
224 |
#: php/admin-menus/class-manage-menu.php:81
|
296 |
|
297 |
#: php/admin.php:190
|
298 |
msgid ""
|
299 |
+
"<strong>Have feedback on Code Snippets?</strong> Please take the time to "
|
300 |
+
"answer a short survey on how you use this plugin and what you'd like to see "
|
301 |
+
"changed or added in the future."
|
302 |
msgstr ""
|
303 |
+
"<strong>Kommentar zu Codeschnipsel?</strong> Nehmen sie sich ein wenig Zeit "
|
304 |
+
"und beantworten sie bitte eine kurze Umfrage zum Plugin, wie sie es nutzen "
|
305 |
+
"und welche Funktionen sie in Zukunft gerne verändert oder hinzugefügt haben "
|
306 |
+
"möchten."
|
307 |
|
308 |
#: php/admin.php:193
|
309 |
msgid "Take the survey now"
|
311 |
|
312 |
#: php/class-export.php:87
|
313 |
msgid ""
|
314 |
+
"This is a code snippets export file generated by the Code Snippets WordPress "
|
315 |
+
"plugin."
|
316 |
msgstr ""
|
317 |
+
"Dies ist eine Codeschnipsel-Export-Datei die durch das Code Snippets "
|
318 |
+
"WordPress Plugin erstellt wurde."
|
319 |
|
320 |
#: php/class-export.php:89
|
321 |
msgid "To import these snippets a WordPress site follow these steps:"
|
322 |
msgstr ""
|
323 |
+
"Um Codeschnipsel in eine WordPress Seite zu importieren folge diesen "
|
324 |
+
"Schritten:"
|
325 |
|
326 |
#: php/class-export.php:90
|
327 |
msgid "1. Log in to that site as an administrator."
|
329 |
|
330 |
#: php/class-export.php:91
|
331 |
msgid ""
|
332 |
+
"2. Install the Code Snippets plugin using the directions provided at the "
|
333 |
+
"above link."
|
334 |
msgstr ""
|
335 |
+
"2. Installiere das Code Snippets Plugin nutze hierzu den Link und die "
|
336 |
+
"Informationen von oben."
|
337 |
|
338 |
#: php/class-export.php:92
|
339 |
msgid "3. Go to 'Tools: Import' in the WordPress admin panel."
|
340 |
msgstr ""
|
341 |
+
"3. Navigiere zu 'Werkzeuge: Daten importieren' in der WordPress "
|
342 |
+
"Administration."
|
343 |
|
344 |
#: php/class-export.php:93
|
345 |
msgid "4. Click on the \"Code Snippets\" importer in the list"
|
351 |
|
352 |
#: php/class-export.php:95
|
353 |
msgid ""
|
354 |
+
"6. Code Snippets will then import all of the snippets and associated "
|
355 |
+
"information contained in this file into your site."
|
356 |
msgstr ""
|
357 |
+
"6. Die Codeschnipsel werden neben allen anderen Informationen aus dieser "
|
358 |
+
"Datei in deine Seite importiert."
|
359 |
|
360 |
#: php/class-export.php:96
|
361 |
msgid ""
|
362 |
+
"7. You will then have to visit the 'Snippets: Manage' admin menu and "
|
363 |
+
"activate desired snippets."
|
364 |
msgstr ""
|
365 |
"7. Nach dem Import besuche die Seite 'Codeschnipsel: Verwalten' im "
|
366 |
"Administrationsmenü und aktiviere die gewünschten Codeschnipsel."
|
414 |
"You are about to permanently delete the selected item.\n"
|
415 |
"\t\t\t\t\t'Cancel' to stop, 'OK' to delete."
|
416 |
msgstr ""
|
417 |
+
"Sie sind dabei die ausgewählten Einträge zu löschen.\n"
|
418 |
+
"\t\t\t\t\t'Abbrechen zum Stoppen, 'OK' zum Löschen."
|
419 |
|
420 |
#: php/class-list-table.php:244
|
421 |
#, php-format
|
424 |
|
425 |
#: php/class-list-table.php:261
|
426 |
msgid "Shared on Network"
|
427 |
+
msgstr "Im Netzwerk teilen"
|
428 |
|
429 |
# @ code-snippets
|
430 |
#: php/class-list-table.php:322
|
491 |
#: php/class-list-table.php:686
|
492 |
#, php-format
|
493 |
msgid ""
|
494 |
+
"You do not appear to have any snippets available at this time. <a href=\"%s"
|
495 |
+
"\">Add New→</a>"
|
496 |
msgstr ""
|
497 |
+
"Sie scheinen derzeit keine Codeschnipsel in der Verwaltung zu haben. Einen "
|
498 |
+
"neuen <a href=\"%s\">hinzufügen →</a>"
|
499 |
|
500 |
# @ code-snippets
|
501 |
#: php/class-list-table.php:965
|
525 |
|
526 |
#: php/contextual-help.php:20
|
527 |
msgid "About Plugin"
|
528 |
+
msgstr "Über das Plugin"
|
529 |
|
530 |
#: php/contextual-help.php:21
|
531 |
msgid "FAQ"
|
532 |
+
msgstr "FAQ"
|
533 |
|
534 |
#: php/contextual-help.php:22
|
535 |
msgid "Support Forums"
|
536 |
+
msgstr "Support-Foren"
|
537 |
|
538 |
#: php/contextual-help.php:23
|
539 |
msgid "Plugin Website</a>"
|
540 |
+
msgstr "Plugin-Webseite</a>"
|
541 |
|
542 |
# @ code-snippets
|
543 |
+
#: php/contextual-help.php:36 php/contextual-help.php:67
|
544 |
+
#: php/contextual-help.php:105
|
545 |
msgid "Overview"
|
546 |
msgstr "Übersicht"
|
547 |
|
548 |
# @ code-snippets
|
549 |
#: php/contextual-help.php:38
|
550 |
msgid ""
|
551 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
552 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
553 |
+
"of code, and do not put as much load on your server. Here you can manage "
|
554 |
+
"your existing snippets and preform tasks on them such as activating, "
|
555 |
+
"deactivating, deleting and exporting."
|
556 |
msgstr ""
|
557 |
"Codeschnipsel sind ähnlich wie Plugins - beide erweitern bzw. verändern die "
|
558 |
+
"Funktionalität. Codeschnipsel sind jedoch weniger komplex und "
|
559 |
+
"leichtgewichtiger; nur einige Zeilen Code. Damit fällt auch weniger Last auf "
|
560 |
+
"dem Webserver an. Hier können Sie bereits existierende Codeschnipsel "
|
561 |
+
"bearbeiten bzw. Aktionen damit ausführen, wie Aktivieren, Deaktivieren, "
|
562 |
+
"Löschen sowie Exportieren."
|
563 |
|
564 |
# @ code-snippets
|
565 |
#: php/contextual-help.php:43
|
569 |
# @ code-snippets
|
570 |
#: php/contextual-help.php:45
|
571 |
msgid ""
|
572 |
+
"Be sure to check your snippets for errors before you activate them, as a "
|
573 |
+
"faulty snippet could bring your whole blog down. If your site starts doing "
|
574 |
+
"strange things, deactivate all your snippets and activate them one at a time."
|
575 |
msgstr ""
|
576 |
+
"Stellen Sie sicher, dass Sie Ihre Codeschnipsel vor dem Aktivieren "
|
577 |
+
"überprüfen. Fehlerhafte Codeschnipsel können Ihre gesamte Webseite zum Crash "
|
578 |
+
"bringen. Falls Ihre Webseite eigenartige Dinge vollführt oder komische "
|
579 |
+
"Sachen anzeigt, deaktivieren Sie bitte alle Codeschnipsel und aktivieren Sie "
|
580 |
+
"diese eins nach dem anderen."
|
581 |
|
582 |
# @ code-snippets
|
583 |
#: php/contextual-help.php:46
|
584 |
msgid ""
|
585 |
+
"If something goes wrong with a snippet and you can't use WordPress, you can "
|
586 |
+
"cause all snippets to stop executing by adding "
|
587 |
+
"<code>define('CODE_SNIPPETS_SAFE_MODE', true);</code> to your <code>wp-"
|
588 |
+
"config.php</code> file. After you have deactivated the offending snippet, "
|
589 |
+
"you can turn off safe mode by removing this line or replacing <strong>true</"
|
590 |
+
"strong> with <strong>false</strong>."
|
591 |
msgstr ""
|
592 |
+
"Falls etwas schief läuft und Sie WordPress nicht mehr verwenden können - "
|
593 |
+
"sprich: den Admin-Bereich - können Sie alle Codeschnipsel dieses Plugins von "
|
594 |
+
"der Ausführung abhalten, indem Sie folgende Konstante "
|
595 |
+
"<code>define( 'CODE_SNIPPETS_SAFE_MODE', true );</code> Ihrer WordPress-"
|
596 |
+
"Konfigurationsdatei <code>wp-config.php</code> hinzufügen. Nachdem Sie den "
|
597 |
+
"fehlerhaften Codeschnipsel gefunden und deaktiviert haben, können Sie den "
|
598 |
+
"Sicherheitsmodus in der <code>wp-config.php</code> wieder entfernen bzw. den "
|
599 |
+
"Wert der Konstante von <strong>true</strong> auf dann <strong>false</strong> "
|
600 |
+
"setzen."
|
601 |
|
602 |
# @ code-snippets
|
603 |
#: php/contextual-help.php:51
|
608 |
#: php/contextual-help.php:53
|
609 |
#, php-format
|
610 |
msgid ""
|
611 |
+
"When you delete Code Snippets through the Plugins menu in WordPress it will "
|
612 |
+
"clear up the <code>%1$s</code> table and a few other bits of data stored in "
|
613 |
+
"the database. If you want to keep this data (ie: you are only temporally "
|
614 |
+
"uninstalling Code Snippets) then remove the <code>%2$s</code> folder using "
|
615 |
+
"FTP."
|
616 |
msgstr ""
|
617 |
"Wenn Sie das Codeschnipsel-Plugin <strong>über das Plugins-Menü in WordPress "
|
618 |
+
"löschen</strong>, wird es die <code>%1$s</code> Tabelle leeren und einige "
|
619 |
+
"anderen Einstellungen in Ihrer Datenbank. Falls Sie diese Daten jedoch "
|
620 |
+
"sichern wollen (mit anderen Worten: Sie wollen das Plugin nur temporär "
|
621 |
+
"deinstallieren), dann sollten Sie den <code>%2$s</code> Ordner lediglich "
|
622 |
+
"<strong>via FTP</strong> entfernen."
|
623 |
|
624 |
# @ code-snippets
|
625 |
#: php/contextual-help.php:54
|
626 |
msgid ""
|
627 |
+
"Even if you're sure that you don't want to use Code Snippets ever again on "
|
628 |
+
"this WordPress installation, you may want to use the export feature to back "
|
629 |
+
"up your snippets."
|
630 |
msgstr ""
|
631 |
+
"Auch wenn Sie sicher sind, dass Sie das Codeschnipsel-Plugin niemals mehr in "
|
632 |
+
"dieser WordPress-Installation verwenden werden, sollten sie vielleicht "
|
633 |
+
"dennoch vorher die Export-Funktion verwenden, um Ihre Codeschnipsel zu "
|
634 |
+
"sichern."
|
635 |
|
636 |
# @ code-snippets
|
637 |
#: php/contextual-help.php:69
|
638 |
msgid ""
|
639 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
640 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
641 |
+
"of code, and do not put as much load on your server. Here you can add a new "
|
642 |
+
"snippet, or edit an existing one."
|
643 |
msgstr ""
|
644 |
"Codeschnipsel sind ähnlich wie Plugins - beide erweitern bzw. verändern die "
|
645 |
+
"Funktionalität. Codeschnipsel sind jedoch weniger komplex und "
|
646 |
+
"leichtgewichtiger; nur einige Zeilen Code. Damit fällt auch weniger Last auf "
|
647 |
+
"dem Webserver an. Hier können Sie einen neuen Codeschnipsel hinzufügen oder "
|
648 |
+
"bereits Existierende bearbeiten."
|
649 |
|
650 |
# @ code-snippets
|
651 |
#: php/contextual-help.php:74
|
654 |
|
655 |
#: php/contextual-help.php:76
|
656 |
msgid ""
|
657 |
+
"Here are some links to websites which host a large number of snippets that "
|
658 |
+
"you can add to your site.\n"
|
659 |
"\t\t\t<ul>\n"
|
660 |
+
"\t\t\t\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress Snippets"
|
661 |
+
"\">WP-Snippets</a></li>\n"
|
662 |
+
"\t\t\t\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP Snipp</a></"
|
663 |
+
"li>\n"
|
664 |
+
"\t\t\t\t<li><a href=\"http://www.catswhocode.com/blog/snippets\" title="
|
665 |
+
"\"Cats Who Code Snippet Library\">Cats Who Code</a></li>\n"
|
666 |
"\t\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
667 |
"\t\t\t</ul>"
|
668 |
msgstr ""
|
669 |
+
"Hier sind ein Links zu Webseiten, welche eine Menge an Codeschnipsel "
|
670 |
+
"bereitstellen und auf ihrer Webseite verwendet werden können.\n"
|
671 |
+
"\t\t\t<ul>\n"
|
672 |
+
"\t\t\t\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress Snippets"
|
673 |
+
"\">WP-Snippets</a></li>\n"
|
674 |
+
"\t\t\t\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP Snipp</a></"
|
675 |
+
"li>\n"
|
676 |
+
"\t\t\t\t<li><a href=\"http://www.catswhocode.com/blog/snippets\" title="
|
677 |
+
"\"Cats Who Code Snippet Library\">Cats Who Code</a></li>\n"
|
678 |
+
"\t\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
679 |
+
"\t\t\t</ul>"
|
680 |
|
681 |
# @ code-snippets
|
682 |
#: php/contextual-help.php:83
|
683 |
msgid ""
|
684 |
+
"More places to find snippets, as well as a selection of example snippets, "
|
685 |
+
"can be found in the <a href=\"https://github.com/sheabunge/code-snippets/"
|
686 |
+
"wiki/Finding-snippets\">plugin documentation</a>"
|
687 |
msgstr ""
|
688 |
+
"Weitere Orte, um Codeschnipsel zu finden und ebenso eine Sammlung von "
|
689 |
+
"Beispiel-Schnipseln finden Sie in der <a href=\"https://github.com/sheabunge/"
|
690 |
+
"code-snippets/wiki/Finding-snippets\">Dokumentation des Plugins</a>."
|
691 |
|
692 |
# @ code-snippets
|
693 |
#: php/contextual-help.php:88
|
697 |
# @ code-snippets
|
698 |
#: php/contextual-help.php:90
|
699 |
msgid ""
|
700 |
+
"You need to fill out the name and code fields for your snippet to be added. "
|
701 |
+
"While the description field will add more information about how your snippet "
|
702 |
+
"works, what is does and where you found it, it is completely optional."
|
703 |
msgstr ""
|
704 |
"Sie müssen die Felder für 'Name' und 'Code' ausfüllen, damit der Schnipsel "
|
705 |
+
"hinzugefügt werden kann. Das Beschreibungsfeld ist völlig optional, es wird "
|
706 |
+
"jedoch sehr empfohlen. Damit können Sie kurz notieren, was der Code "
|
707 |
+
"eigentlich macht und bewahren sich so auf elegante Weise die Übersicht."
|
708 |
|
709 |
# @ code-snippets
|
710 |
#: php/contextual-help.php:91
|
711 |
msgid ""
|
712 |
+
"Please be sure to check that your snippet is valid PHP code and will not "
|
713 |
+
"produce errors before adding it through this page. While doing so will not "
|
714 |
+
"become active straight away, it will help to minimise the chance of a faulty "
|
715 |
+
"snippet becoming active on your site."
|
716 |
msgstr ""
|
717 |
"Bitte stellen Sie vor dem Einfügen von Codeschnipseln sicher, dass Ihr "
|
718 |
+
"entsprechender Codeschipsel valider PHP-Code ist und keine Fehler "
|
719 |
+
"produziert. Somit erhöhen Sie von vornherein die Wahrscheinlichkeit, dass "
|
720 |
+
"überhaupt fehlerhafte Codeschnipsel in Ihrer Installation aktiviert werden."
|
721 |
|
722 |
# @ code-snippets
|
723 |
#: php/contextual-help.php:107
|
724 |
msgid ""
|
725 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
726 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
727 |
+
"of code, and do not put as much load on your server. Here you can load "
|
728 |
+
"snippets from a Code Snippets (.xml) import file into the database with your "
|
729 |
+
"existing snippets."
|
730 |
msgstr ""
|
731 |
"Codeschnipsel sind ähnlich wie Plugins - beide erweitern bzw. verändern die "
|
732 |
+
"Funktionalität. Codeschnipsel sind jedoch weniger komplex und "
|
733 |
+
"leichtgewichtiger; nur einige Zeilen Code. Damit fällt auch weniger Last auf "
|
734 |
+
"dem Webserver an. Hier können Sie Codeschnipsel aus einer Codeschipsel-XML-"
|
735 |
+
"Importdatei hinzufügen."
|
736 |
|
737 |
# @ code-snippets
|
738 |
#: php/contextual-help.php:112
|
742 |
# @ code-snippets
|
743 |
#: php/contextual-help.php:114
|
744 |
msgid ""
|
745 |
+
"You can load your snippets from a code snippets (.xml) export file using "
|
746 |
+
"this page."
|
747 |
msgstr ""
|
748 |
+
"Auf dieser Seite können Sie Ihre Codeschnipsel von einer Codeschnipsel-"
|
749 |
+
"Exportdatei (<code>.xml</code>) laden."
|
750 |
|
751 |
# @ code-snippets
|
752 |
#: php/contextual-help.php:115
|
753 |
#, php-format
|
754 |
msgid ""
|
755 |
"Snippets will be added to the database along with your existing snippets. "
|
756 |
+
"Regardless of whether the snippets were active on the previous site, "
|
757 |
+
"imported snippets are always inactive until activated using the <a href=\"%s"
|
758 |
+
"\">Manage Snippets</a> page.</p>"
|
759 |
msgstr ""
|
760 |
"Codeschnipsel werden der Datenbank hinzugefügt, zusammen mit Ihren bereits "
|
761 |
"bestehenden Codeschnipseln. Unabhängig davon, ob diese Codeschnipsel auf der "
|
762 |
+
"vorherigen Installation aktiv waren, sind importierte Codeschnipsel "
|
763 |
+
"standardmäßig immer deaktiviert, solange Sie von Ihnen auf der <a href=\"%s"
|
764 |
+
"\">Codeschnispel verwalten-Seite</a> aktiviert werden.</p>"
|
765 |
|
766 |
# @ code-snippets
|
767 |
#: php/contextual-help.php:120
|
772 |
#: php/contextual-help.php:122
|
773 |
#, php-format
|
774 |
msgid ""
|
775 |
+
"You can save your snippets to a Code Snippets (.xml) export file using the "
|
776 |
+
"<a href=\"%s\">Manage Snippets</a> page."
|
777 |
msgstr ""
|
778 |
+
"Sie können Ihre Codeschnipsel auch als Codeschnipsel-XML-Exportdatei "
|
779 |
+
"exportieren, über die <a href=\"%s\">Codeschnipsel verwalten-Seite</a>."
|
780 |
|
781 |
#: php/settings/settings-fields.php:42
|
782 |
msgid "Activate by Default"
|
783 |
msgstr "Standardmäßig aktivieren"
|
784 |
|
785 |
#: php/settings/settings-fields.php:44
|
786 |
+
msgid ""
|
787 |
+
"Make the 'Save and Activate' button the default action when saving a snippet."
|
788 |
msgstr ""
|
789 |
+
"Legt die 'Speichern und Aktivieren' Schaltfläche als Standard Aktion fest "
|
790 |
+
"beim Speichern eines Codeschnipsel."
|
791 |
|
792 |
#: php/settings/settings-fields.php:49
|
793 |
msgid "Enable Scope Selector"
|
799 |
|
800 |
#: php/settings/settings-fields.php:56
|
801 |
msgid "Enable Snippet Tags"
|
802 |
+
msgstr "Codeschnipsel-Tags aktivieren"
|
803 |
|
804 |
#: php/settings/settings-fields.php:58
|
805 |
msgid "Show snippet tags on admin pages"
|
806 |
+
msgstr "Codeschnipsel-Tags auf den Administrationsseiten anzeigen"
|
807 |
|
808 |
#: php/settings/settings-fields.php:63
|
809 |
msgid "Enable Snippet Descriptions"
|
810 |
+
msgstr "Codeschnipsel-Beschreibungen aktivieren"
|
811 |
|
812 |
#: php/settings/settings-fields.php:65
|
813 |
msgid "Show snippet descriptions on admin pages"
|
814 |
+
msgstr "Codeschnipsel-Beschreibungen auf den Administrationsseiten anzeigen"
|
815 |
|
816 |
#: php/settings/settings-fields.php:74
|
817 |
msgid "Row Height"
|
871 |
|
872 |
#: php/settings/settings-fields.php:135
|
873 |
msgid "Whether the editor should scroll or wrap for long lines."
|
874 |
+
msgstr ""
|
875 |
+
"Legt fest ob der Editor Zeilen umbricht oder bei langen Zeilen scrollen soll."
|
876 |
|
877 |
#: php/settings/settings-fields.php:141
|
878 |
msgid "Line Numbers"
|
889 |
#: php/settings/settings-fields.php:151
|
890 |
msgid "Auto-close brackets and quotes when typed."
|
891 |
msgstr ""
|
892 |
+
"Vervollständigt und schliesst Klammern und Anführungszeichen während der "
|
893 |
+
"Eingabe."
|
894 |
|
895 |
#: php/settings/settings-fields.php:157
|
896 |
msgid "Highlight Selection Matches"
|
899 |
#: php/settings/settings-fields.php:158
|
900 |
msgid "Highlight all instances of a currently selected word."
|
901 |
msgstr ""
|
902 |
+
"Eine Auswahl an anderen Stellen hervorheben an denen die Auswahl ebenfalls "
|
903 |
+
"vorkommt."
|
904 |
|
905 |
#: php/settings/settings.php:68
|
906 |
msgid "General"
|
957 |
# @ code-snippets
|
958 |
#: php/views/import.php:21
|
959 |
msgid ""
|
960 |
+
"Howdy! Upload your Code Snippets export file and we’ll import the "
|
961 |
+
"snippets to this site."
|
962 |
msgstr ""
|
963 |
+
"Servus! Laden Sie hier Ihre Codeschnipsel-XML-Exportdatei hoch und wir "
|
964 |
+
"werden die Codeschnipsel dieser Installation hinzufügen."
|
965 |
|
966 |
# @ code-snippets
|
967 |
#: php/views/import.php:23
|
968 |
#, php-format
|
969 |
msgid ""
|
970 |
+
"You will need to go to the <a href=\"%s\">Manage Snippets</a> page to "
|
971 |
+
"activate the imported snippets."
|
972 |
msgstr ""
|
973 |
+
"Danach müssen Sie zur <a href=\"%s\">Codeschnispel verwalten-Seite</a> gehen "
|
974 |
+
"und die importierten Codeschnipsel entsprechend aktivieren."
|
975 |
|
976 |
# @ code-snippets
|
977 |
#: php/views/import.php:25
|
978 |
msgid ""
|
979 |
+
"Choose a Code Snippets (.xml) file to upload, then click Upload file and "
|
980 |
+
"import."
|
981 |
msgstr ""
|
982 |
+
"Wählen Sie eine Codeschnipsel-XML-Datei zum Hochladen, klicken Sie dann auf "
|
983 |
+
"'Datei hochladen & importieren'."
|
984 |
|
985 |
# @ code-snippets
|
986 |
#: php/views/import.php:32
|
1007 |
|
1008 |
# @ code-snippets
|
1009 |
#~ msgid ""
|
1010 |
+
#~ "Here are some links to websites which host a large number of snippets "
|
1011 |
+
#~ "that you can add to your site.\n"
|
1012 |
#~ "\t\t<ul>\n"
|
1013 |
+
#~ "\t\t\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress Snippets"
|
1014 |
+
#~ "\">WP-Snippets</a></li>\n"
|
1015 |
+
#~ "\t\t\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP Snipp</a></"
|
1016 |
+
#~ "li>\n"
|
1017 |
+
#~ "\t\t\t<li><a href=\"http://www.catswhocode.com/blog/snippets\" title="
|
1018 |
+
#~ "\"Cats Who Code Snippet Library\">Cats Who Code</a></li>\n"
|
1019 |
#~ "\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
1020 |
#~ "\t\t</ul>"
|
1021 |
#~ msgstr ""
|
1022 |
+
#~ "Hier sind einige Links zu Webseiten, welche eine große Anzahl von "
|
1023 |
+
#~ "WordPress-Codeschnipseln anbieten, die Sie vielleicht für Ihre Webseite "
|
1024 |
+
#~ "verwenden könnten. Bitte seien Sie äußerst vorsichtig mit fremden "
|
1025 |
+
#~ "Codeschnipseln, überprüfen Sie immer den Anbieter/ Herausgeber. Setzen "
|
1026 |
+
#~ "Sie nur vertrauenswürdige Quellen ein!\n"
|
1027 |
#~ "\\\t\\\t<ul>\n"
|
1028 |
+
#~ "\\\t\\\t\\\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress "
|
1029 |
+
#~ "Snippets\">WP-Snippets</a></li>\n"
|
1030 |
+
#~ "\\\t\\\t\\\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP "
|
1031 |
+
#~ "Snipp</a></li>\n"
|
1032 |
+
#~ "\\\t\\\t\\\t<li><a href=\"http://www.catswhocode.com/blog/snippets\" "
|
1033 |
+
#~ "title=\"Cats Who Code Snippet Library\">Cats Who Code</a></li>\n"
|
1034 |
+
#~ "\\\t\\\t\\\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></"
|
1035 |
#~ "li>\n"
|
|
|
|
|
|
|
1036 |
#~ "\\\t\\\t</ul>"
|
1037 |
|
1038 |
# @ code-snippets
|
1040 |
#~ "<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
1041 |
#~ "\">WordPress Extend</a>"
|
1042 |
#~ msgstr ""
|
1043 |
+
#~ "<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
1044 |
+
#~ "\">Plugin-Seite bei WordPress.org</a>"
|
1045 |
|
1046 |
# @ code-snippets
|
1047 |
#~ msgid ""
|
1048 |
+
#~ "<a href=\"http://wordpress.org/support/plugin/code-snippets\" target="
|
1049 |
+
#~ "\"_blank\">Support Forums</a>"
|
1050 |
#~ msgstr ""
|
1051 |
+
#~ "<a href=\"http://wordpress.org/support/plugin/code-snippets\" target="
|
1052 |
+
#~ "\"_blank\">Offizielles Support-Forum (Engl.)</a>"
|
1053 |
|
1054 |
# @ code-snippets
|
1055 |
#~ msgid ""
|
1070 |
#~ "<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
1071 |
#~ "\">WordPress Extend</a></p>"
|
1072 |
#~ msgstr ""
|
1073 |
+
#~ "<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
1074 |
+
#~ "\">Plugin-Seite auf WordPress.org</a></p>"
|
1075 |
|
1076 |
# @ code-snippets
|
1077 |
#~ msgid ""
|
1096 |
|
1097 |
# @ code-snippets
|
1098 |
#~ msgid ""
|
1099 |
+
#~ "An easy, clean and simple way to add code snippets to your site. No need "
|
1100 |
+
#~ "to edit to your theme's functions.php file again!"
|
1101 |
#~ msgstr ""
|
1102 |
#~ "Auf einfache, saubere und elegante Weise Codeschnipsel für Ihre Webseite "
|
1103 |
#~ "hinzufügen. Änderungen an der 'functions.php' des Themes sind nicht mehr "
|
1113 |
|
1114 |
# @ code-snippets
|
1115 |
#~ msgid "Please provide a name for the snippet and its code."
|
1116 |
+
#~ msgstr ""
|
1117 |
+
#~ "Bitte geben Sie einen Namen für den Codeschnipsel und dessen Code an."
|
1118 |
|
1119 |
# @ code-snippets
|
1120 |
#~ msgid "(Optional)"
|
1127 |
# @ code-snippets
|
1128 |
#~ msgid "Import snippets from a <strong>Code Snippets</strong> export file"
|
1129 |
#~ msgstr ""
|
1130 |
+
#~ "Codeschnipsel aus einer <strong>Code Snippets</strong>-Exportdatei "
|
1131 |
+
#~ "importieren"
|
1132 |
|
1133 |
# @ code-snippets
|
1134 |
#~ msgid "Imported <strong>%d</strong> snippet."
|
languages/code-snippets.pot
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
# SOME DESCRIPTIVE TITLE.
|
2 |
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
-
# This file is distributed under the same license as the
|
4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
#
|
6 |
#, fuzzy
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
-
"Project-Id-Version: code-snippets 2.
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
-
"POT-Creation-Date: 2016-
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -140,15 +140,15 @@ msgstr ""
|
|
140 |
msgid "Import Snippets"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: php/admin-menus/class-import-menu.php:
|
144 |
msgid "Code Snippets"
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: php/admin-menus/class-import-menu.php:
|
148 |
msgid "Import snippets from a code snippets export file"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: php/admin-menus/class-import-menu.php:
|
152 |
#, php-format
|
153 |
msgid ""
|
154 |
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</"
|
@@ -159,7 +159,7 @@ msgid_plural ""
|
|
159 |
msgstr[0] ""
|
160 |
msgstr[1] ""
|
161 |
|
162 |
-
#: php/admin-menus/class-import-menu.php:
|
163 |
msgid "An error occurred when processing the import file."
|
164 |
msgstr ""
|
165 |
|
@@ -254,6 +254,10 @@ msgstr ""
|
|
254 |
msgid "Take the survey now"
|
255 |
msgstr ""
|
256 |
|
|
|
|
|
|
|
|
|
257 |
#: php/class-contextual-help.php:40
|
258 |
msgid "For more information:"
|
259 |
msgstr ""
|
@@ -274,12 +278,12 @@ msgstr ""
|
|
274 |
msgid "Plugin Website"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: php/class-contextual-help.php:55 php/class-contextual-help.php:
|
278 |
-
#: php/class-contextual-help.php:
|
279 |
msgid "Overview"
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: php/class-contextual-help.php:
|
283 |
msgid ""
|
284 |
"Snippets are similar to plugins - they both extend and expand the "
|
285 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
@@ -288,18 +292,18 @@ msgid ""
|
|
288 |
"deactivating, deleting and exporting."
|
289 |
msgstr ""
|
290 |
|
291 |
-
#: php/class-contextual-help.php:
|
292 |
msgid "Safe Mode"
|
293 |
msgstr ""
|
294 |
|
295 |
-
#: php/class-contextual-help.php:
|
296 |
msgid ""
|
297 |
"Be sure to check your snippets for errors before you activate them, as a "
|
298 |
"faulty snippet could bring your whole blog down. If your site starts doing "
|
299 |
"strange things, deactivate all your snippets and activate them one at a time."
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: php/class-contextual-help.php:
|
303 |
msgid ""
|
304 |
"If something goes wrong with a snippet and you can't use WordPress, you can "
|
305 |
"cause all snippets to stop executing by adding "
|
@@ -309,11 +313,11 @@ msgid ""
|
|
309 |
"strong> with <strong>false</strong>."
|
310 |
msgstr ""
|
311 |
|
312 |
-
#: php/class-contextual-help.php:
|
313 |
msgid "Uninstall"
|
314 |
msgstr ""
|
315 |
|
316 |
-
#: php/class-contextual-help.php:
|
317 |
#, php-format
|
318 |
msgid ""
|
319 |
"When you delete Code Snippets through the Plugins menu in WordPress it will "
|
@@ -323,14 +327,14 @@ msgid ""
|
|
323 |
"FTP."
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: php/class-contextual-help.php:
|
327 |
msgid ""
|
328 |
"Even if you're sure that you don't want to use Code Snippets ever again on "
|
329 |
"this WordPress installation, you may want to use the export feature to back "
|
330 |
"up your snippets."
|
331 |
msgstr ""
|
332 |
|
333 |
-
#: php/class-contextual-help.php:
|
334 |
msgid ""
|
335 |
"Snippets are similar to plugins - they both extend and expand the "
|
336 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
@@ -338,11 +342,11 @@ msgid ""
|
|
338 |
"snippet, or edit an existing one."
|
339 |
msgstr ""
|
340 |
|
341 |
-
#: php/class-contextual-help.php:
|
342 |
msgid "Finding Snippets"
|
343 |
msgstr ""
|
344 |
|
345 |
-
#: php/class-contextual-help.php:
|
346 |
msgid ""
|
347 |
"Here are some links to websites which host a large number of snippets that "
|
348 |
"you can add to your site.\n"
|
@@ -357,25 +361,25 @@ msgid ""
|
|
357 |
"\t\t\t\t</ul>"
|
358 |
msgstr ""
|
359 |
|
360 |
-
#: php/class-contextual-help.php:
|
361 |
msgid ""
|
362 |
"More places to find snippets, as well as a selection of example snippets, "
|
363 |
"can be found in the <a href=\"https://github.com/sheabunge/code-snippets/"
|
364 |
"wiki/Finding-snippets\">plugin documentation</a>"
|
365 |
msgstr ""
|
366 |
|
367 |
-
#: php/class-contextual-help.php:
|
368 |
msgid "Adding Snippets"
|
369 |
msgstr ""
|
370 |
|
371 |
-
#: php/class-contextual-help.php:
|
372 |
msgid ""
|
373 |
"You need to fill out the name and code fields for your snippet to be added. "
|
374 |
"While the description field will add more information about how your snippet "
|
375 |
"works, what is does and where you found it, it is completely optional."
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: php/class-contextual-help.php:
|
379 |
msgid ""
|
380 |
"Please be sure to check that your snippet is valid PHP code and will not "
|
381 |
"produce errors before adding it through this page. While doing so will not "
|
@@ -383,7 +387,7 @@ msgid ""
|
|
383 |
"snippet becoming active on your site."
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: php/class-contextual-help.php:
|
387 |
msgid ""
|
388 |
"Snippets are similar to plugins - they both extend and expand the "
|
389 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
@@ -392,17 +396,17 @@ msgid ""
|
|
392 |
"existing snippets."
|
393 |
msgstr ""
|
394 |
|
395 |
-
#: php/class-contextual-help.php:
|
396 |
msgid "Importing"
|
397 |
msgstr ""
|
398 |
|
399 |
-
#: php/class-contextual-help.php:
|
400 |
msgid ""
|
401 |
"You can load your snippets from a code snippets (.xml) export file using "
|
402 |
"this page."
|
403 |
msgstr ""
|
404 |
|
405 |
-
#: php/class-contextual-help.php:
|
406 |
#, php-format
|
407 |
msgid ""
|
408 |
"Snippets will be added to the database along with your existing snippets. "
|
@@ -411,11 +415,11 @@ msgid ""
|
|
411 |
"\">Manage Snippets</a> page.</p>"
|
412 |
msgstr ""
|
413 |
|
414 |
-
#: php/class-contextual-help.php:
|
415 |
msgid "Exporting"
|
416 |
msgstr ""
|
417 |
|
418 |
-
#: php/class-contextual-help.php:
|
419 |
#, php-format
|
420 |
msgid ""
|
421 |
"You can save your snippets to a Code Snippets (.xml) export file using the "
|
1 |
# SOME DESCRIPTIVE TITLE.
|
2 |
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the code-snippets package.
|
4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
#
|
6 |
#, fuzzy
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
+
"Project-Id-Version: code-snippets 2.7.0\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2016-08-01 23:32+1000\n"
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
140 |
msgid "Import Snippets"
|
141 |
msgstr ""
|
142 |
|
143 |
+
#: php/admin-menus/class-import-menu.php:78
|
144 |
msgid "Code Snippets"
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: php/admin-menus/class-import-menu.php:79
|
148 |
msgid "Import snippets from a code snippets export file"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: php/admin-menus/class-import-menu.php:93
|
152 |
#, php-format
|
153 |
msgid ""
|
154 |
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</"
|
159 |
msgstr[0] ""
|
160 |
msgstr[1] ""
|
161 |
|
162 |
+
#: php/admin-menus/class-import-menu.php:106
|
163 |
msgid "An error occurred when processing the import file."
|
164 |
msgstr ""
|
165 |
|
254 |
msgid "Take the survey now"
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: php/class-admin.php:190
|
258 |
+
msgid "Dismiss"
|
259 |
+
msgstr ""
|
260 |
+
|
261 |
#: php/class-contextual-help.php:40
|
262 |
msgid "For more information:"
|
263 |
msgstr ""
|
278 |
msgid "Plugin Website"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: php/class-contextual-help.php:55 php/class-contextual-help.php:81
|
282 |
+
#: php/class-contextual-help.php:114
|
283 |
msgid "Overview"
|
284 |
msgstr ""
|
285 |
|
286 |
+
#: php/class-contextual-help.php:56
|
287 |
msgid ""
|
288 |
"Snippets are similar to plugins - they both extend and expand the "
|
289 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
292 |
"deactivating, deleting and exporting."
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: php/class-contextual-help.php:61
|
296 |
msgid "Safe Mode"
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: php/class-contextual-help.php:62
|
300 |
msgid ""
|
301 |
"Be sure to check your snippets for errors before you activate them, as a "
|
302 |
"faulty snippet could bring your whole blog down. If your site starts doing "
|
303 |
"strange things, deactivate all your snippets and activate them one at a time."
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: php/class-contextual-help.php:63
|
307 |
msgid ""
|
308 |
"If something goes wrong with a snippet and you can't use WordPress, you can "
|
309 |
"cause all snippets to stop executing by adding "
|
313 |
"strong> with <strong>false</strong>."
|
314 |
msgstr ""
|
315 |
|
316 |
+
#: php/class-contextual-help.php:68
|
317 |
msgid "Uninstall"
|
318 |
msgstr ""
|
319 |
|
320 |
+
#: php/class-contextual-help.php:69
|
321 |
#, php-format
|
322 |
msgid ""
|
323 |
"When you delete Code Snippets through the Plugins menu in WordPress it will "
|
327 |
"FTP."
|
328 |
msgstr ""
|
329 |
|
330 |
+
#: php/class-contextual-help.php:70
|
331 |
msgid ""
|
332 |
"Even if you're sure that you don't want to use Code Snippets ever again on "
|
333 |
"this WordPress installation, you may want to use the export feature to back "
|
334 |
"up your snippets."
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: php/class-contextual-help.php:82
|
338 |
msgid ""
|
339 |
"Snippets are similar to plugins - they both extend and expand the "
|
340 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
342 |
"snippet, or edit an existing one."
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: php/class-contextual-help.php:87
|
346 |
msgid "Finding Snippets"
|
347 |
msgstr ""
|
348 |
|
349 |
+
#: php/class-contextual-help.php:88
|
350 |
msgid ""
|
351 |
"Here are some links to websites which host a large number of snippets that "
|
352 |
"you can add to your site.\n"
|
361 |
"\t\t\t\t</ul>"
|
362 |
msgstr ""
|
363 |
|
364 |
+
#: php/class-contextual-help.php:95
|
365 |
msgid ""
|
366 |
"More places to find snippets, as well as a selection of example snippets, "
|
367 |
"can be found in the <a href=\"https://github.com/sheabunge/code-snippets/"
|
368 |
"wiki/Finding-snippets\">plugin documentation</a>"
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: php/class-contextual-help.php:100
|
372 |
msgid "Adding Snippets"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: php/class-contextual-help.php:101
|
376 |
msgid ""
|
377 |
"You need to fill out the name and code fields for your snippet to be added. "
|
378 |
"While the description field will add more information about how your snippet "
|
379 |
"works, what is does and where you found it, it is completely optional."
|
380 |
msgstr ""
|
381 |
|
382 |
+
#: php/class-contextual-help.php:102
|
383 |
msgid ""
|
384 |
"Please be sure to check that your snippet is valid PHP code and will not "
|
385 |
"produce errors before adding it through this page. While doing so will not "
|
387 |
"snippet becoming active on your site."
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: php/class-contextual-help.php:115
|
391 |
msgid ""
|
392 |
"Snippets are similar to plugins - they both extend and expand the "
|
393 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
396 |
"existing snippets."
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: php/class-contextual-help.php:120
|
400 |
msgid "Importing"
|
401 |
msgstr ""
|
402 |
|
403 |
+
#: php/class-contextual-help.php:121
|
404 |
msgid ""
|
405 |
"You can load your snippets from a code snippets (.xml) export file using "
|
406 |
"this page."
|
407 |
msgstr ""
|
408 |
|
409 |
+
#: php/class-contextual-help.php:122
|
410 |
#, php-format
|
411 |
msgid ""
|
412 |
"Snippets will be added to the database along with your existing snippets. "
|
415 |
"\">Manage Snippets</a> page.</p>"
|
416 |
msgstr ""
|
417 |
|
418 |
+
#: php/class-contextual-help.php:127
|
419 |
msgid "Exporting"
|
420 |
msgstr ""
|
421 |
|
422 |
+
#: php/class-contextual-help.php:128
|
423 |
#, php-format
|
424 |
msgid ""
|
425 |
"You can save your snippets to a Code Snippets (.xml) export file using the "
|
php/admin-menus/class-import-menu.php
CHANGED
@@ -46,6 +46,8 @@ class Code_Snippets_Import_Menu extends Code_Snippets_Admin_Menu {
|
|
46 |
return;
|
47 |
}
|
48 |
|
|
|
|
|
49 |
/* Import the snippets */
|
50 |
$result = import_snippets( $_FILES['code_snippets_import_file']['tmp_name'], $network );
|
51 |
|
@@ -66,7 +68,7 @@ class Code_Snippets_Import_Menu extends Code_Snippets_Admin_Menu {
|
|
66 |
function register_importer() {
|
67 |
|
68 |
/* Only register the importer if the current user can manage snippets */
|
69 |
-
if ( ! defined( 'WP_LOAD_IMPORTERS' ) || ! current_user_can(
|
70 |
return;
|
71 |
}
|
72 |
|
@@ -94,7 +96,7 @@ class Code_Snippets_Import_Menu extends Code_Snippets_Admin_Menu {
|
|
94 |
'code-snippets'
|
95 |
),
|
96 |
$_REQUEST['imported'],
|
97 |
-
|
98 |
);
|
99 |
|
100 |
echo '</p></div>';
|
46 |
return;
|
47 |
}
|
48 |
|
49 |
+
$network = get_current_screen()->in_admin( 'network' );
|
50 |
+
|
51 |
/* Import the snippets */
|
52 |
$result = import_snippets( $_FILES['code_snippets_import_file']['tmp_name'], $network );
|
53 |
|
68 |
function register_importer() {
|
69 |
|
70 |
/* Only register the importer if the current user can manage snippets */
|
71 |
+
if ( ! defined( 'WP_LOAD_IMPORTERS' ) || ! code_snippets()->current_user_can() ) {
|
72 |
return;
|
73 |
}
|
74 |
|
96 |
'code-snippets'
|
97 |
),
|
98 |
$_REQUEST['imported'],
|
99 |
+
code_snippets()->get_menu_url( 'manage' )
|
100 |
);
|
101 |
|
102 |
echo '</p></div>';
|
php/class-admin.php
CHANGED
@@ -187,7 +187,7 @@ class Code_Snippets_Admin {
|
|
187 |
<?php _e( 'Take the survey now', 'code-snippets' ); ?>
|
188 |
</a>
|
189 |
|
190 |
-
<a href="<?php echo esc_url( wp_nonce_url( add_query_arg( $key, true ), $key ) ); ?>"
|
191 |
|
192 |
</p></div>
|
193 |
|
187 |
<?php _e( 'Take the survey now', 'code-snippets' ); ?>
|
188 |
</a>
|
189 |
|
190 |
+
<a href="<?php echo esc_url( wp_nonce_url( add_query_arg( $key, true ), $key ) ); ?>"><?php _e( 'Dismiss', 'code-snippets' ); ?></a>
|
191 |
|
192 |
</p></div>
|
193 |
|
php/class-code-snippets.php
CHANGED
@@ -41,6 +41,7 @@ class Code_Snippets {
|
|
41 |
|
42 |
add_action( 'grant_super_admin', array( $this, 'grant_network_cap' ) );
|
43 |
add_action( 'remove_super_admin', array( $this, 'remove_network_cap' ) );
|
|
|
44 |
}
|
45 |
|
46 |
function load_plugin() {
|
@@ -205,4 +206,21 @@ class Code_Snippets {
|
|
205 |
/* Remove the capability */
|
206 |
$user->remove_cap( apply_filters( 'code_snippets_network_cap', 'manage_network_snippets' ) );
|
207 |
}
|
208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
add_action( 'grant_super_admin', array( $this, 'grant_network_cap' ) );
|
43 |
add_action( 'remove_super_admin', array( $this, 'remove_network_cap' ) );
|
44 |
+
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
45 |
}
|
46 |
|
47 |
function load_plugin() {
|
206 |
/* Remove the capability */
|
207 |
$user->remove_cap( apply_filters( 'code_snippets_network_cap', 'manage_network_snippets' ) );
|
208 |
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Load up the localization file if we're using WordPress in a different language.
|
212 |
+
*
|
213 |
+
* If you wish to contribute a language file to be included in the Code Snippets package,
|
214 |
+
* please see create an issue on GitHub: https://github.com/sheabunge/code-snippets/issues
|
215 |
+
*/
|
216 |
+
function load_textdomain() {
|
217 |
+
$domain = 'code-snippets';
|
218 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
|
219 |
+
|
220 |
+
// wp-content/languages/code-snippets/code-snippets-[locale].mo
|
221 |
+
load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . "$domain/$domain-$locale.mo" );
|
222 |
+
|
223 |
+
// wp-content/plugins/code-snippets/languages/code-snippets-[locale].mo
|
224 |
+
load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/languages' );
|
225 |
+
}
|
226 |
+
}
|
php/class-contextual-help.php
CHANGED
@@ -41,7 +41,7 @@ class Code_Snippets_Contextual_Help {
|
|
41 |
'<p><a href="https://wordpress.org/plugins/code-snippets">' . __( 'About Plugin', 'code-snippets' ) . '</a></p>' .
|
42 |
'<p><a href="https://wordpress.org/plugins/code-snippets/faq">' . __( 'FAQ', 'code-snippets' ) . '</a></p>' .
|
43 |
'<p><a href="https://wordpress.org/support/plugin/code-snippets">' . __( 'Support Forums', 'code-snippets' ) . '</a></p>' .
|
44 |
-
'<p><a href="
|
45 |
);
|
46 |
}
|
47 |
|
@@ -53,24 +53,21 @@ class Code_Snippets_Contextual_Help {
|
|
53 |
$this->screen->add_help_tab( array(
|
54 |
'id' => 'overview',
|
55 |
'title' => __( 'Overview', 'code-snippets' ),
|
56 |
-
'content' =>
|
57 |
-
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can manage your existing snippets and preform tasks on them such as activating, deactivating, deleting and exporting.', 'code-snippets' ) . '</p>',
|
58 |
) );
|
59 |
|
60 |
$this->screen->add_help_tab( array(
|
61 |
'id' => 'safe-mode',
|
62 |
'title' => __( 'Safe Mode', 'code-snippets' ),
|
63 |
-
'content' =>
|
64 |
-
|
65 |
-
'<p>' . __( "If something goes wrong with a snippet and you can't use WordPress, you can cause all snippets to stop executing by adding <code>define('CODE_SNIPPETS_SAFE_MODE', true);</code> to your <code>wp-config.php</code> file. After you have deactivated the offending snippet, you can turn off safe mode by removing this line or replacing <strong>true</strong> with <strong>false</strong>.", 'code-snippets' ) . '</p>',
|
66 |
) );
|
67 |
|
68 |
$this->screen->add_help_tab( array(
|
69 |
'id' => 'uninstall',
|
70 |
'title' => __( 'Uninstall', 'code-snippets' ),
|
71 |
-
'content' =>
|
72 |
-
|
73 |
-
'<p>' . __( "Even if you're sure that you don't want to use Code Snippets ever again on this WordPress installation, you may want to use the export feature to back up your snippets.", 'code-snippets' ) . '</p>',
|
74 |
) );
|
75 |
}
|
76 |
|
@@ -82,30 +79,27 @@ class Code_Snippets_Contextual_Help {
|
|
82 |
$this->screen->add_help_tab( array(
|
83 |
'id' => 'overview',
|
84 |
'title' => __( 'Overview', 'code-snippets' ),
|
85 |
-
'content' =>
|
86 |
-
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can add a new snippet, or edit an existing one.', 'code-snippets' ) . '</p>',
|
87 |
) );
|
88 |
|
89 |
$this->screen->add_help_tab( array(
|
90 |
'id' => 'finding',
|
91 |
'title' => __( 'Finding Snippets', 'code-snippets' ),
|
92 |
-
'content' =>
|
93 |
-
'<p>' . __( 'Here are some links to websites which host a large number of snippets that you can add to your site.
|
94 |
<ul>
|
95 |
<li><a href="http://wp-snippets.com" title="WordPress Snippets">WP-Snippets</a></li>
|
96 |
<li><a href="http://wpsnipp.com" title="WP Snipp">WP Snipp</a></li>
|
97 |
<li><a href="http://www.catswhocode.com/blog/snippets" title="Cats Who Code Snippet Library">Cats Who Code</a></li>
|
98 |
<li><a href="http://www.wpfunction.me">WP Function Me</a></li>
|
99 |
</ul>', 'code-snippets' ) .
|
100 |
-
|
101 |
) );
|
102 |
|
103 |
$this->screen->add_help_tab( array(
|
104 |
'id' => 'adding',
|
105 |
'title' => __( 'Adding Snippets', 'code-snippets' ),
|
106 |
-
'content' =>
|
107 |
-
|
108 |
-
'<p>' . __( 'Please be sure to check that your snippet is valid PHP code and will not produce errors before adding it through this page. While doing so will not become active straight away, it will help to minimise the chance of a faulty snippet becoming active on your site.', 'code-snippets' ) . '</p>',
|
109 |
) );
|
110 |
}
|
111 |
|
@@ -118,23 +112,20 @@ class Code_Snippets_Contextual_Help {
|
|
118 |
$this->screen->add_help_tab( array(
|
119 |
'id' => 'overview',
|
120 |
'title' => __( 'Overview', 'code-snippets' ),
|
121 |
-
'content' =>
|
122 |
-
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can load snippets from a Code Snippets (.xml) import file into the database with your existing snippets.', 'code-snippets' ) . '</p>',
|
123 |
) );
|
124 |
|
125 |
$this->screen->add_help_tab( array(
|
126 |
'id' => 'import',
|
127 |
'title' => __( 'Importing', 'code-snippets' ),
|
128 |
-
'content' =>
|
129 |
-
|
130 |
-
sprintf( __( 'Snippets will be added to the database along with your existing snippets. Regardless of whether the snippets were active on the previous site, imported snippets are always inactive until activated using the <a href="%s">Manage Snippets</a> page.</p>', 'code-snippets' ), $manage_url ) . '</p>',
|
131 |
) );
|
132 |
|
133 |
$this->screen->add_help_tab( array(
|
134 |
'id' => 'export',
|
135 |
'title' => __( 'Exporting', 'code-snippets' ),
|
136 |
-
'content' =>
|
137 |
-
'<p>' . sprintf( __( 'You can save your snippets to a Code Snippets (.xml) export file using the <a href="%s">Manage Snippets</a> page.', 'code-snippets' ), $manage_url ) . '</p>',
|
138 |
) );
|
139 |
}
|
140 |
-
}
|
41 |
'<p><a href="https://wordpress.org/plugins/code-snippets">' . __( 'About Plugin', 'code-snippets' ) . '</a></p>' .
|
42 |
'<p><a href="https://wordpress.org/plugins/code-snippets/faq">' . __( 'FAQ', 'code-snippets' ) . '</a></p>' .
|
43 |
'<p><a href="https://wordpress.org/support/plugin/code-snippets">' . __( 'Support Forums', 'code-snippets' ) . '</a></p>' .
|
44 |
+
'<p><a href="https://bungeshea.com/plugins/code-snippets/">' . __( 'Plugin Website', 'code-snippets' ) . '</a></p>'
|
45 |
);
|
46 |
}
|
47 |
|
53 |
$this->screen->add_help_tab( array(
|
54 |
'id' => 'overview',
|
55 |
'title' => __( 'Overview', 'code-snippets' ),
|
56 |
+
'content' => '<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can manage your existing snippets and preform tasks on them such as activating, deactivating, deleting and exporting.', 'code-snippets' ) . '</p>',
|
|
|
57 |
) );
|
58 |
|
59 |
$this->screen->add_help_tab( array(
|
60 |
'id' => 'safe-mode',
|
61 |
'title' => __( 'Safe Mode', 'code-snippets' ),
|
62 |
+
'content' => '<p>' . __( 'Be sure to check your snippets for errors before you activate them, as a faulty snippet could bring your whole blog down. If your site starts doing strange things, deactivate all your snippets and activate them one at a time.', 'code-snippets' ) . '</p>' .
|
63 |
+
'<p>' . __( "If something goes wrong with a snippet and you can't use WordPress, you can cause all snippets to stop executing by adding <code>define('CODE_SNIPPETS_SAFE_MODE', true);</code> to your <code>wp-config.php</code> file. After you have deactivated the offending snippet, you can turn off safe mode by removing this line or replacing <strong>true</strong> with <strong>false</strong>.", 'code-snippets' ) . '</p>',
|
|
|
64 |
) );
|
65 |
|
66 |
$this->screen->add_help_tab( array(
|
67 |
'id' => 'uninstall',
|
68 |
'title' => __( 'Uninstall', 'code-snippets' ),
|
69 |
+
'content' => '<p>' . sprintf( __( 'When you delete Code Snippets through the Plugins menu in WordPress it will clear up the <code>%1$s</code> table and a few other bits of data stored in the database. If you want to keep this data (ie: you are only temporally uninstalling Code Snippets) then remove the <code>%2$s</code> folder using FTP.', 'code-snippets' ), code_snippets()->db->get_table_name(), dirname( CODE_SNIPPETS_FILE ) ) .
|
70 |
+
'<p>' . __( "Even if you're sure that you don't want to use Code Snippets ever again on this WordPress installation, you may want to use the export feature to back up your snippets.", 'code-snippets' ) . '</p>',
|
|
|
71 |
) );
|
72 |
}
|
73 |
|
79 |
$this->screen->add_help_tab( array(
|
80 |
'id' => 'overview',
|
81 |
'title' => __( 'Overview', 'code-snippets' ),
|
82 |
+
'content' => '<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can add a new snippet, or edit an existing one.', 'code-snippets' ) . '</p>',
|
|
|
83 |
) );
|
84 |
|
85 |
$this->screen->add_help_tab( array(
|
86 |
'id' => 'finding',
|
87 |
'title' => __( 'Finding Snippets', 'code-snippets' ),
|
88 |
+
'content' => '<p>' . __( 'Here are some links to websites which host a large number of snippets that you can add to your site.
|
|
|
89 |
<ul>
|
90 |
<li><a href="http://wp-snippets.com" title="WordPress Snippets">WP-Snippets</a></li>
|
91 |
<li><a href="http://wpsnipp.com" title="WP Snipp">WP Snipp</a></li>
|
92 |
<li><a href="http://www.catswhocode.com/blog/snippets" title="Cats Who Code Snippet Library">Cats Who Code</a></li>
|
93 |
<li><a href="http://www.wpfunction.me">WP Function Me</a></li>
|
94 |
</ul>', 'code-snippets' ) .
|
95 |
+
__( 'More places to find snippets, as well as a selection of example snippets, can be found in the <a href="https://github.com/sheabunge/code-snippets/wiki/Finding-snippets">plugin documentation</a>', 'code-snippets' ) . '</p>',
|
96 |
) );
|
97 |
|
98 |
$this->screen->add_help_tab( array(
|
99 |
'id' => 'adding',
|
100 |
'title' => __( 'Adding Snippets', 'code-snippets' ),
|
101 |
+
'content' => '<p>' . __( 'You need to fill out the name and code fields for your snippet to be added. While the description field will add more information about how your snippet works, what is does and where you found it, it is completely optional.', 'code-snippets' ) . '</p>' .
|
102 |
+
'<p>' . __( 'Please be sure to check that your snippet is valid PHP code and will not produce errors before adding it through this page. While doing so will not become active straight away, it will help to minimise the chance of a faulty snippet becoming active on your site.', 'code-snippets' ) . '</p>',
|
|
|
103 |
) );
|
104 |
}
|
105 |
|
112 |
$this->screen->add_help_tab( array(
|
113 |
'id' => 'overview',
|
114 |
'title' => __( 'Overview', 'code-snippets' ),
|
115 |
+
'content' => '<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can load snippets from a Code Snippets (.xml) import file into the database with your existing snippets.', 'code-snippets' ) . '</p>',
|
|
|
116 |
) );
|
117 |
|
118 |
$this->screen->add_help_tab( array(
|
119 |
'id' => 'import',
|
120 |
'title' => __( 'Importing', 'code-snippets' ),
|
121 |
+
'content' => '<p>' . __( 'You can load your snippets from a code snippets (.xml) export file using this page.', 'code-snippets' ) .
|
122 |
+
sprintf( __( 'Snippets will be added to the database along with your existing snippets. Regardless of whether the snippets were active on the previous site, imported snippets are always inactive until activated using the <a href="%s">Manage Snippets</a> page.</p>', 'code-snippets' ), $manage_url ) . '</p>',
|
|
|
123 |
) );
|
124 |
|
125 |
$this->screen->add_help_tab( array(
|
126 |
'id' => 'export',
|
127 |
'title' => __( 'Exporting', 'code-snippets' ),
|
128 |
+
'content' => '<p>' . sprintf( __( 'You can save your snippets to a Code Snippets (.xml) export file using the <a href="%s">Manage Snippets</a> page.', 'code-snippets' ), $manage_url ) . '</p>',
|
|
|
129 |
) );
|
130 |
}
|
131 |
+
}
|
php/class-list-table.php
CHANGED
@@ -56,7 +56,7 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
56 |
|
57 |
add_screen_option( 'per_page', array(
|
58 |
'label' => __( 'Snippets per page', 'code-snippets' ),
|
59 |
-
'default' =>
|
60 |
'option' => 'snippets_per_page',
|
61 |
) );
|
62 |
|
@@ -919,14 +919,14 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
919 |
$term = stripslashes( $_REQUEST['s'] );
|
920 |
}
|
921 |
|
922 |
-
$fields =
|
923 |
|
924 |
foreach ( $fields as $field ) {
|
925 |
if ( false !== stripos( $snippet->$field, $term ) ) {
|
926 |
return true;
|
927 |
}
|
928 |
}
|
929 |
-
|
930 |
return false;
|
931 |
}
|
932 |
|
@@ -963,7 +963,7 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
963 |
}
|
964 |
|
965 |
if ( ! empty( $_GET['tag'] ) ) {
|
966 |
-
echo sprintf( __( ' in tag “%s”', 'code-snippets' ), $_GET['tag'] );
|
967 |
}
|
968 |
|
969 |
echo '</span>';
|
56 |
|
57 |
add_screen_option( 'per_page', array(
|
58 |
'label' => __( 'Snippets per page', 'code-snippets' ),
|
59 |
+
'default' => 999,
|
60 |
'option' => 'snippets_per_page',
|
61 |
) );
|
62 |
|
919 |
$term = stripslashes( $_REQUEST['s'] );
|
920 |
}
|
921 |
|
922 |
+
$fields = array( 'name', 'desc', 'code', 'tags_list' );
|
923 |
|
924 |
foreach ( $fields as $field ) {
|
925 |
if ( false !== stripos( $snippet->$field, $term ) ) {
|
926 |
return true;
|
927 |
}
|
928 |
}
|
929 |
+
|
930 |
return false;
|
931 |
}
|
932 |
|
963 |
}
|
964 |
|
965 |
if ( ! empty( $_GET['tag'] ) ) {
|
966 |
+
echo sprintf( __( ' in tag “%s”', 'code-snippets' ), esc_html( $_GET['tag'] ) );
|
967 |
}
|
968 |
|
969 |
echo '</span>';
|
php/class-shortcode.php
CHANGED
@@ -67,6 +67,5 @@ class Code_Snippets_Shortcode {
|
|
67 |
|
68 |
return '<pre><code class="language-php">' . esc_html( $snippet->code ) . '</code></pre>';
|
69 |
}
|
70 |
-
|
71 |
}
|
72 |
|
67 |
|
68 |
return '<pre><code class="language-php">' . esc_html( $snippet->code ) . '</code></pre>';
|
69 |
}
|
|
|
70 |
}
|
71 |
|
php/editor.php
CHANGED
@@ -46,7 +46,7 @@ function code_snippets_get_editor_atts( $override_atts, $json_encode ) {
|
|
46 |
* @uses wp_enqueue_script() to add the scripts to the queue
|
47 |
*/
|
48 |
function code_snippets_enqueue_codemirror() {
|
49 |
-
$codemirror_version = '5.
|
50 |
$url = plugin_dir_url( CODE_SNIPPETS_FILE );
|
51 |
|
52 |
/* Remove other CodeMirror styles */
|
46 |
* @uses wp_enqueue_script() to add the scripts to the queue
|
47 |
*/
|
48 |
function code_snippets_enqueue_codemirror() {
|
49 |
+
$codemirror_version = '5.17.0';
|
50 |
$url = plugin_dir_url( CODE_SNIPPETS_FILE );
|
51 |
|
52 |
/* Remove other CodeMirror styles */
|
php/functions.php
CHANGED
@@ -72,4 +72,4 @@ function get_snippets_cap() {
|
|
72 |
*/
|
73 |
function get_snippets_table_name( $multisite = null ) {
|
74 |
return code_snippets()->db->get_table_name( $multisite );
|
75 |
-
}
|
72 |
*/
|
73 |
function get_snippets_table_name( $multisite = null ) {
|
74 |
return code_snippets()->db->get_table_name( $multisite );
|
75 |
+
}
|
php/snippet-ops.php
CHANGED
@@ -301,7 +301,7 @@ function import_snippets( $file, $multisite = null ) {
|
|
301 |
$dom->load( $file );
|
302 |
|
303 |
$snippets_xml = $dom->getElementsByTagName( 'snippet' );
|
304 |
-
$fields = array( 'name', 'description', 'code', 'tags', 'scope' );
|
305 |
$exported_snippets = array();
|
306 |
|
307 |
/* Loop through all snippets */
|
@@ -402,7 +402,7 @@ function execute_active_snippets() {
|
|
402 |
return false;
|
403 |
}
|
404 |
|
405 |
-
if ( isset( $_GET['
|
406 |
return false;
|
407 |
}
|
408 |
|
@@ -462,3 +462,25 @@ function execute_active_snippets() {
|
|
462 |
|
463 |
return true;
|
464 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
$dom->load( $file );
|
302 |
|
303 |
$snippets_xml = $dom->getElementsByTagName( 'snippet' );
|
304 |
+
$fields = array( 'name', 'description', 'desc', 'code', 'tags', 'scope' );
|
305 |
$exported_snippets = array();
|
306 |
|
307 |
/* Loop through all snippets */
|
402 |
return false;
|
403 |
}
|
404 |
|
405 |
+
if ( isset( $_GET['snippets-safe-mode'] ) && $_GET['snippets-safe-mode'] && code_snippets()->current_user_can() ) {
|
406 |
return false;
|
407 |
}
|
408 |
|
462 |
|
463 |
return true;
|
464 |
}
|
465 |
+
|
466 |
+
|
467 |
+
if ( isset( $_REQUEST['snippets-safe-mode'] ) ) {
|
468 |
+
|
469 |
+
/**
|
470 |
+
* Inject the safe mode query var into URLs
|
471 |
+
*
|
472 |
+
* @param $url
|
473 |
+
*
|
474 |
+
* @return string
|
475 |
+
*/
|
476 |
+
function code_snippets_safe_mode_query_var( $url ) {
|
477 |
+
if ( isset( $_REQUEST['snippets-safe-mode'] ) ) {
|
478 |
+
return add_query_arg( 'snippets-safe-mode', $_REQUEST['snippets-safe-mode'], $url );
|
479 |
+
}
|
480 |
+
return $url;
|
481 |
+
}
|
482 |
+
|
483 |
+
add_filter( 'home_url', 'code_snippets_safe_mode_query_var' );
|
484 |
+
add_filter( 'admin_url', 'code_snippets_safe_mode_query_var' );
|
485 |
+
}
|
486 |
+
|
php/views/edit.php
CHANGED
@@ -142,9 +142,7 @@ $snippet = get_snippet( $edit_id );
|
|
142 |
</div>
|
143 |
|
144 |
<script>
|
145 |
-
|
146 |
-
* Loads CodeMirror on the snippet editor
|
147 |
-
*/
|
148 |
(function() {
|
149 |
|
150 |
var atts = [];
|
142 |
</div>
|
143 |
|
144 |
<script>
|
145 |
+
/* Loads CodeMirror on the snippet editor */
|
|
|
|
|
146 |
(function() {
|
147 |
|
148 |
var atts = [];
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: bungeshea
|
|
3 |
Donate link: https://bungeshea.com/donate/
|
4 |
Tags: code-snippets, snippets, code, php, network, multisite
|
5 |
Requires at least: 3.6
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.
|
8 |
License: MIT
|
9 |
License URI: license.txt
|
10 |
|
@@ -69,6 +69,8 @@ You can try activating 'safe mode'. All snippets will not execute while safe mod
|
|
69 |
|
70 |
To turn safe mode off, either [comment out](http://php.net/manual/language.basic-syntax.comments.php) this line or delete it.
|
71 |
|
|
|
|
|
72 |
= Is there a way to add a snippet but not run it right away? =
|
73 |
Yes. Just add it but do not activate it yet.
|
74 |
|
@@ -116,6 +118,17 @@ That's fantastic! Fork the [repository on GitHub](http://github.com/sheabunge/co
|
|
116 |
|
117 |
== Changelog ==
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
= 2.6.1 =
|
120 |
* Updated German translation by [Mario Siegmann](http://web-alltag.de/)
|
121 |
* Fixed error catching not working correctly
|
@@ -398,6 +411,9 @@ __Fixed__
|
|
398 |
|
399 |
== Upgrade Notice ==
|
400 |
|
|
|
|
|
|
|
401 |
= 2.5.1 =
|
402 |
Prevent Don't Panic message from being triggered accidentally
|
403 |
|
3 |
Donate link: https://bungeshea.com/donate/
|
4 |
Tags: code-snippets, snippets, code, php, network, multisite
|
5 |
Requires at least: 3.6
|
6 |
+
Tested up to: 4.6
|
7 |
+
Stable tag: 2.7.0
|
8 |
License: MIT
|
9 |
License URI: license.txt
|
10 |
|
69 |
|
70 |
To turn safe mode off, either [comment out](http://php.net/manual/language.basic-syntax.comments.php) this line or delete it.
|
71 |
|
72 |
+
You can also activate safe mode on a per-page basis by appending `?snippets-safe-mode=true` to the URL.
|
73 |
+
|
74 |
= Is there a way to add a snippet but not run it right away? =
|
75 |
Yes. Just add it but do not activate it yet.
|
76 |
|
118 |
|
119 |
== Changelog ==
|
120 |
|
121 |
+
= 2.7.0 =
|
122 |
+
* Fixed plugin translations being loaded
|
123 |
+
* Increase default snippets per page so that all are usually shown
|
124 |
+
* Fixed description field not being imported
|
125 |
+
* Updated German translation by [Mario Siegmann](http://web-alltag.de)
|
126 |
+
* Fixed issue with CodeMirror rubyblue theme [[#](https://wordpress.org/support/topic/a-problem-with-the-cursor-color-and-the-fix-that-worked-for-me)]
|
127 |
+
* Added query var to disable snippet execution. To use, add `?snippets-safe-mode=true` to the URL
|
128 |
+
* Fixed snippet fields not importing
|
129 |
+
* Updated CodeMirror to version 5.17.0
|
130 |
+
* Fixed a minor XSS vulnerability discovered by Burak Kelebek [[#](https://wordpress.org/support/topic/security-vulnerability-20)]
|
131 |
+
|
132 |
= 2.6.1 =
|
133 |
* Updated German translation by [Mario Siegmann](http://web-alltag.de/)
|
134 |
* Fixed error catching not working correctly
|
411 |
|
412 |
== Upgrade Notice ==
|
413 |
|
414 |
+
= 2.7.0 =
|
415 |
+
Fix translation loading and description importing
|
416 |
+
|
417 |
= 2.5.1 =
|
418 |
Prevent Don't Panic message from being triggered accidentally
|
419 |
|