1
0

compress.html 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>CodeMirror: Compression Helper</title>
  5. <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
  6. <link rel="stylesheet" type="text/css" href="css/docs.css"/>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  8. </head>
  9. <body>
  10. <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>
  11. <pre class="grey">
  12. <img src="css/baboon.png" class="logo" alt="logo"/>/* Script compression
  13. helper */
  14. </pre>
  15. <p>To optimize loading CodeMirror, especially when including a
  16. bunch of different modes, it is recommended that you combine and
  17. minify (and preferably also gzip) the scripts. This page makes
  18. those first two steps very easy. Simply select the version and
  19. scripts you need in the form below, and
  20. click <strong>Compress</strong> to download the minified script
  21. file.</p>
  22. <form id="form" action="http://marijnhaverbeke.nl/uglifyjs" method="post">
  23. <input type="hidden" id="download" name="download" value="codemirror-compressed.js"/>
  24. <p>Version: <select id="version" onchange="setVersion(this);" style="padding: 1px">
  25. <option value="http://codemirror.net/">HEAD</option>
  26. <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.12;f=">2.12</option>
  27. <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.11;f=">2.11</option>
  28. <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.1;f=">2.1</option>
  29. <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.02;f=">2.02</option>
  30. <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.01;f=">2.01</option>
  31. <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.0;f=">2.0</option>
  32. <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=beta2;f=">beta2</option>
  33. <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=beta1;f=">beta1</option>
  34. </select></p>
  35. <select multiple="multiple" name="code_url" style="width: 40em;" class="field" id="files">
  36. <optgroup label="CodeMirror Library">
  37. <option value="http://codemirror.net/lib/codemirror.js" selected>codemirror.js</option>
  38. <option value="http://codemirror.net/lib/overlay.js">overlay.js</option>
  39. <option value="http://codemirror.net/lib/runmode.js">runmode.js</option>
  40. </optgroup>
  41. <optgroup label="Modes">
  42. <option value="http://codemirror.net/mode/javascript/javascript.js">javascript.js</option>
  43. <option value="http://codemirror.net/mode/xml/xml.js">xml.js</option>
  44. <option value="http://codemirror.net/mode/css/css.js">css.js</option>
  45. <option value="http://codemirror.net/mode/htmlmixed/htmlmixed.js">htmlmixed.js</option>
  46. <option value="http://codemirror.net/mode/clike/clike.js">clike.js</option>
  47. <option value="http://codemirror.net/mode/python/python.js">python.js</option>
  48. <option value="http://codemirror.net/mode/php/php.js">php.js</option>
  49. <option value="http://codemirror.net/mode/haskell/haskell.js">haskell.js</option>
  50. <option value="http://codemirror.net/mode/diff/diff.js">diff.js</option>
  51. <option value="http://codemirror.net/mode/stex/stex.js">stex.js</option>
  52. <option value="http://codemirror.net/mode/smalltalk/smalltalk.js">smalltalk.js</option>
  53. <option value="http://codemirror.net/mode/rst/rst.js">rst.js</option>
  54. <option value="http://codemirror.net/mode/plsql/plsql.js">plsql.js</option>
  55. <option value="http://codemirror.net/mode/lua/lua.js">lua.js</option>
  56. <option value="http://codemirror.net/mode/scheme/scheme.js">scheme.js</option>
  57. <option value="http://codemirror.net/mode/yaml/yaml.js">scheme.js</option>
  58. <option value="http://codemirror.net/mode/sparql/sparql.js">sparql.js</option>
  59. </optgroup>
  60. </select></p>
  61. <p>
  62. <button type="submit">Compress</button> with <a href="http://github.com/mishoo/UglifyJS/">UglifyJS</a>
  63. </p>
  64. <p>Custom code to add to the compressed file:<textarea name="js_code" style="width: 100%; height: 15em;" class="field"></textarea></p>
  65. </form>
  66. <script type="text/javascript">
  67. function setVersion(ver) {
  68. var urlprefix = ver.options[ver.selectedIndex].value;
  69. var select = document.getElementById("files"), m;
  70. for (var optgr = select.firstChild; optgr; optgr = optgr.nextSibling)
  71. for (var opt = optgr.firstChild; opt; opt = opt.nextSibling) {
  72. if (opt.nodeName != "OPTION")
  73. continue;
  74. else if (m = opt.value.match(/^http:\/\/codemirror.net\/2\/(.*)$/))
  75. opt.value = urlprefix + m[1];
  76. else if (m = opt.value.match(/http:\/\/marijnhaverbeke.nl\/git\/codemirror\?a=blob_plain;hb=[^;]+;f=(.*)$/))
  77. opt.value = urlprefix + m[1];
  78. }
  79. }
  80. </script>
  81. </body>
  82. </html>