diff options
Diffstat (limited to 'codemirror_ui/lib/CodeMirror-2.3/doc')
-rw-r--r-- | codemirror_ui/lib/CodeMirror-2.3/doc/baboon.png | bin | 0 -> 23299 bytes | |||
-rw-r--r-- | codemirror_ui/lib/CodeMirror-2.3/doc/baboon_vector.svg | 153 | ||||
-rw-r--r-- | codemirror_ui/lib/CodeMirror-2.3/doc/compress.html | 148 | ||||
-rw-r--r-- | codemirror_ui/lib/CodeMirror-2.3/doc/docs.css | 154 | ||||
-rw-r--r-- | codemirror_ui/lib/CodeMirror-2.3/doc/internals.html | 494 | ||||
-rw-r--r-- | codemirror_ui/lib/CodeMirror-2.3/doc/manual.html | 1128 | ||||
-rw-r--r-- | codemirror_ui/lib/CodeMirror-2.3/doc/oldrelease.html | 267 | ||||
-rw-r--r-- | codemirror_ui/lib/CodeMirror-2.3/doc/reporting.html | 57 | ||||
-rw-r--r-- | codemirror_ui/lib/CodeMirror-2.3/doc/upgrade_v2.2.html | 95 |
9 files changed, 2496 insertions, 0 deletions
diff --git a/codemirror_ui/lib/CodeMirror-2.3/doc/baboon.png b/codemirror_ui/lib/CodeMirror-2.3/doc/baboon.png Binary files differnew file mode 100644 index 0000000..55d97f7 --- /dev/null +++ b/codemirror_ui/lib/CodeMirror-2.3/doc/baboon.png diff --git a/codemirror_ui/lib/CodeMirror-2.3/doc/baboon_vector.svg b/codemirror_ui/lib/CodeMirror-2.3/doc/baboon_vector.svg new file mode 100644 index 0000000..dc1667a --- /dev/null +++ b/codemirror_ui/lib/CodeMirror-2.3/doc/baboon_vector.svg @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="svg3181" + version="1.1" + inkscape:version="0.48.0 r9654" + width="1750" + height="960" + xml:space="preserve" + sodipodi:docname="baboon_vector.svg"><metadata + id="metadata3187"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs3185"><clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath3195"><path + d="M 0,768 1400,768 1400,0 0,0 0,768 z" + id="path3197" /></clipPath><clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath3215"><path + d="M 0,768 1400,768 1400,0 0,0 0,768 z" + id="path3217" /></clipPath></defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1440" + inkscape:window-height="851" + id="namedview3183" + showgrid="false" + inkscape:zoom="0.20550291" + inkscape:cx="1534.1667" + inkscape:cy="795.78156" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="g3189" /><g + id="g3189" + inkscape:groupmode="layer" + inkscape:label="baboon_vector" + transform="matrix(1.25,0,0,-1.25,0,960)"><g + id="g3191"><g + id="g3193" + clip-path="url(#clipPath3195)"><g + id="g3199" + transform="translate(458.9561,569.9678)"><path + d="m 0,0 59.835,69.355 87.034,26.518 133.949,-7.479 c 0,0 74.116,-32.639 74.795,-34.678 0.68,-2.04 84.314,-59.155 84.314,-59.155 l 12.238,-74.795 5.439,-97.912 -13.598,-25.159 -4.76,-40.797 -18.358,-23.118 24.39,-5.561 0.501,-5.192 -14.012,-60.641 16.477,-93.368 7.223,-49.972 -208.295,-51.754 -18.552,4.005 -37.468,8.325 -10.036,4.036 -66.885,10.101 c 0,0 -14.959,74.793 -16.999,73.433 -2.039,-1.359 -42.836,56.437 -42.836,56.437 l -19.719,65.274 12.48,74.571 -7.961,9.643 -26.479,16.187 -12.716,38.309 4.08,48.277 8.769,38.985 L 6.608,-74.308 0,0 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3201" /></g><g + id="g3203" + transform="translate(78.8657,682.1582)"><path + d="M 0,0 142.789,40.797 259.74,52.355 313.457,-232.543 204.665,-291.698 78.194,-293.738 0,0 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3205" /></g><g + id="g3207" + transform="translate(269.5122,345.2344)"><path + d="M 0,0 18.801,-74.425 40.728,-85.408 59.539,-59.541 40.259,13.503 36.821,15.669 0,0 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3209" /></g></g></g><g + id="g3223" + transform="translate(741.918,109.0332)"><path + d="m 0,0 -17.236,-9.401 -16.452,-22.721 -0.783,12.537 6.268,17.234 13.317,6.268 L 0,7.833 14.884,3.917 0,0 z m 172.622,-21.824 c -0.031,0.271 -0.081,0.535 -0.117,0.804 -20.85,7.653 -49.59,7.327 -66.874,10.927 -13.849,2.886 -23.047,9.119 -27.032,12.298 -9.863,-8.494 -12.025,-14.377 -12.025,-14.377 0,0 -9.816,15.309 -30.17,25.76 -7.05,3.621 -17.767,5.691 -29.341,5.691 -24.297,0 -52.384,-9.155 -58.339,-32.223 -10.458,-40.511 9.697,-76.594 49.814,-77.623 1.325,-0.034 2.623,-0.12 3.894,-0.12 36.131,0 48.855,8.572 58.323,15.478 0.027,0.021 0.104,0 0.104,0 0,0 25.126,-11.506 53.529,-11.506 4.419,0 9.156,0.415 14.249,1.063 31.641,4.018 47.989,28.124 43.985,63.828" + style="fill:#df0019;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3225" + inkscape:connector-curvature="0" /></g><g + id="g3227" + transform="translate(300.8481,270.0254)"><path + d="m 0,0 c -3.063,-0.691 -12.535,0.784 -12.535,0.784 l 6.267,-25.853 43.481,13.319 -9.01,27.418 C 28.203,15.668 7.867,1.777 0,0" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3229" + inkscape:connector-curvature="0" /></g><g + id="g3231" + transform="translate(211.66052,615.85984)"><path + d="m 0,0 -16.243,-2.871 -15.462,-9.4 4.323,-10.938 14.568,9.89 L 2.75,-8.771 0,0 z" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3233" + inkscape:connector-curvature="0" /></g><g + id="g3235" + transform="translate(274.15732,626.4084)"><path + d="m 0,0 -15.64,0.407 -14.279,-3.608 2.008,-9.747 14.756,4.208 L 1.111,-8.215 0,0 z" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3237" + inkscape:connector-curvature="0" /></g><path + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="M 436.65625 22.28125 C 436.65625 22.28125 338.18375 25.385 251 42.8125 C 163.24875 60.35375 70.40625 99.65625 70.40625 99.65625 L 175.1875 495.28125 L 327.96875 492.34375 L 337.75 527.59375 C 337.75 527.59375 365.095 523.25875 373 518.78125 C 376.31375 516.90375 383.78125 508 383.78125 508 L 377.75 484.65625 L 504.21875 407.15625 L 436.65625 22.28125 z M 410.53125 55.1875 L 465.6875 393.3125 L 346.59375 456.625 L 202.75 466.46875 L 112 114.40625 L 263 79.1875 L 410.53125 55.1875 z " + transform="matrix(0.8,0,0,-0.8,0,768)" + id="path3253" /><g + id="g3247" + transform="matrix(1.199238,-0.02879331,0.02673084,1.0520756,172.41935,498.37339)"><path + d="m 0,0 c 0,0 -1.861,1.481 -9.143,-1.457 9.712,18.867 9.439,39.989 9.439,39.989 0,0 -3.106,-2.465 -11.311,-8.47 9.241,23.044 5.338,72.525 5.338,72.525 0,0 -17.493,40.746 -13.657,45.799 8.841,11.65 23.834,23.968 44.295,25.594 17.935,1.424 44.606,-4.953 55.865,-15.284 4.536,-4.161 23.367,-47.493 23.367,-47.493 0,0 6.104,-35.271 11.619,-54.108 5.513,-18.839 11.054,-26.674 21.284,-34.825 17.831,-14.207 27.076,-29.938 27.076,-29.938 L 143.399,3.945 c 3.655,-17.356 14.875,-34.28 27.39,-47.672 -12.863,1.507 -19.61,8.783 -19.61,8.783 0,0 2.151,-12.664 9.109,-26.554 l 28.712,15.264 -1.762,10.805 c -5.128,9.304 -9.336,15.534 -9.336,15.534 0,0 2.089,0.956 7.385,-3.572 l -2.005,12.296 c -4.814,9.391 -11.773,16.752 -25.115,31.113 5.944,-6.087 15.438,-5.379 20.751,-4.356 l -0.572,3.512 c -2.231,1.278 -5.494,3.171 -10.241,5.957 -12.43,7.299 -22.326,21.049 -22.326,21.049 0,0 12.85,1.815 20.513,11.022 -7.316,-2.641 -18.585,0.799 -18.585,0.799 -17.086,6.772 -15.022,30.217 -17.687,50.587 -2.667,20.37 -9.299,34.125 -9.299,34.125 0,0 -0.243,2.149 11.91,-5.906 -7.744,33.215 -35.545,44.94 -35.545,44.94 0,0 2.223,2.79 22.843,0.044 -16.469,15.817 -32.303,16.896 -32.303,16.896 0,0 10.077,2.25 23.611,0.24 0,0 -3.327,3.508 -7.549,6.453 L 35.985,194.291 -77.543,167.815 -8.211,-101.17 17.481,-99.413 C 8.602,-85.114 -0.371,-63.837 -2.15,-40.857 -4.911,-5.208 0,0 0,0" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3249" + inkscape:connector-curvature="0" /></g><g + id="g3255" + transform="translate(204.22134,580.88353)"><path + d="m 0,0 c 0,-1.418 0.43,-2.736 1.168,-3.83 1.523,0.677 3.551,1.094 5.786,1.094 2.164,0 4.133,-0.39 5.639,-1.029 0.711,1.081 1.129,2.374 1.129,3.765 0,3.79 -3.072,6.861 -6.861,6.861 C 3.071,6.861 0,3.79 0,0" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3257" + inkscape:connector-curvature="0" /></g><g + id="g3259" + transform="translate(256.3311,595.31646)"><path + d="m 0,0 c 0,-1.418 0.43,-2.736 1.168,-3.83 1.524,0.677 3.552,1.094 5.787,1.094 2.163,0 4.132,-0.39 5.638,-1.029 0.712,1.081 1.129,2.373 1.129,3.765 0,3.79 -3.072,6.861 -6.861,6.861 C 3.071,6.861 0,3.79 0,0" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3261" + inkscape:connector-curvature="0" /></g><g + id="g4174" + transform="matrix(0.99694509,0.07810563,-0.07810563,0.99694509,47.348748,-15.348299)"><g + transform="translate(222.5098,610.1558)" + id="g3219"><path + inkscape:connector-curvature="0" + id="path3221" + style="fill:#df0019;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="m 0,0 4.45,2.752 5.34,3.785 7.05,-8.226 7.093,-33.359 17.801,-51.259 13.86,-30.215 26.261,-1.55 -6.685,-35.653 c 0,0 -49.98,-21.871 -49.545,-21.911 -42.657,4.001 -12.553,43.066 -8.631,47.301 L 3.666,-47.869 0,0 z" /></g><g + transform="translate(247.626,467.3545)" + id="g3239"><path + inkscape:connector-curvature="0" + id="path3241" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="M 0,0 C -3.044,-0.345 -5.232,-3.092 -4.888,-6.136 -4.543,-9.18 1.576,-2.254 13.308,-4.961 13.971,-1.97 3.044,0.344 0,0" /></g><g + transform="translate(279.4419,476.5762)" + id="g3243"><path + inkscape:connector-curvature="0" + id="path3245" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="M 0,0 C 3.271,1.08 6.798,-0.697 7.88,-3.969 8.96,-7.24 -0.55,-3.044 -11.258,-11.329 -13.345,-8.586 -3.272,-1.081 0,0" /></g><g + transform="translate(284.1929,525.9082)" + id="g3263"><path + inkscape:connector-curvature="0" + id="path3265" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="M 0,0 C 0,0 -6.972,28.671 -6.972,29.355 L 1.585,2.864 9.999,-10.564 13.634,-32.697 7.922,-11.098 0,0 z M -0.633,-15.036 -9.19,-4.86 -16.478,25.776 c -0.202,0.684 9.106,-28.811 9.106,-28.811 l 8.64,-11.642 2.469,-17.336 -4.37,16.977 z m -6.339,-6.085 -10.457,16.826 -5.444,28.646 6.614,-27.842 11.311,-18.026 1.413,-9.583 -3.437,9.979 z m -53.462,-13.246 -1.437,24.944 -2.682,28.754 5.106,-29.895 1.212,-21.677 4.139,-18.236 -6.338,16.11 z m -4.265,-19.55 -6.665,15.516 0.404,29.205 -0.882,28.169 3.104,-28.396 0.808,-26.697 4.242,-15.972 2.423,-6.617 -3.434,4.792 z m -9.695,-2.967 -7.117,16.885 1.318,32.01 0,25.223 2.115,-25.061 -0.581,-31.259 5.869,-16.429 5.056,-8.671 -6.66,7.302 z m 103.144,-7.97 -6.676,20.38 2.141,11.54 L 16.499,-9.376 4.557,13.104 -5.879,53.97 c 0,0 -8.325,-7.41 -16.781,-8.08 -8.455,-0.671 -15.09,4.018 -15.09,4.018 0,0 3.592,-17.761 8.659,-37.597 5.069,-19.836 17.528,-44.866 17.528,-44.866 0,0 21.578,-8.197 24.302,-16.587 2.724,-8.391 -3.508,-22.911 -14.102,-26.551 -10.593,-3.64 -32.284,-8.262 -32.284,-8.262 0,0 -19,1.512 -20.438,14.26 0,0 4.131,16.406 10.418,19.225 6.285,2.819 21.362,11.174 21.362,11.174 l -8.254,1.332 -7.664,-1.332 c 0,0 -4.784,11.295 -10.973,35.086 -6.19,23.79 -8.967,42.485 -8.967,42.485 0,0 -3.912,-4.391 -14.199,-4.885 -10.286,-0.494 -16.031,7.988 -16.031,7.988 l 1.027,-30.185 -1.049,-25.83 -0.15,-29.22 5.102,-15.99 19.818,-30.448 c 0,0 14.102,-9.293 31.728,-9.293 16.453,1.328 51.131,18.047 51.131,18.047 l 9.536,16.687 z" /></g></g><g + id="g3267" + transform="translate(847.2637,321.5059)"><path + d="m 0,0 c 2.252,3.516 6.693,15.3 6.693,15.3 0,0 3.778,-13.306 1.912,-17.213 -3.056,-6.404 -23.905,-15.3 -23.905,-15.3 0,0 12.196,12.364 15.3,17.213 m -33.514,23.16 -0.757,56.352 c 0,0 11.136,-14.028 11.843,-19.739 1.176,-9.491 -11.086,-36.613 -11.086,-36.613 m -17.575,236.921 c 0,0 12.453,-15.338 14.854,-21.39 1.424,-3.591 2.286,-15.287 2.286,-15.287 l -17.14,36.677 z M -98.574,-86.136 c -9.757,-0.906 -29.836,1.016 -38.912,4.708 -7.499,3.05 -25.734,19.656 -25.734,19.656 l 24.187,-10.86 -4.701,17.627 15.272,-22.009 41.813,-5.356 c 0,0 -8.812,-3.477 -11.925,-3.766 m -74.428,157.941 c -4.518,10.057 -1.763,44.065 -1.763,44.065 0,0 7.544,-31.093 12.338,-40.541 6.978,-13.754 37.015,-49.352 37.015,-49.352 0,0 -40.824,30.759 -47.59,45.828 m -17.833,-149.47 -40.407,24.724 1.636,-17.575 0.026,-0.035 -5.178,-29.811 -2.056,-10.701 0.383,-33.34 -4.982,36.406 6.41,41.45 -11.063,8.338 -17.532,43.159 23.502,-38.779 2.351,14.101 40.634,-25.695 11.924,-5.651 13.809,-28.871 -19.457,22.28 z m -85.522,138.863 17.212,-34.424 c 0,0 -12.972,11.185 -15.299,16.257 -1.905,4.152 -1.913,18.167 -1.913,18.167 m -2.367,66.042 c 0,0 -6.206,15.581 -6.323,21.082 -0.168,7.817 4.568,23.148 7.695,30.315 0.755,1.73 4.103,6.341 4.103,6.341 0,0 -4.654,-24.542 -5.347,-32.829 -0.518,-6.205 -0.128,-24.909 -0.128,-24.909 m -7.195,-114.809 c -0.334,3.363 1.912,13.387 1.912,13.387 l 3.825,-29.643 c 0,0 -5.313,11.967 -5.737,16.256 m -20.082,53.549 c -1.394,3.571 -0.956,15.301 -0.956,15.301 l 13.388,-30.6 c 0,0 -10.639,10.71 -12.432,15.299 m -6.03,106.795 c 0,0 -0.315,35.831 4.637,46.379 4.531,9.647 29.936,30.356 29.936,30.356 0,0 -17.824,-22.47 -21.503,-31.2 -5.089,-12.077 -10.119,-51.437 -10.119,-51.437 l -2.951,5.902 z M 50.121,205.01 c 3.335,-9.155 1.168,-38.956 1.168,-38.956 0,0 -5.451,29.987 -9.221,39.366 -4.214,10.487 -23.014,38.907 -23.014,38.907 0,0 26.78,-27.546 31.067,-39.317 M 54.506,95.624 c 0,0 6.884,-18.586 5.738,-24.861 -0.773,-4.241 -9.562,-14.345 -9.562,-14.345 0,0 2.414,12.874 2.868,17.212 0.573,5.474 0.956,21.994 0.956,21.994 M 19.125,-13.389 c 0,0 9.656,22.183 11.062,30.068 1.235,6.941 0,28.203 0,28.203 0,0 8.477,-22.819 7.106,-30.538 C 35.845,6.183 19.125,-13.389 19.125,-13.389 m 441.487,-40.965 c -3.249,8.935 -6.587,17.23 -10.01,24.928 l -1.862,28.873 -8.857,-4.876 -25.862,49.457 -4.828,-10.34 c -32.69,31.48 -70.457,34.284 -111.982,31.646 -65.568,-4.163 -91.587,-41.63 -79.098,-57.241 12.49,-15.613 18.733,-5.205 40.589,5.203 21.858,10.407 74.937,26.017 110.323,-2.082 35.386,-28.1 86.383,-109.281 50.997,-169.646 -35.386,-60.365 -105.626,-105.385 -182.135,-88.465 -86.422,19.112 -126.078,60.082 -177.675,74.811 -8.311,1.334 -18.347,2.789 -24.791,3.191 -12.671,0.792 -21.6,14.727 -21.6,14.727 l 17.181,-9.327 25.763,-2.36 c 2.331,14 9.395,49.054 9.395,49.054 l -8.688,87.29 -18.668,-27.06 -7.246,10.184 -21.349,-22.915 -15.473,-1.959 14.67,6.596 21.38,29.409 6.7,-13.754 19.485,24.691 0.004,-0.011 16.47,9.525 -3.123,68.69 10.407,-10.407 -4.163,40.59 22.173,71.502 -34.662,91.899 16.652,-4.162 -19.773,35.386 -40.591,38.509 9.368,17.693 -93.671,9.368 -20.229,-7.165 -18.437,38.292 13.22,8.813 -69.039,14.69 2.938,19.095 -80.791,-23.303 -26.147,-19.191 -116.339,0 8.814,-10.188 -42.501,-40.641 -8.911,-78.491 7.344,-1.494 8.814,-45.548 23.502,-24.978 19.096,45.533 -14.689,-4.409 41.13,48.474 30.848,26.44 -14.69,-1.469 19.096,16.158 105.763,2.938 72.917,15.799 -41.623,-14.742 -30.181,-7.285 -104.079,-1.043 1.04,-11.449 -64.526,-61.403 14.571,2.081 -27.844,-63.28 c -15.017,-13.719 -28.06,-55.016 -36.687,-75.145 -9.367,-21.856 -20.816,-39.55 -20.816,-39.55 0,0 -30.182,-6.244 -61.405,-18.734 -31.224,-12.489 -43.713,4.163 -43.713,4.163 l -3.122,-8.326 c 0,0 -18.28,-9.057 -39.303,-11.825 -16.43,-2.162 -9.967,-20.946 -9.613,-26.684 0.405,-6.57 4.294,-19.774 8.325,-24.978 3.227,-4.165 12.525,-10.425 17.694,-11.448 12.039,-2.385 28.101,5.204 45.794,17.693 74.936,-6.245 103.241,-10.321 126.974,8.326 14.572,11.448 29.142,22.897 41.631,40.59 l -15.611,42.671 -8.327,-14.569 -5.807,44.931 1.841,17.863 5.547,-51.234 7.789,9.257 35.387,-70.772 11.448,4.164 c 0,0 13.515,-18.583 23.057,-32.881 l -26.02,25.006 -10.224,-5.964 -11.076,22.152 c 0,0 -13.383,-2.353 -24.727,-18.027 -15.862,-21.915 -23.503,-24.678 -17.627,-78.735 5.876,-54.055 16.452,-54.055 64.632,-121.039 11.752,-16.452 14.601,-18.465 14.601,-18.465 l -51.03,-27.365 -22.327,-5.876 -21.384,-11.28 c 0,0 4.744,-8.174 7.495,-9.369 4.739,-2.062 20.613,1.56 20.613,1.56 0,0 15.603,-6.763 36.756,-6.763 21.152,0 32.903,8.225 47.005,8.225 14.101,0 38.78,-8.225 57.582,-5.876 18.802,2.351 22.328,12.927 22.328,12.927 l -51.706,54.057 -4.675,47.096 -56.605,75.769 -3.038,9.437 65.791,-82.24 5.107,-46.75 55.161,-61.405 37.468,-8.325 c 0,0 -0.257,1.226 -0.625,3.114 -6.146,15.664 -6.986,34.894 -1.999,54.214 6.975,27.012 38.85,36.596 64.029,36.596 12.506,0 24.179,-2.312 32.025,-6.341 12.912,-6.63 21.851,-15.076 27.029,-20.917 3.673,4.516 7.133,7.194 11.833,11.11 0,0 12.143,-11.751 45.047,-14.101 27.14,-1.939 45.048,-8.226 70.901,-19.585 53.676,-23.584 102.5,-61.785 207.618,-45.132 105.119,16.651 206.073,113.444 164.442,227.929" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path3269" + inkscape:connector-curvature="0" /></g><path + inkscape:connector-curvature="0" + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="m 329.26398,723.3082 -118.025,-19.2 -120.800003,-28.175 72.600003,-281.65 115.075,7.875 95.275,50.65 -44.125,270.5 z m -6.55,-10.575 40.675,-252.4 -87.85,-47.275 -106.125,-7.325 -66.95,262.8 111.4,26.275 108.85,17.925 z" + id="path3253-3" /></g></svg>
\ No newline at end of file diff --git a/codemirror_ui/lib/CodeMirror-2.3/doc/compress.html b/codemirror_ui/lib/CodeMirror-2.3/doc/compress.html new file mode 100644 index 0000000..34c3434 --- /dev/null +++ b/codemirror_ui/lib/CodeMirror-2.3/doc/compress.html @@ -0,0 +1,148 @@ +<!doctype html> +<html> + <head> + <title>CodeMirror: Compression Helper</title> + <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> + <link rel="stylesheet" type="text/css" href="docs.css"/> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + </head> + <body> + +<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> + +<pre class="grey"> +<img src="baboon.png" class="logo" alt="logo"/>/* Script compression + helper */ +</pre> + + <p>To optimize loading CodeMirror, especially when including a + bunch of different modes, it is recommended that you combine and + minify (and preferably also gzip) the scripts. This page makes + those first two steps very easy. Simply select the version and + scripts you need in the form below, and + click <strong>Compress</strong> to download the minified script + file.</p> + + <form id="form" action="http://marijnhaverbeke.nl/uglifyjs" method="post"> + <input type="hidden" id="download" name="download" value="codemirror-compressed.js"/> + <p>Version: <select id="version" onchange="setVersion(this);" style="padding: 1px"> + <option value="http://codemirror.net/">HEAD</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.3;f=">2.3</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.25;f=">2.25</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.24;f=">2.24</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.23;f=">2.23</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.22;f=">2.22</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.21;f=">2.21</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.2;f=">2.2</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.18;f=">2.18</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.16;f=">2.16</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.15;f=">2.15</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.13;f=">2.13</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.12;f=">2.12</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.11;f=">2.11</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.1;f=">2.1</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.02;f=">2.02</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.01;f=">2.01</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.0;f=">2.0</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=beta2;f=">beta2</option> + <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=beta1;f=">beta1</option> + </select></p> + + <select multiple="multiple" size="20" name="code_url" style="width: 40em;" class="field" id="files"> + <optgroup label="CodeMirror Library"> + <option value="http://codemirror.net/lib/codemirror.js" selected>codemirror.js</option> + </optgroup> + <optgroup label="Modes"> + <option value="http://codemirror.net/mode/clike/clike.js">clike.js</option> + <option value="http://codemirror.net/mode/clojure/clojure.js">clojure.js</option> + <option value="http://codemirror.net/mode/coffeescript/coffeescript.js">coffeescript.js</option> + <option value="http://codemirror.net/mode/css/css.js">css.js</option> + <option value="http://codemirror.net/mode/diff/diff.js">diff.js</option> + <option value="http://codemirror.net/mode/ecl/ecl.js">ecl.js</option> + <option value="http://codemirror.net/mode/erlang/erlang.js">erlang.js</option> + <option value="http://codemirror.net/mode/gfm/gfm.js">gfm.js</option> + <option value="http://codemirror.net/mode/go/go.js">go.js</option> + <option value="http://codemirror.net/mode/groovy/groovy.js">groovy.js</option> + <option value="http://codemirror.net/mode/haskell/haskell.js">haskell.js</option> + <option value="http://codemirror.net/mode/htmlembedded/htmlembedded.js">htmlembedded.js</option> + <option value="http://codemirror.net/mode/htmlmixed/htmlmixed.js">htmlmixed.js</option> + <option value="http://codemirror.net/mode/javascript/javascript.js">javascript.js</option> + <option value="http://codemirror.net/mode/jinja2/jinja2.js">jinja2.js</option> + <option value="http://codemirror.net/mode/less/less.js">less.js</option> + <option value="http://codemirror.net/mode/lua/lua.js">lua.js</option> + <option value="http://codemirror.net/mode/markdown/markdown.js">markdown.js</option> + <option value="http://codemirror.net/mode/mysql/mysql.js">mysql.js</option> + <option value="http://codemirror.net/mode/ntriples/ntriples.js">ntriples.js</option> + <option value="http://codemirror.net/mode/pascal/pascal.js">pascal.js</option> + <option value="http://codemirror.net/mode/perl/perl.js">perl.js</option> + <option value="http://codemirror.net/mode/php/php.js">php.js</option> + <option value="http://codemirror.net/mode/pig/pig.js">pig.js</option> + <option value="http://codemirror.net/mode/plsql/plsql.js">plsql.js</option> + <option value="http://codemirror.net/mode/properties/properties.js">properties.js</option> + <option value="http://codemirror.net/mode/python/python.js">python.js</option> + <option value="http://codemirror.net/mode/r/r.js">r.js</option> + <option value="http://codemirror.net/mode/rpm/changes/changes.js">rpm/changes.js</option> + <option value="http://codemirror.net/mode/rpm/spec/spec.js">rpm/spec.js</option> + <option value="http://codemirror.net/mode/rst/rst.js">rst.js</option> + <option value="http://codemirror.net/mode/ruby/ruby.js">ruby.js</option> + <option value="http://codemirror.net/mode/rust/rust.js">rust.js</option> + <option value="http://codemirror.net/mode/scheme/scheme.js">scheme.js</option> + <option value="http://codemirror.net/mode/shell/shell.js">shell.js</option> + <option value="http://codemirror.net/mode/smalltalk/smalltalk.js">smalltalk.js</option> + <option value="http://codemirror.net/mode/smarty/smarty.js">smarty.js</option> + <option value="http://codemirror.net/mode/sparql/sparql.js">sparql.js</option> + <option value="http://codemirror.net/mode/stex/stex.js">stex.js</option> + <option value="http://codemirror.net/mode/tiddlywiki/tiddlywiki.js">tiddlywiki.js</option> + <option value="http://codemirror.net/mode/tiki/tiki.js">tiki.js</option> + <option value="http://codemirror.net/mode/vbscript/vbscript.js">vbscript.js</option> + <option value="http://codemirror.net/mode/velocity/velocity.js">velocity.js</option> + <option value="http://codemirror.net/mode/verilog/verilog.js">verilog.js</option> + <option value="http://codemirror.net/mode/xml/xml.js">xml.js</option> + <option value="http://codemirror.net/mode/xquery/xquery.js">xquery.js</option> + <option value="http://codemirror.net/mode/yaml/yaml.js">yaml.js</option> + </optgroup> + <optgroup label="Utilities and add-ons"> + <option value="http://codemirror.net/lib/util/overlay.js">overlay.js</option> + <option value="http://codemirror.net/lib/util/runmode.js">runmode.js</option> + <option value="http://codemirror.net/lib/util/simple-hint.js">simple-hint.js</option> + <option value="http://codemirror.net/lib/util/javascript-hint.js">javascript-hint.js</option> + <option value="http://codemirror.net/lib/util/foldcode.js">foldcode.js</option> + <option value="http://codemirror.net/lib/util/dialog.js">dialog.js</option> + <option value="http://codemirror.net/lib/util/search.js">search.js</option> + <option value="http://codemirror.net/lib/util/searchcursor.js">searchcursor.js</option> + <option value="http://codemirror.net/lib/util/formatting.js">formatting.js</option> + <option value="http://codemirror.net/lib/util/match-highlighter.js">match-highlighter.js</option> + <option value="http://codemirror.net/lib/util/closetag.js">closetag.js</option> + <option value="http://codemirror.net/lib/util/loadmode.js">loadmode.js</option> + </optgroup> + <optgroup label="Keymaps"> + <option value="http://codemirror.net/keymap/emacs.js">emacs.js</option> + <option value="http://codemirror.net/keymap/vim.js">vim.js</option> + </optgroup> + </select></p> + + <p> + <button type="submit">Compress</button> with <a href="http://github.com/mishoo/UglifyJS/">UglifyJS</a> + </p> + + <p>Custom code to add to the compressed file:<textarea name="js_code" style="width: 100%; height: 15em;" class="field"></textarea></p> + </form> + + <script type="text/javascript"> + function setVersion(ver) { + var urlprefix = ver.options[ver.selectedIndex].value; + var select = document.getElementById("files"), m; + for (var optgr = select.firstChild; optgr; optgr = optgr.nextSibling) + for (var opt = optgr.firstChild; opt; opt = opt.nextSibling) { + if (opt.nodeName != "OPTION") + continue; + else if (m = opt.value.match(/^http:\/\/codemirror.net\/(.*)$/)) + opt.value = urlprefix + m[1]; + else if (m = opt.value.match(/http:\/\/marijnhaverbeke.nl\/git\/codemirror2\?a=blob_plain;hb=[^;]+;f=(.*)$/)) + opt.value = urlprefix + m[1]; + } + } + </script> + + </body> +</html> diff --git a/codemirror_ui/lib/CodeMirror-2.3/doc/docs.css b/codemirror_ui/lib/CodeMirror-2.3/doc/docs.css new file mode 100644 index 0000000..9ea1866 --- /dev/null +++ b/codemirror_ui/lib/CodeMirror-2.3/doc/docs.css @@ -0,0 +1,154 @@ +body { + font-family: Droid Sans, Arial, sans-serif; + line-height: 1.5; + max-width: 64.3em; + margin: 3em auto; + padding: 0 1em; +} + +h1 { + letter-spacing: -3px; + font-size: 3.23em; + font-weight: bold; + margin: 0; +} + +h2 { + font-size: 1.23em; + font-weight: bold; + margin: .5em 0; + letter-spacing: -1px; +} + +h3 { + font-size: 1em; + font-weight: bold; + margin: .4em 0; +} + +pre { + background-color: #eee; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + padding: 1em; +} + +pre.code { + margin: 0 1em; +} + +.grey { + font-size: 2.2em; + padding: .5em 1em; + line-height: 1.2em; + margin-top: .5em; + position: relative; +} + +img.logo { + position: absolute; + right: -25px; + bottom: 4px; +} + +a:link, a:visited, .quasilink { + color: #df0019; + cursor: pointer; + text-decoration: none; +} + +a:hover, .quasilink:hover { + color: #800004; +} + +h1 a:link, h1 a:visited, h1 a:hover { + color: black; +} + +ul { + margin: 0; + padding-left: 1.2em; +} + +a.download { + color: white; + background-color: #df0019; + width: 100%; + display: block; + text-align: center; + font-size: 1.23em; + font-weight: bold; + text-decoration: none; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + padding: .5em 0; + margin-bottom: 1em; +} + +a.download:hover { + background-color: #bb0010; +} + +.rel { + margin-bottom: 0; +} + +.rel-note { + color: #777; + font-size: .9em; + margin-top: .1em; +} + +.logo-braces { + color: #df0019; + position: relative; + top: -4px; +} + +.blk { + float: left; +} + +.left { + width: 37em; + padding-right: 6.53em; + padding-bottom: 1em; +} + +.left1 { + width: 15.24em; + padding-right: 6.45em; +} + +.left2 { + width: 15.24em; +} + +.right { + width: 20.68em; +} + +.leftbig { + width: 42.44em; + padding-right: 6.53em; +} + +.rightsmall { + width: 15.24em; +} + +.clear:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; +} +.clear { display: inline-block; } +/* start commented backslash hack \*/ +* html .clear { height: 1%; } +.clear { display: block; } +/* close commented backslash hack */ diff --git a/codemirror_ui/lib/CodeMirror-2.3/doc/internals.html b/codemirror_ui/lib/CodeMirror-2.3/doc/internals.html new file mode 100644 index 0000000..338c9bb --- /dev/null +++ b/codemirror_ui/lib/CodeMirror-2.3/doc/internals.html @@ -0,0 +1,494 @@ +<!doctype html> +<html> + <head> + <title>CodeMirror: Internals</title> + <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> + <link rel="stylesheet" type="text/css" href="docs.css"/> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <style>dl dl {margin: 0;} .update {color: #d40 !important}</style> + </head> + <body> + +<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> + +<pre class="grey"> +<img src="baboon.png" class="logo" alt="logo"/>/* (Re-) Implementing A Syntax- + Highlighting Editor in JavaScript */ +</pre> + +<div class="clear"><div class="leftbig blk"> + +<p style="font-size: 85%" id="intro"> + <strong>Topic:</strong> JavaScript, code editor implementation<br> + <strong>Author:</strong> Marijn Haverbeke<br> + <strong>Date:</strong> March 2nd 2011 (updated November 13th 2011) +</p> + +<p>This is a followup to +my <a href="http://codemirror.net/story.html">Brutal Odyssey to the +Dark Side of the DOM Tree</a> story. That one describes the +mind-bending process of implementing (what would become) CodeMirror 1. +This one describes the internals of CodeMirror 2, a complete rewrite +and rethink of the old code base. I wanted to give this piece another +Hunter Thompson copycat subtitle, but somehow that would be out of +place—the process this time around was one of straightforward +engineering, requiring no serious mind-bending whatsoever.</p> + +<p>So, what is wrong with CodeMirror 1? I'd estimate, by mailing list +activity and general search-engine presence, that it has been +integrated into about a thousand systems by now. The most prominent +one, since a few weeks, +being <a href="http://googlecode.blogspot.com/2011/01/make-quick-fixes-quicker-on-google.html">Google +code's project hosting</a>. It works, and it's being used widely.</a> + +<p>Still, I did not start replacing it because I was bored. CodeMirror +1 was heavily reliant on <code>designMode</code> +or <code>contentEditable</code> (depending on the browser). Neither of +these are well specified (HTML5 tries +to <a href="http://www.w3.org/TR/html5/editing.html#contenteditable">specify</a> +their basics), and, more importantly, they tend to be one of the more +obscure and buggy areas of browser functionality—CodeMirror, by using +this functionality in a non-typical way, was constantly running up +against browser bugs. WebKit wouldn't show an empty line at the end of +the document, and in some releases would suddenly get unbearably slow. +Firefox would show the cursor in the wrong place. Internet Explorer +would insist on linkifying everything that looked like a URL or email +address, a behaviour that can't be turned off. Some bugs I managed to +work around (which was often a frustrating, painful process), others, +such as the Firefox cursor placement, I gave up on, and had to tell +user after user that they were known problems, but not something I +could help.</p> + +<p>Also, there is the fact that <code>designMode</code> (which seemed +to be less buggy than <code>contentEditable</code> in Webkit and +Firefox, and was thus used by CodeMirror 1 in those browsers) requires +a frame. Frames are another tricky area. It takes some effort to +prevent getting tripped up by domain restrictions, they don't +initialize synchronously, behave strangely in response to the back +button, and, on several browsers, can't be moved around the DOM +without having them re-initialize. They did provide a very nice way to +namespace the library, though—CodeMirror 1 could freely pollute the +namespace inside the frame.</p> + +<p>Finally, working with an editable document means working with +selection in arbitrary DOM structures. Internet Explorer (8 and +before) has an utterly different (and awkward) selection API than all +of the other browsers, and even among the different implementations of +<code>document.selection</code>, details about how exactly a selection +is represented vary quite a bit. Add to that the fact that Opera's +selection support tended to be very buggy until recently, and you can +imagine why CodeMirror 1 contains 700 lines of selection-handling +code.</p> + +<p>And that brings us to the main issue with the CodeMirror 1 +code base: The proportion of browser-bug-workarounds to real +application code was getting dangerously high. By building on top of a +few dodgy features, I put the system in a vulnerable position—any +incompatibility and bugginess in these features, I had to paper over +with my own code. Not only did I have to do some serious stunt-work to +get it to work on older browsers (as detailed in the +previous <a href="http://codemirror.net/story.html">story</a>), things +also kept breaking in newly released versions, requiring me to come up +with <em>new</em> scary hacks in order to keep up. This was starting +to lose its appeal.</p> + +<h2 id="approach">General Approach</h2> + +<p>What CodeMirror 2 does is try to sidestep most of the hairy hacks +that came up in version 1. I owe a lot to the +<a href="http://ace.ajax.org">ACE</a> editor for inspiration on how to +approach this.</p> + +<p>I absolutely did not want to be completely reliant on key events to +generate my input. Every JavaScript programmer knows that key event +information is horrible and incomplete. Some people (most awesomely +Mihai Bazon with <a href="http://ymacs.org">Ymacs</a>) have been able +to build more or less functioning editors by directly reading key +events, but it takes a lot of work (the kind of never-ending, fragile +work I described earlier), and will never be able to properly support +things like multi-keystoke international character +input. <a href="#keymap" class="update">[see below for caveat]</a></p> + +<p>So what I do is focus a hidden textarea, and let the browser +believe that the user is typing into that. What we show to the user is +a DOM structure we built to represent his document. If this is updated +quickly enough, and shows some kind of believable cursor, it feels +like a real text-input control.</p> + +<p>Another big win is that this DOM representation does not have to +span the whole document. Some CodeMirror 1 users insisted that they +needed to put a 30 thousand line XML document into CodeMirror. Putting +all that into the DOM takes a while, especially since, for some +reason, an editable DOM tree is slower than a normal one on most +browsers. If we have full control over what we show, we must only +ensure that the visible part of the document has been added, and can +do the rest only when needed. (Fortunately, the <code>onscroll</code> +event works almost the same on all browsers, and lends itself well to +displaying things only as they are scrolled into view.)</p> + +<h2 id="input">Input</h2> + +<p>ACE uses its hidden textarea only as a text input shim, and does +all cursor movement and things like text deletion itself by directly +handling key events. CodeMirror's way is to let the browser do its +thing as much as possible, and not, for example, define its own set of +key bindings. One way to do this would have been to have the whole +document inside the hidden textarea, and after each key event update +the display DOM to reflect what's in that textarea.</p> + +<p>That'd be simple, but it is not realistic. For even medium-sized +document the editor would be constantly munging huge strings, and get +terribly slow. What CodeMirror 2 does is put the current selection, +along with an extra line on the top and on the bottom, into the +textarea.</p> + +<p>This means that the arrow keys (and their ctrl-variations), home, +end, etcetera, do not have to be handled specially. We just read the +cursor position in the textarea, and update our cursor to match it. +Also, copy and paste work pretty much for free, and people get their +native key bindings, without any special work on my part. For example, +I have emacs key bindings configured for Chrome and Firefox. There is +no way for a script to detect this. <a class="update" +href="#keymap">[no longer the case]</a></p> + +<p>Of course, since only a small part of the document sits in the +textarea, keys like page up and ctrl-end won't do the right thing. +CodeMirror is catching those events and handling them itself.</p> + +<h2 id="selection">Selection</h2> + +<p>Getting and setting the selection range of a textarea in modern +browsers is trivial—you just use the <code>selectionStart</code> +and <code>selectionEnd</code> properties. On IE you have to do some +insane stuff with temporary ranges and compensating for the fact that +moving the selection by a 'character' will treat \r\n as a single +character, but even there it is possible to build functions that +reliably set and get the selection range.</p> + +<p>But consider this typical case: When I'm somewhere in my document, +press shift, and press the up arrow, something gets selected. Then, if +I, still holding shift, press the up arrow again, the top of my +selection is adjusted. The selection remembers where its <em>head</em> +and its <em>anchor</em> are, and moves the head when we shift-move. +This is a generally accepted property of selections, and done right by +every editing component built in the past twenty years.</p> + +<p>But not something that the browser selection APIs expose.</p> + +<p>Great. So when someone creates an 'upside-down' selection, the next +time CodeMirror has to update the textarea, it'll re-create the +selection as an 'upside-up' selection, with the anchor at the top, and +the next cursor motion will behave in an unexpected way—our second +up-arrow press in the example above will not do anything, since it is +interpreted in exactly the same way as the first.</p> + +<p>No problem. We'll just, ehm, detect that the selection is +upside-down (you can tell by the way it was created), and then, when +an upside-down selection is present, and a cursor-moving key is +pressed in combination with shift, we quickly collapse the selection +in the textarea to its start, allow the key to take effect, and then +combine its new head with its old anchor to get the <em>real</em> +selection.</p> + +<p>In short, scary hacks could not be avoided entirely in CodeMirror +2.</p> + +<p>And, the observant reader might ask, how do you even know that a +key combo is a cursor-moving combo, if you claim you support any +native key bindings? Well, we don't, but we can learn. The editor +keeps a set known cursor-movement combos (initialized to the +predictable defaults), and updates this set when it observes that +pressing a certain key had (only) the effect of moving the cursor. +This, of course, doesn't work if the first time the key is used was +for extending an inverted selection, but it works most of the +time.</p> + +<h2 id="update">Intelligent Updating</h2> + +<p>One thing that always comes up when you have a complicated internal +state that's reflected in some user-visible external representation +(in this case, the displayed code and the textarea's content) is +keeping the two in sync. The naive way is to just update the display +every time you change your state, but this is not only error prone +(you'll forget), it also easily leads to duplicate work on big, +composite operations. Then you start passing around flags indicating +whether the display should be updated in an attempt to be efficient +again and, well, at that point you might as well give up completely.</p> + +<p>I did go down that road, but then switched to a much simpler model: +simply keep track of all the things that have been changed during an +action, and then, only at the end, use this information to update the +user-visible display.</p> + +<p>CodeMirror uses a concept of <em>operations</em>, which start by +calling a specific set-up function that clears the state and end by +calling another function that reads this state and does the required +updating. Most event handlers, and all the user-visible methods that +change state are wrapped like this. There's a method +called <code>operation</code> that accepts a function, and returns +another function that wraps the given function as an operation.</p> + +<p>It's trivial to extend this (as CodeMirror does) to detect nesting, +and, when an operation is started inside an operation, simply +increment the nesting count, and only do the updating when this count +reaches zero again.</p> + +<p>If we have a set of changed ranges and know the currently shown +range, we can (with some awkward code to deal with the fact that +changes can add and remove lines, so we're dealing with a changing +coordinate system) construct a map of the ranges that were left +intact. We can then compare this map with the part of the document +that's currently visible (based on scroll offset and editor height) to +determine whether something needs to be updated.</p> + +<p>CodeMirror uses two update algorithms—a full refresh, where it just +discards the whole part of the DOM that contains the edited text and +rebuilds it, and a patch algorithm, where it uses the information +about changed and intact ranges to update only the out-of-date parts +of the DOM. When more than 30 percent (which is the current heuristic, +might change) of the lines need to be updated, the full refresh is +chosen (since it's faster to do than painstakingly finding and +updating all the changed lines), in the other case it does the +patching (so that, if you scroll a line or select another character, +the whole screen doesn't have to be +re-rendered). <span class="update">[the full-refresh +algorithm was dropped, it wasn't really faster than the patching +one]</span></p> + +<p>All updating uses <code>innerHTML</code> rather than direct DOM +manipulation, since that still seems to be by far the fastest way to +build documents. There's a per-line function that combines the +highlighting, <a href="manual.html#markText">marking</a>, and +selection info for that line into a snippet of HTML. The patch updater +uses this to reset individual lines, the refresh updater builds an +HTML chunk for the whole visible document at once, and then uses a +single <code>innerHTML</code> update to do the refresh.</p> + +<h2 id="parse">Parsers can be Simple</h2> + +<p>When I wrote CodeMirror 1, I +thought <a href="http://codemirror.net/story.html#parser">interruptable +parsers</a> were a hugely scary and complicated thing, and I used a +bunch of heavyweight abstractions to keep this supposed complexity +under control: parsers +were <a href="http://bob.pythonmac.org/archives/2005/07/06/iteration-in-javascript/">iterators</a> +that consumed input from another iterator, and used funny +closure-resetting tricks to copy and resume themselves.</p> + +<p>This made for a rather nice system, in that parsers formed strictly +separate modules, and could be composed in predictable ways. +Unfortunately, it was quite slow (stacking three or four iterators on +top of each other), and extremely intimidating to people not used to a +functional programming style.</p> + +<p>With a few small changes, however, we can keep all those +advantages, but simplify the API and make the whole thing less +indirect and inefficient. CodeMirror +2's <a href="manual.html#modeapi">mode API</a> uses explicit state +objects, and makes the parser/tokenizer a function that simply takes a +state and a character stream abstraction, advances the stream one +token, and returns the way the token should be styled. This state may +be copied, optionally in a mode-defined way, in order to be able to +continue a parse at a given point. Even someone who's never touched a +lambda in his life can understand this approach. Additionally, far +fewer objects are allocated in the course of parsing now.</p> + +<p>The biggest speedup comes from the fact that the parsing no longer +has to touch the DOM though. In CodeMirror 1, on an older browser, you +could <em>see</em> the parser work its way through the document, +managing some twenty lines in each 50-millisecond time slice it got. It +was reading its input from the DOM, and updating the DOM as it went +along, which any experienced JavaScript programmer will immediately +spot as a recipe for slowness. In CodeMirror 2, the parser usually +finishes the whole document in a single 100-millisecond time slice—it +manages some 1500 lines during that time on Chrome. All it has to do +is munge strings, so there is no real reason for it to be slow +anymore.</p> + +<h2 id="summary">What Gives?</h2> + +<p>Given all this, what can you expect from CodeMirror 2?</p> + +<ul> + +<li><strong>Small.</strong> the base library is +some <span class="update">45k</span> when minified +now, <span class="update">17k</span> when gzipped. It's smaller than +its own logo.</li> + +<li><strong>Lightweight.</strong> CodeMirror 2 initializes very +quickly, and does almost no work when it is not focused. This means +you can treat it almost like a textarea, have multiple instances on a +page without trouble.</li> + +<li><strong>Huge document support.</strong> Since highlighting is +really fast, and no DOM structure is being built for non-visible +content, you don't have to worry about locking up your browser when a +user enters a megabyte-sized document.</li> + +<li><strong>Extended API.</strong> Some things kept coming up in the +mailing list, such as marking pieces of text or lines, which were +extremely hard to do with CodeMirror 1. The new version has proper +support for these built in.</li> + +<li><strong>Tab support.</strong> Tabs inside editable documents were, +for some reason, a no-go. At least six different people announced they +were going to add tab support to CodeMirror 1, none survived (I mean, +none delivered a working version). CodeMirror 2 no longer removes tabs +from your document.</li> + +<li><strong>Sane styling.</strong> <code>iframe</code> nodes aren't +really known for respecting document flow. Now that an editor instance +is a plain <code>div</code> element, it is much easier to size it to +fit the surrounding elements. You don't even have to make it scroll if +you do not <a href="../demo/resize.html">want to</a>.</li> + +</ul> + +<p>On the downside, a CodeMirror 2 instance is <em>not</em> a native +editable component. Though it does its best to emulate such a +component as much as possible, there is functionality that browsers +just do not allow us to hook into. Doing select-all from the context +menu, for example, is not currently detected by CodeMirror.</p> + +<p id="changes" style="margin-top: 2em;"><span style="font-weight: +bold">[Updates from November 13th 2011]</span> Recently, I've made +some changes to the codebase that cause some of the text above to no +longer be current. I've left the text intact, but added markers at the +passages that are now inaccurate. The new situation is described +below.</p> + +<h2 id="btree">Content Representation</h2> + +<p>The original implementation of CodeMirror 2 represented the +document as a flat array of line objects. This worked well—splicing +arrays will require the part of the array after the splice to be +moved, but this is basically just a simple <code>memmove</code> of a +bunch of pointers, so it is cheap even for huge documents.</p> + +<p>However, I recently added line wrapping and code folding (line +collapsing, basically). Once lines start taking up a non-constant +amount of vertical space, looking up a line by vertical position +(which is needed when someone clicks the document, and to determine +the visible part of the document during scrolling) can only be done +with a linear scan through the whole array, summing up line heights as +you go. Seeing how I've been going out of my way to make big documents +fast, this is not acceptable.</p> + +<p>The new representation is based on a B-tree. The leaves of the tree +contain arrays of line objects, with a fixed minimum and maximum size, +and the non-leaf nodes simply hold arrays of child nodes. Each node +stores both the amount of lines that live below them and the vertical +space taken up by these lines. This allows the tree to be indexed both +by line number and by vertical position, and all access has +logarithmic complexity in relation to the document size.</p> + +<p>I gave line objects and tree nodes parent pointers, to the node +above them. When a line has to update its height, it can simply walk +these pointers to the top of the tree, adding or subtracting the +difference in height from each node it encounters. The parent pointers +also make it cheaper (in complexity terms, the difference is probably +tiny in normal-sized documents) to find the current line number when +given a line object. In the old approach, the whole document array had +to be searched. Now, we can just walk up the tree and count the sizes +of the nodes coming before us at each level.</p> + +<p>I chose B-trees, not regular binary trees, mostly because they +allow for very fast bulk insertions and deletions. When there is a big +change to a document, it typically involves adding, deleting, or +replacing a chunk of subsequent lines. In a regular balanced tree, all +these inserts or deletes would have to be done separately, which could +be really expensive. In a B-tree, to insert a chunk, you just walk +down the tree once to find where it should go, insert them all in one +shot, and then break up the node if needed. This breaking up might +involve breaking up nodes further up, but only requires a single pass +back up the tree. For deletion, I'm somewhat lax in keeping things +balanced—I just collapse nodes into a leaf when their child count goes +below a given number. This means that there are some weird editing +patterns that may result in a seriously unbalanced tree, but even such +an unbalanced tree will perform well, unless you spend a day making +strangely repeating edits to a really big document.</p> + +<h2 id="keymap">Keymaps</h2> + +<p><a href="#approach">Above</a>, I claimed that directly catching key +events for things like cursor movement is impractical because it +requires some browser-specific kludges. I then proceeded to explain +some awful <a href="#selection">hacks</a> that were needed to make it +possible for the selection changes to be detected through the +textarea. In fact, the second hack is about as bad as the first.</p> + +<p>On top of that, in the presence of user-configurable tab sizes and +collapsed and wrapped lines, lining up cursor movement in the textarea +with what's visible on the screen becomes a nightmare. Thus, I've +decided to move to a model where the textarea's selection is no longer +depended on.</p> + +<p>So I moved to a model where all cursor movement is handled by my +own code. This adds support for a goal column, proper interaction of +cursor movement with collapsed lines, and makes it possible for +vertical movement to move through wrapped lines properly, instead of +just treating them like non-wrapped lines.</p> + +<p>The key event handlers now translate the key event into a string, +something like <code>Ctrl-Home</code> or <code>Shift-Cmd-R</code>, and +use that string to look up an action to perform. To make keybinding +customizable, this lookup goes through +a <a href="manual.html#option_keyMap">table</a>, using a scheme that +allows such tables to be chained together (for example, the default +Mac bindings fall through to a table named 'emacsy', which defines +basic Emacs-style bindings like <code>Ctrl-F</code>, and which is also +used by the custom Emacs bindings).</p> + +<p>A new +option <a href="manual.html#option_extraKeys"><code>extraKeys</code></a> +allows ad-hoc keybindings to be defined in a much nicer way than what +was possible with the +old <a href="manual.html#option_onKeyEvent"><code>onKeyEvent</code></a> +callback. You simply provide an object mapping key identifiers to +functions, instead of painstakingly looking at raw key events.</p> + +<p>Built-in commands map to strings, rather than functions, for +example <code>"goLineUp"</code> is the default action bound to the up +arrow key. This allows new keymaps to refer to them without +duplicating any code. New commands can be defined by assigning to +the <code>CodeMirror.commands</code> object, which maps such commands +to functions.</p> + +<p>The hidden textarea now only holds the current selection, with no +extra characters around it. This has a nice advantage: polling for +input becomes much, much faster. If there's a big selection, this text +does not have to be read from the textarea every time—when we poll, +just noticing that something is still selected is enough to tell us +that no new text was typed.</p> + +<p>The reason that cheap polling is important is that many browsers do +not fire useful events on IME (input method engine) input, which is +the thing where people inputting a language like Japanese or Chinese +use multiple keystrokes to create a character or sequence of +characters. Most modern browsers fire <code>input</code> when the +composing is finished, but many don't fire anything when the character +is updated <em>during</em> composition. So we poll, whenever the +editor is focused, to provide immediate updates of the display.</p> + +</div><div class="rightsmall blk"> + + <h2>Contents</h2> + + <ul> + <li><a href="#intro">Introduction</a></li> + <li><a href="#approach">General Approach</a></li> + <li><a href="#input">Input</a></li> + <li><a href="#selection">Selection</a></li> + <li><a href="#update">Intelligent Updating</a></li> + <li><a href="#parse">Parsing</a></li> + <li><a href="#summary">What Gives?</a></li> + <li><a href="#btree">Content Representation</a></li> + <li><a href="#keymap">Key Maps</a></li> + </ul> + +</div></div> + +<div style="height: 2em"> </div> + +</body></html> diff --git a/codemirror_ui/lib/CodeMirror-2.3/doc/manual.html b/codemirror_ui/lib/CodeMirror-2.3/doc/manual.html new file mode 100644 index 0000000..88b2746 --- /dev/null +++ b/codemirror_ui/lib/CodeMirror-2.3/doc/manual.html @@ -0,0 +1,1128 @@ +<!doctype html> +<html> + <head> + <title>CodeMirror: User Manual</title> + <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> + <link rel="stylesheet" type="text/css" href="docs.css"/> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <style>dl dl {margin: 0;}</style> + </head> + <body> + +<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> + +<pre class="grey"> +<img src="baboon.png" class="logo" alt="logo"/>/* User manual and + reference guide */ +</pre> + +<div class="clear"><div class="leftbig blk"> + + <h2 id="overview">Overview</h2> + + <p>CodeMirror is a code-editor component that can be embedded in + Web pages. The code library provides <em>only</em> the editor + component, no accompanying buttons, auto-completion, or other IDE + functionality. It does provide a rich API on top of which such + functionality can be straightforwardly implemented. See + the <a href="#addons">add-ons</a> included in the distribution, + and + the <a href="https://github.com/jagthedrummer/codemirror-ui">CodeMirror + UI</a> project, for reusable implementations of extra features.</p> + + <p>CodeMirror works with language-specific modes. Modes are + JavaScript programs that help color (and optionally indent) text + written in a given language. The distribution comes with a number + of modes (see the <code>mode/</code> directory), and it isn't hard + to <a href="#modeapi">write new ones</a> for other languages.</p> + + <h2 id="usage">Basic Usage</h2> + + <p>The easiest way to use CodeMirror is to simply load the script + and style sheet found under <code>lib/</code> in the distribution, + plus a mode script from one of the <code>mode/</code> directories + and a theme stylesheet from <code>theme/</code>. (See + also <a href="compress.html">the compression helper</a>.) For + example:</p> + + <pre><script src="lib/codemirror.js"></script> +<link rel="stylesheet" href="../lib/codemirror.css"> +<script src="mode/javascript/javascript.js"></script></pre> + + <p>Having done this, an editor instance can be created like + this:</p> + + <pre>var myCodeMirror = CodeMirror(document.body);</pre> + + <p>The editor will be appended to the document body, will start + empty, and will use the mode that we loaded. To have more control + over the new editor, a configuration object can be passed + to <code>CodeMirror</code> as a second argument:</p> + + <pre>var myCodeMirror = CodeMirror(document.body, { + value: "function myScript(){return 100;}\n", + mode: "javascript" +});</pre> + + <p>This will initialize the editor with a piece of code already in + it, and explicitly tell it to use the JavaScript mode (which is + useful when multiple modes are loaded). + See <a href="#config">below</a> for a full discussion of the + configuration options that CodeMirror accepts.</p> + + <p>In cases where you don't want to append the editor to an + element, and need more control over the way it is inserted, the + first argument to the <code>CodeMirror</code> function can also + be a function that, when given a DOM element, inserts it into the + document somewhere. This could be used to, for example, replace a + textarea with a real editor:</p> + + <pre>var myCodeMirror = CodeMirror(function(elt) { + myTextArea.parentNode.replaceChild(elt, myTextArea); +}, {value: myTextArea.value});</pre> + + <p>However, for this use case, which is a common way to use + CodeMirror, the library provides a much more powerful + shortcut:</p> + + <pre>var myCodeMirror = CodeMirror.fromTextArea(myTextArea);</pre> + + <p>This will, among other things, ensure that the textarea's value + is updated when the form (if it is part of a form) is submitted. + See the <a href="#fromTextArea">API reference</a> for a full + description of this method.</p> + + <h2 id="config">Configuration</h2> + + <p>Both the <code>CodeMirror</code> function and + its <code>fromTextArea</code> method take as second (optional) + argument an object containing configuration options. Any option + not supplied like this will be taken + from <code>CodeMirror.defaults</code>, an object containing the + default options. You can update this object to change the defaults + on your page.</p> + + <p>Options are not checked in any way, so setting bogus option + values is bound to lead to odd errors.</p> + + <p>These are the supported options:</p> + + <dl> + <dt id="option_value"><code>value (string)</code></dt> + <dd>The starting value of the editor.</dd> + + <dt id="option_mode"><code>mode (string or object)</code></dt> + <dd>The mode to use. When not given, this will default to the + first mode that was loaded. It may be a string, which either + simply names the mode or is + a <a href="http://en.wikipedia.org/wiki/MIME">MIME</a> type + associated with the mode. Alternatively, it may be an object + containing configuration options for the mode, with + a <code>name</code> property that names the mode (for + example <code>{name: "javascript", json: true}</code>). The demo + pages for each mode contain information about what configuration + parameters the mode supports. You can ask CodeMirror which modes + and MIME types are loaded with + the <code>CodeMirror.listModes</code> + and <code>CodeMirror.listMIMEs</code> functions.</dd> + + <dt id="option_theme"><code>theme (string)</code></dt> + <dd>The theme to style the editor with. You must make sure the + CSS file defining the corresponding <code>.cm-s-[name]</code> + styles is loaded (see + the <a href="../theme/"><code>theme</code></a> directory in the + distribution). The default is <code>"default"</code>, for which + colors are included in <code>codemirror.css</code>. It is + possible to use multiple theming classes at once—for + example <code>"foo bar"</code> will assign both + the <code>cm-s-foo</code> and the <code>cm-s-bar</code> classes + to the editor.</dd> + + <dt id="option_indentUnit"><code>indentUnit (integer)</code></dt> + <dd>How many spaces a block (whatever that means in the edited + language) should be indented. The default is 2.</dd> + + <dt id="option_smartIndent"><code>smartIndent (boolean)</code></dt> + <dd>Whether to use the context-sensitive indentation that the + mode provides (or just indent the same as the line before). + Defaults to true.</dd> + + <dt id="option_tabSize"><code>tabSize (integer)</code></dt> + <dd>The width of a tab character. Defaults to 4.</dd> + + <dt id="option_indentWithTabs"><code>indentWithTabs (boolean)</code></dt> + <dd>Whether, when indenting, the first N*<code>tabSize</code> + spaces should be replaced by N tabs. Default is false.</dd> + + <dt id="option_electricChars"><code>electricChars (boolean)</code></dt> + <dd>Configures whether the editor should re-indent the current + line when a character is typed that might change its proper + indentation (only works if the mode supports indentation). + Default is true.</dd> + + <dt id="option_autoClearEmptyLines"><code>autoClearEmptyLines (boolean)</code></dt> + <dd>When turned on (default is off), this will clear + automatically clear lines consisting only of whitespace when the + cursor leaves them. This is mostly useful to prevent auto + indentation from introducing trailing whitespace in a file.</dd> + + <dt id="option_keyMap"><code>keyMap (string)</code></dt> + <dd>Configures the keymap to use. The default + is <code>"default"</code>, which is the only keymap defined + in <code>codemirror.js</code> itself. Extra keymaps are found in + the <a href="../keymap/"><code>keymap</code></a> directory. See + the <a href="#keymaps">section on keymaps</a> for more + information.</dd> + + <dt id="option_extraKeys"><code>extraKeys (object)</code></dt> + <dd>Can be used to specify extra keybindings for the editor, + alongside the ones defined + by <a href="#option_keyMap"><code>keyMap</code></a>. Should be + either null, or a valid <a href="#keymaps">keymap</a> value.</dd> + + <dt id="option_lineWrapping"><code>lineWrapping (boolean)</code></dt> + <dd>Whether CodeMirror should scroll or wrap for long lines. + Defaults to <code>false</code> (scroll).</dd> + + <dt id="option_lineNumbers"><code>lineNumbers (boolean)</code></dt> + <dd>Whether to show line numbers to the left of the editor.</dd> + + <dt id="option_firstLineNumber"><code>firstLineNumber (integer)</code></dt> + <dd>At which number to start counting lines. Default is 1.</dd> + + <dt id="option_gutter"><code>gutter (boolean)</code></dt> + <dd>Can be used to force a 'gutter' (empty space on the left of + the editor) to be shown even when no line numbers are active. + This is useful for setting <a href="#setMarker">markers</a>.</dd> + + <dt id="option_fixedGutter"><code>fixedGutter (boolean)</code></dt> + <dd>When enabled (off by default), this will make the gutter + stay visible when the document is scrolled horizontally.</dd> + + <dt id="option_readOnly"><code>readOnly (boolean)</code></dt> + <dd>This disables editing of the editor content by the user. If + the special value <code>"nocursor"</code> is given (instead of + simply <code>true</code>), focusing of the editor is also + disallowed.</dd> + + <dt id="option_onChange"><code>onChange (function)</code></dt> + <dd>When given, this function will be called every time the + content of the editor is changed. It will be given the editor + instance as first argument, and an <code>{from, to, text, next}</code> + object containing information about the changes + that occurred as second argument. <code>from</code> + and <code>to</code> are the positions (in the pre-change + coordinate system) where the change started and + ended (for example, it might be <code>{ch:0, line:18}</code> if the + position is at the beginning of line #19). <code>text</code> + is an array of strings representing the text that replaced the changed + range (split by line). If multiple changes happened during a single + operation, the object will have a <code>next</code> property pointing to + another change object (which may point to another, etc).</dd> + + <dt id="option_onCursorActivity"><code>onCursorActivity (function)</code></dt> + <dd>Will be called when the cursor or selection moves, or any + change is made to the editor content.</dd> + + <dt id="option_onGutterClick"><code>onGutterClick (function)</code></dt> + <dd>When given, will be called whenever the editor gutter (the + line-number area) is clicked. Will be given the editor instance + as first argument, the (zero-based) number of the line that was + clicked as second argument, and the raw <code>mousedown</code> + event object as third argument.</dd> + + <dt id="option_onFocus"><code>onFocus, onBlur (function)</code></dt> + <dd>The given functions will be called whenever the editor is + focused or unfocused.</dd> + + <dt id="option_onScroll"><code>onScroll (function)</code></dt> + <dd>When given, will be called whenever the editor is + scrolled.</dd> + + <dt id="option_onHighlightComplete"><code>onHighlightComplete (function)</code></dt> + <dd>Whenever the editor's content has been fully highlighted, + this function (if given) will be called. It'll be given a single + argument, the editor instance.</dd> + + <dt id="option_onUpdate"><code>onUpdate (function)</code></dt> + <dd>Will be called whenever CodeMirror updates its DOM display.</dd> + + <dt id="option_matchBrackets"><code>matchBrackets (boolean)</code></dt> + <dd>Determines whether brackets are matched whenever the cursor + is moved next to a bracket.</dd> + + <dt id="option_workTime"><code>workTime, workDelay (number)</code></dt> + <dd>Highlighting is done by a pseudo background-thread that will + work for <code>workTime</code> milliseconds, and then use + timeout to sleep for <code>workDelay</code> milliseconds. The + defaults are 200 and 300, you can change these options to make + the highlighting more or less aggressive.</dd> + + <dt id="option_pollInterval"><code>pollInterval (number)</code></dt> + <dd>Indicates how quickly CodeMirror should poll its input + textarea for changes. Most input is captured by events, but some + things, like IME input on some browsers, doesn't generate events + that allow CodeMirror to properly detect it. Thus, it polls. + Default is 100 milliseconds.</dd> + + <dt id="option_undoDepth"><code>undoDepth (integer)</code></dt> + <dd>The maximum number of undo levels that the editor stores. + Defaults to 40.</dd> + + <dt id="option_tabindex"><code>tabindex (integer)</code></dt> + <dd>The <a href="http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex">tab + index</a> to assign to the editor. If not given, no tab index + will be assigned.</dd> + + <dt id="option_autofocus"><code>autofocus (boolean)</code></dt> + <dd>Can be used to make CodeMirror focus itself on + initialization. Defaults to off. + When <a href="#fromTextArea"><code>fromTextArea</code></a> is + used, and no explicit value is given for this option, it will + inherit the setting from the textarea's <code>autofocus</code> + attribute.</dd> + + <dt id="option_dragDrop"><code>dragDrop (boolean)</code></dt> + <dd>Controls whether drag-and-drop is enabled. On by default.</dd> + + <dt id="option_onDragEvent"><code>onDragEvent (function)</code></dt> + <dd>When given, this will be called when the editor is handling + a <code>dragenter</code>, <code>dragover</code>, + or <code>drop</code> event. It will be passed the editor instance + and the event object as arguments. The callback can choose to + handle the event itself, in which case it should + return <code>true</code> to indicate that CodeMirror should not + do anything further.</dd> + + <dt id="option_onKeyEvent"><code>onKeyEvent (function)</code></dt> + <dd>This provides a rather low-level hook into CodeMirror's key + handling. If provided, this function will be called on + every <code>keydown</code>, <code>keyup</code>, + and <code>keypress</code> event that CodeMirror captures. It + will be passed two arguments, the editor instance and the key + event. This key event is pretty much the raw key event, except + that a <code>stop()</code> method is always added to it. You + could feed it to, for example, <code>jQuery.Event</code> to + further normalize it.<br>This function can inspect the key + event, and handle it if it wants to. It may return true to tell + CodeMirror to ignore the event. Be wary that, on some browsers, + stopping a <code>keydown</code> does not stop + the <code>keypress</code> from firing, whereas on others it + does. If you respond to an event, you should probably inspect + its <code>type</code> property and only do something when it + is <code>keydown</code> (or <code>keypress</code> for actions + that need character data).</dd> + </dl> + + <h2 id="keymaps">Keymaps</h2> + + <p>Keymaps are ways to associate keys with functionality. A keymap + is an object mapping strings that identify the keys to functions + that implement their functionality.</p> + + <p>Keys are identified either by name or by character. + The <code>CodeMirror.keyNames</code> object defines names for + common keys and associates them with their key codes. Examples of + names defined here are <code>Enter</code>, <code>F5</code>, + and <code>Q</code>. These can be prefixed + with <code>Shift-</code>, <code>Cmd-</code>, <code>Ctrl-</code>, + and <code>Alt-</code> (in that order!) to specify a modifier. So + for example, <code>Shift-Ctrl-Space</code> would be a valid key + identifier.</p> + + <p>Alternatively, a character can be specified directly by + surrounding it in single quotes, for example <code>'$'</code> + or <code>'q'</code>. Due to limitations in the way browsers fire + key events, these may not be prefixed with modifiers.</p> + + <p>The <code>CodeMirror.keyMap</code> object associates keymaps + with names. User code and keymap definitions can assign extra + properties to this object. Anywhere where a keymap is expected, a + string can be given, which will be looked up in this object. It + also contains the <code>"default"</code> keymap holding the + default bindings.</p> + + <p>The values of properties in keymaps can be either functions of + a single argument (the CodeMirror instance), or strings. Such + strings refer to properties of the + <code>CodeMirror.commands</code> object, which defines a number of + common commands that are used by the default keybindings, and maps + them to functions. A key handler function may throw + <code>CodeMirror.Pass</code> to indicate that it has decided not + to handle the key, and other handlers (or the default behavior) + should be given a turn.</p> + + <p>Keys mapped to command names that start with the + characters <code>"go"</code> (which should be used for + cursor-movement actions) will be fired even when an + extra <code>Shift</code> modifier is present (i.e. <code>"Up": + "goLineUp"</code> matches both up and shift-up). This is used to + easily implement shift-selection.</p> + + <p>Keymaps can defer to each other by defining + a <code>fallthrough</code> property. This indicates that when a + key is not found in the map itself, one or more other maps should + be searched. It can hold either a single keymap or an array of + keymaps.</p> + + <p>When a keymap contains a <code>nofallthrough</code> property + set to <code>true</code>, keys matched against that map will be + ignored if they don't match any of the bindings in the map (no + further child maps will be tried, and the default effect of + inserting a character will not occur).</p> + + <h2 id="styling">Customized Styling</h2> + + <p>Up to a certain extent, CodeMirror's look can be changed by + modifying style sheet files. The style sheets supplied by modes + simply provide the colors for that mode, and can be adapted in a + very straightforward way. To style the editor itself, it is + possible to alter or override the styles defined + in <a href="../lib/codemirror.css"><code>codemirror.css</code></a>.</p> + + <p>Some care must be taken there, since a lot of the rules in this + file are necessary to have CodeMirror function properly. Adjusting + colors should be safe, of course, and with some care a lot of + other things can be changed as well. The CSS classes defined in + this file serve the following roles:</p> + + <dl> + <dt id="class_CodeMirror"><code>CodeMirror</code></dt> + <dd>The outer element of the editor. This should be used for + borders and positioning. Can also be used to set styles that + should hold for everything inside the editor (such as font + and font size), or to set a background.</dd> + + <dt id="class_CodeMirror_scroll"><code>CodeMirror-scroll</code></dt> + <dd>This determines whether the editor scrolls (<code>overflow: + auto</code> + fixed height). By default, it does. Giving + this <code>height: auto; overflow: visible;</code> will cause + the editor to resize to fit its content.</dd> + + <dt id="class_CodeMirror_focused"><code>CodeMirror-focused</code></dt> + <dd>Whenever the editor is focused, the top element gets this + class. This is used to hide the cursor and give the selection a + different color when the editor is not focused.</dd> + + <dt id="class_CodeMirror_gutter"><code>CodeMirror-gutter</code></dt> + <dd>Use this for giving a background or a border to the editor + gutter. Don't set any padding here, + use <code>CodeMirror-gutter-text</code> for that. By default, + the gutter is 'fluid', meaning it will adjust its width to the + maximum line number or line marker width. You can also set a + fixed width if you want.</dd> + + <dt id="class_CodeMirror_gutter_text"><code>CodeMirror-gutter-text</code></dt> + <dd>Used to style the actual line numbers. For the numbers to + line up, you must make sure that the font in the gutter is the + same as the one in the rest of the editor, so you should + probably only set font style and size in + the <code>CodeMirror</code> class.</dd> + + <dt id="class_CodeMirror_lines"><code>CodeMirror-lines</code></dt> + <dd>The visible lines. If this has vertical + padding, <code>CodeMirror-gutter</code> should have the same + padding.</dd> + + <dt id="class_CodeMirror_cursor"><code>CodeMirror-cursor</code></dt> + <dd>The cursor is a block element that is absolutely positioned. + You can make it look whichever way you want.</dd> + + <dt id="class_CodeMirror_selected"><code>CodeMirror-selected</code></dt> + <dd>The selection is represented by <code>span</code> elements + with this class.</dd> + + <dt id="class_CodeMirror_matchingbracket"><code>CodeMirror-matchingbracket</code>, + <code>CodeMirror-nonmatchingbracket</code></dt> + <dd>These are used to style matched (or unmatched) brackets.</dd> + </dl> + + <p>The actual lines, as well as the cursor, are represented + by <code>pre</code> elements. By default no text styling (such as + bold) that might change line height is applied. If you do want + such effects, you'll have to give <code>CodeMirror pre</code> a + fixed height.</p> + + <p>If your page's style sheets do funky things to + all <code>div</code> or <code>pre</code> elements (you probably + shouldn't do that), you'll have to define rules to cancel these + effects out again for elements under the <code>CodeMirror</code> + class.</p> + + <p>Themes are also simply CSS files, which define colors for + various syntactic elements. See the files in + the <a href="../theme/"><code>theme</code></a> directory.</p> + + <h2 id="api">Programming API</h2> + + <p>A lot of CodeMirror features are only available through its API. + This has the disadvantage that you need to do work to enable them, + and the advantage that CodeMirror will fit seamlessly into your + application.</p> + + <p>Whenever points in the document are represented, the API uses + objects with <code>line</code> and <code>ch</code> properties. + Both are zero-based. CodeMirror makes sure to 'clip' any positions + passed by client code so that they fit inside the document, so you + shouldn't worry too much about sanitizing your coordinates. If you + give <code>ch</code> a value of <code>null</code>, or don't + specify it, it will be replaced with the length of the specified + line.</p> + + <dl> + <dt id="getValue"><code>getValue() → string</code></dt> + <dd>Get the current editor content.</dd> + <dt id="setValue"><code>setValue(string)</code></dt> + <dd>Set the editor content.</dd> + + <dt id="getSelection"><code>getSelection() → string</code></dt> + <dd>Get the currently selected code.</dd> + <dt id="replaceSelection"><code>replaceSelection(string)</code></dt> + <dd>Replace the selection with the given string.</dd> + + <dt id="focus"><code>focus()</code></dt> + <dd>Give the editor focus.</dd> + <dt id="scrollTo"><code>scrollTo(x, y)</code></dt> + <dd>Scroll the editor to a given (pixel) position. Both + arguments may be left as <code>null</code> + or <code>undefined</code> to have no effect.</dd> + <dt id="getScrollInfo"><code>getScrollInfo()</code></dt> + <dd>Get an <code>{x, y, width, height}</code> object that + represents the current scroll position and scrollable area size + of the editor.</dd> + + <dt id="setOption"><code>setOption(option, value)</code></dt> + <dd>Change the configuration of the editor. <code>option</code> + should the name of an <a href="#config">option</a>, + and <code>value</code> should be a valid value for that + option.</dd> + <dt id="getOption"><code>getOption(option) → value</code></dt> + <dd>Retrieves the current value of the given option for this + editor instance.</dd> + + <dt id="cursorCoords"><code>cursorCoords(start, mode) → object</code></dt> + <dd>Returns an <code>{x, y, yBot}</code> object containing the + coordinates of the cursor. If <code>mode</code> + is <code>"local"</code>, they will be relative to the top-left + corner of the editable document. If it is <code>"page"</code> or + not given, they are relative to the top-left corner of the + page. <code>yBot</code> is the coordinate of the bottom of the + cursor. <code>start</code> is a boolean indicating whether you + want the start or the end of the selection.</dd> + <dt id="charCoords"><code>charCoords(pos, mode) → object</code></dt> + <dd>Like <code>cursorCoords</code>, but returns the position of + an arbitrary characters. <code>pos</code> should be + a <code>{line, ch}</code> object.</dd> + <dt id="coordsChar"><code>coordsChar(object) → pos</code></dt> + <dd>Given an <code>{x, y}</code> object (in page coordinates), + returns the <code>{line, ch}</code> position that corresponds to + it.</dd> + + <dt id="undo"><code>undo()</code></dt> + <dd>Undo one edit (if any undo events are stored).</dd> + <dt id="redo"><code>redo()</code></dt> + <dd>Redo one undone edit.</dd> + <dt id="historySize"><code>historySize() → object</code></dt> + <dd>Returns an object with <code>{undo, redo}</code> properties, + both of which hold integers, indicating the amount of stored + undo and redo operations.</dd> + <dt id="clearHistory"><code>clearHistory()</code></dt> + <dd>Clears the editor's undo history.</dd> + + <dt id="indentLine"><code>indentLine(line, dir)</code></dt> + <dd>Reset the given line's indentation to the indentation + prescribed by the mode. If the second argument is given, + indentation will be increased (if <code>dir</code> is true) or + decreased (if false) by an <a href="#option_indentUnit">indent + unit</a> instead.</dd> + + <dt id="getTokenAt"><code>getTokenAt(pos) → object</code></dt> + <dd>Retrieves information about the token the current mode found + before the given position (a <code>{line, ch}</code> object). The + returned object has the following properties: + <dl> + <dt><code>start</code></dt><dd>The character (on the given line) at which the token starts.</dd> + <dt><code>end</code></dt><dd>The character at which the token ends.</dd> + <dt><code>string</code></dt><dd>The token's string.</dd> + <dt><code>className</code></dt><dd>The class the mode assigned + to the token. (Can be null when no class was assigned.)</dd> + <dt><code>state</code></dt><dd>The mode's state at the end of this token.</dd> + </dl></dd> + + <dt id="markText"><code>markText(from, to, className) → object</code></dt> + <dd>Can be used to mark a range of text with a specific CSS + class name. <code>from</code> and <code>to</code> should + be <code>{line, ch}</code> objects. The method will return an + object with two methods, <code>clear()</code>, which removes the + mark, and <code>find()</code>, which returns a <code>{from, + to}</code> (both document positions), indicating the current + position of the marked range.</dd> + + <dt id="setBookmark"><code>setBookmark(pos) → object</code></dt> + <dd>Inserts a bookmark, a handle that follows the text around it + as it is being edited, at the given position. A bookmark has two + methods <code>find()</code> and <code>clear()</code>. The first + returns the current position of the bookmark, if it is still in + the document, and the second explicitly removes the + bookmark.</dd> + + <dt id="findMarksAt"><code>findMarksAt(pos) → array</code></dt> + <dd>Returns an array of all the bookmarks and marked ranges + present at the given position.</dd> + + <dt id="setMarker"><code>setMarker(line, text, className) → lineHandle</code></dt> + <dd>Add a gutter marker for the given line. Gutter markers are + shown in the line-number area (instead of the number for this + line). Both <code>text</code> and <code>className</code> are + optional. Setting <code>text</code> to a Unicode character like + ● tends to give a nice effect. To put a picture in the gutter, + set <code>text</code> to a space and <code>className</code> to + something that sets a background image. If you + specify <code>text</code>, the given text (which may contain + HTML) will, by default, replace the line number for that line. + If this is not what you want, you can include the + string <code>%N%</code> in the text, which will be replaced by + the line number.</dd> + <dt id="clearMarker"><code>clearMarker(line)</code></dt> + <dd>Clears a marker created + with <code>setMarker</code>. <code>line</code> can be either a + number or a handle returned by <code>setMarker</code> (since a + number may now refer to a different line if something was added + or deleted).</dd> + <dt id="setLineClass"><code>setLineClass(line, className, backgroundClassName) → lineHandle</code></dt> + <dd>Set a CSS class name for the given line. <code>line</code> + can be a number or a line handle (as returned + by <code>setMarker</code> or this + function). <code>className</code> will be used to style the text + for the line, and <code>backgroundClassName</code> to style its + background (which lies behind the selection). + Pass <code>null</code> to clear the classes for a line.</dd> + <dt id="hideLine"><code>hideLine(line) → lineHandle</code></dt> + <dd>Hide the given line (either by number or by handle). Hidden + lines don't show up in the editor, and their numbers are skipped + when <a href="#option_lineNumbers">line numbers</a> are enabled. + Deleting a region around them does delete them, and coping a + region around will include them in the copied text.</dd> + <dt id="showLine"><code>showLine(line) → lineHandle</code></dt> + <dd>The inverse of <code>hideLine</code>—re-shows a previously + hidden line, by number or by handle.</dd> + + <dt id="onDeleteLine"><code>onDeleteLine(line, func)</code></dt> + <dd>Register a function that should be called when the line is + deleted from the document.</dd> + + <dt id="lineInfo"><code>lineInfo(line) → object</code></dt> + <dd>Returns the line number, text content, and marker status of + the given line, which can be either a number or a handle + returned by <code>setMarker</code>. The returned object has the + structure <code>{line, handle, text, markerText, markerClass, + lineClass, bgClass}</code>.</dd> + + <dt id="getLineHandle"><code>getLineHandle(num) → lineHandle</code></dt> + <dd>Fetches the line handle for the given line number.</dd> + + <dt id="addWidget"><code>addWidget(pos, node, scrollIntoView)</code></dt> + <dd>Puts <code>node</code>, which should be an absolutely + positioned DOM node, into the editor, positioned right below the + given <code>{line, ch}</code> position. + When <code>scrollIntoView</code> is true, the editor will ensure + that the entire node is visible (if possible). To remove the + widget again, simply use DOM methods (move it somewhere else, or + call <code>removeChild</code> on its parent).</dd> + + <dt id="matchBrackets"><code>matchBrackets()</code></dt> + <dd>Force matching-bracket-highlighting to happen.</dd> + + <dt id="lineCount"><code>lineCount() → number</code></dt> + <dd>Get the number of lines in the editor.</dd> + + <dt id="getCursor"><code>getCursor(start) → object</code></dt> + <dd><code>start</code> is a boolean indicating whether the start + or the end of the selection must be retrieved. If it is not + given, the current cursor pos, i.e. the side of the selection + that would move if you pressed an arrow key, is chosen. + A <code>{line, ch}</code> object will be returned.</dd> + <dt id="somethingSelected"><code>somethingSelected() → boolean</code></dt> + <dd>Return true if any text is selected.</dd> + <dt id="setCursor"><code>setCursor(pos)</code></dt> + <dd>Set the cursor position. You can either pass a + single <code>{line, ch}</code> object, or the line and the + character as two separate parameters.</dd> + <dt id="setSelection"><code>setSelection(start, end)</code></dt> + <dd>Set the selection range. <code>start</code> + and <code>end</code> should be <code>{line, ch}</code> objects.</dd> + + <dt id="getLine"><code>getLine(n) → string</code></dt> + <dd>Get the content of line <code>n</code>.</dd> + <dt id="setLine"><code>setLine(n, text)</code></dt> + <dd>Set the content of line <code>n</code>.</dd> + <dt id="removeLine"><code>removeLine(n)</code></dt> + <dd>Remove the given line from the document.</dd> + + <dt id="getRange"><code>getRange(from, to) → string</code></td> + <dd>Get the text between the given points in the editor, which + should be <code>{line, ch}</code> objects.</dd> + <dt id="replaceRange"><code>replaceRange(string, from, to)</code></dt> + <dd>Replace the part of the document between <code>from</code> + and <code>to</code> with the given string. <code>from</code> + and <code>to</code> must be <code>{line, ch}</code> + objects. <code>to</code> can be left off to simply insert the + string at position <code>from</code>.</dd> + + <dt id="posFromIndex"><code>posFromIndex(index) → object</code></dt> + <dd>Calculates and returns a <code>{line, ch}</code> object for a + zero-based <code>index</code> who's value is relative to the start of the + editor's text. If the <code>index</code> is out of range of the text then + the returned object is clipped to start or end of the text + respectively.</dd> + <dt id="indexFromPos"><code>indexFromPos(object) → number</code></dt> + <dd>The reverse of <a href="#posFromIndex"><code>posFromIndex</code></a>.</dd> + </dl> + + <p>The following are more low-level methods:</p> + + <dl> + <dt id="operation"><code>operation(func) → result</code></dt> + <dd>CodeMirror internally buffers changes and only updates its + DOM structure after it has finished performing some operation. + If you need to perform a lot of operations on a CodeMirror + instance, you can call this method with a function argument. It + will call the function, buffering up all changes, and only doing + the expensive update after the function returns. This can be a + lot faster. The return value from this method will be the return + value of your function.</dd> + + <dt id="compoundChange"><code>compoundChange(func) → result</code></dt> + <dd>Will call the given function (and return its result), + combining all changes made while that function executes into a + single undo event.</dd> + + <dt id="refresh"><code>refresh()</code></dt> + <dd>If your code does something to change the size of the editor + element (window resizes are already listened for), or unhides + it, you should probably follow up by calling this method to + ensure CodeMirror is still looking as intended.</dd> + + <dt id="getInputField"><code>getInputField() → textarea</code></dt> + <dd>Returns the hidden textarea used to read input.</dd> + <dt id="getWrapperElement"><code>getWrapperElement() → node</code></dt> + <dd>Returns the DOM node that represents the editor. Remove this + from your tree to delete an editor instance.</dd> + <dt id="getScrollerElement"><code>getScrollerElement() → node</code></dt> + <dd>Returns the DOM node that is responsible for the sizing and + the scrolling of the editor. You can change + the <code>height</code> and <code>width</code> styles of this + element to resize an editor. (You might have to call + the <a href="#refresh"><code>refresh</code></a> method + afterwards.)</dd> + <dt id="getGutterElement"><code>getGutterElement() → node</code></dt> + <dd>Fetches the DOM node that represents the editor gutter.</dd> + + <dt id="getStateAfter"><code>getStateAfter(line) → state</code></dt> + <dd>Returns the mode's parser state, if any, at the end of the + given line number. If no line number is given, the state at the + end of the document is returned. This can be useful for storing + parsing errors in the state, or getting other kinds of + contextual information for a line.</dd> + </dl> + + <p id="fromTextArea">Finally, the <code>CodeMirror</code> object + itself has a method <code>fromTextArea</code>. This takes a + textarea DOM node as first argument and an optional configuration + object as second. It will replace the textarea with a CodeMirror + instance, and wire up the form of that textarea (if any) to make + sure the editor contents are put into the textarea when the form + is submitted. A CodeMirror instance created this way has two + additional methods:</p> + + <dl> + <dt id="save"><code>save()</code></dt> + <dd>Copy the content of the editor into the textarea.</dd> + + <dt id="toTextArea"><code>toTextArea()</code></dt> + <dd>Remove the editor, and restore the original textarea (with + the editor's current content).</dd> + + <dt id="getTextArea"><code>getTextArea() → textarea</code></dt> + <dd>Returns the textarea that the instance was based on.</dd> + </dl> + + <p id="defineExtension">If you want to define extra methods in terms + of the CodeMirror API, it is possible to + use <code>CodeMirror.defineExtension(name, value)</code>. This + will cause the given value (usually a method) to be added to all + CodeMirror instances created from then on.</p> + + <h2 id="addons">Add-ons</h2> + + <p>The <code>lib/util</code> directory in the distribution + contains a number of reusable components that implement extra + editor functionality. In brief, they are:</p> + + <dl> + <dt id="util_dialog"><a href="../lib/util/dialog.js"><code>dialog.js</code></a></dt> + <dd>Provides a very simple way to query users for text input. + Adds an <code>openDialog</code> method to CodeMirror instances, + which can be called with an HTML fragment that provides the + prompt (should include an <code>input</code> tag), and a + callback function that is called when text has been entered. + Depends on <code>lib/util/dialog.css</code>.</dd> + <dt id="util_searchcursor"><a href="../lib/util/searchcursor.js"><code>searchcursor.js</code></a></dt> + <dd>Adds the <code>getSearchCursor(query, start, caseFold) → + cursor</code> method to CodeMirror instances, which can be used + to implement search/replace functionality. <code>query</code> + can be a regular expression or a string (only strings will match + across lines—if they contain newlines). <code>start</code> + provides the starting position of the search. It can be + a <code>{line, ch}</code> object, or can be left off to default + to the start of the document. <code>caseFold</code> is only + relevant when matching a string. It will cause the search to be + case-insensitive. A search cursor has the following methods: + <dl> + <dt><code>findNext(), findPrevious() → boolean</code></dt> + <dd>Search forward or backward from the current position. + The return value indicates whether a match was found. If + matching a regular expression, the return value will be the + array returned by the <code>match</code> method, in case you + want to extract matched groups.</dd> + <dt><code>from(), to() → object</code></dt> + <dd>These are only valid when the last call + to <code>findNext</code> or <code>findPrevious</code> did + not return false. They will return <code>{line, ch}</code> + objects pointing at the start and end of the match.</dd> + <dt><code>replace(text)</code></dt> + <dd>Replaces the currently found match with the given text + and adjusts the cursor position to reflect the + replacement.</dd> + </dl></dd> + + <dt id="util_search"><a href="../lib/util/search.js"><code>search.js</code></a></dt> + <dd>Implements the search commands. CodeMirror has keys bound to + these by default, but will not do anything with them unless an + implementation is provided. Depends + on <code>searchcursor.js</code>, and will make use + of <a href="#util_dialog"><code>openDialog</code></a> when + available to make prompting for search queries less ugly.</dd> + <dt id="util_foldcode"><a href="../lib/util/foldcode.js"><code>foldcode.js</code></a></dt> + <dd>Helps with code folding. + See <a href="../demo/folding.html">the demo</a> for an example. + Call <code>CodeMirror.newFoldFunction</code> with a range-finder + helper function to create a function that will, when applied to + a CodeMirror instance and a line number, attempt to fold or + unfold the block starting at the given line. A range-finder is a + language-specific function that also takes an instance and a + line number, and returns an end line for the block, or null if + no block is started on that line. This file + provides <code>CodeMirror.braceRangeFinder</code>, which finds + blocks in brace languages (JavaScript, C, Java, + etc), <code>CodeMirror.indentRangeFinder</code>, for languages + where indentation determines block structure (Python, Haskell), + and <code>CodeMirror.tagRangeFinder</code>, for XML-style + languages.</dd> + <dt id="util_runmode"><a href="../lib/util/runmode.js"><code>runmode.js</code></a></dt> + <dd>Can be used to run a CodeMirror mode over text without + actually opening an editor instance. + See <a href="../demo/runmode.html">the demo</a> for an + example.</dd> + <dt id="util_overlay"><a href="../lib/util/overlay.js"><code>overlay.js</code></a></dt> + <dd>Mode combinator that can be used to extend a mode with an + 'overlay' — a secondary mode is run over the stream, along with + the base mode, and can color specific pieces of text without + interfering with the base mode. + Defines <code>CodeMirror.overlayMode</code>, which is used to + create such a mode. See <a href="../demo/mustache.html">this + demo</a> for a detailed example.</dd> + <dt id="util_multiplex"><a href="../lib/util/multiplex.js"><code>multiplex.js</code></a></dt> + <dd>Mode combinator that can be used to easily 'multiplex' + between several modes. + Defines <code>CodeMirror.multiplexingMode</code> which, when + given as first argument a mode object, and as other arguments + any number of <code>{open, close, mode [, delimStyle]}</code> + objects, will return a mode object that starts parsing using the + mode passed as first argument, but will switch to another mode + as soon as it encounters a string that occurs in one of + the <code>open</code> fields of the passed objects. When in a + sub-mode, it will go back to the top mode again when + the <code>close</code> string is encountered. + When <code>delimStyle</code> is specified, it will be the token + style returned for the delimiter tokens. The outer mode will not + see the content between the delimiters. + See <a href="../demo/multiplex.html">this demo</a> for an + example.</dd> + <dt id="util_simple-hint"><a href="../lib/util/simple-hint.js"><code>simple-hint.js</code></a></dt> + <dd>Provides a framework for showing autocompletion hints. + Defines <code>CodeMirror.simpleHint</code>, which takes a + CodeMirror instance and a hinting function, and pops up a widget + that allows the user to select a completion. Hinting functions + are function that take an editor instance, and return + a <code>{list, from, to}</code> object, where <code>list</code> + is an array of strings (the completions), and <code>from</code> + and <code>to</code> give the start and end of the token that is + being completed. Depends + on <code>lib/util/simple-hint.css</code>.</dd> + <dt id="util_javascript-hint"><a href="../lib/util/javascript-hint.js"><code>javascript-hint.js</code></a></dt> + <dd>Defines <code>CodeMirror.javascriptHint</code> + and <code>CodeMirror.coffeescriptHint</code>, which are simple + hinting functions for the JavaScript and CoffeeScript + modes.</dd> + <dt id="util_match-highlighter"><a href="../lib/util/match-highlighter.js"><code>match-highlighter.js</code></a></dt> + <dd>Adds a <code>matchHighlight</code> method to CodeMirror + instances that can be called (typically from + a <a href="#option_onCursorActivity"><code>onCursorActivity</code></a> + handler) to highlight all instances of a currently selected word + with the a classname given as a first argument to the method. + Depends on + the <a href="#util_searchcursor"><code>searchcursor</code></a> + add-on. Demo <a href="../demo/matchhighlighter.html">here</a>.</dd> + <dt id="util_closetag"><a href="../lib/util/closetag.js"><code>closetag.js</code></a></dt> + <dd>Provides utility functions for adding automatic tag closing + to XML modes. See + the <a href="../demo/closetag.html">demo</a>.</dd> + <dt id="util_loadmode"><a href="../lib/util/loadmode.js"><code>loadmode.js</code></a></dt> + <dd>Defines a <code>CodeMirror.requireMode(modename, + callback)</code> function that will try to load a given mode and + call the callback when it succeeded. You'll have to + set <code>CodeMirror.modeURL</code> to a string that mode paths + can be constructed from, for + example <code>"mode/%N/%N.js"</code>—the <code>%N</code>'s will + be replaced with the mode name. Also + defines <code>CodeMirror.autoLoadMode(instance, mode)</code>, + which will ensure the given mode is loaded and cause the given + editor instance to refresh its mode when the loading + succeeded. See the <a href="../demo/loadmode.html">demo</a>.</dd> + </dl> + + <h2 id="modeapi">Writing CodeMirror Modes</h2> + + <p>Modes typically consist of a single JavaScript file. This file + defines, in the simplest case, a lexer (tokenizer) for your + language—a function that takes a character stream as input, + advances it past a token, and returns a style for that token. More + advanced modes can also handle indentation for the language.</p> + + <p id="defineMode">The mode script should + call <code>CodeMirror.defineMode</code> to register itself with + CodeMirror. This function takes two arguments. The first should be + the name of the mode, for which you should use a lowercase string, + preferably one that is also the name of the files that define the + mode (i.e. <code>"xml"</code> is defined <code>xml.js</code>). The + second argument should be a function that, given a CodeMirror + configuration object (the thing passed to + the <code>CodeMirror</code> function) and an optional mode + configuration object (as in + the <a href="#option_mode"><code>mode</code></a> option), returns + a mode object.</p> + + <p>Typically, you should use this second argument + to <code>defineMode</code> as your module scope function (modes + should not leak anything into the global scope!), i.e. write your + whole mode inside this function.</p> + + <p>The main responsibility of a mode script is <em>parsing</em> + the content of the editor. Depending on the language and the + amount of functionality desired, this can be done in really easy + or extremely complicated ways. Some parsers can be stateless, + meaning that they look at one element (<em>token</em>) of the code + at a time, with no memory of what came before. Most, however, will + need to remember something. This is done by using a <em>state + object</em>, which is an object that is always passed when + reading a token, and which can be mutated by the tokenizer.</p> + + <p id="startState">Modes that use a state must define + a <code>startState</code> method on their mode object. This is a + function of no arguments that produces a state object to be used + at the start of a document.</p> + + <p id="token">The most important part of a mode object is + its <code>token(stream, state)</code> method. All modes must + define this method. It should read one token from the stream it is + given as an argument, optionally update its state, and return a + style string, or <code>null</code> for tokens that do not have to + be styled. For your styles, you can either use the 'standard' ones + defined in the themes (without the <code>cm-</code> prefix), or + define your own and have people include a custom CSS file for your + mode.<p> + + <p id="StringStream">The stream object encapsulates a line of code + (tokens may never span lines) and our current position in that + line. It has the following API:</p> + + <dl> + <dt><code>eol() → boolean</code></dt> + <dd>Returns true only if the stream is at the end of the + line.</dd> + <dt><code>sol() → boolean</code></dt> + <dd>Returns true only if the stream is at the start of the + line.</dd> + + <dt><code>peek() → character</code></dt> + <dd>Returns the next character in the stream without advancing + it. Will return <code>undefined</code> at the end of the + line.</dd> + <dt><code>next() → character</code></dt> + <dd>Returns the next character in the stream and advances it. + Also returns <code>undefined</code> when no more characters are + available.</dd> + + <dt><code>eat(match) → character</code></dt> + <dd><code>match</code> can be a character, a regular expression, + or a function that takes a character and returns a boolean. If + the next character in the stream 'matches' the given argument, + it is consumed and returned. Otherwise, <code>undefined</code> + is returned.</dd> + <dt><code>eatWhile(match) → boolean</code></dt> + <dd>Repeatedly calls <code>eat</code> with the given argument, + until it fails. Returns true if any characters were eaten.</dd> + <dt><code>eatSpace() → boolean</code></dt> + <dd>Shortcut for <code>eatWhile</code> when matching + white-space.</dd> + <dt><code>skipToEnd()</code></dt> + <dd>Moves the position to the end of the line.</dd> + <dt><code>skipTo(ch) → boolean</code></dt> + <dd>Skips to the next occurrence of the given character, if + found on the current line (doesn't advance the stream if the + character does not occur on the line). Returns true if the + character was found.</dd> + <dt><code>match(pattern, consume, caseFold) → boolean</code></dt> + <dd>Act like a + multi-character <code>eat</code>—if <code>consume</code> is true + or not given—or a look-ahead that doesn't update the stream + position—if it is false. <code>pattern</code> can be either a + string or a regular expression starting with <code>^</code>. + When it is a string, <code>caseFold</code> can be set to true to + make the match case-insensitive. When successfully matching a + regular expression, the returned value will be the array + returned by <code>match</code>, in case you need to extract + matched groups.</dd> + + <dt><code>backUp(n)</code></dt> + <dd>Backs up the stream <code>n</code> characters. Backing it up + further than the start of the current token will cause things to + break, so be careful.</dd> + <dt><code>column() → integer</code></dt> + <dd>Returns the column (taking into account tabs) at which the + current token starts. Can be used to find out whether a token + starts a new line.</dd> + <dt><code>indentation() → integer</code></dt> + <dd>Tells you how far the current line has been indented, in + spaces. Corrects for tab characters.</dd> + + <dt><code>current() → string</code></dt> + <dd>Get the string between the start of the current token and + the current stream position.</dd> + </dl> + + <p id="blankLine">By default, blank lines are simply skipped when + tokenizing a document. For languages that have significant blank + lines, you can define a <code>blankLine(state)</code> method on + your mode that will get called whenever a blank line is passed + over, so that it can update the parser state.</p> + + <p id="copyState">Because state object are mutated, and CodeMirror + needs to keep valid versions of a state around so that it can + restart a parse at any line, copies must be made of state objects. + The default algorithm used is that a new state object is created, + which gets all the properties of the old object. Any properties + which hold arrays get a copy of these arrays (since arrays tend to + be used as mutable stacks). When this is not correct, for example + because a mode mutates non-array properties of its state object, a + mode object should define a <code>copyState</code> method, + which is given a state and should return a safe copy of that + state.</p> + + <p id="compareStates">By default, CodeMirror will stop re-parsing + a document as soon as it encounters a few lines that were + highlighted the same in the old parse as in the new one. It is + possible to provide an explicit way to test whether a state is + equivalent to another one, which CodeMirror will use (instead of + the unchanged-lines heuristic) to decide when to stop + highlighting. You do this by providing + a <code>compareStates</code> method on your mode object, which + takes two state arguments and returns a boolean indicating whether + they are equivalent. See the XML mode, which uses this to provide + reliable highlighting of bad closing tags, as an example.</p> + + <p id="indent">If you want your mode to provide smart indentation + (though the <a href="#indentLine"><code>indentLine</code></a> + method and the <code>indentAuto</code> + and <code>newlineAndIndent</code> commands, which keys can be + <a href="#option_extraKeys">bound</a> to), you must define + an <code>indent(state, textAfter)</code> method on your mode + object.</p> + + <p>The indentation method should inspect the given state object, + and optionally the <code>textAfter</code> string, which contains + the text on the line that is being indented, and return an + integer, the amount of spaces to indent. It should usually take + the <a href="#option_indentUnit"><code>indentUnit</code></a> + option into account.</p> + + <p id="electricChars">Finally, a mode may define + an <code>electricChars</code> property, which should hold a string + containing all the characters that should trigger the behaviour + described for + the <a href="#option_electricChars"><code>electricChars</code></a> + option.</p> + + <p>So, to summarize, a mode <em>must</em> provide + a <code>token</code> method, and it <em>may</em> + provide <code>startState</code>, <code>copyState</code>, + <code>compareStates</code>, and <code>indent</code> methods. For + an example of a trivial mode, see + the <a href="../mode/diff/diff.js">diff mode</a>, for a more involved + example, see the <a href="../mode/clike/clike.js">C-like + mode</a>.</p> + + <p>Sometimes, it is useful for modes to <em>nest</em>—to have one + mode delegate work to another mode. An example of this kind of + mode is the <a href="../mode/htmlmixed/htmlmixed.js">mixed-mode HTML + mode</a>. To implement such nesting, it is usually necessary to + create mode objects and copy states yourself. To create a mode + object, there are <code>CodeMirror.getMode(options, + parserConfig)</code>, where the first argument is a configuration + object as passed to the mode constructor function, and the second + argument is a mode specification as in + the <a href="#option_mode"><code>mode</code></a> option. To copy a + state object, call <code>CodeMirror.copyState(mode, state)</code>, + where <code>mode</code> is the mode that created the given + state.</p> + + <p>To make indentation work properly in a nested parser, it is + advisable to give the <code>startState</code> method of modes that + are intended to be nested an optional argument that provides the + base indentation for the block of code. The JavaScript and CSS + parser do this, for example, to allow JavaScript and CSS code + inside the mixed-mode HTML mode to be properly indented.</p> + + <p>Finally, it is possible to associate your mode, or a certain + configuration of your mode, with + a <a href="http://en.wikipedia.org/wiki/MIME">MIME</a> type. For + example, the JavaScript mode associates itself + with <code>text/javascript</code>, and its JSON variant + with <code>application/json</code>. To do this, + call <code>CodeMirror.defineMIME(mime, modeSpec)</code>, + where <code>modeSpec</code> can be a string or object specifying a + mode, as in the <a href="#option_mode"><code>mode</code></a> + option.</p> + +</div><div class="rightsmall blk"> + + <h2>Contents</h2> + + <ul> + <li><a href="#overview">Overview</a></li> + <li><a href="#usage">Basic Usage</a></li> + <li><a href="#config">Configuration</a></li> + <li><a href="#keymaps">Keymaps</a></li> + <li><a href="#styling">Customized Styling</a></li> + <li><a href="#api">Programming API</a></li> + <li><a href="#addons">Add-ons</a></li> + <li><a href="#modeapi">Writing CodeMirror Modes</a></li> + </ul> + +</div></div> + +<div style="height: 2em"> </div> + + </body> +</html> diff --git a/codemirror_ui/lib/CodeMirror-2.3/doc/oldrelease.html b/codemirror_ui/lib/CodeMirror-2.3/doc/oldrelease.html new file mode 100644 index 0000000..a659f40 --- /dev/null +++ b/codemirror_ui/lib/CodeMirror-2.3/doc/oldrelease.html @@ -0,0 +1,267 @@ +<!doctype html> +<html> + <head> + <title>CodeMirror</title> + <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> + <link rel="stylesheet" type="text/css" href="docs.css"/> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <link rel="alternate" href="http://twitter.com/statuses/user_timeline/242283288.rss" type="application/rss+xml"/> + </head> + <body> + +<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> + +<pre class="grey"> +<img src="baboon.png" class="logo" alt="logo"/>/* Old release history */ + +</pre> + + <p class="rel">26-09-2011: <a href="http://codemirror.net/codemirror-2.15.zip">Version 2.15</a>:</p> + <p class="rel-note">Fix bug that snuck into 2.14: Clicking the + character that currently has the cursor didn't re-focus the + editor.</p> + + <p class="rel">26-09-2011: <a href="http://codemirror.net/codemirror-2.14.zip">Version 2.14</a>:</p> + <ul class="rel-note"> + <li>Add <a href="../mode/clojure/index.html">Clojure</a>, <a href="../mode/pascal/index.html">Pascal</a>, <a href="../mode/ntriples/index.html">NTriples</a>, <a href="../mode/jinja2/index.html">Jinja2</a>, and <a href="../mode/markdown/index.html">Markdown</a> modes.</li> + <li>Add <a href="../theme/cobalt.css">Cobalt</a> and <a href="../theme/eclipse.css">Eclipse</a> themes.</li> + <li>Add a <a href="manual.html#option_fixedGutter"><code>fixedGutter</code></a> option.</li> + <li>Fix bug with <code>setValue</code> breaking cursor movement.</li> + <li>Make gutter updates much more efficient.</li> + <li>Allow dragging of text out of the editor (on modern browsers).</li> + </ul> + + + <p class="rel">23-08-2011: <a href="http://codemirror.net/codemirror-2.13.zip">Version 2.13</a>:</p> + <ul class="rel-note"> + <li>Add <a href="../mode/ruby/index.html">Ruby</a>, <a href="../mode/r/index.html">R</a>, <a href="../mode/coffeescript/index.html">CoffeeScript</a>, and <a href="../mode/velocity/index.html">Velocity</a> modes.</li> + <li>Add <a href="manual.html#getGutterElement"><code>getGutterElement</code></a> to API.</li> + <li>Several fixes to scrolling and positioning.</li> + <li>Add <a href="manual.html#option_smartHome"><code>smartHome</code></a> option.</li> + <li>Add an experimental <a href="../mode/xmlpure/index.html">pure XML</a> mode.</li> + </ul> + + <p class="rel">25-07-2011: <a href="http://codemirror.net/codemirror-2.12.zip">Version 2.12</a>:</p> + <ul class="rel-note"> + <li>Add a <a href="../mode/sparql/index.html">SPARQL</a> mode.</li> + <li>Fix bug with cursor jumping around in an unfocused editor in IE.</li> + <li>Allow key and mouse events to bubble out of the editor. Ignore widget clicks.</li> + <li>Solve cursor flakiness after undo/redo.</li> + <li>Fix block-reindent ignoring the last few lines.</li> + <li>Fix parsing of multi-line attrs in XML mode.</li> + <li>Use <code>innerHTML</code> for HTML-escaping.</li> + <li>Some fixes to indentation in C-like mode.</li> + <li>Shrink horiz scrollbars when long lines removed.</li> + <li>Fix width feedback loop bug that caused the width of an inner DIV to shrink.</li> + </ul> + + <p class="rel">04-07-2011: <a href="http://codemirror.net/codemirror-2.11.zip">Version 2.11</a>:</p> + <ul class="rel-note"> + <li>Add a <a href="../mode/scheme/index.html">Scheme mode</a>.</li> + <li>Add a <code>replace</code> method to search cursors, for cursor-preserving replacements.</li> + <li>Make the <a href="../mode/clike/index.html">C-like mode</a> mode more customizable.</li> + <li>Update XML mode to spot mismatched tags.</li> + <li>Add <code>getStateAfter</code> API and <code>compareState</code> mode API methods for finer-grained mode magic.</li> + <li>Add a <code>getScrollerElement</code> API method to manipulate the scrolling DIV.</li> + <li>Fix drag-and-drop for Firefox.</li> + <li>Add a C# configuration for the <a href="../mode/clike/index.html">C-like mode</a>.</li> + <li>Add <a href="../demo/fullscreen.html">full-screen editing</a> and <a href="../demo/changemode.html">mode-changing</a> demos.</li> + </ul> + + <p class="rel">07-06-2011: <a href="http://codemirror.net/codemirror-2.1.zip">Version 2.1</a>:</p> + <p class="rel-note">Add + a <a href="manual.html#option_theme">theme</a> system + (<a href="../demo/theme.html">demo</a>). Note that this is not + backwards-compatible—you'll have to update your styles and + modes!</p> + + <p class="rel">07-06-2011: <a href="http://codemirror.net/codemirror-2.02.zip">Version 2.02</a>:</p> + <ul class="rel-note"> + <li>Add a <a href="../mode/lua/index.html">Lua mode</a>.</li> + <li>Fix reverse-searching for a regexp.</li> + <li>Empty lines can no longer break highlighting.</li> + <li>Rework scrolling model (the outer wrapper no longer does the scrolling).</li> + <li>Solve horizontal jittering on long lines.</li> + <li>Add <a href="../demo/runmode.html">runmode.js</a>.</li> + <li>Immediately re-highlight text when typing.</li> + <li>Fix problem with 'sticking' horizontal scrollbar.</li> + </ul> + + <p class="rel">26-05-2011: <a href="http://codemirror.net/codemirror-2.01.zip">Version 2.01</a>:</p> + <ul class="rel-note"> + <li>Add a <a href="../mode/smalltalk/index.html">Smalltalk mode</a>.</li> + <li>Add a <a href="../mode/rst/index.html">reStructuredText mode</a>.</li> + <li>Add a <a href="../mode/python/index.html">Python mode</a>.</li> + <li>Add a <a href="../mode/plsql/index.html">PL/SQL mode</a>.</li> + <li><code>coordsChar</code> now works</li> + <li>Fix a problem where <code>onCursorActivity</code> interfered with <code>onChange</code>.</li> + <li>Fix a number of scrolling and mouse-click-position glitches.</li> + <li>Pass information about the changed lines to <code>onChange</code>.</li> + <li>Support cmd-up/down on OS X.</li> + <li>Add triple-click line selection.</li> + <li>Don't handle shift when changing the selection through the API.</li> + <li>Support <code>"nocursor"</code> mode for <code>readOnly</code> option.</li> + <li>Add an <code>onHighlightComplete</code> option.</li> + <li>Fix the context menu for Firefox.</li> + </ul> + + <p class="rel">28-03-2011: <a href="http://codemirror.net/codemirror-2.0.zip">Version 2.0</a>:</p> + <p class="rel-note">CodeMirror 2 is a complete rewrite that's + faster, smaller, simpler to use, and less dependent on browser + quirks. See <a href="internals.html">this</a> + and <a href="http://groups.google.com/group/codemirror/browse_thread/thread/5a8e894024a9f580">this</a> + for more information.</a> + + <p class="rel">28-03-2011: <a href="http://codemirror.net/codemirror-1.0.zip">Version 1.0</a>:</p> + <ul class="rel-note"> + <li>Fix error when debug history overflows.</li> + <li>Refine handling of C# verbatim strings.</li> + <li>Fix some issues with JavaScript indentation.</li> + </ul> + + <p class="rel">22-02-2011: <a href="https://github.com/marijnh/codemirror2/tree/beta2">Version 2.0 beta 2</a>:</p> + <p class="rel-note">Somewhat more mature API, lots of bugs shaken out.</a> + + <p class="rel">17-02-2011: <a href="http://codemirror.net/codemirror-0.94.zip">Version 0.94</a>:</p> + <ul class="rel-note"> + <li><code>tabMode: "spaces"</code> was modified slightly (now indents when something is selected).</li> + <li>Fixes a bug that would cause the selection code to break on some IE versions.</li> + <li>Disabling spell-check on WebKit browsers now works.</li> + </ul> + + <p class="rel">08-02-2011: <a href="http://codemirror.net/">Version 2.0 beta 1</a>:</p> + <p class="rel-note">CodeMirror 2 is a complete rewrite of + CodeMirror, no longer depending on an editable frame.</p> + + <p class="rel">19-01-2011: <a href="http://codemirror.net/codemirror-0.93.zip">Version 0.93</a>:</p> + <ul class="rel-note"> + <li>Added a <a href="contrib/regex/index.html">Regular Expression</a> parser.</li> + <li>Fixes to the PHP parser.</li> + <li>Support for regular expression in search/replace.</li> + <li>Add <code>save</code> method to instances created with <code>fromTextArea</code>.</li> + <li>Add support for MS T-SQL in the SQL parser.</li> + <li>Support use of CSS classes for highlighting brackets.</li> + <li>Fix yet another hang with line-numbering in hidden editors.</li> + </ul> + + <p class="rel">17-12-2010: <a href="http://codemirror.net/codemirror-0.92.zip">Version 0.92</a>:</p> + <ul class="rel-note"> + <li>Make CodeMirror work in XHTML documents.</li> + <li>Fix bug in handling of backslashes in Python strings.</li> + <li>The <code>styleNumbers</code> option is now officially + supported and documented.</li> + <li><code>onLineNumberClick</code> option added.</li> + <li>More consistent names <code>onLoad</code> and + <code>onCursorActivity</code> callbacks. Old names still work, but + are deprecated.</li> + <li>Add a <a href="contrib/freemarker/index.html">Freemarker</a> mode.</li> + </ul> + + <p class="rel">11-11-2010: <a + href="http://codemirror.net/codemirror-0.91.zip">Version 0.91</a>:</p> + <ul class="rel-note"> + <li>Adds support for <a href="contrib/java">Java</a>.</li> + <li>Small additions to the <a href="contrib/php">PHP</a> and <a href="contrib/sql">SQL</a> parsers.</li> + <li>Work around various <a href="https://bugs.webkit.org/show_bug.cgi?id=47806">Webkit</a> <a href="https://bugs.webkit.org/show_bug.cgi?id=23474">issues</a>.</li> + <li>Fix <code>toTextArea</code> to update the code in the textarea.</li> + <li>Add a <code>noScriptCaching</code> option (hack to ease development).</li> + <li>Make sub-modes of <a href="mixedtest.html">HTML mixed</a> mode configurable.</li> + </ul> + + <p class="rel">02-10-2010: <a + href="http://codemirror.net/codemirror-0.9.zip">Version 0.9</a>:</p> + <ul class="rel-note"> + <li>Add support for searching backwards.</li> + <li>There are now parsers for <a href="contrib/scheme/index.html">Scheme</a>, <a href="contrib/xquery/index.html">XQuery</a>, and <a href="contrib/ometa/index.html">OmetaJS</a>.</li> + <li>Makes <code>height: "dynamic"</code> more robust.</li> + <li>Fixes bug where paste did not work on OS X.</li> + <li>Add a <code>enterMode</code> and <code>electricChars</code> options to make indentation even more customizable.</li> + <li>Add <code>firstLineNumber</code> option.</li> + <li>Fix bad handling of <code>@media</code> rules by the CSS parser.</li> + <li>Take a new, more robust approach to working around the invisible-last-line bug in WebKit.</li> + </ul> + + <p class="rel">22-07-2010: <a + href="http://codemirror.net/codemirror-0.8.zip">Version 0.8</a>:</p> + <ul class="rel-note"> + <li>Add a <code>cursorCoords</code> method to find the screen + coordinates of the cursor.</li> + <li>A number of fixes and support for more syntax in the PHP parser.</li> + <li>Fix indentation problem with JSON-mode JS parser in Webkit.</li> + <li>Add a <a href="compress.html">minification</a> UI.</li> + <li>Support a <code>height: dynamic</code> mode, where the editor's + height will adjust to the size of its content.</li> + <li>Better support for IME input mode.</li> + <li>Fix JavaScript parser getting confused when seeing a no-argument + function call.</li> + <li>Have CSS parser see the difference between selectors and other + identifiers.</li> + <li>Fix scrolling bug when pasting in a horizontally-scrolled + editor.</li> + <li>Support <code>toTextArea</code> method in instances created with + <code>fromTextArea</code>.</li> + <li>Work around new Opera cursor bug that causes the cursor to jump + when pressing backspace at the end of a line.</li> + </ul> + + <p class="rel">27-04-2010: <a + href="http://codemirror.net/codemirror-0.67.zip">Version + 0.67</a>:</p> + <p class="rel-note">More consistent page-up/page-down behaviour + across browsers. Fix some issues with hidden editors looping forever + when line-numbers were enabled. Make PHP parser parse + <code>"\\"</code> correctly. Have <code>jumpToLine</code> work on + line handles, and add <code>cursorLine</code> function to fetch the + line handle where the cursor currently is. Add new + <code>setStylesheet</code> function to switch style-sheets in a + running editor.</p> + + <p class="rel">01-03-2010: <a + href="http://codemirror.net/codemirror-0.66.zip">Version + 0.66</a>:</p> + <p class="rel-note">Adds <code>removeLine</code> method to API. + Introduces the <a href="contrib/plsql/index.html">PLSQL parser</a>. + Marks XML errors by adding (rather than replacing) a CSS class, so + that they can be disabled by modifying their style. Fixes several + selection bugs, and a number of small glitches.</p> + + <p class="rel">12-11-2009: <a + href="http://codemirror.net/codemirror-0.65.zip">Version + 0.65</a>:</p> + <p class="rel-note">Add support for having both line-wrapping and + line-numbers turned on, make paren-highlighting style customisable + (<code>markParen</code> and <code>unmarkParen</code> config + options), work around a selection bug that Opera + <em>re</em>introduced in version 10.</p> + + <p class="rel">23-10-2009: <a + href="http://codemirror.net/codemirror-0.64.zip">Version + 0.64</a>:</p> + <p class="rel-note">Solves some issues introduced by the + paste-handling changes from the previous release. Adds + <code>setSpellcheck</code>, <code>setTextWrapping</code>, + <code>setIndentUnit</code>, <code>setUndoDepth</code>, + <code>setTabMode</code>, and <code>setLineNumbers</code> to + customise a running editor. Introduces an <a + href="contrib/sql/index.html">SQL</a> parser. Fixes a few small + problems in the <a href="contrib/python/index.html">Python</a> + parser. And, as usual, add workarounds for various newly discovered + browser incompatibilities.</p> + +<p class="rel"><em>31-08-2009</em>: <a +href="http://codemirror.net/codemirror-0.63.zip">Version +0.63</a>:</p> +<p class="rel-note"> Overhaul of paste-handling (less fragile), fixes for several +serious IE8 issues (cursor jumping, end-of-document bugs) and a number +of small problems.</p> + +<p class="rel"><em>30-05-2009</em>: <a +href="http://codemirror.net/codemirror-0.62.zip">Version +0.62</a>:</p> +<p class="rel-note">Introduces <a href="contrib/python/index.html">Python</a> +and <a href="contrib/lua/index.html">Lua</a> parsers. Add +<code>setParser</code> (on-the-fly mode changing) and +<code>clearHistory</code> methods. Make parsing passes time-based +instead of lines-based (see the <code>passTime</code> option).</p> + +</body></html> diff --git a/codemirror_ui/lib/CodeMirror-2.3/doc/reporting.html b/codemirror_ui/lib/CodeMirror-2.3/doc/reporting.html new file mode 100644 index 0000000..915fa52 --- /dev/null +++ b/codemirror_ui/lib/CodeMirror-2.3/doc/reporting.html @@ -0,0 +1,57 @@ +<!doctype html> +<html> + <head> + <title>CodeMirror: Reporting Bugs</title> + <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> + <link rel="stylesheet" type="text/css" href="docs.css"/> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <style>li { margin-top: 1em; }</style> + </head> + <body> + +<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> + +<pre class="grey"> +<img src="baboon.png" class="logo" alt="logo"/>/* Reporting bugs + effectively */ +</pre> + +<div class="left"> + +<p>So you found a problem in CodeMirror. By all means, report it! Bug +reports from users are the main drive behind improvements to +CodeMirror. But first, please read over these points:</p> + +<ol> + <li>CodeMirror is maintained by volunteers. They don't owe you + anything, so be polite. Reports with an indignant or belligerent + tone tend to be moved to the bottom of the pile.</li> + + <li>Include information about <strong>the browser in which the + problem occurred</strong>. Even if you tested several browsers, and + the problem occurred in all of them, mention this fact in the bug + report. Also include browser version numbers and the operating + system that you're on.</li> + + <li>Mention which release of CodeMirror you're using. Preferably, + try also with the current development snapshot, to ensure the + problem has not already been fixed.</li> + + <li>Mention very precisely what went wrong. "X is broken" is not a + good bug report. What did you expect to happen? What happened + instead? Describe the exact steps a maintainer has to take to make + the problem occur. We can not fix something that we can not + observe.</li> + + <li>If the problem can not be reproduced in any of the demos + included in the CodeMirror distribution, please provide an HTML + document that demonstrates the problem. The best way to do this is + to go to <a href="http://jsbin.com/ihunin/edit">jsbin.com</a>, enter + it there, press save, and include the resulting link in your bug + report.</li> +</ol> + +</div> + + </body> +</html> diff --git a/codemirror_ui/lib/CodeMirror-2.3/doc/upgrade_v2.2.html b/codemirror_ui/lib/CodeMirror-2.3/doc/upgrade_v2.2.html new file mode 100644 index 0000000..a6d0236 --- /dev/null +++ b/codemirror_ui/lib/CodeMirror-2.3/doc/upgrade_v2.2.html @@ -0,0 +1,95 @@ +<!doctype html> +<html> + <head> + <title>CodeMirror: Upgrading to v2.2</title> + <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> + <link rel="stylesheet" type="text/css" href="docs.css"/> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + </head> + <body> + +<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> + +<pre class="grey"> +<img src="baboon.png" class="logo" alt="logo"/>/* Upgrading to v2.2 + */ +</pre> + +<div class="left"> + +<p>There are a few things in the 2.2 release that require some care +when upgrading.</p> + +<h2>No more default.css</h2> + +<p>The default theme is now included +in <a href="../lib/codemirror.css"><code>codemirror.css</code></a>, so +you do not have to included it separately anymore. (It was tiny, so +even if you're not using it, the extra data overhead is negligible.) + +<h2>Different key customization</h2> + +<p>CodeMirror has moved to a system +where <a href="manual.html#option_keyMap">keymaps</a> are used to +bind behavior to keys. This means <a href="../demo/emacs.html">custom +bindings</a> are now possible.</p> + +<p>Three options that influenced key +behavior, <code>tabMode</code>, <code>enterMode</code>, +and <code>smartHome</code>, are no longer supported. Instead, you can +provide custom bindings to influence the way these keys act. This is +done through the +new <a href="manual.html#option_extraKeys"><code>extraKeys</code></a> +option, which can hold an object mapping key names to functionality. A +simple example would be:</p> + +<pre> extraKeys: { + "Ctrl-S": function(instance) { saveText(instance.getValue()); }, + "Ctrl-/": "undo" + }</pre> + +<p>Keys can be mapped either to functions, which will be given the +editor instance as argument, or to strings, which are mapped through +functions through the <code>CodeMirror.commands</code> table, which +contains all the built-in editing commands, and can be inspected and +extended by external code.</p> + +<p>By default, the <code>Home</code> key is bound to +the <code>"goLineStartSmart"</code> command, which moves the cursor to +the first non-whitespace character on the line. You can set do this to +make it always go to the very start instead:</p> + +<pre> extraKeys: {"Home": "goLineStart"}</pre> + +<p>Similarly, <code>Enter</code> is bound +to <code>"newlineAndIndent"</code> by default. You can bind it to +something else to get different behavior. To disable special handling +completely and only get a newline character inserted, you can bind it +to <code>false</code>:</p> + +<pre> extraKeys: {"Enter": false}</pre> + +<p>The same works for <code>Tab</code>. If you don't want CodeMirror +to handle it, bind it to <code>false</code>. The default behaviour is +to indent the current line more (<code>"indentMore"</code> command), +and indent it less when shift is held (<code>"indentLess"</code>). +There are also <code>"indentAuto"</code> (smart indent) +and <code>"insertTab"</code> commands provided for alternate +behaviors. Or you can write your own handler function to do something +different altogether.</p> + +<h2>Tabs</h2> + +<p>Handling of tabs changed completely. The display width of tabs can +now be set with the <code>tabSize</code> option, and tabs can +be <a href="../demo/visibletabs.html">styled</a> by setting CSS rules +for the <code>cm-tab</code> class.</p> + +<p>The default width for tabs is now 4, as opposed to the 8 that is +hard-wired into browsers. If you are relying on 8-space tabs, make +sure you explicitly set <code>tabSize: 8</code> in your options.</p> + +</div> + + </body> +</html> |