Kirki - Version 2.0.5

Version Description

Download this release

Release Info

Developer aristath
Plugin Icon 128x128 Kirki
Version 2.0.5
Comparing to
See all releases

Code changes from version 2.3.3 to 2.0.5

Files changed (176) hide show
  1. LICENSE +0 -21
  2. assets/css/{customizer-dynamic-css-colors.php → customizer-dynamic-css-colors.css} +0 -4
  3. assets/css/{customizer-dynamic-css-width.php → customizer-dynamic-css-width.css} +0 -4
  4. assets/css/{customizer-dynamic-css.php → customizer-dynamic-css.css} +1 -4
  5. assets/css/customizer.css +470 -678
  6. assets/css/customizer.css.map +2 -2
  7. assets/css/customizer.min.css +1 -0
  8. assets/css/transparency-grid.png +0 -0
  9. assets/images/jquery.fs.stepper-arrows.png +0 -0
  10. assets/images/kirki-bottom.png +0 -0
  11. assets/images/kirki-bottom.svg +0 -91
  12. assets/images/kirki-logo.svg +0 -48
  13. assets/images/kirki-toolkit.png +0 -0
  14. assets/js/branding.js +0 -13
  15. assets/js/controls/checkbox.js +9 -17
  16. assets/js/controls/code.js +19 -39
  17. assets/js/controls/color-alpha.js +18 -0
  18. assets/js/controls/color-palette.js +0 -17
  19. assets/js/controls/color.js +0 -31
  20. assets/js/controls/custom.js +0 -0
  21. assets/js/controls/dashicons.js +0 -17
  22. assets/js/controls/date.js +0 -21
  23. assets/js/controls/dimension.js +15 -38
  24. assets/js/controls/dropdown-pages.js +0 -18
  25. assets/js/controls/editor.js +35 -154
  26. assets/js/controls/generic.js +0 -17
  27. assets/js/controls/multicheck.js +12 -20
  28. assets/js/controls/multicolor.js +0 -92
  29. assets/js/controls/number.js +23 -35
  30. assets/js/controls/palette.js +4 -9
  31. assets/js/controls/preset.js +273 -23
  32. assets/js/controls/radio-buttonset.js +4 -8
  33. assets/js/controls/radio-image.js +4 -9
  34. assets/js/controls/radio.js +4 -9
  35. assets/js/controls/repeater.js +341 -879
  36. assets/js/controls/select.js +20 -22
  37. assets/js/controls/slider.js +22 -26
  38. assets/js/controls/sortable.js +18 -33
  39. assets/js/controls/spacing.js +99 -51
  40. assets/js/controls/switch.js +9 -11
  41. assets/js/controls/text.js +11 -0
  42. assets/js/controls/textarea.js +11 -0
  43. assets/js/controls/toggle.js +9 -11
  44. assets/js/controls/typography.js +145 -309
  45. assets/js/functions/set-setting-value.js +0 -218
  46. assets/js/functions/validate-css-value.js +0 -35
  47. assets/js/l10n.js +0 -4
  48. assets/js/postmessage.js +0 -153
  49. assets/js/reset.js +0 -20
  50. assets/js/tooltip.js +0 -3
  51. assets/js/vendor/codemirror/mode/apl/apl.js +174 -0
  52. assets/js/vendor/codemirror/mode/apl/index.html +72 -0
  53. assets/js/vendor/codemirror/mode/asciiarmor/asciiarmor.js +73 -0
  54. assets/js/vendor/codemirror/mode/asciiarmor/index.html +46 -0
  55. assets/js/vendor/codemirror/mode/asn.1/asn.1.js +204 -0
  56. assets/js/vendor/codemirror/mode/asn.1/index.html +78 -0
  57. assets/js/vendor/codemirror/mode/asterisk/asterisk.js +196 -0
  58. assets/js/vendor/codemirror/mode/asterisk/index.html +154 -0
  59. assets/js/vendor/codemirror/mode/brainfuck/brainfuck.js +85 -0
  60. assets/js/vendor/codemirror/mode/brainfuck/index.html +85 -0
  61. assets/js/vendor/codemirror/mode/clike/clike.js +775 -0
  62. assets/js/vendor/codemirror/mode/clike/index.html +360 -0
  63. assets/js/vendor/codemirror/mode/clike/scala.html +767 -0
  64. assets/js/vendor/codemirror/mode/clike/test.js +42 -0
  65. assets/js/vendor/codemirror/mode/clojure/clojure.js +244 -0
  66. assets/js/vendor/codemirror/mode/clojure/index.html +88 -0
  67. assets/js/vendor/codemirror/mode/cmake/cmake.js +97 -0
  68. assets/js/vendor/codemirror/mode/cmake/index.html +129 -0
  69. assets/js/vendor/codemirror/mode/cobol/cobol.js +255 -0
  70. assets/js/vendor/codemirror/mode/cobol/index.html +210 -0
  71. assets/js/vendor/codemirror/mode/commonlisp/commonlisp.js +123 -0
  72. assets/js/vendor/codemirror/mode/commonlisp/index.html +177 -0
  73. assets/js/vendor/codemirror/mode/cypher/cypher.js +146 -0
  74. assets/js/vendor/codemirror/mode/cypher/index.html +63 -0
  75. assets/js/vendor/codemirror/mode/d/d.js +218 -0
  76. assets/js/vendor/codemirror/mode/d/index.html +273 -0
  77. assets/js/vendor/codemirror/mode/dart/dart.js +130 -0
  78. assets/js/vendor/codemirror/mode/dart/index.html +71 -0
  79. assets/js/vendor/codemirror/mode/diff/diff.js +47 -0
  80. assets/js/vendor/codemirror/mode/diff/index.html +117 -0
  81. assets/js/vendor/codemirror/mode/django/django.js +350 -0
  82. assets/js/vendor/codemirror/mode/django/index.html +73 -0
  83. assets/js/vendor/codemirror/mode/dockerfile/dockerfile.js +79 -0
  84. assets/js/vendor/codemirror/mode/dockerfile/index.html +73 -0
  85. assets/js/vendor/codemirror/mode/dtd/dtd.js +142 -0
  86. assets/js/vendor/codemirror/mode/dtd/index.html +89 -0
  87. assets/js/vendor/codemirror/mode/dylan/dylan.js +291 -0
  88. assets/js/vendor/codemirror/mode/dylan/index.html +407 -0
  89. assets/js/vendor/codemirror/mode/ebnf/ebnf.js +195 -0
  90. assets/js/vendor/codemirror/mode/ebnf/index.html +102 -0
  91. assets/js/vendor/codemirror/mode/ecl/ecl.js +206 -0
  92. assets/js/vendor/codemirror/mode/ecl/index.html +52 -0
  93. assets/js/vendor/codemirror/mode/eiffel/eiffel.js +160 -0
  94. assets/js/vendor/codemirror/mode/eiffel/index.html +429 -0
  95. assets/js/vendor/codemirror/mode/elm/elm.js +205 -0
  96. assets/js/vendor/codemirror/mode/elm/index.html +61 -0
  97. assets/js/vendor/codemirror/mode/erlang/erlang.js +618 -0
  98. assets/js/vendor/codemirror/mode/erlang/index.html +76 -0
  99. assets/js/vendor/codemirror/mode/factor/factor.js +83 -0
  100. assets/js/vendor/codemirror/mode/factor/index.html +77 -0
  101. assets/js/vendor/codemirror/mode/forth/forth.js +180 -0
  102. assets/js/vendor/codemirror/mode/forth/index.html +75 -0
  103. assets/js/vendor/codemirror/mode/fortran/fortran.js +188 -0
  104. assets/js/vendor/codemirror/mode/fortran/index.html +81 -0
  105. assets/js/vendor/codemirror/mode/gas/gas.js +345 -0
  106. assets/js/vendor/codemirror/mode/gas/index.html +68 -0
  107. assets/js/vendor/codemirror/mode/gfm/gfm.js +130 -0
  108. assets/js/vendor/codemirror/mode/gfm/index.html +93 -0
  109. assets/js/vendor/codemirror/mode/gfm/test.js +230 -0
  110. assets/js/vendor/codemirror/mode/gherkin/gherkin.js +178 -0
  111. assets/js/vendor/codemirror/mode/gherkin/index.html +48 -0
  112. assets/js/vendor/codemirror/mode/go/go.js +185 -0
  113. assets/js/vendor/codemirror/mode/go/index.html +85 -0
  114. assets/js/vendor/codemirror/mode/groovy/groovy.js +230 -0
  115. assets/js/vendor/codemirror/mode/groovy/index.html +84 -0
  116. assets/js/vendor/codemirror/mode/handlebars/handlebars.js +53 -0
  117. assets/js/vendor/codemirror/mode/handlebars/index.html +83 -0
  118. assets/js/vendor/codemirror/mode/haskell/haskell.js +267 -0
  119. assets/js/vendor/codemirror/mode/haskell/index.html +73 -0
  120. assets/js/vendor/codemirror/mode/haxe/haxe.js +515 -0
  121. assets/js/vendor/codemirror/mode/haxe/index.html +124 -0
  122. assets/js/vendor/codemirror/mode/http/http.js +113 -0
  123. assets/js/vendor/codemirror/mode/http/index.html +45 -0
  124. assets/js/vendor/codemirror/mode/idl/idl.js +290 -0
  125. assets/js/vendor/codemirror/mode/idl/index.html +64 -0
  126. assets/js/vendor/codemirror/mode/jade/index.html +70 -0
  127. assets/js/vendor/codemirror/mode/jade/jade.js +590 -0
  128. assets/js/vendor/codemirror/mode/jinja2/index.html +54 -0
  129. assets/js/vendor/codemirror/mode/jinja2/jinja2.js +142 -0
  130. assets/js/vendor/codemirror/mode/julia/index.html +195 -0
  131. assets/js/vendor/codemirror/mode/julia/julia.js +299 -0
  132. assets/js/vendor/codemirror/mode/livescript/index.html +459 -0
  133. assets/js/vendor/codemirror/mode/livescript/livescript.js +280 -0
  134. assets/js/vendor/codemirror/mode/lua/index.html +85 -0
  135. assets/js/vendor/codemirror/mode/lua/lua.js +159 -0
  136. assets/js/vendor/codemirror/mode/mathematica/index.html +72 -0
  137. assets/js/vendor/codemirror/mode/mathematica/mathematica.js +175 -0
  138. assets/js/vendor/codemirror/mode/mirc/index.html +160 -0
  139. assets/js/vendor/codemirror/mode/mirc/mirc.js +193 -0
  140. assets/js/vendor/codemirror/mode/mllike/index.html +179 -0
  141. assets/js/vendor/codemirror/mode/mllike/mllike.js +205 -0
  142. assets/js/vendor/codemirror/mode/modelica/index.html +67 -0
  143. assets/js/vendor/codemirror/mode/modelica/modelica.js +245 -0
  144. assets/js/vendor/codemirror/mode/mscgen/index.html +65 -0
  145. assets/js/vendor/codemirror/mode/mscgen/index_msgenny.html +44 -0
  146. assets/js/vendor/codemirror/mode/mscgen/index_xu.html +70 -0
  147. assets/js/vendor/codemirror/mode/mscgen/mscgen.js +169 -0
  148. assets/js/vendor/codemirror/mode/mscgen/mscgen_test.js +75 -0
  149. assets/js/vendor/codemirror/mode/mscgen/msgenny_test.js +71 -0
  150. assets/js/vendor/codemirror/mode/mscgen/xu_test.js +75 -0
  151. assets/js/vendor/codemirror/mode/mumps/index.html +85 -0
  152. assets/js/vendor/codemirror/mode/mumps/mumps.js +148 -0
  153. assets/js/vendor/codemirror/mode/nginx/index.html +181 -0
  154. assets/js/vendor/codemirror/mode/nginx/nginx.js +178 -0
  155. assets/js/vendor/codemirror/mode/nsis/index.html +80 -0
  156. assets/js/vendor/codemirror/mode/nsis/nsis.js +95 -0
  157. assets/js/vendor/codemirror/mode/ntriples/index.html +45 -0
  158. assets/js/vendor/codemirror/mode/ntriples/ntriples.js +186 -0
  159. assets/js/vendor/codemirror/mode/octave/index.html +83 -0
  160. assets/js/vendor/codemirror/mode/octave/octave.js +135 -0
  161. assets/js/vendor/codemirror/mode/oz/index.html +59 -0
  162. assets/js/vendor/codemirror/mode/oz/oz.js +252 -0
  163. assets/js/vendor/codemirror/mode/pascal/index.html +61 -0
  164. assets/js/vendor/codemirror/mode/pascal/pascal.js +109 -0
  165. assets/js/vendor/codemirror/mode/pegjs/index.html +66 -0
  166. assets/js/vendor/codemirror/mode/pegjs/pegjs.js +114 -0
  167. assets/js/vendor/codemirror/mode/perl/index.html +75 -0
  168. assets/js/vendor/codemirror/mode/perl/perl.js +837 -0
  169. assets/js/vendor/codemirror/mode/pig/index.html +55 -0
  170. assets/js/vendor/codemirror/mode/pig/pig.js +178 -0
  171. assets/js/vendor/codemirror/mode/properties/index.html +53 -0
  172. assets/js/vendor/codemirror/mode/properties/properties.js +78 -0
  173. assets/js/vendor/codemirror/mode/puppet/index.html +121 -0
  174. assets/js/vendor/codemirror/mode/puppet/puppet.js +220 -0
  175. assets/js/vendor/codemirror/mode/python/index.html +198 -0
  176. assets/js/vendor/codemirror/mode/python/python.js +344 -0
LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 Aristeides Stathopoulos
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/{customizer-dynamic-css-colors.php → customizer-dynamic-css-colors.css} RENAMED
@@ -1,6 +1,3 @@
1
- <?php
2
-
3
- return '
4
  /** Generic background color **/
5
  .wp-full-overlay-sidebar {
6
  background: COLOR_BACK;
@@ -108,4 +105,3 @@ h3.customize-section-title {
108
  #customize-controls .customize-info .preview-notice {
109
  color: COLOR_FONT;
110
  }
111
- ';
 
 
 
1
  /** Generic background color **/
2
  .wp-full-overlay-sidebar {
3
  background: COLOR_BACK;
105
  #customize-controls .customize-info .preview-notice {
106
  color: COLOR_FONT;
107
  }
 
assets/css/{customizer-dynamic-css-width.php → customizer-dynamic-css-width.css} RENAMED
@@ -1,6 +1,3 @@
1
- <?php
2
-
3
- return '
4
  .wp-full-overlay-sidebar {
5
  width: WIDTH;
6
  }
@@ -8,4 +5,3 @@ return '
8
  .wp-full-overlay.expanded {
9
  margin-left: WIDTH;
10
  }
11
- ';
 
 
 
1
  .wp-full-overlay-sidebar {
2
  width: WIDTH;
3
  }
5
  .wp-full-overlay.expanded {
6
  margin-left: WIDTH;
7
  }
 
assets/css/{customizer-dynamic-css.php → customizer-dynamic-css.css} RENAMED
@@ -1,5 +1,3 @@
1
- <?php
2
- return '
3
  /** Button styles **/
4
  .wp-core-ui .button-primary-disabled,
5
  .wp-core-ui .button-primary.disabled,
@@ -18,7 +16,7 @@ return '
18
  }
19
 
20
  /** Tooltip styles **/
21
- #customize-controls .customize-info .customize-tooltip-toggle {
22
  color: COLOR_ACCENT;
23
  }
24
 
@@ -65,4 +63,3 @@ return '
65
  .customize-control-palette label.ui-state-active.ui-button.ui-widget span.ui-button-text {
66
  border-color: COLOR_ACCENT;
67
  }
68
- ';
 
 
1
  /** Button styles **/
2
  .wp-core-ui .button-primary-disabled,
3
  .wp-core-ui .button-primary.disabled,
16
  }
17
 
18
  /** Tooltip styles **/
19
+ #customize-controls .customize-info .customize-help-toggle {
20
  color: COLOR_ACCENT;
21
  }
22
 
63
  .customize-control-palette label.ui-state-active.ui-button.ui-widget span.ui-button-text {
64
  border-color: COLOR_ACCENT;
65
  }
 
assets/css/customizer.css CHANGED
@@ -6,20 +6,127 @@
6
  border-color: transparent !important;
7
  border-color: transparent !important; }
8
 
9
- #customize-preview.is-kirki-editor-open {
10
- height: calc(100% - 301px); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- .customize-control-kirki .description {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  font-style: normal;
14
  font-weight: 300;
15
  font-size: .9em; }
16
- .customize-control-kirki input {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  font-size: 16px; }
18
- .customize-control-kirki input[type="text"],
19
- .customize-control-kirki input[type="date"],
20
- .customize-control-kirki input[type="email"],
21
- .customize-control-kirki input[type="url"],
22
- .customize-control-kirki input[type="tel"] {
23
  border: 1px solid rgba(0, 0, 0, 0.1);
24
  background-image: none;
25
  background-position: 0% 0%;
@@ -27,83 +134,7 @@
27
  border-radius: 3px;
28
  padding: .5em; }
29
 
30
- .wp-full-overlay.expanded #customize-footer-actions .kirki-footer-thanks {
31
- position: fixed;
32
- bottom: 8px;
33
- left: 150px;
34
- padding: 0;
35
- width: 90px;
36
- height: 25px;
37
- background-image: url("../images/kirki-bottom.png");
38
- background-repeat: no-repeat;
39
- background-position: center center; }
40
-
41
- .kirki-reset-section {
42
- position: absolute;
43
- top: 10px;
44
- right: 10px;
45
- background: #BDBDBD;
46
- opacity: .5;
47
- color: #fff;
48
- font-size: .8rem;
49
- border-radius: 3px;
50
- padding: 0 5px;
51
- -webkit-transition: all .2s ease-in-out;
52
- -moz-transition: all .2s ease-in-out;
53
- -ms-transition: all .2s ease-in-out;
54
- -o-transition: all .2s ease-in-out;
55
- transition: all .2s ease-in-out;
56
- font-weight: bold; }
57
- .kirki-reset-section .dashicons {
58
- font-size: .8rem;
59
- width: .8rem;
60
- height: .8rem;
61
- line-height: .8rem;
62
- vertical-align: baseline; }
63
- .kirki-reset-section:hover, .kirki-reset-section:active {
64
- background: #F44336;
65
- color: #fff;
66
- font-weight: bold;
67
- opacity: 1; }
68
- .kirki-reset-section:focus {
69
- opacity: 1;
70
- -webkit-box-shadow: 0 0 0 1px #F44336, 0 0 2px 1px rgba(200, 50, 30, 0.8);
71
- box-shadow: 0 0 0 1px #F44336, 0 0 2px 1px rgba(200, 50, 30, 0.8); }
72
-
73
- #customize-theme-controls .control-panel.control-panel-kirki-expanded > ul.control-panel-content {
74
- position: relative;
75
- left: 0;
76
- display: block !important;
77
- margin-top: 0 !important; }
78
- #customize-theme-controls .control-panel.control-panel-kirki-expanded > ul.control-panel-content .accordion-section-title {
79
- margin-left: 0; }
80
- #customize-theme-controls .control-panel.control-panel-kirki-expanded > ul.control-panel-content > li.customize-info {
81
- margin-bottom: 0;
82
- border-top: none; }
83
- #customize-theme-controls .control-panel.control-panel-kirki-expanded > ul.control-panel-content > li.customize-info .accordion-section-title {
84
- border-bottom: none !important; }
85
-
86
- #customize-theme-controls .control-section.control-section-kirki-expanded > ul.accordion-section-content {
87
- position: relative;
88
- left: 0;
89
- display: block;
90
- margin-top: 0 !important; }
91
-
92
- #customize-theme-controls .control-section.control-section-kirki-hover:hover:not(.open) > ul.accordion-section-content, #customize-theme-controls .control-section.control-section-kirki-hover:focus:not(.open) > ul.accordion-section-content, #customize-theme-controls .control-section.control-section-kirki-hover:active:not(.open) > ul.accordion-section-content {
93
- position: fixed;
94
- left: 300px;
95
- width: 300px;
96
- background: #eee;
97
- display: block;
98
- height: 100%;
99
- max-height: 100vh;
100
- overflow-y: scroll; }
101
- #customize-theme-controls .control-section.control-section-kirki-hover:hover:not(.open) .customize-section-title, #customize-theme-controls .control-section.control-section-kirki-hover:focus:not(.open) .customize-section-title, #customize-theme-controls .control-section.control-section-kirki-hover:active:not(.open) .customize-section-title {
102
- display: none; }
103
-
104
- .customize-control-kirki-checkbox input[type="checkbox"],
105
- .customize-control-kirki-multicheck input[type="checkbox"],
106
- .customize-control-repeater input[type="checkbox"] {
107
  position: relative;
108
  margin: 0 1rem 0 0;
109
  cursor: pointer;
@@ -112,9 +143,7 @@
112
  height: 22px;
113
  border-radius: 3px;
114
  -webkit-border-radius: 3px; }
115
- .customize-control-kirki-checkbox input[type="checkbox"]:before,
116
- .customize-control-kirki-multicheck input[type="checkbox"]:before,
117
- .customize-control-repeater input[type="checkbox"]:before {
118
  content: "";
119
  position: absolute;
120
  left: 0;
@@ -122,9 +151,7 @@
122
  width: 100%;
123
  height: 100%;
124
  border: none; }
125
- .customize-control-kirki-checkbox input[type="checkbox"]:after,
126
- .customize-control-kirki-multicheck input[type="checkbox"]:after,
127
- .customize-control-repeater input[type="checkbox"]:after {
128
  content: "";
129
  position: absolute;
130
  left: 0;
@@ -135,49 +162,16 @@
135
  cursor: pointer;
136
  border-radius: 3px;
137
  -webkit-border-radius: 3px; }
138
- .customize-control-kirki-checkbox input[type="checkbox"]:checked:before,
139
- .customize-control-kirki-multicheck input[type="checkbox"]:checked:before,
140
- .customize-control-repeater input[type="checkbox"]:checked:before {
141
  content: "\f147";
142
  font-family: dashicons;
143
  font-size: 25px;
144
  left: 0;
145
  top: 2px; }
146
- .customize-control-kirki-checkbox input[type="checkbox"]:checked:after,
147
- .customize-control-kirki-multicheck input[type="checkbox"]:checked:after,
148
- .customize-control-repeater input[type="checkbox"]:checked:after {
149
  background: #fff; }
150
 
151
- .customize-control-kirki-code a.close {
152
- display: none; }
153
- .customize-control-kirki-code .CodeMirror {
154
- position: fixed;
155
- left: -100%;
156
- top: 0;
157
- height: 100vh;
158
- opacity: 0.9;
159
- z-index: 9998;
160
- width: 100%;
161
- -webkit-transition: all 250ms ease-in-out;
162
- -moz-transition: all 250ms ease-in-out;
163
- -ms-transition: all 250ms ease-in-out;
164
- -o-transition: all 250ms ease-in-out;
165
- transition: all 250ms ease-in-out; }
166
- .customize-control-kirki-code .kirki-codemirror-editor.expanded + .CodeMirror {
167
- left: 0; }
168
- .customize-control-kirki-code .kirki-codemirror-editor.expanded + .CodeMirror + a.close {
169
- display: block;
170
- position: fixed;
171
- right: 0;
172
- top: 0;
173
- opacity: 0.9;
174
- z-index: 9999;
175
- background: #fff;
176
- background: rgba(255, 255, 255, 0.85);
177
- color: #333;
178
- padding: 10px;
179
- cursor: pointer; }
180
-
181
  .CodeMirror {
182
  /* Set height, width, borders, and global font properties here */
183
  font-family: monospace;
@@ -193,8 +187,7 @@
193
  padding: 0 4px;
194
  /* Horizontal padding of content */ }
195
 
196
- .CodeMirror-gutter-filler,
197
- .CodeMirror-scrollbar-filler {
198
  background-color: white;
199
  /* The little square between H and V scrollbars */ }
200
 
@@ -274,8 +267,7 @@
274
  .cm-positive {
275
  color: #292; }
276
 
277
- .cm-header,
278
- .cm-strong {
279
  font-weight: bold; }
280
 
281
  .cm-em {
@@ -388,10 +380,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
388
  /* The fake, visible scrollbars. Used to force redraw during scrolling
389
  before actuall scrolling happens, thus preventing shaking and
390
  flickering artifacts. */
391
- .CodeMirror-gutter-filler,
392
- .CodeMirror-hscrollbar,
393
- .CodeMirror-scrollbar-filler,
394
- .CodeMirror-vscrollbar {
395
  position: absolute;
396
  z-index: 6;
397
  display: none; }
@@ -499,11 +488,11 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
499
  outline: none; }
500
 
501
  /* Force content-box sizing for the elements where we expect it */
 
 
502
  .CodeMirror-gutter,
503
  .CodeMirror-gutters,
504
- .CodeMirror-linenumber,
505
- .CodeMirror-scroll,
506
- .CodeMirror-sizer {
507
  -moz-box-sizing: content-box;
508
  box-sizing: content-box; }
509
 
@@ -540,14 +529,10 @@ div.CodeMirror-dragcursors {
540
  .CodeMirror-crosshair {
541
  cursor: crosshair; }
542
 
543
- .CodeMirror-line > span > span::selection,
544
- .CodeMirror-line > span::selection,
545
- .CodeMirror-line::selection {
546
  background: #d7d4f0; }
547
 
548
- .CodeMirror-line > span > span::-moz-selection,
549
- .CodeMirror-line > span::-moz-selection,
550
- .CodeMirror-line::-moz-selection {
551
  background: #d7d4f0; }
552
 
553
  .cm-searching {
@@ -560,7 +545,7 @@ div.CodeMirror-dragcursors {
560
 
561
  /* Used to force a border model for a node */
562
  .cm-force-border {
563
- padding-right: 0.1px; }
564
 
565
  @media print {
566
  /* Hide the cursor when printing */
@@ -574,186 +559,140 @@ div.CodeMirror-dragcursors {
574
  span.CodeMirror-selectedtext {
575
  background: none; }
576
 
577
- .customize-control-kirki-color .wp-picker-container {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
578
  width: 100%; }
579
- .customize-control-kirki-color .wp-picker-container a.wp-color-result {
580
- width: auto;
581
- display: block;
582
- border: none;
583
- padding-left: 40px; }
584
- .customize-control-kirki-color .wp-picker-container a.wp-color-result:after {
585
- background: rgba(0, 0, 0, 0.25);
586
- color: #fff;
587
- border: none;
588
- -webkit-box-shadow: none;
589
- box-shadow: none; }
590
- .customize-control-kirki-color .wp-picker-container a.wp-color-result:focus:after, .customize-control-kirki-color .wp-picker-container a.wp-color-result:hover:after {
591
- color: #fff; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
 
593
- #kirki_editor_pane {
 
 
 
 
594
  background: #fff;
595
- z-index: 1;
596
- padding-top: 5px;
597
- border-top: 1px solid #dedede;
598
- position: absolute;
599
- bottom: 0;
600
- width: 100%;
601
- -webkit-transition: bottom .2s;
602
- -moz-transition: bottom .2s;
603
- -ms-transition: bottom .2s;
604
- -o-transition: bottom .2s;
605
- transition: bottom .2s; }
606
- #kirki_editor_pane.hide {
607
- bottom: -301px;
608
- z-index: -999; }
609
-
610
- .mce-container.mce-panel.mce-floatpanel.mce-window.mce-in {
611
- z-index: 99999999 !important; }
612
-
613
- .customize-control-kirki-multicolor .multicolor-group-wrapper {
614
- display: flex; }
615
- .customize-control-kirki-multicolor .multicolor-group-wrapper .multicolor-single-color-wrapper {
616
- width: 100%; }
617
- .customize-control-kirki-multicolor .multicolor-group-wrapper .multicolor-single-color-wrapper label {
618
- display: block;
619
- text-align: center;
620
- padding: 3px; }
621
- .customize-control-kirki-multicolor .multicolor-group-wrapper .wp-picker-container {
622
- width: 100%; }
623
- .customize-control-kirki-multicolor .multicolor-group-wrapper .wp-picker-container a.wp-color-result {
624
- width: 100%;
625
- height: 30px;
626
- padding-left: 0;
627
- border-radius: 0;
628
- border: none;
629
- margin-right: 0; }
630
- .customize-control-kirki-multicolor .multicolor-group-wrapper .wp-picker-container a.wp-color-result > span {
631
- border-top-left-radius: 0 !important;
632
- border-bottom-left-radius: 0 !important;
633
- border-top-right-radius: 0 !important;
634
- border-bottom-right-radius: 0 !important; }
635
- .customize-control-kirki-multicolor .multicolor-group-wrapper .wp-picker-container a.wp-color-result:after {
636
- display: none; }
637
-
638
- .customize-control-kirki-color-palette label {
639
- position: relative;
640
  display: inline-block;
641
- padding: 2px 0; }
642
- .customize-control-kirki-color-palette .color-palette-color {
643
- color: transparent;
644
- display: block;
645
- width: 42px;
646
- height: 42px;
647
- overflow: hidden;
648
- border-radius: 50%;
649
- -webkit-box-shadow: inset 3px 3px 13px 2px rgba(0, 0, 0, 0.22);
650
- box-shadow: inset 3px 3px 13px 2px rgba(0, 0, 0, 0.22);
651
- border: 1px solid rgba(0, 0, 0, 0.2); }
652
- .customize-control-kirki-color-palette .colors-wrapper {
653
- max-height: 300px;
654
- overflow-y: auto;
655
- padding: 10px; }
656
- .customize-control-kirki-color-palette .colors-wrapper input {
657
- display: none; }
658
- .customize-control-kirki-color-palette .colors-wrapper input:checked + label .color-palette-color {
659
- -webkit-box-shadow: 1px 1px 10px 1px #333333;
660
- box-shadow: 1px 1px 10px 1px #333333;
661
- border: 1px solid rgba(0, 0, 0, 0.3); }
662
-
663
- .wp-customizer div.ui-datepicker {
664
- z-index: 500001 !important;
665
- width: 255px;
666
- background: #fff;
667
- border: 1px solid #dedede; }
668
- .wp-customizer div.ui-datepicker .ui-datepicker-header {
669
- padding: 10px;
670
- background: #e5e5e5;
671
- border-bottom: 1px solid #fff; }
672
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next,
673
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev {
674
- display: block;
675
- position: absolute;
676
- width: 1em;
677
- overflow: hidden; }
678
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:after, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:before,
679
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:after,
680
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before {
681
- font-family: dashicons; }
682
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:after:hover, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:before:hover,
683
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:after:hover,
684
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before:hover {
685
- cursor: pointer; }
686
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next .ui-icon,
687
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev .ui-icon {
688
- display: none; }
689
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev {
690
- left: 10px; }
691
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before {
692
- content: "\f341"; }
693
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next {
694
- right: 10px; }
695
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:after {
696
- content: "\f345"; }
697
- .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-title {
698
- text-align: center; }
699
- .wp-customizer div.ui-datepicker .ui-datepicker-calendar {
700
- border-collapse: collapse;
701
- width: 100%; }
702
- .wp-customizer div.ui-datepicker .ui-datepicker-calendar thead {
703
- background: #e5e5e5;
704
- padding: 5px; }
705
- .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td {
706
- text-align: center; }
707
- .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td a {
708
- display: block;
709
- padding: 5px;
710
- color: #333;
711
- text-decoration: none; }
712
- .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td a.ui-state-active, .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td a:hover {
713
- color: #fff;
714
- background-color: #0073aa; }
715
- .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td.ui-state-disabled a, .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td.ui-state-disabled .ui-state-default a {
716
- color: #999; }
717
-
718
- .customize-control-kirki-dashicons label {
719
  position: relative;
 
 
 
720
  display: inline-block; }
721
- .customize-control-kirki-dashicons .icons-wrapper {
722
- max-height: 300px;
723
- overflow-y: scroll; }
724
- .customize-control-kirki-dashicons .icons-wrapper h4 {
725
- font-weight: 300;
726
- margin: 0.7em 0; }
727
- .customize-control-kirki-dashicons .icons-wrapper .dashicons {
728
- padding: 3px;
729
- font-size: 25px;
730
- width: 25px;
731
- height: 25px;
732
- border: 1px solid transparent; }
733
- .customize-control-kirki-dashicons .icons-wrapper input {
734
- display: none; }
735
- .customize-control-kirki-dashicons .icons-wrapper input:checked + label .dashicons {
736
- border: 1px solid #3498DB;
737
- color: #000; }
738
-
739
- .customize-control-kirki-dimension .input-wrapper .invalid-value {
740
- display: none;
741
- background: #D32F2F;
742
- font-size: 0.85em;
743
- color: #fff;
744
- float: left;
745
- padding: 2px 0;
746
- border-radius: 3px; }
747
- .customize-control-kirki-dimension .input-wrapper.invalid .invalid-value {
748
- display: block;
749
- width: 98%;
750
- text-align: center; }
751
- .customize-control-kirki-dimension .input-wrapper.invalid input[type="text"]:focus {
752
- border-color: #D32F2F; }
753
 
754
- .customize-control-kirki-number .ui-spinner.ui-widget-content {
755
  position: relative; }
756
- .customize-control-kirki-number .ui-spinner.ui-widget-content .ui-spinner-button {
757
  position: absolute;
758
  right: 0;
759
  color: rgba(0, 0, 0, 0.3);
@@ -768,35 +707,35 @@ span.CodeMirror-selectedtext {
768
  background: transparent;
769
  background: none;
770
  margin: 0; }
771
- .customize-control-kirki-number .ui-spinner.ui-widget-content .ui-spinner-button .ui-button-text {
772
  display: none; }
773
- .customize-control-kirki-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before, .customize-control-kirki-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before {
774
  font-family: dashicons;
775
  position: absolute;
776
  left: 0; }
777
- .customize-control-kirki-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up {
778
  top: -50%; }
779
- .customize-control-kirki-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before {
780
  content: "\f343"; }
781
- .customize-control-kirki-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down {
782
  top: 50%; }
783
- .customize-control-kirki-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before {
784
  content: "\f347"; }
785
- .customize-control-kirki-number .ui-spinner.ui-widget-content .ui-spinner-button:hover {
786
  color: rgba(0, 0, 0, 0.7); }
787
 
788
- .customize-control-kirki-palette input[type="radio"] {
789
  display: none; }
790
- .customize-control-kirki-palette input[type="radio"]:checked + label {
791
  border: 3px solid rgba(0, 0, 0, 0.4); }
792
- .customize-control-kirki-palette label {
793
  background: none;
794
  padding: 0;
795
  border-top: 3px solid transparent;
796
  border-bottom: 3px solid transparent;
797
  margin-bottom: 5px;
798
  display: flex; }
799
- .customize-control-kirki-palette label span {
800
  padding: 10px 0;
801
  flex-grow: 1;
802
  font-size: 0;
@@ -809,11 +748,11 @@ span.CodeMirror-selectedtext {
809
  transition: all 200ms ease-in-out;
810
  border-top: 1px solid rgba(0, 0, 0, 0.1);
811
  border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
812
- .customize-control-kirki-palette label span:first-child {
813
  border-left: 1px solid rgba(0, 0, 0, 0.1); }
814
- .customize-control-kirki-palette label span:last-child {
815
  border-right: 1px solid rgba(0, 0, 0, 0.1); }
816
- .customize-control-kirki-palette label span:hover {
817
  padding: 10px;
818
  flex-grow: 3;
819
  min-width: 60px;
@@ -834,92 +773,53 @@ span.CodeMirror-selectedtext {
834
  .customize-control-kirki-radio label .option-description {
835
  display: block;
836
  color: rgba(0, 0, 0, 0.35);
837
- font-size: 0.9em;
838
  padding-left: 25px; }
839
 
840
- .customize-control-kirki-radio-buttonset .buttonset .switch-label {
841
- background: rgba(0, 0, 0, 0.05);
842
- color: #555;
843
  border-right: 1px solid rgba(0, 0, 0, 0.2);
844
  padding: 4px 7px;
845
  margin: 0;
846
  font-size: 12px; }
847
- .customize-control-kirki-radio-buttonset .buttonset .switch-label:last-child {
848
  border-right: none; }
849
- .customize-control-kirki-radio-buttonset .buttonset .switch-input {
850
  display: none; }
851
- .customize-control-kirki-radio-buttonset .buttonset .switch-input:checked + .switch-label {
852
- background-color: #3498DB;
853
- color: #fff; }
854
 
855
- .customize-control-kirki-radio-image label {
856
- position: relative;
857
- display: inline-block; }
858
- .customize-control-kirki-radio-image input {
859
  display: none; }
860
- .customize-control-kirki-radio-image input img {
861
  border: 1px solid transparent; }
862
- .customize-control-kirki-radio-image input:checked + label img {
863
  -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
864
  box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
865
  border: 1px solid #3498DB; }
866
- .customize-control-kirki-radio-image input + label .image-clickable {
867
- position: absolute;
868
- top: 0;
869
- bottom: 0;
870
- left: 0;
871
- right: 0;
872
- width: 100%;
873
- height: 100%; }
874
 
875
  .customize-control-repeater .repeater-fields .repeater-row {
 
876
  border: 1px solid #999;
877
- margin-top: 0.5rem;
878
  background: #eee;
879
- position: relative; }
880
- .customize-control-repeater .repeater-fields .repeater-row.minimized {
881
- border: 1px solid #dfdfdf;
882
- padding: 0; }
883
- .customize-control-repeater .repeater-fields .repeater-row.minimized:hover {
884
- border: 1px solid #999; }
885
- .customize-control-repeater .repeater-fields .repeater-row.minimized .repeater-row-content {
886
- display: none; }
887
  .customize-control-repeater .repeater-fields .repeater-row label {
888
  margin-bottom: 12px;
889
  clear: both; }
890
- .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field- {
891
- display: none; }
892
- .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input {
893
- display: none; }
894
- .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input img {
895
- border: 1px solid transparent; }
896
- .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input:checked + label img {
897
- -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
898
- box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
899
- border: 1px solid #3498DB; }
900
- .customize-control-repeater .repeater-fields .repeater-row .repeater-field:last-child {
901
- border-bottom: none;
902
- padding-bottom: 0; }
903
  .customize-control-repeater button.repeater-add {
904
  margin-top: 1rem; }
905
- .customize-control-repeater .repeater-row-content {
906
- padding: 10px 15px; }
907
  .customize-control-repeater .repeater-field {
908
  margin-bottom: 12px;
909
  width: 100%;
910
  clear: both;
911
  padding-bottom: 12px;
912
  border-bottom: 1px dotted #CCC; }
913
- .customize-control-repeater .repeater-field .customize-control-title {
914
- font-size: 13px;
915
- line-height: initial; }
916
- .customize-control-repeater .repeater-field .customize-control-description {
917
- font-size: 13px;
918
- line-height: initial; }
919
- .customize-control-repeater .repeater-field.repeater-field-hidden {
920
- margin: 0;
921
- padding: 0;
922
- border: 0; }
923
  .customize-control-repeater .repeater-field-select select {
924
  margin-left: 0; }
925
  .customize-control-repeater .repeater-field-checkbox label {
@@ -932,64 +832,44 @@ span.CodeMirror-selectedtext {
932
  resize: vertical; }
933
  .customize-control-repeater .repeater-row-header {
934
  background: white;
935
- border: 1px solid #dfdfdf;
936
- position: relative;
937
- padding: 10px 15px;
938
- height: auto;
939
- min-height: 20px;
940
- line-height: 30px;
941
- overflow: hidden;
942
- word-wrap: break-word; }
943
- .customize-control-repeater .repeater-row-header:hover {
944
- cursor: move; }
945
- .customize-control-repeater .repeater-row-header .dashicons {
946
- font-size: 18px;
947
- position: absolute;
948
- right: 12px;
949
- top: 2px;
950
- color: #a0a5aa; }
951
- .customize-control-repeater .repeater-row-label {
952
- font-size: 13px;
953
- font-weight: 600;
954
- line-height: 20px;
955
- display: block;
956
- text-transform: capitalize;
957
- width: 90%;
958
- overflow: hidden;
959
- height: 18px; }
960
- .customize-control-repeater .repeater-row-remove {
961
- color: #a00; }
962
- .customize-control-repeater .repeater-row-remove:hover {
963
- color: #f00; }
 
 
 
964
  .customize-control-repeater .repeater-minimize {
965
  line-height: 36px; }
966
- .customize-control-repeater .remove-button,
967
- .customize-control-repeater .upload-button {
968
- width: 48%; }
969
-
970
- .kirki-image-attachment {
971
- margin: 0;
972
- text-align: center;
973
- margin-bottom: 10px; }
974
- .kirki-image-attachment img {
975
- display: inline-block; }
976
-
977
- .kirki-file-attachment {
978
- margin: 0;
979
- text-align: center;
980
- margin-bottom: 10px; }
981
- .kirki-file-attachment .file {
982
- display: block;
983
- padding: 10px 5px;
984
- border: 1px dotted #c3c3c3;
985
- background: #f9f9f9; }
986
-
987
- .limit {
988
- padding: 3px;
989
- border-radius: 3px; }
990
- .limit.highlight {
991
- background: #D32F2F;
992
- color: #fff; }
993
 
994
  .selectize-control {
995
  position: relative; }
@@ -1053,7 +933,7 @@ span.CodeMirror-selectedtext {
1053
  text-decoration: none;
1054
  vertical-align: middle;
1055
  display: inline-block;
1056
- padding: 2px 0 0;
1057
  border-left: 1px solid #d0d0d0;
1058
  -webkit-border-radius: 0 2px 2px 0;
1059
  -moz-border-radius: 0 2px 2px 0;
@@ -1089,12 +969,11 @@ span.CodeMirror-selectedtext {
1089
  background: #ffffff;
1090
  border: 0 solid #ffffff; }
1091
  .selectize-dropdown {
1092
- position: relative;
1093
- top: -4px !important;
1094
  z-index: 10;
1095
  border: 1px solid #d0d0d0;
1096
  background: #ffffff;
1097
- margin: -1px 0 0;
1098
  border-top: 0 none;
1099
  -webkit-box-sizing: border-box;
1100
  -moz-box-sizing: border-box;
@@ -1143,13 +1022,13 @@ span.CodeMirror-selectedtext {
1143
  font-size: 13px;
1144
  line-height: 18px;
1145
  -webkit-font-smoothing: inherit; }
1146
- .selectize-control.single .selectize-input.input-active, .selectize-input {
1147
  background: #ffffff;
1148
  cursor: text;
1149
  display: inline-block; }
1150
  .selectize-input {
1151
  border: 1px solid rgba(0, 0, 0, 0.1);
1152
- padding: 8px;
1153
  display: inline-block;
1154
  width: 100%;
1155
  overflow: hidden;
@@ -1217,8 +1096,8 @@ span.CodeMirror-selectedtext {
1217
  -webkit-border-radius: 1px;
1218
  -moz-border-radius: 1px;
1219
  border-radius: 1px; }
1220
- .selectize-dropdown .optgroup-header,
1221
- .selectize-dropdown [data-selectable] {
1222
  padding: 5px 8px; }
1223
  .selectize-dropdown .optgroup:first-child .optgroup-header {
1224
  border-top: 0 none; }
@@ -1238,132 +1117,118 @@ span.CodeMirror-selectedtext {
1238
  overflow-x: hidden;
1239
  max-height: 200px; }
1240
 
1241
- .customize-control-kirki-slider input[type=range] {
1242
  -webkit-appearance: none;
1243
- -webkit-transition: background 0.3s;
1244
- -moz-transition: background 0.3s;
1245
- transition: background 0.3s;
1246
  background-color: rgba(0, 0, 0, 0.1);
1247
  height: 5px;
1248
  width: calc(100% - 70px);
1249
  padding: 0; }
1250
- .customize-control-kirki-slider input[type=range]:focus {
1251
  box-shadow: none;
1252
  outline: none; }
1253
- .customize-control-kirki-slider input[type=range]:hover {
1254
  background-color: rgba(0, 0, 0, 0.25); }
1255
- .customize-control-kirki-slider input[type=range]::-webkit-slider-thumb {
1256
  -webkit-appearance: none;
1257
  width: 15px;
1258
  height: 15px;
1259
  border-radius: 50%;
1260
  -webkit-border-radius: 50%;
1261
  background-color: #3498D9; }
1262
- .customize-control-kirki-slider input[type=range]::-webkit-slider-thumb {
1263
  -webkit-appearance: none;
1264
  width: 15px;
1265
  height: 15px;
1266
  border: none;
1267
  border-radius: 50%;
1268
  background-color: #3498D9; }
1269
- .customize-control-kirki-slider input[type=range]::-moz-range-thumb {
1270
  width: 15px;
1271
  height: 15px;
1272
  border: none;
1273
  border-radius: 50%;
1274
  background-color: #3498D9; }
1275
- .customize-control-kirki-slider input[type=range]::-ms-thumb {
1276
  width: 15px;
1277
  height: 15px;
1278
  border-radius: 50%;
1279
  border: 0;
1280
  background-color: #3498D9; }
1281
- .customize-control-kirki-slider input[type=range]::-moz-range-track {
1282
  border: inherit;
1283
  background: transparent; }
1284
- .customize-control-kirki-slider input[type=range]::-ms-track {
1285
  border: inherit;
1286
  color: transparent;
1287
  background: transparent; }
1288
- .customize-control-kirki-slider input[type=range]::-ms-fill-lower, .customize-control-kirki-slider input[type=range]::-ms-fill-upper {
1289
  background: transparent; }
1290
- .customize-control-kirki-slider input[type=range]::-ms-tooltip {
1291
  display: none; }
1292
- .customize-control-kirki-slider .kirki_range_value {
1293
  display: inline-block;
1294
  font-size: 14px;
1295
  padding: 0 5px;
1296
  font-weight: 400;
1297
  position: relative;
1298
  top: 2px; }
1299
- .customize-control-kirki-slider .kirki-slider-reset {
1300
  color: rgba(0, 0, 0, 0.2);
1301
  float: right;
1302
- -webkit-transition: color 0.5s ease-in;
1303
- -moz-transition: color 0.5s ease-in;
1304
- -ms-transition: color 0.5s ease-in;
1305
- -o-transition: color 0.5s ease-in;
1306
- transition: color 0.5s ease-in; }
1307
- .customize-control-kirki-slider .kirki-slider-reset span {
1308
  font-size: 16px;
1309
  line-height: 22px; }
1310
- .customize-control-kirki-slider .kirki-slider-reset:hover {
1311
  color: red; }
1312
 
1313
- .customize-control-kirki-sortable ul.ui-sortable li {
1314
  padding: 5px 10px;
1315
  border: 1px solid #333;
1316
  background: #fff; }
1317
- .customize-control-kirki-sortable ul.ui-sortable li .dashicons.dashicons-menu {
1318
  float: right; }
1319
- .customize-control-kirki-sortable ul.ui-sortable li .dashicons.visibility {
1320
  margin-right: 10px; }
1321
- .customize-control-kirki-sortable ul.ui-sortable li.invisible {
1322
  color: #aaa;
1323
  border: 1px dashed #aaa; }
1324
- .customize-control-kirki-sortable ul.ui-sortable li.invisible .dashicons.visibility {
1325
  color: #aaa; }
1326
 
1327
- .customize-control-kirki-spacing .wrapper {
1328
  -webkit-box-shadow: inset 0 0 5px 2px rgba(0, 0, 0, 0.1);
1329
  box-shadow: inset 0 0 5px 2px rgba(0, 0, 0, 0.1);
1330
  width: 96%;
1331
  padding: 3%; }
1332
- .customize-control-kirki-spacing .wrapper .control {
1333
  display: flex;
1334
  flex-wrap: wrap;
1335
  justify-content: space-between; }
1336
- .customize-control-kirki-spacing .wrapper .control > div {
1337
  width: 48%; }
1338
- .customize-control-kirki-spacing .wrapper .control > div h5 {
1339
- margin: 10px 0 7px; }
1340
- .customize-control-kirki-spacing .wrapper .control > div .inner {
1341
  display: flex; }
1342
- .customize-control-kirki-spacing .wrapper .control > div .inner input[type="number"] {
1343
  width: 50%;
1344
  height: 36px; }
1345
- .customize-control-kirki-spacing .wrapper .control > div .inner .selectize-control.single {
1346
  width: 50%; }
1347
- .customize-control-kirki-spacing .wrapper .control > div .inner .selectize-control.single > .selectize-input {
1348
  height: 36px; }
1349
- .customize-control-kirki-spacing .wrapper .input-wrapper .invalid-value {
1350
- display: none;
1351
- background: #D32F2F;
1352
- font-size: 0.85em;
1353
- color: #fff;
1354
- float: left;
1355
- padding: 2px 0;
1356
- border-radius: 3px; }
1357
- .customize-control-kirki-spacing .wrapper .input-wrapper.invalid .invalid-value {
1358
- display: block;
1359
- width: 98%;
1360
- text-align: center; }
1361
- .customize-control-kirki-spacing .wrapper .input-wrapper.invalid input[type="text"]:focus {
1362
- border-color: #D32F2F; }
1363
 
1364
- .customize-control-kirki-switch input[type="checkbox"] {
1365
  display: none; }
1366
- .customize-control-kirki-switch .switch {
1367
  border: none;
1368
  margin-bottom: 1.5rem;
1369
  outline: 0;
@@ -1373,79 +1238,79 @@ span.CodeMirror-selectedtext {
1373
  -moz-user-select: none;
1374
  -ms-user-select: none;
1375
  user-select: none; }
1376
- .customize-control-kirki-switch .switch label {
1377
  background: rgba(0, 0, 0, 0.2);
1378
  color: transparent;
1379
  cursor: pointer;
1380
  display: block;
1381
  margin-bottom: 1rem;
1382
  position: relative;
 
1383
  transition: left 0.15s ease-out;
1384
  height: 2rem;
1385
- width: 4rem;
1386
- font-family: Monaco, "Lucida Sans Typewriter", "Lucida Typewriter", "Courier New", Courier, monospace; }
1387
- .customize-control-kirki-switch .switch label:after {
1388
  background: #FFFFFF;
1389
  content: "";
1390
  display: block;
1391
  height: 1.5rem;
1392
- left: 0.25rem;
1393
  position: absolute;
1394
- top: 0.25rem;
1395
  width: 1.5rem;
1396
- -webkit-transition: all 0.25s ease-in-out;
1397
- -moz-transition: all 0.25s ease-in-out;
1398
- -ms-transition: all 0.25s ease-in-out;
1399
- -o-transition: all 0.25s ease-in-out;
1400
- transition: all 0.25s ease-in-out; }
1401
- .customize-control-kirki-switch .switch input {
 
 
 
 
1402
  left: 10px;
1403
  opacity: 0;
1404
  padding: 0;
1405
  position: absolute;
1406
  top: 9px; }
1407
- .customize-control-kirki-switch .switch input + label {
1408
  margin-left: 0;
1409
  margin-right: 0; }
1410
- .customize-control-kirki-switch .switch input:checked + label {
1411
  background: #3498DB; }
1412
- .customize-control-kirki-switch .switch input:checked + label:after {
1413
  left: 2.25rem;
1414
  background: #ffffff; }
1415
- .customize-control-kirki-switch .switch.round {
1416
  border-radius: 1000px; }
1417
- .customize-control-kirki-switch .switch.round label {
1418
  border-radius: 2rem; }
1419
- .customize-control-kirki-switch .switch.round label:after {
1420
  border-radius: 2rem; }
1421
- .customize-control-kirki-switch .switch-off,
1422
- .customize-control-kirki-switch .switch-on {
1423
- line-height: 32px;
 
 
1424
  font-weight: bold;
1425
- padding: 0 10px; }
1426
- .customize-control-kirki-switch .switch-on {
1427
- color: #fff;
1428
- padding-right: 5px; }
1429
- .customize-control-kirki-switch .switch-off {
1430
- color: #777;
1431
- padding-left: 5px; }
 
1432
 
1433
- .customize-control-kirki-generic textarea {
1434
  width: 100%;
1435
  border: 1px solid rgba(0, 0, 0, 0.1);
1436
  -webkit-box-shadow: none;
1437
  box-shadow: none; }
1438
 
1439
- .customize-control-kirki-toggle label {
1440
- display: flex;
1441
- flex-wrap: wrap; }
1442
- .customize-control-kirki-toggle label .customize-control-title {
1443
- width: calc(100% - 55px); }
1444
- .customize-control-kirki-toggle label .description {
1445
- order: 99; }
1446
- .customize-control-kirki-toggle input[type="checkbox"] {
1447
  display: none; }
1448
- .customize-control-kirki-toggle .switch {
1449
  border: 1px solid rgba(0, 0, 0, 0.1);
1450
  display: inline-block;
1451
  width: 35px;
@@ -1457,7 +1322,7 @@ span.CodeMirror-selectedtext {
1457
  cursor: pointer;
1458
  user-select: none;
1459
  transition: background 350ms ease; }
1460
- .customize-control-kirki-toggle .switch:after, .customize-control-kirki-toggle .switch:before {
1461
  content: "";
1462
  display: block;
1463
  width: 20px;
@@ -1467,28 +1332,31 @@ span.CodeMirror-selectedtext {
1467
  top: 50%;
1468
  left: -3px;
1469
  transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease; }
1470
- .customize-control-kirki-toggle .switch:before {
1471
  background: rgba(0, 0, 0, 0.2);
1472
  transform: translate3d(0, -50%, 0) scale(0); }
1473
- .customize-control-kirki-toggle .switch:after {
1474
  background: #999;
1475
  border: 1px solid rgba(0, 0, 0, 0.1);
1476
  transform: translate3d(0, -50%, 0); }
1477
- .customize-control-kirki-toggle .switch:active:before {
1478
  transform: translate3d(0, -50%, 0) scale(3); }
1479
- .customize-control-kirki-toggle input:checked + .switch {
1480
  background: rgba(52, 152, 222, 0.3); }
1481
- .customize-control-kirki-toggle input:checked + .switch:before {
1482
  background: rgba(52, 152, 222, 0.075);
1483
  transform: translate3d(100%, -50%, 0) scale(1); }
1484
- .customize-control-kirki-toggle input:checked + .switch:after {
1485
  background: #3498DE;
1486
  transform: translate3d(100%, -50%, 0); }
1487
- .customize-control-kirki-toggle input:checked + .switch:active:before {
1488
  background: rgba(52, 152, 222, 0.075);
1489
  transform: translate3d(100%, -50%, 0) scale(3); }
 
 
 
1490
 
1491
- .customize-control-kirki-typography .wrapper {
1492
  -webkit-box-shadow: inset 0 0 10px 0 rgba(0, 0, 0, 0.1);
1493
  box-shadow: inset 0 0 10px 0 rgba(0, 0, 0, 0.1);
1494
  padding: 10px;
@@ -1496,134 +1364,58 @@ span.CodeMirror-selectedtext {
1496
  display: flex;
1497
  flex-wrap: wrap;
1498
  justify-content: space-between; }
1499
- .customize-control-kirki-typography .wrapper .color,
1500
- .customize-control-kirki-typography .wrapper .font-family,
1501
- .customize-control-kirki-typography .wrapper .font-size,
1502
- .customize-control-kirki-typography .wrapper .letter-spacing,
1503
- .customize-control-kirki-typography .wrapper .line-height,
1504
- .customize-control-kirki-typography .wrapper .subsets,
1505
- .customize-control-kirki-typography .wrapper .text-transform,
1506
- .customize-control-kirki-typography .wrapper .variant {
1507
- width: 100%;
1508
- float: none;
1509
- clear: both; }
1510
- .customize-control-kirki-typography .wrapper .color h5,
1511
- .customize-control-kirki-typography .wrapper .font-family h5,
1512
- .customize-control-kirki-typography .wrapper .font-size h5,
1513
- .customize-control-kirki-typography .wrapper .letter-spacing h5,
1514
- .customize-control-kirki-typography .wrapper .line-height h5,
1515
- .customize-control-kirki-typography .wrapper .subsets h5,
1516
- .customize-control-kirki-typography .wrapper .text-transform h5,
1517
- .customize-control-kirki-typography .wrapper .variant h5 {
1518
- margin: 0.67em 0 0; }
1519
- .customize-control-kirki-typography .wrapper .font-size,
1520
- .customize-control-kirki-typography .wrapper .letter-spacing,
1521
- .customize-control-kirki-typography .wrapper .line-height {
1522
- width: 50%; }
1523
- .customize-control-kirki-typography .wrapper .text-align {
1524
- width: 100%; }
1525
- .customize-control-kirki-typography .wrapper .text-align .dashicons {
1526
- padding: 3px;
1527
- font-size: 25px;
1528
- width: 25px;
1529
- height: 25px;
1530
- border: 1px solid transparent; }
1531
- .customize-control-kirki-typography .wrapper .text-align input {
1532
  display: none; }
1533
- .customize-control-kirki-typography .wrapper .text-align input:checked + label .dashicons {
1534
- border: 1px solid #3498DB;
1535
- color: #000; }
1536
- .customize-control-kirki-typography .wrapper .text-transform {
1537
- padding-top: 10px; }
1538
- .customize-control-kirki-typography .wrapper .color {
1539
- width: auto; }
1540
-
1541
- .hint,
1542
- [data-hint] {
1543
- position: relative;
1544
- display: inline-block; }
1545
- .hint:before, .hint:after,
1546
- [data-hint]:before,
1547
- [data-hint]:after {
1548
- position: absolute;
1549
- -webkit-transform: translate3d(0, 0, 0);
1550
- -moz-transform: translate3d(0, 0, 0);
1551
- transform: translate3d(0, 0, 0);
1552
- visibility: hidden;
1553
- opacity: 0;
1554
- z-index: 998;
1555
- pointer-events: none;
1556
- transition: 0.3s ease;
1557
- transition-delay: 250ms; }
1558
- .hint:hover:before, .hint:hover:after, .hint:focus:before, .hint:focus:after,
1559
- [data-hint]:hover:before,
1560
- [data-hint]:hover:after,
1561
- [data-hint]:focus:before,
1562
- [data-hint]:focus:after {
1563
- visibility: visible;
1564
- opacity: 1; }
1565
- .hint:hover:before, .hint:hover:after,
1566
- [data-hint]:hover:before,
1567
- [data-hint]:hover:after {
1568
- transition-delay: 0; }
1569
- .hint:before,
1570
- [data-hint]:before {
1571
- content: '';
1572
- position: absolute;
1573
- background: transparent;
1574
- border: none;
1575
- z-index: 999;
1576
- width: 0;
1577
- height: 0;
1578
- border-top: 5px solid transparent;
1579
- border-bottom: 5px solid transparent;
1580
- border-left: 5px solid #333;
1581
- left: -5px;
1582
- top: 5px; }
1583
- .hint:after,
1584
- [data-hint]:after {
1585
- content: attr(data-hint);
1586
- background: #333;
1587
- color: white;
1588
- padding: 5px 10px;
1589
- font-size: 12px;
1590
- line-height: 14px;
1591
- height: auto;
1592
- margin-bottom: -14px;
1593
- width: 170px;
1594
- max-width: 170px;
1595
- display: block;
1596
- white-space: normal;
1597
- text-align: right;
1598
- position: relative;
1599
- top: -22px;
1600
- left: -195px; }
1601
-
1602
- li.customize-control {
1603
- position: relative; }
1604
- li.customize-control a.tooltip.hint--left {
1605
- display: block;
1606
- position: absolute;
1607
- top: 5px;
1608
- right: -10px;
1609
  border-radius: 50%;
1610
- color: #999;
1611
- border: none;
1612
- line-height: 8px;
1613
  width: 20px;
1614
  height: 20px;
1615
- z-index: 10; }
1616
-
1617
- .rtl li.customize-control a.tooltip.hint--left {
1618
- right: auto;
1619
- left: 0; }
1620
- .rtl .hint:before,
1621
- .rtl [data-hint]:before {
1622
- left: 20px;
1623
- border-left: none;
1624
- border-right: 5px solid #333; }
1625
- .rtl .hint:after,
1626
- .rtl [data-hint]:after {
1627
- left: 195px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1628
 
1629
  /*# sourceMappingURL=customizer.css.map */
6
  border-color: transparent !important;
7
  border-color: transparent !important; }
8
 
9
+ .hint,
10
+ [data-hint] {
11
+ position: relative;
12
+ display: inline-block; }
13
+ .hint:before, .hint:after,
14
+ [data-hint]:before,
15
+ [data-hint]:after {
16
+ position: absolute;
17
+ -webkit-transform: translate3d(0, 0, 0);
18
+ -moz-transform: translate3d(0, 0, 0);
19
+ transform: translate3d(0, 0, 0);
20
+ visibility: hidden;
21
+ opacity: 0;
22
+ z-index: 998;
23
+ pointer-events: none;
24
+ transition: 0.3s ease;
25
+ transition-delay: 250ms; }
26
+ .hint:hover:before, .hint:hover:after, .hint:focus:before, .hint:focus:after,
27
+ [data-hint]:hover:before,
28
+ [data-hint]:hover:after,
29
+ [data-hint]:focus:before,
30
+ [data-hint]:focus:after {
31
+ visibility: visible;
32
+ opacity: 1; }
33
+ .hint:hover:before, .hint:hover:after,
34
+ [data-hint]:hover:before,
35
+ [data-hint]:hover:after {
36
+ transition-delay: 0; }
37
+ .hint:before,
38
+ [data-hint]:before {
39
+ content: '';
40
+ position: absolute;
41
+ background: transparent;
42
+ border: none;
43
+ z-index: 999;
44
+ width: 0;
45
+ height: 0;
46
+ border-top: 5px solid transparent;
47
+ border-bottom: 5px solid transparent;
48
+ border-left: 5px solid #333;
49
+ left: -5px;
50
+ top: 5px; }
51
+ .hint:after,
52
+ [data-hint]:after {
53
+ content: attr(data-hint);
54
+ background: #333;
55
+ color: white;
56
+ padding: 5px 10px;
57
+ font-size: 12px;
58
+ line-height: 14px;
59
+ height: auto;
60
+ margin-bottom: -14px;
61
+ width: 170px;
62
+ max-width: 170px;
63
+ display: block;
64
+ white-space: normal;
65
+ text-align: right;
66
+ position: relative;
67
+ top: -22px;
68
+ left: -195px; }
69
+
70
+ li.customize-control {
71
+ position: relative; }
72
+ li.customize-control a.tooltip.hint--left {
73
+ display: block;
74
+ position: absolute;
75
+ top: 5px;
76
+ right: -10px;
77
+ border-radius: 50%;
78
+ color: #999;
79
+ border: none;
80
+ line-height: 8px;
81
+ width: 20px;
82
+ height: 20px;
83
+ z-index: 10; }
84
 
85
+ .rtl li.customize-control a.tooltip.hint--left {
86
+ right: auto;
87
+ left: 0; }
88
+ .rtl .hint:before,
89
+ .rtl [data-hint]:before {
90
+ left: 20px;
91
+ border-left: none;
92
+ border-right: 5px solid #333; }
93
+ .rtl .hint:after,
94
+ .rtl [data-hint]:after {
95
+ left: 195px; }
96
+
97
+ customize-control-upload .current .container {
98
+ border: 1px solid rgba(0, 0, 0, 0.05); }
99
+
100
+ #customize-controls .description {
101
  font-style: normal;
102
  font-weight: 300;
103
  font-size: .9em; }
104
+
105
+ .customize-control-color .wp-picker-container,
106
+ .customize-control-color-alpha .wp-picker-container {
107
+ width: 100%; }
108
+ .customize-control-color .wp-picker-container a.wp-color-result,
109
+ .customize-control-color-alpha .wp-picker-container a.wp-color-result {
110
+ width: auto;
111
+ display: block;
112
+ border: none;
113
+ padding-left: 40px; }
114
+ .customize-control-color .wp-picker-container a.wp-color-result:after,
115
+ .customize-control-color-alpha .wp-picker-container a.wp-color-result:after {
116
+ background: rgba(0, 0, 0, 0.25);
117
+ color: #fff;
118
+ border: none;
119
+ -webkit-box-shadow: none;
120
+ box-shadow: none; }
121
+ .customize-control-color .wp-picker-container a.wp-color-result:focus:after, .customize-control-color .wp-picker-container a.wp-color-result:hover:after,
122
+ .customize-control-color-alpha .wp-picker-container a.wp-color-result:focus:after,
123
+ .customize-control-color-alpha .wp-picker-container a.wp-color-result:hover:after {
124
+ color: #fff; }
125
+
126
+ input {
127
  font-size: 16px; }
128
+
129
+ input[type="text"] {
 
 
 
130
  border: 1px solid rgba(0, 0, 0, 0.1);
131
  background-image: none;
132
  background-position: 0% 0%;
134
  border-radius: 3px;
135
  padding: .5em; }
136
 
137
+ .customize-control input[type="checkbox"] {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  position: relative;
139
  margin: 0 1rem 0 0;
140
  cursor: pointer;
143
  height: 22px;
144
  border-radius: 3px;
145
  -webkit-border-radius: 3px; }
146
+ .customize-control input[type="checkbox"]:before {
 
 
147
  content: "";
148
  position: absolute;
149
  left: 0;
151
  width: 100%;
152
  height: 100%;
153
  border: none; }
154
+ .customize-control input[type="checkbox"]:after {
 
 
155
  content: "";
156
  position: absolute;
157
  left: 0;
162
  cursor: pointer;
163
  border-radius: 3px;
164
  -webkit-border-radius: 3px; }
165
+ .customize-control input[type="checkbox"]:checked:before {
 
 
166
  content: "\f147";
167
  font-family: dashicons;
168
  font-size: 25px;
169
  left: 0;
170
  top: 2px; }
171
+ .customize-control input[type="checkbox"]:checked:after {
 
 
172
  background: #fff; }
173
 
174
+ /* BASICS */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  .CodeMirror {
176
  /* Set height, width, borders, and global font properties here */
177
  font-family: monospace;
187
  padding: 0 4px;
188
  /* Horizontal padding of content */ }
189
 
190
+ .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
 
191
  background-color: white;
192
  /* The little square between H and V scrollbars */ }
193
 
267
  .cm-positive {
268
  color: #292; }
269
 
270
+ .cm-header, .cm-strong {
 
271
  font-weight: bold; }
272
 
273
  .cm-em {
380
  /* The fake, visible scrollbars. Used to force redraw during scrolling
381
  before actuall scrolling happens, thus preventing shaking and
382
  flickering artifacts. */
383
+ .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
 
 
 
384
  position: absolute;
385
  z-index: 6;
386
  display: none; }
488
  outline: none; }
489
 
490
  /* Force content-box sizing for the elements where we expect it */
491
+ .CodeMirror-scroll,
492
+ .CodeMirror-sizer,
493
  .CodeMirror-gutter,
494
  .CodeMirror-gutters,
495
+ .CodeMirror-linenumber {
 
 
496
  -moz-box-sizing: content-box;
497
  box-sizing: content-box; }
498
 
529
  .CodeMirror-crosshair {
530
  cursor: crosshair; }
531
 
532
+ .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection {
 
 
533
  background: #d7d4f0; }
534
 
535
+ .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection {
 
 
536
  background: #d7d4f0; }
537
 
538
  .cm-searching {
545
 
546
  /* Used to force a border model for a node */
547
  .cm-force-border {
548
+ padding-right: .1px; }
549
 
550
  @media print {
551
  /* Hide the cursor when printing */
559
  span.CodeMirror-selectedtext {
560
  background: none; }
561
 
562
+ .customize-control-color .kirki-alpha-container {
563
+ box-sizing: padding-box;
564
+ display: none;
565
+ border: 1px solid #dfdfdf;
566
+ border-top: none;
567
+ background: #fff;
568
+ padding: 0 11px 6px; }
569
+ .customize-control-color .kirki-alpha-container .transparency {
570
+ height: 24px;
571
+ width: 100%;
572
+ background-color: #fff;
573
+ background-image: url("transparency-grid.png");
574
+ background-size: cover;
575
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.4) inset;
576
+ -webkit-border-radius: 3px;
577
+ -moz-border-radius: 3px;
578
+ border-radius: 3px;
579
+ padding: 0; }
580
+ .customize-control-color .kirki-alpha-container .ui-slider-handle {
581
+ color: #777;
582
+ background-color: #fff;
583
+ text-shadow: 0 1px 0 #fff;
584
+ text-decoration: none;
585
+ position: absolute;
586
+ z-index: 2;
587
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
588
+ border: 1px solid #aaa;
589
+ -webkit-border-radius: 4px;
590
+ -moz-border-radius: 4px;
591
+ border-radius: 4px;
592
+ opacity: 0.9;
593
+ margin-top: -2px;
594
+ height: 20px;
595
+ cursor: ew-resize;
596
+ font-size: 12px;
597
+ padding: 3px; }
598
+ .customize-control-color .kirki-alpha-container .ui-slider {
599
+ position: relative;
600
+ text-align: center;
601
+ width: 88%; }
602
+ .customize-control-color .wp-picker-container a.wp-picker-open ~ div.kirki-alpha-container {
603
+ display: block; }
604
+ .customize-control-color .customize-control-alphacolor .wp-picker-container .iris-picker {
605
+ border-bottom: none; }
606
+ .customize-control-color .wp-picker-container {
607
  width: 100%; }
608
+ .customize-control-color .wp-picker-container .wp-picker-holder {
609
+ width: calc(100% - 2px); }
610
+ .customize-control-color .wp-picker-container .iris-picker {
611
+ width: 100% !important;
612
+ height: 195px !important;
613
+ padding-bottom: 10px !important; }
614
+ .customize-control-color .wp-picker-container .iris-picker .iris-picker-inner {
615
+ left: 35px;
616
+ height: 190px; }
617
+ .customize-control-color .wp-picker-container .iris-picker .iris-picker-inner .iris-square {
618
+ width: calc(100% - 35px) !important;
619
+ margin-right: 2%; }
620
+ .customize-control-color .wp-picker-container .iris-picker .iris-picker-inner .iris-slider.iris-strip {
621
+ height: 185px !important;
622
+ width: 28px !important; }
623
+ .customize-control-color .iris-palette-container {
624
+ width: 20px;
625
+ left: 8px;
626
+ top: 10px;
627
+ text-align: center; }
628
+ .customize-control-color .iris-palette-container a {
629
+ display: inline-block;
630
+ margin-left: 0 !important;
631
+ margin-bottom: 3px;
632
+ border: 1px solid rgba(0, 0, 0, 0.06);
633
+ border-radius: 0;
634
+ box-shadow: none;
635
+ width: 18px !important;
636
+ height: 18px !important; }
637
 
638
+ .customize-control-color-alpha .kirki-alpha-container {
639
+ box-sizing: padding-box;
640
+ display: none;
641
+ border: 1px solid #dfdfdf;
642
+ border-top: none;
643
  background: #fff;
644
+ padding: 0 11px 6px; }
645
+ .customize-control-color-alpha .wp-picker-container a.wp-picker-open ~ div.kirki-alpha-container {
646
+ display: block; }
647
+ .customize-control-color-alpha .customize-control-alphacolor .wp-picker-container .iris-picker {
648
+ border-bottom: none; }
649
+ .customize-control-color-alpha .wp-picker-container {
650
+ width: 100%; }
651
+ .customize-control-color-alpha .wp-picker-container .wp-picker-holder {
652
+ width: calc(100% - 2px); }
653
+ .customize-control-color-alpha .wp-picker-container .iris-picker {
654
+ width: 100% !important;
655
+ height: 195px !important;
656
+ padding-bottom: 10px !important; }
657
+ .customize-control-color-alpha .wp-picker-container .iris-picker .iris-picker-inner {
658
+ left: 35px;
659
+ height: 190px; }
660
+ .customize-control-color-alpha .wp-picker-container .iris-picker .iris-picker-inner .iris-square {
661
+ width: calc(100% - 50px) !important;
662
+ margin-right: 2%; }
663
+ .customize-control-color-alpha .wp-picker-container .iris-picker .iris-picker-inner .iris-slider.iris-strip {
664
+ height: 185px !important;
665
+ width: 14px !important; }
666
+ .customize-control-color-alpha .wp-picker-container .iris-picker .iris-picker-inner .iris-slider.iris-strip.iris-alpha-slider {
667
+ margin-left: 7px !important; }
668
+ .customize-control-color-alpha .iris-palette-container {
669
+ width: 20px;
670
+ left: 8px;
671
+ top: 10px;
672
+ text-align: center; }
673
+ .customize-control-color-alpha .iris-palette-container a {
674
+ display: inline-block;
675
+ margin-left: 0 !important;
676
+ margin-bottom: 3px;
677
+ border: 1px solid rgba(0, 0, 0, 0.06);
678
+ border-radius: 0;
679
+ box-shadow: none;
680
+ width: 18px !important;
681
+ height: 18px !important; }
682
+
683
+ .customize-control-dimension input[type="number"] {
684
+ width: 68%;
 
 
 
 
685
  display: inline-block;
686
+ height: 35px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
687
  position: relative;
688
+ top: -12px; }
689
+ .customize-control-dimension .selectize-control {
690
+ width: 30%;
691
  display: inline-block; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
 
693
+ .customize-control-number .ui-spinner.ui-widget-content {
694
  position: relative; }
695
+ .customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button {
696
  position: absolute;
697
  right: 0;
698
  color: rgba(0, 0, 0, 0.3);
707
  background: transparent;
708
  background: none;
709
  margin: 0; }
710
+ .customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button .ui-button-text {
711
  display: none; }
712
+ .customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before, .customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before {
713
  font-family: dashicons;
714
  position: absolute;
715
  left: 0; }
716
+ .customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up {
717
  top: -50%; }
718
+ .customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before {
719
  content: "\f343"; }
720
+ .customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down {
721
  top: 50%; }
722
+ .customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before {
723
  content: "\f347"; }
724
+ .customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button:hover {
725
  color: rgba(0, 0, 0, 0.7); }
726
 
727
+ .customize-control-palette input[type="radio"] {
728
  display: none; }
729
+ .customize-control-palette input[type="radio"]:checked + label {
730
  border: 3px solid rgba(0, 0, 0, 0.4); }
731
+ .customize-control-palette label {
732
  background: none;
733
  padding: 0;
734
  border-top: 3px solid transparent;
735
  border-bottom: 3px solid transparent;
736
  margin-bottom: 5px;
737
  display: flex; }
738
+ .customize-control-palette label span {
739
  padding: 10px 0;
740
  flex-grow: 1;
741
  font-size: 0;
748
  transition: all 200ms ease-in-out;
749
  border-top: 1px solid rgba(0, 0, 0, 0.1);
750
  border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
751
+ .customize-control-palette label span:first-child {
752
  border-left: 1px solid rgba(0, 0, 0, 0.1); }
753
+ .customize-control-palette label span:last-child {
754
  border-right: 1px solid rgba(0, 0, 0, 0.1); }
755
+ .customize-control-palette label span:hover {
756
  padding: 10px;
757
  flex-grow: 3;
758
  min-width: 60px;
773
  .customize-control-kirki-radio label .option-description {
774
  display: block;
775
  color: rgba(0, 0, 0, 0.35);
776
+ font-size: .9em;
777
  padding-left: 25px; }
778
 
779
+ .customize-control-radio-buttonset .buttonset .switch-label {
780
+ background: rgba(0, 0, 0, 0.17);
781
+ color: #fff;
782
  border-right: 1px solid rgba(0, 0, 0, 0.2);
783
  padding: 4px 7px;
784
  margin: 0;
785
  font-size: 12px; }
786
+ .customize-control-radio-buttonset .buttonset .switch-label:last-child {
787
  border-right: none; }
788
+ .customize-control-radio-buttonset .buttonset .switch-input {
789
  display: none; }
790
+ .customize-control-radio-buttonset .buttonset .switch-input:checked + .switch-label {
791
+ background-color: #3498DB; }
 
792
 
793
+ .customize-control-radio-image input {
 
 
 
794
  display: none; }
795
+ .customize-control-radio-image input img {
796
  border: 1px solid transparent; }
797
+ .customize-control-radio-image input:checked + label img {
798
  -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
799
  box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
800
  border: 1px solid #3498DB; }
 
 
 
 
 
 
 
 
801
 
802
  .customize-control-repeater .repeater-fields .repeater-row {
803
+ padding: .5rem;
804
  border: 1px solid #999;
805
+ margin-top: .5rem;
806
  background: #eee;
807
+ position: relative;
808
+ padding-top: 48px; }
 
 
 
 
 
 
809
  .customize-control-repeater .repeater-fields .repeater-row label {
810
  margin-bottom: 12px;
811
  clear: both; }
 
 
 
 
 
 
 
 
 
 
 
 
 
812
  .customize-control-repeater button.repeater-add {
813
  margin-top: 1rem; }
 
 
814
  .customize-control-repeater .repeater-field {
815
  margin-bottom: 12px;
816
  width: 100%;
817
  clear: both;
818
  padding-bottom: 12px;
819
  border-bottom: 1px dotted #CCC; }
820
+ .customize-control-repeater .repeater-row .repeater-field:last-child {
821
+ border-bottom: none;
822
+ padding-bottom: 0; }
 
 
 
 
 
 
 
823
  .customize-control-repeater .repeater-field-select select {
824
  margin-left: 0; }
825
  .customize-control-repeater .repeater-field-checkbox label {
832
  resize: vertical; }
833
  .customize-control-repeater .repeater-row-header {
834
  background: white;
835
+ position: absolute;
836
+ top: 0;
837
+ left: 0;
838
+ right: 0;
839
+ height: 36px;
840
+ color: #555;
841
+ border-bottom: 1px solid #999;
842
+ line-height: 36px;
843
+ font-size: 15px; }
844
+ .customize-control-repeater .repeater-row-number {
845
+ border-right: 1px solid #ddd;
846
+ display: inline-block;
847
+ width: 35px;
848
+ text-align: center; }
849
+ .customize-control-repeater .repeater-row-remove,
850
+ .customize-control-repeater .repeater-row-move,
851
+ .customize-control-repeater .repeater-row-minimize {
852
+ display: inline-block;
853
+ float: right;
854
+ border-left: 1px solid #ddd;
855
+ width: 35px;
856
+ height: 36px;
857
+ text-align: center; }
858
+ .customize-control-repeater .repeater-row-remove:hover,
859
+ .customize-control-repeater .repeater-row-move:hover,
860
+ .customize-control-repeater .repeater-row-minimize:hover {
861
+ background: #ddd;
862
+ cursor: pointer; }
863
+ .customize-control-repeater .repeater-row-move:hover {
864
+ cursor: move; }
865
+ .customize-control-repeater .repeater-remove,
866
+ .customize-control-repeater .repeater-move,
867
  .customize-control-repeater .repeater-minimize {
868
  line-height: 36px; }
869
+ .customize-control-repeater .repeater-row.minimized {
870
+ padding: 0;
871
+ height: 36px;
872
+ overflow: hidden; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
873
 
874
  .selectize-control {
875
  position: relative; }
933
  text-decoration: none;
934
  vertical-align: middle;
935
  display: inline-block;
936
+ padding: 2px 0 0 0;
937
  border-left: 1px solid #d0d0d0;
938
  -webkit-border-radius: 0 2px 2px 0;
939
  -moz-border-radius: 0 2px 2px 0;
969
  background: #ffffff;
970
  border: 0 solid #ffffff; }
971
  .selectize-dropdown {
972
+ position: absolute;
 
973
  z-index: 10;
974
  border: 1px solid #d0d0d0;
975
  background: #ffffff;
976
+ margin: -1px 0 0 0;
977
  border-top: 0 none;
978
  -webkit-box-sizing: border-box;
979
  -moz-box-sizing: border-box;
1022
  font-size: 13px;
1023
  line-height: 18px;
1024
  -webkit-font-smoothing: inherit; }
1025
+ .selectize-input, .selectize-control.single .selectize-input.input-active {
1026
  background: #ffffff;
1027
  cursor: text;
1028
  display: inline-block; }
1029
  .selectize-input {
1030
  border: 1px solid rgba(0, 0, 0, 0.1);
1031
+ padding: 8px 8px;
1032
  display: inline-block;
1033
  width: 100%;
1034
  overflow: hidden;
1096
  -webkit-border-radius: 1px;
1097
  -moz-border-radius: 1px;
1098
  border-radius: 1px; }
1099
+ .selectize-dropdown [data-selectable],
1100
+ .selectize-dropdown .optgroup-header {
1101
  padding: 5px 8px; }
1102
  .selectize-dropdown .optgroup:first-child .optgroup-header {
1103
  border-top: 0 none; }
1117
  overflow-x: hidden;
1118
  max-height: 200px; }
1119
 
1120
+ .customize-control-slider input[type=range] {
1121
  -webkit-appearance: none;
1122
+ -webkit-transition: background .3s;
1123
+ -moz-transition: background .3s;
1124
+ transition: background .3s;
1125
  background-color: rgba(0, 0, 0, 0.1);
1126
  height: 5px;
1127
  width: calc(100% - 70px);
1128
  padding: 0; }
1129
+ .customize-control-slider input[type=range]:focus {
1130
  box-shadow: none;
1131
  outline: none; }
1132
+ .customize-control-slider input[type=range]:hover {
1133
  background-color: rgba(0, 0, 0, 0.25); }
1134
+ .customize-control-slider input[type=range]::-webkit-slider-thumb {
1135
  -webkit-appearance: none;
1136
  width: 15px;
1137
  height: 15px;
1138
  border-radius: 50%;
1139
  -webkit-border-radius: 50%;
1140
  background-color: #3498D9; }
1141
+ .customize-control-slider input[type=range]::-webkit-slider-thumb {
1142
  -webkit-appearance: none;
1143
  width: 15px;
1144
  height: 15px;
1145
  border: none;
1146
  border-radius: 50%;
1147
  background-color: #3498D9; }
1148
+ .customize-control-slider input[type=range]::-moz-range-thumb {
1149
  width: 15px;
1150
  height: 15px;
1151
  border: none;
1152
  border-radius: 50%;
1153
  background-color: #3498D9; }
1154
+ .customize-control-slider input[type=range]::-ms-thumb {
1155
  width: 15px;
1156
  height: 15px;
1157
  border-radius: 50%;
1158
  border: 0;
1159
  background-color: #3498D9; }
1160
+ .customize-control-slider input[type=range]::-moz-range-track {
1161
  border: inherit;
1162
  background: transparent; }
1163
+ .customize-control-slider input[type=range]::-ms-track {
1164
  border: inherit;
1165
  color: transparent;
1166
  background: transparent; }
1167
+ .customize-control-slider input[type=range]::-ms-fill-lower, .customize-control-slider input[type=range]::-ms-fill-upper {
1168
  background: transparent; }
1169
+ .customize-control-slider input[type=range]::-ms-tooltip {
1170
  display: none; }
1171
+ .customize-control-slider .kirki_range_value {
1172
  display: inline-block;
1173
  font-size: 14px;
1174
  padding: 0 5px;
1175
  font-weight: 400;
1176
  position: relative;
1177
  top: 2px; }
1178
+ .customize-control-slider .kirki-slider-reset {
1179
  color: rgba(0, 0, 0, 0.2);
1180
  float: right;
1181
+ -webkit-transition: color .5s ease-in;
1182
+ -moz-transition: color .5s ease-in;
1183
+ -ms-transition: color .5s ease-in;
1184
+ -o-transition: color .5s ease-in;
1185
+ transition: color .5s ease-in; }
1186
+ .customize-control-slider .kirki-slider-reset span {
1187
  font-size: 16px;
1188
  line-height: 22px; }
1189
+ .customize-control-slider .kirki-slider-reset:hover {
1190
  color: red; }
1191
 
1192
+ .customize-control-sortable ul.ui-sortable li {
1193
  padding: 5px 10px;
1194
  border: 1px solid #333;
1195
  background: #fff; }
1196
+ .customize-control-sortable ul.ui-sortable li .dashicons.dashicons-menu {
1197
  float: right; }
1198
+ .customize-control-sortable ul.ui-sortable li .dashicons.visibility {
1199
  margin-right: 10px; }
1200
+ .customize-control-sortable ul.ui-sortable li.invisible {
1201
  color: #aaa;
1202
  border: 1px dashed #aaa; }
1203
+ .customize-control-sortable ul.ui-sortable li.invisible .dashicons.visibility {
1204
  color: #aaa; }
1205
 
1206
+ .customize-control-spacing .wrapper {
1207
  -webkit-box-shadow: inset 0 0 5px 2px rgba(0, 0, 0, 0.1);
1208
  box-shadow: inset 0 0 5px 2px rgba(0, 0, 0, 0.1);
1209
  width: 96%;
1210
  padding: 3%; }
1211
+ .customize-control-spacing .wrapper .control {
1212
  display: flex;
1213
  flex-wrap: wrap;
1214
  justify-content: space-between; }
1215
+ .customize-control-spacing .wrapper .control > div {
1216
  width: 48%; }
1217
+ .customize-control-spacing .wrapper .control > div h5 {
1218
+ margin: 10px 0 7px 0; }
1219
+ .customize-control-spacing .wrapper .control > div .inner {
1220
  display: flex; }
1221
+ .customize-control-spacing .wrapper .control > div .inner input[type="number"] {
1222
  width: 50%;
1223
  height: 36px; }
1224
+ .customize-control-spacing .wrapper .control > div .inner .selectize-control.single {
1225
  width: 50%; }
1226
+ .customize-control-spacing .wrapper .control > div .inner .selectize-control.single > .selectize-input {
1227
  height: 36px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1228
 
1229
+ .customize-control-switch input[type="checkbox"] {
1230
  display: none; }
1231
+ .customize-control-switch .switch {
1232
  border: none;
1233
  margin-bottom: 1.5rem;
1234
  outline: 0;
1238
  -moz-user-select: none;
1239
  -ms-user-select: none;
1240
  user-select: none; }
1241
+ .customize-control-switch .switch label {
1242
  background: rgba(0, 0, 0, 0.2);
1243
  color: transparent;
1244
  cursor: pointer;
1245
  display: block;
1246
  margin-bottom: 1rem;
1247
  position: relative;
1248
+ text-indent: 100%;
1249
  transition: left 0.15s ease-out;
1250
  height: 2rem;
1251
+ width: 4rem; }
1252
+ .customize-control-switch .switch label:after {
 
1253
  background: #FFFFFF;
1254
  content: "";
1255
  display: block;
1256
  height: 1.5rem;
1257
+ left: .25rem;
1258
  position: absolute;
1259
+ top: .25rem;
1260
  width: 1.5rem;
1261
+ -webkit-transition: left 0.15s ease-out;
1262
+ -moz-transition: left 0.15s ease-out;
1263
+ -o-transition: translate3d(0, 0, 0);
1264
+ transition: left 0.15s ease-out;
1265
+ -webkit-transform: translate3d(0, 0, 0);
1266
+ -moz-transform: translate3d(0, 0, 0);
1267
+ -ms-transform: translate3d(0, 0, 0);
1268
+ -o-transform: translate3d(0, 0, 0);
1269
+ transform: translate3d(0, 0, 0); }
1270
+ .customize-control-switch .switch input {
1271
  left: 10px;
1272
  opacity: 0;
1273
  padding: 0;
1274
  position: absolute;
1275
  top: 9px; }
1276
+ .customize-control-switch .switch input + label {
1277
  margin-left: 0;
1278
  margin-right: 0; }
1279
+ .customize-control-switch .switch input:checked + label {
1280
  background: #3498DB; }
1281
+ .customize-control-switch .switch input:checked + label:after {
1282
  left: 2.25rem;
1283
  background: #ffffff; }
1284
+ .customize-control-switch .switch.round {
1285
  border-radius: 1000px; }
1286
+ .customize-control-switch .switch.round label {
1287
  border-radius: 2rem; }
1288
+ .customize-control-switch .switch.round label:after {
1289
  border-radius: 2rem; }
1290
+ .customize-control-switch .switch-on {
1291
+ position: absolute;
1292
+ left: -55px;
1293
+ top: 8px;
1294
+ color: white;
1295
  font-weight: bold;
1296
+ font-size: 9px; }
1297
+ .customize-control-switch .switch-off {
1298
+ position: absolute;
1299
+ left: -25px;
1300
+ top: 8px;
1301
+ color: white;
1302
+ font-weight: bold;
1303
+ font-size: 9px; }
1304
 
1305
+ .customize-control-kirki-textarea textarea {
1306
  width: 100%;
1307
  border: 1px solid rgba(0, 0, 0, 0.1);
1308
  -webkit-box-shadow: none;
1309
  box-shadow: none; }
1310
 
1311
+ .customize-control-toggle input[type="checkbox"] {
 
 
 
 
 
 
 
1312
  display: none; }
1313
+ .customize-control-toggle .switch {
1314
  border: 1px solid rgba(0, 0, 0, 0.1);
1315
  display: inline-block;
1316
  width: 35px;
1322
  cursor: pointer;
1323
  user-select: none;
1324
  transition: background 350ms ease; }
1325
+ .customize-control-toggle .switch:before, .customize-control-toggle .switch:after {
1326
  content: "";
1327
  display: block;
1328
  width: 20px;
1332
  top: 50%;
1333
  left: -3px;
1334
  transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease; }
1335
+ .customize-control-toggle .switch:before {
1336
  background: rgba(0, 0, 0, 0.2);
1337
  transform: translate3d(0, -50%, 0) scale(0); }
1338
+ .customize-control-toggle .switch:after {
1339
  background: #999;
1340
  border: 1px solid rgba(0, 0, 0, 0.1);
1341
  transform: translate3d(0, -50%, 0); }
1342
+ .customize-control-toggle .switch:active:before {
1343
  transform: translate3d(0, -50%, 0) scale(3); }
1344
+ .customize-control-toggle input:checked + .switch {
1345
  background: rgba(52, 152, 222, 0.3); }
1346
+ .customize-control-toggle input:checked + .switch:before {
1347
  background: rgba(52, 152, 222, 0.075);
1348
  transform: translate3d(100%, -50%, 0) scale(1); }
1349
+ .customize-control-toggle input:checked + .switch:after {
1350
  background: #3498DE;
1351
  transform: translate3d(100%, -50%, 0); }
1352
+ .customize-control-toggle input:checked + .switch:active:before {
1353
  background: rgba(52, 152, 222, 0.075);
1354
  transform: translate3d(100%, -50%, 0) scale(3); }
1355
+ .customize-control-toggle .customize-control-title {
1356
+ width: calc(100% - 50px);
1357
+ float: left; }
1358
 
1359
+ .customize-control-typography .wrapper {
1360
  -webkit-box-shadow: inset 0 0 10px 0 rgba(0, 0, 0, 0.1);
1361
  box-shadow: inset 0 0 10px 0 rgba(0, 0, 0, 0.1);
1362
  padding: 10px;
1364
  display: flex;
1365
  flex-wrap: wrap;
1366
  justify-content: space-between; }
1367
+ .customize-control-typography .font-style {
1368
+ width: 100%; }
1369
+ .customize-control-typography .font-style .bold,
1370
+ .customize-control-typography .font-style .italic,
1371
+ .customize-control-typography .font-style .underline,
1372
+ .customize-control-typography .font-style .strikethrough {
1373
+ display: inline-block; }
1374
+ .customize-control-typography .font-style input[type="checkbox"] {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1375
  display: none; }
1376
+ .customize-control-typography .font-style input[type="checkbox"]:checked + .dashicons {
1377
+ background: #3498DB;
1378
+ color: #fff; }
1379
+ .customize-control-typography .font-style .dashicons {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1380
  border-radius: 50%;
1381
+ padding: 10px;
 
 
1382
  width: 20px;
1383
  height: 20px;
1384
+ line-height: 20px;
1385
+ color: #777; }
1386
+ .customize-control-typography .font-family {
1387
+ width: 100%; }
1388
+ .customize-control-typography .font-size,
1389
+ .customize-control-typography .font-weight,
1390
+ .customize-control-typography .line-height,
1391
+ .customize-control-typography .letter-spacing {
1392
+ width: 48%; }
1393
+ .customize-control-typography .font-size h5,
1394
+ .customize-control-typography .font-weight h5,
1395
+ .customize-control-typography .line-height h5,
1396
+ .customize-control-typography .letter-spacing h5 {
1397
+ width: 100%;
1398
+ margin: 10px 0 7px 0; }
1399
+ .customize-control-typography .font-size,
1400
+ .customize-control-typography .letter-spacing {
1401
+ display: flex;
1402
+ flex-wrap: wrap; }
1403
+ .customize-control-typography .font-size input[type="number"],
1404
+ .customize-control-typography .letter-spacing input[type="number"] {
1405
+ width: 50%;
1406
+ height: 36px; }
1407
+ .customize-control-typography .font-size .selectize-control.single,
1408
+ .customize-control-typography .letter-spacing .selectize-control.single {
1409
+ width: 50%; }
1410
+ .customize-control-typography .font-size .selectize-control.single > .selectize-input,
1411
+ .customize-control-typography .letter-spacing .selectize-control.single > .selectize-input {
1412
+ height: 36px; }
1413
+ .customize-control-typography .font-weight .selectize-control.single {
1414
+ width: 100%; }
1415
+ .customize-control-typography .font-weight .selectize-control.single > .selectize-input {
1416
+ height: 36px; }
1417
+ .customize-control-typography .line-height input[type="number"] {
1418
+ width: 100%;
1419
+ height: 36px; }
1420
 
1421
  /*# sourceMappingURL=customizer.css.map */
assets/css/customizer.css.map CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "version": 3,
3
- "mappings": "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",
4
- "sources": ["../scss/global.scss","../scss/panels/expanded.scss","../scss/sections/expanded.scss","../scss/sections/hover.scss","../scss/controls/checkbox.scss","../scss/controls/code.scss","../scss/controls/color.scss","../scss/controls/editor.scss","../scss/controls/multicolor.scss","../scss/controls/color-palette.scss","../scss/controls/date.scss","../scss/controls/dashicons.scss","../scss/controls/dimension.scss","../scss/controls/number.scss","../scss/controls/palette.scss","../scss/controls/radio.scss","../scss/controls/radio-buttonset.scss","../scss/controls/radio-image.scss","../scss/controls/repeater.scss","../scss/controls/select.scss","../scss/controls/slider.scss","../scss/controls/sortable.scss","../scss/controls/spacing.scss","../scss/controls/switch.scss","../scss/controls/generic.scss","../scss/controls/toggle.scss","../scss/controls/typography.scss","../scss/tooltips.scss"],
5
  "names": [],
6
  "file": "customizer.css"
7
  }
1
  {
2
  "version": 3,
3
+ "mappings": "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",
4
+ "sources": ["../scss/global.scss","../scss/controls/checkbox.scss","../scss/controls/code.scss","../scss/controls/color.scss","../scss/controls/color-alpha.scss","../scss/controls/dimension.scss","../scss/controls/number.scss","../scss/controls/palette.scss","../scss/controls/radio.scss","../scss/controls/radio-buttonset.scss","../scss/controls/radio-image.scss","../scss/controls/repeater.scss","../scss/controls/select.scss","../scss/controls/slider.scss","../scss/controls/sortable.scss","../scss/controls/spacing.scss","../scss/controls/switch.scss","../scss/controls/textarea.scss","../scss/controls/toggle.scss","../scss/controls/typography.scss"],
5
  "names": [],
6
  "file": "customizer.css"
7
  }
assets/css/customizer.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #customize-controls #customize-info .accordion-section-title{border-bottom:1px solid rgba(0,0,0,.3)}#customize-controls #customize-theme-controls .accordion-section>.accordion-section-title{border-bottom:1px solid rgba(0,0,0,.1)}#customize-controls #customize-theme-controls .accordion-section>.accordion-section-title:after{border-color:transparent!important}.hint,[data-hint]{position:relative;display:inline-block}.hint:after,.hint:before,[data-hint]:after,[data-hint]:before{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:998;pointer-events:none;transition:.3s ease;transition-delay:250ms}.hint:focus:after,.hint:focus:before,.hint:hover:after,.hint:hover:before,[data-hint]:focus:after,[data-hint]:focus:before,[data-hint]:hover:after,[data-hint]:hover:before{visibility:visible;opacity:1}.hint:hover:after,.hint:hover:before,[data-hint]:hover:after,[data-hint]:hover:before{transition-delay:0}.hint:before,[data-hint]:before{content:'';position:absolute;background:0 0;border:none;z-index:999;width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #333;left:-5px;top:5px}.hint:after,[data-hint]:after{content:attr(data-hint);background:#333;color:#fff;padding:5px 10px;font-size:12px;line-height:14px;height:auto;margin-bottom:-14px;width:170px;max-width:170px;display:block;white-space:normal;text-align:right;position:relative;top:-22px;left:-195px}li.customize-control{position:relative}li.customize-control a.tooltip.hint--left{display:block;position:absolute;top:5px;right:-10px;border-radius:50%;color:#999;border:none;line-height:8px;width:20px;height:20px;z-index:10}.rtl li.customize-control a.tooltip.hint--left{right:auto;left:0}.rtl .hint:before,.rtl [data-hint]:before{left:20px;border-left:none;border-right:5px solid #333}.rtl .hint:after,.rtl [data-hint]:after{left:195px}customize-control-upload .current .container{border:1px solid rgba(0,0,0,.05)}#customize-controls .description{font-style:normal;font-weight:300;font-size:.9em}.customize-control-color .wp-picker-container,.customize-control-color-alpha .wp-picker-container{width:100%}.customize-control-color .wp-picker-container a.wp-color-result,.customize-control-color-alpha .wp-picker-container a.wp-color-result{width:auto;display:block;border:none;padding-left:40px}.customize-control-color .wp-picker-container a.wp-color-result:after,.customize-control-color-alpha .wp-picker-container a.wp-color-result:after{background:rgba(0,0,0,.25);color:#fff;border:none;-webkit-box-shadow:none;box-shadow:none}.customize-control-color .wp-picker-container a.wp-color-result:focus:after,.customize-control-color .wp-picker-container a.wp-color-result:hover:after,.customize-control-color-alpha .wp-picker-container a.wp-color-result:focus:after,.customize-control-color-alpha .wp-picker-container a.wp-color-result:hover:after{color:#fff}input{font-size:16px}input[type=text]{border:1px solid rgba(0,0,0,.1);background-image:none;background-position:0 0;background-repeat:repeat;border-radius:3px;padding:.5em}.customize-control input[type=checkbox]{position:relative;margin:0 1rem 0 0;cursor:pointer;margin-bottom:5px;width:22px;height:22px;border-radius:3px;-webkit-border-radius:3px}.customize-control input[type=checkbox]:before{content:"";position:absolute;left:0;z-index:1;width:100%;height:100%;border:none}.customize-control input[type=checkbox]:after{content:"";position:absolute;left:0;top:0;width:100%;height:100%;background:#f2f2f2;cursor:pointer;border-radius:3px;-webkit-border-radius:3px}.customize-control input[type=checkbox]:checked:before{content:"\f147";font-family:dashicons;font-size:25px;left:0;top:2px}.customize-control input[type=checkbox]:checked:after{background:#fff}.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-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-invalidchar,.cm-s-default .cm-error{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:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{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}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.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:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-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}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.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)}.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}.customize-control-color .kirki-alpha-container{box-sizing:padding-box;display:none;border:1px solid #dfdfdf;border-top:none;background:#fff;padding:0 11px 6px}.customize-control-color .kirki-alpha-container .transparency{height:24px;width:100%;background-color:#fff;background-image:url(transparency-grid.png);background-size:cover;box-shadow:0 0 5px rgba(0,0,0,.4) inset;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding:0}.customize-control-color .kirki-alpha-container .ui-slider-handle{color:#777;background-color:#fff;text-shadow:0 1px 0 #fff;text-decoration:none;position:absolute;z-index:2;box-shadow:0 1px 2px rgba(0,0,0,.2);border:1px solid #aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:.9;margin-top:-2px;height:20px;cursor:ew-resize;font-size:12px;padding:3px}.customize-control-color .kirki-alpha-container .ui-slider{position:relative;text-align:center;width:88%}.customize-control-color .wp-picker-container a.wp-picker-open~div.kirki-alpha-container{display:block}.customize-control-color .customize-control-alphacolor .wp-picker-container .iris-picker{border-bottom:none}.customize-control-color .wp-picker-container{width:100%}.customize-control-color .wp-picker-container .wp-picker-holder{width:calc(100% - 2px)}.customize-control-color .wp-picker-container .iris-picker{width:100%!important;height:195px!important;padding-bottom:10px!important}.customize-control-color .wp-picker-container .iris-picker .iris-picker-inner{left:35px;height:190px}.customize-control-color .wp-picker-container .iris-picker .iris-picker-inner .iris-square{width:calc(100% - 35px)!important;margin-right:2%}.customize-control-color .wp-picker-container .iris-picker .iris-picker-inner .iris-slider.iris-strip{height:185px!important;width:28px!important}.customize-control-color .iris-palette-container{width:20px;left:8px;top:10px;text-align:center}.customize-control-color .iris-palette-container a{display:inline-block;margin-left:0!important;margin-bottom:3px;border:1px solid rgba(0,0,0,.06);border-radius:0;box-shadow:none;width:18px!important;height:18px!important}.customize-control-color-alpha .kirki-alpha-container{box-sizing:padding-box;display:none;border:1px solid #dfdfdf;border-top:none;background:#fff;padding:0 11px 6px}.customize-control-color-alpha .wp-picker-container a.wp-picker-open~div.kirki-alpha-container{display:block}.customize-control-color-alpha .customize-control-alphacolor .wp-picker-container .iris-picker{border-bottom:none}.customize-control-color-alpha .wp-picker-container{width:100%}.customize-control-color-alpha .wp-picker-container .wp-picker-holder{width:calc(100% - 2px)}.customize-control-color-alpha .wp-picker-container .iris-picker{width:100%!important;height:195px!important;padding-bottom:10px!important}.customize-control-color-alpha .wp-picker-container .iris-picker .iris-picker-inner{left:35px;height:190px}.customize-control-color-alpha .wp-picker-container .iris-picker .iris-picker-inner .iris-square{width:calc(100% - 50px)!important;margin-right:2%}.customize-control-color-alpha .wp-picker-container .iris-picker .iris-picker-inner .iris-slider.iris-strip{height:185px!important;width:14px!important}.customize-control-color-alpha .wp-picker-container .iris-picker .iris-picker-inner .iris-slider.iris-strip.iris-alpha-slider{margin-left:7px!important}.customize-control-color-alpha .iris-palette-container{width:20px;left:8px;top:10px;text-align:center}.customize-control-color-alpha .iris-palette-container a{display:inline-block;margin-left:0!important;margin-bottom:3px;border:1px solid rgba(0,0,0,.06);border-radius:0;box-shadow:none;width:18px!important;height:18px!important}.customize-control-dimension input[type=number]{width:68%;display:inline-block;height:35px;position:relative;top:-12px}.customize-control-dimension .selectize-control{width:30%;display:inline-block}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button .ui-button-text,.customize-control-palette input[type=radio]{display:none}.customize-control-number .ui-spinner.ui-widget-content{position:relative}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button{position:absolute;right:0;color:rgba(0,0,0,.3);border:none;padding:0 5px;width:20px;height:calc(50% + .5em);border-radius:0;-webkit-border-radius:0;box-shadow:none;-webkit-box-shadow:none;background:0 0;margin:0}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before,.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before{font-family:dashicons;position:absolute;left:0}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up{top:-50%}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before{content:"\f343"}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down{top:50%}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before{content:"\f347"}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button:hover{color:rgba(0,0,0,.7)}.customize-control-palette input[type=radio]:checked+label{border:3px solid rgba(0,0,0,.4)}.customize-control-palette label{background:0 0;padding:0;border-top:3px solid transparent;border-bottom:3px solid transparent;margin-bottom:5px;display:flex}.customize-control-palette label span{padding:10px 0;flex-grow:1;font-size:0;line-height:10px;color:transparent;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1)}.customize-control-palette label span:first-child{border-left:1px solid rgba(0,0,0,.1)}.customize-control-palette label span:last-child{border-right:1px solid rgba(0,0,0,.1)}.customize-control-palette label span:hover{padding:10px;flex-grow:3;min-width:60px;font-size:10px;line-height:10px;color:#000}.customize-control-kirki-radio input[type=radio]{width:18px;height:18px}.customize-control-kirki-radio input[type=radio]:checked:before{width:10px;height:10px;margin:3px}.customize-control-kirki-radio label{display:list-item;margin-bottom:7px}.customize-control-kirki-radio label .option-description{display:block;color:rgba(0,0,0,.35);font-size:.9em;padding-left:25px}.customize-control-radio-buttonset .buttonset .switch-input,.customize-control-radio-image input{display:none}.customize-control-radio-buttonset .buttonset .switch-label{background:rgba(0,0,0,.17);color:#fff;border-right:1px solid rgba(0,0,0,.2);padding:4px 7px;margin:0;font-size:12px}.customize-control-radio-buttonset .buttonset .switch-label:last-child{border-right:none}.customize-control-radio-buttonset .buttonset .switch-input:checked+.switch-label{background-color:#3498DB}.customize-control-radio-image input img{border:1px solid transparent}.customize-control-radio-image input:checked+label img{-webkit-box-shadow:0 0 5px 2px rgba(0,0,0,.25);box-shadow:0 0 5px 2px rgba(0,0,0,.25);border:1px solid #3498DB}.customize-control-repeater .repeater-fields .repeater-row{padding:.5rem;border:1px solid #999;margin-top:.5rem;background:#eee;position:relative;padding-top:48px}.customize-control-repeater .repeater-fields .repeater-row label{margin-bottom:12px;clear:both}.customize-control-repeater button.repeater-add{margin-top:1rem}.customize-control-repeater .repeater-field{margin-bottom:12px;width:100%;clear:both;padding-bottom:12px;border-bottom:1px dotted #CCC}.customize-control-repeater .repeater-row .repeater-field:last-child{border-bottom:none;padding-bottom:0}.customize-control-repeater .repeater-field-select select{margin-left:0}.customize-control-repeater .repeater-field-checkbox label{line-height:28px}.customize-control-repeater .repeater-field-checkbox input{line-height:28px;margin-right:5px}.customize-control-repeater .repeater-field-textarea textarea{width:100%;resize:vertical}.customize-control-repeater .repeater-row-header{background:#fff;position:absolute;top:0;left:0;right:0;height:36px;color:#555;border-bottom:1px solid #999;line-height:36px;font-size:15px}.customize-control-repeater .repeater-row-number{border-right:1px solid #ddd;display:inline-block;width:35px;text-align:center}.customize-control-repeater .repeater-row-minimize,.customize-control-repeater .repeater-row-move,.customize-control-repeater .repeater-row-remove{display:inline-block;float:right;border-left:1px solid #ddd;width:35px;height:36px;text-align:center}.customize-control-repeater .repeater-row-minimize:hover,.customize-control-repeater .repeater-row-move:hover,.customize-control-repeater .repeater-row-remove:hover{background:#ddd;cursor:pointer}.customize-control-repeater .repeater-row-move:hover{cursor:move}.customize-control-repeater .repeater-minimize,.customize-control-repeater .repeater-move,.customize-control-repeater .repeater-remove{line-height:36px}.customize-control-repeater .repeater-row.minimized{padding:0;height:36px;overflow:hidden}.selectize-control{position:relative}.selectize-control.single .selectize-input,.selectize-control.single .selectize-input input{cursor:pointer}.selectize-control.single .selectize-input.input-active,.selectize-control.single .selectize-input.input-active input{cursor:text}.selectize-control.single .selectize-input:after{content:"\f347";display:block;position:absolute;top:0;right:0;margin-top:0;width:12px;height:36px;font-family:dashicons;border-left:1px solid rgba(0,0,0,.06);line-height:36px;padding:0 3px}.selectize-control.single .selectize-input.dropdown-active:after{content:"\f343";border-left:1px solid rgba(0,0,0,.1)}.selectize-control.single .selectize-input.disabled{opacity:.5;background-color:#fafafa}.selectize-control.single.rtl .selectize-input:after{left:15px;right:auto}.selectize-control.rtl .selectize-input>input{margin:0 4px 0 -2px!important}.selectize-control .plugin-drag_drop.multi>.selectize-input>div.ui-sortable-placeholder{visibility:visible!important;background:#f2f2f2!important;background:rgba(0,0,0,.06)!important;border:0!important;-webkit-box-shadow:inset 0 0 12px 4px #fff;box-shadow:inset 0 0 12px 4px #fff}.selectize-control .plugin-drag_drop .ui-sortable-placeholder::after{content:'!';visibility:hidden}.selectize-control .plugin-drag_drop .ui-sortable-helper{-webkit-box-shadow:0 2px 5px rgba(0,0,0,.2);box-shadow:0 2px 5px rgba(0,0,0,.2)}.selectize-control .plugin-remove_button [data-value]{position:relative;padding-right:24px!important}.selectize-control .plugin-remove_button [data-value] .remove{z-index:1;position:absolute;top:0;right:0;bottom:0;width:17px;text-align:center;font-weight:700;font-size:12px;color:inherit;text-decoration:none;vertical-align:middle;display:inline-block;padding:2px 0 0;border-left:1px solid #d0d0d0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-control .plugin-remove_button .remove:hover{background:rgba(0,0,0,.05)}.selectize-control .plugin-remove_button.active .remove{border-left-color:#cacaca}.selectize-control .plugin .disabled [data-value] .remove:hover{background:0 0}.selectize-control .plugin .disabled [data-value] .remove{border-left-color:#fff}.selectize-control.multi .selectize-input{min-height:36px}.selectize-control.multi .selectize-input.has-items{padding:6px 8px 3px}.selectize-control.multi .selectize-input>div{cursor:pointer;margin:0 3px 3px 0;padding:2px 6px;background:#f2f2f2;color:#303030;border:0 solid #d0d0d0}.selectize-control.multi .selectize-input>div.active{background:#e8e8e8;color:#303030;border:0 solid #cacaca}.selectize-control.multi .selectize-input.disabled>div,.selectize-control.multi .selectize-input.disabled>div.active{color:#7d7d7d;background:#fff;border:0 solid #fff}.selectize-dropdown{position:absolute;border:1px solid #d0d0d0;background:#fff;margin:-1px 0 0;border-top:0 none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1);-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;z-index:999}.selectize-dropdown-header{position:relative;padding:5px 8px;border-bottom:1px solid #d0d0d0;background:#f8f8f8;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-dropdown-header-close{position:absolute;right:8px;top:50%;color:#303030;opacity:.4;margin-top:-12px;line-height:20px;font-size:20px!important}.selectize-dropdown-header-close:hover{color:#000}.selectize-dropdown.plugin-optgroup_columns .optgroup{border-right:1px solid #f2f2f2;border-top:0 none;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child{border-right:0 none}.selectize-dropdown.plugin-optgroup_columns .optgroup:before{display:none}.selectize-dropdown.plugin-optgroup_columns .optgroup-header{border-top:0 none}.selectize-dropdown,.selectize-input,.selectize-input input{color:#303030;font-family:inherit;font-size:13px;line-height:18px;-webkit-font-smoothing:inherit}.selectize-control.single .selectize-input.input-active,.selectize-input{background:#fff;cursor:text;display:inline-block}.selectize-input{border:1px solid rgba(0,0,0,.1);padding:8px;display:inline-block;width:100%;overflow:hidden;position:relative;z-index:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.selectize-input.full{background-color:#fff}.selectize-input.disabled,.selectize-input.disabled *{cursor:default!important}.selectize-input.focus{-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.15);box-shadow:inset 0 1px 2px rgba(0,0,0,.15)}.selectize-input.dropdown-active{-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-input>*{vertical-align:baseline;display:-moz-inline-stack;display:inline-block;zoom:1}.selectize-input>input{display:inline-block!important;padding:0!important;min-height:0!important;max-height:none!important;max-width:100%!important;margin:0 2px 0 0!important;text-indent:0!important;border:0!important;background:0 0!important;line-height:inherit!important;-webkit-user-select:auto!important;-webkit-box-shadow:none!important;box-shadow:none!important}.selectize-input>input::-ms-clear{display:none}.selectize-input>input:focus{outline:0!important}.selectize-input::after{content:' ';display:block;clear:left}.selectize-input.dropdown-active::before{content:' ';display:block;position:absolute;background:#f0f0f0;height:1px;bottom:0;left:0;right:0}.selectize-dropdown [data-selectable]{cursor:pointer;overflow:hidden}.selectize-dropdown [data-selectable] .highlight{background:rgba(125,168,208,.2);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.selectize-dropdown .optgroup-header,.selectize-dropdown [data-selectable]{padding:5px 8px}.selectize-dropdown .optgroup:first-child .optgroup-header{border-top:0 none}.selectize-dropdown .optgroup-header{color:#303030;background:#fff;cursor:default}.selectize-dropdown .active{background-color:#f5fafd;color:#495c68}.selectize-dropdown .active.create{color:#495c68}.selectize-dropdown .create{color:rgba(48,48,48,.5)}.selectize-dropdown-content{overflow-y:auto;overflow-x:hidden;max-height:200px}.customize-control-slider input[type=range]{-webkit-appearance:none;-webkit-transition:background .3s;-moz-transition:background .3s;transition:background .3s;background-color:rgba(0,0,0,.1);height:5px;width:calc(100% - 70px);padding:0}.customize-control-slider input[type=range]:focus{box-shadow:none;outline:0}.customize-control-slider input[type=range]:hover{background-color:rgba(0,0,0,.25)}.customize-control-slider input[type=range]::-webkit-slider-thumb{-webkit-border-radius:50%;-webkit-appearance:none;width:15px;height:15px;border:none;border-radius:50%;background-color:#3498D9}.customize-control-slider input[type=range]::-moz-range-thumb{width:15px;height:15px;border:none;border-radius:50%;background-color:#3498D9}.customize-control-slider input[type=range]::-ms-thumb{width:15px;height:15px;border-radius:50%;border:0;background-color:#3498D9}.customize-control-slider input[type=range]::-moz-range-track{border:inherit;background:0 0}.customize-control-slider input[type=range]::-ms-track{border:inherit;color:transparent;background:0 0}.customize-control-slider input[type=range]::-ms-fill-lower,.customize-control-slider input[type=range]::-ms-fill-upper{background:0 0}.customize-control-slider input[type=range]::-ms-tooltip{display:none}.customize-control-slider .kirki_range_value{display:inline-block;font-size:14px;padding:0 5px;font-weight:400;position:relative;top:2px}.customize-control-slider .kirki-slider-reset{color:rgba(0,0,0,.2);float:right;-webkit-transition:color .5s ease-in;-moz-transition:color .5s ease-in;-ms-transition:color .5s ease-in;-o-transition:color .5s ease-in;transition:color .5s ease-in}.customize-control-slider .kirki-slider-reset span{font-size:16px;line-height:22px}.customize-control-slider .kirki-slider-reset:hover{color:red}.customize-control-sortable ul.ui-sortable li{padding:5px 10px;border:1px solid #333;background:#fff}.customize-control-sortable ul.ui-sortable li .dashicons.dashicons-menu{float:right}.customize-control-sortable ul.ui-sortable li .dashicons.visibility{margin-right:10px}.customize-control-sortable ul.ui-sortable li.invisible{color:#aaa;border:1px dashed #aaa}.customize-control-sortable ul.ui-sortable li.invisible .dashicons.visibility{color:#aaa}.customize-control-spacing .wrapper{-webkit-box-shadow:inset 0 0 5px 2px rgba(0,0,0,.1);box-shadow:inset 0 0 5px 2px rgba(0,0,0,.1);width:96%;padding:3%}.customize-control-spacing .wrapper .control{display:flex;flex-wrap:wrap;justify-content:space-between}.customize-control-spacing .wrapper .control>div{width:48%}.customize-control-spacing .wrapper .control>div h5{margin:10px 0 7px}.customize-control-spacing .wrapper .control>div .inner{display:flex}.customize-control-spacing .wrapper .control>div .inner input[type=number]{width:50%;height:36px}.customize-control-spacing .wrapper .control>div .inner .selectize-control.single{width:50%}.customize-control-spacing .wrapper .control>div .inner .selectize-control.single>.selectize-input{height:36px}.customize-control-switch input[type=checkbox]{display:none}.customize-control-switch .switch{border:none;margin-bottom:1.5rem;outline:0;padding:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.customize-control-switch .switch label{background:rgba(0,0,0,.2);color:transparent;cursor:pointer;display:block;margin-bottom:1rem;position:relative;text-indent:100%;transition:left .15s ease-out;height:2rem;width:4rem}.customize-control-switch .switch label:after{background:#FFF;content:"";display:block;height:1.5rem;left:.25rem;position:absolute;top:.25rem;width:1.5rem;-webkit-transition:left .15s ease-out;-moz-transition:left .15s ease-out;-o-transition:translate3d(0,0,0);transition:left .15s ease-out;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.customize-control-switch .switch input{left:10px;opacity:0;padding:0;position:absolute;top:9px}.customize-control-switch .switch input+label{margin-left:0;margin-right:0}.customize-control-switch .switch input:checked+label{background:#3498DB}.customize-control-switch .switch input:checked+label:after{left:2.25rem;background:#fff}.customize-control-switch .switch.round{border-radius:1000px}.customize-control-switch .switch.round label,.customize-control-switch .switch.round label:after{border-radius:2rem}.customize-control-switch .switch-on{position:absolute;left:-55px;top:8px;color:#fff;font-weight:700;font-size:9px}.customize-control-switch .switch-off{position:absolute;left:-25px;top:8px;color:#fff;font-weight:700;font-size:9px}.customize-control-kirki-textarea textarea{width:100%;border:1px solid rgba(0,0,0,.1);-webkit-box-shadow:none;box-shadow:none}.customize-control-toggle input[type=checkbox]{display:none}.customize-control-toggle .switch{border:1px solid rgba(0,0,0,.1);display:inline-block;width:35px;height:12px;border-radius:8px;background:#ccc;vertical-align:middle;position:relative;cursor:pointer;user-select:none;transition:background 350ms ease}.customize-control-toggle .switch:after,.customize-control-toggle .switch:before{content:"";display:block;width:20px;height:20px;border-radius:50%;position:absolute;top:50%;left:-3px;transition:all 350ms cubic-bezier(0,.95,.38,.98),background 150ms ease}.customize-control-toggle .switch:before{background:rgba(0,0,0,.2);transform:translate3d(0,-50%,0) scale(0)}.customize-control-toggle .switch:after{background:#999;border:1px solid rgba(0,0,0,.1);transform:translate3d(0,-50%,0)}.customize-control-toggle .switch:active:before{transform:translate3d(0,-50%,0) scale(3)}.customize-control-toggle input:checked+.switch{background:rgba(52,152,222,.3)}.customize-control-toggle input:checked+.switch:before{background:rgba(52,152,222,.075);transform:translate3d(100%,-50%,0) scale(1)}.customize-control-toggle input:checked+.switch:after{background:#3498DE;transform:translate3d(100%,-50%,0)}.customize-control-toggle input:checked+.switch:active:before{background:rgba(52,152,222,.075);transform:translate3d(100%,-50%,0) scale(3)}.customize-control-toggle .customize-control-title{width:calc(100% - 50px);float:left}.customize-control-typography .wrapper{-webkit-box-shadow:inset 0 0 10px 0 rgba(0,0,0,.1);box-shadow:inset 0 0 10px 0 rgba(0,0,0,.1);padding:10px;border-radius:3px;display:flex;flex-wrap:wrap;justify-content:space-between}.customize-control-typography .font-style{width:100%}.customize-control-typography .font-style .bold,.customize-control-typography .font-style .italic,.customize-control-typography .font-style .strikethrough,.customize-control-typography .font-style .underline{display:inline-block}.customize-control-typography .font-style input[type=checkbox]{display:none}.customize-control-typography .font-style input[type=checkbox]:checked+.dashicons{background:#3498DB;color:#fff}.customize-control-typography .font-style .dashicons{border-radius:50%;padding:10px;width:20px;height:20px;line-height:20px;color:#777}.customize-control-typography .font-family{width:100%}.customize-control-typography .font-size,.customize-control-typography .font-weight,.customize-control-typography .letter-spacing,.customize-control-typography .line-height{width:48%}.customize-control-typography .font-size h5,.customize-control-typography .font-weight h5,.customize-control-typography .letter-spacing h5,.customize-control-typography .line-height h5{width:100%;margin:10px 0 7px}.customize-control-typography .font-size,.customize-control-typography .letter-spacing{display:flex;flex-wrap:wrap}.customize-control-typography .font-size input[type=number],.customize-control-typography .letter-spacing input[type=number]{width:50%;height:36px}.customize-control-typography .font-size .selectize-control.single,.customize-control-typography .letter-spacing .selectize-control.single{width:50%}.customize-control-typography .font-size .selectize-control.single>.selectize-input,.customize-control-typography .letter-spacing .selectize-control.single>.selectize-input{height:36px}.customize-control-typography .font-weight .selectize-control.single{width:100%}.customize-control-typography .font-weight .selectize-control.single>.selectize-input{height:36px}.customize-control-typography .line-height input[type=number]{width:100%;height:36px}
assets/css/transparency-grid.png CHANGED
File without changes
assets/images/jquery.fs.stepper-arrows.png CHANGED
File without changes
assets/images/kirki-bottom.png DELETED
Binary file
assets/images/kirki-bottom.svg DELETED
@@ -1,91 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
9
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
10
- width="71.497665"
11
- height="23.886881"
12
- version="1.1"
13
- xml:space="preserve"
14
- style="clip-rule:evenodd;fill-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1"
15
- id="svg2"
16
- inkscape:version="0.91 r13725"
17
- sodipodi:docname="kirki-bottom.svg"><metadata
18
- id="metadata56"><rdf:RDF><cc:Work
19
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
20
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
21
- id="defs54" /><sodipodi:namedview
22
- pagecolor="#ffffff"
23
- bordercolor="#666666"
24
- borderopacity="1"
25
- objecttolerance="10"
26
- gridtolerance="10"
27
- guidetolerance="10"
28
- inkscape:pageopacity="0"
29
- inkscape:pageshadow="2"
30
- inkscape:window-width="1871"
31
- inkscape:window-height="1056"
32
- id="namedview52"
33
- showgrid="false"
34
- fit-margin-top="0"
35
- fit-margin-left="0"
36
- fit-margin-right="0"
37
- fit-margin-bottom="0"
38
- inkscape:zoom="4.6669048"
39
- inkscape:cx="-1.0852472"
40
- inkscape:cy="-7.0625365"
41
- inkscape:window-x="49"
42
- inkscape:window-y="24"
43
- inkscape:window-maximized="1"
44
- inkscape:current-layer="svg2" /><g
45
- id="g4242"
46
- transform="translate(-3.71284,-0.18012)"
47
- inkscape:export-xdpi="94"
48
- inkscape:export-ydpi="94"><path
49
- inkscape:export-ydpi="94.19397"
50
- inkscape:export-xdpi="94.19397"
51
- inkscape:connector-curvature="0"
52
- id="path46"
53
- style="fill:none;stroke:#000000;stroke-width:0.2;stroke-miterlimit:1;stroke-dasharray:none"
54
- d="m 10.4064,22.5387 -0.3276,0 0,1.4283 -1.65866,0 -0.31673,-2.9188 C 5.488,18.886 3.81284,15.6275 3.81284,12.0084 c 0,-2.71119 0.9401,-5.22001 2.5246,-7.23473 L 6.0704,2.31269 l 2.90602,0 C 10.8759,1.02464 13.1284,0.28012 15.5411,0.28012 c 2.4127,0 4.6652,0.74452 6.5647,2.03257 l 2.8545,0 -0.2609,2.40411 c 1.6102,2.01928 2.57,4.55213 2.57,7.2916 0,3.6568 -1.7103,6.9454 -4.3471,9.0859 l -0.3117,2.8727 -1.6586,0 0,-1.4283 -0.2761,0 c -1.5432,0.7637 -3.2923,1.1979 -5.1348,1.1979 -1.8425,0 -3.5916,-0.4342 -5.1347,-1.1979 z" /><g
55
- inkscape:export-ydpi="94.19397"
56
- inkscape:export-xdpi="94.19397"
57
- style="stroke-width:0.2;stroke-miterlimit:1;stroke-dasharray:none"
58
- id="g48"><path
59
- d="m 15.4462,11.8498 c 3.4224,0 6.1968,2.104 6.1968,4.6994 0,2.5955 -2.7744,4.6995 -6.1968,4.6995 -3.4224,0 -6.19678,-2.104 -6.19678,-4.6995 0,-2.5954 2.77438,-4.6994 6.19678,-4.6994 z m -1.9811,2.9947 c 0.5725,0 1.0366,0.8148 1.0366,1.8199 0,1.0051 -0.4641,1.8199 -1.0366,1.8199 -0.5725,0 -1.0366,-0.8148 -1.0366,-1.8199 0,-1.0051 0.4641,-1.8199 1.0366,-1.8199 z m 4.0544,0 c 0.5726,0 1.0367,0.8148 1.0367,1.8199 0,1.0051 -0.4641,1.8199 -1.0367,1.8199 -0.5725,0 -1.0366,-0.8148 -1.0366,-1.8199 0,-1.0051 0.4641,-1.8199 1.0366,-1.8199 z"
60
- style="fill:none;stroke:#000000;stroke-width:0.2;stroke-miterlimit:1;stroke-dasharray:none"
61
- id="path50"
62
- inkscape:connector-curvature="0" /></g></g><g
63
- id="g20"
64
- style="fill:#000000;fill-opacity:0.20408164"
65
- inkscape:export-xdpi="94.19397"
66
- inkscape:export-ydpi="94.19397"
67
- transform="matrix(0.34650485,0,0,0.34650485,30.267064,8.7780735)"><text
68
- xml:space="preserve"
69
- style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:40px;line-height:125%;font-family:Roboto;-inkscape-font-specification:'Roboto Light';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:0.20408164;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
70
- x="-7.2853427"
71
- y="42.141983"
72
- id="text4234"
73
- sodipodi:linespacing="125%"><tspan
74
- sodipodi:role="line"
75
- id="tspan4236"
76
- x="-7.2853427"
77
- y="42.141983">toolkit</tspan></text>
78
- </g><text
79
- xml:space="preserve"
80
- style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:15.76700211px;line-height:125%;font-family:'Roboto Slab';-inkscape-font-specification:'Roboto Slab Bold';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:0.10204079;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
81
- x="27.568701"
82
- y="11.573637"
83
- id="text4238"
84
- sodipodi:linespacing="125%"
85
- inkscape:export-xdpi="94"
86
- inkscape:export-ydpi="94"><tspan
87
- sodipodi:role="line"
88
- id="tspan4240"
89
- x="27.568701"
90
- y="11.573637">KIRKI</tspan></text>
91
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/images/kirki-logo.svg DELETED
@@ -1,48 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
9
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
10
- width="50"
11
- height="50"
12
- version="1.1"
13
- xml:space="preserve"
14
- style="clip-rule:evenodd;fill-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1"
15
- id="svg4136"
16
- inkscape:version="0.91 r13725"
17
- sodipodi:docname="kirki-logo.svg"><metadata
18
- id="metadata4190"><rdf:RDF><cc:Work
19
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
20
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
21
- id="defs4188" /><sodipodi:namedview
22
- pagecolor="#ffffff"
23
- bordercolor="#666666"
24
- borderopacity="1"
25
- objecttolerance="10"
26
- gridtolerance="10"
27
- guidetolerance="10"
28
- inkscape:pageopacity="0"
29
- inkscape:pageshadow="2"
30
- inkscape:window-width="1871"
31
- inkscape:window-height="1056"
32
- id="namedview4186"
33
- showgrid="false"
34
- fit-margin-top="0"
35
- fit-margin-left="0"
36
- fit-margin-right="0"
37
- fit-margin-bottom="0"
38
- inkscape:zoom="15.188889"
39
- inkscape:cx="41.22716"
40
- inkscape:cy="11.507"
41
- inkscape:window-x="49"
42
- inkscape:window-y="24"
43
- inkscape:window-maximized="1"
44
- inkscape:current-layer="svg4136" /><path
45
- id="path4184"
46
- style="fill:none;stroke:#000000;stroke-width:0.16830143px"
47
- d="m 24.80031,24.424072 c 7.199936,0 13.036629,4.426328 13.036629,9.886447 0,5.46033 -5.836693,9.886658 -13.036629,9.886658 -7.199935,0 -13.036587,-4.426328 -13.036587,-9.886658 0,-5.460119 5.836652,-9.886447 13.036587,-9.886447 z m -4.167774,6.300154 c 1.204407,0 2.180766,1.71415 2.180766,3.828647 0,2.114498 -0.976359,3.828648 -2.180766,3.828648 -1.204407,0 -2.180766,-1.71415 -2.180766,-3.828648 0,-2.114497 0.976359,-3.828647 2.180766,-3.828647 z m 8.529516,0 c 1.204618,0 2.180977,1.71415 2.180977,3.828647 0,2.114498 -0.976359,3.828648 -2.180977,3.828648 -1.204407,0 -2.180765,-1.71415 -2.180765,-3.828648 0,-2.114497 0.976358,-3.828647 2.180765,-3.828647 z m -14.964311,16.186812 -0.689195,0 0,3.004811 -3.489435,0 -0.6663266,-6.140478 C 3.8505687,39.226604 0.32642086,32.371476 0.32642086,24.75773 c 0,-5.703715 1.97775214,-10.98169 5.31117244,-15.2201932 l -0.5617902,-5.177331 6.1135919,0 c 3.996065,-2.709758 8.734802,-4.27605494 13.810563,-4.27605494 5.075761,0 9.814498,1.56629694 13.810605,4.27605494 l 6.005206,0 -0.548873,5.05769 c 3.387487,4.2480962 5.406683,9.5766252 5.406683,15.3398342 0,7.693058 -3.598074,14.61151 -9.145289,19.114625 l -0.655745,6.043494 -3.489309,0 0,-3.004811 -0.58085,0 c -3.246535,1.606647 -6.926236,2.520103 -10.802428,2.520103 -3.876192,0 -7.555893,-0.913456 -10.802217,-2.520103 z"
48
- inkscape:connector-curvature="0" /></svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/images/kirki-toolkit.png CHANGED
File without changes
assets/js/branding.js DELETED
@@ -1,13 +0,0 @@
1
- jQuery( document ).ready( function() {
2
-
3
- 'use strict';
4
-
5
- if ( '' !== kirkiBranding.logoImage ) {
6
- jQuery( 'div#customize-info .preview-notice' ).replaceWith( '<img src="' + kirkiBranding.logoImage + '">' );
7
- }
8
-
9
- if ( '' !== kirkiBranding.description ) {
10
- jQuery( 'div#customize-info > .customize-panel-description' ).replaceWith( '<div class="customize-panel-description">' + kirkiBranding.description + '</div>' );
11
- }
12
-
13
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/controls/checkbox.js CHANGED
@@ -1,24 +1,16 @@
1
- wp.customize.controlConstructor['kirki-checkbox'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
 
4
  ready: function() {
 
5
 
6
- 'use strict';
7
-
8
- var control = this,
9
- value = control.setting._value;
10
 
11
- // Change the value
12
  this.container.on( 'change', 'input', function() {
13
-
14
- // Get the checkbox status
15
- value = ( jQuery( this ).is( ':checked' ) ) ? true : false;
16
-
17
- // Set the value in the WordPress API
18
- control.setting.set( value );
19
-
20
  });
21
-
22
  }
23
-
24
  });
1
+ /**
2
+ * KIRKI CONTROL: CHECKBOX
3
+ */
4
+ wp.customize.controlConstructor['kirki-checkbox'] = wp.customize.Control.extend( {
5
  ready: function() {
6
+ var control = this;
7
 
8
+ // Get the initial value
9
+ var checkbox_value = control.setting._value;
 
 
10
 
 
11
  this.container.on( 'change', 'input', function() {
12
+ checkbox_value = ( jQuery( this ).is( ':checked' ) ) ? true : false;
13
+ control.setting.set( checkbox_value );
 
 
 
 
 
14
  });
 
15
  }
 
16
  });
assets/js/controls/code.js CHANGED
@@ -1,50 +1,30 @@
1
- wp.customize.controlConstructor['kirki-code'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
 
4
  ready: function() {
5
-
6
- 'use strict';
7
-
8
- var control = this,
9
- element = control.container.find( '.kirki-codemirror-editor' ),
10
- language = control.params.choices.language,
11
- openButton = control.container.find( 'a.edit' ),
12
- closeButton = control.container.find( 'a.close' ),
13
- editor;
14
-
15
- // HTML mode requires a small hack because CodeMirror uses 'htmlmixed'.
16
- if ( 'html' === control.params.choices.language ) {
17
- language = { name: 'htmlmixed' };
18
  }
19
 
20
- // When the edit button is clicked, change the textarea class to expanded.
21
- openButton.on( 'click', function() {
22
- element.removeClass( 'collapsed' ).addClass( 'expanded' );
23
- });
 
24
 
25
- // When the close button is clicked, change the textarea class to collapsed.
26
- closeButton.on( 'click', function() {
27
- element.removeClass( 'expanded' ).addClass( 'collapsed' );
28
- });
29
-
30
- editor = CodeMirror.fromTextArea( element[0], {
31
- value: control.setting._value,
32
- mode: language,
33
- lineNumbers: true,
34
- theme: control.params.choices.theme,
35
- height: control.params.choices.height + 'px'
36
- });
37
-
38
- // On change make sure we infor the Customizer API
39
- editor.on( 'change', function() {
40
  control.setting.set( editor.getValue() );
41
  });
42
 
43
- // Hack to refresh the editor when we open a section
44
- element.parents( '.accordion-section' ).on( 'click', function() {
45
  editor.refresh();
46
  });
47
-
48
  }
49
-
50
  });
1
+ /**
2
+ * KIRKI CONTROL: CODE
3
+ */
4
+ wp.customize.controlConstructor['code'] = wp.customize.Control.extend( {
5
  ready: function() {
6
+ var control = this;
7
+ var element = control.container.find( '#kirki-codemirror-editor-' + control.id );
8
+ var editor = CodeMirror.fromTextArea( element[0] );
9
+
10
+ if ( control.params.choices.language == 'html' ) {
11
+ var language = { name: "htmlmixed" };
12
+ } else {
13
+ language = control.params.choices.language;
 
 
 
 
 
14
  }
15
 
16
+ editor.setOption( "value", control.setting._value );
17
+ editor.setOption( "mode", language );
18
+ editor.setOption( "lineNumbers", true );
19
+ editor.setOption( "theme", control.params.choices.theme );
20
+ editor.setOption( "height", control.params.choices.height + 'px' );
21
 
22
+ editor.on('change', function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  control.setting.set( editor.getValue() );
24
  });
25
 
26
+ element.parents('.accordion-section').on('click', function(){
 
27
  editor.refresh();
28
  });
 
29
  }
 
30
  });
assets/js/controls/color-alpha.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * KIRKI CONTROL: COLOR-ALPHA
3
+ */
4
+ wp.customize.controlConstructor['color-alpha'] = wp.customize.Control.extend( {
5
+ ready: function() {
6
+ var control = this;
7
+ var picker = this.container.find( '.kirki-color-control' );
8
+ var new_color = picker.val();
9
+
10
+ picker.wpColorPicker({
11
+ change: function( event, ui ) {
12
+ setTimeout( function(){
13
+ control.setting.set( picker.val() );
14
+ }, 100 );
15
+ },
16
+ });
17
+ }
18
+ });
assets/js/controls/color-palette.js DELETED
@@ -1,17 +0,0 @@
1
- wp.customize.controlConstructor['kirki-color-palette'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
4
- ready: function() {
5
-
6
- 'use strict';
7
-
8
- var control = this;
9
-
10
- // Save the value
11
- this.container.on( 'click', 'input', function() {
12
- control.setting.set( jQuery( this ).val() );
13
- });
14
-
15
- }
16
-
17
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/controls/color.js DELETED
@@ -1,31 +0,0 @@
1
- wp.customize.controlConstructor['kirki-color'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
4
- ready: function() {
5
-
6
- 'use strict';
7
-
8
- var control = this,
9
- picker = this.container.find( '.kirki-color-control' );
10
-
11
- // If we have defined any extra choices, make sure they are passed-on to Iris.
12
- if ( undefined !== control.params.choices ) {
13
- picker.wpColorPicker( control.params.choices );
14
- }
15
-
16
- // Saves our settings to the WP API
17
- picker.wpColorPicker({
18
- change: function( event, ui ) {
19
-
20
- // Small hack: the picker needs a small delay
21
- setTimeout( function() {
22
- control.setting.set( picker.val() );
23
- }, 100 );
24
-
25
- }
26
-
27
- });
28
-
29
- }
30
-
31
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/controls/custom.js DELETED
File without changes
assets/js/controls/dashicons.js DELETED
@@ -1,17 +0,0 @@
1
- wp.customize.controlConstructor['kirki-dashicons'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
4
- ready: function() {
5
-
6
- 'use strict';
7
-
8
- var control = this;
9
-
10
- // Save the value
11
- this.container.on( 'click', 'input', function() {
12
- control.setting.set( jQuery( this ).val() );
13
- });
14
-
15
- }
16
-
17
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/controls/date.js DELETED
@@ -1,21 +0,0 @@
1
- wp.customize.controlConstructor['kirki-date'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
4
- ready: function() {
5
-
6
- 'use strict';
7
-
8
- var control = this,
9
- selector = control.selector + ' input.datepicker';
10
-
11
- // Init the datepicker
12
- jQuery( selector ).datepicker();
13
-
14
- // Save the changes
15
- this.container.on( 'change keyup paste', 'input.datepicker', function() {
16
- control.setting.set( jQuery( this ).val() );
17
- });
18
-
19
- }
20
-
21
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/controls/dimension.js CHANGED
@@ -1,44 +1,21 @@
1
- wp.customize.controlConstructor['kirki-dimension'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
 
4
  ready: function() {
 
 
 
5
 
6
- 'use strict';
7
-
8
- var control = this,
9
- value;
10
-
11
- // Validate the value and show a warning if it's invalid
12
- if ( false === kirkiValidateCSSValue( control.setting._value ) ) {
13
- jQuery( control.selector + ' .input-wrapper' ).addClass( 'invalid' );
14
- } else {
15
- jQuery( control.selector + ' .input-wrapper' ).removeClass( 'invalid' );
16
- }
17
-
18
- // Save the value
19
- this.container.on( 'change keyup paste', 'input', function() {
20
-
21
- value = jQuery( this ).val();
22
-
23
- // Validate the value and show a warning if it's invalid.
24
- // We did this once when initializing the field, but we need to re-evaluate
25
- // every time the value changes.
26
- if ( false === kirkiValidateCSSValue( value ) ) {
27
-
28
- jQuery( control.selector + ' .input-wrapper' ).addClass( 'invalid' );
29
-
30
- } else {
31
-
32
- jQuery( control.selector + ' .input-wrapper' ).removeClass( 'invalid' );
33
-
34
- // Set the value to the customizer.
35
- // We're only saving VALID values.
36
- control.setting.set( value );
37
-
38
- }
39
 
 
 
 
 
 
 
 
40
  });
41
-
42
  }
43
-
44
  });
1
+ /**
2
+ * KIRKI CONTROL: DIMENSION
3
+ */
4
+ wp.customize.controlConstructor['dimension'] = wp.customize.Control.extend( {
5
  ready: function() {
6
+ var control = this;
7
+ var numeric_value = control.container.find('input[type=number]' ).val();
8
+ var units_value = control.container.find('select' ).val();
9
 
10
+ jQuery( '.customize-control-dimension select' ).selectize();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
+ this.container.on( 'change', 'input', function() {
13
+ numeric_value = jQuery( this ).val();
14
+ control.setting.set( numeric_value + units_value );
15
+ });
16
+ this.container.on( 'change', 'select', function() {
17
+ units_value = jQuery( this ).val();
18
+ control.setting.set( numeric_value + units_value );
19
  });
 
20
  }
 
21
  });
assets/js/controls/dropdown-pages.js DELETED
@@ -1,18 +0,0 @@
1
- wp.customize.controlConstructor['kirki-dropdown-pages'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
4
- ready: function() {
5
-
6
- 'use strict';
7
-
8
- var control = this,
9
- element = this.container.find( 'select' );
10
-
11
- jQuery( element ).selectize();
12
- this.container.on( 'change', 'select', function() {
13
- control.setting.set( jQuery( this ).val() );
14
- });
15
-
16
- }
17
-
18
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/controls/editor.js CHANGED
@@ -1,157 +1,38 @@
1
- wp.customize.controlConstructor['kirki-editor'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
4
- ready: function() {
5
-
6
- 'use strict';
7
-
8
- var control = this,
9
- element = control.container.find( 'textarea' ),
10
- toggler = control.container.find( '.toggle-editor' ),
11
- editorWrapper = jQuery( '#kirki_editor_pane' ),
12
- wpEditorArea = jQuery( '#kirki_editor_pane textarea.wp-editor-area' ),
13
- setChange,
14
- content;
15
-
16
- jQuery( window ).load( function() {
17
-
18
- var editor = tinyMCE.get( 'kirki-editor' );
19
-
20
- // Add the button text
21
- toggler.html( window.kirki.l10n[ control.params.kirkiConfig ]['open-editor'] );
22
-
23
- toggler.on( 'click', function() {
24
-
25
- // Toggle the editor.
26
- control.toggleEditor();
27
-
28
- // Change button.
29
- control.changeButton();
30
-
31
- // Add the content to the editor.
32
- control.setEditorContent( editor );
33
-
34
- // Modify the preview-area height.
35
- control.previewHeight();
36
-
37
- });
38
-
39
- // Update the option from the editor contents on change.
40
- if ( editor ) {
41
-
42
- editor.onChange.add( function( ed, e ) {
43
-
44
- ed.save();
45
- content = editor.getContent();
46
- clearTimeout( setChange );
47
- setChange = setTimeout( function() {
48
- element.val( content ).trigger( 'change' );
49
- wp.customize.instance( control.getEditorWrapperSetting() ).set( content );
50
- }, 500 );
51
-
52
  });
53
-
54
- }
55
-
56
- // Handle text mode.
57
- wpEditorArea.on( 'change keyup paste', function() {
58
- wp.customize.instance( control.getEditorWrapperSetting() ).set( jQuery( this ).val() );
59
  });
60
-
61
- });
62
-
63
- },
64
-
65
- /**
66
- * Modify the button text and classes.
67
- */
68
- changeButton: function() {
69
-
70
- 'use strict';
71
-
72
- var control = this,
73
- editorWrapper = jQuery( '#kirki_editor_pane' );
74
-
75
- // Reset all editor buttons.
76
- // Necessary if we have multiple editor fields.
77
- jQuery( '.customize-control-kirki-editor .toggle-editor' ).html( window.kirki.l10n[ control.params.kirkiConfig ]['switch-editor'] );
78
-
79
- // Change the button text & color.
80
- if ( false !== control.getEditorWrapperSetting() ) {
81
- jQuery( '.customize-control-kirki-editor .toggle-editor' ).html( window.kirki.l10n[ control.params.kirkiConfig ]['switch-editor'] );
82
- jQuery( '#customize-control-' + control.getEditorWrapperSetting() + ' .toggle-editor' ).html( window.kirki.l10n[ control.params.kirkiConfig ]['close-editor'] );
83
- } else {
84
- jQuery( '.customize-control-kirki-editor .toggle-editor' ).html( window.kirki.l10n[ control.params.kirkiConfig ]['open-editor'] );
85
- }
86
-
87
- },
88
-
89
- /**
90
- * Toggle the editor.
91
- */
92
- toggleEditor: function() {
93
-
94
- 'use strict';
95
-
96
- var control = this,
97
- editorWrapper = jQuery( '#kirki_editor_pane' );
98
-
99
- if ( ! control.getEditorWrapperSetting() || control.id !== control.getEditorWrapperSetting() ) {
100
- editorWrapper.removeClass();
101
- editorWrapper.addClass( control.id );
102
- } else {
103
- editorWrapper.removeClass();
104
- editorWrapper.addClass( 'hide' );
105
- }
106
-
107
- },
108
-
109
- /**
110
- * Set the content.
111
- */
112
- setEditorContent: function( editor ) {
113
-
114
- 'use strict';
115
-
116
- var control = this,
117
- editorWrapper = jQuery( '#kirki_editor_pane' );
118
-
119
- editor.setContent( control.setting._value );
120
-
121
- },
122
-
123
- /**
124
- * Gets the setting from the editor wrapper class.
125
- */
126
- getEditorWrapperSetting: function() {
127
-
128
- 'use strict';
129
-
130
- if ( jQuery( '#kirki_editor_pane' ).hasClass( 'hide' ) ) {
131
- return false;
132
  }
133
-
134
- if ( jQuery( '#kirki_editor_pane' ).attr( 'class' ) ) {
135
- return jQuery( '#kirki_editor_pane' ).attr( 'class' );
136
- } else {
137
- return false;
138
- }
139
-
140
- },
141
-
142
- /**
143
- * Modifies the height of the preview area.
144
- */
145
- previewHeight: function() {
146
- if ( jQuery( '#kirki_editor_pane' ).hasClass( 'hide' ) ) {
147
- if ( jQuery( '#customize-preview' ).hasClass( 'is-kirki-editor-open' ) ) {
148
- jQuery( '#customize-preview' ).removeClass( 'is-kirki-editor-open' );
149
- }
150
- } else {
151
- if ( ! jQuery( '#customize-preview' ).hasClass( 'is-kirki-editor-open' ) ) {
152
- jQuery( '#customize-preview' ).addClass( 'is-kirki-editor-open' );
153
- }
154
- }
155
- }
156
-
157
- });
1
+ /**
2
+ * KIRKI CONTROL: EDITOR
3
+ */
4
+ ( function( $ ) {
5
+ wp.customizerCtrlEditor = {
6
+ init: function() {
7
+ $( window ).load( function() {
8
+ $( 'textarea.wp-editor-area' ).each( function() {
9
+ var tArea = $( this ),
10
+ id = tArea.attr( 'id' ),
11
+ editor = tinyMCE.get( id ),
12
+ setChange,
13
+ content;
14
+
15
+ if ( editor ) {
16
+ editor.onChange.add( function(ed, e) {
17
+ ed.save();
18
+ content = editor.getContent();
19
+ clearTimeout( setChange );
20
+ setChange = setTimeout( function() {
21
+ tArea.val( content ).trigger( 'change' );
22
+ }, 500 );
23
+ });
24
+ }
25
+
26
+ tArea.css({ visibility: 'visible' }).on('keyup', function() {
27
+ content = tArea.val();
28
+ clearTimeout( setChange );
29
+ setChange = setTimeout( function() {
30
+ content.trigger( 'change' );
31
+ }, 500 );
32
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  });
 
 
 
 
 
 
34
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
+ };
37
+ wp.customizerCtrlEditor.init();
38
+ })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/controls/generic.js DELETED
@@ -1,17 +0,0 @@
1
- wp.customize.controlConstructor['kirki-generic'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing
4
- ready: function() {
5
-
6
- 'use strict';
7
-
8
- var control = this;
9
-
10
- // Save the value
11
- this.container.on( 'change keyup paste', control.params.choices.element, function() {
12
- control.setting.set( jQuery( this ).val() );
13
- });
14
-
15
- }
16
-
17
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/controls/multicheck.js CHANGED
@@ -1,30 +1,22 @@
1
- wp.customize.controlConstructor['kirki-multicheck'] = wp.customize.Control.extend({
2
-
3
- // When we're finished loading continue processing.
 
4
  ready: function() {
5
-
6
- 'use strict';
7
-
8
  var control = this;
9
 
10
- // Save the value
11
  control.container.on( 'change', 'input', function() {
12
- var value = [],
13
- i = 0;
14
-
15
- // Build the value as an object using the sub-values from individual checkboxes.
16
- jQuery.each( control.params.choices, function( key, subValue ) {
17
- if ( control.container.find( 'input[value="' + key + '"]' ).is( ':checked' ) ) {
18
- value[ i ] = key;
19
  i++;
20
  }
21
  });
22
-
23
- // Update the value in the customizer.
24
- control.setting.set( value );
25
-
26
  });
27
-
28
  }
29
-
30
  });
1
+ /**
2
+ * KIRKI CONTROL: MULTICHECK
3
+ */
4
+ wp.customize.controlConstructor['multicheck'] = wp.customize.Control.extend( {
5
  ready: function() {
 
 
 
6
  var control = this;
7
 
8
+ // Modified values
9
  control.container.on( 'change', 'input', function() {
10
+ var compiled_value = [];
11
+ var i = 0;
12
+ jQuery.each( control.params.choices, function( key, value ) {
13
+ if ( jQuery( 'input[value="' + key + '"' ).is( ':checked' ) ) {
14
+ compiled_value[i] = key;
 
 
15
  i++;
16
  }
17
  });
18
+ control.setting.set( compiled_value );
19
+ wp.customize.previewer.refresh();
 
 
20
  });
 
21
  }
 
22
  });
assets/js/controls/multicolor.js DELETED
@@ -1,92 +0,0 @@
1
- wp.customize.controlConstructor['kirki-multicolor'] = wp.customize.Control.extend({
2
-
3
- ready: function() {
4
-
5
- 'use strict';
6
-
7
- var control = this,
8
- colors = control.params.choices,
9
- keys = Object.keys( colors ),
10
- value = this.params.value,
11
- target = control.container.find( '.iris-target' ),
12
- i = 0,
13
- irisInput,
14
- irisPicker;
15
-
16
- // Proxy function that handles changing the individual colors
17
- function kirkiMulticolorChangeHandler( control, value, subSetting ) {
18
-
19
- var picker = control.container.find( '.multicolor-index-' + subSetting );
20
-
21
- // Did we change the value?
22
- picker.wpColorPicker({
23
- target: target[0],
24
- change: function( event, ui ) {
25
-
26
- // Color controls require a small delay
27
- setTimeout( function() {
28
- value[ subSetting ] = picker.val();
29
-
30
- // Set the value
31
- control.setValue( value, false );
32
-
33
- // Trigger the change
34
- control.container.find( '.multicolor-index-' + subSetting ).trigger( 'change' );
35
- }, 100 );
36
-
37
- }
38
-
39
- });
40
-
41
- }
42
-
43
- // The hidden field that keeps the data saved (though we never update it)
44
- this.settingField = this.container.find( '[data-customize-setting-link]' ).first();
45
-
46
- // Colors loop
47
- while ( i < Object.keys( colors ).length ) {
48
-
49
- kirkiMulticolorChangeHandler( this, value, keys[ i ] );
50
-
51
- // Move colorpicker to the 'iris-target' container div
52
- irisInput = control.container.find( '.wp-picker-container .wp-picker-input-wrap' ),
53
- irisPicker = control.container.find( '.wp-picker-container .wp-picker-holder' );
54
- jQuery( irisInput[0] ).detach().appendTo( target[0] );
55
- jQuery( irisPicker[0] ).detach().appendTo( target[0] );
56
-
57
- i++;
58
-
59
- }
60
-
61
- },
62
-
63
- /**
64
- * Set a new value for the setting
65
- *
66
- * @param newValue Object
67
- * @param refresh If we want to refresh the previewer or not
68
- */
69
- setValue: function( value, refresh ) {
70
-
71
- 'use strict';
72
-
73
- var control = this,
74
- newValue = {};
75
-
76
- _.each( value, function( newSubValue, i ) {
77
- newValue[ i ] = newSubValue;
78
- });
79
-
80
- control.setting.set( newValue );
81
-
82
- if ( refresh ) {
83
-
84
- // Trigger the change event on the hidden field so
85
- // previewer refresh the website on Customizer
86
- control.settingField.trigger( 'change' );
87
-
88
- }
89
-
90
- }
91
-
92
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/controls/number.js CHANGED
@@ -1,45 +1,33 @@
1
- wp.customize.controlConstructor['kirki-number'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
 
 
4
 
5
- 'use strict';
6
-
7
- var control = this,
8
- element = this.container.find( 'input' ),
9
- min = -99999,
10
- max = 99999,
11
- step = 1;
12
-
13
- // Set minimum value.
14
- if ( 'undefined' !== typeof control.params.choices && 'undefined' !== typeof control.params.choices.min ) {
15
- min = control.params.choices.min;
16
  }
17
-
18
- // Set maximum value.
19
- if ( 'undefined' !== typeof control.params.choices && 'undefined' !== typeof control.params.choices.max ) {
20
- max = control.params.choices.max;
21
  }
22
-
23
- // Set step value.
24
- if ( 'undefined' !== typeof control.params.choices && 'undefined' !== typeof control.params.choices.step ) {
25
- step = control.params.choices.step;
26
- if ( 'any' === control.params.choices.step ) {
27
- step = '0.001';
28
- }
29
  }
30
-
31
- // Init the spinner
32
- jQuery( element ).spinner({
33
- min: min,
34
- max: max,
35
- step: step
36
- });
37
-
38
  // On change
39
- this.container.on( 'change click keyup paste', 'input', function() {
 
 
 
 
 
 
 
 
40
  control.setting.set( jQuery( this ).val() );
41
  });
42
-
43
  }
44
-
45
  });
1
+ /**
2
+ * KIRKI CONTROL: NUMBER
3
+ */
4
+ wp.customize.controlConstructor['number'] = wp.customize.Control.extend( {
5
  ready: function() {
6
+ var control = this;
7
+ var element = this.container.find( 'input' );
8
 
9
+ jQuery( element ).spinner();
10
+ if ( control.params.choices.min ) {
11
+ jQuery( element ).spinner( 'option', 'min', control.params.choices.min );
 
 
 
 
 
 
 
 
12
  }
13
+ if ( control.params.choices.min ) {
14
+ jQuery( element ).spinner( 'option', 'max', control.params.choices.max );
 
 
15
  }
16
+ if ( control.params.choices.min ) {
17
+ var control_step = ( 'any' == control.params.choises.step ) ? '0.001' : control.params.choices.step;
18
+ jQuery( element ).spinner( 'option', 'step', control_step );
 
 
 
 
19
  }
 
 
 
 
 
 
 
 
20
  // On change
21
+ this.container.on( 'change', 'input', function() {
22
+ control.setting.set( jQuery( this ).val() );
23
+ });
24
+ // On click
25
+ this.container.on( 'click', 'input', function() {
26
+ control.setting.set( jQuery( this ).val() );
27
+ });
28
+ // On keyup
29
+ this.container.on( 'keyup', 'input', function() {
30
  control.setting.set( jQuery( this ).val() );
31
  });
 
32
  }
 
33
  });
assets/js/controls/palette.js CHANGED
@@ -1,16 +1,11 @@
1
- wp.customize.controlConstructor['kirki-palette'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
4
-
5
- 'use strict';
6
-
7
  var control = this;
8
-
9
- // Change the value
10
  this.container.on( 'click', 'input', function() {
11
  control.setting.set( jQuery( this ).val() );
12
  });
13
-
14
  }
15
-
16
  });
1
+ /**
2
+ * KIRKI CONTROL: PALETTE
3
+ */
4
+ wp.customize.controlConstructor['palette'] = wp.customize.Control.extend( {
5
  ready: function() {
 
 
 
6
  var control = this;
 
 
7
  this.container.on( 'click', 'input', function() {
8
  control.setting.set( jQuery( this ).val() );
9
  });
 
10
  }
 
11
  });
assets/js/controls/preset.js CHANGED
@@ -1,37 +1,287 @@
1
- wp.customize.controlConstructor['kirki-preset'] = wp.customize.Control.extend({
 
 
2
 
 
3
  ready: function() {
 
 
4
 
5
- 'use strict';
6
-
7
- var control = this,
8
- element = this.container.find( 'select' ),
9
- selectValue;
10
-
11
- // Init selectize
12
  jQuery( element ).selectize();
13
 
14
- // Trigger a change
15
  this.container.on( 'change', 'select', function() {
16
 
17
- // Get the control's value
18
- selectValue = jQuery( this ).val();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
- // Update the value using the customizer API and trigger the "save" button
21
- control.setting.set( selectValue );
 
 
 
 
22
 
23
- // We have to get the choices of this control
24
- // and then start parsing them to see what we have to do for each of the choices.
25
- jQuery.each( control.params.choices, function( key, value ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
- // If the current value of the control is the key of the choice,
28
- // then we can continue processing, Otherwise there's no reason to do anything.
29
- if ( selectValue === key ) {
30
 
31
- // Each choice has an array of settings defined in it.
32
- // We'll have to loop through them all and apply the changes needed to them.
33
- jQuery.each( value.settings, function( presetSetting, presetSettingValue ) {
34
- kirkiSetSettingValue( presetSetting, presetSettingValue );
35
  });
36
 
37
  }
1
+ /**
2
+ * KIRKI CONTROL: PRESET
3
+ */
4
 
5
+ wp.customize.controlConstructor['preset'] = wp.customize.Control.extend( {
6
  ready: function() {
7
+ var control = this;
8
+ var element = this.container.find( 'select' );
9
 
 
 
 
 
 
 
 
10
  jQuery( element ).selectize();
11
 
 
12
  this.container.on( 'change', 'select', function() {
13
 
14
+ /**
15
+ * First of all we have to get the control's value
16
+ */
17
+ var select_value = jQuery( this ).val();
18
+ /**
19
+ * Update the value using the customizer API and trigger the "save" button
20
+ */
21
+ control.setting.set( select_value );
22
+ /**
23
+ * We have to get the choices of this control
24
+ * and then start parsing them to see what we have to do for each of the choices.
25
+ */
26
+ jQuery.each( control.params.choices, function( key, value ) {
27
+ /**
28
+ * If the current value of the control is the key of the choice,
29
+ * then we can continue processing.
30
+ * Otherwise there's no reason to do anything.
31
+ */
32
+ if ( select_value == key ) {
33
+ /**
34
+ * Each choice has an array of settings defined in it.
35
+ * We'll have to loop through them all and apply the changes needed to them.
36
+ */
37
+ jQuery.each( value['settings'], function( preset_setting, preset_setting_value ) {
38
+ /**
39
+ * Get the control of the sub-setting.
40
+ * This will be used to get properties we need from that control,
41
+ * and determine if we need to do any further work based on those.
42
+ */
43
+ var sub_control = wp.customize.settings.controls[ preset_setting ];
44
+ /**
45
+ * Check if the control we want to affect actually exists.
46
+ * If not then skip the item,
47
+ */
48
+ if ( typeof sub_control === undefined ) {
49
+ return true;
50
+ }
51
 
52
+ /**
53
+ * Get the control-type of this sub-setting.
54
+ * We want the value to live-update on the controls themselves,
55
+ * so depending on the control's type we'll need to do different things.
56
+ */
57
+ var sub_control_type = sub_control['type'];
58
 
59
+ /**
60
+ * Below we're starting to check the control tyype and depending on what that is,
61
+ * make the necessary adjustments to it.
62
+ */
63
+
64
+ /**
65
+ * Control types:
66
+ * checkbox
67
+ * switch
68
+ * toggle
69
+ * kirki-checkbox
70
+ */
71
+ if ( 'checkbox' == sub_control_type || 'switch' == sub_control_type || 'toggle' == sub_control_type || 'kirki-checkbox' == sub_control_type ) {
72
+
73
+ var input_element = wp.customize.control( preset_setting ).container.find( 'input' );
74
+ if ( 1 == preset_setting_value ) {
75
+ /**
76
+ * Update the value visually in the control
77
+ */
78
+ jQuery( input_element ).prop( "checked", true );
79
+ /**
80
+ * Update the value in the customizer object
81
+ */
82
+ wp.customize.instance( preset_setting ).set( true );
83
+ } else {
84
+ /**
85
+ * Update the value visually in the control
86
+ */
87
+ jQuery( input_element ).prop( "checked", false );
88
+ /**
89
+ * Update the value in the customizer object
90
+ */
91
+ wp.customize.instance( preset_setting ).set( false );
92
+ }
93
+
94
+ }
95
+ /**
96
+ * Control types:
97
+ * select
98
+ * select2
99
+ * select2-multiple
100
+ * kirki-select
101
+ */
102
+ else if ( 'select' == sub_control_type || 'select2' == sub_control_type || 'select2-multiple' == sub_control_type || 'kirki-select' == sub_control_type ) {
103
+
104
+ /**
105
+ * Update the value visually in the control
106
+ */
107
+ var input_element = wp.customize.control( preset_setting ).container.find( 'select' );
108
+ var $select = jQuery( input_element ).selectize();
109
+ var selectize = $select[0].selectize;
110
+ selectize.setValue( preset_setting_value, true );
111
+ /**
112
+ * Update the value in the customizer object
113
+ */
114
+ wp.customize.instance( preset_setting ).set( preset_setting_value );
115
+
116
+ }
117
+ /**
118
+ * Control types:
119
+ * slider
120
+ */
121
+ else if ( 'slider' == sub_control_type ) {
122
+
123
+ /**
124
+ * Update the value visually in the control (slider)
125
+ */
126
+ var input_element = wp.customize.control( preset_setting ).container.find( 'input' );
127
+ jQuery( input_element ).prop( "value", preset_setting_value );
128
+ /**
129
+ * Update the value visually in the control (number)
130
+ */
131
+ var numeric_element = wp.customize.control( preset_setting ).container.find( '.kirki_range_value .value' );
132
+ jQuery( numeric_element ).html( preset_setting_value );
133
+ /**
134
+ * Update the value in the customizer object
135
+ */
136
+ wp.customize.instance( preset_setting ).set( preset_setting_value );
137
+
138
+ }
139
+ /**
140
+ * Control types:
141
+ * textarea
142
+ * kirki-textarea
143
+ */
144
+ else if ( 'textarea' == sub_control_type || 'kirki-textarea' == sub_control_type ) {
145
+
146
+ /**
147
+ * Update the value visually in the control
148
+ */
149
+ var input_element = wp.customize.control( preset_setting ).container.find( 'textarea' );
150
+ jQuery( input_element ).prop( "value", preset_setting_value );
151
+ /**
152
+ * Update the value in the customizer object
153
+ */
154
+ wp.customize( preset_setting ).set( preset_setting_value );
155
+
156
+ }
157
+ /**
158
+ * Control types:
159
+ * color
160
+ * kirki-color
161
+ */
162
+ else if ( 'color' == sub_control_type || 'kirki-color' == sub_control_type ) {
163
+
164
+ /**
165
+ * Update the value in the customizer object
166
+ */
167
+ wp.customize.instance( preset_setting ).set( preset_setting_value );
168
+ /**
169
+ * Update the value visually in the control
170
+ */
171
+
172
+ wp.customize.control( preset_setting ).container.find( '.color-picker-hex' )
173
+ .attr( 'data-default-color', preset_setting_value )
174
+ .data( 'default-color', preset_setting_value )
175
+ .wpColorPicker( 'color', preset_setting_value );
176
+
177
+ }
178
+ else if ( 'color-alpha' == sub_control_type ) {
179
+
180
+ /**
181
+ * Update the value visually in the control
182
+ */
183
+ var alphaColorControl = wp.customize.control( preset_setting ).container.find( '.kirki-color-control' );
184
+
185
+ alphaColorControl
186
+ .attr( 'data-default-color', preset_setting_value )
187
+ .data( 'default-color', preset_setting_value )
188
+ .wpColorPicker( 'color', preset_setting_value );
189
+
190
+ /**
191
+ * Update the value in the customizer object
192
+ */
193
+ wp.customize.instance( preset_setting ).set( preset_setting_value );
194
+
195
+ }
196
+ /**
197
+ * Control types:
198
+ * dimension
199
+ */
200
+ else if ( 'dimension' == sub_control_type ) {
201
+
202
+ /**
203
+ * Update the value in the customizer object
204
+ */
205
+ wp.customize.instance( preset_setting ).set( preset_setting_value );
206
+ /**
207
+ * Update the numeric value visually in the control
208
+ */
209
+ var input_element = wp.customize.control( preset_setting ).container.find( 'input[type=number]' );
210
+ var numeric_value = parseFloat( preset_setting_value );
211
+ jQuery( input_element ).prop( "value", numeric_value );
212
+ /**
213
+ * Update the units value visually in the control
214
+ */
215
+ var select_element = wp.customize.control( preset_setting ).container.find( 'select' );
216
+ var units_value = preset_setting_value.replace( parseFloat( preset_setting_value ), '' );
217
+ jQuery( select_element ).prop( "value", units_value );
218
+
219
+ }
220
+ /**
221
+ * Control types:
222
+ * multicheck
223
+ */
224
+ else if ( 'multicheck' == sub_control_type ) {
225
+
226
+ /**
227
+ * Update the value in the customizer object
228
+ */
229
+ wp.customize.instance( preset_setting ).set( preset_setting_value );
230
+ /**
231
+ * Update the value visually in the control.
232
+ * This value is an array so we'll have to go through each one of the items
233
+ * in order to properly apply the value and check each checkbox separately.
234
+ *
235
+ * First we uncheck ALL checkboxes in the control
236
+ * Then we check the ones that we want.
237
+ */
238
+ wp.customize.control( preset_setting ).container.find( 'input' ).each(function() {
239
+ jQuery( this ).prop( "checked", false );
240
+ });
241
+
242
+ for ( index = 0; index < preset_setting_value.length; index++ ) {
243
+ var input_element = wp.customize.control( preset_setting ).container.find( 'input[value="' + preset_setting_value[ index ] + '"]' );
244
+ jQuery( input_element ).prop( "checked", true );
245
+ }
246
+
247
+ }
248
+ /**
249
+ * Control types:
250
+ * radio-buttonset
251
+ * radio-image
252
+ * radio
253
+ * kirki-radio
254
+ */
255
+ else if ( 'radio-buttonset' == sub_control_type || 'radio-image' == sub_control_type || 'radio' == sub_control_type || 'kirki-radio' == sub_control_type ) {
256
+
257
+ /**
258
+ * Update the value visually in the control
259
+ */
260
+ var input_element = wp.customize.control( preset_setting ).container.find( 'input[value="' + preset_setting_value + '"]' );
261
+ jQuery( input_element ).prop( "checked", true );
262
+ /**
263
+ * Update the value in the customizer object
264
+ */
265
+ wp.customize.instance( preset_setting ).set( preset_setting_value );
266
+
267
+ }
268
+ /**
269
+ * Fallback for all other controls.
270
+ */
271
+ else {
272
+
273
+ /**
274
+ * Update the value visually in the control
275
+ */
276
+ var input_element = wp.customize.control( preset_setting ).container.find( 'input' );
277
+ jQuery( input_element ).prop( "value", preset_setting_value );
278
+ /**
279
+ * Update the value in the customizer object
280
+ */
281
+ wp.customize.instance( preset_setting ).set( preset_setting_value );
282
 
283
+ }
 
 
284
 
 
 
 
 
285
  });
286
 
287
  }
assets/js/controls/radio-buttonset.js CHANGED
@@ -1,15 +1,11 @@
1
- wp.customize.controlConstructor['kirki-radio-buttonset'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
4
-
5
- 'use strict';
6
-
7
  var control = this;
8
-
9
- // Change the value
10
  this.container.on( 'click', 'input', function() {
11
  control.setting.set( jQuery( this ).val() );
12
  });
13
  }
14
-
15
  });
1
+ /**
2
+ * KIRKI CONTROL: RADIO-BUTTONSET
3
+ */
4
+ wp.customize.controlConstructor['radio-buttonset'] = wp.customize.Control.extend( {
5
  ready: function() {
 
 
 
6
  var control = this;
 
 
7
  this.container.on( 'click', 'input', function() {
8
  control.setting.set( jQuery( this ).val() );
9
  });
10
  }
 
11
  });
assets/js/controls/radio-image.js CHANGED
@@ -1,16 +1,11 @@
1
- wp.customize.controlConstructor['kirki-radio-image'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
4
-
5
- 'use strict';
6
-
7
  var control = this;
8
-
9
- // Change the value
10
  this.container.on( 'click', 'input', function() {
11
  control.setting.set( jQuery( this ).val() );
12
  });
13
-
14
  }
15
-
16
  });
1
+ /**
2
+ * KIRKI CONTROL: RADIO-IMAGE
3
+ */
4
+ wp.customize.controlConstructor['radio-image'] = wp.customize.Control.extend( {
5
  ready: function() {
 
 
 
6
  var control = this;
 
 
7
  this.container.on( 'click', 'input', function() {
8
  control.setting.set( jQuery( this ).val() );
9
  });
 
10
  }
 
11
  });
assets/js/controls/radio.js CHANGED
@@ -1,16 +1,11 @@
1
- wp.customize.controlConstructor['kirki-radio'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
4
-
5
- 'use strict';
6
-
7
  var control = this;
8
-
9
- // Change the value
10
  this.container.on( 'change', 'input', function() {
11
  control.setting.set( jQuery( this ).val() );
12
  });
13
-
14
  }
15
-
16
  });
1
+ /**
2
+ * KIRKI CONTROL: RADIO
3
+ */
4
+ wp.customize.controlConstructor['kirki-radio'] = wp.customize.Control.extend( {
5
  ready: function() {
 
 
 
6
  var control = this;
 
 
7
  this.container.on( 'change', 'input', function() {
8
  control.setting.set( jQuery( this ).val() );
9
  });
 
10
  }
 
11
  });
assets/js/controls/repeater.js CHANGED
@@ -1,899 +1,361 @@
1
- /*jshint -W065 */
2
- var RepeaterRow = function( rowIndex, container, label ) {
3
-
4
- 'use strict';
5
-
6
- var self = this;
7
-
8
- this.rowIndex = rowIndex;
9
- this.container = container;
10
- this.label = label;
11
- this.header = this.container.find( '.repeater-row-header' ),
12
-
13
- this.header.on( 'click', function() {
14
- self.toggleMinimize();
15
- });
16
-
17
- this.container.on( 'click', '.repeater-row-remove', function() {
18
- self.remove();
19
- });
20
-
21
- this.header.on( 'mousedown', function() {
22
- self.container.trigger( 'row:start-dragging' );
23
- });
24
-
25
- this.container.on( 'keyup change', 'input, select, textarea', function( e ) {
26
- self.container.trigger( 'row:update', [ self.rowIndex, jQuery( e.target ).data( 'field' ), e.target ] );
27
- });
28
-
29
- this.setRowIndex = function( rowIndex ) {
30
- this.rowIndex = rowIndex;
31
- this.container.attr( 'data-row', rowIndex );
32
- this.container.data( 'row', rowIndex );
33
- this.updateLabel();
34
- };
35
-
36
- this.toggleMinimize = function() {
37
-
38
- // Store the previous state.
39
- this.container.toggleClass( 'minimized' );
40
- this.header.find( '.dashicons' ).toggleClass( 'dashicons-arrow-up' ).toggleClass( 'dashicons-arrow-down' );
41
- };
42
-
43
- this.remove = function() {
44
- this.container.slideUp( 300, function() {
45
- jQuery( this ).detach();
46
- });
47
- this.container.trigger( 'row:remove', [ this.rowIndex ] );
48
- };
49
-
50
- this.updateLabel = function() {
51
- var rowLabelField,
52
- rowLabel;
53
-
54
- if ( 'field' === this.label.type ) {
55
- rowLabelField = this.container.find( '.repeater-field [data-field="' + this.label.field + '"]' );
56
- if ( 'function' === typeof rowLabelField.val ) {
57
- rowLabel = rowLabelField.val();
58
- if ( '' !== rowLabel ) {
59
- this.header.find( '.repeater-row-label' ).text( rowLabel );
60
- return;
61
- }
62
- }
63
- }
64
- this.header.find( '.repeater-row-label' ).text( this.label.value + ' ' + ( this.rowIndex + 1 ) );
65
- };
66
-
67
- this.updateLabel();
68
- };
69
-
70
- wp.customize.controlConstructor.repeater = wp.customize.Control.extend({
71
- ready: function() {
72
-
73
- 'use strict';
74
-
75
- var control = this,
76
- limit,
77
- theNewRow;
78
-
79
- // The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function)
80
- var settingValue = this.params.value;
81
-
82
- // The hidden field that keeps the data saved (though we never update it)
83
- this.settingField = this.container.find( '[data-customize-setting-link]' ).first();
84
-
85
- // Set the field value for the first time, we'll fill it up later
86
- this.setValue( [], false );
87
-
88
- // The DIV that holds all the rows
89
- this.repeaterFieldsContainer = this.container.find( '.repeater-fields' ).first();
90
-
91
- // Set number of rows to 0
92
- this.currentIndex = 0;
93
-
94
- // Save the rows objects
95
- this.rows = [];
96
-
97
- // Default limit choice
98
- limit = false;
99
- if ( undefined !== this.params.choices.limit ) {
100
- limit = ( 0 >= this.params.choices.limit ) ? false : parseInt( this.params.choices.limit );
101
- }
102
-
103
- this.container.on( 'click', 'button.repeater-add', function( e ) {
104
- e.preventDefault();
105
- if ( ! limit || control.currentIndex < limit ) {
106
- theNewRow = control.addRow();
107
- theNewRow.toggleMinimize();
108
- control.initColorPicker();
109
- control.initDropdownPages( theNewRow );
110
- } else {
111
- jQuery( control.selector + ' .limit' ).addClass( 'highlight' );
112
- }
113
- });
114
-
115
- this.container.on( 'click', '.repeater-row-remove', function( e ) {
116
- control.currentIndex--;
117
- if ( ! limit || control.currentIndex < limit ) {
118
- jQuery( control.selector + ' .limit' ).removeClass( 'highlight' );
119
- }
120
- });
121
-
122
- this.container.on( 'click keypress', '.repeater-field-image .upload-button,.repeater-field-cropped_image .upload-button,.repeater-field-upload .upload-button', function( e ) {
123
- e.preventDefault();
124
- control.$thisButton = jQuery( this );
125
- control.openFrame( e );
126
- });
127
-
128
- this.container.on( 'click keypress', '.repeater-field-image .remove-button,.repeater-field-cropped_image .remove-button', function( e ) {
129
- e.preventDefault();
130
- control.$thisButton = jQuery( this );
131
- control.removeImage( e );
132
- });
133
-
134
- this.container.on( 'click keypress', '.repeater-field-upload .remove-button', function( e ) {
135
- e.preventDefault();
136
- control.$thisButton = jQuery( this );
137
- control.removeFile( e );
138
- });
139
-
140
- /**
141
- * Function that loads the Mustache template
142
- */
143
- this.repeaterTemplate = _.memoize( function() {
144
- var compiled,
145
- /*
146
- * Underscore's default ERB-style templates are incompatible with PHP
147
- * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.
148
- *
149
- * @see trac ticket #22344.
150
- */
151
- options = {
152
- evaluate: /<#([\s\S]+?)#>/g,
153
- interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
154
- escape: /\{\{([^\}]+?)\}\}(?!\})/g,
155
- variable: 'data'
156
- };
157
-
158
- return function( data ) {
159
- compiled = _.template( control.container.find( '.customize-control-repeater-content' ).first().html(), null, options );
160
- return compiled( data );
161
- };
162
- });
163
-
164
- // When we load the control, the fields have not been filled up
165
- // This is the first time that we create all the rows
166
- if ( settingValue.length ) {
167
- _.each( settingValue, function( subValue ) {
168
- theNewRow = control.addRow( subValue );
169
- control.initColorPicker();
170
- control.initDropdownPages( theNewRow, subValue );
171
- });
172
- }
173
-
174
- // Once we have displayed the rows, we cleanup the values
175
- this.setValue( settingValue, true, true );
176
-
177
- this.repeaterFieldsContainer.sortable({
178
- handle: '.repeater-row-header',
179
- update: function( e, ui ) {
180
- control.sort();
181
- }
182
- });
183
-
184
- },
185
-
186
- /**
187
- * Open the media modal.
188
- */
189
- openFrame: function( event ) {
190
-
191
- 'use strict';
192
-
193
- if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
194
- return;
195
- }
196
-
197
- if ( this.$thisButton.closest( '.repeater-field' ).hasClass( 'repeater-field-cropped_image' ) ) {
198
- this.initCropperFrame();
199
- } else {
200
- this.initFrame();
201
- }
202
-
203
- this.frame.open();
204
- },
205
-
206
- initFrame: function() {
207
-
208
- 'use strict';
209
-
210
- var libMediaType = this.getMimeType();
211
-
212
- this.frame = wp.media({
213
- states: [
214
- new wp.media.controller.Library({
215
- library: wp.media.query({ type: libMediaType }),
216
- multiple: false,
217
- date: false
218
- })
219
- ]
220
- });
221
-
222
- // When a file is selected, run a callback.
223
- this.frame.on( 'select', this.onSelect, this );
224
- },
225
- /**
226
- * Create a media modal select frame, and store it so the instance can be reused when needed.
227
- * This is mostly a copy/paste of Core api.CroppedImageControl in /wp-admin/js/customize-control.js
228
- */
229
- initCropperFrame: function() {
230
-
231
- 'use strict';
232
-
233
- // We get the field id from which this was called
234
- var currentFieldId = this.$thisButton.siblings( 'input.hidden-field' ).attr( 'data-field' ),
235
- attrs = [ 'width', 'height', 'flex_width', 'flex_height' ], // A list of attributes to look for
236
- libMediaType = this.getMimeType();
237
-
238
- // Make sure we got it
239
- if ( 'string' === typeof currentFieldId && '' !== currentFieldId ) {
240
-
241
- // Make fields is defined and only do the hack for cropped_image
242
- if ( 'object' === typeof this.params.fields[ currentFieldId ] && 'cropped_image' === this.params.fields[ currentFieldId ].type ) {
243
-
244
- //Iterate over the list of attributes
245
- attrs.forEach( function( el, index ) {
246
-
247
- // If the attribute exists in the field
248
- if ( 'undefined' !== typeof this.params.fields[ currentFieldId ][ el ] ) {
249
-
250
- // Set the attribute in the main object
251
- this.params[ el ] = this.params.fields[ currentFieldId ][ el ];
252
- }
253
- }.bind( this ) );
254
- }
255
- }
256
-
257
- this.frame = wp.media({
258
- button: {
259
- text: 'Select and Crop',
260
- close: false
261
- },
262
- states: [
263
- new wp.media.controller.Library({
264
- library: wp.media.query({ type: libMediaType }),
265
- multiple: false,
266
- date: false,
267
- suggestedWidth: this.params.width,
268
- suggestedHeight: this.params.height
269
- }),
270
- new wp.media.controller.CustomizeImageCropper({
271
- imgSelectOptions: this.calculateImageSelectOptions,
272
- control: this
273
- })
274
- ]
275
- });
276
-
277
- this.frame.on( 'select', this.onSelectForCrop, this );
278
- this.frame.on( 'cropped', this.onCropped, this );
279
- this.frame.on( 'skippedcrop', this.onSkippedCrop, this );
280
-
281
- },
282
-
283
- onSelect: function() {
284
-
285
- 'use strict';
286
-
287
- var attachment = this.frame.state().get( 'selection' ).first().toJSON();
288
-
289
- if ( this.$thisButton.closest( '.repeater-field' ).hasClass( 'repeater-field-upload' ) ) {
290
- this.setFileInRepeaterField( attachment );
291
- } else {
292
- this.setImageInRepeaterField( attachment );
293
- }
294
- },
295
-
296
- /**
297
- * After an image is selected in the media modal, switch to the cropper
298
- * state if the image isn't the right size.
299
- */
300
-
301
- onSelectForCrop: function() {
302
-
303
- 'use strict';
304
-
305
- var attachment = this.frame.state().get( 'selection' ).first().toJSON();
306
-
307
- if ( this.params.width === attachment.width && this.params.height === attachment.height && ! this.params.flex_width && ! this.params.flex_height ) {
308
- this.setImageInRepeaterField( attachment );
309
- } else {
310
- this.frame.setState( 'cropper' );
311
- }
312
- },
313
-
314
- /**
315
- * After the image has been cropped, apply the cropped image data to the setting.
316
- *
317
- * @param {object} croppedImage Cropped attachment data.
318
- */
319
- onCropped: function( croppedImage ) {
320
-
321
- 'use strict';
322
-
323
- this.setImageInRepeaterField( croppedImage );
324
-
325
- },
326
-
327
- /**
328
- * Returns a set of options, computed from the attached image data and
329
- * control-specific data, to be fed to the imgAreaSelect plugin in
330
- * wp.media.view.Cropper.
331
- *
332
- * @param {wp.media.model.Attachment} attachment
333
- * @param {wp.media.controller.Cropper} controller
334
- * @returns {Object} Options
335
- */
336
- calculateImageSelectOptions: function( attachment, controller ) {
337
-
338
- 'use strict';
339
-
340
- var control = controller.get( 'control' ),
341
- flexWidth = !! parseInt( control.params.flex_width, 10 ),
342
- flexHeight = !! parseInt( control.params.flex_height, 10 ),
343
- realWidth = attachment.get( 'width' ),
344
- realHeight = attachment.get( 'height' ),
345
- xInit = parseInt( control.params.width, 10 ),
346
- yInit = parseInt( control.params.height, 10 ),
347
- ratio = xInit / yInit,
348
- xImg = realWidth,
349
- yImg = realHeight,
350
- x1,
351
- y1,
352
- imgSelectOptions;
353
-
354
- controller.set( 'canSkipCrop', ! control.mustBeCropped( flexWidth, flexHeight, xInit, yInit, realWidth, realHeight ) );
355
-
356
- if ( xImg / yImg > ratio ) {
357
- yInit = yImg;
358
- xInit = yInit * ratio;
359
- } else {
360
- xInit = xImg;
361
- yInit = xInit / ratio;
362
- }
363
-
364
- x1 = ( xImg - xInit ) / 2;
365
- y1 = ( yImg - yInit ) / 2;
366
-
367
- imgSelectOptions = {
368
- handles: true,
369
- keys: true,
370
- instance: true,
371
- persistent: true,
372
- imageWidth: realWidth,
373
- imageHeight: realHeight,
374
- x1: x1,
375
- y1: y1,
376
- x2: xInit + x1,
377
- y2: yInit + y1
378
- };
379
-
380
- if ( false === flexHeight && false === flexWidth ) {
381
- imgSelectOptions.aspectRatio = xInit + ':' + yInit;
382
- }
383
- if ( false === flexHeight ) {
384
- imgSelectOptions.maxHeight = yInit;
385
- }
386
- if ( false === flexWidth ) {
387
- imgSelectOptions.maxWidth = xInit;
388
- }
389
-
390
- return imgSelectOptions;
391
- },
392
-
393
- /**
394
- * Return whether the image must be cropped, based on required dimensions.
395
- *
396
- * @param {bool} flexW
397
- * @param {bool} flexH
398
- * @param {int} dstW
399
- * @param {int} dstH
400
- * @param {int} imgW
401
- * @param {int} imgH
402
- * @return {bool}
403
- */
404
- mustBeCropped: function( flexW, flexH, dstW, dstH, imgW, imgH ) {
405
-
406
- 'use strict';
407
-
408
- if ( true === flexW && true === flexH ) {
409
- return false;
410
- }
411
-
412
- if ( true === flexW && dstH === imgH ) {
413
- return false;
414
- }
415
-
416
- if ( true === flexH && dstW === imgW ) {
417
- return false;
418
- }
419
-
420
- if ( dstW === imgW && dstH === imgH ) {
421
- return false;
422
- }
423
-
424
- if ( imgW <= dstW ) {
425
- return false;
426
- }
427
-
428
- return true;
429
- },
430
-
431
- /**
432
- * If cropping was skipped, apply the image data directly to the setting.
433
- */
434
- onSkippedCrop: function() {
435
-
436
- 'use strict';
437
-
438
- var attachment = this.frame.state().get( 'selection' ).first().toJSON();
439
- this.setImageInRepeaterField( attachment );
440
-
441
- },
442
-
443
- /**
444
- * Updates the setting and re-renders the control UI.
445
- *
446
- * @param {object} attachment
447
- */
448
- setImageInRepeaterField: function( attachment ) {
449
-
450
- 'use strict';
451
-
452
- var $targetDiv = this.$thisButton.closest( '.repeater-field-image,.repeater-field-cropped_image' );
453
-
454
- $targetDiv.find( '.kirki-image-attachment' ).html( '<img src="' + attachment.url + '">' ).hide().slideDown( 'slow' );
455
-
456
- $targetDiv.find( '.hidden-field' ).val( attachment.id );
457
- this.$thisButton.text( this.$thisButton.data( 'alt-label' ) );
458
- $targetDiv.find( '.remove-button' ).show();
459
-
460
- //This will activate the save button
461
- $targetDiv.find( 'input, textarea, select' ).trigger( 'change' );
462
- this.frame.close();
463
-
464
- },
465
-
466
- /**
467
- * Updates the setting and re-renders the control UI.
468
- *
469
- * @param {object} attachment
470
- */
471
- setFileInRepeaterField: function( attachment ) {
472
-
473
- 'use strict';
474
-
475
- var $targetDiv = this.$thisButton.closest( '.repeater-field-upload' );
476
-
477
- $targetDiv.find( '.kirki-file-attachment' ).html( '<span class="file"><span class="dashicons dashicons-media-default"></span> ' + attachment.filename + '</span>' ).hide().slideDown( 'slow' );
478
-
479
- $targetDiv.find( '.hidden-field' ).val( attachment.id );
480
- this.$thisButton.text( this.$thisButton.data( 'alt-label' ) );
481
- $targetDiv.find( '.upload-button' ).show();
482
- $targetDiv.find( '.remove-button' ).show();
483
-
484
- //This will activate the save button
485
- $targetDiv.find( 'input, textarea, select' ).trigger( 'change' );
486
- this.frame.close();
487
-
488
- },
489
-
490
- getMimeType: function() {
491
-
492
- 'use strict';
493
-
494
- // We get the field id from which this was called
495
- var currentFieldId = this.$thisButton.siblings( 'input.hidden-field' ).attr( 'data-field' ),
496
- attrs = [ 'mime_type' ]; // A list of attributes to look for
497
-
498
- // Make sure we got it
499
- if ( 'string' === typeof currentFieldId && '' !== currentFieldId ) {
500
-
501
- // Make fields is defined and only do the hack for cropped_image
502
- if ( 'object' === typeof this.params.fields[ currentFieldId ] && 'upload' === this.params.fields[ currentFieldId ].type ) {
503
-
504
- // If the attribute exists in the field
505
- if ( 'undefined' !== typeof this.params.fields[ currentFieldId ].mime_type ) {
506
-
507
- // Set the attribute in the main object
508
- return this.params.fields[ currentFieldId ].mime_type;
509
- }
510
- }
511
- }
512
-
513
- return 'image';
514
-
515
- },
516
-
517
- removeImage: function( event ) {
518
-
519
- 'use strict';
520
-
521
- var $targetDiv,
522
- $uploadButton;
523
-
524
- if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
525
- return;
526
- }
527
-
528
- $targetDiv = this.$thisButton.closest( '.repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload' );
529
- $uploadButton = $targetDiv.find( '.upload-button' );
530
-
531
- $targetDiv.find( '.kirki-image-attachment' ).slideUp( 'fast', function() {
532
- jQuery( this ).show().html( jQuery( this ).data( 'placeholder' ) );
533
- });
534
- $targetDiv.find( '.hidden-field' ).val( '' );
535
- $uploadButton.text( $uploadButton.data( 'label' ) );
536
- this.$thisButton.hide();
537
-
538
- $targetDiv.find( 'input, textarea, select' ).trigger( 'change' );
539
-
540
- },
541
-
542
- removeFile: function( event ) {
543
-
544
- 'use strict';
545
-
546
- var $targetDiv,
547
- $uploadButton;
548
-
549
- if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
550
- return;
551
- }
552
-
553
- $targetDiv = this.$thisButton.closest( '.repeater-field-upload' );
554
- $uploadButton = $targetDiv.find( '.upload-button' );
555
-
556
- $targetDiv.find( '.kirki-file-attachment' ).slideUp( 'fast', function() {
557
- jQuery( this ).show().html( jQuery( this ).data( 'placeholder' ) );
558
- });
559
- $targetDiv.find( '.hidden-field' ).val( '' );
560
- $uploadButton.text( $uploadButton.data( 'label' ) );
561
- this.$thisButton.hide();
562
-
563
- $targetDiv.find( 'input, textarea, select' ).trigger( 'change' );
564
-
565
- },
566
-
567
- /**
568
- * Get the current value of the setting
569
- *
570
- * @return Object
571
- */
572
- getValue: function() {
573
-
574
- 'use strict';
575
-
576
- // The setting is saved in JSON
577
- return JSON.parse( decodeURI( this.setting.get() ) );
578
-
579
- },
580
-
581
- /**
582
- * Set a new value for the setting
583
- *
584
- * @param newValue Object
585
- * @param refresh If we want to refresh the previewer or not
586
- */
587
- setValue: function( newValue, refresh, filtering ) {
588
-
589
- 'use strict';
590
-
591
- // We need to filter the values after the first load to remove data requrired for diplay but that we don't want to save in DB
592
- var filteredValue = newValue,
593
- filter = [];
594
-
595
- if ( filtering ) {
596
- jQuery.each( this.params.fields, function( index, value ) {
597
- if ( 'image' === value.type || 'cropped_image' === value.type || 'upload' === value.type ) {
598
- filter.push( index );
599
- }
600
- });
601
- jQuery.each( newValue, function( index, value ) {
602
- jQuery.each( filter, function( ind, field ) {
603
- if ( 'undefined' !== typeof value[field] && 'undefined' !== typeof value[field].id ) {
604
- filteredValue[index][field] = value[field].id;
605
- }
606
- });
607
- });
608
-
609
- }
610
-
611
- this.setting.set( encodeURI( JSON.stringify( filteredValue ) ) );
612
-
613
- if ( refresh ) {
614
-
615
- // Trigger the change event on the hidden field so
616
- // previewer refresh the website on Customizer
617
- this.settingField.trigger( 'change' );
618
-
619
- }
620
-
621
- },
622
-
623
- /**
624
- * Add a new row to repeater settings based on the structure.
625
- *
626
- * @param data (Optional) Object of field => value pairs (undefined if you want to get the default values)
627
- */
628
- addRow: function( data ) {
629
-
630
- 'use strict';
631
-
632
- var control = this,
633
- template = control.repeaterTemplate(), // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() ).
634
- settingValue = this.getValue(), // Get the current setting value.
635
- newRowSetting = {}, // Saves the new setting data.
636
- templateData, // Data to pass to the template
637
- newRow,
638
- i;
639
-
640
- if ( template ) {
641
-
642
- // The control structure is going to define the new fields
643
- // We need to clone control.params.fields. Assigning it
644
- // ould result in a reference assignment.
645
- templateData = jQuery.extend( true, {}, control.params.fields );
646
 
647
- // But if we have passed data, we'll use the data values instead
648
- if ( data ) {
649
- for ( i in data ) {
650
- if ( data.hasOwnProperty( i ) && templateData.hasOwnProperty( i ) ) {
651
- templateData[ i ]['default'] = data[ i ];
652
- }
653
- }
654
- }
655
 
656
- templateData.index = this.currentIndex;
 
 
657
 
658
- // Append the template content
659
- template = template( templateData );
 
660
 
661
- // Create a new row object and append the element
662
- newRow = new RepeaterRow(
663
- control.currentIndex,
664
- jQuery( template ).appendTo( control.repeaterFieldsContainer ),
665
- control.params.row_label
666
- );
667
 
668
- newRow.container.on( 'row:remove', function( e, rowIndex ) {
669
- control.deleteRow( rowIndex );
670
- });
671
 
672
- newRow.container.on( 'row:update', function( e, rowIndex, fieldName, element ) {
673
- control.updateField.call( control, e, rowIndex, fieldName, element );
674
- newRow.updateLabel();
675
- });
676
 
677
- // Add the row to rows collection
678
- this.rows[ this.currentIndex ] = newRow;
679
 
680
- for ( i in templateData ) {
681
- if ( templateData.hasOwnProperty( i ) ) {
682
- newRowSetting[ i ] = templateData[ i ]['default'];
683
- }
684
- }
685
 
686
- settingValue[ this.currentIndex ] = newRowSetting;
687
- this.setValue( settingValue, true );
688
-
689
- this.currentIndex++;
690
-
691
- return newRow;
692
-
693
- }
694
-
695
- },
696
-
697
- sort: function() {
698
-
699
- 'use strict';
700
-
701
- var control = this,
702
- $rows = this.repeaterFieldsContainer.find( '.repeater-row' ),
703
- newOrder = [],
704
- settings = control.getValue(),
705
- newRows = [],
706
- newSettings = [];
707
-
708
- $rows.each( function( i, element ) {
709
- newOrder.push( jQuery( element ).data( 'row' ) );
710
- });
711
-
712
- jQuery.each( newOrder, function( newPosition, oldPosition ) {
713
- newRows[ newPosition ] = control.rows[ oldPosition ];
714
- newRows[ newPosition ].setRowIndex( newPosition );
715
-
716
- newSettings[ newPosition ] = settings[ oldPosition ];
717
- });
718
-
719
- control.rows = newRows;
720
- control.setValue( newSettings );
721
-
722
- },
723
-
724
- /**
725
- * Delete a row in the repeater setting
726
- *
727
- * @param index Position of the row in the complete Setting Array
728
- */
729
- deleteRow: function( index ) {
730
-
731
- 'use strict';
732
-
733
- var currentSettings = this.getValue(),
734
- row,
735
- i,
736
- prop;
737
-
738
- if ( currentSettings[ index ] ) {
739
-
740
- // Find the row
741
- row = this.rows[ index ];
742
- if ( row ) {
743
-
744
- // The row exists, let's delete it
745
-
746
- // Remove the row settings
747
- delete currentSettings[ index ];
748
-
749
- // Remove the row from the rows collection
750
- delete this.rows[ index ];
751
-
752
- // Update the new setting values
753
- this.setValue( currentSettings, true );
754
-
755
- }
756
-
757
- }
758
-
759
- // Remap the row numbers
760
- i = 1;
761
- for ( prop in this.rows ) {
762
- if ( this.rows.hasOwnProperty( prop ) && this.rows[ prop ] ) {
763
- this.rows[ prop ].updateLabel();
764
- i++;
765
- }
766
- }
767
-
768
- },
769
-
770
- /**
771
- * Update a single field inside a row.
772
- * Triggered when a field has changed
773
- *
774
- * @param e Event Object
775
- */
776
- updateField: function( e, rowIndex, fieldId, element ) {
777
-
778
- 'use strict';
779
-
780
- var type,
781
- row,
782
- currentSettings;
783
-
784
- if ( ! this.rows[ rowIndex ] ) {
785
- return;
786
- }
787
-
788
- if ( ! this.params.fields[ fieldId ] ) {
789
- return;
790
- }
791
-
792
- type = this.params.fields[ fieldId].type;
793
- row = this.rows[ rowIndex ];
794
- currentSettings = this.getValue();
795
-
796
- element = jQuery( element );
797
-
798
- if ( undefined === typeof currentSettings[ row.rowIndex ][ fieldId ] ) {
799
- return;
800
- }
801
-
802
- if ( 'checkbox' === type ) {
803
-
804
- currentSettings[ row.rowIndex ][ fieldId ] = element.is( ':checked' );
805
-
806
- } else {
807
-
808
- // Update the settings
809
- currentSettings[ row.rowIndex ][ fieldId ] = element.val();
810
-
811
- }
812
- this.setValue( currentSettings, true );
813
-
814
- },
815
-
816
- /**
817
- * Init the color picker on color fields
818
- * Called after AddRow
819
- *
820
- */
821
- initColorPicker: function() {
822
-
823
- 'use strict';
824
-
825
- var control = this,
826
- colorPicker = control.container.find( '.color-picker-hex' ),
827
- options = {},
828
- fieldId = colorPicker.data( 'field' );
829
-
830
- // We check if the color palette parameter is defined.
831
- if ( 'undefined' !== typeof fieldId && 'undefined' !== typeof control.params.fields[ fieldId ] && 'undefined' !== typeof control.params.fields[ fieldId ].palettes && 'object' === typeof control.params.fields[ fieldId ].palettes ) {
832
- options.palettes = control.params.fields[ fieldId ].palettes;
833
- }
834
-
835
- // When the color picker value is changed we update the value of the field
836
- options.change = function( event, ui ) {
837
-
838
- var currentPicker = jQuery( event.target ),
839
- row = currentPicker.closest( '.repeater-row' ),
840
- rowIndex = row.data( 'row' ),
841
- currentSettings = control.getValue();
842
-
843
- currentSettings[ rowIndex ][ currentPicker.data( 'field' ) ] = ui.color.toString();
844
- control.setValue( currentSettings, true );
845
-
846
- };
847
-
848
- // Init the color picker
849
- if ( 0 !== colorPicker.length ) {
850
- colorPicker.wpColorPicker( options );
851
- }
852
-
853
- },
854
-
855
- /**
856
- * Init the dropdown-pages field with selectize
857
- * Called after AddRow
858
- *
859
- * @param {object} theNewRow the row that was added to the repeater
860
- * @param {object} data the data for the row if we're initializing a pre-existing row
861
- *
862
- */
863
- initDropdownPages: function( theNewRow, data ) {
864
-
865
- 'use strict';
866
 
867
- var control = this,
868
- dropdown = theNewRow.container.find( '.repeater-dropdown-pages select' ),
869
- $select,
870
- selectize,
871
- dataField;
872
 
873
- if ( 0 === dropdown.length ) {
874
- return;
875
- }
876
 
877
- $select = jQuery( dropdown ).selectize();
878
- selectize = $select[0].selectize;
879
- dataField = dropdown.data( 'field' );
 
880
 
881
- if ( data ) {
882
- selectize.setValue( data[dataField] );
883
- }
884
 
885
- this.container.on( 'change', '.repeater-dropdown-pages select', function( event ) {
 
 
 
 
886
 
887
- var currentDropdown = jQuery( event.target ),
888
- row = currentDropdown.closest( '.repeater-row' ),
889
- rowIndex = row.data( 'row' ),
890
- currentSettings = control.getValue();
 
 
891
 
892
- currentSettings[ rowIndex ][ currentDropdown.data( 'field' ) ] = jQuery( this ).val();
893
- control.setValue( currentSettings );
 
 
 
894
 
895
- });
 
 
 
 
 
 
 
896
 
897
- }
 
 
898
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
899
  });
1
+ /**
2
+ * KIRKI CONTROL: REPEATER
3
+ */
4
+ function RepeaterRow( rowIndex, element ) {
5
+ this.rowIndex = rowIndex;
6
+ this.rowNumber = rowIndex + 1;
7
+ this.$el = element;
8
+ this.$dragger = this.$el.find( '.repeater-row-move' );
9
+ this.$minimizer = this.$el.find( '.repeater-row-minimize' );
10
+ this.$remover = this.$el.find( '.repeater-row-remove' );
11
+ this.$number = this.$el.find( '.repeater-row-number' );
12
+ this.$fields = this.$el.find( 'input,select,textarea' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ var self = this;
 
 
 
 
 
 
 
15
 
16
+ this.$minimizer.on( 'click', function() {
17
+ self.toggleMinimize();
18
+ });
19
 
20
+ this.$remover.on( 'click', function() {
21
+ self.remove();
22
+ });
23
 
24
+ this.$dragger.on( 'mousedown', function() {
25
+ self.$el.trigger( 'row:start-dragging' );
26
+ });
 
 
 
27
 
 
 
 
28
 
29
+ this.$el.on( 'keyup change', 'input, select, textarea', function( e ) {
30
+ self.$el.trigger( 'row:update', [ self.getRowIndex(), jQuery( e.target ).data( 'field' ), e.target ] );
31
+ });
 
32
 
33
+ this.renderNumber();
 
34
 
35
+ }
 
 
 
 
36
 
37
+ RepeaterRow.prototype.getRowIndex = function() {
38
+ return this.rowIndex;
39
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
 
 
 
 
 
41
 
42
+ RepeaterRow.prototype.getRowNumber = function() {
43
+ return this.rowNumber;
44
+ };
45
 
46
+ RepeaterRow.prototype.setRowNumber = function( rowNumber ) {
47
+ this.rowNumber = rowNumber;
48
+ this.renderNumber();
49
+ };
50
 
51
+ RepeaterRow.prototype.getElement = function() {
52
+ return this.$el;
53
+ };
54
 
55
+ RepeaterRow.prototype.setRowIndex = function( rowIndex ) {
56
+ this.rowIndex = rowIndex;
57
+ this.$el.attr( 'data-row', rowIndex );
58
+ this.$el.data( 'row', rowIndex );
59
+ };
60
 
61
+ RepeaterRow.prototype.toggleMinimize = function() {
62
+ // Store the previous state
63
+ this.$el.toggleClass( 'minimized' );
64
+ this.$minimizer.find( '.repeater-minimize' ).toggleClass( 'dashicons-arrow-up' );
65
+ this.$minimizer.find( '.repeater-minimize').toggleClass( 'dashicons-arrow-down' );
66
+ };
67
 
68
+ RepeaterRow.prototype.minimize = function() {
69
+ this.$el.addClass( 'minimized' );
70
+ this.$minimizer.find( '.repeater-minimize' ).removeClass( 'dashicons-arrow-up' );
71
+ this.$minimizer.find( '.repeater-minimize').addClass( 'dashicons-arrow-down' );
72
+ };
73
 
74
+ RepeaterRow.prototype.remove = function() {
75
+ if ( confirm( "Are you sure?" ) ) {
76
+ this.$el.slideUp( 300, function() {
77
+ jQuery(this).detach();
78
+ });
79
+ this.$el.trigger( 'row:remove', [ this.getRowIndex() ] );
80
+ }
81
+ };
82
 
83
+ RepeaterRow.prototype.renderNumber = function() {
84
+ this.$number.text( this.getRowNumber() );
85
+ };
86
 
87
+ wp.customize.controlConstructor['repeater'] = wp.customize.Control.extend({
88
+ ready: function() {
89
+ var control = this;
90
+
91
+ // The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function)
92
+ var settingValue = this.params.value;
93
+
94
+ // The hidden field that keeps the data saved (though we never update it)
95
+ this.settingField = this.container.find('[data-customize-setting-link]').first();
96
+
97
+ // Set the field value for the first time, we'll fill it up later
98
+ this.setValue( [], false );
99
+
100
+ // The DIV that holds all the rows
101
+ this.repeaterFieldsContainer = control.container.find('.repeater-fields').first();
102
+
103
+ // Set number of rows to 0
104
+ this.currentIndex = 0;
105
+
106
+ // Save the rows objects
107
+ this.rows = [];
108
+
109
+
110
+ control.container.on('click', 'button.repeater-add', function (e) {
111
+ e.preventDefault();
112
+ control.addRow();
113
+ });
114
+
115
+ /**
116
+ * Function that loads the Mustache template
117
+ */
118
+ this.repeaterTemplate = _.memoize(function () {
119
+ var compiled,
120
+ /*
121
+ * Underscore's default ERB-style templates are incompatible with PHP
122
+ * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.
123
+ *
124
+ * @see trac ticket #22344.
125
+ */
126
+ options = {
127
+ evaluate: /<#([\s\S]+?)#>/g,
128
+ interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
129
+ escape: /\{\{([^\}]+?)\}\}(?!\})/g,
130
+ variable: 'data'
131
+ };
132
+
133
+ return function (data) {
134
+ compiled = _.template(control.container.find('.customize-control-repeater-content').first().html(), null, options);
135
+ return compiled(data);
136
+ };
137
+ });
138
+
139
+ // When we load the control, the fields have not been filled up
140
+ // This is the first time that we create all the rows
141
+ if (settingValue.length) {
142
+ for (var i = 0; i < settingValue.length; i++) {
143
+ control.addRow(settingValue[i]);
144
+ }
145
+ }
146
+
147
+ this.repeaterFieldsContainer.sortable({
148
+ handle: ".repeater-row-move",
149
+ update: function( e, ui ) {
150
+ control.sort();
151
+ }
152
+ });
153
+
154
+ },
155
+
156
+
157
+
158
+ /**
159
+ * Get the current value of the setting
160
+ *
161
+ * @return Object
162
+ */
163
+ getValue: function() {
164
+ // The setting is saved in JSON
165
+ return JSON.parse( decodeURI( this.setting.get() ) );
166
+ },
167
+
168
+ /**
169
+ * Set a new value for the setting
170
+ *
171
+ * @param newValue Object
172
+ * @param refresh If we want to refresh the previewer or not
173
+ */
174
+ setValue: function( newValue, refresh ) {
175
+ this.setting.set( encodeURI( JSON.stringify( newValue ) ) );
176
+
177
+ if ( refresh ) {
178
+ // Trigger the change event on the hidden field so
179
+ // previewer refresh the website on Customizer
180
+ this.settingField.trigger('change');
181
+ }
182
+ },
183
+
184
+ /**
185
+ * Add a new row to repeater settings based on the structure.
186
+ *
187
+ * @param data (Optional) Object of field => value pairs (undefined if you want to get the default values)
188
+ */
189
+ addRow: function( data ) {
190
+ var control = this,
191
+ i,
192
+ row,
193
+
194
+ // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() )
195
+ template = control.repeaterTemplate(),
196
+
197
+ // Get the current setting value
198
+ settingValue = this.getValue(),
199
+
200
+ // Saves the new setting data
201
+ newRowSetting = {},
202
+
203
+ // Data to pass to the template
204
+ templateData;
205
+
206
+ if ( template ) {
207
+
208
+ // The control structure is going to define the new fields
209
+ // We need to clone control.params.fields. Assigning it
210
+ // ould result in a reference assignment.
211
+ templateData = jQuery.extend( true, {}, control.params.fields );
212
+
213
+ // But if we have passed data, we'll use the data values instead
214
+ if ( data ) {
215
+ for ( i in data ) {
216
+ if ( data.hasOwnProperty( i ) && templateData.hasOwnProperty( i ) ) {
217
+ templateData[i].default = data[i];
218
+ }
219
+ }
220
+ }
221
+
222
+ templateData['index'] = this.currentIndex;
223
+ templateData['ControlId'] = this.id;
224
+
225
+ // Append the template content
226
+ template = template( templateData );
227
+
228
+ // Create a new row object and append the element
229
+ var newRow = new RepeaterRow(
230
+ control.currentIndex,
231
+ jQuery( template ).appendTo( control.repeaterFieldsContainer )
232
+ );
233
+
234
+ newRow.getElement().one( 'row:remove', function( e, rowIndex ) {
235
+ control.deleteRow( rowIndex );
236
+ });
237
+
238
+ newRow.getElement().on( 'row:update', function( e, rowIndex, fieldName, element ) {
239
+ control.updateField.call( control, e, rowIndex, fieldName, element );
240
+ });
241
+
242
+ newRow.getElement().on( 'row:start-dragging', function() {
243
+ // Minimize all rows
244
+ for ( i in control.rows ) {
245
+ if ( control.rows.hasOwnProperty( i ) && control.rows[i] ) {
246
+ control.rows[i].minimize();
247
+ }
248
+ }
249
+ });
250
+
251
+ // Add the row to rows collection
252
+ this.rows[ this.currentIndex ] = newRow;
253
+
254
+ for ( i in templateData ) {
255
+ if ( templateData.hasOwnProperty( i ) ) {
256
+ newRowSetting[ i ] = templateData[i].default;
257
+ }
258
+ }
259
+
260
+ settingValue[this.currentIndex] = newRowSetting;
261
+ this.setValue( settingValue, true );
262
+
263
+ this.currentIndex++;
264
+
265
+ }
266
+
267
+ },
268
+
269
+ sort: function() {
270
+ var control = this;
271
+ var $rows = this.repeaterFieldsContainer.find( '.repeater-row' );
272
+ var newOrder = [];
273
+
274
+ $rows.each( function( i, element ) {
275
+ newOrder.push( jQuery( element ).data( 'row' ) );
276
+ });
277
+
278
+ var settings = control.getValue();
279
+ var newRows = [];
280
+ var newSettings = [];
281
+ jQuery.each( newOrder, function( newPosition, oldPosition ) {
282
+ newRows[ newPosition ] = control.rows[ oldPosition ];
283
+ newRows[ newPosition ].setRowIndex( newPosition );
284
+ newRows[ newPosition ].setRowNumber( newPosition + 1 );
285
+
286
+ newSettings[ newPosition ] = settings[ oldPosition ];
287
+ });
288
+
289
+ control.rows = newRows;
290
+ control.setValue( newSettings );
291
+ },
292
+
293
+ /**
294
+ * Delete a row in the repeater setting
295
+ *
296
+ * @param index Position of the row in the complete Setting Array
297
+ */
298
+ deleteRow: function( index ) {
299
+ var currentSettings = this.getValue();
300
+
301
+ if ( currentSettings[ index ] ) {
302
+ // Find the row
303
+ var row = this.rows[ index ];
304
+ if ( row ) {
305
+ // The row exists, let's delete it
306
+
307
+ // Remove the row settings
308
+ delete currentSettings[index];
309
+
310
+ // Remove the row from the rows collection
311
+ delete this.rows[index];
312
+
313
+ // Update the new setting values
314
+ this.setValue( currentSettings, true );
315
+ }
316
+ }
317
+
318
+ // Remap the row numbers
319
+ var i = 1;
320
+ for ( prop in this.rows ) {
321
+ if ( this.rows.hasOwnProperty( prop ) && this.rows[ prop ] ) {
322
+ this.rows[ prop ].setRowNumber( i );
323
+ i++;
324
+ }
325
+ }
326
+ },
327
+
328
+ /**
329
+ * Update a single field inside a row.
330
+ * Triggered when a field has changed
331
+ *
332
+ * @param e Event Object
333
+ */
334
+ updateField: function( e, rowIndex, fieldId, element ) {
335
+ if ( ! this.rows[ rowIndex ] )
336
+ return;
337
+
338
+ if ( ! this.params.fields[ fieldId ] )
339
+ return;
340
+
341
+ var type = this.params.fields[ fieldId].type;
342
+ var row = this.rows[ rowIndex ];
343
+ var currentSettings = this.getValue();
344
+ element = jQuery( element );
345
+
346
+ if (typeof currentSettings[row.getRowIndex()][fieldId] == undefined) {
347
+ return;
348
+ }
349
+
350
+ if ( type == 'checkbox' ) {
351
+ currentSettings[row.getRowIndex()][fieldId] = element.is( ':checked' );
352
+ }
353
+ else {
354
+ // Update the settings
355
+ currentSettings[row.getRowIndex()][fieldId] = element.val();
356
+ }
357
+
358
+ this.setValue( currentSettings, true );
359
+
360
+ }
361
  });
assets/js/controls/select.js CHANGED
@@ -1,18 +1,23 @@
1
- /*jshint -W065 */
2
- wp.customize.controlConstructor['kirki-select'] = wp.customize.Control.extend({
 
 
 
 
 
 
 
 
 
 
3
 
 
4
  ready: function() {
 
5
 
6
- 'use strict';
7
-
8
- var control = this,
9
- element = this.container.find( 'select' ),
10
- multiple = parseInt( element.data( 'multiple' ) ),
11
- selectValue;
12
 
13
- // If this is a multi-select control,
14
- // then we'll need to initialize selectize using the appropriate arguments.
15
- // If this is a single-select, then we can initialize selectize without any arguments.
16
  if ( multiple > 1 ) {
17
  jQuery( element ).selectize({
18
  maxItems: multiple,
@@ -22,20 +27,13 @@ wp.customize.controlConstructor['kirki-select'] = wp.customize.Control.extend({
22
  jQuery( element ).selectize();
23
  }
24
 
25
- // Change value
26
  this.container.on( 'change', 'select', function() {
27
-
28
- selectValue = jQuery( this ).val();
29
-
30
- // If this is a multi-select, then we need to convert the value to an object.
31
  if ( multiple > 1 ) {
32
- selectValue = _.extend( {}, jQuery( this ).val() );
 
 
33
  }
34
-
35
- control.setting.set( selectValue );
36
-
37
  });
38
-
39
  }
40
-
41
  });
1
+ /**
2
+ * KIRKI CONTROL: KIRKI-SELECT
3
+ */
4
+ function kirkiArrayToObject( arr ) {
5
+ var rv = {};
6
+ if ( null !== arr ) {
7
+ for ( var i = 0; i < arr.length; ++i ) {
8
+ if ( arr[i] !== undefined ) rv[i] = arr[i];
9
+ }
10
+ }
11
+ return rv;
12
+ }
13
 
14
+ wp.customize.controlConstructor['kirki-select'] = wp.customize.Control.extend( {
15
  ready: function() {
16
+ var control = this;
17
 
18
+ var element = this.container.find( 'select' );
19
+ var multiple = parseInt( element.data( 'multiple' ) );
 
 
 
 
20
 
 
 
 
21
  if ( multiple > 1 ) {
22
  jQuery( element ).selectize({
23
  maxItems: multiple,
27
  jQuery( element ).selectize();
28
  }
29
 
 
30
  this.container.on( 'change', 'select', function() {
 
 
 
 
31
  if ( multiple > 1 ) {
32
+ var select_value = kirkiArrayToObject( jQuery( this ).val() );
33
+ } else {
34
+ var select_value = jQuery( this ).val();
35
  }
36
+ control.setting.set( select_value );
 
 
37
  });
 
38
  }
 
39
  });
assets/js/controls/slider.js CHANGED
@@ -1,36 +1,32 @@
1
- wp.customize.controlConstructor['kirki-slider'] = wp.customize.Control.extend({
 
 
 
2
 
3
- ready: function() {
4
-
5
- 'use strict';
 
 
 
 
6
 
7
- var control = this,
8
- value,
9
- thisInput,
10
- inputDefault;
11
 
12
- // Update the text value
13
- jQuery( 'input[type=range]' ).on( 'mousedown', function() {
14
- value = jQuery( this ).attr( 'value' );
15
- jQuery( this ).mousemove( function() {
16
- value = jQuery( this ).attr( 'value' );
17
- jQuery( this ).closest( 'label' ).find( '.kirki_range_value .value' ).text( value );
18
- });
19
- });
20
 
21
- // Handle the reset button
22
- jQuery( '.kirki-slider-reset' ).click( function() {
23
- thisInput = jQuery( this ).closest( 'label' ).find( 'input' );
24
- inputDefault = thisInput.data( 'reset_value' );
25
- thisInput.val( inputDefault );
26
- thisInput.change();
27
- jQuery( this ).closest( 'label' ).find( '.kirki_range_value .value' ).text( inputDefault );
28
- });
29
 
30
- // Save changes.
 
 
31
  this.container.on( 'change', 'input', function() {
32
  control.setting.set( jQuery( this ).val() );
33
  });
34
  }
35
-
36
  });
1
+ /**
2
+ * KIRKI CONTROL: SLIDER
3
+ */
4
+ jQuery(document).ready(function($) {
5
 
6
+ $( 'input[type=range]' ).on( 'mousedown', function() {
7
+ value = $( this ).attr( 'value' );
8
+ $( this ).mousemove(function() {
9
+ value = $( this ).attr( 'value' );
10
+ $( this ).closest( 'label' ).find( '.kirki_range_value .value' ).text( value );
11
+ });
12
+ });
13
 
14
+ $( '.kirki-slider-reset' ).click( function () {
15
+ var $this_input = $( this ).closest( 'label' ).find( 'input' ),
16
+ input_name = $this_input.data( 'customize-setting-link' ),
17
+ input_default = $this_input.data( 'reset_value' );
18
 
19
+ $this_input.val( input_default );
20
+ $this_input.change();
21
+ });
 
 
 
 
 
22
 
23
+ });
 
 
 
 
 
 
 
24
 
25
+ wp.customize.controlConstructor['slider'] = wp.customize.Control.extend( {
26
+ ready: function() {
27
+ var control = this;
28
  this.container.on( 'change', 'input', function() {
29
  control.setting.set( jQuery( this ).val() );
30
  });
31
  }
 
32
  });
assets/js/controls/sortable.js CHANGED
@@ -1,32 +1,32 @@
1
- wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
4
-
5
- 'use strict';
6
-
7
  var control = this;
8
 
9
  // The hidden field that keeps the data saved
10
- this.settingField = this.container.find( '[data-customize-setting-link]' ).first();
11
 
12
  // The sortable container
13
- this.sortableContainer = this.container.find( 'ul.sortable' ).first();
14
 
15
  // Set the field value for the first time
16
  this.setValue( this.setting.get(), false );
17
 
 
18
  // Init the sortable container
19
  this.sortableContainer.sortable()
20
  .disableSelection()
21
- .on( 'sortstop', function( event, ui ) {
22
  control.sort();
23
  })
24
- .find( 'li' ).each(function() {
25
- jQuery( this ).find( 'i.visibility' ).click( function() {
26
- jQuery( this ).toggleClass( 'dashicons-visibility-faint' ).parents( 'li:eq(0)' ).toggleClass( 'invisible' );
27
  });
28
  })
29
- .click( function() {
30
  control.sort();
31
  });
32
  },
@@ -35,19 +35,15 @@ wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend(
35
  * Updates the sorting list
36
  */
37
  sort: function() {
38
-
39
- 'use strict';
40
-
41
  var newValue = [];
42
  this.sortableContainer.find( 'li' ).each( function() {
43
- var $this = jQuery( this );
44
  if ( ! $this.is( '.invisible' ) ) {
45
- newValue.push( $this.data( 'value' ) );
46
  }
47
  });
48
 
49
  this.setValue( newValue, true );
50
-
51
  },
52
 
53
  /**
@@ -56,12 +52,8 @@ wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend(
56
  * @return Object
57
  */
58
  getValue: function() {
59
-
60
- 'use strict';
61
-
62
  // The setting is saved in PHP serialized format
63
  return unserialize( this.setting.get() );
64
-
65
  },
66
 
67
  /**
@@ -71,24 +63,17 @@ wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend(
71
  * @param refresh If we want to refresh the previewer or not
72
  */
73
  setValue: function( newValue, refresh ) {
74
-
75
- 'use strict';
76
-
77
- var newValueSerialized = serialize( newValue );
78
-
79
- this.setting.set( newValueSerialized );
80
 
81
  // Update the hidden field
82
- this.settingField.val( newValueSerialized );
83
 
84
  if ( refresh ) {
85
-
86
  // Trigger the change event on the hidden field so
87
  // previewer refresh the website on Customizer
88
- this.settingField.trigger( 'change' );
89
-
90
  }
91
-
92
  }
93
 
94
  });
1
+ /**
2
+ * KIRKI CONTROL: SORTABLE
3
+ */
4
+ wp.customize.controlConstructor['sortable'] = wp.customize.Control.extend({
5
  ready: function() {
 
 
 
6
  var control = this;
7
 
8
  // The hidden field that keeps the data saved
9
+ this.settingField = this.container.find('[data-customize-setting-link]').first();
10
 
11
  // The sortable container
12
+ this.sortableContainer = this.container.find( 'ul.sortable').first();
13
 
14
  // Set the field value for the first time
15
  this.setValue( this.setting.get(), false );
16
 
17
+
18
  // Init the sortable container
19
  this.sortableContainer.sortable()
20
  .disableSelection()
21
+ .on("sortstop", function(event, ui) {
22
  control.sort();
23
  })
24
+ .find('li').each(function() {
25
+ jQuery(this).find('i.visibility').click(function() {
26
+ jQuery(this).toggleClass('dashicons-visibility-faint').parents('li:eq(0)').toggleClass('invisible');
27
  });
28
  })
29
+ .click(function() {
30
  control.sort();
31
  });
32
  },
35
  * Updates the sorting list
36
  */
37
  sort: function() {
 
 
 
38
  var newValue = [];
39
  this.sortableContainer.find( 'li' ).each( function() {
40
+ var $this = jQuery(this);
41
  if ( ! $this.is( '.invisible' ) ) {
42
+ newValue.push( $this.data('value' ) );
43
  }
44
  });
45
 
46
  this.setValue( newValue, true );
 
47
  },
48
 
49
  /**
52
  * @return Object
53
  */
54
  getValue: function() {
 
 
 
55
  // The setting is saved in PHP serialized format
56
  return unserialize( this.setting.get() );
 
57
  },
58
 
59
  /**
63
  * @param refresh If we want to refresh the previewer or not
64
  */
65
  setValue: function( newValue, refresh ) {
66
+ newValue = serialize( newValue );
67
+ this.setting.set( newValue );
 
 
 
 
68
 
69
  // Update the hidden field
70
+ this.settingField.val( newValue );
71
 
72
  if ( refresh ) {
 
73
  // Trigger the change event on the hidden field so
74
  // previewer refresh the website on Customizer
75
+ this.settingField.trigger('change');
 
76
  }
 
77
  }
78
 
79
  });
assets/js/controls/spacing.js CHANGED
@@ -1,54 +1,102 @@
1
- wp.customize.controlConstructor['kirki-spacing'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
4
-
5
- 'use strict';
6
-
7
- var control = this,
8
- value = {};
9
-
10
- _.each( ['top', 'bottom', 'left', 'right'], function( dimension, index ) {
11
-
12
- // Get initial values and pre-populate the object.
13
- if ( control.container.has( '.' + dimension ).size() ) {
14
-
15
- value[ dimension ] = control.setting._value[ dimension ];
16
-
17
- // Validate the value and show a warning if it's invalid.
18
- jQuery( control.selector + ' .' + dimension + '.input-wrapper' ).removeClass( 'invalid' );
19
- if ( false === kirkiValidateCSSValue( control.setting._value[ dimension ] ) ) {
20
- jQuery( control.selector + ' .' + dimension + '.input-wrapper' ).addClass( 'invalid' );
21
- }
22
-
23
- control.container.on( 'change keyup paste', '.' + dimension + ' input', function() {
24
-
25
- var subValue = jQuery( this ).val();
26
-
27
- // Validate the value and show a warning if it's invalid.
28
- if ( false === kirkiValidateCSSValue( subValue ) ) {
29
-
30
- jQuery( control.selector + ' .' + dimension + '.input-wrapper' ).addClass( 'invalid' );
31
-
32
- } else {
33
-
34
- jQuery( control.selector + ' .' + dimension + '.input-wrapper' ).removeClass( 'invalid' );
35
-
36
- // Only proceed if value is valid.
37
- value[ dimension ] = subValue;
38
- control.setting.set( value );
39
-
40
- // Refresh the preview.
41
- // The `postMessage` implementation is still incomplete for this field.
42
- wp.customize.previewer.refresh();
43
-
44
- }
45
-
46
- });
47
-
48
- }
49
-
50
- });
51
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
-
54
  });
1
+ /**
2
+ * KIRKI CONTROL: SPACING
3
+ */
4
+ wp.customize.controlConstructor['spacing'] = wp.customize.Control.extend( {
5
  ready: function() {
6
+ var control = this;
7
+ var compiled_value = {};
8
+
9
+ // get initial values and pre-populate the object
10
+ if ( control.container.has( '.top' ).size() ) {
11
+ compiled_value['top'] = control.setting._value['top'];
12
+ }
13
+ if ( control.container.has( '.bottom' ).size() ) {
14
+ compiled_value['bottom'] = control.setting._value['bottom'];
15
+ }
16
+ if ( control.container.has( '.left' ).size() ) {
17
+ compiled_value['left'] = control.setting._value['left'];
18
+ }
19
+ if ( control.container.has( '.right' ).size() ) {
20
+ compiled_value['right'] = control.setting._value['right'];
21
+ }
22
+
23
+ // use selectize
24
+ jQuery( '.customize-control-spacing select' ).selectize();
25
+
26
+ // top
27
+ if ( control.container.has( '.top' ).size() ) {
28
+ var top_numeric_value = control.container.find('.top input[type=number]' ).val();
29
+ var top_units_value = control.container.find('.top select' ).val();
30
+
31
+ this.container.on( 'change', '.top input', function() {
32
+ top_numeric_value = jQuery( this ).val();
33
+ compiled_value['top'] = top_numeric_value + top_units_value;
34
+ control.setting.set( compiled_value );
35
+ wp.customize.previewer.refresh();
36
+ });
37
+ this.container.on( 'change', '.top select', function() {
38
+ top_units_value = jQuery( this ).val();
39
+ compiled_value['top'] = top_numeric_value + top_units_value;
40
+ control.setting.set( compiled_value );
41
+ wp.customize.previewer.refresh();
42
+ });
43
+ }
44
+
45
+ // bottom
46
+ if ( control.container.has( '.bottom' ).size() ) {
47
+ var bottom_numeric_value = control.container.find('.bottom input[type=number]' ).val();
48
+ var bottom_units_value = control.container.find('.bottom select' ).val();
49
+
50
+ this.container.on( 'change', '.bottom input', function() {
51
+ bottom_numeric_value = jQuery( this ).val();
52
+ compiled_value['bottom'] = bottom_numeric_value + bottom_units_value;
53
+ control.setting.set( compiled_value );
54
+ wp.customize.previewer.refresh();
55
+ });
56
+ this.container.on( 'change', '.bottom select', function() {
57
+ bottom_units_value = jQuery( this ).val();
58
+ compiled_value['bottom'] = bottom_numeric_value + bottom_units_value;
59
+ control.setting.set( compiled_value );
60
+ wp.customize.previewer.refresh();
61
+ });
62
+ }
63
+
64
+ // left
65
+ if ( control.container.has( '.left' ).size() ) {
66
+ var left_numeric_value = control.container.find('.left input[type=number]' ).val();
67
+ var left_units_value = control.container.find('.left select' ).val();
68
+
69
+ this.container.on( 'change', '.left input', function() {
70
+ left_numeric_value = jQuery( this ).val();
71
+ compiled_value['left'] = left_numeric_value + left_units_value;
72
+ control.setting.set( compiled_value );
73
+ wp.customize.previewer.refresh();
74
+ });
75
+ this.container.on( 'change', '.left select', function() {
76
+ left_units_value = jQuery( this ).val();
77
+ compiled_value['left'] = left_numeric_value + left_units_value;
78
+ control.setting.set( compiled_value );
79
+ wp.customize.previewer.refresh();
80
+ });
81
+ }
82
+
83
+ // right
84
+ if ( control.container.has( '.right' ).size() ) {
85
+ var right_numeric_value = control.container.find('.right input[type=number]' ).val();
86
+ var right_units_value = control.container.find('.right select' ).val();
87
+
88
+ this.container.on( 'change', '.right input', function() {
89
+ right_numeric_value = jQuery( this ).val();
90
+ compiled_value['right'] = right_numeric_value + right_units_value;
91
+ control.setting.set( compiled_value );
92
+ wp.customize.previewer.refresh();
93
+ });
94
+ this.container.on( 'change', '.right select', function() {
95
+ right_units_value = jQuery( this ).val();
96
+ compiled_value['right'] = right_numeric_value + right_units_value;
97
+ control.setting.set( compiled_value );
98
+ wp.customize.previewer.refresh();
99
+ });
100
+ }
101
  }
 
102
  });
assets/js/controls/switch.js CHANGED
@@ -1,18 +1,16 @@
1
- wp.customize.controlConstructor['kirki-switch'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
 
4
 
5
- 'use strict';
6
-
7
- var control = this,
8
- checkboxValue = control.setting._value;
9
 
10
- // Save the value
11
  this.container.on( 'change', 'input', function() {
12
- checkboxValue = ( jQuery( this ).is( ':checked' ) ) ? true : false;
13
- control.setting.set( checkboxValue );
14
  });
15
-
16
  }
17
-
18
  });
1
+ /**
2
+ * KIRKI CONTROL: SWITCH
3
+ */
4
+ wp.customize.controlConstructor['switch'] = wp.customize.Control.extend( {
5
  ready: function() {
6
+ var control = this;
7
 
8
+ // Get the initial value
9
+ var checkbox_value = control.setting._value;
 
 
10
 
 
11
  this.container.on( 'change', 'input', function() {
12
+ checkbox_value = ( jQuery( this ).is( ':checked' ) ) ? true : false;
13
+ control.setting.set( checkbox_value );
14
  });
 
15
  }
 
16
  });
assets/js/controls/text.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * KIRKI CONTROL: TEXT
3
+ */
4
+ wp.customize.controlConstructor['kirki-text'] = wp.customize.Control.extend( {
5
+ ready: function() {
6
+ var control = this;
7
+ this.container.on( 'change keyup paste', 'input', function() {
8
+ control.setting.set( jQuery( this ).val() );
9
+ });
10
+ }
11
+ });
assets/js/controls/textarea.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * KIRKI CONTROL: TEXTAREA
3
+ */
4
+ wp.customize.controlConstructor['kirki-textarea'] = wp.customize.Control.extend( {
5
+ ready: function() {
6
+ var control = this;
7
+ this.container.on( 'change keyup paste', '.textarea', function() {
8
+ control.setting.set( jQuery( this ).val() );
9
+ });
10
+ }
11
+ });
assets/js/controls/toggle.js CHANGED
@@ -1,18 +1,16 @@
1
- wp.customize.controlConstructor['kirki-toggle'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
 
4
 
5
- 'use strict';
6
-
7
- var control = this,
8
- checkboxValue = control.setting._value;
9
 
10
- // Save the value
11
  this.container.on( 'change', 'input', function() {
12
- checkboxValue = ( jQuery( this ).is( ':checked' ) ) ? true : false;
13
- control.setting.set( checkboxValue );
14
  });
15
-
16
  }
17
-
18
  });
1
+ /**
2
+ * KIRKI CONTROL: TOGGLE
3
+ */
4
+ wp.customize.controlConstructor['toggle'] = wp.customize.Control.extend( {
5
  ready: function() {
6
+ var control = this;
7
 
8
+ // Get the initial value
9
+ var checkbox_value = control.setting._value;
 
 
10
 
 
11
  this.container.on( 'change', 'input', function() {
12
+ checkbox_value = ( jQuery( this ).is( ':checked' ) ) ? true : false;
13
+ control.setting.set( checkbox_value );
14
  });
 
15
  }
 
16
  });
assets/js/controls/typography.js CHANGED
@@ -1,322 +1,158 @@
1
- wp.customize.controlConstructor['kirki-typography'] = wp.customize.Control.extend({
2
-
 
 
3
  ready: function() {
4
-
5
- 'use strict';
6
-
7
- var control = this,
8
- fontFamilySelector = control.selector + ' .font-family select',
9
- variantSelector = control.selector + ' .variant select',
10
- subsetSelector = control.selector + ' .subsets select',
11
- textTransformSelector = control.selector + ' .text-transform select',
12
- hasDefault = false,
13
- firstAvailable = false,
14
- activeItem,
15
- value = {},
16
- renderSubControl,
17
- picker;
18
-
19
- // Make sure everything we're going to need exists.
20
- _.each( control.params['default'], function( defaultParamValue, param ) {
21
- if ( false !== defaultParamValue ) {
22
- value[ param ] = defaultParamValue;
23
- if ( undefined !== control.setting._value[ param ] ) {
24
- value[ param ] = control.setting._value[ param ];
25
- }
26
- }
27
- });
28
- _.each( control.setting._value, function( subValue, param ) {
29
- if ( undefined === value[ param ] || 'undefined' === typeof value[ param ] ) {
30
- value[ param ] = subValue;
31
- }
32
- });
33
-
34
- // Renders and refreshes selectize sub-controls.
35
- renderSubControl = function( fontFamily, sub, startValue ) {
36
-
37
- var subSelector = ( 'variant' === sub ) ? variantSelector : subsetSelector,
38
- isStandard = false,
39
- subList = {},
40
- subValue,
41
- subsetValues,
42
- subsetValuesArray,
43
- subSelectize;
44
-
45
- // Destroy the selectize instance.
46
- if ( undefined !== jQuery( subSelector ).selectize()[0] ) {
47
- jQuery( subSelector ).selectize()[0].selectize.destroy();
48
- }
49
-
50
- // Get all items in the sub-list for the active font-family.
51
- _.each( kirkiAllFonts, function( font, i ) {
52
-
53
- // Find the font-family we've selected in the global array of fonts.
54
- if ( fontFamily === font.family ) {
55
-
56
- // Check if this is a standard font or a google-font.
57
- if ( undefined !== font.isStandard && true === font.isStandard ) {
58
- isStandard = true;
59
- }
60
-
61
- if ( 'variant' === sub ) {
62
- subList = font.variants;
63
- } else if ( 'subsets' === sub ) {
64
- subList = font.subsets;
65
- }
66
-
67
  }
68
-
 
69
  });
 
70
 
71
- // This is a googlefont, or we're talking subsets.
72
- if ( false === isStandard || 'subsets' !== sub ) {
73
-
74
- // Determine the initial value we have to use
75
- if ( null === startValue ) {
76
-
77
- if ( 'variant' === sub ) { // The context here is variants
78
-
79
- // Loop the variants.
80
- _.each( subList, function( variant ) {
81
-
82
- var defaultValue;
83
-
84
- if ( undefined !== variant.id ) {
85
-
86
- activeItem = value.variant;
87
-
88
- } else {
89
-
90
- defaultValue = 'regular';
91
-
92
- if ( defaultValue === variant.id ) {
93
- hasDefault = true;
94
- } else if ( false === firstAvailable ) {
95
- firstAvailable = variant.id;
96
- }
97
-
98
- }
99
-
100
- });
101
-
102
- } else if ( 'subsets' === sub ) { // The context here is subsets
103
-
104
- subsetValues = {};
105
-
106
- _.each( subList, function( subSet ) {
107
- if ( null !== value.subsets ) {
108
- _.each( value.subsets, function( item ) {
109
- if ( undefined !== subSet && item === subSet.id ) {
110
- subsetValues[ item ] = item;
111
- }
112
- });
113
- }
114
- });
115
-
116
- if ( 0 !== subsetValues.length ) {
117
- subsetValuesArray = jQuery.map( subsetValues, function( value, index ) {
118
- return [value];
119
- });
120
- activeItem = subsetValuesArray;
121
- }
122
-
123
- }
124
-
125
- // If we have a valid setting, use it.
126
- // If not, check if the default value exists.
127
- // If not, then use the 1st available option.
128
- subValue = ( undefined !== activeItem ) ? activeItem : ( false !== hasDefault ) ? 'regular' : firstAvailable;
129
-
130
  } else {
131
-
132
- subValue = startValue;
133
-
134
  }
 
 
 
 
135
 
136
- // Create
137
- subSelectize = jQuery( subSelector ).selectize({
138
- maxItems: ( 'variant' === sub ) ? 1 : null,
139
- valueField: 'id',
140
- labelField: 'label',
141
- searchField: ['label'],
142
- options: subList,
143
- items: ( 'variant' === sub ) ? [ subValue ] : subValue,
144
- create: false,
145
- plugins: ( 'variant' === sub ) ? '' : ['remove_button'],
146
- render: {
147
- item: function( item, escape ) {
148
- return '<div>' + escape( item.label ) + '</div>';
149
- },
150
- option: function( item, escape ) {
151
- return '<div>' + escape( item.label ) + '</div>';
152
- }
153
- }
154
- }).data( 'selectize' );
155
-
156
- }
157
-
158
- if ( true === isStandard ) {
159
-
160
- // Hide unrelated fields on standard fonts.
161
- control.container.find( '.hide-on-standard-fonts' ).css( 'display', 'none' );
162
- } else {
163
-
164
- if ( 2 > subList.length ) {
165
-
166
- // If only 1 option is available then there's no reason to show this.
167
- control.container.find( '.kirki-' + sub + '-wrapper' ).css( 'display', 'none' );
168
  } else {
169
- control.container.find( '.kirki-' + sub + '-wrapper' ).css( 'display', 'block' );
170
  }
 
 
 
 
171
 
172
- }
173
-
174
- };
175
-
176
- // Render the font-family
177
- jQuery( fontFamilySelector ).selectize({
178
- options: kirkiAllFonts,
179
- items: [ control.setting._value['font-family'] ],
180
- persist: false,
181
- maxItems: 1,
182
- valueField: 'family',
183
- labelField: 'label',
184
- searchField: ['family', 'label', 'subsets'],
185
- create: false,
186
- render: {
187
- item: function( item, escape ) {
188
- return '<div>' + escape( item.label ) + '</div>';
189
- },
190
- option: function( item, escape ) {
191
- return '<div>' + escape( item.label ) + '</div>';
192
  }
193
- }
194
- });
195
-
196
- // Render the variants
197
- // Please note that when the value of font-family changes,
198
- // this will be destroyed and re-created.
199
- renderSubControl( value['font-family'], 'variant', value.variant );
200
-
201
- // Render the subsets
202
- // Please note that when the value of font-family changes,
203
- // this will be destroyed and re-created.
204
- renderSubControl( value['font-family'], 'subsets', value.subsets );
205
-
206
- this.container.on( 'change', '.font-family select', function() {
207
-
208
- // Add the value to the array and set the setting's value
209
- value['font-family'] = jQuery( this ).val();
210
- control.saveValue( value );
211
-
212
- // Trigger changes to variants & subsets
213
- renderSubControl( jQuery( this ).val(), 'variant', null );
214
- renderSubControl( jQuery( this ).val(), 'subsets', null );
215
-
216
- // Refresh the preview
217
- wp.customize.previewer.refresh();
218
-
219
- });
220
-
221
- this.container.on( 'change', '.variant select', function() {
222
-
223
- // Add the value to the array and set the setting's value
224
- value.variant = jQuery( this ).val();
225
- control.saveValue( value );
226
-
227
- // Refresh the preview
228
- wp.customize.previewer.refresh();
229
-
230
- });
231
-
232
- this.container.on( 'change', '.subsets select', function() {
233
-
234
- // Add the value to the array and set the setting's value.
235
- value.subsets = jQuery( this ).val();
236
- control.saveValue( value );
237
-
238
- // Refresh the preview
239
- wp.customize.previewer.refresh();
240
-
241
- });
242
-
243
- this.container.on( 'change keyup paste', '.font-size input', function() {
244
-
245
- // Add the value to the array and set the setting's value
246
- value['font-size'] = jQuery( this ).val();
247
- control.saveValue( value );
248
-
249
- });
250
-
251
- this.container.on( 'change keyup paste', '.line-height input', function() {
252
-
253
- // Add the value to the array and set the setting's value
254
- value['line-height'] = jQuery( this ).val();
255
- control.saveValue( value );
256
-
257
- });
258
-
259
- this.container.on( 'change keyup paste', '.letter-spacing input', function() {
260
-
261
- // Add the value to the array and set the setting's value
262
- value['letter-spacing'] = jQuery( this ).val();
263
- control.saveValue( value );
264
-
265
- });
266
-
267
- this.container.on( 'change', '.text-align input', function() {
268
-
269
- // Add the value to the array and set the setting's value.
270
- value['text-align'] = jQuery( this ).val();
271
- control.saveValue( value );
272
-
273
- });
274
-
275
- // Text-transform
276
- jQuery( textTransformSelector ).selectize();
277
- this.container.on( 'change', '.text-transform select', function() {
278
-
279
- // Add the value to the array and set the setting's value.
280
- value['text-transform'] = jQuery( this ).val();
281
- control.saveValue( value );
282
-
283
- });
284
-
285
- picker = this.container.find( '.kirki-color-control' );
286
-
287
- // Change color
288
- picker.wpColorPicker({
289
- change: function() {
290
-
291
- setTimeout( function() {
292
-
293
- // Add the value to the array and set the setting's value
294
- value.color = picker.val();
295
- control.saveValue( value );
296
-
297
- }, 100 );
298
-
299
- }
300
-
301
- });
302
-
303
- },
304
-
305
- /**
306
- * Saves the value.
307
- */
308
- saveValue: function( value ) {
309
-
310
- 'use strict';
311
-
312
- var control = this,
313
- newValue = {};
314
-
315
- _.each( value, function( newSubValue, i ) {
316
- newValue[ i ] = newSubValue;
317
- });
318
-
319
- control.setting.set( newValue );
320
  }
321
-
322
  });
1
+ /**
2
+ * KIRKI CONTROL: TYPOGRAPHY
3
+ */
4
+ wp.customize.controlConstructor['typography'] = wp.customize.Control.extend( {
5
  ready: function() {
6
+ var control = this;
7
+ var compiled_value = {};
8
+
9
+ // get initial values and pre-populate the object
10
+ if ( control.container.has( '.bold' ).size() ) {
11
+ compiled_value['bold'] = control.setting._value['bold'];
12
+ }
13
+ if ( control.container.has( '.italic' ).size() ) {
14
+ compiled_value['italic'] = control.setting._value['italic'];
15
+ }
16
+ if ( control.container.has( '.underline' ).size() ) {
17
+ compiled_value['underline'] = control.setting._value['underline'];
18
+ }
19
+ if ( control.container.has( '.strikethrough' ).size() ) {
20
+ compiled_value['strikethrough'] = control.setting._value['strikethrough'];
21
+ }
22
+ if ( control.container.has( '.font-family' ).size() ) {
23
+ compiled_value['font-family'] = control.setting._value['font-family'];
24
+ }
25
+ if ( control.container.has( '.font-size' ).size() ) {
26
+ compiled_value['font-size'] = control.setting._value['font-size'];
27
+ }
28
+ if ( control.container.has( '.font-weight' ).size() ) {
29
+ compiled_value['font-weight'] = control.setting._value['font-weight'];
30
+ }
31
+ if ( control.container.has( '.line-height' ).size() ) {
32
+ compiled_value['line-height'] = control.setting._value['line-height'];
33
+ }
34
+ if ( control.container.has( '.letter-spacing' ).size() ) {
35
+ compiled_value['letter-spacing'] = control.setting._value['letter-spacing'];
36
+ }
37
+
38
+ // use selectize
39
+ jQuery( '.customize-control-typography select' ).selectize();
40
+
41
+ // bold
42
+ if ( control.container.has( '.bold' ).size() ) {
43
+ this.container.on( 'change', '.bold input', function() {
44
+ if ( jQuery( this ).is( ':checked' ) ) {
45
+ compiled_value['bold'] = true;
46
+ } else {
47
+ compiled_value['bold'] = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
+ control.setting.set( compiled_value );
50
+ wp.customize.previewer.refresh();
51
  });
52
+ }
53
 
54
+ // italic
55
+ if ( control.container.has( '.italic' ).size() ) {
56
+ this.container.on( 'change', '.italic input', function() {
57
+ if ( jQuery( this ).is( ':checked' ) ) {
58
+ compiled_value['italic'] = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  } else {
60
+ compiled_value['italic'] = false;
 
 
61
  }
62
+ control.setting.set( compiled_value );
63
+ wp.customize.previewer.refresh();
64
+ });
65
+ }
66
 
67
+ // underline
68
+ if ( control.container.has( '.underline' ).size() ) {
69
+ this.container.on( 'change', '.underline input', function() {
70
+ if ( jQuery( this ).is( ':checked' ) ) {
71
+ compiled_value['underline'] = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  } else {
73
+ compiled_value['underline'] = false;
74
  }
75
+ control.setting.set( compiled_value );
76
+ wp.customize.previewer.refresh();
77
+ });
78
+ }
79
 
80
+ // strikethrough
81
+ if ( control.container.has( '.strikethrough' ).size() ) {
82
+ this.container.on( 'change', '.strikethrough input', function() {
83
+ if ( jQuery( this ).is( ':checked' ) ) {
84
+ compiled_value['strikethrough'] = true;
85
+ } else {
86
+ compiled_value['strikethrough'] = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  }
88
+ control.setting.set( compiled_value );
89
+ wp.customize.previewer.refresh();
90
+ });
91
+ }
92
+
93
+ // font-family
94
+ if ( control.container.has( '.font-family' ).size() ) {
95
+ this.container.on( 'change', '.font-family select', function() {
96
+ compiled_value['font-family'] = jQuery( this ).val();
97
+ control.setting.set( compiled_value );
98
+ wp.customize.previewer.refresh();
99
+ });
100
+ }
101
+
102
+ // font-size
103
+ if ( control.container.has( '.font-size' ).size() ) {
104
+ var font_size_numeric_value = control.container.find('.font-size input[type=number]' ).val();
105
+ var font_size_units_value = control.container.find('.font-size select' ).val();
106
+
107
+ this.container.on( 'change', '.font-size input', function() {
108
+ font_size_numeric_value = jQuery( this ).val();
109
+ compiled_value['font-size'] = font_size_numeric_value + font_size_units_value;
110
+ control.setting.set( compiled_value );
111
+ wp.customize.previewer.refresh();
112
+ });
113
+ this.container.on( 'change', '.font-size select', function() {
114
+ font_size_units_value = jQuery( this ).val();
115
+ compiled_value['font-size'] = font_size_numeric_value + font_size_units_value;
116
+ control.setting.set( compiled_value );
117
+ wp.customize.previewer.refresh();
118
+ });
119
+ }
120
+
121
+ // font-weight
122
+ if ( control.container.has( '.font-weight' ).size() ) {
123
+ this.container.on( 'change', '.font-weight select', function() {
124
+ compiled_value['font-weight'] = jQuery( this ).val();
125
+ control.setting.set( compiled_value );
126
+ wp.customize.previewer.refresh();
127
+ });
128
+ }
129
+
130
+ // line-height
131
+ if ( control.container.has( '.line-height' ).size() ) {
132
+ this.container.on( 'change', '.line-height input', function() {
133
+ compiled_value['line-height'] = jQuery( this ).val();
134
+ control.setting.set( compiled_value );
135
+ wp.customize.previewer.refresh();
136
+ });
137
+ }
138
+
139
+ // letter-spacing
140
+ if ( control.container.has( '.letter-spacing' ).size() ) {
141
+ var letter_spacing_numeric_value = control.container.find('.letter-spacing input[type=number]' ).val();
142
+ var letter_spacing_units_value = control.container.find('.letter-spacing select' ).val();
143
+
144
+ this.container.on( 'change', '.letter-spacing input', function() {
145
+ letter_spacing_numeric_value = jQuery( this ).val();
146
+ compiled_value['letter-spacing'] = letter_spacing_numeric_value + letter_spacing_units_value;
147
+ control.setting.set( compiled_value );
148
+ wp.customize.previewer.refresh();
149
+ });
150
+ this.container.on( 'change', '.letter-spacing select', function() {
151
+ letter_spacing_units_value = jQuery( this ).val();
152
+ compiled_value['letter-spacing'] = letter_spacing_numeric_value + letter_spacing_units_value;
153
+ control.setting.set( compiled_value );
154
+ wp.customize.previewer.refresh();
155
+ });
156
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  }
 
158
  });
assets/js/functions/set-setting-value.js DELETED
@@ -1,218 +0,0 @@
1
- function kirkiSetSettingValue( setting, value ) {
2
- /**
3
- * Get the control of the sub-setting.
4
- * This will be used to get properties we need from that control,
5
- * and determine if we need to do any further work based on those.
6
- */
7
- var subControl = wp.customize.settings.controls[ setting ],
8
- $select,
9
- selectize,
10
- controlType,
11
- alphaColorControl,
12
- typographyColor;
13
- /**
14
- * Check if the control we want to affect actually exists.
15
- * If not then skip the item,
16
- */
17
- if ( undefined === typeof subControl ) {
18
- return true;
19
- }
20
-
21
- /**
22
- * Get the control-type of this sub-setting.
23
- * We want the value to live-update on the controls themselves,
24
- * so depending on the control's type we'll need to do different things.
25
- */
26
- controlType = subControl.type;
27
-
28
- /**
29
- * Below we're starting to check the control tyype and depending on what that is,
30
- * make the necessary adjustments to it.
31
- */
32
-
33
- if ( 'kirki-checkbox' === controlType || 'kirki-switch' === controlType || 'kirki-toggle' === controlType ) {
34
-
35
- if ( 1 === value || '1' === value || true === value ) {
36
-
37
- // Update the value visually in the control
38
- jQuery( wp.customize.control( setting ).container.find( 'input' ) ).prop( 'checked', true );
39
-
40
- // Update the value in the customizer object
41
- wp.customize.instance( setting ).set( true );
42
-
43
- } else {
44
-
45
- // Update the value visually in the control
46
- jQuery( wp.customize.control( setting ).container.find( 'input' ) ).prop( 'checked', false );
47
-
48
- // Update the value in the customizer object
49
- wp.customize.instance( setting ).set( false );
50
-
51
- }
52
-
53
- } else if ( 'kirki-select' === controlType || 'kirki-preset' === controlType ) {
54
-
55
- // Update the value visually in the control
56
- $select = jQuery( wp.customize.control( setting ).container.find( 'select' ) ).selectize();
57
- selectize = $select[0].selectize;
58
- selectize.setValue( value, true );
59
-
60
- // Update the value in the customizer object
61
- wp.customize.instance( setting ).set( value );
62
-
63
- } else if ( 'kirki-slider' === controlType ) {
64
-
65
- // Update the value visually in the control (slider)
66
- jQuery( wp.customize.control( setting ).container.find( 'input' ) ).prop( 'value', value );
67
-
68
- // Update the value visually in the control (number)
69
- jQuery( wp.customize.control( setting ).container.find( '.kirki_range_value .value' ) ).html( value );
70
-
71
- // Update the value in the customizer object
72
- wp.customize.instance( setting ).set( value );
73
-
74
- } else if ( 'kirki-generic' === controlType && undefined !== subControl.choices && undefined !== subControl.choices.element && 'textarea' === subControl.choices.element ) {
75
-
76
- // Update the value visually in the control
77
- jQuery( wp.customize.control( setting ).container.find( 'textarea' ) ).prop( 'value', value );
78
-
79
- // Update the value in the customizer object
80
- wp.customize( setting ).set( value );
81
-
82
- } else if ( 'kirki-color' === controlType ) {
83
-
84
- // Update the value visually in the control
85
- alphaColorControl = wp.customize.control( setting ).container.find( '.kirki-color-control' );
86
-
87
- alphaColorControl
88
- .attr( 'data-default-color', value )
89
- .data( 'default-color', value )
90
- .wpColorPicker( 'color', value );
91
-
92
- // Update the value in the customizer object
93
- wp.customize.instance( setting ).set( value );
94
-
95
- } else if ( 'kirki-multicheck' === controlType ) {
96
-
97
- // Update the value in the customizer object
98
- wp.customize.instance( setting ).set( value );
99
-
100
- /**
101
- * Update the value visually in the control.
102
- * This value is an array so we'll have to go through each one of the items
103
- * in order to properly apply the value and check each checkbox separately.
104
- *
105
- * First we uncheck ALL checkboxes in the control
106
- * Then we check the ones that we want.
107
- */
108
- wp.customize.control( setting ).container.find( 'input' ).each(function() {
109
- jQuery( this ).prop( 'checked', false );
110
- });
111
-
112
- _.each( value, function( subValue, i ) {
113
- jQuery( wp.customize.control( setting ).container.find( 'input[value="' + value[ i ] + '"]' ) ).prop( 'checked', true );
114
- });
115
-
116
- } else if ( 'kirki-radio-buttonset' === controlType || 'kirki-radio-image' === controlType || 'kirki-radio' === controlType || 'kirki-dashicons' === controlType || 'kirki-color-palette' === controlType || 'kirki-palette' === controlType ) {
117
-
118
- // Update the value visually in the control
119
- jQuery( wp.customize.control( setting ).container.find( 'input[value="' + value + '"]' ) ).prop( 'checked', true );
120
-
121
- // Update the value in the customizer object
122
- wp.customize.instance( setting ).set( value );
123
-
124
- } else if ( 'kirki-typography' === controlType ) {
125
-
126
- if ( undefined !== value['font-family'] ) {
127
-
128
- $select = jQuery( wp.customize.control( setting ).container.find( '.font-family select' ) ).selectize();
129
-
130
- if ( 'undefined' !== typeof select ) {
131
- selectize = $select[0].selectize;
132
-
133
- // Update the value visually in the control
134
- selectize.setValue( value['font-family'], true );
135
- }
136
-
137
- }
138
-
139
- if ( undefined !== value.variant ) {
140
-
141
- $select = jQuery( wp.customize.control( setting ).container.find( '.variant select' ) ).selectize();
142
-
143
- if ( 'undefined' !== typeof select ) {
144
- selectize = $select[0].selectize;
145
-
146
- // Update the value visually in the control
147
- selectize.setValue( value.variant, true );
148
- }
149
-
150
- }
151
-
152
- if ( undefined !== value.subsets ) {
153
-
154
- $select = jQuery( wp.customize.control( setting ).container.find( '.subset select' ) ).selectize();
155
-
156
- if ( 'undefined' !== typeof select ) {
157
- selectize = $select[0].selectize;
158
-
159
- // Update the value visually in the control
160
- selectize.setValue( value.subset, true );
161
- }
162
-
163
- }
164
-
165
- if ( undefined !== value['font-size'] ) {
166
-
167
- // Update the value visually in the control
168
- jQuery( wp.customize.control( setting ).container.find( '.font-size input' ) ).prop( 'value', value['font-size'] );
169
-
170
- }
171
-
172
- if ( undefined !== value['line-height'] ) {
173
-
174
- // Update the value visually in the control
175
- jQuery( wp.customize.control( setting ).container.find( '.line-height input' ) ).prop( 'value', value['line-height'] );
176
-
177
- }
178
-
179
- if ( undefined !== value['letter-spacing'] ) {
180
-
181
- // Update the value visually in the control
182
- jQuery( wp.customize.control( setting ).container.find( '.letter-spacing input' ) ).prop( 'value', value['letter-spacing'] );
183
-
184
- }
185
-
186
- if ( undefined !== value.color ) {
187
-
188
- // Update the value visually in the control
189
- typographyColor = wp.customize.control( setting ).container.find( '.kirki-color-control' );
190
-
191
- typographyColor
192
- .attr( 'data-default-color', value )
193
- .data( 'default-color', value )
194
- .wpColorPicker( 'color', value );
195
- }
196
-
197
- // Update the value in the customizer object
198
- wp.customize.instance( setting ).set( value );
199
-
200
- } else if ( 'kirki-repeater' === controlType ) {
201
-
202
- // Do nothing
203
- }
204
-
205
- /**
206
- * Fallback for all other controls.
207
- */
208
- else {
209
-
210
- // Update the value visually in the control
211
- jQuery( wp.customize.control( setting ).container.find( 'input' ) ).prop( 'value', value );
212
-
213
- // Update the value in the customizer object
214
- wp.customize.instance( setting ).set( value );
215
-
216
- }
217
-
218
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/functions/validate-css-value.js DELETED
@@ -1,35 +0,0 @@
1
- function kirkiValidateCSSValue( value ) {
2
-
3
- var validUnits = ['rem', 'em', 'ex', '%', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ch', 'vh', 'vw', 'vmin', 'vmax'],
4
- numericValue,
5
- unit;
6
-
7
- // 0 is always a valid value
8
- if ( '0' === value ) {
9
- return true;
10
- }
11
-
12
- // If we're using calc() just return true.
13
- if ( 0 <= value.indexOf( 'calc(' ) && 0 <= value.indexOf( ')' ) ) {
14
- return true;
15
- }
16
-
17
- // Get the numeric value.
18
- numericValue = parseFloat( value );
19
-
20
- // Get the unit
21
- unit = value.replace( numericValue, '' );
22
-
23
- // Check the validity of the numeric value.
24
- if ( isNaN( numericValue ) ) {
25
- return false;
26
- }
27
-
28
- // Check the validity of the units.
29
- if ( -1 === jQuery.inArray( unit, validUnits ) ) {
30
- return false;
31
- }
32
-
33
- return true;
34
-
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/l10n.js DELETED
@@ -1,4 +0,0 @@
1
- if ( undefined === window.kirki || 'undefined' === typeof window.kirki ) {
2
- window.kirki = {};
3
- }
4
- window.kirki.l10n = kirkiL10n;
 
 
 
 
assets/js/postmessage.js DELETED
@@ -1,153 +0,0 @@
1
- ( function() {
2
- var api = wp.customize;
3
-
4
- _.each( jsvars, function( jsVars, setting ) {
5
-
6
- var css = '',
7
- cssArray = {};
8
-
9
- api( setting, function( value ) {
10
-
11
- value.bind( function( newval ) {
12
-
13
- if ( undefined !== jsVars && 0 < jsVars.length ) {
14
-
15
- _.each( jsVars, function( jsVar ) {
16
-
17
- var val = newval;
18
-
19
- // Make sure element is defined.
20
- if ( undefined === jsVar.element ) {
21
- jsVar.element = '';
22
- }
23
-
24
- // Make sure property is defined.
25
- if ( undefined === jsVar.property ) {
26
- jsVar.property = '';
27
- }
28
-
29
- // Use empty prefix if undefined
30
- if ( undefined === jsVar.prefix ) {
31
- jsVar.prefix = '';
32
- }
33
-
34
- // Use empty suffix if undefined
35
- if ( undefined === jsVar.suffix ) {
36
- jsVar.suffix = '';
37
- }
38
-
39
- // Use empty units if undefined
40
- if ( undefined === jsVar.units ) {
41
- jsVar.units = '';
42
- }
43
-
44
- // Use css if method is undefined
45
- if ( undefined === jsVar['function'] ) {
46
- jsVar['function'] = 'css';
47
- }
48
-
49
- // Use $ (just the value) if value_pattern is undefined
50
- if ( undefined === jsVar.value_pattern ) {
51
- jsVar.value_pattern = '$';
52
- }
53
-
54
- _.each( jsVars, function( args, i ) {
55
-
56
- // Value is a string
57
- if ( 'string' === typeof newval ) {
58
-
59
- // Process the value pattern
60
- if ( undefined !== args.value_pattern ) {
61
- val = args.value_pattern.replace( /\$/g, args.prefix + newval + args.units + args.suffix );
62
- } else {
63
- val = args.prefix + newval + args.units + args.suffix;
64
- }
65
-
66
- // Simple tweak for background-image properties.
67
- if ( 'background-image' === args.property ) {
68
- if ( 0 > val.indexOf( 'url(' ) ) {
69
- val = 'url("' + val + '")';
70
- }
71
- }
72
-
73
- // Inject HTML
74
- if ( 'html' === args['function'] ) {
75
- if ( 'undefined' !== typeof args.attr && undefined !== args.attr ) {
76
- jQuery( args.element ).attr( args.attr, val );
77
- } else {
78
- jQuery( args.element ).html( val );
79
- }
80
-
81
- // Add CSS
82
- } else {
83
-
84
- // If we have new value, replace style contents with custom css
85
- if ( '' !== val ) {
86
- cssArray[ i ] = args.element + '{' + args.property + ':' + val + ';}';
87
- }
88
-
89
- // Else let's clear it out
90
- else {
91
- cssArray[ i ] = '';
92
- }
93
-
94
- }
95
-
96
- // Value is an object
97
- } else if ( 'object' === typeof newval ) {
98
-
99
- cssArray[ i ] = '';
100
- _.each( newval, function( subValueValue, subValueKey ) {
101
- if ( undefined !== args.choice ) {
102
- if ( args.choice === subValueKey ) {
103
- cssArray[ i ] += args.element + '{' + args.property + ':' + args.prefix + subValueValue + args.units + args.suffix + ';}';
104
- }
105
- } else {
106
- if ( _.contains( [ 'top', 'bottom', 'left', 'right' ], subValueKey ) ) {
107
- cssArray[ i ] += args.element + '{' + args.property + '-' + subValueKey + ':' + args.prefix + subValueValue + args.units + args.suffix + ';}';
108
- } else {
109
- cssArray[ i ] += args.element + '{' + subValueKey + ':' + args.prefix + subValueValue + args.units + args.suffix + ';}';
110
- }
111
- }
112
- });
113
-
114
- }
115
-
116
- });
117
-
118
- });
119
-
120
- _.each( cssArray, function( singleCSS ) {
121
-
122
- css = '';
123
-
124
- setTimeout( function() {
125
-
126
- if ( '' !== singleCSS ) {
127
- css += singleCSS;
128
- }
129
-
130
- // Attach to <head>
131
- if ( '' !== css ) {
132
-
133
- // Make sure we have a stylesheet with the defined ID.
134
- // If we don't then add it.
135
- if ( ! jQuery( '#kirki-customizer-postmessage' + setting.replace( /\[/g, '-' ).replace( /\]/g, '' ) ).size() ) {
136
- jQuery( 'head' ).append( '<style id="kirki-customizer-postmessage' + setting.replace( /\[/g, '-' ).replace( /\]/g, '' ) + '"></style>' );
137
- }
138
- jQuery( '#kirki-customizer-postmessage' + setting.replace( /\[/g, '-' ).replace( /\]/g, '' ) ).text( css );
139
- }
140
-
141
- }, 100 );
142
-
143
- });
144
-
145
- }
146
-
147
- });
148
-
149
- });
150
-
151
- });
152
-
153
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/reset.js DELETED
@@ -1,20 +0,0 @@
1
- jQuery( document ).ready( function() {
2
-
3
- 'use strict';
4
-
5
- jQuery( 'a.kirki-reset-section' ).on( 'click', function() {
6
-
7
- var id = jQuery( this ).data( 'reset-section-id' ),
8
- controls = wp.customize.section( id ).controls();
9
-
10
- // Loop controls
11
- _.each( controls, function( control, i ) {
12
-
13
- // Set value to default
14
- kirkiSetSettingValue( controls[ i ].id, control.params['default'] );
15
-
16
- });
17
-
18
- });
19
-
20
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/tooltip.js DELETED
@@ -1,3 +0,0 @@
1
- jQuery( document ).ready( function( $ ) {
2
- $( 'a.tooltip' ).tooltip();
3
- });
 
 
 
assets/js/vendor/codemirror/mode/apl/apl.js ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("apl", function() {
15
+ var builtInOps = {
16
+ ".": "innerProduct",
17
+ "\\": "scan",
18
+ "/": "reduce",
19
+ "⌿": "reduce1Axis",
20
+ "⍀": "scan1Axis",
21
+ "¨": "each",
22
+ "⍣": "power"
23
+ };
24
+ var builtInFuncs = {
25
+ "+": ["conjugate", "add"],
26
+ "−": ["negate", "subtract"],
27
+ "×": ["signOf", "multiply"],
28
+ "÷": ["reciprocal", "divide"],
29
+ "⌈": ["ceiling", "greaterOf"],
30
+ "⌊": ["floor", "lesserOf"],
31
+ "∣": ["absolute", "residue"],
32
+ "⍳": ["indexGenerate", "indexOf"],
33
+ "?": ["roll", "deal"],
34
+ "⋆": ["exponentiate", "toThePowerOf"],
35
+ "⍟": ["naturalLog", "logToTheBase"],
36
+ "○": ["piTimes", "circularFuncs"],
37
+ "!": ["factorial", "binomial"],
38
+ "⌹": ["matrixInverse", "matrixDivide"],
39
+ "<": [null, "lessThan"],
40
+ "≤": [null, "lessThanOrEqual"],
41
+ "=": [null, "equals"],
42
+ ">": [null, "greaterThan"],
43
+ "≥": [null, "greaterThanOrEqual"],
44
+ "≠": [null, "notEqual"],
45
+ "≡": ["depth", "match"],
46
+ "≢": [null, "notMatch"],
47
+ "∈": ["enlist", "membership"],
48
+ "⍷": [null, "find"],
49
+ "∪": ["unique", "union"],
50
+ "∩": [null, "intersection"],
51
+ "∼": ["not", "without"],
52
+ "∨": [null, "or"],
53
+ "∧": [null, "and"],
54
+ "⍱": [null, "nor"],
55
+ "⍲": [null, "nand"],
56
+ "⍴": ["shapeOf", "reshape"],
57
+ ",": ["ravel", "catenate"],
58
+ "⍪": [null, "firstAxisCatenate"],
59
+ "⌽": ["reverse", "rotate"],
60
+ "⊖": ["axis1Reverse", "axis1Rotate"],
61
+ "⍉": ["transpose", null],
62
+ "↑": ["first", "take"],
63
+ "↓": [null, "drop"],
64
+ "⊂": ["enclose", "partitionWithAxis"],
65
+ "⊃": ["diclose", "pick"],
66
+ "⌷": [null, "index"],
67
+ "⍋": ["gradeUp", null],
68
+ "⍒": ["gradeDown", null],
69
+ "⊤": ["encode", null],
70
+ "⊥": ["decode", null],
71
+ "⍕": ["format", "formatByExample"],
72
+ "⍎": ["execute", null],
73
+ "⊣": ["stop", "left"],
74
+ "⊢": ["pass", "right"]
75
+ };
76
+
77
+ var isOperator = /[\.\/⌿⍀¨⍣]/;
78
+ var isNiladic = /⍬/;
79
+ var isFunction = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/;
80
+ var isArrow = /←/;
81
+ var isComment = /[⍝#].*$/;
82
+
83
+ var stringEater = function(type) {
84
+ var prev;
85
+ prev = false;
86
+ return function(c) {
87
+ prev = c;
88
+ if (c === type) {
89
+ return prev === "\\";
90
+ }
91
+ return true;
92
+ };
93
+ };
94
+ return {
95
+ startState: function() {
96
+ return {
97
+ prev: false,
98
+ func: false,
99
+ op: false,
100
+ string: false,
101
+ escape: false
102
+ };
103
+ },
104
+ token: function(stream, state) {
105
+ var ch, funcName;
106
+ if (stream.eatSpace()) {
107
+ return null;
108
+ }
109
+ ch = stream.next();
110
+ if (ch === '"' || ch === "'") {
111
+ stream.eatWhile(stringEater(ch));
112
+ stream.next();
113
+ state.prev = true;
114
+ return "string";
115
+ }
116
+ if (/[\[{\(]/.test(ch)) {
117
+ state.prev = false;
118
+ return null;
119
+ }
120
+ if (/[\]}\)]/.test(ch)) {
121
+ state.prev = true;
122
+ return null;
123
+ }
124
+ if (isNiladic.test(ch)) {
125
+ state.prev = false;
126
+ return "niladic";
127
+ }
128
+ if (/[¯\d]/.test(ch)) {
129
+ if (state.func) {
130
+ state.func = false;
131
+ state.prev = false;
132
+ } else {
133
+ state.prev = true;
134
+ }
135
+ stream.eatWhile(/[\w\.]/);
136
+ return "number";
137
+ }
138
+ if (isOperator.test(ch)) {
139
+ return "operator apl-" + builtInOps[ch];
140
+ }
141
+ if (isArrow.test(ch)) {
142
+ return "apl-arrow";
143
+ }
144
+ if (isFunction.test(ch)) {
145
+ funcName = "apl-";
146
+ if (builtInFuncs[ch] != null) {
147
+ if (state.prev) {
148
+ funcName += builtInFuncs[ch][1];
149
+ } else {
150
+ funcName += builtInFuncs[ch][0];
151
+ }
152
+ }
153
+ state.func = true;
154
+ state.prev = false;
155
+ return "function " + funcName;
156
+ }
157
+ if (isComment.test(ch)) {
158
+ stream.skipToEnd();
159
+ return "comment";
160
+ }
161
+ if (ch === "∘" && stream.peek() === ".") {
162
+ stream.next();
163
+ return "function jot-dot";
164
+ }
165
+ stream.eatWhile(/[\w\$_]/);
166
+ state.prev = true;
167
+ return "keyword";
168
+ }
169
+ };
170
+ });
171
+
172
+ CodeMirror.defineMIME("text/apl", "apl");
173
+
174
+ });
assets/js/vendor/codemirror/mode/apl/index.html ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: APL mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="./apl.js"></script>
11
+ <style>
12
+ .CodeMirror { border: 2px inset #dee; }
13
+ </style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#">APL</a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>APL mode</h2>
30
+ <form><textarea id="code" name="code">
31
+ ⍝ Conway's game of life
32
+
33
+ ⍝ This example was inspired by the impressive demo at
34
+ ⍝ http://www.youtube.com/watch?v=a9xAKttWgP4
35
+
36
+ ⍝ Create a matrix:
37
+ ⍝ 0 1 1
38
+ ⍝ 1 1 0
39
+ ⍝ 0 1 0
40
+ creature ← (3 3 ⍴ ⍳ 9) ∈ 1 2 3 4 7 ⍝ Original creature from demo
41
+ creature ← (3 3 ⍴ ⍳ 9) ∈ 1 3 6 7 8 ⍝ Glider
42
+
43
+ ⍝ Place the creature on a larger board, near the centre
44
+ board ← ¯1 ⊖ ¯2 ⌽ 5 7 ↑ creature
45
+
46
+ ⍝ A function to move from one generation to the next
47
+ life ← {∨/ 1 ⍵ ∧ 3 4 = ⊂+/ +⌿ 1 0 ¯1 ∘.⊖ 1 0 ¯1 ⌽¨ ⊂⍵}
48
+
49
+ ⍝ Compute n-th generation and format it as a
50
+ ⍝ character matrix
51
+ gen ← {' #'[(life ⍣ ⍵) board]}
52
+
53
+ ⍝ Show first three generations
54
+ (gen 1) (gen 2) (gen 3)
55
+ </textarea></form>
56
+
57
+ <script>
58
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
59
+ lineNumbers: true,
60
+ matchBrackets: true,
61
+ mode: "text/apl"
62
+ });
63
+ </script>
64
+
65
+ <p>Simple mode that tries to handle APL as well as it can.</p>
66
+ <p>It attempts to label functions/operators based upon
67
+ monadic/dyadic usage (but this is far from fully fleshed out).
68
+ This means there are meaningful classnames so hover states can
69
+ have popups etc.</p>
70
+
71
+ <p><strong>MIME types defined:</strong> <code>text/apl</code> (APL code)</p>
72
+ </article>
assets/js/vendor/codemirror/mode/asciiarmor/asciiarmor.js ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ function errorIfNotEmpty(stream) {
15
+ var nonWS = stream.match(/^\s*\S/);
16
+ stream.skipToEnd();
17
+ return nonWS ? "error" : null;
18
+ }
19
+
20
+ CodeMirror.defineMode("asciiarmor", function() {
21
+ return {
22
+ token: function(stream, state) {
23
+ var m;
24
+ if (state.state == "top") {
25
+ if (stream.sol() && (m = stream.match(/^-----BEGIN (.*)?-----\s*$/))) {
26
+ state.state = "headers";
27
+ state.type = m[1];
28
+ return "tag";
29
+ }
30
+ return errorIfNotEmpty(stream);
31
+ } else if (state.state == "headers") {
32
+ if (stream.sol() && stream.match(/^\w+:/)) {
33
+ state.state = "header";
34
+ return "atom";
35
+ } else {
36
+ var result = errorIfNotEmpty(stream);
37
+ if (result) state.state = "body";
38
+ return result;
39
+ }
40
+ } else if (state.state == "header") {
41
+ stream.skipToEnd();
42
+ state.state = "headers";
43
+ return "string";
44
+ } else if (state.state == "body") {
45
+ if (stream.sol() && (m = stream.match(/^-----END (.*)?-----\s*$/))) {
46
+ if (m[1] != state.type) return "error";
47
+ state.state = "end";
48
+ return "tag";
49
+ } else {
50
+ if (stream.eatWhile(/[A-Za-z0-9+\/=]/)) {
51
+ return null;
52
+ } else {
53
+ stream.next();
54
+ return "error";
55
+ }
56
+ }
57
+ } else if (state.state == "end") {
58
+ return errorIfNotEmpty(stream);
59
+ }
60
+ },
61
+ blankLine: function(state) {
62
+ if (state.state == "headers") state.state = "body";
63
+ },
64
+ startState: function() {
65
+ return {state: "top", type: null};
66
+ }
67
+ };
68
+ });
69
+
70
+ CodeMirror.defineMIME("application/pgp", "asciiarmor");
71
+ CodeMirror.defineMIME("application/pgp-keys", "asciiarmor");
72
+ CodeMirror.defineMIME("application/pgp-signature", "asciiarmor");
73
+ });
assets/js/vendor/codemirror/mode/asciiarmor/index.html ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: ASCII Armor (PGP) mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="asciiarmor.js"></script>
10
+ <style>.CodeMirror {background: #f8f8f8;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">ASCII Armor</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>ASCII Armor (PGP) mode</h2>
27
+ <form><textarea id="code" name="code">
28
+ -----BEGIN PGP MESSAGE-----
29
+ Version: OpenPrivacy 0.99
30
+
31
+ yDgBO22WxBHv7O8X7O/jygAEzol56iUKiXmV+XmpCtmpqQUKiQrFqclFqUDBovzS
32
+ vBSFjNSiVHsuAA==
33
+ =njUN
34
+ -----END PGP MESSAGE-----
35
+ </textarea></form>
36
+
37
+ <script>
38
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
39
+ lineNumbers: true
40
+ });
41
+ </script>
42
+
43
+ <p><strong>MIME types
44
+ defined:</strong> <code>application/pgp</code>, <code>application/pgp-keys</code>, <code>application/pgp-signature</code></p>
45
+
46
+ </article>
assets/js/vendor/codemirror/mode/asn.1/asn.1.js ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("asn.1", function(config, parserConfig) {
15
+ var indentUnit = config.indentUnit,
16
+ keywords = parserConfig.keywords || {},
17
+ cmipVerbs = parserConfig.cmipVerbs || {},
18
+ compareTypes = parserConfig.compareTypes || {},
19
+ status = parserConfig.status || {},
20
+ tags = parserConfig.tags || {},
21
+ storage = parserConfig.storage || {},
22
+ modifier = parserConfig.modifier || {},
23
+ accessTypes = parserConfig.accessTypes|| {},
24
+ multiLineStrings = parserConfig.multiLineStrings,
25
+ indentStatements = parserConfig.indentStatements !== false;
26
+ var isOperatorChar = /[\|\^]/;
27
+ var curPunc;
28
+
29
+ function tokenBase(stream, state) {
30
+ var ch = stream.next();
31
+ if (ch == '"' || ch == "'") {
32
+ state.tokenize = tokenString(ch);
33
+ return state.tokenize(stream, state);
34
+ }
35
+ if (/[\[\]\(\){}:=,;]/.test(ch)) {
36
+ curPunc = ch;
37
+ return "punctuation";
38
+ }
39
+ if (ch == "-"){
40
+ if (stream.eat("-")) {
41
+ stream.skipToEnd();
42
+ return "comment";
43
+ }
44
+ }
45
+ if (/\d/.test(ch)) {
46
+ stream.eatWhile(/[\w\.]/);
47
+ return "number";
48
+ }
49
+ if (isOperatorChar.test(ch)) {
50
+ stream.eatWhile(isOperatorChar);
51
+ return "operator";
52
+ }
53
+
54
+ stream.eatWhile(/[\w\-]/);
55
+ var cur = stream.current();
56
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
57
+ if (cmipVerbs.propertyIsEnumerable(cur)) return "variable cmipVerbs";
58
+ if (compareTypes.propertyIsEnumerable(cur)) return "atom compareTypes";
59
+ if (status.propertyIsEnumerable(cur)) return "comment status";
60
+ if (tags.propertyIsEnumerable(cur)) return "variable-3 tags";
61
+ if (storage.propertyIsEnumerable(cur)) return "builtin storage";
62
+ if (modifier.propertyIsEnumerable(cur)) return "string-2 modifier";
63
+ if (accessTypes.propertyIsEnumerable(cur)) return "atom accessTypes";
64
+
65
+ return "variable";
66
+ }
67
+
68
+ function tokenString(quote) {
69
+ return function(stream, state) {
70
+ var escaped = false, next, end = false;
71
+ while ((next = stream.next()) != null) {
72
+ if (next == quote && !escaped){
73
+ var afterNext = stream.peek();
74
+ //look if the character if the quote is like the B in '10100010'B
75
+ if (afterNext){
76
+ afterNext = afterNext.toLowerCase();
77
+ if(afterNext == "b" || afterNext == "h" || afterNext == "o")
78
+ stream.next();
79
+ }
80
+ end = true; break;
81
+ }
82
+ escaped = !escaped && next == "\\";
83
+ }
84
+ if (end || !(escaped || multiLineStrings))
85
+ state.tokenize = null;
86
+ return "string";
87
+ };
88
+ }
89
+
90
+ function Context(indented, column, type, align, prev) {
91
+ this.indented = indented;
92
+ this.column = column;
93
+ this.type = type;
94
+ this.align = align;
95
+ this.prev = prev;
96
+ }
97
+ function pushContext(state, col, type) {
98
+ var indent = state.indented;
99
+ if (state.context && state.context.type == "statement")
100
+ indent = state.context.indented;
101
+ return state.context = new Context(indent, col, type, null, state.context);
102
+ }
103
+ function popContext(state) {
104
+ var t = state.context.type;
105
+ if (t == ")" || t == "]" || t == "}")
106
+ state.indented = state.context.indented;
107
+ return state.context = state.context.prev;
108
+ }
109
+
110
+ //Interface
111
+ return {
112
+ startState: function(basecolumn) {
113
+ return {
114
+ tokenize: null,
115
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
116
+ indented: 0,
117
+ startOfLine: true
118
+ };
119
+ },
120
+
121
+ token: function(stream, state) {
122
+ var ctx = state.context;
123
+ if (stream.sol()) {
124
+ if (ctx.align == null) ctx.align = false;
125
+ state.indented = stream.indentation();
126
+ state.startOfLine = true;
127
+ }
128
+ if (stream.eatSpace()) return null;
129
+ curPunc = null;
130
+ var style = (state.tokenize || tokenBase)(stream, state);
131
+ if (style == "comment") return style;
132
+ if (ctx.align == null) ctx.align = true;
133
+
134
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
135
+ && ctx.type == "statement"){
136
+ popContext(state);
137
+ }
138
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
139
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
140
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
141
+ else if (curPunc == "}") {
142
+ while (ctx.type == "statement") ctx = popContext(state);
143
+ if (ctx.type == "}") ctx = popContext(state);
144
+ while (ctx.type == "statement") ctx = popContext(state);
145
+ }
146
+ else if (curPunc == ctx.type) popContext(state);
147
+ else if (indentStatements && (((ctx.type == "}" || ctx.type == "top")
148
+ && curPunc != ';') || (ctx.type == "statement"
149
+ && curPunc == "newstatement")))
150
+ pushContext(state, stream.column(), "statement");
151
+
152
+ state.startOfLine = false;
153
+ return style;
154
+ },
155
+
156
+ electricChars: "{}",
157
+ lineComment: "--",
158
+ fold: "brace"
159
+ };
160
+ });
161
+
162
+ function words(str) {
163
+ var obj = {}, words = str.split(" ");
164
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
165
+ return obj;
166
+ }
167
+
168
+ CodeMirror.defineMIME("text/x-ttcn-asn", {
169
+ name: "asn.1",
170
+ keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION" +
171
+ " REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED" +
172
+ " WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN" +
173
+ " IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS" +
174
+ " MINACCESS MAXACCESS REVISION STATUS DESCRIPTION" +
175
+ " SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName" +
176
+ " ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY" +
177
+ " IMPLIED EXPORTS"),
178
+ cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"),
179
+ compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY" +
180
+ " MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY" +
181
+ " OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL" +
182
+ " SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL" +
183
+ " TEXTUAL-CONVENTION"),
184
+ status: words("current deprecated mandatory obsolete"),
185
+ tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS" +
186
+ " UNIVERSAL"),
187
+ storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING" +
188
+ " UTCTime InterfaceIndex IANAifType CMIP-Attribute" +
189
+ " REAL PACKAGE PACKAGES IpAddress PhysAddress" +
190
+ " NetworkAddress BITS BMPString TimeStamp TimeTicks" +
191
+ " TruthValue RowStatus DisplayString GeneralString" +
192
+ " GraphicString IA5String NumericString" +
193
+ " PrintableString SnmpAdminAtring TeletexString" +
194
+ " UTF8String VideotexString VisibleString StringStore" +
195
+ " ISO646String T61String UniversalString Unsigned32" +
196
+ " Integer32 Gauge Gauge32 Counter Counter32 Counter64"),
197
+ modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS" +
198
+ " GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS" +
199
+ " DEFINED"),
200
+ accessTypes: words("not-accessible accessible-for-notify read-only" +
201
+ " read-create read-write"),
202
+ multiLineStrings: true
203
+ });
204
+ });
assets/js/vendor/codemirror/mode/asn.1/index.html ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: ASN.1 mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="asn.1.js"></script>
10
+ <style type="text/css">
11
+ .CodeMirror {
12
+ border-top: 1px solid black;
13
+ border-bottom: 1px solid black;
14
+ }
15
+ </style>
16
+ <div id=nav>
17
+ <a href="http://codemirror.net"><h1>CodeMirror</h1>
18
+ <img id=logo src="../../doc/logo.png">
19
+ </a>
20
+
21
+ <ul>
22
+ <li><a href="../../index.html">Home</a>
23
+ <li><a href="../../doc/manual.html">Manual</a>
24
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
25
+ </ul>
26
+ <ul>
27
+ <li><a href="../index.html">Language modes</a>
28
+ <li><a class=active href="http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One">ASN.1</a>
29
+ </ul>
30
+ </div>
31
+ <article>
32
+ <h2>ASN.1 example</h2>
33
+ <div>
34
+ <textarea id="ttcn-asn-code">
35
+ --
36
+ -- Sample ASN.1 Code
37
+ --
38
+ MyModule DEFINITIONS ::=
39
+ BEGIN
40
+
41
+ MyTypes ::= SEQUENCE {
42
+ myObjectId OBJECT IDENTIFIER,
43
+ mySeqOf SEQUENCE OF MyInt,
44
+ myBitString BIT STRING {
45
+ muxToken(0),
46
+ modemToken(1)
47
+ }
48
+ }
49
+
50
+ MyInt ::= INTEGER (0..65535)
51
+
52
+ END
53
+ </textarea>
54
+ </div>
55
+
56
+ <script>
57
+ var ttcnEditor = CodeMirror.fromTextArea(document.getElementById("ttcn-asn-code"), {
58
+ lineNumbers: true,
59
+ matchBrackets: true,
60
+ mode: "text/x-ttcn-asn"
61
+ });
62
+ ttcnEditor.setSize(400, 400);
63
+ var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
64
+ CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
65
+ </script>
66
+ <br/>
67
+ <p><strong>Language:</strong> Abstract Syntax Notation One
68
+ (<a href="http://www.itu.int/en/ITU-T/asn1/Pages/introduction.aspx">ASN.1</a>)
69
+ </p>
70
+ <p><strong>MIME types defined:</strong> <code>text/x-ttcn-asn</code></p>
71
+
72
+ <br/>
73
+ <p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
74
+ </a>.</p>
75
+ <p>Coded by Asmelash Tsegay Gebretsadkan </p>
76
+ </article>
77
+ </article>
78
+
assets/js/vendor/codemirror/mode/asterisk/asterisk.js ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /*
5
+ * =====================================================================================
6
+ *
7
+ * Filename: mode/asterisk/asterisk.js
8
+ *
9
+ * Description: CodeMirror mode for Asterisk dialplan
10
+ *
11
+ * Created: 05/17/2012 09:20:25 PM
12
+ * Revision: none
13
+ *
14
+ * Author: Stas Kobzar (stas@modulis.ca),
15
+ * Company: Modulis.ca Inc.
16
+ *
17
+ * =====================================================================================
18
+ */
19
+
20
+ (function(mod) {
21
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
22
+ mod(require("../../lib/codemirror"));
23
+ else if (typeof define == "function" && define.amd) // AMD
24
+ define(["../../lib/codemirror"], mod);
25
+ else // Plain browser env
26
+ mod(CodeMirror);
27
+ })(function(CodeMirror) {
28
+ "use strict";
29
+
30
+ CodeMirror.defineMode("asterisk", function() {
31
+ var atoms = ["exten", "same", "include","ignorepat","switch"],
32
+ dpcmd = ["#include","#exec"],
33
+ apps = [
34
+ "addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi",
35
+ "alarmreceiver","amd","answer","authenticate","background","backgrounddetect",
36
+ "bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent",
37
+ "changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge",
38
+ "congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge",
39
+ "dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility",
40
+ "datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa",
41
+ "dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy",
42
+ "externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif",
43
+ "goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete",
44
+ "ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus",
45
+ "jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme",
46
+ "meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete",
47
+ "minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode",
48
+ "mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish",
49
+ "originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce",
50
+ "parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones",
51
+ "privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten",
52
+ "readfile","receivefax","receivefax","receivefax","record","removequeuemember",
53
+ "resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun",
54
+ "saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax",
55
+ "sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags",
56
+ "setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel",
57
+ "slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground",
58
+ "speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound",
59
+ "speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor",
60
+ "stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec",
61
+ "trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate",
62
+ "vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring",
63
+ "waitforsilence","waitmusiconhold","waituntil","while","zapateller"
64
+ ];
65
+
66
+ function basicToken(stream,state){
67
+ var cur = '';
68
+ var ch = stream.next();
69
+ // comment
70
+ if(ch == ";") {
71
+ stream.skipToEnd();
72
+ return "comment";
73
+ }
74
+ // context
75
+ if(ch == '[') {
76
+ stream.skipTo(']');
77
+ stream.eat(']');
78
+ return "header";
79
+ }
80
+ // string
81
+ if(ch == '"') {
82
+ stream.skipTo('"');
83
+ return "string";
84
+ }
85
+ if(ch == "'") {
86
+ stream.skipTo("'");
87
+ return "string-2";
88
+ }
89
+ // dialplan commands
90
+ if(ch == '#') {
91
+ stream.eatWhile(/\w/);
92
+ cur = stream.current();
93
+ if(dpcmd.indexOf(cur) !== -1) {
94
+ stream.skipToEnd();
95
+ return "strong";
96
+ }
97
+ }
98
+ // application args
99
+ if(ch == '$'){
100
+ var ch1 = stream.peek();
101
+ if(ch1 == '{'){
102
+ stream.skipTo('}');
103
+ stream.eat('}');
104
+ return "variable-3";
105
+ }
106
+ }
107
+ // extension
108
+ stream.eatWhile(/\w/);
109
+ cur = stream.current();
110
+ if(atoms.indexOf(cur) !== -1) {
111
+ state.extenStart = true;
112
+ switch(cur) {
113
+ case 'same': state.extenSame = true; break;
114
+ case 'include':
115
+ case 'switch':
116
+ case 'ignorepat':
117
+ state.extenInclude = true;break;
118
+ default:break;
119
+ }
120
+ return "atom";
121
+ }
122
+ }
123
+
124
+ return {
125
+ startState: function() {
126
+ return {
127
+ extenStart: false,
128
+ extenSame: false,
129
+ extenInclude: false,
130
+ extenExten: false,
131
+ extenPriority: false,
132
+ extenApplication: false
133
+ };
134
+ },
135
+ token: function(stream, state) {
136
+
137
+ var cur = '';
138
+ if(stream.eatSpace()) return null;
139
+ // extension started
140
+ if(state.extenStart){
141
+ stream.eatWhile(/[^\s]/);
142
+ cur = stream.current();
143
+ if(/^=>?$/.test(cur)){
144
+ state.extenExten = true;
145
+ state.extenStart = false;
146
+ return "strong";
147
+ } else {
148
+ state.extenStart = false;
149
+ stream.skipToEnd();
150
+ return "error";
151
+ }
152
+ } else if(state.extenExten) {
153
+ // set exten and priority
154
+ state.extenExten = false;
155
+ state.extenPriority = true;
156
+ stream.eatWhile(/[^,]/);
157
+ if(state.extenInclude) {
158
+ stream.skipToEnd();
159
+ state.extenPriority = false;
160
+ state.extenInclude = false;
161
+ }
162
+ if(state.extenSame) {
163
+ state.extenPriority = false;
164
+ state.extenSame = false;
165
+ state.extenApplication = true;
166
+ }
167
+ return "tag";
168
+ } else if(state.extenPriority) {
169
+ state.extenPriority = false;
170
+ state.extenApplication = true;
171
+ stream.next(); // get comma
172
+ if(state.extenSame) return null;
173
+ stream.eatWhile(/[^,]/);
174
+ return "number";
175
+ } else if(state.extenApplication) {
176
+ stream.eatWhile(/,/);
177
+ cur = stream.current();
178
+ if(cur === ',') return null;
179
+ stream.eatWhile(/\w/);
180
+ cur = stream.current().toLowerCase();
181
+ state.extenApplication = false;
182
+ if(apps.indexOf(cur) !== -1){
183
+ return "def strong";
184
+ }
185
+ } else{
186
+ return basicToken(stream,state);
187
+ }
188
+
189
+ return null;
190
+ }
191
+ };
192
+ });
193
+
194
+ CodeMirror.defineMIME("text/x-asterisk", "asterisk");
195
+
196
+ });
assets/js/vendor/codemirror/mode/asterisk/index.html ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Asterisk dialplan mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="asterisk.js"></script>
10
+ <style>
11
+ .CodeMirror {border: 1px solid #999;}
12
+ .cm-s-default span.cm-arrow { color: red; }
13
+ </style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#">Asterisk dialplan</a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>Asterisk dialplan mode</h2>
30
+ <form><textarea id="code" name="code">
31
+ ; extensions.conf - the Asterisk dial plan
32
+ ;
33
+
34
+ [general]
35
+ ;
36
+ ; If static is set to no, or omitted, then the pbx_config will rewrite
37
+ ; this file when extensions are modified. Remember that all comments
38
+ ; made in the file will be lost when that happens.
39
+ static=yes
40
+
41
+ #include "/etc/asterisk/additional_general.conf
42
+
43
+ [iaxprovider]
44
+ switch => IAX2/user:[key]@myserver/mycontext
45
+
46
+ [dynamic]
47
+ #exec /usr/bin/dynamic-peers.pl
48
+
49
+ [trunkint]
50
+ ;
51
+ ; International long distance through trunk
52
+ ;
53
+ exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
54
+ exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${FILTER(0-9,${EXTEN:${GLOBAL(TRUNKMSD)}})})
55
+
56
+ [local]
57
+ ;
58
+ ; Master context for local, toll-free, and iaxtel calls only
59
+ ;
60
+ ignorepat => 9
61
+ include => default
62
+
63
+ [demo]
64
+ include => stdexten
65
+ ;
66
+ ; We start with what to do when a call first comes in.
67
+ ;
68
+ exten => s,1,Wait(1) ; Wait a second, just for fun
69
+ same => n,Answer ; Answer the line
70
+ same => n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
71
+ same => n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
72
+ same => n(restart),BackGround(demo-congrats) ; Play a congratulatory message
73
+ same => n(instruct),BackGround(demo-instruct) ; Play some instructions
74
+ same => n,WaitExten ; Wait for an extension to be dialed.
75
+
76
+ exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
77
+ exten => 2,n,Goto(s,instruct)
78
+
79
+ exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
80
+ exten => 3,n,Goto(s,restart) ; Start with the congratulations
81
+
82
+ exten => 1000,1,Goto(default,s,1)
83
+ ;
84
+ ; We also create an example user, 1234, who is on the console and has
85
+ ; voicemail, etc.
86
+ ;
87
+ exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
88
+ ; (but skip if channel is not up)
89
+ exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}))
90
+ exten => 1234,n,Goto(default,s,1) ; exited Voicemail
91
+
92
+ exten => 1235,1,Voicemail(1234,u) ; Right to voicemail
93
+
94
+ exten => 1236,1,Dial(Console/dsp) ; Ring forever
95
+ exten => 1236,n,Voicemail(1234,b) ; Unless busy
96
+
97
+ ;
98
+ ; # for when they're done with the demo
99
+ ;
100
+ exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
101
+ exten => #,n,Hangup ; Hang them up.
102
+
103
+ ;
104
+ ; A timeout and "invalid extension rule"
105
+ ;
106
+ exten => t,1,Goto(#,1) ; If they take too long, give up
107
+ exten => i,1,Playback(invalid) ; "That's not valid, try again"
108
+
109
+ ;
110
+ ; Create an extension, 500, for dialing the
111
+ ; Asterisk demo.
112
+ ;
113
+ exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
114
+ exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo
115
+ exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site
116
+ exten => 500,n,Goto(s,6) ; Return to the start over message.
117
+
118
+ ;
119
+ ; Create an extension, 600, for evaluating echo latency.
120
+ ;
121
+ exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
122
+ exten => 600,n,Echo ; Do the echo test
123
+ exten => 600,n,Playback(demo-echodone) ; Let them know it's over
124
+ exten => 600,n,Goto(s,6) ; Start over
125
+
126
+ ;
127
+ ; You can use the Macro Page to intercom a individual user
128
+ exten => 76245,1,Macro(page,SIP/Grandstream1)
129
+ ; or if your peernames are the same as extensions
130
+ exten => _7XXX,1,Macro(page,SIP/${EXTEN})
131
+ ;
132
+ ;
133
+ ; System Wide Page at extension 7999
134
+ ;
135
+ exten => 7999,1,Set(TIMEOUT(absolute)=60)
136
+ exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
137
+
138
+ ; Give voicemail at extension 8500
139
+ ;
140
+ exten => 8500,1,VoicemailMain
141
+ exten => 8500,n,Goto(s,6)
142
+
143
+ </textarea></form>
144
+ <script>
145
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
146
+ mode: "text/x-asterisk",
147
+ matchBrackets: true,
148
+ lineNumber: true
149
+ });
150
+ </script>
151
+
152
+ <p><strong>MIME types defined:</strong> <code>text/x-asterisk</code>.</p>
153
+
154
+ </article>
assets/js/vendor/codemirror/mode/brainfuck/brainfuck.js ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // Brainfuck mode created by Michael Kaminsky https://github.com/mkaminsky11
5
+
6
+ (function(mod) {
7
+ if (typeof exports == "object" && typeof module == "object")
8
+ mod(require("../../lib/codemirror"))
9
+ else if (typeof define == "function" && define.amd)
10
+ define(["../../lib/codemirror"], mod)
11
+ else
12
+ mod(CodeMirror)
13
+ })(function(CodeMirror) {
14
+ "use strict"
15
+ var reserve = "><+-.,[]".split("");
16
+ /*
17
+ comments can be either:
18
+ placed behind lines
19
+
20
+ +++ this is a comment
21
+
22
+ where reserved characters cannot be used
23
+ or in a loop
24
+ [
25
+ this is ok to use [ ] and stuff
26
+ ]
27
+ or preceded by #
28
+ */
29
+ CodeMirror.defineMode("brainfuck", function() {
30
+ return {
31
+ startState: function() {
32
+ return {
33
+ commentLine: false,
34
+ left: 0,
35
+ right: 0,
36
+ commentLoop: false
37
+ }
38
+ },
39
+ token: function(stream, state) {
40
+ if (stream.eatSpace()) return null
41
+ if(stream.sol()){
42
+ state.commentLine = false;
43
+ }
44
+ var ch = stream.next().toString();
45
+ if(reserve.indexOf(ch) !== -1){
46
+ if(state.commentLine === true){
47
+ if(stream.eol()){
48
+ state.commentLine = false;
49
+ }
50
+ return "comment";
51
+ }
52
+ if(ch === "]" || ch === "["){
53
+ if(ch === "["){
54
+ state.left++;
55
+ }
56
+ else{
57
+ state.right++;
58
+ }
59
+ return "bracket";
60
+ }
61
+ else if(ch === "+" || ch === "-"){
62
+ return "keyword";
63
+ }
64
+ else if(ch === "<" || ch === ">"){
65
+ return "atom";
66
+ }
67
+ else if(ch === "." || ch === ","){
68
+ return "def";
69
+ }
70
+ }
71
+ else{
72
+ state.commentLine = true;
73
+ if(stream.eol()){
74
+ state.commentLine = false;
75
+ }
76
+ return "comment";
77
+ }
78
+ if(stream.eol()){
79
+ state.commentLine = false;
80
+ }
81
+ }
82
+ };
83
+ });
84
+ CodeMirror.defineMIME("text/x-brainfuck","brainfuck")
85
+ });
assets/js/vendor/codemirror/mode/brainfuck/index.html ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Brainfuck mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="./brainfuck.js"></script>
11
+ <style>
12
+ .CodeMirror { border: 2px inset #dee; }
13
+ </style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#"></a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>Brainfuck mode</h2>
30
+ <form><textarea id="code" name="code">
31
+ [ This program prints "Hello World!" and a newline to the screen, its
32
+ length is 106 active command characters [it is not the shortest.]
33
+
34
+ This loop is a "comment loop", it's a simple way of adding a comment
35
+ to a BF program such that you don't have to worry about any command
36
+ characters. Any ".", ",", "+", "-", "&lt;" and "&gt;" characters are simply
37
+ ignored, the "[" and "]" characters just have to be balanced.
38
+ ]
39
+ +++++ +++ Set Cell #0 to 8
40
+ [
41
+ &gt;++++ Add 4 to Cell #1; this will always set Cell #1 to 4
42
+ [ as the cell will be cleared by the loop
43
+ &gt;++ Add 2 to Cell #2
44
+ &gt;+++ Add 3 to Cell #3
45
+ &gt;+++ Add 3 to Cell #4
46
+ &gt;+ Add 1 to Cell #5
47
+ &lt;&lt;&lt;&lt;- Decrement the loop counter in Cell #1
48
+ ] Loop till Cell #1 is zero; number of iterations is 4
49
+ &gt;+ Add 1 to Cell #2
50
+ &gt;+ Add 1 to Cell #3
51
+ &gt;- Subtract 1 from Cell #4
52
+ &gt;&gt;+ Add 1 to Cell #6
53
+ [&lt;] Move back to the first zero cell you find; this will
54
+ be Cell #1 which was cleared by the previous loop
55
+ &lt;- Decrement the loop Counter in Cell #0
56
+ ] Loop till Cell #0 is zero; number of iterations is 8
57
+
58
+ The result of this is:
59
+ Cell No : 0 1 2 3 4 5 6
60
+ Contents: 0 0 72 104 88 32 8
61
+ Pointer : ^
62
+
63
+ &gt;&gt;. Cell #2 has value 72 which is 'H'
64
+ &gt;---. Subtract 3 from Cell #3 to get 101 which is 'e'
65
+ +++++++..+++. Likewise for 'llo' from Cell #3
66
+ &gt;&gt;. Cell #5 is 32 for the space
67
+ &lt;-. Subtract 1 from Cell #4 for 87 to give a 'W'
68
+ &lt;. Cell #3 was set to 'o' from the end of 'Hello'
69
+ +++.------.--------. Cell #3 for 'rl' and 'd'
70
+ &gt;&gt;+. Add 1 to Cell #5 gives us an exclamation point
71
+ &gt;++. And finally a newline from Cell #6
72
+ </textarea></form>
73
+
74
+ <script>
75
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
76
+ lineNumbers: true,
77
+ matchBrackets: true,
78
+ mode: "text/x-brainfuck"
79
+ });
80
+ </script>
81
+
82
+ <p>A mode for Brainfuck</p>
83
+
84
+ <p><strong>MIME types defined:</strong> <code>text/x-brainfuck</code></p>
85
+ </article>
assets/js/vendor/codemirror/mode/clike/clike.js ADDED
@@ -0,0 +1,775 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("clike", function(config, parserConfig) {
15
+ var indentUnit = config.indentUnit,
16
+ statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
17
+ dontAlignCalls = parserConfig.dontAlignCalls,
18
+ keywords = parserConfig.keywords || {},
19
+ types = parserConfig.types || {},
20
+ builtin = parserConfig.builtin || {},
21
+ blockKeywords = parserConfig.blockKeywords || {},
22
+ defKeywords = parserConfig.defKeywords || {},
23
+ atoms = parserConfig.atoms || {},
24
+ hooks = parserConfig.hooks || {},
25
+ multiLineStrings = parserConfig.multiLineStrings,
26
+ indentStatements = parserConfig.indentStatements !== false,
27
+ indentSwitch = parserConfig.indentSwitch !== false,
28
+ namespaceSeparator = parserConfig.namespaceSeparator,
29
+ isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
30
+ numberStart = parserConfig.numberStart || /[\d\.]/,
31
+ number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
32
+ isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
33
+ endStatement = parserConfig.endStatement || /^[;:,]$/;
34
+
35
+ var curPunc, isDefKeyword;
36
+
37
+ function tokenBase(stream, state) {
38
+ var ch = stream.next();
39
+ if (hooks[ch]) {
40
+ var result = hooks[ch](stream, state);
41
+ if (result !== false) return result;
42
+ }
43
+ if (ch == '"' || ch == "'") {
44
+ state.tokenize = tokenString(ch);
45
+ return state.tokenize(stream, state);
46
+ }
47
+ if (isPunctuationChar.test(ch)) {
48
+ curPunc = ch;
49
+ return null;
50
+ }
51
+ if (numberStart.test(ch)) {
52
+ stream.backUp(1)
53
+ if (stream.match(number)) return "number"
54
+ stream.next()
55
+ }
56
+ if (ch == "/") {
57
+ if (stream.eat("*")) {
58
+ state.tokenize = tokenComment;
59
+ return tokenComment(stream, state);
60
+ }
61
+ if (stream.eat("/")) {
62
+ stream.skipToEnd();
63
+ return "comment";
64
+ }
65
+ }
66
+ if (isOperatorChar.test(ch)) {
67
+ stream.eatWhile(isOperatorChar);
68
+ return "operator";
69
+ }
70
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
71
+ if (namespaceSeparator) while (stream.match(namespaceSeparator))
72
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
73
+
74
+ var cur = stream.current();
75
+ if (contains(keywords, cur)) {
76
+ if (contains(blockKeywords, cur)) curPunc = "newstatement";
77
+ if (contains(defKeywords, cur)) isDefKeyword = true;
78
+ return "keyword";
79
+ }
80
+ if (contains(types, cur)) return "variable-3";
81
+ if (contains(builtin, cur)) {
82
+ if (contains(blockKeywords, cur)) curPunc = "newstatement";
83
+ return "builtin";
84
+ }
85
+ if (contains(atoms, cur)) return "atom";
86
+ return "variable";
87
+ }
88
+
89
+ function tokenString(quote) {
90
+ return function(stream, state) {
91
+ var escaped = false, next, end = false;
92
+ while ((next = stream.next()) != null) {
93
+ if (next == quote && !escaped) {end = true; break;}
94
+ escaped = !escaped && next == "\\";
95
+ }
96
+ if (end || !(escaped || multiLineStrings))
97
+ state.tokenize = null;
98
+ return "string";
99
+ };
100
+ }
101
+
102
+ function tokenComment(stream, state) {
103
+ var maybeEnd = false, ch;
104
+ while (ch = stream.next()) {
105
+ if (ch == "/" && maybeEnd) {
106
+ state.tokenize = null;
107
+ break;
108
+ }
109
+ maybeEnd = (ch == "*");
110
+ }
111
+ return "comment";
112
+ }
113
+
114
+ function Context(indented, column, type, align, prev) {
115
+ this.indented = indented;
116
+ this.column = column;
117
+ this.type = type;
118
+ this.align = align;
119
+ this.prev = prev;
120
+ }
121
+ function isStatement(type) {
122
+ return type == "statement" || type == "switchstatement" || type == "namespace";
123
+ }
124
+ function pushContext(state, col, type) {
125
+ var indent = state.indented;
126
+ if (state.context && isStatement(state.context.type) && !isStatement(type))
127
+ indent = state.context.indented;
128
+ return state.context = new Context(indent, col, type, null, state.context);
129
+ }
130
+ function popContext(state) {
131
+ var t = state.context.type;
132
+ if (t == ")" || t == "]" || t == "}")
133
+ state.indented = state.context.indented;
134
+ return state.context = state.context.prev;
135
+ }
136
+
137
+ function typeBefore(stream, state) {
138
+ if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
139
+ if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
140
+ }
141
+
142
+ function isTopScope(context) {
143
+ for (;;) {
144
+ if (!context || context.type == "top") return true;
145
+ if (context.type == "}" && context.prev.type != "namespace") return false;
146
+ context = context.prev;
147
+ }
148
+ }
149
+
150
+ // Interface
151
+
152
+ return {
153
+ startState: function(basecolumn) {
154
+ return {
155
+ tokenize: null,
156
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
157
+ indented: 0,
158
+ startOfLine: true,
159
+ prevToken: null
160
+ };
161
+ },
162
+
163
+ token: function(stream, state) {
164
+ var ctx = state.context;
165
+ if (stream.sol()) {
166
+ if (ctx.align == null) ctx.align = false;
167
+ state.indented = stream.indentation();
168
+ state.startOfLine = true;
169
+ }
170
+ if (stream.eatSpace()) return null;
171
+ curPunc = isDefKeyword = null;
172
+ var style = (state.tokenize || tokenBase)(stream, state);
173
+ if (style == "comment" || style == "meta") return style;
174
+ if (ctx.align == null) ctx.align = true;
175
+
176
+ if (endStatement.test(curPunc)) while (isStatement(state.context.type)) popContext(state);
177
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
178
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
179
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
180
+ else if (curPunc == "}") {
181
+ while (isStatement(ctx.type)) ctx = popContext(state);
182
+ if (ctx.type == "}") ctx = popContext(state);
183
+ while (isStatement(ctx.type)) ctx = popContext(state);
184
+ }
185
+ else if (curPunc == ctx.type) popContext(state);
186
+ else if (indentStatements &&
187
+ (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
188
+ (isStatement(ctx.type) && curPunc == "newstatement"))) {
189
+ var type = "statement";
190
+ if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch")
191
+ type = "switchstatement";
192
+ else if (style == "keyword" && stream.current() == "namespace")
193
+ type = "namespace";
194
+ pushContext(state, stream.column(), type);
195
+ }
196
+
197
+ if (style == "variable" &&
198
+ ((state.prevToken == "def" ||
199
+ (parserConfig.typeFirstDefinitions && typeBefore(stream, state) &&
200
+ isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
201
+ style = "def";
202
+
203
+ if (hooks.token) {
204
+ var result = hooks.token(stream, state, style);
205
+ if (result !== undefined) style = result;
206
+ }
207
+
208
+ if (style == "def" && parserConfig.styleDefs === false) style = "variable";
209
+
210
+ state.startOfLine = false;
211
+ state.prevToken = isDefKeyword ? "def" : style || curPunc;
212
+ return style;
213
+ },
214
+
215
+ indent: function(state, textAfter) {
216
+ if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
217
+ var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
218
+ if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev;
219
+ if (hooks.indent) {
220
+ var hook = hooks.indent(state, ctx, textAfter);
221
+ if (typeof hook == "number") return hook
222
+ }
223
+ var closing = firstChar == ctx.type;
224
+ var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
225
+ if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
226
+ while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
227
+ return ctx.indented
228
+ }
229
+ if (isStatement(ctx.type))
230
+ return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
231
+ if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
232
+ return ctx.column + (closing ? 0 : 1);
233
+ if (ctx.type == ")" && !closing)
234
+ return ctx.indented + statementIndentUnit;
235
+
236
+ return ctx.indented + (closing ? 0 : indentUnit) +
237
+ (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
238
+ },
239
+
240
+ electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
241
+ blockCommentStart: "/*",
242
+ blockCommentEnd: "*/",
243
+ lineComment: "//",
244
+ fold: "brace"
245
+ };
246
+ });
247
+
248
+ function words(str) {
249
+ var obj = {}, words = str.split(" ");
250
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
251
+ return obj;
252
+ }
253
+ function contains(words, word) {
254
+ if (typeof words === "function") {
255
+ return words(word);
256
+ } else {
257
+ return words.propertyIsEnumerable(word);
258
+ }
259
+ }
260
+ var cKeywords = "auto if break case register continue return default do sizeof " +
261
+ "static else struct switch extern typedef union for goto while enum const volatile";
262
+ var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
263
+
264
+ function cppHook(stream, state) {
265
+ if (!state.startOfLine) return false;
266
+ for (;;) {
267
+ if (stream.skipTo("\\")) {
268
+ stream.next();
269
+ if (stream.eol()) {
270
+ state.tokenize = cppHook;
271
+ break;
272
+ }
273
+ } else {
274
+ stream.skipToEnd();
275
+ state.tokenize = null;
276
+ break;
277
+ }
278
+ }
279
+ return "meta";
280
+ }
281
+
282
+ function pointerHook(_stream, state) {
283
+ if (state.prevToken == "variable-3") return "variable-3";
284
+ return false;
285
+ }
286
+
287
+ function cpp14Literal(stream) {
288
+ stream.eatWhile(/[\w\.']/);
289
+ return "number";
290
+ }
291
+
292
+ function cpp11StringHook(stream, state) {
293
+ stream.backUp(1);
294
+ // Raw strings.
295
+ if (stream.match(/(R|u8R|uR|UR|LR)/)) {
296
+ var match = stream.match(/"([^\s\\()]{0,16})\(/);
297
+ if (!match) {
298
+ return false;
299
+ }
300
+ state.cpp11RawStringDelim = match[1];
301
+ state.tokenize = tokenRawString;
302
+ return tokenRawString(stream, state);
303
+ }
304
+ // Unicode strings/chars.
305
+ if (stream.match(/(u8|u|U|L)/)) {
306
+ if (stream.match(/["']/, /* eat */ false)) {
307
+ return "string";
308
+ }
309
+ return false;
310
+ }
311
+ // Ignore this hook.
312
+ stream.next();
313
+ return false;
314
+ }
315
+
316
+ function cppLooksLikeConstructor(word) {
317
+ var lastTwo = /(\w+)::(\w+)$/.exec(word);
318
+ return lastTwo && lastTwo[1] == lastTwo[2];
319
+ }
320
+
321
+ // C#-style strings where "" escapes a quote.
322
+ function tokenAtString(stream, state) {
323
+ var next;
324
+ while ((next = stream.next()) != null) {
325
+ if (next == '"' && !stream.eat('"')) {
326
+ state.tokenize = null;
327
+ break;
328
+ }
329
+ }
330
+ return "string";
331
+ }
332
+
333
+ // C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where
334
+ // <delim> can be a string up to 16 characters long.
335
+ function tokenRawString(stream, state) {
336
+ // Escape characters that have special regex meanings.
337
+ var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
338
+ var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
339
+ if (match)
340
+ state.tokenize = null;
341
+ else
342
+ stream.skipToEnd();
343
+ return "string";
344
+ }
345
+
346
+ function def(mimes, mode) {
347
+ if (typeof mimes == "string") mimes = [mimes];
348
+ var words = [];
349
+ function add(obj) {
350
+ if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
351
+ words.push(prop);
352
+ }
353
+ add(mode.keywords);
354
+ add(mode.types);
355
+ add(mode.builtin);
356
+ add(mode.atoms);
357
+ if (words.length) {
358
+ mode.helperType = mimes[0];
359
+ CodeMirror.registerHelper("hintWords", mimes[0], words);
360
+ }
361
+
362
+ for (var i = 0; i < mimes.length; ++i)
363
+ CodeMirror.defineMIME(mimes[i], mode);
364
+ }
365
+
366
+ def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
367
+ name: "clike",
368
+ keywords: words(cKeywords),
369
+ types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
370
+ "int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
371
+ "uint32_t uint64_t"),
372
+ blockKeywords: words("case do else for if switch while struct"),
373
+ defKeywords: words("struct"),
374
+ typeFirstDefinitions: true,
375
+ atoms: words("null true false"),
376
+ hooks: {"#": cppHook, "*": pointerHook},
377
+ modeProps: {fold: ["brace", "include"]}
378
+ });
379
+
380
+ def(["text/x-c++src", "text/x-c++hdr"], {
381
+ name: "clike",
382
+ keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
383
+ "static_cast typeid catch operator template typename class friend private " +
384
+ "this using const_cast inline public throw virtual delete mutable protected " +
385
+ "alignas alignof constexpr decltype nullptr noexcept thread_local final " +
386
+ "static_assert override"),
387
+ types: words(cTypes + " bool wchar_t"),
388
+ blockKeywords: words("catch class do else finally for if struct switch try while"),
389
+ defKeywords: words("class namespace struct enum union"),
390
+ typeFirstDefinitions: true,
391
+ atoms: words("true false null"),
392
+ hooks: {
393
+ "#": cppHook,
394
+ "*": pointerHook,
395
+ "u": cpp11StringHook,
396
+ "U": cpp11StringHook,
397
+ "L": cpp11StringHook,
398
+ "R": cpp11StringHook,
399
+ "0": cpp14Literal,
400
+ "1": cpp14Literal,
401
+ "2": cpp14Literal,
402
+ "3": cpp14Literal,
403
+ "4": cpp14Literal,
404
+ "5": cpp14Literal,
405
+ "6": cpp14Literal,
406
+ "7": cpp14Literal,
407
+ "8": cpp14Literal,
408
+ "9": cpp14Literal,
409
+ token: function(stream, state, style) {
410
+ if (style == "variable" && stream.peek() == "(" &&
411
+ (state.prevToken == ";" || state.prevToken == null ||
412
+ state.prevToken == "}") &&
413
+ cppLooksLikeConstructor(stream.current()))
414
+ return "def";
415
+ }
416
+ },
417
+ namespaceSeparator: "::",
418
+ modeProps: {fold: ["brace", "include"]}
419
+ });
420
+
421
+ def("text/x-java", {
422
+ name: "clike",
423
+ keywords: words("abstract assert break case catch class const continue default " +
424
+ "do else enum extends final finally float for goto if implements import " +
425
+ "instanceof interface native new package private protected public " +
426
+ "return static strictfp super switch synchronized this throw throws transient " +
427
+ "try volatile while"),
428
+ types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
429
+ "Integer Long Number Object Short String StringBuffer StringBuilder Void"),
430
+ blockKeywords: words("catch class do else finally for if switch try while"),
431
+ defKeywords: words("class interface package enum"),
432
+ typeFirstDefinitions: true,
433
+ atoms: words("true false null"),
434
+ endStatement: /^[;:]$/,
435
+ hooks: {
436
+ "@": function(stream) {
437
+ stream.eatWhile(/[\w\$_]/);
438
+ return "meta";
439
+ }
440
+ },
441
+ modeProps: {fold: ["brace", "import"]}
442
+ });
443
+
444
+ def("text/x-csharp", {
445
+ name: "clike",
446
+ keywords: words("abstract as async await base break case catch checked class const continue" +
447
+ " default delegate do else enum event explicit extern finally fixed for" +
448
+ " foreach goto if implicit in interface internal is lock namespace new" +
449
+ " operator out override params private protected public readonly ref return sealed" +
450
+ " sizeof stackalloc static struct switch this throw try typeof unchecked" +
451
+ " unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
452
+ " global group into join let orderby partial remove select set value var yield"),
453
+ types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
454
+ " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
455
+ " UInt64 bool byte char decimal double short int long object" +
456
+ " sbyte float string ushort uint ulong"),
457
+ blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
458
+ defKeywords: words("class interface namespace struct var"),
459
+ typeFirstDefinitions: true,
460
+ atoms: words("true false null"),
461
+ hooks: {
462
+ "@": function(stream, state) {
463
+ if (stream.eat('"')) {
464
+ state.tokenize = tokenAtString;
465
+ return tokenAtString(stream, state);
466
+ }
467
+ stream.eatWhile(/[\w\$_]/);
468
+ return "meta";
469
+ }
470
+ }
471
+ });
472
+
473
+ function tokenTripleString(stream, state) {
474
+ var escaped = false;
475
+ while (!stream.eol()) {
476
+ if (!escaped && stream.match('"""')) {
477
+ state.tokenize = null;
478
+ break;
479
+ }
480
+ escaped = stream.next() == "\\" && !escaped;
481
+ }
482
+ return "string";
483
+ }
484
+
485
+ def("text/x-scala", {
486
+ name: "clike",
487
+ keywords: words(
488
+
489
+ /* scala */
490
+ "abstract case catch class def do else extends final finally for forSome if " +
491
+ "implicit import lazy match new null object override package private protected return " +
492
+ "sealed super this throw trait try type val var while with yield _ : = => <- <: " +
493
+ "<% >: # @ " +
494
+
495
+ /* package scala */
496
+ "assert assume require print println printf readLine readBoolean readByte readShort " +
497
+ "readChar readInt readLong readFloat readDouble " +
498
+
499
+ ":: #:: "
500
+ ),
501
+ types: words(
502
+ "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
503
+ "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +
504
+ "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
505
+ "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
506
+ "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
507
+
508
+ /* package java.lang */
509
+ "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
510
+ "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
511
+ "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
512
+ "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
513
+ ),
514
+ multiLineStrings: true,
515
+ blockKeywords: words("catch class do else finally for forSome if match switch try while"),
516
+ defKeywords: words("class def object package trait type val var"),
517
+ atoms: words("true false null"),
518
+ indentStatements: false,
519
+ indentSwitch: false,
520
+ hooks: {
521
+ "@": function(stream) {
522
+ stream.eatWhile(/[\w\$_]/);
523
+ return "meta";
524
+ },
525
+ '"': function(stream, state) {
526
+ if (!stream.match('""')) return false;
527
+ state.tokenize = tokenTripleString;
528
+ return state.tokenize(stream, state);
529
+ },
530
+ "'": function(stream) {
531
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
532
+ return "atom";
533
+ }
534
+ },
535
+ modeProps: {closeBrackets: {triples: '"'}}
536
+ });
537
+
538
+ function tokenKotlinString(tripleString){
539
+ return function (stream, state) {
540
+ var escaped = false, next, end = false;
541
+ while (!stream.eol()) {
542
+ if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
543
+ if (tripleString && stream.match('"""')) {end = true; break;}
544
+ next = stream.next();
545
+ if(!escaped && next == "$" && stream.match('{'))
546
+ stream.skipTo("}");
547
+ escaped = !escaped && next == "\\" && !tripleString;
548
+ }
549
+ if (end || !tripleString)
550
+ state.tokenize = null;
551
+ return "string";
552
+ }
553
+ }
554
+
555
+ def("text/x-kotlin", {
556
+ name: "clike",
557
+ keywords: words(
558
+ /*keywords*/
559
+ "package as typealias class interface this super val " +
560
+ "var fun for is in This throw return " +
561
+ "break continue object if else while do try when !in !is as? " +
562
+
563
+ /*soft keywords*/
564
+ "file import where by get set abstract enum open inner override private public internal " +
565
+ "protected catch finally out final vararg reified dynamic companion constructor init " +
566
+ "sealed field property receiver param sparam lateinit data inline noinline tailrec " +
567
+ "external annotation crossinline const operator infix"
568
+ ),
569
+ types: words(
570
+ /* package java.lang */
571
+ "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
572
+ "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
573
+ "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
574
+ "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
575
+ ),
576
+ intendSwitch: false,
577
+ indentStatements: false,
578
+ multiLineStrings: true,
579
+ blockKeywords: words("catch class do else finally for if where try while enum"),
580
+ defKeywords: words("class val var object package interface fun"),
581
+ atoms: words("true false null this"),
582
+ hooks: {
583
+ '"': function(stream, state) {
584
+ state.tokenize = tokenKotlinString(stream.match('""'));
585
+ return state.tokenize(stream, state);
586
+ }
587
+ },
588
+ modeProps: {closeBrackets: {triples: '"'}}
589
+ });
590
+
591
+ def(["x-shader/x-vertex", "x-shader/x-fragment"], {
592
+ name: "clike",
593
+ keywords: words("sampler1D sampler2D sampler3D samplerCube " +
594
+ "sampler1DShadow sampler2DShadow " +
595
+ "const attribute uniform varying " +
596
+ "break continue discard return " +
597
+ "for while do if else struct " +
598
+ "in out inout"),
599
+ types: words("float int bool void " +
600
+ "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
601
+ "mat2 mat3 mat4"),
602
+ blockKeywords: words("for while do if else struct"),
603
+ builtin: words("radians degrees sin cos tan asin acos atan " +
604
+ "pow exp log exp2 sqrt inversesqrt " +
605
+ "abs sign floor ceil fract mod min max clamp mix step smoothstep " +
606
+ "length distance dot cross normalize ftransform faceforward " +
607
+ "reflect refract matrixCompMult " +
608
+ "lessThan lessThanEqual greaterThan greaterThanEqual " +
609
+ "equal notEqual any all not " +
610
+ "texture1D texture1DProj texture1DLod texture1DProjLod " +
611
+ "texture2D texture2DProj texture2DLod texture2DProjLod " +
612
+ "texture3D texture3DProj texture3DLod texture3DProjLod " +
613
+ "textureCube textureCubeLod " +
614
+ "shadow1D shadow2D shadow1DProj shadow2DProj " +
615
+ "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
616
+ "dFdx dFdy fwidth " +
617
+ "noise1 noise2 noise3 noise4"),
618
+ atoms: words("true false " +
619
+ "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
620
+ "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
621
+ "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
622
+ "gl_FogCoord gl_PointCoord " +
623
+ "gl_Position gl_PointSize gl_ClipVertex " +
624
+ "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
625
+ "gl_TexCoord gl_FogFragCoord " +
626
+ "gl_FragCoord gl_FrontFacing " +
627
+ "gl_FragData gl_FragDepth " +
628
+ "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
629
+ "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
630
+ "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
631
+ "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
632
+ "gl_ProjectionMatrixInverseTranspose " +
633
+ "gl_ModelViewProjectionMatrixInverseTranspose " +
634
+ "gl_TextureMatrixInverseTranspose " +
635
+ "gl_NormalScale gl_DepthRange gl_ClipPlane " +
636
+ "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
637
+ "gl_FrontLightModelProduct gl_BackLightModelProduct " +
638
+ "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
639
+ "gl_FogParameters " +
640
+ "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
641
+ "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
642
+ "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
643
+ "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
644
+ "gl_MaxDrawBuffers"),
645
+ indentSwitch: false,
646
+ hooks: {"#": cppHook},
647
+ modeProps: {fold: ["brace", "include"]}
648
+ });
649
+
650
+ def("text/x-nesc", {
651
+ name: "clike",
652
+ keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
653
+ "implementation includes interface module new norace nx_struct nx_union post provides " +
654
+ "signal task uses abstract extends"),
655
+ types: words(cTypes),
656
+ blockKeywords: words("case do else for if switch while struct"),
657
+ atoms: words("null true false"),
658
+ hooks: {"#": cppHook},
659
+ modeProps: {fold: ["brace", "include"]}
660
+ });
661
+
662
+ def("text/x-objectivec", {
663
+ name: "clike",
664
+ keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " +
665
+ "inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
666
+ types: words(cTypes),
667
+ atoms: words("YES NO NULL NILL ON OFF true false"),
668
+ hooks: {
669
+ "@": function(stream) {
670
+ stream.eatWhile(/[\w\$]/);
671
+ return "keyword";
672
+ },
673
+ "#": cppHook,
674
+ indent: function(_state, ctx, textAfter) {
675
+ if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented
676
+ }
677
+ },
678
+ modeProps: {fold: "brace"}
679
+ });
680
+
681
+ def("text/x-squirrel", {
682
+ name: "clike",
683
+ keywords: words("base break clone continue const default delete enum extends function in class" +
684
+ " foreach local resume return this throw typeof yield constructor instanceof static"),
685
+ types: words(cTypes),
686
+ blockKeywords: words("case catch class else for foreach if switch try while"),
687
+ defKeywords: words("function local class"),
688
+ typeFirstDefinitions: true,
689
+ atoms: words("true false null"),
690
+ hooks: {"#": cppHook},
691
+ modeProps: {fold: ["brace", "include"]}
692
+ });
693
+
694
+ // Ceylon Strings need to deal with interpolation
695
+ var stringTokenizer = null;
696
+ function tokenCeylonString(type) {
697
+ return function(stream, state) {
698
+ var escaped = false, next, end = false;
699
+ while (!stream.eol()) {
700
+ if (!escaped && stream.match('"') &&
701
+ (type == "single" || stream.match('""'))) {
702
+ end = true;
703
+ break;
704
+ }
705
+ if (!escaped && stream.match('``')) {
706
+ stringTokenizer = tokenCeylonString(type);
707
+ end = true;
708
+ break;
709
+ }
710
+ next = stream.next();
711
+ escaped = type == "single" && !escaped && next == "\\";
712
+ }
713
+ if (end)
714
+ state.tokenize = null;
715
+ return "string";
716
+ }
717
+ }
718
+
719
+ def("text/x-ceylon", {
720
+ name: "clike",
721
+ keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" +
722
+ " exists extends finally for function given if import in interface is let module new" +
723
+ " nonempty object of out outer package return satisfies super switch then this throw" +
724
+ " try value void while"),
725
+ types: function(word) {
726
+ // In Ceylon all identifiers that start with an uppercase are types
727
+ var first = word.charAt(0);
728
+ return (first === first.toUpperCase() && first !== first.toLowerCase());
729
+ },
730
+ blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
731
+ defKeywords: words("class dynamic function interface module object package value"),
732
+ builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" +
733
+ " native optional sealed see serializable shared suppressWarnings tagged throws variable"),
734
+ isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
735
+ isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
736
+ numberStart: /[\d#$]/,
737
+ number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
738
+ multiLineStrings: true,
739
+ typeFirstDefinitions: true,
740
+ atoms: words("true false null larger smaller equal empty finished"),
741
+ indentSwitch: false,
742
+ styleDefs: false,
743
+ hooks: {
744
+ "@": function(stream) {
745
+ stream.eatWhile(/[\w\$_]/);
746
+ return "meta";
747
+ },
748
+ '"': function(stream, state) {
749
+ state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
750
+ return state.tokenize(stream, state);
751
+ },
752
+ '`': function(stream, state) {
753
+ if (!stringTokenizer || !stream.match('`')) return false;
754
+ state.tokenize = stringTokenizer;
755
+ stringTokenizer = null;
756
+ return state.tokenize(stream, state);
757
+ },
758
+ "'": function(stream) {
759
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
760
+ return "atom";
761
+ },
762
+ token: function(_stream, state, style) {
763
+ if ((style == "variable" || style == "variable-3") &&
764
+ state.prevToken == ".") {
765
+ return "variable-2";
766
+ }
767
+ }
768
+ },
769
+ modeProps: {
770
+ fold: ["brace", "import"],
771
+ closeBrackets: {triples: '"'}
772
+ }
773
+ });
774
+
775
+ });
assets/js/vendor/codemirror/mode/clike/index.html ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: C-like mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <link rel="stylesheet" href="../../addon/hint/show-hint.css">
11
+ <script src="../../addon/hint/show-hint.js"></script>
12
+ <script src="clike.js"></script>
13
+ <style>.CodeMirror {border: 2px inset #dee;}</style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#">C-like</a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>C-like mode</h2>
30
+
31
+ <div><textarea id="c-code">
32
+ /* C demo code */
33
+
34
+ #include <zmq.h>
35
+ #include <pthread.h>
36
+ #include <semaphore.h>
37
+ #include <time.h>
38
+ #include <stdio.h>
39
+ #include <fcntl.h>
40
+ #include <malloc.h>
41
+
42
+ typedef struct {
43
+ void* arg_socket;
44
+ zmq_msg_t* arg_msg;
45
+ char* arg_string;
46
+ unsigned long arg_len;
47
+ int arg_int, arg_command;
48
+
49
+ int signal_fd;
50
+ int pad;
51
+ void* context;
52
+ sem_t sem;
53
+ } acl_zmq_context;
54
+
55
+ #define p(X) (context->arg_##X)
56
+
57
+ void* zmq_thread(void* context_pointer) {
58
+ acl_zmq_context* context = (acl_zmq_context*)context_pointer;
59
+ char ok = 'K', err = 'X';
60
+ int res;
61
+
62
+ while (1) {
63
+ while ((res = sem_wait(&amp;context->sem)) == EINTR);
64
+ if (res) {write(context->signal_fd, &amp;err, 1); goto cleanup;}
65
+ switch(p(command)) {
66
+ case 0: goto cleanup;
67
+ case 1: p(socket) = zmq_socket(context->context, p(int)); break;
68
+ case 2: p(int) = zmq_close(p(socket)); break;
69
+ case 3: p(int) = zmq_bind(p(socket), p(string)); break;
70
+ case 4: p(int) = zmq_connect(p(socket), p(string)); break;
71
+ case 5: p(int) = zmq_getsockopt(p(socket), p(int), (void*)p(string), &amp;p(len)); break;
72
+ case 6: p(int) = zmq_setsockopt(p(socket), p(int), (void*)p(string), p(len)); break;
73
+ case 7: p(int) = zmq_send(p(socket), p(msg), p(int)); break;
74
+ case 8: p(int) = zmq_recv(p(socket), p(msg), p(int)); break;
75
+ case 9: p(int) = zmq_poll(p(socket), p(int), p(len)); break;
76
+ }
77
+ p(command) = errno;
78
+ write(context->signal_fd, &amp;ok, 1);
79
+ }
80
+ cleanup:
81
+ close(context->signal_fd);
82
+ free(context_pointer);
83
+ return 0;
84
+ }
85
+
86
+ void* zmq_thread_init(void* zmq_context, int signal_fd) {
87
+ acl_zmq_context* context = malloc(sizeof(acl_zmq_context));
88
+ pthread_t thread;
89
+
90
+ context->context = zmq_context;
91
+ context->signal_fd = signal_fd;
92
+ sem_init(&amp;context->sem, 1, 0);
93
+ pthread_create(&amp;thread, 0, &amp;zmq_thread, context);
94
+ pthread_detach(thread);
95
+ return context;
96
+ }
97
+ </textarea></div>
98
+
99
+ <h2>C++ example</h2>
100
+
101
+ <div><textarea id="cpp-code">
102
+ #include <iostream>
103
+ #include "mystuff/util.h"
104
+
105
+ namespace {
106
+ enum Enum {
107
+ VAL1, VAL2, VAL3
108
+ };
109
+
110
+ char32_t unicode_string = U"\U0010FFFF";
111
+ string raw_string = R"delim(anything
112
+ you
113
+ want)delim";
114
+
115
+ int Helper(const MyType& param) {
116
+ return 0;
117
+ }
118
+ } // namespace
119
+
120
+ class ForwardDec;
121
+
122
+ template <class T, class V>
123
+ class Class : public BaseClass {
124
+ const MyType<T, V> member_;
125
+
126
+ public:
127
+ const MyType<T, V>& Method() const {
128
+ return member_;
129
+ }
130
+
131
+ void Method2(MyType<T, V>* value);
132
+ }
133
+
134
+ template <class T, class V>
135
+ void Class::Method2(MyType<T, V>* value) {
136
+ std::out << 1 >> method();
137
+ value->Method3(member_);
138
+ member_ = value;
139
+ }
140
+ </textarea></div>
141
+
142
+ <h2>Objective-C example</h2>
143
+
144
+ <div><textarea id="objectivec-code">
145
+ /*
146
+ This is a longer comment
147
+ That spans two lines
148
+ */
149
+
150
+ #import <Test/Test.h>
151
+ @implementation YourAppDelegate
152
+
153
+ // This is a one-line comment
154
+
155
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
156
+ char myString[] = "This is a C character array";
157
+ int test = 5;
158
+ return YES;
159
+ }
160
+ </textarea></div>
161
+
162
+ <h2>Java example</h2>
163
+
164
+ <div><textarea id="java-code">
165
+ import com.demo.util.MyType;
166
+ import com.demo.util.MyInterface;
167
+
168
+ public enum Enum {
169
+ VAL1, VAL2, VAL3
170
+ }
171
+
172
+ public class Class<T, V> implements MyInterface {
173
+ public static final MyType<T, V> member;
174
+
175
+ private class InnerClass {
176
+ public int zero() {
177
+ return 0;
178
+ }
179
+ }
180
+
181
+ @Override
182
+ public MyType method() {
183
+ return member;
184
+ }
185
+
186
+ public void method2(MyType<T, V> value) {
187
+ method();
188
+ value.method3();
189
+ member = value;
190
+ }
191
+ }
192
+ </textarea></div>
193
+
194
+ <h2>Scala example</h2>
195
+
196
+ <div><textarea id="scala-code">
197
+ object FilterTest extends App {
198
+ def filter(xs: List[Int], threshold: Int) = {
199
+ def process(ys: List[Int]): List[Int] =
200
+ if (ys.isEmpty) ys
201
+ else if (ys.head < threshold) ys.head :: process(ys.tail)
202
+ else process(ys.tail)
203
+ process(xs)
204
+ }
205
+ println(filter(List(1, 9, 2, 8, 3, 7, 4), 5))
206
+ }
207
+ </textarea></div>
208
+
209
+ <h2>Kotlin mode</h2>
210
+
211
+ <div><textarea id="kotlin-code">
212
+ package org.wasabi.http
213
+
214
+ import java.util.concurrent.Executors
215
+ import java.net.InetSocketAddress
216
+ import org.wasabi.app.AppConfiguration
217
+ import io.netty.bootstrap.ServerBootstrap
218
+ import io.netty.channel.nio.NioEventLoopGroup
219
+ import io.netty.channel.socket.nio.NioServerSocketChannel
220
+ import org.wasabi.app.AppServer
221
+
222
+ public class HttpServer(private val appServer: AppServer) {
223
+
224
+ val bootstrap: ServerBootstrap
225
+ val primaryGroup: NioEventLoopGroup
226
+ val workerGroup: NioEventLoopGroup
227
+
228
+ init {
229
+ // Define worker groups
230
+ primaryGroup = NioEventLoopGroup()
231
+ workerGroup = NioEventLoopGroup()
232
+
233
+ // Initialize bootstrap of server
234
+ bootstrap = ServerBootstrap()
235
+
236
+ bootstrap.group(primaryGroup, workerGroup)
237
+ bootstrap.channel(javaClass<NioServerSocketChannel>())
238
+ bootstrap.childHandler(NettyPipelineInitializer(appServer))
239
+ }
240
+
241
+ public fun start(wait: Boolean = true) {
242
+ val channel = bootstrap.bind(appServer.configuration.port)?.sync()?.channel()
243
+
244
+ if (wait) {
245
+ channel?.closeFuture()?.sync()
246
+ }
247
+ }
248
+
249
+ public fun stop() {
250
+ // Shutdown all event loops
251
+ primaryGroup.shutdownGracefully()
252
+ workerGroup.shutdownGracefully()
253
+
254
+ // Wait till all threads are terminated
255
+ primaryGroup.terminationFuture().sync()
256
+ workerGroup.terminationFuture().sync()
257
+ }
258
+ }
259
+ </textarea></div>
260
+
261
+ <h2>Ceylon mode</h2>
262
+
263
+ <div><textarea id="ceylon-code">
264
+ "Produces the [[stream|Iterable]] that results from repeated
265
+ application of the given [[function|next]] to the given
266
+ [[first]] element of the stream, until the function first
267
+ returns [[finished]]. If the given function never returns
268
+ `finished`, the resulting stream is infinite.
269
+
270
+ For example:
271
+
272
+ loop(0)(2.plus).takeWhile(10.largerThan)
273
+
274
+ produces the stream `{ 0, 2, 4, 6, 8 }`."
275
+ tagged("Streams")
276
+ shared {Element+} loop&lt;Element&gt;(
277
+ "The first element of the resulting stream."
278
+ Element first)(
279
+ "The function that produces the next element of the
280
+ stream, given the current element. The function may
281
+ return [[finished]] to indicate the end of the
282
+ stream."
283
+ Element|Finished next(Element element))
284
+ =&gt; let (start = first)
285
+ object satisfies {Element+} {
286
+ first =&gt; start;
287
+ empty =&gt; false;
288
+ function nextElement(Element element)
289
+ =&gt; next(element);
290
+ iterator()
291
+ =&gt; object satisfies Iterator&lt;Element&gt; {
292
+ variable Element|Finished current = start;
293
+ shared actual Element|Finished next() {
294
+ if (!is Finished result = current) {
295
+ current = nextElement(result);
296
+ return result;
297
+ }
298
+ else {
299
+ return finished;
300
+ }
301
+ }
302
+ };
303
+ };
304
+ </textarea></div>
305
+
306
+ <script>
307
+ var cEditor = CodeMirror.fromTextArea(document.getElementById("c-code"), {
308
+ lineNumbers: true,
309
+ matchBrackets: true,
310
+ mode: "text/x-csrc"
311
+ });
312
+ var cppEditor = CodeMirror.fromTextArea(document.getElementById("cpp-code"), {
313
+ lineNumbers: true,
314
+ matchBrackets: true,
315
+ mode: "text/x-c++src"
316
+ });
317
+ var javaEditor = CodeMirror.fromTextArea(document.getElementById("java-code"), {
318
+ lineNumbers: true,
319
+ matchBrackets: true,
320
+ mode: "text/x-java"
321
+ });
322
+ var objectivecEditor = CodeMirror.fromTextArea(document.getElementById("objectivec-code"), {
323
+ lineNumbers: true,
324
+ matchBrackets: true,
325
+ mode: "text/x-objectivec"
326
+ });
327
+ var scalaEditor = CodeMirror.fromTextArea(document.getElementById("scala-code"), {
328
+ lineNumbers: true,
329
+ matchBrackets: true,
330
+ mode: "text/x-scala"
331
+ });
332
+ var kotlinEditor = CodeMirror.fromTextArea(document.getElementById("kotlin-code"), {
333
+ lineNumbers: true,
334
+ matchBrackets: true,
335
+ mode: "text/x-kotlin"
336
+ });
337
+ var ceylonEditor = CodeMirror.fromTextArea(document.getElementById("ceylon-code"), {
338
+ lineNumbers: true,
339
+ matchBrackets: true,
340
+ mode: "text/x-ceylon"
341
+ });
342
+ var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
343
+ CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
344
+ </script>
345
+
346
+ <p>Simple mode that tries to handle C-like languages as well as it
347
+ can. Takes two configuration parameters: <code>keywords</code>, an
348
+ object whose property names are the keywords in the language,
349
+ and <code>useCPP</code>, which determines whether C preprocessor
350
+ directives are recognized.</p>
351
+
352
+ <p><strong>MIME types defined:</strong> <code>text/x-csrc</code>
353
+ (C), <code>text/x-c++src</code> (C++), <code>text/x-java</code>
354
+ (Java), <code>text/x-csharp</code> (C#),
355
+ <code>text/x-objectivec</code> (Objective-C),
356
+ <code>text/x-scala</code> (Scala), <code>text/x-vertex</code>
357
+ <code>x-shader/x-fragment</code> (shader programs),
358
+ <code>text/x-squirrel</code> (Squirrel) and
359
+ <code>text/x-ceylon</code> (Ceylon)</p>
360
+ </article>
assets/js/vendor/codemirror/mode/clike/scala.html ADDED
@@ -0,0 +1,767 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Scala mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/ambiance.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="../../addon/edit/matchbrackets.js"></script>
11
+ <script src="clike.js"></script>
12
+ <div id=nav>
13
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
14
+
15
+ <ul>
16
+ <li><a href="../../index.html">Home</a>
17
+ <li><a href="../../doc/manual.html">Manual</a>
18
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
19
+ </ul>
20
+ <ul>
21
+ <li><a href="../index.html">Language modes</a>
22
+ <li><a class=active href="#">Scala</a>
23
+ </ul>
24
+ </div>
25
+
26
+ <article>
27
+ <h2>Scala mode</h2>
28
+ <form>
29
+ <textarea id="code" name="code">
30
+
31
+ /* __ *\
32
+ ** ________ ___ / / ___ Scala API **
33
+ ** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL **
34
+ ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
35
+ ** /____/\___/_/ |_/____/_/ | | **
36
+ ** |/ **
37
+ \* */
38
+
39
+ package scala.collection
40
+
41
+ import generic._
42
+ import mutable.{ Builder, ListBuffer }
43
+ import annotation.{tailrec, migration, bridge}
44
+ import annotation.unchecked.{ uncheckedVariance => uV }
45
+ import parallel.ParIterable
46
+
47
+ /** A template trait for traversable collections of type `Traversable[A]`.
48
+ *
49
+ * $traversableInfo
50
+ * @define mutability
51
+ * @define traversableInfo
52
+ * This is a base trait of all kinds of $mutability Scala collections. It
53
+ * implements the behavior common to all collections, in terms of a method
54
+ * `foreach` with signature:
55
+ * {{{
56
+ * def foreach[U](f: Elem => U): Unit
57
+ * }}}
58
+ * Collection classes mixing in this trait provide a concrete
59
+ * `foreach` method which traverses all the
60
+ * elements contained in the collection, applying a given function to each.
61
+ * They also need to provide a method `newBuilder`
62
+ * which creates a builder for collections of the same kind.
63
+ *
64
+ * A traversable class might or might not have two properties: strictness
65
+ * and orderedness. Neither is represented as a type.
66
+ *
67
+ * The instances of a strict collection class have all their elements
68
+ * computed before they can be used as values. By contrast, instances of
69
+ * a non-strict collection class may defer computation of some of their
70
+ * elements until after the instance is available as a value.
71
+ * A typical example of a non-strict collection class is a
72
+ * <a href="../immutable/Stream.html" target="ContentFrame">
73
+ * `scala.collection.immutable.Stream`</a>.
74
+ * A more general class of examples are `TraversableViews`.
75
+ *
76
+ * If a collection is an instance of an ordered collection class, traversing
77
+ * its elements with `foreach` will always visit elements in the
78
+ * same order, even for different runs of the program. If the class is not
79
+ * ordered, `foreach` can visit elements in different orders for
80
+ * different runs (but it will keep the same order in the same run).'
81
+ *
82
+ * A typical example of a collection class which is not ordered is a
83
+ * `HashMap` of objects. The traversal order for hash maps will
84
+ * depend on the hash codes of its elements, and these hash codes might
85
+ * differ from one run to the next. By contrast, a `LinkedHashMap`
86
+ * is ordered because it's `foreach` method visits elements in the
87
+ * order they were inserted into the `HashMap`.
88
+ *
89
+ * @author Martin Odersky
90
+ * @version 2.8
91
+ * @since 2.8
92
+ * @tparam A the element type of the collection
93
+ * @tparam Repr the type of the actual collection containing the elements.
94
+ *
95
+ * @define Coll Traversable
96
+ * @define coll traversable collection
97
+ */
98
+ trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr]
99
+ with FilterMonadic[A, Repr]
100
+ with TraversableOnce[A]
101
+ with GenTraversableLike[A, Repr]
102
+ with Parallelizable[A, ParIterable[A]]
103
+ {
104
+ self =>
105
+
106
+ import Traversable.breaks._
107
+
108
+ /** The type implementing this traversable */
109
+ protected type Self = Repr
110
+
111
+ /** The collection of type $coll underlying this `TraversableLike` object.
112
+ * By default this is implemented as the `TraversableLike` object itself,
113
+ * but this can be overridden.
114
+ */
115
+ def repr: Repr = this.asInstanceOf[Repr]
116
+
117
+ /** The underlying collection seen as an instance of `$Coll`.
118
+ * By default this is implemented as the current collection object itself,
119
+ * but this can be overridden.
120
+ */
121
+ protected[this] def thisCollection: Traversable[A] = this.asInstanceOf[Traversable[A]]
122
+
123
+ /** A conversion from collections of type `Repr` to `$Coll` objects.
124
+ * By default this is implemented as just a cast, but this can be overridden.
125
+ */
126
+ protected[this] def toCollection(repr: Repr): Traversable[A] = repr.asInstanceOf[Traversable[A]]
127
+
128
+ /** Creates a new builder for this collection type.
129
+ */
130
+ protected[this] def newBuilder: Builder[A, Repr]
131
+
132
+ protected[this] def parCombiner = ParIterable.newCombiner[A]
133
+
134
+ /** Applies a function `f` to all elements of this $coll.
135
+ *
136
+ * Note: this method underlies the implementation of most other bulk operations.
137
+ * It's important to implement this method in an efficient way.
138
+ *
139
+ *
140
+ * @param f the function that is applied for its side-effect to every element.
141
+ * The result of function `f` is discarded.
142
+ *
143
+ * @tparam U the type parameter describing the result of function `f`.
144
+ * This result will always be ignored. Typically `U` is `Unit`,
145
+ * but this is not necessary.
146
+ *
147
+ * @usecase def foreach(f: A => Unit): Unit
148
+ */
149
+ def foreach[U](f: A => U): Unit
150
+
151
+ /** Tests whether this $coll is empty.
152
+ *
153
+ * @return `true` if the $coll contain no elements, `false` otherwise.
154
+ */
155
+ def isEmpty: Boolean = {
156
+ var result = true
157
+ breakable {
158
+ for (x <- this) {
159
+ result = false
160
+ break
161
+ }
162
+ }
163
+ result
164
+ }
165
+
166
+ /** Tests whether this $coll is known to have a finite size.
167
+ * All strict collections are known to have finite size. For a non-strict collection
168
+ * such as `Stream`, the predicate returns `true` if all elements have been computed.
169
+ * It returns `false` if the stream is not yet evaluated to the end.
170
+ *
171
+ * Note: many collection methods will not work on collections of infinite sizes.
172
+ *
173
+ * @return `true` if this collection is known to have finite size, `false` otherwise.
174
+ */
175
+ def hasDefiniteSize = true
176
+
177
+ def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
178
+ val b = bf(repr)
179
+ if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.seq.size)
180
+ b ++= thisCollection
181
+ b ++= that.seq
182
+ b.result
183
+ }
184
+
185
+ @bridge
186
+ def ++[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
187
+ ++(that: GenTraversableOnce[B])(bf)
188
+
189
+ /** Concatenates this $coll with the elements of a traversable collection.
190
+ * It differs from ++ in that the right operand determines the type of the
191
+ * resulting collection rather than the left one.
192
+ *
193
+ * @param that the traversable to append.
194
+ * @tparam B the element type of the returned collection.
195
+ * @tparam That $thatinfo
196
+ * @param bf $bfinfo
197
+ * @return a new collection of type `That` which contains all elements
198
+ * of this $coll followed by all elements of `that`.
199
+ *
200
+ * @usecase def ++:[B](that: TraversableOnce[B]): $Coll[B]
201
+ *
202
+ * @return a new $coll which contains all elements of this $coll
203
+ * followed by all elements of `that`.
204
+ */
205
+ def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
206
+ val b = bf(repr)
207
+ if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.size)
208
+ b ++= that
209
+ b ++= thisCollection
210
+ b.result
211
+ }
212
+
213
+ /** This overload exists because: for the implementation of ++: we should reuse
214
+ * that of ++ because many collections override it with more efficient versions.
215
+ * Since TraversableOnce has no '++' method, we have to implement that directly,
216
+ * but Traversable and down can use the overload.
217
+ */
218
+ def ++:[B >: A, That](that: Traversable[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
219
+ (that ++ seq)(breakOut)
220
+
221
+ def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
222
+ val b = bf(repr)
223
+ b.sizeHint(this)
224
+ for (x <- this) b += f(x)
225
+ b.result
226
+ }
227
+
228
+ def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
229
+ val b = bf(repr)
230
+ for (x <- this) b ++= f(x).seq
231
+ b.result
232
+ }
233
+
234
+ /** Selects all elements of this $coll which satisfy a predicate.
235
+ *
236
+ * @param p the predicate used to test elements.
237
+ * @return a new $coll consisting of all elements of this $coll that satisfy the given
238
+ * predicate `p`. The order of the elements is preserved.
239
+ */
240
+ def filter(p: A => Boolean): Repr = {
241
+ val b = newBuilder
242
+ for (x <- this)
243
+ if (p(x)) b += x
244
+ b.result
245
+ }
246
+
247
+ /** Selects all elements of this $coll which do not satisfy a predicate.
248
+ *
249
+ * @param p the predicate used to test elements.
250
+ * @return a new $coll consisting of all elements of this $coll that do not satisfy the given
251
+ * predicate `p`. The order of the elements is preserved.
252
+ */
253
+ def filterNot(p: A => Boolean): Repr = filter(!p(_))
254
+
255
+ def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
256
+ val b = bf(repr)
257
+ for (x <- this) if (pf.isDefinedAt(x)) b += pf(x)
258
+ b.result
259
+ }
260
+
261
+ /** Builds a new collection by applying an option-valued function to all
262
+ * elements of this $coll on which the function is defined.
263
+ *
264
+ * @param f the option-valued function which filters and maps the $coll.
265
+ * @tparam B the element type of the returned collection.
266
+ * @tparam That $thatinfo
267
+ * @param bf $bfinfo
268
+ * @return a new collection of type `That` resulting from applying the option-valued function
269
+ * `f` to each element and collecting all defined results.
270
+ * The order of the elements is preserved.
271
+ *
272
+ * @usecase def filterMap[B](f: A => Option[B]): $Coll[B]
273
+ *
274
+ * @param pf the partial function which filters and maps the $coll.
275
+ * @return a new $coll resulting from applying the given option-valued function
276
+ * `f` to each element and collecting all defined results.
277
+ * The order of the elements is preserved.
278
+ def filterMap[B, That](f: A => Option[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
279
+ val b = bf(repr)
280
+ for (x <- this)
281
+ f(x) match {
282
+ case Some(y) => b += y
283
+ case _ =>
284
+ }
285
+ b.result
286
+ }
287
+ */
288
+
289
+ /** Partitions this $coll in two ${coll}s according to a predicate.
290
+ *
291
+ * @param p the predicate on which to partition.
292
+ * @return a pair of ${coll}s: the first $coll consists of all elements that
293
+ * satisfy the predicate `p` and the second $coll consists of all elements
294
+ * that don't. The relative order of the elements in the resulting ${coll}s
295
+ * is the same as in the original $coll.
296
+ */
297
+ def partition(p: A => Boolean): (Repr, Repr) = {
298
+ val l, r = newBuilder
299
+ for (x <- this) (if (p(x)) l else r) += x
300
+ (l.result, r.result)
301
+ }
302
+
303
+ def groupBy[K](f: A => K): immutable.Map[K, Repr] = {
304
+ val m = mutable.Map.empty[K, Builder[A, Repr]]
305
+ for (elem <- this) {
306
+ val key = f(elem)
307
+ val bldr = m.getOrElseUpdate(key, newBuilder)
308
+ bldr += elem
309
+ }
310
+ val b = immutable.Map.newBuilder[K, Repr]
311
+ for ((k, v) <- m)
312
+ b += ((k, v.result))
313
+
314
+ b.result
315
+ }
316
+
317
+ /** Tests whether a predicate holds for all elements of this $coll.
318
+ *
319
+ * $mayNotTerminateInf
320
+ *
321
+ * @param p the predicate used to test elements.
322
+ * @return `true` if the given predicate `p` holds for all elements
323
+ * of this $coll, otherwise `false`.
324
+ */
325
+ def forall(p: A => Boolean): Boolean = {
326
+ var result = true
327
+ breakable {
328
+ for (x <- this)
329
+ if (!p(x)) { result = false; break }
330
+ }
331
+ result
332
+ }
333
+
334
+ /** Tests whether a predicate holds for some of the elements of this $coll.
335
+ *
336
+ * $mayNotTerminateInf
337
+ *
338
+ * @param p the predicate used to test elements.
339
+ * @return `true` if the given predicate `p` holds for some of the
340
+ * elements of this $coll, otherwise `false`.
341
+ */
342
+ def exists(p: A => Boolean): Boolean = {
343
+ var result = false
344
+ breakable {
345
+ for (x <- this)
346
+ if (p(x)) { result = true; break }
347
+ }
348
+ result
349
+ }
350
+
351
+ /** Finds the first element of the $coll satisfying a predicate, if any.
352
+ *
353
+ * $mayNotTerminateInf
354
+ * $orderDependent
355
+ *
356
+ * @param p the predicate used to test elements.
357
+ * @return an option value containing the first element in the $coll
358
+ * that satisfies `p`, or `None` if none exists.
359
+ */
360
+ def find(p: A => Boolean): Option[A] = {
361
+ var result: Option[A] = None
362
+ breakable {
363
+ for (x <- this)
364
+ if (p(x)) { result = Some(x); break }
365
+ }
366
+ result
367
+ }
368
+
369
+ def scan[B >: A, That](z: B)(op: (B, B) => B)(implicit cbf: CanBuildFrom[Repr, B, That]): That = scanLeft(z)(op)
370
+
371
+ def scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
372
+ val b = bf(repr)
373
+ b.sizeHint(this, 1)
374
+ var acc = z
375
+ b += acc
376
+ for (x <- this) { acc = op(acc, x); b += acc }
377
+ b.result
378
+ }
379
+
380
+ @migration(2, 9,
381
+ "This scanRight definition has changed in 2.9.\n" +
382
+ "The previous behavior can be reproduced with scanRight.reverse."
383
+ )
384
+ def scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
385
+ var scanned = List(z)
386
+ var acc = z
387
+ for (x <- reversed) {
388
+ acc = op(x, acc)
389
+ scanned ::= acc
390
+ }
391
+ val b = bf(repr)
392
+ for (elem <- scanned) b += elem
393
+ b.result
394
+ }
395
+
396
+ /** Selects the first element of this $coll.
397
+ * $orderDependent
398
+ * @return the first element of this $coll.
399
+ * @throws `NoSuchElementException` if the $coll is empty.
400
+ */
401
+ def head: A = {
402
+ var result: () => A = () => throw new NoSuchElementException
403
+ breakable {
404
+ for (x <- this) {
405
+ result = () => x
406
+ break
407
+ }
408
+ }
409
+ result()
410
+ }
411
+
412
+ /** Optionally selects the first element.
413
+ * $orderDependent
414
+ * @return the first element of this $coll if it is nonempty, `None` if it is empty.
415
+ */
416
+ def headOption: Option[A] = if (isEmpty) None else Some(head)
417
+
418
+ /** Selects all elements except the first.
419
+ * $orderDependent
420
+ * @return a $coll consisting of all elements of this $coll
421
+ * except the first one.
422
+ * @throws `UnsupportedOperationException` if the $coll is empty.
423
+ */
424
+ override def tail: Repr = {
425
+ if (isEmpty) throw new UnsupportedOperationException("empty.tail")
426
+ drop(1)
427
+ }
428
+
429
+ /** Selects the last element.
430
+ * $orderDependent
431
+ * @return The last element of this $coll.
432
+ * @throws NoSuchElementException If the $coll is empty.
433
+ */
434
+ def last: A = {
435
+ var lst = head
436
+ for (x <- this)
437
+ lst = x
438
+ lst
439
+ }
440
+
441
+ /** Optionally selects the last element.
442
+ * $orderDependent
443
+ * @return the last element of this $coll$ if it is nonempty, `None` if it is empty.
444
+ */
445
+ def lastOption: Option[A] = if (isEmpty) None else Some(last)
446
+
447
+ /** Selects all elements except the last.
448
+ * $orderDependent
449
+ * @return a $coll consisting of all elements of this $coll
450
+ * except the last one.
451
+ * @throws `UnsupportedOperationException` if the $coll is empty.
452
+ */
453
+ def init: Repr = {
454
+ if (isEmpty) throw new UnsupportedOperationException("empty.init")
455
+ var lst = head
456
+ var follow = false
457
+ val b = newBuilder
458
+ b.sizeHint(this, -1)
459
+ for (x <- this.seq) {
460
+ if (follow) b += lst
461
+ else follow = true
462
+ lst = x
463
+ }
464
+ b.result
465
+ }
466
+
467
+ def take(n: Int): Repr = slice(0, n)
468
+
469
+ def drop(n: Int): Repr =
470
+ if (n <= 0) {
471
+ val b = newBuilder
472
+ b.sizeHint(this)
473
+ b ++= thisCollection result
474
+ }
475
+ else sliceWithKnownDelta(n, Int.MaxValue, -n)
476
+
477
+ def slice(from: Int, until: Int): Repr = sliceWithKnownBound(math.max(from, 0), until)
478
+
479
+ // Precondition: from >= 0, until > 0, builder already configured for building.
480
+ private[this] def sliceInternal(from: Int, until: Int, b: Builder[A, Repr]): Repr = {
481
+ var i = 0
482
+ breakable {
483
+ for (x <- this.seq) {
484
+ if (i >= from) b += x
485
+ i += 1
486
+ if (i >= until) break
487
+ }
488
+ }
489
+ b.result
490
+ }
491
+ // Precondition: from >= 0
492
+ private[scala] def sliceWithKnownDelta(from: Int, until: Int, delta: Int): Repr = {
493
+ val b = newBuilder
494
+ if (until <= from) b.result
495
+ else {
496
+ b.sizeHint(this, delta)
497
+ sliceInternal(from, until, b)
498
+ }
499
+ }
500
+ // Precondition: from >= 0
501
+ private[scala] def sliceWithKnownBound(from: Int, until: Int): Repr = {
502
+ val b = newBuilder
503
+ if (until <= from) b.result
504
+ else {
505
+ b.sizeHintBounded(until - from, this)
506
+ sliceInternal(from, until, b)
507
+ }
508
+ }
509
+
510
+ def takeWhile(p: A => Boolean): Repr = {
511
+ val b = newBuilder
512
+ breakable {
513
+ for (x <- this) {
514
+ if (!p(x)) break
515
+ b += x
516
+ }
517
+ }
518
+ b.result
519
+ }
520
+
521
+ def dropWhile(p: A => Boolean): Repr = {
522
+ val b = newBuilder
523
+ var go = false
524
+ for (x <- this) {
525
+ if (!p(x)) go = true
526
+ if (go) b += x
527
+ }
528
+ b.result
529
+ }
530
+
531
+ def span(p: A => Boolean): (Repr, Repr) = {
532
+ val l, r = newBuilder
533
+ var toLeft = true
534
+ for (x <- this) {
535
+ toLeft = toLeft && p(x)
536
+ (if (toLeft) l else r) += x
537
+ }
538
+ (l.result, r.result)
539
+ }
540
+
541
+ def splitAt(n: Int): (Repr, Repr) = {
542
+ val l, r = newBuilder
543
+ l.sizeHintBounded(n, this)
544
+ if (n >= 0) r.sizeHint(this, -n)
545
+ var i = 0
546
+ for (x <- this) {
547
+ (if (i < n) l else r) += x
548
+ i += 1
549
+ }
550
+ (l.result, r.result)
551
+ }
552
+
553
+ /** Iterates over the tails of this $coll. The first value will be this
554
+ * $coll and the final one will be an empty $coll, with the intervening
555
+ * values the results of successive applications of `tail`.
556
+ *
557
+ * @return an iterator over all the tails of this $coll
558
+ * @example `List(1,2,3).tails = Iterator(List(1,2,3), List(2,3), List(3), Nil)`
559
+ */
560
+ def tails: Iterator[Repr] = iterateUntilEmpty(_.tail)
561
+
562
+ /** Iterates over the inits of this $coll. The first value will be this
563
+ * $coll and the final one will be an empty $coll, with the intervening
564
+ * values the results of successive applications of `init`.
565
+ *
566
+ * @return an iterator over all the inits of this $coll
567
+ * @example `List(1,2,3).inits = Iterator(List(1,2,3), List(1,2), List(1), Nil)`
568
+ */
569
+ def inits: Iterator[Repr] = iterateUntilEmpty(_.init)
570
+
571
+ /** Copies elements of this $coll to an array.
572
+ * Fills the given array `xs` with at most `len` elements of
573
+ * this $coll, starting at position `start`.
574
+ * Copying will stop once either the end of the current $coll is reached,
575
+ * or the end of the array is reached, or `len` elements have been copied.
576
+ *
577
+ * $willNotTerminateInf
578
+ *
579
+ * @param xs the array to fill.
580
+ * @param start the starting index.
581
+ * @param len the maximal number of elements to copy.
582
+ * @tparam B the type of the elements of the array.
583
+ *
584
+ *
585
+ * @usecase def copyToArray(xs: Array[A], start: Int, len: Int): Unit
586
+ */
587
+ def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) {
588
+ var i = start
589
+ val end = (start + len) min xs.length
590
+ breakable {
591
+ for (x <- this) {
592
+ if (i >= end) break
593
+ xs(i) = x
594
+ i += 1
595
+ }
596
+ }
597
+ }
598
+
599
+ def toTraversable: Traversable[A] = thisCollection
600
+ def toIterator: Iterator[A] = toStream.iterator
601
+ def toStream: Stream[A] = toBuffer.toStream
602
+
603
+ /** Converts this $coll to a string.
604
+ *
605
+ * @return a string representation of this collection. By default this
606
+ * string consists of the `stringPrefix` of this $coll,
607
+ * followed by all elements separated by commas and enclosed in parentheses.
608
+ */
609
+ override def toString = mkString(stringPrefix + "(", ", ", ")")
610
+
611
+ /** Defines the prefix of this object's `toString` representation.
612
+ *
613
+ * @return a string representation which starts the result of `toString`
614
+ * applied to this $coll. By default the string prefix is the
615
+ * simple name of the collection class $coll.
616
+ */
617
+ def stringPrefix : String = {
618
+ var string = repr.asInstanceOf[AnyRef].getClass.getName
619
+ val idx1 = string.lastIndexOf('.' : Int)
620
+ if (idx1 != -1) string = string.substring(idx1 + 1)
621
+ val idx2 = string.indexOf('$')
622
+ if (idx2 != -1) string = string.substring(0, idx2)
623
+ string
624
+ }
625
+
626
+ /** Creates a non-strict view of this $coll.
627
+ *
628
+ * @return a non-strict view of this $coll.
629
+ */
630
+ def view = new TraversableView[A, Repr] {
631
+ protected lazy val underlying = self.repr
632
+ override def foreach[U](f: A => U) = self foreach f
633
+ }
634
+
635
+ /** Creates a non-strict view of a slice of this $coll.
636
+ *
637
+ * Note: the difference between `view` and `slice` is that `view` produces
638
+ * a view of the current $coll, whereas `slice` produces a new $coll.
639
+ *
640
+ * Note: `view(from, to)` is equivalent to `view.slice(from, to)`
641
+ * $orderDependent
642
+ *
643
+ * @param from the index of the first element of the view
644
+ * @param until the index of the element following the view
645
+ * @return a non-strict view of a slice of this $coll, starting at index `from`
646
+ * and extending up to (but not including) index `until`.
647
+ */
648
+ def view(from: Int, until: Int): TraversableView[A, Repr] = view.slice(from, until)
649
+
650
+ /** Creates a non-strict filter of this $coll.
651
+ *
652
+ * Note: the difference between `c filter p` and `c withFilter p` is that
653
+ * the former creates a new collection, whereas the latter only
654
+ * restricts the domain of subsequent `map`, `flatMap`, `foreach`,
655
+ * and `withFilter` operations.
656
+ * $orderDependent
657
+ *
658
+ * @param p the predicate used to test elements.
659
+ * @return an object of class `WithFilter`, which supports
660
+ * `map`, `flatMap`, `foreach`, and `withFilter` operations.
661
+ * All these operations apply to those elements of this $coll which
662
+ * satisfy the predicate `p`.
663
+ */
664
+ def withFilter(p: A => Boolean): FilterMonadic[A, Repr] = new WithFilter(p)
665
+
666
+ /** A class supporting filtered operations. Instances of this class are
667
+ * returned by method `withFilter`.
668
+ */
669
+ class WithFilter(p: A => Boolean) extends FilterMonadic[A, Repr] {
670
+
671
+ /** Builds a new collection by applying a function to all elements of the
672
+ * outer $coll containing this `WithFilter` instance that satisfy predicate `p`.
673
+ *
674
+ * @param f the function to apply to each element.
675
+ * @tparam B the element type of the returned collection.
676
+ * @tparam That $thatinfo
677
+ * @param bf $bfinfo
678
+ * @return a new collection of type `That` resulting from applying
679
+ * the given function `f` to each element of the outer $coll
680
+ * that satisfies predicate `p` and collecting the results.
681
+ *
682
+ * @usecase def map[B](f: A => B): $Coll[B]
683
+ *
684
+ * @return a new $coll resulting from applying the given function
685
+ * `f` to each element of the outer $coll that satisfies
686
+ * predicate `p` and collecting the results.
687
+ */
688
+ def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
689
+ val b = bf(repr)
690
+ for (x <- self)
691
+ if (p(x)) b += f(x)
692
+ b.result
693
+ }
694
+
695
+ /** Builds a new collection by applying a function to all elements of the
696
+ * outer $coll containing this `WithFilter` instance that satisfy
697
+ * predicate `p` and concatenating the results.
698
+ *
699
+ * @param f the function to apply to each element.
700
+ * @tparam B the element type of the returned collection.
701
+ * @tparam That $thatinfo
702
+ * @param bf $bfinfo
703
+ * @return a new collection of type `That` resulting from applying
704
+ * the given collection-valued function `f` to each element
705
+ * of the outer $coll that satisfies predicate `p` and
706
+ * concatenating the results.
707
+ *
708
+ * @usecase def flatMap[B](f: A => TraversableOnce[B]): $Coll[B]
709
+ *
710
+ * @return a new $coll resulting from applying the given collection-valued function
711
+ * `f` to each element of the outer $coll that satisfies predicate `p` and concatenating the results.
712
+ */
713
+ def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
714
+ val b = bf(repr)
715
+ for (x <- self)
716
+ if (p(x)) b ++= f(x).seq
717
+ b.result
718
+ }
719
+
720
+ /** Applies a function `f` to all elements of the outer $coll containing
721
+ * this `WithFilter` instance that satisfy predicate `p`.
722
+ *
723
+ * @param f the function that is applied for its side-effect to every element.
724
+ * The result of function `f` is discarded.
725
+ *
726
+ * @tparam U the type parameter describing the result of function `f`.
727
+ * This result will always be ignored. Typically `U` is `Unit`,
728
+ * but this is not necessary.
729
+ *
730
+ * @usecase def foreach(f: A => Unit): Unit
731
+ */
732
+ def foreach[U](f: A => U): Unit =
733
+ for (x <- self)
734
+ if (p(x)) f(x)
735
+
736
+ /** Further refines the filter for this $coll.
737
+ *
738
+ * @param q the predicate used to test elements.
739
+ * @return an object of class `WithFilter`, which supports
740
+ * `map`, `flatMap`, `foreach`, and `withFilter` operations.
741
+ * All these operations apply to those elements of this $coll which
742
+ * satisfy the predicate `q` in addition to the predicate `p`.
743
+ */
744
+ def withFilter(q: A => Boolean): WithFilter =
745
+ new WithFilter(x => p(x) && q(x))
746
+ }
747
+
748
+ // A helper for tails and inits.
749
+ private def iterateUntilEmpty(f: Traversable[A @uV] => Traversable[A @uV]): Iterator[Repr] = {
750
+ val it = Iterator.iterate(thisCollection)(f) takeWhile (x => !x.isEmpty)
751
+ it ++ Iterator(Nil) map (newBuilder ++= _ result)
752
+ }
753
+ }
754
+
755
+
756
+ </textarea>
757
+ </form>
758
+
759
+ <script>
760
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
761
+ lineNumbers: true,
762
+ matchBrackets: true,
763
+ theme: "ambiance",
764
+ mode: "text/x-scala"
765
+ });
766
+ </script>
767
+ </article>
assets/js/vendor/codemirror/mode/clike/test.js ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function() {
5
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-c");
6
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
7
+
8
+ MT("indent",
9
+ "[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {",
10
+ " [variable-3 int] [variable c] [operator =] [variable b] [operator +]",
11
+ " [number 1];",
12
+ " [keyword return] [operator *][variable a];",
13
+ "}");
14
+
15
+ MT("indent_switch",
16
+ "[keyword switch] ([variable x]) {",
17
+ " [keyword case] [number 10]:",
18
+ " [keyword return] [number 20];",
19
+ " [keyword default]:",
20
+ " [variable printf]([string \"foo %c\"], [variable x]);",
21
+ "}");
22
+
23
+ MT("def",
24
+ "[variable-3 void] [def foo]() {}",
25
+ "[keyword struct] [def bar]{}",
26
+ "[variable-3 int] [variable-3 *][def baz]() {}");
27
+
28
+ MT("double_block",
29
+ "[keyword for] (;;)",
30
+ " [keyword for] (;;)",
31
+ " [variable x][operator ++];",
32
+ "[keyword return];");
33
+
34
+ var mode_cpp = CodeMirror.getMode({indentUnit: 2}, "text/x-c++src");
35
+ function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.call(arguments, 1)); }
36
+
37
+ MTCPP("cpp14_literal",
38
+ "[number 10'000];",
39
+ "[number 0b10'000];",
40
+ "[number 0x10'000];",
41
+ "[string '100000'];");
42
+ })();
assets/js/vendor/codemirror/mode/clojure/clojure.js ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /**
5
+ * Author: Hans Engel
6
+ * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun)
7
+ */
8
+
9
+ (function(mod) {
10
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
11
+ mod(require("../../lib/codemirror"));
12
+ else if (typeof define == "function" && define.amd) // AMD
13
+ define(["../../lib/codemirror"], mod);
14
+ else // Plain browser env
15
+ mod(CodeMirror);
16
+ })(function(CodeMirror) {
17
+ "use strict";
18
+
19
+ CodeMirror.defineMode("clojure", function (options) {
20
+ var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", CHARACTER = "string-2",
21
+ ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword", VAR = "variable";
22
+ var INDENT_WORD_SKIP = options.indentUnit || 2;
23
+ var NORMAL_INDENT_UNIT = options.indentUnit || 2;
24
+
25
+ function makeKeywords(str) {
26
+ var obj = {}, words = str.split(" ");
27
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
28
+ return obj;
29
+ }
30
+
31
+ var atoms = makeKeywords("true false nil");
32
+
33
+ var keywords = makeKeywords(
34
+ "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle");
35
+
36
+ var builtins = makeKeywords(
37
+ "* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>");
38
+
39
+ var indentKeys = makeKeywords(
40
+ // Built-ins
41
+ "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch " +
42
+
43
+ // Binding forms
44
+ "let letfn binding loop for doseq dotimes when-let if-let " +
45
+
46
+ // Data structures
47
+ "defstruct struct-map assoc " +
48
+
49
+ // clojure.test
50
+ "testing deftest " +
51
+
52
+ // contrib
53
+ "handler-case handle dotrace deftrace");
54
+
55
+ var tests = {
56
+ digit: /\d/,
57
+ digit_or_colon: /[\d:]/,
58
+ hex: /[0-9a-f]/i,
59
+ sign: /[+-]/,
60
+ exponent: /e/i,
61
+ keyword_char: /[^\s\(\[\;\)\]]/,
62
+ symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/
63
+ };
64
+
65
+ function stateStack(indent, type, prev) { // represents a state stack object
66
+ this.indent = indent;
67
+ this.type = type;
68
+ this.prev = prev;
69
+ }
70
+
71
+ function pushStack(state, indent, type) {
72
+ state.indentStack = new stateStack(indent, type, state.indentStack);
73
+ }
74
+
75
+ function popStack(state) {
76
+ state.indentStack = state.indentStack.prev;
77
+ }
78
+
79
+ function isNumber(ch, stream){
80
+ // hex
81
+ if ( ch === '0' && stream.eat(/x/i) ) {
82
+ stream.eatWhile(tests.hex);
83
+ return true;
84
+ }
85
+
86
+ // leading sign
87
+ if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) {
88
+ stream.eat(tests.sign);
89
+ ch = stream.next();
90
+ }
91
+
92
+ if ( tests.digit.test(ch) ) {
93
+ stream.eat(ch);
94
+ stream.eatWhile(tests.digit);
95
+
96
+ if ( '.' == stream.peek() ) {
97
+ stream.eat('.');
98
+ stream.eatWhile(tests.digit);
99
+ }
100
+
101
+ if ( stream.eat(tests.exponent) ) {
102
+ stream.eat(tests.sign);
103
+ stream.eatWhile(tests.digit);
104
+ }
105
+
106
+ return true;
107
+ }
108
+
109
+ return false;
110
+ }
111
+
112
+ // Eat character that starts after backslash \
113
+ function eatCharacter(stream) {
114
+ var first = stream.next();
115
+ // Read special literals: backspace, newline, space, return.
116
+ // Just read all lowercase letters.
117
+ if (first && first.match(/[a-z]/) && stream.match(/[a-z]+/, true)) {
118
+ return;
119
+ }
120
+ // Read unicode character: \u1000 \uA0a1
121
+ if (first === "u") {
122
+ stream.match(/[0-9a-z]{4}/i, true);
123
+ }
124
+ }
125
+
126
+ return {
127
+ startState: function () {
128
+ return {
129
+ indentStack: null,
130
+ indentation: 0,
131
+ mode: false
132
+ };
133
+ },
134
+
135
+ token: function (stream, state) {
136
+ if (state.indentStack == null && stream.sol()) {
137
+ // update indentation, but only if indentStack is empty
138
+ state.indentation = stream.indentation();
139
+ }
140
+
141
+ // skip spaces
142
+ if (stream.eatSpace()) {
143
+ return null;
144
+ }
145
+ var returnType = null;
146
+
147
+ switch(state.mode){
148
+ case "string": // multi-line string parsing mode
149
+ var next, escaped = false;
150
+ while ((next = stream.next()) != null) {
151
+ if (next == "\"" && !escaped) {
152
+
153
+ state.mode = false;
154
+ break;
155
+ }
156
+ escaped = !escaped && next == "\\";
157
+ }
158
+ returnType = STRING; // continue on in string mode
159
+ break;
160
+ default: // default parsing mode
161
+ var ch = stream.next();
162
+
163
+ if (ch == "\"") {
164
+ state.mode = "string";
165
+ returnType = STRING;
166
+ } else if (ch == "\\") {
167
+ eatCharacter(stream);
168
+ returnType = CHARACTER;
169
+ } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) {
170
+ returnType = ATOM;
171
+ } else if (ch == ";") { // comment
172
+ stream.skipToEnd(); // rest of the line is a comment
173
+ returnType = COMMENT;
174
+ } else if (isNumber(ch,stream)){
175
+ returnType = NUMBER;
176
+ } else if (ch == "(" || ch == "[" || ch == "{" ) {
177
+ var keyWord = '', indentTemp = stream.column(), letter;
178
+ /**
179
+ Either
180
+ (indent-word ..
181
+ (non-indent-word ..
182
+ (;something else, bracket, etc.
183
+ */
184
+
185
+ if (ch == "(") while ((letter = stream.eat(tests.keyword_char)) != null) {
186
+ keyWord += letter;
187
+ }
188
+
189
+ if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) ||
190
+ /^(?:def|with)/.test(keyWord))) { // indent-word
191
+ pushStack(state, indentTemp + INDENT_WORD_SKIP, ch);
192
+ } else { // non-indent word
193
+ // we continue eating the spaces
194
+ stream.eatSpace();
195
+ if (stream.eol() || stream.peek() == ";") {
196
+ // nothing significant after
197
+ // we restart indentation the user defined spaces after
198
+ pushStack(state, indentTemp + NORMAL_INDENT_UNIT, ch);
199
+ } else {
200
+ pushStack(state, indentTemp + stream.current().length, ch); // else we match
201
+ }
202
+ }
203
+ stream.backUp(stream.current().length - 1); // undo all the eating
204
+
205
+ returnType = BRACKET;
206
+ } else if (ch == ")" || ch == "]" || ch == "}") {
207
+ returnType = BRACKET;
208
+ if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : (ch == "]" ? "[" :"{"))) {
209
+ popStack(state);
210
+ }
211
+ } else if ( ch == ":" ) {
212
+ stream.eatWhile(tests.symbol);
213
+ return ATOM;
214
+ } else {
215
+ stream.eatWhile(tests.symbol);
216
+
217
+ if (keywords && keywords.propertyIsEnumerable(stream.current())) {
218
+ returnType = KEYWORD;
219
+ } else if (builtins && builtins.propertyIsEnumerable(stream.current())) {
220
+ returnType = BUILTIN;
221
+ } else if (atoms && atoms.propertyIsEnumerable(stream.current())) {
222
+ returnType = ATOM;
223
+ } else {
224
+ returnType = VAR;
225
+ }
226
+ }
227
+ }
228
+
229
+ return returnType;
230
+ },
231
+
232
+ indent: function (state) {
233
+ if (state.indentStack == null) return state.indentation;
234
+ return state.indentStack.indent;
235
+ },
236
+
237
+ closeBrackets: {pairs: "()[]{}\"\""},
238
+ lineComment: ";;"
239
+ };
240
+ });
241
+
242
+ CodeMirror.defineMIME("text/x-clojure", "clojure");
243
+
244
+ });
assets/js/vendor/codemirror/mode/clojure/index.html ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Clojure mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="clojure.js"></script>
10
+ <style>.CodeMirror {background: #f8f8f8;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Clojure</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Clojure mode</h2>
27
+ <form><textarea id="code" name="code">
28
+ ; Conway's Game of Life, based on the work of:
29
+ ;; Laurent Petit https://gist.github.com/1200343
30
+ ;; Christophe Grand http://clj-me.cgrand.net/2011/08/19/conways-game-of-life
31
+
32
+ (ns ^{:doc "Conway's Game of Life."}
33
+ game-of-life)
34
+
35
+ ;; Core game of life's algorithm functions
36
+
37
+ (defn neighbours
38
+ "Given a cell's coordinates, returns the coordinates of its neighbours."
39
+ [[x y]]
40
+ (for [dx [-1 0 1] dy (if (zero? dx) [-1 1] [-1 0 1])]
41
+ [(+ dx x) (+ dy y)]))
42
+
43
+ (defn step
44
+ "Given a set of living cells, computes the new set of living cells."
45
+ [cells]
46
+ (set (for [[cell n] (frequencies (mapcat neighbours cells))
47
+ :when (or (= n 3) (and (= n 2) (cells cell)))]
48
+ cell)))
49
+
50
+ ;; Utility methods for displaying game on a text terminal
51
+
52
+ (defn print-board
53
+ "Prints a board on *out*, representing a step in the game."
54
+ [board w h]
55
+ (doseq [x (range (inc w)) y (range (inc h))]
56
+ (if (= y 0) (print "\n"))
57
+ (print (if (board [x y]) "[X]" " . "))))
58
+
59
+ (defn display-grids
60
+ "Prints a squence of boards on *out*, representing several steps."
61
+ [grids w h]
62
+ (doseq [board grids]
63
+ (print-board board w h)
64
+ (print "\n")))
65
+
66
+ ;; Launches an example board
67
+
68
+ (def
69
+ ^{:doc "board represents the initial set of living cells"}
70
+ board #{[2 1] [2 2] [2 3]})
71
+
72
+ (display-grids (take 3 (iterate step board)) 5 5)
73
+
74
+ ;; Let's play with characters
75
+ (println \1 \a \# \\
76
+ \" \( \newline
77
+ \} \" \space
78
+ \tab \return \backspace
79
+ \u1000 \uAaAa \u9F9F)
80
+
81
+ </textarea></form>
82
+ <script>
83
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
84
+ </script>
85
+
86
+ <p><strong>MIME types defined:</strong> <code>text/x-clojure</code>.</p>
87
+
88
+ </article>
assets/js/vendor/codemirror/mode/cmake/cmake.js ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object")
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd)
8
+ define(["../../lib/codemirror"], mod);
9
+ else
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("cmake", function () {
15
+ var variable_regex = /({)?[a-zA-Z0-9_]+(})?/;
16
+
17
+ function tokenString(stream, state) {
18
+ var current, prev, found_var = false;
19
+ while (!stream.eol() && (current = stream.next()) != state.pending) {
20
+ if (current === '$' && prev != '\\' && state.pending == '"') {
21
+ found_var = true;
22
+ break;
23
+ }
24
+ prev = current;
25
+ }
26
+ if (found_var) {
27
+ stream.backUp(1);
28
+ }
29
+ if (current == state.pending) {
30
+ state.continueString = false;
31
+ } else {
32
+ state.continueString = true;
33
+ }
34
+ return "string";
35
+ }
36
+
37
+ function tokenize(stream, state) {
38
+ var ch = stream.next();
39
+
40
+ // Have we found a variable?
41
+ if (ch === '$') {
42
+ if (stream.match(variable_regex)) {
43
+ return 'variable-2';
44
+ }
45
+ return 'variable';
46
+ }
47
+ // Should we still be looking for the end of a string?
48
+ if (state.continueString) {
49
+ // If so, go through the loop again
50
+ stream.backUp(1);
51
+ return tokenString(stream, state);
52
+ }
53
+ // Do we just have a function on our hands?
54
+ // In 'cmake_minimum_required (VERSION 2.8.8)', 'cmake_minimum_required' is matched
55
+ if (stream.match(/(\s+)?\w+\(/) || stream.match(/(\s+)?\w+\ \(/)) {
56
+ stream.backUp(1);
57
+ return 'def';
58
+ }
59
+ if (ch == "#") {
60
+ stream.skipToEnd();
61
+ return "comment";
62
+ }
63
+ // Have we found a string?
64
+ if (ch == "'" || ch == '"') {
65
+ // Store the type (single or double)
66
+ state.pending = ch;
67
+ // Perform the looping function to find the end
68
+ return tokenString(stream, state);
69
+ }
70
+ if (ch == '(' || ch == ')') {
71
+ return 'bracket';
72
+ }
73
+ if (ch.match(/[0-9]/)) {
74
+ return 'number';
75
+ }
76
+ stream.eatWhile(/[\w-]/);
77
+ return null;
78
+ }
79
+ return {
80
+ startState: function () {
81
+ var state = {};
82
+ state.inDefinition = false;
83
+ state.inInclude = false;
84
+ state.continueString = false;
85
+ state.pending = false;
86
+ return state;
87
+ },
88
+ token: function (stream, state) {
89
+ if (stream.eatSpace()) return null;
90
+ return tokenize(stream, state);
91
+ }
92
+ };
93
+ });
94
+
95
+ CodeMirror.defineMIME("text/x-cmake", "cmake");
96
+
97
+ });
assets/js/vendor/codemirror/mode/cmake/index.html ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: CMake mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="cmake.js"></script>
11
+ <style>
12
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
13
+ .cm-s-default span.cm-arrow { color: red; }
14
+ </style>
15
+ <div id=nav>
16
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
17
+
18
+ <ul>
19
+ <li><a href="../../index.html">Home</a>
20
+ <li><a href="../../doc/manual.html">Manual</a>
21
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
22
+ </ul>
23
+ <ul>
24
+ <li><a href="../index.html">Language modes</a>
25
+ <li><a class=active href="#">CMake</a>
26
+ </ul>
27
+ </div>
28
+
29
+ <article>
30
+ <h2>CMake mode</h2>
31
+ <form><textarea id="code" name="code">
32
+ # vim: syntax=cmake
33
+ if(NOT CMAKE_BUILD_TYPE)
34
+ # default to Release build for GCC builds
35
+ set(CMAKE_BUILD_TYPE Release CACHE STRING
36
+ "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
37
+ FORCE)
38
+ endif()
39
+ message(STATUS "cmake version ${CMAKE_VERSION}")
40
+ if(POLICY CMP0025)
41
+ cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang
42
+ endif()
43
+ if(POLICY CMP0042)
44
+ cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH
45
+ endif()
46
+
47
+ project (x265)
48
+ cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8
49
+ include(CheckIncludeFiles)
50
+ include(CheckFunctionExists)
51
+ include(CheckSymbolExists)
52
+ include(CheckCXXCompilerFlag)
53
+
54
+ # X265_BUILD must be incremented each time the public API is changed
55
+ set(X265_BUILD 48)
56
+ configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
57
+ "${PROJECT_BINARY_DIR}/x265.def")
58
+ configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
59
+ "${PROJECT_BINARY_DIR}/x265_config.h")
60
+
61
+ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
62
+
63
+ # System architecture detection
64
+ string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
65
+ set(X86_ALIASES x86 i386 i686 x86_64 amd64)
66
+ list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
67
+ if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1")
68
+ message(STATUS "Detected x86 target processor")
69
+ set(X86 1)
70
+ add_definitions(-DX265_ARCH_X86=1)
71
+ if("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
72
+ set(X64 1)
73
+ add_definitions(-DX86_64=1)
74
+ endif()
75
+ elseif(${SYSPROC} STREQUAL "armv6l")
76
+ message(STATUS "Detected ARM target processor")
77
+ set(ARM 1)
78
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
79
+ else()
80
+ message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
81
+ message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
82
+ endif()
83
+
84
+ if(UNIX)
85
+ list(APPEND PLATFORM_LIBS pthread)
86
+ find_library(LIBRT rt)
87
+ if(LIBRT)
88
+ list(APPEND PLATFORM_LIBS rt)
89
+ endif()
90
+ find_package(Numa)
91
+ if(NUMA_FOUND)
92
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${NUMA_LIBRARY})
93
+ check_symbol_exists(numa_node_of_cpu numa.h NUMA_V2)
94
+ if(NUMA_V2)
95
+ add_definitions(-DHAVE_LIBNUMA)
96
+ message(STATUS "libnuma found, building with support for NUMA nodes")
97
+ list(APPEND PLATFORM_LIBS ${NUMA_LIBRARY})
98
+ link_directories(${NUMA_LIBRARY_DIR})
99
+ include_directories(${NUMA_INCLUDE_DIR})
100
+ endif()
101
+ endif()
102
+ mark_as_advanced(LIBRT NUMA_FOUND)
103
+ endif(UNIX)
104
+
105
+ if(X64 AND NOT WIN32)
106
+ option(ENABLE_PIC "Enable Position Independent Code" ON)
107
+ else()
108
+ option(ENABLE_PIC "Enable Position Independent Code" OFF)
109
+ endif(X64 AND NOT WIN32)
110
+
111
+ # Compiler detection
112
+ if(CMAKE_GENERATOR STREQUAL "Xcode")
113
+ set(XCODE 1)
114
+ endif()
115
+ if (APPLE)
116
+ add_definitions(-DMACOS)
117
+ endif()
118
+ </textarea></form>
119
+ <script>
120
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
121
+ mode: "text/x-cmake",
122
+ matchBrackets: true,
123
+ indentUnit: 4
124
+ });
125
+ </script>
126
+
127
+ <p><strong>MIME types defined:</strong> <code>text/x-cmake</code>.</p>
128
+
129
+ </article>
assets/js/vendor/codemirror/mode/cobol/cobol.js ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /**
5
+ * Author: Gautam Mehta
6
+ * Branched from CodeMirror's Scheme mode
7
+ */
8
+ (function(mod) {
9
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
10
+ mod(require("../../lib/codemirror"));
11
+ else if (typeof define == "function" && define.amd) // AMD
12
+ define(["../../lib/codemirror"], mod);
13
+ else // Plain browser env
14
+ mod(CodeMirror);
15
+ })(function(CodeMirror) {
16
+ "use strict";
17
+
18
+ CodeMirror.defineMode("cobol", function () {
19
+ var BUILTIN = "builtin", COMMENT = "comment", STRING = "string",
20
+ ATOM = "atom", NUMBER = "number", KEYWORD = "keyword", MODTAG = "header",
21
+ COBOLLINENUM = "def", PERIOD = "link";
22
+ function makeKeywords(str) {
23
+ var obj = {}, words = str.split(" ");
24
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
25
+ return obj;
26
+ }
27
+ var atoms = makeKeywords("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES ");
28
+ var keywords = makeKeywords(
29
+ "ACCEPT ACCESS ACQUIRE ADD ADDRESS " +
30
+ "ADVANCING AFTER ALIAS ALL ALPHABET " +
31
+ "ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED " +
32
+ "ALSO ALTER ALTERNATE AND ANY " +
33
+ "ARE AREA AREAS ARITHMETIC ASCENDING " +
34
+ "ASSIGN AT ATTRIBUTE AUTHOR AUTO " +
35
+ "AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS " +
36
+ "B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP " +
37
+ "BEFORE BELL BINARY BIT BITS " +
38
+ "BLANK BLINK BLOCK BOOLEAN BOTTOM " +
39
+ "BY CALL CANCEL CD CF " +
40
+ "CH CHARACTER CHARACTERS CLASS CLOCK-UNITS " +
41
+ "CLOSE COBOL CODE CODE-SET COL " +
42
+ "COLLATING COLUMN COMMA COMMIT COMMITMENT " +
43
+ "COMMON COMMUNICATION COMP COMP-0 COMP-1 " +
44
+ "COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 " +
45
+ "COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 " +
46
+ "COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 " +
47
+ "COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE " +
48
+ "CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS " +
49
+ "CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS " +
50
+ "CONVERTING COPY CORR CORRESPONDING COUNT " +
51
+ "CRT CRT-UNDER CURRENCY CURRENT CURSOR " +
52
+ "DATA DATE DATE-COMPILED DATE-WRITTEN DAY " +
53
+ "DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION " +
54
+ "DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS " +
55
+ "DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE " +
56
+ "DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING " +
57
+ "DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED " +
58
+ "DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION " +
59
+ "DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 " +
60
+ "DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 " +
61
+ "DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION " +
62
+ "DOWN DROP DUPLICATE DUPLICATES DYNAMIC " +
63
+ "EBCDIC EGI EJECT ELSE EMI " +
64
+ "EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. " +
65
+ "END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY " +
66
+ "END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY " +
67
+ "END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN " +
68
+ "END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT " +
69
+ "END-UNSTRING END-WRITE END-XML ENTER ENTRY " +
70
+ "ENVIRONMENT EOP EQUAL EQUALS ERASE " +
71
+ "ERROR ESI EVALUATE EVERY EXCEEDS " +
72
+ "EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL " +
73
+ "EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL " +
74
+ "FILE-STREAM FILES FILLER FINAL FIND " +
75
+ "FINISH FIRST FOOTING FOR FOREGROUND-COLOR " +
76
+ "FOREGROUND-COLOUR FORMAT FREE FROM FULL " +
77
+ "FUNCTION GENERATE GET GIVING GLOBAL " +
78
+ "GO GOBACK GREATER GROUP HEADING " +
79
+ "HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL " +
80
+ "ID IDENTIFICATION IF IN INDEX " +
81
+ "INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 " +
82
+ "INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED " +
83
+ "INDIC INDICATE INDICATOR INDICATORS INITIAL " +
84
+ "INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT " +
85
+ "INSTALLATION INTO INVALID INVOKE IS " +
86
+ "JUST JUSTIFIED KANJI KEEP KEY " +
87
+ "LABEL LAST LD LEADING LEFT " +
88
+ "LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY " +
89
+ "LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER " +
90
+ "LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE " +
91
+ "LOCALE LOCALLY LOCK " +
92
+ "MEMBER MEMORY MERGE MESSAGE METACLASS " +
93
+ "MODE MODIFIED MODIFY MODULES MOVE " +
94
+ "MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE " +
95
+ "NEXT NO NO-ECHO NONE NOT " +
96
+ "NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER " +
97
+ "NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS " +
98
+ "OF OFF OMITTED ON ONLY " +
99
+ "OPEN OPTIONAL OR ORDER ORGANIZATION " +
100
+ "OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL " +
101
+ "PADDING PAGE PAGE-COUNTER PARSE PERFORM " +
102
+ "PF PH PIC PICTURE PLUS " +
103
+ "POINTER POSITION POSITIVE PREFIX PRESENT " +
104
+ "PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES " +
105
+ "PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID " +
106
+ "PROMPT PROTECTED PURGE QUEUE QUOTE " +
107
+ "QUOTES RANDOM RD READ READY " +
108
+ "REALM RECEIVE RECONNECT RECORD RECORD-NAME " +
109
+ "RECORDS RECURSIVE REDEFINES REEL REFERENCE " +
110
+ "REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE " +
111
+ "REMAINDER REMOVAL RENAMES REPEATED REPLACE " +
112
+ "REPLACING REPORT REPORTING REPORTS REPOSITORY " +
113
+ "REQUIRED RERUN RESERVE RESET RETAINING " +
114
+ "RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO " +
115
+ "REVERSED REWIND REWRITE RF RH " +
116
+ "RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED " +
117
+ "RUN SAME SCREEN SD SEARCH " +
118
+ "SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT " +
119
+ "SELECT SEND SENTENCE SEPARATE SEQUENCE " +
120
+ "SEQUENTIAL SET SHARED SIGN SIZE " +
121
+ "SKIP1 SKIP2 SKIP3 SORT SORT-MERGE " +
122
+ "SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL " +
123
+ "SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 " +
124
+ "START STARTING STATUS STOP STORE " +
125
+ "STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA " +
126
+ "SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS " +
127
+ "SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT " +
128
+ "TABLE TALLYING TAPE TENANT TERMINAL " +
129
+ "TERMINATE TEST TEXT THAN THEN " +
130
+ "THROUGH THRU TIME TIMES TITLE " +
131
+ "TO TOP TRAILING TRAILING-SIGN TRANSACTION " +
132
+ "TYPE TYPEDEF UNDERLINE UNEQUAL UNIT " +
133
+ "UNSTRING UNTIL UP UPDATE UPON " +
134
+ "USAGE USAGE-MODE USE USING VALID " +
135
+ "VALIDATE VALUE VALUES VARYING VLR " +
136
+ "WAIT WHEN WHEN-COMPILED WITH WITHIN " +
137
+ "WORDS WORKING-STORAGE WRITE XML XML-CODE " +
138
+ "XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL " );
139
+
140
+ var builtins = makeKeywords("- * ** / + < <= = > >= ");
141
+ var tests = {
142
+ digit: /\d/,
143
+ digit_or_colon: /[\d:]/,
144
+ hex: /[0-9a-f]/i,
145
+ sign: /[+-]/,
146
+ exponent: /e/i,
147
+ keyword_char: /[^\s\(\[\;\)\]]/,
148
+ symbol: /[\w*+\-]/
149
+ };
150
+ function isNumber(ch, stream){
151
+ // hex
152
+ if ( ch === '0' && stream.eat(/x/i) ) {
153
+ stream.eatWhile(tests.hex);
154
+ return true;
155
+ }
156
+ // leading sign
157
+ if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) {
158
+ stream.eat(tests.sign);
159
+ ch = stream.next();
160
+ }
161
+ if ( tests.digit.test(ch) ) {
162
+ stream.eat(ch);
163
+ stream.eatWhile(tests.digit);
164
+ if ( '.' == stream.peek()) {
165
+ stream.eat('.');
166
+ stream.eatWhile(tests.digit);
167
+ }
168
+ if ( stream.eat(tests.exponent) ) {
169
+ stream.eat(tests.sign);
170
+ stream.eatWhile(tests.digit);
171
+ }
172
+ return true;
173
+ }
174
+ return false;
175
+ }
176
+ return {
177
+ startState: function () {
178
+ return {
179
+ indentStack: null,
180
+ indentation: 0,
181
+ mode: false
182
+ };
183
+ },
184
+ token: function (stream, state) {
185
+ if (state.indentStack == null && stream.sol()) {
186
+ // update indentation, but only if indentStack is empty
187
+ state.indentation = 6 ; //stream.indentation();
188
+ }
189
+ // skip spaces
190
+ if (stream.eatSpace()) {
191
+ return null;
192
+ }
193
+ var returnType = null;
194
+ switch(state.mode){
195
+ case "string": // multi-line string parsing mode
196
+ var next = false;
197
+ while ((next = stream.next()) != null) {
198
+ if (next == "\"" || next == "\'") {
199
+ state.mode = false;
200
+ break;
201
+ }
202
+ }
203
+ returnType = STRING; // continue on in string mode
204
+ break;
205
+ default: // default parsing mode
206
+ var ch = stream.next();
207
+ var col = stream.column();
208
+ if (col >= 0 && col <= 5) {
209
+ returnType = COBOLLINENUM;
210
+ } else if (col >= 72 && col <= 79) {
211
+ stream.skipToEnd();
212
+ returnType = MODTAG;
213
+ } else if (ch == "*" && col == 6) { // comment
214
+ stream.skipToEnd(); // rest of the line is a comment
215
+ returnType = COMMENT;
216
+ } else if (ch == "\"" || ch == "\'") {
217
+ state.mode = "string";
218
+ returnType = STRING;
219
+ } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) {
220
+ returnType = ATOM;
221
+ } else if (ch == ".") {
222
+ returnType = PERIOD;
223
+ } else if (isNumber(ch,stream)){
224
+ returnType = NUMBER;
225
+ } else {
226
+ if (stream.current().match(tests.symbol)) {
227
+ while (col < 71) {
228
+ if (stream.eat(tests.symbol) === undefined) {
229
+ break;
230
+ } else {
231
+ col++;
232
+ }
233
+ }
234
+ }
235
+ if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) {
236
+ returnType = KEYWORD;
237
+ } else if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) {
238
+ returnType = BUILTIN;
239
+ } else if (atoms && atoms.propertyIsEnumerable(stream.current().toUpperCase())) {
240
+ returnType = ATOM;
241
+ } else returnType = null;
242
+ }
243
+ }
244
+ return returnType;
245
+ },
246
+ indent: function (state) {
247
+ if (state.indentStack == null) return state.indentation;
248
+ return state.indentStack.indent;
249
+ }
250
+ };
251
+ });
252
+
253
+ CodeMirror.defineMIME("text/x-cobol", "cobol");
254
+
255
+ });
assets/js/vendor/codemirror/mode/cobol/index.html ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: COBOL mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/neat.css">
9
+ <link rel="stylesheet" href="../../theme/elegant.css">
10
+ <link rel="stylesheet" href="../../theme/erlang-dark.css">
11
+ <link rel="stylesheet" href="../../theme/night.css">
12
+ <link rel="stylesheet" href="../../theme/monokai.css">
13
+ <link rel="stylesheet" href="../../theme/cobalt.css">
14
+ <link rel="stylesheet" href="../../theme/eclipse.css">
15
+ <link rel="stylesheet" href="../../theme/rubyblue.css">
16
+ <link rel="stylesheet" href="../../theme/lesser-dark.css">
17
+ <link rel="stylesheet" href="../../theme/xq-dark.css">
18
+ <link rel="stylesheet" href="../../theme/xq-light.css">
19
+ <link rel="stylesheet" href="../../theme/ambiance.css">
20
+ <link rel="stylesheet" href="../../theme/blackboard.css">
21
+ <link rel="stylesheet" href="../../theme/vibrant-ink.css">
22
+ <link rel="stylesheet" href="../../theme/solarized.css">
23
+ <link rel="stylesheet" href="../../theme/twilight.css">
24
+ <link rel="stylesheet" href="../../theme/midnight.css">
25
+ <link rel="stylesheet" href="../../addon/dialog/dialog.css">
26
+ <script src="../../lib/codemirror.js"></script>
27
+ <script src="../../addon/edit/matchbrackets.js"></script>
28
+ <script src="cobol.js"></script>
29
+ <script src="../../addon/selection/active-line.js"></script>
30
+ <script src="../../addon/search/search.js"></script>
31
+ <script src="../../addon/dialog/dialog.js"></script>
32
+ <script src="../../addon/search/searchcursor.js"></script>
33
+ <style>
34
+ .CodeMirror {
35
+ border: 1px solid #eee;
36
+ font-size : 20px;
37
+ height : auto !important;
38
+ }
39
+ .CodeMirror-activeline-background {background: #555555 !important;}
40
+ </style>
41
+ <div id=nav>
42
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
43
+
44
+ <ul>
45
+ <li><a href="../../index.html">Home</a>
46
+ <li><a href="../../doc/manual.html">Manual</a>
47
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
48
+ </ul>
49
+ <ul>
50
+ <li><a href="../index.html">Language modes</a>
51
+ <li><a class=active href="#">COBOL</a>
52
+ </ul>
53
+ </div>
54
+
55
+ <article>
56
+ <h2>COBOL mode</h2>
57
+
58
+ <p> Select Theme <select onchange="selectTheme()" id="selectTheme">
59
+ <option>default</option>
60
+ <option>ambiance</option>
61
+ <option>blackboard</option>
62
+ <option>cobalt</option>
63
+ <option>eclipse</option>
64
+ <option>elegant</option>
65
+ <option>erlang-dark</option>
66
+ <option>lesser-dark</option>
67
+ <option>midnight</option>
68
+ <option>monokai</option>
69
+ <option>neat</option>
70
+ <option>night</option>
71
+ <option>rubyblue</option>
72
+ <option>solarized dark</option>
73
+ <option>solarized light</option>
74
+ <option selected>twilight</option>
75
+ <option>vibrant-ink</option>
76
+ <option>xq-dark</option>
77
+ <option>xq-light</option>
78
+ </select> Select Font Size <select onchange="selectFontsize()" id="selectFontSize">
79
+ <option value="13px">13px</option>
80
+ <option value="14px">14px</option>
81
+ <option value="16px">16px</option>
82
+ <option value="18px">18px</option>
83
+ <option value="20px" selected="selected">20px</option>
84
+ <option value="24px">24px</option>
85
+ <option value="26px">26px</option>
86
+ <option value="28px">28px</option>
87
+ <option value="30px">30px</option>
88
+ <option value="32px">32px</option>
89
+ <option value="34px">34px</option>
90
+ <option value="36px">36px</option>
91
+ </select>
92
+ <label for="checkBoxReadOnly">Read-only</label>
93
+ <input type="checkbox" id="checkBoxReadOnly" onchange="selectReadOnly()">
94
+ <label for="id_tabToIndentSpace">Insert Spaces on Tab</label>
95
+ <input type="checkbox" id="id_tabToIndentSpace" onchange="tabToIndentSpace()">
96
+ </p>
97
+ <textarea id="code" name="code">
98
+ ---------1---------2---------3---------4---------5---------6---------7---------8
99
+ 12345678911234567892123456789312345678941234567895123456789612345678971234567898
100
+ 000010 IDENTIFICATION DIVISION. MODTGHERE
101
+ 000020 PROGRAM-ID. SAMPLE.
102
+ 000030 AUTHOR. TEST SAM.
103
+ 000040 DATE-WRITTEN. 5 February 2013
104
+ 000041
105
+ 000042* A sample program just to show the form.
106
+ 000043* The program copies its input to the output,
107
+ 000044* and counts the number of records.
108
+ 000045* At the end this number is printed.
109
+ 000046
110
+ 000050 ENVIRONMENT DIVISION.
111
+ 000060 INPUT-OUTPUT SECTION.
112
+ 000070 FILE-CONTROL.
113
+ 000080 SELECT STUDENT-FILE ASSIGN TO SYSIN
114
+ 000090 ORGANIZATION IS LINE SEQUENTIAL.
115
+ 000100 SELECT PRINT-FILE ASSIGN TO SYSOUT
116
+ 000110 ORGANIZATION IS LINE SEQUENTIAL.
117
+ 000120
118
+ 000130 DATA DIVISION.
119
+ 000140 FILE SECTION.
120
+ 000150 FD STUDENT-FILE
121
+ 000160 RECORD CONTAINS 43 CHARACTERS
122
+ 000170 DATA RECORD IS STUDENT-IN.
123
+ 000180 01 STUDENT-IN PIC X(43).
124
+ 000190
125
+ 000200 FD PRINT-FILE
126
+ 000210 RECORD CONTAINS 80 CHARACTERS
127
+ 000220 DATA RECORD IS PRINT-LINE.
128
+ 000230 01 PRINT-LINE PIC X(80).
129
+ 000240
130
+ 000250 WORKING-STORAGE SECTION.
131
+ 000260 01 DATA-REMAINS-SWITCH PIC X(2) VALUE SPACES.
132
+ 000261 01 RECORDS-WRITTEN PIC 99.
133
+ 000270
134
+ 000280 01 DETAIL-LINE.
135
+ 000290 05 FILLER PIC X(7) VALUE SPACES.
136
+ 000300 05 RECORD-IMAGE PIC X(43).
137
+ 000310 05 FILLER PIC X(30) VALUE SPACES.
138
+ 000311
139
+ 000312 01 SUMMARY-LINE.
140
+ 000313 05 FILLER PIC X(7) VALUE SPACES.
141
+ 000314 05 TOTAL-READ PIC 99.
142
+ 000315 05 FILLER PIC X VALUE SPACE.
143
+ 000316 05 FILLER PIC X(17)
144
+ 000317 VALUE 'Records were read'.
145
+ 000318 05 FILLER PIC X(53) VALUE SPACES.
146
+ 000319
147
+ 000320 PROCEDURE DIVISION.
148
+ 000321
149
+ 000330 PREPARE-SENIOR-REPORT.
150
+ 000340 OPEN INPUT STUDENT-FILE
151
+ 000350 OUTPUT PRINT-FILE.
152
+ 000351 MOVE ZERO TO RECORDS-WRITTEN.
153
+ 000360 READ STUDENT-FILE
154
+ 000370 AT END MOVE 'NO' TO DATA-REMAINS-SWITCH
155
+ 000380 END-READ.
156
+ 000390 PERFORM PROCESS-RECORDS
157
+ 000410 UNTIL DATA-REMAINS-SWITCH = 'NO'.
158
+ 000411 PERFORM PRINT-SUMMARY.
159
+ 000420 CLOSE STUDENT-FILE
160
+ 000430 PRINT-FILE.
161
+ 000440 STOP RUN.
162
+ 000450
163
+ 000460 PROCESS-RECORDS.
164
+ 000470 MOVE STUDENT-IN TO RECORD-IMAGE.
165
+ 000480 MOVE DETAIL-LINE TO PRINT-LINE.
166
+ 000490 WRITE PRINT-LINE.
167
+ 000500 ADD 1 TO RECORDS-WRITTEN.
168
+ 000510 READ STUDENT-FILE
169
+ 000520 AT END MOVE 'NO' TO DATA-REMAINS-SWITCH
170
+ 000530 END-READ.
171
+ 000540
172
+ 000550 PRINT-SUMMARY.
173
+ 000560 MOVE RECORDS-WRITTEN TO TOTAL-READ.
174
+ 000570 MOVE SUMMARY-LINE TO PRINT-LINE.
175
+ 000571 WRITE PRINT-LINE.
176
+ 000572
177
+ 000580
178
+ </textarea>
179
+ <script>
180
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
181
+ lineNumbers: true,
182
+ matchBrackets: true,
183
+ mode: "text/x-cobol",
184
+ theme : "twilight",
185
+ styleActiveLine: true,
186
+ showCursorWhenSelecting : true,
187
+ });
188
+ function selectTheme() {
189
+ var themeInput = document.getElementById("selectTheme");
190
+ var theme = themeInput.options[themeInput.selectedIndex].innerHTML;
191
+ editor.setOption("theme", theme);
192
+ }
193
+ function selectFontsize() {
194
+ var fontSizeInput = document.getElementById("selectFontSize");
195
+ var fontSize = fontSizeInput.options[fontSizeInput.selectedIndex].innerHTML;
196
+ editor.getWrapperElement().style.fontSize = fontSize;
197
+ editor.refresh();
198
+ }
199
+ function selectReadOnly() {
200
+ editor.setOption("readOnly", document.getElementById("checkBoxReadOnly").checked);
201
+ }
202
+ function tabToIndentSpace() {
203
+ if (document.getElementById("id_tabToIndentSpace").checked) {
204
+ editor.setOption("extraKeys", {Tab: function(cm) { cm.replaceSelection(" ", "end"); }});
205
+ } else {
206
+ editor.setOption("extraKeys", {Tab: function(cm) { cm.replaceSelection(" ", "end"); }});
207
+ }
208
+ }
209
+ </script>
210
+ </article>
assets/js/vendor/codemirror/mode/commonlisp/commonlisp.js ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("commonlisp", function (config) {
15
+ var specialForm = /^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/;
16
+ var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/;
17
+ var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/;
18
+ var symbol = /[^\s'`,@()\[\]";]/;
19
+ var type;
20
+
21
+ function readSym(stream) {
22
+ var ch;
23
+ while (ch = stream.next()) {
24
+ if (ch == "\\") stream.next();
25
+ else if (!symbol.test(ch)) { stream.backUp(1); break; }
26
+ }
27
+ return stream.current();
28
+ }
29
+
30
+ function base(stream, state) {
31
+ if (stream.eatSpace()) {type = "ws"; return null;}
32
+ if (stream.match(numLiteral)) return "number";
33
+ var ch = stream.next();
34
+ if (ch == "\\") ch = stream.next();
35
+
36
+ if (ch == '"') return (state.tokenize = inString)(stream, state);
37
+ else if (ch == "(") { type = "open"; return "bracket"; }
38
+ else if (ch == ")" || ch == "]") { type = "close"; return "bracket"; }
39
+ else if (ch == ";") { stream.skipToEnd(); type = "ws"; return "comment"; }
40
+ else if (/['`,@]/.test(ch)) return null;
41
+ else if (ch == "|") {
42
+ if (stream.skipTo("|")) { stream.next(); return "symbol"; }
43
+ else { stream.skipToEnd(); return "error"; }
44
+ } else if (ch == "#") {
45
+ var ch = stream.next();
46
+ if (ch == "[") { type = "open"; return "bracket"; }
47
+ else if (/[+\-=\.']/.test(ch)) return null;
48
+ else if (/\d/.test(ch) && stream.match(/^\d*#/)) return null;
49
+ else if (ch == "|") return (state.tokenize = inComment)(stream, state);
50
+ else if (ch == ":") { readSym(stream); return "meta"; }
51
+ else return "error";
52
+ } else {
53
+ var name = readSym(stream);
54
+ if (name == ".") return null;
55
+ type = "symbol";
56
+ if (name == "nil" || name == "t" || name.charAt(0) == ":") return "atom";
57
+ if (state.lastType == "open" && (specialForm.test(name) || assumeBody.test(name))) return "keyword";
58
+ if (name.charAt(0) == "&") return "variable-2";
59
+ return "variable";
60
+ }
61
+ }
62
+
63
+ function inString(stream, state) {
64
+ var escaped = false, next;
65
+ while (next = stream.next()) {
66
+ if (next == '"' && !escaped) { state.tokenize = base; break; }
67
+ escaped = !escaped && next == "\\";
68
+ }
69
+ return "string";
70
+ }
71
+
72
+ function inComment(stream, state) {
73
+ var next, last;
74
+ while (next = stream.next()) {
75
+ if (next == "#" && last == "|") { state.tokenize = base; break; }
76
+ last = next;
77
+ }
78
+ type = "ws";
79
+ return "comment";
80
+ }
81
+
82
+ return {
83
+ startState: function () {
84
+ return {ctx: {prev: null, start: 0, indentTo: 0}, lastType: null, tokenize: base};
85
+ },
86
+
87
+ token: function (stream, state) {
88
+ if (stream.sol() && typeof state.ctx.indentTo != "number")
89
+ state.ctx.indentTo = state.ctx.start + 1;
90
+
91
+ type = null;
92
+ var style = state.tokenize(stream, state);
93
+ if (type != "ws") {
94
+ if (state.ctx.indentTo == null) {
95
+ if (type == "symbol" && assumeBody.test(stream.current()))
96
+ state.ctx.indentTo = state.ctx.start + config.indentUnit;
97
+ else
98
+ state.ctx.indentTo = "next";
99
+ } else if (state.ctx.indentTo == "next") {
100
+ state.ctx.indentTo = stream.column();
101
+ }
102
+ state.lastType = type;
103
+ }
104
+ if (type == "open") state.ctx = {prev: state.ctx, start: stream.column(), indentTo: null};
105
+ else if (type == "close") state.ctx = state.ctx.prev || state.ctx;
106
+ return style;
107
+ },
108
+
109
+ indent: function (state, _textAfter) {
110
+ var i = state.ctx.indentTo;
111
+ return typeof i == "number" ? i : state.ctx.start + 1;
112
+ },
113
+
114
+ closeBrackets: {pairs: "()[]{}\"\""},
115
+ lineComment: ";;",
116
+ blockCommentStart: "#|",
117
+ blockCommentEnd: "|#"
118
+ };
119
+ });
120
+
121
+ CodeMirror.defineMIME("text/x-common-lisp", "commonlisp");
122
+
123
+ });
assets/js/vendor/codemirror/mode/commonlisp/index.html ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Common Lisp mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="commonlisp.js"></script>
10
+ <style>.CodeMirror {background: #f8f8f8;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Common Lisp</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Common Lisp mode</h2>
27
+ <form><textarea id="code" name="code">(in-package :cl-postgres)
28
+
29
+ ;; These are used to synthesize reader and writer names for integer
30
+ ;; reading/writing functions when the amount of bytes and the
31
+ ;; signedness is known. Both the macro that creates the functions and
32
+ ;; some macros that use them create names this way.
33
+ (eval-when (:compile-toplevel :load-toplevel :execute)
34
+ (defun integer-reader-name (bytes signed)
35
+ (intern (with-standard-io-syntax
36
+ (format nil "~a~a~a~a" '#:read- (if signed "" '#:u) '#:int bytes))))
37
+ (defun integer-writer-name (bytes signed)
38
+ (intern (with-standard-io-syntax
39
+ (format nil "~a~a~a~a" '#:write- (if signed "" '#:u) '#:int bytes)))))
40
+
41
+ (defmacro integer-reader (bytes)
42
+ "Create a function to read integers from a binary stream."
43
+ (let ((bits (* bytes 8)))
44
+ (labels ((return-form (signed)
45
+ (if signed
46
+ `(if (logbitp ,(1- bits) result)
47
+ (dpb result (byte ,(1- bits) 0) -1)
48
+ result)
49
+ `result))
50
+ (generate-reader (signed)
51
+ `(defun ,(integer-reader-name bytes signed) (socket)
52
+ (declare (type stream socket)
53
+ #.*optimize*)
54
+ ,(if (= bytes 1)
55
+ `(let ((result (the (unsigned-byte 8) (read-byte socket))))
56
+ (declare (type (unsigned-byte 8) result))
57
+ ,(return-form signed))
58
+ `(let ((result 0))
59
+ (declare (type (unsigned-byte ,bits) result))
60
+ ,@(loop :for byte :from (1- bytes) :downto 0
61
+ :collect `(setf (ldb (byte 8 ,(* 8 byte)) result)
62
+ (the (unsigned-byte 8) (read-byte socket))))
63
+ ,(return-form signed))))))
64
+ `(progn
65
+ ;; This causes weird errors on SBCL in some circumstances. Disabled for now.
66
+ ;; (declaim (inline ,(integer-reader-name bytes t)
67
+ ;; ,(integer-reader-name bytes nil)))
68
+ (declaim (ftype (function (t) (signed-byte ,bits))
69
+ ,(integer-reader-name bytes t)))
70
+ ,(generate-reader t)
71
+ (declaim (ftype (function (t) (unsigned-byte ,bits))
72
+ ,(integer-reader-name bytes nil)))
73
+ ,(generate-reader nil)))))
74
+
75
+ (defmacro integer-writer (bytes)
76
+ "Create a function to write integers to a binary stream."
77
+ (let ((bits (* 8 bytes)))
78
+ `(progn
79
+ (declaim (inline ,(integer-writer-name bytes t)
80
+ ,(integer-writer-name bytes nil)))
81
+ (defun ,(integer-writer-name bytes nil) (socket value)
82
+ (declare (type stream socket)
83
+ (type (unsigned-byte ,bits) value)
84
+ #.*optimize*)
85
+ ,@(if (= bytes 1)
86
+ `((write-byte value socket))
87
+ (loop :for byte :from (1- bytes) :downto 0
88
+ :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value)
89
+ socket)))
90
+ (values))
91
+ (defun ,(integer-writer-name bytes t) (socket value)
92
+ (declare (type stream socket)
93
+ (type (signed-byte ,bits) value)
94
+ #.*optimize*)
95
+ ,@(if (= bytes 1)
96
+ `((write-byte (ldb (byte 8 0) value) socket))
97
+ (loop :for byte :from (1- bytes) :downto 0
98
+ :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value)
99
+ socket)))
100
+ (values)))))
101
+
102
+ ;; All the instances of the above that we need.
103
+
104
+ (integer-reader 1)
105
+ (integer-reader 2)
106
+ (integer-reader 4)
107
+ (integer-reader 8)
108
+
109
+ (integer-writer 1)
110
+ (integer-writer 2)
111
+ (integer-writer 4)
112
+
113
+ (defun write-bytes (socket bytes)
114
+ "Write a byte-array to a stream."
115
+ (declare (type stream socket)
116
+ (type (simple-array (unsigned-byte 8)) bytes)
117
+ #.*optimize*)
118
+ (write-sequence bytes socket))
119
+
120
+ (defun write-str (socket string)
121
+ "Write a null-terminated string to a stream \(encoding it when UTF-8
122
+ support is enabled.)."
123
+ (declare (type stream socket)
124
+ (type string string)
125
+ #.*optimize*)
126
+ (enc-write-string string socket)
127
+ (write-uint1 socket 0))
128
+
129
+ (declaim (ftype (function (t unsigned-byte)
130
+ (simple-array (unsigned-byte 8) (*)))
131
+ read-bytes))
132
+ (defun read-bytes (socket length)
133
+ "Read a byte array of the given length from a stream."
134
+ (declare (type stream socket)
135
+ (type fixnum length)
136
+ #.*optimize*)
137
+ (let ((result (make-array length :element-type '(unsigned-byte 8))))
138
+ (read-sequence result socket)
139
+ result))
140
+
141
+ (declaim (ftype (function (t) string) read-str))
142
+ (defun read-str (socket)
143
+ "Read a null-terminated string from a stream. Takes care of encoding
144
+ when UTF-8 support is enabled."
145
+ (declare (type stream socket)
146
+ #.*optimize*)
147
+ (enc-read-string socket :null-terminated t))
148
+
149
+ (defun skip-bytes (socket length)
150
+ "Skip a given number of bytes in a binary stream."
151
+ (declare (type stream socket)
152
+ (type (unsigned-byte 32) length)
153
+ #.*optimize*)
154
+ (dotimes (i length)
155
+ (read-byte socket)))
156
+
157
+ (defun skip-str (socket)
158
+ "Skip a null-terminated string."
159
+ (declare (type stream socket)
160
+ #.*optimize*)
161
+ (loop :for char :of-type fixnum = (read-byte socket)
162
+ :until (zerop char)))
163
+
164
+ (defun ensure-socket-is-closed (socket &amp;key abort)
165
+ (when (open-stream-p socket)
166
+ (handler-case
167
+ (close socket :abort abort)
168
+ (error (error)
169
+ (warn "Ignoring the error which happened while trying to close PostgreSQL socket: ~A" error)))))
170
+ </textarea></form>
171
+ <script>
172
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {lineNumbers: true});
173
+ </script>
174
+
175
+ <p><strong>MIME types defined:</strong> <code>text/x-common-lisp</code>.</p>
176
+
177
+ </article>
assets/js/vendor/codemirror/mode/cypher/cypher.js ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // By the Neo4j Team and contributors.
5
+ // https://github.com/neo4j-contrib/CodeMirror
6
+
7
+ (function(mod) {
8
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
9
+ mod(require("../../lib/codemirror"));
10
+ else if (typeof define == "function" && define.amd) // AMD
11
+ define(["../../lib/codemirror"], mod);
12
+ else // Plain browser env
13
+ mod(CodeMirror);
14
+ })(function(CodeMirror) {
15
+ "use strict";
16
+ var wordRegexp = function(words) {
17
+ return new RegExp("^(?:" + words.join("|") + ")$", "i");
18
+ };
19
+
20
+ CodeMirror.defineMode("cypher", function(config) {
21
+ var tokenBase = function(stream/*, state*/) {
22
+ var ch = stream.next();
23
+ if (ch === "\"" || ch === "'") {
24
+ stream.match(/.+?["']/);
25
+ return "string";
26
+ }
27
+ if (/[{}\(\),\.;\[\]]/.test(ch)) {
28
+ curPunc = ch;
29
+ return "node";
30
+ } else if (ch === "/" && stream.eat("/")) {
31
+ stream.skipToEnd();
32
+ return "comment";
33
+ } else if (operatorChars.test(ch)) {
34
+ stream.eatWhile(operatorChars);
35
+ return null;
36
+ } else {
37
+ stream.eatWhile(/[_\w\d]/);
38
+ if (stream.eat(":")) {
39
+ stream.eatWhile(/[\w\d_\-]/);
40
+ return "atom";
41
+ }
42
+ var word = stream.current();
43
+ if (funcs.test(word)) return "builtin";
44
+ if (preds.test(word)) return "def";
45
+ if (keywords.test(word)) return "keyword";
46
+ return "variable";
47
+ }
48
+ };
49
+ var pushContext = function(state, type, col) {
50
+ return state.context = {
51
+ prev: state.context,
52
+ indent: state.indent,
53
+ col: col,
54
+ type: type
55
+ };
56
+ };
57
+ var popContext = function(state) {
58
+ state.indent = state.context.indent;
59
+ return state.context = state.context.prev;
60
+ };
61
+ var indentUnit = config.indentUnit;
62
+ var curPunc;
63
+ var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]);
64
+ var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]);
65
+ var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]);
66
+ var operatorChars = /[*+\-<>=&|~%^]/;
67
+
68
+ return {
69
+ startState: function(/*base*/) {
70
+ return {
71
+ tokenize: tokenBase,
72
+ context: null,
73
+ indent: 0,
74
+ col: 0
75
+ };
76
+ },
77
+ token: function(stream, state) {
78
+ if (stream.sol()) {
79
+ if (state.context && (state.context.align == null)) {
80
+ state.context.align = false;
81
+ }
82
+ state.indent = stream.indentation();
83
+ }
84
+ if (stream.eatSpace()) {
85
+ return null;
86
+ }
87
+ var style = state.tokenize(stream, state);
88
+ if (style !== "comment" && state.context && (state.context.align == null) && state.context.type !== "pattern") {
89
+ state.context.align = true;
90
+ }
91
+ if (curPunc === "(") {
92
+ pushContext(state, ")", stream.column());
93
+ } else if (curPunc === "[") {
94
+ pushContext(state, "]", stream.column());
95
+ } else if (curPunc === "{") {
96
+ pushContext(state, "}", stream.column());
97
+ } else if (/[\]\}\)]/.test(curPunc)) {
98
+ while (state.context && state.context.type === "pattern") {
99
+ popContext(state);
100
+ }
101
+ if (state.context && curPunc === state.context.type) {
102
+ popContext(state);
103
+ }
104
+ } else if (curPunc === "." && state.context && state.context.type === "pattern") {
105
+ popContext(state);
106
+ } else if (/atom|string|variable/.test(style) && state.context) {
107
+ if (/[\}\]]/.test(state.context.type)) {
108
+ pushContext(state, "pattern", stream.column());
109
+ } else if (state.context.type === "pattern" && !state.context.align) {
110
+ state.context.align = true;
111
+ state.context.col = stream.column();
112
+ }
113
+ }
114
+ return style;
115
+ },
116
+ indent: function(state, textAfter) {
117
+ var firstChar = textAfter && textAfter.charAt(0);
118
+ var context = state.context;
119
+ if (/[\]\}]/.test(firstChar)) {
120
+ while (context && context.type === "pattern") {
121
+ context = context.prev;
122
+ }
123
+ }
124
+ var closing = context && firstChar === context.type;
125
+ if (!context) return 0;
126
+ if (context.type === "keywords") return CodeMirror.commands.newlineAndIndent;
127
+ if (context.align) return context.col + (closing ? 0 : 1);
128
+ return context.indent + (closing ? 0 : indentUnit);
129
+ }
130
+ };
131
+ });
132
+
133
+ CodeMirror.modeExtensions["cypher"] = {
134
+ autoFormatLineBreaks: function(text) {
135
+ var i, lines, reProcessedPortion;
136
+ var lines = text.split("\n");
137
+ var reProcessedPortion = /\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g;
138
+ for (var i = 0; i < lines.length; i++)
139
+ lines[i] = lines[i].replace(reProcessedPortion, " \n$1 ").trim();
140
+ return lines.join("\n");
141
+ }
142
+ };
143
+
144
+ CodeMirror.defineMIME("application/x-cypher-query", "cypher");
145
+
146
+ });
assets/js/vendor/codemirror/mode/cypher/index.html ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Cypher Mode for CodeMirror</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css" />
8
+ <link rel="stylesheet" href="../../theme/neo.css" />
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="cypher.js"></script>
11
+ <style>
12
+ .CodeMirror {
13
+ border-top: 1px solid black;
14
+ border-bottom: 1px solid black;
15
+ }
16
+ </style>
17
+ <div id=nav>
18
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
19
+
20
+ <ul>
21
+ <li><a href="../../index.html">Home</a>
22
+ <li><a href="../../doc/manual.html">Manual</a>
23
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
24
+ </ul>
25
+ <ul>
26
+ <li><a href="../index.html">Language modes</a>
27
+ <li><a class=active href="#">Cypher Mode for CodeMirror</a>
28
+ </ul>
29
+ </div>
30
+
31
+ <article>
32
+ <h2>Cypher Mode for CodeMirror</h2>
33
+ <form>
34
+ <textarea id="code" name="code">// Cypher Mode for CodeMirror, using the neo theme
35
+ MATCH (joe { name: 'Joe' })-[:knows*2..2]-(friend_of_friend)
36
+ WHERE NOT (joe)-[:knows]-(friend_of_friend)
37
+ RETURN friend_of_friend.name, COUNT(*)
38
+ ORDER BY COUNT(*) DESC , friend_of_friend.name
39
+ </textarea>
40
+ </form>
41
+ <p><strong>MIME types defined:</strong>
42
+ <code><a href="?mime=application/x-cypher-query">application/x-cypher-query</a></code>
43
+ </p>
44
+ <script>
45
+ window.onload = function() {
46
+ var mime = 'application/x-cypher-query';
47
+ // get mime type
48
+ if (window.location.href.indexOf('mime=') > -1) {
49
+ mime = window.location.href.substr(window.location.href.indexOf('mime=') + 5);
50
+ }
51
+ window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {
52
+ mode: mime,
53
+ indentWithTabs: true,
54
+ smartIndent: true,
55
+ lineNumbers: true,
56
+ matchBrackets : true,
57
+ autofocus: true,
58
+ theme: 'neo'
59
+ });
60
+ };
61
+ </script>
62
+
63
+ </article>
assets/js/vendor/codemirror/mode/d/d.js ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("d", function(config, parserConfig) {
15
+ var indentUnit = config.indentUnit,
16
+ statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
17
+ keywords = parserConfig.keywords || {},
18
+ builtin = parserConfig.builtin || {},
19
+ blockKeywords = parserConfig.blockKeywords || {},
20
+ atoms = parserConfig.atoms || {},
21
+ hooks = parserConfig.hooks || {},
22
+ multiLineStrings = parserConfig.multiLineStrings;
23
+ var isOperatorChar = /[+\-*&%=<>!?|\/]/;
24
+
25
+ var curPunc;
26
+
27
+ function tokenBase(stream, state) {
28
+ var ch = stream.next();
29
+ if (hooks[ch]) {
30
+ var result = hooks[ch](stream, state);
31
+ if (result !== false) return result;
32
+ }
33
+ if (ch == '"' || ch == "'" || ch == "`") {
34
+ state.tokenize = tokenString(ch);
35
+ return state.tokenize(stream, state);
36
+ }
37
+ if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
38
+ curPunc = ch;
39
+ return null;
40
+ }
41
+ if (/\d/.test(ch)) {
42
+ stream.eatWhile(/[\w\.]/);
43
+ return "number";
44
+ }
45
+ if (ch == "/") {
46
+ if (stream.eat("+")) {
47
+ state.tokenize = tokenComment;
48
+ return tokenNestedComment(stream, state);
49
+ }
50
+ if (stream.eat("*")) {
51
+ state.tokenize = tokenComment;
52
+ return tokenComment(stream, state);
53
+ }
54
+ if (stream.eat("/")) {
55
+ stream.skipToEnd();
56
+ return "comment";
57
+ }
58
+ }
59
+ if (isOperatorChar.test(ch)) {
60
+ stream.eatWhile(isOperatorChar);
61
+ return "operator";
62
+ }
63
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
64
+ var cur = stream.current();
65
+ if (keywords.propertyIsEnumerable(cur)) {
66
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
67
+ return "keyword";
68
+ }
69
+ if (builtin.propertyIsEnumerable(cur)) {
70
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
71
+ return "builtin";
72
+ }
73
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
74
+ return "variable";
75
+ }
76
+
77
+ function tokenString(quote) {
78
+ return function(stream, state) {
79
+ var escaped = false, next, end = false;
80
+ while ((next = stream.next()) != null) {
81
+ if (next == quote && !escaped) {end = true; break;}
82
+ escaped = !escaped && next == "\\";
83
+ }
84
+ if (end || !(escaped || multiLineStrings))
85
+ state.tokenize = null;
86
+ return "string";
87
+ };
88
+ }
89
+
90
+ function tokenComment(stream, state) {
91
+ var maybeEnd = false, ch;
92
+ while (ch = stream.next()) {
93
+ if (ch == "/" && maybeEnd) {
94
+ state.tokenize = null;
95
+ break;
96
+ }
97
+ maybeEnd = (ch == "*");
98
+ }
99
+ return "comment";
100
+ }
101
+
102
+ function tokenNestedComment(stream, state) {
103
+ var maybeEnd = false, ch;
104
+ while (ch = stream.next()) {
105
+ if (ch == "/" && maybeEnd) {
106
+ state.tokenize = null;
107
+ break;
108
+ }
109
+ maybeEnd = (ch == "+");
110
+ }
111
+ return "comment";
112
+ }
113
+
114
+ function Context(indented, column, type, align, prev) {
115
+ this.indented = indented;
116
+ this.column = column;
117
+ this.type = type;
118
+ this.align = align;
119
+ this.prev = prev;
120
+ }
121
+ function pushContext(state, col, type) {
122
+ var indent = state.indented;
123
+ if (state.context && state.context.type == "statement")
124
+ indent = state.context.indented;
125
+ return state.context = new Context(indent, col, type, null, state.context);
126
+ }
127
+ function popContext(state) {
128
+ var t = state.context.type;
129
+ if (t == ")" || t == "]" || t == "}")
130
+ state.indented = state.context.indented;
131
+ return state.context = state.context.prev;
132
+ }
133
+
134
+ // Interface
135
+
136
+ return {
137
+ startState: function(basecolumn) {
138
+ return {
139
+ tokenize: null,
140
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
141
+ indented: 0,
142
+ startOfLine: true
143
+ };
144
+ },
145
+
146
+ token: function(stream, state) {
147
+ var ctx = state.context;
148
+ if (stream.sol()) {
149
+ if (ctx.align == null) ctx.align = false;
150
+ state.indented = stream.indentation();
151
+ state.startOfLine = true;
152
+ }
153
+ if (stream.eatSpace()) return null;
154
+ curPunc = null;
155
+ var style = (state.tokenize || tokenBase)(stream, state);
156
+ if (style == "comment" || style == "meta") return style;
157
+ if (ctx.align == null) ctx.align = true;
158
+
159
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);
160
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
161
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
162
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
163
+ else if (curPunc == "}") {
164
+ while (ctx.type == "statement") ctx = popContext(state);
165
+ if (ctx.type == "}") ctx = popContext(state);
166
+ while (ctx.type == "statement") ctx = popContext(state);
167
+ }
168
+ else if (curPunc == ctx.type) popContext(state);
169
+ else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement"))
170
+ pushContext(state, stream.column(), "statement");
171
+ state.startOfLine = false;
172
+ return style;
173
+ },
174
+
175
+ indent: function(state, textAfter) {
176
+ if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
177
+ var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
178
+ if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
179
+ var closing = firstChar == ctx.type;
180
+ if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
181
+ else if (ctx.align) return ctx.column + (closing ? 0 : 1);
182
+ else return ctx.indented + (closing ? 0 : indentUnit);
183
+ },
184
+
185
+ electricChars: "{}"
186
+ };
187
+ });
188
+
189
+ function words(str) {
190
+ var obj = {}, words = str.split(" ");
191
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
192
+ return obj;
193
+ }
194
+
195
+ var blockKeywords = "body catch class do else enum for foreach foreach_reverse if in interface mixin " +
196
+ "out scope struct switch try union unittest version while with";
197
+
198
+ CodeMirror.defineMIME("text/x-d", {
199
+ name: "d",
200
+ keywords: words("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue " +
201
+ "debug default delegate delete deprecated export extern final finally function goto immutable " +
202
+ "import inout invariant is lazy macro module new nothrow override package pragma private " +
203
+ "protected public pure ref return shared short static super synchronized template this " +
204
+ "throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters " +
205
+ blockKeywords),
206
+ blockKeywords: words(blockKeywords),
207
+ builtin: words("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte " +
208
+ "ucent uint ulong ushort wchar wstring void size_t sizediff_t"),
209
+ atoms: words("exit failure success true false null"),
210
+ hooks: {
211
+ "@": function(stream, _state) {
212
+ stream.eatWhile(/[\w\$_]/);
213
+ return "meta";
214
+ }
215
+ }
216
+ });
217
+
218
+ });
assets/js/vendor/codemirror/mode/d/index.html ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: D mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="d.js"></script>
11
+ <style>.CodeMirror {border: 2px inset #dee;}</style>
12
+ <div id=nav>
13
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
14
+
15
+ <ul>
16
+ <li><a href="../../index.html">Home</a>
17
+ <li><a href="../../doc/manual.html">Manual</a>
18
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
19
+ </ul>
20
+ <ul>
21
+ <li><a href="../index.html">Language modes</a>
22
+ <li><a class=active href="#">D</a>
23
+ </ul>
24
+ </div>
25
+
26
+ <article>
27
+ <h2>D mode</h2>
28
+ <form><textarea id="code" name="code">
29
+ /* D demo code // copied from phobos/sd/metastrings.d */
30
+ // Written in the D programming language.
31
+
32
+ /**
33
+ Templates with which to do compile-time manipulation of strings.
34
+
35
+ Macros:
36
+ WIKI = Phobos/StdMetastrings
37
+
38
+ Copyright: Copyright Digital Mars 2007 - 2009.
39
+ License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
40
+ Authors: $(WEB digitalmars.com, Walter Bright),
41
+ Don Clugston
42
+ Source: $(PHOBOSSRC std/_metastrings.d)
43
+ */
44
+ /*
45
+ Copyright Digital Mars 2007 - 2009.
46
+ Distributed under the Boost Software License, Version 1.0.
47
+ (See accompanying file LICENSE_1_0.txt or copy at
48
+ http://www.boost.org/LICENSE_1_0.txt)
49
+ */
50
+ module std.metastrings;
51
+
52
+ /**
53
+ Formats constants into a string at compile time. Analogous to $(XREF
54
+ string,format).
55
+
56
+ Parameters:
57
+
58
+ A = tuple of constants, which can be strings, characters, or integral
59
+ values.
60
+
61
+ Formats:
62
+ * The formats supported are %s for strings, and %%
63
+ * for the % character.
64
+ Example:
65
+ ---
66
+ import std.metastrings;
67
+ import std.stdio;
68
+
69
+ void main()
70
+ {
71
+ string s = Format!("Arg %s = %s", "foo", 27);
72
+ writefln(s); // "Arg foo = 27"
73
+ }
74
+ * ---
75
+ */
76
+
77
+ template Format(A...)
78
+ {
79
+ static if (A.length == 0)
80
+ enum Format = "";
81
+ else static if (is(typeof(A[0]) : const(char)[]))
82
+ enum Format = FormatString!(A[0], A[1..$]);
83
+ else
84
+ enum Format = toStringNow!(A[0]) ~ Format!(A[1..$]);
85
+ }
86
+
87
+ template FormatString(const(char)[] F, A...)
88
+ {
89
+ static if (F.length == 0)
90
+ enum FormatString = Format!(A);
91
+ else static if (F.length == 1)
92
+ enum FormatString = F[0] ~ Format!(A);
93
+ else static if (F[0..2] == "%s")
94
+ enum FormatString
95
+ = toStringNow!(A[0]) ~ FormatString!(F[2..$],A[1..$]);
96
+ else static if (F[0..2] == "%%")
97
+ enum FormatString = "%" ~ FormatString!(F[2..$],A);
98
+ else
99
+ {
100
+ static assert(F[0] != '%', "unrecognized format %" ~ F[1]);
101
+ enum FormatString = F[0] ~ FormatString!(F[1..$],A);
102
+ }
103
+ }
104
+
105
+ unittest
106
+ {
107
+ auto s = Format!("hel%slo", "world", -138, 'c', true);
108
+ assert(s == "helworldlo-138ctrue", "[" ~ s ~ "]");
109
+ }
110
+
111
+ /**
112
+ * Convert constant argument to a string.
113
+ */
114
+
115
+ template toStringNow(ulong v)
116
+ {
117
+ static if (v < 10)
118
+ enum toStringNow = "" ~ cast(char)(v + '0');
119
+ else
120
+ enum toStringNow = toStringNow!(v / 10) ~ toStringNow!(v % 10);
121
+ }
122
+
123
+ unittest
124
+ {
125
+ static assert(toStringNow!(1uL << 62) == "4611686018427387904");
126
+ }
127
+
128
+ /// ditto
129
+ template toStringNow(long v)
130
+ {
131
+ static if (v < 0)
132
+ enum toStringNow = "-" ~ toStringNow!(cast(ulong) -v);
133
+ else
134
+ enum toStringNow = toStringNow!(cast(ulong) v);
135
+ }
136
+
137
+ unittest
138
+ {
139
+ static assert(toStringNow!(0x100000000) == "4294967296");
140
+ static assert(toStringNow!(-138L) == "-138");
141
+ }
142
+
143
+ /// ditto
144
+ template toStringNow(uint U)
145
+ {
146
+ enum toStringNow = toStringNow!(cast(ulong)U);
147
+ }
148
+
149
+ /// ditto
150
+ template toStringNow(int I)
151
+ {
152
+ enum toStringNow = toStringNow!(cast(long)I);
153
+ }
154
+
155
+ /// ditto
156
+ template toStringNow(bool B)
157
+ {
158
+ enum toStringNow = B ? "true" : "false";
159
+ }
160
+
161
+ /// ditto
162
+ template toStringNow(string S)
163
+ {
164
+ enum toStringNow = S;
165
+ }
166
+
167
+ /// ditto
168
+ template toStringNow(char C)
169
+ {
170
+ enum toStringNow = "" ~ C;
171
+ }
172
+
173
+
174
+ /********
175
+ * Parse unsigned integer literal from the start of string s.
176
+ * returns:
177
+ * .value = the integer literal as a string,
178
+ * .rest = the string following the integer literal
179
+ * Otherwise:
180
+ * .value = null,
181
+ * .rest = s
182
+ */
183
+
184
+ template parseUinteger(const(char)[] s)
185
+ {
186
+ static if (s.length == 0)
187
+ {
188
+ enum value = "";
189
+ enum rest = "";
190
+ }
191
+ else static if (s[0] >= '0' && s[0] <= '9')
192
+ {
193
+ enum value = s[0] ~ parseUinteger!(s[1..$]).value;
194
+ enum rest = parseUinteger!(s[1..$]).rest;
195
+ }
196
+ else
197
+ {
198
+ enum value = "";
199
+ enum rest = s;
200
+ }
201
+ }
202
+
203
+ /********
204
+ Parse integer literal optionally preceded by $(D '-') from the start
205
+ of string $(D s).
206
+
207
+ Returns:
208
+ .value = the integer literal as a string,
209
+ .rest = the string following the integer literal
210
+
211
+ Otherwise:
212
+ .value = null,
213
+ .rest = s
214
+ */
215
+
216
+ template parseInteger(const(char)[] s)
217
+ {
218
+ static if (s.length == 0)
219
+ {
220
+ enum value = "";
221
+ enum rest = "";
222
+ }
223
+ else static if (s[0] >= '0' && s[0] <= '9')
224
+ {
225
+ enum value = s[0] ~ parseUinteger!(s[1..$]).value;
226
+ enum rest = parseUinteger!(s[1..$]).rest;
227
+ }
228
+ else static if (s.length >= 2 &&
229
+ s[0] == '-' && s[1] >= '0' && s[1] <= '9')
230
+ {
231
+ enum value = s[0..2] ~ parseUinteger!(s[2..$]).value;
232
+ enum rest = parseUinteger!(s[2..$]).rest;
233
+ }
234
+ else
235
+ {
236
+ enum value = "";
237
+ enum rest = s;
238
+ }
239
+ }
240
+
241
+ unittest
242
+ {
243
+ assert(parseUinteger!("1234abc").value == "1234");
244
+ assert(parseUinteger!("1234abc").rest == "abc");
245
+ assert(parseInteger!("-1234abc").value == "-1234");
246
+ assert(parseInteger!("-1234abc").rest == "abc");
247
+ }
248
+
249
+ /**
250
+ Deprecated aliases held for backward compatibility.
251
+ */
252
+ deprecated alias toStringNow ToString;
253
+ /// Ditto
254
+ deprecated alias parseUinteger ParseUinteger;
255
+ /// Ditto
256
+ deprecated alias parseUinteger ParseInteger;
257
+
258
+ </textarea></form>
259
+
260
+ <script>
261
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
262
+ lineNumbers: true,
263
+ matchBrackets: true,
264
+ indentUnit: 4,
265
+ mode: "text/x-d"
266
+ });
267
+ </script>
268
+
269
+ <p>Simple mode that handle D-Syntax (<a href="http://www.dlang.org">DLang Homepage</a>).</p>
270
+
271
+ <p><strong>MIME types defined:</strong> <code>text/x-d</code>
272
+ .</p>
273
+ </article>
assets/js/vendor/codemirror/mode/dart/dart.js ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../clike/clike"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../clike/clike"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ var keywords = ("this super static final const abstract class extends external factory " +
15
+ "implements get native operator set typedef with enum throw rethrow " +
16
+ "assert break case continue default in return new deferred async await " +
17
+ "try catch finally do else for if switch while import library export " +
18
+ "part of show hide is as").split(" ");
19
+ var blockKeywords = "try catch finally do else for if switch while".split(" ");
20
+ var atoms = "true false null".split(" ");
21
+ var builtins = "void bool num int double dynamic var String".split(" ");
22
+
23
+ function set(words) {
24
+ var obj = {};
25
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
26
+ return obj;
27
+ }
28
+
29
+ function pushInterpolationStack(state) {
30
+ (state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize);
31
+ }
32
+
33
+ function popInterpolationStack(state) {
34
+ return (state.interpolationStack || (state.interpolationStack = [])).pop();
35
+ }
36
+
37
+ function sizeInterpolationStack(state) {
38
+ return state.interpolationStack ? state.interpolationStack.length : 0;
39
+ }
40
+
41
+ CodeMirror.defineMIME("application/dart", {
42
+ name: "clike",
43
+ keywords: set(keywords),
44
+ blockKeywords: set(blockKeywords),
45
+ builtin: set(builtins),
46
+ atoms: set(atoms),
47
+ hooks: {
48
+ "@": function(stream) {
49
+ stream.eatWhile(/[\w\$_\.]/);
50
+ return "meta";
51
+ },
52
+
53
+ // custom string handling to deal with triple-quoted strings and string interpolation
54
+ "'": function(stream, state) {
55
+ return tokenString("'", stream, state, false);
56
+ },
57
+ "\"": function(stream, state) {
58
+ return tokenString("\"", stream, state, false);
59
+ },
60
+ "r": function(stream, state) {
61
+ var peek = stream.peek();
62
+ if (peek == "'" || peek == "\"") {
63
+ return tokenString(stream.next(), stream, state, true);
64
+ }
65
+ return false;
66
+ },
67
+
68
+ "}": function(_stream, state) {
69
+ // "}" is end of interpolation, if interpolation stack is non-empty
70
+ if (sizeInterpolationStack(state) > 0) {
71
+ state.tokenize = popInterpolationStack(state);
72
+ return null;
73
+ }
74
+ return false;
75
+ }
76
+ }
77
+ });
78
+
79
+ function tokenString(quote, stream, state, raw) {
80
+ var tripleQuoted = false;
81
+ if (stream.eat(quote)) {
82
+ if (stream.eat(quote)) tripleQuoted = true;
83
+ else return "string"; //empty string
84
+ }
85
+ function tokenStringHelper(stream, state) {
86
+ var escaped = false;
87
+ while (!stream.eol()) {
88
+ if (!raw && !escaped && stream.peek() == "$") {
89
+ pushInterpolationStack(state);
90
+ state.tokenize = tokenInterpolation;
91
+ return "string";
92
+ }
93
+ var next = stream.next();
94
+ if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) {
95
+ state.tokenize = null;
96
+ break;
97
+ }
98
+ escaped = !raw && !escaped && next == "\\";
99
+ }
100
+ return "string";
101
+ }
102
+ state.tokenize = tokenStringHelper;
103
+ return tokenStringHelper(stream, state);
104
+ }
105
+
106
+ function tokenInterpolation(stream, state) {
107
+ stream.eat("$");
108
+ if (stream.eat("{")) {
109
+ // let clike handle the content of ${...},
110
+ // we take over again when "}" appears (see hooks).
111
+ state.tokenize = null;
112
+ } else {
113
+ state.tokenize = tokenInterpolationIdentifier;
114
+ }
115
+ return null;
116
+ }
117
+
118
+ function tokenInterpolationIdentifier(stream, state) {
119
+ stream.eatWhile(/[\w_]/);
120
+ state.tokenize = popInterpolationStack(state);
121
+ return "variable";
122
+ }
123
+
124
+ CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));
125
+
126
+ // This is needed to make loading through meta.js work.
127
+ CodeMirror.defineMode("dart", function(conf) {
128
+ return CodeMirror.getMode(conf, "application/dart");
129
+ }, "clike");
130
+ });
assets/js/vendor/codemirror/mode/dart/index.html ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Dart mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+ <link rel="stylesheet" href="../../lib/codemirror.css">
7
+ <script src="../../lib/codemirror.js"></script>
8
+ <script src="../clike/clike.js"></script>
9
+ <script src="dart.js"></script>
10
+ <style>.CodeMirror {border: 1px solid #dee;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Dart</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Dart mode</h2>
27
+ <form>
28
+ <textarea id="code" name="code">
29
+ import 'dart:math' show Random;
30
+
31
+ void main() {
32
+ print(new Die(n: 12).roll());
33
+ }
34
+
35
+ // Define a class.
36
+ class Die {
37
+ // Define a class variable.
38
+ static Random shaker = new Random();
39
+
40
+ // Define instance variables.
41
+ int sides, value;
42
+
43
+ // Define a method using shorthand syntax.
44
+ String toString() => '$value';
45
+
46
+ // Define a constructor.
47
+ Die({int n: 6}) {
48
+ if (4 <= n && n <= 20) {
49
+ sides = n;
50
+ } else {
51
+ // Support for errors and exceptions.
52
+ throw new ArgumentError(/* */);
53
+ }
54
+ }
55
+
56
+ // Define an instance method.
57
+ int roll() {
58
+ return value = shaker.nextInt(sides) + 1;
59
+ }
60
+ }
61
+ </textarea>
62
+ </form>
63
+
64
+ <script>
65
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
66
+ lineNumbers: true,
67
+ mode: "application/dart"
68
+ });
69
+ </script>
70
+
71
+ </article>
assets/js/vendor/codemirror/mode/diff/diff.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("diff", function() {
15
+
16
+ var TOKEN_NAMES = {
17
+ '+': 'positive',
18
+ '-': 'negative',
19
+ '@': 'meta'
20
+ };
21
+
22
+ return {
23
+ token: function(stream) {
24
+ var tw_pos = stream.string.search(/[\t ]+?$/);
25
+
26
+ if (!stream.sol() || tw_pos === 0) {
27
+ stream.skipToEnd();
28
+ return ("error " + (
29
+ TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
30
+ }
31
+
32
+ var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();
33
+
34
+ if (tw_pos === -1) {
35
+ stream.skipToEnd();
36
+ } else {
37
+ stream.pos = tw_pos;
38
+ }
39
+
40
+ return token_name;
41
+ }
42
+ };
43
+ });
44
+
45
+ CodeMirror.defineMIME("text/x-diff", "diff");
46
+
47
+ });
assets/js/vendor/codemirror/mode/diff/index.html ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Diff mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="diff.js"></script>
10
+ <style>
11
+ .CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}
12
+ span.cm-meta {color: #a0b !important;}
13
+ span.cm-error { background-color: black; opacity: 0.4;}
14
+ span.cm-error.cm-string { background-color: red; }
15
+ span.cm-error.cm-tag { background-color: #2b2; }
16
+ </style>
17
+ <div id=nav>
18
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
19
+
20
+ <ul>
21
+ <li><a href="../../index.html">Home</a>
22
+ <li><a href="../../doc/manual.html">Manual</a>
23
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
24
+ </ul>
25
+ <ul>
26
+ <li><a href="../index.html">Language modes</a>
27
+ <li><a class=active href="#">Diff</a>
28
+ </ul>
29
+ </div>
30
+
31
+ <article>
32
+ <h2>Diff mode</h2>
33
+ <form><textarea id="code" name="code">
34
+ diff --git a/index.html b/index.html
35
+ index c1d9156..7764744 100644
36
+ --- a/index.html
37
+ +++ b/index.html
38
+ @@ -95,7 +95,8 @@ StringStream.prototype = {
39
+ <script>
40
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
41
+ lineNumbers: true,
42
+ - autoMatchBrackets: true
43
+ + autoMatchBrackets: true,
44
+ + onGutterClick: function(x){console.log(x);}
45
+ });
46
+ </script>
47
+ </body>
48
+ diff --git a/lib/codemirror.js b/lib/codemirror.js
49
+ index 04646a9..9a39cc7 100644
50
+ --- a/lib/codemirror.js
51
+ +++ b/lib/codemirror.js
52
+ @@ -399,10 +399,16 @@ var CodeMirror = (function() {
53
+ }
54
+
55
+ function onMouseDown(e) {
56
+ - var start = posFromMouse(e), last = start;
57
+ + var start = posFromMouse(e), last = start, target = e.target();
58
+ if (!start) return;
59
+ setCursor(start.line, start.ch, false);
60
+ if (e.button() != 1) return;
61
+ + if (target.parentNode == gutter) {
62
+ + if (options.onGutterClick)
63
+ + options.onGutterClick(indexOf(gutter.childNodes, target) + showingFrom);
64
+ + return;
65
+ + }
66
+ +
67
+ if (!focused) onFocus();
68
+
69
+ e.stop();
70
+ @@ -808,7 +814,7 @@ var CodeMirror = (function() {
71
+ for (var i = showingFrom; i < showingTo; ++i) {
72
+ var marker = lines[i].gutterMarker;
73
+ if (marker) html.push('<div class="' + marker.style + '">' + htmlEscape(marker.text) + '</div>');
74
+ - else html.push("<div>" + (options.lineNumbers ? i + 1 : "\u00a0") + "</div>");
75
+ + else html.push("<div>" + (options.lineNumbers ? i + options.firstLineNumber : "\u00a0") + "</div>");
76
+ }
77
+ gutter.style.display = "none"; // TODO test whether this actually helps
78
+ gutter.innerHTML = html.join("");
79
+ @@ -1371,10 +1377,8 @@ var CodeMirror = (function() {
80
+ if (option == "parser") setParser(value);
81
+ else if (option === "lineNumbers") setLineNumbers(value);
82
+ else if (option === "gutter") setGutter(value);
83
+ - else if (option === "readOnly") options.readOnly = value;
84
+ - else if (option === "indentUnit") {options.indentUnit = indentUnit = value; setParser(options.parser);}
85
+ - else if (/^(?:enterMode|tabMode|indentWithTabs|readOnly|autoMatchBrackets|undoDepth)$/.test(option)) options[option] = value;
86
+ - else throw new Error("Can't set option " + option);
87
+ + else if (option === "indentUnit") {options.indentUnit = value; setParser(options.parser);}
88
+ + else options[option] = value;
89
+ },
90
+ cursorCoords: cursorCoords,
91
+ undo: operation(undo),
92
+ @@ -1402,7 +1406,8 @@ var CodeMirror = (function() {
93
+ replaceRange: operation(replaceRange),
94
+
95
+ operation: function(f){return operation(f)();},
96
+ - refresh: function(){updateDisplay([{from: 0, to: lines.length}]);}
97
+ + refresh: function(){updateDisplay([{from: 0, to: lines.length}]);},
98
+ + getInputField: function(){return input;}
99
+ };
100
+ return instance;
101
+ }
102
+ @@ -1420,6 +1425,7 @@ var CodeMirror = (function() {
103
+ readOnly: false,
104
+ onChange: null,
105
+ onCursorActivity: null,
106
+ + onGutterClick: null,
107
+ autoMatchBrackets: false,
108
+ workTime: 200,
109
+ workDelay: 300,
110
+ </textarea></form>
111
+ <script>
112
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
113
+ </script>
114
+
115
+ <p><strong>MIME types defined:</strong> <code>text/x-diff</code>.</p>
116
+
117
+ </article>
assets/js/vendor/codemirror/mode/django/django.js ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"),
7
+ require("../../addon/mode/overlay"));
8
+ else if (typeof define == "function" && define.amd) // AMD
9
+ define(["../../lib/codemirror", "../htmlmixed/htmlmixed",
10
+ "../../addon/mode/overlay"], mod);
11
+ else // Plain browser env
12
+ mod(CodeMirror);
13
+ })(function(CodeMirror) {
14
+ "use strict";
15
+
16
+ CodeMirror.defineMode("django:inner", function() {
17
+ var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter",
18
+ "loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import",
19
+ "with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal",
20
+ "endifnotequal", "extends", "include", "load", "comment", "endcomment",
21
+ "empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now",
22
+ "regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle",
23
+ "csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless",
24
+ "ssi", "templatetag", "verbatim", "endverbatim", "widthratio"],
25
+ filters = ["add", "addslashes", "capfirst", "center", "cut", "date",
26
+ "default", "default_if_none", "dictsort",
27
+ "dictsortreversed", "divisibleby", "escape", "escapejs",
28
+ "filesizeformat", "first", "floatformat", "force_escape",
29
+ "get_digit", "iriencode", "join", "last", "length",
30
+ "length_is", "linebreaks", "linebreaksbr", "linenumbers",
31
+ "ljust", "lower", "make_list", "phone2numeric", "pluralize",
32
+ "pprint", "random", "removetags", "rjust", "safe",
33
+ "safeseq", "slice", "slugify", "stringformat", "striptags",
34
+ "time", "timesince", "timeuntil", "title", "truncatechars",
35
+ "truncatechars_html", "truncatewords", "truncatewords_html",
36
+ "unordered_list", "upper", "urlencode", "urlize",
37
+ "urlizetrunc", "wordcount", "wordwrap", "yesno"],
38
+ operators = ["==", "!=", "<", ">", "<=", ">=", "in", "not", "or", "and"];
39
+
40
+ keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b");
41
+ filters = new RegExp("^\\b(" + filters.join("|") + ")\\b");
42
+ operators = new RegExp("^\\b(" + operators.join("|") + ")\\b");
43
+
44
+ // We have to return "null" instead of null, in order to avoid string
45
+ // styling as the default, when using Django templates inside HTML
46
+ // element attributes
47
+ function tokenBase (stream, state) {
48
+ // Attempt to identify a variable, template or comment tag respectively
49
+ if (stream.match("{{")) {
50
+ state.tokenize = inVariable;
51
+ return "tag";
52
+ } else if (stream.match("{%")) {
53
+ state.tokenize = inTag;
54
+ return "tag";
55
+ } else if (stream.match("{#")) {
56
+ state.tokenize = inComment;
57
+ return "comment";
58
+ }
59
+
60
+ // Ignore completely any stream series that do not match the
61
+ // Django template opening tags.
62
+ while (stream.next() != null && !stream.match("{{", false) && !stream.match("{%", false)) {}
63
+ return null;
64
+ }
65
+
66
+ // A string can be included in either single or double quotes (this is
67
+ // the delimeter). Mark everything as a string until the start delimeter
68
+ // occurs again.
69
+ function inString (delimeter, previousTokenizer) {
70
+ return function (stream, state) {
71
+ if (!state.escapeNext && stream.eat(delimeter)) {
72
+ state.tokenize = previousTokenizer;
73
+ } else {
74
+ if (state.escapeNext) {
75
+ state.escapeNext = false;
76
+ }
77
+
78
+ var ch = stream.next();
79
+
80
+ // Take into account the backslash for escaping characters, such as
81
+ // the string delimeter.
82
+ if (ch == "\\") {
83
+ state.escapeNext = true;
84
+ }
85
+ }
86
+
87
+ return "string";
88
+ };
89
+ }
90
+
91
+ // Apply Django template variable syntax highlighting
92
+ function inVariable (stream, state) {
93
+ // Attempt to match a dot that precedes a property
94
+ if (state.waitDot) {
95
+ state.waitDot = false;
96
+
97
+ if (stream.peek() != ".") {
98
+ return "null";
99
+ }
100
+
101
+ // Dot folowed by a non-word character should be considered an error.
102
+ if (stream.match(/\.\W+/)) {
103
+ return "error";
104
+ } else if (stream.eat(".")) {
105
+ state.waitProperty = true;
106
+ return "null";
107
+ } else {
108
+ throw Error ("Unexpected error while waiting for property.");
109
+ }
110
+ }
111
+
112
+ // Attempt to match a pipe that precedes a filter
113
+ if (state.waitPipe) {
114
+ state.waitPipe = false;
115
+
116
+ if (stream.peek() != "|") {
117
+ return "null";
118
+ }
119
+
120
+ // Pipe folowed by a non-word character should be considered an error.
121
+ if (stream.match(/\.\W+/)) {
122
+ return "error";
123
+ } else if (stream.eat("|")) {
124
+ state.waitFilter = true;
125
+ return "null";
126
+ } else {
127
+ throw Error ("Unexpected error while waiting for filter.");
128
+ }
129
+ }
130
+
131
+ // Highlight properties
132
+ if (state.waitProperty) {
133
+ state.waitProperty = false;
134
+ if (stream.match(/\b(\w+)\b/)) {
135
+ state.waitDot = true; // A property can be followed by another property
136
+ state.waitPipe = true; // A property can be followed by a filter
137
+ return "property";
138
+ }
139
+ }
140
+
141
+ // Highlight filters
142
+ if (state.waitFilter) {
143
+ state.waitFilter = false;
144
+ if (stream.match(filters)) {
145
+ return "variable-2";
146
+ }
147
+ }
148
+
149
+ // Ignore all white spaces
150
+ if (stream.eatSpace()) {
151
+ state.waitProperty = false;
152
+ return "null";
153
+ }
154
+
155
+ // Identify numbers
156
+ if (stream.match(/\b\d+(\.\d+)?\b/)) {
157
+ return "number";
158
+ }
159
+
160
+ // Identify strings
161
+ if (stream.match("'")) {
162
+ state.tokenize = inString("'", state.tokenize);
163
+ return "string";
164
+ } else if (stream.match('"')) {
165
+ state.tokenize = inString('"', state.tokenize);
166
+ return "string";
167
+ }
168
+
169
+ // Attempt to find the variable
170
+ if (stream.match(/\b(\w+)\b/) && !state.foundVariable) {
171
+ state.waitDot = true;
172
+ state.waitPipe = true; // A property can be followed by a filter
173
+ return "variable";
174
+ }
175
+
176
+ // If found closing tag reset
177
+ if (stream.match("}}")) {
178
+ state.waitProperty = null;
179
+ state.waitFilter = null;
180
+ state.waitDot = null;
181
+ state.waitPipe = null;
182
+ state.tokenize = tokenBase;
183
+ return "tag";
184
+ }
185
+
186
+ // If nothing was found, advance to the next character
187
+ stream.next();
188
+ return "null";
189
+ }
190
+
191
+ function inTag (stream, state) {
192
+ // Attempt to match a dot that precedes a property
193
+ if (state.waitDot) {
194
+ state.waitDot = false;
195
+
196
+ if (stream.peek() != ".") {
197
+ return "null";
198
+ }
199
+
200
+ // Dot folowed by a non-word character should be considered an error.
201
+ if (stream.match(/\.\W+/)) {
202
+ return "error";
203
+ } else if (stream.eat(".")) {
204
+ state.waitProperty = true;
205
+ return "null";
206
+ } else {
207
+ throw Error ("Unexpected error while waiting for property.");
208
+ }
209
+ }
210
+
211
+ // Attempt to match a pipe that precedes a filter
212
+ if (state.waitPipe) {
213
+ state.waitPipe = false;
214
+
215
+ if (stream.peek() != "|") {
216
+ return "null";
217
+ }
218
+
219
+ // Pipe folowed by a non-word character should be considered an error.
220
+ if (stream.match(/\.\W+/)) {
221
+ return "error";
222
+ } else if (stream.eat("|")) {
223
+ state.waitFilter = true;
224
+ return "null";
225
+ } else {
226
+ throw Error ("Unexpected error while waiting for filter.");
227
+ }
228
+ }
229
+
230
+ // Highlight properties
231
+ if (state.waitProperty) {
232
+ state.waitProperty = false;
233
+ if (stream.match(/\b(\w+)\b/)) {
234
+ state.waitDot = true; // A property can be followed by another property
235
+ state.waitPipe = true; // A property can be followed by a filter
236
+ return "property";
237
+ }
238
+ }
239
+
240
+ // Highlight filters
241
+ if (state.waitFilter) {
242
+ state.waitFilter = false;
243
+ if (stream.match(filters)) {
244
+ return "variable-2";
245
+ }
246
+ }
247
+
248
+ // Ignore all white spaces
249
+ if (stream.eatSpace()) {
250
+ state.waitProperty = false;
251
+ return "null";
252
+ }
253
+
254
+ // Identify numbers
255
+ if (stream.match(/\b\d+(\.\d+)?\b/)) {
256
+ return "number";
257
+ }
258
+
259
+ // Identify strings
260
+ if (stream.match("'")) {
261
+ state.tokenize = inString("'", state.tokenize);
262
+ return "string";
263
+ } else if (stream.match('"')) {
264
+ state.tokenize = inString('"', state.tokenize);
265
+ return "string";
266
+ }
267
+
268
+ // Attempt to match an operator
269
+ if (stream.match(operators)) {
270
+ return "operator";
271
+ }
272
+
273
+ // Attempt to match a keyword
274
+ var keywordMatch = stream.match(keywords);
275
+ if (keywordMatch) {
276
+ if (keywordMatch[0] == "comment") {
277
+ state.blockCommentTag = true;
278
+ }
279
+ return "keyword";
280
+ }
281
+
282
+ // Attempt to match a variable
283
+ if (stream.match(/\b(\w+)\b/)) {
284
+ state.waitDot = true;
285
+ state.waitPipe = true; // A property can be followed by a filter
286
+ return "variable";
287
+ }
288
+
289
+ // If found closing tag reset
290
+ if (stream.match("%}")) {
291
+ state.waitProperty = null;
292
+ state.waitFilter = null;
293
+ state.waitDot = null;
294
+ state.waitPipe = null;
295
+ // If the tag that closes is a block comment tag, we want to mark the
296
+ // following code as comment, until the tag closes.
297
+ if (state.blockCommentTag) {
298
+ state.blockCommentTag = false; // Release the "lock"
299
+ state.tokenize = inBlockComment;
300
+ } else {
301
+ state.tokenize = tokenBase;
302
+ }
303
+ return "tag";
304
+ }
305
+
306
+ // If nothing was found, advance to the next character
307
+ stream.next();
308
+ return "null";
309
+ }
310
+
311
+ // Mark everything as comment inside the tag and the tag itself.
312
+ function inComment (stream, state) {
313
+ if (stream.match("#}")) {
314
+ state.tokenize = tokenBase;
315
+ }
316
+ return "comment";
317
+ }
318
+
319
+ // Mark everything as a comment until the `blockcomment` tag closes.
320
+ function inBlockComment (stream, state) {
321
+ if (stream.match(/\{%\s*endcomment\s*%\}/, false)) {
322
+ state.tokenize = inTag;
323
+ stream.match("{%");
324
+ return "tag";
325
+ } else {
326
+ stream.next();
327
+ return "comment";
328
+ }
329
+ }
330
+
331
+ return {
332
+ startState: function () {
333
+ return {tokenize: tokenBase};
334
+ },
335
+ token: function (stream, state) {
336
+ return state.tokenize(stream, state);
337
+ },
338
+ blockCommentStart: "{% comment %}",
339
+ blockCommentEnd: "{% endcomment %}"
340
+ };
341
+ });
342
+
343
+ CodeMirror.defineMode("django", function(config) {
344
+ var htmlBase = CodeMirror.getMode(config, "text/html");
345
+ var djangoInner = CodeMirror.getMode(config, "django:inner");
346
+ return CodeMirror.overlayMode(htmlBase, djangoInner);
347
+ });
348
+
349
+ CodeMirror.defineMIME("text/x-django", "django");
350
+ });
assets/js/vendor/codemirror/mode/django/index.html ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Django template mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/mdn-like.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="../../addon/mode/overlay.js"></script>
11
+ <script src="../xml/xml.js"></script>
12
+ <script src="../htmlmixed/htmlmixed.js"></script>
13
+ <script src="django.js"></script>
14
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
15
+ <div id=nav>
16
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
17
+
18
+ <ul>
19
+ <li><a href="../../index.html">Home</a>
20
+ <li><a href="../../doc/manual.html">Manual</a>
21
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
22
+ </ul>
23
+ <ul>
24
+ <li><a href="../index.html">Language modes</a>
25
+ <li><a class=active href="#">Django</a>
26
+ </ul>
27
+ </div>
28
+
29
+ <article>
30
+ <h2>Django template mode</h2>
31
+ <form><textarea id="code" name="code">
32
+ <!doctype html>
33
+ <html>
34
+ <head>
35
+ <title>My Django web application</title>
36
+ </head>
37
+ <body>
38
+ <h1>
39
+ {{ page.title|capfirst }}
40
+ </h1>
41
+ <ul class="my-list">
42
+ {# traverse a list of items and produce links to their views. #}
43
+ {% for item in items %}
44
+ <li>
45
+ <a href="{% url 'item_view' item.name|slugify %}">
46
+ {{ item.name }}
47
+ </a>
48
+ </li>
49
+ {% empty %}
50
+ <li>You have no items in your list.</li>
51
+ {% endfor %}
52
+ </ul>
53
+ {% comment "this is a forgotten footer" %}
54
+ <footer></footer>
55
+ {% endcomment %}
56
+ </body>
57
+ </html>
58
+ </textarea></form>
59
+
60
+ <script>
61
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
62
+ lineNumbers: true,
63
+ mode: "django",
64
+ indentUnit: 2,
65
+ indentWithTabs: true,
66
+ theme: "mdn-like"
67
+ });
68
+ </script>
69
+
70
+ <p>Mode for HTML with embedded Django template markup.</p>
71
+
72
+ <p><strong>MIME types defined:</strong> <code>text/x-django</code></p>
73
+ </article>
assets/js/vendor/codemirror/mode/dockerfile/dockerfile.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ // Collect all Dockerfile directives
15
+ var instructions = ["from", "maintainer", "run", "cmd", "expose", "env",
16
+ "add", "copy", "entrypoint", "volume", "user",
17
+ "workdir", "onbuild"],
18
+ instructionRegex = "(" + instructions.join('|') + ")",
19
+ instructionOnlyLine = new RegExp(instructionRegex + "\\s*$", "i"),
20
+ instructionWithArguments = new RegExp(instructionRegex + "(\\s+)", "i");
21
+
22
+ CodeMirror.defineSimpleMode("dockerfile", {
23
+ start: [
24
+ // Block comment: This is a line starting with a comment
25
+ {
26
+ regex: /#.*$/,
27
+ token: "comment"
28
+ },
29
+ // Highlight an instruction without any arguments (for convenience)
30
+ {
31
+ regex: instructionOnlyLine,
32
+ token: "variable-2"
33
+ },
34
+ // Highlight an instruction followed by arguments
35
+ {
36
+ regex: instructionWithArguments,
37
+ token: ["variable-2", null],
38
+ next: "arguments"
39
+ },
40
+ {
41
+ regex: /./,
42
+ token: null
43
+ }
44
+ ],
45
+ arguments: [
46
+ {
47
+ // Line comment without instruction arguments is an error
48
+ regex: /#.*$/,
49
+ token: "error",
50
+ next: "start"
51
+ },
52
+ {
53
+ regex: /[^#]+\\$/,
54
+ token: null
55
+ },
56
+ {
57
+ // Match everything except for the inline comment
58
+ regex: /[^#]+/,
59
+ token: null,
60
+ next: "start"
61
+ },
62
+ {
63
+ regex: /$/,
64
+ token: null,
65
+ next: "start"
66
+ },
67
+ // Fail safe return to start
68
+ {
69
+ token: null,
70
+ next: "start"
71
+ }
72
+ ],
73
+ meta: {
74
+ lineComment: "#"
75
+ }
76
+ });
77
+
78
+ CodeMirror.defineMIME("text/x-dockerfile", "dockerfile");
79
+ });
assets/js/vendor/codemirror/mode/dockerfile/index.html ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Dockerfile mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/mode/simple.js"></script>
10
+ <script src="dockerfile.js"></script>
11
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
12
+ <div id=nav>
13
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
14
+
15
+ <ul>
16
+ <li><a href="../../index.html">Home</a>
17
+ <li><a href="../../doc/manual.html">Manual</a>
18
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
19
+ </ul>
20
+ <ul>
21
+ <li><a href="../index.html">Language modes</a>
22
+ <li><a class=active href="#">Dockerfile</a>
23
+ </ul>
24
+ </div>
25
+
26
+ <article>
27
+ <h2>Dockerfile mode</h2>
28
+ <form><textarea id="code" name="code"># Install Ghost blogging platform and run development environment
29
+ #
30
+ # VERSION 1.0.0
31
+
32
+ FROM ubuntu:12.10
33
+ MAINTAINER Amer Grgic "amer@livebyt.es"
34
+ WORKDIR /data/ghost
35
+
36
+ # Install dependencies for nginx installation
37
+ RUN apt-get update
38
+ RUN apt-get install -y python g++ make software-properties-common --force-yes
39
+ RUN add-apt-repository ppa:chris-lea/node.js
40
+ RUN apt-get update
41
+ # Install unzip
42
+ RUN apt-get install -y unzip
43
+ # Install curl
44
+ RUN apt-get install -y curl
45
+ # Install nodejs & npm
46
+ RUN apt-get install -y rlwrap
47
+ RUN apt-get install -y nodejs
48
+ # Download Ghost v0.4.1
49
+ RUN curl -L https://ghost.org/zip/ghost-latest.zip -o /tmp/ghost.zip
50
+ # Unzip Ghost zip to /data/ghost
51
+ RUN unzip -uo /tmp/ghost.zip -d /data/ghost
52
+ # Add custom config js to /data/ghost
53
+ ADD ./config.example.js /data/ghost/config.js
54
+ # Install Ghost with NPM
55
+ RUN cd /data/ghost/ && npm install --production
56
+ # Expose port 2368
57
+ EXPOSE 2368
58
+ # Run Ghost
59
+ CMD ["npm","start"]
60
+ </textarea></form>
61
+
62
+ <script>
63
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
64
+ lineNumbers: true,
65
+ mode: "dockerfile"
66
+ });
67
+ </script>
68
+
69
+ <p>Dockerfile syntax highlighting for CodeMirror. Depends on
70
+ the <a href="../../demo/simplemode.html">simplemode</a> addon.</p>
71
+
72
+ <p><strong>MIME types defined:</strong> <code>text/x-dockerfile</code></p>
73
+ </article>
assets/js/vendor/codemirror/mode/dtd/dtd.js ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /*
5
+ DTD mode
6
+ Ported to CodeMirror by Peter Kroon <plakroon@gmail.com>
7
+ Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues
8
+ GitHub: @peterkroon
9
+ */
10
+
11
+ (function(mod) {
12
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
13
+ mod(require("../../lib/codemirror"));
14
+ else if (typeof define == "function" && define.amd) // AMD
15
+ define(["../../lib/codemirror"], mod);
16
+ else // Plain browser env
17
+ mod(CodeMirror);
18
+ })(function(CodeMirror) {
19
+ "use strict";
20
+
21
+ CodeMirror.defineMode("dtd", function(config) {
22
+ var indentUnit = config.indentUnit, type;
23
+ function ret(style, tp) {type = tp; return style;}
24
+
25
+ function tokenBase(stream, state) {
26
+ var ch = stream.next();
27
+
28
+ if (ch == "<" && stream.eat("!") ) {
29
+ if (stream.eatWhile(/[\-]/)) {
30
+ state.tokenize = tokenSGMLComment;
31
+ return tokenSGMLComment(stream, state);
32
+ } else if (stream.eatWhile(/[\w]/)) return ret("keyword", "doindent");
33
+ } else if (ch == "<" && stream.eat("?")) { //xml declaration
34
+ state.tokenize = inBlock("meta", "?>");
35
+ return ret("meta", ch);
36
+ } else if (ch == "#" && stream.eatWhile(/[\w]/)) return ret("atom", "tag");
37
+ else if (ch == "|") return ret("keyword", "seperator");
38
+ else if (ch.match(/[\(\)\[\]\-\.,\+\?>]/)) return ret(null, ch);//if(ch === ">") return ret(null, "endtag"); else
39
+ else if (ch.match(/[\[\]]/)) return ret("rule", ch);
40
+ else if (ch == "\"" || ch == "'") {
41
+ state.tokenize = tokenString(ch);
42
+ return state.tokenize(stream, state);
43
+ } else if (stream.eatWhile(/[a-zA-Z\?\+\d]/)) {
44
+ var sc = stream.current();
45
+ if( sc.substr(sc.length-1,sc.length).match(/\?|\+/) !== null )stream.backUp(1);
46
+ return ret("tag", "tag");
47
+ } else if (ch == "%" || ch == "*" ) return ret("number", "number");
48
+ else {
49
+ stream.eatWhile(/[\w\\\-_%.{,]/);
50
+ return ret(null, null);
51
+ }
52
+ }
53
+
54
+ function tokenSGMLComment(stream, state) {
55
+ var dashes = 0, ch;
56
+ while ((ch = stream.next()) != null) {
57
+ if (dashes >= 2 && ch == ">") {
58
+ state.tokenize = tokenBase;
59
+ break;
60
+ }
61
+ dashes = (ch == "-") ? dashes + 1 : 0;
62
+ }
63
+ return ret("comment", "comment");
64
+ }
65
+
66
+ function tokenString(quote) {
67
+ return function(stream, state) {
68
+ var escaped = false, ch;
69
+ while ((ch = stream.next()) != null) {
70
+ if (ch == quote && !escaped) {
71
+ state.tokenize = tokenBase;
72
+ break;
73
+ }
74
+ escaped = !escaped && ch == "\\";
75
+ }
76
+ return ret("string", "tag");
77
+ };
78
+ }
79
+
80
+ function inBlock(style, terminator) {
81
+ return function(stream, state) {
82
+ while (!stream.eol()) {
83
+ if (stream.match(terminator)) {
84
+ state.tokenize = tokenBase;
85
+ break;
86
+ }
87
+ stream.next();
88
+ }
89
+ return style;
90
+ };
91
+ }
92
+
93
+ return {
94
+ startState: function(base) {
95
+ return {tokenize: tokenBase,
96
+ baseIndent: base || 0,
97
+ stack: []};
98
+ },
99
+
100
+ token: function(stream, state) {
101
+ if (stream.eatSpace()) return null;
102
+ var style = state.tokenize(stream, state);
103
+
104
+ var context = state.stack[state.stack.length-1];
105
+ if (stream.current() == "[" || type === "doindent" || type == "[") state.stack.push("rule");
106
+ else if (type === "endtag") state.stack[state.stack.length-1] = "endtag";
107
+ else if (stream.current() == "]" || type == "]" || (type == ">" && context == "rule")) state.stack.pop();
108
+ else if (type == "[") state.stack.push("[");
109
+ return style;
110
+ },
111
+
112
+ indent: function(state, textAfter) {
113
+ var n = state.stack.length;
114
+
115
+ if( textAfter.match(/\]\s+|\]/) )n=n-1;
116
+ else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){
117
+ if(textAfter.substr(0,1) === "<")n;
118
+ else if( type == "doindent" && textAfter.length > 1 )n;
119
+ else if( type == "doindent")n--;
120
+ else if( type == ">" && textAfter.length > 1)n;
121
+ else if( type == "tag" && textAfter !== ">")n;
122
+ else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--;
123
+ else if( type == "tag")n++;
124
+ else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--;
125
+ else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule")n;
126
+ else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1;
127
+ else if( textAfter === ">")n;
128
+ else n=n-1;
129
+ //over rule them all
130
+ if(type == null || type == "]")n--;
131
+ }
132
+
133
+ return state.baseIndent + n * indentUnit;
134
+ },
135
+
136
+ electricChars: "]>"
137
+ };
138
+ });
139
+
140
+ CodeMirror.defineMIME("application/xml-dtd", "dtd");
141
+
142
+ });
assets/js/vendor/codemirror/mode/dtd/index.html ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: DTD mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="dtd.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">DTD</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>DTD mode</h2>
27
+ <form><textarea id="code" name="code"><?xml version="1.0" encoding="UTF-8"?>
28
+
29
+ <!ATTLIST title
30
+ xmlns CDATA #FIXED "http://docbook.org/ns/docbook"
31
+ role CDATA #IMPLIED
32
+ %db.common.attributes;
33
+ %db.common.linking.attributes;
34
+ >
35
+
36
+ <!--
37
+ Try: http://docbook.org/xml/5.0/dtd/docbook.dtd
38
+ -->
39
+
40
+ <!DOCTYPE xsl:stylesheet
41
+ [
42
+ <!ENTITY nbsp "&amp;#160;">
43
+ <!ENTITY copy "&amp;#169;">
44
+ <!ENTITY reg "&amp;#174;">
45
+ <!ENTITY trade "&amp;#8482;">
46
+ <!ENTITY mdash "&amp;#8212;">
47
+ <!ENTITY ldquo "&amp;#8220;">
48
+ <!ENTITY rdquo "&amp;#8221;">
49
+ <!ENTITY pound "&amp;#163;">
50
+ <!ENTITY yen "&amp;#165;">
51
+ <!ENTITY euro "&amp;#8364;">
52
+ <!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
53
+ ]
54
+ >
55
+
56
+ <!ELEMENT title (#PCDATA|inlinemediaobject|remark|superscript|subscript|xref|link|olink|anchor|biblioref|alt|annotation|indexterm|abbrev|acronym|date|emphasis|footnote|footnoteref|foreignphrase|phrase|quote|wordasword|firstterm|glossterm|coref|trademark|productnumber|productname|database|application|hardware|citation|citerefentry|citetitle|citebiblioid|author|person|personname|org|orgname|editor|jobtitle|replaceable|package|parameter|termdef|nonterminal|systemitem|option|optional|property|inlineequation|tag|markup|token|symbol|literal|code|constant|email|uri|guiicon|guibutton|guimenuitem|guimenu|guisubmenu|guilabel|menuchoice|mousebutton|keycombo|keycap|keycode|keysym|shortcut|accel|prompt|envar|filename|command|computeroutput|userinput|function|varname|returnvalue|type|classname|exceptionname|interfacename|methodname|modifier|initializer|ooclass|ooexception|oointerface|errorcode|errortext|errorname|errortype)*>
57
+
58
+ <!ENTITY % db.common.attributes "
59
+ xml:id ID #IMPLIED
60
+ version CDATA #IMPLIED
61
+ xml:lang CDATA #IMPLIED
62
+ xml:base CDATA #IMPLIED
63
+ remap CDATA #IMPLIED
64
+ xreflabel CDATA #IMPLIED
65
+ revisionflag (changed|added|deleted|off) #IMPLIED
66
+ dir (ltr|rtl|lro|rlo) #IMPLIED
67
+ arch CDATA #IMPLIED
68
+ audience CDATA #IMPLIED
69
+ condition CDATA #IMPLIED
70
+ conformance CDATA #IMPLIED
71
+ os CDATA #IMPLIED
72
+ revision CDATA #IMPLIED
73
+ security CDATA #IMPLIED
74
+ userlevel CDATA #IMPLIED
75
+ vendor CDATA #IMPLIED
76
+ wordsize CDATA #IMPLIED
77
+ annotations CDATA #IMPLIED
78
+
79
+ "></textarea></form>
80
+ <script>
81
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
82
+ mode: {name: "dtd", alignCDATA: true},
83
+ lineNumbers: true,
84
+ lineWrapping: true
85
+ });
86
+ </script>
87
+
88
+ <p><strong>MIME types defined:</strong> <code>application/xml-dtd</code>.</p>
89
+ </article>
assets/js/vendor/codemirror/mode/dylan/dylan.js ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("dylan", function(_config) {
15
+ // Words
16
+ var words = {
17
+ // Words that introduce unnamed definitions like "define interface"
18
+ unnamedDefinition: ["interface"],
19
+
20
+ // Words that introduce simple named definitions like "define library"
21
+ namedDefinition: ["module", "library", "macro",
22
+ "C-struct", "C-union",
23
+ "C-function", "C-callable-wrapper"
24
+ ],
25
+
26
+ // Words that introduce type definitions like "define class".
27
+ // These are also parameterized like "define method" and are
28
+ // appended to otherParameterizedDefinitionWords
29
+ typeParameterizedDefinition: ["class", "C-subtype", "C-mapped-subtype"],
30
+
31
+ // Words that introduce trickier definitions like "define method".
32
+ // These require special definitions to be added to startExpressions
33
+ otherParameterizedDefinition: ["method", "function",
34
+ "C-variable", "C-address"
35
+ ],
36
+
37
+ // Words that introduce module constant definitions.
38
+ // These must also be simple definitions and are
39
+ // appended to otherSimpleDefinitionWords
40
+ constantSimpleDefinition: ["constant"],
41
+
42
+ // Words that introduce module variable definitions.
43
+ // These must also be simple definitions and are
44
+ // appended to otherSimpleDefinitionWords
45
+ variableSimpleDefinition: ["variable"],
46
+
47
+ // Other words that introduce simple definitions
48
+ // (without implicit bodies).
49
+ otherSimpleDefinition: ["generic", "domain",
50
+ "C-pointer-type",
51
+ "table"
52
+ ],
53
+
54
+ // Words that begin statements with implicit bodies.
55
+ statement: ["if", "block", "begin", "method", "case",
56
+ "for", "select", "when", "unless", "until",
57
+ "while", "iterate", "profiling", "dynamic-bind"
58
+ ],
59
+
60
+ // Patterns that act as separators in compound statements.
61
+ // This may include any general pattern that must be indented
62
+ // specially.
63
+ separator: ["finally", "exception", "cleanup", "else",
64
+ "elseif", "afterwards"
65
+ ],
66
+
67
+ // Keywords that do not require special indentation handling,
68
+ // but which should be highlighted
69
+ other: ["above", "below", "by", "from", "handler", "in",
70
+ "instance", "let", "local", "otherwise", "slot",
71
+ "subclass", "then", "to", "keyed-by", "virtual"
72
+ ],
73
+
74
+ // Condition signaling function calls
75
+ signalingCalls: ["signal", "error", "cerror",
76
+ "break", "check-type", "abort"
77
+ ]
78
+ };
79
+
80
+ words["otherDefinition"] =
81
+ words["unnamedDefinition"]
82
+ .concat(words["namedDefinition"])
83
+ .concat(words["otherParameterizedDefinition"]);
84
+
85
+ words["definition"] =
86
+ words["typeParameterizedDefinition"]
87
+ .concat(words["otherDefinition"]);
88
+
89
+ words["parameterizedDefinition"] =
90
+ words["typeParameterizedDefinition"]
91
+ .concat(words["otherParameterizedDefinition"]);
92
+
93
+ words["simpleDefinition"] =
94
+ words["constantSimpleDefinition"]
95
+ .concat(words["variableSimpleDefinition"])
96
+ .concat(words["otherSimpleDefinition"]);
97
+
98
+ words["keyword"] =
99
+ words["statement"]
100
+ .concat(words["separator"])
101
+ .concat(words["other"]);
102
+
103
+ // Patterns
104
+ var symbolPattern = "[-_a-zA-Z?!*@<>$%]+";
105
+ var symbol = new RegExp("^" + symbolPattern);
106
+ var patterns = {
107
+ // Symbols with special syntax
108
+ symbolKeyword: symbolPattern + ":",
109
+ symbolClass: "<" + symbolPattern + ">",
110
+ symbolGlobal: "\\*" + symbolPattern + "\\*",
111
+ symbolConstant: "\\$" + symbolPattern
112
+ };
113
+ var patternStyles = {
114
+ symbolKeyword: "atom",
115
+ symbolClass: "tag",
116
+ symbolGlobal: "variable-2",
117
+ symbolConstant: "variable-3"
118
+ };
119
+
120
+ // Compile all patterns to regular expressions
121
+ for (var patternName in patterns)
122
+ if (patterns.hasOwnProperty(patternName))
123
+ patterns[patternName] = new RegExp("^" + patterns[patternName]);
124
+
125
+ // Names beginning "with-" and "without-" are commonly
126
+ // used as statement macro
127
+ patterns["keyword"] = [/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];
128
+
129
+ var styles = {};
130
+ styles["keyword"] = "keyword";
131
+ styles["definition"] = "def";
132
+ styles["simpleDefinition"] = "def";
133
+ styles["signalingCalls"] = "builtin";
134
+
135
+ // protected words lookup table
136
+ var wordLookup = {};
137
+ var styleLookup = {};
138
+
139
+ [
140
+ "keyword",
141
+ "definition",
142
+ "simpleDefinition",
143
+ "signalingCalls"
144
+ ].forEach(function(type) {
145
+ words[type].forEach(function(word) {
146
+ wordLookup[word] = type;
147
+ styleLookup[word] = styles[type];
148
+ });
149
+ });
150
+
151
+
152
+ function chain(stream, state, f) {
153
+ state.tokenize = f;
154
+ return f(stream, state);
155
+ }
156
+
157
+ function tokenBase(stream, state) {
158
+ // String
159
+ var ch = stream.peek();
160
+ if (ch == "'" || ch == '"') {
161
+ stream.next();
162
+ return chain(stream, state, tokenString(ch, "string"));
163
+ }
164
+ // Comment
165
+ else if (ch == "/") {
166
+ stream.next();
167
+ if (stream.eat("*")) {
168
+ return chain(stream, state, tokenComment);
169
+ } else if (stream.eat("/")) {
170
+ stream.skipToEnd();
171
+ return "comment";
172
+ } else {
173
+ stream.skipTo(" ");
174
+ return "operator";
175
+ }
176
+ }
177
+ // Decimal
178
+ else if (/\d/.test(ch)) {
179
+ stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/);
180
+ return "number";
181
+ }
182
+ // Hash
183
+ else if (ch == "#") {
184
+ stream.next();
185
+ // Symbol with string syntax
186
+ ch = stream.peek();
187
+ if (ch == '"') {
188
+ stream.next();
189
+ return chain(stream, state, tokenString('"', "string-2"));
190
+ }
191
+ // Binary number
192
+ else if (ch == "b") {
193
+ stream.next();
194
+ stream.eatWhile(/[01]/);
195
+ return "number";
196
+ }
197
+ // Hex number
198
+ else if (ch == "x") {
199
+ stream.next();
200
+ stream.eatWhile(/[\da-f]/i);
201
+ return "number";
202
+ }
203
+ // Octal number
204
+ else if (ch == "o") {
205
+ stream.next();
206
+ stream.eatWhile(/[0-7]/);
207
+ return "number";
208
+ }
209
+ // Hash symbol
210
+ else {
211
+ stream.eatWhile(/[-a-zA-Z]/);
212
+ return "keyword";
213
+ }
214
+ } else if (stream.match("end")) {
215
+ return "keyword";
216
+ }
217
+ for (var name in patterns) {
218
+ if (patterns.hasOwnProperty(name)) {
219
+ var pattern = patterns[name];
220
+ if ((pattern instanceof Array && pattern.some(function(p) {
221
+ return stream.match(p);
222
+ })) || stream.match(pattern))
223
+ return patternStyles[name];
224
+ }
225
+ }
226
+ if (stream.match("define")) {
227
+ return "def";
228
+ } else {
229
+ stream.eatWhile(/[\w\-]/);
230
+ // Keyword
231
+ if (wordLookup[stream.current()]) {
232
+ return styleLookup[stream.current()];
233
+ } else if (stream.current().match(symbol)) {
234
+ return "variable";
235
+ } else {
236
+ stream.next();
237
+ return "variable-2";
238
+ }
239
+ }
240
+ }
241
+
242
+ function tokenComment(stream, state) {
243
+ var maybeEnd = false,
244
+ ch;
245
+ while ((ch = stream.next())) {
246
+ if (ch == "/" && maybeEnd) {
247
+ state.tokenize = tokenBase;
248
+ break;
249
+ }
250
+ maybeEnd = (ch == "*");
251
+ }
252
+ return "comment";
253
+ }
254
+
255
+ function tokenString(quote, style) {
256
+ return function(stream, state) {
257
+ var next, end = false;
258
+ while ((next = stream.next()) != null) {
259
+ if (next == quote) {
260
+ end = true;
261
+ break;
262
+ }
263
+ }
264
+ if (end)
265
+ state.tokenize = tokenBase;
266
+ return style;
267
+ };
268
+ }
269
+
270
+ // Interface
271
+ return {
272
+ startState: function() {
273
+ return {
274
+ tokenize: tokenBase,
275
+ currentIndent: 0
276
+ };
277
+ },
278
+ token: function(stream, state) {
279
+ if (stream.eatSpace())
280
+ return null;
281
+ var style = state.tokenize(stream, state);
282
+ return style;
283
+ },
284
+ blockCommentStart: "/*",
285
+ blockCommentEnd: "*/"
286
+ };
287
+ });
288
+
289
+ CodeMirror.defineMIME("text/x-dylan", "dylan");
290
+
291
+ });
assets/js/vendor/codemirror/mode/dylan/index.html ADDED
@@ -0,0 +1,407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Dylan mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="../../addon/comment/continuecomment.js"></script>
11
+ <script src="../../addon/comment/comment.js"></script>
12
+ <script src="dylan.js"></script>
13
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#">Dylan</a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>Dylan mode</h2>
30
+
31
+
32
+ <div><textarea id="code" name="code">
33
+ Module: locators-internals
34
+ Synopsis: Abstract modeling of locations
35
+ Author: Andy Armstrong
36
+ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
37
+ All rights reserved.
38
+ License: See License.txt in this distribution for details.
39
+ Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
40
+
41
+ define open generic locator-server
42
+ (locator :: <locator>) => (server :: false-or(<server-locator>));
43
+ define open generic locator-host
44
+ (locator :: <locator>) => (host :: false-or(<string>));
45
+ define open generic locator-volume
46
+ (locator :: <locator>) => (volume :: false-or(<string>));
47
+ define open generic locator-directory
48
+ (locator :: <locator>) => (directory :: false-or(<directory-locator>));
49
+ define open generic locator-relative?
50
+ (locator :: <locator>) => (relative? :: <boolean>);
51
+ define open generic locator-path
52
+ (locator :: <locator>) => (path :: <sequence>);
53
+ define open generic locator-base
54
+ (locator :: <locator>) => (base :: false-or(<string>));
55
+ define open generic locator-extension
56
+ (locator :: <locator>) => (extension :: false-or(<string>));
57
+
58
+ /// Locator classes
59
+
60
+ define open abstract class <directory-locator> (<physical-locator>)
61
+ end class <directory-locator>;
62
+
63
+ define open abstract class <file-locator> (<physical-locator>)
64
+ end class <file-locator>;
65
+
66
+ define method as
67
+ (class == <directory-locator>, string :: <string>)
68
+ => (locator :: <directory-locator>)
69
+ as(<native-directory-locator>, string)
70
+ end method as;
71
+
72
+ define method make
73
+ (class == <directory-locator>,
74
+ #key server :: false-or(<server-locator>) = #f,
75
+ path :: <sequence> = #[],
76
+ relative? :: <boolean> = #f,
77
+ name :: false-or(<string>) = #f)
78
+ => (locator :: <directory-locator>)
79
+ make(<native-directory-locator>,
80
+ server: server,
81
+ path: path,
82
+ relative?: relative?,
83
+ name: name)
84
+ end method make;
85
+
86
+ define method as
87
+ (class == <file-locator>, string :: <string>)
88
+ => (locator :: <file-locator>)
89
+ as(<native-file-locator>, string)
90
+ end method as;
91
+
92
+ define method make
93
+ (class == <file-locator>,
94
+ #key directory :: false-or(<directory-locator>) = #f,
95
+ base :: false-or(<string>) = #f,
96
+ extension :: false-or(<string>) = #f,
97
+ name :: false-or(<string>) = #f)
98
+ => (locator :: <file-locator>)
99
+ make(<native-file-locator>,
100
+ directory: directory,
101
+ base: base,
102
+ extension: extension,
103
+ name: name)
104
+ end method make;
105
+
106
+ /// Locator coercion
107
+
108
+ //---*** andrewa: This caching scheme doesn't work yet, so disable it.
109
+ define constant $cache-locators? = #f;
110
+ define constant $cache-locator-strings? = #f;
111
+
112
+ define constant $locator-to-string-cache = make(<object-table>, weak: #"key");
113
+ define constant $string-to-locator-cache = make(<string-table>, weak: #"value");
114
+
115
+ define open generic locator-as-string
116
+ (class :: subclass(<string>), locator :: <locator>)
117
+ => (string :: <string>);
118
+
119
+ define open generic string-as-locator
120
+ (class :: subclass(<locator>), string :: <string>)
121
+ => (locator :: <locator>);
122
+
123
+ define sealed sideways method as
124
+ (class :: subclass(<string>), locator :: <locator>)
125
+ => (string :: <string>)
126
+ let string = element($locator-to-string-cache, locator, default: #f);
127
+ if (string)
128
+ as(class, string)
129
+ else
130
+ let string = locator-as-string(class, locator);
131
+ if ($cache-locator-strings?)
132
+ element($locator-to-string-cache, locator) := string;
133
+ else
134
+ string
135
+ end
136
+ end
137
+ end method as;
138
+
139
+ define sealed sideways method as
140
+ (class :: subclass(<locator>), string :: <string>)
141
+ => (locator :: <locator>)
142
+ let locator = element($string-to-locator-cache, string, default: #f);
143
+ if (instance?(locator, class))
144
+ locator
145
+ else
146
+ let locator = string-as-locator(class, string);
147
+ if ($cache-locators?)
148
+ element($string-to-locator-cache, string) := locator;
149
+ else
150
+ locator
151
+ end
152
+ end
153
+ end method as;
154
+
155
+ /// Locator conditions
156
+
157
+ define class <locator-error> (<format-string-condition>, <error>)
158
+ end class <locator-error>;
159
+
160
+ define function locator-error
161
+ (format-string :: <string>, #rest format-arguments)
162
+ error(make(<locator-error>,
163
+ format-string: format-string,
164
+ format-arguments: format-arguments))
165
+ end function locator-error;
166
+
167
+ /// Useful locator protocols
168
+
169
+ define open generic locator-test
170
+ (locator :: <directory-locator>) => (test :: <function>);
171
+
172
+ define method locator-test
173
+ (locator :: <directory-locator>) => (test :: <function>)
174
+ \=
175
+ end method locator-test;
176
+
177
+ define open generic locator-might-have-links?
178
+ (locator :: <directory-locator>) => (links? :: <boolean>);
179
+
180
+ define method locator-might-have-links?
181
+ (locator :: <directory-locator>) => (links? :: singleton(#f))
182
+ #f
183
+ end method locator-might-have-links?;
184
+
185
+ define method locator-relative?
186
+ (locator :: <file-locator>) => (relative? :: <boolean>)
187
+ let directory = locator.locator-directory;
188
+ ~directory | directory.locator-relative?
189
+ end method locator-relative?;
190
+
191
+ define method current-directory-locator?
192
+ (locator :: <directory-locator>) => (current-directory? :: <boolean>)
193
+ locator.locator-relative?
194
+ & locator.locator-path = #[#"self"]
195
+ end method current-directory-locator?;
196
+
197
+ define method locator-directory
198
+ (locator :: <directory-locator>) => (parent :: false-or(<directory-locator>))
199
+ let path = locator.locator-path;
200
+ unless (empty?(path))
201
+ make(object-class(locator),
202
+ server: locator.locator-server,
203
+ path: copy-sequence(path, end: path.size - 1),
204
+ relative?: locator.locator-relative?)
205
+ end
206
+ end method locator-directory;
207
+
208
+ /// Simplify locator
209
+
210
+ define open generic simplify-locator
211
+ (locator :: <physical-locator>)
212
+ => (simplified-locator :: <physical-locator>);
213
+
214
+ define method simplify-locator
215
+ (locator :: <directory-locator>)
216
+ => (simplified-locator :: <directory-locator>)
217
+ let path = locator.locator-path;
218
+ let relative? = locator.locator-relative?;
219
+ let resolve-parent? = ~locator.locator-might-have-links?;
220
+ let simplified-path
221
+ = simplify-path(path,
222
+ resolve-parent?: resolve-parent?,
223
+ relative?: relative?);
224
+ if (path ~= simplified-path)
225
+ make(object-class(locator),
226
+ server: locator.locator-server,
227
+ path: simplified-path,
228
+ relative?: locator.locator-relative?)
229
+ else
230
+ locator
231
+ end
232
+ end method simplify-locator;
233
+
234
+ define method simplify-locator
235
+ (locator :: <file-locator>) => (simplified-locator :: <file-locator>)
236
+ let directory = locator.locator-directory;
237
+ let simplified-directory = directory & simplify-locator(directory);
238
+ if (directory ~= simplified-directory)
239
+ make(object-class(locator),
240
+ directory: simplified-directory,
241
+ base: locator.locator-base,
242
+ extension: locator.locator-extension)
243
+ else
244
+ locator
245
+ end
246
+ end method simplify-locator;
247
+
248
+ /// Subdirectory locator
249
+
250
+ define open generic subdirectory-locator
251
+ (locator :: <directory-locator>, #rest sub-path)
252
+ => (subdirectory :: <directory-locator>);
253
+
254
+ define method subdirectory-locator
255
+ (locator :: <directory-locator>, #rest sub-path)
256
+ => (subdirectory :: <directory-locator>)
257
+ let old-path = locator.locator-path;
258
+ let new-path = concatenate-as(<simple-object-vector>, old-path, sub-path);
259
+ make(object-class(locator),
260
+ server: locator.locator-server,
261
+ path: new-path,
262
+ relative?: locator.locator-relative?)
263
+ end method subdirectory-locator;
264
+
265
+ /// Relative locator
266
+
267
+ define open generic relative-locator
268
+ (locator :: <physical-locator>, from-locator :: <physical-locator>)
269
+ => (relative-locator :: <physical-locator>);
270
+
271
+ define method relative-locator
272
+ (locator :: <directory-locator>, from-locator :: <directory-locator>)
273
+ => (relative-locator :: <directory-locator>)
274
+ let path = locator.locator-path;
275
+ let from-path = from-locator.locator-path;
276
+ case
277
+ ~locator.locator-relative? & from-locator.locator-relative? =>
278
+ locator-error
279
+ ("Cannot find relative path of absolute locator %= from relative locator %=",
280
+ locator, from-locator);
281
+ locator.locator-server ~= from-locator.locator-server =>
282
+ locator;
283
+ path = from-path =>
284
+ make(object-class(locator),
285
+ path: vector(#"self"),
286
+ relative?: #t);
287
+ otherwise =>
288
+ make(object-class(locator),
289
+ path: relative-path(path, from-path, test: locator.locator-test),
290
+ relative?: #t);
291
+ end
292
+ end method relative-locator;
293
+
294
+ define method relative-locator
295
+ (locator :: <file-locator>, from-directory :: <directory-locator>)
296
+ => (relative-locator :: <file-locator>)
297
+ let directory = locator.locator-directory;
298
+ let relative-directory = directory & relative-locator(directory, from-directory);
299
+ if (relative-directory ~= directory)
300
+ simplify-locator
301
+ (make(object-class(locator),
302
+ directory: relative-directory,
303
+ base: locator.locator-base,
304
+ extension: locator.locator-extension))
305
+ else
306
+ locator
307
+ end
308
+ end method relative-locator;
309
+
310
+ define method relative-locator
311
+ (locator :: <physical-locator>, from-locator :: <file-locator>)
312
+ => (relative-locator :: <physical-locator>)
313
+ let from-directory = from-locator.locator-directory;
314
+ case
315
+ from-directory =>
316
+ relative-locator(locator, from-directory);
317
+ ~locator.locator-relative? =>
318
+ locator-error
319
+ ("Cannot find relative path of absolute locator %= from relative locator %=",
320
+ locator, from-locator);
321
+ otherwise =>
322
+ locator;
323
+ end
324
+ end method relative-locator;
325
+
326
+ /// Merge locators
327
+
328
+ define open generic merge-locators
329
+ (locator :: <physical-locator>, from-locator :: <physical-locator>)
330
+ => (merged-locator :: <physical-locator>);
331
+
332
+ /// Merge locators
333
+
334
+ define method merge-locators
335
+ (locator :: <directory-locator>, from-locator :: <directory-locator>)
336
+ => (merged-locator :: <directory-locator>)
337
+ if (locator.locator-relative?)
338
+ let path = concatenate(from-locator.locator-path, locator.locator-path);
339
+ simplify-locator
340
+ (make(object-class(locator),
341
+ server: from-locator.locator-server,
342
+ path: path,
343
+ relative?: from-locator.locator-relative?))
344
+ else
345
+ locator
346
+ end
347
+ end method merge-locators;
348
+
349
+ define method merge-locators
350
+ (locator :: <file-locator>, from-locator :: <directory-locator>)
351
+ => (merged-locator :: <file-locator>)
352
+ let directory = locator.locator-directory;
353
+ let merged-directory
354
+ = if (directory)
355
+ merge-locators(directory, from-locator)
356
+ else
357
+ simplify-locator(from-locator)
358
+ end;
359
+ if (merged-directory ~= directory)
360
+ make(object-class(locator),
361
+ directory: merged-directory,
362
+ base: locator.locator-base,
363
+ extension: locator.locator-extension)
364
+ else
365
+ locator
366
+ end
367
+ end method merge-locators;
368
+
369
+ define method merge-locators
370
+ (locator :: <physical-locator>, from-locator :: <file-locator>)
371
+ => (merged-locator :: <physical-locator>)
372
+ let from-directory = from-locator.locator-directory;
373
+ if (from-directory)
374
+ merge-locators(locator, from-directory)
375
+ else
376
+ locator
377
+ end
378
+ end method merge-locators;
379
+
380
+ /// Locator protocols
381
+
382
+ define sideways method supports-open-locator?
383
+ (locator :: <file-locator>) => (openable? :: <boolean>)
384
+ ~locator.locator-relative?
385
+ end method supports-open-locator?;
386
+
387
+ define sideways method open-locator
388
+ (locator :: <file-locator>, #rest keywords, #key, #all-keys)
389
+ => (stream :: <stream>)
390
+ apply(open-file-stream, locator, keywords)
391
+ end method open-locator;
392
+ </textarea></div>
393
+
394
+ <script>
395
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
396
+ mode: "text/x-dylan",
397
+ lineNumbers: true,
398
+ matchBrackets: true,
399
+ continueComments: "Enter",
400
+ extraKeys: {"Ctrl-Q": "toggleComment"},
401
+ tabMode: "indent",
402
+ indentUnit: 2
403
+ });
404
+ </script>
405
+
406
+ <p><strong>MIME types defined:</strong> <code>text/x-dylan</code>.</p>
407
+ </article>
assets/js/vendor/codemirror/mode/ebnf/ebnf.js ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("ebnf", function (config) {
15
+ var commentType = {slash: 0, parenthesis: 1};
16
+ var stateType = {comment: 0, _string: 1, characterClass: 2};
17
+ var bracesMode = null;
18
+
19
+ if (config.bracesMode)
20
+ bracesMode = CodeMirror.getMode(config, config.bracesMode);
21
+
22
+ return {
23
+ startState: function () {
24
+ return {
25
+ stringType: null,
26
+ commentType: null,
27
+ braced: 0,
28
+ lhs: true,
29
+ localState: null,
30
+ stack: [],
31
+ inDefinition: false
32
+ };
33
+ },
34
+ token: function (stream, state) {
35
+ if (!stream) return;
36
+
37
+ //check for state changes
38
+ if (state.stack.length === 0) {
39
+ //strings
40
+ if ((stream.peek() == '"') || (stream.peek() == "'")) {
41
+ state.stringType = stream.peek();
42
+ stream.next(); // Skip quote
43
+ state.stack.unshift(stateType._string);
44
+ } else if (stream.match(/^\/\*/)) { //comments starting with /*
45
+ state.stack.unshift(stateType.comment);
46
+ state.commentType = commentType.slash;
47
+ } else if (stream.match(/^\(\*/)) { //comments starting with (*
48
+ state.stack.unshift(stateType.comment);
49
+ state.commentType = commentType.parenthesis;
50
+ }
51
+ }
52
+
53
+ //return state
54
+ //stack has
55
+ switch (state.stack[0]) {
56
+ case stateType._string:
57
+ while (state.stack[0] === stateType._string && !stream.eol()) {
58
+ if (stream.peek() === state.stringType) {
59
+ stream.next(); // Skip quote
60
+ state.stack.shift(); // Clear flag
61
+ } else if (stream.peek() === "\\") {
62
+ stream.next();
63
+ stream.next();
64
+ } else {
65
+ stream.match(/^.[^\\\"\']*/);
66
+ }
67
+ }
68
+ return state.lhs ? "property string" : "string"; // Token style
69
+
70
+ case stateType.comment:
71
+ while (state.stack[0] === stateType.comment && !stream.eol()) {
72
+ if (state.commentType === commentType.slash && stream.match(/\*\//)) {
73
+ state.stack.shift(); // Clear flag
74
+ state.commentType = null;
75
+ } else if (state.commentType === commentType.parenthesis && stream.match(/\*\)/)) {
76
+ state.stack.shift(); // Clear flag
77
+ state.commentType = null;
78
+ } else {
79
+ stream.match(/^.[^\*]*/);
80
+ }
81
+ }
82
+ return "comment";
83
+
84
+ case stateType.characterClass:
85
+ while (state.stack[0] === stateType.characterClass && !stream.eol()) {
86
+ if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) {
87
+ state.stack.shift();
88
+ }
89
+ }
90
+ return "operator";
91
+ }
92
+
93
+ var peek = stream.peek();
94
+
95
+ if (bracesMode !== null && (state.braced || peek === "{")) {
96
+ if (state.localState === null)
97
+ state.localState = bracesMode.startState();
98
+
99
+ var token = bracesMode.token(stream, state.localState),
100
+ text = stream.current();
101
+
102
+ if (!token) {
103
+ for (var i = 0; i < text.length; i++) {
104
+ if (text[i] === "{") {
105
+ if (state.braced === 0) {
106
+ token = "matchingbracket";
107
+ }
108
+ state.braced++;
109
+ } else if (text[i] === "}") {
110
+ state.braced--;
111
+ if (state.braced === 0) {
112
+ token = "matchingbracket";
113
+ }
114
+ }
115
+ }
116
+ }
117
+ return token;
118
+ }
119
+
120
+ //no stack
121
+ switch (peek) {
122
+ case "[":
123
+ stream.next();
124
+ state.stack.unshift(stateType.characterClass);
125
+ return "bracket";
126
+ case ":":
127
+ case "|":
128
+ case ";":
129
+ stream.next();
130
+ return "operator";
131
+ case "%":
132
+ if (stream.match("%%")) {
133
+ return "header";
134
+ } else if (stream.match(/[%][A-Za-z]+/)) {
135
+ return "keyword";
136
+ } else if (stream.match(/[%][}]/)) {
137
+ return "matchingbracket";
138
+ }
139
+ break;
140
+ case "/":
141
+ if (stream.match(/[\/][A-Za-z]+/)) {
142
+ return "keyword";
143
+ }
144
+ case "\\":
145
+ if (stream.match(/[\][a-z]+/)) {
146
+ return "string-2";
147
+ }
148
+ case ".":
149
+ if (stream.match(".")) {
150
+ return "atom";
151
+ }
152
+ case "*":
153
+ case "-":
154
+ case "+":
155
+ case "^":
156
+ if (stream.match(peek)) {
157
+ return "atom";
158
+ }
159
+ case "$":
160
+ if (stream.match("$$")) {
161
+ return "builtin";
162
+ } else if (stream.match(/[$][0-9]+/)) {
163
+ return "variable-3";
164
+ }
165
+ case "<":
166
+ if (stream.match(/<<[a-zA-Z_]+>>/)) {
167
+ return "builtin";
168
+ }
169
+ }
170
+
171
+ if (stream.match(/^\/\//)) {
172
+ stream.skipToEnd();
173
+ return "comment";
174
+ } else if (stream.match(/return/)) {
175
+ return "operator";
176
+ } else if (stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)) {
177
+ if (stream.match(/(?=[\(.])/)) {
178
+ return "variable";
179
+ } else if (stream.match(/(?=[\s\n]*[:=])/)) {
180
+ return "def";
181
+ }
182
+ return "variable-2";
183
+ } else if (["[", "]", "(", ")"].indexOf(stream.peek()) != -1) {
184
+ stream.next();
185
+ return "bracket";
186
+ } else if (!stream.eatSpace()) {
187
+ stream.next();
188
+ }
189
+ return null;
190
+ }
191
+ };
192
+ });
193
+
194
+ CodeMirror.defineMIME("text/x-ebnf", "ebnf");
195
+ });
assets/js/vendor/codemirror/mode/ebnf/index.html ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title>CodeMirror: EBNF Mode</title>
5
+ <meta charset="utf-8"/>
6
+ <link rel=stylesheet href="../../doc/docs.css">
7
+
8
+ <link rel="stylesheet" href="../../lib/codemirror.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="../javascript/javascript.js"></script>
11
+ <script src="ebnf.js"></script>
12
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
13
+ </head>
14
+ <body>
15
+ <div id=nav>
16
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
17
+
18
+ <ul>
19
+ <li><a href="../../index.html">Home</a>
20
+ <li><a href="../../doc/manual.html">Manual</a>
21
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
22
+ </ul>
23
+ <ul>
24
+ <li><a href="../index.html">Language modes</a>
25
+ <li><a class=active href="#">EBNF Mode</a>
26
+ </ul>
27
+ </div>
28
+
29
+ <article>
30
+ <h2>EBNF Mode (bracesMode setting = "javascript")</h2>
31
+ <form><textarea id="code" name="code">
32
+ /* description: Parses end executes mathematical expressions. */
33
+
34
+ /* lexical grammar */
35
+ %lex
36
+
37
+ %%
38
+ \s+ /* skip whitespace */
39
+ [0-9]+("."[0-9]+)?\b return 'NUMBER';
40
+ "*" return '*';
41
+ "/" return '/';
42
+ "-" return '-';
43
+ "+" return '+';
44
+ "^" return '^';
45
+ "(" return '(';
46
+ ")" return ')';
47
+ "PI" return 'PI';
48
+ "E" return 'E';
49
+ &lt;&lt;EOF&gt;&gt; return 'EOF';
50
+
51
+ /lex
52
+
53
+ /* operator associations and precedence */
54
+
55
+ %left '+' '-'
56
+ %left '*' '/'
57
+ %left '^'
58
+ %left UMINUS
59
+
60
+ %start expressions
61
+
62
+ %% /* language grammar */
63
+
64
+ expressions
65
+ : e EOF
66
+ {print($1); return $1;}
67
+ ;
68
+
69
+ e
70
+ : e '+' e
71
+ {$$ = $1+$3;}
72
+ | e '-' e
73
+ {$$ = $1-$3;}
74
+ | e '*' e
75
+ {$$ = $1*$3;}
76
+ | e '/' e
77
+ {$$ = $1/$3;}
78
+ | e '^' e
79
+ {$$ = Math.pow($1, $3);}
80
+ | '-' e %prec UMINUS
81
+ {$$ = -$2;}
82
+ | '(' e ')'
83
+ {$$ = $2;}
84
+ | NUMBER
85
+ {$$ = Number(yytext);}
86
+ | E
87
+ {$$ = Math.E;}
88
+ | PI
89
+ {$$ = Math.PI;}
90
+ ;</textarea></form>
91
+ <script>
92
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
93
+ mode: {name: "ebnf"},
94
+ lineNumbers: true,
95
+ bracesMode: 'javascript'
96
+ });
97
+ </script>
98
+ <h3>The EBNF Mode</h3>
99
+ <p> Created by <a href="https://github.com/robertleeplummerjr">Robert Plummer</a></p>
100
+ </article>
101
+ </body>
102
+ </html>
assets/js/vendor/codemirror/mode/ecl/ecl.js ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("ecl", function(config) {
15
+
16
+ function words(str) {
17
+ var obj = {}, words = str.split(" ");
18
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
19
+ return obj;
20
+ }
21
+
22
+ function metaHook(stream, state) {
23
+ if (!state.startOfLine) return false;
24
+ stream.skipToEnd();
25
+ return "meta";
26
+ }
27
+
28
+ var indentUnit = config.indentUnit;
29
+ var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode");
30
+ var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait");
31
+ var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath");
32
+ var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode");
33
+ var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when");
34
+ var blockKeywords = words("catch class do else finally for if switch try while");
35
+ var atoms = words("true false null");
36
+ var hooks = {"#": metaHook};
37
+ var isOperatorChar = /[+\-*&%=<>!?|\/]/;
38
+
39
+ var curPunc;
40
+
41
+ function tokenBase(stream, state) {
42
+ var ch = stream.next();
43
+ if (hooks[ch]) {
44
+ var result = hooks[ch](stream, state);
45
+ if (result !== false) return result;
46
+ }
47
+ if (ch == '"' || ch == "'") {
48
+ state.tokenize = tokenString(ch);
49
+ return state.tokenize(stream, state);
50
+ }
51
+ if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
52
+ curPunc = ch;
53
+ return null;
54
+ }
55
+ if (/\d/.test(ch)) {
56
+ stream.eatWhile(/[\w\.]/);
57
+ return "number";
58
+ }
59
+ if (ch == "/") {
60
+ if (stream.eat("*")) {
61
+ state.tokenize = tokenComment;
62
+ return tokenComment(stream, state);
63
+ }
64
+ if (stream.eat("/")) {
65
+ stream.skipToEnd();
66
+ return "comment";
67
+ }
68
+ }
69
+ if (isOperatorChar.test(ch)) {
70
+ stream.eatWhile(isOperatorChar);
71
+ return "operator";
72
+ }
73
+ stream.eatWhile(/[\w\$_]/);
74
+ var cur = stream.current().toLowerCase();
75
+ if (keyword.propertyIsEnumerable(cur)) {
76
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
77
+ return "keyword";
78
+ } else if (variable.propertyIsEnumerable(cur)) {
79
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
80
+ return "variable";
81
+ } else if (variable_2.propertyIsEnumerable(cur)) {
82
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
83
+ return "variable-2";
84
+ } else if (variable_3.propertyIsEnumerable(cur)) {
85
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
86
+ return "variable-3";
87
+ } else if (builtin.propertyIsEnumerable(cur)) {
88
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
89
+ return "builtin";
90
+ } else { //Data types are of from KEYWORD##
91
+ var i = cur.length - 1;
92
+ while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_'))
93
+ --i;
94
+
95
+ if (i > 0) {
96
+ var cur2 = cur.substr(0, i + 1);
97
+ if (variable_3.propertyIsEnumerable(cur2)) {
98
+ if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement";
99
+ return "variable-3";
100
+ }
101
+ }
102
+ }
103
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
104
+ return null;
105
+ }
106
+
107
+ function tokenString(quote) {
108
+ return function(stream, state) {
109
+ var escaped = false, next, end = false;
110
+ while ((next = stream.next()) != null) {
111
+ if (next == quote && !escaped) {end = true; break;}
112
+ escaped = !escaped && next == "\\";
113
+ }
114
+ if (end || !escaped)
115
+ state.tokenize = tokenBase;
116
+ return "string";
117
+ };
118
+ }
119
+
120
+ function tokenComment(stream, state) {
121
+ var maybeEnd = false, ch;
122
+ while (ch = stream.next()) {
123
+ if (ch == "/" && maybeEnd) {
124
+ state.tokenize = tokenBase;
125
+ break;
126
+ }
127
+ maybeEnd = (ch == "*");
128
+ }
129
+ return "comment";
130
+ }
131
+
132
+ function Context(indented, column, type, align, prev) {
133
+ this.indented = indented;
134
+ this.column = column;
135
+ this.type = type;
136
+ this.align = align;
137
+ this.prev = prev;
138
+ }
139
+ function pushContext(state, col, type) {
140
+ return state.context = new Context(state.indented, col, type, null, state.context);
141
+ }
142
+ function popContext(state) {
143
+ var t = state.context.type;
144
+ if (t == ")" || t == "]" || t == "}")
145
+ state.indented = state.context.indented;
146
+ return state.context = state.context.prev;
147
+ }
148
+
149
+ // Interface
150
+
151
+ return {
152
+ startState: function(basecolumn) {
153
+ return {
154
+ tokenize: null,
155
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
156
+ indented: 0,
157
+ startOfLine: true
158
+ };
159
+ },
160
+
161
+ token: function(stream, state) {
162
+ var ctx = state.context;
163
+ if (stream.sol()) {
164
+ if (ctx.align == null) ctx.align = false;
165
+ state.indented = stream.indentation();
166
+ state.startOfLine = true;
167
+ }
168
+ if (stream.eatSpace()) return null;
169
+ curPunc = null;
170
+ var style = (state.tokenize || tokenBase)(stream, state);
171
+ if (style == "comment" || style == "meta") return style;
172
+ if (ctx.align == null) ctx.align = true;
173
+
174
+ if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
175
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
176
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
177
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
178
+ else if (curPunc == "}") {
179
+ while (ctx.type == "statement") ctx = popContext(state);
180
+ if (ctx.type == "}") ctx = popContext(state);
181
+ while (ctx.type == "statement") ctx = popContext(state);
182
+ }
183
+ else if (curPunc == ctx.type) popContext(state);
184
+ else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
185
+ pushContext(state, stream.column(), "statement");
186
+ state.startOfLine = false;
187
+ return style;
188
+ },
189
+
190
+ indent: function(state, textAfter) {
191
+ if (state.tokenize != tokenBase && state.tokenize != null) return 0;
192
+ var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
193
+ if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
194
+ var closing = firstChar == ctx.type;
195
+ if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
196
+ else if (ctx.align) return ctx.column + (closing ? 0 : 1);
197
+ else return ctx.indented + (closing ? 0 : indentUnit);
198
+ },
199
+
200
+ electricChars: "{}"
201
+ };
202
+ });
203
+
204
+ CodeMirror.defineMIME("text/x-ecl", "ecl");
205
+
206
+ });
assets/js/vendor/codemirror/mode/ecl/index.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: ECL mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="ecl.js"></script>
10
+ <style>.CodeMirror {border: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">ECL</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>ECL mode</h2>
27
+ <form><textarea id="code" name="code">
28
+ /*
29
+ sample useless code to demonstrate ecl syntax highlighting
30
+ this is a multiline comment!
31
+ */
32
+
33
+ // this is a singleline comment!
34
+
35
+ import ut;
36
+ r :=
37
+ record
38
+ string22 s1 := '123';
39
+ integer4 i1 := 123;
40
+ end;
41
+ #option('tmp', true);
42
+ d := dataset('tmp::qb', r, thor);
43
+ output(d);
44
+ </textarea></form>
45
+ <script>
46
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
47
+ </script>
48
+
49
+ <p>Based on CodeMirror's clike mode. For more information see <a href="http://hpccsystems.com">HPCC Systems</a> web site.</p>
50
+ <p><strong>MIME types defined:</strong> <code>text/x-ecl</code>.</p>
51
+
52
+ </article>
assets/js/vendor/codemirror/mode/eiffel/eiffel.js ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("eiffel", function() {
15
+ function wordObj(words) {
16
+ var o = {};
17
+ for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
18
+ return o;
19
+ }
20
+ var keywords = wordObj([
21
+ 'note',
22
+ 'across',
23
+ 'when',
24
+ 'variant',
25
+ 'until',
26
+ 'unique',
27
+ 'undefine',
28
+ 'then',
29
+ 'strip',
30
+ 'select',
31
+ 'retry',
32
+ 'rescue',
33
+ 'require',
34
+ 'rename',
35
+ 'reference',
36
+ 'redefine',
37
+ 'prefix',
38
+ 'once',
39
+ 'old',
40
+ 'obsolete',
41
+ 'loop',
42
+ 'local',
43
+ 'like',
44
+ 'is',
45
+ 'inspect',
46
+ 'infix',
47
+ 'include',
48
+ 'if',
49
+ 'frozen',
50
+ 'from',
51
+ 'external',
52
+ 'export',
53
+ 'ensure',
54
+ 'end',
55
+ 'elseif',
56
+ 'else',
57
+ 'do',
58
+ 'creation',
59
+ 'create',
60
+ 'check',
61
+ 'alias',
62
+ 'agent',
63
+ 'separate',
64
+ 'invariant',
65
+ 'inherit',
66
+ 'indexing',
67
+ 'feature',
68
+ 'expanded',
69
+ 'deferred',
70
+ 'class',
71
+ 'Void',
72
+ 'True',
73
+ 'Result',
74
+ 'Precursor',
75
+ 'False',
76
+ 'Current',
77
+ 'create',
78
+ 'attached',
79
+ 'detachable',
80
+ 'as',
81
+ 'and',
82
+ 'implies',
83
+ 'not',
84
+ 'or'
85
+ ]);
86
+ var operators = wordObj([":=", "and then","and", "or","<<",">>"]);
87
+
88
+ function chain(newtok, stream, state) {
89
+ state.tokenize.push(newtok);
90
+ return newtok(stream, state);
91
+ }
92
+
93
+ function tokenBase(stream, state) {
94
+ if (stream.eatSpace()) return null;
95
+ var ch = stream.next();
96
+ if (ch == '"'||ch == "'") {
97
+ return chain(readQuoted(ch, "string"), stream, state);
98
+ } else if (ch == "-"&&stream.eat("-")) {
99
+ stream.skipToEnd();
100
+ return "comment";
101
+ } else if (ch == ":"&&stream.eat("=")) {
102
+ return "operator";
103
+ } else if (/[0-9]/.test(ch)) {
104
+ stream.eatWhile(/[xXbBCc0-9\.]/);
105
+ stream.eat(/[\?\!]/);
106
+ return "ident";
107
+ } else if (/[a-zA-Z_0-9]/.test(ch)) {
108
+ stream.eatWhile(/[a-zA-Z_0-9]/);
109
+ stream.eat(/[\?\!]/);
110
+ return "ident";
111
+ } else if (/[=+\-\/*^%<>~]/.test(ch)) {
112
+ stream.eatWhile(/[=+\-\/*^%<>~]/);
113
+ return "operator";
114
+ } else {
115
+ return null;
116
+ }
117
+ }
118
+
119
+ function readQuoted(quote, style, unescaped) {
120
+ return function(stream, state) {
121
+ var escaped = false, ch;
122
+ while ((ch = stream.next()) != null) {
123
+ if (ch == quote && (unescaped || !escaped)) {
124
+ state.tokenize.pop();
125
+ break;
126
+ }
127
+ escaped = !escaped && ch == "%";
128
+ }
129
+ return style;
130
+ };
131
+ }
132
+
133
+ return {
134
+ startState: function() {
135
+ return {tokenize: [tokenBase]};
136
+ },
137
+
138
+ token: function(stream, state) {
139
+ var style = state.tokenize[state.tokenize.length-1](stream, state);
140
+ if (style == "ident") {
141
+ var word = stream.current();
142
+ style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"
143
+ : operators.propertyIsEnumerable(stream.current()) ? "operator"
144
+ : /^[A-Z][A-Z_0-9]*$/g.test(word) ? "tag"
145
+ : /^0[bB][0-1]+$/g.test(word) ? "number"
146
+ : /^0[cC][0-7]+$/g.test(word) ? "number"
147
+ : /^0[xX][a-fA-F0-9]+$/g.test(word) ? "number"
148
+ : /^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(word) ? "number"
149
+ : /^[0-9]+$/g.test(word) ? "number"
150
+ : "variable";
151
+ }
152
+ return style;
153
+ },
154
+ lineComment: "--"
155
+ };
156
+ });
157
+
158
+ CodeMirror.defineMIME("text/x-eiffel", "eiffel");
159
+
160
+ });
assets/js/vendor/codemirror/mode/eiffel/index.html ADDED
@@ -0,0 +1,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Eiffel mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/neat.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="eiffel.js"></script>
11
+ <style>
12
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
13
+ .cm-s-default span.cm-arrow { color: red; }
14
+ </style>
15
+ <div id=nav>
16
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
17
+
18
+ <ul>
19
+ <li><a href="../../index.html">Home</a>
20
+ <li><a href="../../doc/manual.html">Manual</a>
21
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
22
+ </ul>
23
+ <ul>
24
+ <li><a href="../index.html">Language modes</a>
25
+ <li><a class=active href="#">Eiffel</a>
26
+ </ul>
27
+ </div>
28
+
29
+ <article>
30
+ <h2>Eiffel mode</h2>
31
+ <form><textarea id="code" name="code">
32
+ note
33
+ description: "[
34
+ Project-wide universal properties.
35
+ This class is an ancestor to all developer-written classes.
36
+ ANY may be customized for individual projects or teams.
37
+ ]"
38
+
39
+ library: "Free implementation of ELKS library"
40
+ status: "See notice at end of class."
41
+ legal: "See notice at end of class."
42
+ date: "$Date: 2013-01-25 11:49:00 -0800 (Fri, 25 Jan 2013) $"
43
+ revision: "$Revision: 712 $"
44
+
45
+ class
46
+ ANY
47
+
48
+ feature -- Customization
49
+
50
+ feature -- Access
51
+
52
+ generator: STRING
53
+ -- Name of current object's generating class
54
+ -- (base class of the type of which it is a direct instance)
55
+ external
56
+ "built_in"
57
+ ensure
58
+ generator_not_void: Result /= Void
59
+ generator_not_empty: not Result.is_empty
60
+ end
61
+
62
+ generating_type: TYPE [detachable like Current]
63
+ -- Type of current object
64
+ -- (type of which it is a direct instance)
65
+ do
66
+ Result := {detachable like Current}
67
+ ensure
68
+ generating_type_not_void: Result /= Void
69
+ end
70
+
71
+ feature -- Status report
72
+
73
+ conforms_to (other: ANY): BOOLEAN
74
+ -- Does type of current object conform to type
75
+ -- of `other' (as per Eiffel: The Language, chapter 13)?
76
+ require
77
+ other_not_void: other /= Void
78
+ external
79
+ "built_in"
80
+ end
81
+
82
+ same_type (other: ANY): BOOLEAN
83
+ -- Is type of current object identical to type of `other'?
84
+ require
85
+ other_not_void: other /= Void
86
+ external
87
+ "built_in"
88
+ ensure
89
+ definition: Result = (conforms_to (other) and
90
+ other.conforms_to (Current))
91
+ end
92
+
93
+ feature -- Comparison
94
+
95
+ is_equal (other: like Current): BOOLEAN
96
+ -- Is `other' attached to an object considered
97
+ -- equal to current object?
98
+ require
99
+ other_not_void: other /= Void
100
+ external
101
+ "built_in"
102
+ ensure
103
+ symmetric: Result implies other ~ Current
104
+ consistent: standard_is_equal (other) implies Result
105
+ end
106
+
107
+ frozen standard_is_equal (other: like Current): BOOLEAN
108
+ -- Is `other' attached to an object of the same type
109
+ -- as current object, and field-by-field identical to it?
110
+ require
111
+ other_not_void: other /= Void
112
+ external
113
+ "built_in"
114
+ ensure
115
+ same_type: Result implies same_type (other)
116
+ symmetric: Result implies other.standard_is_equal (Current)
117
+ end
118
+
119
+ frozen equal (a: detachable ANY; b: like a): BOOLEAN
120
+ -- Are `a' and `b' either both void or attached
121
+ -- to objects considered equal?
122
+ do
123
+ if a = Void then
124
+ Result := b = Void
125
+ else
126
+ Result := b /= Void and then
127
+ a.is_equal (b)
128
+ end
129
+ ensure
130
+ definition: Result = (a = Void and b = Void) or else
131
+ ((a /= Void and b /= Void) and then
132
+ a.is_equal (b))
133
+ end
134
+
135
+ frozen standard_equal (a: detachable ANY; b: like a): BOOLEAN
136
+ -- Are `a' and `b' either both void or attached to
137
+ -- field-by-field identical objects of the same type?
138
+ -- Always uses default object comparison criterion.
139
+ do
140
+ if a = Void then
141
+ Result := b = Void
142
+ else
143
+ Result := b /= Void and then
144
+ a.standard_is_equal (b)
145
+ end
146
+ ensure
147
+ definition: Result = (a = Void and b = Void) or else
148
+ ((a /= Void and b /= Void) and then
149
+ a.standard_is_equal (b))
150
+ end
151
+
152
+ frozen is_deep_equal (other: like Current): BOOLEAN
153
+ -- Are `Current' and `other' attached to isomorphic object structures?
154
+ require
155
+ other_not_void: other /= Void
156
+ external
157
+ "built_in"
158
+ ensure
159
+ shallow_implies_deep: standard_is_equal (other) implies Result
160
+ same_type: Result implies same_type (other)
161
+ symmetric: Result implies other.is_deep_equal (Current)
162
+ end
163
+
164
+ frozen deep_equal (a: detachable ANY; b: like a): BOOLEAN
165
+ -- Are `a' and `b' either both void
166
+ -- or attached to isomorphic object structures?
167
+ do
168
+ if a = Void then
169
+ Result := b = Void
170
+ else
171
+ Result := b /= Void and then a.is_deep_equal (b)
172
+ end
173
+ ensure
174
+ shallow_implies_deep: standard_equal (a, b) implies Result
175
+ both_or_none_void: (a = Void) implies (Result = (b = Void))
176
+ same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b))
177
+ symmetric: Result implies deep_equal (b, a)
178
+ end
179
+
180
+ feature -- Duplication
181
+
182
+ frozen twin: like Current
183
+ -- New object equal to `Current'
184
+ -- `twin' calls `copy'; to change copying/twinning semantics, redefine `copy'.
185
+ external
186
+ "built_in"
187
+ ensure
188
+ twin_not_void: Result /= Void
189
+ is_equal: Result ~ Current
190
+ end
191
+
192
+ copy (other: like Current)
193
+ -- Update current object using fields of object attached
194
+ -- to `other', so as to yield equal objects.
195
+ require
196
+ other_not_void: other /= Void
197
+ type_identity: same_type (other)
198
+ external
199
+ "built_in"
200
+ ensure
201
+ is_equal: Current ~ other
202
+ end
203
+
204
+ frozen standard_copy (other: like Current)
205
+ -- Copy every field of `other' onto corresponding field
206
+ -- of current object.
207
+ require
208
+ other_not_void: other /= Void
209
+ type_identity: same_type (other)
210
+ external
211
+ "built_in"
212
+ ensure
213
+ is_standard_equal: standard_is_equal (other)
214
+ end
215
+
216
+ frozen clone (other: detachable ANY): like other
217
+ -- Void if `other' is void; otherwise new object
218
+ -- equal to `other'
219
+ --
220
+ -- For non-void `other', `clone' calls `copy';
221
+ -- to change copying/cloning semantics, redefine `copy'.
222
+ obsolete
223
+ "Use `twin' instead."
224
+ do
225
+ if other /= Void then
226
+ Result := other.twin
227
+ end
228
+ ensure
229
+ equal: Result ~ other
230
+ end
231
+
232
+ frozen standard_clone (other: detachable ANY): like other
233
+ -- Void if `other' is void; otherwise new object
234
+ -- field-by-field identical to `other'.
235
+ -- Always uses default copying semantics.
236
+ obsolete
237
+ "Use `standard_twin' instead."
238
+ do
239
+ if other /= Void then
240
+ Result := other.standard_twin
241
+ end
242
+ ensure
243
+ equal: standard_equal (Result, other)
244
+ end
245
+
246
+ frozen standard_twin: like Current
247
+ -- New object field-by-field identical to `other'.
248
+ -- Always uses default copying semantics.
249
+ external
250
+ "built_in"
251
+ ensure
252
+ standard_twin_not_void: Result /= Void
253
+ equal: standard_equal (Result, Current)
254
+ end
255
+
256
+ frozen deep_twin: like Current
257
+ -- New object structure recursively duplicated from Current.
258
+ external
259
+ "built_in"
260
+ ensure
261
+ deep_twin_not_void: Result /= Void
262
+ deep_equal: deep_equal (Current, Result)
263
+ end
264
+
265
+ frozen deep_clone (other: detachable ANY): like other
266
+ -- Void if `other' is void: otherwise, new object structure
267
+ -- recursively duplicated from the one attached to `other'
268
+ obsolete
269
+ "Use `deep_twin' instead."
270
+ do
271
+ if other /= Void then
272
+ Result := other.deep_twin
273
+ end
274
+ ensure
275
+ deep_equal: deep_equal (other, Result)
276
+ end
277
+
278
+ frozen deep_copy (other: like Current)
279
+ -- Effect equivalent to that of:
280
+ -- `copy' (`other' . `deep_twin')
281
+ require
282
+ other_not_void: other /= Void
283
+ do
284
+ copy (other.deep_twin)
285
+ ensure
286
+ deep_equal: deep_equal (Current, other)
287
+ end
288
+
289
+ feature {NONE} -- Retrieval
290
+
291
+ frozen internal_correct_mismatch
292
+ -- Called from runtime to perform a proper dynamic dispatch on `correct_mismatch'
293
+ -- from MISMATCH_CORRECTOR.
294
+ local
295
+ l_msg: STRING
296
+ l_exc: EXCEPTIONS
297
+ do
298
+ if attached {MISMATCH_CORRECTOR} Current as l_corrector then
299
+ l_corrector.correct_mismatch
300
+ else
301
+ create l_msg.make_from_string ("Mismatch: ")
302
+ create l_exc
303
+ l_msg.append (generating_type.name)
304
+ l_exc.raise_retrieval_exception (l_msg)
305
+ end
306
+ end
307
+
308
+ feature -- Output
309
+
310
+ io: STD_FILES
311
+ -- Handle to standard file setup
312
+ once
313
+ create Result
314
+ Result.set_output_default
315
+ ensure
316
+ io_not_void: Result /= Void
317
+ end
318
+
319
+ out: STRING
320
+ -- New string containing terse printable representation
321
+ -- of current object
322
+ do
323
+ Result := tagged_out
324
+ ensure
325
+ out_not_void: Result /= Void
326
+ end
327
+
328
+ frozen tagged_out: STRING
329
+ -- New string containing terse printable representation
330
+ -- of current object
331
+ external
332
+ "built_in"
333
+ ensure
334
+ tagged_out_not_void: Result /= Void
335
+ end
336
+
337
+ print (o: detachable ANY)
338
+ -- Write terse external representation of `o'
339
+ -- on standard output.
340
+ do
341
+ if o /= Void then
342
+ io.put_string (o.out)
343
+ end
344
+ end
345
+
346
+ feature -- Platform
347
+
348
+ Operating_environment: OPERATING_ENVIRONMENT
349
+ -- Objects available from the operating system
350
+ once
351
+ create Result
352
+ ensure
353
+ operating_environment_not_void: Result /= Void
354
+ end
355
+
356
+ feature {NONE} -- Initialization
357
+
358
+ default_create
359
+ -- Process instances of classes with no creation clause.
360
+ -- (Default: do nothing.)
361
+ do
362
+ end
363
+
364
+ feature -- Basic operations
365
+
366
+ default_rescue
367
+ -- Process exception for routines with no Rescue clause.
368
+ -- (Default: do nothing.)
369
+ do
370
+ end
371
+
372
+ frozen do_nothing
373
+ -- Execute a null action.
374
+ do
375
+ end
376
+
377
+ frozen default: detachable like Current
378
+ -- Default value of object's type
379
+ do
380
+ end
381
+
382
+ frozen default_pointer: POINTER
383
+ -- Default value of type `POINTER'
384
+ -- (Avoid the need to write `p'.`default' for
385
+ -- some `p' of type `POINTER'.)
386
+ do
387
+ ensure
388
+ -- Result = Result.default
389
+ end
390
+
391
+ frozen as_attached: attached like Current
392
+ -- Attached version of Current
393
+ -- (Can be used during transitional period to convert
394
+ -- non-void-safe classes to void-safe ones.)
395
+ do
396
+ Result := Current
397
+ end
398
+
399
+ invariant
400
+ reflexive_equality: standard_is_equal (Current)
401
+ reflexive_conformance: conforms_to (Current)
402
+
403
+ note
404
+ copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
405
+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
406
+ source: "[
407
+ Eiffel Software
408
+ 5949 Hollister Ave., Goleta, CA 93117 USA
409
+ Telephone 805-685-1006, Fax 805-685-6869
410
+ Website http://www.eiffel.com
411
+ Customer support http://support.eiffel.com
412
+ ]"
413
+
414
+ end
415
+
416
+ </textarea></form>
417
+ <script>
418
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
419
+ mode: "text/x-eiffel",
420
+ indentUnit: 4,
421
+ lineNumbers: true,
422
+ theme: "neat"
423
+ });
424
+ </script>
425
+
426
+ <p><strong>MIME types defined:</strong> <code>text/x-eiffel</code>.</p>
427
+
428
+ <p> Created by <a href="https://github.com/ynh">YNH</a>.</p>
429
+ </article>
assets/js/vendor/codemirror/mode/elm/elm.js ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("elm", function() {
15
+
16
+ function switchState(source, setState, f) {
17
+ setState(f);
18
+ return f(source, setState);
19
+ }
20
+
21
+ // These should all be Unicode extended, as per the Haskell 2010 report
22
+ var smallRE = /[a-z_]/;
23
+ var largeRE = /[A-Z]/;
24
+ var digitRE = /[0-9]/;
25
+ var hexitRE = /[0-9A-Fa-f]/;
26
+ var octitRE = /[0-7]/;
27
+ var idRE = /[a-z_A-Z0-9\']/;
28
+ var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]/;
29
+ var specialRE = /[(),;[\]`{}]/;
30
+ var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer
31
+
32
+ function normal() {
33
+ return function (source, setState) {
34
+ if (source.eatWhile(whiteCharRE)) {
35
+ return null;
36
+ }
37
+
38
+ var ch = source.next();
39
+ if (specialRE.test(ch)) {
40
+ if (ch == '{' && source.eat('-')) {
41
+ var t = "comment";
42
+ if (source.eat('#')) t = "meta";
43
+ return switchState(source, setState, ncomment(t, 1));
44
+ }
45
+ return null;
46
+ }
47
+
48
+ if (ch == '\'') {
49
+ if (source.eat('\\'))
50
+ source.next(); // should handle other escapes here
51
+ else
52
+ source.next();
53
+
54
+ if (source.eat('\''))
55
+ return "string";
56
+ return "error";
57
+ }
58
+
59
+ if (ch == '"') {
60
+ return switchState(source, setState, stringLiteral);
61
+ }
62
+
63
+ if (largeRE.test(ch)) {
64
+ source.eatWhile(idRE);
65
+ if (source.eat('.'))
66
+ return "qualifier";
67
+ return "variable-2";
68
+ }
69
+
70
+ if (smallRE.test(ch)) {
71
+ var isDef = source.pos === 1;
72
+ source.eatWhile(idRE);
73
+ return isDef ? "variable-3" : "variable";
74
+ }
75
+
76
+ if (digitRE.test(ch)) {
77
+ if (ch == '0') {
78
+ if (source.eat(/[xX]/)) {
79
+ source.eatWhile(hexitRE); // should require at least 1
80
+ return "integer";
81
+ }
82
+ if (source.eat(/[oO]/)) {
83
+ source.eatWhile(octitRE); // should require at least 1
84
+ return "number";
85
+ }
86
+ }
87
+ source.eatWhile(digitRE);
88
+ var t = "number";
89
+ if (source.eat('.')) {
90
+ t = "number";
91
+ source.eatWhile(digitRE); // should require at least 1
92
+ }
93
+ if (source.eat(/[eE]/)) {
94
+ t = "number";
95
+ source.eat(/[-+]/);
96
+ source.eatWhile(digitRE); // should require at least 1
97
+ }
98
+ return t;
99
+ }
100
+
101
+ if (symbolRE.test(ch)) {
102
+ if (ch == '-' && source.eat(/-/)) {
103
+ source.eatWhile(/-/);
104
+ if (!source.eat(symbolRE)) {
105
+ source.skipToEnd();
106
+ return "comment";
107
+ }
108
+ }
109
+ source.eatWhile(symbolRE);
110
+ return "builtin";
111
+ }
112
+
113
+ return "error";
114
+ }
115
+ }
116
+
117
+ function ncomment(type, nest) {
118
+ if (nest == 0) {
119
+ return normal();
120
+ }
121
+ return function(source, setState) {
122
+ var currNest = nest;
123
+ while (!source.eol()) {
124
+ var ch = source.next();
125
+ if (ch == '{' && source.eat('-')) {
126
+ ++currNest;
127
+ } else if (ch == '-' && source.eat('}')) {
128
+ --currNest;
129
+ if (currNest == 0) {
130
+ setState(normal());
131
+ return type;
132
+ }
133
+ }
134
+ }
135
+ setState(ncomment(type, currNest));
136
+ return type;
137
+ }
138
+ }
139
+
140
+ function stringLiteral(source, setState) {
141
+ while (!source.eol()) {
142
+ var ch = source.next();
143
+ if (ch == '"') {
144
+ setState(normal());
145
+ return "string";
146
+ }
147
+ if (ch == '\\') {
148
+ if (source.eol() || source.eat(whiteCharRE)) {
149
+ setState(stringGap);
150
+ return "string";
151
+ }
152
+ if (!source.eat('&')) source.next(); // should handle other escapes here
153
+ }
154
+ }
155
+ setState(normal());
156
+ return "error";
157
+ }
158
+
159
+ function stringGap(source, setState) {
160
+ if (source.eat('\\')) {
161
+ return switchState(source, setState, stringLiteral);
162
+ }
163
+ source.next();
164
+ setState(normal());
165
+ return "error";
166
+ }
167
+
168
+
169
+ var wellKnownWords = (function() {
170
+ var wkw = {};
171
+
172
+ var keywords = [
173
+ "case", "of", "as",
174
+ "if", "then", "else",
175
+ "let", "in",
176
+ "infix", "infixl", "infixr",
177
+ "type", "alias",
178
+ "input", "output", "foreign", "loopback",
179
+ "module", "where", "import", "exposing",
180
+ "_", "..", "|", ":", "=", "\\", "\"", "->", "<-"
181
+ ];
182
+
183
+ for (var i = keywords.length; i--;)
184
+ wkw[keywords[i]] = "keyword";
185
+
186
+ return wkw;
187
+ })();
188
+
189
+
190
+
191
+ return {
192
+ startState: function () { return { f: normal() }; },
193
+ copyState: function (s) { return { f: s.f }; },
194
+
195
+ token: function(stream, state) {
196
+ var t = state.f(stream, function(s) { state.f = s; });
197
+ var w = stream.current();
198
+ return (wellKnownWords.hasOwnProperty(w)) ? wellKnownWords[w] : t;
199
+ }
200
+ };
201
+
202
+ });
203
+
204
+ CodeMirror.defineMIME("text/x-elm", "elm");
205
+ });
assets/js/vendor/codemirror/mode/elm/index.html ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Elm mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="elm.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Elm</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Elm mode</h2>
27
+
28
+ <div><textarea id="code" name="code">
29
+ import Color exposing (..)
30
+ import Graphics.Collage exposing (..)
31
+ import Graphics.Element exposing (..)
32
+ import Time exposing (..)
33
+
34
+ main =
35
+ Signal.map clock (every second)
36
+
37
+ clock t =
38
+ collage 400 400
39
+ [ filled lightGrey (ngon 12 110)
40
+ , outlined (solid grey) (ngon 12 110)
41
+ , hand orange 100 t
42
+ , hand charcoal 100 (t/60)
43
+ , hand charcoal 60 (t/720)
44
+ ]
45
+
46
+ hand clr len time =
47
+ let angle = degrees (90 - 6 * inSeconds time)
48
+ in
49
+ segment (0,0) (fromPolar (len,angle))
50
+ |> traced (solid clr)
51
+ </textarea></div>
52
+
53
+ <script>
54
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
55
+ lineNumbers: true,
56
+ mode: "text/x-elm"
57
+ });
58
+ </script>
59
+
60
+ <p><strong>MIME types defined:</strong> <code>text/x-elm</code>.</p>
61
+ </article>
assets/js/vendor/codemirror/mode/erlang/erlang.js ADDED
@@ -0,0 +1,618 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /*jshint unused:true, eqnull:true, curly:true, bitwise:true */
5
+ /*jshint undef:true, latedef:true, trailing:true */
6
+ /*global CodeMirror:true */
7
+
8
+ // erlang mode.
9
+ // tokenizer -> token types -> CodeMirror styles
10
+ // tokenizer maintains a parse stack
11
+ // indenter uses the parse stack
12
+
13
+ // TODO indenter:
14
+ // bit syntax
15
+ // old guard/bif/conversion clashes (e.g. "float/1")
16
+ // type/spec/opaque
17
+
18
+ (function(mod) {
19
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
20
+ mod(require("../../lib/codemirror"));
21
+ else if (typeof define == "function" && define.amd) // AMD
22
+ define(["../../lib/codemirror"], mod);
23
+ else // Plain browser env
24
+ mod(CodeMirror);
25
+ })(function(CodeMirror) {
26
+ "use strict";
27
+
28
+ CodeMirror.defineMIME("text/x-erlang", "erlang");
29
+
30
+ CodeMirror.defineMode("erlang", function(cmCfg) {
31
+ "use strict";
32
+
33
+ /////////////////////////////////////////////////////////////////////////////
34
+ // constants
35
+
36
+ var typeWords = [
37
+ "-type", "-spec", "-export_type", "-opaque"];
38
+
39
+ var keywordWords = [
40
+ "after","begin","catch","case","cond","end","fun","if",
41
+ "let","of","query","receive","try","when"];
42
+
43
+ var separatorRE = /[\->,;]/;
44
+ var separatorWords = [
45
+ "->",";",","];
46
+
47
+ var operatorAtomWords = [
48
+ "and","andalso","band","bnot","bor","bsl","bsr","bxor",
49
+ "div","not","or","orelse","rem","xor"];
50
+
51
+ var operatorSymbolRE = /[\+\-\*\/<>=\|:!]/;
52
+ var operatorSymbolWords = [
53
+ "=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"];
54
+
55
+ var openParenRE = /[<\(\[\{]/;
56
+ var openParenWords = [
57
+ "<<","(","[","{"];
58
+
59
+ var closeParenRE = /[>\)\]\}]/;
60
+ var closeParenWords = [
61
+ "}","]",")",">>"];
62
+
63
+ var guardWords = [
64
+ "is_atom","is_binary","is_bitstring","is_boolean","is_float",
65
+ "is_function","is_integer","is_list","is_number","is_pid",
66
+ "is_port","is_record","is_reference","is_tuple",
67
+ "atom","binary","bitstring","boolean","function","integer","list",
68
+ "number","pid","port","record","reference","tuple"];
69
+
70
+ var bifWords = [
71
+ "abs","adler32","adler32_combine","alive","apply","atom_to_binary",
72
+ "atom_to_list","binary_to_atom","binary_to_existing_atom",
73
+ "binary_to_list","binary_to_term","bit_size","bitstring_to_list",
74
+ "byte_size","check_process_code","contact_binary","crc32",
75
+ "crc32_combine","date","decode_packet","delete_module",
76
+ "disconnect_node","element","erase","exit","float","float_to_list",
77
+ "garbage_collect","get","get_keys","group_leader","halt","hd",
78
+ "integer_to_list","internal_bif","iolist_size","iolist_to_binary",
79
+ "is_alive","is_atom","is_binary","is_bitstring","is_boolean",
80
+ "is_float","is_function","is_integer","is_list","is_number","is_pid",
81
+ "is_port","is_process_alive","is_record","is_reference","is_tuple",
82
+ "length","link","list_to_atom","list_to_binary","list_to_bitstring",
83
+ "list_to_existing_atom","list_to_float","list_to_integer",
84
+ "list_to_pid","list_to_tuple","load_module","make_ref","module_loaded",
85
+ "monitor_node","node","node_link","node_unlink","nodes","notalive",
86
+ "now","open_port","pid_to_list","port_close","port_command",
87
+ "port_connect","port_control","pre_loaded","process_flag",
88
+ "process_info","processes","purge_module","put","register",
89
+ "registered","round","self","setelement","size","spawn","spawn_link",
90
+ "spawn_monitor","spawn_opt","split_binary","statistics",
91
+ "term_to_binary","time","throw","tl","trunc","tuple_size",
92
+ "tuple_to_list","unlink","unregister","whereis"];
93
+
94
+ // upper case: [A-Z] [Ø-Þ] [À-Ö]
95
+ // lower case: [a-z] [ß-ö] [ø-ÿ]
96
+ var anumRE = /[\w@Ø-ÞÀ-Öß-öø-ÿ]/;
97
+ var escapesRE =
98
+ /[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;
99
+
100
+ /////////////////////////////////////////////////////////////////////////////
101
+ // tokenizer
102
+
103
+ function tokenizer(stream,state) {
104
+ // in multi-line string
105
+ if (state.in_string) {
106
+ state.in_string = (!doubleQuote(stream));
107
+ return rval(state,stream,"string");
108
+ }
109
+
110
+ // in multi-line atom
111
+ if (state.in_atom) {
112
+ state.in_atom = (!singleQuote(stream));
113
+ return rval(state,stream,"atom");
114
+ }
115
+
116
+ // whitespace
117
+ if (stream.eatSpace()) {
118
+ return rval(state,stream,"whitespace");
119
+ }
120
+
121
+ // attributes and type specs
122
+ if (!peekToken(state) &&
123
+ stream.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)) {
124
+ if (is_member(stream.current(),typeWords)) {
125
+ return rval(state,stream,"type");
126
+ }else{
127
+ return rval(state,stream,"attribute");
128
+ }
129
+ }
130
+
131
+ var ch = stream.next();
132
+
133
+ // comment
134
+ if (ch == '%') {
135
+ stream.skipToEnd();
136
+ return rval(state,stream,"comment");
137
+ }
138
+
139
+ // colon
140
+ if (ch == ":") {
141
+ return rval(state,stream,"colon");
142
+ }
143
+
144
+ // macro
145
+ if (ch == '?') {
146
+ stream.eatSpace();
147
+ stream.eatWhile(anumRE);
148
+ return rval(state,stream,"macro");
149
+ }
150
+
151
+ // record
152
+ if (ch == "#") {
153
+ stream.eatSpace();
154
+ stream.eatWhile(anumRE);
155
+ return rval(state,stream,"record");
156
+ }
157
+
158
+ // dollar escape
159
+ if (ch == "$") {
160
+ if (stream.next() == "\\" && !stream.match(escapesRE)) {
161
+ return rval(state,stream,"error");
162
+ }
163
+ return rval(state,stream,"number");
164
+ }
165
+
166
+ // dot
167
+ if (ch == ".") {
168
+ return rval(state,stream,"dot");
169
+ }
170
+
171
+ // quoted atom
172
+ if (ch == '\'') {
173
+ if (!(state.in_atom = (!singleQuote(stream)))) {
174
+ if (stream.match(/\s*\/\s*[0-9]/,false)) {
175
+ stream.match(/\s*\/\s*[0-9]/,true);
176
+ return rval(state,stream,"fun"); // 'f'/0 style fun
177
+ }
178
+ if (stream.match(/\s*\(/,false) || stream.match(/\s*:/,false)) {
179
+ return rval(state,stream,"function");
180
+ }
181
+ }
182
+ return rval(state,stream,"atom");
183
+ }
184
+
185
+ // string
186
+ if (ch == '"') {
187
+ state.in_string = (!doubleQuote(stream));
188
+ return rval(state,stream,"string");
189
+ }
190
+
191
+ // variable
192
+ if (/[A-Z_Ø-ÞÀ-Ö]/.test(ch)) {
193
+ stream.eatWhile(anumRE);
194
+ return rval(state,stream,"variable");
195
+ }
196
+
197
+ // atom/keyword/BIF/function
198
+ if (/[a-z_ß-öø-ÿ]/.test(ch)) {
199
+ stream.eatWhile(anumRE);
200
+
201
+ if (stream.match(/\s*\/\s*[0-9]/,false)) {
202
+ stream.match(/\s*\/\s*[0-9]/,true);
203
+ return rval(state,stream,"fun"); // f/0 style fun
204
+ }
205
+
206
+ var w = stream.current();
207
+
208
+ if (is_member(w,keywordWords)) {
209
+ return rval(state,stream,"keyword");
210
+ }else if (is_member(w,operatorAtomWords)) {
211
+ return rval(state,stream,"operator");
212
+ }else if (stream.match(/\s*\(/,false)) {
213
+ // 'put' and 'erlang:put' are bifs, 'foo:put' is not
214
+ if (is_member(w,bifWords) &&
215
+ ((peekToken(state).token != ":") ||
216
+ (peekToken(state,2).token == "erlang"))) {
217
+ return rval(state,stream,"builtin");
218
+ }else if (is_member(w,guardWords)) {
219
+ return rval(state,stream,"guard");
220
+ }else{
221
+ return rval(state,stream,"function");
222
+ }
223
+ }else if (lookahead(stream) == ":") {
224
+ if (w == "erlang") {
225
+ return rval(state,stream,"builtin");
226
+ } else {
227
+ return rval(state,stream,"function");
228
+ }
229
+ }else if (is_member(w,["true","false"])) {
230
+ return rval(state,stream,"boolean");
231
+ }else{
232
+ return rval(state,stream,"atom");
233
+ }
234
+ }
235
+
236
+ // number
237
+ var digitRE = /[0-9]/;
238
+ var radixRE = /[0-9a-zA-Z]/; // 36#zZ style int
239
+ if (digitRE.test(ch)) {
240
+ stream.eatWhile(digitRE);
241
+ if (stream.eat('#')) { // 36#aZ style integer
242
+ if (!stream.eatWhile(radixRE)) {
243
+ stream.backUp(1); //"36#" - syntax error
244
+ }
245
+ } else if (stream.eat('.')) { // float
246
+ if (!stream.eatWhile(digitRE)) {
247
+ stream.backUp(1); // "3." - probably end of function
248
+ } else {
249
+ if (stream.eat(/[eE]/)) { // float with exponent
250
+ if (stream.eat(/[-+]/)) {
251
+ if (!stream.eatWhile(digitRE)) {
252
+ stream.backUp(2); // "2e-" - syntax error
253
+ }
254
+ } else {
255
+ if (!stream.eatWhile(digitRE)) {
256
+ stream.backUp(1); // "2e" - syntax error
257
+ }
258
+ }
259
+ }
260
+ }
261
+ }
262
+ return rval(state,stream,"number"); // normal integer
263
+ }
264
+
265
+ // open parens
266
+ if (nongreedy(stream,openParenRE,openParenWords)) {
267
+ return rval(state,stream,"open_paren");
268
+ }
269
+
270
+ // close parens
271
+ if (nongreedy(stream,closeParenRE,closeParenWords)) {
272
+ return rval(state,stream,"close_paren");
273
+ }
274
+
275
+ // separators
276
+ if (greedy(stream,separatorRE,separatorWords)) {
277
+ return rval(state,stream,"separator");
278
+ }
279
+
280
+ // operators
281
+ if (greedy(stream,operatorSymbolRE,operatorSymbolWords)) {
282
+ return rval(state,stream,"operator");
283
+ }
284
+
285
+ return rval(state,stream,null);
286
+ }
287
+
288
+ /////////////////////////////////////////////////////////////////////////////
289
+ // utilities
290
+ function nongreedy(stream,re,words) {
291
+ if (stream.current().length == 1 && re.test(stream.current())) {
292
+ stream.backUp(1);
293
+ while (re.test(stream.peek())) {
294
+ stream.next();
295
+ if (is_member(stream.current(),words)) {
296
+ return true;
297
+ }
298
+ }
299
+ stream.backUp(stream.current().length-1);
300
+ }
301
+ return false;
302
+ }
303
+
304
+ function greedy(stream,re,words) {
305
+ if (stream.current().length == 1 && re.test(stream.current())) {
306
+ while (re.test(stream.peek())) {
307
+ stream.next();
308
+ }
309
+ while (0 < stream.current().length) {
310
+ if (is_member(stream.current(),words)) {
311
+ return true;
312
+ }else{
313
+ stream.backUp(1);
314
+ }
315
+ }
316
+ stream.next();
317
+ }
318
+ return false;
319
+ }
320
+
321
+ function doubleQuote(stream) {
322
+ return quote(stream, '"', '\\');
323
+ }
324
+
325
+ function singleQuote(stream) {
326
+ return quote(stream,'\'','\\');
327
+ }
328
+
329
+ function quote(stream,quoteChar,escapeChar) {
330
+ while (!stream.eol()) {
331
+ var ch = stream.next();
332
+ if (ch == quoteChar) {
333
+ return true;
334
+ }else if (ch == escapeChar) {
335
+ stream.next();
336
+ }
337
+ }
338
+ return false;
339
+ }
340
+
341
+ function lookahead(stream) {
342
+ var m = stream.match(/([\n\s]+|%[^\n]*\n)*(.)/,false);
343
+ return m ? m.pop() : "";
344
+ }
345
+
346
+ function is_member(element,list) {
347
+ return (-1 < list.indexOf(element));
348
+ }
349
+
350
+ function rval(state,stream,type) {
351
+
352
+ // parse stack
353
+ pushToken(state,realToken(type,stream));
354
+
355
+ // map erlang token type to CodeMirror style class
356
+ // erlang -> CodeMirror tag
357
+ switch (type) {
358
+ case "atom": return "atom";
359
+ case "attribute": return "attribute";
360
+ case "boolean": return "atom";
361
+ case "builtin": return "builtin";
362
+ case "close_paren": return null;
363
+ case "colon": return null;
364
+ case "comment": return "comment";
365
+ case "dot": return null;
366
+ case "error": return "error";
367
+ case "fun": return "meta";
368
+ case "function": return "tag";
369
+ case "guard": return "property";
370
+ case "keyword": return "keyword";
371
+ case "macro": return "variable-2";
372
+ case "number": return "number";
373
+ case "open_paren": return null;
374
+ case "operator": return "operator";
375
+ case "record": return "bracket";
376
+ case "separator": return null;
377
+ case "string": return "string";
378
+ case "type": return "def";
379
+ case "variable": return "variable";
380
+ default: return null;
381
+ }
382
+ }
383
+
384
+ function aToken(tok,col,ind,typ) {
385
+ return {token: tok,
386
+ column: col,
387
+ indent: ind,
388
+ type: typ};
389
+ }
390
+
391
+ function realToken(type,stream) {
392
+ return aToken(stream.current(),
393
+ stream.column(),
394
+ stream.indentation(),
395
+ type);
396
+ }
397
+
398
+ function fakeToken(type) {
399
+ return aToken(type,0,0,type);
400
+ }
401
+
402
+ function peekToken(state,depth) {
403
+ var len = state.tokenStack.length;
404
+ var dep = (depth ? depth : 1);
405
+
406
+ if (len < dep) {
407
+ return false;
408
+ }else{
409
+ return state.tokenStack[len-dep];
410
+ }
411
+ }
412
+
413
+ function pushToken(state,token) {
414
+
415
+ if (!(token.type == "comment" || token.type == "whitespace")) {
416
+ state.tokenStack = maybe_drop_pre(state.tokenStack,token);
417
+ state.tokenStack = maybe_drop_post(state.tokenStack);
418
+ }
419
+ }
420
+
421
+ function maybe_drop_pre(s,token) {
422
+ var last = s.length-1;
423
+
424
+ if (0 < last && s[last].type === "record" && token.type === "dot") {
425
+ s.pop();
426
+ }else if (0 < last && s[last].type === "group") {
427
+ s.pop();
428
+ s.push(token);
429
+ }else{
430
+ s.push(token);
431
+ }
432
+ return s;
433
+ }
434
+
435
+ function maybe_drop_post(s) {
436
+ var last = s.length-1;
437
+
438
+ if (s[last].type === "dot") {
439
+ return [];
440
+ }
441
+ if (s[last].type === "fun" && s[last-1].token === "fun") {
442
+ return s.slice(0,last-1);
443
+ }
444
+ switch (s[s.length-1].token) {
445
+ case "}": return d(s,{g:["{"]});
446
+ case "]": return d(s,{i:["["]});
447
+ case ")": return d(s,{i:["("]});
448
+ case ">>": return d(s,{i:["<<"]});
449
+ case "end": return d(s,{i:["begin","case","fun","if","receive","try"]});
450
+ case ",": return d(s,{e:["begin","try","when","->",
451
+ ",","(","[","{","<<"]});
452
+ case "->": return d(s,{r:["when"],
453
+ m:["try","if","case","receive"]});
454
+ case ";": return d(s,{E:["case","fun","if","receive","try","when"]});
455
+ case "catch":return d(s,{e:["try"]});
456
+ case "of": return d(s,{e:["case"]});
457
+ case "after":return d(s,{e:["receive","try"]});
458
+ default: return s;
459
+ }
460
+ }
461
+
462
+ function d(stack,tt) {
463
+ // stack is a stack of Token objects.
464
+ // tt is an object; {type:tokens}
465
+ // type is a char, tokens is a list of token strings.
466
+ // The function returns (possibly truncated) stack.
467
+ // It will descend the stack, looking for a Token such that Token.token
468
+ // is a member of tokens. If it does not find that, it will normally (but
469
+ // see "E" below) return stack. If it does find a match, it will remove
470
+ // all the Tokens between the top and the matched Token.
471
+ // If type is "m", that is all it does.
472
+ // If type is "i", it will also remove the matched Token and the top Token.
473
+ // If type is "g", like "i", but add a fake "group" token at the top.
474
+ // If type is "r", it will remove the matched Token, but not the top Token.
475
+ // If type is "e", it will keep the matched Token but not the top Token.
476
+ // If type is "E", it behaves as for type "e", except if there is no match,
477
+ // in which case it will return an empty stack.
478
+
479
+ for (var type in tt) {
480
+ var len = stack.length-1;
481
+ var tokens = tt[type];
482
+ for (var i = len-1; -1 < i ; i--) {
483
+ if (is_member(stack[i].token,tokens)) {
484
+ var ss = stack.slice(0,i);
485
+ switch (type) {
486
+ case "m": return ss.concat(stack[i]).concat(stack[len]);
487
+ case "r": return ss.concat(stack[len]);
488
+ case "i": return ss;
489
+ case "g": return ss.concat(fakeToken("group"));
490
+ case "E": return ss.concat(stack[i]);
491
+ case "e": return ss.concat(stack[i]);
492
+ }
493
+ }
494
+ }
495
+ }
496
+ return (type == "E" ? [] : stack);
497
+ }
498
+
499
+ /////////////////////////////////////////////////////////////////////////////
500
+ // indenter
501
+
502
+ function indenter(state,textAfter) {
503
+ var t;
504
+ var unit = cmCfg.indentUnit;
505
+ var wordAfter = wordafter(textAfter);
506
+ var currT = peekToken(state,1);
507
+ var prevT = peekToken(state,2);
508
+
509
+ if (state.in_string || state.in_atom) {
510
+ return CodeMirror.Pass;
511
+ }else if (!prevT) {
512
+ return 0;
513
+ }else if (currT.token == "when") {
514
+ return currT.column+unit;
515
+ }else if (wordAfter === "when" && prevT.type === "function") {
516
+ return prevT.indent+unit;
517
+ }else if (wordAfter === "(" && currT.token === "fun") {
518
+ return currT.column+3;
519
+ }else if (wordAfter === "catch" && (t = getToken(state,["try"]))) {
520
+ return t.column;
521
+ }else if (is_member(wordAfter,["end","after","of"])) {
522
+ t = getToken(state,["begin","case","fun","if","receive","try"]);
523
+ return t ? t.column : CodeMirror.Pass;
524
+ }else if (is_member(wordAfter,closeParenWords)) {
525
+ t = getToken(state,openParenWords);
526
+ return t ? t.column : CodeMirror.Pass;
527
+ }else if (is_member(currT.token,[",","|","||"]) ||
528
+ is_member(wordAfter,[",","|","||"])) {
529
+ t = postcommaToken(state);
530
+ return t ? t.column+t.token.length : unit;
531
+ }else if (currT.token == "->") {
532
+ if (is_member(prevT.token, ["receive","case","if","try"])) {
533
+ return prevT.column+unit+unit;
534
+ }else{
535
+ return prevT.column+unit;
536
+ }
537
+ }else if (is_member(currT.token,openParenWords)) {
538
+ return currT.column+currT.token.length;
539
+ }else{
540
+ t = defaultToken(state);
541
+ return truthy(t) ? t.column+unit : 0;
542
+ }
543
+ }
544
+
545
+ function wordafter(str) {
546
+ var m = str.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);
547
+
548
+ return truthy(m) && (m.index === 0) ? m[0] : "";
549
+ }
550
+
551
+ function postcommaToken(state) {
552
+ var objs = state.tokenStack.slice(0,-1);
553
+ var i = getTokenIndex(objs,"type",["open_paren"]);
554
+
555
+ return truthy(objs[i]) ? objs[i] : false;
556
+ }
557
+
558
+ function defaultToken(state) {
559
+ var objs = state.tokenStack;
560
+ var stop = getTokenIndex(objs,"type",["open_paren","separator","keyword"]);
561
+ var oper = getTokenIndex(objs,"type",["operator"]);
562
+
563
+ if (truthy(stop) && truthy(oper) && stop < oper) {
564
+ return objs[stop+1];
565
+ } else if (truthy(stop)) {
566
+ return objs[stop];
567
+ } else {
568
+ return false;
569
+ }
570
+ }
571
+
572
+ function getToken(state,tokens) {
573
+ var objs = state.tokenStack;
574
+ var i = getTokenIndex(objs,"token",tokens);
575
+
576
+ return truthy(objs[i]) ? objs[i] : false;
577
+ }
578
+
579
+ function getTokenIndex(objs,propname,propvals) {
580
+
581
+ for (var i = objs.length-1; -1 < i ; i--) {
582
+ if (is_member(objs[i][propname],propvals)) {
583
+ return i;
584
+ }
585
+ }
586
+ return false;
587
+ }
588
+
589
+ function truthy(x) {
590
+ return (x !== false) && (x != null);
591
+ }
592
+
593
+ /////////////////////////////////////////////////////////////////////////////
594
+ // this object defines the mode
595
+
596
+ return {
597
+ startState:
598
+ function() {
599
+ return {tokenStack: [],
600
+ in_string: false,
601
+ in_atom: false};
602
+ },
603
+
604
+ token:
605
+ function(stream, state) {
606
+ return tokenizer(stream, state);
607
+ },
608
+
609
+ indent:
610
+ function(state, textAfter) {
611
+ return indenter(state,textAfter);
612
+ },
613
+
614
+ lineComment: "%"
615
+ };
616
+ });
617
+
618
+ });
assets/js/vendor/codemirror/mode/erlang/index.html ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Erlang mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/erlang-dark.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="../../addon/edit/matchbrackets.js"></script>
11
+ <script src="erlang.js"></script>
12
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
13
+ <div id=nav>
14
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
15
+
16
+ <ul>
17
+ <li><a href="../../index.html">Home</a>
18
+ <li><a href="../../doc/manual.html">Manual</a>
19
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
20
+ </ul>
21
+ <ul>
22
+ <li><a href="../index.html">Language modes</a>
23
+ <li><a class=active href="#">Erlang</a>
24
+ </ul>
25
+ </div>
26
+
27
+ <article>
28
+ <h2>Erlang mode</h2>
29
+ <form><textarea id="code" name="code">
30
+ %% -*- mode: erlang; erlang-indent-level: 2 -*-
31
+ %%% Created : 7 May 2012 by mats cronqvist <masse@klarna.com>
32
+
33
+ %% @doc
34
+ %% Demonstrates how to print a record.
35
+ %% @end
36
+
37
+ -module('ex').
38
+ -author('mats cronqvist').
39
+ -export([demo/0,
40
+ rec_info/1]).
41
+
42
+ -record(demo,{a="One",b="Two",c="Three",d="Four"}).
43
+
44
+ rec_info(demo) -> record_info(fields,demo).
45
+
46
+ demo() -> expand_recs(?MODULE,#demo{a="A",b="BB"}).
47
+
48
+ expand_recs(M,List) when is_list(List) ->
49
+ [expand_recs(M,L)||L<-List];
50
+ expand_recs(M,Tup) when is_tuple(Tup) ->
51
+ case tuple_size(Tup) of
52
+ L when L < 1 -> Tup;
53
+ L ->
54
+ try
55
+ Fields = M:rec_info(element(1,Tup)),
56
+ L = length(Fields)+1,
57
+ lists:zip(Fields,expand_recs(M,tl(tuple_to_list(Tup))))
58
+ catch
59
+ _:_ -> list_to_tuple(expand_recs(M,tuple_to_list(Tup)))
60
+ end
61
+ end;
62
+ expand_recs(_,Term) ->
63
+ Term.
64
+ </textarea></form>
65
+
66
+ <script>
67
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
68
+ lineNumbers: true,
69
+ matchBrackets: true,
70
+ extraKeys: {"Tab": "indentAuto"},
71
+ theme: "erlang-dark"
72
+ });
73
+ </script>
74
+
75
+ <p><strong>MIME types defined:</strong> <code>text/x-erlang</code>.</p>
76
+ </article>
assets/js/vendor/codemirror/mode/factor/factor.js ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // Factor syntax highlight - simple mode
5
+ //
6
+ // by Dimage Sapelkin (https://github.com/kerabromsmu)
7
+
8
+ (function(mod) {
9
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
10
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
11
+ else if (typeof define == "function" && define.amd) // AMD
12
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
13
+ else // Plain browser env
14
+ mod(CodeMirror);
15
+ })(function(CodeMirror) {
16
+ "use strict";
17
+
18
+ CodeMirror.defineSimpleMode("factor", {
19
+ // The start state contains the rules that are intially used
20
+ start: [
21
+ // comments
22
+ {regex: /#?!.*/, token: "comment"},
23
+ // strings """, multiline --> state
24
+ {regex: /"""/, token: "string", next: "string3"},
25
+ {regex: /"/, token: "string", next: "string"},
26
+ // numbers: dec, hex, unicode, bin, fractional, complex
27
+ {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
28
+ //{regex: /[+-]?/} //fractional
29
+ // definition: defining word, defined word, etc
30
+ {regex: /(\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "keyword"], next: "stack"},
31
+ // vocabulary using --> state
32
+ {regex: /USING\:/, token: "keyword", next: "vocabulary"},
33
+ // vocabulary definition/use
34
+ {regex: /(USE\:|IN\:)(\s+)(\S+)/, token: ["keyword", null, "variable-2"]},
35
+ // <constructors>
36
+ {regex: /<\S+>/, token: "builtin"},
37
+ // "keywords", incl. ; t f . [ ] { } defining words
38
+ {regex: /;|t|f|if|\.|\[|\]|\{|\}|MAIN:/, token: "keyword"},
39
+ // any id (?)
40
+ {regex: /\S+/, token: "variable"},
41
+
42
+ {
43
+ regex: /./,
44
+ token: null
45
+ }
46
+ ],
47
+ vocabulary: [
48
+ {regex: /;/, token: "keyword", next: "start"},
49
+ {regex: /\S+/, token: "variable-2"},
50
+ {
51
+ regex: /./,
52
+ token: null
53
+ }
54
+ ],
55
+ string: [
56
+ {regex: /(?:[^\\]|\\.)*?"/, token: "string", next: "start"},
57
+ {regex: /.*/, token: "string"}
58
+ ],
59
+ string3: [
60
+ {regex: /(?:[^\\]|\\.)*?"""/, token: "string", next: "start"},
61
+ {regex: /.*/, token: "string"}
62
+ ],
63
+ stack: [
64
+ {regex: /\)/, token: "meta", next: "start"},
65
+ {regex: /--/, token: "meta"},
66
+ {regex: /\S+/, token: "variable-3"},
67
+ {
68
+ regex: /./,
69
+ token: null
70
+ }
71
+ ],
72
+ // The meta property contains global information about the mode. It
73
+ // can contain properties like lineComment, which are supported by
74
+ // all modes, and also directives like dontIndentStates, which are
75
+ // specific to simple modes.
76
+ meta: {
77
+ dontIndentStates: ["start", "vocabulary", "string", "string3", "stack"],
78
+ lineComment: [ "!", "#!" ]
79
+ }
80
+ });
81
+
82
+ CodeMirror.defineMIME("text/x-factor", "factor");
83
+ });
assets/js/vendor/codemirror/mode/factor/index.html ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Factor mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
8
+ <link rel="stylesheet" href="../../lib/codemirror.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="../../addon/mode/simple.js"></script>
11
+ <script src="factor.js"></script>
12
+ <style>
13
+ .CodeMirror {
14
+ font-family: 'Droid Sans Mono', monospace;
15
+ font-size: 14px;
16
+ }
17
+ </style>
18
+ <div id=nav>
19
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
20
+
21
+ <ul>
22
+ <li><a href="../../index.html">Home</a>
23
+ <li><a href="../../doc/manual.html">Manual</a>
24
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
25
+ </ul>
26
+ <ul>
27
+ <li><a href="../index.html">Language modes</a>
28
+ <li><a class=active href="#">Factor</a>
29
+ </ul>
30
+ </div>
31
+
32
+ <article>
33
+
34
+ <h2>Factor mode</h2>
35
+
36
+ <form><textarea id="code" name="code">
37
+ ! Copyright (C) 2008 Slava Pestov.
38
+ ! See http://factorcode.org/license.txt for BSD license.
39
+
40
+ ! A simple time server
41
+
42
+ USING: accessors calendar calendar.format io io.encodings.ascii
43
+ io.servers kernel threads ;
44
+ IN: time-server
45
+
46
+ : handle-time-client ( -- )
47
+ now timestamp>rfc822 print ;
48
+
49
+ : <time-server> ( -- threaded-server )
50
+ ascii <threaded-server>
51
+ "time-server" >>name
52
+ 1234 >>insecure
53
+ [ handle-time-client ] >>handler ;
54
+
55
+ : start-time-server ( -- )
56
+ <time-server> start-server drop ;
57
+
58
+ MAIN: start-time-server
59
+ </textarea>
60
+ </form>
61
+
62
+ <script>
63
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
64
+ lineNumbers: true,
65
+ lineWrapping: true,
66
+ indentUnit: 2,
67
+ tabSize: 2,
68
+ autofocus: true,
69
+ mode: "text/x-factor"
70
+ });
71
+ </script>
72
+ <p/>
73
+ <p>Simple mode that handles Factor Syntax (<a href="http://en.wikipedia.org/wiki/Factor_(programming_language)">Factor on WikiPedia</a>).</p>
74
+
75
+ <p><strong>MIME types defined:</strong> <code>text/x-factor</code>.</p>
76
+
77
+ </article>
assets/js/vendor/codemirror/mode/forth/forth.js ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // Author: Aliaksei Chapyzhenka
5
+
6
+ (function(mod) {
7
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
8
+ mod(require("../../lib/codemirror"));
9
+ else if (typeof define == "function" && define.amd) // AMD
10
+ define(["../../lib/codemirror"], mod);
11
+ else // Plain browser env
12
+ mod(CodeMirror);
13
+ })(function(CodeMirror) {
14
+ "use strict";
15
+
16
+ function toWordList(words) {
17
+ var ret = [];
18
+ words.split(' ').forEach(function(e){
19
+ ret.push({name: e});
20
+ });
21
+ return ret;
22
+ }
23
+
24
+ var coreWordList = toWordList(
25
+ 'INVERT AND OR XOR\
26
+ 2* 2/ LSHIFT RSHIFT\
27
+ 0= = 0< < > U< MIN MAX\
28
+ 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP\
29
+ >R R> R@\
30
+ + - 1+ 1- ABS NEGATE\
31
+ S>D * M* UM*\
32
+ FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD\
33
+ HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2!\
34
+ ALIGN ALIGNED +! ALLOT\
35
+ CHAR [CHAR] [ ] BL\
36
+ FIND EXECUTE IMMEDIATE COUNT LITERAL STATE\
37
+ ; DOES> >BODY\
38
+ EVALUATE\
39
+ SOURCE >IN\
40
+ <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL\
41
+ FILL MOVE\
42
+ . CR EMIT SPACE SPACES TYPE U. .R U.R\
43
+ ACCEPT\
44
+ TRUE FALSE\
45
+ <> U> 0<> 0>\
46
+ NIP TUCK ROLL PICK\
47
+ 2>R 2R@ 2R>\
48
+ WITHIN UNUSED MARKER\
49
+ I J\
50
+ TO\
51
+ COMPILE, [COMPILE]\
52
+ SAVE-INPUT RESTORE-INPUT\
53
+ PAD ERASE\
54
+ 2LITERAL DNEGATE\
55
+ D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS\
56
+ M+ M*/ D. D.R 2ROT DU<\
57
+ CATCH THROW\
58
+ FREE RESIZE ALLOCATE\
59
+ CS-PICK CS-ROLL\
60
+ GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER\
61
+ PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER\
62
+ -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL');
63
+
64
+ var immediateWordList = toWordList('IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE');
65
+
66
+ CodeMirror.defineMode('forth', function() {
67
+ function searchWordList (wordList, word) {
68
+ var i;
69
+ for (i = wordList.length - 1; i >= 0; i--) {
70
+ if (wordList[i].name === word.toUpperCase()) {
71
+ return wordList[i];
72
+ }
73
+ }
74
+ return undefined;
75
+ }
76
+ return {
77
+ startState: function() {
78
+ return {
79
+ state: '',
80
+ base: 10,
81
+ coreWordList: coreWordList,
82
+ immediateWordList: immediateWordList,
83
+ wordList: []
84
+ };
85
+ },
86
+ token: function (stream, stt) {
87
+ var mat;
88
+ if (stream.eatSpace()) {
89
+ return null;
90
+ }
91
+ if (stt.state === '') { // interpretation
92
+ if (stream.match(/^(\]|:NONAME)(\s|$)/i)) {
93
+ stt.state = ' compilation';
94
+ return 'builtin compilation';
95
+ }
96
+ mat = stream.match(/^(\:)\s+(\S+)(\s|$)+/);
97
+ if (mat) {
98
+ stt.wordList.push({name: mat[2].toUpperCase()});
99
+ stt.state = ' compilation';
100
+ return 'def' + stt.state;
101
+ }
102
+ mat = stream.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i);
103
+ if (mat) {
104
+ stt.wordList.push({name: mat[2].toUpperCase()});
105
+ return 'def' + stt.state;
106
+ }
107
+ mat = stream.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/);
108
+ if (mat) {
109
+ return 'builtin' + stt.state;
110
+ }
111
+ } else { // compilation
112
+ // ; [
113
+ if (stream.match(/^(\;|\[)(\s)/)) {
114
+ stt.state = '';
115
+ stream.backUp(1);
116
+ return 'builtin compilation';
117
+ }
118
+ if (stream.match(/^(\;|\[)($)/)) {
119
+ stt.state = '';
120
+ return 'builtin compilation';
121
+ }
122
+ if (stream.match(/^(POSTPONE)\s+\S+(\s|$)+/)) {
123
+ return 'builtin';
124
+ }
125
+ }
126
+
127
+ // dynamic wordlist
128
+ mat = stream.match(/^(\S+)(\s+|$)/);
129
+ if (mat) {
130
+ if (searchWordList(stt.wordList, mat[1]) !== undefined) {
131
+ return 'variable' + stt.state;
132
+ }
133
+
134
+ // comments
135
+ if (mat[1] === '\\') {
136
+ stream.skipToEnd();
137
+ return 'comment' + stt.state;
138
+ }
139
+
140
+ // core words
141
+ if (searchWordList(stt.coreWordList, mat[1]) !== undefined) {
142
+ return 'builtin' + stt.state;
143
+ }
144
+ if (searchWordList(stt.immediateWordList, mat[1]) !== undefined) {
145
+ return 'keyword' + stt.state;
146
+ }
147
+
148
+ if (mat[1] === '(') {
149
+ stream.eatWhile(function (s) { return s !== ')'; });
150
+ stream.eat(')');
151
+ return 'comment' + stt.state;
152
+ }
153
+
154
+ // // strings
155
+ if (mat[1] === '.(') {
156
+ stream.eatWhile(function (s) { return s !== ')'; });
157
+ stream.eat(')');
158
+ return 'string' + stt.state;
159
+ }
160
+ if (mat[1] === 'S"' || mat[1] === '."' || mat[1] === 'C"') {
161
+ stream.eatWhile(function (s) { return s !== '"'; });
162
+ stream.eat('"');
163
+ return 'string' + stt.state;
164
+ }
165
+
166
+ // numbers
167
+ if (mat[1] - 0xfffffffff) {
168
+ return 'number' + stt.state;
169
+ }
170
+ // if (mat[1].match(/^[-+]?[0-9]+\.[0-9]*/)) {
171
+ // return 'number' + stt.state;
172
+ // }
173
+
174
+ return 'atom' + stt.state;
175
+ }
176
+ }
177
+ };
178
+ });
179
+ CodeMirror.defineMIME("text/x-forth", "forth");
180
+ });
assets/js/vendor/codemirror/mode/forth/index.html ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Forth mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
8
+ <link rel="stylesheet" href="../../lib/codemirror.css">
9
+ <link rel=stylesheet href="../../theme/colorforth.css">
10
+ <script src="../../lib/codemirror.js"></script>
11
+ <script src="forth.js"></script>
12
+ <style>
13
+ .CodeMirror {
14
+ font-family: 'Droid Sans Mono', monospace;
15
+ font-size: 14px;
16
+ }
17
+ </style>
18
+ <div id=nav>
19
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
20
+
21
+ <ul>
22
+ <li><a href="../../index.html">Home</a>
23
+ <li><a href="../../doc/manual.html">Manual</a>
24
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
25
+ </ul>
26
+ <ul>
27
+ <li><a href="../index.html">Language modes</a>
28
+ <li><a class=active href="#">Forth</a>
29
+ </ul>
30
+ </div>
31
+
32
+ <article>
33
+
34
+ <h2>Forth mode</h2>
35
+
36
+ <form><textarea id="code" name="code">
37
+ \ Insertion sort
38
+
39
+ : cell- 1 cells - ;
40
+
41
+ : insert ( start end -- start )
42
+ dup @ >r ( r: v )
43
+ begin
44
+ 2dup <
45
+ while
46
+ r@ over cell- @ <
47
+ while
48
+ cell-
49
+ dup @ over cell+ !
50
+ repeat then
51
+ r> swap ! ;
52
+
53
+ : sort ( array len -- )
54
+ 1 ?do
55
+ dup i cells + insert
56
+ loop drop ;</textarea>
57
+ </form>
58
+
59
+ <script>
60
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
61
+ lineNumbers: true,
62
+ lineWrapping: true,
63
+ indentUnit: 2,
64
+ tabSize: 2,
65
+ autofocus: true,
66
+ theme: "colorforth",
67
+ mode: "text/x-forth"
68
+ });
69
+ </script>
70
+
71
+ <p>Simple mode that handle Forth-Syntax (<a href="http://en.wikipedia.org/wiki/Forth_%28programming_language%29">Forth on WikiPedia</a>).</p>
72
+
73
+ <p><strong>MIME types defined:</strong> <code>text/x-forth</code>.</p>
74
+
75
+ </article>
assets/js/vendor/codemirror/mode/fortran/fortran.js ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("fortran", function() {
15
+ function words(array) {
16
+ var keys = {};
17
+ for (var i = 0; i < array.length; ++i) {
18
+ keys[array[i]] = true;
19
+ }
20
+ return keys;
21
+ }
22
+
23
+ var keywords = words([
24
+ "abstract", "accept", "allocatable", "allocate",
25
+ "array", "assign", "asynchronous", "backspace",
26
+ "bind", "block", "byte", "call", "case",
27
+ "class", "close", "common", "contains",
28
+ "continue", "cycle", "data", "deallocate",
29
+ "decode", "deferred", "dimension", "do",
30
+ "elemental", "else", "encode", "end",
31
+ "endif", "entry", "enumerator", "equivalence",
32
+ "exit", "external", "extrinsic", "final",
33
+ "forall", "format", "function", "generic",
34
+ "go", "goto", "if", "implicit", "import", "include",
35
+ "inquire", "intent", "interface", "intrinsic",
36
+ "module", "namelist", "non_intrinsic",
37
+ "non_overridable", "none", "nopass",
38
+ "nullify", "open", "optional", "options",
39
+ "parameter", "pass", "pause", "pointer",
40
+ "print", "private", "program", "protected",
41
+ "public", "pure", "read", "recursive", "result",
42
+ "return", "rewind", "save", "select", "sequence",
43
+ "stop", "subroutine", "target", "then", "to", "type",
44
+ "use", "value", "volatile", "where", "while",
45
+ "write"]);
46
+ var builtins = words(["abort", "abs", "access", "achar", "acos",
47
+ "adjustl", "adjustr", "aimag", "aint", "alarm",
48
+ "all", "allocated", "alog", "amax", "amin",
49
+ "amod", "and", "anint", "any", "asin",
50
+ "associated", "atan", "besj", "besjn", "besy",
51
+ "besyn", "bit_size", "btest", "cabs", "ccos",
52
+ "ceiling", "cexp", "char", "chdir", "chmod",
53
+ "clog", "cmplx", "command_argument_count",
54
+ "complex", "conjg", "cos", "cosh", "count",
55
+ "cpu_time", "cshift", "csin", "csqrt", "ctime",
56
+ "c_funloc", "c_loc", "c_associated", "c_null_ptr",
57
+ "c_null_funptr", "c_f_pointer", "c_null_char",
58
+ "c_alert", "c_backspace", "c_form_feed",
59
+ "c_new_line", "c_carriage_return",
60
+ "c_horizontal_tab", "c_vertical_tab", "dabs",
61
+ "dacos", "dasin", "datan", "date_and_time",
62
+ "dbesj", "dbesj", "dbesjn", "dbesy", "dbesy",
63
+ "dbesyn", "dble", "dcos", "dcosh", "ddim", "derf",
64
+ "derfc", "dexp", "digits", "dim", "dint", "dlog",
65
+ "dlog", "dmax", "dmin", "dmod", "dnint",
66
+ "dot_product", "dprod", "dsign", "dsinh",
67
+ "dsin", "dsqrt", "dtanh", "dtan", "dtime",
68
+ "eoshift", "epsilon", "erf", "erfc", "etime",
69
+ "exit", "exp", "exponent", "extends_type_of",
70
+ "fdate", "fget", "fgetc", "float", "floor",
71
+ "flush", "fnum", "fputc", "fput", "fraction",
72
+ "fseek", "fstat", "ftell", "gerror", "getarg",
73
+ "get_command", "get_command_argument",
74
+ "get_environment_variable", "getcwd",
75
+ "getenv", "getgid", "getlog", "getpid",
76
+ "getuid", "gmtime", "hostnm", "huge", "iabs",
77
+ "iachar", "iand", "iargc", "ibclr", "ibits",
78
+ "ibset", "ichar", "idate", "idim", "idint",
79
+ "idnint", "ieor", "ierrno", "ifix", "imag",
80
+ "imagpart", "index", "int", "ior", "irand",
81
+ "isatty", "ishft", "ishftc", "isign",
82
+ "iso_c_binding", "is_iostat_end", "is_iostat_eor",
83
+ "itime", "kill", "kind", "lbound", "len", "len_trim",
84
+ "lge", "lgt", "link", "lle", "llt", "lnblnk", "loc",
85
+ "log", "logical", "long", "lshift", "lstat", "ltime",
86
+ "matmul", "max", "maxexponent", "maxloc", "maxval",
87
+ "mclock", "merge", "move_alloc", "min", "minexponent",
88
+ "minloc", "minval", "mod", "modulo", "mvbits",
89
+ "nearest", "new_line", "nint", "not", "or", "pack",
90
+ "perror", "precision", "present", "product", "radix",
91
+ "rand", "random_number", "random_seed", "range",
92
+ "real", "realpart", "rename", "repeat", "reshape",
93
+ "rrspacing", "rshift", "same_type_as", "scale",
94
+ "scan", "second", "selected_int_kind",
95
+ "selected_real_kind", "set_exponent", "shape",
96
+ "short", "sign", "signal", "sinh", "sin", "sleep",
97
+ "sngl", "spacing", "spread", "sqrt", "srand", "stat",
98
+ "sum", "symlnk", "system", "system_clock", "tan",
99
+ "tanh", "time", "tiny", "transfer", "transpose",
100
+ "trim", "ttynam", "ubound", "umask", "unlink",
101
+ "unpack", "verify", "xor", "zabs", "zcos", "zexp",
102
+ "zlog", "zsin", "zsqrt"]);
103
+
104
+ var dataTypes = words(["c_bool", "c_char", "c_double", "c_double_complex",
105
+ "c_float", "c_float_complex", "c_funptr", "c_int",
106
+ "c_int16_t", "c_int32_t", "c_int64_t", "c_int8_t",
107
+ "c_int_fast16_t", "c_int_fast32_t", "c_int_fast64_t",
108
+ "c_int_fast8_t", "c_int_least16_t", "c_int_least32_t",
109
+ "c_int_least64_t", "c_int_least8_t", "c_intmax_t",
110
+ "c_intptr_t", "c_long", "c_long_double",
111
+ "c_long_double_complex", "c_long_long", "c_ptr",
112
+ "c_short", "c_signed_char", "c_size_t", "character",
113
+ "complex", "double", "integer", "logical", "real"]);
114
+ var isOperatorChar = /[+\-*&=<>\/\:]/;
115
+ var litOperator = new RegExp("(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)", "i");
116
+
117
+ function tokenBase(stream, state) {
118
+
119
+ if (stream.match(litOperator)){
120
+ return 'operator';
121
+ }
122
+
123
+ var ch = stream.next();
124
+ if (ch == "!") {
125
+ stream.skipToEnd();
126
+ return "comment";
127
+ }
128
+ if (ch == '"' || ch == "'") {
129
+ state.tokenize = tokenString(ch);
130
+ return state.tokenize(stream, state);
131
+ }
132
+ if (/[\[\]\(\),]/.test(ch)) {
133
+ return null;
134
+ }
135
+ if (/\d/.test(ch)) {
136
+ stream.eatWhile(/[\w\.]/);
137
+ return "number";
138
+ }
139
+ if (isOperatorChar.test(ch)) {
140
+ stream.eatWhile(isOperatorChar);
141
+ return "operator";
142
+ }
143
+ stream.eatWhile(/[\w\$_]/);
144
+ var word = stream.current().toLowerCase();
145
+
146
+ if (keywords.hasOwnProperty(word)){
147
+ return 'keyword';
148
+ }
149
+ if (builtins.hasOwnProperty(word) || dataTypes.hasOwnProperty(word)) {
150
+ return 'builtin';
151
+ }
152
+ return "variable";
153
+ }
154
+
155
+ function tokenString(quote) {
156
+ return function(stream, state) {
157
+ var escaped = false, next, end = false;
158
+ while ((next = stream.next()) != null) {
159
+ if (next == quote && !escaped) {
160
+ end = true;
161
+ break;
162
+ }
163
+ escaped = !escaped && next == "\\";
164
+ }
165
+ if (end || !escaped) state.tokenize = null;
166
+ return "string";
167
+ };
168
+ }
169
+
170
+ // Interface
171
+
172
+ return {
173
+ startState: function() {
174
+ return {tokenize: null};
175
+ },
176
+
177
+ token: function(stream, state) {
178
+ if (stream.eatSpace()) return null;
179
+ var style = (state.tokenize || tokenBase)(stream, state);
180
+ if (style == "comment" || style == "meta") return style;
181
+ return style;
182
+ }
183
+ };
184
+ });
185
+
186
+ CodeMirror.defineMIME("text/x-fortran", "fortran");
187
+
188
+ });
assets/js/vendor/codemirror/mode/fortran/index.html ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Fortran mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="fortran.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Fortran</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Fortran mode</h2>
27
+
28
+
29
+ <div><textarea id="code" name="code">
30
+ ! Example Fortran code
31
+ program average
32
+
33
+ ! Read in some numbers and take the average
34
+ ! As written, if there are no data points, an average of zero is returned
35
+ ! While this may not be desired behavior, it keeps this example simple
36
+
37
+ implicit none
38
+
39
+ real, dimension(:), allocatable :: points
40
+ integer :: number_of_points
41
+ real :: average_points=0., positive_average=0., negative_average=0.
42
+
43
+ write (*,*) "Input number of points to average:"
44
+ read (*,*) number_of_points
45
+
46
+ allocate (points(number_of_points))
47
+
48
+ write (*,*) "Enter the points to average:"
49
+ read (*,*) points
50
+
51
+ ! Take the average by summing points and dividing by number_of_points
52
+ if (number_of_points > 0) average_points = sum(points) / number_of_points
53
+
54
+ ! Now form average over positive and negative points only
55
+ if (count(points > 0.) > 0) then
56
+ positive_average = sum(points, points > 0.) / count(points > 0.)
57
+ end if
58
+
59
+ if (count(points < 0.) > 0) then
60
+ negative_average = sum(points, points < 0.) / count(points < 0.)
61
+ end if
62
+
63
+ deallocate (points)
64
+
65
+ ! Print result to terminal
66
+ write (*,'(a,g12.4)') 'Average = ', average_points
67
+ write (*,'(a,g12.4)') 'Average of positive points = ', positive_average
68
+ write (*,'(a,g12.4)') 'Average of negative points = ', negative_average
69
+
70
+ end program average
71
+ </textarea></div>
72
+
73
+ <script>
74
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
75
+ lineNumbers: true,
76
+ mode: "text/x-fortran"
77
+ });
78
+ </script>
79
+
80
+ <p><strong>MIME types defined:</strong> <code>text/x-Fortran</code>.</p>
81
+ </article>
assets/js/vendor/codemirror/mode/gas/gas.js ADDED
@@ -0,0 +1,345 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("gas", function(_config, parserConfig) {
15
+ 'use strict';
16
+
17
+ // If an architecture is specified, its initialization function may
18
+ // populate this array with custom parsing functions which will be
19
+ // tried in the event that the standard functions do not find a match.
20
+ var custom = [];
21
+
22
+ // The symbol used to start a line comment changes based on the target
23
+ // architecture.
24
+ // If no architecture is pased in "parserConfig" then only multiline
25
+ // comments will have syntax support.
26
+ var lineCommentStartSymbol = "";
27
+
28
+ // These directives are architecture independent.
29
+ // Machine specific directives should go in their respective
30
+ // architecture initialization function.
31
+ // Reference:
32
+ // http://sourceware.org/binutils/docs/as/Pseudo-Ops.html#Pseudo-Ops
33
+ var directives = {
34
+ ".abort" : "builtin",
35
+ ".align" : "builtin",
36
+ ".altmacro" : "builtin",
37
+ ".ascii" : "builtin",
38
+ ".asciz" : "builtin",
39
+ ".balign" : "builtin",
40
+ ".balignw" : "builtin",
41
+ ".balignl" : "builtin",
42
+ ".bundle_align_mode" : "builtin",
43
+ ".bundle_lock" : "builtin",
44
+ ".bundle_unlock" : "builtin",
45
+ ".byte" : "builtin",
46
+ ".cfi_startproc" : "builtin",
47
+ ".comm" : "builtin",
48
+ ".data" : "builtin",
49
+ ".def" : "builtin",
50
+ ".desc" : "builtin",
51
+ ".dim" : "builtin",
52
+ ".double" : "builtin",
53
+ ".eject" : "builtin",
54
+ ".else" : "builtin",
55
+ ".elseif" : "builtin",
56
+ ".end" : "builtin",
57
+ ".endef" : "builtin",
58
+ ".endfunc" : "builtin",
59
+ ".endif" : "builtin",
60
+ ".equ" : "builtin",
61
+ ".equiv" : "builtin",
62
+ ".eqv" : "builtin",
63
+ ".err" : "builtin",
64
+ ".error" : "builtin",
65
+ ".exitm" : "builtin",
66
+ ".extern" : "builtin",
67
+ ".fail" : "builtin",
68
+ ".file" : "builtin",
69
+ ".fill" : "builtin",
70
+ ".float" : "builtin",
71
+ ".func" : "builtin",
72
+ ".global" : "builtin",
73
+ ".gnu_attribute" : "builtin",
74
+ ".hidden" : "builtin",
75
+ ".hword" : "builtin",
76
+ ".ident" : "builtin",
77
+ ".if" : "builtin",
78
+ ".incbin" : "builtin",
79
+ ".include" : "builtin",
80
+ ".int" : "builtin",
81
+ ".internal" : "builtin",
82
+ ".irp" : "builtin",
83
+ ".irpc" : "builtin",
84
+ ".lcomm" : "builtin",
85
+ ".lflags" : "builtin",
86
+ ".line" : "builtin",
87
+ ".linkonce" : "builtin",
88
+ ".list" : "builtin",
89
+ ".ln" : "builtin",
90
+ ".loc" : "builtin",
91
+ ".loc_mark_labels" : "builtin",
92
+ ".local" : "builtin",
93
+ ".long" : "builtin",
94
+ ".macro" : "builtin",
95
+ ".mri" : "builtin",
96
+ ".noaltmacro" : "builtin",
97
+ ".nolist" : "builtin",
98
+ ".octa" : "builtin",
99
+ ".offset" : "builtin",
100
+ ".org" : "builtin",
101
+ ".p2align" : "builtin",
102
+ ".popsection" : "builtin",
103
+ ".previous" : "builtin",
104
+ ".print" : "builtin",
105
+ ".protected" : "builtin",
106
+ ".psize" : "builtin",
107
+ ".purgem" : "builtin",
108
+ ".pushsection" : "builtin",
109
+ ".quad" : "builtin",
110
+ ".reloc" : "builtin",
111
+ ".rept" : "builtin",
112
+ ".sbttl" : "builtin",
113
+ ".scl" : "builtin",
114
+ ".section" : "builtin",
115
+ ".set" : "builtin",
116
+ ".short" : "builtin",
117
+ ".single" : "builtin",
118
+ ".size" : "builtin",
119
+ ".skip" : "builtin",
120
+ ".sleb128" : "builtin",
121
+ ".space" : "builtin",
122
+ ".stab" : "builtin",
123
+ ".string" : "builtin",
124
+ ".struct" : "builtin",
125
+ ".subsection" : "builtin",
126
+ ".symver" : "builtin",
127
+ ".tag" : "builtin",
128
+ ".text" : "builtin",
129
+ ".title" : "builtin",
130
+ ".type" : "builtin",
131
+ ".uleb128" : "builtin",
132
+ ".val" : "builtin",
133
+ ".version" : "builtin",
134
+ ".vtable_entry" : "builtin",
135
+ ".vtable_inherit" : "builtin",
136
+ ".warning" : "builtin",
137
+ ".weak" : "builtin",
138
+ ".weakref" : "builtin",
139
+ ".word" : "builtin"
140
+ };
141
+
142
+ var registers = {};
143
+
144
+ function x86(_parserConfig) {
145
+ lineCommentStartSymbol = "#";
146
+
147
+ registers.ax = "variable";
148
+ registers.eax = "variable-2";
149
+ registers.rax = "variable-3";
150
+
151
+ registers.bx = "variable";
152
+ registers.ebx = "variable-2";
153
+ registers.rbx = "variable-3";
154
+
155
+ registers.cx = "variable";
156
+ registers.ecx = "variable-2";
157
+ registers.rcx = "variable-3";
158
+
159
+ registers.dx = "variable";
160
+ registers.edx = "variable-2";
161
+ registers.rdx = "variable-3";
162
+
163
+ registers.si = "variable";
164
+ registers.esi = "variable-2";
165
+ registers.rsi = "variable-3";
166
+
167
+ registers.di = "variable";
168
+ registers.edi = "variable-2";
169
+ registers.rdi = "variable-3";
170
+
171
+ registers.sp = "variable";
172
+ registers.esp = "variable-2";
173
+ registers.rsp = "variable-3";
174
+
175
+ registers.bp = "variable";
176
+ registers.ebp = "variable-2";
177
+ registers.rbp = "variable-3";
178
+
179
+ registers.ip = "variable";
180
+ registers.eip = "variable-2";
181
+ registers.rip = "variable-3";
182
+
183
+ registers.cs = "keyword";
184
+ registers.ds = "keyword";
185
+ registers.ss = "keyword";
186
+ registers.es = "keyword";
187
+ registers.fs = "keyword";
188
+ registers.gs = "keyword";
189
+ }
190
+
191
+ function armv6(_parserConfig) {
192
+ // Reference:
193
+ // http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf
194
+ // http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf
195
+ lineCommentStartSymbol = "@";
196
+ directives.syntax = "builtin";
197
+
198
+ registers.r0 = "variable";
199
+ registers.r1 = "variable";
200
+ registers.r2 = "variable";
201
+ registers.r3 = "variable";
202
+ registers.r4 = "variable";
203
+ registers.r5 = "variable";
204
+ registers.r6 = "variable";
205
+ registers.r7 = "variable";
206
+ registers.r8 = "variable";
207
+ registers.r9 = "variable";
208
+ registers.r10 = "variable";
209
+ registers.r11 = "variable";
210
+ registers.r12 = "variable";
211
+
212
+ registers.sp = "variable-2";
213
+ registers.lr = "variable-2";
214
+ registers.pc = "variable-2";
215
+ registers.r13 = registers.sp;
216
+ registers.r14 = registers.lr;
217
+ registers.r15 = registers.pc;
218
+
219
+ custom.push(function(ch, stream) {
220
+ if (ch === '#') {
221
+ stream.eatWhile(/\w/);
222
+ return "number";
223
+ }
224
+ });
225
+ }
226
+
227
+ var arch = (parserConfig.architecture || "x86").toLowerCase();
228
+ if (arch === "x86") {
229
+ x86(parserConfig);
230
+ } else if (arch === "arm" || arch === "armv6") {
231
+ armv6(parserConfig);
232
+ }
233
+
234
+ function nextUntilUnescaped(stream, end) {
235
+ var escaped = false, next;
236
+ while ((next = stream.next()) != null) {
237
+ if (next === end && !escaped) {
238
+ return false;
239
+ }
240
+ escaped = !escaped && next === "\\";
241
+ }
242
+ return escaped;
243
+ }
244
+
245
+ function clikeComment(stream, state) {
246
+ var maybeEnd = false, ch;
247
+ while ((ch = stream.next()) != null) {
248
+ if (ch === "/" && maybeEnd) {
249
+ state.tokenize = null;
250
+ break;
251
+ }
252
+ maybeEnd = (ch === "*");
253
+ }
254
+ return "comment";
255
+ }
256
+
257
+ return {
258
+ startState: function() {
259
+ return {
260
+ tokenize: null
261
+ };
262
+ },
263
+
264
+ token: function(stream, state) {
265
+ if (state.tokenize) {
266
+ return state.tokenize(stream, state);
267
+ }
268
+
269
+ if (stream.eatSpace()) {
270
+ return null;
271
+ }
272
+
273
+ var style, cur, ch = stream.next();
274
+
275
+ if (ch === "/") {
276
+ if (stream.eat("*")) {
277
+ state.tokenize = clikeComment;
278
+ return clikeComment(stream, state);
279
+ }
280
+ }
281
+
282
+ if (ch === lineCommentStartSymbol) {
283
+ stream.skipToEnd();
284
+ return "comment";
285
+ }
286
+
287
+ if (ch === '"') {
288
+ nextUntilUnescaped(stream, '"');
289
+ return "string";
290
+ }
291
+
292
+ if (ch === '.') {
293
+ stream.eatWhile(/\w/);
294
+ cur = stream.current().toLowerCase();
295
+ style = directives[cur];
296
+ return style || null;
297
+ }
298
+
299
+ if (ch === '=') {
300
+ stream.eatWhile(/\w/);
301
+ return "tag";
302
+ }
303
+
304
+ if (ch === '{') {
305
+ return "braket";
306
+ }
307
+
308
+ if (ch === '}') {
309
+ return "braket";
310
+ }
311
+
312
+ if (/\d/.test(ch)) {
313
+ if (ch === "0" && stream.eat("x")) {
314
+ stream.eatWhile(/[0-9a-fA-F]/);
315
+ return "number";
316
+ }
317
+ stream.eatWhile(/\d/);
318
+ return "number";
319
+ }
320
+
321
+ if (/\w/.test(ch)) {
322
+ stream.eatWhile(/\w/);
323
+ if (stream.eat(":")) {
324
+ return 'tag';
325
+ }
326
+ cur = stream.current().toLowerCase();
327
+ style = registers[cur];
328
+ return style || null;
329
+ }
330
+
331
+ for (var i = 0; i < custom.length; i++) {
332
+ style = custom[i](ch, stream, state);
333
+ if (style) {
334
+ return style;
335
+ }
336
+ }
337
+ },
338
+
339
+ lineComment: lineCommentStartSymbol,
340
+ blockCommentStart: "/*",
341
+ blockCommentEnd: "*/"
342
+ };
343
+ });
344
+
345
+ });
assets/js/vendor/codemirror/mode/gas/index.html ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Gas mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="gas.js"></script>
10
+ <style>.CodeMirror {border: 2px inset #dee;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Gas</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Gas mode</h2>
27
+ <form>
28
+ <textarea id="code" name="code">
29
+ .syntax unified
30
+ .global main
31
+
32
+ /*
33
+ * A
34
+ * multi-line
35
+ * comment.
36
+ */
37
+
38
+ @ A single line comment.
39
+
40
+ main:
41
+ push {sp, lr}
42
+ ldr r0, =message
43
+ bl puts
44
+ mov r0, #0
45
+ pop {sp, pc}
46
+
47
+ message:
48
+ .asciz "Hello world!<br />"
49
+ </textarea>
50
+ </form>
51
+
52
+ <script>
53
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
54
+ lineNumbers: true,
55
+ mode: {name: "gas", architecture: "ARMv6"},
56
+ });
57
+ </script>
58
+
59
+ <p>Handles AT&amp;T assembler syntax (more specifically this handles
60
+ the GNU Assembler (gas) syntax.)
61
+ It takes a single optional configuration parameter:
62
+ <code>architecture</code>, which can be one of <code>"ARM"</code>,
63
+ <code>"ARMv6"</code> or <code>"x86"</code>.
64
+ Including the parameter adds syntax for the registers and special
65
+ directives for the supplied architecture.
66
+
67
+ <p><strong>MIME types defined:</strong> <code>text/x-gas</code></p>
68
+ </article>
assets/js/vendor/codemirror/mode/gfm/gfm.js ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../markdown/markdown", "../../addon/mode/overlay"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i
15
+
16
+ CodeMirror.defineMode("gfm", function(config, modeConfig) {
17
+ var codeDepth = 0;
18
+ function blankLine(state) {
19
+ state.code = false;
20
+ return null;
21
+ }
22
+ var gfmOverlay = {
23
+ startState: function() {
24
+ return {
25
+ code: false,
26
+ codeBlock: false,
27
+ ateSpace: false
28
+ };
29
+ },
30
+ copyState: function(s) {
31
+ return {
32
+ code: s.code,
33
+ codeBlock: s.codeBlock,
34
+ ateSpace: s.ateSpace
35
+ };
36
+ },
37
+ token: function(stream, state) {
38
+ state.combineTokens = null;
39
+
40
+ // Hack to prevent formatting override inside code blocks (block and inline)
41
+ if (state.codeBlock) {
42
+ if (stream.match(/^```+/)) {
43
+ state.codeBlock = false;
44
+ return null;
45
+ }
46
+ stream.skipToEnd();
47
+ return null;
48
+ }
49
+ if (stream.sol()) {
50
+ state.code = false;
51
+ }
52
+ if (stream.sol() && stream.match(/^```+/)) {
53
+ stream.skipToEnd();
54
+ state.codeBlock = true;
55
+ return null;
56
+ }
57
+ // If this block is changed, it may need to be updated in Markdown mode
58
+ if (stream.peek() === '`') {
59
+ stream.next();
60
+ var before = stream.pos;
61
+ stream.eatWhile('`');
62
+ var difference = 1 + stream.pos - before;
63
+ if (!state.code) {
64
+ codeDepth = difference;
65
+ state.code = true;
66
+ } else {
67
+ if (difference === codeDepth) { // Must be exact
68
+ state.code = false;
69
+ }
70
+ }
71
+ return null;
72
+ } else if (state.code) {
73
+ stream.next();
74
+ return null;
75
+ }
76
+ // Check if space. If so, links can be formatted later on
77
+ if (stream.eatSpace()) {
78
+ state.ateSpace = true;
79
+ return null;
80
+ }
81
+ if (stream.sol() || state.ateSpace) {
82
+ state.ateSpace = false;
83
+ if (modeConfig.gitHubSpice !== false) {
84
+ if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
85
+ // User/Project@SHA
86
+ // User@SHA
87
+ // SHA
88
+ state.combineTokens = true;
89
+ return "link";
90
+ } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
91
+ // User/Project#Num
92
+ // User#Num
93
+ // #Num
94
+ state.combineTokens = true;
95
+ return "link";
96
+ }
97
+ }
98
+ }
99
+ if (stream.match(urlRE) &&
100
+ stream.string.slice(stream.start - 2, stream.start) != "](" &&
101
+ (stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) {
102
+ // URLs
103
+ // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
104
+ // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine
105
+ // And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL
106
+ state.combineTokens = true;
107
+ return "link";
108
+ }
109
+ stream.next();
110
+ return null;
111
+ },
112
+ blankLine: blankLine
113
+ };
114
+
115
+ var markdownConfig = {
116
+ underscoresBreakWords: false,
117
+ taskLists: true,
118
+ fencedCodeBlocks: '```',
119
+ strikethrough: true
120
+ };
121
+ for (var attr in modeConfig) {
122
+ markdownConfig[attr] = modeConfig[attr];
123
+ }
124
+ markdownConfig.name = "markdown";
125
+ return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay);
126
+
127
+ }, "markdown");
128
+
129
+ CodeMirror.defineMIME("text/x-gfm", "gfm");
130
+ });
assets/js/vendor/codemirror/mode/gfm/index.html ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: GFM mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/mode/overlay.js"></script>
10
+ <script src="../xml/xml.js"></script>
11
+ <script src="../markdown/markdown.js"></script>
12
+ <script src="gfm.js"></script>
13
+ <script src="../javascript/javascript.js"></script>
14
+ <script src="../css/css.js"></script>
15
+ <script src="../htmlmixed/htmlmixed.js"></script>
16
+ <script src="../clike/clike.js"></script>
17
+ <script src="../meta.js"></script>
18
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
19
+ <div id=nav>
20
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
21
+
22
+ <ul>
23
+ <li><a href="../../index.html">Home</a>
24
+ <li><a href="../../doc/manual.html">Manual</a>
25
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
26
+ </ul>
27
+ <ul>
28
+ <li><a href="../index.html">Language modes</a>
29
+ <li><a class=active href="#">GFM</a>
30
+ </ul>
31
+ </div>
32
+
33
+ <article>
34
+ <h2>GFM mode</h2>
35
+ <form><textarea id="code" name="code">
36
+ GitHub Flavored Markdown
37
+ ========================
38
+
39
+ Everything from markdown plus GFM features:
40
+
41
+ ## URL autolinking
42
+
43
+ Underscores_are_allowed_between_words.
44
+
45
+ ## Strikethrough text
46
+
47
+ GFM adds syntax to strikethrough text, which is missing from standard Markdown.
48
+
49
+ ~~Mistaken text.~~
50
+ ~~**works with other fomatting**~~
51
+
52
+ ~~spans across
53
+ lines~~
54
+
55
+ ## Fenced code blocks (and syntax highlighting)
56
+
57
+ ```javascript
58
+ for (var i = 0; i &lt; items.length; i++) {
59
+ console.log(items[i], i); // log them
60
+ }
61
+ ```
62
+
63
+ ## Task Lists
64
+
65
+ - [ ] Incomplete task list item
66
+ - [x] **Completed** task list item
67
+
68
+ ## A bit of GitHub spice
69
+
70
+ * SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
71
+ * User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
72
+ * User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
73
+ * \#Num: #1
74
+ * User/#Num: mojombo#1
75
+ * User/Project#Num: mojombo/god#1
76
+
77
+ See http://github.github.com/github-flavored-markdown/.
78
+
79
+ </textarea></form>
80
+
81
+ <script>
82
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
83
+ mode: 'gfm',
84
+ lineNumbers: true,
85
+ theme: "default"
86
+ });
87
+ </script>
88
+
89
+ <p>Optionally depends on other modes for properly highlighted code blocks.</p>
90
+
91
+ <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gfm_*">normal</a>, <a href="../../test/index.html#verbose,gfm_*">verbose</a>.</p>
92
+
93
+ </article>
assets/js/vendor/codemirror/mode/gfm/test.js ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function() {
5
+ var mode = CodeMirror.getMode({tabSize: 4}, "gfm");
6
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
7
+ var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true});
8
+ function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); }
9
+
10
+ FT("codeBackticks",
11
+ "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]");
12
+
13
+ FT("doubleBackticks",
14
+ "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]");
15
+
16
+ FT("codeBlock",
17
+ "[comment&formatting&formatting-code-block ```css]",
18
+ "[tag foo]",
19
+ "[comment&formatting&formatting-code-block ```]");
20
+
21
+ FT("taskList",
22
+ "[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]",
23
+ "[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]");
24
+
25
+ FT("formatting_strikethrough",
26
+ "[strikethrough&formatting&formatting-strikethrough ~~][strikethrough foo][strikethrough&formatting&formatting-strikethrough ~~]");
27
+
28
+ FT("formatting_strikethrough",
29
+ "foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]");
30
+
31
+ MT("emInWordAsterisk",
32
+ "foo[em *bar*]hello");
33
+
34
+ MT("emInWordUnderscore",
35
+ "foo_bar_hello");
36
+
37
+ MT("emStrongUnderscore",
38
+ "[strong __][em&strong _foo__][em _] bar");
39
+
40
+ MT("fencedCodeBlocks",
41
+ "[comment ```]",
42
+ "[comment foo]",
43
+ "",
44
+ "[comment ```]",
45
+ "bar");
46
+
47
+ MT("fencedCodeBlockModeSwitching",
48
+ "[comment ```javascript]",
49
+ "[variable foo]",
50
+ "",
51
+ "[comment ```]",
52
+ "bar");
53
+
54
+ MT("fencedCodeBlocksNoTildes",
55
+ "~~~",
56
+ "foo",
57
+ "~~~");
58
+
59
+ MT("taskListAsterisk",
60
+ "[variable-2 * []] foo]", // Invalid; must have space or x between []
61
+ "[variable-2 * [ ]]bar]", // Invalid; must have space after ]
62
+ "[variable-2 * [x]]hello]", // Invalid; must have space after ]
63
+ "[variable-2 * ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
64
+ " [variable-3 * ][property [x]]][variable-3 foo]"); // Valid; can be nested
65
+
66
+ MT("taskListPlus",
67
+ "[variable-2 + []] foo]", // Invalid; must have space or x between []
68
+ "[variable-2 + [ ]]bar]", // Invalid; must have space after ]
69
+ "[variable-2 + [x]]hello]", // Invalid; must have space after ]
70
+ "[variable-2 + ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
71
+ " [variable-3 + ][property [x]]][variable-3 foo]"); // Valid; can be nested
72
+
73
+ MT("taskListDash",
74
+ "[variable-2 - []] foo]", // Invalid; must have space or x between []
75
+ "[variable-2 - [ ]]bar]", // Invalid; must have space after ]
76
+ "[variable-2 - [x]]hello]", // Invalid; must have space after ]
77
+ "[variable-2 - ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
78
+ " [variable-3 - ][property [x]]][variable-3 foo]"); // Valid; can be nested
79
+
80
+ MT("taskListNumber",
81
+ "[variable-2 1. []] foo]", // Invalid; must have space or x between []
82
+ "[variable-2 2. [ ]]bar]", // Invalid; must have space after ]
83
+ "[variable-2 3. [x]]hello]", // Invalid; must have space after ]
84
+ "[variable-2 4. ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
85
+ " [variable-3 1. ][property [x]]][variable-3 foo]"); // Valid; can be nested
86
+
87
+ MT("SHA",
88
+ "foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar");
89
+
90
+ MT("SHAEmphasis",
91
+ "[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]");
92
+
93
+ MT("shortSHA",
94
+ "foo [link be6a8cc] bar");
95
+
96
+ MT("tooShortSHA",
97
+ "foo be6a8c bar");
98
+
99
+ MT("longSHA",
100
+ "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar");
101
+
102
+ MT("badSHA",
103
+ "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar");
104
+
105
+ MT("userSHA",
106
+ "foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello");
107
+
108
+ MT("userSHAEmphasis",
109
+ "[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]");
110
+
111
+ MT("userProjectSHA",
112
+ "foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world");
113
+
114
+ MT("userProjectSHAEmphasis",
115
+ "[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]");
116
+
117
+ MT("num",
118
+ "foo [link #1] bar");
119
+
120
+ MT("numEmphasis",
121
+ "[em *foo ][em&link #1][em *]");
122
+
123
+ MT("badNum",
124
+ "foo #1bar hello");
125
+
126
+ MT("userNum",
127
+ "foo [link bar#1] hello");
128
+
129
+ MT("userNumEmphasis",
130
+ "[em *foo ][em&link bar#1][em *]");
131
+
132
+ MT("userProjectNum",
133
+ "foo [link bar/hello#1] world");
134
+
135
+ MT("userProjectNumEmphasis",
136
+ "[em *foo ][em&link bar/hello#1][em *]");
137
+
138
+ MT("vanillaLink",
139
+ "foo [link http://www.example.com/] bar");
140
+
141
+ MT("vanillaLinkNoScheme",
142
+ "foo [link www.example.com] bar");
143
+
144
+ MT("vanillaLinkHttps",
145
+ "foo [link https://www.example.com/] bar");
146
+
147
+ MT("vanillaLinkDataSchema",
148
+ "foo [link data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==] bar");
149
+
150
+ MT("vanillaLinkPunctuation",
151
+ "foo [link http://www.example.com/]. bar");
152
+
153
+ MT("vanillaLinkExtension",
154
+ "foo [link http://www.example.com/index.html] bar");
155
+
156
+ MT("vanillaLinkEmphasis",
157
+ "foo [em *][em&link http://www.example.com/index.html][em *] bar");
158
+
159
+ MT("notALink",
160
+ "foo asfd:asdf bar");
161
+
162
+ MT("notALink",
163
+ "[comment ```css]",
164
+ "[tag foo] {[property color]:[keyword black];}",
165
+ "[comment ```][link http://www.example.com/]");
166
+
167
+ MT("notALink",
168
+ "[comment ``foo `bar` http://www.example.com/``] hello");
169
+
170
+ MT("notALink",
171
+ "[comment `foo]",
172
+ "[comment&link http://www.example.com/]",
173
+ "[comment `] foo",
174
+ "",
175
+ "[link http://www.example.com/]");
176
+
177
+ MT("headerCodeBlockGithub",
178
+ "[header&header-1 # heading]",
179
+ "",
180
+ "[comment ```]",
181
+ "[comment code]",
182
+ "[comment ```]",
183
+ "",
184
+ "Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]",
185
+ "Issue: [link #1]",
186
+ "Link: [link http://www.example.com/]");
187
+
188
+ MT("strikethrough",
189
+ "[strikethrough ~~foo~~]");
190
+
191
+ MT("strikethroughWithStartingSpace",
192
+ "~~ foo~~");
193
+
194
+ MT("strikethroughUnclosedStrayTildes",
195
+ "[strikethrough ~~foo~~~]");
196
+
197
+ MT("strikethroughUnclosedStrayTildes",
198
+ "[strikethrough ~~foo ~~]");
199
+
200
+ MT("strikethroughUnclosedStrayTildes",
201
+ "[strikethrough ~~foo ~~ bar]");
202
+
203
+ MT("strikethroughUnclosedStrayTildes",
204
+ "[strikethrough ~~foo ~~ bar~~]hello");
205
+
206
+ MT("strikethroughOneLetter",
207
+ "[strikethrough ~~a~~]");
208
+
209
+ MT("strikethroughWrapped",
210
+ "[strikethrough ~~foo]",
211
+ "[strikethrough foo~~]");
212
+
213
+ MT("strikethroughParagraph",
214
+ "[strikethrough ~~foo]",
215
+ "",
216
+ "foo[strikethrough ~~bar]");
217
+
218
+ MT("strikethroughEm",
219
+ "[strikethrough ~~foo][em&strikethrough *bar*][strikethrough ~~]");
220
+
221
+ MT("strikethroughEm",
222
+ "[em *][em&strikethrough ~~foo~~][em *]");
223
+
224
+ MT("strikethroughStrong",
225
+ "[strikethrough ~~][strong&strikethrough **foo**][strikethrough ~~]");
226
+
227
+ MT("strikethroughStrong",
228
+ "[strong **][strong&strikethrough ~~foo~~][strong **]");
229
+
230
+ })();
assets/js/vendor/codemirror/mode/gherkin/gherkin.js ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /*
5
+ Gherkin mode - http://www.cukes.info/
6
+ Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues
7
+ */
8
+
9
+ // Following Objs from Brackets implementation: https://github.com/tregusti/brackets-gherkin/blob/master/main.js
10
+ //var Quotes = {
11
+ // SINGLE: 1,
12
+ // DOUBLE: 2
13
+ //};
14
+
15
+ //var regex = {
16
+ // keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/
17
+ //};
18
+
19
+ (function(mod) {
20
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
21
+ mod(require("../../lib/codemirror"));
22
+ else if (typeof define == "function" && define.amd) // AMD
23
+ define(["../../lib/codemirror"], mod);
24
+ else // Plain browser env
25
+ mod(CodeMirror);
26
+ })(function(CodeMirror) {
27
+ "use strict";
28
+
29
+ CodeMirror.defineMode("gherkin", function () {
30
+ return {
31
+ startState: function () {
32
+ return {
33
+ lineNumber: 0,
34
+ tableHeaderLine: false,
35
+ allowFeature: true,
36
+ allowBackground: false,
37
+ allowScenario: false,
38
+ allowSteps: false,
39
+ allowPlaceholders: false,
40
+ allowMultilineArgument: false,
41
+ inMultilineString: false,
42
+ inMultilineTable: false,
43
+ inKeywordLine: false
44
+ };
45
+ },
46
+ token: function (stream, state) {
47
+ if (stream.sol()) {
48
+ state.lineNumber++;
49
+ state.inKeywordLine = false;
50
+ if (state.inMultilineTable) {
51
+ state.tableHeaderLine = false;
52
+ if (!stream.match(/\s*\|/, false)) {
53
+ state.allowMultilineArgument = false;
54
+ state.inMultilineTable = false;
55
+ }
56
+ }
57
+ }
58
+
59
+ stream.eatSpace();
60
+
61
+ if (state.allowMultilineArgument) {
62
+
63
+ // STRING
64
+ if (state.inMultilineString) {
65
+ if (stream.match('"""')) {
66
+ state.inMultilineString = false;
67
+ state.allowMultilineArgument = false;
68
+ } else {
69
+ stream.match(/.*/);
70
+ }
71
+ return "string";
72
+ }
73
+
74
+ // TABLE
75
+ if (state.inMultilineTable) {
76
+ if (stream.match(/\|\s*/)) {
77
+ return "bracket";
78
+ } else {
79
+ stream.match(/[^\|]*/);
80
+ return state.tableHeaderLine ? "header" : "string";
81
+ }
82
+ }
83
+
84
+ // DETECT START
85
+ if (stream.match('"""')) {
86
+ // String
87
+ state.inMultilineString = true;
88
+ return "string";
89
+ } else if (stream.match("|")) {
90
+ // Table
91
+ state.inMultilineTable = true;
92
+ state.tableHeaderLine = true;
93
+ return "bracket";
94
+ }
95
+
96
+ }
97
+
98
+ // LINE COMMENT
99
+ if (stream.match(/#.*/)) {
100
+ return "comment";
101
+
102
+ // TAG
103
+ } else if (!state.inKeywordLine && stream.match(/@\S+/)) {
104
+ return "tag";
105
+
106
+ // FEATURE
107
+ } else if (!state.inKeywordLine && state.allowFeature && stream.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)) {
108
+ state.allowScenario = true;
109
+ state.allowBackground = true;
110
+ state.allowPlaceholders = false;
111
+ state.allowSteps = false;
112
+ state.allowMultilineArgument = false;
113
+ state.inKeywordLine = true;
114
+ return "keyword";
115
+
116
+ // BACKGROUND
117
+ } else if (!state.inKeywordLine && state.allowBackground && stream.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)) {
118
+ state.allowPlaceholders = false;
119
+ state.allowSteps = true;
120
+ state.allowBackground = false;
121
+ state.allowMultilineArgument = false;
122
+ state.inKeywordLine = true;
123
+ return "keyword";
124
+
125
+ // SCENARIO OUTLINE
126
+ } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)) {
127
+ state.allowPlaceholders = true;
128
+ state.allowSteps = true;
129
+ state.allowMultilineArgument = false;
130
+ state.inKeywordLine = true;
131
+ return "keyword";
132
+
133
+ // EXAMPLES
134
+ } else if (state.allowScenario && stream.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)) {
135
+ state.allowPlaceholders = false;
136
+ state.allowSteps = true;
137
+ state.allowBackground = false;
138
+ state.allowMultilineArgument = true;
139
+ return "keyword";
140
+
141
+ // SCENARIO
142
+ } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)) {
143
+ state.allowPlaceholders = false;
144
+ state.allowSteps = true;
145
+ state.allowBackground = false;
146
+ state.allowMultilineArgument = false;
147
+ state.inKeywordLine = true;
148
+ return "keyword";
149
+
150
+ // STEPS
151
+ } else if (!state.inKeywordLine && state.allowSteps && stream.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)) {
152
+ state.inStep = true;
153
+ state.allowPlaceholders = true;
154
+ state.allowMultilineArgument = true;
155
+ state.inKeywordLine = true;
156
+ return "keyword";
157
+
158
+ // INLINE STRING
159
+ } else if (stream.match(/"[^"]*"?/)) {
160
+ return "string";
161
+
162
+ // PLACEHOLDER
163
+ } else if (state.allowPlaceholders && stream.match(/<[^>]*>?/)) {
164
+ return "variable";
165
+
166
+ // Fall through
167
+ } else {
168
+ stream.next();
169
+ stream.eatWhile(/[^@"<#]/);
170
+ return null;
171
+ }
172
+ }
173
+ };
174
+ });
175
+
176
+ CodeMirror.defineMIME("text/x-feature", "gherkin");
177
+
178
+ });
assets/js/vendor/codemirror/mode/gherkin/index.html ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Gherkin mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="gherkin.js"></script>
10
+ <style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Gherkin</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Gherkin mode</h2>
27
+ <form><textarea id="code" name="code">
28
+ Feature: Using Google
29
+ Background:
30
+ Something something
31
+ Something else
32
+ Scenario: Has a homepage
33
+ When I navigate to the google home page
34
+ Then the home page should contain the menu and the search form
35
+ Scenario: Searching for a term
36
+ When I navigate to the google home page
37
+ When I search for Tofu
38
+ Then the search results page is displayed
39
+ Then the search results page contains 10 individual search results
40
+ Then the search results contain a link to the wikipedia tofu page
41
+ </textarea></form>
42
+ <script>
43
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
44
+ </script>
45
+
46
+ <p><strong>MIME types defined:</strong> <code>text/x-feature</code>.</p>
47
+
48
+ </article>
assets/js/vendor/codemirror/mode/go/go.js ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("go", function(config) {
15
+ var indentUnit = config.indentUnit;
16
+
17
+ var keywords = {
18
+ "break":true, "case":true, "chan":true, "const":true, "continue":true,
19
+ "default":true, "defer":true, "else":true, "fallthrough":true, "for":true,
20
+ "func":true, "go":true, "goto":true, "if":true, "import":true,
21
+ "interface":true, "map":true, "package":true, "range":true, "return":true,
22
+ "select":true, "struct":true, "switch":true, "type":true, "var":true,
23
+ "bool":true, "byte":true, "complex64":true, "complex128":true,
24
+ "float32":true, "float64":true, "int8":true, "int16":true, "int32":true,
25
+ "int64":true, "string":true, "uint8":true, "uint16":true, "uint32":true,
26
+ "uint64":true, "int":true, "uint":true, "uintptr":true
27
+ };
28
+
29
+ var atoms = {
30
+ "true":true, "false":true, "iota":true, "nil":true, "append":true,
31
+ "cap":true, "close":true, "complex":true, "copy":true, "imag":true,
32
+ "len":true, "make":true, "new":true, "panic":true, "print":true,
33
+ "println":true, "real":true, "recover":true
34
+ };
35
+
36
+ var isOperatorChar = /[+\-*&^%:=<>!|\/]/;
37
+
38
+ var curPunc;
39
+
40
+ function tokenBase(stream, state) {
41
+ var ch = stream.next();
42
+ if (ch == '"' || ch == "'" || ch == "`") {
43
+ state.tokenize = tokenString(ch);
44
+ return state.tokenize(stream, state);
45
+ }
46
+ if (/[\d\.]/.test(ch)) {
47
+ if (ch == ".") {
48
+ stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);
49
+ } else if (ch == "0") {
50
+ stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);
51
+ } else {
52
+ stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);
53
+ }
54
+ return "number";
55
+ }
56
+ if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
57
+ curPunc = ch;
58
+ return null;
59
+ }
60
+ if (ch == "/") {
61
+ if (stream.eat("*")) {
62
+ state.tokenize = tokenComment;
63
+ return tokenComment(stream, state);
64
+ }
65
+ if (stream.eat("/")) {
66
+ stream.skipToEnd();
67
+ return "comment";
68
+ }
69
+ }
70
+ if (isOperatorChar.test(ch)) {
71
+ stream.eatWhile(isOperatorChar);
72
+ return "operator";
73
+ }
74
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
75
+ var cur = stream.current();
76
+ if (keywords.propertyIsEnumerable(cur)) {
77
+ if (cur == "case" || cur == "default") curPunc = "case";
78
+ return "keyword";
79
+ }
80
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
81
+ return "variable";
82
+ }
83
+
84
+ function tokenString(quote) {
85
+ return function(stream, state) {
86
+ var escaped = false, next, end = false;
87
+ while ((next = stream.next()) != null) {
88
+ if (next == quote && !escaped) {end = true; break;}
89
+ escaped = !escaped && quote != "`" && next == "\\";
90
+ }
91
+ if (end || !(escaped || quote == "`"))
92
+ state.tokenize = tokenBase;
93
+ return "string";
94
+ };
95
+ }
96
+
97
+ function tokenComment(stream, state) {
98
+ var maybeEnd = false, ch;
99
+ while (ch = stream.next()) {
100
+ if (ch == "/" && maybeEnd) {
101
+ state.tokenize = tokenBase;
102
+ break;
103
+ }
104
+ maybeEnd = (ch == "*");
105
+ }
106
+ return "comment";
107
+ }
108
+
109
+ function Context(indented, column, type, align, prev) {
110
+ this.indented = indented;
111
+ this.column = column;
112
+ this.type = type;
113
+ this.align = align;
114
+ this.prev = prev;
115
+ }
116
+ function pushContext(state, col, type) {
117
+ return state.context = new Context(state.indented, col, type, null, state.context);
118
+ }
119
+ function popContext(state) {
120
+ if (!state.context.prev) return;
121
+ var t = state.context.type;
122
+ if (t == ")" || t == "]" || t == "}")
123
+ state.indented = state.context.indented;
124
+ return state.context = state.context.prev;
125
+ }
126
+
127
+ // Interface
128
+
129
+ return {
130
+ startState: function(basecolumn) {
131
+ return {
132
+ tokenize: null,
133
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
134
+ indented: 0,
135
+ startOfLine: true
136
+ };
137
+ },
138
+
139
+ token: function(stream, state) {
140
+ var ctx = state.context;
141
+ if (stream.sol()) {
142
+ if (ctx.align == null) ctx.align = false;
143
+ state.indented = stream.indentation();
144
+ state.startOfLine = true;
145
+ if (ctx.type == "case") ctx.type = "}";
146
+ }
147
+ if (stream.eatSpace()) return null;
148
+ curPunc = null;
149
+ var style = (state.tokenize || tokenBase)(stream, state);
150
+ if (style == "comment") return style;
151
+ if (ctx.align == null) ctx.align = true;
152
+
153
+ if (curPunc == "{") pushContext(state, stream.column(), "}");
154
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
155
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
156
+ else if (curPunc == "case") ctx.type = "case";
157
+ else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state);
158
+ else if (curPunc == ctx.type) popContext(state);
159
+ state.startOfLine = false;
160
+ return style;
161
+ },
162
+
163
+ indent: function(state, textAfter) {
164
+ if (state.tokenize != tokenBase && state.tokenize != null) return 0;
165
+ var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
166
+ if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) {
167
+ state.context.type = "}";
168
+ return ctx.indented;
169
+ }
170
+ var closing = firstChar == ctx.type;
171
+ if (ctx.align) return ctx.column + (closing ? 0 : 1);
172
+ else return ctx.indented + (closing ? 0 : indentUnit);
173
+ },
174
+
175
+ electricChars: "{}):",
176
+ fold: "brace",
177
+ blockCommentStart: "/*",
178
+ blockCommentEnd: "*/",
179
+ lineComment: "//"
180
+ };
181
+ });
182
+
183
+ CodeMirror.defineMIME("text/x-go", "go");
184
+
185
+ });
assets/js/vendor/codemirror/mode/go/index.html ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Go mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/elegant.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="../../addon/edit/matchbrackets.js"></script>
11
+ <script src="go.js"></script>
12
+ <style>.CodeMirror {border:1px solid #999; background:#ffc}</style>
13
+ <div id=nav>
14
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
15
+
16
+ <ul>
17
+ <li><a href="../../index.html">Home</a>
18
+ <li><a href="../../doc/manual.html">Manual</a>
19
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
20
+ </ul>
21
+ <ul>
22
+ <li><a href="../index.html">Language modes</a>
23
+ <li><a class=active href="#">Go</a>
24
+ </ul>
25
+ </div>
26
+
27
+ <article>
28
+ <h2>Go mode</h2>
29
+ <form><textarea id="code" name="code">
30
+ // Prime Sieve in Go.
31
+ // Taken from the Go specification.
32
+ // Copyright © The Go Authors.
33
+
34
+ package main
35
+
36
+ import "fmt"
37
+
38
+ // Send the sequence 2, 3, 4, ... to channel 'ch'.
39
+ func generate(ch chan&lt;- int) {
40
+ for i := 2; ; i++ {
41
+ ch &lt;- i // Send 'i' to channel 'ch'
42
+ }
43
+ }
44
+
45
+ // Copy the values from channel 'src' to channel 'dst',
46
+ // removing those divisible by 'prime'.
47
+ func filter(src &lt;-chan int, dst chan&lt;- int, prime int) {
48
+ for i := range src { // Loop over values received from 'src'.
49
+ if i%prime != 0 {
50
+ dst &lt;- i // Send 'i' to channel 'dst'.
51
+ }
52
+ }
53
+ }
54
+
55
+ // The prime sieve: Daisy-chain filter processes together.
56
+ func sieve() {
57
+ ch := make(chan int) // Create a new channel.
58
+ go generate(ch) // Start generate() as a subprocess.
59
+ for {
60
+ prime := &lt;-ch
61
+ fmt.Print(prime, "\n")
62
+ ch1 := make(chan int)
63
+ go filter(ch, ch1, prime)
64
+ ch = ch1
65
+ }
66
+ }
67
+
68
+ func main() {
69
+ sieve()
70
+ }
71
+ </textarea></form>
72
+
73
+ <script>
74
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
75
+ theme: "elegant",
76
+ matchBrackets: true,
77
+ indentUnit: 8,
78
+ tabSize: 8,
79
+ indentWithTabs: true,
80
+ mode: "text/x-go"
81
+ });
82
+ </script>
83
+
84
+ <p><strong>MIME type:</strong> <code>text/x-go</code></p>
85
+ </article>
assets/js/vendor/codemirror/mode/groovy/groovy.js ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("groovy", function(config) {
15
+ function words(str) {
16
+ var obj = {}, words = str.split(" ");
17
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
18
+ return obj;
19
+ }
20
+ var keywords = words(
21
+ "abstract as assert boolean break byte case catch char class const continue def default " +
22
+ "do double else enum extends final finally float for goto if implements import in " +
23
+ "instanceof int interface long native new package private protected public return " +
24
+ "short static strictfp super switch synchronized threadsafe throw throws transient " +
25
+ "try void volatile while");
26
+ var blockKeywords = words("catch class do else finally for if switch try while enum interface def");
27
+ var standaloneKeywords = words("return break continue");
28
+ var atoms = words("null true false this");
29
+
30
+ var curPunc;
31
+ function tokenBase(stream, state) {
32
+ var ch = stream.next();
33
+ if (ch == '"' || ch == "'") {
34
+ return startString(ch, stream, state);
35
+ }
36
+ if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
37
+ curPunc = ch;
38
+ return null;
39
+ }
40
+ if (/\d/.test(ch)) {
41
+ stream.eatWhile(/[\w\.]/);
42
+ if (stream.eat(/eE/)) { stream.eat(/\+\-/); stream.eatWhile(/\d/); }
43
+ return "number";
44
+ }
45
+ if (ch == "/") {
46
+ if (stream.eat("*")) {
47
+ state.tokenize.push(tokenComment);
48
+ return tokenComment(stream, state);
49
+ }
50
+ if (stream.eat("/")) {
51
+ stream.skipToEnd();
52
+ return "comment";
53
+ }
54
+ if (expectExpression(state.lastToken, false)) {
55
+ return startString(ch, stream, state);
56
+ }
57
+ }
58
+ if (ch == "-" && stream.eat(">")) {
59
+ curPunc = "->";
60
+ return null;
61
+ }
62
+ if (/[+\-*&%=<>!?|\/~]/.test(ch)) {
63
+ stream.eatWhile(/[+\-*&%=<>|~]/);
64
+ return "operator";
65
+ }
66
+ stream.eatWhile(/[\w\$_]/);
67
+ if (ch == "@") { stream.eatWhile(/[\w\$_\.]/); return "meta"; }
68
+ if (state.lastToken == ".") return "property";
69
+ if (stream.eat(":")) { curPunc = "proplabel"; return "property"; }
70
+ var cur = stream.current();
71
+ if (atoms.propertyIsEnumerable(cur)) { return "atom"; }
72
+ if (keywords.propertyIsEnumerable(cur)) {
73
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
74
+ else if (standaloneKeywords.propertyIsEnumerable(cur)) curPunc = "standalone";
75
+ return "keyword";
76
+ }
77
+ return "variable";
78
+ }
79
+ tokenBase.isBase = true;
80
+
81
+ function startString(quote, stream, state) {
82
+ var tripleQuoted = false;
83
+ if (quote != "/" && stream.eat(quote)) {
84
+ if (stream.eat(quote)) tripleQuoted = true;
85
+ else return "string";
86
+ }
87
+ function t(stream, state) {
88
+ var escaped = false, next, end = !tripleQuoted;
89
+ while ((next = stream.next()) != null) {
90
+ if (next == quote && !escaped) {
91
+ if (!tripleQuoted) { break; }
92
+ if (stream.match(quote + quote)) { end = true; break; }
93
+ }
94
+ if (quote == '"' && next == "$" && !escaped && stream.eat("{")) {
95
+ state.tokenize.push(tokenBaseUntilBrace());
96
+ return "string";
97
+ }
98
+ escaped = !escaped && next == "\\";
99
+ }
100
+ if (end) state.tokenize.pop();
101
+ return "string";
102
+ }
103
+ state.tokenize.push(t);
104
+ return t(stream, state);
105
+ }
106
+
107
+ function tokenBaseUntilBrace() {
108
+ var depth = 1;
109
+ function t(stream, state) {
110
+ if (stream.peek() == "}") {
111
+ depth--;
112
+ if (depth == 0) {
113
+ state.tokenize.pop();
114
+ return state.tokenize[state.tokenize.length-1](stream, state);
115
+ }
116
+ } else if (stream.peek() == "{") {
117
+ depth++;
118
+ }
119
+ return tokenBase(stream, state);
120
+ }
121
+ t.isBase = true;
122
+ return t;
123
+ }
124
+
125
+ function tokenComment(stream, state) {
126
+ var maybeEnd = false, ch;
127
+ while (ch = stream.next()) {
128
+ if (ch == "/" && maybeEnd) {
129
+ state.tokenize.pop();
130
+ break;
131
+ }
132
+ maybeEnd = (ch == "*");
133
+ }
134
+ return "comment";
135
+ }
136
+
137
+ function expectExpression(last, newline) {
138
+ return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) ||
139
+ last == "newstatement" || last == "keyword" || last == "proplabel" ||
140
+ (last == "standalone" && !newline);
141
+ }
142
+
143
+ function Context(indented, column, type, align, prev) {
144
+ this.indented = indented;
145
+ this.column = column;
146
+ this.type = type;
147
+ this.align = align;
148
+ this.prev = prev;
149
+ }
150
+ function pushContext(state, col, type) {
151
+ return state.context = new Context(state.indented, col, type, null, state.context);
152
+ }
153
+ function popContext(state) {
154
+ var t = state.context.type;
155
+ if (t == ")" || t == "]" || t == "}")
156
+ state.indented = state.context.indented;
157
+ return state.context = state.context.prev;
158
+ }
159
+
160
+ // Interface
161
+
162
+ return {
163
+ startState: function(basecolumn) {
164
+ return {
165
+ tokenize: [tokenBase],
166
+ context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false),
167
+ indented: 0,
168
+ startOfLine: true,
169
+ lastToken: null
170
+ };
171
+ },
172
+
173
+ token: function(stream, state) {
174
+ var ctx = state.context;
175
+ if (stream.sol()) {
176
+ if (ctx.align == null) ctx.align = false;
177
+ state.indented = stream.indentation();
178
+ state.startOfLine = true;
179
+ // Automatic semicolon insertion
180
+ if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) {
181
+ popContext(state); ctx = state.context;
182
+ }
183
+ }
184
+ if (stream.eatSpace()) return null;
185
+ curPunc = null;
186
+ var style = state.tokenize[state.tokenize.length-1](stream, state);
187
+ if (style == "comment") return style;
188
+ if (ctx.align == null) ctx.align = true;
189
+
190
+ if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
191
+ // Handle indentation for {x -> \n ... }
192
+ else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") {
193
+ popContext(state);
194
+ state.context.align = false;
195
+ }
196
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
197
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
198
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
199
+ else if (curPunc == "}") {
200
+ while (ctx.type == "statement") ctx = popContext(state);
201
+ if (ctx.type == "}") ctx = popContext(state);
202
+ while (ctx.type == "statement") ctx = popContext(state);
203
+ }
204
+ else if (curPunc == ctx.type) popContext(state);
205
+ else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
206
+ pushContext(state, stream.column(), "statement");
207
+ state.startOfLine = false;
208
+ state.lastToken = curPunc || style;
209
+ return style;
210
+ },
211
+
212
+ indent: function(state, textAfter) {
213
+ if (!state.tokenize[state.tokenize.length-1].isBase) return 0;
214
+ var firstChar = textAfter && textAfter.charAt(0), ctx = state.context;
215
+ if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) ctx = ctx.prev;
216
+ var closing = firstChar == ctx.type;
217
+ if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit);
218
+ else if (ctx.align) return ctx.column + (closing ? 0 : 1);
219
+ else return ctx.indented + (closing ? 0 : config.indentUnit);
220
+ },
221
+
222
+ electricChars: "{}",
223
+ closeBrackets: {triples: "'\""},
224
+ fold: "brace"
225
+ };
226
+ });
227
+
228
+ CodeMirror.defineMIME("text/x-groovy", "groovy");
229
+
230
+ });
assets/js/vendor/codemirror/mode/groovy/index.html ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Groovy mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="groovy.js"></script>
11
+ <style>.CodeMirror {border-top: 1px solid #500; border-bottom: 1px solid #500;}</style>
12
+ <div id=nav>
13
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
14
+
15
+ <ul>
16
+ <li><a href="../../index.html">Home</a>
17
+ <li><a href="../../doc/manual.html">Manual</a>
18
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
19
+ </ul>
20
+ <ul>
21
+ <li><a href="../index.html">Language modes</a>
22
+ <li><a class=active href="#">Groovy</a>
23
+ </ul>
24
+ </div>
25
+
26
+ <article>
27
+ <h2>Groovy mode</h2>
28
+ <form><textarea id="code" name="code">
29
+ //Pattern for groovy script
30
+ def p = ~/.*\.groovy/
31
+ new File( 'd:\\scripts' ).eachFileMatch(p) {f ->
32
+ // imports list
33
+ def imports = []
34
+ f.eachLine {
35
+ // condition to detect an import instruction
36
+ ln -> if ( ln =~ '^import .*' ) {
37
+ imports << "${ln - 'import '}"
38
+ }
39
+ }
40
+ // print thmen
41
+ if ( ! imports.empty ) {
42
+ println f
43
+ imports.each{ println " $it" }
44
+ }
45
+ }
46
+
47
+ /* Coin changer demo code from http://groovy.codehaus.org */
48
+
49
+ enum UsCoin {
50
+ quarter(25), dime(10), nickel(5), penny(1)
51
+ UsCoin(v) { value = v }
52
+ final value
53
+ }
54
+
55
+ enum OzzieCoin {
56
+ fifty(50), twenty(20), ten(10), five(5)
57
+ OzzieCoin(v) { value = v }
58
+ final value
59
+ }
60
+
61
+ def plural(word, count) {
62
+ if (count == 1) return word
63
+ word[-1] == 'y' ? word[0..-2] + "ies" : word + "s"
64
+ }
65
+
66
+ def change(currency, amount) {
67
+ currency.values().inject([]){ list, coin ->
68
+ int count = amount / coin.value
69
+ amount = amount % coin.value
70
+ list += "$count ${plural(coin.toString(), count)}"
71
+ }
72
+ }
73
+ </textarea></form>
74
+
75
+ <script>
76
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
77
+ lineNumbers: true,
78
+ matchBrackets: true,
79
+ mode: "text/x-groovy"
80
+ });
81
+ </script>
82
+
83
+ <p><strong>MIME types defined:</strong> <code>text/x-groovy</code></p>
84
+ </article>
assets/js/vendor/codemirror/mode/handlebars/handlebars.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineSimpleMode("handlebars", {
15
+ start: [
16
+ { regex: /\{\{!--/, push: "dash_comment", token: "comment" },
17
+ { regex: /\{\{!/, push: "comment", token: "comment" },
18
+ { regex: /\{\{/, push: "handlebars", token: "tag" }
19
+ ],
20
+ handlebars: [
21
+ { regex: /\}\}/, pop: true, token: "tag" },
22
+
23
+ // Double and single quotes
24
+ { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
25
+ { regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
26
+
27
+ // Handlebars keywords
28
+ { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" },
29
+ { regex: /(?:else|this)\b/, token: "keyword" },
30
+
31
+ // Numeral
32
+ { regex: /\d+/i, token: "number" },
33
+
34
+ // Atoms like = and .
35
+ { regex: /=|~|@|true|false/, token: "atom" },
36
+
37
+ // Paths
38
+ { regex: /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/, token: "variable-2" }
39
+ ],
40
+ dash_comment: [
41
+ { regex: /--\}\}/, pop: true, token: "comment" },
42
+
43
+ // Commented code
44
+ { regex: /./, token: "comment"}
45
+ ],
46
+ comment: [
47
+ { regex: /\}\}/, pop: true, token: "comment" },
48
+ { regex: /./, token: "comment" }
49
+ ]
50
+ });
51
+
52
+ CodeMirror.defineMIME("text/x-handlebars-template", "handlebars");
53
+ });
assets/js/vendor/codemirror/mode/handlebars/index.html ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Handlebars mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/mode/simple.js"></script>
10
+ <script src="../../addon/mode/multiplex.js"></script>
11
+ <script src="../xml/xml.js"></script>
12
+ <script src="handlebars.js"></script>
13
+ <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#">HTML mixed</a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>Handlebars</h2>
30
+ <form><textarea id="code" name="code">
31
+ {{> breadcrumbs}}
32
+
33
+ {{!--
34
+ You can use the t function to get
35
+ content translated to the current locale, es:
36
+ {{t 'article_list'}}
37
+ --}}
38
+
39
+ <h1>{{t 'article_list'}}</h1>
40
+
41
+ {{! one line comment }}
42
+
43
+ {{#each articles}}
44
+ {{~title}}
45
+ <p>{{excerpt body size=120 ellipsis=true}}</p>
46
+
47
+ {{#with author}}
48
+ written by {{first_name}} {{last_name}}
49
+ from category: {{../category.title}}
50
+ {{#if @../last}}foobar!{{/if}}
51
+ {{/with~}}
52
+
53
+ {{#if promoted.latest}}Read this one! {{else}} This is ok! {{/if}}
54
+
55
+ {{#if @last}}<hr>{{/if}}
56
+ {{/each}}
57
+
58
+ {{#form new_comment}}
59
+ <input type="text" name="body">
60
+ {{/form}}
61
+
62
+ </textarea></form>
63
+ <script>
64
+ CodeMirror.defineMode("htmlhandlebars", function(config) {
65
+ return CodeMirror.multiplexingMode(
66
+ CodeMirror.getMode(config, "text/html"),
67
+ {open: "{{", close: "}}",
68
+ mode: CodeMirror.getMode(config, "handlebars"),
69
+ parseDelimiters: true});
70
+ });
71
+
72
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
73
+ lineNumbers: true,
74
+ matchBrackets: true,
75
+ mode: "htmlhandlebars"
76
+ });
77
+ </script>
78
+ </script>
79
+
80
+ <p>Handlebars syntax highlighting for CodeMirror.</p>
81
+
82
+ <p><strong>MIME types defined:</strong> <code>text/x-handlebars-template</code></p>
83
+ </article>
assets/js/vendor/codemirror/mode/haskell/haskell.js ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("haskell", function(_config, modeConfig) {
15
+
16
+ function switchState(source, setState, f) {
17
+ setState(f);
18
+ return f(source, setState);
19
+ }
20
+
21
+ // These should all be Unicode extended, as per the Haskell 2010 report
22
+ var smallRE = /[a-z_]/;
23
+ var largeRE = /[A-Z]/;
24
+ var digitRE = /\d/;
25
+ var hexitRE = /[0-9A-Fa-f]/;
26
+ var octitRE = /[0-7]/;
27
+ var idRE = /[a-z_A-Z0-9'\xa1-\uffff]/;
28
+ var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/;
29
+ var specialRE = /[(),;[\]`{}]/;
30
+ var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer
31
+
32
+ function normal(source, setState) {
33
+ if (source.eatWhile(whiteCharRE)) {
34
+ return null;
35
+ }
36
+
37
+ var ch = source.next();
38
+ if (specialRE.test(ch)) {
39
+ if (ch == '{' && source.eat('-')) {
40
+ var t = "comment";
41
+ if (source.eat('#')) {
42
+ t = "meta";
43
+ }
44
+ return switchState(source, setState, ncomment(t, 1));
45
+ }
46
+ return null;
47
+ }
48
+
49
+ if (ch == '\'') {
50
+ if (source.eat('\\')) {
51
+ source.next(); // should handle other escapes here
52
+ }
53
+ else {
54
+ source.next();
55
+ }
56
+ if (source.eat('\'')) {
57
+ return "string";
58
+ }
59
+ return "error";
60
+ }
61
+
62
+ if (ch == '"') {
63
+ return switchState(source, setState, stringLiteral);
64
+ }
65
+
66
+ if (largeRE.test(ch)) {
67
+ source.eatWhile(idRE);
68
+ if (source.eat('.')) {
69
+ return "qualifier";
70
+ }
71
+ return "variable-2";
72
+ }
73
+
74
+ if (smallRE.test(ch)) {
75
+ source.eatWhile(idRE);
76
+ return "variable";
77
+ }
78
+
79
+ if (digitRE.test(ch)) {
80
+ if (ch == '0') {
81
+ if (source.eat(/[xX]/)) {
82
+ source.eatWhile(hexitRE); // should require at least 1
83
+ return "integer";
84
+ }
85
+ if (source.eat(/[oO]/)) {
86
+ source.eatWhile(octitRE); // should require at least 1
87
+ return "number";
88
+ }
89
+ }
90
+ source.eatWhile(digitRE);
91
+ var t = "number";
92
+ if (source.match(/^\.\d+/)) {
93
+ t = "number";
94
+ }
95
+ if (source.eat(/[eE]/)) {
96
+ t = "number";
97
+ source.eat(/[-+]/);
98
+ source.eatWhile(digitRE); // should require at least 1
99
+ }
100
+ return t;
101
+ }
102
+
103
+ if (ch == "." && source.eat("."))
104
+ return "keyword";
105
+
106
+ if (symbolRE.test(ch)) {
107
+ if (ch == '-' && source.eat(/-/)) {
108
+ source.eatWhile(/-/);
109
+ if (!source.eat(symbolRE)) {
110
+ source.skipToEnd();
111
+ return "comment";
112
+ }
113
+ }
114
+ var t = "variable";
115
+ if (ch == ':') {
116
+ t = "variable-2";
117
+ }
118
+ source.eatWhile(symbolRE);
119
+ return t;
120
+ }
121
+
122
+ return "error";
123
+ }
124
+
125
+ function ncomment(type, nest) {
126
+ if (nest == 0) {
127
+ return normal;
128
+ }
129
+ return function(source, setState) {
130
+ var currNest = nest;
131
+ while (!source.eol()) {
132
+ var ch = source.next();
133
+ if (ch == '{' && source.eat('-')) {
134
+ ++currNest;
135
+ }
136
+ else if (ch == '-' && source.eat('}')) {
137
+ --currNest;
138
+ if (currNest == 0) {
139
+ setState(normal);
140
+ return type;
141
+ }
142
+ }
143
+ }
144
+ setState(ncomment(type, currNest));
145
+ return type;
146
+ };
147
+ }
148
+
149
+ function stringLiteral(source, setState) {
150
+ while (!source.eol()) {
151
+ var ch = source.next();
152
+ if (ch == '"') {
153
+ setState(normal);
154
+ return "string";
155
+ }
156
+ if (ch == '\\') {
157
+ if (source.eol() || source.eat(whiteCharRE)) {
158
+ setState(stringGap);
159
+ return "string";
160
+ }
161
+ if (source.eat('&')) {
162
+ }
163
+ else {
164
+ source.next(); // should handle other escapes here
165
+ }
166
+ }
167
+ }
168
+ setState(normal);
169
+ return "error";
170
+ }
171
+
172
+ function stringGap(source, setState) {
173
+ if (source.eat('\\')) {
174
+ return switchState(source, setState, stringLiteral);
175
+ }
176
+ source.next();
177
+ setState(normal);
178
+ return "error";
179
+ }
180
+
181
+
182
+ var wellKnownWords = (function() {
183
+ var wkw = {};
184
+ function setType(t) {
185
+ return function () {
186
+ for (var i = 0; i < arguments.length; i++)
187
+ wkw[arguments[i]] = t;
188
+ };
189
+ }
190
+
191
+ setType("keyword")(
192
+ "case", "class", "data", "default", "deriving", "do", "else", "foreign",
193
+ "if", "import", "in", "infix", "infixl", "infixr", "instance", "let",
194
+ "module", "newtype", "of", "then", "type", "where", "_");
195
+
196
+ setType("keyword")(
197
+ "\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>");
198
+
199
+ setType("builtin")(
200
+ "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<",
201
+ "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**");
202
+
203
+ setType("builtin")(
204
+ "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq",
205
+ "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT",
206
+ "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left",
207
+ "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read",
208
+ "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS",
209
+ "String", "True");
210
+
211
+ setType("builtin")(
212
+ "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf",
213
+ "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling",
214
+ "compare", "concat", "concatMap", "const", "cos", "cosh", "curry",
215
+ "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either",
216
+ "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo",
217
+ "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter",
218
+ "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap",
219
+ "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger",
220
+ "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents",
221
+ "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized",
222
+ "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last",
223
+ "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map",
224
+ "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound",
225
+ "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or",
226
+ "otherwise", "pi", "pred", "print", "product", "properFraction",
227
+ "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile",
228
+ "readIO", "readList", "readLn", "readParen", "reads", "readsPrec",
229
+ "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse",
230
+ "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq",
231
+ "sequence", "sequence_", "show", "showChar", "showList", "showParen",
232
+ "showString", "shows", "showsPrec", "significand", "signum", "sin",
233
+ "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum",
234
+ "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger",
235
+ "toRational", "truncate", "uncurry", "undefined", "unlines", "until",
236
+ "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip",
237
+ "zip3", "zipWith", "zipWith3");
238
+
239
+ var override = modeConfig.overrideKeywords;
240
+ if (override) for (var word in override) if (override.hasOwnProperty(word))
241
+ wkw[word] = override[word];
242
+
243
+ return wkw;
244
+ })();
245
+
246
+
247
+
248
+ return {
249
+ startState: function () { return { f: normal }; },
250
+ copyState: function (s) { return { f: s.f }; },
251
+
252
+ token: function(stream, state) {
253
+ var t = state.f(stream, function(s) { state.f = s; });
254
+ var w = stream.current();
255
+ return wellKnownWords.hasOwnProperty(w) ? wellKnownWords[w] : t;
256
+ },
257
+
258
+ blockCommentStart: "{-",
259
+ blockCommentEnd: "-}",
260
+ lineComment: "--"
261
+ };
262
+
263
+ });
264
+
265
+ CodeMirror.defineMIME("text/x-haskell", "haskell");
266
+
267
+ });
assets/js/vendor/codemirror/mode/haskell/index.html ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Haskell mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/elegant.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="../../addon/edit/matchbrackets.js"></script>
11
+ <script src="haskell.js"></script>
12
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
13
+ <div id=nav>
14
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
15
+
16
+ <ul>
17
+ <li><a href="../../index.html">Home</a>
18
+ <li><a href="../../doc/manual.html">Manual</a>
19
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
20
+ </ul>
21
+ <ul>
22
+ <li><a href="../index.html">Language modes</a>
23
+ <li><a class=active href="#">Haskell</a>
24
+ </ul>
25
+ </div>
26
+
27
+ <article>
28
+ <h2>Haskell mode</h2>
29
+ <form><textarea id="code" name="code">
30
+ module UniquePerms (
31
+ uniquePerms
32
+ )
33
+ where
34
+
35
+ -- | Find all unique permutations of a list where there might be duplicates.
36
+ uniquePerms :: (Eq a) => [a] -> [[a]]
37
+ uniquePerms = permBag . makeBag
38
+
39
+ -- | An unordered collection where duplicate values are allowed,
40
+ -- but represented with a single value and a count.
41
+ type Bag a = [(a, Int)]
42
+
43
+ makeBag :: (Eq a) => [a] -> Bag a
44
+ makeBag [] = []
45
+ makeBag (a:as) = mix a $ makeBag as
46
+ where
47
+ mix a [] = [(a,1)]
48
+ mix a (bn@(b,n):bs) | a == b = (b,n+1):bs
49
+ | otherwise = bn : mix a bs
50
+
51
+ permBag :: Bag a -> [[a]]
52
+ permBag [] = [[]]
53
+ permBag bs = concatMap (\(f,cs) -> map (f:) $ permBag cs) . oneOfEach $ bs
54
+ where
55
+ oneOfEach [] = []
56
+ oneOfEach (an@(a,n):bs) =
57
+ let bs' = if n == 1 then bs else (a,n-1):bs
58
+ in (a,bs') : mapSnd (an:) (oneOfEach bs)
59
+
60
+ apSnd f (a,b) = (a, f b)
61
+ mapSnd = map . apSnd
62
+ </textarea></form>
63
+
64
+ <script>
65
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
66
+ lineNumbers: true,
67
+ matchBrackets: true,
68
+ theme: "elegant"
69
+ });
70
+ </script>
71
+
72
+ <p><strong>MIME types defined:</strong> <code>text/x-haskell</code>.</p>
73
+ </article>
assets/js/vendor/codemirror/mode/haxe/haxe.js ADDED
@@ -0,0 +1,515 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("haxe", function(config, parserConfig) {
15
+ var indentUnit = config.indentUnit;
16
+
17
+ // Tokenizer
18
+
19
+ function kw(type) {return {type: type, style: "keyword"};}
20
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
21
+ var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"};
22
+ var type = kw("typedef");
23
+ var keywords = {
24
+ "if": A, "while": A, "else": B, "do": B, "try": B,
25
+ "return": C, "break": C, "continue": C, "new": C, "throw": C,
26
+ "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"),
27
+ "public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"),
28
+ "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"),
29
+ "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
30
+ "in": operator, "never": kw("property_access"), "trace":kw("trace"),
31
+ "class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type,
32
+ "true": atom, "false": atom, "null": atom
33
+ };
34
+
35
+ var isOperatorChar = /[+\-*&%=<>!?|]/;
36
+
37
+ function chain(stream, state, f) {
38
+ state.tokenize = f;
39
+ return f(stream, state);
40
+ }
41
+
42
+ function toUnescaped(stream, end) {
43
+ var escaped = false, next;
44
+ while ((next = stream.next()) != null) {
45
+ if (next == end && !escaped)
46
+ return true;
47
+ escaped = !escaped && next == "\\";
48
+ }
49
+ }
50
+
51
+ // Used as scratch variables to communicate multiple values without
52
+ // consing up tons of objects.
53
+ var type, content;
54
+ function ret(tp, style, cont) {
55
+ type = tp; content = cont;
56
+ return style;
57
+ }
58
+
59
+ function haxeTokenBase(stream, state) {
60
+ var ch = stream.next();
61
+ if (ch == '"' || ch == "'") {
62
+ return chain(stream, state, haxeTokenString(ch));
63
+ } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
64
+ return ret(ch);
65
+ } else if (ch == "0" && stream.eat(/x/i)) {
66
+ stream.eatWhile(/[\da-f]/i);
67
+ return ret("number", "number");
68
+ } else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
69
+ stream.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/);
70
+ return ret("number", "number");
71
+ } else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) {
72
+ toUnescaped(stream, "/");
73
+ stream.eatWhile(/[gimsu]/);
74
+ return ret("regexp", "string-2");
75
+ } else if (ch == "/") {
76
+ if (stream.eat("*")) {
77
+ return chain(stream, state, haxeTokenComment);
78
+ } else if (stream.eat("/")) {
79
+ stream.skipToEnd();
80
+ return ret("comment", "comment");
81
+ } else {
82
+ stream.eatWhile(isOperatorChar);
83
+ return ret("operator", null, stream.current());
84
+ }
85
+ } else if (ch == "#") {
86
+ stream.skipToEnd();
87
+ return ret("conditional", "meta");
88
+ } else if (ch == "@") {
89
+ stream.eat(/:/);
90
+ stream.eatWhile(/[\w_]/);
91
+ return ret ("metadata", "meta");
92
+ } else if (isOperatorChar.test(ch)) {
93
+ stream.eatWhile(isOperatorChar);
94
+ return ret("operator", null, stream.current());
95
+ } else {
96
+ var word;
97
+ if(/[A-Z]/.test(ch)) {
98
+ stream.eatWhile(/[\w_<>]/);
99
+ word = stream.current();
100
+ return ret("type", "variable-3", word);
101
+ } else {
102
+ stream.eatWhile(/[\w_]/);
103
+ var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
104
+ return (known && state.kwAllowed) ? ret(known.type, known.style, word) :
105
+ ret("variable", "variable", word);
106
+ }
107
+ }
108
+ }
109
+
110
+ function haxeTokenString(quote) {
111
+ return function(stream, state) {
112
+ if (toUnescaped(stream, quote))
113
+ state.tokenize = haxeTokenBase;
114
+ return ret("string", "string");
115
+ };
116
+ }
117
+
118
+ function haxeTokenComment(stream, state) {
119
+ var maybeEnd = false, ch;
120
+ while (ch = stream.next()) {
121
+ if (ch == "/" && maybeEnd) {
122
+ state.tokenize = haxeTokenBase;
123
+ break;
124
+ }
125
+ maybeEnd = (ch == "*");
126
+ }
127
+ return ret("comment", "comment");
128
+ }
129
+
130
+ // Parser
131
+
132
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
133
+
134
+ function HaxeLexical(indented, column, type, align, prev, info) {
135
+ this.indented = indented;
136
+ this.column = column;
137
+ this.type = type;
138
+ this.prev = prev;
139
+ this.info = info;
140
+ if (align != null) this.align = align;
141
+ }
142
+
143
+ function inScope(state, varname) {
144
+ for (var v = state.localVars; v; v = v.next)
145
+ if (v.name == varname) return true;
146
+ }
147
+
148
+ function parseHaxe(state, style, type, content, stream) {
149
+ var cc = state.cc;
150
+ // Communicate our context to the combinators.
151
+ // (Less wasteful than consing up a hundred closures on every call.)
152
+ cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
153
+
154
+ if (!state.lexical.hasOwnProperty("align"))
155
+ state.lexical.align = true;
156
+
157
+ while(true) {
158
+ var combinator = cc.length ? cc.pop() : statement;
159
+ if (combinator(type, content)) {
160
+ while(cc.length && cc[cc.length - 1].lex)
161
+ cc.pop()();
162
+ if (cx.marked) return cx.marked;
163
+ if (type == "variable" && inScope(state, content)) return "variable-2";
164
+ if (type == "variable" && imported(state, content)) return "variable-3";
165
+ return style;
166
+ }
167
+ }
168
+ }
169
+
170
+ function imported(state, typename) {
171
+ if (/[a-z]/.test(typename.charAt(0)))
172
+ return false;
173
+ var len = state.importedtypes.length;
174
+ for (var i = 0; i<len; i++)
175
+ if(state.importedtypes[i]==typename) return true;
176
+ }
177
+
178
+ function registerimport(importname) {
179
+ var state = cx.state;
180
+ for (var t = state.importedtypes; t; t = t.next)
181
+ if(t.name == importname) return;
182
+ state.importedtypes = { name: importname, next: state.importedtypes };
183
+ }
184
+ // Combinator utils
185
+
186
+ var cx = {state: null, column: null, marked: null, cc: null};
187
+ function pass() {
188
+ for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
189
+ }
190
+ function cont() {
191
+ pass.apply(null, arguments);
192
+ return true;
193
+ }
194
+ function inList(name, list) {
195
+ for (var v = list; v; v = v.next)
196
+ if (v.name == name) return true;
197
+ return false;
198
+ }
199
+ function register(varname) {
200
+ var state = cx.state;
201
+ if (state.context) {
202
+ cx.marked = "def";
203
+ if (inList(varname, state.localVars)) return;
204
+ state.localVars = {name: varname, next: state.localVars};
205
+ } else if (state.globalVars) {
206
+ if (inList(varname, state.globalVars)) return;
207
+ state.globalVars = {name: varname, next: state.globalVars};
208
+ }
209
+ }
210
+
211
+ // Combinators
212
+
213
+ var defaultVars = {name: "this", next: null};
214
+ function pushcontext() {
215
+ if (!cx.state.context) cx.state.localVars = defaultVars;
216
+ cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
217
+ }
218
+ function popcontext() {
219
+ cx.state.localVars = cx.state.context.vars;
220
+ cx.state.context = cx.state.context.prev;
221
+ }
222
+ popcontext.lex = true;
223
+ function pushlex(type, info) {
224
+ var result = function() {
225
+ var state = cx.state;
226
+ state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info);
227
+ };
228
+ result.lex = true;
229
+ return result;
230
+ }
231
+ function poplex() {
232
+ var state = cx.state;
233
+ if (state.lexical.prev) {
234
+ if (state.lexical.type == ")")
235
+ state.indented = state.lexical.indented;
236
+ state.lexical = state.lexical.prev;
237
+ }
238
+ }
239
+ poplex.lex = true;
240
+
241
+ function expect(wanted) {
242
+ function f(type) {
243
+ if (type == wanted) return cont();
244
+ else if (wanted == ";") return pass();
245
+ else return cont(f);
246
+ }
247
+ return f;
248
+ }
249
+
250
+ function statement(type) {
251
+ if (type == "@") return cont(metadef);
252
+ if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
253
+ if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
254
+ if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
255
+ if (type == "{") return cont(pushlex("}"), pushcontext, block, poplex, popcontext);
256
+ if (type == ";") return cont();
257
+ if (type == "attribute") return cont(maybeattribute);
258
+ if (type == "function") return cont(functiondef);
259
+ if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
260
+ poplex, statement, poplex);
261
+ if (type == "variable") return cont(pushlex("stat"), maybelabel);
262
+ if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
263
+ block, poplex, poplex);
264
+ if (type == "case") return cont(expression, expect(":"));
265
+ if (type == "default") return cont(expect(":"));
266
+ if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
267
+ statement, poplex, popcontext);
268
+ if (type == "import") return cont(importdef, expect(";"));
269
+ if (type == "typedef") return cont(typedef);
270
+ return pass(pushlex("stat"), expression, expect(";"), poplex);
271
+ }
272
+ function expression(type) {
273
+ if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
274
+ if (type == "type" ) return cont(maybeoperator);
275
+ if (type == "function") return cont(functiondef);
276
+ if (type == "keyword c") return cont(maybeexpression);
277
+ if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
278
+ if (type == "operator") return cont(expression);
279
+ if (type == "[") return cont(pushlex("]"), commasep(maybeexpression, "]"), poplex, maybeoperator);
280
+ if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
281
+ return cont();
282
+ }
283
+ function maybeexpression(type) {
284
+ if (type.match(/[;\}\)\],]/)) return pass();
285
+ return pass(expression);
286
+ }
287
+
288
+ function maybeoperator(type, value) {
289
+ if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator);
290
+ if (type == "operator" || type == ":") return cont(expression);
291
+ if (type == ";") return;
292
+ if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
293
+ if (type == ".") return cont(property, maybeoperator);
294
+ if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
295
+ }
296
+
297
+ function maybeattribute(type) {
298
+ if (type == "attribute") return cont(maybeattribute);
299
+ if (type == "function") return cont(functiondef);
300
+ if (type == "var") return cont(vardef1);
301
+ }
302
+
303
+ function metadef(type) {
304
+ if(type == ":") return cont(metadef);
305
+ if(type == "variable") return cont(metadef);
306
+ if(type == "(") return cont(pushlex(")"), commasep(metaargs, ")"), poplex, statement);
307
+ }
308
+ function metaargs(type) {
309
+ if(type == "variable") return cont();
310
+ }
311
+
312
+ function importdef (type, value) {
313
+ if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
314
+ else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef);
315
+ }
316
+
317
+ function typedef (type, value)
318
+ {
319
+ if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
320
+ else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); }
321
+ }
322
+
323
+ function maybelabel(type) {
324
+ if (type == ":") return cont(poplex, statement);
325
+ return pass(maybeoperator, expect(";"), poplex);
326
+ }
327
+ function property(type) {
328
+ if (type == "variable") {cx.marked = "property"; return cont();}
329
+ }
330
+ function objprop(type) {
331
+ if (type == "variable") cx.marked = "property";
332
+ if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression);
333
+ }
334
+ function commasep(what, end) {
335
+ function proceed(type) {
336
+ if (type == ",") return cont(what, proceed);
337
+ if (type == end) return cont();
338
+ return cont(expect(end));
339
+ }
340
+ return function(type) {
341
+ if (type == end) return cont();
342
+ else return pass(what, proceed);
343
+ };
344
+ }
345
+ function block(type) {
346
+ if (type == "}") return cont();
347
+ return pass(statement, block);
348
+ }
349
+ function vardef1(type, value) {
350
+ if (type == "variable"){register(value); return cont(typeuse, vardef2);}
351
+ return cont();
352
+ }
353
+ function vardef2(type, value) {
354
+ if (value == "=") return cont(expression, vardef2);
355
+ if (type == ",") return cont(vardef1);
356
+ }
357
+ function forspec1(type, value) {
358
+ if (type == "variable") {
359
+ register(value);
360
+ return cont(forin, expression)
361
+ } else {
362
+ return pass()
363
+ }
364
+ }
365
+ function forin(_type, value) {
366
+ if (value == "in") return cont();
367
+ }
368
+ function functiondef(type, value) {
369
+ //function names starting with upper-case letters are recognised as types, so cludging them together here.
370
+ if (type == "variable" || type == "type") {register(value); return cont(functiondef);}
371
+ if (value == "new") return cont(functiondef);
372
+ if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext);
373
+ }
374
+ function typeuse(type) {
375
+ if(type == ":") return cont(typestring);
376
+ }
377
+ function typestring(type) {
378
+ if(type == "type") return cont();
379
+ if(type == "variable") return cont();
380
+ if(type == "{") return cont(pushlex("}"), commasep(typeprop, "}"), poplex);
381
+ }
382
+ function typeprop(type) {
383
+ if(type == "variable") return cont(typeuse);
384
+ }
385
+ function funarg(type, value) {
386
+ if (type == "variable") {register(value); return cont(typeuse);}
387
+ }
388
+
389
+ // Interface
390
+ return {
391
+ startState: function(basecolumn) {
392
+ var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"];
393
+ var state = {
394
+ tokenize: haxeTokenBase,
395
+ reAllowed: true,
396
+ kwAllowed: true,
397
+ cc: [],
398
+ lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false),
399
+ localVars: parserConfig.localVars,
400
+ importedtypes: defaulttypes,
401
+ context: parserConfig.localVars && {vars: parserConfig.localVars},
402
+ indented: 0
403
+ };
404
+ if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
405
+ state.globalVars = parserConfig.globalVars;
406
+ return state;
407
+ },
408
+
409
+ token: function(stream, state) {
410
+ if (stream.sol()) {
411
+ if (!state.lexical.hasOwnProperty("align"))
412
+ state.lexical.align = false;
413
+ state.indented = stream.indentation();
414
+ }
415
+ if (stream.eatSpace()) return null;
416
+ var style = state.tokenize(stream, state);
417
+ if (type == "comment") return style;
418
+ state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/));
419
+ state.kwAllowed = type != '.';
420
+ return parseHaxe(state, style, type, content, stream);
421
+ },
422
+
423
+ indent: function(state, textAfter) {
424
+ if (state.tokenize != haxeTokenBase) return 0;
425
+ var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
426
+ if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
427
+ var type = lexical.type, closing = firstChar == type;
428
+ if (type == "vardef") return lexical.indented + 4;
429
+ else if (type == "form" && firstChar == "{") return lexical.indented;
430
+ else if (type == "stat" || type == "form") return lexical.indented + indentUnit;
431
+ else if (lexical.info == "switch" && !closing)
432
+ return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
433
+ else if (lexical.align) return lexical.column + (closing ? 0 : 1);
434
+ else return lexical.indented + (closing ? 0 : indentUnit);
435
+ },
436
+
437
+ electricChars: "{}",
438
+ blockCommentStart: "/*",
439
+ blockCommentEnd: "*/",
440
+ lineComment: "//"
441
+ };
442
+ });
443
+
444
+ CodeMirror.defineMIME("text/x-haxe", "haxe");
445
+
446
+ CodeMirror.defineMode("hxml", function () {
447
+
448
+ return {
449
+ startState: function () {
450
+ return {
451
+ define: false,
452
+ inString: false
453
+ };
454
+ },
455
+ token: function (stream, state) {
456
+ var ch = stream.peek();
457
+ var sol = stream.sol();
458
+
459
+ ///* comments */
460
+ if (ch == "#") {
461
+ stream.skipToEnd();
462
+ return "comment";
463
+ }
464
+ if (sol && ch == "-") {
465
+ var style = "variable-2";
466
+
467
+ stream.eat(/-/);
468
+
469
+ if (stream.peek() == "-") {
470
+ stream.eat(/-/);
471
+ style = "keyword a";
472
+ }
473
+
474
+ if (stream.peek() == "D") {
475
+ stream.eat(/[D]/);
476
+ style = "keyword c";
477
+ state.define = true;
478
+ }
479
+
480
+ stream.eatWhile(/[A-Z]/i);
481
+ return style;
482
+ }
483
+
484
+ var ch = stream.peek();
485
+
486
+ if (state.inString == false && ch == "'") {
487
+ state.inString = true;
488
+ ch = stream.next();
489
+ }
490
+
491
+ if (state.inString == true) {
492
+ if (stream.skipTo("'")) {
493
+
494
+ } else {
495
+ stream.skipToEnd();
496
+ }
497
+
498
+ if (stream.peek() == "'") {
499
+ stream.next();
500
+ state.inString = false;
501
+ }
502
+
503
+ return "string";
504
+ }
505
+
506
+ stream.next();
507
+ return null;
508
+ },
509
+ lineComment: "#"
510
+ };
511
+ });
512
+
513
+ CodeMirror.defineMIME("text/x-hxml", "hxml");
514
+
515
+ });
assets/js/vendor/codemirror/mode/haxe/index.html ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Haxe mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="haxe.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Haxe</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Haxe mode</h2>
27
+
28
+
29
+ <div><p><textarea id="code-haxe" name="code">
30
+ import one.two.Three;
31
+
32
+ @attr("test")
33
+ class Foo&lt;T&gt; extends Three
34
+ {
35
+ public function new()
36
+ {
37
+ noFoo = 12;
38
+ }
39
+
40
+ public static inline function doFoo(obj:{k:Int, l:Float}):Int
41
+ {
42
+ for(i in 0...10)
43
+ {
44
+ obj.k++;
45
+ trace(i);
46
+ var var1 = new Array();
47
+ if(var1.length > 1)
48
+ throw "Error";
49
+ }
50
+ // The following line should not be colored, the variable is scoped out
51
+ var1;
52
+ /* Multi line
53
+ * Comment test
54
+ */
55
+ return obj.k;
56
+ }
57
+ private function bar():Void
58
+ {
59
+ #if flash
60
+ var t1:String = "1.21";
61
+ #end
62
+ try {
63
+ doFoo({k:3, l:1.2});
64
+ }
65
+ catch (e : String) {
66
+ trace(e);
67
+ }
68
+ var t2:Float = cast(3.2);
69
+ var t3:haxe.Timer = new haxe.Timer();
70
+ var t4 = {k:Std.int(t2), l:Std.parseFloat(t1)};
71
+ var t5 = ~/123+.*$/i;
72
+ doFoo(t4);
73
+ untyped t1 = 4;
74
+ bob = new Foo&lt;Int&gt;
75
+ }
76
+ public var okFoo(default, never):Float;
77
+ var noFoo(getFoo, null):Int;
78
+ function getFoo():Int {
79
+ return noFoo;
80
+ }
81
+
82
+ public var three:Int;
83
+ }
84
+ enum Color
85
+ {
86
+ red;
87
+ green;
88
+ blue;
89
+ grey( v : Int );
90
+ rgb (r:Int,g:Int,b:Int);
91
+ }
92
+ </textarea></p>
93
+
94
+ <p>Hxml mode:</p>
95
+
96
+ <p><textarea id="code-hxml">
97
+ -cp test
98
+ -js path/to/file.js
99
+ #-remap nme:flash
100
+ --next
101
+ -D source-map-content
102
+ -cmd 'test'
103
+ -lib lime
104
+ </textarea></p>
105
+ </div>
106
+
107
+ <script>
108
+ var editor = CodeMirror.fromTextArea(document.getElementById("code-haxe"), {
109
+ mode: "haxe",
110
+ lineNumbers: true,
111
+ indentUnit: 4,
112
+ indentWithTabs: true
113
+ });
114
+
115
+ editor = CodeMirror.fromTextArea(document.getElementById("code-hxml"), {
116
+ mode: "hxml",
117
+ lineNumbers: true,
118
+ indentUnit: 4,
119
+ indentWithTabs: true
120
+ });
121
+ </script>
122
+
123
+ <p><strong>MIME types defined:</strong> <code>text/x-haxe, text/x-hxml</code>.</p>
124
+ </article>
assets/js/vendor/codemirror/mode/http/http.js ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("http", function() {
15
+ function failFirstLine(stream, state) {
16
+ stream.skipToEnd();
17
+ state.cur = header;
18
+ return "error";
19
+ }
20
+
21
+ function start(stream, state) {
22
+ if (stream.match(/^HTTP\/\d\.\d/)) {
23
+ state.cur = responseStatusCode;
24
+ return "keyword";
25
+ } else if (stream.match(/^[A-Z]+/) && /[ \t]/.test(stream.peek())) {
26
+ state.cur = requestPath;
27
+ return "keyword";
28
+ } else {
29
+ return failFirstLine(stream, state);
30
+ }
31
+ }
32
+
33
+ function responseStatusCode(stream, state) {
34
+ var code = stream.match(/^\d+/);
35
+ if (!code) return failFirstLine(stream, state);
36
+
37
+ state.cur = responseStatusText;
38
+ var status = Number(code[0]);
39
+ if (status >= 100 && status < 200) {
40
+ return "positive informational";
41
+ } else if (status >= 200 && status < 300) {
42
+ return "positive success";
43
+ } else if (status >= 300 && status < 400) {
44
+ return "positive redirect";
45
+ } else if (status >= 400 && status < 500) {
46
+ return "negative client-error";
47
+ } else if (status >= 500 && status < 600) {
48
+ return "negative server-error";
49
+ } else {
50
+ return "error";
51
+ }
52
+ }
53
+
54
+ function responseStatusText(stream, state) {
55
+ stream.skipToEnd();
56
+ state.cur = header;
57
+ return null;
58
+ }
59
+
60
+ function requestPath(stream, state) {
61
+ stream.eatWhile(/\S/);
62
+ state.cur = requestProtocol;
63
+ return "string-2";
64
+ }
65
+
66
+ function requestProtocol(stream, state) {
67
+ if (stream.match(/^HTTP\/\d\.\d$/)) {
68
+ state.cur = header;
69
+ return "keyword";
70
+ } else {
71
+ return failFirstLine(stream, state);
72
+ }
73
+ }
74
+
75
+ function header(stream) {
76
+ if (stream.sol() && !stream.eat(/[ \t]/)) {
77
+ if (stream.match(/^.*?:/)) {
78
+ return "atom";
79
+ } else {
80
+ stream.skipToEnd();
81
+ return "error";
82
+ }
83
+ } else {
84
+ stream.skipToEnd();
85
+ return "string";
86
+ }
87
+ }
88
+
89
+ function body(stream) {
90
+ stream.skipToEnd();
91
+ return null;
92
+ }
93
+
94
+ return {
95
+ token: function(stream, state) {
96
+ var cur = state.cur;
97
+ if (cur != header && cur != body && stream.eatSpace()) return null;
98
+ return cur(stream, state);
99
+ },
100
+
101
+ blankLine: function(state) {
102
+ state.cur = body;
103
+ },
104
+
105
+ startState: function() {
106
+ return {cur: start};
107
+ }
108
+ };
109
+ });
110
+
111
+ CodeMirror.defineMIME("message/http", "http");
112
+
113
+ });
assets/js/vendor/codemirror/mode/http/index.html ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: HTTP mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="http.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">HTTP</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>HTTP mode</h2>
27
+
28
+
29
+ <div><textarea id="code" name="code">
30
+ POST /somewhere HTTP/1.1
31
+ Host: example.com
32
+ If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
33
+ Content-Type: application/x-www-form-urlencoded;
34
+ charset=utf-8
35
+ User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11
36
+
37
+ This is the request body!
38
+ </textarea></div>
39
+
40
+ <script>
41
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
42
+ </script>
43
+
44
+ <p><strong>MIME types defined:</strong> <code>message/http</code>.</p>
45
+ </article>
assets/js/vendor/codemirror/mode/idl/idl.js ADDED
@@ -0,0 +1,290 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ function wordRegexp(words) {
15
+ return new RegExp('^((' + words.join(')|(') + '))\\b', 'i');
16
+ };
17
+
18
+ var builtinArray = [
19
+ 'a_correlate', 'abs', 'acos', 'adapt_hist_equal', 'alog',
20
+ 'alog2', 'alog10', 'amoeba', 'annotate', 'app_user_dir',
21
+ 'app_user_dir_query', 'arg_present', 'array_equal', 'array_indices',
22
+ 'arrow', 'ascii_template', 'asin', 'assoc', 'atan',
23
+ 'axis', 'axis', 'bandpass_filter', 'bandreject_filter', 'barplot',
24
+ 'bar_plot', 'beseli', 'beselj', 'beselk', 'besely',
25
+ 'beta', 'biginteger', 'bilinear', 'bin_date', 'binary_template',
26
+ 'bindgen', 'binomial', 'bit_ffs', 'bit_population', 'blas_axpy',
27
+ 'blk_con', 'boolarr', 'boolean', 'boxplot', 'box_cursor',
28
+ 'breakpoint', 'broyden', 'bubbleplot', 'butterworth', 'bytarr',
29
+ 'byte', 'byteorder', 'bytscl', 'c_correlate', 'calendar',
30
+ 'caldat', 'call_external', 'call_function', 'call_method',
31
+ 'call_procedure', 'canny', 'catch', 'cd', 'cdf', 'ceil',
32
+ 'chebyshev', 'check_math', 'chisqr_cvf', 'chisqr_pdf', 'choldc',
33
+ 'cholsol', 'cindgen', 'cir_3pnt', 'clipboard', 'close',
34
+ 'clust_wts', 'cluster', 'cluster_tree', 'cmyk_convert', 'code_coverage',
35
+ 'color_convert', 'color_exchange', 'color_quan', 'color_range_map',
36
+ 'colorbar', 'colorize_sample', 'colormap_applicable',
37
+ 'colormap_gradient', 'colormap_rotation', 'colortable',
38
+ 'comfit', 'command_line_args', 'common', 'compile_opt', 'complex',
39
+ 'complexarr', 'complexround', 'compute_mesh_normals', 'cond', 'congrid',
40
+ 'conj', 'constrained_min', 'contour', 'contour', 'convert_coord',
41
+ 'convol', 'convol_fft', 'coord2to3', 'copy_lun', 'correlate',
42
+ 'cos', 'cosh', 'cpu', 'cramer', 'createboxplotdata',
43
+ 'create_cursor', 'create_struct', 'create_view', 'crossp', 'crvlength',
44
+ 'ct_luminance', 'cti_test', 'cursor', 'curvefit', 'cv_coord',
45
+ 'cvttobm', 'cw_animate', 'cw_animate_getp', 'cw_animate_load',
46
+ 'cw_animate_run', 'cw_arcball', 'cw_bgroup', 'cw_clr_index',
47
+ 'cw_colorsel', 'cw_defroi', 'cw_field', 'cw_filesel', 'cw_form',
48
+ 'cw_fslider', 'cw_light_editor', 'cw_light_editor_get',
49
+ 'cw_light_editor_set', 'cw_orient', 'cw_palette_editor',
50
+ 'cw_palette_editor_get', 'cw_palette_editor_set', 'cw_pdmenu',
51
+ 'cw_rgbslider', 'cw_tmpl', 'cw_zoom', 'db_exists',
52
+ 'dblarr', 'dcindgen', 'dcomplex', 'dcomplexarr', 'define_key',
53
+ 'define_msgblk', 'define_msgblk_from_file', 'defroi', 'defsysv',
54
+ 'delvar', 'dendro_plot', 'dendrogram', 'deriv', 'derivsig',
55
+ 'determ', 'device', 'dfpmin', 'diag_matrix', 'dialog_dbconnect',
56
+ 'dialog_message', 'dialog_pickfile', 'dialog_printersetup',
57
+ 'dialog_printjob', 'dialog_read_image',
58
+ 'dialog_write_image', 'dictionary', 'digital_filter', 'dilate', 'dindgen',
59
+ 'dissolve', 'dist', 'distance_measure', 'dlm_load', 'dlm_register',
60
+ 'doc_library', 'double', 'draw_roi', 'edge_dog', 'efont',
61
+ 'eigenql', 'eigenvec', 'ellipse', 'elmhes', 'emboss',
62
+ 'empty', 'enable_sysrtn', 'eof', 'eos', 'erase',
63
+ 'erf', 'erfc', 'erfcx', 'erode', 'errorplot',
64
+ 'errplot', 'estimator_filter', 'execute', 'exit', 'exp',
65
+ 'expand', 'expand_path', 'expint', 'extrac', 'extract_slice',
66
+ 'f_cvf', 'f_pdf', 'factorial', 'fft', 'file_basename',
67
+ 'file_chmod', 'file_copy', 'file_delete', 'file_dirname',
68
+ 'file_expand_path', 'file_gunzip', 'file_gzip', 'file_info',
69
+ 'file_lines', 'file_link', 'file_mkdir', 'file_move',
70
+ 'file_poll_input', 'file_readlink', 'file_same',
71
+ 'file_search', 'file_tar', 'file_test', 'file_untar', 'file_unzip',
72
+ 'file_which', 'file_zip', 'filepath', 'findgen', 'finite',
73
+ 'fix', 'flick', 'float', 'floor', 'flow3',
74
+ 'fltarr', 'flush', 'format_axis_values', 'forward_function', 'free_lun',
75
+ 'fstat', 'fulstr', 'funct', 'function', 'fv_test',
76
+ 'fx_root', 'fz_roots', 'gamma', 'gamma_ct', 'gauss_cvf',
77
+ 'gauss_pdf', 'gauss_smooth', 'gauss2dfit', 'gaussfit',
78
+ 'gaussian_function', 'gaussint', 'get_drive_list', 'get_dxf_objects',
79
+ 'get_kbrd', 'get_login_info',
80
+ 'get_lun', 'get_screen_size', 'getenv', 'getwindows', 'greg2jul',
81
+ 'grib', 'grid_input', 'grid_tps', 'grid3', 'griddata',
82
+ 'gs_iter', 'h_eq_ct', 'h_eq_int', 'hanning', 'hash',
83
+ 'hdf', 'hdf5', 'heap_free', 'heap_gc', 'heap_nosave',
84
+ 'heap_refcount', 'heap_save', 'help', 'hilbert', 'hist_2d',
85
+ 'hist_equal', 'histogram', 'hls', 'hough', 'hqr',
86
+ 'hsv', 'i18n_multibytetoutf8',
87
+ 'i18n_multibytetowidechar', 'i18n_utf8tomultibyte',
88
+ 'i18n_widechartomultibyte',
89
+ 'ibeta', 'icontour', 'iconvertcoord', 'idelete', 'identity',
90
+ 'idl_base64', 'idl_container', 'idl_validname',
91
+ 'idlexbr_assistant', 'idlitsys_createtool',
92
+ 'idlunit', 'iellipse', 'igamma', 'igetcurrent', 'igetdata',
93
+ 'igetid', 'igetproperty', 'iimage', 'image', 'image_cont',
94
+ 'image_statistics', 'image_threshold', 'imaginary', 'imap', 'indgen',
95
+ 'int_2d', 'int_3d', 'int_tabulated', 'intarr', 'interpol',
96
+ 'interpolate', 'interval_volume', 'invert', 'ioctl', 'iopen',
97
+ 'ir_filter', 'iplot', 'ipolygon', 'ipolyline', 'iputdata',
98
+ 'iregister', 'ireset', 'iresolve', 'irotate', 'isa',
99
+ 'isave', 'iscale', 'isetcurrent', 'isetproperty', 'ishft',
100
+ 'isocontour', 'isosurface', 'isurface', 'itext', 'itranslate',
101
+ 'ivector', 'ivolume', 'izoom', 'journal', 'json_parse',
102
+ 'json_serialize', 'jul2greg', 'julday', 'keyword_set', 'krig2d',
103
+ 'kurtosis', 'kw_test', 'l64indgen', 'la_choldc', 'la_cholmprove',
104
+ 'la_cholsol', 'la_determ', 'la_eigenproblem', 'la_eigenql', 'la_eigenvec',
105
+ 'la_elmhes', 'la_gm_linear_model', 'la_hqr', 'la_invert',
106
+ 'la_least_square_equality', 'la_least_squares', 'la_linear_equation',
107
+ 'la_ludc', 'la_lumprove', 'la_lusol',
108
+ 'la_svd', 'la_tridc', 'la_trimprove', 'la_triql', 'la_trired',
109
+ 'la_trisol', 'label_date', 'label_region', 'ladfit', 'laguerre',
110
+ 'lambda', 'lambdap', 'lambertw', 'laplacian', 'least_squares_filter',
111
+ 'leefilt', 'legend', 'legendre', 'linbcg', 'lindgen',
112
+ 'linfit', 'linkimage', 'list', 'll_arc_distance', 'lmfit',
113
+ 'lmgr', 'lngamma', 'lnp_test', 'loadct', 'locale_get',
114
+ 'logical_and', 'logical_or', 'logical_true', 'lon64arr', 'lonarr',
115
+ 'long', 'long64', 'lsode', 'lu_complex', 'ludc',
116
+ 'lumprove', 'lusol', 'm_correlate', 'machar', 'make_array',
117
+ 'make_dll', 'make_rt', 'map', 'mapcontinents', 'mapgrid',
118
+ 'map_2points', 'map_continents', 'map_grid', 'map_image', 'map_patch',
119
+ 'map_proj_forward', 'map_proj_image', 'map_proj_info',
120
+ 'map_proj_init', 'map_proj_inverse',
121
+ 'map_set', 'matrix_multiply', 'matrix_power', 'max', 'md_test',
122
+ 'mean', 'meanabsdev', 'mean_filter', 'median', 'memory',
123
+ 'mesh_clip', 'mesh_decimate', 'mesh_issolid',
124
+ 'mesh_merge', 'mesh_numtriangles',
125
+ 'mesh_obj', 'mesh_smooth', 'mesh_surfacearea',
126
+ 'mesh_validate', 'mesh_volume',
127
+ 'message', 'min', 'min_curve_surf', 'mk_html_help', 'modifyct',
128
+ 'moment', 'morph_close', 'morph_distance',
129
+ 'morph_gradient', 'morph_hitormiss',
130
+ 'morph_open', 'morph_thin', 'morph_tophat', 'multi', 'n_elements',
131
+ 'n_params', 'n_tags', 'ncdf', 'newton', 'noise_hurl',
132
+ 'noise_pick', 'noise_scatter', 'noise_slur', 'norm', 'obj_class',
133
+ 'obj_destroy', 'obj_hasmethod', 'obj_isa', 'obj_new', 'obj_valid',
134
+ 'objarr', 'on_error', 'on_ioerror', 'online_help', 'openr',
135
+ 'openu', 'openw', 'oplot', 'oploterr', 'orderedhash',
136
+ 'p_correlate', 'parse_url', 'particle_trace', 'path_cache', 'path_sep',
137
+ 'pcomp', 'plot', 'plot3d', 'plot', 'plot_3dbox',
138
+ 'plot_field', 'ploterr', 'plots', 'polar_contour', 'polar_surface',
139
+ 'polyfill', 'polyshade', 'pnt_line', 'point_lun', 'polarplot',
140
+ 'poly', 'poly_2d', 'poly_area', 'poly_fit', 'polyfillv',
141
+ 'polygon', 'polyline', 'polywarp', 'popd', 'powell',
142
+ 'pref_commit', 'pref_get', 'pref_set', 'prewitt', 'primes',
143
+ 'print', 'printf', 'printd', 'pro', 'product',
144
+ 'profile', 'profiler', 'profiles', 'project_vol', 'ps_show_fonts',
145
+ 'psafm', 'pseudo', 'ptr_free', 'ptr_new', 'ptr_valid',
146
+ 'ptrarr', 'pushd', 'qgrid3', 'qhull', 'qromb',
147
+ 'qromo', 'qsimp', 'query_*', 'query_ascii', 'query_bmp',
148
+ 'query_csv', 'query_dicom', 'query_gif', 'query_image', 'query_jpeg',
149
+ 'query_jpeg2000', 'query_mrsid', 'query_pict', 'query_png', 'query_ppm',
150
+ 'query_srf', 'query_tiff', 'query_video', 'query_wav', 'r_correlate',
151
+ 'r_test', 'radon', 'randomn', 'randomu', 'ranks',
152
+ 'rdpix', 'read', 'readf', 'read_ascii', 'read_binary',
153
+ 'read_bmp', 'read_csv', 'read_dicom', 'read_gif', 'read_image',
154
+ 'read_interfile', 'read_jpeg', 'read_jpeg2000', 'read_mrsid', 'read_pict',
155
+ 'read_png', 'read_ppm', 'read_spr', 'read_srf', 'read_sylk',
156
+ 'read_tiff', 'read_video', 'read_wav', 'read_wave', 'read_x11_bitmap',
157
+ 'read_xwd', 'reads', 'readu', 'real_part', 'rebin',
158
+ 'recall_commands', 'recon3', 'reduce_colors', 'reform', 'region_grow',
159
+ 'register_cursor', 'regress', 'replicate',
160
+ 'replicate_inplace', 'resolve_all',
161
+ 'resolve_routine', 'restore', 'retall', 'return', 'reverse',
162
+ 'rk4', 'roberts', 'rot', 'rotate', 'round',
163
+ 'routine_filepath', 'routine_info', 'rs_test', 's_test', 'save',
164
+ 'savgol', 'scale3', 'scale3d', 'scatterplot', 'scatterplot3d',
165
+ 'scope_level', 'scope_traceback', 'scope_varfetch',
166
+ 'scope_varname', 'search2d',
167
+ 'search3d', 'sem_create', 'sem_delete', 'sem_lock', 'sem_release',
168
+ 'set_plot', 'set_shading', 'setenv', 'sfit', 'shade_surf',
169
+ 'shade_surf_irr', 'shade_volume', 'shift', 'shift_diff', 'shmdebug',
170
+ 'shmmap', 'shmunmap', 'shmvar', 'show3', 'showfont',
171
+ 'signum', 'simplex', 'sin', 'sindgen', 'sinh',
172
+ 'size', 'skewness', 'skip_lun', 'slicer3', 'slide_image',
173
+ 'smooth', 'sobel', 'socket', 'sort', 'spawn',
174
+ 'sph_4pnt', 'sph_scat', 'spher_harm', 'spl_init', 'spl_interp',
175
+ 'spline', 'spline_p', 'sprsab', 'sprsax', 'sprsin',
176
+ 'sprstp', 'sqrt', 'standardize', 'stddev', 'stop',
177
+ 'strarr', 'strcmp', 'strcompress', 'streamline', 'streamline',
178
+ 'stregex', 'stretch', 'string', 'strjoin', 'strlen',
179
+ 'strlowcase', 'strmatch', 'strmessage', 'strmid', 'strpos',
180
+ 'strput', 'strsplit', 'strtrim', 'struct_assign', 'struct_hide',
181
+ 'strupcase', 'surface', 'surface', 'surfr', 'svdc',
182
+ 'svdfit', 'svsol', 'swap_endian', 'swap_endian_inplace', 'symbol',
183
+ 'systime', 't_cvf', 't_pdf', 't3d', 'tag_names',
184
+ 'tan', 'tanh', 'tek_color', 'temporary', 'terminal_size',
185
+ 'tetra_clip', 'tetra_surface', 'tetra_volume', 'text', 'thin',
186
+ 'thread', 'threed', 'tic', 'time_test2', 'timegen',
187
+ 'timer', 'timestamp', 'timestamptovalues', 'tm_test', 'toc',
188
+ 'total', 'trace', 'transpose', 'tri_surf', 'triangulate',
189
+ 'trigrid', 'triql', 'trired', 'trisol', 'truncate_lun',
190
+ 'ts_coef', 'ts_diff', 'ts_fcast', 'ts_smooth', 'tv',
191
+ 'tvcrs', 'tvlct', 'tvrd', 'tvscl', 'typename',
192
+ 'uindgen', 'uint', 'uintarr', 'ul64indgen', 'ulindgen',
193
+ 'ulon64arr', 'ulonarr', 'ulong', 'ulong64', 'uniq',
194
+ 'unsharp_mask', 'usersym', 'value_locate', 'variance', 'vector',
195
+ 'vector_field', 'vel', 'velovect', 'vert_t3d', 'voigt',
196
+ 'volume', 'voronoi', 'voxel_proj', 'wait', 'warp_tri',
197
+ 'watershed', 'wdelete', 'wf_draw', 'where', 'widget_base',
198
+ 'widget_button', 'widget_combobox', 'widget_control',
199
+ 'widget_displaycontextmenu', 'widget_draw',
200
+ 'widget_droplist', 'widget_event', 'widget_info',
201
+ 'widget_label', 'widget_list',
202
+ 'widget_propertysheet', 'widget_slider', 'widget_tab',
203
+ 'widget_table', 'widget_text',
204
+ 'widget_tree', 'widget_tree_move', 'widget_window',
205
+ 'wiener_filter', 'window',
206
+ 'window', 'write_bmp', 'write_csv', 'write_gif', 'write_image',
207
+ 'write_jpeg', 'write_jpeg2000', 'write_nrif', 'write_pict', 'write_png',
208
+ 'write_ppm', 'write_spr', 'write_srf', 'write_sylk', 'write_tiff',
209
+ 'write_video', 'write_wav', 'write_wave', 'writeu', 'wset',
210
+ 'wshow', 'wtn', 'wv_applet', 'wv_cwt', 'wv_cw_wavelet',
211
+ 'wv_denoise', 'wv_dwt', 'wv_fn_coiflet',
212
+ 'wv_fn_daubechies', 'wv_fn_gaussian',
213
+ 'wv_fn_haar', 'wv_fn_morlet', 'wv_fn_paul',
214
+ 'wv_fn_symlet', 'wv_import_data',
215
+ 'wv_import_wavelet', 'wv_plot3d_wps', 'wv_plot_multires',
216
+ 'wv_pwt', 'wv_tool_denoise',
217
+ 'xbm_edit', 'xdisplayfile', 'xdxf', 'xfont', 'xinteranimate',
218
+ 'xloadct', 'xmanager', 'xmng_tmpl', 'xmtool', 'xobjview',
219
+ 'xobjview_rotate', 'xobjview_write_image',
220
+ 'xpalette', 'xpcolor', 'xplot3d',
221
+ 'xregistered', 'xroi', 'xsq_test', 'xsurface', 'xvaredit',
222
+ 'xvolume', 'xvolume_rotate', 'xvolume_write_image',
223
+ 'xyouts', 'zlib_compress', 'zlib_uncompress', 'zoom', 'zoom_24'
224
+ ];
225
+ var builtins = wordRegexp(builtinArray);
226
+
227
+ var keywordArray = [
228
+ 'begin', 'end', 'endcase', 'endfor',
229
+ 'endwhile', 'endif', 'endrep', 'endforeach',
230
+ 'break', 'case', 'continue', 'for',
231
+ 'foreach', 'goto', 'if', 'then', 'else',
232
+ 'repeat', 'until', 'switch', 'while',
233
+ 'do', 'pro', 'function'
234
+ ];
235
+ var keywords = wordRegexp(keywordArray);
236
+
237
+ CodeMirror.registerHelper("hintWords", "idl", builtinArray.concat(keywordArray));
238
+
239
+ var identifiers = new RegExp('^[_a-z\xa1-\uffff][_a-z0-9\xa1-\uffff]*', 'i');
240
+
241
+ var singleOperators = /[+\-*&=<>\/@#~$]/;
242
+ var boolOperators = new RegExp('(and|or|eq|lt|le|gt|ge|ne|not)', 'i');
243
+
244
+ function tokenBase(stream) {
245
+ // whitespaces
246
+ if (stream.eatSpace()) return null;
247
+
248
+ // Handle one line Comments
249
+ if (stream.match(';')) {
250
+ stream.skipToEnd();
251
+ return 'comment';
252
+ }
253
+
254
+ // Handle Number Literals
255
+ if (stream.match(/^[0-9\.+-]/, false)) {
256
+ if (stream.match(/^[+-]?0x[0-9a-fA-F]+/))
257
+ return 'number';
258
+ if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))
259
+ return 'number';
260
+ if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))
261
+ return 'number';
262
+ }
263
+
264
+ // Handle Strings
265
+ if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; }
266
+ if (stream.match(/^'([^']|(''))*'/)) { return 'string'; }
267
+
268
+ // Handle words
269
+ if (stream.match(keywords)) { return 'keyword'; }
270
+ if (stream.match(builtins)) { return 'builtin'; }
271
+ if (stream.match(identifiers)) { return 'variable'; }
272
+
273
+ if (stream.match(singleOperators) || stream.match(boolOperators)) {
274
+ return 'operator'; }
275
+
276
+ // Handle non-detected items
277
+ stream.next();
278
+ return null;
279
+ };
280
+
281
+ CodeMirror.defineMode('idl', function() {
282
+ return {
283
+ token: function(stream) {
284
+ return tokenBase(stream);
285
+ }
286
+ };
287
+ });
288
+
289
+ CodeMirror.defineMIME('text/x-idl', 'idl');
290
+ });
assets/js/vendor/codemirror/mode/idl/index.html ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: IDL mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="idl.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">IDL</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>IDL mode</h2>
27
+
28
+ <div><textarea id="code" name="code">
29
+ ;; Example IDL code
30
+ FUNCTION mean_and_stddev,array
31
+ ;; This program reads in an array of numbers
32
+ ;; and returns a structure containing the
33
+ ;; average and standard deviation
34
+
35
+ ave = 0.0
36
+ count = 0.0
37
+
38
+ for i=0,N_ELEMENTS(array)-1 do begin
39
+ ave = ave + array[i]
40
+ count = count + 1
41
+ endfor
42
+
43
+ ave = ave/count
44
+
45
+ std = stddev(array)
46
+
47
+ return, {average:ave,std:std}
48
+
49
+ END
50
+
51
+ </textarea></div>
52
+ <script>
53
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
54
+ mode: {name: "idl",
55
+ version: 1,
56
+ singleLineStringErrors: false},
57
+ lineNumbers: true,
58
+ indentUnit: 4,
59
+ matchBrackets: true
60
+ });
61
+ </script>
62
+
63
+ <p><strong>MIME types defined:</strong> <code>text/x-idl</code>.</p>
64
+ </article>
assets/js/vendor/codemirror/mode/jade/index.html ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Jade Templating Mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../javascript/javascript.js"></script>
10
+ <script src="../css/css.js"></script>
11
+ <script src="../xml/xml.js"></script>
12
+ <script src="../htmlmixed/htmlmixed.js"></script>
13
+ <script src="jade.js"></script>
14
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
15
+ <div id=nav>
16
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
17
+
18
+ <ul>
19
+ <li><a href="../../index.html">Home</a>
20
+ <li><a href="../../doc/manual.html">Manual</a>
21
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
22
+ </ul>
23
+ <ul>
24
+ <li><a href="../index.html">Language modes</a>
25
+ <li><a class=active href="#">Jade Templating Mode</a>
26
+ </ul>
27
+ </div>
28
+
29
+ <article>
30
+ <h2>Jade Templating Mode</h2>
31
+ <form><textarea id="code" name="code">
32
+ doctype html
33
+ html
34
+ head
35
+ title= "Jade Templating CodeMirror Mode Example"
36
+ link(rel='stylesheet', href='/css/bootstrap.min.css')
37
+ link(rel='stylesheet', href='/css/index.css')
38
+ script(type='text/javascript', src='/js/jquery-1.9.1.min.js')
39
+ script(type='text/javascript', src='/js/bootstrap.min.js')
40
+ body
41
+ div.header
42
+ h1 Welcome to this Example
43
+ div.spots
44
+ if locals.spots
45
+ each spot in spots
46
+ div.spot.well
47
+ div
48
+ if spot.logo
49
+ img.img-rounded.logo(src=spot.logo)
50
+ else
51
+ img.img-rounded.logo(src="img/placeholder.png")
52
+ h3
53
+ a(href=spot.hash) ##{spot.hash}
54
+ if spot.title
55
+ span.title #{spot.title}
56
+ if spot.desc
57
+ div #{spot.desc}
58
+ else
59
+ h3 There are no spots currently available.
60
+ </textarea></form>
61
+ <script>
62
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
63
+ mode: {name: "jade", alignCDATA: true},
64
+ lineNumbers: true
65
+ });
66
+ </script>
67
+ <h3>The Jade Templating Mode</h3>
68
+ <p> Created by Forbes Lindesay. Managed as part of a Brackets extension at <a href="https://github.com/ForbesLindesay/jade-brackets">https://github.com/ForbesLindesay/jade-brackets</a>.</p>
69
+ <p><strong>MIME type defined:</strong> <code>text/x-jade</code>.</p>
70
+ </article>
assets/js/vendor/codemirror/mode/jade/jade.js ADDED
@@ -0,0 +1,590 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../javascript/javascript"), require("../css/css"), require("../htmlmixed/htmlmixed"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../javascript/javascript", "../css/css", "../htmlmixed/htmlmixed"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode('jade', function (config) {
15
+ // token types
16
+ var KEYWORD = 'keyword';
17
+ var DOCTYPE = 'meta';
18
+ var ID = 'builtin';
19
+ var CLASS = 'qualifier';
20
+
21
+ var ATTRS_NEST = {
22
+ '{': '}',
23
+ '(': ')',
24
+ '[': ']'
25
+ };
26
+
27
+ var jsMode = CodeMirror.getMode(config, 'javascript');
28
+
29
+ function State() {
30
+ this.javaScriptLine = false;
31
+ this.javaScriptLineExcludesColon = false;
32
+
33
+ this.javaScriptArguments = false;
34
+ this.javaScriptArgumentsDepth = 0;
35
+
36
+ this.isInterpolating = false;
37
+ this.interpolationNesting = 0;
38
+
39
+ this.jsState = jsMode.startState();
40
+
41
+ this.restOfLine = '';
42
+
43
+ this.isIncludeFiltered = false;
44
+ this.isEach = false;
45
+
46
+ this.lastTag = '';
47
+ this.scriptType = '';
48
+
49
+ // Attributes Mode
50
+ this.isAttrs = false;
51
+ this.attrsNest = [];
52
+ this.inAttributeName = true;
53
+ this.attributeIsType = false;
54
+ this.attrValue = '';
55
+
56
+ // Indented Mode
57
+ this.indentOf = Infinity;
58
+ this.indentToken = '';
59
+
60
+ this.innerMode = null;
61
+ this.innerState = null;
62
+
63
+ this.innerModeForLine = false;
64
+ }
65
+ /**
66
+ * Safely copy a state
67
+ *
68
+ * @return {State}
69
+ */
70
+ State.prototype.copy = function () {
71
+ var res = new State();
72
+ res.javaScriptLine = this.javaScriptLine;
73
+ res.javaScriptLineExcludesColon = this.javaScriptLineExcludesColon;
74
+ res.javaScriptArguments = this.javaScriptArguments;
75
+ res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth;
76
+ res.isInterpolating = this.isInterpolating;
77
+ res.interpolationNesting = this.intpolationNesting;
78
+
79
+ res.jsState = CodeMirror.copyState(jsMode, this.jsState);
80
+
81
+ res.innerMode = this.innerMode;
82
+ if (this.innerMode && this.innerState) {
83
+ res.innerState = CodeMirror.copyState(this.innerMode, this.innerState);
84
+ }
85
+
86
+ res.restOfLine = this.restOfLine;
87
+
88
+ res.isIncludeFiltered = this.isIncludeFiltered;
89
+ res.isEach = this.isEach;
90
+ res.lastTag = this.lastTag;
91
+ res.scriptType = this.scriptType;
92
+ res.isAttrs = this.isAttrs;
93
+ res.attrsNest = this.attrsNest.slice();
94
+ res.inAttributeName = this.inAttributeName;
95
+ res.attributeIsType = this.attributeIsType;
96
+ res.attrValue = this.attrValue;
97
+ res.indentOf = this.indentOf;
98
+ res.indentToken = this.indentToken;
99
+
100
+ res.innerModeForLine = this.innerModeForLine;
101
+
102
+ return res;
103
+ };
104
+
105
+ function javaScript(stream, state) {
106
+ if (stream.sol()) {
107
+ // if javaScriptLine was set at end of line, ignore it
108
+ state.javaScriptLine = false;
109
+ state.javaScriptLineExcludesColon = false;
110
+ }
111
+ if (state.javaScriptLine) {
112
+ if (state.javaScriptLineExcludesColon && stream.peek() === ':') {
113
+ state.javaScriptLine = false;
114
+ state.javaScriptLineExcludesColon = false;
115
+ return;
116
+ }
117
+ var tok = jsMode.token(stream, state.jsState);
118
+ if (stream.eol()) state.javaScriptLine = false;
119
+ return tok || true;
120
+ }
121
+ }
122
+ function javaScriptArguments(stream, state) {
123
+ if (state.javaScriptArguments) {
124
+ if (state.javaScriptArgumentsDepth === 0 && stream.peek() !== '(') {
125
+ state.javaScriptArguments = false;
126
+ return;
127
+ }
128
+ if (stream.peek() === '(') {
129
+ state.javaScriptArgumentsDepth++;
130
+ } else if (stream.peek() === ')') {
131
+ state.javaScriptArgumentsDepth--;
132
+ }
133
+ if (state.javaScriptArgumentsDepth === 0) {
134
+ state.javaScriptArguments = false;
135
+ return;
136
+ }
137
+
138
+ var tok = jsMode.token(stream, state.jsState);
139
+ return tok || true;
140
+ }
141
+ }
142
+
143
+ function yieldStatement(stream) {
144
+ if (stream.match(/^yield\b/)) {
145
+ return 'keyword';
146
+ }
147
+ }
148
+
149
+ function doctype(stream) {
150
+ if (stream.match(/^(?:doctype) *([^\n]+)?/)) {
151
+ return DOCTYPE;
152
+ }
153
+ }
154
+
155
+ function interpolation(stream, state) {
156
+ if (stream.match('#{')) {
157
+ state.isInterpolating = true;
158
+ state.interpolationNesting = 0;
159
+ return 'punctuation';
160
+ }
161
+ }
162
+
163
+ function interpolationContinued(stream, state) {
164
+ if (state.isInterpolating) {
165
+ if (stream.peek() === '}') {
166
+ state.interpolationNesting--;
167
+ if (state.interpolationNesting < 0) {
168
+ stream.next();
169
+ state.isInterpolating = false;
170
+ return 'puncutation';
171
+ }
172
+ } else if (stream.peek() === '{') {
173
+ state.interpolationNesting++;
174
+ }
175
+ return jsMode.token(stream, state.jsState) || true;
176
+ }
177
+ }
178
+
179
+ function caseStatement(stream, state) {
180
+ if (stream.match(/^case\b/)) {
181
+ state.javaScriptLine = true;
182
+ return KEYWORD;
183
+ }
184
+ }
185
+
186
+ function when(stream, state) {
187
+ if (stream.match(/^when\b/)) {
188
+ state.javaScriptLine = true;
189
+ state.javaScriptLineExcludesColon = true;
190
+ return KEYWORD;
191
+ }
192
+ }
193
+
194
+ function defaultStatement(stream) {
195
+ if (stream.match(/^default\b/)) {
196
+ return KEYWORD;
197
+ }
198
+ }
199
+
200
+ function extendsStatement(stream, state) {
201
+ if (stream.match(/^extends?\b/)) {
202
+ state.restOfLine = 'string';
203
+ return KEYWORD;
204
+ }
205
+ }
206
+
207
+ function append(stream, state) {
208
+ if (stream.match(/^append\b/)) {
209
+ state.restOfLine = 'variable';
210
+ return KEYWORD;
211
+ }
212
+ }
213
+ function prepend(stream, state) {
214
+ if (stream.match(/^prepend\b/)) {
215
+ state.restOfLine = 'variable';
216
+ return KEYWORD;
217
+ }
218
+ }
219
+ function block(stream, state) {
220
+ if (stream.match(/^block\b *(?:(prepend|append)\b)?/)) {
221
+ state.restOfLine = 'variable';
222
+ return KEYWORD;
223
+ }
224
+ }
225
+
226
+ function include(stream, state) {
227
+ if (stream.match(/^include\b/)) {
228
+ state.restOfLine = 'string';
229
+ return KEYWORD;
230
+ }
231
+ }
232
+
233
+ function includeFiltered(stream, state) {
234
+ if (stream.match(/^include:([a-zA-Z0-9\-]+)/, false) && stream.match('include')) {
235
+ state.isIncludeFiltered = true;
236
+ return KEYWORD;
237
+ }
238
+ }
239
+
240
+ function includeFilteredContinued(stream, state) {
241
+ if (state.isIncludeFiltered) {
242
+ var tok = filter(stream, state);
243
+ state.isIncludeFiltered = false;
244
+ state.restOfLine = 'string';
245
+ return tok;
246
+ }
247
+ }
248
+
249
+ function mixin(stream, state) {
250
+ if (stream.match(/^mixin\b/)) {
251
+ state.javaScriptLine = true;
252
+ return KEYWORD;
253
+ }
254
+ }
255
+
256
+ function call(stream, state) {
257
+ if (stream.match(/^\+([-\w]+)/)) {
258
+ if (!stream.match(/^\( *[-\w]+ *=/, false)) {
259
+ state.javaScriptArguments = true;
260
+ state.javaScriptArgumentsDepth = 0;
261
+ }
262
+ return 'variable';
263
+ }
264
+ if (stream.match(/^\+#{/, false)) {
265
+ stream.next();
266
+ state.mixinCallAfter = true;
267
+ return interpolation(stream, state);
268
+ }
269
+ }
270
+ function callArguments(stream, state) {
271
+ if (state.mixinCallAfter) {
272
+ state.mixinCallAfter = false;
273
+ if (!stream.match(/^\( *[-\w]+ *=/, false)) {
274
+ state.javaScriptArguments = true;
275
+ state.javaScriptArgumentsDepth = 0;
276
+ }
277
+ return true;
278
+ }
279
+ }
280
+
281
+ function conditional(stream, state) {
282
+ if (stream.match(/^(if|unless|else if|else)\b/)) {
283
+ state.javaScriptLine = true;
284
+ return KEYWORD;
285
+ }
286
+ }
287
+
288
+ function each(stream, state) {
289
+ if (stream.match(/^(- *)?(each|for)\b/)) {
290
+ state.isEach = true;
291
+ return KEYWORD;
292
+ }
293
+ }
294
+ function eachContinued(stream, state) {
295
+ if (state.isEach) {
296
+ if (stream.match(/^ in\b/)) {
297
+ state.javaScriptLine = true;
298
+ state.isEach = false;
299
+ return KEYWORD;
300
+ } else if (stream.sol() || stream.eol()) {
301
+ state.isEach = false;
302
+ } else if (stream.next()) {
303
+ while (!stream.match(/^ in\b/, false) && stream.next());
304
+ return 'variable';
305
+ }
306
+ }
307
+ }
308
+
309
+ function whileStatement(stream, state) {
310
+ if (stream.match(/^while\b/)) {
311
+ state.javaScriptLine = true;
312
+ return KEYWORD;
313
+ }
314
+ }
315
+
316
+ function tag(stream, state) {
317
+ var captures;
318
+ if (captures = stream.match(/^(\w(?:[-:\w]*\w)?)\/?/)) {
319
+ state.lastTag = captures[1].toLowerCase();
320
+ if (state.lastTag === 'script') {
321
+ state.scriptType = 'application/javascript';
322
+ }
323
+ return 'tag';
324
+ }
325
+ }
326
+
327
+ function filter(stream, state) {
328
+ if (stream.match(/^:([\w\-]+)/)) {
329
+ var innerMode;
330
+ if (config && config.innerModes) {
331
+ innerMode = config.innerModes(stream.current().substring(1));
332
+ }
333
+ if (!innerMode) {
334
+ innerMode = stream.current().substring(1);
335
+ }
336
+ if (typeof innerMode === 'string') {
337
+ innerMode = CodeMirror.getMode(config, innerMode);
338
+ }
339
+ setInnerMode(stream, state, innerMode);
340
+ return 'atom';
341
+ }
342
+ }
343
+
344
+ function code(stream, state) {
345
+ if (stream.match(/^(!?=|-)/)) {
346
+ state.javaScriptLine = true;
347
+ return 'punctuation';
348
+ }
349
+ }
350
+
351
+ function id(stream) {
352
+ if (stream.match(/^#([\w-]+)/)) {
353
+ return ID;
354
+ }
355
+ }
356
+
357
+ function className(stream) {
358
+ if (stream.match(/^\.([\w-]+)/)) {
359
+ return CLASS;
360
+ }
361
+ }
362
+
363
+ function attrs(stream, state) {
364
+ if (stream.peek() == '(') {
365
+ stream.next();
366
+ state.isAttrs = true;
367
+ state.attrsNest = [];
368
+ state.inAttributeName = true;
369
+ state.attrValue = '';
370
+ state.attributeIsType = false;
371
+ return 'punctuation';
372
+ }
373
+ }
374
+
375
+ function attrsContinued(stream, state) {
376
+ if (state.isAttrs) {
377
+ if (ATTRS_NEST[stream.peek()]) {
378
+ state.attrsNest.push(ATTRS_NEST[stream.peek()]);
379
+ }
380
+ if (state.attrsNest[state.attrsNest.length - 1] === stream.peek()) {
381
+ state.attrsNest.pop();
382
+ } else if (stream.eat(')')) {
383
+ state.isAttrs = false;
384
+ return 'punctuation';
385
+ }
386
+ if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) {
387
+ if (stream.peek() === '=' || stream.peek() === '!') {
388
+ state.inAttributeName = false;
389
+ state.jsState = jsMode.startState();
390
+ if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') {
391
+ state.attributeIsType = true;
392
+ } else {
393
+ state.attributeIsType = false;
394
+ }
395
+ }
396
+ return 'attribute';
397
+ }
398
+
399
+ var tok = jsMode.token(stream, state.jsState);
400
+ if (state.attributeIsType && tok === 'string') {
401
+ state.scriptType = stream.current().toString();
402
+ }
403
+ if (state.attrsNest.length === 0 && (tok === 'string' || tok === 'variable' || tok === 'keyword')) {
404
+ try {
405
+ Function('', 'var x ' + state.attrValue.replace(/,\s*$/, '').replace(/^!/, ''));
406
+ state.inAttributeName = true;
407
+ state.attrValue = '';
408
+ stream.backUp(stream.current().length);
409
+ return attrsContinued(stream, state);
410
+ } catch (ex) {
411
+ //not the end of an attribute
412
+ }
413
+ }
414
+ state.attrValue += stream.current();
415
+ return tok || true;
416
+ }
417
+ }
418
+
419
+ function attributesBlock(stream, state) {
420
+ if (stream.match(/^&attributes\b/)) {
421
+ state.javaScriptArguments = true;
422
+ state.javaScriptArgumentsDepth = 0;
423
+ return 'keyword';
424
+ }
425
+ }
426
+
427
+ function indent(stream) {
428
+ if (stream.sol() && stream.eatSpace()) {
429
+ return 'indent';
430
+ }
431
+ }
432
+
433
+ function comment(stream, state) {
434
+ if (stream.match(/^ *\/\/(-)?([^\n]*)/)) {
435
+ state.indentOf = stream.indentation();
436
+ state.indentToken = 'comment';
437
+ return 'comment';
438
+ }
439
+ }
440
+
441
+ function colon(stream) {
442
+ if (stream.match(/^: */)) {
443
+ return 'colon';
444
+ }
445
+ }
446
+
447
+ function text(stream, state) {
448
+ if (stream.match(/^(?:\| ?| )([^\n]+)/)) {
449
+ return 'string';
450
+ }
451
+ if (stream.match(/^(<[^\n]*)/, false)) {
452
+ // html string
453
+ setInnerMode(stream, state, 'htmlmixed');
454
+ state.innerModeForLine = true;
455
+ return innerMode(stream, state, true);
456
+ }
457
+ }
458
+
459
+ function dot(stream, state) {
460
+ if (stream.eat('.')) {
461
+ var innerMode = null;
462
+ if (state.lastTag === 'script' && state.scriptType.toLowerCase().indexOf('javascript') != -1) {
463
+ innerMode = state.scriptType.toLowerCase().replace(/"|'/g, '');
464
+ } else if (state.lastTag === 'style') {
465
+ innerMode = 'css';
466
+ }
467
+ setInnerMode(stream, state, innerMode);
468
+ return 'dot';
469
+ }
470
+ }
471
+
472
+ function fail(stream) {
473
+ stream.next();
474
+ return null;
475
+ }
476
+
477
+
478
+ function setInnerMode(stream, state, mode) {
479
+ mode = CodeMirror.mimeModes[mode] || mode;
480
+ mode = config.innerModes ? config.innerModes(mode) || mode : mode;
481
+ mode = CodeMirror.mimeModes[mode] || mode;
482
+ mode = CodeMirror.getMode(config, mode);
483
+ state.indentOf = stream.indentation();
484
+
485
+ if (mode && mode.name !== 'null') {
486
+ state.innerMode = mode;
487
+ } else {
488
+ state.indentToken = 'string';
489
+ }
490
+ }
491
+ function innerMode(stream, state, force) {
492
+ if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) {
493
+ if (state.innerMode) {
494
+ if (!state.innerState) {
495
+ state.innerState = state.innerMode.startState ? state.innerMode.startState(stream.indentation()) : {};
496
+ }
497
+ return stream.hideFirstChars(state.indentOf + 2, function () {
498
+ return state.innerMode.token(stream, state.innerState) || true;
499
+ });
500
+ } else {
501
+ stream.skipToEnd();
502
+ return state.indentToken;
503
+ }
504
+ } else if (stream.sol()) {
505
+ state.indentOf = Infinity;
506
+ state.indentToken = null;
507
+ state.innerMode = null;
508
+ state.innerState = null;
509
+ }
510
+ }
511
+ function restOfLine(stream, state) {
512
+ if (stream.sol()) {
513
+ // if restOfLine was set at end of line, ignore it
514
+ state.restOfLine = '';
515
+ }
516
+ if (state.restOfLine) {
517
+ stream.skipToEnd();
518
+ var tok = state.restOfLine;
519
+ state.restOfLine = '';
520
+ return tok;
521
+ }
522
+ }
523
+
524
+
525
+ function startState() {
526
+ return new State();
527
+ }
528
+ function copyState(state) {
529
+ return state.copy();
530
+ }
531
+ /**
532
+ * Get the next token in the stream
533
+ *
534
+ * @param {Stream} stream
535
+ * @param {State} state
536
+ */
537
+ function nextToken(stream, state) {
538
+ var tok = innerMode(stream, state)
539
+ || restOfLine(stream, state)
540
+ || interpolationContinued(stream, state)
541
+ || includeFilteredContinued(stream, state)
542
+ || eachContinued(stream, state)
543
+ || attrsContinued(stream, state)
544
+ || javaScript(stream, state)
545
+ || javaScriptArguments(stream, state)
546
+ || callArguments(stream, state)
547
+
548
+ || yieldStatement(stream, state)
549
+ || doctype(stream, state)
550
+ || interpolation(stream, state)
551
+ || caseStatement(stream, state)
552
+ || when(stream, state)
553
+ || defaultStatement(stream, state)
554
+ || extendsStatement(stream, state)
555
+ || append(stream, state)
556
+ || prepend(stream, state)
557
+ || block(stream, state)
558
+ || include(stream, state)
559
+ || includeFiltered(stream, state)
560
+ || mixin(stream, state)
561
+ || call(stream, state)
562
+ || conditional(stream, state)
563
+ || each(stream, state)
564
+ || whileStatement(stream, state)
565
+ || tag(stream, state)
566
+ || filter(stream, state)
567
+ || code(stream, state)
568
+ || id(stream, state)
569
+ || className(stream, state)
570
+ || attrs(stream, state)
571
+ || attributesBlock(stream, state)
572
+ || indent(stream, state)
573
+ || text(stream, state)
574
+ || comment(stream, state)
575
+ || colon(stream, state)
576
+ || dot(stream, state)
577
+ || fail(stream, state);
578
+
579
+ return tok === true ? null : tok;
580
+ }
581
+ return {
582
+ startState: startState,
583
+ copyState: copyState,
584
+ token: nextToken
585
+ };
586
+ });
587
+
588
+ CodeMirror.defineMIME('text/x-jade', 'jade');
589
+
590
+ });
assets/js/vendor/codemirror/mode/jinja2/index.html ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Jinja2 mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="jinja2.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Jinja2</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Jinja2 mode</h2>
27
+ <form><textarea id="code" name="code">
28
+ {# this is a comment #}
29
+ {%- for item in li -%}
30
+ &lt;li&gt;{{ item.label }}&lt;/li&gt;
31
+ {% endfor -%}
32
+ {{ item.sand == true and item.keyword == false ? 1 : 0 }}
33
+ {{ app.get(55, 1.2, true) }}
34
+ {% if app.get(&#39;_route&#39;) == (&#39;_home&#39;) %}home{% endif %}
35
+ {% if app.session.flashbag.has(&#39;message&#39;) %}
36
+ {% for message in app.session.flashbag.get(&#39;message&#39;) %}
37
+ {{ message.content }}
38
+ {% endfor %}
39
+ {% endif %}
40
+ {{ path(&#39;_home&#39;, {&#39;section&#39;: app.request.get(&#39;section&#39;)}) }}
41
+ {{ path(&#39;_home&#39;, {
42
+ &#39;section&#39;: app.request.get(&#39;section&#39;),
43
+ &#39;boolean&#39;: true,
44
+ &#39;number&#39;: 55.33
45
+ })
46
+ }}
47
+ {% include (&#39;test.incl.html.twig&#39;) %}
48
+ </textarea></form>
49
+ <script>
50
+ var editor =
51
+ CodeMirror.fromTextArea(document.getElementById("code"), {mode:
52
+ {name: "jinja2", htmlMode: true}});
53
+ </script>
54
+ </article>
assets/js/vendor/codemirror/mode/jinja2/jinja2.js ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("jinja2", function() {
15
+ var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif",
16
+ "extends", "filter", "endfilter", "firstof", "for",
17
+ "endfor", "if", "endif", "ifchanged", "endifchanged",
18
+ "ifequal", "endifequal", "ifnotequal",
19
+ "endifnotequal", "in", "include", "load", "not", "now", "or",
20
+ "parsed", "regroup", "reversed", "spaceless",
21
+ "endspaceless", "ssi", "templatetag", "openblock",
22
+ "closeblock", "openvariable", "closevariable",
23
+ "openbrace", "closebrace", "opencomment",
24
+ "closecomment", "widthratio", "url", "with", "endwith",
25
+ "get_current_language", "trans", "endtrans", "noop", "blocktrans",
26
+ "endblocktrans", "get_available_languages",
27
+ "get_current_language_bidi", "plural"],
28
+ operator = /^[+\-*&%=<>!?|~^]/,
29
+ sign = /^[:\[\(\{]/,
30
+ atom = ["true", "false"],
31
+ number = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
32
+
33
+ keywords = new RegExp("((" + keywords.join(")|(") + "))\\b");
34
+ atom = new RegExp("((" + atom.join(")|(") + "))\\b");
35
+
36
+ function tokenBase (stream, state) {
37
+ var ch = stream.peek();
38
+
39
+ //Comment
40
+ if (state.incomment) {
41
+ if(!stream.skipTo("#}")) {
42
+ stream.skipToEnd();
43
+ } else {
44
+ stream.eatWhile(/\#|}/);
45
+ state.incomment = false;
46
+ }
47
+ return "comment";
48
+ //Tag
49
+ } else if (state.intag) {
50
+ //After operator
51
+ if(state.operator) {
52
+ state.operator = false;
53
+ if(stream.match(atom)) {
54
+ return "atom";
55
+ }
56
+ if(stream.match(number)) {
57
+ return "number";
58
+ }
59
+ }
60
+ //After sign
61
+ if(state.sign) {
62
+ state.sign = false;
63
+ if(stream.match(atom)) {
64
+ return "atom";
65
+ }
66
+ if(stream.match(number)) {
67
+ return "number";
68
+ }
69
+ }
70
+
71
+ if(state.instring) {
72
+ if(ch == state.instring) {
73
+ state.instring = false;
74
+ }
75
+ stream.next();
76
+ return "string";
77
+ } else if(ch == "'" || ch == '"') {
78
+ state.instring = ch;
79
+ stream.next();
80
+ return "string";
81
+ } else if(stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) {
82
+ state.intag = false;
83
+ return "tag";
84
+ } else if(stream.match(operator)) {
85
+ state.operator = true;
86
+ return "operator";
87
+ } else if(stream.match(sign)) {
88
+ state.sign = true;
89
+ } else {
90
+ if(stream.eat(" ") || stream.sol()) {
91
+ if(stream.match(keywords)) {
92
+ return "keyword";
93
+ }
94
+ if(stream.match(atom)) {
95
+ return "atom";
96
+ }
97
+ if(stream.match(number)) {
98
+ return "number";
99
+ }
100
+ if(stream.sol()) {
101
+ stream.next();
102
+ }
103
+ } else {
104
+ stream.next();
105
+ }
106
+
107
+ }
108
+ return "variable";
109
+ } else if (stream.eat("{")) {
110
+ if (ch = stream.eat("#")) {
111
+ state.incomment = true;
112
+ if(!stream.skipTo("#}")) {
113
+ stream.skipToEnd();
114
+ } else {
115
+ stream.eatWhile(/\#|}/);
116
+ state.incomment = false;
117
+ }
118
+ return "comment";
119
+ //Open tag
120
+ } else if (ch = stream.eat(/\{|%/)) {
121
+ //Cache close tag
122
+ state.intag = ch;
123
+ if(ch == "{") {
124
+ state.intag = "}";
125
+ }
126
+ stream.eat("-");
127
+ return "tag";
128
+ }
129
+ }
130
+ stream.next();
131
+ };
132
+
133
+ return {
134
+ startState: function () {
135
+ return {tokenize: tokenBase};
136
+ },
137
+ token: function (stream, state) {
138
+ return state.tokenize(stream, state);
139
+ }
140
+ };
141
+ });
142
+ });
assets/js/vendor/codemirror/mode/julia/index.html ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Julia mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="julia.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Julia</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Julia mode</h2>
27
+
28
+ <div><textarea id="code" name="code">
29
+ #numbers
30
+ 1234
31
+ 1234im
32
+ .234
33
+ .234im
34
+ 2.23im
35
+ 2.3f3
36
+ 23e2
37
+ 0x234
38
+
39
+ #strings
40
+ 'a'
41
+ "asdf"
42
+ r"regex"
43
+ b"bytestring"
44
+
45
+ """
46
+ multiline string
47
+ """
48
+
49
+ #identifiers
50
+ a
51
+ as123
52
+ function_name!
53
+
54
+ #unicode identifiers
55
+ # a = x\ddot
56
+ a⃗ = ẍ
57
+ # a = v\dot
58
+ a⃗ = v̇
59
+ #F\vec = m \cdotp a\vec
60
+ F⃗ = m·a⃗
61
+
62
+ #literal identifier multiples
63
+ 3x
64
+ 4[1, 2, 3]
65
+
66
+ #dicts and indexing
67
+ x=[1, 2, 3]
68
+ x[end-1]
69
+ x={"julia"=>"language of technical computing"}
70
+
71
+
72
+ #exception handling
73
+ try
74
+ f()
75
+ catch
76
+ @printf "Error"
77
+ finally
78
+ g()
79
+ end
80
+
81
+ #types
82
+ immutable Color{T<:Number}
83
+ r::T
84
+ g::T
85
+ b::T
86
+ end
87
+
88
+ #functions
89
+ function change!(x::Vector{Float64})
90
+ for i = 1:length(x)
91
+ x[i] *= 2
92
+ end
93
+ end
94
+
95
+ #function invocation
96
+ f('b', (2, 3)...)
97
+
98
+ #operators
99
+ |=
100
+ &=
101
+ ^=
102
+ \-
103
+ %=
104
+ *=
105
+ +=
106
+ -=
107
+ <=
108
+ >=
109
+ !=
110
+ ==
111
+ %
112
+ *
113
+ +
114
+ -
115
+ <
116
+ >
117
+ !
118
+ =
119
+ |
120
+ &
121
+ ^
122
+ \
123
+ ?
124
+ ~
125
+ :
126
+ $
127
+ <:
128
+ .<
129
+ .>
130
+ <<
131
+ <<=
132
+ >>
133
+ >>>>
134
+ >>=
135
+ >>>=
136
+ <<=
137
+ <<<=
138
+ .<=
139
+ .>=
140
+ .==
141
+ ->
142
+ //
143
+ in
144
+ ...
145
+ //
146
+ :=
147
+ .//=
148
+ .*=
149
+ ./=
150
+ .^=
151
+ .%=
152
+ .+=
153
+ .-=
154
+ \=
155
+ \\=
156
+ ||
157
+ ===
158
+ &&
159
+ |=
160
+ .|=
161
+ <:
162
+ >:
163
+ |>
164
+ <|
165
+ ::
166
+ x ? y : z
167
+
168
+ #macros
169
+ @spawnat 2 1+1
170
+ @eval(:x)
171
+
172
+ #keywords and operators
173
+ if else elseif while for
174
+ begin let end do
175
+ try catch finally return break continue
176
+ global local const
177
+ export import importall using
178
+ function macro module baremodule
179
+ type immutable quote
180
+ true false enumerate
181
+
182
+
183
+ </textarea></div>
184
+ <script>
185
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
186
+ mode: {name: "julia",
187
+ },
188
+ lineNumbers: true,
189
+ indentUnit: 4,
190
+ matchBrackets: true
191
+ });
192
+ </script>
193
+
194
+ <p><strong>MIME types defined:</strong> <code>text/x-julia</code>.</p>
195
+ </article>
assets/js/vendor/codemirror/mode/julia/julia.js ADDED
@@ -0,0 +1,299 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("julia", function(_conf, parserConf) {
15
+ var ERRORCLASS = 'error';
16
+
17
+ function wordRegexp(words) {
18
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
19
+ }
20
+
21
+ var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/;
22
+ var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
23
+ var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
24
+ var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"];
25
+ var blockClosers = ["end", "else", "elseif", "catch", "finally"];
26
+ var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype', 'ccall'];
27
+ var builtinList = ['true', 'false', 'enumerate', 'open', 'close', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'UTF8String', 'ASCIIString', 'error', 'warn', 'info', '@printf'];
28
+
29
+ //var stringPrefixes = new RegExp("^[br]?('|\")")
30
+ var stringPrefixes = /^(`|'|"{3}|([br]?"))/;
31
+ var keywords = wordRegexp(keywordList);
32
+ var builtins = wordRegexp(builtinList);
33
+ var openers = wordRegexp(blockOpeners);
34
+ var closers = wordRegexp(blockClosers);
35
+ var macro = /^@[_A-Za-z][_A-Za-z0-9]*/;
36
+ var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/;
37
+
38
+ function in_array(state) {
39
+ var ch = cur_scope(state);
40
+ if(ch=="[" || ch=="{") {
41
+ return true;
42
+ }
43
+ else {
44
+ return false;
45
+ }
46
+ }
47
+
48
+ function cur_scope(state) {
49
+ if(state.scopes.length==0) {
50
+ return null;
51
+ }
52
+ return state.scopes[state.scopes.length - 1];
53
+ }
54
+
55
+ // tokenizers
56
+ function tokenBase(stream, state) {
57
+ // Handle scope changes
58
+ var leaving_expr = state.leaving_expr;
59
+ if(stream.sol()) {
60
+ leaving_expr = false;
61
+ }
62
+ state.leaving_expr = false;
63
+ if(leaving_expr) {
64
+ if(stream.match(/^'+/)) {
65
+ return 'operator';
66
+ }
67
+
68
+ }
69
+
70
+ if(stream.match(/^\.{2,3}/)) {
71
+ return 'operator';
72
+ }
73
+
74
+ if (stream.eatSpace()) {
75
+ return null;
76
+ }
77
+
78
+ var ch = stream.peek();
79
+ // Handle Comments
80
+ if (ch === '#') {
81
+ stream.skipToEnd();
82
+ return 'comment';
83
+ }
84
+ if(ch==='[') {
85
+ state.scopes.push("[");
86
+ }
87
+
88
+ if(ch==='{') {
89
+ state.scopes.push("{");
90
+ }
91
+
92
+ var scope=cur_scope(state);
93
+
94
+ if(scope==='[' && ch===']') {
95
+ state.scopes.pop();
96
+ state.leaving_expr=true;
97
+ }
98
+
99
+ if(scope==='{' && ch==='}') {
100
+ state.scopes.pop();
101
+ state.leaving_expr=true;
102
+ }
103
+
104
+ if(ch===')') {
105
+ state.leaving_expr = true;
106
+ }
107
+
108
+ var match;
109
+ if(!in_array(state) && (match=stream.match(openers, false))) {
110
+ state.scopes.push(match);
111
+ }
112
+
113
+ if(!in_array(state) && stream.match(closers, false)) {
114
+ state.scopes.pop();
115
+ }
116
+
117
+ if(in_array(state)) {
118
+ if(stream.match(/^end/)) {
119
+ return 'number';
120
+ }
121
+
122
+ }
123
+
124
+ if(stream.match(/^=>/)) {
125
+ return 'operator';
126
+ }
127
+
128
+
129
+ // Handle Number Literals
130
+ if (stream.match(/^[0-9\.]/, false)) {
131
+ var imMatcher = RegExp(/^im\b/);
132
+ var floatLiteral = false;
133
+ // Floats
134
+ if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; }
135
+ if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; }
136
+ if (stream.match(/^\.\d+/)) { floatLiteral = true; }
137
+ if (floatLiteral) {
138
+ // Float literals may be "imaginary"
139
+ stream.match(imMatcher);
140
+ state.leaving_expr = true;
141
+ return 'number';
142
+ }
143
+ // Integers
144
+ var intLiteral = false;
145
+ // Hex
146
+ if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; }
147
+ // Binary
148
+ if (stream.match(/^0b[01]+/i)) { intLiteral = true; }
149
+ // Octal
150
+ if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; }
151
+ // Decimal
152
+ if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
153
+ intLiteral = true;
154
+ }
155
+ // Zero by itself with no other piece of number.
156
+ if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }
157
+ if (intLiteral) {
158
+ // Integer literals may be "long"
159
+ stream.match(imMatcher);
160
+ state.leaving_expr = true;
161
+ return 'number';
162
+ }
163
+ }
164
+
165
+ if(stream.match(/^(::)|(<:)/)) {
166
+ return 'operator';
167
+ }
168
+
169
+ // Handle symbols
170
+ if(!leaving_expr && stream.match(symbol)) {
171
+ return 'string';
172
+ }
173
+
174
+ // Handle operators and Delimiters
175
+ if (stream.match(operators)) {
176
+ return 'operator';
177
+ }
178
+
179
+
180
+ // Handle Strings
181
+ if (stream.match(stringPrefixes)) {
182
+ state.tokenize = tokenStringFactory(stream.current());
183
+ return state.tokenize(stream, state);
184
+ }
185
+
186
+ if (stream.match(macro)) {
187
+ return 'meta';
188
+ }
189
+
190
+
191
+ if (stream.match(delimiters)) {
192
+ return null;
193
+ }
194
+
195
+ if (stream.match(keywords)) {
196
+ return 'keyword';
197
+ }
198
+
199
+ if (stream.match(builtins)) {
200
+ return 'builtin';
201
+ }
202
+
203
+
204
+ if (stream.match(identifiers)) {
205
+ state.leaving_expr=true;
206
+ return 'variable';
207
+ }
208
+ // Handle non-detected items
209
+ stream.next();
210
+ return ERRORCLASS;
211
+ }
212
+
213
+ function tokenStringFactory(delimiter) {
214
+ while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
215
+ delimiter = delimiter.substr(1);
216
+ }
217
+ var singleline = delimiter.length == 1;
218
+ var OUTCLASS = 'string';
219
+
220
+ function tokenString(stream, state) {
221
+ while (!stream.eol()) {
222
+ stream.eatWhile(/[^'"\\]/);
223
+ if (stream.eat('\\')) {
224
+ stream.next();
225
+ if (singleline && stream.eol()) {
226
+ return OUTCLASS;
227
+ }
228
+ } else if (stream.match(delimiter)) {
229
+ state.tokenize = tokenBase;
230
+ return OUTCLASS;
231
+ } else {
232
+ stream.eat(/['"]/);
233
+ }
234
+ }
235
+ if (singleline) {
236
+ if (parserConf.singleLineStringErrors) {
237
+ return ERRORCLASS;
238
+ } else {
239
+ state.tokenize = tokenBase;
240
+ }
241
+ }
242
+ return OUTCLASS;
243
+ }
244
+ tokenString.isString = true;
245
+ return tokenString;
246
+ }
247
+
248
+ function tokenLexer(stream, state) {
249
+ var style = state.tokenize(stream, state);
250
+ var current = stream.current();
251
+
252
+ // Handle '.' connected identifiers
253
+ if (current === '.') {
254
+ style = stream.match(identifiers, false) ? null : ERRORCLASS;
255
+ if (style === null && state.lastStyle === 'meta') {
256
+ // Apply 'meta' style to '.' connected identifiers when
257
+ // appropriate.
258
+ style = 'meta';
259
+ }
260
+ return style;
261
+ }
262
+
263
+ return style;
264
+ }
265
+
266
+ var external = {
267
+ startState: function() {
268
+ return {
269
+ tokenize: tokenBase,
270
+ scopes: [],
271
+ leaving_expr: false
272
+ };
273
+ },
274
+
275
+ token: function(stream, state) {
276
+ var style = tokenLexer(stream, state);
277
+ state.lastStyle = style;
278
+ return style;
279
+ },
280
+
281
+ indent: function(state, textAfter) {
282
+ var delta = 0;
283
+ if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") {
284
+ delta = -1;
285
+ }
286
+ return (state.scopes.length + delta) * _conf.indentUnit;
287
+ },
288
+
289
+ lineComment: "#",
290
+ fold: "indent",
291
+ electricChars: "edlsifyh]}"
292
+ };
293
+ return external;
294
+ });
295
+
296
+
297
+ CodeMirror.defineMIME("text/x-julia", "julia");
298
+
299
+ });
assets/js/vendor/codemirror/mode/livescript/index.html ADDED
@@ -0,0 +1,459 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: LiveScript mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/solarized.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="livescript.js"></script>
11
+ <style>.CodeMirror {font-size: 80%;border-top: 1px solid silver; border-bottom: 1px solid silver;}</style>
12
+ <div id=nav>
13
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
14
+
15
+ <ul>
16
+ <li><a href="../../index.html">Home</a>
17
+ <li><a href="../../doc/manual.html">Manual</a>
18
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
19
+ </ul>
20
+ <ul>
21
+ <li><a href="../index.html">Language modes</a>
22
+ <li><a class=active href="#">LiveScript</a>
23
+ </ul>
24
+ </div>
25
+
26
+ <article>
27
+ <h2>LiveScript mode</h2>
28
+ <form><textarea id="code" name="code">
29
+ # LiveScript mode for CodeMirror
30
+ # The following script, prelude.ls, is used to
31
+ # demonstrate LiveScript mode for CodeMirror.
32
+ # https://github.com/gkz/prelude-ls
33
+
34
+ export objToFunc = objToFunc = (obj) ->
35
+ (key) -> obj[key]
36
+
37
+ export each = (f, xs) -->
38
+ if typeof! xs is \Object
39
+ for , x of xs then f x
40
+ else
41
+ for x in xs then f x
42
+ xs
43
+
44
+ export map = (f, xs) -->
45
+ f = objToFunc f if typeof! f isnt \Function
46
+ type = typeof! xs
47
+ if type is \Object
48
+ {[key, f x] for key, x of xs}
49
+ else
50
+ result = [f x for x in xs]
51
+ if type is \String then result * '' else result
52
+
53
+ export filter = (f, xs) -->
54
+ f = objToFunc f if typeof! f isnt \Function
55
+ type = typeof! xs
56
+ if type is \Object
57
+ {[key, x] for key, x of xs when f x}
58
+ else
59
+ result = [x for x in xs when f x]
60
+ if type is \String then result * '' else result
61
+
62
+ export reject = (f, xs) -->
63
+ f = objToFunc f if typeof! f isnt \Function
64
+ type = typeof! xs
65
+ if type is \Object
66
+ {[key, x] for key, x of xs when not f x}
67
+ else
68
+ result = [x for x in xs when not f x]
69
+ if type is \String then result * '' else result
70
+
71
+ export partition = (f, xs) -->
72
+ f = objToFunc f if typeof! f isnt \Function
73
+ type = typeof! xs
74
+ if type is \Object
75
+ passed = {}
76
+ failed = {}
77
+ for key, x of xs
78
+ (if f x then passed else failed)[key] = x
79
+ else
80
+ passed = []
81
+ failed = []
82
+ for x in xs
83
+ (if f x then passed else failed)push x
84
+ if type is \String
85
+ passed *= ''
86
+ failed *= ''
87
+ [passed, failed]
88
+
89
+ export find = (f, xs) -->
90
+ f = objToFunc f if typeof! f isnt \Function
91
+ if typeof! xs is \Object
92
+ for , x of xs when f x then return x
93
+ else
94
+ for x in xs when f x then return x
95
+ void
96
+
97
+ export head = export first = (xs) ->
98
+ return void if not xs.length
99
+ xs.0
100
+
101
+ export tail = (xs) ->
102
+ return void if not xs.length
103
+ xs.slice 1
104
+
105
+ export last = (xs) ->
106
+ return void if not xs.length
107
+ xs[*-1]
108
+
109
+ export initial = (xs) ->
110
+ return void if not xs.length
111
+ xs.slice 0 xs.length - 1
112
+
113
+ export empty = (xs) ->
114
+ if typeof! xs is \Object
115
+ for x of xs then return false
116
+ return yes
117
+ not xs.length
118
+
119
+ export values = (obj) ->
120
+ [x for , x of obj]
121
+
122
+ export keys = (obj) ->
123
+ [x for x of obj]
124
+
125
+ export len = (xs) ->
126
+ xs = values xs if typeof! xs is \Object
127
+ xs.length
128
+
129
+ export cons = (x, xs) -->
130
+ if typeof! xs is \String then x + xs else [x] ++ xs
131
+
132
+ export append = (xs, ys) -->
133
+ if typeof! ys is \String then xs + ys else xs ++ ys
134
+
135
+ export join = (sep, xs) -->
136
+ xs = values xs if typeof! xs is \Object
137
+ xs.join sep
138
+
139
+ export reverse = (xs) ->
140
+ if typeof! xs is \String
141
+ then (xs / '')reverse! * ''
142
+ else xs.slice!reverse!
143
+
144
+ export fold = export foldl = (f, memo, xs) -->
145
+ if typeof! xs is \Object
146
+ for , x of xs then memo = f memo, x
147
+ else
148
+ for x in xs then memo = f memo, x
149
+ memo
150
+
151
+ export fold1 = export foldl1 = (f, xs) --> fold f, xs.0, xs.slice 1
152
+
153
+ export foldr = (f, memo, xs) --> fold f, memo, xs.slice!reverse!
154
+
155
+ export foldr1 = (f, xs) -->
156
+ xs.=slice!reverse!
157
+ fold f, xs.0, xs.slice 1
158
+
159
+ export unfoldr = export unfold = (f, b) -->
160
+ if (f b)?
161
+ [that.0] ++ unfoldr f, that.1
162
+ else
163
+ []
164
+
165
+ export andList = (xs) ->
166
+ for x in xs when not x
167
+ return false
168
+ true
169
+
170
+ export orList = (xs) ->
171
+ for x in xs when x
172
+ return true
173
+ false
174
+
175
+ export any = (f, xs) -->
176
+ f = objToFunc f if typeof! f isnt \Function
177
+ for x in xs when f x
178
+ return yes
179
+ no
180
+
181
+ export all = (f, xs) -->
182
+ f = objToFunc f if typeof! f isnt \Function
183
+ for x in xs when not f x
184
+ return no
185
+ yes
186
+
187
+ export unique = (xs) ->
188
+ result = []
189
+ if typeof! xs is \Object
190
+ for , x of xs when x not in result then result.push x
191
+ else
192
+ for x in xs when x not in result then result.push x
193
+ if typeof! xs is \String then result * '' else result
194
+
195
+ export sort = (xs) ->
196
+ xs.concat!sort (x, y) ->
197
+ | x > y => 1
198
+ | x < y => -1
199
+ | _ => 0
200
+
201
+ export sortBy = (f, xs) -->
202
+ return [] unless xs.length
203
+ xs.concat!sort f
204
+
205
+ export compare = (f, x, y) -->
206
+ | (f x) > (f y) => 1
207
+ | (f x) < (f y) => -1
208
+ | otherwise => 0
209
+
210
+ export sum = (xs) ->
211
+ result = 0
212
+ if typeof! xs is \Object
213
+ for , x of xs then result += x
214
+ else
215
+ for x in xs then result += x
216
+ result
217
+
218
+ export product = (xs) ->
219
+ result = 1
220
+ if typeof! xs is \Object
221
+ for , x of xs then result *= x
222
+ else
223
+ for x in xs then result *= x
224
+ result
225
+
226
+ export mean = export average = (xs) -> (sum xs) / len xs
227
+
228
+ export concat = (xss) -> fold append, [], xss
229
+
230
+ export concatMap = (f, xs) --> fold ((memo, x) -> append memo, f x), [], xs
231
+
232
+ export listToObj = (xs) ->
233
+ {[x.0, x.1] for x in xs}
234
+
235
+ export maximum = (xs) -> fold1 (>?), xs
236
+
237
+ export minimum = (xs) -> fold1 (<?), xs
238
+
239
+ export scan = export scanl = (f, memo, xs) -->
240
+ last = memo
241
+ if typeof! xs is \Object
242
+ then [memo] ++ [last = f last, x for , x of xs]
243
+ else [memo] ++ [last = f last, x for x in xs]
244
+
245
+ export scan1 = export scanl1 = (f, xs) --> scan f, xs.0, xs.slice 1
246
+
247
+ export scanr = (f, memo, xs) -->
248
+ xs.=slice!reverse!
249
+ scan f, memo, xs .reverse!
250
+
251
+ export scanr1 = (f, xs) -->
252
+ xs.=slice!reverse!
253
+ scan f, xs.0, xs.slice 1 .reverse!
254
+
255
+ export replicate = (n, x) -->
256
+ result = []
257
+ i = 0
258
+ while i < n, ++i then result.push x
259
+ result
260
+
261
+ export take = (n, xs) -->
262
+ | n <= 0
263
+ if typeof! xs is \String then '' else []
264
+ | not xs.length => xs
265
+ | otherwise => xs.slice 0, n
266
+
267
+ export drop = (n, xs) -->
268
+ | n <= 0 => xs
269
+ | not xs.length => xs
270
+ | otherwise => xs.slice n
271
+
272
+ export splitAt = (n, xs) --> [(take n, xs), (drop n, xs)]
273
+
274
+ export takeWhile = (p, xs) -->
275
+ return xs if not xs.length
276
+ p = objToFunc p if typeof! p isnt \Function
277
+ result = []
278
+ for x in xs
279
+ break if not p x
280
+ result.push x
281
+ if typeof! xs is \String then result * '' else result
282
+
283
+ export dropWhile = (p, xs) -->
284
+ return xs if not xs.length
285
+ p = objToFunc p if typeof! p isnt \Function
286
+ i = 0
287
+ for x in xs
288
+ break if not p x
289
+ ++i
290
+ drop i, xs
291
+
292
+ export span = (p, xs) --> [(takeWhile p, xs), (dropWhile p, xs)]
293
+
294
+ export breakIt = (p, xs) --> span (not) << p, xs
295
+
296
+ export zip = (xs, ys) -->
297
+ result = []
298
+ for zs, i in [xs, ys]
299
+ for z, j in zs
300
+ result.push [] if i is 0
301
+ result[j]?push z
302
+ result
303
+
304
+ export zipWith = (f,xs, ys) -->
305
+ f = objToFunc f if typeof! f isnt \Function
306
+ if not xs.length or not ys.length
307
+ []
308
+ else
309
+ [f.apply this, zs for zs in zip.call this, xs, ys]
310
+
311
+ export zipAll = (...xss) ->
312
+ result = []
313
+ for xs, i in xss
314
+ for x, j in xs
315
+ result.push [] if i is 0
316
+ result[j]?push x
317
+ result
318
+
319
+ export zipAllWith = (f, ...xss) ->
320
+ f = objToFunc f if typeof! f isnt \Function
321
+ if not xss.0.length or not xss.1.length
322
+ []
323
+ else
324
+ [f.apply this, xs for xs in zipAll.apply this, xss]
325
+
326
+ export compose = (...funcs) ->
327
+ ->
328
+ args = arguments
329
+ for f in funcs
330
+ args = [f.apply this, args]
331
+ args.0
332
+
333
+ export curry = (f) ->
334
+ curry$ f # using util method curry$ from livescript
335
+
336
+ export id = (x) -> x
337
+
338
+ export flip = (f, x, y) --> f y, x
339
+
340
+ export fix = (f) ->
341
+ ( (g, x) -> -> f(g g) ...arguments ) do
342
+ (g, x) -> -> f(g g) ...arguments
343
+
344
+ export lines = (str) ->
345
+ return [] if not str.length
346
+ str / \\n
347
+
348
+ export unlines = (strs) -> strs * \\n
349
+
350
+ export words = (str) ->
351
+ return [] if not str.length
352
+ str / /[ ]+/
353
+
354
+ export unwords = (strs) -> strs * ' '
355
+
356
+ export max = (>?)
357
+
358
+ export min = (<?)
359
+
360
+ export negate = (x) -> -x
361
+
362
+ export abs = Math.abs
363
+
364
+ export signum = (x) ->
365
+ | x < 0 => -1
366
+ | x > 0 => 1
367
+ | otherwise => 0
368
+
369
+ export quot = (x, y) --> ~~(x / y)
370
+
371
+ export rem = (%)
372
+
373
+ export div = (x, y) --> Math.floor x / y
374
+
375
+ export mod = (%%)
376
+
377
+ export recip = (1 /)
378
+
379
+ export pi = Math.PI
380
+
381
+ export tau = pi * 2
382
+
383
+ export exp = Math.exp
384
+
385
+ export sqrt = Math.sqrt
386
+
387
+ # changed from log as log is a
388
+ # common function for logging things
389
+ export ln = Math.log
390
+
391
+ export pow = (^)
392
+
393
+ export sin = Math.sin
394
+
395
+ export tan = Math.tan
396
+
397
+ export cos = Math.cos
398
+
399
+ export asin = Math.asin
400
+
401
+ export acos = Math.acos
402
+
403
+ export atan = Math.atan
404
+
405
+ export atan2 = (x, y) --> Math.atan2 x, y
406
+
407
+ # sinh
408
+ # tanh
409
+ # cosh
410
+ # asinh
411
+ # atanh
412
+ # acosh
413
+
414
+ export truncate = (x) -> ~~x
415
+
416
+ export round = Math.round
417
+
418
+ export ceiling = Math.ceil
419
+
420
+ export floor = Math.floor
421
+
422
+ export isItNaN = (x) -> x isnt x
423
+
424
+ export even = (x) -> x % 2 == 0
425
+
426
+ export odd = (x) -> x % 2 != 0
427
+
428
+ export gcd = (x, y) -->
429
+ x = Math.abs x
430
+ y = Math.abs y
431
+ until y is 0
432
+ z = x % y
433
+ x = y
434
+ y = z
435
+ x
436
+
437
+ export lcm = (x, y) -->
438
+ Math.abs Math.floor (x / (gcd x, y) * y)
439
+
440
+ # meta
441
+ export installPrelude = !(target) ->
442
+ unless target.prelude?isInstalled
443
+ target <<< out$ # using out$ generated by livescript
444
+ target <<< target.prelude.isInstalled = true
445
+
446
+ export prelude = out$
447
+ </textarea></form>
448
+ <script>
449
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
450
+ theme: "solarized light",
451
+ lineNumbers: true
452
+ });
453
+ </script>
454
+
455
+ <p><strong>MIME types defined:</strong> <code>text/x-livescript</code>.</p>
456
+
457
+ <p>The LiveScript mode was written by Kenneth Bentley.</p>
458
+
459
+ </article>
assets/js/vendor/codemirror/mode/livescript/livescript.js ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /**
5
+ * Link to the project's GitHub page:
6
+ * https://github.com/duralog/CodeMirror
7
+ */
8
+
9
+ (function(mod) {
10
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
11
+ mod(require("../../lib/codemirror"));
12
+ else if (typeof define == "function" && define.amd) // AMD
13
+ define(["../../lib/codemirror"], mod);
14
+ else // Plain browser env
15
+ mod(CodeMirror);
16
+ })(function(CodeMirror) {
17
+ "use strict";
18
+
19
+ CodeMirror.defineMode('livescript', function(){
20
+ var tokenBase = function(stream, state) {
21
+ var next_rule = state.next || "start";
22
+ if (next_rule) {
23
+ state.next = state.next;
24
+ var nr = Rules[next_rule];
25
+ if (nr.splice) {
26
+ for (var i$ = 0; i$ < nr.length; ++i$) {
27
+ var r = nr[i$];
28
+ if (r.regex && stream.match(r.regex)) {
29
+ state.next = r.next || state.next;
30
+ return r.token;
31
+ }
32
+ }
33
+ stream.next();
34
+ return 'error';
35
+ }
36
+ if (stream.match(r = Rules[next_rule])) {
37
+ if (r.regex && stream.match(r.regex)) {
38
+ state.next = r.next;
39
+ return r.token;
40
+ } else {
41
+ stream.next();
42
+ return 'error';
43
+ }
44
+ }
45
+ }
46
+ stream.next();
47
+ return 'error';
48
+ };
49
+ var external = {
50
+ startState: function(){
51
+ return {
52
+ next: 'start',
53
+ lastToken: null
54
+ };
55
+ },
56
+ token: function(stream, state){
57
+ while (stream.pos == stream.start)
58
+ var style = tokenBase(stream, state);
59
+ state.lastToken = {
60
+ style: style,
61
+ indent: stream.indentation(),
62
+ content: stream.current()
63
+ };
64
+ return style.replace(/\./g, ' ');
65
+ },
66
+ indent: function(state){
67
+ var indentation = state.lastToken.indent;
68
+ if (state.lastToken.content.match(indenter)) {
69
+ indentation += 2;
70
+ }
71
+ return indentation;
72
+ }
73
+ };
74
+ return external;
75
+ });
76
+
77
+ var identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*';
78
+ var indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
79
+ var keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))';
80
+ var stringfill = {
81
+ token: 'string',
82
+ regex: '.+'
83
+ };
84
+ var Rules = {
85
+ start: [
86
+ {
87
+ token: 'comment.doc',
88
+ regex: '/\\*',
89
+ next: 'comment'
90
+ }, {
91
+ token: 'comment',
92
+ regex: '#.*'
93
+ }, {
94
+ token: 'keyword',
95
+ regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend
96
+ }, {
97
+ token: 'constant.language',
98
+ regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend
99
+ }, {
100
+ token: 'invalid.illegal',
101
+ regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend
102
+ }, {
103
+ token: 'language.support.class',
104
+ regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend
105
+ }, {
106
+ token: 'language.support.function',
107
+ regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend
108
+ }, {
109
+ token: 'variable.language',
110
+ regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend
111
+ }, {
112
+ token: 'identifier',
113
+ regex: identifier + '\\s*:(?![:=])'
114
+ }, {
115
+ token: 'variable',
116
+ regex: identifier
117
+ }, {
118
+ token: 'keyword.operator',
119
+ regex: '(?:\\.{3}|\\s+\\?)'
120
+ }, {
121
+ token: 'keyword.variable',
122
+ regex: '(?:@+|::|\\.\\.)',
123
+ next: 'key'
124
+ }, {
125
+ token: 'keyword.operator',
126
+ regex: '\\.\\s*',
127
+ next: 'key'
128
+ }, {
129
+ token: 'string',
130
+ regex: '\\\\\\S[^\\s,;)}\\]]*'
131
+ }, {
132
+ token: 'string.doc',
133
+ regex: '\'\'\'',
134
+ next: 'qdoc'
135
+ }, {
136
+ token: 'string.doc',
137
+ regex: '"""',
138
+ next: 'qqdoc'
139
+ }, {
140
+ token: 'string',
141
+ regex: '\'',
142
+ next: 'qstring'
143
+ }, {
144
+ token: 'string',
145
+ regex: '"',
146
+ next: 'qqstring'
147
+ }, {
148
+ token: 'string',
149
+ regex: '`',
150
+ next: 'js'
151
+ }, {
152
+ token: 'string',
153
+ regex: '<\\[',
154
+ next: 'words'
155
+ }, {
156
+ token: 'string.regex',
157
+ regex: '//',
158
+ next: 'heregex'
159
+ }, {
160
+ token: 'string.regex',
161
+ regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}',
162
+ next: 'key'
163
+ }, {
164
+ token: 'constant.numeric',
165
+ regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)'
166
+ }, {
167
+ token: 'lparen',
168
+ regex: '[({[]'
169
+ }, {
170
+ token: 'rparen',
171
+ regex: '[)}\\]]',
172
+ next: 'key'
173
+ }, {
174
+ token: 'keyword.operator',
175
+ regex: '\\S+'
176
+ }, {
177
+ token: 'text',
178
+ regex: '\\s+'
179
+ }
180
+ ],
181
+ heregex: [
182
+ {
183
+ token: 'string.regex',
184
+ regex: '.*?//[gimy$?]{0,4}',
185
+ next: 'start'
186
+ }, {
187
+ token: 'string.regex',
188
+ regex: '\\s*#{'
189
+ }, {
190
+ token: 'comment.regex',
191
+ regex: '\\s+(?:#.*)?'
192
+ }, {
193
+ token: 'string.regex',
194
+ regex: '\\S+'
195
+ }
196
+ ],
197
+ key: [
198
+ {
199
+ token: 'keyword.operator',
200
+ regex: '[.?@!]+'
201
+ }, {
202
+ token: 'identifier',
203
+ regex: identifier,
204
+ next: 'start'
205
+ }, {
206
+ token: 'text',
207
+ regex: '',
208
+ next: 'start'
209
+ }
210
+ ],
211
+ comment: [
212
+ {
213
+ token: 'comment.doc',
214
+ regex: '.*?\\*/',
215
+ next: 'start'
216
+ }, {
217
+ token: 'comment.doc',
218
+ regex: '.+'
219
+ }
220
+ ],
221
+ qdoc: [
222
+ {
223
+ token: 'string',
224
+ regex: ".*?'''",
225
+ next: 'key'
226
+ }, stringfill
227
+ ],
228
+ qqdoc: [
229
+ {
230
+ token: 'string',
231
+ regex: '.*?"""',
232
+ next: 'key'
233
+ }, stringfill
234
+ ],
235
+ qstring: [
236
+ {
237
+ token: 'string',
238
+ regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'',
239
+ next: 'key'
240
+ }, stringfill
241
+ ],
242
+ qqstring: [
243
+ {
244
+ token: 'string',
245
+ regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
246
+ next: 'key'
247
+ }, stringfill
248
+ ],
249
+ js: [
250
+ {
251
+ token: 'string',
252
+ regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`',
253
+ next: 'key'
254
+ }, stringfill
255
+ ],
256
+ words: [
257
+ {
258
+ token: 'string',
259
+ regex: '.*?\\]>',
260
+ next: 'key'
261
+ }, stringfill
262
+ ]
263
+ };
264
+ for (var idx in Rules) {
265
+ var r = Rules[idx];
266
+ if (r.splice) {
267
+ for (var i = 0, len = r.length; i < len; ++i) {
268
+ var rr = r[i];
269
+ if (typeof rr.regex === 'string') {
270
+ Rules[idx][i].regex = new RegExp('^' + rr.regex);
271
+ }
272
+ }
273
+ } else if (typeof rr.regex === 'string') {
274
+ Rules[idx].regex = new RegExp('^' + r.regex);
275
+ }
276
+ }
277
+
278
+ CodeMirror.defineMIME('text/x-livescript', 'livescript');
279
+
280
+ });
assets/js/vendor/codemirror/mode/lua/index.html ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Lua mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/neat.css">
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="../../lib/codemirror.js"></script>
11
+ <script src="lua.js"></script>
12
+ <style>.CodeMirror {border: 1px solid black;}</style>
13
+ <div id=nav>
14
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
15
+
16
+ <ul>
17
+ <li><a href="../../index.html">Home</a>
18
+ <li><a href="../../doc/manual.html">Manual</a>
19
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
20
+ </ul>
21
+ <ul>
22
+ <li><a href="../index.html">Language modes</a>
23
+ <li><a class=active href="#">Lua</a>
24
+ </ul>
25
+ </div>
26
+
27
+ <article>
28
+ <h2>Lua mode</h2>
29
+ <form><textarea id="code" name="code">
30
+ --[[
31
+ example useless code to show lua syntax highlighting
32
+ this is multiline comment
33
+ ]]
34
+
35
+ function blahblahblah(x)
36
+
37
+ local table = {
38
+ "asd" = 123,
39
+ "x" = 0.34,
40
+ }
41
+ if x ~= 3 then
42
+ print( x )
43
+ elseif x == "string"
44
+ my_custom_function( 0x34 )
45
+ else
46
+ unknown_function( "some string" )
47
+ end
48
+
49
+ --single line comment
50
+
51
+ end
52
+
53
+ function blablabla3()
54
+
55
+ for k,v in ipairs( table ) do
56
+ --abcde..
57
+ y=[=[
58
+ x=[[
59
+ x is a multi line string
60
+ ]]
61
+ but its definition is iside a highest level string!
62
+ ]=]
63
+ print(" \"\" ")
64
+
65
+ s = math.sin( x )
66
+ end
67
+
68
+ end
69
+ </textarea></form>
70
+ <script>
71
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
72
+ matchBrackets: true,
73
+ theme: "neat"
74
+ });
75
+ </script>
76
+
77
+ <p>Loosely based on Franciszek
78
+ Wawrzak's <a href="http://codemirror.net/1/contrib/lua">CodeMirror
79
+ 1 mode</a>. One configuration parameter is
80
+ supported, <code>specials</code>, to which you can provide an
81
+ array of strings to have those identifiers highlighted with
82
+ the <code>lua-special</code> style.</p>
83
+ <p><strong>MIME types defined:</strong> <code>text/x-lua</code>.</p>
84
+
85
+ </article>
assets/js/vendor/codemirror/mode/lua/lua.js ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's
5
+ // CodeMirror 1 mode.
6
+ // highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting
7
+
8
+ (function(mod) {
9
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
10
+ mod(require("../../lib/codemirror"));
11
+ else if (typeof define == "function" && define.amd) // AMD
12
+ define(["../../lib/codemirror"], mod);
13
+ else // Plain browser env
14
+ mod(CodeMirror);
15
+ })(function(CodeMirror) {
16
+ "use strict";
17
+
18
+ CodeMirror.defineMode("lua", function(config, parserConfig) {
19
+ var indentUnit = config.indentUnit;
20
+
21
+ function prefixRE(words) {
22
+ return new RegExp("^(?:" + words.join("|") + ")", "i");
23
+ }
24
+ function wordRE(words) {
25
+ return new RegExp("^(?:" + words.join("|") + ")$", "i");
26
+ }
27
+ var specials = wordRE(parserConfig.specials || []);
28
+
29
+ // long list of standard functions from lua manual
30
+ var builtins = wordRE([
31
+ "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load",
32
+ "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require",
33
+ "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall",
34
+
35
+ "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield",
36
+
37
+ "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable",
38
+ "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable",
39
+ "debug.setupvalue","debug.traceback",
40
+
41
+ "close","flush","lines","read","seek","setvbuf","write",
42
+
43
+ "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin",
44
+ "io.stdout","io.tmpfile","io.type","io.write",
45
+
46
+ "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg",
47
+ "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max",
48
+ "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh",
49
+ "math.sqrt","math.tan","math.tanh",
50
+
51
+ "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale",
52
+ "os.time","os.tmpname",
53
+
54
+ "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload",
55
+ "package.seeall",
56
+
57
+ "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub",
58
+ "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper",
59
+
60
+ "table.concat","table.insert","table.maxn","table.remove","table.sort"
61
+ ]);
62
+ var keywords = wordRE(["and","break","elseif","false","nil","not","or","return",
63
+ "true","function", "end", "if", "then", "else", "do",
64
+ "while", "repeat", "until", "for", "in", "local" ]);
65
+
66
+ var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]);
67
+ var dedentTokens = wordRE(["end", "until", "\\)", "}"]);
68
+ var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]);
69
+
70
+ function readBracket(stream) {
71
+ var level = 0;
72
+ while (stream.eat("=")) ++level;
73
+ stream.eat("[");
74
+ return level;
75
+ }
76
+
77
+ function normal(stream, state) {
78
+ var ch = stream.next();
79
+ if (ch == "-" && stream.eat("-")) {
80
+ if (stream.eat("[") && stream.eat("["))
81
+ return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state);
82
+ stream.skipToEnd();
83
+ return "comment";
84
+ }
85
+ if (ch == "\"" || ch == "'")
86
+ return (state.cur = string(ch))(stream, state);
87
+ if (ch == "[" && /[\[=]/.test(stream.peek()))
88
+ return (state.cur = bracketed(readBracket(stream), "string"))(stream, state);
89
+ if (/\d/.test(ch)) {
90
+ stream.eatWhile(/[\w.%]/);
91
+ return "number";
92
+ }
93
+ if (/[\w_]/.test(ch)) {
94
+ stream.eatWhile(/[\w\\\-_.]/);
95
+ return "variable";
96
+ }
97
+ return null;
98
+ }
99
+
100
+ function bracketed(level, style) {
101
+ return function(stream, state) {
102
+ var curlev = null, ch;
103
+ while ((ch = stream.next()) != null) {
104
+ if (curlev == null) {if (ch == "]") curlev = 0;}
105
+ else if (ch == "=") ++curlev;
106
+ else if (ch == "]" && curlev == level) { state.cur = normal; break; }
107
+ else curlev = null;
108
+ }
109
+ return style;
110
+ };
111
+ }
112
+
113
+ function string(quote) {
114
+ return function(stream, state) {
115
+ var escaped = false, ch;
116
+ while ((ch = stream.next()) != null) {
117
+ if (ch == quote && !escaped) break;
118
+ escaped = !escaped && ch == "\\";
119
+ }
120
+ if (!escaped) state.cur = normal;
121
+ return "string";
122
+ };
123
+ }
124
+
125
+ return {
126
+ startState: function(basecol) {
127
+ return {basecol: basecol || 0, indentDepth: 0, cur: normal};
128
+ },
129
+
130
+ token: function(stream, state) {
131
+ if (stream.eatSpace()) return null;
132
+ var style = state.cur(stream, state);
133
+ var word = stream.current();
134
+ if (style == "variable") {
135
+ if (keywords.test(word)) style = "keyword";
136
+ else if (builtins.test(word)) style = "builtin";
137
+ else if (specials.test(word)) style = "variable-2";
138
+ }
139
+ if ((style != "comment") && (style != "string")){
140
+ if (indentTokens.test(word)) ++state.indentDepth;
141
+ else if (dedentTokens.test(word)) --state.indentDepth;
142
+ }
143
+ return style;
144
+ },
145
+
146
+ indent: function(state, textAfter) {
147
+ var closing = dedentPartial.test(textAfter);
148
+ return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0));
149
+ },
150
+
151
+ lineComment: "--",
152
+ blockCommentStart: "--[[",
153
+ blockCommentEnd: "]]"
154
+ };
155
+ });
156
+
157
+ CodeMirror.defineMIME("text/x-lua", "lua");
158
+
159
+ });
assets/js/vendor/codemirror/mode/mathematica/index.html ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Mathematica mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel=stylesheet href=../../lib/codemirror.css>
8
+ <script src=../../lib/codemirror.js></script>
9
+ <script src=../../addon/edit/matchbrackets.js></script>
10
+ <script src=mathematica.js></script>
11
+ <style type=text/css>
12
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
13
+ </style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#">Mathematica</a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>Mathematica mode</h2>
30
+
31
+
32
+ <textarea id="mathematicaCode">
33
+ (* example Mathematica code *)
34
+ (* Dualisiert wird anhand einer Polarität an einer
35
+ Quadrik $x^t Q x = 0$ mit regulärer Matrix $Q$ (also
36
+ mit $det(Q) \neq 0$), z.B. die Identitätsmatrix.
37
+ $p$ ist eine Liste von Polynomen - ein Ideal. *)
38
+ dualize::"singular" = "Q must be regular: found Det[Q]==0.";
39
+ dualize[ Q_, p_ ] := Block[
40
+ { m, n, xv, lv, uv, vars, polys, dual },
41
+ If[Det[Q] == 0,
42
+ Message[dualize::"singular"],
43
+ m = Length[p];
44
+ n = Length[Q] - 1;
45
+ xv = Table[Subscript[x, i], {i, 0, n}];
46
+ lv = Table[Subscript[l, i], {i, 1, m}];
47
+ uv = Table[Subscript[u, i], {i, 0, n}];
48
+ (* Konstruiere Ideal polys. *)
49
+ If[m == 0,
50
+ polys = Q.uv,
51
+ polys = Join[p, Q.uv - Transpose[Outer[D, p, xv]].lv]
52
+ ];
53
+ (* Eliminiere die ersten n + 1 + m Variablen xv und lv
54
+ aus dem Ideal polys. *)
55
+ vars = Join[xv, lv];
56
+ dual = GroebnerBasis[polys, uv, vars];
57
+ (* Ersetze u mit x im Ergebnis. *)
58
+ ReplaceAll[dual, Rule[u, x]]
59
+ ]
60
+ ]
61
+ </textarea>
62
+
63
+ <script>
64
+ var mathematicaEditor = CodeMirror.fromTextArea(document.getElementById('mathematicaCode'), {
65
+ mode: 'text/x-mathematica',
66
+ lineNumbers: true,
67
+ matchBrackets: true
68
+ });
69
+ </script>
70
+
71
+ <p><strong>MIME types defined:</strong> <code>text/x-mathematica</code> (Mathematica).</p>
72
+ </article>
assets/js/vendor/codemirror/mode/mathematica/mathematica.js ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // Mathematica mode copyright (c) 2015 by Calin Barbat
5
+ // Based on code by Patrick Scheibe (halirutan)
6
+ // See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js
7
+
8
+ (function(mod) {
9
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
10
+ mod(require("../../lib/codemirror"));
11
+ else if (typeof define == "function" && define.amd) // AMD
12
+ define(["../../lib/codemirror"], mod);
13
+ else // Plain browser env
14
+ mod(CodeMirror);
15
+ })(function(CodeMirror) {
16
+ "use strict";
17
+
18
+ CodeMirror.defineMode('mathematica', function(_config, _parserConfig) {
19
+
20
+ // used pattern building blocks
21
+ var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*';
22
+ var pBase = "(?:\\d+)";
23
+ var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)";
24
+ var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)";
25
+ var pPrecision = "(?:`(?:`?"+pFloat+")?)";
26
+
27
+ // regular expressions
28
+ var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))');
29
+ var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)');
30
+ var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)');
31
+
32
+ function tokenBase(stream, state) {
33
+ var ch;
34
+
35
+ // get next character
36
+ ch = stream.next();
37
+
38
+ // string
39
+ if (ch === '"') {
40
+ state.tokenize = tokenString;
41
+ return state.tokenize(stream, state);
42
+ }
43
+
44
+ // comment
45
+ if (ch === '(') {
46
+ if (stream.eat('*')) {
47
+ state.commentLevel++;
48
+ state.tokenize = tokenComment;
49
+ return state.tokenize(stream, state);
50
+ }
51
+ }
52
+
53
+ // go back one character
54
+ stream.backUp(1);
55
+
56
+ // look for numbers
57
+ // Numbers in a baseform
58
+ if (stream.match(reBaseForm, true, false)) {
59
+ return 'number';
60
+ }
61
+
62
+ // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition
63
+ // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow.
64
+ if (stream.match(reFloatForm, true, false)) {
65
+ return 'number';
66
+ }
67
+
68
+ /* In[23] and Out[34] */
69
+ if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) {
70
+ return 'atom';
71
+ }
72
+
73
+ // usage
74
+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) {
75
+ return 'meta';
76
+ }
77
+
78
+ // message
79
+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) {
80
+ return 'string-2';
81
+ }
82
+
83
+ // this makes a look-ahead match for something like variable:{_Integer}
84
+ // the match is then forwarded to the mma-patterns tokenizer.
85
+ if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) {
86
+ return 'variable-2';
87
+ }
88
+
89
+ // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___)
90
+ // Cannot start with a number, but can have numbers at any other position. Examples
91
+ // blub__Integer, a1_, b34_Integer32
92
+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
93
+ return 'variable-2';
94
+ }
95
+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) {
96
+ return 'variable-2';
97
+ }
98
+ if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
99
+ return 'variable-2';
100
+ }
101
+
102
+ // Named characters in Mathematica, like \[Gamma].
103
+ if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) {
104
+ return 'variable-3';
105
+ }
106
+
107
+ // Match all braces separately
108
+ if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) {
109
+ return 'bracket';
110
+ }
111
+
112
+ // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match
113
+ // only one.
114
+ if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) {
115
+ return 'variable-2';
116
+ }
117
+
118
+ // Literals like variables, keywords, functions
119
+ if (stream.match(reIdInContext, true, false)) {
120
+ return 'keyword';
121
+ }
122
+
123
+ // operators. Note that operators like @@ or /; are matched separately for each symbol.
124
+ if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) {
125
+ return 'operator';
126
+ }
127
+
128
+ // everything else is an error
129
+ return 'error';
130
+ }
131
+
132
+ function tokenString(stream, state) {
133
+ var next, end = false, escaped = false;
134
+ while ((next = stream.next()) != null) {
135
+ if (next === '"' && !escaped) {
136
+ end = true;
137
+ break;
138
+ }
139
+ escaped = !escaped && next === '\\';
140
+ }
141
+ if (end && !escaped) {
142
+ state.tokenize = tokenBase;
143
+ }
144
+ return 'string';
145
+ };
146
+
147
+ function tokenComment(stream, state) {
148
+ var prev, next;
149
+ while(state.commentLevel > 0 && (next = stream.next()) != null) {
150
+ if (prev === '(' && next === '*') state.commentLevel++;
151
+ if (prev === '*' && next === ')') state.commentLevel--;
152
+ prev = next;
153
+ }
154
+ if (state.commentLevel <= 0) {
155
+ state.tokenize = tokenBase;
156
+ }
157
+ return 'comment';
158
+ }
159
+
160
+ return {
161
+ startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
162
+ token: function(stream, state) {
163
+ if (stream.eatSpace()) return null;
164
+ return state.tokenize(stream, state);
165
+ },
166
+ blockCommentStart: "(*",
167
+ blockCommentEnd: "*)"
168
+ };
169
+ });
170
+
171
+ CodeMirror.defineMIME('text/x-mathematica', {
172
+ name: 'mathematica'
173
+ });
174
+
175
+ });
assets/js/vendor/codemirror/mode/mirc/index.html ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: mIRC mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/twilight.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="mirc.js"></script>
11
+ <style>.CodeMirror {border: 1px solid black;}</style>
12
+ <div id=nav>
13
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
14
+
15
+ <ul>
16
+ <li><a href="../../index.html">Home</a>
17
+ <li><a href="../../doc/manual.html">Manual</a>
18
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
19
+ </ul>
20
+ <ul>
21
+ <li><a href="../index.html">Language modes</a>
22
+ <li><a class=active href="#">mIRC</a>
23
+ </ul>
24
+ </div>
25
+
26
+ <article>
27
+ <h2>mIRC mode</h2>
28
+ <form><textarea id="code" name="code">
29
+ ;AKA Nick Tracker by Ford_Lawnmower irc.GeekShed.net #Script-Help
30
+ ;*****************************************************************************;
31
+ ;**Start Setup
32
+ ;Change JoinDisplay, below, for On Join AKA Display. On = 1 - Off = 0
33
+ alias -l JoinDisplay { return 1 }
34
+ ;Change MaxNicks, below, to the number of nicknames you want to store for each hostmask. I wouldn't go over 400 with this ;/
35
+ alias -l MaxNicks { return 20 }
36
+ ;Change AKALogo, below, To the text you want displayed before each AKA result.
37
+ alias -l AKALogo { return 06 05A06K07A 06 }
38
+ ;**End Setup
39
+ ;*****************************************************************************;
40
+ On *:Join:#: {
41
+ if ($nick == $me) { .timer 1 1 ialupdateCheck $chan }
42
+ NickNamesAdd $nick $+($network,$wildsite)
43
+ if ($JoinDisplay) { .timerNickNames $+ $nick 1 2 NickNames.display $nick $chan $network $wildsite }
44
+ }
45
+ on *:Nick: { NickNamesAdd $newnick $+($network,$wildsite) $nick }
46
+ alias -l NickNames.display {
47
+ if ($gettok($hget(NickNames,$+($3,$4)),0,126) > 1) {
48
+ echo -g $2 $AKALogo $+(09,$1) $AKALogo 07 $mid($replace($hget(NickNames,$+($3,$4)),$chr(126),$chr(44)),2,-1)
49
+ }
50
+ }
51
+ alias -l NickNamesAdd {
52
+ if ($hget(NickNames,$2)) {
53
+ if (!$regex($hget(NickNames,$2),/~\Q $+ $replacecs($1,\E,\E\\E\Q) $+ \E~/i)) {
54
+ if ($gettok($hget(NickNames,$2),0,126) <= $MaxNicks) {
55
+ hadd NickNames $2 $+($hget(NickNames,$2),$1,~)
56
+ }
57
+ else {
58
+ hadd NickNames $2 $+($mid($hget(NickNames,$2),$pos($hget(NickNames,$2),~,2)),$1,~)
59
+ }
60
+ }
61
+ }
62
+ else {
63
+ hadd -m NickNames $2 $+(~,$1,~,$iif($3,$+($3,~)))
64
+ }
65
+ }
66
+ alias -l Fix.All.MindUser {
67
+ var %Fix.Count = $hfind(NickNames,/[^~]+[0-9]{4}~/,0,r).data
68
+ while (%Fix.Count) {
69
+ if ($Fix.MindUser($hget(NickNames,$hfind(NickNames,/[^~]+[0-9]{4}~/,%Fix.Count,r).data))) {
70
+ echo -ag Record %Fix.Count - $v1 - Was Cleaned
71
+ hadd NickNames $hfind(NickNames,/[^~]+[0-9]{4}~/,%Fix.Count,r).data $v1
72
+ }
73
+ dec %Fix.Count
74
+ }
75
+ }
76
+ alias -l Fix.MindUser { return $regsubex($1,/[^~]+[0-9]{4}~/g,$null) }
77
+ menu nicklist,query {
78
+ -
79
+ .AKA
80
+ ..Check $$1: {
81
+ if ($gettok($hget(NickNames,$+($network,$address($1,2))),0,126) > 1) {
82
+ NickNames.display $1 $active $network $address($1,2)
83
+ }
84
+ else { echo -ag $AKALogo $+(09,$1) 07has not been known by any other nicknames while I have been watching. }
85
+ }
86
+ ..Cleanup $$1:hadd NickNames $+($network,$address($1,2)) $fix.minduser($hget(NickNames,$+($network,$address($1,2))))
87
+ ..Clear $$1:hadd NickNames $+($network,$address($1,2)) $+(~,$1,~)
88
+ ..AKA Search Dialog:dialog $iif($dialog(AKA_Search),-v,-m) AKA_Search AKA_Search
89
+ -
90
+ }
91
+ menu status,channel {
92
+ -
93
+ .AKA
94
+ ..AKA Search Dialog:dialog $iif($dialog(AKA_Search),-v,-m) AKA_Search AKA_Search
95
+ ..Clean All Records:Fix.All.Minduser
96
+ -
97
+ }
98
+ dialog AKA_Search {
99
+ title "AKA Search Engine"
100
+ size -1 -1 206 221
101
+ option dbu
102
+ edit "", 1, 8 5 149 10, autohs
103
+ button "Search", 2, 163 4 32 12
104
+ radio "Search HostMask", 4, 61 22 55 10
105
+ radio "Search Nicknames", 5, 123 22 56 10
106
+ list 6, 8 38 190 169, sort extsel vsbar
107
+ button "Check Selected", 7, 67 206 40 12
108
+ button "Close", 8, 160 206 38 12, cancel
109
+ box "Search Type", 3, 11 17 183 18
110
+ button "Copy to Clipboard", 9, 111 206 46 12
111
+ }
112
+ On *:Dialog:Aka_Search:init:*: { did -c $dname 5 }
113
+ On *:Dialog:Aka_Search:Sclick:2,7,9: {
114
+ if ($did == 2) && ($did($dname,1)) {
115
+ did -r $dname 6
116
+ var %search $+(*,$v1,*), %type $iif($did($dname,5).state,data,item), %matches = $hfind(NickNames,%search,0,w). [ $+ [ %type ] ]
117
+ while (%matches) {
118
+ did -a $dname 6 $hfind(NickNames,%search,%matches,w). [ $+ [ %type ] ]
119
+ dec %matches
120
+ }
121
+ did -c $dname 6 1
122
+ }
123
+ elseif ($did == 7) && ($did($dname,6).seltext) { echo -ga $AKALogo 07 $mid($replace($hget(NickNames,$v1),$chr(126),$chr(44)),2,-1) }
124
+ elseif ($did == 9) && ($did($dname,6).seltext) { clipboard $mid($v1,$pos($v1,*,1)) }
125
+ }
126
+ On *:Start:{
127
+ if (!$hget(NickNames)) { hmake NickNames 10 }
128
+ if ($isfile(NickNames.hsh)) { hload NickNames NickNames.hsh }
129
+ }
130
+ On *:Exit: { if ($hget(NickNames)) { hsave NickNames NickNames.hsh } }
131
+ On *:Disconnect: { if ($hget(NickNames)) { hsave NickNames NickNames.hsh } }
132
+ On *:Unload: { hfree NickNames }
133
+ alias -l ialupdateCheck {
134
+ inc -z $+(%,ialupdateCheck,$network) $calc($nick($1,0) / 4)
135
+ ;If your ial is already being updated on join .who $1 out.
136
+ ;If you are using /names to update ial you will still need this line.
137
+ .who $1
138
+ }
139
+ Raw 352:*: {
140
+ if ($($+(%,ialupdateCheck,$network),2)) haltdef
141
+ NickNamesAdd $6 $+($network,$address($6,2))
142
+ }
143
+ Raw 315:*: {
144
+ if ($($+(%,ialupdateCheck,$network),2)) haltdef
145
+ }
146
+
147
+ </textarea></form>
148
+ <script>
149
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
150
+ theme: "twilight",
151
+ lineNumbers: true,
152
+ matchBrackets: true,
153
+ indentUnit: 4,
154
+ mode: "text/mirc"
155
+ });
156
+ </script>
157
+
158
+ <p><strong>MIME types defined:</strong> <code>text/mirc</code>.</p>
159
+
160
+ </article>
assets/js/vendor/codemirror/mode/mirc/mirc.js ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ //mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara
5
+
6
+ (function(mod) {
7
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
8
+ mod(require("../../lib/codemirror"));
9
+ else if (typeof define == "function" && define.amd) // AMD
10
+ define(["../../lib/codemirror"], mod);
11
+ else // Plain browser env
12
+ mod(CodeMirror);
13
+ })(function(CodeMirror) {
14
+ "use strict";
15
+
16
+ CodeMirror.defineMIME("text/mirc", "mirc");
17
+ CodeMirror.defineMode("mirc", function() {
18
+ function parseWords(str) {
19
+ var obj = {}, words = str.split(" ");
20
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
21
+ return obj;
22
+ }
23
+ var specials = parseWords("$! $$ $& $? $+ $abook $abs $active $activecid " +
24
+ "$activewid $address $addtok $agent $agentname $agentstat $agentver " +
25
+ "$alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime " +
26
+ "$asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind " +
27
+ "$binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes " +
28
+ "$chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color " +
29
+ "$com $comcall $comchan $comerr $compact $compress $comval $cos $count " +
30
+ "$cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight " +
31
+ "$dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress " +
32
+ "$deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll " +
33
+ "$dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error " +
34
+ "$eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir " +
35
+ "$finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve " +
36
+ "$fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt " +
37
+ "$group $halted $hash $height $hfind $hget $highlight $hnick $hotline " +
38
+ "$hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil " +
39
+ "$inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect " +
40
+ "$insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile " +
41
+ "$isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive " +
42
+ "$lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock " +
43
+ "$lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer " +
44
+ "$maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext " +
45
+ "$menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode " +
46
+ "$modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile " +
47
+ "$nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly " +
48
+ "$opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree " +
49
+ "$pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo " +
50
+ "$readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex " +
51
+ "$reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline " +
52
+ "$sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin " +
53
+ "$site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname " +
54
+ "$sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped " +
55
+ "$syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp " +
56
+ "$timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel " +
57
+ "$ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver " +
58
+ "$version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor");
59
+ var keywords = parseWords("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice " +
60
+ "away background ban bcopy beep bread break breplace bset btrunc bunset bwrite " +
61
+ "channel clear clearall cline clipboard close cnick color comclose comopen " +
62
+ "comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver " +
63
+ "debug dec describe dialog did didtok disable disconnect dlevel dline dll " +
64
+ "dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace " +
65
+ "drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable " +
66
+ "events exit fclose filter findtext finger firewall flash flist flood flush " +
67
+ "flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove " +
68
+ "gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd " +
69
+ "halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear " +
70
+ "ialmark identd if ignore iline inc invite iuser join kick linesep links list " +
71
+ "load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice " +
72
+ "notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice " +
73
+ "qme qmsg query queryn quit raw reload remini remote remove rename renwin " +
74
+ "reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini " +
75
+ "say scid scon server set showmirc signam sline sockaccept sockclose socklist " +
76
+ "socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite " +
77
+ "sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize " +
78
+ "toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho " +
79
+ "var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum " +
80
+ "isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower " +
81
+ "isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs " +
82
+ "elseif else goto menu nicklist status title icon size option text edit " +
83
+ "button check radio box scroll list combo link tab item");
84
+ var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch");
85
+ var isOperatorChar = /[+\-*&%=<>!?^\/\|]/;
86
+ function chain(stream, state, f) {
87
+ state.tokenize = f;
88
+ return f(stream, state);
89
+ }
90
+ function tokenBase(stream, state) {
91
+ var beforeParams = state.beforeParams;
92
+ state.beforeParams = false;
93
+ var ch = stream.next();
94
+ if (/[\[\]{}\(\),\.]/.test(ch)) {
95
+ if (ch == "(" && beforeParams) state.inParams = true;
96
+ else if (ch == ")") state.inParams = false;
97
+ return null;
98
+ }
99
+ else if (/\d/.test(ch)) {
100
+ stream.eatWhile(/[\w\.]/);
101
+ return "number";
102
+ }
103
+ else if (ch == "\\") {
104
+ stream.eat("\\");
105
+ stream.eat(/./);
106
+ return "number";
107
+ }
108
+ else if (ch == "/" && stream.eat("*")) {
109
+ return chain(stream, state, tokenComment);
110
+ }
111
+ else if (ch == ";" && stream.match(/ *\( *\(/)) {
112
+ return chain(stream, state, tokenUnparsed);
113
+ }
114
+ else if (ch == ";" && !state.inParams) {
115
+ stream.skipToEnd();
116
+ return "comment";
117
+ }
118
+ else if (ch == '"') {
119
+ stream.eat(/"/);
120
+ return "keyword";
121
+ }
122
+ else if (ch == "$") {
123
+ stream.eatWhile(/[$_a-z0-9A-Z\.:]/);
124
+ if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) {
125
+ return "keyword";
126
+ }
127
+ else {
128
+ state.beforeParams = true;
129
+ return "builtin";
130
+ }
131
+ }
132
+ else if (ch == "%") {
133
+ stream.eatWhile(/[^,^\s^\(^\)]/);
134
+ state.beforeParams = true;
135
+ return "string";
136
+ }
137
+ else if (isOperatorChar.test(ch)) {
138
+ stream.eatWhile(isOperatorChar);
139
+ return "operator";
140
+ }
141
+ else {
142
+ stream.eatWhile(/[\w\$_{}]/);
143
+ var word = stream.current().toLowerCase();
144
+ if (keywords && keywords.propertyIsEnumerable(word))
145
+ return "keyword";
146
+ if (functions && functions.propertyIsEnumerable(word)) {
147
+ state.beforeParams = true;
148
+ return "keyword";
149
+ }
150
+ return null;
151
+ }
152
+ }
153
+ function tokenComment(stream, state) {
154
+ var maybeEnd = false, ch;
155
+ while (ch = stream.next()) {
156
+ if (ch == "/" && maybeEnd) {
157
+ state.tokenize = tokenBase;
158
+ break;
159
+ }
160
+ maybeEnd = (ch == "*");
161
+ }
162
+ return "comment";
163
+ }
164
+ function tokenUnparsed(stream, state) {
165
+ var maybeEnd = 0, ch;
166
+ while (ch = stream.next()) {
167
+ if (ch == ";" && maybeEnd == 2) {
168
+ state.tokenize = tokenBase;
169
+ break;
170
+ }
171
+ if (ch == ")")
172
+ maybeEnd++;
173
+ else if (ch != " ")
174
+ maybeEnd = 0;
175
+ }
176
+ return "meta";
177
+ }
178
+ return {
179
+ startState: function() {
180
+ return {
181
+ tokenize: tokenBase,
182
+ beforeParams: false,
183
+ inParams: false
184
+ };
185
+ },
186
+ token: function(stream, state) {
187
+ if (stream.eatSpace()) return null;
188
+ return state.tokenize(stream, state);
189
+ }
190
+ };
191
+ });
192
+
193
+ });
assets/js/vendor/codemirror/mode/mllike/index.html ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: ML-like mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel=stylesheet href=../../lib/codemirror.css>
8
+ <script src=../../lib/codemirror.js></script>
9
+ <script src=../../addon/edit/matchbrackets.js></script>
10
+ <script src=mllike.js></script>
11
+ <style type=text/css>
12
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
13
+ </style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#">ML-like</a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>OCaml mode</h2>
30
+
31
+
32
+ <textarea id="ocamlCode">
33
+ (* Summing a list of integers *)
34
+ let rec sum xs =
35
+ match xs with
36
+ | [] -&gt; 0
37
+ | x :: xs' -&gt; x + sum xs'
38
+
39
+ (* Quicksort *)
40
+ let rec qsort = function
41
+ | [] -&gt; []
42
+ | pivot :: rest -&gt;
43
+ let is_less x = x &lt; pivot in
44
+ let left, right = List.partition is_less rest in
45
+ qsort left @ [pivot] @ qsort right
46
+
47
+ (* Fibonacci Sequence *)
48
+ let rec fib_aux n a b =
49
+ match n with
50
+ | 0 -&gt; a
51
+ | _ -&gt; fib_aux (n - 1) (a + b) a
52
+ let fib n = fib_aux n 0 1
53
+
54
+ (* Birthday paradox *)
55
+ let year_size = 365.
56
+
57
+ let rec birthday_paradox prob people =
58
+ let prob' = (year_size -. float people) /. year_size *. prob in
59
+ if prob' &lt; 0.5 then
60
+ Printf.printf "answer = %d\n" (people+1)
61
+ else
62
+ birthday_paradox prob' (people+1) ;;
63
+
64
+ birthday_paradox 1.0 1
65
+
66
+ (* Church numerals *)
67
+ let zero f x = x
68
+ let succ n f x = f (n f x)
69
+ let one = succ zero
70
+ let two = succ (succ zero)
71
+ let add n1 n2 f x = n1 f (n2 f x)
72
+ let to_string n = n (fun k -&gt; "S" ^ k) "0"
73
+ let _ = to_string (add (succ two) two)
74
+
75
+ (* Elementary functions *)
76
+ let square x = x * x;;
77
+ let rec fact x =
78
+ if x &lt;= 1 then 1 else x * fact (x - 1);;
79
+
80
+ (* Automatic memory management *)
81
+ let l = 1 :: 2 :: 3 :: [];;
82
+ [1; 2; 3];;
83
+ 5 :: l;;
84
+
85
+ (* Polymorphism: sorting lists *)
86
+ let rec sort = function
87
+ | [] -&gt; []
88
+ | x :: l -&gt; insert x (sort l)
89
+
90
+ and insert elem = function
91
+ | [] -&gt; [elem]
92
+ | x :: l -&gt;
93
+ if elem &lt; x then elem :: x :: l else x :: insert elem l;;
94
+
95
+ (* Imperative features *)
96
+ let add_polynom p1 p2 =
97
+ let n1 = Array.length p1
98
+ and n2 = Array.length p2 in
99
+ let result = Array.create (max n1 n2) 0 in
100
+ for i = 0 to n1 - 1 do result.(i) &lt;- p1.(i) done;
101
+ for i = 0 to n2 - 1 do result.(i) &lt;- result.(i) + p2.(i) done;
102
+ result;;
103
+ add_polynom [| 1; 2 |] [| 1; 2; 3 |];;
104
+
105
+ (* We may redefine fact using a reference cell and a for loop *)
106
+ let fact n =
107
+ let result = ref 1 in
108
+ for i = 2 to n do
109
+ result := i * !result
110
+ done;
111
+ !result;;
112
+ fact 5;;
113
+
114
+ (* Triangle (graphics) *)
115
+ let () =
116
+ ignore( Glut.init Sys.argv );
117
+ Glut.initDisplayMode ~double_buffer:true ();
118
+ ignore (Glut.createWindow ~title:"OpenGL Demo");
119
+ let angle t = 10. *. t *. t in
120
+ let render () =
121
+ GlClear.clear [ `color ];
122
+ GlMat.load_identity ();
123
+ GlMat.rotate ~angle: (angle (Sys.time ())) ~z:1. ();
124
+ GlDraw.begins `triangles;
125
+ List.iter GlDraw.vertex2 [-1., -1.; 0., 1.; 1., -1.];
126
+ GlDraw.ends ();
127
+ Glut.swapBuffers () in
128
+ GlMat.mode `modelview;
129
+ Glut.displayFunc ~cb:render;
130
+ Glut.idleFunc ~cb:(Some Glut.postRedisplay);
131
+ Glut.mainLoop ()
132
+
133
+ (* A Hundred Lines of Caml - http://caml.inria.fr/about/taste.en.html *)
134
+ (* OCaml page on Wikipedia - http://en.wikipedia.org/wiki/OCaml *)
135
+ </textarea>
136
+
137
+ <h2>F# mode</h2>
138
+ <textarea id="fsharpCode">
139
+ module CodeMirror.FSharp
140
+
141
+ let rec fib = function
142
+ | 0 -> 0
143
+ | 1 -> 1
144
+ | n -> fib (n - 1) + fib (n - 2)
145
+
146
+ type Point =
147
+ {
148
+ x : int
149
+ y : int
150
+ }
151
+
152
+ type Color =
153
+ | Red
154
+ | Green
155
+ | Blue
156
+
157
+ [0 .. 10]
158
+ |> List.map ((+) 2)
159
+ |> List.fold (fun x y -> x + y) 0
160
+ |> printf "%i"
161
+ </textarea>
162
+
163
+
164
+ <script>
165
+ var ocamlEditor = CodeMirror.fromTextArea(document.getElementById('ocamlCode'), {
166
+ mode: 'text/x-ocaml',
167
+ lineNumbers: true,
168
+ matchBrackets: true
169
+ });
170
+
171
+ var fsharpEditor = CodeMirror.fromTextArea(document.getElementById('fsharpCode'), {
172
+ mode: 'text/x-fsharp',
173
+ lineNumbers: true,
174
+ matchBrackets: true
175
+ });
176
+ </script>
177
+
178
+ <p><strong>MIME types defined:</strong> <code>text/x-ocaml</code> (OCaml) and <code>text/x-fsharp</code> (F#).</p>
179
+ </article>
assets/js/vendor/codemirror/mode/mllike/mllike.js ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode('mllike', function(_config, parserConfig) {
15
+ var words = {
16
+ 'let': 'keyword',
17
+ 'rec': 'keyword',
18
+ 'in': 'keyword',
19
+ 'of': 'keyword',
20
+ 'and': 'keyword',
21
+ 'if': 'keyword',
22
+ 'then': 'keyword',
23
+ 'else': 'keyword',
24
+ 'for': 'keyword',
25
+ 'to': 'keyword',
26
+ 'while': 'keyword',
27
+ 'do': 'keyword',
28
+ 'done': 'keyword',
29
+ 'fun': 'keyword',
30
+ 'function': 'keyword',
31
+ 'val': 'keyword',
32
+ 'type': 'keyword',
33
+ 'mutable': 'keyword',
34
+ 'match': 'keyword',
35
+ 'with': 'keyword',
36
+ 'try': 'keyword',
37
+ 'open': 'builtin',
38
+ 'ignore': 'builtin',
39
+ 'begin': 'keyword',
40
+ 'end': 'keyword'
41
+ };
42
+
43
+ var extraWords = parserConfig.extraWords || {};
44
+ for (var prop in extraWords) {
45
+ if (extraWords.hasOwnProperty(prop)) {
46
+ words[prop] = parserConfig.extraWords[prop];
47
+ }
48
+ }
49
+
50
+ function tokenBase(stream, state) {
51
+ var ch = stream.next();
52
+
53
+ if (ch === '"') {
54
+ state.tokenize = tokenString;
55
+ return state.tokenize(stream, state);
56
+ }
57
+ if (ch === '(') {
58
+ if (stream.eat('*')) {
59
+ state.commentLevel++;
60
+ state.tokenize = tokenComment;
61
+ return state.tokenize(stream, state);
62
+ }
63
+ }
64
+ if (ch === '~') {
65
+ stream.eatWhile(/\w/);
66
+ return 'variable-2';
67
+ }
68
+ if (ch === '`') {
69
+ stream.eatWhile(/\w/);
70
+ return 'quote';
71
+ }
72
+ if (ch === '/' && parserConfig.slashComments && stream.eat('/')) {
73
+ stream.skipToEnd();
74
+ return 'comment';
75
+ }
76
+ if (/\d/.test(ch)) {
77
+ stream.eatWhile(/[\d]/);
78
+ if (stream.eat('.')) {
79
+ stream.eatWhile(/[\d]/);
80
+ }
81
+ return 'number';
82
+ }
83
+ if ( /[+\-*&%=<>!?|]/.test(ch)) {
84
+ return 'operator';
85
+ }
86
+ stream.eatWhile(/\w/);
87
+ var cur = stream.current();
88
+ return words.hasOwnProperty(cur) ? words[cur] : 'variable';
89
+ }
90
+
91
+ function tokenString(stream, state) {
92
+ var next, end = false, escaped = false;
93
+ while ((next = stream.next()) != null) {
94
+ if (next === '"' && !escaped) {
95
+ end = true;
96
+ break;
97
+ }
98
+ escaped = !escaped && next === '\\';
99
+ }
100
+ if (end && !escaped) {
101
+ state.tokenize = tokenBase;
102
+ }
103
+ return 'string';
104
+ };
105
+
106
+ function tokenComment(stream, state) {
107
+ var prev, next;
108
+ while(state.commentLevel > 0 && (next = stream.next()) != null) {
109
+ if (prev === '(' && next === '*') state.commentLevel++;
110
+ if (prev === '*' && next === ')') state.commentLevel--;
111
+ prev = next;
112
+ }
113
+ if (state.commentLevel <= 0) {
114
+ state.tokenize = tokenBase;
115
+ }
116
+ return 'comment';
117
+ }
118
+
119
+ return {
120
+ startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
121
+ token: function(stream, state) {
122
+ if (stream.eatSpace()) return null;
123
+ return state.tokenize(stream, state);
124
+ },
125
+
126
+ blockCommentStart: "(*",
127
+ blockCommentEnd: "*)",
128
+ lineComment: parserConfig.slashComments ? "//" : null
129
+ };
130
+ });
131
+
132
+ CodeMirror.defineMIME('text/x-ocaml', {
133
+ name: 'mllike',
134
+ extraWords: {
135
+ 'succ': 'keyword',
136
+ 'trace': 'builtin',
137
+ 'exit': 'builtin',
138
+ 'print_string': 'builtin',
139
+ 'print_endline': 'builtin',
140
+ 'true': 'atom',
141
+ 'false': 'atom',
142
+ 'raise': 'keyword'
143
+ }
144
+ });
145
+
146
+ CodeMirror.defineMIME('text/x-fsharp', {
147
+ name: 'mllike',
148
+ extraWords: {
149
+ 'abstract': 'keyword',
150
+ 'as': 'keyword',
151
+ 'assert': 'keyword',
152
+ 'base': 'keyword',
153
+ 'class': 'keyword',
154
+ 'default': 'keyword',
155
+ 'delegate': 'keyword',
156
+ 'downcast': 'keyword',
157
+ 'downto': 'keyword',
158
+ 'elif': 'keyword',
159
+ 'exception': 'keyword',
160
+ 'extern': 'keyword',
161
+ 'finally': 'keyword',
162
+ 'global': 'keyword',
163
+ 'inherit': 'keyword',
164
+ 'inline': 'keyword',
165
+ 'interface': 'keyword',
166
+ 'internal': 'keyword',
167
+ 'lazy': 'keyword',
168
+ 'let!': 'keyword',
169
+ 'member' : 'keyword',
170
+ 'module': 'keyword',
171
+ 'namespace': 'keyword',
172
+ 'new': 'keyword',
173
+ 'null': 'keyword',
174
+ 'override': 'keyword',
175
+ 'private': 'keyword',
176
+ 'public': 'keyword',
177
+ 'return': 'keyword',
178
+ 'return!': 'keyword',
179
+ 'select': 'keyword',
180
+ 'static': 'keyword',
181
+ 'struct': 'keyword',
182
+ 'upcast': 'keyword',
183
+ 'use': 'keyword',
184
+ 'use!': 'keyword',
185
+ 'val': 'keyword',
186
+ 'when': 'keyword',
187
+ 'yield': 'keyword',
188
+ 'yield!': 'keyword',
189
+
190
+ 'List': 'builtin',
191
+ 'Seq': 'builtin',
192
+ 'Map': 'builtin',
193
+ 'Set': 'builtin',
194
+ 'int': 'builtin',
195
+ 'string': 'builtin',
196
+ 'raise': 'builtin',
197
+ 'failwith': 'builtin',
198
+ 'not': 'builtin',
199
+ 'true': 'builtin',
200
+ 'false': 'builtin'
201
+ },
202
+ slashComments: true
203
+ });
204
+
205
+ });
assets/js/vendor/codemirror/mode/modelica/index.html ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Modelica mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <link rel="stylesheet" href="../../addon/hint/show-hint.css">
11
+ <script src="../../addon/hint/show-hint.js"></script>
12
+ <script src="modelica.js"></script>
13
+ <style>.CodeMirror {border: 2px inset #dee;}</style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#">Modelica</a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>Modelica mode</h2>
30
+
31
+ <div><textarea id="modelica">
32
+ model BouncingBall
33
+ parameter Real e = 0.7;
34
+ parameter Real g = 9.81;
35
+ Real h(start=1);
36
+ Real v;
37
+ Boolean flying(start=true);
38
+ Boolean impact;
39
+ Real v_new;
40
+ equation
41
+ impact = h <= 0.0;
42
+ der(v) = if flying then -g else 0;
43
+ der(h) = v;
44
+ when {h <= 0.0 and v <= 0.0, impact} then
45
+ v_new = if edge(impact) then -e*pre(v) else 0;
46
+ flying = v_new > 0;
47
+ reinit(v, v_new);
48
+ end when;
49
+ annotation (uses(Modelica(version="3.2")));
50
+ end BouncingBall;
51
+ </textarea></div>
52
+
53
+ <script>
54
+ var modelicaEditor = CodeMirror.fromTextArea(document.getElementById("modelica"), {
55
+ lineNumbers: true,
56
+ matchBrackets: true,
57
+ mode: "text/x-modelica"
58
+ });
59
+ var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
60
+ CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
61
+ </script>
62
+
63
+ <p>Simple mode that tries to handle Modelica as well as it can.</p>
64
+
65
+ <p><strong>MIME types defined:</strong> <code>text/x-modelica</code>
66
+ (Modlica code).</p>
67
+ </article>
assets/js/vendor/codemirror/mode/modelica/modelica.js ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // Modelica support for CodeMirror, copyright (c) by Lennart Ochel
5
+
6
+ (function(mod) {
7
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
8
+ mod(require("../../lib/codemirror"));
9
+ else if (typeof define == "function" && define.amd) // AMD
10
+ define(["../../lib/codemirror"], mod);
11
+ else // Plain browser env
12
+ mod(CodeMirror);
13
+ })
14
+
15
+ (function(CodeMirror) {
16
+ "use strict";
17
+
18
+ CodeMirror.defineMode("modelica", function(config, parserConfig) {
19
+
20
+ var indentUnit = config.indentUnit;
21
+ var keywords = parserConfig.keywords || {};
22
+ var builtin = parserConfig.builtin || {};
23
+ var atoms = parserConfig.atoms || {};
24
+
25
+ var isSingleOperatorChar = /[;=\(:\),{}.*<>+\-\/^\[\]]/;
26
+ var isDoubleOperatorChar = /(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/;
27
+ var isDigit = /[0-9]/;
28
+ var isNonDigit = /[_a-zA-Z]/;
29
+
30
+ function tokenLineComment(stream, state) {
31
+ stream.skipToEnd();
32
+ state.tokenize = null;
33
+ return "comment";
34
+ }
35
+
36
+ function tokenBlockComment(stream, state) {
37
+ var maybeEnd = false, ch;
38
+ while (ch = stream.next()) {
39
+ if (maybeEnd && ch == "/") {
40
+ state.tokenize = null;
41
+ break;
42
+ }
43
+ maybeEnd = (ch == "*");
44
+ }
45
+ return "comment";
46
+ }
47
+
48
+ function tokenString(stream, state) {
49
+ var escaped = false, ch;
50
+ while ((ch = stream.next()) != null) {
51
+ if (ch == '"' && !escaped) {
52
+ state.tokenize = null;
53
+ state.sol = false;
54
+ break;
55
+ }
56
+ escaped = !escaped && ch == "\\";
57
+ }
58
+
59
+ return "string";
60
+ }
61
+
62
+ function tokenIdent(stream, state) {
63
+ stream.eatWhile(isDigit);
64
+ while (stream.eat(isDigit) || stream.eat(isNonDigit)) { }
65
+
66
+
67
+ var cur = stream.current();
68
+
69
+ if(state.sol && (cur == "package" || cur == "model" || cur == "when" || cur == "connector")) state.level++;
70
+ else if(state.sol && cur == "end" && state.level > 0) state.level--;
71
+
72
+ state.tokenize = null;
73
+ state.sol = false;
74
+
75
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
76
+ else if (builtin.propertyIsEnumerable(cur)) return "builtin";
77
+ else if (atoms.propertyIsEnumerable(cur)) return "atom";
78
+ else return "variable";
79
+ }
80
+
81
+ function tokenQIdent(stream, state) {
82
+ while (stream.eat(/[^']/)) { }
83
+
84
+ state.tokenize = null;
85
+ state.sol = false;
86
+
87
+ if(stream.eat("'"))
88
+ return "variable";
89
+ else
90
+ return "error";
91
+ }
92
+
93
+ function tokenUnsignedNuber(stream, state) {
94
+ stream.eatWhile(isDigit);
95
+ if (stream.eat('.')) {
96
+ stream.eatWhile(isDigit);
97
+ }
98
+ if (stream.eat('e') || stream.eat('E')) {
99
+ if (!stream.eat('-'))
100
+ stream.eat('+');
101
+ stream.eatWhile(isDigit);
102
+ }
103
+
104
+ state.tokenize = null;
105
+ state.sol = false;
106
+ return "number";
107
+ }
108
+
109
+ // Interface
110
+ return {
111
+ startState: function() {
112
+ return {
113
+ tokenize: null,
114
+ level: 0,
115
+ sol: true
116
+ };
117
+ },
118
+
119
+ token: function(stream, state) {
120
+ if(state.tokenize != null) {
121
+ return state.tokenize(stream, state);
122
+ }
123
+
124
+ if(stream.sol()) {
125
+ state.sol = true;
126
+ }
127
+
128
+ // WHITESPACE
129
+ if(stream.eatSpace()) {
130
+ state.tokenize = null;
131
+ return null;
132
+ }
133
+
134
+ var ch = stream.next();
135
+
136
+ // LINECOMMENT
137
+ if(ch == '/' && stream.eat('/')) {
138
+ state.tokenize = tokenLineComment;
139
+ }
140
+ // BLOCKCOMMENT
141
+ else if(ch == '/' && stream.eat('*')) {
142
+ state.tokenize = tokenBlockComment;
143
+ }
144
+ // TWO SYMBOL TOKENS
145
+ else if(isDoubleOperatorChar.test(ch+stream.peek())) {
146
+ stream.next();
147
+ state.tokenize = null;
148
+ return "operator";
149
+ }
150
+ // SINGLE SYMBOL TOKENS
151
+ else if(isSingleOperatorChar.test(ch)) {
152
+ state.tokenize = null;
153
+ return "operator";
154
+ }
155
+ // IDENT
156
+ else if(isNonDigit.test(ch)) {
157
+ state.tokenize = tokenIdent;
158
+ }
159
+ // Q-IDENT
160
+ else if(ch == "'" && stream.peek() && stream.peek() != "'") {
161
+ state.tokenize = tokenQIdent;
162
+ }
163
+ // STRING
164
+ else if(ch == '"') {
165
+ state.tokenize = tokenString;
166
+ }
167
+ // UNSIGNED_NUBER
168
+ else if(isDigit.test(ch)) {
169
+ state.tokenize = tokenUnsignedNuber;
170
+ }
171
+ // ERROR
172
+ else {
173
+ state.tokenize = null;
174
+ return "error";
175
+ }
176
+
177
+ return state.tokenize(stream, state);
178
+ },
179
+
180
+ indent: function(state, textAfter) {
181
+ if (state.tokenize != null) return CodeMirror.Pass;
182
+
183
+ var level = state.level;
184
+ if(/(algorithm)/.test(textAfter)) level--;
185
+ if(/(equation)/.test(textAfter)) level--;
186
+ if(/(initial algorithm)/.test(textAfter)) level--;
187
+ if(/(initial equation)/.test(textAfter)) level--;
188
+ if(/(end)/.test(textAfter)) level--;
189
+
190
+ if(level > 0)
191
+ return indentUnit*level;
192
+ else
193
+ return 0;
194
+ },
195
+
196
+ blockCommentStart: "/*",
197
+ blockCommentEnd: "*/",
198
+ lineComment: "//"
199
+ };
200
+ });
201
+
202
+ function words(str) {
203
+ var obj = {}, words = str.split(" ");
204
+ for (var i=0; i<words.length; ++i)
205
+ obj[words[i]] = true;
206
+ return obj;
207
+ }
208
+
209
+ var modelicaKeywords = "algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within";
210
+ var modelicaBuiltin = "abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh";
211
+ var modelicaAtoms = "Real Boolean Integer String";
212
+
213
+ function def(mimes, mode) {
214
+ if (typeof mimes == "string")
215
+ mimes = [mimes];
216
+
217
+ var words = [];
218
+
219
+ function add(obj) {
220
+ if (obj)
221
+ for (var prop in obj)
222
+ if (obj.hasOwnProperty(prop))
223
+ words.push(prop);
224
+ }
225
+
226
+ add(mode.keywords);
227
+ add(mode.builtin);
228
+ add(mode.atoms);
229
+
230
+ if (words.length) {
231
+ mode.helperType = mimes[0];
232
+ CodeMirror.registerHelper("hintWords", mimes[0], words);
233
+ }
234
+
235
+ for (var i=0; i<mimes.length; ++i)
236
+ CodeMirror.defineMIME(mimes[i], mode);
237
+ }
238
+
239
+ def(["text/x-modelica"], {
240
+ name: "modelica",
241
+ keywords: words(modelicaKeywords),
242
+ builtin: words(modelicaBuiltin),
243
+ atoms: words(modelicaAtoms)
244
+ });
245
+ });
assets/js/vendor/codemirror/mode/mscgen/index.html ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Oz mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="mscgen.js"></script>
10
+ <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+ <ul>
14
+ <li><a href="../../index.html">Home</a>
15
+ <li><a href="../../doc/manual.html">Manual</a>
16
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
17
+ </ul>
18
+ <ul>
19
+ <li><a href="../index.html">Language modes</a>
20
+ <li><a class=active href="#">MscGen</a>
21
+ </ul>
22
+ </div>
23
+
24
+ <article>
25
+ <h2>MscGen mode</h2>
26
+
27
+ <div><textarea id="code">
28
+ # Sample mscgen program
29
+ # See http://www.mcternan.me.uk/mscgen or
30
+ # https://sverweij.github.io/mscgen_js for more samples
31
+
32
+ msc {
33
+ # options
34
+ hscale="1.2";
35
+
36
+ # entities/ lifelines
37
+ a [label="Entity A"],
38
+ b [label="Entity B", linecolor="red", arclinecolor="red", textbgcolor="pink"],
39
+ c [label="Entity C"];
40
+
41
+ # arcs/ messages
42
+ a => c [label="doSomething(args)"];
43
+ b => c [label="doSomething(args)"];
44
+ c >> * [label="everyone asked me", arcskip="1"];
45
+ c =>> c [label="doing something"];
46
+ c -x * [label="report back", arcskip="1"];
47
+ |||;
48
+ --- [label="shows's over, however ..."];
49
+ b => a [label="did you see c doing something?"];
50
+ a -> b [label="nope"];
51
+ b :> a [label="shall we ask again?"];
52
+ a => b [label="naah"];
53
+ ...;
54
+ }
55
+ </textarea></div>
56
+
57
+ <script>
58
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
59
+ lineNumbers: true,
60
+ mode: "mscgen",
61
+ });
62
+ </script>
63
+
64
+ <p><strong>MIME types defined:</strong> <code>text/x-mscgen</code></p>
65
+ </article>
assets/js/vendor/codemirror/mode/mscgen/index_msgenny.html ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>CodeMirror: msgenny mode</title>
6
+ <link rel="stylesheet" href="../../lib/codemirror.css">
7
+ <script src="../../lib/codemirror.js"></script>
8
+ <script src="mscgen.js"></script>
9
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
10
+ </head>
11
+ <body>
12
+ <h1>CodeMirror: msgenny mode</h1>
13
+
14
+ <div><textarea id="code">
15
+ # Sample msgenny program
16
+ # https://sverweij.github.io/mscgen_js for more samples
17
+
18
+ a -> b : a -> b (signal);
19
+ a => b : a => b (method);
20
+ b >> a : b >> a (return value);
21
+ a =>> b : a =>> b (callback);
22
+ a -x b : a -x b (lost);
23
+ a :> b : a :> b (emphasis);
24
+ a .. b : a .. b (dotted);
25
+ a -- b : "a -- b straight line";
26
+ a note a : a note a\n(note),
27
+ b box b : b box b\n(action);
28
+ a rbox a : a rbox a\n(reference),
29
+ b abox b : b abox b\n(state/ condition);
30
+ ||| : ||| (empty row);
31
+ ... : ... (omitted row);
32
+ --- : --- (comment);
33
+ </textarea></div>
34
+
35
+ <script>
36
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
37
+ lineNumbers: true,
38
+ mode: "msgenny",
39
+ });
40
+ </script>
41
+
42
+ <p><strong>MIME types defined:</strong> <code>text/x-msgenny</code></p>
43
+ </body>
44
+ </html>
assets/js/vendor/codemirror/mode/mscgen/index_xu.html ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>CodeMirror: xu mode</title>
6
+ <link rel="stylesheet" href="../../lib/codemirror.css">
7
+ <script src="../../lib/codemirror.js"></script>
8
+ <script src="mscgen.js"></script>
9
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
10
+ </head>
11
+ <body>
12
+ <h1>CodeMirror: xù mode</h1>
13
+
14
+ <div><textarea id="code">
15
+ # test50 - expansions to mscgen to support inline expressions
16
+ # for now in a separate language: xù
17
+ msc {
18
+
19
+ hscale="0.8",
20
+ width="700";
21
+
22
+ a,
23
+ b [label="change store"],
24
+ c,
25
+ d [label="necro queue"],
26
+ e [label="natalis queue"],
27
+ f;
28
+
29
+ a =>> b [label="get change list()"];
30
+ a alt f [label="changes found"] { /* alt is a xu specific keyword*/
31
+ b >> a [label="list of changes"];
32
+ a =>> c [label="cull old stuff (list of changes)"];
33
+ b loop e [label="for each change"] { // loop is xu specific as well...
34
+ /*
35
+ * Here interesting stuff happens.
36
+ * TBD
37
+ */
38
+ c =>> b [label="get change()"];
39
+ b >> c [label="change"];
40
+ c alt e [label="change too old"] {
41
+ c =>> d [label="queue(change)"];
42
+ --- [label="change newer than latest run"];
43
+ c =>> e [label="queue(change)"];
44
+ --- [label="all other cases"];
45
+ ||| [label="leave well alone"];
46
+ };
47
+ };
48
+
49
+
50
+ c >> a [label="done
51
+ processing"];
52
+
53
+ /* shucks! nothing found ...*/
54
+ --- [label="nothing found"];
55
+ b >> a [label="nothing"];
56
+ a note a [label="silent exit"];
57
+ };
58
+ }
59
+ </textarea></div>
60
+
61
+ <script>
62
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
63
+ lineNumbers: true,
64
+ mode: "xu",
65
+ });
66
+ </script>
67
+
68
+ <p><strong>MIME types defined:</strong> <code>text/x-xu</code></p>
69
+ </body>
70
+ </html>
assets/js/vendor/codemirror/mode/mscgen/mscgen.js ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // mode(s) for the sequence chart dsl's mscgen, xù and msgenny
5
+ // For more information on mscgen, see the site of the original author:
6
+ // http://www.mcternan.me.uk/mscgen
7
+ //
8
+ // This mode for mscgen and the two derivative languages were
9
+ // originally made for use in the mscgen_js interpreter
10
+ // (https://sverweij.github.io/mscgen_js)
11
+
12
+ (function(mod) {
13
+ if ( typeof exports == "object" && typeof module == "object")// CommonJS
14
+ mod(require("../../lib/codemirror"));
15
+ else if ( typeof define == "function" && define.amd)// AMD
16
+ define(["../../lib/codemirror"], mod);
17
+ else// Plain browser env
18
+ mod(CodeMirror);
19
+ })(function(CodeMirror) {
20
+ "use strict";
21
+
22
+ var languages = {
23
+ mscgen: {
24
+ "keywords" : ["msc"],
25
+ "options" : ["hscale", "width", "arcgradient", "wordwraparcs"],
26
+ "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
27
+ "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
28
+ "arcsWords" : ["note", "abox", "rbox", "box"],
29
+ "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
30
+ "singlecomment" : ["//", "#"],
31
+ "operators" : ["="]
32
+ },
33
+ xu: {
34
+ "keywords" : ["msc"],
35
+ "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
36
+ "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
37
+ "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
38
+ "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
39
+ "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
40
+ "singlecomment" : ["//", "#"],
41
+ "operators" : ["="]
42
+ },
43
+ msgenny: {
44
+ "keywords" : null,
45
+ "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
46
+ "attributes" : null,
47
+ "brackets" : ["\\{", "\\}"],
48
+ "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
49
+ "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
50
+ "singlecomment" : ["//", "#"],
51
+ "operators" : ["="]
52
+ }
53
+ }
54
+
55
+ CodeMirror.defineMode("mscgen", function(_, modeConfig) {
56
+ var language = languages[modeConfig && modeConfig.language || "mscgen"]
57
+ return {
58
+ startState: startStateFn,
59
+ copyState: copyStateFn,
60
+ token: produceTokenFunction(language),
61
+ lineComment : "#",
62
+ blockCommentStart : "/*",
63
+ blockCommentEnd : "*/"
64
+ };
65
+ });
66
+
67
+ CodeMirror.defineMIME("text/x-mscgen", "mscgen");
68
+ CodeMirror.defineMIME("text/x-xu", {name: "mscgen", language: "xu"});
69
+ CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"});
70
+
71
+ function wordRegexpBoundary(pWords) {
72
+ return new RegExp("\\b((" + pWords.join(")|(") + "))\\b", "i");
73
+ }
74
+
75
+ function wordRegexp(pWords) {
76
+ return new RegExp("((" + pWords.join(")|(") + "))", "i");
77
+ }
78
+
79
+ function startStateFn() {
80
+ return {
81
+ inComment : false,
82
+ inString : false,
83
+ inAttributeList : false,
84
+ inScript : false
85
+ };
86
+ }
87
+
88
+ function copyStateFn(pState) {
89
+ return {
90
+ inComment : pState.inComment,
91
+ inString : pState.inString,
92
+ inAttributeList : pState.inAttributeList,
93
+ inScript : pState.inScript
94
+ };
95
+ }
96
+
97
+ function produceTokenFunction(pConfig) {
98
+
99
+ return function(pStream, pState) {
100
+ if (pStream.match(wordRegexp(pConfig.brackets), true, true)) {
101
+ return "bracket";
102
+ }
103
+ /* comments */
104
+ if (!pState.inComment) {
105
+ if (pStream.match(/\/\*[^\*\/]*/, true, true)) {
106
+ pState.inComment = true;
107
+ return "comment";
108
+ }
109
+ if (pStream.match(wordRegexp(pConfig.singlecomment), true, true)) {
110
+ pStream.skipToEnd();
111
+ return "comment";
112
+ }
113
+ }
114
+ if (pState.inComment) {
115
+ if (pStream.match(/[^\*\/]*\*\//, true, true))
116
+ pState.inComment = false;
117
+ else
118
+ pStream.skipToEnd();
119
+ return "comment";
120
+ }
121
+ /* strings */
122
+ if (!pState.inString && pStream.match(/\"(\\\"|[^\"])*/, true, true)) {
123
+ pState.inString = true;
124
+ return "string";
125
+ }
126
+ if (pState.inString) {
127
+ if (pStream.match(/[^\"]*\"/, true, true))
128
+ pState.inString = false;
129
+ else
130
+ pStream.skipToEnd();
131
+ return "string";
132
+ }
133
+ /* keywords & operators */
134
+ if (!!pConfig.keywords && pStream.match(wordRegexpBoundary(pConfig.keywords), true, true))
135
+ return "keyword";
136
+
137
+ if (pStream.match(wordRegexpBoundary(pConfig.options), true, true))
138
+ return "keyword";
139
+
140
+ if (pStream.match(wordRegexpBoundary(pConfig.arcsWords), true, true))
141
+ return "keyword";
142
+
143
+ if (pStream.match(wordRegexp(pConfig.arcsOthers), true, true))
144
+ return "keyword";
145
+
146
+ if (!!pConfig.operators && pStream.match(wordRegexp(pConfig.operators), true, true))
147
+ return "operator";
148
+
149
+ /* attribute lists */
150
+ if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) {
151
+ pConfig.inAttributeList = true;
152
+ return "bracket";
153
+ }
154
+ if (pConfig.inAttributeList) {
155
+ if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) {
156
+ return "attribute";
157
+ }
158
+ if (pStream.match(/]/, true, true)) {
159
+ pConfig.inAttributeList = false;
160
+ return "bracket";
161
+ }
162
+ }
163
+
164
+ pStream.next();
165
+ return "base";
166
+ };
167
+ }
168
+
169
+ });
assets/js/vendor/codemirror/mode/mscgen/mscgen_test.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function() {
5
+ var mode = CodeMirror.getMode({indentUnit: 2}, "mscgen");
6
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
7
+
8
+ MT("empty chart",
9
+ "[keyword msc][bracket {]",
10
+ "[base ]",
11
+ "[bracket }]"
12
+ );
13
+
14
+ MT("comments",
15
+ "[comment // a single line comment]",
16
+ "[comment # another single line comment /* and */ ignored here]",
17
+ "[comment /* A multi-line comment even though it contains]",
18
+ "[comment msc keywords and \"quoted text\"*/]");
19
+
20
+ MT("strings",
21
+ "[string \"// a string\"]",
22
+ "[string \"a string running over]",
23
+ "[string two lines\"]",
24
+ "[string \"with \\\"escaped quote\"]"
25
+ );
26
+
27
+ MT("xù/ msgenny keywords classify as 'base'",
28
+ "[base watermark]",
29
+ "[base alt loop opt ref else break par seq assert]"
30
+ );
31
+
32
+ MT("mscgen options classify as keyword",
33
+ "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
34
+ );
35
+
36
+ MT("mscgen arcs classify as keyword",
37
+ "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
38
+ "[keyword |||...---]", "[keyword ..--==::]",
39
+ "[keyword ->]", "[keyword <-]", "[keyword <->]",
40
+ "[keyword =>]", "[keyword <=]", "[keyword <=>]",
41
+ "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
42
+ "[keyword >>]", "[keyword <<]", "[keyword <<>>]",
43
+ "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
44
+ "[keyword :>]", "[keyword <:]", "[keyword <:>]"
45
+ );
46
+
47
+ MT("within an attribute list, attributes classify as attribute",
48
+ "[bracket [[][attribute label]",
49
+ "[attribute id]","[attribute url]","[attribute idurl]",
50
+ "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
51
+ "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
52
+ "[attribute arcskip][bracket ]]]"
53
+ );
54
+
55
+ MT("outside an attribute list, attributes classify as base",
56
+ "[base label]",
57
+ "[base id]","[base url]","[base idurl]",
58
+ "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
59
+ "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
60
+ "[base arcskip]"
61
+ );
62
+
63
+ MT("a typical program",
64
+ "[comment # typical mscgen program]",
65
+ "[keyword msc][base ][bracket {]",
66
+ "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]",
67
+ "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]",
68
+ "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
69
+ "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
70
+ "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
71
+ "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
72
+ "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
73
+ "[bracket }]"
74
+ );
75
+ })();
assets/js/vendor/codemirror/mode/mscgen/msgenny_test.js ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function() {
5
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-msgenny");
6
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "msgenny"); }
7
+
8
+ MT("comments",
9
+ "[comment // a single line comment]",
10
+ "[comment # another single line comment /* and */ ignored here]",
11
+ "[comment /* A multi-line comment even though it contains]",
12
+ "[comment msc keywords and \"quoted text\"*/]");
13
+
14
+ MT("strings",
15
+ "[string \"// a string\"]",
16
+ "[string \"a string running over]",
17
+ "[string two lines\"]",
18
+ "[string \"with \\\"escaped quote\"]"
19
+ );
20
+
21
+ MT("xù/ msgenny keywords classify as 'keyword'",
22
+ "[keyword watermark]",
23
+ "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
24
+ );
25
+
26
+ MT("mscgen options classify as keyword",
27
+ "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
28
+ );
29
+
30
+ MT("mscgen arcs classify as keyword",
31
+ "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
32
+ "[keyword |||...---]", "[keyword ..--==::]",
33
+ "[keyword ->]", "[keyword <-]", "[keyword <->]",
34
+ "[keyword =>]", "[keyword <=]", "[keyword <=>]",
35
+ "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
36
+ "[keyword >>]", "[keyword <<]", "[keyword <<>>]",
37
+ "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
38
+ "[keyword :>]", "[keyword <:]", "[keyword <:>]"
39
+ );
40
+
41
+ MT("within an attribute list, mscgen/ xù attributes classify as base",
42
+ "[base [[label]",
43
+ "[base idurl id url]",
44
+ "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]",
45
+ "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]",
46
+ "[base arcskip]]]"
47
+ );
48
+
49
+ MT("outside an attribute list, mscgen/ xù attributes classify as base",
50
+ "[base label]",
51
+ "[base idurl id url]",
52
+ "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]",
53
+ "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]",
54
+ "[base arcskip]"
55
+ );
56
+
57
+ MT("a typical program",
58
+ "[comment # typical msgenny program]",
59
+ "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][base , ][keyword arcgradient][operator =][base 30;]",
60
+ "[base a : ][string \"Entity A\"][base ,]",
61
+ "[base b : Entity B,]",
62
+ "[base c : Entity C;]",
63
+ "[base a ][keyword =>>][base b: ][string \"Hello entity B\"][base ;]",
64
+ "[base a ][keyword alt][base c][bracket {]",
65
+ "[base a ][keyword <<][base b: ][string \"Here's an answer dude!\"][base ;]",
66
+ "[keyword ---][base : ][string \"sorry, won't march - comm glitch\"]",
67
+ "[base a ][keyword x-][base b: ][string \"Here's an answer dude! (won't arrive...)\"][base ;]",
68
+ "[bracket }]",
69
+ "[base c ][keyword :>][base *: What about me?;]"
70
+ );
71
+ })();
assets/js/vendor/codemirror/mode/mscgen/xu_test.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function() {
5
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-xu");
6
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "xu"); }
7
+
8
+ MT("empty chart",
9
+ "[keyword msc][bracket {]",
10
+ "[base ]",
11
+ "[bracket }]"
12
+ );
13
+
14
+ MT("comments",
15
+ "[comment // a single line comment]",
16
+ "[comment # another single line comment /* and */ ignored here]",
17
+ "[comment /* A multi-line comment even though it contains]",
18
+ "[comment msc keywords and \"quoted text\"*/]");
19
+
20
+ MT("strings",
21
+ "[string \"// a string\"]",
22
+ "[string \"a string running over]",
23
+ "[string two lines\"]",
24
+ "[string \"with \\\"escaped quote\"]"
25
+ );
26
+
27
+ MT("xù/ msgenny keywords classify as 'keyword'",
28
+ "[keyword watermark]",
29
+ "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
30
+ );
31
+
32
+ MT("mscgen options classify as keyword",
33
+ "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
34
+ );
35
+
36
+ MT("mscgen arcs classify as keyword",
37
+ "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
38
+ "[keyword |||...---]", "[keyword ..--==::]",
39
+ "[keyword ->]", "[keyword <-]", "[keyword <->]",
40
+ "[keyword =>]", "[keyword <=]", "[keyword <=>]",
41
+ "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
42
+ "[keyword >>]", "[keyword <<]", "[keyword <<>>]",
43
+ "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
44
+ "[keyword :>]", "[keyword <:]", "[keyword <:>]"
45
+ );
46
+
47
+ MT("within an attribute list, attributes classify as attribute",
48
+ "[bracket [[][attribute label]",
49
+ "[attribute id]","[attribute url]","[attribute idurl]",
50
+ "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
51
+ "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
52
+ "[attribute arcskip][bracket ]]]"
53
+ );
54
+
55
+ MT("outside an attribute list, attributes classify as base",
56
+ "[base label]",
57
+ "[base id]","[base url]","[base idurl]",
58
+ "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
59
+ "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
60
+ "[base arcskip]"
61
+ );
62
+
63
+ MT("a typical program",
64
+ "[comment # typical mscgen program]",
65
+ "[keyword msc][base ][bracket {]",
66
+ "[keyword wordwraparcs][operator =][string \"true\"][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]",
67
+ "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]",
68
+ "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
69
+ "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
70
+ "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
71
+ "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
72
+ "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
73
+ "[bracket }]"
74
+ );
75
+ })();
assets/js/vendor/codemirror/mode/mumps/index.html ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: MUMPS mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="mumps.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">MUMPS</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>MUMPS mode</h2>
27
+
28
+
29
+ <div><textarea id="code" name="code">
30
+ ; Lloyd Milligan
31
+ ; 03-30-2015
32
+ ;
33
+ ; MUMPS support for Code Mirror - Excerpts below from routine ^XUS
34
+ ;
35
+ CHECKAV(X1) ;Check A/V code return DUZ or Zero. (Called from XUSRB)
36
+ N %,%1,X,Y,IEN,DA,DIK
37
+ S IEN=0
38
+ ;Start CCOW
39
+ I $E(X1,1,7)="~~TOK~~" D Q:IEN>0 IEN
40
+ . I $E(X1,8,9)="~1" S IEN=$$CHKASH^XUSRB4($E(X1,8,255))
41
+ . I $E(X1,8,9)="~2" S IEN=$$CHKCCOW^XUSRB4($E(X1,8,255))
42
+ . Q
43
+ ;End CCOW
44
+ S X1=$$UP(X1) S:X1[":" XUTT=1,X1=$TR(X1,":")
45
+ S X=$P(X1,";") Q:X="^" -1 S:XUF %1="Access: "_X
46
+ Q:X'?1.20ANP 0
47
+ S X=$$EN^XUSHSH(X) I '$D(^VA(200,"A",X)) D LBAV Q 0
48
+ S %1="",IEN=$O(^VA(200,"A",X,0)),XUF(.3)=IEN D USER(IEN)
49
+ S X=$P(X1,";",2) S:XUF %1="Verify: "_X S X=$$EN^XUSHSH(X)
50
+ I $P(XUSER(1),"^",2)'=X D LBAV Q 0
51
+ I $G(XUFAC(1)) S DIK="^XUSEC(4,",DA=XUFAC(1) D ^DIK
52
+ Q IEN
53
+ ;
54
+ ; Spell out commands
55
+ ;
56
+ SET2() ;EF. Return error code (also called from XUSRB)
57
+ NEW %,X
58
+ SET XUNOW=$$HTFM^XLFDT($H),DT=$P(XUNOW,".")
59
+ KILL DUZ,XUSER
60
+ SET (DUZ,DUZ(2))=0,(DUZ(0),DUZ("AG"),XUSER(0),XUSER(1),XUTT,%UCI)=""
61
+ SET %=$$INHIBIT^XUSRB() IF %>0 QUIT %
62
+ SET X=$G(^%ZIS(1,XUDEV,"XUS")),XU1=$G(^(1))
63
+ IF $L(X) FOR I=1:1:15 IF $L($P(X,U,I)) SET $P(XOPT,U,I)=$P(X,U,I)
64
+ SET DTIME=600
65
+ IF '$P(XOPT,U,11),$D(^%ZIS(1,XUDEV,90)),^(90)>2800000,^(90)'>DT QUIT 8
66
+ QUIT 0
67
+ ;
68
+ ; Spell out commands and functions
69
+ ;
70
+ IF $PIECE(XUSER(0),U,11),$PIECE(XUSER(0),U,11)'>DT QUIT 11 ;Terminated
71
+ IF $DATA(DUZ("ASH")) QUIT 0 ;If auto handle, Allow to sign-on p434
72
+ IF $PIECE(XUSER(0),U,7) QUIT 5 ;Disuser flag set
73
+ IF '$LENGTH($PIECE(XUSER(1),U,2)) QUIT 21 ;p419, p434
74
+ Q 0
75
+ ;
76
+ </textarea>
77
+ <script>
78
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
79
+ mode: "mumps",
80
+ lineNumbers: true,
81
+ lineWrapping: true
82
+ });
83
+ </script>
84
+
85
+ </article>
assets/js/vendor/codemirror/mode/mumps/mumps.js ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /*
5
+ This MUMPS Language script was constructed using vbscript.js as a template.
6
+ */
7
+
8
+ (function(mod) {
9
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
10
+ mod(require("../../lib/codemirror"));
11
+ else if (typeof define == "function" && define.amd) // AMD
12
+ define(["../../lib/codemirror"], mod);
13
+ else // Plain browser env
14
+ mod(CodeMirror);
15
+ })(function(CodeMirror) {
16
+ "use strict";
17
+
18
+ CodeMirror.defineMode("mumps", function() {
19
+ function wordRegexp(words) {
20
+ return new RegExp("^((" + words.join(")|(") + "))\\b", "i");
21
+ }
22
+
23
+ var singleOperators = new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]");
24
+ var doubleOperators = new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))");
25
+ var singleDelimiters = new RegExp("^[\\.,:]");
26
+ var brackets = new RegExp("[()]");
27
+ var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*");
28
+ var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"];
29
+ // The following list includes instrinsic functions _and_ special variables
30
+ var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"];
31
+ var intrinsicFuncs = wordRegexp(intrinsicFuncsWords);
32
+ var command = wordRegexp(commandKeywords);
33
+
34
+ function tokenBase(stream, state) {
35
+ if (stream.sol()) {
36
+ state.label = true;
37
+ state.commandMode = 0;
38
+ }
39
+
40
+ // The <space> character has meaning in MUMPS. Ignoring consecutive
41
+ // spaces would interfere with interpreting whether the next non-space
42
+ // character belongs to the command or argument context.
43
+
44
+ // Examine each character and update a mode variable whose interpretation is:
45
+ // >0 => command 0 => argument <0 => command post-conditional
46
+ var ch = stream.peek();
47
+
48
+ if (ch == " " || ch == "\t") { // Pre-process <space>
49
+ state.label = false;
50
+ if (state.commandMode == 0)
51
+ state.commandMode = 1;
52
+ else if ((state.commandMode < 0) || (state.commandMode == 2))
53
+ state.commandMode = 0;
54
+ } else if ((ch != ".") && (state.commandMode > 0)) {
55
+ if (ch == ":")
56
+ state.commandMode = -1; // SIS - Command post-conditional
57
+ else
58
+ state.commandMode = 2;
59
+ }
60
+
61
+ // Do not color parameter list as line tag
62
+ if ((ch === "(") || (ch === "\u0009"))
63
+ state.label = false;
64
+
65
+ // MUMPS comment starts with ";"
66
+ if (ch === ";") {
67
+ stream.skipToEnd();
68
+ return "comment";
69
+ }
70
+
71
+ // Number Literals // SIS/RLM - MUMPS permits canonic number followed by concatenate operator
72
+ if (stream.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/))
73
+ return "number";
74
+
75
+ // Handle Strings
76
+ if (ch == '"') {
77
+ if (stream.skipTo('"')) {
78
+ stream.next();
79
+ return "string";
80
+ } else {
81
+ stream.skipToEnd();
82
+ return "error";
83
+ }
84
+ }
85
+
86
+ // Handle operators and Delimiters
87
+ if (stream.match(doubleOperators) || stream.match(singleOperators))
88
+ return "operator";
89
+
90
+ // Prevents leading "." in DO block from falling through to error
91
+ if (stream.match(singleDelimiters))
92
+ return null;
93
+
94
+ if (brackets.test(ch)) {
95
+ stream.next();
96
+ return "bracket";
97
+ }
98
+
99
+ if (state.commandMode > 0 && stream.match(command))
100
+ return "variable-2";
101
+
102
+ if (stream.match(intrinsicFuncs))
103
+ return "builtin";
104
+
105
+ if (stream.match(identifiers))
106
+ return "variable";
107
+
108
+ // Detect dollar-sign when not a documented intrinsic function
109
+ // "^" may introduce a GVN or SSVN - Color same as function
110
+ if (ch === "$" || ch === "^") {
111
+ stream.next();
112
+ return "builtin";
113
+ }
114
+
115
+ // MUMPS Indirection
116
+ if (ch === "@") {
117
+ stream.next();
118
+ return "string-2";
119
+ }
120
+
121
+ if (/[\w%]/.test(ch)) {
122
+ stream.eatWhile(/[\w%]/);
123
+ return "variable";
124
+ }
125
+
126
+ // Handle non-detected items
127
+ stream.next();
128
+ return "error";
129
+ }
130
+
131
+ return {
132
+ startState: function() {
133
+ return {
134
+ label: false,
135
+ commandMode: 0
136
+ };
137
+ },
138
+
139
+ token: function(stream, state) {
140
+ var style = tokenBase(stream, state);
141
+ if (state.label) return "tag";
142
+ return style;
143
+ }
144
+ };
145
+ });
146
+
147
+ CodeMirror.defineMIME("text/x-mumps", "mumps");
148
+ });
assets/js/vendor/codemirror/mode/nginx/index.html ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: NGINX mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="nginx.js"></script>
10
+ <style>.CodeMirror {background: #f8f8f8;}</style>
11
+ <link rel="stylesheet" href="../../doc/docs.css">
12
+ </head>
13
+
14
+ <style>
15
+ body {
16
+ margin: 0em auto;
17
+ }
18
+
19
+ .CodeMirror, .CodeMirror-scroll {
20
+ height: 600px;
21
+ }
22
+ </style>
23
+ <div id=nav>
24
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
25
+
26
+ <ul>
27
+ <li><a href="../../index.html">Home</a>
28
+ <li><a href="../../doc/manual.html">Manual</a>
29
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
30
+ </ul>
31
+ <ul>
32
+ <li><a href="../index.html">Language modes</a>
33
+ <li><a class=active href="#">NGINX</a>
34
+ </ul>
35
+ </div>
36
+
37
+ <article>
38
+ <h2>NGINX mode</h2>
39
+ <form><textarea id="code" name="code" style="height: 800px;">
40
+ server {
41
+ listen 173.255.219.235:80;
42
+ server_name website.com.au;
43
+ rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
44
+ }
45
+
46
+ server {
47
+ listen 173.255.219.235:443;
48
+ server_name website.com.au;
49
+ rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
50
+ }
51
+
52
+ server {
53
+
54
+ listen 173.255.219.235:80;
55
+ server_name www.website.com.au;
56
+
57
+
58
+
59
+ root /data/www;
60
+ index index.html index.php;
61
+
62
+ location / {
63
+ index index.html index.php; ## Allow a static html file to be shown first
64
+ try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
65
+ expires 30d; ## Assume all files are cachable
66
+ }
67
+
68
+ ## These locations would be hidden by .htaccess normally
69
+ location /app/ { deny all; }
70
+ location /includes/ { deny all; }
71
+ location /lib/ { deny all; }
72
+ location /media/downloadable/ { deny all; }
73
+ location /pkginfo/ { deny all; }
74
+ location /report/config.xml { deny all; }
75
+ location /var/ { deny all; }
76
+
77
+ location /var/export/ { ## Allow admins only to view export folder
78
+ auth_basic "Restricted"; ## Message shown in login window
79
+ auth_basic_user_file /rs/passwords/testfile; ## See /etc/nginx/htpassword
80
+ autoindex on;
81
+ }
82
+
83
+ location /. { ## Disable .htaccess and other hidden files
84
+ return 404;
85
+ }
86
+
87
+ location @handler { ## Magento uses a common front handler
88
+ rewrite / /index.php;
89
+ }
90
+
91
+ location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
92
+ rewrite ^/(.*.php)/ /$1 last;
93
+ }
94
+
95
+ location ~ \.php$ {
96
+ if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
97
+
98
+ fastcgi_pass 127.0.0.1:9000;
99
+ fastcgi_index index.php;
100
+ fastcgi_param PATH_INFO $fastcgi_script_name;
101
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
102
+ include /rs/confs/nginx/fastcgi_params;
103
+ }
104
+
105
+ }
106
+
107
+
108
+ server {
109
+
110
+ listen 173.255.219.235:443;
111
+ server_name website.com.au www.website.com.au;
112
+
113
+ root /data/www;
114
+ index index.html index.php;
115
+
116
+ ssl on;
117
+ ssl_certificate /rs/ssl/ssl.crt;
118
+ ssl_certificate_key /rs/ssl/ssl.key;
119
+
120
+ ssl_session_timeout 5m;
121
+
122
+ ssl_protocols SSLv2 SSLv3 TLSv1;
123
+ ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
124
+ ssl_prefer_server_ciphers on;
125
+
126
+
127
+
128
+ location / {
129
+ index index.html index.php; ## Allow a static html file to be shown first
130
+ try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
131
+ expires 30d; ## Assume all files are cachable
132
+ }
133
+
134
+ ## These locations would be hidden by .htaccess normally
135
+ location /app/ { deny all; }
136
+ location /includes/ { deny all; }
137
+ location /lib/ { deny all; }
138
+ location /media/downloadable/ { deny all; }
139
+ location /pkginfo/ { deny all; }
140
+ location /report/config.xml { deny all; }
141
+ location /var/ { deny all; }
142
+
143
+ location /var/export/ { ## Allow admins only to view export folder
144
+ auth_basic "Restricted"; ## Message shown in login window
145
+ auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
146
+ autoindex on;
147
+ }
148
+
149
+ location /. { ## Disable .htaccess and other hidden files
150
+ return 404;
151
+ }
152
+
153
+ location @handler { ## Magento uses a common front handler
154
+ rewrite / /index.php;
155
+ }
156
+
157
+ location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
158
+ rewrite ^/(.*.php)/ /$1 last;
159
+ }
160
+
161
+ location ~ .php$ { ## Execute PHP scripts
162
+ if (!-e $request_filename) { rewrite /index.php last; } ## Catch 404s that try_files miss
163
+
164
+ fastcgi_pass 127.0.0.1:9000;
165
+ fastcgi_index index.php;
166
+ fastcgi_param PATH_INFO $fastcgi_script_name;
167
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
168
+ include /rs/confs/nginx/fastcgi_params;
169
+
170
+ fastcgi_param HTTPS on;
171
+ }
172
+
173
+ }
174
+ </textarea></form>
175
+ <script>
176
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
177
+ </script>
178
+
179
+ <p><strong>MIME types defined:</strong> <code>text/nginx</code>.</p>
180
+
181
+ </article>
assets/js/vendor/codemirror/mode/nginx/nginx.js ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("nginx", function(config) {
15
+
16
+ function words(str) {
17
+ var obj = {}, words = str.split(" ");
18
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
19
+ return obj;
20
+ }
21
+
22
+ var keywords = words(
23
+ /* ngxDirectiveControl */ "break return rewrite set" +
24
+ /* ngxDirective */ " accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"
25
+ );
26
+
27
+ var keywords_block = words(
28
+ /* ngxDirectiveBlock */ "http mail events server types location upstream charset_map limit_except if geo map"
29
+ );
30
+
31
+ var keywords_important = words(
32
+ /* ngxDirectiveImportant */ "include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"
33
+ );
34
+
35
+ var indentUnit = config.indentUnit, type;
36
+ function ret(style, tp) {type = tp; return style;}
37
+
38
+ function tokenBase(stream, state) {
39
+
40
+
41
+ stream.eatWhile(/[\w\$_]/);
42
+
43
+ var cur = stream.current();
44
+
45
+
46
+ if (keywords.propertyIsEnumerable(cur)) {
47
+ return "keyword";
48
+ }
49
+ else if (keywords_block.propertyIsEnumerable(cur)) {
50
+ return "variable-2";
51
+ }
52
+ else if (keywords_important.propertyIsEnumerable(cur)) {
53
+ return "string-2";
54
+ }
55
+ /**/
56
+
57
+ var ch = stream.next();
58
+ if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());}
59
+ else if (ch == "/" && stream.eat("*")) {
60
+ state.tokenize = tokenCComment;
61
+ return tokenCComment(stream, state);
62
+ }
63
+ else if (ch == "<" && stream.eat("!")) {
64
+ state.tokenize = tokenSGMLComment;
65
+ return tokenSGMLComment(stream, state);
66
+ }
67
+ else if (ch == "=") ret(null, "compare");
68
+ else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");
69
+ else if (ch == "\"" || ch == "'") {
70
+ state.tokenize = tokenString(ch);
71
+ return state.tokenize(stream, state);
72
+ }
73
+ else if (ch == "#") {
74
+ stream.skipToEnd();
75
+ return ret("comment", "comment");
76
+ }
77
+ else if (ch == "!") {
78
+ stream.match(/^\s*\w*/);
79
+ return ret("keyword", "important");
80
+ }
81
+ else if (/\d/.test(ch)) {
82
+ stream.eatWhile(/[\w.%]/);
83
+ return ret("number", "unit");
84
+ }
85
+ else if (/[,.+>*\/]/.test(ch)) {
86
+ return ret(null, "select-op");
87
+ }
88
+ else if (/[;{}:\[\]]/.test(ch)) {
89
+ return ret(null, ch);
90
+ }
91
+ else {
92
+ stream.eatWhile(/[\w\\\-]/);
93
+ return ret("variable", "variable");
94
+ }
95
+ }
96
+
97
+ function tokenCComment(stream, state) {
98
+ var maybeEnd = false, ch;
99
+ while ((ch = stream.next()) != null) {
100
+ if (maybeEnd && ch == "/") {
101
+ state.tokenize = tokenBase;
102
+ break;
103
+ }
104
+ maybeEnd = (ch == "*");
105
+ }
106
+ return ret("comment", "comment");
107
+ }
108
+
109
+ function tokenSGMLComment(stream, state) {
110
+ var dashes = 0, ch;
111
+ while ((ch = stream.next()) != null) {
112
+ if (dashes >= 2 && ch == ">") {
113
+ state.tokenize = tokenBase;
114
+ break;
115
+ }
116
+ dashes = (ch == "-") ? dashes + 1 : 0;
117
+ }
118
+ return ret("comment", "comment");
119
+ }
120
+
121
+ function tokenString(quote) {
122
+ return function(stream, state) {
123
+ var escaped = false, ch;
124
+ while ((ch = stream.next()) != null) {
125
+ if (ch == quote && !escaped)
126
+ break;
127
+ escaped = !escaped && ch == "\\";
128
+ }
129
+ if (!escaped) state.tokenize = tokenBase;
130
+ return ret("string", "string");
131
+ };
132
+ }
133
+
134
+ return {
135
+ startState: function(base) {
136
+ return {tokenize: tokenBase,
137
+ baseIndent: base || 0,
138
+ stack: []};
139
+ },
140
+
141
+ token: function(stream, state) {
142
+ if (stream.eatSpace()) return null;
143
+ type = null;
144
+ var style = state.tokenize(stream, state);
145
+
146
+ var context = state.stack[state.stack.length-1];
147
+ if (type == "hash" && context == "rule") style = "atom";
148
+ else if (style == "variable") {
149
+ if (context == "rule") style = "number";
150
+ else if (!context || context == "@media{") style = "tag";
151
+ }
152
+
153
+ if (context == "rule" && /^[\{\};]$/.test(type))
154
+ state.stack.pop();
155
+ if (type == "{") {
156
+ if (context == "@media") state.stack[state.stack.length-1] = "@media{";
157
+ else state.stack.push("{");
158
+ }
159
+ else if (type == "}") state.stack.pop();
160
+ else if (type == "@media") state.stack.push("@media");
161
+ else if (context == "{" && type != "comment") state.stack.push("rule");
162
+ return style;
163
+ },
164
+
165
+ indent: function(state, textAfter) {
166
+ var n = state.stack.length;
167
+ if (/^\}/.test(textAfter))
168
+ n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1;
169
+ return state.baseIndent + n * indentUnit;
170
+ },
171
+
172
+ electricChars: "}"
173
+ };
174
+ });
175
+
176
+ CodeMirror.defineMIME("text/nginx", "text/x-nginx-conf");
177
+
178
+ });
assets/js/vendor/codemirror/mode/nsis/index.html ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: NSIS mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel=stylesheet href=../../lib/codemirror.css>
8
+ <script src=../../lib/codemirror.js></script>
9
+ <script src="../../addon/mode/simple.js"></script>
10
+ <script src="../../addon/edit/matchbrackets.js"></script>
11
+ <script src=nsis.js></script>
12
+ <style type=text/css>
13
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
14
+ </style>
15
+ <div id=nav>
16
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
17
+
18
+ <ul>
19
+ <li><a href="../../index.html">Home</a>
20
+ <li><a href="../../doc/manual.html">Manual</a>
21
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
22
+ </ul>
23
+ <ul>
24
+ <li><a href="../index.html">Language modes</a>
25
+ <li><a class=active href="#">NSIS</a>
26
+ </ul>
27
+ </div>
28
+
29
+ <article>
30
+ <h2>NSIS mode</h2>
31
+
32
+
33
+ <textarea id=code>
34
+ ; This is a comment
35
+ !ifdef ERROR
36
+ !error "Something went wrong"
37
+ !endif
38
+
39
+ OutFile "demo.exe"
40
+ RequestExecutionLevel user
41
+ SetDetailsPrint listonly
42
+
43
+ !include "LogicLib.nsh"
44
+ !include "WinVer.nsh"
45
+
46
+ Section -mandatory
47
+
48
+ Call logWinVer
49
+
50
+ ${If} 1 > 0
51
+ MessageBox MB_OK "Hello world"
52
+ ${EndIf}
53
+
54
+ SectionEnd
55
+
56
+ Function logWinVer
57
+
58
+ ${If} ${IsWin10}
59
+ DetailPrint "Windows 10!"
60
+ ${ElseIf} ${AtLeastWinVista}
61
+ DetailPrint "We're post-XP"
62
+ ${Else}
63
+ DetailPrint "Legacy system"
64
+ ${EndIf}
65
+
66
+ FunctionEnd
67
+ </textarea>
68
+
69
+ <script>
70
+ var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
71
+ mode: 'nsis',
72
+ indentWithTabs: true,
73
+ smartIndent: true,
74
+ lineNumbers: true,
75
+ matchBrackets: true
76
+ });
77
+ </script>
78
+
79
+ <p><strong>MIME types defined:</strong> <code>text/x-nsis</code>.</p>
80
+ </article>
assets/js/vendor/codemirror/mode/nsis/nsis.js ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // Author: Jan T. Sott (http://github.com/idleberg)
5
+
6
+ (function(mod) {
7
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
8
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
9
+ else if (typeof define == "function" && define.amd) // AMD
10
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
11
+ else // Plain browser env
12
+ mod(CodeMirror);
13
+ })(function(CodeMirror) {
14
+ "use strict";
15
+
16
+ CodeMirror.defineSimpleMode("nsis",{
17
+ start:[
18
+ // Numbers
19
+ {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
20
+
21
+ // Strings
22
+ { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
23
+ { regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
24
+ { regex: /`(?:[^\\`]|\\.)*`?/, token: "string" },
25
+
26
+ // Compile Time Commands
27
+ {regex: /(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"},
28
+
29
+ // Conditional Compilation
30
+ {regex: /(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true},
31
+ {regex: /(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true},
32
+
33
+ // Runtime Commands
34
+ {regex: /\b(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
35
+ {regex: /\b(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true},
36
+ {regex: /\b(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true},
37
+
38
+ // Command Options
39
+ {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
40
+ {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
41
+
42
+ // LogicLib.nsh
43
+ {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true},
44
+
45
+ // FileFunc.nsh
46
+ {regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true},
47
+
48
+ // Memento.nsh
49
+ {regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true},
50
+
51
+ // TextFunc.nsh
52
+ {regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true},
53
+
54
+ // WinVer.nsh
55
+ {regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true},
56
+
57
+ // WordFunc.nsh
58
+ {regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true},
59
+
60
+ // x64.nsh
61
+ {regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true},
62
+ {regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true},
63
+
64
+ // Line Comment
65
+ {regex: /(#|;).*/, token: "comment"},
66
+
67
+ // Block Comment
68
+ {regex: /\/\*/, token: "comment", next: "comment"},
69
+
70
+ // Operator
71
+ {regex: /[-+\/*=<>!]+/, token: "operator"},
72
+
73
+ // Variable
74
+ {regex: /\$[\w]+/, token: "variable"},
75
+
76
+ // Constant
77
+ {regex: /\${[\w]+}/,token: "variable-2"},
78
+
79
+ // Language String
80
+ {regex: /\$\([\w]+\)/,token: "variable-3"}
81
+ ],
82
+ comment: [
83
+ {regex: /.*?\*\//, token: "comment", next: "start"},
84
+ {regex: /.*/, token: "comment"}
85
+ ],
86
+ meta: {
87
+ electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/,
88
+ blockCommentStart: "/*",
89
+ blockCommentEnd: "*/",
90
+ lineComment: ["#", ";"]
91
+ }
92
+ });
93
+
94
+ CodeMirror.defineMIME("text/x-nsis", "nsis");
95
+ });
assets/js/vendor/codemirror/mode/ntriples/index.html ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: NTriples mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="ntriples.js"></script>
10
+ <style type="text/css">
11
+ .CodeMirror {
12
+ border: 1px solid #eee;
13
+ }
14
+ </style>
15
+ <div id=nav>
16
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
17
+
18
+ <ul>
19
+ <li><a href="../../index.html">Home</a>
20
+ <li><a href="../../doc/manual.html">Manual</a>
21
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
22
+ </ul>
23
+ <ul>
24
+ <li><a href="../index.html">Language modes</a>
25
+ <li><a class=active href="#">NTriples</a>
26
+ </ul>
27
+ </div>
28
+
29
+ <article>
30
+ <h2>NTriples mode</h2>
31
+ <form>
32
+ <textarea id="ntriples" name="ntriples">
33
+ <http://Sub1> <http://pred1> <http://obj> .
34
+ <http://Sub2> <http://pred2#an2> "literal 1" .
35
+ <http://Sub3#an3> <http://pred3> _:bnode3 .
36
+ _:bnode4 <http://pred4> "literal 2"@lang .
37
+ _:bnode5 <http://pred5> "literal 3"^^<http://type> .
38
+ </textarea>
39
+ </form>
40
+
41
+ <script>
42
+ var editor = CodeMirror.fromTextArea(document.getElementById("ntriples"), {});
43
+ </script>
44
+ <p><strong>MIME types defined:</strong> <code>text/n-triples</code>.</p>
45
+ </article>
assets/js/vendor/codemirror/mode/ntriples/ntriples.js ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /**********************************************************
5
+ * This script provides syntax highlighting support for
6
+ * the Ntriples format.
7
+ * Ntriples format specification:
8
+ * http://www.w3.org/TR/rdf-testcases/#ntriples
9
+ ***********************************************************/
10
+
11
+ /*
12
+ The following expression defines the defined ASF grammar transitions.
13
+
14
+ pre_subject ->
15
+ {
16
+ ( writing_subject_uri | writing_bnode_uri )
17
+ -> pre_predicate
18
+ -> writing_predicate_uri
19
+ -> pre_object
20
+ -> writing_object_uri | writing_object_bnode |
21
+ (
22
+ writing_object_literal
23
+ -> writing_literal_lang | writing_literal_type
24
+ )
25
+ -> post_object
26
+ -> BEGIN
27
+ } otherwise {
28
+ -> ERROR
29
+ }
30
+ */
31
+
32
+ (function(mod) {
33
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
34
+ mod(require("../../lib/codemirror"));
35
+ else if (typeof define == "function" && define.amd) // AMD
36
+ define(["../../lib/codemirror"], mod);
37
+ else // Plain browser env
38
+ mod(CodeMirror);
39
+ })(function(CodeMirror) {
40
+ "use strict";
41
+
42
+ CodeMirror.defineMode("ntriples", function() {
43
+
44
+ var Location = {
45
+ PRE_SUBJECT : 0,
46
+ WRITING_SUB_URI : 1,
47
+ WRITING_BNODE_URI : 2,
48
+ PRE_PRED : 3,
49
+ WRITING_PRED_URI : 4,
50
+ PRE_OBJ : 5,
51
+ WRITING_OBJ_URI : 6,
52
+ WRITING_OBJ_BNODE : 7,
53
+ WRITING_OBJ_LITERAL : 8,
54
+ WRITING_LIT_LANG : 9,
55
+ WRITING_LIT_TYPE : 10,
56
+ POST_OBJ : 11,
57
+ ERROR : 12
58
+ };
59
+ function transitState(currState, c) {
60
+ var currLocation = currState.location;
61
+ var ret;
62
+
63
+ // Opening.
64
+ if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI;
65
+ else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI;
66
+ else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI;
67
+ else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI;
68
+ else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE;
69
+ else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL;
70
+
71
+ // Closing.
72
+ else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED;
73
+ else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED;
74
+ else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ;
75
+ else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ;
76
+ else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ;
77
+ else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ;
78
+ else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ;
79
+ else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ;
80
+
81
+ // Closing typed and language literal.
82
+ else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG;
83
+ else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE;
84
+
85
+ // Spaces.
86
+ else if( c == ' ' &&
87
+ (
88
+ currLocation == Location.PRE_SUBJECT ||
89
+ currLocation == Location.PRE_PRED ||
90
+ currLocation == Location.PRE_OBJ ||
91
+ currLocation == Location.POST_OBJ
92
+ )
93
+ ) ret = currLocation;
94
+
95
+ // Reset.
96
+ else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT;
97
+
98
+ // Error
99
+ else ret = Location.ERROR;
100
+
101
+ currState.location=ret;
102
+ }
103
+
104
+ return {
105
+ startState: function() {
106
+ return {
107
+ location : Location.PRE_SUBJECT,
108
+ uris : [],
109
+ anchors : [],
110
+ bnodes : [],
111
+ langs : [],
112
+ types : []
113
+ };
114
+ },
115
+ token: function(stream, state) {
116
+ var ch = stream.next();
117
+ if(ch == '<') {
118
+ transitState(state, ch);
119
+ var parsedURI = '';
120
+ stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} );
121
+ state.uris.push(parsedURI);
122
+ if( stream.match('#', false) ) return 'variable';
123
+ stream.next();
124
+ transitState(state, '>');
125
+ return 'variable';
126
+ }
127
+ if(ch == '#') {
128
+ var parsedAnchor = '';
129
+ stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;});
130
+ state.anchors.push(parsedAnchor);
131
+ return 'variable-2';
132
+ }
133
+ if(ch == '>') {
134
+ transitState(state, '>');
135
+ return 'variable';
136
+ }
137
+ if(ch == '_') {
138
+ transitState(state, ch);
139
+ var parsedBNode = '';
140
+ stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;});
141
+ state.bnodes.push(parsedBNode);
142
+ stream.next();
143
+ transitState(state, ' ');
144
+ return 'builtin';
145
+ }
146
+ if(ch == '"') {
147
+ transitState(state, ch);
148
+ stream.eatWhile( function(c) { return c != '"'; } );
149
+ stream.next();
150
+ if( stream.peek() != '@' && stream.peek() != '^' ) {
151
+ transitState(state, '"');
152
+ }
153
+ return 'string';
154
+ }
155
+ if( ch == '@' ) {
156
+ transitState(state, '@');
157
+ var parsedLang = '';
158
+ stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;});
159
+ state.langs.push(parsedLang);
160
+ stream.next();
161
+ transitState(state, ' ');
162
+ return 'string-2';
163
+ }
164
+ if( ch == '^' ) {
165
+ stream.next();
166
+ transitState(state, '^');
167
+ var parsedType = '';
168
+ stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} );
169
+ state.types.push(parsedType);
170
+ stream.next();
171
+ transitState(state, '>');
172
+ return 'variable';
173
+ }
174
+ if( ch == ' ' ) {
175
+ transitState(state, ch);
176
+ }
177
+ if( ch == '.' ) {
178
+ transitState(state, ch);
179
+ }
180
+ }
181
+ };
182
+ });
183
+
184
+ CodeMirror.defineMIME("text/n-triples", "ntriples");
185
+
186
+ });
assets/js/vendor/codemirror/mode/octave/index.html ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Octave mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="octave.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Octave</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Octave mode</h2>
27
+
28
+ <div><textarea id="code" name="code">
29
+ %numbers
30
+ [1234 1234i 1234j]
31
+ [.234 .234j 2.23i]
32
+ [23e2 12E1j 123D-4 0x234]
33
+
34
+ %strings
35
+ 'asda''a'
36
+ "asda""a"
37
+
38
+ %identifiers
39
+ a + as123 - __asd__
40
+
41
+ %operators
42
+ -
43
+ +
44
+ =
45
+ ==
46
+ >
47
+ <
48
+ >=
49
+ <=
50
+ &
51
+ ~
52
+ ...
53
+ break zeros default margin round ones rand
54
+ ceil floor size clear zeros eye mean std cov
55
+ error eval function
56
+ abs acos atan asin cos cosh exp log prod sum
57
+ log10 max min sign sin sinh sqrt tan reshape
58
+ return
59
+ case switch
60
+ else elseif end if otherwise
61
+ do for while
62
+ try catch
63
+ classdef properties events methods
64
+ global persistent
65
+
66
+ %one line comment
67
+ %{ multi
68
+ line commment %}
69
+
70
+ </textarea></div>
71
+ <script>
72
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
73
+ mode: {name: "octave",
74
+ version: 2,
75
+ singleLineStringErrors: false},
76
+ lineNumbers: true,
77
+ indentUnit: 4,
78
+ matchBrackets: true
79
+ });
80
+ </script>
81
+
82
+ <p><strong>MIME types defined:</strong> <code>text/x-octave</code>.</p>
83
+ </article>
assets/js/vendor/codemirror/mode/octave/octave.js ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("octave", function() {
15
+ function wordRegexp(words) {
16
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
17
+ }
18
+
19
+ var singleOperators = new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]");
20
+ var singleDelimiters = new RegExp('^[\\(\\[\\{\\},:=;]');
21
+ var doubleOperators = new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))");
22
+ var doubleDelimiters = new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))");
23
+ var tripleDelimiters = new RegExp("^((>>=)|(<<=))");
24
+ var expressionEnd = new RegExp("^[\\]\\)]");
25
+ var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*");
26
+
27
+ var builtins = wordRegexp([
28
+ 'error', 'eval', 'function', 'abs', 'acos', 'atan', 'asin', 'cos',
29
+ 'cosh', 'exp', 'log', 'prod', 'sum', 'log10', 'max', 'min', 'sign', 'sin', 'sinh',
30
+ 'sqrt', 'tan', 'reshape', 'break', 'zeros', 'default', 'margin', 'round', 'ones',
31
+ 'rand', 'syn', 'ceil', 'floor', 'size', 'clear', 'zeros', 'eye', 'mean', 'std', 'cov',
32
+ 'det', 'eig', 'inv', 'norm', 'rank', 'trace', 'expm', 'logm', 'sqrtm', 'linspace', 'plot',
33
+ 'title', 'xlabel', 'ylabel', 'legend', 'text', 'grid', 'meshgrid', 'mesh', 'num2str',
34
+ 'fft', 'ifft', 'arrayfun', 'cellfun', 'input', 'fliplr', 'flipud', 'ismember'
35
+ ]);
36
+
37
+ var keywords = wordRegexp([
38
+ 'return', 'case', 'switch', 'else', 'elseif', 'end', 'endif', 'endfunction',
39
+ 'if', 'otherwise', 'do', 'for', 'while', 'try', 'catch', 'classdef', 'properties', 'events',
40
+ 'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'sprintf', 'disp', 'until',
41
+ 'continue', 'pkg'
42
+ ]);
43
+
44
+
45
+ // tokenizers
46
+ function tokenTranspose(stream, state) {
47
+ if (!stream.sol() && stream.peek() === '\'') {
48
+ stream.next();
49
+ state.tokenize = tokenBase;
50
+ return 'operator';
51
+ }
52
+ state.tokenize = tokenBase;
53
+ return tokenBase(stream, state);
54
+ }
55
+
56
+
57
+ function tokenComment(stream, state) {
58
+ if (stream.match(/^.*%}/)) {
59
+ state.tokenize = tokenBase;
60
+ return 'comment';
61
+ };
62
+ stream.skipToEnd();
63
+ return 'comment';
64
+ }
65
+
66
+ function tokenBase(stream, state) {
67
+ // whitespaces
68
+ if (stream.eatSpace()) return null;
69
+
70
+ // Handle one line Comments
71
+ if (stream.match('%{')){
72
+ state.tokenize = tokenComment;
73
+ stream.skipToEnd();
74
+ return 'comment';
75
+ }
76
+
77
+ if (stream.match(/^[%#]/)){
78
+ stream.skipToEnd();
79
+ return 'comment';
80
+ }
81
+
82
+ // Handle Number Literals
83
+ if (stream.match(/^[0-9\.+-]/, false)) {
84
+ if (stream.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)) {
85
+ stream.tokenize = tokenBase;
86
+ return 'number'; };
87
+ if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };
88
+ if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };
89
+ }
90
+ if (stream.match(wordRegexp(['nan','NaN','inf','Inf']))) { return 'number'; };
91
+
92
+ // Handle Strings
93
+ if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; } ;
94
+ if (stream.match(/^'([^']|(''))*'/)) { return 'string'; } ;
95
+
96
+ // Handle words
97
+ if (stream.match(keywords)) { return 'keyword'; } ;
98
+ if (stream.match(builtins)) { return 'builtin'; } ;
99
+ if (stream.match(identifiers)) { return 'variable'; } ;
100
+
101
+ if (stream.match(singleOperators) || stream.match(doubleOperators)) { return 'operator'; };
102
+ if (stream.match(singleDelimiters) || stream.match(doubleDelimiters) || stream.match(tripleDelimiters)) { return null; };
103
+
104
+ if (stream.match(expressionEnd)) {
105
+ state.tokenize = tokenTranspose;
106
+ return null;
107
+ };
108
+
109
+
110
+ // Handle non-detected items
111
+ stream.next();
112
+ return 'error';
113
+ };
114
+
115
+
116
+ return {
117
+ startState: function() {
118
+ return {
119
+ tokenize: tokenBase
120
+ };
121
+ },
122
+
123
+ token: function(stream, state) {
124
+ var style = state.tokenize(stream, state);
125
+ if (style === 'number' || style === 'variable'){
126
+ state.tokenize = tokenTranspose;
127
+ }
128
+ return style;
129
+ }
130
+ };
131
+ });
132
+
133
+ CodeMirror.defineMIME("text/x-octave", "octave");
134
+
135
+ });
assets/js/vendor/codemirror/mode/oz/index.html ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Oz mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="oz.js"></script>
10
+ <script type="text/javascript" src="../../addon/runmode/runmode.js"></script>
11
+ <style>
12
+ .CodeMirror {border: 1px solid #aaa;}
13
+ </style>
14
+ <div id=nav>
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
16
+ <ul>
17
+ <li><a href="../../index.html">Home</a>
18
+ <li><a href="../../doc/manual.html">Manual</a>
19
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
20
+ </ul>
21
+ <ul>
22
+ <li><a href="../index.html">Language modes</a>
23
+ <li><a class=active href="#">Oz</a>
24
+ </ul>
25
+ </div>
26
+
27
+ <article>
28
+ <h2>Oz mode</h2>
29
+ <textarea id="code" name="code">
30
+ declare
31
+ fun {Ints N Max}
32
+ if N == Max then nil
33
+ else
34
+ {Delay 1000}
35
+ N|{Ints N+1 Max}
36
+ end
37
+ end
38
+
39
+ fun {Sum S Stream}
40
+ case Stream of nil then S
41
+ [] H|T then S|{Sum H+S T} end
42
+ end
43
+
44
+ local X Y in
45
+ thread X = {Ints 0 1000} end
46
+ thread Y = {Sum 0 X} end
47
+ {Browse Y}
48
+ end
49
+ </textarea>
50
+ <p>MIME type defined: <code>text/x-oz</code>.</p>
51
+
52
+ <script type="text/javascript">
53
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
54
+ lineNumbers: true,
55
+ mode: "text/x-oz",
56
+ readOnly: false
57
+ });
58
+ </script>
59
+ </article>
assets/js/vendor/codemirror/mode/oz/oz.js ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("oz", function (conf) {
15
+
16
+ function wordRegexp(words) {
17
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
18
+ }
19
+
20
+ var singleOperators = /[\^@!\|<>#~\.\*\-\+\\/,=]/;
21
+ var doubleOperators = /(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/;
22
+ var tripleOperators = /(:::)|(\.\.\.)|(=<:)|(>=:)/;
23
+
24
+ var middle = ["in", "then", "else", "of", "elseof", "elsecase", "elseif", "catch",
25
+ "finally", "with", "require", "prepare", "import", "export", "define", "do"];
26
+ var end = ["end"];
27
+
28
+ var atoms = wordRegexp(["true", "false", "nil", "unit"]);
29
+ var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex",
30
+ "mod", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]);
31
+ var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis",
32
+ "choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]);
33
+ var middleKeywords = wordRegexp(middle);
34
+ var endKeywords = wordRegexp(end);
35
+
36
+ // Tokenizers
37
+ function tokenBase(stream, state) {
38
+ if (stream.eatSpace()) {
39
+ return null;
40
+ }
41
+
42
+ // Brackets
43
+ if(stream.match(/[{}]/)) {
44
+ return "bracket";
45
+ }
46
+
47
+ // Special [] keyword
48
+ if (stream.match(/(\[])/)) {
49
+ return "keyword"
50
+ }
51
+
52
+ // Operators
53
+ if (stream.match(tripleOperators) || stream.match(doubleOperators)) {
54
+ return "operator";
55
+ }
56
+
57
+ // Atoms
58
+ if(stream.match(atoms)) {
59
+ return 'atom';
60
+ }
61
+
62
+ // Opening keywords
63
+ var matched = stream.match(openingKeywords);
64
+ if (matched) {
65
+ if (!state.doInCurrentLine)
66
+ state.currentIndent++;
67
+ else
68
+ state.doInCurrentLine = false;
69
+
70
+ // Special matching for signatures
71
+ if(matched[0] == "proc" || matched[0] == "fun")
72
+ state.tokenize = tokenFunProc;
73
+ else if(matched[0] == "class")
74
+ state.tokenize = tokenClass;
75
+ else if(matched[0] == "meth")
76
+ state.tokenize = tokenMeth;
77
+
78
+ return 'keyword';
79
+ }
80
+
81
+ // Middle and other keywords
82
+ if (stream.match(middleKeywords) || stream.match(commonKeywords)) {
83
+ return "keyword"
84
+ }
85
+
86
+ // End keywords
87
+ if (stream.match(endKeywords)) {
88
+ state.currentIndent--;
89
+ return 'keyword';
90
+ }
91
+
92
+ // Eat the next char for next comparisons
93
+ var ch = stream.next();
94
+
95
+ // Strings
96
+ if (ch == '"' || ch == "'") {
97
+ state.tokenize = tokenString(ch);
98
+ return state.tokenize(stream, state);
99
+ }
100
+
101
+ // Numbers
102
+ if (/[~\d]/.test(ch)) {
103
+ if (ch == "~") {
104
+ if(! /^[0-9]/.test(stream.peek()))
105
+ return null;
106
+ else if (( stream.next() == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
107
+ return "number";
108
+ }
109
+
110
+ if ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
111
+ return "number";
112
+
113
+ return null;
114
+ }
115
+
116
+ // Comments
117
+ if (ch == "%") {
118
+ stream.skipToEnd();
119
+ return 'comment';
120
+ }
121
+ else if (ch == "/") {
122
+ if (stream.eat("*")) {
123
+ state.tokenize = tokenComment;
124
+ return tokenComment(stream, state);
125
+ }
126
+ }
127
+
128
+ // Single operators
129
+ if(singleOperators.test(ch)) {
130
+ return "operator";
131
+ }
132
+
133
+ // If nothing match, we skip the entire alphanumerical block
134
+ stream.eatWhile(/\w/);
135
+
136
+ return "variable";
137
+ }
138
+
139
+ function tokenClass(stream, state) {
140
+ if (stream.eatSpace()) {
141
+ return null;
142
+ }
143
+ stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/);
144
+ state.tokenize = tokenBase;
145
+ return "variable-3"
146
+ }
147
+
148
+ function tokenMeth(stream, state) {
149
+ if (stream.eatSpace()) {
150
+ return null;
151
+ }
152
+ stream.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/);
153
+ state.tokenize = tokenBase;
154
+ return "def"
155
+ }
156
+
157
+ function tokenFunProc(stream, state) {
158
+ if (stream.eatSpace()) {
159
+ return null;
160
+ }
161
+
162
+ if(!state.hasPassedFirstStage && stream.eat("{")) {
163
+ state.hasPassedFirstStage = true;
164
+ return "bracket";
165
+ }
166
+ else if(state.hasPassedFirstStage) {
167
+ stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/);
168
+ state.hasPassedFirstStage = false;
169
+ state.tokenize = tokenBase;
170
+ return "def"
171
+ }
172
+ else {
173
+ state.tokenize = tokenBase;
174
+ return null;
175
+ }
176
+ }
177
+
178
+ function tokenComment(stream, state) {
179
+ var maybeEnd = false, ch;
180
+ while (ch = stream.next()) {
181
+ if (ch == "/" && maybeEnd) {
182
+ state.tokenize = tokenBase;
183
+ break;
184
+ }
185
+ maybeEnd = (ch == "*");
186
+ }
187
+ return "comment";
188
+ }
189
+
190
+ function tokenString(quote) {
191
+ return function (stream, state) {
192
+ var escaped = false, next, end = false;
193
+ while ((next = stream.next()) != null) {
194
+ if (next == quote && !escaped) {
195
+ end = true;
196
+ break;
197
+ }
198
+ escaped = !escaped && next == "\\";
199
+ }
200
+ if (end || !escaped)
201
+ state.tokenize = tokenBase;
202
+ return "string";
203
+ };
204
+ }
205
+
206
+ function buildElectricInputRegEx() {
207
+ // Reindentation should occur on [] or on a match of any of
208
+ // the block closing keywords, at the end of a line.
209
+ var allClosings = middle.concat(end);
210
+ return new RegExp("[\\[\\]]|(" + allClosings.join("|") + ")$");
211
+ }
212
+
213
+ return {
214
+
215
+ startState: function () {
216
+ return {
217
+ tokenize: tokenBase,
218
+ currentIndent: 0,
219
+ doInCurrentLine: false,
220
+ hasPassedFirstStage: false
221
+ };
222
+ },
223
+
224
+ token: function (stream, state) {
225
+ if (stream.sol())
226
+ state.doInCurrentLine = 0;
227
+
228
+ return state.tokenize(stream, state);
229
+ },
230
+
231
+ indent: function (state, textAfter) {
232
+ var trueText = textAfter.replace(/^\s+|\s+$/g, '');
233
+
234
+ if (trueText.match(endKeywords) || trueText.match(middleKeywords) || trueText.match(/(\[])/))
235
+ return conf.indentUnit * (state.currentIndent - 1);
236
+
237
+ if (state.currentIndent < 0)
238
+ return 0;
239
+
240
+ return state.currentIndent * conf.indentUnit;
241
+ },
242
+ fold: "indent",
243
+ electricInput: buildElectricInputRegEx(),
244
+ lineComment: "%",
245
+ blockCommentStart: "/*",
246
+ blockCommentEnd: "*/"
247
+ };
248
+ });
249
+
250
+ CodeMirror.defineMIME("text/x-oz", "oz");
251
+
252
+ });
assets/js/vendor/codemirror/mode/pascal/index.html ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Pascal mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="pascal.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Pascal</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Pascal mode</h2>
27
+
28
+
29
+ <div><textarea id="code" name="code">
30
+ (* Example Pascal code *)
31
+
32
+ while a <> b do writeln('Waiting');
33
+
34
+ if a > b then
35
+ writeln('Condition met')
36
+ else
37
+ writeln('Condition not met');
38
+
39
+ for i := 1 to 10 do
40
+ writeln('Iteration: ', i:1);
41
+
42
+ repeat
43
+ a := a + 1
44
+ until a = 10;
45
+
46
+ case i of
47
+ 0: write('zero');
48
+ 1: write('one');
49
+ 2: write('two')
50
+ end;
51
+ </textarea></div>
52
+
53
+ <script>
54
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
55
+ lineNumbers: true,
56
+ mode: "text/x-pascal"
57
+ });
58
+ </script>
59
+
60
+ <p><strong>MIME types defined:</strong> <code>text/x-pascal</code>.</p>
61
+ </article>
assets/js/vendor/codemirror/mode/pascal/pascal.js ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("pascal", function() {
15
+ function words(str) {
16
+ var obj = {}, words = str.split(" ");
17
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
18
+ return obj;
19
+ }
20
+ var keywords = words("and array begin case const div do downto else end file for forward integer " +
21
+ "boolean char function goto if in label mod nil not of or packed procedure " +
22
+ "program record repeat set string then to type until var while with");
23
+ var atoms = {"null": true};
24
+
25
+ var isOperatorChar = /[+\-*&%=<>!?|\/]/;
26
+
27
+ function tokenBase(stream, state) {
28
+ var ch = stream.next();
29
+ if (ch == "#" && state.startOfLine) {
30
+ stream.skipToEnd();
31
+ return "meta";
32
+ }
33
+ if (ch == '"' || ch == "'") {
34
+ state.tokenize = tokenString(ch);
35
+ return state.tokenize(stream, state);
36
+ }
37
+ if (ch == "(" && stream.eat("*")) {
38
+ state.tokenize = tokenComment;
39
+ return tokenComment(stream, state);
40
+ }
41
+ if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
42
+ return null;
43
+ }
44
+ if (/\d/.test(ch)) {
45
+ stream.eatWhile(/[\w\.]/);
46
+ return "number";
47
+ }
48
+ if (ch == "/") {
49
+ if (stream.eat("/")) {
50
+ stream.skipToEnd();
51
+ return "comment";
52
+ }
53
+ }
54
+ if (isOperatorChar.test(ch)) {
55
+ stream.eatWhile(isOperatorChar);
56
+ return "operator";
57
+ }
58
+ stream.eatWhile(/[\w\$_]/);
59
+ var cur = stream.current();
60
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
61
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
62
+ return "variable";
63
+ }
64
+
65
+ function tokenString(quote) {
66
+ return function(stream, state) {
67
+ var escaped = false, next, end = false;
68
+ while ((next = stream.next()) != null) {
69
+ if (next == quote && !escaped) {end = true; break;}
70
+ escaped = !escaped && next == "\\";
71
+ }
72
+ if (end || !escaped) state.tokenize = null;
73
+ return "string";
74
+ };
75
+ }
76
+
77
+ function tokenComment(stream, state) {
78
+ var maybeEnd = false, ch;
79
+ while (ch = stream.next()) {
80
+ if (ch == ")" && maybeEnd) {
81
+ state.tokenize = null;
82
+ break;
83
+ }
84
+ maybeEnd = (ch == "*");
85
+ }
86
+ return "comment";
87
+ }
88
+
89
+ // Interface
90
+
91
+ return {
92
+ startState: function() {
93
+ return {tokenize: null};
94
+ },
95
+
96
+ token: function(stream, state) {
97
+ if (stream.eatSpace()) return null;
98
+ var style = (state.tokenize || tokenBase)(stream, state);
99
+ if (style == "comment" || style == "meta") return style;
100
+ return style;
101
+ },
102
+
103
+ electricChars: "{}"
104
+ };
105
+ });
106
+
107
+ CodeMirror.defineMIME("text/x-pascal", "pascal");
108
+
109
+ });
assets/js/vendor/codemirror/mode/pegjs/index.html ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title>CodeMirror: PEG.js Mode</title>
5
+ <meta charset="utf-8"/>
6
+ <link rel=stylesheet href="../../doc/docs.css">
7
+
8
+ <link rel="stylesheet" href="../../lib/codemirror.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="../javascript/javascript.js"></script>
11
+ <script src="pegjs.js"></script>
12
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
13
+ </head>
14
+ <body>
15
+ <div id=nav>
16
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
17
+
18
+ <ul>
19
+ <li><a href="../../index.html">Home</a>
20
+ <li><a href="../../doc/manual.html">Manual</a>
21
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
22
+ </ul>
23
+ <ul>
24
+ <li><a href="../index.html">Language modes</a>
25
+ <li><a class=active href="#">PEG.js Mode</a>
26
+ </ul>
27
+ </div>
28
+
29
+ <article>
30
+ <h2>PEG.js Mode</h2>
31
+ <form><textarea id="code" name="code">
32
+ /*
33
+ * Classic example grammar, which recognizes simple arithmetic expressions like
34
+ * "2*(3+4)". The parser generated from this grammar then computes their value.
35
+ */
36
+
37
+ start
38
+ = additive
39
+
40
+ additive
41
+ = left:multiplicative "+" right:additive { return left + right; }
42
+ / multiplicative
43
+
44
+ multiplicative
45
+ = left:primary "*" right:multiplicative { return left * right; }
46
+ / primary
47
+
48
+ primary
49
+ = integer
50
+ / "(" additive:additive ")" { return additive; }
51
+
52
+ integer "integer"
53
+ = digits:[0-9]+ { return parseInt(digits.join(""), 10); }
54
+
55
+ letter = [a-z]+</textarea></form>
56
+ <script>
57
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
58
+ mode: {name: "pegjs"},
59
+ lineNumbers: true
60
+ });
61
+ </script>
62
+ <h3>The PEG.js Mode</h3>
63
+ <p> Created by Forbes Lindesay.</p>
64
+ </article>
65
+ </body>
66
+ </html>
assets/js/vendor/codemirror/mode/pegjs/pegjs.js ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../javascript/javascript"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../javascript/javascript"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("pegjs", function (config) {
15
+ var jsMode = CodeMirror.getMode(config, "javascript");
16
+
17
+ function identifier(stream) {
18
+ return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);
19
+ }
20
+
21
+ return {
22
+ startState: function () {
23
+ return {
24
+ inString: false,
25
+ stringType: null,
26
+ inComment: false,
27
+ inChracterClass: false,
28
+ braced: 0,
29
+ lhs: true,
30
+ localState: null
31
+ };
32
+ },
33
+ token: function (stream, state) {
34
+ if (stream)
35
+
36
+ //check for state changes
37
+ if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) {
38
+ state.stringType = stream.peek();
39
+ stream.next(); // Skip quote
40
+ state.inString = true; // Update state
41
+ }
42
+ if (!state.inString && !state.inComment && stream.match(/^\/\*/)) {
43
+ state.inComment = true;
44
+ }
45
+
46
+ //return state
47
+ if (state.inString) {
48
+ while (state.inString && !stream.eol()) {
49
+ if (stream.peek() === state.stringType) {
50
+ stream.next(); // Skip quote
51
+ state.inString = false; // Clear flag
52
+ } else if (stream.peek() === '\\') {
53
+ stream.next();
54
+ stream.next();
55
+ } else {
56
+ stream.match(/^.[^\\\"\']*/);
57
+ }
58
+ }
59
+ return state.lhs ? "property string" : "string"; // Token style
60
+ } else if (state.inComment) {
61
+ while (state.inComment && !stream.eol()) {
62
+ if (stream.match(/\*\//)) {
63
+ state.inComment = false; // Clear flag
64
+ } else {
65
+ stream.match(/^.[^\*]*/);
66
+ }
67
+ }
68
+ return "comment";
69
+ } else if (state.inChracterClass) {
70
+ while (state.inChracterClass && !stream.eol()) {
71
+ if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) {
72
+ state.inChracterClass = false;
73
+ }
74
+ }
75
+ } else if (stream.peek() === '[') {
76
+ stream.next();
77
+ state.inChracterClass = true;
78
+ return 'bracket';
79
+ } else if (stream.match(/^\/\//)) {
80
+ stream.skipToEnd();
81
+ return "comment";
82
+ } else if (state.braced || stream.peek() === '{') {
83
+ if (state.localState === null) {
84
+ state.localState = jsMode.startState();
85
+ }
86
+ var token = jsMode.token(stream, state.localState);
87
+ var text = stream.current();
88
+ if (!token) {
89
+ for (var i = 0; i < text.length; i++) {
90
+ if (text[i] === '{') {
91
+ state.braced++;
92
+ } else if (text[i] === '}') {
93
+ state.braced--;
94
+ }
95
+ };
96
+ }
97
+ return token;
98
+ } else if (identifier(stream)) {
99
+ if (stream.peek() === ':') {
100
+ return 'variable';
101
+ }
102
+ return 'variable-2';
103
+ } else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) {
104
+ stream.next();
105
+ return 'bracket';
106
+ } else if (!stream.eatSpace()) {
107
+ stream.next();
108
+ }
109
+ return null;
110
+ }
111
+ };
112
+ }, "javascript");
113
+
114
+ });
assets/js/vendor/codemirror/mode/perl/index.html ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Perl mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="perl.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Perl</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Perl mode</h2>
27
+
28
+
29
+ <div><textarea id="code" name="code">
30
+ #!/usr/bin/perl
31
+
32
+ use Something qw(func1 func2);
33
+
34
+ # strings
35
+ my $s1 = qq'single line';
36
+ our $s2 = q(multi-
37
+ line);
38
+
39
+ =item Something
40
+ Example.
41
+ =cut
42
+
43
+ my $html=<<'HTML'
44
+ <html>
45
+ <title>hi!</title>
46
+ </html>
47
+ HTML
48
+
49
+ print "first,".join(',', 'second', qq~third~);
50
+
51
+ if($s1 =~ m[(?<!\s)(l.ne)\z]o) {
52
+ $h->{$1}=$$.' predefined variables';
53
+ $s2 =~ s/\-line//ox;
54
+ $s1 =~ s[
55
+ line ]
56
+ [
57
+ block
58
+ ]ox;
59
+ }
60
+
61
+ 1; # numbers and comments
62
+
63
+ __END__
64
+ something...
65
+
66
+ </textarea></div>
67
+
68
+ <script>
69
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
70
+ lineNumbers: true
71
+ });
72
+ </script>
73
+
74
+ <p><strong>MIME types defined:</strong> <code>text/x-perl</code>.</p>
75
+ </article>
assets/js/vendor/codemirror/mode/perl/perl.js ADDED
@@ -0,0 +1,837 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08)
5
+ // This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com)
6
+
7
+ (function(mod) {
8
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
9
+ mod(require("../../lib/codemirror"));
10
+ else if (typeof define == "function" && define.amd) // AMD
11
+ define(["../../lib/codemirror"], mod);
12
+ else // Plain browser env
13
+ mod(CodeMirror);
14
+ })(function(CodeMirror) {
15
+ "use strict";
16
+
17
+ CodeMirror.defineMode("perl",function(){
18
+ // http://perldoc.perl.org
19
+ var PERL={ // null - magic touch
20
+ // 1 - keyword
21
+ // 2 - def
22
+ // 3 - atom
23
+ // 4 - operator
24
+ // 5 - variable-2 (predefined)
25
+ // [x,y] - x=1,2,3; y=must be defined if x{...}
26
+ // PERL operators
27
+ '->' : 4,
28
+ '++' : 4,
29
+ '--' : 4,
30
+ '**' : 4,
31
+ // ! ~ \ and unary + and -
32
+ '=~' : 4,
33
+ '!~' : 4,
34
+ '*' : 4,
35
+ '/' : 4,
36
+ '%' : 4,
37
+ 'x' : 4,
38
+ '+' : 4,
39
+ '-' : 4,
40
+ '.' : 4,
41
+ '<<' : 4,
42
+ '>>' : 4,
43
+ // named unary operators
44
+ '<' : 4,
45
+ '>' : 4,
46
+ '<=' : 4,
47
+ '>=' : 4,
48
+ 'lt' : 4,
49
+ 'gt' : 4,
50
+ 'le' : 4,
51
+ 'ge' : 4,
52
+ '==' : 4,
53
+ '!=' : 4,
54
+ '<=>' : 4,
55
+ 'eq' : 4,
56
+ 'ne' : 4,
57
+ 'cmp' : 4,
58
+ '~~' : 4,
59
+ '&' : 4,
60
+ '|' : 4,
61
+ '^' : 4,
62
+ '&&' : 4,
63
+ '||' : 4,
64
+ '//' : 4,
65
+ '..' : 4,
66
+ '...' : 4,
67
+ '?' : 4,
68
+ ':' : 4,
69
+ '=' : 4,
70
+ '+=' : 4,
71
+ '-=' : 4,
72
+ '*=' : 4, // etc. ???
73
+ ',' : 4,
74
+ '=>' : 4,
75
+ '::' : 4,
76
+ // list operators (rightward)
77
+ 'not' : 4,
78
+ 'and' : 4,
79
+ 'or' : 4,
80
+ 'xor' : 4,
81
+ // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;)
82
+ 'BEGIN' : [5,1],
83
+ 'END' : [5,1],
84
+ 'PRINT' : [5,1],
85
+ 'PRINTF' : [5,1],
86
+ 'GETC' : [5,1],
87
+ 'READ' : [5,1],
88
+ 'READLINE' : [5,1],
89
+ 'DESTROY' : [5,1],
90
+ 'TIE' : [5,1],
91
+ 'TIEHANDLE' : [5,1],
92
+ 'UNTIE' : [5,1],
93
+ 'STDIN' : 5,
94
+ 'STDIN_TOP' : 5,
95
+ 'STDOUT' : 5,
96
+ 'STDOUT_TOP' : 5,
97
+ 'STDERR' : 5,
98
+ 'STDERR_TOP' : 5,
99
+ '$ARG' : 5,
100
+ '$_' : 5,
101
+ '@ARG' : 5,
102
+ '@_' : 5,
103
+ '$LIST_SEPARATOR' : 5,
104
+ '$"' : 5,
105
+ '$PROCESS_ID' : 5,
106
+ '$PID' : 5,
107
+ '$$' : 5,
108
+ '$REAL_GROUP_ID' : 5,
109
+ '$GID' : 5,
110
+ '$(' : 5,
111
+ '$EFFECTIVE_GROUP_ID' : 5,
112
+ '$EGID' : 5,
113
+ '$)' : 5,
114
+ '$PROGRAM_NAME' : 5,
115
+ '$0' : 5,
116
+ '$SUBSCRIPT_SEPARATOR' : 5,
117
+ '$SUBSEP' : 5,
118
+ '$;' : 5,
119
+ '$REAL_USER_ID' : 5,
120
+ '$UID' : 5,
121
+ '$<' : 5,
122
+ '$EFFECTIVE_USER_ID' : 5,
123
+ '$EUID' : 5,
124
+ '$>' : 5,
125
+ '$a' : 5,
126
+ '$b' : 5,
127
+ '$COMPILING' : 5,
128
+ '$^C' : 5,
129
+ '$DEBUGGING' : 5,
130
+ '$^D' : 5,
131
+ '${^ENCODING}' : 5,
132
+ '$ENV' : 5,
133
+ '%ENV' : 5,
134
+ '$SYSTEM_FD_MAX' : 5,
135
+ '$^F' : 5,
136
+ '@F' : 5,
137
+ '${^GLOBAL_PHASE}' : 5,
138
+ '$^H' : 5,
139
+ '%^H' : 5,
140
+ '@INC' : 5,
141
+ '%INC' : 5,
142
+ '$INPLACE_EDIT' : 5,
143
+ '$^I' : 5,
144
+ '$^M' : 5,
145
+ '$OSNAME' : 5,
146
+ '$^O' : 5,
147
+ '${^OPEN}' : 5,
148
+ '$PERLDB' : 5,
149
+ '$^P' : 5,
150
+ '$SIG' : 5,
151
+ '%SIG' : 5,
152
+ '$BASETIME' : 5,
153
+ '$^T' : 5,
154
+ '${^TAINT}' : 5,
155
+ '${^UNICODE}' : 5,
156
+ '${^UTF8CACHE}' : 5,
157
+ '${^UTF8LOCALE}' : 5,
158
+ '$PERL_VERSION' : 5,
159
+ '$^V' : 5,
160
+ '${^WIN32_SLOPPY_STAT}' : 5,
161
+ '$EXECUTABLE_NAME' : 5,
162
+ '$^X' : 5,
163
+ '$1' : 5, // - regexp $1, $2...
164
+ '$MATCH' : 5,
165
+ '$&' : 5,
166
+ '${^MATCH}' : 5,
167
+ '$PREMATCH' : 5,
168
+ '$`' : 5,
169
+ '${^PREMATCH}' : 5,
170
+ '$POSTMATCH' : 5,
171
+ "$'" : 5,
172
+ '${^POSTMATCH}' : 5,
173
+ '$LAST_PAREN_MATCH' : 5,
174
+ '$+' : 5,
175
+ '$LAST_SUBMATCH_RESULT' : 5,
176
+ '$^N' : 5,
177
+ '@LAST_MATCH_END' : 5,
178
+ '@+' : 5,
179
+ '%LAST_PAREN_MATCH' : 5,
180
+ '%+' : 5,
181
+ '@LAST_MATCH_START' : 5,
182
+ '@-' : 5,
183
+ '%LAST_MATCH_START' : 5,
184
+ '%-' : 5,
185
+ '$LAST_REGEXP_CODE_RESULT' : 5,
186
+ '$^R' : 5,
187
+ '${^RE_DEBUG_FLAGS}' : 5,
188
+ '${^RE_TRIE_MAXBUF}' : 5,
189
+ '$ARGV' : 5,
190
+ '@ARGV' : 5,
191
+ 'ARGV' : 5,
192
+ 'ARGVOUT' : 5,
193
+ '$OUTPUT_FIELD_SEPARATOR' : 5,
194
+ '$OFS' : 5,
195
+ '$,' : 5,
196
+ '$INPUT_LINE_NUMBER' : 5,
197
+ '$NR' : 5,
198
+ '$.' : 5,
199
+ '$INPUT_RECORD_SEPARATOR' : 5,
200
+ '$RS' : 5,
201
+ '$/' : 5,
202
+ '$OUTPUT_RECORD_SEPARATOR' : 5,
203
+ '$ORS' : 5,
204
+ '$\\' : 5,
205
+ '$OUTPUT_AUTOFLUSH' : 5,
206
+ '$|' : 5,
207
+ '$ACCUMULATOR' : 5,
208
+ '$^A' : 5,
209
+ '$FORMAT_FORMFEED' : 5,
210
+ '$^L' : 5,
211
+ '$FORMAT_PAGE_NUMBER' : 5,
212
+ '$%' : 5,
213
+ '$FORMAT_LINES_LEFT' : 5,
214
+ '$-' : 5,
215
+ '$FORMAT_LINE_BREAK_CHARACTERS' : 5,
216
+ '$:' : 5,
217
+ '$FORMAT_LINES_PER_PAGE' : 5,
218
+ '$=' : 5,
219
+ '$FORMAT_TOP_NAME' : 5,
220
+ '$^' : 5,
221
+ '$FORMAT_NAME' : 5,
222
+ '$~' : 5,
223
+ '${^CHILD_ERROR_NATIVE}' : 5,
224
+ '$EXTENDED_OS_ERROR' : 5,
225
+ '$^E' : 5,
226
+ '$EXCEPTIONS_BEING_CAUGHT' : 5,
227
+ '$^S' : 5,
228
+ '$WARNING' : 5,
229
+ '$^W' : 5,
230
+ '${^WARNING_BITS}' : 5,
231
+ '$OS_ERROR' : 5,
232
+ '$ERRNO' : 5,
233
+ '$!' : 5,
234
+ '%OS_ERROR' : 5,
235
+ '%ERRNO' : 5,
236
+ '%!' : 5,
237
+ '$CHILD_ERROR' : 5,
238
+ '$?' : 5,
239
+ '$EVAL_ERROR' : 5,
240
+ '$@' : 5,
241
+ '$OFMT' : 5,
242
+ '$#' : 5,
243
+ '$*' : 5,
244
+ '$ARRAY_BASE' : 5,
245
+ '$[' : 5,
246
+ '$OLD_PERL_VERSION' : 5,
247
+ '$]' : 5,
248
+ // PERL blocks
249
+ 'if' :[1,1],
250
+ elsif :[1,1],
251
+ 'else' :[1,1],
252
+ 'while' :[1,1],
253
+ unless :[1,1],
254
+ 'for' :[1,1],
255
+ foreach :[1,1],
256
+ // PERL functions
257
+ 'abs' :1, // - absolute value function
258
+ accept :1, // - accept an incoming socket connect
259
+ alarm :1, // - schedule a SIGALRM
260
+ 'atan2' :1, // - arctangent of Y/X in the range -PI to PI
261
+ bind :1, // - binds an address to a socket
262
+ binmode :1, // - prepare binary files for I/O
263
+ bless :1, // - create an object
264
+ bootstrap :1, //
265
+ 'break' :1, // - break out of a "given" block
266
+ caller :1, // - get context of the current subroutine call
267
+ chdir :1, // - change your current working directory
268
+ chmod :1, // - changes the permissions on a list of files
269
+ chomp :1, // - remove a trailing record separator from a string
270
+ chop :1, // - remove the last character from a string
271
+ chown :1, // - change the owership on a list of files
272
+ chr :1, // - get character this number represents
273
+ chroot :1, // - make directory new root for path lookups
274
+ close :1, // - close file (or pipe or socket) handle
275
+ closedir :1, // - close directory handle
276
+ connect :1, // - connect to a remote socket
277
+ 'continue' :[1,1], // - optional trailing block in a while or foreach
278
+ 'cos' :1, // - cosine function
279
+ crypt :1, // - one-way passwd-style encryption
280
+ dbmclose :1, // - breaks binding on a tied dbm file
281
+ dbmopen :1, // - create binding on a tied dbm file
282
+ 'default' :1, //
283
+ defined :1, // - test whether a value, variable, or function is defined
284
+ 'delete' :1, // - deletes a value from a hash
285
+ die :1, // - raise an exception or bail out
286
+ 'do' :1, // - turn a BLOCK into a TERM
287
+ dump :1, // - create an immediate core dump
288
+ each :1, // - retrieve the next key/value pair from a hash
289
+ endgrent :1, // - be done using group file
290
+ endhostent :1, // - be done using hosts file
291
+ endnetent :1, // - be done using networks file
292
+ endprotoent :1, // - be done using protocols file
293
+ endpwent :1, // - be done using passwd file
294
+ endservent :1, // - be done using services file
295
+ eof :1, // - test a filehandle for its end
296
+ 'eval' :1, // - catch exceptions or compile and run code
297
+ 'exec' :1, // - abandon this program to run another
298
+ exists :1, // - test whether a hash key is present
299
+ exit :1, // - terminate this program
300
+ 'exp' :1, // - raise I to a power
301
+ fcntl :1, // - file control system call
302
+ fileno :1, // - return file descriptor from filehandle
303
+ flock :1, // - lock an entire file with an advisory lock
304
+ fork :1, // - create a new process just like this one
305
+ format :1, // - declare a picture format with use by the write() function
306
+ formline :1, // - internal function used for formats
307
+ getc :1, // - get the next character from the filehandle
308
+ getgrent :1, // - get next group record
309
+ getgrgid :1, // - get group record given group user ID
310
+ getgrnam :1, // - get group record given group name
311
+ gethostbyaddr :1, // - get host record given its address
312
+ gethostbyname :1, // - get host record given name
313
+ gethostent :1, // - get next hosts record
314
+ getlogin :1, // - return who logged in at this tty
315
+ getnetbyaddr :1, // - get network record given its address
316
+ getnetbyname :1, // - get networks record given name
317
+ getnetent :1, // - get next networks record
318
+ getpeername :1, // - find the other end of a socket connection
319
+ getpgrp :1, // - get process group
320
+ getppid :1, // - get parent process ID
321
+ getpriority :1, // - get current nice value
322
+ getprotobyname :1, // - get protocol record given name
323
+ getprotobynumber :1, // - get protocol record numeric protocol
324
+ getprotoent :1, // - get next protocols record
325
+ getpwent :1, // - get next passwd record
326
+ getpwnam :1, // - get passwd record given user login name
327
+ getpwuid :1, // - get passwd record given user ID
328
+ getservbyname :1, // - get services record given its name
329
+ getservbyport :1, // - get services record given numeric port
330
+ getservent :1, // - get next services record
331
+ getsockname :1, // - retrieve the sockaddr for a given socket
332
+ getsockopt :1, // - get socket options on a given socket
333
+ given :1, //
334
+ glob :1, // - expand filenames using wildcards
335
+ gmtime :1, // - convert UNIX time into record or string using Greenwich time
336
+ 'goto' :1, // - create spaghetti code
337
+ grep :1, // - locate elements in a list test true against a given criterion
338
+ hex :1, // - convert a string to a hexadecimal number
339
+ 'import' :1, // - patch a module's namespace into your own
340
+ index :1, // - find a substring within a string
341
+ 'int' :1, // - get the integer portion of a number
342
+ ioctl :1, // - system-dependent device control system call
343
+ 'join' :1, // - join a list into a string using a separator
344
+ keys :1, // - retrieve list of indices from a hash
345
+ kill :1, // - send a signal to a process or process group
346
+ last :1, // - exit a block prematurely
347
+ lc :1, // - return lower-case version of a string
348
+ lcfirst :1, // - return a string with just the next letter in lower case
349
+ length :1, // - return the number of bytes in a string
350
+ 'link' :1, // - create a hard link in the filesytem
351
+ listen :1, // - register your socket as a server
352
+ local : 2, // - create a temporary value for a global variable (dynamic scoping)
353
+ localtime :1, // - convert UNIX time into record or string using local time
354
+ lock :1, // - get a thread lock on a variable, subroutine, or method
355
+ 'log' :1, // - retrieve the natural logarithm for a number
356
+ lstat :1, // - stat a symbolic link
357
+ m :null, // - match a string with a regular expression pattern
358
+ map :1, // - apply a change to a list to get back a new list with the changes
359
+ mkdir :1, // - create a directory
360
+ msgctl :1, // - SysV IPC message control operations
361
+ msgget :1, // - get SysV IPC message queue
362
+ msgrcv :1, // - receive a SysV IPC message from a message queue
363
+ msgsnd :1, // - send a SysV IPC message to a message queue
364
+ my : 2, // - declare and assign a local variable (lexical scoping)
365
+ 'new' :1, //
366
+ next :1, // - iterate a block prematurely
367
+ no :1, // - unimport some module symbols or semantics at compile time
368
+ oct :1, // - convert a string to an octal number
369
+ open :1, // - open a file, pipe, or descriptor
370
+ opendir :1, // - open a directory
371
+ ord :1, // - find a character's numeric representation
372
+ our : 2, // - declare and assign a package variable (lexical scoping)
373
+ pack :1, // - convert a list into a binary representation
374
+ 'package' :1, // - declare a separate global namespace
375
+ pipe :1, // - open a pair of connected filehandles
376
+ pop :1, // - remove the last element from an array and return it
377
+ pos :1, // - find or set the offset for the last/next m//g search
378
+ print :1, // - output a list to a filehandle
379
+ printf :1, // - output a formatted list to a filehandle
380
+ prototype :1, // - get the prototype (if any) of a subroutine
381
+ push :1, // - append one or more elements to an array
382
+ q :null, // - singly quote a string
383
+ qq :null, // - doubly quote a string
384
+ qr :null, // - Compile pattern
385
+ quotemeta :null, // - quote regular expression magic characters
386
+ qw :null, // - quote a list of words
387
+ qx :null, // - backquote quote a string
388
+ rand :1, // - retrieve the next pseudorandom number
389
+ read :1, // - fixed-length buffered input from a filehandle
390
+ readdir :1, // - get a directory from a directory handle
391
+ readline :1, // - fetch a record from a file
392
+ readlink :1, // - determine where a symbolic link is pointing
393
+ readpipe :1, // - execute a system command and collect standard output
394
+ recv :1, // - receive a message over a Socket
395
+ redo :1, // - start this loop iteration over again
396
+ ref :1, // - find out the type of thing being referenced
397
+ rename :1, // - change a filename
398
+ require :1, // - load in external functions from a library at runtime
399
+ reset :1, // - clear all variables of a given name
400
+ 'return' :1, // - get out of a function early
401
+ reverse :1, // - flip a string or a list
402
+ rewinddir :1, // - reset directory handle
403
+ rindex :1, // - right-to-left substring search
404
+ rmdir :1, // - remove a directory
405
+ s :null, // - replace a pattern with a string
406
+ say :1, // - print with newline
407
+ scalar :1, // - force a scalar context
408
+ seek :1, // - reposition file pointer for random-access I/O
409
+ seekdir :1, // - reposition directory pointer
410
+ select :1, // - reset default output or do I/O multiplexing
411
+ semctl :1, // - SysV semaphore control operations
412
+ semget :1, // - get set of SysV semaphores
413
+ semop :1, // - SysV semaphore operations
414
+ send :1, // - send a message over a socket
415
+ setgrent :1, // - prepare group file for use
416
+ sethostent :1, // - prepare hosts file for use
417
+ setnetent :1, // - prepare networks file for use
418
+ setpgrp :1, // - set the process group of a process
419
+ setpriority :1, // - set a process's nice value
420
+ setprotoent :1, // - prepare protocols file for use
421
+ setpwent :1, // - prepare passwd file for use
422
+ setservent :1, // - prepare services file for use
423
+ setsockopt :1, // - set some socket options
424
+ shift :1, // - remove the first element of an array, and return it
425
+ shmctl :1, // - SysV shared memory operations
426
+ shmget :1, // - get SysV shared memory segment identifier
427
+ shmread :1, // - read SysV shared memory
428
+ shmwrite :1, // - write SysV shared memory
429
+ shutdown :1, // - close down just half of a socket connection
430
+ 'sin' :1, // - return the sine of a number
431
+ sleep :1, // - block for some number of seconds
432
+ socket :1, // - create a socket
433
+ socketpair :1, // - create a pair of sockets
434
+ 'sort' :1, // - sort a list of values
435
+ splice :1, // - add or remove elements anywhere in an array
436
+ 'split' :1, // - split up a string using a regexp delimiter
437
+ sprintf :1, // - formatted print into a string
438
+ 'sqrt' :1, // - square root function
439
+ srand :1, // - seed the random number generator
440
+ stat :1, // - get a file's status information
441
+ state :1, // - declare and assign a state variable (persistent lexical scoping)
442
+ study :1, // - optimize input data for repeated searches
443
+ 'sub' :1, // - declare a subroutine, possibly anonymously
444
+ 'substr' :1, // - get or alter a portion of a stirng
445
+ symlink :1, // - create a symbolic link to a file
446
+ syscall :1, // - execute an arbitrary system call
447
+ sysopen :1, // - open a file, pipe, or descriptor
448
+ sysread :1, // - fixed-length unbuffered input from a filehandle
449
+ sysseek :1, // - position I/O pointer on handle used with sysread and syswrite
450
+ system :1, // - run a separate program
451
+ syswrite :1, // - fixed-length unbuffered output to a filehandle
452
+ tell :1, // - get current seekpointer on a filehandle
453
+ telldir :1, // - get current seekpointer on a directory handle
454
+ tie :1, // - bind a variable to an object class
455
+ tied :1, // - get a reference to the object underlying a tied variable
456
+ time :1, // - return number of seconds since 1970
457
+ times :1, // - return elapsed time for self and child processes
458
+ tr :null, // - transliterate a string
459
+ truncate :1, // - shorten a file
460
+ uc :1, // - return upper-case version of a string
461
+ ucfirst :1, // - return a string with just the next letter in upper case
462
+ umask :1, // - set file creation mode mask
463
+ undef :1, // - remove a variable or function definition
464
+ unlink :1, // - remove one link to a file
465
+ unpack :1, // - convert binary structure into normal perl variables
466
+ unshift :1, // - prepend more elements to the beginning of a list
467
+ untie :1, // - break a tie binding to a variable
468
+ use :1, // - load in a module at compile time
469
+ utime :1, // - set a file's last access and modify times
470
+ values :1, // - return a list of the values in a hash
471
+ vec :1, // - test or set particular bits in a string
472
+ wait :1, // - wait for any child process to die
473
+ waitpid :1, // - wait for a particular child process to die
474
+ wantarray :1, // - get void vs scalar vs list context of current subroutine call
475
+ warn :1, // - print debugging info
476
+ when :1, //
477
+ write :1, // - print a picture record
478
+ y :null}; // - transliterate a string
479
+
480
+ var RXstyle="string-2";
481
+ var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type
482
+
483
+ function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;)
484
+ state.chain=null; // 12 3tail
485
+ state.style=null;
486
+ state.tail=null;
487
+ state.tokenize=function(stream,state){
488
+ var e=false,c,i=0;
489
+ while(c=stream.next()){
490
+ if(c===chain[i]&&!e){
491
+ if(chain[++i]!==undefined){
492
+ state.chain=chain[i];
493
+ state.style=style;
494
+ state.tail=tail;}
495
+ else if(tail)
496
+ stream.eatWhile(tail);
497
+ state.tokenize=tokenPerl;
498
+ return style;}
499
+ e=!e&&c=="\\";}
500
+ return style;};
501
+ return state.tokenize(stream,state);}
502
+
503
+ function tokenSOMETHING(stream,state,string){
504
+ state.tokenize=function(stream,state){
505
+ if(stream.string==string)
506
+ state.tokenize=tokenPerl;
507
+ stream.skipToEnd();
508
+ return "string";};
509
+ return state.tokenize(stream,state);}
510
+
511
+ function tokenPerl(stream,state){
512
+ if(stream.eatSpace())
513
+ return null;
514
+ if(state.chain)
515
+ return tokenChain(stream,state,state.chain,state.style,state.tail);
516
+ if(stream.match(/^\-?[\d\.]/,false))
517
+ if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))
518
+ return 'number';
519
+ if(stream.match(/^<<(?=\w)/)){ // NOTE: <<SOMETHING\n...\nSOMETHING\n
520
+ stream.eatWhile(/\w/);
521
+ return tokenSOMETHING(stream,state,stream.current().substr(2));}
522
+ if(stream.sol()&&stream.match(/^\=item(?!\w)/)){// NOTE: \n=item...\n=cut\n
523
+ return tokenSOMETHING(stream,state,'=cut');}
524
+ var ch=stream.next();
525
+ if(ch=='"'||ch=="'"){ // NOTE: ' or " or <<'SOMETHING'\n...\nSOMETHING\n or <<"SOMETHING"\n...\nSOMETHING\n
526
+ if(prefix(stream, 3)=="<<"+ch){
527
+ var p=stream.pos;
528
+ stream.eatWhile(/\w/);
529
+ var n=stream.current().substr(1);
530
+ if(n&&stream.eat(ch))
531
+ return tokenSOMETHING(stream,state,n);
532
+ stream.pos=p;}
533
+ return tokenChain(stream,state,[ch],"string");}
534
+ if(ch=="q"){
535
+ var c=look(stream, -2);
536
+ if(!(c&&/\w/.test(c))){
537
+ c=look(stream, 0);
538
+ if(c=="x"){
539
+ c=look(stream, 1);
540
+ if(c=="("){
541
+ eatSuffix(stream, 2);
542
+ return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
543
+ if(c=="["){
544
+ eatSuffix(stream, 2);
545
+ return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
546
+ if(c=="{"){
547
+ eatSuffix(stream, 2);
548
+ return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
549
+ if(c=="<"){
550
+ eatSuffix(stream, 2);
551
+ return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}
552
+ if(/[\^'"!~\/]/.test(c)){
553
+ eatSuffix(stream, 1);
554
+ return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}
555
+ else if(c=="q"){
556
+ c=look(stream, 1);
557
+ if(c=="("){
558
+ eatSuffix(stream, 2);
559
+ return tokenChain(stream,state,[")"],"string");}
560
+ if(c=="["){
561
+ eatSuffix(stream, 2);
562
+ return tokenChain(stream,state,["]"],"string");}
563
+ if(c=="{"){
564
+ eatSuffix(stream, 2);
565
+ return tokenChain(stream,state,["}"],"string");}
566
+ if(c=="<"){
567
+ eatSuffix(stream, 2);
568
+ return tokenChain(stream,state,[">"],"string");}
569
+ if(/[\^'"!~\/]/.test(c)){
570
+ eatSuffix(stream, 1);
571
+ return tokenChain(stream,state,[stream.eat(c)],"string");}}
572
+ else if(c=="w"){
573
+ c=look(stream, 1);
574
+ if(c=="("){
575
+ eatSuffix(stream, 2);
576
+ return tokenChain(stream,state,[")"],"bracket");}
577
+ if(c=="["){
578
+ eatSuffix(stream, 2);
579
+ return tokenChain(stream,state,["]"],"bracket");}
580
+ if(c=="{"){
581
+ eatSuffix(stream, 2);
582
+ return tokenChain(stream,state,["}"],"bracket");}
583
+ if(c=="<"){
584
+ eatSuffix(stream, 2);
585
+ return tokenChain(stream,state,[">"],"bracket");}
586
+ if(/[\^'"!~\/]/.test(c)){
587
+ eatSuffix(stream, 1);
588
+ return tokenChain(stream,state,[stream.eat(c)],"bracket");}}
589
+ else if(c=="r"){
590
+ c=look(stream, 1);
591
+ if(c=="("){
592
+ eatSuffix(stream, 2);
593
+ return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
594
+ if(c=="["){
595
+ eatSuffix(stream, 2);
596
+ return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
597
+ if(c=="{"){
598
+ eatSuffix(stream, 2);
599
+ return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
600
+ if(c=="<"){
601
+ eatSuffix(stream, 2);
602
+ return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}
603
+ if(/[\^'"!~\/]/.test(c)){
604
+ eatSuffix(stream, 1);
605
+ return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}
606
+ else if(/[\^'"!~\/(\[{<]/.test(c)){
607
+ if(c=="("){
608
+ eatSuffix(stream, 1);
609
+ return tokenChain(stream,state,[")"],"string");}
610
+ if(c=="["){
611
+ eatSuffix(stream, 1);
612
+ return tokenChain(stream,state,["]"],"string");}
613
+ if(c=="{"){
614
+ eatSuffix(stream, 1);
615
+ return tokenChain(stream,state,["}"],"string");}
616
+ if(c=="<"){
617
+ eatSuffix(stream, 1);
618
+ return tokenChain(stream,state,[">"],"string");}
619
+ if(/[\^'"!~\/]/.test(c)){
620
+ return tokenChain(stream,state,[stream.eat(c)],"string");}}}}
621
+ if(ch=="m"){
622
+ var c=look(stream, -2);
623
+ if(!(c&&/\w/.test(c))){
624
+ c=stream.eat(/[(\[{<\^'"!~\/]/);
625
+ if(c){
626
+ if(/[\^'"!~\/]/.test(c)){
627
+ return tokenChain(stream,state,[c],RXstyle,RXmodifiers);}
628
+ if(c=="("){
629
+ return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
630
+ if(c=="["){
631
+ return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
632
+ if(c=="{"){
633
+ return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
634
+ if(c=="<"){
635
+ return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}}
636
+ if(ch=="s"){
637
+ var c=/[\/>\]})\w]/.test(look(stream, -2));
638
+ if(!c){
639
+ c=stream.eat(/[(\[{<\^'"!~\/]/);
640
+ if(c){
641
+ if(c=="[")
642
+ return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
643
+ if(c=="{")
644
+ return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
645
+ if(c=="<")
646
+ return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
647
+ if(c=="(")
648
+ return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
649
+ return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}
650
+ if(ch=="y"){
651
+ var c=/[\/>\]})\w]/.test(look(stream, -2));
652
+ if(!c){
653
+ c=stream.eat(/[(\[{<\^'"!~\/]/);
654
+ if(c){
655
+ if(c=="[")
656
+ return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
657
+ if(c=="{")
658
+ return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
659
+ if(c=="<")
660
+ return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
661
+ if(c=="(")
662
+ return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
663
+ return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}
664
+ if(ch=="t"){
665
+ var c=/[\/>\]})\w]/.test(look(stream, -2));
666
+ if(!c){
667
+ c=stream.eat("r");if(c){
668
+ c=stream.eat(/[(\[{<\^'"!~\/]/);
669
+ if(c){
670
+ if(c=="[")
671
+ return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
672
+ if(c=="{")
673
+ return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
674
+ if(c=="<")
675
+ return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
676
+ if(c=="(")
677
+ return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
678
+ return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}}
679
+ if(ch=="`"){
680
+ return tokenChain(stream,state,[ch],"variable-2");}
681
+ if(ch=="/"){
682
+ if(!/~\s*$/.test(prefix(stream)))
683
+ return "operator";
684
+ else
685
+ return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);}
686
+ if(ch=="$"){
687
+ var p=stream.pos;
688
+ if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}"))
689
+ return "variable-2";
690
+ else
691
+ stream.pos=p;}
692
+ if(/[$@%]/.test(ch)){
693
+ var p=stream.pos;
694
+ if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){
695
+ var c=stream.current();
696
+ if(PERL[c])
697
+ return "variable-2";}
698
+ stream.pos=p;}
699
+ if(/[$@%&]/.test(ch)){
700
+ if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){
701
+ var c=stream.current();
702
+ if(PERL[c])
703
+ return "variable-2";
704
+ else
705
+ return "variable";}}
706
+ if(ch=="#"){
707
+ if(look(stream, -2)!="$"){
708
+ stream.skipToEnd();
709
+ return "comment";}}
710
+ if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){
711
+ var p=stream.pos;
712
+ stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);
713
+ if(PERL[stream.current()])
714
+ return "operator";
715
+ else
716
+ stream.pos=p;}
717
+ if(ch=="_"){
718
+ if(stream.pos==1){
719
+ if(suffix(stream, 6)=="_END__"){
720
+ return tokenChain(stream,state,['\0'],"comment");}
721
+ else if(suffix(stream, 7)=="_DATA__"){
722
+ return tokenChain(stream,state,['\0'],"variable-2");}
723
+ else if(suffix(stream, 7)=="_C__"){
724
+ return tokenChain(stream,state,['\0'],"string");}}}
725
+ if(/\w/.test(ch)){
726
+ var p=stream.pos;
727
+ if(look(stream, -2)=="{"&&(look(stream, 0)=="}"||stream.eatWhile(/\w/)&&look(stream, 0)=="}"))
728
+ return "string";
729
+ else
730
+ stream.pos=p;}
731
+ if(/[A-Z]/.test(ch)){
732
+ var l=look(stream, -2);
733
+ var p=stream.pos;
734
+ stream.eatWhile(/[A-Z_]/);
735
+ if(/[\da-z]/.test(look(stream, 0))){
736
+ stream.pos=p;}
737
+ else{
738
+ var c=PERL[stream.current()];
739
+ if(!c)
740
+ return "meta";
741
+ if(c[1])
742
+ c=c[0];
743
+ if(l!=":"){
744
+ if(c==1)
745
+ return "keyword";
746
+ else if(c==2)
747
+ return "def";
748
+ else if(c==3)
749
+ return "atom";
750
+ else if(c==4)
751
+ return "operator";
752
+ else if(c==5)
753
+ return "variable-2";
754
+ else
755
+ return "meta";}
756
+ else
757
+ return "meta";}}
758
+ if(/[a-zA-Z_]/.test(ch)){
759
+ var l=look(stream, -2);
760
+ stream.eatWhile(/\w/);
761
+ var c=PERL[stream.current()];
762
+ if(!c)
763
+ return "meta";
764
+ if(c[1])
765
+ c=c[0];
766
+ if(l!=":"){
767
+ if(c==1)
768
+ return "keyword";
769
+ else if(c==2)
770
+ return "def";
771
+ else if(c==3)
772
+ return "atom";
773
+ else if(c==4)
774
+ return "operator";
775
+ else if(c==5)
776
+ return "variable-2";
777
+ else
778
+ return "meta";}
779
+ else
780
+ return "meta";}
781
+ return null;}
782
+
783
+ return {
784
+ startState: function() {
785
+ return {
786
+ tokenize: tokenPerl,
787
+ chain: null,
788
+ style: null,
789
+ tail: null
790
+ };
791
+ },
792
+ token: function(stream, state) {
793
+ return (state.tokenize || tokenPerl)(stream, state);
794
+ },
795
+ lineComment: '#'
796
+ };
797
+ });
798
+
799
+ CodeMirror.registerHelper("wordChars", "perl", /[\w$]/);
800
+
801
+ CodeMirror.defineMIME("text/x-perl", "perl");
802
+
803
+ // it's like "peek", but need for look-ahead or look-behind if index < 0
804
+ function look(stream, c){
805
+ return stream.string.charAt(stream.pos+(c||0));
806
+ }
807
+
808
+ // return a part of prefix of current stream from current position
809
+ function prefix(stream, c){
810
+ if(c){
811
+ var x=stream.pos-c;
812
+ return stream.string.substr((x>=0?x:0),c);}
813
+ else{
814
+ return stream.string.substr(0,stream.pos-1);
815
+ }
816
+ }
817
+
818
+ // return a part of suffix of current stream from current position
819
+ function suffix(stream, c){
820
+ var y=stream.string.length;
821
+ var x=y-stream.pos+1;
822
+ return stream.string.substr(stream.pos,(c&&c<y?c:x));
823
+ }
824
+
825
+ // eating and vomiting a part of stream from current position
826
+ function eatSuffix(stream, c){
827
+ var x=stream.pos+c;
828
+ var y;
829
+ if(x<=0)
830
+ stream.pos=0;
831
+ else if(x>=(y=stream.string.length-1))
832
+ stream.pos=y;
833
+ else
834
+ stream.pos=x;
835
+ }
836
+
837
+ });
assets/js/vendor/codemirror/mode/pig/index.html ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Pig Latin mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="pig.js"></script>
10
+ <style>.CodeMirror {border: 2px inset #dee;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Pig Latin</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Pig Latin mode</h2>
27
+ <form><textarea id="code" name="code">
28
+ -- Apache Pig (Pig Latin Language) Demo
29
+ /*
30
+ This is a multiline comment.
31
+ */
32
+ a = LOAD "\path\to\input" USING PigStorage('\t') AS (x:long, y:chararray, z:bytearray);
33
+ b = GROUP a BY (x,y,3+4);
34
+ c = FOREACH b GENERATE flatten(group) as (x,y), SUM(group.$2) as z;
35
+ STORE c INTO "\path\to\output";
36
+
37
+ --
38
+ </textarea></form>
39
+
40
+ <script>
41
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
42
+ lineNumbers: true,
43
+ indentUnit: 4,
44
+ mode: "text/x-pig"
45
+ });
46
+ </script>
47
+
48
+ <p>
49
+ Simple mode that handles Pig Latin language.
50
+ </p>
51
+
52
+ <p><strong>MIME type defined:</strong> <code>text/x-pig</code>
53
+ (PIG code)
54
+ </html>
55
+ </article>
assets/js/vendor/codemirror/mode/pig/pig.js ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /*
5
+ * Pig Latin Mode for CodeMirror 2
6
+ * @author Prasanth Jayachandran
7
+ * @link https://github.com/prasanthj/pig-codemirror-2
8
+ * This implementation is adapted from PL/SQL mode in CodeMirror 2.
9
+ */
10
+ (function(mod) {
11
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
12
+ mod(require("../../lib/codemirror"));
13
+ else if (typeof define == "function" && define.amd) // AMD
14
+ define(["../../lib/codemirror"], mod);
15
+ else // Plain browser env
16
+ mod(CodeMirror);
17
+ })(function(CodeMirror) {
18
+ "use strict";
19
+
20
+ CodeMirror.defineMode("pig", function(_config, parserConfig) {
21
+ var keywords = parserConfig.keywords,
22
+ builtins = parserConfig.builtins,
23
+ types = parserConfig.types,
24
+ multiLineStrings = parserConfig.multiLineStrings;
25
+
26
+ var isOperatorChar = /[*+\-%<>=&?:\/!|]/;
27
+
28
+ function chain(stream, state, f) {
29
+ state.tokenize = f;
30
+ return f(stream, state);
31
+ }
32
+
33
+ function tokenComment(stream, state) {
34
+ var isEnd = false;
35
+ var ch;
36
+ while(ch = stream.next()) {
37
+ if(ch == "/" && isEnd) {
38
+ state.tokenize = tokenBase;
39
+ break;
40
+ }
41
+ isEnd = (ch == "*");
42
+ }
43
+ return "comment";
44
+ }
45
+
46
+ function tokenString(quote) {
47
+ return function(stream, state) {
48
+ var escaped = false, next, end = false;
49
+ while((next = stream.next()) != null) {
50
+ if (next == quote && !escaped) {
51
+ end = true; break;
52
+ }
53
+ escaped = !escaped && next == "\\";
54
+ }
55
+ if (end || !(escaped || multiLineStrings))
56
+ state.tokenize = tokenBase;
57
+ return "error";
58
+ };
59
+ }
60
+
61
+
62
+ function tokenBase(stream, state) {
63
+ var ch = stream.next();
64
+
65
+ // is a start of string?
66
+ if (ch == '"' || ch == "'")
67
+ return chain(stream, state, tokenString(ch));
68
+ // is it one of the special chars
69
+ else if(/[\[\]{}\(\),;\.]/.test(ch))
70
+ return null;
71
+ // is it a number?
72
+ else if(/\d/.test(ch)) {
73
+ stream.eatWhile(/[\w\.]/);
74
+ return "number";
75
+ }
76
+ // multi line comment or operator
77
+ else if (ch == "/") {
78
+ if (stream.eat("*")) {
79
+ return chain(stream, state, tokenComment);
80
+ }
81
+ else {
82
+ stream.eatWhile(isOperatorChar);
83
+ return "operator";
84
+ }
85
+ }
86
+ // single line comment or operator
87
+ else if (ch=="-") {
88
+ if(stream.eat("-")){
89
+ stream.skipToEnd();
90
+ return "comment";
91
+ }
92
+ else {
93
+ stream.eatWhile(isOperatorChar);
94
+ return "operator";
95
+ }
96
+ }
97
+ // is it an operator
98
+ else if (isOperatorChar.test(ch)) {
99
+ stream.eatWhile(isOperatorChar);
100
+ return "operator";
101
+ }
102
+ else {
103
+ // get the while word
104
+ stream.eatWhile(/[\w\$_]/);
105
+ // is it one of the listed keywords?
106
+ if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) {
107
+ //keywords can be used as variables like flatten(group), group.$0 etc..
108
+ if (!stream.eat(")") && !stream.eat("."))
109
+ return "keyword";
110
+ }
111
+ // is it one of the builtin functions?
112
+ if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase()))
113
+ return "variable-2";
114
+ // is it one of the listed types?
115
+ if (types && types.propertyIsEnumerable(stream.current().toUpperCase()))
116
+ return "variable-3";
117
+ // default is a 'variable'
118
+ return "variable";
119
+ }
120
+ }
121
+
122
+ // Interface
123
+ return {
124
+ startState: function() {
125
+ return {
126
+ tokenize: tokenBase,
127
+ startOfLine: true
128
+ };
129
+ },
130
+
131
+ token: function(stream, state) {
132
+ if(stream.eatSpace()) return null;
133
+ var style = state.tokenize(stream, state);
134
+ return style;
135
+ }
136
+ };
137
+ });
138
+
139
+ (function() {
140
+ function keywords(str) {
141
+ var obj = {}, words = str.split(" ");
142
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
143
+ return obj;
144
+ }
145
+
146
+ // builtin funcs taken from trunk revision 1303237
147
+ var pBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL "
148
+ + "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS "
149
+ + "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG "
150
+ + "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN "
151
+ + "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER "
152
+ + "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS "
153
+ + "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA "
154
+ + "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE "
155
+ + "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG "
156
+ + "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER ";
157
+
158
+ // taken from QueryLexer.g
159
+ var pKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP "
160
+ + "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL "
161
+ + "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE "
162
+ + "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE "
163
+ + "NEQ MATCHES TRUE FALSE DUMP";
164
+
165
+ // data types
166
+ var pTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP ";
167
+
168
+ CodeMirror.defineMIME("text/x-pig", {
169
+ name: "pig",
170
+ builtins: keywords(pBuiltins),
171
+ keywords: keywords(pKeywords),
172
+ types: keywords(pTypes)
173
+ });
174
+
175
+ CodeMirror.registerHelper("hintWords", "pig", (pBuiltins + pTypes + pKeywords).split(" "));
176
+ }());
177
+
178
+ });
assets/js/vendor/codemirror/mode/properties/index.html ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Properties files mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="properties.js"></script>
10
+ <style>.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Properties files</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Properties files mode</h2>
27
+ <form><textarea id="code" name="code">
28
+ # This is a properties file
29
+ a.key = A value
30
+ another.key = http://example.com
31
+ ! Exclamation mark as comment
32
+ but.not=Within ! A value # indeed
33
+ # Spaces at the beginning of a line
34
+ spaces.before.key=value
35
+ backslash=Used for multi\
36
+ line entries,\
37
+ that's convenient.
38
+ # Unicode sequences
39
+ unicode.key=This is \u0020 Unicode
40
+ no.multiline=here
41
+ # Colons
42
+ colons : can be used too
43
+ # Spaces
44
+ spaces\ in\ keys=Not very common...
45
+ </textarea></form>
46
+ <script>
47
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
48
+ </script>
49
+
50
+ <p><strong>MIME types defined:</strong> <code>text/x-properties</code>,
51
+ <code>text/x-ini</code>.</p>
52
+
53
+ </article>
assets/js/vendor/codemirror/mode/properties/properties.js ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("properties", function() {
15
+ return {
16
+ token: function(stream, state) {
17
+ var sol = stream.sol() || state.afterSection;
18
+ var eol = stream.eol();
19
+
20
+ state.afterSection = false;
21
+
22
+ if (sol) {
23
+ if (state.nextMultiline) {
24
+ state.inMultiline = true;
25
+ state.nextMultiline = false;
26
+ } else {
27
+ state.position = "def";
28
+ }
29
+ }
30
+
31
+ if (eol && ! state.nextMultiline) {
32
+ state.inMultiline = false;
33
+ state.position = "def";
34
+ }
35
+
36
+ if (sol) {
37
+ while(stream.eatSpace());
38
+ }
39
+
40
+ var ch = stream.next();
41
+
42
+ if (sol && (ch === "#" || ch === "!" || ch === ";")) {
43
+ state.position = "comment";
44
+ stream.skipToEnd();
45
+ return "comment";
46
+ } else if (sol && ch === "[") {
47
+ state.afterSection = true;
48
+ stream.skipTo("]"); stream.eat("]");
49
+ return "header";
50
+ } else if (ch === "=" || ch === ":") {
51
+ state.position = "quote";
52
+ return null;
53
+ } else if (ch === "\\" && state.position === "quote") {
54
+ if (stream.eol()) { // end of line?
55
+ // Multiline value
56
+ state.nextMultiline = true;
57
+ }
58
+ }
59
+
60
+ return state.position;
61
+ },
62
+
63
+ startState: function() {
64
+ return {
65
+ position : "def", // Current position, "def", "quote" or "comment"
66
+ nextMultiline : false, // Is the next line multiline value
67
+ inMultiline : false, // Is the current line a multiline value
68
+ afterSection : false // Did we just open a section
69
+ };
70
+ }
71
+
72
+ };
73
+ });
74
+
75
+ CodeMirror.defineMIME("text/x-properties", "properties");
76
+ CodeMirror.defineMIME("text/x-ini", "properties");
77
+
78
+ });
assets/js/vendor/codemirror/mode/puppet/index.html ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Puppet mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="puppet.js"></script>
11
+ <style>
12
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
13
+ .cm-s-default span.cm-arrow { color: red; }
14
+ </style>
15
+ <div id=nav>
16
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
17
+
18
+ <ul>
19
+ <li><a href="../../index.html">Home</a>
20
+ <li><a href="../../doc/manual.html">Manual</a>
21
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
22
+ </ul>
23
+ <ul>
24
+ <li><a href="../index.html">Language modes</a>
25
+ <li><a class=active href="#">Puppet</a>
26
+ </ul>
27
+ </div>
28
+
29
+ <article>
30
+ <h2>Puppet mode</h2>
31
+ <form><textarea id="code" name="code">
32
+ # == Class: automysqlbackup
33
+ #
34
+ # Puppet module to install AutoMySQLBackup for periodic MySQL backups.
35
+ #
36
+ # class { 'automysqlbackup':
37
+ # backup_dir => '/mnt/backups',
38
+ # }
39
+ #
40
+
41
+ class automysqlbackup (
42
+ $bin_dir = $automysqlbackup::params::bin_dir,
43
+ $etc_dir = $automysqlbackup::params::etc_dir,
44
+ $backup_dir = $automysqlbackup::params::backup_dir,
45
+ $install_multicore = undef,
46
+ $config = {},
47
+ $config_defaults = {},
48
+ ) inherits automysqlbackup::params {
49
+
50
+ # Ensure valid paths are assigned
51
+ validate_absolute_path($bin_dir)
52
+ validate_absolute_path($etc_dir)
53
+ validate_absolute_path($backup_dir)
54
+
55
+ # Create a subdirectory in /etc for config files
56
+ file { $etc_dir:
57
+ ensure => directory,
58
+ owner => 'root',
59
+ group => 'root',
60
+ mode => '0750',
61
+ }
62
+
63
+ # Create an example backup file, useful for reference
64
+ file { "${etc_dir}/automysqlbackup.conf.example":
65
+ ensure => file,
66
+ owner => 'root',
67
+ group => 'root',
68
+ mode => '0660',
69
+ source => 'puppet:///modules/automysqlbackup/automysqlbackup.conf',
70
+ }
71
+
72
+ # Add files from the developer
73
+ file { "${etc_dir}/AMB_README":
74
+ ensure => file,
75
+ source => 'puppet:///modules/automysqlbackup/AMB_README',
76
+ }
77
+ file { "${etc_dir}/AMB_LICENSE":
78
+ ensure => file,
79
+ source => 'puppet:///modules/automysqlbackup/AMB_LICENSE',
80
+ }
81
+
82
+ # Install the actual binary file
83
+ file { "${bin_dir}/automysqlbackup":
84
+ ensure => file,
85
+ owner => 'root',
86
+ group => 'root',
87
+ mode => '0755',
88
+ source => 'puppet:///modules/automysqlbackup/automysqlbackup',
89
+ }
90
+
91
+ # Create the base backup directory
92
+ file { $backup_dir:
93
+ ensure => directory,
94
+ owner => 'root',
95
+ group => 'root',
96
+ mode => '0755',
97
+ }
98
+
99
+ # If you'd like to keep your config in hiera and pass it to this class
100
+ if !empty($config) {
101
+ create_resources('automysqlbackup::backup', $config, $config_defaults)
102
+ }
103
+
104
+ # If using RedHat family, must have the RPMforge repo's enabled
105
+ if $install_multicore {
106
+ package { ['pigz', 'pbzip2']: ensure => installed }
107
+ }
108
+
109
+ }
110
+ </textarea></form>
111
+ <script>
112
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
113
+ mode: "text/x-puppet",
114
+ matchBrackets: true,
115
+ indentUnit: 4
116
+ });
117
+ </script>
118
+
119
+ <p><strong>MIME types defined:</strong> <code>text/x-puppet</code>.</p>
120
+
121
+ </article>
assets/js/vendor/codemirror/mode/puppet/puppet.js ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("puppet", function () {
15
+ // Stores the words from the define method
16
+ var words = {};
17
+ // Taken, mostly, from the Puppet official variable standards regex
18
+ var variable_regex = /({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;
19
+
20
+ // Takes a string of words separated by spaces and adds them as
21
+ // keys with the value of the first argument 'style'
22
+ function define(style, string) {
23
+ var split = string.split(' ');
24
+ for (var i = 0; i < split.length; i++) {
25
+ words[split[i]] = style;
26
+ }
27
+ }
28
+
29
+ // Takes commonly known puppet types/words and classifies them to a style
30
+ define('keyword', 'class define site node include import inherits');
31
+ define('keyword', 'case if else in and elsif default or');
32
+ define('atom', 'false true running present absent file directory undef');
33
+ define('builtin', 'action augeas burst chain computer cron destination dport exec ' +
34
+ 'file filebucket group host icmp iniface interface jump k5login limit log_level ' +
35
+ 'log_prefix macauthorization mailalias maillist mcx mount nagios_command ' +
36
+ 'nagios_contact nagios_contactgroup nagios_host nagios_hostdependency ' +
37
+ 'nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service ' +
38
+ 'nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo ' +
39
+ 'nagios_servicegroup nagios_timeperiod name notify outiface package proto reject ' +
40
+ 'resources router schedule scheduled_task selboolean selmodule service source ' +
41
+ 'sport ssh_authorized_key sshkey stage state table tidy todest toports tosource ' +
42
+ 'user vlan yumrepo zfs zone zpool');
43
+
44
+ // After finding a start of a string ('|") this function attempts to find the end;
45
+ // If a variable is encountered along the way, we display it differently when it
46
+ // is encapsulated in a double-quoted string.
47
+ function tokenString(stream, state) {
48
+ var current, prev, found_var = false;
49
+ while (!stream.eol() && (current = stream.next()) != state.pending) {
50
+ if (current === '$' && prev != '\\' && state.pending == '"') {
51
+ found_var = true;
52
+ break;
53
+ }
54
+ prev = current;
55
+ }
56
+ if (found_var) {
57
+ stream.backUp(1);
58
+ }
59
+ if (current == state.pending) {
60
+ state.continueString = false;
61
+ } else {
62
+ state.continueString = true;
63
+ }
64
+ return "string";
65
+ }
66
+
67
+ // Main function
68
+ function tokenize(stream, state) {
69
+ // Matches one whole word
70
+ var word = stream.match(/[\w]+/, false);
71
+ // Matches attributes (i.e. ensure => present ; 'ensure' would be matched)
72
+ var attribute = stream.match(/(\s+)?\w+\s+=>.*/, false);
73
+ // Matches non-builtin resource declarations
74
+ // (i.e. "apache::vhost {" or "mycustomclasss {" would be matched)
75
+ var resource = stream.match(/(\s+)?[\w:_]+(\s+)?{/, false);
76
+ // Matches virtual and exported resources (i.e. @@user { ; and the like)
77
+ var special_resource = stream.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/, false);
78
+
79
+ // Finally advance the stream
80
+ var ch = stream.next();
81
+
82
+ // Have we found a variable?
83
+ if (ch === '$') {
84
+ if (stream.match(variable_regex)) {
85
+ // If so, and its in a string, assign it a different color
86
+ return state.continueString ? 'variable-2' : 'variable';
87
+ }
88
+ // Otherwise return an invalid variable
89
+ return "error";
90
+ }
91
+ // Should we still be looking for the end of a string?
92
+ if (state.continueString) {
93
+ // If so, go through the loop again
94
+ stream.backUp(1);
95
+ return tokenString(stream, state);
96
+ }
97
+ // Are we in a definition (class, node, define)?
98
+ if (state.inDefinition) {
99
+ // If so, return def (i.e. for 'class myclass {' ; 'myclass' would be matched)
100
+ if (stream.match(/(\s+)?[\w:_]+(\s+)?/)) {
101
+ return 'def';
102
+ }
103
+ // Match the rest it the next time around
104
+ stream.match(/\s+{/);
105
+ state.inDefinition = false;
106
+ }
107
+ // Are we in an 'include' statement?
108
+ if (state.inInclude) {
109
+ // Match and return the included class
110
+ stream.match(/(\s+)?\S+(\s+)?/);
111
+ state.inInclude = false;
112
+ return 'def';
113
+ }
114
+ // Do we just have a function on our hands?
115
+ // In 'ensure_resource("myclass")', 'ensure_resource' is matched
116
+ if (stream.match(/(\s+)?\w+\(/)) {
117
+ stream.backUp(1);
118
+ return 'def';
119
+ }
120
+ // Have we matched the prior attribute regex?
121
+ if (attribute) {
122
+ stream.match(/(\s+)?\w+/);
123
+ return 'tag';
124
+ }
125
+ // Do we have Puppet specific words?
126
+ if (word && words.hasOwnProperty(word)) {
127
+ // Negates the initial next()
128
+ stream.backUp(1);
129
+ // Acutally move the stream
130
+ stream.match(/[\w]+/);
131
+ // We want to process these words differently
132
+ // do to the importance they have in Puppet
133
+ if (stream.match(/\s+\S+\s+{/, false)) {
134
+ state.inDefinition = true;
135
+ }
136
+ if (word == 'include') {
137
+ state.inInclude = true;
138
+ }
139
+ // Returns their value as state in the prior define methods
140
+ return words[word];
141
+ }
142
+ // Is there a match on a reference?
143
+ if (/(^|\s+)[A-Z][\w:_]+/.test(word)) {
144
+ // Negate the next()
145
+ stream.backUp(1);
146
+ // Match the full reference
147
+ stream.match(/(^|\s+)[A-Z][\w:_]+/);
148
+ return 'def';
149
+ }
150
+ // Have we matched the prior resource regex?
151
+ if (resource) {
152
+ stream.match(/(\s+)?[\w:_]+/);
153
+ return 'def';
154
+ }
155
+ // Have we matched the prior special_resource regex?
156
+ if (special_resource) {
157
+ stream.match(/(\s+)?[@]{1,2}/);
158
+ return 'special';
159
+ }
160
+ // Match all the comments. All of them.
161
+ if (ch == "#") {
162
+ stream.skipToEnd();
163
+ return "comment";
164
+ }
165
+ // Have we found a string?
166
+ if (ch == "'" || ch == '"') {
167
+ // Store the type (single or double)
168
+ state.pending = ch;
169
+ // Perform the looping function to find the end
170
+ return tokenString(stream, state);
171
+ }
172
+ // Match all the brackets
173
+ if (ch == '{' || ch == '}') {
174
+ return 'bracket';
175
+ }
176
+ // Match characters that we are going to assume
177
+ // are trying to be regex
178
+ if (ch == '/') {
179
+ stream.match(/.*?\//);
180
+ return 'variable-3';
181
+ }
182
+ // Match all the numbers
183
+ if (ch.match(/[0-9]/)) {
184
+ stream.eatWhile(/[0-9]+/);
185
+ return 'number';
186
+ }
187
+ // Match the '=' and '=>' operators
188
+ if (ch == '=') {
189
+ if (stream.peek() == '>') {
190
+ stream.next();
191
+ }
192
+ return "operator";
193
+ }
194
+ // Keep advancing through all the rest
195
+ stream.eatWhile(/[\w-]/);
196
+ // Return a blank line for everything else
197
+ return null;
198
+ }
199
+ // Start it all
200
+ return {
201
+ startState: function () {
202
+ var state = {};
203
+ state.inDefinition = false;
204
+ state.inInclude = false;
205
+ state.continueString = false;
206
+ state.pending = false;
207
+ return state;
208
+ },
209
+ token: function (stream, state) {
210
+ // Strip the spaces, but regex will account for them eitherway
211
+ if (stream.eatSpace()) return null;
212
+ // Go through the main process
213
+ return tokenize(stream, state);
214
+ }
215
+ };
216
+ });
217
+
218
+ CodeMirror.defineMIME("text/x-puppet", "puppet");
219
+
220
+ });
assets/js/vendor/codemirror/mode/python/index.html ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Python mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="python.js"></script>
11
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
12
+ <div id=nav>
13
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
14
+
15
+ <ul>
16
+ <li><a href="../../index.html">Home</a>
17
+ <li><a href="../../doc/manual.html">Manual</a>
18
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
19
+ </ul>
20
+ <ul>
21
+ <li><a href="../index.html">Language modes</a>
22
+ <li><a class=active href="#">Python</a>
23
+ </ul>
24
+ </div>
25
+
26
+ <article>
27
+ <h2>Python mode</h2>
28
+
29
+ <div><textarea id="code" name="code">
30
+ # Literals
31
+ 1234
32
+ 0.0e101
33
+ .123
34
+ 0b01010011100
35
+ 0o01234567
36
+ 0x0987654321abcdef
37
+ 7
38
+ 2147483647
39
+ 3L
40
+ 79228162514264337593543950336L
41
+ 0x100000000L
42
+ 79228162514264337593543950336
43
+ 0xdeadbeef
44
+ 3.14j
45
+ 10.j
46
+ 10j
47
+ .001j
48
+ 1e100j
49
+ 3.14e-10j
50
+
51
+
52
+ # String Literals
53
+ 'For\''
54
+ "God\""
55
+ """so loved
56
+ the world"""
57
+ '''that he gave
58
+ his only begotten\' '''
59
+ 'that whosoever believeth \
60
+ in him'
61
+ ''
62
+
63
+ # Identifiers
64
+ __a__
65
+ a.b
66
+ a.b.c
67
+
68
+ #Unicode identifiers on Python3
69
+ # a = x\ddot
70
+ a⃗ = ẍ
71
+ # a = v\dot
72
+ a⃗ = v̇
73
+
74
+ #F\vec = m \cdot a\vec
75
+ F⃗ = m•a⃗
76
+
77
+ # Operators
78
+ + - * / % & | ^ ~ < >
79
+ == != <= >= <> << >> // **
80
+ and or not in is
81
+
82
+ #infix matrix multiplication operator (PEP 465)
83
+ A @ B
84
+
85
+ # Delimiters
86
+ () [] {} , : ` = ; @ . # Note that @ and . require the proper context on Python 2.
87
+ += -= *= /= %= &= |= ^=
88
+ //= >>= <<= **=
89
+
90
+ # Keywords
91
+ as assert break class continue def del elif else except
92
+ finally for from global if import lambda pass raise
93
+ return try while with yield
94
+
95
+ # Python 2 Keywords (otherwise Identifiers)
96
+ exec print
97
+
98
+ # Python 3 Keywords (otherwise Identifiers)
99
+ nonlocal
100
+
101
+ # Types
102
+ bool classmethod complex dict enumerate float frozenset int list object
103
+ property reversed set slice staticmethod str super tuple type
104
+
105
+ # Python 2 Types (otherwise Identifiers)
106
+ basestring buffer file long unicode xrange
107
+
108
+ # Python 3 Types (otherwise Identifiers)
109
+ bytearray bytes filter map memoryview open range zip
110
+
111
+ # Some Example code
112
+ import os
113
+ from package import ParentClass
114
+
115
+ @nonsenseDecorator
116
+ def doesNothing():
117
+ pass
118
+
119
+ class ExampleClass(ParentClass):
120
+ @staticmethod
121
+ def example(inputStr):
122
+ a = list(inputStr)
123
+ a.reverse()
124
+ return ''.join(a)
125
+
126
+ def __init__(self, mixin = 'Hello'):
127
+ self.mixin = mixin
128
+
129
+ </textarea></div>
130
+
131
+
132
+ <h2>Cython mode</h2>
133
+
134
+ <div><textarea id="code-cython" name="code-cython">
135
+
136
+ import numpy as np
137
+ cimport cython
138
+ from libc.math cimport sqrt
139
+
140
+ @cython.boundscheck(False)
141
+ @cython.wraparound(False)
142
+ def pairwise_cython(double[:, ::1] X):
143
+ cdef int M = X.shape[0]
144
+ cdef int N = X.shape[1]
145
+ cdef double tmp, d
146
+ cdef double[:, ::1] D = np.empty((M, M), dtype=np.float64)
147
+ for i in range(M):
148
+ for j in range(M):
149
+ d = 0.0
150
+ for k in range(N):
151
+ tmp = X[i, k] - X[j, k]
152
+ d += tmp * tmp
153
+ D[i, j] = sqrt(d)
154
+ return np.asarray(D)
155
+
156
+ </textarea></div>
157
+
158
+ <script>
159
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
160
+ mode: {name: "python",
161
+ version: 3,
162
+ singleLineStringErrors: false},
163
+ lineNumbers: true,
164
+ indentUnit: 4,
165
+ matchBrackets: true
166
+ });
167
+
168
+ CodeMirror.fromTextArea(document.getElementById("code-cython"), {
169
+ mode: {name: "text/x-cython",
170
+ version: 2,
171
+ singleLineStringErrors: false},
172
+ lineNumbers: true,
173
+ indentUnit: 4,
174
+ matchBrackets: true
175
+ });
176
+ </script>
177
+ <h2>Configuration Options for Python mode:</h2>
178
+ <ul>
179
+ <li>version - 2/3 - The version of Python to recognize. Default is 2.</li>
180
+ <li>singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.</li>
181
+ <li>hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.</li>
182
+ </ul>
183
+ <h2>Advanced Configuration Options:</h2>
184
+ <p>Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help</p>
185
+ <ul>
186
+ <li>singleOperators - RegEx - Regular Expression for single operator matching, default : <pre>^[\\+\\-\\*/%&amp;|\\^~&lt;&gt;!]</pre> including <pre>@</pre> on Python 3</li>
187
+ <li>singleDelimiters - RegEx - Regular Expression for single delimiter matching, default : <pre>^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]</pre></li>
188
+ <li>doubleOperators - RegEx - Regular Expression for double operators matching, default : <pre>^((==)|(!=)|(&lt;=)|(&gt;=)|(&lt;&gt;)|(&lt;&lt;)|(&gt;&gt;)|(//)|(\\*\\*))</pre></li>
189
+ <li>doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default : <pre>^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&amp;=)|(\\|=)|(\\^=))</pre></li>
190
+ <li>tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default : <pre>^((//=)|(&gt;&gt;=)|(&lt;&lt;=)|(\\*\\*=))</pre></li>
191
+ <li>identifiers - RegEx - Regular Expression for identifier, default : <pre>^[_A-Za-z][_A-Za-z0-9]*</pre> on Python 2 and <pre>^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*</pre> on Python 3.</li>
192
+ <li>extra_keywords - list of string - List of extra words ton consider as keywords</li>
193
+ <li>extra_builtins - list of string - List of extra words ton consider as builtins</li>
194
+ </ul>
195
+
196
+
197
+ <p><strong>MIME types defined:</strong> <code>text/x-python</code> and <code>text/x-cython</code>.</p>
198
+ </article>
assets/js/vendor/codemirror/mode/python/python.js ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ function wordRegexp(words) {
15
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
16
+ }
17
+
18
+ var wordOperators = wordRegexp(["and", "or", "not", "is"]);
19
+ var commonKeywords = ["as", "assert", "break", "class", "continue",
20
+ "def", "del", "elif", "else", "except", "finally",
21
+ "for", "from", "global", "if", "import",
22
+ "lambda", "pass", "raise", "return",
23
+ "try", "while", "with", "yield", "in"];
24
+ var commonBuiltins = ["abs", "all", "any", "bin", "bool", "bytearray", "callable", "chr",
25
+ "classmethod", "compile", "complex", "delattr", "dict", "dir", "divmod",
26
+ "enumerate", "eval", "filter", "float", "format", "frozenset",
27
+ "getattr", "globals", "hasattr", "hash", "help", "hex", "id",
28
+ "input", "int", "isinstance", "issubclass", "iter", "len",
29
+ "list", "locals", "map", "max", "memoryview", "min", "next",
30
+ "object", "oct", "open", "ord", "pow", "property", "range",
31
+ "repr", "reversed", "round", "set", "setattr", "slice",
32
+ "sorted", "staticmethod", "str", "sum", "super", "tuple",
33
+ "type", "vars", "zip", "__import__", "NotImplemented",
34
+ "Ellipsis", "__debug__"];
35
+ var py2 = {builtins: ["apply", "basestring", "buffer", "cmp", "coerce", "execfile",
36
+ "file", "intern", "long", "raw_input", "reduce", "reload",
37
+ "unichr", "unicode", "xrange", "False", "True", "None"],
38
+ keywords: ["exec", "print"]};
39
+ var py3 = {builtins: ["ascii", "bytes", "exec", "print"],
40
+ keywords: ["nonlocal", "False", "True", "None", "async", "await"]};
41
+
42
+ CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins));
43
+
44
+ function top(state) {
45
+ return state.scopes[state.scopes.length - 1];
46
+ }
47
+
48
+ CodeMirror.defineMode("python", function(conf, parserConf) {
49
+ var ERRORCLASS = "error";
50
+
51
+ var singleDelimiters = parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/;
52
+ var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/;
53
+ var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
54
+ var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/;
55
+
56
+ if (parserConf.version && parseInt(parserConf.version, 10) == 3){
57
+ // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
58
+ var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;
59
+ var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
60
+ } else {
61
+ var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/;
62
+ var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;
63
+ }
64
+
65
+ var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
66
+
67
+ var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
68
+ if(parserConf.extra_keywords != undefined){
69
+ myKeywords = myKeywords.concat(parserConf.extra_keywords);
70
+ }
71
+ if(parserConf.extra_builtins != undefined){
72
+ myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
73
+ }
74
+ if (parserConf.version && parseInt(parserConf.version, 10) == 3) {
75
+ myKeywords = myKeywords.concat(py3.keywords);
76
+ myBuiltins = myBuiltins.concat(py3.builtins);
77
+ var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i");
78
+ } else {
79
+ myKeywords = myKeywords.concat(py2.keywords);
80
+ myBuiltins = myBuiltins.concat(py2.builtins);
81
+ var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i");
82
+ }
83
+ var keywords = wordRegexp(myKeywords);
84
+ var builtins = wordRegexp(myBuiltins);
85
+
86
+ // tokenizers
87
+ function tokenBase(stream, state) {
88
+ // Handle scope changes
89
+ if (stream.sol() && top(state).type == "py") {
90
+ var scopeOffset = top(state).offset;
91
+ if (stream.eatSpace()) {
92
+ var lineOffset = stream.indentation();
93
+ if (lineOffset > scopeOffset)
94
+ pushScope(stream, state, "py");
95
+ else if (lineOffset < scopeOffset && dedent(stream, state))
96
+ state.errorToken = true;
97
+ return null;
98
+ } else {
99
+ var style = tokenBaseInner(stream, state);
100
+ if (scopeOffset > 0 && dedent(stream, state))
101
+ style += " " + ERRORCLASS;
102
+ return style;
103
+ }
104
+ }
105
+ return tokenBaseInner(stream, state);
106
+ }
107
+
108
+ function tokenBaseInner(stream, state) {
109
+ if (stream.eatSpace()) return null;
110
+
111
+ var ch = stream.peek();
112
+
113
+ // Handle Comments
114
+ if (ch == "#") {
115
+ stream.skipToEnd();
116
+ return "comment";
117
+ }
118
+
119
+ // Handle Number Literals
120
+ if (stream.match(/^[0-9\.]/, false)) {
121
+ var floatLiteral = false;
122
+ // Floats
123
+ if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; }
124
+ if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; }
125
+ if (stream.match(/^\.\d+/)) { floatLiteral = true; }
126
+ if (floatLiteral) {
127
+ // Float literals may be "imaginary"
128
+ stream.eat(/J/i);
129
+ return "number";
130
+ }
131
+ // Integers
132
+ var intLiteral = false;
133
+ // Hex
134
+ if (stream.match(/^0x[0-9a-f]+/i)) intLiteral = true;
135
+ // Binary
136
+ if (stream.match(/^0b[01]+/i)) intLiteral = true;
137
+ // Octal
138
+ if (stream.match(/^0o[0-7]+/i)) intLiteral = true;
139
+ // Decimal
140
+ if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
141
+ // Decimal literals may be "imaginary"
142
+ stream.eat(/J/i);
143
+ // TODO - Can you have imaginary longs?
144
+ intLiteral = true;
145
+ }
146
+ // Zero by itself with no other piece of number.
147
+ if (stream.match(/^0(?![\dx])/i)) intLiteral = true;
148
+ if (intLiteral) {
149
+ // Integer literals may be "long"
150
+ stream.eat(/L/i);
151
+ return "number";
152
+ }
153
+ }
154
+
155
+ // Handle Strings
156
+ if (stream.match(stringPrefixes)) {
157
+ state.tokenize = tokenStringFactory(stream.current());
158
+ return state.tokenize(stream, state);
159
+ }
160
+
161
+ // Handle operators and Delimiters
162
+ if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters))
163
+ return "punctuation";
164
+
165
+ if (stream.match(doubleOperators) || stream.match(singleOperators))
166
+ return "operator";
167
+
168
+ if (stream.match(singleDelimiters))
169
+ return "punctuation";
170
+
171
+ if (state.lastToken == "." && stream.match(identifiers))
172
+ return "property";
173
+
174
+ if (stream.match(keywords) || stream.match(wordOperators))
175
+ return "keyword";
176
+
177
+ if (stream.match(builtins))
178
+ return "builtin";
179
+
180
+ if (stream.match(/^(self|cls)\b/))
181
+ return "variable-2";
182
+
183
+ if (stream.match(identifiers)) {
184
+ if (state.lastToken == "def" || state.lastToken == "class")
185
+ return "def";
186
+ return "variable";
187
+ }
188
+
189
+ // Handle non-detected items
190
+ stream.next();
191
+ return ERRORCLASS;
192
+ }
193
+
194
+ function tokenStringFactory(delimiter) {
195
+ while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
196
+ delimiter = delimiter.substr(1);
197
+
198
+ var singleline = delimiter.length == 1;
199
+ var OUTCLASS = "string";
200
+
201
+ function tokenString(stream, state) {
202
+ while (!stream.eol()) {
203
+ stream.eatWhile(/[^'"\\]/);
204
+ if (stream.eat("\\")) {
205
+ stream.next();
206
+ if (singleline && stream.eol())
207
+ return OUTCLASS;
208
+ } else if (stream.match(delimiter)) {
209
+ state.tokenize = tokenBase;
210
+ return OUTCLASS;
211
+ } else {
212
+ stream.eat(/['"]/);
213
+ }
214
+ }
215
+ if (singleline) {
216
+ if (parserConf.singleLineStringErrors)
217
+ return ERRORCLASS;
218
+ else
219
+ state.tokenize = tokenBase;
220
+ }
221
+ return OUTCLASS;
222
+ }
223
+ tokenString.isString = true;
224
+ return tokenString;
225
+ }
226
+
227
+ function pushScope(stream, state, type) {
228
+ var offset = 0, align = null;
229
+ if (type == "py") {
230
+ while (top(state).type != "py")
231
+ state.scopes.pop();
232
+ }
233
+ offset = top(state).offset + (type == "py" ? conf.indentUnit : hangingIndent);
234
+ if (type != "py" && !stream.match(/^(\s|#.*)*$/, false))
235
+ align = stream.column() + 1;
236
+ state.scopes.push({offset: offset, type: type, align: align});
237
+ }
238
+
239
+ function dedent(stream, state) {
240
+ var indented = stream.indentation();
241
+ while (top(state).offset > indented) {
242
+ if (top(state).type != "py") return true;
243
+ state.scopes.pop();
244
+ }
245
+ return top(state).offset != indented;
246
+ }
247
+
248
+ function tokenLexer(stream, state) {
249
+ var style = state.tokenize(stream, state);
250
+ var current = stream.current();
251
+
252
+ // Handle decorators
253
+ if (current == "@"){
254
+ if(parserConf.version && parseInt(parserConf.version, 10) == 3){
255
+ return stream.match(identifiers, false) ? "meta" : "operator";
256
+ } else {
257
+ return stream.match(identifiers, false) ? "meta" : ERRORCLASS;
258
+ }
259
+ }
260
+
261
+ if ((style == "variable" || style == "builtin")
262
+ && state.lastToken == "meta")
263
+ style = "meta";
264
+
265
+ // Handle scope changes.
266
+ if (current == "pass" || current == "return")
267
+ state.dedent += 1;
268
+
269
+ if (current == "lambda") state.lambda = true;
270
+ if (current == ":" && !state.lambda && top(state).type == "py")
271
+ pushScope(stream, state, "py");
272
+
273
+ var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1;
274
+ if (delimiter_index != -1)
275
+ pushScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
276
+
277
+ delimiter_index = "])}".indexOf(current);
278
+ if (delimiter_index != -1) {
279
+ if (top(state).type == current) state.scopes.pop();
280
+ else return ERRORCLASS;
281
+ }
282
+ if (state.dedent > 0 && stream.eol() && top(state).type == "py") {
283
+ if (state.scopes.length > 1) state.scopes.pop();
284
+ state.dedent -= 1;
285
+ }
286
+
287
+ return style;
288
+ }
289
+
290
+ var external = {
291
+ startState: function(basecolumn) {
292
+ return {
293
+ tokenize: tokenBase,
294
+ scopes: [{offset: basecolumn || 0, type: "py", align: null}],
295
+ lastToken: null,
296
+ lambda: false,
297
+ dedent: 0
298
+ };
299
+ },
300
+
301
+ token: function(stream, state) {
302
+ var addErr = state.errorToken;
303
+ if (addErr) state.errorToken = false;
304
+ var style = tokenLexer(stream, state);
305
+
306
+ if (style && style != "comment")
307
+ state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style;
308
+ if (style == "punctuation") style = null;
309
+
310
+ if (stream.eol() && state.lambda)
311
+ state.lambda = false;
312
+ return addErr ? style + " " + ERRORCLASS : style;
313
+ },
314
+
315
+ indent: function(state, textAfter) {
316
+ if (state.tokenize != tokenBase)
317
+ return state.tokenize.isString ? CodeMirror.Pass : 0;
318
+
319
+ var scope = top(state);
320
+ var closing = textAfter && textAfter.charAt(0) == scope.type;
321
+ if (scope.align != null)
322
+ return scope.align - (closing ? 1 : 0);
323
+ else if (closing && state.scopes.length > 1)
324
+ return state.scopes[state.scopes.length - 2].offset;
325
+ else
326
+ return scope.offset;
327
+ },
328
+
329
+ closeBrackets: {triples: "'\""},
330
+ lineComment: "#",
331
+ fold: "indent"
332
+ };
333
+ return external;
334
+ });
335
+
336
+ CodeMirror.defineMIME("text/x-python", "python");
337
+
338
+ var words = function(str) { return str.split(" "); };
339
+
340
+ CodeMirror.defineMIME("text/x-cython", {
341
+ name: "python",
342
+ extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+
343
+ "extern gil include nogil property public"+
344
+