pax_global_header 0000666 0000000 0000000 00000000064 11734030565 0014516 g ustar 00root root 0000000 0000000 52 comment=677a6aa8bbebf35d9d3ab07f7bc7d5d4326df806
marijnh-CodeMirror2-677a6aa/ 0000775 0000000 0000000 00000000000 11734030565 0015711 5 ustar 00root root 0000000 0000000 marijnh-CodeMirror2-677a6aa/LICENSE 0000664 0000000 0000000 00000002314 11734030565 0016716 0 ustar 00root root 0000000 0000000 Copyright (C) 2011 by Marijn Haverbeke
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Please note that some subdirectories of the CodeMirror distribution
include their own LICENSE files, and are released under different
licences.
marijnh-CodeMirror2-677a6aa/README.md 0000664 0000000 0000000 00000000352 11734030565 0017170 0 ustar 00root root 0000000 0000000 # CodeMirror 2
CodeMirror 2 is a rewrite of [CodeMirror
1](http://github.com/marijnh/CodeMirror). The docs live
[here](http://codemirror.net/doc/manual.html), and the project page is
[http://codemirror.net/](http://codemirror.net/).
marijnh-CodeMirror2-677a6aa/demo/ 0000775 0000000 0000000 00000000000 11734030565 0016635 5 ustar 00root root 0000000 0000000 marijnh-CodeMirror2-677a6aa/demo/activeline.html 0000664 0000000 0000000 00000005261 11734030565 0021652 0 ustar 00root root 0000000 0000000
CodeMirror: Active Line Demo
On changes to the content of the above editor, a (crude) script
tries to auto-detect the language used, and switches the editor to
either JavaScript or Scheme mode based on that.
The emacs keybindings are enabled by
including keymap/emacs.js and setting
the keyMap option to "emacs". Because
CodeMirror's internal API is quite different from Emacs, they are only
a loose approximation of actual emacs bindings, though.
Also note that a lot of browsers disallow certain keys from being
captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the
result that idiomatic use of Emacs keys will constantly close your tab
or open a new window.
Select a piece of code and click one of the links below to apply automatic formatting to the selected text or comment/uncomment the selected text. Note that the formatting behavior depends on the current block's mode.
Demonstration of a mode that parses HTML, highlighting
the Mustache templating
directives inside of it by using the code
in overlay.js. View
source to see the 15 lines of code needed to accomplish this.
If this is a function, it will be called for each token with
two arguments, the token's text and the token's style class (may
be null for unstyled tokens). If it is a DOM node,
the tokens will be converted to span elements as in
an editor, and inserted into the node
(through innerHTML).
The vim keybindings are enabled by
including keymap/vim.js and setting
the keyMap option to "vim". Because
CodeMirror's internal API is quite different from Vim, they are only
a loose approximation of actual vim bindings, though.
Tabs inside the editor are spans with the
class cm-tab, and can be styled. This demo uses
an :after pseudo-class CSS hack that will not work on old
browsers. You can use a more conservative technique like a background
image as an alternative.