2
0

compress.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>CodeMirror: Compression Helper</title>
  6. <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
  7. <link rel="stylesheet" type="text/css" href="docs.css"/>
  8. </head>
  9. <body>
  10. <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>
  11. <div class="grey">
  12. <img src="baboon.png" class="logo" alt="logo"/>
  13. <pre>
  14. /* Script compression
  15. helper */
  16. </pre>
  17. </div>
  18. <p>To optimize loading CodeMirror, especially when including a
  19. bunch of different modes, it is recommended that you combine and
  20. minify (and preferably also gzip) the scripts. This page makes
  21. those first two steps very easy. Simply select the version and
  22. scripts you need in the form below, and
  23. click <strong>Compress</strong> to download the minified script
  24. file.</p>
  25. <form id="form" action="http://marijnhaverbeke.nl/uglifyjs" method="post">
  26. <input type="hidden" id="download" name="download" value="codemirror-compressed.js"/>
  27. <p>Version: <select id="version" onchange="setVersion(this);" style="padding: 1px">
  28. <option value="http://codemirror.net/">HEAD</option>
  29. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=3.13.0;f=">3.13</option>
  30. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.12;f=">3.12</option>
  31. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.11;f=">3.11</option>
  32. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.1;f=">3.1</option>
  33. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.02;f=">3.02</option>
  34. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.01;f=">3.01</option>
  35. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.0;f=">3.0</option>
  36. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.38;f=">2.38</option>
  37. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.37;f=">2.37</option>
  38. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.36;f=">2.36</option>
  39. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.35;f=">2.35</option>
  40. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.34;f=">2.34</option>
  41. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.33;f=">2.33</option>
  42. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.32;f=">2.32</option>
  43. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.31;f=">2.31</option>
  44. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.3;f=">2.3</option>
  45. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.25;f=">2.25</option>
  46. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.24;f=">2.24</option>
  47. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.23;f=">2.23</option>
  48. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.22;f=">2.22</option>
  49. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.21;f=">2.21</option>
  50. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.2;f=">2.2</option>
  51. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.18;f=">2.18</option>
  52. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.16;f=">2.16</option>
  53. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.15;f=">2.15</option>
  54. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.13;f=">2.13</option>
  55. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.12;f=">2.12</option>
  56. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.11;f=">2.11</option>
  57. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.1;f=">2.1</option>
  58. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.02;f=">2.02</option>
  59. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.01;f=">2.01</option>
  60. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.0;f=">2.0</option>
  61. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=beta2;f=">beta2</option>
  62. <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=beta1;f=">beta1</option>
  63. </select></p>
  64. <select multiple="multiple" size="20" name="code_url" style="width: 40em;" class="field" id="files">
  65. <optgroup label="CodeMirror Library">
  66. <option value="http://codemirror.net/lib/codemirror.js" selected>codemirror.js</option>
  67. </optgroup>
  68. <optgroup label="Modes">
  69. <option value="http://codemirror.net/mode/apl/apl.js">apl.js</option>
  70. <option value="http://codemirror.net/mode/clike/clike.js">clike.js</option>
  71. <option value="http://codemirror.net/mode/clojure/clojure.js">clojure.js</option>
  72. <option value="http://codemirror.net/mode/cobol/cobol.js">cobol.js</option>
  73. <option value="http://codemirror.net/mode/coffeescript/coffeescript.js">coffeescript.js</option>
  74. <option value="http://codemirror.net/mode/commonlisp/commonlisp.js">commonlisp.js</option>
  75. <option value="http://codemirror.net/mode/css/css.js">css.js</option>
  76. <option value="http://codemirror.net/mode/d/d.js">d.js</option>
  77. <option value="http://codemirror.net/mode/diff/diff.js">diff.js</option>
  78. <option value="http://codemirror.net/mode/ecl/ecl.js">ecl.js</option>
  79. <option value="http://codemirror.net/mode/erlang/erlang.js">erlang.js</option>
  80. <option value="http://codemirror.net/mode/gfm/gfm.js">gfm.js</option>
  81. <option value="http://codemirror.net/mode/gas/gas.js">gas.js</option>
  82. <option value="http://codemirror.net/mode/go/go.js">go.js</option>
  83. <option value="http://codemirror.net/mode/groovy/groovy.js">groovy.js</option>
  84. <option value="http://codemirror.net/mode/haml/haml.js">haml.js</option>
  85. <option value="http://codemirror.net/mode/haskell/haskell.js">haskell.js</option>
  86. <option value="http://codemirror.net/mode/haxe/haxe.js">haxe.js</option>
  87. <option value="http://codemirror.net/mode/htmlembedded/htmlembedded.js">htmlembedded.js</option>
  88. <option value="http://codemirror.net/mode/htmlmixed/htmlmixed.js">htmlmixed.js</option>
  89. <option value="http://codemirror.net/mode/http/http.js">http.js</option>
  90. <option value="http://codemirror.net/mode/javascript/javascript.js">javascript.js</option>
  91. <option value="http://codemirror.net/mode/jinja2/jinja2.js">jinja2.js</option>
  92. <option value="http://codemirror.net/mode/less/less.js">less.js</option>
  93. <option value="http://codemirror.net/mode/livescript/livescript.js">livescript.js</option>
  94. <option value="http://codemirror.net/mode/lua/lua.js">lua.js</option>
  95. <option value="http://codemirror.net/mode/markdown/markdown.js">markdown.js</option>
  96. <option value="http://codemirror.net/mode/mirc/mirc.js">mirc.js</option>
  97. <option value="http://codemirror.net/mode/ntriples/ntriples.js">ntriples.js</option>
  98. <option value="http://codemirror.net/mode/ocaml/ocaml.js">ocaml.js</option>
  99. <option value="http://codemirror.net/mode/pascal/pascal.js">pascal.js</option>
  100. <option value="http://codemirror.net/mode/perl/perl.js">perl.js</option>
  101. <option value="http://codemirror.net/mode/php/php.js">php.js</option>
  102. <option value="http://codemirror.net/mode/pig/pig.js">pig.js</option>
  103. <option value="http://codemirror.net/mode/properties/properties.js">properties.js</option>
  104. <option value="http://codemirror.net/mode/python/python.js">python.js</option>
  105. <option value="http://codemirror.net/mode/q/q.js">q.js</option>
  106. <option value="http://codemirror.net/mode/r/r.js">r.js</option>
  107. <option value="http://codemirror.net/mode/rpm/changes/changes.js">rpm/changes.js</option>
  108. <option value="http://codemirror.net/mode/rpm/spec/spec.js">rpm/spec.js</option>
  109. <option value="http://codemirror.net/mode/rst/rst.js">rst.js</option>
  110. <option value="http://codemirror.net/mode/ruby/ruby.js">ruby.js</option>
  111. <option value="http://codemirror.net/mode/rust/rust.js">rust.js</option>
  112. <option value="http://codemirror.net/mode/sass/sass.js">sass.js</option>
  113. <option value="http://codemirror.net/mode/scala/scala.js">scala.js</option>
  114. <option value="http://codemirror.net/mode/scheme/scheme.js">scheme.js</option>
  115. <option value="http://codemirror.net/mode/shell/shell.js">shell.js</option>
  116. <option value="http://codemirror.net/mode/sieve/sieve.js">sieve.js</option>
  117. <option value="http://codemirror.net/mode/smalltalk/smalltalk.js">smalltalk.js</option>
  118. <option value="http://codemirror.net/mode/smarty/smarty.js">smarty.js</option>
  119. <option value="http://codemirror.net/mode/sql/sql.js">sql.js</option>
  120. <option value="http://codemirror.net/mode/sparql/sparql.js">sparql.js</option>
  121. <option value="http://codemirror.net/mode/stex/stex.js">stex.js</option>
  122. <option value="http://codemirror.net/mode/tcl/tcl.js">tcl.js</option>
  123. <option value="http://codemirror.net/mode/tiddlywiki/tiddlywiki.js">tiddlywiki.js</option>
  124. <option value="http://codemirror.net/mode/tiki/tiki.js">tiki.js</option>
  125. <option value="http://codemirror.net/mode/turtle/turtle.js">turtle.js</option>
  126. <option value="http://codemirror.net/mode/vb/vb.js">vb.js</option>
  127. <option value="http://codemirror.net/mode/vbscript/vbscript.js">vbscript.js</option>
  128. <option value="http://codemirror.net/mode/velocity/velocity.js">velocity.js</option>
  129. <option value="http://codemirror.net/mode/verilog/verilog.js">verilog.js</option>
  130. <option value="http://codemirror.net/mode/xml/xml.js">xml.js</option>
  131. <option value="http://codemirror.net/mode/xquery/xquery.js">xquery.js</option>
  132. <option value="http://codemirror.net/mode/yaml/yaml.js">yaml.js</option>
  133. <option value="http://codemirror.net/mode/z80/z80.js">z80.js</option>
  134. </optgroup>
  135. <optgroup label="Add-ons">
  136. <option value="http://codemirror.net/addon/dialog/dialog.js">dialog.js</option>
  137. <option value="http://codemirror.net/addon/edit/closetag.js">closetag.js</option>
  138. <option value="http://codemirror.net/addon/edit/continuecomment.js">continuecomment.js</option>
  139. <option value="http://codemirror.net/addon/edit/continuelist.js">continuelist.js</option>
  140. <option value="http://codemirror.net/addon/edit/matchbrackets.js">matchbrackets.js</option>
  141. <option value="http://codemirror.net/addon/edit/closebrackets.js">closebrackets.js</option>
  142. <option value="http://codemirror.net/addon/fold/foldcode.js">foldcode.js</option>
  143. <option value="http://codemirror.net/addon/fold/xml-fold.js">xml-fold.js</option>
  144. <option value="http://codemirror.net/addon/fold/brace-fold.js">brace-fold.js</option>
  145. <option value="http://codemirror.net/addon/fold/indent-fold.js">indent-fold.js</option>
  146. <option value="http://codemirror.net/addon/hint/show-hint.js">show-hint.js</option>
  147. <option value="http://codemirror.net/addon/hint/javascript-hint.js">javascript-hint.js</option>
  148. <option value="http://codemirror.net/addon/hint/xml-hint.js">xml-hint.js</option>
  149. <option value="http://codemirror.net/addon/hint/html-hint.js">html-hint.js</option>
  150. <option value="http://codemirror.net/addon/hint/pig-hint.js">pig-hint.js</option>
  151. <option value="http://codemirror.net/addon/hint/python-hint.js">python-hint.js</option>
  152. <option value="http://codemirror.net/addon/mode/loadmode.js">loadmode.js</option>
  153. <option value="http://codemirror.net/addon/mode/overlay.js">overlay.js</option>
  154. <option value="http://codemirror.net/addon/mode/multiplex.js">multiplex.js</option>
  155. <option value="http://codemirror.net/addon/runmode/colorize.js">colorize.js</option>
  156. <option value="http://codemirror.net/addon/runmode/runmode.js">runmode.js</option>
  157. <option value="http://codemirror.net/addon/runmode/runmode-standalone.js">runmode-standalone.js</option>
  158. <option value="http://codemirror.net/addon/runmode/runmode.node.js">runmode.node.js</option>
  159. <option value="http://codemirror.net/addon/search/search.js">search.js</option>
  160. <option value="http://codemirror.net/addon/search/searchcursor.js">searchcursor.js</option>
  161. <option value="http://codemirror.net/addon/search/match-highlighter.js">match-highlighter.js</option>
  162. <option value="http://codemirror.net/addon/selection/mark-selection.js">mark-selection.js</option>
  163. <option value="http://codemirror.net/addon/selection/active-line.js">active-line.js</option>
  164. <option value="http://codemirror.net/addon/lint/lint.js">lint.js</option>
  165. <option value="http://codemirror.net/addon/lint/javascript-lint.js">javascript-lint.js</option>
  166. <option value="http://codemirror.net/addon/lint/json-lint.js">json-lint.js</option>
  167. </optgroup>
  168. <optgroup label="Keymaps">
  169. <option value="http://codemirror.net/keymap/emacs.js">emacs.js</option>
  170. <option value="http://codemirror.net/keymap/vim.js">vim.js</option>
  171. </optgroup>
  172. </select>
  173. <p>
  174. <button type="submit">Compress</button> with <a href="http://github.com/mishoo/UglifyJS/">UglifyJS</a>
  175. </p>
  176. <p>Custom code to add to the compressed file:<textarea name="js_code" style="width: 100%; height: 15em;" class="field"></textarea></p>
  177. </form>
  178. <script type="text/javascript">
  179. function setVersion(ver) {
  180. var urlprefix = ver.options[ver.selectedIndex].value;
  181. var select = document.getElementById("files"), m;
  182. for (var optgr = select.firstChild; optgr; optgr = optgr.nextSibling)
  183. for (var opt = optgr.firstChild; opt; opt = opt.nextSibling) {
  184. if (opt.nodeName != "OPTION")
  185. continue;
  186. else if (m = opt.value.match(/^http:\/\/codemirror.net\/(.*)$/))
  187. opt.value = urlprefix + m[1];
  188. else if (m = opt.value.match(/http:\/\/marijnhaverbeke.nl\/git\/codemirror\?a=blob_plain;hb=[^;]+;f=(.*)$/))
  189. opt.value = urlprefix + m[1];
  190. }
  191. }
  192. </script>
  193. </body>
  194. </html>