Upgrade CodeMirror to 5.0 #43

This commit is contained in:
Jason Barnabe 2015-02-24 20:42:17 -06:00
parent c1a8872dad
commit 51a9c5c016
48 changed files with 3349 additions and 2274 deletions

View File

@ -2,6 +2,7 @@ List of CodeMirror contributors. Updated before every release.
4r2r 4r2r
Aaron Brooks Aaron Brooks
Abdelouahab
Abe Fettig Abe Fettig
Adam Ahmed Adam Ahmed
Adam King Adam King
@ -23,6 +24,7 @@ Alexander Solovyov
Alexandre Bique Alexandre Bique
alexey-k alexey-k
Alex Piggott Alex Piggott
Aliaksei Chapyzhenka
Amsul Amsul
amuntean amuntean
Amy Amy
@ -31,15 +33,18 @@ anaran
AndersMad AndersMad
Anders Nawroth Anders Nawroth
Anderson Mesquita Anderson Mesquita
Andrea G
Andreas Reischuck Andreas Reischuck
Andre von Houck Andre von Houck
Andrey Fedorov Andrey Fedorov
Andrey Klyuchnikov
Andrey Lushnikov Andrey Lushnikov
Andy Joslin Andy Joslin
Andy Kimball Andy Kimball
Andy Li Andy Li
angelozerr angelozerr
angelo.zerr@gmail.com angelo.zerr@gmail.com
Ankit
Ankit Ahuja Ankit Ahuja
Ansel Santosa Ansel Santosa
Anthony Grimes Anthony Grimes
@ -61,6 +66,7 @@ Billy Moon
binny binny
B Krishna Chaitanya B Krishna Chaitanya
Blaine G Blaine G
blukat29
boomyjee boomyjee
borawjm borawjm
Brandon Frohs Brandon Frohs
@ -76,6 +82,8 @@ Chris Coyier
Chris Granger Chris Granger
Chris Houseknecht Chris Houseknecht
Chris Morgan Chris Morgan
Christian Oyarzun
Christian Petrov
Christopher Brown Christopher Brown
ciaranj ciaranj
CodeAnimal CodeAnimal
@ -83,6 +91,8 @@ ComFreek
Curtis Gagliardi Curtis Gagliardi
dagsta dagsta
daines daines
Dale Jung
Dan Bentley
Dan Heberden Dan Heberden
Daniel, Dao Quang Minh Daniel, Dao Quang Minh
Daniele Di Sarli Daniele Di Sarli
@ -92,13 +102,18 @@ Daniel KJ
Daniel Neel Daniel Neel
Daniel Parnell Daniel Parnell
Danny Yoo Danny Yoo
darealshinji
Darius Roberts Darius Roberts
Dave Myers Dave Myers
David Mignot David Mignot
David Pathakjee David Pathakjee
David Vázquez
deebugger deebugger
Deep Thought Deep Thought
Devon Carew
dignifiedquire dignifiedquire
Dimage Sapelkin
Dmitry Kiselyov
domagoj412 domagoj412
Dominator008 Dominator008
Domizio Demichelis Domizio Demichelis
@ -127,19 +142,24 @@ flack
ForbesLindesay ForbesLindesay
Forbes Lindesay Forbes Lindesay
Ford_Lawnmower Ford_Lawnmower
Forrest Oliphant
Frank Wiegand Frank Wiegand
Gabriel Gheorghian
Gabriel Horner Gabriel Horner
Gabriel Nahmias Gabriel Nahmias
galambalazs galambalazs
Gautam Mehta Gautam Mehta
gekkoe gekkoe
Gerard Braad
Gergely Hegykozi Gergely Hegykozi
Giovanni Calò
Glenn Jorde Glenn Jorde
Glenn Ruehle Glenn Ruehle
Golevka Golevka
Gordon Smith Gordon Smith
Grant Skinner Grant Skinner
greengiant greengiant
Gregory Koberger
Guillaume Massé Guillaume Massé
Guillaume Massé Guillaume Massé
Gustavo Rodrigues Gustavo Rodrigues
@ -147,6 +167,7 @@ Hakan Tunc
Hans Engel Hans Engel
Hardest Hardest
Hasan Karahan Hasan Karahan
Herculano Campos
Hiroyuki Makino Hiroyuki Makino
hitsthings hitsthings
Hocdoc Hocdoc
@ -163,6 +184,7 @@ Ivan Kurnosov
Jacob Lee Jacob Lee
Jakob Miland Jakob Miland
Jakub Vrana Jakub Vrana
Jakub Vrána
James Campos James Campos
James Thorne James Thorne
Jamie Hill Jamie Hill
@ -171,7 +193,9 @@ jankeromnes
Jan Keromnes Jan Keromnes
Jan Odvarko Jan Odvarko
Jan T. Sott Jan T. Sott
Jared Forsyth
Jason Jason
Jason Barnabe
Jason Grout Jason Grout
Jason Johnston Jason Johnston
Jason San Jose Jason San Jose
@ -181,6 +205,7 @@ Jean Boussier
jeffkenton jeffkenton
Jeff Pickhardt Jeff Pickhardt
jem (graphite) jem (graphite)
Jeremy Parmenter
Jochen Berger Jochen Berger
Johan Ask Johan Ask
John Connor John Connor
@ -190,6 +215,7 @@ John Van Der Loo
Jonathan Malmaud Jonathan Malmaud
jongalloway jongalloway
Jon Malmaud Jon Malmaud
Jon Sangster
Joost-Wim Boekesteijn Joost-Wim Boekesteijn
Joseph Pecoraro Joseph Pecoraro
Joshua Newman Joshua Newman
@ -199,11 +225,13 @@ jsoojeon
Juan Benavides Romero Juan Benavides Romero
Jucovschi Constantin Jucovschi Constantin
Juho Vuori Juho Vuori
Justin Hileman
jwallers@gmail.com jwallers@gmail.com
kaniga kaniga
Ken Newman Ken Newman
Ken Rockot Ken Rockot
Kevin Sawicki Kevin Sawicki
Kevin Ushey
Klaus Silveira Klaus Silveira
Koh Zi Han, Cliff Koh Zi Han, Cliff
komakino komakino
@ -211,16 +239,20 @@ Konstantin Lopuhin
koops koops
ks-ifware ks-ifware
kubelsmieci kubelsmieci
KwanEsq
Lanfei
Lanny Lanny
Laszlo Vidacs Laszlo Vidacs
leaf corcoran leaf corcoran
Leonid Khachaturov Leonid Khachaturov
Leon Sorokin
Leonya Khachaturov Leonya Khachaturov
Liam Newman Liam Newman
LM LM
lochel lochel
Lorenzo Stoakes Lorenzo Stoakes
Luciano Longo Luciano Longo
Luke Stagner
lynschinzer lynschinzer
Maksim Lin Maksim Lin
Maksym Taran Maksym Taran
@ -231,7 +263,9 @@ Marcel Gerber
Marco Aurélio Marco Aurélio
Marco Munizaga Marco Munizaga
Marcus Bointon Marcus Bointon
Marek Rudnicki
Marijn Haverbeke Marijn Haverbeke
Mário Gonçalves
Mario Pietsch Mario Pietsch
Mark Lentczner Mark Lentczner
Marko Bonaci Marko Bonaci
@ -243,6 +277,7 @@ Mateusz Paprocki
Mathias Bynens Mathias Bynens
mats cronqvist mats cronqvist
Matthew Beale Matthew Beale
Matthias Bussonnier
Matthias BUSSONNIER Matthias BUSSONNIER
Matt McDonald Matt McDonald
Matt Pass Matt Pass
@ -251,6 +286,7 @@ mauricio
Maximilian Hils Maximilian Hils
Maxim Kraev Maxim Kraev
Max Kirsch Max Kirsch
Max Xiantu
mbarkhau mbarkhau
Metatheos Metatheos
Micah Dubinko Micah Dubinko
@ -258,6 +294,7 @@ Michael Lehenbauer
Michael Zhou Michael Zhou
Mighty Guava Mighty Guava
Miguel Castillo Miguel Castillo
mihailik
Mike Mike
Mike Brevoort Mike Brevoort
Mike Diaz Mike Diaz
@ -267,6 +304,7 @@ MinRK
Miraculix87 Miraculix87
misfo misfo
mloginov mloginov
Moritz Schwörer
mps mps
mtaran-google mtaran-google
Narciso Jaramillo Narciso Jaramillo
@ -274,21 +312,27 @@ Nathan Williams
ndr ndr
nerbert nerbert
nextrevision nextrevision
ngn
nguillaumin nguillaumin
Ng Zhi An Ng Zhi An
Nicholas Bollweg Nicholas Bollweg
Nicholas Bollweg (Nick)
Nick Small Nick Small
Niels van Groningen Niels van Groningen
nightwing
Nikita Beloglazov Nikita Beloglazov
Nikita Vasilyev Nikita Vasilyev
Nikolay Kostov Nikolay Kostov
nilp0inter nilp0inter
Nisarg Jhaveri
nlwillia nlwillia
Norman Rzepka
pablo pablo
Page Page
Panupong Pasupat Panupong Pasupat
paris paris
Patil Arpith Patil Arpith
Patrick Stoica
Patrick Strawderman Patrick Strawderman
Paul Garvin Paul Garvin
Paul Ivanov Paul Ivanov
@ -303,10 +347,14 @@ prasanthj
Prasanth J Prasanth J
Radek Piórkowski Radek Piórkowski
Rahul Rahul
Randall Mason
Randy Burden
Randy Edmunds Randy Edmunds
Rasmus Erik Voel Jensen Rasmus Erik Voel Jensen
Ray Ratchup
Richard van der Meer Richard van der Meer
Richard Z.H. Wang Richard Z.H. Wang
Robert Crossfield
Roberto Abdelkader Martínez Pérez Roberto Abdelkader Martínez Pérez
robertop23 robertop23
Robert Plummer Robert Plummer
@ -322,6 +370,7 @@ satchmorun
sathyamoorthi sathyamoorthi
SCLINIC\jdecker SCLINIC\jdecker
Scott Aikin Scott Aikin
Scott Goodhew
Sebastian Zaha Sebastian Zaha
shaund shaund
shaun gilchrist shaun gilchrist
@ -330,6 +379,7 @@ sheopory
Shiv Deepak Shiv Deepak
Shmuel Englard Shmuel Englard
Shubham Jain Shubham Jain
silverwind
snasa snasa
soliton4 soliton4
sonson sonson
@ -344,6 +394,7 @@ stoskov
Taha Jahangir Taha Jahangir
Takuji Shimokawa Takuji Shimokawa
Tarmil Tarmil
tel
tfjgeorge tfjgeorge
Thaddee Tyl Thaddee Tyl
TheHowl TheHowl
@ -369,13 +420,17 @@ Vincent Woo
Volker Mische Volker Mische
wenli wenli
Wesley Wiser Wesley Wiser
Will Binns-Smith
William Jamieson William Jamieson
William Stein William Stein
Willy
Wojtek Ptak Wojtek Ptak
Xavier Mendez Xavier Mendez
Yassin N. Hassan
YNH Webdev YNH Webdev
Yunchi Luo Yunchi Luo
Yuvi Panda Yuvi Panda
Zachary Dremann Zachary Dremann
Zhang Hao
zziuni zziuni
魏鹏刚 魏鹏刚

View File

@ -7,17 +7,17 @@
## Getting help ## Getting help
Community discussion, questions, and informal bug reporting is done on the Community discussion, questions, and informal bug reporting is done on the
[CodeMirror Google group](http://groups.google.com/group/codemirror). [discuss.CodeMirror forum](http://discuss.codemirror.net).
## Submitting bug reports ## Submitting bug reports
The preferred way to report bugs is to use the The preferred way to report bugs is to use the
[GitHub issue tracker](http://github.com/marijnh/CodeMirror/issues). Before [GitHub issue tracker](http://github.com/codemirror/CodeMirror/issues). Before
reporting a bug, read these pointers. reporting a bug, read these pointers.
**Note:** The issue tracker is for *bugs*, not requests for help. Questions **Note:** The issue tracker is for *bugs*, not requests for help. Questions
should be asked on the should be asked on the
[CodeMirror Google group](http://groups.google.com/group/codemirror) instead. [discuss.CodeMirror forum](http://discuss.codemirror.net) instead.
### Reporting bugs effectively ### Reporting bugs effectively
@ -48,7 +48,7 @@ should be asked on the
## Contributing code ## Contributing code
- Make sure you have a [GitHub Account](https://github.com/signup/free) - Make sure you have a [GitHub Account](https://github.com/signup/free)
- Fork [CodeMirror](https://github.com/marijnh/CodeMirror/) - Fork [CodeMirror](https://github.com/codemirror/CodeMirror/)
([how to fork a repo](https://help.github.com/articles/fork-a-repo)) ([how to fork a repo](https://help.github.com/articles/fork-a-repo))
- Make your changes - Make your changes
- If your changes are easy to test or likely to regress, add tests. - If your changes are easy to test or likely to regress, add tests.

View File

@ -1,6 +1,7 @@
# CodeMirror # CodeMirror
[![Build Status](https://travis-ci.org/marijnh/CodeMirror.svg)](https://travis-ci.org/marijnh/CodeMirror) [![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror)
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror) [![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)
[Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png)](https://marijnhaverbeke.nl/fund/)
CodeMirror is a JavaScript component that provides a code editor in CodeMirror is a JavaScript component that provides a code editor in
the browser. When a mode is available for the language you are coding the browser. When a mode is available for the language you are coding
@ -8,4 +9,4 @@ in, it will color your code, and optionally help with indentation.
The project page is http://codemirror.net The project page is http://codemirror.net
The manual is at http://codemirror.net/doc/manual.html The manual is at http://codemirror.net/doc/manual.html
The contributing guidelines are in [CONTRIBUTING.md](https://github.com/marijnh/CodeMirror/blob/master/CONTRIBUTING.md) The contributing guidelines are in [CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md)

0
codemirror/bin/authors.sh Normal file → Executable file
View File

0
codemirror/bin/compress Normal file → Executable file
View File

15
codemirror/bin/lint Normal file → Executable file
View File

@ -1,16 +1,3 @@
#!/usr/bin/env node #!/usr/bin/env node
var lint = require("../test/lint/lint"), process.exit(require("../test/lint").ok ? 0 : 1);
path = require("path");
if (process.argv.length > 2) {
lint.checkDir(process.argv[2]);
} else {
process.chdir(path.resolve(__dirname, ".."));
lint.checkDir("lib");
lint.checkDir("mode");
lint.checkDir("addon");
lint.checkDir("keymap");
}
process.exit(lint.success() ? 0 : 1);

4
codemirror/bin/release Normal file → Executable file
View File

@ -41,6 +41,6 @@ rewrite("doc/compress.html", function(cmp) {
}); });
rewrite("index.html", function(index) { rewrite("index.html", function(index) {
return index.replace(/<strong>version \d+\.\d+<\/strong>/, return index.replace(/\.zip">\d+\.\d+<\/a>/,
"<strong>version " + simple + "</strong>"); ".zip\">" + simple + "</a>");
}); });

0
codemirror/bin/source-highlight Normal file → Executable file
View File

View File

@ -1,6 +1,6 @@
{ {
"name": "codemirror", "name": "codemirror",
"version":"4.6.0", "version":"5.0.0",
"main": ["lib/codemirror.js", "lib/codemirror.css"], "main": ["lib/codemirror.js", "lib/codemirror.css"],
"ignore": [ "ignore": [
"**/.*", "**/.*",

View File

@ -21,12 +21,12 @@
</style> </style>
<div id=nav> <div id=nav>
<a href="http://codemirror.net"><img id=logo src="doc/logo.png"></a> <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="doc/logo.png"></a>
<ul> <ul>
<li><a class=active data-default="true" href="#description">Home</a> <li><a class=active data-default="true" href="#description">Home</a>
<li><a href="doc/manual.html">Manual</a> <li><a href="doc/manual.html">Manual</a>
<li><a href="https://github.com/marijnh/codemirror">Code</a> <li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul> </ul>
<ul> <ul>
<li><a href="#features">Features</a> <li><a href="#features">Features</a>
@ -40,7 +40,7 @@
<section id=description class=first> <section id=description class=first>
<p><strong>CodeMirror</strong> is a versatile text editor <p><strong>CodeMirror</strong> is a versatile text editor
implemented in JavaScript for the browser. It is specialized for implemented in JavaScript for the browser. It is specialized for
editing code, and comes with a number of language modes and addons editing code, and comes with a number of <a href="mode/index.html">language modes</a> and <a href="doc/manual.html#addons">addons</a>
that implement more advanced editing functionality.</p> that implement more advanced editing functionality.</p>
<p>A rich <a href="doc/manual.html#api">programming API</a> and a <p>A rich <a href="doc/manual.html#api">programming API</a> and a
@ -57,7 +57,7 @@
<script src="lib/codemirror.js"></script> <script src="lib/codemirror.js"></script>
<script> <script>
var editor = CodeMirror.fromTextArea(myTextarea, { var editor = CodeMirror.fromTextArea(myTextarea, {
mode: "text/html" lineNumbers: true
}); });
</script></textarea> </script></textarea>
<select id="demolist" onchange="document.location = this.options[this.selectedIndex].value;"> <select id="demolist" onchange="document.location = this.options[this.selectedIndex].value;">
@ -75,6 +75,7 @@
<option value="demo/tern.html">Tern integration</option> <option value="demo/tern.html">Tern integration</option>
<option value="demo/merge.html">Merge/diff interface</option> <option value="demo/merge.html">Merge/diff interface</option>
<option value="demo/fullscreen.html">Full-screen editor</option> <option value="demo/fullscreen.html">Full-screen editor</option>
<option value="demo/simplescrollbars.html">Custom scrollbars</option>
</select></form> </select></form>
<script> <script>
var editor = CodeMirror.fromTextArea(document.getElementById("demotext"), { var editor = CodeMirror.fromTextArea(document.getElementById("demotext"), {
@ -83,46 +84,42 @@
matchBrackets: true matchBrackets: true
}); });
</script> </script>
<div style="position: relative; margin: 1em 0;">
<a class="bigbutton left" href="http://codemirror.net/codemirror.zip">DOWNLOAD LATEST RELEASE</a> <div class=actions>
<div><strong>version 4.6</strong> (<a href="doc/releases.html">Release notes</a>)</div> <div class=actionspicture>
<div>or use the <a href="doc/compress.html">minification helper</a></div> <img src="doc/yinyang.png" class=yinyang>
<div style="position: absolute; top: 0; right: 0; text-align: right"> <div class="actionlink download">
<span class="bigbutton right" onclick="document.getElementById('paypal').submit();">DONATE WITH PAYPAL</span> <a href="http://codemirror.net/codemirror.zip">DOWNLOAD</a>
<div style="position: relative">
or <span onclick="document.getElementById('bankinfo').style.display = 'block';" class=quasilink>Bank</span>,
<span onclick="document.getElementById('bcinfo').style.display = 'block';" class=quasilink>Bitcoin</span>,
<a href="https://www.gittip.com/marijnh">Gittip</a>,
<a href="https://flattr.com/profile/marijnh">Flattr</a><br>
<div id=bankinfo class=bankinfo>
<span class=bankinfo_close onclick="document.getElementById('bankinfo').style.display = '';">×</span>
Bank: <i>Rabobank</i><br/>
Country: <i>Netherlands</i><br/>
SWIFT: <i>RABONL2U</i><br/>
Account: <i>147850770</i><br/>
Name: <i>Marijn Haverbeke</i><br/>
IBAN: <i>NL26 RABO 0147 8507 70</i>
</div>
<div id=bcinfo class=bankinfo>
<span class=bankinfo_close onclick="document.getElementById('bcinfo').style.display = '';">×</span>
Bitcoin address: 1HVnnU8E9yLPeFyNgNtUPB5deXBvUmZ6Nx
</div>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paypal">
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="hosted_button_id" value="3FVHS5FGUY7CC"/>
</form>
</div> </div>
<div> <div class="actionlink fund">
Purchase <a href="http://codemirror.com">commercial support</a> <a href="https://marijnhaverbeke.nl/fund/">FUND</a>
</div> </div>
</div> </div>
<div class=actionsleft>
Get the current version: <a href="http://codemirror.net/codemirror.zip">5.0</a>.<br>
You can see the <a href="https://github.com/codemirror/codemirror" title="Github repository">code</a> or<br>
read the <a href="doc/releases.html">release notes</a>.<br>
There is a <a href="doc/compress.html">minification helper</a>.
</div>
<div class=actionsright>
Software needs maintenance,<br>
maintainers need to subsist.<br>
Current funding status = <img src="https://marijnhaverbeke.nl/fund/status_s.png" title="Current maintainer happiness" style="vertical-align: middle; height: 16px; width: 16px"><br>
You can help <a href="https://marijnhaverbeke.nl/fund/" title="Set up a monthly contribution">per month</a> or
<a title="Donate with Paypal" href="javascript:document.getElementById('paypal').submit();">once</a>.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paypal">
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="hosted_button_id" value="3FVHS5FGUY7CC"/>
</form>
</div>
</div> </div>
</section> </section>
<section id=features> <section id=features>
<h2>Features</h2> <h2>Features</h2>
<ul> <ul>
<li>Support for <a href="mode/index.html">over 60 languages</a> out of the box <li>Support for <a href="mode/index.html">over 90 languages</a> out of the box
<li>A powerful, <a href="mode/htmlmixed/index.html">composable</a> language mode <a href="doc/manual.html#modeapi">system</a> <li>A powerful, <a href="mode/htmlmixed/index.html">composable</a> language mode <a href="doc/manual.html#modeapi">system</a>
<li><a href="doc/manual.html#addon_show-hint">Autocompletion</a> (<a href="demo/xmlcomplete.html">XML</a>) <li><a href="doc/manual.html#addon_show-hint">Autocompletion</a> (<a href="demo/xmlcomplete.html">XML</a>)
<li><a href="doc/manual.html#addon_foldcode">Code folding</a> <li><a href="doc/manual.html#addon_foldcode">Code folding</a>
@ -156,7 +153,7 @@
and <a href="doc/realworld.html">many other projects</a>.</p> and <a href="doc/realworld.html">many other projects</a>.</p>
<p>Development and bug tracking happens <p>Development and bug tracking happens
on <a href="https://github.com/marijnh/CodeMirror/">github</a> on <a href="https://github.com/codemirror/CodeMirror/">github</a>
(<a href="http://marijnhaverbeke.nl/git/codemirror">alternate git (<a href="http://marijnhaverbeke.nl/git/codemirror">alternate git
repository</a>). repository</a>).
Please <a href="http://codemirror.net/doc/reporting.html">read these Please <a href="http://codemirror.net/doc/reporting.html">read these
@ -165,7 +162,7 @@
license that CodeMirror uses.</p> license that CodeMirror uses.</p>
<p>Discussion around the project is done on <p>Discussion around the project is done on
a <a href="http://groups.google.com/group/codemirror">mailing list</a>. a <a href="http://discuss.codemirror.net">discussion forum</a>.
There is also There is also
the <a href="http://groups.google.com/group/codemirror-announce">codemirror-announce</a> the <a href="http://groups.google.com/group/codemirror-announce">codemirror-announce</a>
list, which is only used for major announcements (such as new list, which is only used for major announcements (such as new
@ -175,14 +172,14 @@
<p>A list of CodeMirror-related software that is not part of the <p>A list of CodeMirror-related software that is not part of the
main distribution is maintained main distribution is maintained
on <a href="https://github.com/marijnh/CodeMirror/wiki/CodeMirror-addons">our on <a href="https://github.com/codemirror/CodeMirror/wiki/CodeMirror-addons">our
wiki</a>. Feel free to add your project.</p> wiki</a>. Feel free to add your project.</p>
</section> </section>
<section id=browsersupport> <section id=browsersupport>
<h2>Browser support</h2> <h2>Browser support</h2>
<p>The <em>desktop</em> versions of the following browsers, <p>The <em>desktop</em> versions of the following browsers,
in <em>standards mode</em> (HTML5 <code>&lt;!doctype html></code> in <em>standards mode</em> (HTML5 <code>&lt;!doctype html></code>
recommended) are supported:</p> recommended) are supported:</p>
<table style="margin-bottom: 1em"> <table style="margin-bottom: 1em">
<tr><th>Firefox</th><td>version 4 and up</td></tr> <tr><th>Firefox</th><td>version 4 and up</td></tr>
@ -191,9 +188,9 @@
<tr><th style="padding-right: 1em;">Internet Explorer</th><td>version 8 and up</td></tr> <tr><th style="padding-right: 1em;">Internet Explorer</th><td>version 8 and up</td></tr>
<tr><th>Opera</th><td>version 9 and up</td></tr> <tr><th>Opera</th><td>version 9 and up</td></tr>
</table> </table>
<p>Modern mobile browsers tend to partly work. Bug reports and <p>Support for modern mobile browsers is experimental. Recent
patches for mobile support are welcome, but the maintainer does not versions of the iOS browser and Chrome on Android should work
have the time or budget to actually work on it himself.</p> pretty well.</p>
</section> </section>
</article> </article>

View File

@ -132,8 +132,8 @@
}; };
} }
function findEnd(cm, by, dir) { function findEnd(cm, pos, by, dir) {
var pos = cm.getCursor(), prefix = getPrefix(cm); var prefix = getPrefix(cm);
if (prefix < 0) { dir = -dir; prefix = -prefix; } if (prefix < 0) { dir = -dir; prefix = -prefix; }
for (var i = 0; i < prefix; ++i) { for (var i = 0; i < prefix; ++i) {
var newPos = by(cm, pos, dir); var newPos = by(cm, pos, dir);
@ -145,14 +145,31 @@
function move(by, dir) { function move(by, dir) {
var f = function(cm) { var f = function(cm) {
cm.extendSelection(findEnd(cm, by, dir)); cm.extendSelection(findEnd(cm, cm.getCursor(), by, dir));
}; };
f.motion = true; f.motion = true;
return f; return f;
} }
function killTo(cm, by, dir) { function killTo(cm, by, dir) {
kill(cm, cm.getCursor(), findEnd(cm, by, dir), true); var selections = cm.listSelections(), cursor;
var i = selections.length;
while (i--) {
cursor = selections[i].head;
kill(cm, cursor, findEnd(cm, cursor, by, dir), true);
}
}
function killRegion(cm) {
if (cm.somethingSelected()) {
var selections = cm.listSelections(), selection;
var i = selections.length;
while (i--) {
selection = selections[i];
kill(cm, selection.anchor, selection.head);
}
return true;
}
} }
function addPrefix(cm, digit) { function addPrefix(cm, digit) {
@ -256,7 +273,7 @@
// Actual keymap // Actual keymap
var keyMap = CodeMirror.keyMap.emacs = { var keyMap = CodeMirror.keyMap.emacs = CodeMirror.normalizeKeyMap({
"Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"));}, "Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"));},
"Ctrl-K": repeated(function(cm) { "Ctrl-K": repeated(function(cm) {
var start = cm.getCursor(), end = cm.clipPos(Pos(start.line)); var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));
@ -283,9 +300,9 @@
"Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1), "Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1),
"Right": move(byChar, 1), "Left": move(byChar, -1), "Right": move(byChar, 1), "Left": move(byChar, -1),
"Ctrl-D": function(cm) { killTo(cm, byChar, 1); }, "Ctrl-D": function(cm) { killTo(cm, byChar, 1); },
"Delete": function(cm) { killTo(cm, byChar, 1); }, "Delete": function(cm) { killRegion(cm) || killTo(cm, byChar, 1); },
"Ctrl-H": function(cm) { killTo(cm, byChar, -1); }, "Ctrl-H": function(cm) { killTo(cm, byChar, -1); },
"Backspace": function(cm) { killTo(cm, byChar, -1); }, "Backspace": function(cm) { killRegion(cm) || killTo(cm, byChar, -1); },
"Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1), "Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1),
"Alt-D": function(cm) { killTo(cm, byWord, 1); }, "Alt-D": function(cm) { killTo(cm, byWord, 1); },
@ -309,7 +326,8 @@
"Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1), "Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1),
"Shift-Ctrl-Alt-2": function(cm) { "Shift-Ctrl-Alt-2": function(cm) {
cm.setSelection(findEnd(cm, byExpr, 1), cm.getCursor()); var cursor = cm.getCursor();
cm.setSelection(findEnd(cm, cursor, byExpr, 1), cursor);
}, },
"Ctrl-Alt-T": function(cm) { "Ctrl-Alt-T": function(cm) {
var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1); var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1);
@ -353,27 +371,7 @@
"Alt-/": "autocomplete", "Alt-/": "autocomplete",
"Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto", "Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto",
"Alt-G": function(cm) {cm.setOption("keyMap", "emacs-Alt-G");}, "Alt-G G": function(cm) {
"Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");},
"Ctrl-Q": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-Q");},
"Ctrl-U": addPrefixMap
};
CodeMirror.keyMap["emacs-Ctrl-X"] = {
"Tab": function(cm) {
cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit"));
},
"Ctrl-X": function(cm) {
cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor"));
},
"Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": repeated("undo"), "K": "close",
"Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), true); },
auto: "emacs", nofallthrough: true, disableInput: true
};
CodeMirror.keyMap["emacs-Alt-G"] = {
"G": function(cm) {
var prefix = getPrefix(cm, true); var prefix = getPrefix(cm, true);
if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1); if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1);
@ -383,13 +381,25 @@
cm.setCursor(num - 1); cm.setCursor(num - 1);
}); });
}, },
auto: "emacs", nofallthrough: true, disableInput: true
};
CodeMirror.keyMap["emacs-Ctrl-Q"] = { "Ctrl-X Tab": function(cm) {
"Tab": repeated("insertTab"), cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit"));
auto: "emacs", nofallthrough: true },
}; "Ctrl-X Ctrl-X": function(cm) {
cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor"));
},
"Ctrl-X Ctrl-S": "save",
"Ctrl-X Ctrl-W": "save",
"Ctrl-X S": "saveAll",
"Ctrl-X F": "open",
"Ctrl-X U": repeated("undo"),
"Ctrl-X K": "close",
"Ctrl-X Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), true); },
"Ctrl-X H": "selectAll",
"Ctrl-Q Tab": repeated("insertTab"),
"Ctrl-U": addPrefixMap
});
var prefixMap = {"Ctrl-G": clearPrefix}; var prefixMap = {"Ctrl-G": clearPrefix};
function regPrefix(d) { function regPrefix(d) {

View File

@ -386,9 +386,7 @@
map["Alt-Q"] = "wrapLines"; map["Alt-Q"] = "wrapLines";
var mapK = CodeMirror.keyMap["sublime-Ctrl-K"] = {auto: "sublime", nofallthrough: true}; var cK = ctrl + "K ";
map[ctrl + "K"] = function(cm) {cm.setOption("keyMap", "sublime-Ctrl-K");};
function modifyWordOrSelection(cm, mod) { function modifyWordOrSelection(cm, mod) {
cm.operation(function() { cm.operation(function() {
@ -409,9 +407,9 @@
}); });
} }
mapK[ctrl + "Backspace"] = "delLineLeft"; map[cK + ctrl + "Backspace"] = "delLineLeft";
cmds[mapK[ctrl + "K"] = "delLineRight"] = function(cm) { cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) {
cm.operation(function() { cm.operation(function() {
var ranges = cm.listSelections(); var ranges = cm.listSelections();
for (var i = ranges.length - 1; i >= 0; i--) for (var i = ranges.length - 1; i >= 0; i--)
@ -420,22 +418,22 @@
}); });
}; };
cmds[mapK[ctrl + "U"] = "upcaseAtCursor"] = function(cm) { cmds[map[cK + ctrl + "U"] = "upcaseAtCursor"] = function(cm) {
modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); }); modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); });
}; };
cmds[mapK[ctrl + "L"] = "downcaseAtCursor"] = function(cm) { cmds[map[cK + ctrl + "L"] = "downcaseAtCursor"] = function(cm) {
modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); }); modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); });
}; };
cmds[mapK[ctrl + "Space"] = "setSublimeMark"] = function(cm) { cmds[map[cK + ctrl + "Space"] = "setSublimeMark"] = function(cm) {
if (cm.state.sublimeMark) cm.state.sublimeMark.clear(); if (cm.state.sublimeMark) cm.state.sublimeMark.clear();
cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); cm.state.sublimeMark = cm.setBookmark(cm.getCursor());
}; };
cmds[mapK[ctrl + "A"] = "selectToSublimeMark"] = function(cm) { cmds[map[cK + ctrl + "A"] = "selectToSublimeMark"] = function(cm) {
var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
if (found) cm.setSelection(cm.getCursor(), found); if (found) cm.setSelection(cm.getCursor(), found);
}; };
cmds[mapK[ctrl + "W"] = "deleteToSublimeMark"] = function(cm) { cmds[map[cK + ctrl + "W"] = "deleteToSublimeMark"] = function(cm) {
var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
if (found) { if (found) {
var from = cm.getCursor(), to = found; var from = cm.getCursor(), to = found;
@ -444,7 +442,7 @@
cm.replaceRange("", from, to); cm.replaceRange("", from, to);
} }
}; };
cmds[mapK[ctrl + "X"] = "swapWithSublimeMark"] = function(cm) { cmds[map[cK + ctrl + "X"] = "swapWithSublimeMark"] = function(cm) {
var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
if (found) { if (found) {
cm.state.sublimeMark.clear(); cm.state.sublimeMark.clear();
@ -452,13 +450,13 @@
cm.setCursor(found); cm.setCursor(found);
} }
}; };
cmds[mapK[ctrl + "Y"] = "sublimeYank"] = function(cm) { cmds[map[cK + ctrl + "Y"] = "sublimeYank"] = function(cm) {
if (cm.state.sublimeKilled != null) if (cm.state.sublimeKilled != null)
cm.replaceSelection(cm.state.sublimeKilled, null, "paste"); cm.replaceSelection(cm.state.sublimeKilled, null, "paste");
}; };
mapK[ctrl + "G"] = "clearBookmarks"; map[cK + ctrl + "G"] = "clearBookmarks";
cmds[mapK[ctrl + "C"] = "showInCenter"] = function(cm) { cmds[map[cK + ctrl + "C"] = "showInCenter"] = function(cm) {
var pos = cm.cursorCoords(null, "local"); var pos = cm.cursorCoords(null, "local");
cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2); cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);
}; };
@ -530,7 +528,7 @@
map["Shift-" + ctrl + "["] = "fold"; map["Shift-" + ctrl + "["] = "fold";
map["Shift-" + ctrl + "]"] = "unfold"; map["Shift-" + ctrl + "]"] = "unfold";
mapK[ctrl + "0"] = mapK[ctrl + "j"] = "unfoldAll"; map[cK + ctrl + "0"] = map[cK + ctrl + "j"] = "unfoldAll";
map[ctrl + "I"] = "findIncremental"; map[ctrl + "I"] = "findIncremental";
map["Shift-" + ctrl + "I"] = "findIncrementalReverse"; map["Shift-" + ctrl + "I"] = "findIncrementalReverse";
@ -538,4 +536,5 @@
map["F3"] = "findNext"; map["F3"] = "findNext";
map["Shift-F3"] = "findPrev"; map["Shift-F3"] = "findPrev";
CodeMirror.normalizeKeyMap(map);
}); });

2461
codemirror/keymap/vim.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,7 @@
/* Set height, width, borders, and global font properties here */ /* Set height, width, borders, and global font properties here */
font-family: monospace; font-family: monospace;
height: 300px; height: 300px;
} color: black;
.CodeMirror-scroll {
/* Set scrolling behaviour here */
overflow: auto;
} }
/* PADDING */ /* PADDING */
@ -52,12 +49,12 @@
.CodeMirror div.CodeMirror-secondarycursor { .CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver; border-left: 1px solid silver;
} }
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { .CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
width: auto; width: auto;
border: 0; border: 0;
background: #7e7; background: #7e7;
} }
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursors { .CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1; z-index: 1;
} }
@ -87,7 +84,7 @@
/* Can style cursor different in overwrite (non-insert) mode */ /* Can style cursor different in overwrite (non-insert) mode */
div.CodeMirror-overwrite div.CodeMirror-cursor {} div.CodeMirror-overwrite div.CodeMirror-cursor {}
.cm-tab { display: inline-block; } .cm-tab { display: inline-block; text-decoration: inherit; }
.CodeMirror-ruler { .CodeMirror-ruler {
border-left: 1px solid #ccc; border-left: 1px solid #ccc;
@ -125,6 +122,7 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
.cm-header, .cm-strong {font-weight: bold;} .cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;} .cm-em {font-style: italic;}
.cm-link {text-decoration: underline;} .cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}
.cm-s-default .cm-error {color: #f00;} .cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;} .cm-invalidchar {color: #f00;}
@ -142,14 +140,13 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
the editor. You probably shouldn't touch them. */ the editor. You probably shouldn't touch them. */
.CodeMirror { .CodeMirror {
line-height: 1;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background: white; background: white;
color: black;
} }
.CodeMirror-scroll { .CodeMirror-scroll {
overflow: scroll !important; /* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */ /* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */ /* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-right: -30px; margin-bottom: -30px; margin-right: -30px;
@ -194,7 +191,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-gutters { .CodeMirror-gutters {
position: absolute; left: 0; top: 0; position: absolute; left: 0; top: 0;
padding-bottom: 30px;
z-index: 3; z-index: 3;
} }
.CodeMirror-gutter { .CodeMirror-gutter {
@ -202,18 +198,27 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
height: 100%; height: 100%;
-moz-box-sizing: content-box; -moz-box-sizing: content-box;
box-sizing: content-box; box-sizing: content-box;
padding-bottom: 30px;
margin-bottom: -32px;
display: inline-block; display: inline-block;
margin-bottom: -30px;
/* Hack to make IE7 behave */ /* Hack to make IE7 behave */
*zoom:1; *zoom:1;
*display:inline; *display:inline;
} }
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
height: 100%;
}
.CodeMirror-gutter-elt { .CodeMirror-gutter-elt {
position: absolute; position: absolute;
cursor: default; cursor: default;
z-index: 4; z-index: 4;
} }
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.CodeMirror-lines { .CodeMirror-lines {
cursor: text; cursor: text;
@ -234,6 +239,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
z-index: 2; z-index: 2;
position: relative; position: relative;
overflow: visible; overflow: visible;
-webkit-tap-highlight-color: transparent;
} }
.CodeMirror-wrap pre { .CodeMirror-wrap pre {
word-wrap: break-word; word-wrap: break-word;
@ -255,8 +261,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-widget {} .CodeMirror-widget {}
.CodeMirror-wrap .CodeMirror-scroll { .CodeMirror-code {
overflow-x: hidden; outline: none;
} }
.CodeMirror-measure { .CodeMirror-measure {
@ -286,6 +292,8 @@ div.CodeMirror-cursors {
.CodeMirror-selected { background: #d9d9d9; } .CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; } .CodeMirror-crosshair { cursor: crosshair; }
.CodeMirror ::selection { background: #d7d4f0; }
.CodeMirror ::-moz-selection { background: #d7d4f0; }
.cm-searching { .cm-searching {
background: #ffa; background: #ffa;
@ -305,5 +313,8 @@ div.CodeMirror-cursors {
} }
} }
/* See issue #2901 */
.cm-tab-wrap-hack:after { content: ''; }
/* Help users use markselection to safely style text background */ /* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext { background: none; } span.CodeMirror-selectedtext { background: none; }

File diff suppressed because it is too large Load Diff

View File

@ -16,13 +16,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
var indentUnit = config.indentUnit, var indentUnit = config.indentUnit,
tokenHooks = parserConfig.tokenHooks, tokenHooks = parserConfig.tokenHooks,
documentTypes = parserConfig.documentTypes || {},
mediaTypes = parserConfig.mediaTypes || {}, mediaTypes = parserConfig.mediaTypes || {},
mediaFeatures = parserConfig.mediaFeatures || {}, mediaFeatures = parserConfig.mediaFeatures || {},
propertyKeywords = parserConfig.propertyKeywords || {}, propertyKeywords = parserConfig.propertyKeywords || {},
nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
fontProperties = parserConfig.fontProperties || {},
counterDescriptors = parserConfig.counterDescriptors || {},
colorKeywords = parserConfig.colorKeywords || {}, colorKeywords = parserConfig.colorKeywords || {},
valueKeywords = parserConfig.valueKeywords || {}, valueKeywords = parserConfig.valueKeywords || {},
fontProperties = parserConfig.fontProperties || {},
allowNested = parserConfig.allowNested; allowNested = parserConfig.allowNested;
var type, override; var type, override;
@ -57,6 +59,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
if (/[\d.]/.test(stream.peek())) { if (/[\d.]/.test(stream.peek())) {
stream.eatWhile(/[\w.%]/); stream.eatWhile(/[\w.%]/);
return ret("number", "unit"); return ret("number", "unit");
} else if (stream.match(/^-[\w\\\-]+/)) {
stream.eatWhile(/[\w\\\-]/);
if (stream.match(/^\s*:/, false))
return ret("variable-2", "variable-definition");
return ret("variable-2", "variable");
} else if (stream.match(/^\w+-/)) { } else if (stream.match(/^\w+-/)) {
return ret("meta", "meta"); return ret("meta", "meta");
} }
@ -66,7 +73,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return ret("qualifier", "qualifier"); return ret("qualifier", "qualifier");
} else if (/[:;{}\[\]\(\)]/.test(ch)) { } else if (/[:;{}\[\]\(\)]/.test(ch)) {
return ret(null, ch); return ret(null, ch);
} else if (ch == "u" && stream.match("rl(")) { } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) ||
(ch == "d" && stream.match("omain(")) ||
(ch == "r" && stream.match("egexp("))) {
stream.backUp(1); stream.backUp(1);
state.tokenize = tokenParenthesized; state.tokenize = tokenParenthesized;
return ret("property", "word"); return ret("property", "word");
@ -148,10 +157,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return pushContext(state, stream, "block"); return pushContext(state, stream, "block");
} else if (type == "}" && state.context.prev) { } else if (type == "}" && state.context.prev) {
return popContext(state); return popContext(state);
} else if (type == "@media") { } else if (/@(media|supports|(-moz-)?document)/.test(type)) {
return pushContext(state, stream, "media"); return pushContext(state, stream, "atBlock");
} else if (type == "@font-face") { } else if (/@(font-face|counter-style)/.test(type)) {
return "font_face_before"; state.stateArg = type;
return "restricted_atBlock_before";
} else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
return "keyframes"; return "keyframes";
} else if (type && type.charAt(0) == "@") { } else if (type && type.charAt(0) == "@") {
@ -182,7 +192,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
override = "string-2"; override = "string-2";
return "maybeprop"; return "maybeprop";
} else if (allowNested) { } else if (allowNested) {
override = stream.match(/^\s*:/, false) ? "property" : "tag"; override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
return "block"; return "block";
} else { } else {
override += " error"; override += " error";
@ -241,47 +251,63 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return pass(type, stream, state); return pass(type, stream, state);
}; };
states.media = function(type, stream, state) { states.atBlock = function(type, stream, state) {
if (type == "(") return pushContext(state, stream, "media_parens"); if (type == "(") return pushContext(state, stream, "atBlock_parens");
if (type == "}") return popAndPass(type, stream, state); if (type == "}") return popAndPass(type, stream, state);
if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
if (type == "word") { if (type == "word") {
var word = stream.current().toLowerCase(); var word = stream.current().toLowerCase();
if (word == "only" || word == "not" || word == "and") if (word == "only" || word == "not" || word == "and" || word == "or")
override = "keyword"; override = "keyword";
else if (documentTypes.hasOwnProperty(word))
override = "tag";
else if (mediaTypes.hasOwnProperty(word)) else if (mediaTypes.hasOwnProperty(word))
override = "attribute"; override = "attribute";
else if (mediaFeatures.hasOwnProperty(word)) else if (mediaFeatures.hasOwnProperty(word))
override = "property"; override = "property";
else if (propertyKeywords.hasOwnProperty(word))
override = "property";
else if (nonStandardPropertyKeywords.hasOwnProperty(word))
override = "string-2";
else if (valueKeywords.hasOwnProperty(word))
override = "atom";
else else
override = "error"; override = "error";
} }
return state.context.type; return state.context.type;
}; };
states.media_parens = function(type, stream, state) { states.atBlock_parens = function(type, stream, state) {
if (type == ")") return popContext(state); if (type == ")") return popContext(state);
if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
return states.media(type, stream, state); return states.atBlock(type, stream, state);
}; };
states.font_face_before = function(type, stream, state) { states.restricted_atBlock_before = function(type, stream, state) {
if (type == "{") if (type == "{")
return pushContext(state, stream, "font_face"); return pushContext(state, stream, "restricted_atBlock");
if (type == "word" && state.stateArg == "@counter-style") {
override = "variable";
return "restricted_atBlock_before";
}
return pass(type, stream, state); return pass(type, stream, state);
}; };
states.font_face = function(type, stream, state) { states.restricted_atBlock = function(type, stream, state) {
if (type == "}") return popContext(state); if (type == "}") {
state.stateArg = null;
return popContext(state);
}
if (type == "word") { if (type == "word") {
if (!fontProperties.hasOwnProperty(stream.current().toLowerCase())) if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||
(state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))
override = "error"; override = "error";
else else
override = "property"; override = "property";
return "maybeprop"; return "maybeprop";
} }
return "font_face"; return "restricted_atBlock";
}; };
states.keyframes = function(type, stream, state) { states.keyframes = function(type, stream, state) {
@ -309,6 +335,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
startState: function(base) { startState: function(base) {
return {tokenize: null, return {tokenize: null,
state: "top", state: "top",
stateArg: null,
context: new Context("top", base || 0, null)}; context: new Context("top", base || 0, null)};
}, },
@ -329,9 +356,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
var indent = cx.indent; var indent = cx.indent;
if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
if (cx.prev && if (cx.prev &&
(ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") || (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "restricted_atBlock") ||
ch == ")" && (cx.type == "parens" || cx.type == "media_parens") || ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
ch == "{" && (cx.type == "at" || cx.type == "media"))) { ch == "{" && (cx.type == "at" || cx.type == "atBlock"))) {
indent = cx.indent - indentUnit; indent = cx.indent - indentUnit;
cx = cx.prev; cx = cx.prev;
} }
@ -353,6 +380,10 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return keys; return keys;
} }
var documentTypes_ = [
"domain", "regexp", "url", "url-prefix"
], documentTypes = keySet(documentTypes_);
var mediaTypes_ = [ var mediaTypes_ = [
"all", "aural", "braille", "handheld", "print", "projection", "screen", "all", "aural", "braille", "handheld", "print", "projection", "screen",
"tty", "tv", "embossed" "tty", "tv", "embossed"
@ -469,6 +500,16 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"searchfield-results-decoration", "zoom" "searchfield-results-decoration", "zoom"
], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
var fontProperties_ = [
"font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
"font-stretch", "font-weight", "font-style"
], fontProperties = keySet(fontProperties_);
var counterDescriptors_ = [
"additive-symbols", "fallback", "negative", "pad", "prefix", "range",
"speak-as", "suffix", "symbols", "system"
], counterDescriptors = keySet(counterDescriptors_);
var colorKeywords_ = [ var colorKeywords_ = [
"aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
"bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
@ -499,46 +540,49 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
], colorKeywords = keySet(colorKeywords_); ], colorKeywords = keySet(colorKeywords_);
var valueKeywords_ = [ var valueKeywords_ = [
"above", "absolute", "activeborder", "activecaption", "afar", "above", "absolute", "activeborder", "additive", "activecaption", "afar",
"after-white-space", "ahead", "alias", "all", "all-scroll", "alternate", "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate",
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace", "always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
"arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page", "arabic-indic", "armenian", "asterisks", "attr", "auto", "avoid", "avoid-column", "avoid-page",
"avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",
"bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
"both", "bottom", "break", "break-all", "break-word", "button", "button-bevel", "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
"cell", "center", "checkbox", "circle", "cjk-earthly-branch", "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
"col-resize", "collapse", "column", "compact", "condensed", "contain", "content", "col-resize", "collapse", "column", "compact", "condensed", "contain", "content",
"content-box", "context-menu", "continuous", "copy", "cover", "crop", "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
"cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", "cross", "crosshair", "currentcolor", "cursive", "cyclic", "dashed", "decimal",
"decimal-leading-zero", "default", "default-button", "destination-atop", "decimal-leading-zero", "default", "default-button", "destination-atop",
"destination-in", "destination-out", "destination-over", "devanagari", "destination-in", "destination-out", "destination-over", "devanagari",
"disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted", "disc", "discard", "disclosure-closed", "disclosure-open", "document",
"double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", "dot-dash", "dot-dot-dash",
"dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
"element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
"ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et",
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
"ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed", "ethiopic-numeric", "ew-resize", "expanded", "extends", "extra-condensed",
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "footnotes",
"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
"help", "hidden", "hide", "higher", "highlight", "highlighttext", "help", "hidden", "hide", "higher", "highlight", "highlighttext",
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
"inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", "inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert",
"italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", "italic", "japanese-formal", "japanese-informal", "justify", "kannada",
"katakana", "katakana-iroha", "keep-all", "khmer",
"korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
"landscape", "lao", "large", "larger", "left", "level", "lighter", "landscape", "lao", "large", "larger", "left", "level", "lighter",
"line-through", "linear", "lines", "list-item", "listbox", "listitem", "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
"lower-roman", "lowercase", "ltr", "malayalam", "match", "lower-roman", "lowercase", "ltr", "malayalam", "match", "matrix", "matrix3d",
"media-controls-background", "media-current-time-display", "media-controls-background", "media-current-time-display",
"media-fullscreen-button", "media-mute-button", "media-play-button", "media-fullscreen-button", "media-mute-button", "media-play-button",
"media-return-to-realtime-button", "media-rewind-button", "media-return-to-realtime-button", "media-rewind-button",
@ -550,45 +594,48 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
"narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
"ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
"outside", "outside-shape", "overlay", "overline", "padding", "padding-box", "outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
"painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer", "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter",
"polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
"radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region", "progress", "push-button", "radial-gradient", "radio", "read-only",
"relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", "read-write", "read-write-plaintext-only", "rectangle", "region",
"ridge", "right", "round", "row-resize", "rtl", "run-in", "running", "relative", "repeat", "repeating-linear-gradient",
"s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield", "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
"rotateZ", "round", "row-resize", "rtl", "run-in", "running",
"s-resize", "sans-serif", "scale", "scale3d", "scaleX", "scaleY", "scaleZ",
"scroll", "scrollbar", "se-resize", "searchfield",
"searchfield-cancel-button", "searchfield-decoration", "searchfield-cancel-button", "searchfield-decoration",
"searchfield-results-button", "searchfield-results-decoration", "searchfield-results-button", "searchfield-results-decoration",
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
"single", "skip-white-space", "slide", "slider-horizontal", "simp-chinese-formal", "simp-chinese-informal", "single",
"skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
"small", "small-caps", "small-caption", "smaller", "solid", "somali", "small", "small-caps", "small-caption", "smaller", "solid", "somali",
"source-atop", "source-in", "source-out", "source-over", "space", "square", "source-atop", "source-in", "source-out", "source-over", "space", "spell-out", "square",
"square-button", "start", "static", "status-bar", "stretch", "stroke", "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
"sub", "subpixel-antialiased", "super", "sw-resize", "table", "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table",
"table-caption", "table-cell", "table-column", "table-column-group", "table-caption", "table-cell", "table-column", "table-column-group",
"table-footer-group", "table-header-group", "table-row", "table-row-group", "table-footer-group", "table-header-group", "table-row", "table-row-group",
"tamil",
"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
"trad-chinese-formal", "trad-chinese-informal",
"translate", "translate3d", "translateX", "translateY", "translateZ",
"transparent", "ultra-condensed", "ultra-expanded", "underline", "up", "transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
"vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
"visibleStroke", "visual", "w-resize", "wait", "wave", "wider", "visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
"window", "windowframe", "windowtext", "x-large", "x-small", "xor", "window", "windowframe", "windowtext", "words", "x-large", "x-small", "xor",
"xx-large", "xx-small" "xx-large", "xx-small"
], valueKeywords = keySet(valueKeywords_); ], valueKeywords = keySet(valueKeywords_);
var fontProperties_ = [ var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(propertyKeywords_)
"font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
"font-stretch", "font-weight", "font-style"
], fontProperties = keySet(fontProperties_);
var allWords = mediaTypes_.concat(mediaFeatures_).concat(propertyKeywords_)
.concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_); .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_);
CodeMirror.registerHelper("hintWords", "css", allWords); CodeMirror.registerHelper("hintWords", "css", allWords);
@ -615,13 +662,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
} }
CodeMirror.defineMIME("text/css", { CodeMirror.defineMIME("text/css", {
documentTypes: documentTypes,
mediaTypes: mediaTypes, mediaTypes: mediaTypes,
mediaFeatures: mediaFeatures, mediaFeatures: mediaFeatures,
propertyKeywords: propertyKeywords, propertyKeywords: propertyKeywords,
nonStandardPropertyKeywords: nonStandardPropertyKeywords, nonStandardPropertyKeywords: nonStandardPropertyKeywords,
fontProperties: fontProperties,
counterDescriptors: counterDescriptors,
colorKeywords: colorKeywords, colorKeywords: colorKeywords,
valueKeywords: valueKeywords, valueKeywords: valueKeywords,
fontProperties: fontProperties,
tokenHooks: { tokenHooks: {
"<": function(stream, state) { "<": function(stream, state) {
if (!stream.match("!--")) return false; if (!stream.match("!--")) return false;

View File

@ -5,16 +5,19 @@
<link rel=stylesheet href="../../doc/docs.css"> <link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css"> <link rel="stylesheet" href="../../lib/codemirror.css">
<link rel="stylesheet" href="../../addon/hint/show-hint.css">
<script src="../../lib/codemirror.js"></script> <script src="../../lib/codemirror.js"></script>
<script src="css.js"></script> <script src="css.js"></script>
<script src="../../addon/hint/show-hint.js"></script>
<script src="../../addon/hint/css-hint.js"></script>
<style>.CodeMirror {background: #f8f8f8;}</style> <style>.CodeMirror {background: #f8f8f8;}</style>
<div id=nav> <div id=nav>
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a> <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul> <ul>
<li><a href="../../index.html">Home</a> <li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a> <li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/marijnh/codemirror">Code</a> <li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul> </ul>
<ul> <ul>
<li><a href="../index.html">Language modes</a> <li><a href="../index.html">Language modes</a>
@ -60,7 +63,9 @@ code {
} }
</textarea></form> </textarea></form>
<script> <script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
extraKeys: {"Ctrl-Space": "autocomplete"},
});
</script> </script>
<p><strong>MIME types defined:</strong> <code>text/css</code>, <code>text/x-scss</code> (<a href="scss.html">demo</a>), <code>text/x-less</code> (<a href="less.html">demo</a>).</p> <p><strong>MIME types defined:</strong> <code>text/css</code>, <code>text/x-scss</code> (<a href="scss.html">demo</a>), <code>text/x-less</code> (<a href="less.html">demo</a>).</p>

View File

@ -10,12 +10,12 @@
<script src="css.js"></script> <script src="css.js"></script>
<style>.CodeMirror {border: 1px solid #ddd; line-height: 1.2;}</style> <style>.CodeMirror {border: 1px solid #ddd; line-height: 1.2;}</style>
<div id=nav> <div id=nav>
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a> <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul> <ul>
<li><a href="../../index.html">Home</a> <li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a> <li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/marijnh/codemirror">Code</a> <li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul> </ul>
<ul> <ul>
<li><a href="../index.html">Language modes</a> <li><a href="../index.html">Language modes</a>

View File

@ -9,12 +9,12 @@
<script src="css.js"></script> <script src="css.js"></script>
<style>.CodeMirror {background: #f8f8f8;}</style> <style>.CodeMirror {background: #f8f8f8;}</style>
<div id=nav> <div id=nav>
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a> <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul> <ul>
<li><a href="../../index.html">Home</a> <li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a> <li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/marijnh/codemirror">Code</a> <li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul> </ul>
<ul> <ul>
<li><a href="../index.html">Language modes</a> <li><a href="../index.html">Language modes</a>

View File

@ -126,10 +126,70 @@
MT("parens", MT("parens",
"[qualifier .foo] {", "[qualifier .foo] {",
" [property background-image]: [variable fade]([atom #000], [number 20%]);", " [property background-image]: [variable fade]([atom #000], [number 20%]);",
" [property border-image]: [variable linear-gradient](", " [property border-image]: [atom linear-gradient](",
" [atom to] [atom bottom],", " [atom to] [atom bottom],",
" [variable fade]([atom #000], [number 20%]) [number 0%],", " [variable fade]([atom #000], [number 20%]) [number 0%],",
" [variable fade]([atom #000], [number 20%]) [number 100%]", " [variable fade]([atom #000], [number 20%]) [number 100%]",
" );", " );",
"}"); "}");
MT("css_variable",
":[variable-3 root] {",
" [variable-2 --main-color]: [atom #06c];",
"}",
"[tag h1][builtin #foo] {",
" [property color]: [atom var]([variable-2 --main-color]);",
"}");
MT("supports",
"[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {",
" [property text-align-last]: [atom justify];",
"}");
MT("document",
"[def @document] [tag url]([string http://blah]),",
" [tag url-prefix]([string https://]),",
" [tag domain]([string blah.com]),",
" [tag regexp]([string \".*blah.+\"]) {",
" [builtin #id] {",
" [property background-color]: [keyword white];",
" }",
" [tag foo] {",
" [property font-family]: [variable Verdana], [atom sans-serif];",
" }",
" }");
MT("document_url",
"[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }");
MT("document_urlPrefix",
"[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }");
MT("document_domain",
"[def @document] [tag domain]([string blah.com]) { [tag foo] { } }");
MT("document_regexp",
"[def @document] [tag regexp]([string \".*blah.+\"]) { [builtin #id] { } }");
MT("counter-style",
"[def @counter-style] [variable binary] {",
" [property system]: [atom numeric];",
" [property symbols]: [number 0] [number 1];",
" [property suffix]: [string \".\"];",
" [property range]: [atom infinite];",
" [property speak-as]: [atom numeric];",
"}");
MT("counter-style-additive-symbols",
"[def @counter-style] [variable simple-roman] {",
" [property system]: [atom additive];",
" [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];",
" [property range]: [number 1] [number 49];",
"}");
MT("counter-style-use",
"[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }");
MT("counter-style-symbols",
"[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }");
})(); })();

View File

@ -1,6 +1,6 @@
{ {
"name": "codemirror", "name": "codemirror",
"version":"4.6.0", "version":"5.0.0",
"main": "lib/codemirror.js", "main": "lib/codemirror.js",
"description": "In-browser code editing made bearable", "description": "In-browser code editing made bearable",
"licenses": [{"type": "MIT", "licenses": [{"type": "MIT",
@ -8,13 +8,14 @@
"directories": {"lib": "./lib"}, "directories": {"lib": "./lib"},
"scripts": {"test": "node ./test/run.js"}, "scripts": {"test": "node ./test/run.js"},
"devDependencies": {"node-static": "0.6.0", "devDependencies": {"node-static": "0.6.0",
"phantomjs": "1.9.2-5"}, "phantomjs": "1.9.2-5",
"bugs": "http://github.com/marijnh/CodeMirror/issues", "blint": ">=0.1.1"},
"bugs": "http://github.com/codemirror/CodeMirror/issues",
"keywords": ["JavaScript", "CodeMirror", "Editor"], "keywords": ["JavaScript", "CodeMirror", "Editor"],
"homepage": "http://codemirror.net", "homepage": "http://codemirror.net",
"maintainers":[{"name": "Marijn Haverbeke", "maintainers":[{"name": "Marijn Haverbeke",
"email": "marijnh@gmail.com", "email": "marijnh@gmail.com",
"web": "http://marijnhaverbeke.nl"}], "web": "http://marijnhaverbeke.nl"}],
"repository": {"type": "git", "repository": {"type": "git",
"url": "https://github.com/marijnh/CodeMirror.git"} "url": "https://github.com/codemirror/CodeMirror.git"}
} }

View File

@ -10,6 +10,8 @@
.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;} .cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}
.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;} .cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}
.cm-s-3024-day.CodeMirror ::selection { background: #d6d5d4; }
.cm-s-3024-day.CodeMirror ::-moz-selection { background: #d9d9d9; }
.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;} .cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}
.cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; } .cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; }
@ -35,4 +37,4 @@
.cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;} .cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;}
.cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;} .cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;}
.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} .cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important;}

View File

@ -10,6 +10,8 @@
.cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;} .cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;}
.cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;} .cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;}
.cm-s-3024-night.CodeMirror ::selection { background: rgba(58, 52, 50, .99); }
.cm-s-3024-night.CodeMirror ::-moz-selection { background: rgba(58, 52, 50, .99); }
.cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;} .cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;}
.cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; } .cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; }
.cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; } .cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; }

View File

@ -30,12 +30,10 @@
.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; } .cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; }
.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; } .cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; }
.cm-s-ambiance .CodeMirror-selected { .cm-s-ambiance .CodeMirror-selected { background: rgba(255, 255, 255, 0.15); }
background: rgba(255, 255, 255, 0.15); .cm-s-ambiance.CodeMirror-focused .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
} .cm-s-ambiance.CodeMirror ::selection { background: rgba(255, 255, 255, 0.10); }
.cm-s-ambiance.CodeMirror-focused .CodeMirror-selected { .cm-s-ambiance.CodeMirror ::-moz-selection { background: rgba(255, 255, 255, 0.10); }
background: rgba(255, 255, 255, 0.10);
}
/* Editor styling */ /* Editor styling */

View File

@ -9,7 +9,9 @@
*/ */
.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;} .cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;}
.cm-s-base16-dark div.CodeMirror-selected {background: #202020 !important;} .cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;}
.cm-s-base16-dark.CodeMirror ::selection { background: rgba(48, 48, 48, .99); }
.cm-s-base16-dark.CodeMirror ::-moz-selection { background: rgba(48, 48, 48, .99); }
.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;} .cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;}
.cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; } .cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; }
.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; } .cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; }
@ -32,5 +34,5 @@
.cm-s-base16-dark span.cm-link {color: #aa759f;} .cm-s-base16-dark span.cm-link {color: #aa759f;}
.cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;} .cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;}
.cm-s-base16-dark .CodeMirror-activeline-background {background: #2F2F2F !important;} .cm-s-base16-dark .CodeMirror-activeline-background {background: #202020 !important;}
.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} .cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}

View File

@ -10,6 +10,8 @@
.cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;} .cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;}
.cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;} .cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;}
.cm-s-base16-light.CodeMirror ::selection { background: #e0e0e0; }
.cm-s-base16-light.CodeMirror ::-moz-selection { background: #e0e0e0; }
.cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;} .cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;}
.cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; } .cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; }
.cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; } .cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; }

View File

@ -2,6 +2,8 @@
.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } .cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }
.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } .cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
.cm-s-blackboard.CodeMirror ::selection { background: rgba(37, 59, 118, .99); }
.cm-s-blackboard.CodeMirror ::-moz-selection { background: rgba(37, 59, 118, .99); }
.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } .cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } .cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; }
.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } .cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; }

View File

@ -1,5 +1,7 @@
.cm-s-cobalt.CodeMirror { background: #002240; color: white; } .cm-s-cobalt.CodeMirror { background: #002240; color: white; }
.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
.cm-s-cobalt.CodeMirror ::selection { background: rgba(179, 101, 57, .99); }
.cm-s-cobalt.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); }
.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } .cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; }
.cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } .cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; }

33
codemirror/theme/colorforth.css vendored Normal file
View File

@ -0,0 +1,33 @@
.cm-s-colorforth.CodeMirror { background: #000000; color: #f8f8f8; }
.cm-s-colorforth .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-colorforth .CodeMirror-guttermarker { color: #FFBD40; }
.cm-s-colorforth .CodeMirror-guttermarker-subtle { color: #78846f; }
.cm-s-colorforth .CodeMirror-linenumber { color: #bababa; }
.cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-colorforth span.cm-comment { color: #ededed; }
.cm-s-colorforth span.cm-def { color: #ff1c1c; font-weight:bold; }
.cm-s-colorforth span.cm-keyword { color: #ffd900; }
.cm-s-colorforth span.cm-builtin { color: #00d95a; }
.cm-s-colorforth span.cm-variable { color: #73ff00; }
.cm-s-colorforth span.cm-string { color: #007bff; }
.cm-s-colorforth span.cm-number { color: #00c4ff; }
.cm-s-colorforth span.cm-atom { color: #606060; }
.cm-s-colorforth span.cm-variable-2 { color: #EEE; }
.cm-s-colorforth span.cm-variable-3 { color: #DDD; }
.cm-s-colorforth span.cm-property {}
.cm-s-colorforth span.cm-operator {}
.cm-s-colorforth span.cm-meta { color: yellow; }
.cm-s-colorforth span.cm-qualifier { color: #FFF700; }
.cm-s-colorforth span.cm-bracket { color: #cc7; }
.cm-s-colorforth span.cm-tag { color: #FFBD40; }
.cm-s-colorforth span.cm-attribute { color: #FFF700; }
.cm-s-colorforth span.cm-error { color: #f00; }
.cm-s-colorforth .CodeMirror-selected { background: #333d53 !important; }
.cm-s-colorforth span.cm-compilation { background: rgba(255, 255, 255, 0.12); }
.cm-s-colorforth .CodeMirror-activeline-background {background: #253540 !important;}

View File

@ -1,5 +1,7 @@
.cm-s-erlang-dark.CodeMirror { background: #002240; color: white; } .cm-s-erlang-dark.CodeMirror { background: #002240; color: white; }
.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; } .cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; }
.cm-s-erlang-dark.CodeMirror ::selection { background: rgba(179, 101, 57, .99); }
.cm-s-erlang-dark.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); }
.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } .cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-erlang-dark .CodeMirror-guttermarker { color: white; } .cm-s-erlang-dark .CodeMirror-guttermarker { color: white; }
.cm-s-erlang-dark .CodeMirror-guttermarker-subtle { color: #d0d0d0; } .cm-s-erlang-dark .CodeMirror-guttermarker-subtle { color: #d0d0d0; }

View File

@ -7,6 +7,8 @@ Ported to CodeMirror by Peter Kroon
} }
.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } .cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; }
.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/
.cm-s-lesser-dark.CodeMirror ::selection { background: rgba(69, 68, 59, .99); }
.cm-s-lesser-dark.CodeMirror ::-moz-selection { background: rgba(69, 68, 59, .99); }
.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/ .cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/

View File

@ -6,6 +6,8 @@
.cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffec;} .cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffec;}
.cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;} .cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;}
.cm-s-mbo.CodeMirror ::selection { background: rgba(113, 108, 98, .99); }
.cm-s-mbo.CodeMirror ::-moz-selection { background: rgba(113, 108, 98, .99); }
.cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;} .cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;}
.cm-s-mbo .CodeMirror-guttermarker { color: white; } .cm-s-mbo .CodeMirror-guttermarker { color: white; }
.cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; } .cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; }

View File

@ -1,7 +1,7 @@
/* /*
MDN-LIKE Theme - Mozilla MDN-LIKE Theme - Mozilla
Ported to CodeMirror by Peter Kroon <plakroon@gmail.com> Ported to CodeMirror by Peter Kroon <plakroon@gmail.com>
Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues
GitHub: @peterkroon GitHub: @peterkroon
The mdn-like theme is inspired on the displayed code examples at: https://developer.mozilla.org/en-US/docs/Web/CSS/animation The mdn-like theme is inspired on the displayed code examples at: https://developer.mozilla.org/en-US/docs/Web/CSS/animation
@ -9,6 +9,8 @@
*/ */
.cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; } .cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; }
.cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; } .cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; }
.cm-s-mdn-like.CodeMirror ::selection { background: #cfc; }
.cm-s-mdn-like.CodeMirror ::-moz-selection { background: #cfc; }
.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; } .cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; }
.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; margin-left: 3px; } .cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; margin-left: 3px; }

View File

@ -15,6 +15,8 @@
.cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} .cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;} .cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;}
.cm-s-midnight.CodeMirror ::selection { background: rgba(49, 77, 103, .99); }
.cm-s-midnight.CodeMirror ::-moz-selection { background: rgba(49, 77, 103, .99); }
.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;} .cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;}
.cm-s-midnight .CodeMirror-guttermarker { color: white; } .cm-s-midnight .CodeMirror-guttermarker { color: white; }
.cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } .cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; }

View File

@ -2,6 +2,8 @@
.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} .cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
.cm-s-monokai.CodeMirror ::selection { background: rgba(73, 72, 62, .99); }
.cm-s-monokai.CodeMirror ::-moz-selection { background: rgba(73, 72, 62, .99); }
.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} .cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
.cm-s-monokai .CodeMirror-guttermarker { color: white; } .cm-s-monokai .CodeMirror-guttermarker { color: white; }
.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; } .cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; }

View File

@ -2,6 +2,8 @@
.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } .cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; }
.cm-s-night div.CodeMirror-selected { background: #447 !important; } .cm-s-night div.CodeMirror-selected { background: #447 !important; }
.cm-s-night.CodeMirror ::selection { background: rgba(68, 68, 119, .99); }
.cm-s-night.CodeMirror ::-moz-selection { background: rgba(68, 68, 119, .99); }
.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } .cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-night .CodeMirror-guttermarker { color: white; } .cm-s-night .CodeMirror-guttermarker { color: white; }
.cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; } .cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; }

View File

@ -10,6 +10,8 @@
.cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;} .cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;}
.cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;} .cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;}
.cm-s-paraiso-dark.CodeMirror ::selection { background: rgba(65, 50, 63, .99); }
.cm-s-paraiso-dark.CodeMirror ::-moz-selection { background: rgba(65, 50, 63, .99); }
.cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;} .cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;}
.cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; } .cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; }
.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; } .cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; }

View File

@ -10,6 +10,8 @@
.cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;} .cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;}
.cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;} .cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;}
.cm-s-paraiso-light.CodeMirror ::selection { background: #b9b6b0; }
.cm-s-paraiso-light.CodeMirror ::-moz-selection { background: #b9b6b0; }
.cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;} .cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;}
.cm-s-paraiso-light .CodeMirror-guttermarker { color: black; } .cm-s-paraiso-light .CodeMirror-guttermarker { color: black; }
.cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; } .cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; }

View File

@ -14,6 +14,9 @@
font-size: 14px; font-size: 14px;
} }
.cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; } .cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; }
.cm-s-pastel-on-dark.CodeMirror ::selection { background: rgba(221,240,255,0.2); }
.cm-s-pastel-on-dark.CodeMirror ::-moz-selection { background: rgba(221,240,255,0.2); }
.cm-s-pastel-on-dark .CodeMirror-gutters { .cm-s-pastel-on-dark .CodeMirror-gutters {
background: #34302f; background: #34302f;
border-right: 0px; border-right: 0px;

View File

@ -1,5 +1,7 @@
.cm-s-rubyblue.CodeMirror { background: #112435; color: white; } .cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
.cm-s-rubyblue.CodeMirror ::selection { background: rgba(56, 86, 111, 0.99); }
.cm-s-rubyblue.CodeMirror ::-moz-selection { background: rgba(56, 86, 111, 0.99); }
.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } .cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; }
.cm-s-rubyblue .CodeMirror-guttermarker { color: white; } .cm-s-rubyblue .CodeMirror-guttermarker { color: white; }
.cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; } .cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; }

View File

@ -88,24 +88,19 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
text-decoration-style: dotted; text-decoration-style: dotted;
} }
.cm-s-solarized .cm-strong { color: #eee; } .cm-s-solarized .cm-strong { color: #eee; }
.cm-s-solarized .cm-tab:before {
content: "➤"; /*visualize tab character*/
color: #586e75;
position:absolute;
}
.cm-s-solarized .cm-error, .cm-s-solarized .cm-error,
.cm-s-solarized .cm-invalidchar { .cm-s-solarized .cm-invalidchar {
color: #586e75; color: #586e75;
border-bottom: 1px dotted #dc322f; border-bottom: 1px dotted #dc322f;
} }
.cm-s-solarized.cm-s-dark .CodeMirror-selected { .cm-s-solarized.cm-s-dark .CodeMirror-selected { background: #073642; }
background: #073642; .cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); }
} .cm-s-solarized.cm-s-dark.CodeMirror ::-moz-selection { background: rgba(7, 54, 66, 0.99); }
.cm-s-solarized.cm-s-light .CodeMirror-selected { .cm-s-solarized.cm-s-light .CodeMirror-selected { background: #eee8d5; }
background: #eee8d5; .cm-s-solarized.cm-s-light.CodeMirror ::selection { background: #eee8d5; }
} .cm-s-solarized.cm-s-lightCodeMirror ::-moz-selection { background: #eee8d5; }
/* Editor styling */ /* Editor styling */

View File

@ -1,5 +1,7 @@
.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } .cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; }
.cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; } .cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; }
.cm-s-the-matrix.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); }
.cm-s-the-matrix.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); }
.cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } .cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; }
.cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } .cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; }
.cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } .cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; }

View File

@ -0,0 +1,35 @@
/*
Name: Tomorrow Night - Bright
Author: Chris Kempson
Port done by Gerard Braad <me@gbraad.nl>
*/
.cm-s-tomorrow-night-bright.CodeMirror {background: #000000; color: #eaeaea;}
.cm-s-tomorrow-night-bright div.CodeMirror-selected {background: #424242 !important;}
.cm-s-tomorrow-night-bright .CodeMirror-gutters {background: #000000; border-right: 0px;}
.cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; }
.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; }
.cm-s-tomorrow-night-bright .CodeMirror-linenumber {color: #424242;}
.cm-s-tomorrow-night-bright .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;}
.cm-s-tomorrow-night-bright span.cm-comment {color: #d27b53;}
.cm-s-tomorrow-night-bright span.cm-atom {color: #a16a94;}
.cm-s-tomorrow-night-bright span.cm-number {color: #a16a94;}
.cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute {color: #99cc99;}
.cm-s-tomorrow-night-bright span.cm-keyword {color: #d54e53;}
.cm-s-tomorrow-night-bright span.cm-string {color: #e7c547;}
.cm-s-tomorrow-night-bright span.cm-variable {color: #b9ca4a;}
.cm-s-tomorrow-night-bright span.cm-variable-2 {color: #7aa6da;}
.cm-s-tomorrow-night-bright span.cm-def {color: #e78c45;}
.cm-s-tomorrow-night-bright span.cm-bracket {color: #eaeaea;}
.cm-s-tomorrow-night-bright span.cm-tag {color: #d54e53;}
.cm-s-tomorrow-night-bright span.cm-link {color: #a16a94;}
.cm-s-tomorrow-night-bright span.cm-error {background: #d54e53; color: #6A6A6A;}
.cm-s-tomorrow-night-bright .CodeMirror-activeline-background {background: #2a2a2a !important;}
.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}

View File

@ -10,6 +10,8 @@
.cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;} .cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;}
.cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;} .cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;}
.cm-s-tomorrow-night-eighties.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); }
.cm-s-tomorrow-night-eighties.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); }
.cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;} .cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;}
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; } .cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; }
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; } .cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; }

View File

@ -1,5 +1,7 @@
.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ .cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/
.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/ .cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/
.cm-s-twilight.CodeMirror ::selection { background: rgba(50, 50, 50, 0.99); }
.cm-s-twilight.CodeMirror ::-moz-selection { background: rgba(50, 50, 50, 0.99); }
.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } .cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; }
.cm-s-twilight .CodeMirror-guttermarker { color: white; } .cm-s-twilight .CodeMirror-guttermarker { color: white; }

View File

@ -2,6 +2,8 @@
.cm-s-vibrant-ink.CodeMirror { background: black; color: white; } .cm-s-vibrant-ink.CodeMirror { background: black; color: white; }
.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } .cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; }
.cm-s-vibrant-ink.CodeMirror ::selection { background: rgba(53, 73, 60, 0.99); }
.cm-s-vibrant-ink.CodeMirror ::-moz-selection { background: rgba(53, 73, 60, 0.99); }
.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } .cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; } .cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; }

View File

@ -22,6 +22,8 @@ THE SOFTWARE.
*/ */
.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; } .cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; }
.cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; } .cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; }
.cm-s-xq-dark.CodeMirror ::selection { background: rgba(39, 0, 122, 0.99); }
.cm-s-xq-dark.CodeMirror ::-moz-selection { background: rgba(39, 0, 122, 0.99); }
.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } .cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-xq-dark .CodeMirror-guttermarker { color: #FFBD40; } .cm-s-xq-dark .CodeMirror-guttermarker { color: #FFBD40; }
.cm-s-xq-dark .CodeMirror-guttermarker-subtle { color: #f8f8f8; } .cm-s-xq-dark .CodeMirror-guttermarker-subtle { color: #f8f8f8; }

37
codemirror/theme/zenburn.css vendored Normal file
View File

@ -0,0 +1,37 @@
/**
* "
* Using Zenburn color palette from the Emacs Zenburn Theme
* https://github.com/bbatsov/zenburn-emacs/blob/master/zenburn-theme.el
*
* Also using parts of https://github.com/xavi/coderay-lighttable-theme
* "
* From: https://github.com/wisenomad/zenburn-lighttable-theme/blob/master/zenburn.css
*/
.cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; }
.cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; }
.cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; }
.cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; }
.cm-s-zenburn span.cm-comment { color: #7f9f7f; }
.cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; }
.cm-s-zenburn span.cm-atom { color: #bfebbf; }
.cm-s-zenburn span.cm-def { color: #dcdccc; }
.cm-s-zenburn span.cm-variable { color: #dfaf8f; }
.cm-s-zenburn span.cm-variable-2 { color: #dcdccc; }
.cm-s-zenburn span.cm-string { color: #cc9393; }
.cm-s-zenburn span.cm-string-2 { color: #cc9393; }
.cm-s-zenburn span.cm-number { color: #dcdccc; }
.cm-s-zenburn span.cm-tag { color: #93e0e3; }
.cm-s-zenburn span.cm-property { color: #dfaf8f; }
.cm-s-zenburn span.cm-attribute { color: #dfaf8f; }
.cm-s-zenburn span.cm-qualifier { color: #7cb8bb; }
.cm-s-zenburn span.cm-meta { color: #f0dfaf; }
.cm-s-zenburn span.cm-header { color: #f0efd0; }
.cm-s-zenburn span.cm-operator { color: #f0efd0; }
.cm-s-zenburn span.CodeMirror-matchingbracket { box-sizing: border-box; background: transparent; border-bottom: 1px solid; }
.cm-s-zenburn span.CodeMirror-nonmatchingbracket { border-bottom: 1px solid; background: none; }
.cm-s-zenburn .CodeMirror-activeline { background: #000000; }
.cm-s-zenburn .CodeMirror-activeline-background { background: #000000; }
.cm-s-zenburn .CodeMirror-selected { background: #545454; }
.cm-s-zenburn .CodeMirror-focused .CodeMirror-selected { background: #4f4f4f; }