├── .gitignore ├── LICENCE.txt ├── MANIFEST.in ├── Makefile ├── README.rst ├── djangocodemirror ├── .gitignore ├── __init__.py ├── assets.py ├── exceptions.py ├── fields.py ├── helper.py ├── manifest.py ├── settings.py ├── static │ └── CodeMirror │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── addon │ │ ├── comment │ │ │ ├── comment.js │ │ │ └── continuecomment.js │ │ ├── dialog │ │ │ ├── dialog.css │ │ │ └── dialog.js │ │ ├── display │ │ │ ├── autorefresh.js │ │ │ ├── fullscreen.css │ │ │ ├── fullscreen.js │ │ │ ├── panel.js │ │ │ ├── placeholder.js │ │ │ └── rulers.js │ │ ├── edit │ │ │ ├── closebrackets.js │ │ │ ├── closetag.js │ │ │ ├── continuelist.js │ │ │ ├── matchbrackets.js │ │ │ ├── matchtags.js │ │ │ └── trailingspace.js │ │ ├── fold │ │ │ ├── brace-fold.js │ │ │ ├── comment-fold.js │ │ │ ├── foldcode.js │ │ │ ├── foldgutter.css │ │ │ ├── foldgutter.js │ │ │ ├── indent-fold.js │ │ │ ├── markdown-fold.js │ │ │ └── xml-fold.js │ │ ├── hint │ │ │ ├── anyword-hint.js │ │ │ ├── css-hint.js │ │ │ ├── html-hint.js │ │ │ ├── javascript-hint.js │ │ │ ├── show-hint.css │ │ │ ├── show-hint.js │ │ │ ├── sql-hint.js │ │ │ └── xml-hint.js │ │ ├── lint │ │ │ ├── coffeescript-lint.js │ │ │ ├── css-lint.js │ │ │ ├── html-lint.js │ │ │ ├── javascript-lint.js │ │ │ ├── json-lint.js │ │ │ ├── lint.css │ │ │ ├── lint.js │ │ │ └── yaml-lint.js │ │ ├── merge │ │ │ ├── merge.css │ │ │ └── merge.js │ │ ├── mode │ │ │ ├── loadmode.js │ │ │ ├── multiplex.js │ │ │ ├── multiplex_test.js │ │ │ ├── overlay.js │ │ │ └── simple.js │ │ ├── runmode │ │ │ ├── colorize.js │ │ │ ├── runmode-standalone.js │ │ │ ├── runmode.js │ │ │ └── runmode.node.js │ │ ├── scroll │ │ │ ├── annotatescrollbar.js │ │ │ ├── scrollpastend.js │ │ │ ├── simplescrollbars.css │ │ │ └── simplescrollbars.js │ │ ├── search │ │ │ ├── jump-to-line.js │ │ │ ├── match-highlighter.js │ │ │ ├── matchesonscrollbar.css │ │ │ ├── matchesonscrollbar.js │ │ │ ├── search.js │ │ │ └── searchcursor.js │ │ ├── selection │ │ │ ├── active-line.js │ │ │ ├── mark-selection.js │ │ │ └── selection-pointer.js │ │ ├── tern │ │ │ ├── tern.css │ │ │ ├── tern.js │ │ │ └── worker.js │ │ └── wrap │ │ │ └── hardwrap.js │ │ ├── keymap │ │ ├── emacs.js │ │ ├── sublime.js │ │ └── vim.js │ │ ├── lib │ │ ├── codemirror.css │ │ └── codemirror.js │ │ ├── mode │ │ ├── apl │ │ │ ├── apl.js │ │ │ └── index.html │ │ ├── asciiarmor │ │ │ ├── asciiarmor.js │ │ │ └── index.html │ │ ├── asn.1 │ │ │ ├── asn.1.js │ │ │ └── index.html │ │ ├── asterisk │ │ │ ├── asterisk.js │ │ │ └── index.html │ │ ├── brainfuck │ │ │ ├── brainfuck.js │ │ │ └── index.html │ │ ├── clike │ │ │ ├── clike.js │ │ │ ├── index.html │ │ │ ├── scala.html │ │ │ └── test.js │ │ ├── clojure │ │ │ ├── clojure.js │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── cmake │ │ │ ├── cmake.js │ │ │ └── index.html │ │ ├── cobol │ │ │ ├── cobol.js │ │ │ └── index.html │ │ ├── coffeescript │ │ │ ├── coffeescript.js │ │ │ └── index.html │ │ ├── commonlisp │ │ │ ├── commonlisp.js │ │ │ └── index.html │ │ ├── crystal │ │ │ ├── crystal.js │ │ │ └── index.html │ │ ├── css │ │ │ ├── css.js │ │ │ ├── gss.html │ │ │ ├── gss_test.js │ │ │ ├── index.html │ │ │ ├── less.html │ │ │ ├── less_test.js │ │ │ ├── scss.html │ │ │ ├── scss_test.js │ │ │ └── test.js │ │ ├── cypher │ │ │ ├── cypher.js │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── d │ │ │ ├── d.js │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── dart │ │ │ ├── dart.js │ │ │ └── index.html │ │ ├── diff │ │ │ ├── diff.js │ │ │ └── index.html │ │ ├── django │ │ │ ├── django.js │ │ │ └── index.html │ │ ├── dockerfile │ │ │ ├── dockerfile.js │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── dtd │ │ │ ├── dtd.js │ │ │ └── index.html │ │ ├── dylan │ │ │ ├── dylan.js │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── ebnf │ │ │ ├── ebnf.js │ │ │ └── index.html │ │ ├── ecl │ │ │ ├── ecl.js │ │ │ └── index.html │ │ ├── eiffel │ │ │ ├── eiffel.js │ │ │ └── index.html │ │ ├── elm │ │ │ ├── elm.js │ │ │ └── index.html │ │ ├── erlang │ │ │ ├── erlang.js │ │ │ └── index.html │ │ ├── factor │ │ │ ├── factor.js │ │ │ └── index.html │ │ ├── fcl │ │ │ ├── fcl.js │ │ │ └── index.html │ │ ├── forth │ │ │ ├── forth.js │ │ │ └── index.html │ │ ├── fortran │ │ │ ├── fortran.js │ │ │ └── index.html │ │ ├── gas │ │ │ ├── gas.js │ │ │ └── index.html │ │ ├── gfm │ │ │ ├── gfm.js │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── gherkin │ │ │ ├── gherkin.js │ │ │ └── index.html │ │ ├── go │ │ │ ├── go.js │ │ │ └── index.html │ │ ├── groovy │ │ │ ├── groovy.js │ │ │ └── index.html │ │ ├── haml │ │ │ ├── haml.js │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── handlebars │ │ │ ├── handlebars.js │ │ │ └── index.html │ │ ├── haskell-literate │ │ │ ├── haskell-literate.js │ │ │ └── index.html │ │ ├── haskell │ │ │ ├── haskell.js │ │ │ └── index.html │ │ ├── haxe │ │ │ ├── haxe.js │ │ │ └── index.html │ │ ├── htmlembedded │ │ │ ├── htmlembedded.js │ │ │ └── index.html │ │ ├── htmlmixed │ │ │ ├── htmlmixed.js │ │ │ └── index.html │ │ ├── http │ │ │ ├── http.js │ │ │ └── index.html │ │ ├── idl │ │ │ ├── idl.js │ │ │ └── index.html │ │ ├── index.html │ │ ├── javascript │ │ │ ├── index.html │ │ │ ├── javascript.js │ │ │ ├── json-ld.html │ │ │ ├── test.js │ │ │ └── typescript.html │ │ ├── jinja2 │ │ │ ├── index.html │ │ │ └── jinja2.js │ │ ├── jsx │ │ │ ├── index.html │ │ │ ├── jsx.js │ │ │ └── test.js │ │ ├── julia │ │ │ ├── index.html │ │ │ └── julia.js │ │ ├── livescript │ │ │ ├── index.html │ │ │ └── livescript.js │ │ ├── lua │ │ │ ├── index.html │ │ │ └── lua.js │ │ ├── markdown │ │ │ ├── index.html │ │ │ ├── markdown.js │ │ │ └── test.js │ │ ├── mathematica │ │ │ ├── index.html │ │ │ └── mathematica.js │ │ ├── mbox │ │ │ ├── index.html │ │ │ └── mbox.js │ │ ├── meta.js │ │ ├── mirc │ │ │ ├── index.html │ │ │ └── mirc.js │ │ ├── mllike │ │ │ ├── index.html │ │ │ └── mllike.js │ │ ├── modelica │ │ │ ├── index.html │ │ │ └── modelica.js │ │ ├── mscgen │ │ │ ├── index.html │ │ │ ├── mscgen.js │ │ │ ├── mscgen_test.js │ │ │ ├── msgenny_test.js │ │ │ └── xu_test.js │ │ ├── mumps │ │ │ ├── index.html │ │ │ └── mumps.js │ │ ├── nginx │ │ │ ├── index.html │ │ │ └── nginx.js │ │ ├── nsis │ │ │ ├── index.html │ │ │ └── nsis.js │ │ ├── ntriples │ │ │ ├── index.html │ │ │ └── ntriples.js │ │ ├── octave │ │ │ ├── index.html │ │ │ └── octave.js │ │ ├── oz │ │ │ ├── index.html │ │ │ └── oz.js │ │ ├── pascal │ │ │ ├── index.html │ │ │ └── pascal.js │ │ ├── pegjs │ │ │ ├── index.html │ │ │ └── pegjs.js │ │ ├── perl │ │ │ ├── index.html │ │ │ └── perl.js │ │ ├── php │ │ │ ├── index.html │ │ │ ├── php.js │ │ │ └── test.js │ │ ├── pig │ │ │ ├── index.html │ │ │ └── pig.js │ │ ├── powershell │ │ │ ├── index.html │ │ │ ├── powershell.js │ │ │ └── test.js │ │ ├── properties │ │ │ ├── index.html │ │ │ └── properties.js │ │ ├── protobuf │ │ │ ├── index.html │ │ │ └── protobuf.js │ │ ├── pug │ │ │ ├── index.html │ │ │ └── pug.js │ │ ├── puppet │ │ │ ├── index.html │ │ │ └── puppet.js │ │ ├── python │ │ │ ├── index.html │ │ │ ├── python.js │ │ │ └── test.js │ │ ├── q │ │ │ ├── index.html │ │ │ └── q.js │ │ ├── r │ │ │ ├── index.html │ │ │ └── r.js │ │ ├── rpm │ │ │ ├── changes │ │ │ │ └── index.html │ │ │ ├── index.html │ │ │ └── rpm.js │ │ ├── rst │ │ │ ├── index.html │ │ │ └── rst.js │ │ ├── ruby │ │ │ ├── index.html │ │ │ ├── ruby.js │ │ │ └── test.js │ │ ├── rust │ │ │ ├── index.html │ │ │ ├── rust.js │ │ │ └── test.js │ │ ├── sas │ │ │ ├── index.html │ │ │ └── sas.js │ │ ├── sass │ │ │ ├── index.html │ │ │ ├── sass.js │ │ │ └── test.js │ │ ├── scheme │ │ │ ├── index.html │ │ │ └── scheme.js │ │ ├── shell │ │ │ ├── index.html │ │ │ ├── shell.js │ │ │ └── test.js │ │ ├── sieve │ │ │ ├── index.html │ │ │ └── sieve.js │ │ ├── slim │ │ │ ├── index.html │ │ │ ├── slim.js │ │ │ └── test.js │ │ ├── smalltalk │ │ │ ├── index.html │ │ │ └── smalltalk.js │ │ ├── smarty │ │ │ ├── index.html │ │ │ └── smarty.js │ │ ├── solr │ │ │ ├── index.html │ │ │ └── solr.js │ │ ├── soy │ │ │ ├── index.html │ │ │ ├── soy.js │ │ │ └── test.js │ │ ├── sparql │ │ │ ├── index.html │ │ │ └── sparql.js │ │ ├── spreadsheet │ │ │ ├── index.html │ │ │ └── spreadsheet.js │ │ ├── sql │ │ │ ├── index.html │ │ │ └── sql.js │ │ ├── stex │ │ │ ├── index.html │ │ │ ├── stex.js │ │ │ └── test.js │ │ ├── stylus │ │ │ ├── index.html │ │ │ └── stylus.js │ │ ├── swift │ │ │ ├── index.html │ │ │ ├── swift.js │ │ │ └── test.js │ │ ├── tcl │ │ │ ├── index.html │ │ │ └── tcl.js │ │ ├── textile │ │ │ ├── index.html │ │ │ ├── test.js │ │ │ └── textile.js │ │ ├── tiddlywiki │ │ │ ├── index.html │ │ │ ├── tiddlywiki.css │ │ │ └── tiddlywiki.js │ │ ├── tiki │ │ │ ├── index.html │ │ │ ├── tiki.css │ │ │ └── tiki.js │ │ ├── toml │ │ │ ├── index.html │ │ │ └── toml.js │ │ ├── tornado │ │ │ ├── index.html │ │ │ └── tornado.js │ │ ├── troff │ │ │ ├── index.html │ │ │ └── troff.js │ │ ├── ttcn-cfg │ │ │ ├── index.html │ │ │ └── ttcn-cfg.js │ │ ├── ttcn │ │ │ ├── index.html │ │ │ └── ttcn.js │ │ ├── turtle │ │ │ ├── index.html │ │ │ └── turtle.js │ │ ├── twig │ │ │ ├── index.html │ │ │ └── twig.js │ │ ├── vb │ │ │ ├── index.html │ │ │ └── vb.js │ │ ├── vbscript │ │ │ ├── index.html │ │ │ └── vbscript.js │ │ ├── velocity │ │ │ ├── index.html │ │ │ └── velocity.js │ │ ├── verilog │ │ │ ├── index.html │ │ │ ├── test.js │ │ │ └── verilog.js │ │ ├── vhdl │ │ │ ├── index.html │ │ │ └── vhdl.js │ │ ├── vue │ │ │ ├── index.html │ │ │ └── vue.js │ │ ├── webidl │ │ │ ├── index.html │ │ │ └── webidl.js │ │ ├── xml │ │ │ ├── index.html │ │ │ ├── test.js │ │ │ └── xml.js │ │ ├── xquery │ │ │ ├── index.html │ │ │ ├── test.js │ │ │ └── xquery.js │ │ ├── yacas │ │ │ ├── index.html │ │ │ └── yacas.js │ │ ├── yaml-frontmatter │ │ │ ├── index.html │ │ │ └── yaml-frontmatter.js │ │ ├── yaml │ │ │ ├── index.html │ │ │ └── yaml.js │ │ └── z80 │ │ │ ├── index.html │ │ │ └── z80.js │ │ └── theme │ │ ├── 3024-day.css │ │ ├── 3024-night.css │ │ ├── abcdef.css │ │ ├── ambiance-mobile.css │ │ ├── ambiance.css │ │ ├── base16-dark.css │ │ ├── base16-light.css │ │ ├── bespin.css │ │ ├── blackboard.css │ │ ├── cobalt.css │ │ ├── colorforth.css │ │ ├── darcula.css │ │ ├── dracula.css │ │ ├── duotone-dark.css │ │ ├── duotone-light.css │ │ ├── eclipse.css │ │ ├── elegant.css │ │ ├── erlang-dark.css │ │ ├── gruvbox-dark.css │ │ ├── hopscotch.css │ │ ├── icecoder.css │ │ ├── idea.css │ │ ├── isotope.css │ │ ├── lesser-dark.css │ │ ├── liquibyte.css │ │ ├── lucario.css │ │ ├── material.css │ │ ├── mbo.css │ │ ├── mdn-like.css │ │ ├── midnight.css │ │ ├── monokai.css │ │ ├── neat.css │ │ ├── neo.css │ │ ├── night.css │ │ ├── oceanic-next.css │ │ ├── panda-syntax.css │ │ ├── paraiso-dark.css │ │ ├── paraiso-light.css │ │ ├── pastel-on-dark.css │ │ ├── railscasts.css │ │ ├── rubyblue.css │ │ ├── seti.css │ │ ├── shadowfox.css │ │ ├── solarized.css │ │ ├── ssms.css │ │ ├── the-matrix.css │ │ ├── tomorrow-night-bright.css │ │ ├── tomorrow-night-eighties.css │ │ ├── ttcn.css │ │ ├── twilight.css │ │ ├── vibrant-ink.css │ │ ├── xq-dark.css │ │ ├── xq-light.css │ │ ├── yeti.css │ │ └── zenburn.css ├── templates │ └── djangocodemirror │ │ └── widget.html ├── templatetags │ ├── __init__.py │ └── djangocodemirror_tags.py └── widgets.py ├── docs ├── .gitignore ├── Makefile ├── _static │ └── .keep ├── changelog.rst ├── conf.py ├── configurations.rst ├── development.rst ├── django_settings.py ├── examples.rst ├── index.rst ├── install.rst ├── library_references │ ├── assetrender.rst │ ├── assets.rst │ ├── fields.rst │ ├── helper.rst │ ├── manifest.rst │ ├── templatetags.rst │ └── widgets.rst ├── requirements.txt └── settings.rst ├── sandbox ├── __init__.py ├── demo_datas │ ├── css.txt │ ├── django.txt │ ├── html.txt │ ├── javascript.txt │ ├── python.txt │ ├── restructuredtext.txt │ └── scss.txt ├── forms.py ├── manage.py ├── settings │ ├── __init__.py │ ├── base.py │ ├── demo.py │ ├── djangocodemirror_app.py │ └── tests.py ├── templates │ ├── form.html │ ├── homepage.html │ ├── modes.html │ ├── raw.html │ └── skeleton.html ├── urls.py ├── views.py └── wsgi.py ├── setup.cfg ├── setup.py └── tests ├── 001_manifest ├── test_001_registry.py ├── test_002_js.py ├── test_003_css.py ├── test_004_config.py └── test_005_helper.py ├── 002_forms ├── test_001_widget.py ├── test_002_fields.py └── test_003_forms.py ├── 003_templatetags ├── test_001_asset_tag_render.py ├── test_001_input_config.py ├── test_002_js_assets.py ├── test_003_css_assets.py └── test_004_codemirror_instance.py ├── __init__.py ├── conftest.py ├── test_001_ping_urls.py └── utils.py /.gitignore: -------------------------------------------------------------------------------- 1 | # virtualenv 2 | .venv 3 | venv 4 | 5 | # Packaging 6 | build 7 | dist 8 | *.egg-info 9 | 10 | # sqlite DB 11 | db.sqlite3 12 | *.db 13 | 14 | # Byte-compiled / optimized / DLL files 15 | __pycache__/ 16 | *.py[cod] 17 | 18 | # Site media 19 | /data/ 20 | 21 | # Settings 22 | local.py 23 | 24 | # Unit test / coverage reports 25 | htmlcov/ 26 | .coverage 27 | .cache 28 | .pytest_cache 29 | nosetests.xml 30 | coverage.xml 31 | 32 | # Temp files 33 | *~ 34 | .~lock* 35 | 36 | # Swap files 37 | *.sw[po] 38 | 39 | # JS dependencies 40 | node_modules 41 | 42 | # SASS 43 | .sass-cache 44 | 45 | # logs 46 | yarn-error.log 47 | 48 | # Exported strings & generated translation templates 49 | *.pot 50 | 51 | # Tests 52 | .tox 53 | -------------------------------------------------------------------------------- /LICENCE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2019 David Thenon. 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include MANIFEST.in 2 | include LICENCE.txt 3 | include README.rst 4 | 5 | recursive-include djangocodemirror/templates * 6 | recursive-include djangocodemirror/static * 7 | recursive-include djangocodemirror/locale * 8 | 9 | recursive-exclude data * 10 | recursive-exclude docs * 11 | recursive-exclude sandbox * 12 | recursive-exclude tests * 13 | recursive-exclude * __pycache__ 14 | recursive-exclude * *.py[co] 15 | 16 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | .. _CodeMirror: http://codemirror.net/ 2 | .. _Django: https://www.djangoproject.com/ 3 | .. _django-assets: http://pypi.python.org/pypi/django-assets 4 | 5 | Django CodeMirror 6 | ================= 7 | 8 | This is a `Django`_ application to embed `CodeMirror`_. 9 | 10 | It works exclusively from configuration sets to manage CodeMirror options and 11 | assets. A dedicated field, widget and some template tags are available to make 12 | CodeMirror instances using these configurations on any element. 13 | 14 | Since configurations are aware of every assets to load this enable you to 15 | use CodeMirror without a Javascript module loader (like ``Browserify`` or 16 | ``RequireJS``). 17 | 18 | Links 19 | ***** 20 | 21 | * Read the documentation on `Read the docs `_; 22 | * Download its `PyPi package `_; 23 | * Clone it on its `Github repository `_; 24 | 25 | Dependancies 26 | ************ 27 | 28 | * `Django`_ >= 1.10; 29 | * Optionally `django-assets`_; 30 | 31 | Credits 32 | ******* 33 | 34 | CodeMirror is a software from Marijn Haverbeke under MIT license. 35 | -------------------------------------------------------------------------------- /djangocodemirror/.gitignore: -------------------------------------------------------------------------------- 1 | .sass-cache -------------------------------------------------------------------------------- /djangocodemirror/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Django CodeMirror is a Django application to embed CodeMirror""" 3 | from __future__ import absolute_import, unicode_literals 4 | 5 | import os 6 | from setuptools.config import read_configuration 7 | 8 | import pkg_resources 9 | 10 | PROJECT_DIR = os.path.join(os.path.dirname(__file__), "..") 11 | 12 | 13 | def _extract_version(package_name): 14 | """ 15 | Get package version from installed distribution or configuration file if not 16 | installed 17 | """ 18 | try: 19 | return pkg_resources.get_distribution(package_name).version 20 | except pkg_resources.DistributionNotFound: 21 | _conf = read_configuration(os.path.join(PROJECT_DIR, "setup.cfg")) 22 | return _conf["metadata"]["version"] 23 | 24 | 25 | __version__ = _extract_version("djangocodemirror") 26 | -------------------------------------------------------------------------------- /djangocodemirror/exceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Internal exceptions 4 | =================== 5 | 6 | """ 7 | 8 | 9 | class NotRegisteredError(KeyError): 10 | pass 11 | 12 | 13 | class UnknowConfigError(KeyError): 14 | pass 15 | 16 | 17 | class UnknowModeError(KeyError): 18 | pass 19 | 20 | 21 | class UnknowThemeError(KeyError): 22 | pass 23 | 24 | 25 | class CodeMirrorFieldBundleError(KeyError): 26 | pass 27 | -------------------------------------------------------------------------------- /djangocodemirror/fields.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Form field 4 | ========== 5 | 6 | """ 7 | from django import forms 8 | 9 | from djangocodemirror.widgets import CodeMirrorWidget 10 | 11 | 12 | class CodeMirrorField(forms.CharField): 13 | """ 14 | A CharField that comes with CodeMirrorWidget. 15 | 16 | Arguments: 17 | config_name (string): A Codemirror config name available in 18 | ``settings.CODEMIRROR_SETTINGS``. Default is ``empty``. 19 | """ 20 | def __init__(self, *args, **kwargs): 21 | self.config_name = kwargs.pop('config_name', 'empty') 22 | # Add Codemirror widget to the field 23 | kwargs.update({'widget': CodeMirrorWidget}) 24 | 25 | # Initialize widget with given config name if the field has been 26 | # bounded. 27 | widget = kwargs.get('widget', None) or self.widget 28 | if isinstance(widget, type): 29 | kwargs['widget'] = widget(config_name=self.config_name) 30 | 31 | super(CodeMirrorField, self).__init__(*args, **kwargs) 32 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (C) 2017 by Marijn Haverbeke and others 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/dialog/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: absolute; 3 | left: 0; right: 0; 4 | background: inherit; 5 | z-index: 15; 6 | padding: .1em .8em; 7 | overflow: hidden; 8 | color: inherit; 9 | } 10 | 11 | .CodeMirror-dialog-top { 12 | border-bottom: 1px solid #eee; 13 | top: 0; 14 | } 15 | 16 | .CodeMirror-dialog-bottom { 17 | border-top: 1px solid #eee; 18 | bottom: 0; 19 | } 20 | 21 | .CodeMirror-dialog input { 22 | border: none; 23 | outline: none; 24 | background: transparent; 25 | width: 20em; 26 | color: inherit; 27 | font-family: monospace; 28 | } 29 | 30 | .CodeMirror-dialog button { 31 | font-size: 70%; 32 | } 33 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/display/autorefresh.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")) 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod) 9 | else // Plain browser env 10 | mod(CodeMirror) 11 | })(function(CodeMirror) { 12 | "use strict" 13 | 14 | CodeMirror.defineOption("autoRefresh", false, function(cm, val) { 15 | if (cm.state.autoRefresh) { 16 | stopListening(cm, cm.state.autoRefresh) 17 | cm.state.autoRefresh = null 18 | } 19 | if (val && cm.display.wrapper.offsetHeight == 0) 20 | startListening(cm, cm.state.autoRefresh = {delay: val.delay || 250}) 21 | }) 22 | 23 | function startListening(cm, state) { 24 | function check() { 25 | if (cm.display.wrapper.offsetHeight) { 26 | stopListening(cm, state) 27 | if (cm.display.lastWrapHeight != cm.display.wrapper.clientHeight) 28 | cm.refresh() 29 | } else { 30 | state.timeout = setTimeout(check, state.delay) 31 | } 32 | } 33 | state.timeout = setTimeout(check, state.delay) 34 | state.hurry = function() { 35 | clearTimeout(state.timeout) 36 | state.timeout = setTimeout(check, 50) 37 | } 38 | CodeMirror.on(window, "mouseup", state.hurry) 39 | CodeMirror.on(window, "keyup", state.hurry) 40 | } 41 | 42 | function stopListening(_cm, state) { 43 | clearTimeout(state.timeout) 44 | CodeMirror.off(window, "mouseup", state.hurry) 45 | CodeMirror.off(window, "keyup", state.hurry) 46 | } 47 | }); 48 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/display/fullscreen.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-fullscreen { 2 | position: fixed; 3 | top: 0; left: 0; right: 0; bottom: 0; 4 | height: auto; 5 | z-index: 9; 6 | } 7 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/display/fullscreen.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineOption("fullScreen", false, function(cm, val, old) { 15 | if (old == CodeMirror.Init) old = false; 16 | if (!old == !val) return; 17 | if (val) setFullscreen(cm); 18 | else setNormal(cm); 19 | }); 20 | 21 | function setFullscreen(cm) { 22 | var wrap = cm.getWrapperElement(); 23 | cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, 24 | width: wrap.style.width, height: wrap.style.height}; 25 | wrap.style.width = ""; 26 | wrap.style.height = "auto"; 27 | wrap.className += " CodeMirror-fullscreen"; 28 | document.documentElement.style.overflow = "hidden"; 29 | cm.refresh(); 30 | } 31 | 32 | function setNormal(cm) { 33 | var wrap = cm.getWrapperElement(); 34 | wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); 35 | document.documentElement.style.overflow = ""; 36 | var info = cm.state.fullScreenRestore; 37 | wrap.style.width = info.width; wrap.style.height = info.height; 38 | window.scrollTo(info.scrollLeft, info.scrollTop); 39 | cm.refresh(); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/display/rulers.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineOption("rulers", false, function(cm, val) { 15 | if (cm.state.rulerDiv) { 16 | cm.state.rulerDiv.parentElement.removeChild(cm.state.rulerDiv) 17 | cm.state.rulerDiv = null 18 | cm.off("refresh", drawRulers) 19 | } 20 | if (val && val.length) { 21 | cm.state.rulerDiv = cm.display.lineSpace.parentElement.insertBefore(document.createElement("div"), cm.display.lineSpace) 22 | cm.state.rulerDiv.className = "CodeMirror-rulers" 23 | drawRulers(cm) 24 | cm.on("refresh", drawRulers) 25 | } 26 | }); 27 | 28 | function drawRulers(cm) { 29 | cm.state.rulerDiv.textContent = "" 30 | var val = cm.getOption("rulers"); 31 | var cw = cm.defaultCharWidth(); 32 | var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left; 33 | cm.state.rulerDiv.style.minHeight = (cm.display.scroller.offsetHeight + 30) + "px"; 34 | for (var i = 0; i < val.length; i++) { 35 | var elt = document.createElement("div"); 36 | elt.className = "CodeMirror-ruler"; 37 | var col, conf = val[i]; 38 | if (typeof conf == "number") { 39 | col = conf; 40 | } else { 41 | col = conf.column; 42 | if (conf.className) elt.className += " " + conf.className; 43 | if (conf.color) elt.style.borderColor = conf.color; 44 | if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle; 45 | if (conf.width) elt.style.borderLeftWidth = conf.width; 46 | } 47 | elt.style.left = (left + col * cw) + "px"; 48 | cm.state.rulerDiv.appendChild(elt) 49 | } 50 | } 51 | }); 52 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/edit/trailingspace.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { 13 | if (prev == CodeMirror.Init) prev = false; 14 | if (prev && !val) 15 | cm.removeOverlay("trailingspace"); 16 | else if (!prev && val) 17 | cm.addOverlay({ 18 | token: function(stream) { 19 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} 20 | if (i > stream.pos) { stream.pos = i; return null; } 21 | stream.pos = l; 22 | return "trailingspace"; 23 | }, 24 | name: "trailingspace" 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/fold/foldgutter.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-foldmarker { 2 | color: blue; 3 | text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; 4 | font-family: arial; 5 | line-height: .3; 6 | cursor: pointer; 7 | } 8 | .CodeMirror-foldgutter { 9 | width: .7em; 10 | } 11 | .CodeMirror-foldgutter-open, 12 | .CodeMirror-foldgutter-folded { 13 | cursor: pointer; 14 | } 15 | .CodeMirror-foldgutter-open:after { 16 | content: "\25BE"; 17 | } 18 | .CodeMirror-foldgutter-folded:after { 19 | content: "\25B8"; 20 | } 21 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/fold/indent-fold.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | function lineIndent(cm, lineNo) { 15 | var text = cm.getLine(lineNo) 16 | var spaceTo = text.search(/\S/) 17 | if (spaceTo == -1 || /\bcomment\b/.test(cm.getTokenTypeAt(CodeMirror.Pos(lineNo, spaceTo + 1)))) 18 | return -1 19 | return CodeMirror.countColumn(text, null, cm.getOption("tabSize")) 20 | } 21 | 22 | CodeMirror.registerHelper("fold", "indent", function(cm, start) { 23 | var myIndent = lineIndent(cm, start.line) 24 | if (myIndent < 0) return 25 | var lastLineInFold = null 26 | 27 | // Go through lines until we find a line that definitely doesn't belong in 28 | // the block we're folding, or to the end. 29 | for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { 30 | var indent = lineIndent(cm, i) 31 | if (indent == -1) { 32 | } else if (indent > myIndent) { 33 | // Lines with a greater indent are considered part of the block. 34 | lastLineInFold = i; 35 | } else { 36 | // If this line has non-space, non-comment content, and is 37 | // indented less or equal to the start line, it is the start of 38 | // another block. 39 | break; 40 | } 41 | } 42 | if (lastLineInFold) return { 43 | from: CodeMirror.Pos(start.line, cm.getLine(start.line).length), 44 | to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) 45 | }; 46 | }); 47 | 48 | }); 49 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/fold/markdown-fold.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.registerHelper("fold", "markdown", function(cm, start) { 15 | var maxDepth = 100; 16 | 17 | function isHeader(lineNo) { 18 | var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0)); 19 | return tokentype && /\bheader\b/.test(tokentype); 20 | } 21 | 22 | function headerLevel(lineNo, line, nextLine) { 23 | var match = line && line.match(/^#+/); 24 | if (match && isHeader(lineNo)) return match[0].length; 25 | match = nextLine && nextLine.match(/^[=\-]+\s*$/); 26 | if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2; 27 | return maxDepth; 28 | } 29 | 30 | var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1); 31 | var level = headerLevel(start.line, firstLine, nextLine); 32 | if (level === maxDepth) return undefined; 33 | 34 | var lastLineNo = cm.lastLine(); 35 | var end = start.line, nextNextLine = cm.getLine(end + 2); 36 | while (end < lastLineNo) { 37 | if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break; 38 | ++end; 39 | nextLine = nextNextLine; 40 | nextNextLine = cm.getLine(end + 2); 41 | } 42 | 43 | return { 44 | from: CodeMirror.Pos(start.line, firstLine.length), 45 | to: CodeMirror.Pos(end, cm.getLine(end).length) 46 | }; 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/hint/anyword-hint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var WORD = /[\w$]+/, RANGE = 500; 15 | 16 | CodeMirror.registerHelper("hint", "anyword", function(editor, options) { 17 | var word = options && options.word || WORD; 18 | var range = options && options.range || RANGE; 19 | var cur = editor.getCursor(), curLine = editor.getLine(cur.line); 20 | var end = cur.ch, start = end; 21 | while (start && word.test(curLine.charAt(start - 1))) --start; 22 | var curWord = start != end && curLine.slice(start, end); 23 | 24 | var list = options && options.list || [], seen = {}; 25 | var re = new RegExp(word.source, "g"); 26 | for (var dir = -1; dir <= 1; dir += 2) { 27 | var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir; 28 | for (; line != endLine; line += dir) { 29 | var text = editor.getLine(line), m; 30 | while (m = re.exec(text)) { 31 | if (line == cur.line && m[0] === curWord) continue; 32 | if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) { 33 | seen[m[0]] = true; 34 | list.push(m[0]); 35 | } 36 | } 37 | } 38 | } 39 | return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)}; 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | white-space: pre; 29 | color: black; 30 | cursor: pointer; 31 | } 32 | 33 | li.CodeMirror-hint-active { 34 | background: #08f; 35 | color: white; 36 | } 37 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/lint/coffeescript-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js 5 | 6 | // declare global: coffeelint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "coffeescript", function(text) { 19 | var found = []; 20 | if (!window.coffeelint) { 21 | if (window.console) { 22 | window.console.error("Error: window.coffeelint not defined, CodeMirror CoffeeScript linting cannot run."); 23 | } 24 | return found; 25 | } 26 | var parseError = function(err) { 27 | var loc = err.lineNumber; 28 | found.push({from: CodeMirror.Pos(loc-1, 0), 29 | to: CodeMirror.Pos(loc, 0), 30 | severity: err.level, 31 | message: err.message}); 32 | }; 33 | try { 34 | var res = coffeelint.lint(text); 35 | for(var i = 0; i < res.length; i++) { 36 | parseError(res[i]); 37 | } 38 | } catch(e) { 39 | found.push({from: CodeMirror.Pos(e.location.first_line, 0), 40 | to: CodeMirror.Pos(e.location.last_line, e.location.last_column), 41 | severity: 'error', 42 | message: e.message}); 43 | } 44 | return found; 45 | }); 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/lint/css-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | // Depends on csslint.js from https://github.com/stubbornella/csslint 5 | 6 | // declare global: CSSLint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "css", function(text, options) { 19 | var found = []; 20 | if (!window.CSSLint) { 21 | if (window.console) { 22 | window.console.error("Error: window.CSSLint not defined, CodeMirror CSS linting cannot run."); 23 | } 24 | return found; 25 | } 26 | var results = CSSLint.verify(text, options), messages = results.messages, message = null; 27 | for ( var i = 0; i < messages.length; i++) { 28 | message = messages[i]; 29 | var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col; 30 | found.push({ 31 | from: CodeMirror.Pos(startLine, startCol), 32 | to: CodeMirror.Pos(endLine, endCol), 33 | message: message.message, 34 | severity : message.type 35 | }); 36 | } 37 | return found; 38 | }); 39 | 40 | }); 41 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/lint/html-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | // Depends on htmlhint.js from http://htmlhint.com/js/htmlhint.js 5 | 6 | // declare global: HTMLHint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror"), require("htmlhint")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror", "htmlhint"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror, window.HTMLHint); 15 | })(function(CodeMirror, HTMLHint) { 16 | "use strict"; 17 | 18 | var defaultRules = { 19 | "tagname-lowercase": true, 20 | "attr-lowercase": true, 21 | "attr-value-double-quotes": true, 22 | "doctype-first": false, 23 | "tag-pair": true, 24 | "spec-char-escape": true, 25 | "id-unique": true, 26 | "src-not-empty": true, 27 | "attr-no-duplication": true 28 | }; 29 | 30 | CodeMirror.registerHelper("lint", "html", function(text, options) { 31 | var found = []; 32 | if (HTMLHint && !HTMLHint.verify) HTMLHint = HTMLHint.HTMLHint; 33 | if (!HTMLHint) HTMLHint = window.HTMLHint; 34 | if (!HTMLHint) { 35 | if (window.console) { 36 | window.console.error("Error: HTMLHint not found, not defined on window, or not available through define/require, CodeMirror HTML linting cannot run."); 37 | } 38 | return found; 39 | } 40 | var messages = HTMLHint.verify(text, options && options.rules || defaultRules); 41 | for (var i = 0; i < messages.length; i++) { 42 | var message = messages[i]; 43 | var startLine = message.line - 1, endLine = message.line - 1, startCol = message.col - 1, endCol = message.col; 44 | found.push({ 45 | from: CodeMirror.Pos(startLine, startCol), 46 | to: CodeMirror.Pos(endLine, endCol), 47 | message: message.message, 48 | severity : message.type 49 | }); 50 | } 51 | return found; 52 | }); 53 | }); 54 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/lint/json-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint 5 | 6 | // declare global: jsonlint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "json", function(text) { 19 | var found = []; 20 | if (!window.jsonlint) { 21 | if (window.console) { 22 | window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run."); 23 | } 24 | return found; 25 | } 26 | // for jsonlint's web dist jsonlint is exported as an object with a single property parser, of which parseError 27 | // is a subproperty 28 | var jsonlint = window.jsonlint.parser || window.jsonlint 29 | jsonlint.parseError = function(str, hash) { 30 | var loc = hash.loc; 31 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), 32 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), 33 | message: str}); 34 | }; 35 | try { jsonlint.parse(text); } 36 | catch(e) {} 37 | return found; 38 | }); 39 | 40 | }); 41 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/lint/yaml-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | // Depends on js-yaml.js from https://github.com/nodeca/js-yaml 15 | 16 | // declare global: jsyaml 17 | 18 | CodeMirror.registerHelper("lint", "yaml", function(text) { 19 | var found = []; 20 | if (!window.jsyaml) { 21 | if (window.console) { 22 | window.console.error("Error: window.jsyaml not defined, CodeMirror YAML linting cannot run."); 23 | } 24 | return found; 25 | } 26 | try { jsyaml.load(text); } 27 | catch(e) { 28 | var loc = e.mark, 29 | // js-yaml YAMLException doesn't always provide an accurate lineno 30 | // e.g., when there are multiple yaml docs 31 | // --- 32 | // --- 33 | // foo:bar 34 | from = loc ? CodeMirror.Pos(loc.line, loc.column) : CodeMirror.Pos(0, 0), 35 | to = from; 36 | found.push({ from: from, to: to, message: e.message }); 37 | } 38 | return found; 39 | }); 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/mode/multiplex_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | CodeMirror.defineMode("markdown_with_stex", function(){ 6 | var inner = CodeMirror.getMode({}, "stex"); 7 | var outer = CodeMirror.getMode({}, "markdown"); 8 | 9 | var innerOptions = { 10 | open: '$', 11 | close: '$', 12 | mode: inner, 13 | delimStyle: 'delim', 14 | innerStyle: 'inner' 15 | }; 16 | 17 | return CodeMirror.multiplexingMode(outer, innerOptions); 18 | }); 19 | 20 | var mode = CodeMirror.getMode({}, "markdown_with_stex"); 21 | 22 | function MT(name) { 23 | test.mode( 24 | name, 25 | mode, 26 | Array.prototype.slice.call(arguments, 1), 27 | 'multiplexing'); 28 | } 29 | 30 | MT( 31 | "stexInsideMarkdown", 32 | "[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]"); 33 | })(); 34 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/runmode/colorize.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("./runmode")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "./runmode"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; 15 | 16 | function textContent(node, out) { 17 | if (node.nodeType == 3) return out.push(node.nodeValue); 18 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) { 19 | textContent(ch, out); 20 | if (isBlock.test(node.nodeType)) out.push("\n"); 21 | } 22 | } 23 | 24 | CodeMirror.colorize = function(collection, defaultMode) { 25 | if (!collection) collection = document.body.getElementsByTagName("pre"); 26 | 27 | for (var i = 0; i < collection.length; ++i) { 28 | var node = collection[i]; 29 | var mode = node.getAttribute("data-lang") || defaultMode; 30 | if (!mode) continue; 31 | 32 | var text = []; 33 | textContent(node, text); 34 | node.innerHTML = ""; 35 | CodeMirror.runMode(text.join(""), mode, node); 36 | 37 | node.className += " cm-s-default"; 38 | } 39 | }; 40 | }); 41 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/scroll/scrollpastend.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) { 15 | if (old && old != CodeMirror.Init) { 16 | cm.off("change", onChange); 17 | cm.off("refresh", updateBottomMargin); 18 | cm.display.lineSpace.parentNode.style.paddingBottom = ""; 19 | cm.state.scrollPastEndPadding = null; 20 | } 21 | if (val) { 22 | cm.on("change", onChange); 23 | cm.on("refresh", updateBottomMargin); 24 | updateBottomMargin(cm); 25 | } 26 | }); 27 | 28 | function onChange(cm, change) { 29 | if (CodeMirror.changeEnd(change).line == cm.lastLine()) 30 | updateBottomMargin(cm); 31 | } 32 | 33 | function updateBottomMargin(cm) { 34 | var padding = ""; 35 | if (cm.lineCount() > 1) { 36 | var totalH = cm.display.scroller.clientHeight - 30, 37 | lastLineH = cm.getLineHandle(cm.lastLine()).height; 38 | padding = (totalH - lastLineH) + "px"; 39 | } 40 | if (cm.state.scrollPastEndPadding != padding) { 41 | cm.state.scrollPastEndPadding = padding; 42 | cm.display.lineSpace.parentNode.style.paddingBottom = padding; 43 | cm.off("refresh", updateBottomMargin); 44 | cm.setSize(); 45 | cm.on("refresh", updateBottomMargin); 46 | } 47 | } 48 | }); 49 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/scroll/simplescrollbars.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { 2 | position: absolute; 3 | background: #ccc; 4 | -moz-box-sizing: border-box; 5 | box-sizing: border-box; 6 | border: 1px solid #bbb; 7 | border-radius: 2px; 8 | } 9 | 10 | .CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { 11 | position: absolute; 12 | z-index: 6; 13 | background: #eee; 14 | } 15 | 16 | .CodeMirror-simplescroll-horizontal { 17 | bottom: 0; left: 0; 18 | height: 8px; 19 | } 20 | .CodeMirror-simplescroll-horizontal div { 21 | bottom: 0; 22 | height: 100%; 23 | } 24 | 25 | .CodeMirror-simplescroll-vertical { 26 | right: 0; top: 0; 27 | width: 8px; 28 | } 29 | .CodeMirror-simplescroll-vertical div { 30 | right: 0; 31 | width: 100%; 32 | } 33 | 34 | 35 | .CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { 36 | display: none; 37 | } 38 | 39 | .CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { 40 | position: absolute; 41 | background: #bcd; 42 | border-radius: 3px; 43 | } 44 | 45 | .CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { 46 | position: absolute; 47 | z-index: 6; 48 | } 49 | 50 | .CodeMirror-overlayscroll-horizontal { 51 | bottom: 0; left: 0; 52 | height: 6px; 53 | } 54 | .CodeMirror-overlayscroll-horizontal div { 55 | bottom: 0; 56 | height: 100%; 57 | } 58 | 59 | .CodeMirror-overlayscroll-vertical { 60 | right: 0; top: 0; 61 | width: 6px; 62 | } 63 | .CodeMirror-overlayscroll-vertical div { 64 | right: 0; 65 | width: 100%; 66 | } 67 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/search/jump-to-line.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | // Defines jumpToLine command. Uses dialog.js if present. 5 | 6 | (function(mod) { 7 | if (typeof exports == "object" && typeof module == "object") // CommonJS 8 | mod(require("../../lib/codemirror"), require("../dialog/dialog")); 9 | else if (typeof define == "function" && define.amd) // AMD 10 | define(["../../lib/codemirror", "../dialog/dialog"], mod); 11 | else // Plain browser env 12 | mod(CodeMirror); 13 | })(function(CodeMirror) { 14 | "use strict"; 15 | 16 | function dialog(cm, text, shortText, deflt, f) { 17 | if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true}); 18 | else f(prompt(shortText, deflt)); 19 | } 20 | 21 | function getJumpDialog(cm) { 22 | return cm.phrase("Jump to line:") + ' ' + cm.phrase("(Use line:column or scroll% syntax)") + ''; 23 | } 24 | 25 | function interpretLine(cm, string) { 26 | var num = Number(string) 27 | if (/^[-+]/.test(string)) return cm.getCursor().line + num 28 | else return num - 1 29 | } 30 | 31 | CodeMirror.commands.jumpToLine = function(cm) { 32 | var cur = cm.getCursor(); 33 | dialog(cm, getJumpDialog(cm), cm.phrase("Jump to line:"), (cur.line + 1) + ":" + cur.ch, function(posStr) { 34 | if (!posStr) return; 35 | 36 | var match; 37 | if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) { 38 | cm.setCursor(interpretLine(cm, match[1]), Number(match[2])) 39 | } else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) { 40 | var line = Math.round(cm.lineCount() * Number(match[1]) / 100); 41 | if (/^[-+]/.test(match[1])) line = cur.line + line + 1; 42 | cm.setCursor(line - 1, cur.ch); 43 | } else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) { 44 | cm.setCursor(interpretLine(cm, match[1]), cur.ch); 45 | } 46 | }); 47 | }; 48 | 49 | CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine"; 50 | }); 51 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/search/matchesonscrollbar.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-search-match { 2 | background: gold; 3 | border-top: 1px solid orange; 4 | border-bottom: 1px solid orange; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | opacity: .5; 8 | } 9 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/addon/tern/worker.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | // declare global: tern, server 5 | 6 | var server; 7 | 8 | this.onmessage = function(e) { 9 | var data = e.data; 10 | switch (data.type) { 11 | case "init": return startServer(data.defs, data.plugins, data.scripts); 12 | case "add": return server.addFile(data.name, data.text); 13 | case "del": return server.delFile(data.name); 14 | case "req": return server.request(data.body, function(err, reqData) { 15 | postMessage({id: data.id, body: reqData, err: err && String(err)}); 16 | }); 17 | case "getFile": 18 | var c = pending[data.id]; 19 | delete pending[data.id]; 20 | return c(data.err, data.text); 21 | default: throw new Error("Unknown message type: " + data.type); 22 | } 23 | }; 24 | 25 | var nextId = 0, pending = {}; 26 | function getFile(file, c) { 27 | postMessage({type: "getFile", name: file, id: ++nextId}); 28 | pending[nextId] = c; 29 | } 30 | 31 | function startServer(defs, plugins, scripts) { 32 | if (scripts) importScripts.apply(null, scripts); 33 | 34 | server = new tern.Server({ 35 | getFile: getFile, 36 | async: true, 37 | defs: defs, 38 | plugins: plugins 39 | }); 40 | } 41 | 42 | this.console = { 43 | log: function(v) { postMessage({type: "debug", message: v}); } 44 | }; 45 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/asciiarmor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ASCII Armor (PGP) mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ASCII Armor (PGP) mode

27 |
36 | 37 | 42 | 43 |

MIME types 44 | defined: application/pgp, application/pgp-encrypted, application/pgp-keys, application/pgp-signature

45 | 46 |
47 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/css/gss_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | "use strict"; 6 | 7 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss"); 8 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); } 9 | 10 | MT("atComponent", 11 | "[def @component] {", 12 | "[tag foo] {", 13 | " [property color]: [keyword black];", 14 | "}", 15 | "}"); 16 | 17 | })(); 18 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/css/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: CSS mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 | 28 |
29 |

CSS mode

30 |
65 | 70 | 71 |

MIME types defined: text/css, text/x-scss (demo), text/x-less (demo).

72 | 73 |

Parsing/Highlighting Tests: normal, verbose.

74 | 75 |
76 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/css/less_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | "use strict"; 6 | 7 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less"); 8 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); } 9 | 10 | MT("variable", 11 | "[variable-2 @base]: [atom #f04615];", 12 | "[qualifier .class] {", 13 | " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]", 14 | " [property color]: [variable saturate]([variable-2 @base], [number 5%]);", 15 | "}"); 16 | 17 | MT("amp", 18 | "[qualifier .child], [qualifier .sibling] {", 19 | " [qualifier .parent] [atom &] {", 20 | " [property color]: [keyword black];", 21 | " }", 22 | " [atom &] + [atom &] {", 23 | " [property color]: [keyword red];", 24 | " }", 25 | "}"); 26 | 27 | MT("mixin", 28 | "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", 29 | " [property color]: [atom darken]([variable-2 @color], [number 10%]);", 30 | "}", 31 | "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", 32 | " [property color]: [atom lighten]([variable-2 @color], [number 10%]);", 33 | "}", 34 | "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", 35 | " [property display]: [atom block];", 36 | "}", 37 | "[variable-2 @switch]: [variable light];", 38 | "[qualifier .class] {", 39 | " [qualifier .mixin]([variable-2 @switch]; [atom #888]);", 40 | "}"); 41 | 42 | MT("nest", 43 | "[qualifier .one] {", 44 | " [def @media] ([property width]: [number 400px]) {", 45 | " [property font-size]: [number 1.2em];", 46 | " [def @media] [attribute print] [keyword and] [property color] {", 47 | " [property color]: [keyword blue];", 48 | " }", 49 | " }", 50 | "}"); 51 | 52 | 53 | MT("interpolation", ".@{[variable foo]} { [property font-weight]: [atom bold]; }"); 54 | })(); 55 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/cypher/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "cypher"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("unbalancedDoubledQuotedString", 9 | "[string \"a'b\"][variable c]"); 10 | 11 | MT("unbalancedSingleQuotedString", 12 | "[string 'a\"b'][variable c]"); 13 | 14 | MT("doubleQuotedString", 15 | "[string \"a\"][variable b]"); 16 | 17 | MT("singleQuotedString", 18 | "[string 'a'][variable b]"); 19 | 20 | MT("single attribute (with content)", 21 | "[node {][atom a:][string 'a'][node }]"); 22 | 23 | MT("multiple attribute, singleQuotedString (with content)", 24 | "[node {][atom a:][string 'a'][node ,][atom b:][string 'b'][node }]"); 25 | 26 | MT("multiple attribute, doubleQuotedString (with content)", 27 | "[node {][atom a:][string \"a\"][node ,][atom b:][string \"b\"][node }]"); 28 | 29 | MT("single attribute (without content)", 30 | "[node {][atom a:][string 'a'][node }]"); 31 | 32 | MT("multiple attribute, singleQuotedString (without content)", 33 | "[node {][atom a:][string ''][node ,][atom b:][string ''][node }]"); 34 | 35 | MT("multiple attribute, doubleQuotedString (without content)", 36 | "[node {][atom a:][string \"\"][node ,][atom b:][string \"\"][node }]"); 37 | })(); 38 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/d/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "d"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("nested_comments", 9 | "[comment /+]","[comment comment]","[comment +/]","[variable void] [variable main](){}"); 10 | 11 | })(); 12 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/dart/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Dart mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Dart mode

27 |
28 | 62 |
63 | 64 | 70 | 71 |
72 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/diff/diff.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineMode("diff", function() { 15 | 16 | var TOKEN_NAMES = { 17 | '+': 'positive', 18 | '-': 'negative', 19 | '@': 'meta' 20 | }; 21 | 22 | return { 23 | token: function(stream) { 24 | var tw_pos = stream.string.search(/[\t ]+?$/); 25 | 26 | if (!stream.sol() || tw_pos === 0) { 27 | stream.skipToEnd(); 28 | return ("error " + ( 29 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); 30 | } 31 | 32 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); 33 | 34 | if (tw_pos === -1) { 35 | stream.skipToEnd(); 36 | } else { 37 | stream.pos = tw_pos; 38 | } 39 | 40 | return token_name; 41 | } 42 | }; 43 | }); 44 | 45 | CodeMirror.defineMIME("text/x-diff", "diff"); 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/ecl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ECL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ECL mode

27 |
45 | 48 | 49 |

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

50 |

MIME types defined: text/x-ecl.

51 | 52 |
53 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/elm/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Elm mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Elm mode

27 | 28 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-elm.

61 |
62 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/forth/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Forth mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 31 | 32 |
33 | 34 |

Forth mode

35 | 36 |
57 |
58 | 59 | 70 | 71 |

Simple mode that handle Forth-Syntax (Forth on WikiPedia).

72 | 73 |

MIME types defined: text/x-forth.

74 | 75 |
76 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/gas/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Gas mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Gas mode

27 |
28 | 50 |
51 | 52 | 58 | 59 |

Handles AT&T assembler syntax (more specifically this handles 60 | the GNU Assembler (gas) syntax.) 61 | It takes a single optional configuration parameter: 62 | architecture, which can be one of "ARM", 63 | "ARMv6" or "x86". 64 | Including the parameter adds syntax for the registers and special 65 | directives for the supplied architecture. 66 | 67 |

MIME types defined: text/x-gas

68 |
69 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/gherkin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Gherkin mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Gherkin mode

27 |
42 | 45 | 46 |

MIME types defined: text/x-feature.

47 | 48 |
49 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/haskell-literate/haskell-literate.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function (mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("../haskell/haskell")) 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "../haskell/haskell"], mod) 9 | else // Plain browser env 10 | mod(CodeMirror) 11 | })(function (CodeMirror) { 12 | "use strict" 13 | 14 | CodeMirror.defineMode("haskell-literate", function (config, parserConfig) { 15 | var baseMode = CodeMirror.getMode(config, (parserConfig && parserConfig.base) || "haskell") 16 | 17 | return { 18 | startState: function () { 19 | return { 20 | inCode: false, 21 | baseState: CodeMirror.startState(baseMode) 22 | } 23 | }, 24 | token: function (stream, state) { 25 | if (stream.sol()) { 26 | if (state.inCode = stream.eat(">")) 27 | return "meta" 28 | } 29 | if (state.inCode) { 30 | return baseMode.token(stream, state.baseState) 31 | } else { 32 | stream.skipToEnd() 33 | return "comment" 34 | } 35 | }, 36 | innerMode: function (state) { 37 | return state.inCode ? {state: state.baseState, mode: baseMode} : null 38 | } 39 | } 40 | }, "haskell") 41 | 42 | CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate") 43 | }); 44 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/htmlembedded/htmlembedded.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), 7 | require("../../addon/mode/multiplex")); 8 | else if (typeof define == "function" && define.amd) // AMD 9 | define(["../../lib/codemirror", "../htmlmixed/htmlmixed", 10 | "../../addon/mode/multiplex"], mod); 11 | else // Plain browser env 12 | mod(CodeMirror); 13 | })(function(CodeMirror) { 14 | "use strict"; 15 | 16 | CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { 17 | var closeComment = parserConfig.closeComment || "--%>" 18 | return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { 19 | open: parserConfig.openComment || "<%--", 20 | close: closeComment, 21 | delimStyle: "comment", 22 | mode: {token: function(stream) { 23 | stream.skipTo(closeComment) || stream.skipToEnd() 24 | return "comment" 25 | }} 26 | }, { 27 | open: parserConfig.open || parserConfig.scriptStartRegex || "<%", 28 | close: parserConfig.close || parserConfig.scriptEndRegex || "%>", 29 | mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) 30 | }); 31 | }, "htmlmixed"); 32 | 33 | CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); 34 | CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); 35 | CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); 36 | CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); 37 | }); 38 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/http/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: HTTP mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

HTTP mode

27 | 28 | 29 |
39 | 40 | 43 | 44 |

MIME types defined: message/http.

45 |
46 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/idl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: IDL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

IDL mode

28 | 29 |
53 | 63 | 64 |

MIME types defined: text/x-idl.

65 |
66 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/javascript/typescript.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: TypeScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

TypeScript mode

28 | 29 | 30 |
52 | 53 | 60 | 61 |

This is a specialization of the JavaScript mode.

62 |
63 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/jinja2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Jinja2 mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Jinja2 mode

27 |
49 | 54 |
55 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/mbox/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: mbox mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

mbox mode

27 |
38 | 41 | 42 |

MIME types defined: application/mbox.

43 | 44 |
45 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/nsis/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: NSIS mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 28 | 29 |
30 |

NSIS mode

31 | 32 | 33 | 68 | 69 | 78 | 79 |

MIME types defined: text/x-nsis.

80 |
-------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/octave/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Octave mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Octave mode

28 | 29 |
72 | 82 | 83 |

MIME types defined: text/x-octave.

84 |
85 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/oz/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Oz mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 26 | 27 |
28 |

Oz mode

29 | 50 |

MIME type defined: text/x-oz.

51 | 52 | 59 |
60 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/pascal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Pascal mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Pascal mode

27 | 28 | 29 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-pascal.

61 |
62 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/pegjs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: PEG.js Mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 28 | 29 |
30 |

PEG.js Mode

31 |
56 | 62 |

The PEG.js Mode

63 |

Created by Forbes Lindesay.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/perl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Perl mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Perl mode

27 | 28 | 29 |
67 | 68 | 73 | 74 |

MIME types defined: text/x-perl.

75 |
76 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/pig/index.html: -------------------------------------------------------------------------------- 1 |  2 | CodeMirror: Pig Latin mode 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 23 | 24 |
25 |

Pig Latin mode

26 |
38 | 39 | 46 | 47 |

48 | Simple mode that handles Pig Latin language. 49 |

50 | 51 |

MIME type defined: text/x-pig 52 | (PIG code) 53 |

54 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/properties/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Properties files mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Properties files mode

27 |
46 | 49 | 50 |

MIME types defined: text/x-properties, 51 | text/x-ini.

52 | 53 |
54 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/python/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 4}, 6 | {name: "python", 7 | version: 3, 8 | singleLineStringErrors: false}); 9 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 10 | 11 | // Error, because "foobarhello" is neither a known type or property, but 12 | // property was expected (after "and"), and it should be in parentheses. 13 | MT("decoratorStartOfLine", 14 | "[meta @dec]", 15 | "[keyword def] [def function]():", 16 | " [keyword pass]"); 17 | 18 | MT("decoratorIndented", 19 | "[keyword class] [def Foo]:", 20 | " [meta @dec]", 21 | " [keyword def] [def function]():", 22 | " [keyword pass]"); 23 | 24 | MT("matmulWithSpace:", "[variable a] [operator @] [variable b]"); 25 | MT("matmulWithoutSpace:", "[variable a][operator @][variable b]"); 26 | MT("matmulSpaceBefore:", "[variable a] [operator @][variable b]"); 27 | var before_equal_sign = ["+", "-", "*", "/", "=", "!", ">", "<"]; 28 | for (var i = 0; i < before_equal_sign.length; ++i) { 29 | var c = before_equal_sign[i] 30 | MT("before_equal_sign_" + c, "[variable a] [operator " + c + "=] [variable b]"); 31 | } 32 | 33 | MT("fValidStringPrefix", "[string f'this is a]{[variable formatted]}[string string']"); 34 | MT("fValidExpressioninFString", "[string f'expression ]{[number 100][operator *][number 5]}[string string']"); 35 | MT("fInvalidFString", "[error f'this is wrong}]"); 36 | MT("fNestedFString", "[string f'expression ]{[number 100] [operator +] [string f'inner]{[number 5]}[string ']}[string string']"); 37 | MT("uValidStringPrefix", "[string u'this is an unicode string']"); 38 | })(); 39 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/ruby/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("divide_equal_operator", 9 | "[variable bar] [operator /=] [variable foo]"); 10 | 11 | MT("divide_equal_operator_no_spacing", 12 | "[variable foo][operator /=][number 42]"); 13 | 14 | MT("complex_regexp", 15 | "[keyword if] [variable cr] [operator =~] [string-2 /(?: \\( #{][tag RE_NOT][string-2 }\\( | #{][tag RE_NOT_PAR_OR][string-2 }* #{][tag RE_OPA_OR][string-2 } )/][variable x]") 16 | })(); 17 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/rust/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Rust mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Rust mode

28 | 29 | 30 |
53 | 54 | 62 | 63 |

MIME types defined: text/x-rustsrc.

64 |
65 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/rust/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 4}, "rust"); 6 | function MT(name) {test.mode(name, mode, Array.prototype.slice.call(arguments, 1));} 7 | 8 | MT('integer_test', 9 | '[number 123i32]', 10 | '[number 123u32]', 11 | '[number 123_u32]', 12 | '[number 0xff_u8]', 13 | '[number 0o70_i16]', 14 | '[number 0b1111_1111_1001_0000_i32]', 15 | '[number 0usize]'); 16 | 17 | MT('float_test', 18 | '[number 123.0f64]', 19 | '[number 0.1f64]', 20 | '[number 0.1f32]', 21 | '[number 12E+99_f64]'); 22 | 23 | MT('string-literals-test', 24 | '[string "foo"]', 25 | '[string r"foo"]', 26 | '[string "\\"foo\\""]', 27 | '[string r#""foo""#]', 28 | '[string "foo #\\"# bar"]', 29 | 30 | '[string b"foo"]', 31 | '[string br"foo"]', 32 | '[string b"\\"foo\\""]', 33 | '[string br#""foo""#]', 34 | '[string br##"foo #" bar"##]', 35 | 36 | "[string-2 'h']", 37 | "[string-2 b'h']"); 38 | 39 | })(); 40 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/sas/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: SAS mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 30 | 31 |
32 |

SAS mode

33 |
71 | 72 | 78 | 79 |

MIME types defined: text/x-sas.

80 | 81 |
82 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/sass/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Sass mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 26 | 27 |
28 |

Sass mode

29 |
59 | 66 | 67 |

MIME types defined: text/x-sass.

68 |
69 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/shell/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Shell mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 27 | 28 |
29 |

Shell mode

30 | 31 | 32 | 56 | 57 | 64 | 65 |

MIME types defined: text/x-sh, application/x-sh.

66 |
67 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/smalltalk/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Smalltalk mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | 29 | 30 |
31 |

Smalltalk mode

32 |
55 | 56 | 64 | 65 |

Simple Smalltalk mode.

66 | 67 |

MIME types defined: text/x-stsrc.

68 |
69 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/solr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Solr mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 33 | 34 |
35 |

Solr mode

36 | 37 |
38 | 47 |
48 | 49 | 55 | 56 |

MIME types defined: text/x-solr.

57 |
58 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/soy/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Soy (Closure Template) mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 29 | 30 |
31 |

Soy (Closure Template) mode

32 |
55 | 56 | 65 | 66 |

A mode for Closure Templates (Soy).

67 |

MIME type defined: text/x-soy.

68 |
69 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/sparql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: SPARQL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

SPARQL mode

28 |
52 | 58 | 59 |

MIME types defined: application/sparql-query.

60 | 61 |
62 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/spreadsheet/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Spreadsheet mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Spreadsheet mode

28 |
29 | 30 | 37 | 38 |

MIME types defined: text/x-spreadsheet.

39 | 40 |

The Spreadsheet Mode

41 |

Created by Robert Plummer

42 |
43 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/tiki/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Tiki wiki mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Tiki wiki mode

28 | 29 | 30 |
87 | 88 | 94 | 95 |
96 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/tiki/tiki.css: -------------------------------------------------------------------------------- 1 | .cm-tw-syntaxerror { 2 | color: #FFF; 3 | background-color: #900; 4 | } 5 | 6 | .cm-tw-deleted { 7 | text-decoration: line-through; 8 | } 9 | 10 | .cm-tw-header5 { 11 | font-weight: bold; 12 | } 13 | .cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ 14 | padding-left: 10px; 15 | } 16 | 17 | .cm-tw-box { 18 | border-top-width: 0px !important; 19 | border-style: solid; 20 | border-width: 1px; 21 | border-color: inherit; 22 | } 23 | 24 | .cm-tw-underline { 25 | text-decoration: underline; 26 | } -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/toml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: TOML Mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

TOML Mode

27 |
64 | 70 |

The TOML Mode

71 |

Created by Forbes Lindesay.

72 |

MIME type defined: text/x-toml.

73 |
74 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/tornado/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Tornado template mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 | 28 |
29 |

Tornado template mode

30 |
50 | 51 | 59 | 60 |

Mode for HTML with embedded Tornado template markup.

61 | 62 |

MIME types defined: text/x-tornado

63 |
64 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/turtle/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Turtle mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Turtle mode

28 |
42 | 48 | 49 |

MIME types defined: text/turtle.

50 | 51 |
52 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/twig/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Twig mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Twig mode

27 |
40 | 45 |
46 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/vb/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: VB.NET mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 17 | 30 | 31 |
32 |

VB.NET mode

33 |
34 | 46 |
47 |

MIME type defined: text/x-vb.

48 | 49 |
50 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/vbscript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: VBScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

VBScript mode

27 | 28 | 29 |
46 | 47 | 53 | 54 |

MIME types defined: text/vbscript.

55 |
56 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/xml/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } 7 | 8 | MT("matching", 9 | "[tag&bracket <][tag top][tag&bracket >]", 10 | " text", 11 | " [tag&bracket <][tag inner][tag&bracket />]", 12 | "[tag&bracket ]"); 13 | 14 | MT("nonmatching", 15 | "[tag&bracket <][tag top][tag&bracket >]", 16 | " [tag&bracket <][tag inner][tag&bracket />]", 17 | " [tag&bracket ]"); 18 | 19 | MT("doctype", 20 | "[meta ]", 21 | "[tag&bracket <][tag top][tag&bracket />]"); 22 | 23 | MT("cdata", 24 | "[tag&bracket <][tag top][tag&bracket >]", 25 | " [atom ]", 27 | "[tag&bracket ]"); 28 | 29 | // HTML tests 30 | mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); 31 | 32 | MT("selfclose", 33 | "[tag&bracket <][tag html][tag&bracket >]", 34 | " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", 35 | "[tag&bracket ]"); 36 | 37 | MT("list", 38 | "[tag&bracket <][tag ol][tag&bracket >]", 39 | " [tag&bracket <][tag li][tag&bracket >]one", 40 | " [tag&bracket <][tag li][tag&bracket >]two", 41 | "[tag&bracket ]"); 42 | 43 | MT("valueless", 44 | "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); 45 | 46 | MT("pThenArticle", 47 | "[tag&bracket <][tag p][tag&bracket >]", 48 | " foo", 49 | "[tag&bracket <][tag article][tag&bracket >]bar"); 50 | 51 | })(); 52 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/mode/z80/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Z80 assembly mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Z80 assembly mode

27 | 28 | 29 |
45 | 46 | 51 | 52 |

MIME types defined: text/x-z80, text/x-ez80.

53 |
54 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/3024-day.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: 3024 day 4 | Author: Jan T. Sott (http://github.com/idleberg) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-3024-day.CodeMirror { background: #f7f7f7; color: #3a3432; } 12 | .cm-s-3024-day div.CodeMirror-selected { background: #d6d5d4; } 13 | 14 | .cm-s-3024-day .CodeMirror-line::selection, .cm-s-3024-day .CodeMirror-line > span::selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d6d5d4; } 15 | .cm-s-3024-day .CodeMirror-line::-moz-selection, .cm-s-3024-day .CodeMirror-line > span::-moz-selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d9d9d9; } 16 | 17 | .cm-s-3024-day .CodeMirror-gutters { background: #f7f7f7; border-right: 0px; } 18 | .cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; } 19 | .cm-s-3024-day .CodeMirror-guttermarker-subtle { color: #807d7c; } 20 | .cm-s-3024-day .CodeMirror-linenumber { color: #807d7c; } 21 | 22 | .cm-s-3024-day .CodeMirror-cursor { border-left: 1px solid #5c5855; } 23 | 24 | .cm-s-3024-day span.cm-comment { color: #cdab53; } 25 | .cm-s-3024-day span.cm-atom { color: #a16a94; } 26 | .cm-s-3024-day span.cm-number { color: #a16a94; } 27 | 28 | .cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute { color: #01a252; } 29 | .cm-s-3024-day span.cm-keyword { color: #db2d20; } 30 | .cm-s-3024-day span.cm-string { color: #fded02; } 31 | 32 | .cm-s-3024-day span.cm-variable { color: #01a252; } 33 | .cm-s-3024-day span.cm-variable-2 { color: #01a0e4; } 34 | .cm-s-3024-day span.cm-def { color: #e8bbd0; } 35 | .cm-s-3024-day span.cm-bracket { color: #3a3432; } 36 | .cm-s-3024-day span.cm-tag { color: #db2d20; } 37 | .cm-s-3024-day span.cm-link { color: #a16a94; } 38 | .cm-s-3024-day span.cm-error { background: #db2d20; color: #5c5855; } 39 | 40 | .cm-s-3024-day .CodeMirror-activeline-background { background: #e8f2ff; } 41 | .cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important; } 42 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/3024-night.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: 3024 night 4 | Author: Jan T. Sott (http://github.com/idleberg) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-3024-night.CodeMirror { background: #090300; color: #d6d5d4; } 12 | .cm-s-3024-night div.CodeMirror-selected { background: #3a3432; } 13 | .cm-s-3024-night .CodeMirror-line::selection, .cm-s-3024-night .CodeMirror-line > span::selection, .cm-s-3024-night .CodeMirror-line > span > span::selection { background: rgba(58, 52, 50, .99); } 14 | .cm-s-3024-night .CodeMirror-line::-moz-selection, .cm-s-3024-night .CodeMirror-line > span::-moz-selection, .cm-s-3024-night .CodeMirror-line > span > span::-moz-selection { background: rgba(58, 52, 50, .99); } 15 | .cm-s-3024-night .CodeMirror-gutters { background: #090300; border-right: 0px; } 16 | .cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; } 17 | .cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; } 18 | .cm-s-3024-night .CodeMirror-linenumber { color: #5c5855; } 19 | 20 | .cm-s-3024-night .CodeMirror-cursor { border-left: 1px solid #807d7c; } 21 | 22 | .cm-s-3024-night span.cm-comment { color: #cdab53; } 23 | .cm-s-3024-night span.cm-atom { color: #a16a94; } 24 | .cm-s-3024-night span.cm-number { color: #a16a94; } 25 | 26 | .cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute { color: #01a252; } 27 | .cm-s-3024-night span.cm-keyword { color: #db2d20; } 28 | .cm-s-3024-night span.cm-string { color: #fded02; } 29 | 30 | .cm-s-3024-night span.cm-variable { color: #01a252; } 31 | .cm-s-3024-night span.cm-variable-2 { color: #01a0e4; } 32 | .cm-s-3024-night span.cm-def { color: #e8bbd0; } 33 | .cm-s-3024-night span.cm-bracket { color: #d6d5d4; } 34 | .cm-s-3024-night span.cm-tag { color: #db2d20; } 35 | .cm-s-3024-night span.cm-link { color: #a16a94; } 36 | .cm-s-3024-night span.cm-error { background: #db2d20; color: #807d7c; } 37 | 38 | .cm-s-3024-night .CodeMirror-activeline-background { background: #2F2F2F; } 39 | .cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } 40 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/abcdef.css: -------------------------------------------------------------------------------- 1 | .cm-s-abcdef.CodeMirror { background: #0f0f0f; color: #defdef; } 2 | .cm-s-abcdef div.CodeMirror-selected { background: #515151; } 3 | .cm-s-abcdef .CodeMirror-line::selection, .cm-s-abcdef .CodeMirror-line > span::selection, .cm-s-abcdef .CodeMirror-line > span > span::selection { background: rgba(56, 56, 56, 0.99); } 4 | .cm-s-abcdef .CodeMirror-line::-moz-selection, .cm-s-abcdef .CodeMirror-line > span::-moz-selection, .cm-s-abcdef .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 56, 56, 0.99); } 5 | .cm-s-abcdef .CodeMirror-gutters { background: #555; border-right: 2px solid #314151; } 6 | .cm-s-abcdef .CodeMirror-guttermarker { color: #222; } 7 | .cm-s-abcdef .CodeMirror-guttermarker-subtle { color: azure; } 8 | .cm-s-abcdef .CodeMirror-linenumber { color: #FFFFFF; } 9 | .cm-s-abcdef .CodeMirror-cursor { border-left: 1px solid #00FF00; } 10 | 11 | .cm-s-abcdef span.cm-keyword { color: darkgoldenrod; font-weight: bold; } 12 | .cm-s-abcdef span.cm-atom { color: #77F; } 13 | .cm-s-abcdef span.cm-number { color: violet; } 14 | .cm-s-abcdef span.cm-def { color: #fffabc; } 15 | .cm-s-abcdef span.cm-variable { color: #abcdef; } 16 | .cm-s-abcdef span.cm-variable-2 { color: #cacbcc; } 17 | .cm-s-abcdef span.cm-variable-3, .cm-s-abcdef span.cm-type { color: #def; } 18 | .cm-s-abcdef span.cm-property { color: #fedcba; } 19 | .cm-s-abcdef span.cm-operator { color: #ff0; } 20 | .cm-s-abcdef span.cm-comment { color: #7a7b7c; font-style: italic;} 21 | .cm-s-abcdef span.cm-string { color: #2b4; } 22 | .cm-s-abcdef span.cm-meta { color: #C9F; } 23 | .cm-s-abcdef span.cm-qualifier { color: #FFF700; } 24 | .cm-s-abcdef span.cm-builtin { color: #30aabc; } 25 | .cm-s-abcdef span.cm-bracket { color: #8a8a8a; } 26 | .cm-s-abcdef span.cm-tag { color: #FFDD44; } 27 | .cm-s-abcdef span.cm-attribute { color: #DDFF00; } 28 | .cm-s-abcdef span.cm-error { color: #FF0000; } 29 | .cm-s-abcdef span.cm-header { color: aquamarine; font-weight: bold; } 30 | .cm-s-abcdef span.cm-link { color: blueviolet; } 31 | 32 | .cm-s-abcdef .CodeMirror-activeline-background { background: #314151; } 33 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/ambiance-mobile.css: -------------------------------------------------------------------------------- 1 | .cm-s-ambiance.CodeMirror { 2 | -webkit-box-shadow: none; 3 | -moz-box-shadow: none; 4 | box-shadow: none; 5 | } 6 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/bespin.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Bespin 4 | Author: Mozilla / Jan T. Sott 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-bespin.CodeMirror {background: #28211c; color: #9d9b97;} 12 | .cm-s-bespin div.CodeMirror-selected {background: #36312e !important;} 13 | .cm-s-bespin .CodeMirror-gutters {background: #28211c; border-right: 0px;} 14 | .cm-s-bespin .CodeMirror-linenumber {color: #666666;} 15 | .cm-s-bespin .CodeMirror-cursor {border-left: 1px solid #797977 !important;} 16 | 17 | .cm-s-bespin span.cm-comment {color: #937121;} 18 | .cm-s-bespin span.cm-atom {color: #9b859d;} 19 | .cm-s-bespin span.cm-number {color: #9b859d;} 20 | 21 | .cm-s-bespin span.cm-property, .cm-s-bespin span.cm-attribute {color: #54be0d;} 22 | .cm-s-bespin span.cm-keyword {color: #cf6a4c;} 23 | .cm-s-bespin span.cm-string {color: #f9ee98;} 24 | 25 | .cm-s-bespin span.cm-variable {color: #54be0d;} 26 | .cm-s-bespin span.cm-variable-2 {color: #5ea6ea;} 27 | .cm-s-bespin span.cm-def {color: #cf7d34;} 28 | .cm-s-bespin span.cm-error {background: #cf6a4c; color: #797977;} 29 | .cm-s-bespin span.cm-bracket {color: #9d9b97;} 30 | .cm-s-bespin span.cm-tag {color: #cf6a4c;} 31 | .cm-s-bespin span.cm-link {color: #9b859d;} 32 | 33 | .cm-s-bespin .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 34 | .cm-s-bespin .CodeMirror-activeline-background { background: #404040; } 35 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/blackboard.css: -------------------------------------------------------------------------------- 1 | /* Port of TextMate's Blackboard theme */ 2 | 3 | .cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } 4 | .cm-s-blackboard div.CodeMirror-selected { background: #253B76; } 5 | .cm-s-blackboard .CodeMirror-line::selection, .cm-s-blackboard .CodeMirror-line > span::selection, .cm-s-blackboard .CodeMirror-line > span > span::selection { background: rgba(37, 59, 118, .99); } 6 | .cm-s-blackboard .CodeMirror-line::-moz-selection, .cm-s-blackboard .CodeMirror-line > span::-moz-selection, .cm-s-blackboard .CodeMirror-line > span > span::-moz-selection { background: rgba(37, 59, 118, .99); } 7 | .cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } 8 | .cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } 9 | .cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } 10 | .cm-s-blackboard .CodeMirror-linenumber { color: #888; } 11 | .cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7; } 12 | 13 | .cm-s-blackboard .cm-keyword { color: #FBDE2D; } 14 | .cm-s-blackboard .cm-atom { color: #D8FA3C; } 15 | .cm-s-blackboard .cm-number { color: #D8FA3C; } 16 | .cm-s-blackboard .cm-def { color: #8DA6CE; } 17 | .cm-s-blackboard .cm-variable { color: #FF6400; } 18 | .cm-s-blackboard .cm-operator { color: #FBDE2D; } 19 | .cm-s-blackboard .cm-comment { color: #AEAEAE; } 20 | .cm-s-blackboard .cm-string { color: #61CE3C; } 21 | .cm-s-blackboard .cm-string-2 { color: #61CE3C; } 22 | .cm-s-blackboard .cm-meta { color: #D8FA3C; } 23 | .cm-s-blackboard .cm-builtin { color: #8DA6CE; } 24 | .cm-s-blackboard .cm-tag { color: #8DA6CE; } 25 | .cm-s-blackboard .cm-attribute { color: #8DA6CE; } 26 | .cm-s-blackboard .cm-header { color: #FF6400; } 27 | .cm-s-blackboard .cm-hr { color: #AEAEAE; } 28 | .cm-s-blackboard .cm-link { color: #8DA6CE; } 29 | .cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } 30 | 31 | .cm-s-blackboard .CodeMirror-activeline-background { background: #3C3636; } 32 | .cm-s-blackboard .CodeMirror-matchingbracket { outline:1px solid grey;color:white !important; } 33 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/cobalt.css: -------------------------------------------------------------------------------- 1 | .cm-s-cobalt.CodeMirror { background: #002240; color: white; } 2 | .cm-s-cobalt div.CodeMirror-selected { background: #b36539; } 3 | .cm-s-cobalt .CodeMirror-line::selection, .cm-s-cobalt .CodeMirror-line > span::selection, .cm-s-cobalt .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); } 4 | .cm-s-cobalt .CodeMirror-line::-moz-selection, .cm-s-cobalt .CodeMirror-line > span::-moz-selection, .cm-s-cobalt .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); } 5 | .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } 6 | .cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } 7 | .cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } 8 | .cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } 9 | .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white; } 10 | 11 | .cm-s-cobalt span.cm-comment { color: #08f; } 12 | .cm-s-cobalt span.cm-atom { color: #845dc4; } 13 | .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } 14 | .cm-s-cobalt span.cm-keyword { color: #ffee80; } 15 | .cm-s-cobalt span.cm-string { color: #3ad900; } 16 | .cm-s-cobalt span.cm-meta { color: #ff9d00; } 17 | .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } 18 | .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def, .cm-s-cobalt .cm-type { color: white; } 19 | .cm-s-cobalt span.cm-bracket { color: #d8d8d8; } 20 | .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } 21 | .cm-s-cobalt span.cm-link { color: #845dc4; } 22 | .cm-s-cobalt span.cm-error { color: #9d1e15; } 23 | 24 | .cm-s-cobalt .CodeMirror-activeline-background { background: #002D57; } 25 | .cm-s-cobalt .CodeMirror-matchingbracket { outline:1px solid grey;color:white !important; } 26 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/colorforth.css: -------------------------------------------------------------------------------- 1 | .cm-s-colorforth.CodeMirror { background: #000000; color: #f8f8f8; } 2 | .cm-s-colorforth .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } 3 | .cm-s-colorforth .CodeMirror-guttermarker { color: #FFBD40; } 4 | .cm-s-colorforth .CodeMirror-guttermarker-subtle { color: #78846f; } 5 | .cm-s-colorforth .CodeMirror-linenumber { color: #bababa; } 6 | .cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white; } 7 | 8 | .cm-s-colorforth span.cm-comment { color: #ededed; } 9 | .cm-s-colorforth span.cm-def { color: #ff1c1c; font-weight:bold; } 10 | .cm-s-colorforth span.cm-keyword { color: #ffd900; } 11 | .cm-s-colorforth span.cm-builtin { color: #00d95a; } 12 | .cm-s-colorforth span.cm-variable { color: #73ff00; } 13 | .cm-s-colorforth span.cm-string { color: #007bff; } 14 | .cm-s-colorforth span.cm-number { color: #00c4ff; } 15 | .cm-s-colorforth span.cm-atom { color: #606060; } 16 | 17 | .cm-s-colorforth span.cm-variable-2 { color: #EEE; } 18 | .cm-s-colorforth span.cm-variable-3, .cm-s-colorforth span.cm-type { color: #DDD; } 19 | .cm-s-colorforth span.cm-property {} 20 | .cm-s-colorforth span.cm-operator {} 21 | 22 | .cm-s-colorforth span.cm-meta { color: yellow; } 23 | .cm-s-colorforth span.cm-qualifier { color: #FFF700; } 24 | .cm-s-colorforth span.cm-bracket { color: #cc7; } 25 | .cm-s-colorforth span.cm-tag { color: #FFBD40; } 26 | .cm-s-colorforth span.cm-attribute { color: #FFF700; } 27 | .cm-s-colorforth span.cm-error { color: #f00; } 28 | 29 | .cm-s-colorforth div.CodeMirror-selected { background: #333d53; } 30 | 31 | .cm-s-colorforth span.cm-compilation { background: rgba(255, 255, 255, 0.12); } 32 | 33 | .cm-s-colorforth .CodeMirror-activeline-background { background: #253540; } 34 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/dracula.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: dracula 4 | Author: Michael Kaminsky (http://github.com/mkaminsky11) 5 | 6 | Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme) 7 | 8 | */ 9 | 10 | 11 | .cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters { 12 | background-color: #282a36 !important; 13 | color: #f8f8f2 !important; 14 | border: none; 15 | } 16 | .cm-s-dracula .CodeMirror-gutters { color: #282a36; } 17 | .cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; } 18 | .cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; } 19 | .cm-s-dracula .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } 20 | .cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); } 21 | .cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); } 22 | .cm-s-dracula span.cm-comment { color: #6272a4; } 23 | .cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #f1fa8c; } 24 | .cm-s-dracula span.cm-number { color: #bd93f9; } 25 | .cm-s-dracula span.cm-variable { color: #50fa7b; } 26 | .cm-s-dracula span.cm-variable-2 { color: white; } 27 | .cm-s-dracula span.cm-def { color: #50fa7b; } 28 | .cm-s-dracula span.cm-operator { color: #ff79c6; } 29 | .cm-s-dracula span.cm-keyword { color: #ff79c6; } 30 | .cm-s-dracula span.cm-atom { color: #bd93f9; } 31 | .cm-s-dracula span.cm-meta { color: #f8f8f2; } 32 | .cm-s-dracula span.cm-tag { color: #ff79c6; } 33 | .cm-s-dracula span.cm-attribute { color: #50fa7b; } 34 | .cm-s-dracula span.cm-qualifier { color: #50fa7b; } 35 | .cm-s-dracula span.cm-property { color: #66d9ef; } 36 | .cm-s-dracula span.cm-builtin { color: #50fa7b; } 37 | .cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type { color: #ffb86c; } 38 | 39 | .cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); } 40 | .cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } 41 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/eclipse.css: -------------------------------------------------------------------------------- 1 | .cm-s-eclipse span.cm-meta { color: #FF1717; } 2 | .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } 3 | .cm-s-eclipse span.cm-atom { color: #219; } 4 | .cm-s-eclipse span.cm-number { color: #164; } 5 | .cm-s-eclipse span.cm-def { color: #00f; } 6 | .cm-s-eclipse span.cm-variable { color: black; } 7 | .cm-s-eclipse span.cm-variable-2 { color: #0000C0; } 8 | .cm-s-eclipse span.cm-variable-3, .cm-s-eclipse span.cm-type { color: #0000C0; } 9 | .cm-s-eclipse span.cm-property { color: black; } 10 | .cm-s-eclipse span.cm-operator { color: black; } 11 | .cm-s-eclipse span.cm-comment { color: #3F7F5F; } 12 | .cm-s-eclipse span.cm-string { color: #2A00FF; } 13 | .cm-s-eclipse span.cm-string-2 { color: #f50; } 14 | .cm-s-eclipse span.cm-qualifier { color: #555; } 15 | .cm-s-eclipse span.cm-builtin { color: #30a; } 16 | .cm-s-eclipse span.cm-bracket { color: #cc7; } 17 | .cm-s-eclipse span.cm-tag { color: #170; } 18 | .cm-s-eclipse span.cm-attribute { color: #00c; } 19 | .cm-s-eclipse span.cm-link { color: #219; } 20 | .cm-s-eclipse span.cm-error { color: #f00; } 21 | 22 | .cm-s-eclipse .CodeMirror-activeline-background { background: #e8f2ff; } 23 | .cm-s-eclipse .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } 24 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/elegant.css: -------------------------------------------------------------------------------- 1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom { color: #762; } 2 | .cm-s-elegant span.cm-comment { color: #262; font-style: italic; line-height: 1em; } 3 | .cm-s-elegant span.cm-meta { color: #555; font-style: italic; line-height: 1em; } 4 | .cm-s-elegant span.cm-variable { color: black; } 5 | .cm-s-elegant span.cm-variable-2 { color: #b11; } 6 | .cm-s-elegant span.cm-qualifier { color: #555; } 7 | .cm-s-elegant span.cm-keyword { color: #730; } 8 | .cm-s-elegant span.cm-builtin { color: #30a; } 9 | .cm-s-elegant span.cm-link { color: #762; } 10 | .cm-s-elegant span.cm-error { background-color: #fdd; } 11 | 12 | .cm-s-elegant .CodeMirror-activeline-background { background: #e8f2ff; } 13 | .cm-s-elegant .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } 14 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/gruvbox-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: gruvbox-dark 4 | Author: kRkk (https://github.com/krkk) 5 | 6 | Original gruvbox color scheme by Pavel Pertsev (https://github.com/morhetz/gruvbox) 7 | 8 | */ 9 | 10 | .cm-s-gruvbox-dark.CodeMirror, .cm-s-gruvbox-dark .CodeMirror-gutters { background-color: #282828; color: #bdae93; } 11 | .cm-s-gruvbox-dark .CodeMirror-gutters {background: #282828; border-right: 0px;} 12 | .cm-s-gruvbox-dark .CodeMirror-linenumber {color: #7c6f64;} 13 | .cm-s-gruvbox-dark .CodeMirror-cursor { border-left: 1px solid #ebdbb2; } 14 | .cm-s-gruvbox-dark div.CodeMirror-selected { background: #928374; } 15 | .cm-s-gruvbox-dark span.cm-meta { color: #83a598; } 16 | 17 | .cm-s-gruvbox-dark span.cm-comment { color: #928374; } 18 | .cm-s-gruvbox-dark span.cm-number, span.cm-atom { color: #d3869b; } 19 | .cm-s-gruvbox-dark span.cm-keyword { color: #f84934; } 20 | 21 | .cm-s-gruvbox-dark span.cm-variable { color: #ebdbb2; } 22 | .cm-s-gruvbox-dark span.cm-variable-2 { color: #ebdbb2; } 23 | .cm-s-gruvbox-dark span.cm-variable-3, .cm-s-gruvbox-dark span.cm-type { color: #fabd2f; } 24 | .cm-s-gruvbox-dark span.cm-operator { color: #ebdbb2; } 25 | .cm-s-gruvbox-dark span.cm-callee { color: #ebdbb2; } 26 | .cm-s-gruvbox-dark span.cm-def { color: #ebdbb2; } 27 | .cm-s-gruvbox-dark span.cm-property { color: #ebdbb2; } 28 | .cm-s-gruvbox-dark span.cm-string { color: #b8bb26; } 29 | .cm-s-gruvbox-dark span.cm-string-2 { color: #8ec07c; } 30 | .cm-s-gruvbox-dark span.cm-qualifier { color: #8ec07c; } 31 | .cm-s-gruvbox-dark span.cm-attribute { color: #8ec07c; } 32 | 33 | .cm-s-gruvbox-dark .CodeMirror-activeline-background { background: #3c3836; } 34 | .cm-s-gruvbox-dark .CodeMirror-matchingbracket { background: #928374; color:#282828 !important; } 35 | 36 | .cm-s-gruvbox-dark span.cm-builtin { color: #fe8019; } 37 | .cm-s-gruvbox-dark span.cm-tag { color: #fe8019; } 38 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/hopscotch.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Hopscotch 4 | Author: Jan T. Sott 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-hopscotch.CodeMirror {background: #322931; color: #d5d3d5;} 12 | .cm-s-hopscotch div.CodeMirror-selected {background: #433b42 !important;} 13 | .cm-s-hopscotch .CodeMirror-gutters {background: #322931; border-right: 0px;} 14 | .cm-s-hopscotch .CodeMirror-linenumber {color: #797379;} 15 | .cm-s-hopscotch .CodeMirror-cursor {border-left: 1px solid #989498 !important;} 16 | 17 | .cm-s-hopscotch span.cm-comment {color: #b33508;} 18 | .cm-s-hopscotch span.cm-atom {color: #c85e7c;} 19 | .cm-s-hopscotch span.cm-number {color: #c85e7c;} 20 | 21 | .cm-s-hopscotch span.cm-property, .cm-s-hopscotch span.cm-attribute {color: #8fc13e;} 22 | .cm-s-hopscotch span.cm-keyword {color: #dd464c;} 23 | .cm-s-hopscotch span.cm-string {color: #fdcc59;} 24 | 25 | .cm-s-hopscotch span.cm-variable {color: #8fc13e;} 26 | .cm-s-hopscotch span.cm-variable-2 {color: #1290bf;} 27 | .cm-s-hopscotch span.cm-def {color: #fd8b19;} 28 | .cm-s-hopscotch span.cm-error {background: #dd464c; color: #989498;} 29 | .cm-s-hopscotch span.cm-bracket {color: #d5d3d5;} 30 | .cm-s-hopscotch span.cm-tag {color: #dd464c;} 31 | .cm-s-hopscotch span.cm-link {color: #c85e7c;} 32 | 33 | .cm-s-hopscotch .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 34 | .cm-s-hopscotch .CodeMirror-activeline-background { background: #302020; } 35 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/idea.css: -------------------------------------------------------------------------------- 1 | /** 2 | Name: IDEA default theme 3 | From IntelliJ IDEA by JetBrains 4 | */ 5 | 6 | .cm-s-idea span.cm-meta { color: #808000; } 7 | .cm-s-idea span.cm-number { color: #0000FF; } 8 | .cm-s-idea span.cm-keyword { line-height: 1em; font-weight: bold; color: #000080; } 9 | .cm-s-idea span.cm-atom { font-weight: bold; color: #000080; } 10 | .cm-s-idea span.cm-def { color: #000000; } 11 | .cm-s-idea span.cm-variable { color: black; } 12 | .cm-s-idea span.cm-variable-2 { color: black; } 13 | .cm-s-idea span.cm-variable-3, .cm-s-idea span.cm-type { color: black; } 14 | .cm-s-idea span.cm-property { color: black; } 15 | .cm-s-idea span.cm-operator { color: black; } 16 | .cm-s-idea span.cm-comment { color: #808080; } 17 | .cm-s-idea span.cm-string { color: #008000; } 18 | .cm-s-idea span.cm-string-2 { color: #008000; } 19 | .cm-s-idea span.cm-qualifier { color: #555; } 20 | .cm-s-idea span.cm-error { color: #FF0000; } 21 | .cm-s-idea span.cm-attribute { color: #0000FF; } 22 | .cm-s-idea span.cm-tag { color: #000080; } 23 | .cm-s-idea span.cm-link { color: #0000FF; } 24 | .cm-s-idea .CodeMirror-activeline-background { background: #FFFAE3; } 25 | 26 | .cm-s-idea span.cm-builtin { color: #30a; } 27 | .cm-s-idea span.cm-bracket { color: #cc7; } 28 | .cm-s-idea { font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;} 29 | 30 | 31 | .cm-s-idea .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } 32 | 33 | .CodeMirror-hints.idea { 34 | font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; 35 | color: #616569; 36 | background-color: #ebf3fd !important; 37 | } 38 | 39 | .CodeMirror-hints.idea .CodeMirror-hint-active { 40 | background-color: #a2b8c9 !important; 41 | color: #5c6065 !important; 42 | } -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/isotope.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Isotope 4 | Author: David Desandro / Jan T. Sott 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-isotope.CodeMirror {background: #000000; color: #e0e0e0;} 12 | .cm-s-isotope div.CodeMirror-selected {background: #404040 !important;} 13 | .cm-s-isotope .CodeMirror-gutters {background: #000000; border-right: 0px;} 14 | .cm-s-isotope .CodeMirror-linenumber {color: #808080;} 15 | .cm-s-isotope .CodeMirror-cursor {border-left: 1px solid #c0c0c0 !important;} 16 | 17 | .cm-s-isotope span.cm-comment {color: #3300ff;} 18 | .cm-s-isotope span.cm-atom {color: #cc00ff;} 19 | .cm-s-isotope span.cm-number {color: #cc00ff;} 20 | 21 | .cm-s-isotope span.cm-property, .cm-s-isotope span.cm-attribute {color: #33ff00;} 22 | .cm-s-isotope span.cm-keyword {color: #ff0000;} 23 | .cm-s-isotope span.cm-string {color: #ff0099;} 24 | 25 | .cm-s-isotope span.cm-variable {color: #33ff00;} 26 | .cm-s-isotope span.cm-variable-2 {color: #0066ff;} 27 | .cm-s-isotope span.cm-def {color: #ff9900;} 28 | .cm-s-isotope span.cm-error {background: #ff0000; color: #c0c0c0;} 29 | .cm-s-isotope span.cm-bracket {color: #e0e0e0;} 30 | .cm-s-isotope span.cm-tag {color: #ff0000;} 31 | .cm-s-isotope span.cm-link {color: #cc00ff;} 32 | 33 | .cm-s-isotope .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 34 | .cm-s-isotope .CodeMirror-activeline-background { background: #202020; } 35 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/lucario.css: -------------------------------------------------------------------------------- 1 | /* 2 | Name: lucario 3 | Author: Raphael Amorim 4 | 5 | Original Lucario color scheme (https://github.com/raphamorim/lucario) 6 | */ 7 | 8 | .cm-s-lucario.CodeMirror, .cm-s-lucario .CodeMirror-gutters { 9 | background-color: #2b3e50 !important; 10 | color: #f8f8f2 !important; 11 | border: none; 12 | } 13 | .cm-s-lucario .CodeMirror-gutters { color: #2b3e50; } 14 | .cm-s-lucario .CodeMirror-cursor { border-left: solid thin #E6C845; } 15 | .cm-s-lucario .CodeMirror-linenumber { color: #f8f8f2; } 16 | .cm-s-lucario .CodeMirror-selected { background: #243443; } 17 | .cm-s-lucario .CodeMirror-line::selection, .cm-s-lucario .CodeMirror-line > span::selection, .cm-s-lucario .CodeMirror-line > span > span::selection { background: #243443; } 18 | .cm-s-lucario .CodeMirror-line::-moz-selection, .cm-s-lucario .CodeMirror-line > span::-moz-selection, .cm-s-lucario .CodeMirror-line > span > span::-moz-selection { background: #243443; } 19 | .cm-s-lucario span.cm-comment { color: #5c98cd; } 20 | .cm-s-lucario span.cm-string, .cm-s-lucario span.cm-string-2 { color: #E6DB74; } 21 | .cm-s-lucario span.cm-number { color: #ca94ff; } 22 | .cm-s-lucario span.cm-variable { color: #f8f8f2; } 23 | .cm-s-lucario span.cm-variable-2 { color: #f8f8f2; } 24 | .cm-s-lucario span.cm-def { color: #72C05D; } 25 | .cm-s-lucario span.cm-operator { color: #66D9EF; } 26 | .cm-s-lucario span.cm-keyword { color: #ff6541; } 27 | .cm-s-lucario span.cm-atom { color: #bd93f9; } 28 | .cm-s-lucario span.cm-meta { color: #f8f8f2; } 29 | .cm-s-lucario span.cm-tag { color: #ff6541; } 30 | .cm-s-lucario span.cm-attribute { color: #66D9EF; } 31 | .cm-s-lucario span.cm-qualifier { color: #72C05D; } 32 | .cm-s-lucario span.cm-property { color: #f8f8f2; } 33 | .cm-s-lucario span.cm-builtin { color: #72C05D; } 34 | .cm-s-lucario span.cm-variable-3, .cm-s-lucario span.cm-type { color: #ffb86c; } 35 | 36 | .cm-s-lucario .CodeMirror-activeline-background { background: #243443; } 37 | .cm-s-lucario .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } 38 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/midnight.css: -------------------------------------------------------------------------------- 1 | /* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */ 2 | 3 | /**/ 4 | .cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; } 5 | .cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; } 6 | 7 | /**/ 8 | .cm-s-midnight .CodeMirror-activeline-background { background: #253540; } 9 | 10 | .cm-s-midnight.CodeMirror { 11 | background: #0F192A; 12 | color: #D1EDFF; 13 | } 14 | 15 | .cm-s-midnight div.CodeMirror-selected { background: #314D67; } 16 | .cm-s-midnight .CodeMirror-line::selection, .cm-s-midnight .CodeMirror-line > span::selection, .cm-s-midnight .CodeMirror-line > span > span::selection { background: rgba(49, 77, 103, .99); } 17 | .cm-s-midnight .CodeMirror-line::-moz-selection, .cm-s-midnight .CodeMirror-line > span::-moz-selection, .cm-s-midnight .CodeMirror-line > span > span::-moz-selection { background: rgba(49, 77, 103, .99); } 18 | .cm-s-midnight .CodeMirror-gutters { background: #0F192A; border-right: 1px solid; } 19 | .cm-s-midnight .CodeMirror-guttermarker { color: white; } 20 | .cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } 21 | .cm-s-midnight .CodeMirror-linenumber { color: #D0D0D0; } 22 | .cm-s-midnight .CodeMirror-cursor { border-left: 1px solid #F8F8F0; } 23 | 24 | .cm-s-midnight span.cm-comment { color: #428BDD; } 25 | .cm-s-midnight span.cm-atom { color: #AE81FF; } 26 | .cm-s-midnight span.cm-number { color: #D1EDFF; } 27 | 28 | .cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute { color: #A6E22E; } 29 | .cm-s-midnight span.cm-keyword { color: #E83737; } 30 | .cm-s-midnight span.cm-string { color: #1DC116; } 31 | 32 | .cm-s-midnight span.cm-variable { color: #FFAA3E; } 33 | .cm-s-midnight span.cm-variable-2 { color: #FFAA3E; } 34 | .cm-s-midnight span.cm-def { color: #4DD; } 35 | .cm-s-midnight span.cm-bracket { color: #D1EDFF; } 36 | .cm-s-midnight span.cm-tag { color: #449; } 37 | .cm-s-midnight span.cm-link { color: #AE81FF; } 38 | .cm-s-midnight span.cm-error { background: #F92672; color: #F8F8F0; } 39 | 40 | .cm-s-midnight .CodeMirror-matchingbracket { 41 | text-decoration: underline; 42 | color: white !important; 43 | } 44 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/neat.css: -------------------------------------------------------------------------------- 1 | .cm-s-neat span.cm-comment { color: #a86; } 2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } 3 | .cm-s-neat span.cm-string { color: #a22; } 4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } 5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } 6 | .cm-s-neat span.cm-variable { color: black; } 7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } 8 | .cm-s-neat span.cm-meta { color: #555; } 9 | .cm-s-neat span.cm-link { color: #3a3; } 10 | 11 | .cm-s-neat .CodeMirror-activeline-background { background: #e8f2ff; } 12 | .cm-s-neat .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } 13 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/neo.css: -------------------------------------------------------------------------------- 1 | /* neo theme for codemirror */ 2 | 3 | /* Color scheme */ 4 | 5 | .cm-s-neo.CodeMirror { 6 | background-color:#ffffff; 7 | color:#2e383c; 8 | line-height:1.4375; 9 | } 10 | .cm-s-neo .cm-comment { color:#75787b; } 11 | .cm-s-neo .cm-keyword, .cm-s-neo .cm-property { color:#1d75b3; } 12 | .cm-s-neo .cm-atom,.cm-s-neo .cm-number { color:#75438a; } 13 | .cm-s-neo .cm-node,.cm-s-neo .cm-tag { color:#9c3328; } 14 | .cm-s-neo .cm-string { color:#b35e14; } 15 | .cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier { color:#047d65; } 16 | 17 | 18 | /* Editor styling */ 19 | 20 | .cm-s-neo pre { 21 | padding:0; 22 | } 23 | 24 | .cm-s-neo .CodeMirror-gutters { 25 | border:none; 26 | border-right:10px solid transparent; 27 | background-color:transparent; 28 | } 29 | 30 | .cm-s-neo .CodeMirror-linenumber { 31 | padding:0; 32 | color:#e0e2e5; 33 | } 34 | 35 | .cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } 36 | .cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } 37 | 38 | .cm-s-neo .CodeMirror-cursor { 39 | width: auto; 40 | border: 0; 41 | background: rgba(155,157,162,0.37); 42 | z-index: 1; 43 | } 44 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/night.css: -------------------------------------------------------------------------------- 1 | /* Loosely based on the Midnight Textmate theme */ 2 | 3 | .cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } 4 | .cm-s-night div.CodeMirror-selected { background: #447; } 5 | .cm-s-night .CodeMirror-line::selection, .cm-s-night .CodeMirror-line > span::selection, .cm-s-night .CodeMirror-line > span > span::selection { background: rgba(68, 68, 119, .99); } 6 | .cm-s-night .CodeMirror-line::-moz-selection, .cm-s-night .CodeMirror-line > span::-moz-selection, .cm-s-night .CodeMirror-line > span > span::-moz-selection { background: rgba(68, 68, 119, .99); } 7 | .cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } 8 | .cm-s-night .CodeMirror-guttermarker { color: white; } 9 | .cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; } 10 | .cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } 11 | .cm-s-night .CodeMirror-cursor { border-left: 1px solid white; } 12 | 13 | .cm-s-night span.cm-comment { color: #8900d1; } 14 | .cm-s-night span.cm-atom { color: #845dc4; } 15 | .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } 16 | .cm-s-night span.cm-keyword { color: #599eff; } 17 | .cm-s-night span.cm-string { color: #37f14a; } 18 | .cm-s-night span.cm-meta { color: #7678e2; } 19 | .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } 20 | .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def, .cm-s-night span.cm-type { color: white; } 21 | .cm-s-night span.cm-bracket { color: #8da6ce; } 22 | .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } 23 | .cm-s-night span.cm-link { color: #845dc4; } 24 | .cm-s-night span.cm-error { color: #9d1e15; } 25 | 26 | .cm-s-night .CodeMirror-activeline-background { background: #1C005A; } 27 | .cm-s-night .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; } 28 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/panda-syntax.css: -------------------------------------------------------------------------------- 1 | /* 2 | Name: Panda Syntax 3 | Author: Siamak Mokhtari (http://github.com/siamak/) 4 | CodeMirror template by Siamak Mokhtari (https://github.com/siamak/atom-panda-syntax) 5 | */ 6 | .cm-s-panda-syntax { 7 | background: #292A2B; 8 | color: #E6E6E6; 9 | line-height: 1.5; 10 | font-family: 'Operator Mono', 'Source Sans Pro', Menlo, Monaco, Consolas, Courier New, monospace; 11 | } 12 | .cm-s-panda-syntax .CodeMirror-cursor { border-color: #ff2c6d; } 13 | .cm-s-panda-syntax .CodeMirror-activeline-background { 14 | background: rgba(99, 123, 156, 0.1); 15 | } 16 | .cm-s-panda-syntax .CodeMirror-selected { 17 | background: #FFF; 18 | } 19 | .cm-s-panda-syntax .cm-comment { 20 | font-style: italic; 21 | color: #676B79; 22 | } 23 | .cm-s-panda-syntax .cm-operator { 24 | color: #f3f3f3; 25 | } 26 | .cm-s-panda-syntax .cm-string { 27 | color: #19F9D8; 28 | } 29 | .cm-s-panda-syntax .cm-string-2 { 30 | color: #FFB86C; 31 | } 32 | 33 | .cm-s-panda-syntax .cm-tag { 34 | color: #ff2c6d; 35 | } 36 | .cm-s-panda-syntax .cm-meta { 37 | color: #b084eb; 38 | } 39 | 40 | .cm-s-panda-syntax .cm-number { 41 | color: #FFB86C; 42 | } 43 | .cm-s-panda-syntax .cm-atom { 44 | color: #ff2c6d; 45 | } 46 | .cm-s-panda-syntax .cm-keyword { 47 | color: #FF75B5; 48 | } 49 | .cm-s-panda-syntax .cm-variable { 50 | color: #ffb86c; 51 | } 52 | .cm-s-panda-syntax .cm-variable-2 { 53 | color: #ff9ac1; 54 | } 55 | .cm-s-panda-syntax .cm-variable-3, .cm-s-panda-syntax .cm-type { 56 | color: #ff9ac1; 57 | } 58 | 59 | .cm-s-panda-syntax .cm-def { 60 | color: #e6e6e6; 61 | } 62 | .cm-s-panda-syntax .cm-property { 63 | color: #f3f3f3; 64 | } 65 | .cm-s-panda-syntax .cm-unit { 66 | color: #ffb86c; 67 | } 68 | 69 | .cm-s-panda-syntax .cm-attribute { 70 | color: #ffb86c; 71 | } 72 | 73 | .cm-s-panda-syntax .CodeMirror-matchingbracket { 74 | border-bottom: 1px dotted #19F9D8; 75 | padding-bottom: 2px; 76 | color: #e6e6e6; 77 | } 78 | .cm-s-panda-syntax .CodeMirror-gutters { 79 | background: #292a2b; 80 | border-right-color: rgba(255, 255, 255, 0.1); 81 | } 82 | .cm-s-panda-syntax .CodeMirror-linenumber { 83 | color: #e6e6e6; 84 | opacity: 0.6; 85 | } 86 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/paraiso-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Paraíso (Dark) 4 | Author: Jan T. Sott 5 | 6 | Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) 7 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br) 8 | 9 | */ 10 | 11 | .cm-s-paraiso-dark.CodeMirror { background: #2f1e2e; color: #b9b6b0; } 12 | .cm-s-paraiso-dark div.CodeMirror-selected { background: #41323f; } 13 | .cm-s-paraiso-dark .CodeMirror-line::selection, .cm-s-paraiso-dark .CodeMirror-line > span::selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::selection { background: rgba(65, 50, 63, .99); } 14 | .cm-s-paraiso-dark .CodeMirror-line::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(65, 50, 63, .99); } 15 | .cm-s-paraiso-dark .CodeMirror-gutters { background: #2f1e2e; border-right: 0px; } 16 | .cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; } 17 | .cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; } 18 | .cm-s-paraiso-dark .CodeMirror-linenumber { color: #776e71; } 19 | .cm-s-paraiso-dark .CodeMirror-cursor { border-left: 1px solid #8d8687; } 20 | 21 | .cm-s-paraiso-dark span.cm-comment { color: #e96ba8; } 22 | .cm-s-paraiso-dark span.cm-atom { color: #815ba4; } 23 | .cm-s-paraiso-dark span.cm-number { color: #815ba4; } 24 | 25 | .cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute { color: #48b685; } 26 | .cm-s-paraiso-dark span.cm-keyword { color: #ef6155; } 27 | .cm-s-paraiso-dark span.cm-string { color: #fec418; } 28 | 29 | .cm-s-paraiso-dark span.cm-variable { color: #48b685; } 30 | .cm-s-paraiso-dark span.cm-variable-2 { color: #06b6ef; } 31 | .cm-s-paraiso-dark span.cm-def { color: #f99b15; } 32 | .cm-s-paraiso-dark span.cm-bracket { color: #b9b6b0; } 33 | .cm-s-paraiso-dark span.cm-tag { color: #ef6155; } 34 | .cm-s-paraiso-dark span.cm-link { color: #815ba4; } 35 | .cm-s-paraiso-dark span.cm-error { background: #ef6155; color: #8d8687; } 36 | 37 | .cm-s-paraiso-dark .CodeMirror-activeline-background { background: #4D344A; } 38 | .cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } 39 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/paraiso-light.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Paraíso (Light) 4 | Author: Jan T. Sott 5 | 6 | Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) 7 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br) 8 | 9 | */ 10 | 11 | .cm-s-paraiso-light.CodeMirror { background: #e7e9db; color: #41323f; } 12 | .cm-s-paraiso-light div.CodeMirror-selected { background: #b9b6b0; } 13 | .cm-s-paraiso-light .CodeMirror-line::selection, .cm-s-paraiso-light .CodeMirror-line > span::selection, .cm-s-paraiso-light .CodeMirror-line > span > span::selection { background: #b9b6b0; } 14 | .cm-s-paraiso-light .CodeMirror-line::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span > span::-moz-selection { background: #b9b6b0; } 15 | .cm-s-paraiso-light .CodeMirror-gutters { background: #e7e9db; border-right: 0px; } 16 | .cm-s-paraiso-light .CodeMirror-guttermarker { color: black; } 17 | .cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; } 18 | .cm-s-paraiso-light .CodeMirror-linenumber { color: #8d8687; } 19 | .cm-s-paraiso-light .CodeMirror-cursor { border-left: 1px solid #776e71; } 20 | 21 | .cm-s-paraiso-light span.cm-comment { color: #e96ba8; } 22 | .cm-s-paraiso-light span.cm-atom { color: #815ba4; } 23 | .cm-s-paraiso-light span.cm-number { color: #815ba4; } 24 | 25 | .cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute { color: #48b685; } 26 | .cm-s-paraiso-light span.cm-keyword { color: #ef6155; } 27 | .cm-s-paraiso-light span.cm-string { color: #fec418; } 28 | 29 | .cm-s-paraiso-light span.cm-variable { color: #48b685; } 30 | .cm-s-paraiso-light span.cm-variable-2 { color: #06b6ef; } 31 | .cm-s-paraiso-light span.cm-def { color: #f99b15; } 32 | .cm-s-paraiso-light span.cm-bracket { color: #41323f; } 33 | .cm-s-paraiso-light span.cm-tag { color: #ef6155; } 34 | .cm-s-paraiso-light span.cm-link { color: #815ba4; } 35 | .cm-s-paraiso-light span.cm-error { background: #ef6155; color: #776e71; } 36 | 37 | .cm-s-paraiso-light .CodeMirror-activeline-background { background: #CFD1C4; } 38 | .cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } 39 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/railscasts.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Railscasts 4 | Author: Ryan Bates (http://railscasts.com) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-railscasts.CodeMirror {background: #2b2b2b; color: #f4f1ed;} 12 | .cm-s-railscasts div.CodeMirror-selected {background: #272935 !important;} 13 | .cm-s-railscasts .CodeMirror-gutters {background: #2b2b2b; border-right: 0px;} 14 | .cm-s-railscasts .CodeMirror-linenumber {color: #5a647e;} 15 | .cm-s-railscasts .CodeMirror-cursor {border-left: 1px solid #d4cfc9 !important;} 16 | 17 | .cm-s-railscasts span.cm-comment {color: #bc9458;} 18 | .cm-s-railscasts span.cm-atom {color: #b6b3eb;} 19 | .cm-s-railscasts span.cm-number {color: #b6b3eb;} 20 | 21 | .cm-s-railscasts span.cm-property, .cm-s-railscasts span.cm-attribute {color: #a5c261;} 22 | .cm-s-railscasts span.cm-keyword {color: #da4939;} 23 | .cm-s-railscasts span.cm-string {color: #ffc66d;} 24 | 25 | .cm-s-railscasts span.cm-variable {color: #a5c261;} 26 | .cm-s-railscasts span.cm-variable-2 {color: #6d9cbe;} 27 | .cm-s-railscasts span.cm-def {color: #cc7833;} 28 | .cm-s-railscasts span.cm-error {background: #da4939; color: #d4cfc9;} 29 | .cm-s-railscasts span.cm-bracket {color: #f4f1ed;} 30 | .cm-s-railscasts span.cm-tag {color: #da4939;} 31 | .cm-s-railscasts span.cm-link {color: #b6b3eb;} 32 | 33 | .cm-s-railscasts .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 34 | .cm-s-railscasts .CodeMirror-activeline-background { background: #303040; } 35 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/rubyblue.css: -------------------------------------------------------------------------------- 1 | .cm-s-rubyblue.CodeMirror { background: #112435; color: white; } 2 | .cm-s-rubyblue div.CodeMirror-selected { background: #38566F; } 3 | .cm-s-rubyblue .CodeMirror-line::selection, .cm-s-rubyblue .CodeMirror-line > span::selection, .cm-s-rubyblue .CodeMirror-line > span > span::selection { background: rgba(56, 86, 111, 0.99); } 4 | .cm-s-rubyblue .CodeMirror-line::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 86, 111, 0.99); } 5 | .cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } 6 | .cm-s-rubyblue .CodeMirror-guttermarker { color: white; } 7 | .cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; } 8 | .cm-s-rubyblue .CodeMirror-linenumber { color: white; } 9 | .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white; } 10 | 11 | .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } 12 | .cm-s-rubyblue span.cm-atom { color: #F4C20B; } 13 | .cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } 14 | .cm-s-rubyblue span.cm-keyword { color: #F0F; } 15 | .cm-s-rubyblue span.cm-string { color: #F08047; } 16 | .cm-s-rubyblue span.cm-meta { color: #F0F; } 17 | .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } 18 | .cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def, .cm-s-rubyblue span.cm-type { color: white; } 19 | .cm-s-rubyblue span.cm-bracket { color: #F0F; } 20 | .cm-s-rubyblue span.cm-link { color: #F4C20B; } 21 | .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } 22 | .cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } 23 | .cm-s-rubyblue span.cm-error { color: #AF2018; } 24 | 25 | .cm-s-rubyblue .CodeMirror-activeline-background { background: #173047; } 26 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/seti.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: seti 4 | Author: Michael Kaminsky (http://github.com/mkaminsky11) 5 | 6 | Original seti color scheme by Jesse Weed (https://github.com/jesseweed/seti-syntax) 7 | 8 | */ 9 | 10 | 11 | .cm-s-seti.CodeMirror { 12 | background-color: #151718 !important; 13 | color: #CFD2D1 !important; 14 | border: none; 15 | } 16 | .cm-s-seti .CodeMirror-gutters { 17 | color: #404b53; 18 | background-color: #0E1112; 19 | border: none; 20 | } 21 | .cm-s-seti .CodeMirror-cursor { border-left: solid thin #f8f8f0; } 22 | .cm-s-seti .CodeMirror-linenumber { color: #6D8A88; } 23 | .cm-s-seti.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } 24 | .cm-s-seti .CodeMirror-line::selection, .cm-s-seti .CodeMirror-line > span::selection, .cm-s-seti .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); } 25 | .cm-s-seti .CodeMirror-line::-moz-selection, .cm-s-seti .CodeMirror-line > span::-moz-selection, .cm-s-seti .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); } 26 | .cm-s-seti span.cm-comment { color: #41535b; } 27 | .cm-s-seti span.cm-string, .cm-s-seti span.cm-string-2 { color: #55b5db; } 28 | .cm-s-seti span.cm-number { color: #cd3f45; } 29 | .cm-s-seti span.cm-variable { color: #55b5db; } 30 | .cm-s-seti span.cm-variable-2 { color: #a074c4; } 31 | .cm-s-seti span.cm-def { color: #55b5db; } 32 | .cm-s-seti span.cm-keyword { color: #ff79c6; } 33 | .cm-s-seti span.cm-operator { color: #9fca56; } 34 | .cm-s-seti span.cm-keyword { color: #e6cd69; } 35 | .cm-s-seti span.cm-atom { color: #cd3f45; } 36 | .cm-s-seti span.cm-meta { color: #55b5db; } 37 | .cm-s-seti span.cm-tag { color: #55b5db; } 38 | .cm-s-seti span.cm-attribute { color: #9fca56; } 39 | .cm-s-seti span.cm-qualifier { color: #9fca56; } 40 | .cm-s-seti span.cm-property { color: #a074c4; } 41 | .cm-s-seti span.cm-variable-3, .cm-s-seti span.cm-type { color: #9fca56; } 42 | .cm-s-seti span.cm-builtin { color: #9fca56; } 43 | .cm-s-seti .CodeMirror-activeline-background { background: #101213; } 44 | .cm-s-seti .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } 45 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/ssms.css: -------------------------------------------------------------------------------- 1 | .cm-s-ssms span.cm-keyword { color: blue; } 2 | .cm-s-ssms span.cm-comment { color: darkgreen; } 3 | .cm-s-ssms span.cm-string { color: red; } 4 | .cm-s-ssms span.cm-def { color: black; } 5 | .cm-s-ssms span.cm-variable { color: black; } 6 | .cm-s-ssms span.cm-variable-2 { color: black; } 7 | .cm-s-ssms span.cm-atom { color: darkgray; } 8 | .cm-s-ssms .CodeMirror-linenumber { color: teal; } 9 | .cm-s-ssms .CodeMirror-activeline-background { background: #ffffff; } 10 | .cm-s-ssms span.cm-string-2 { color: #FF00FF; } 11 | .cm-s-ssms span.cm-operator, 12 | .cm-s-ssms span.cm-bracket, 13 | .cm-s-ssms span.cm-punctuation { color: darkgray; } 14 | .cm-s-ssms .CodeMirror-gutters { border-right: 3px solid #ffee62; background-color: #ffffff; } 15 | .cm-s-ssms div.CodeMirror-selected { background: #ADD6FF; } 16 | 17 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/the-matrix.css: -------------------------------------------------------------------------------- 1 | .cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } 2 | .cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D; } 3 | .cm-s-the-matrix .CodeMirror-line::selection, .cm-s-the-matrix .CodeMirror-line > span::selection, .cm-s-the-matrix .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); } 4 | .cm-s-the-matrix .CodeMirror-line::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); } 5 | .cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } 6 | .cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } 7 | .cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } 8 | .cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; } 9 | .cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00; } 10 | 11 | .cm-s-the-matrix span.cm-keyword { color: #008803; font-weight: bold; } 12 | .cm-s-the-matrix span.cm-atom { color: #3FF; } 13 | .cm-s-the-matrix span.cm-number { color: #FFB94F; } 14 | .cm-s-the-matrix span.cm-def { color: #99C; } 15 | .cm-s-the-matrix span.cm-variable { color: #F6C; } 16 | .cm-s-the-matrix span.cm-variable-2 { color: #C6F; } 17 | .cm-s-the-matrix span.cm-variable-3, .cm-s-the-matrix span.cm-type { color: #96F; } 18 | .cm-s-the-matrix span.cm-property { color: #62FFA0; } 19 | .cm-s-the-matrix span.cm-operator { color: #999; } 20 | .cm-s-the-matrix span.cm-comment { color: #CCCCCC; } 21 | .cm-s-the-matrix span.cm-string { color: #39C; } 22 | .cm-s-the-matrix span.cm-meta { color: #C9F; } 23 | .cm-s-the-matrix span.cm-qualifier { color: #FFF700; } 24 | .cm-s-the-matrix span.cm-builtin { color: #30a; } 25 | .cm-s-the-matrix span.cm-bracket { color: #cc7; } 26 | .cm-s-the-matrix span.cm-tag { color: #FFBD40; } 27 | .cm-s-the-matrix span.cm-attribute { color: #FFF700; } 28 | .cm-s-the-matrix span.cm-error { color: #FF0000; } 29 | 30 | .cm-s-the-matrix .CodeMirror-activeline-background { background: #040; } 31 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/tomorrow-night-bright.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Tomorrow Night - Bright 4 | Author: Chris Kempson 5 | 6 | Port done by Gerard Braad 7 | 8 | */ 9 | 10 | .cm-s-tomorrow-night-bright.CodeMirror { background: #000000; color: #eaeaea; } 11 | .cm-s-tomorrow-night-bright div.CodeMirror-selected { background: #424242; } 12 | .cm-s-tomorrow-night-bright .CodeMirror-gutters { background: #000000; border-right: 0px; } 13 | .cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; } 14 | .cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; } 15 | .cm-s-tomorrow-night-bright .CodeMirror-linenumber { color: #424242; } 16 | .cm-s-tomorrow-night-bright .CodeMirror-cursor { border-left: 1px solid #6A6A6A; } 17 | 18 | .cm-s-tomorrow-night-bright span.cm-comment { color: #d27b53; } 19 | .cm-s-tomorrow-night-bright span.cm-atom { color: #a16a94; } 20 | .cm-s-tomorrow-night-bright span.cm-number { color: #a16a94; } 21 | 22 | .cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute { color: #99cc99; } 23 | .cm-s-tomorrow-night-bright span.cm-keyword { color: #d54e53; } 24 | .cm-s-tomorrow-night-bright span.cm-string { color: #e7c547; } 25 | 26 | .cm-s-tomorrow-night-bright span.cm-variable { color: #b9ca4a; } 27 | .cm-s-tomorrow-night-bright span.cm-variable-2 { color: #7aa6da; } 28 | .cm-s-tomorrow-night-bright span.cm-def { color: #e78c45; } 29 | .cm-s-tomorrow-night-bright span.cm-bracket { color: #eaeaea; } 30 | .cm-s-tomorrow-night-bright span.cm-tag { color: #d54e53; } 31 | .cm-s-tomorrow-night-bright span.cm-link { color: #a16a94; } 32 | .cm-s-tomorrow-night-bright span.cm-error { background: #d54e53; color: #6A6A6A; } 33 | 34 | .cm-s-tomorrow-night-bright .CodeMirror-activeline-background { background: #2a2a2a; } 35 | .cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } 36 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/yeti.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: yeti 4 | Author: Michael Kaminsky (http://github.com/mkaminsky11) 5 | 6 | Original yeti color scheme by Jesse Weed (https://github.com/jesseweed/yeti-syntax) 7 | 8 | */ 9 | 10 | 11 | .cm-s-yeti.CodeMirror { 12 | background-color: #ECEAE8 !important; 13 | color: #d1c9c0 !important; 14 | border: none; 15 | } 16 | 17 | .cm-s-yeti .CodeMirror-gutters { 18 | color: #adaba6; 19 | background-color: #E5E1DB; 20 | border: none; 21 | } 22 | .cm-s-yeti .CodeMirror-cursor { border-left: solid thin #d1c9c0; } 23 | .cm-s-yeti .CodeMirror-linenumber { color: #adaba6; } 24 | .cm-s-yeti.CodeMirror-focused div.CodeMirror-selected { background: #DCD8D2; } 25 | .cm-s-yeti .CodeMirror-line::selection, .cm-s-yeti .CodeMirror-line > span::selection, .cm-s-yeti .CodeMirror-line > span > span::selection { background: #DCD8D2; } 26 | .cm-s-yeti .CodeMirror-line::-moz-selection, .cm-s-yeti .CodeMirror-line > span::-moz-selection, .cm-s-yeti .CodeMirror-line > span > span::-moz-selection { background: #DCD8D2; } 27 | .cm-s-yeti span.cm-comment { color: #d4c8be; } 28 | .cm-s-yeti span.cm-string, .cm-s-yeti span.cm-string-2 { color: #96c0d8; } 29 | .cm-s-yeti span.cm-number { color: #a074c4; } 30 | .cm-s-yeti span.cm-variable { color: #55b5db; } 31 | .cm-s-yeti span.cm-variable-2 { color: #a074c4; } 32 | .cm-s-yeti span.cm-def { color: #55b5db; } 33 | .cm-s-yeti span.cm-operator { color: #9fb96e; } 34 | .cm-s-yeti span.cm-keyword { color: #9fb96e; } 35 | .cm-s-yeti span.cm-atom { color: #a074c4; } 36 | .cm-s-yeti span.cm-meta { color: #96c0d8; } 37 | .cm-s-yeti span.cm-tag { color: #96c0d8; } 38 | .cm-s-yeti span.cm-attribute { color: #9fb96e; } 39 | .cm-s-yeti span.cm-qualifier { color: #96c0d8; } 40 | .cm-s-yeti span.cm-property { color: #a074c4; } 41 | .cm-s-yeti span.cm-builtin { color: #a074c4; } 42 | .cm-s-yeti span.cm-variable-3, .cm-s-yeti span.cm-type { color: #96c0d8; } 43 | .cm-s-yeti .CodeMirror-activeline-background { background: #E7E4E0; } 44 | .cm-s-yeti .CodeMirror-matchingbracket { text-decoration: underline; } 45 | -------------------------------------------------------------------------------- /djangocodemirror/static/CodeMirror/theme/zenburn.css: -------------------------------------------------------------------------------- 1 | /** 2 | * " 3 | * Using Zenburn color palette from the Emacs Zenburn Theme 4 | * https://github.com/bbatsov/zenburn-emacs/blob/master/zenburn-theme.el 5 | * 6 | * Also using parts of https://github.com/xavi/coderay-lighttable-theme 7 | * " 8 | * From: https://github.com/wisenomad/zenburn-lighttable-theme/blob/master/zenburn.css 9 | */ 10 | 11 | .cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; } 12 | .cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; } 13 | .cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white; } 14 | .cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; } 15 | .cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; } 16 | .cm-s-zenburn span.cm-comment { color: #7f9f7f; } 17 | .cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; } 18 | .cm-s-zenburn span.cm-atom { color: #bfebbf; } 19 | .cm-s-zenburn span.cm-def { color: #dcdccc; } 20 | .cm-s-zenburn span.cm-variable { color: #dfaf8f; } 21 | .cm-s-zenburn span.cm-variable-2 { color: #dcdccc; } 22 | .cm-s-zenburn span.cm-string { color: #cc9393; } 23 | .cm-s-zenburn span.cm-string-2 { color: #cc9393; } 24 | .cm-s-zenburn span.cm-number { color: #dcdccc; } 25 | .cm-s-zenburn span.cm-tag { color: #93e0e3; } 26 | .cm-s-zenburn span.cm-property { color: #dfaf8f; } 27 | .cm-s-zenburn span.cm-attribute { color: #dfaf8f; } 28 | .cm-s-zenburn span.cm-qualifier { color: #7cb8bb; } 29 | .cm-s-zenburn span.cm-meta { color: #f0dfaf; } 30 | .cm-s-zenburn span.cm-header { color: #f0efd0; } 31 | .cm-s-zenburn span.cm-operator { color: #f0efd0; } 32 | .cm-s-zenburn span.CodeMirror-matchingbracket { box-sizing: border-box; background: transparent; border-bottom: 1px solid; } 33 | .cm-s-zenburn span.CodeMirror-nonmatchingbracket { border-bottom: 1px solid; background: none; } 34 | .cm-s-zenburn .CodeMirror-activeline { background: #000000; } 35 | .cm-s-zenburn .CodeMirror-activeline-background { background: #000000; } 36 | .cm-s-zenburn div.CodeMirror-selected { background: #545454; } 37 | .cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected { background: #4f4f4f; } 38 | -------------------------------------------------------------------------------- /djangocodemirror/templates/djangocodemirror/widget.html: -------------------------------------------------------------------------------- 1 | 2 | {% if widget.script %}{{ widget.script|safe }}{% endif %} 3 | -------------------------------------------------------------------------------- /djangocodemirror/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sveetch/djangocodemirror/02869149fb698315474b7f7544876def0e9fe21d/djangocodemirror/templatetags/__init__.py -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | _build -------------------------------------------------------------------------------- /docs/_static/.keep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/django_settings.py: -------------------------------------------------------------------------------- 1 | # Dummy Django settings 2 | SECRET_KEY = 'dummy-key' 3 | 4 | from djangocodemirror.settings import * 5 | 6 | INSTALLED_APPS = ( 7 | 'django.contrib.staticfiles', 8 | 'autobreadcrumbs', 9 | ) 10 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. djangocodemirror documentation master file, created by 2 | sphinx-quickstart on Tue Sept 15 00:09:10 2016. 3 | 4 | .. _CodeMirror: http://codemirror.net/ 5 | .. _Django: https://www.djangoproject.com/ 6 | .. _django-assets: http://pypi.python.org/pypi/django-assets 7 | 8 | Welcome to Django CodeMirror's documentation! 9 | ============================================= 10 | 11 | This is a `Django`_ application to embed `CodeMirror`_. 12 | 13 | It works exclusively from configuration sets to manage CodeMirror options and 14 | assets. A dedicated field, widget and some template tags are available to make 15 | CodeMirror instances using these configurations on any element. 16 | 17 | Since configurations are aware of every assets to load this enable you to 18 | use CodeMirror without a Javascript module loader (like ``Browserify`` or 19 | ``RequireJS``). 20 | 21 | Links 22 | ***** 23 | 24 | * Read the documentation on `Read the docs `_; 25 | * Download its `PyPi package `_; 26 | * Clone it on its `Github repository `_; 27 | 28 | Dependancies 29 | ************ 30 | 31 | * `Django`_ >= 1.10; 32 | * Optionally `django-assets`_; 33 | 34 | User’s Guide 35 | ************ 36 | 37 | .. toctree:: 38 | :maxdepth: 1 39 | 40 | install.rst 41 | examples.rst 42 | settings.rst 43 | configurations.rst 44 | library_references/helper.rst 45 | library_references/templatetags.rst 46 | library_references/widgets.rst 47 | library_references/fields.rst 48 | 49 | Developer’s Guide 50 | ***************** 51 | 52 | .. toctree:: 53 | :maxdepth: 1 54 | 55 | library_references/manifest.rst 56 | library_references/assets.rst 57 | library_references/assetrender.rst 58 | development.rst 59 | changelog.rst 60 | -------------------------------------------------------------------------------- /docs/install.rst: -------------------------------------------------------------------------------- 1 | .. _django-assets: http://pypi.python.org/pypi/django-assets 2 | 3 | .. _install-intro: 4 | 5 | ======= 6 | Install 7 | ======= 8 | 9 | :: 10 | 11 | pip install djangocodemirror 12 | 13 | 14 | #. In your *settings* file add **djangocodemirror** to your installed apps: 15 | 16 | .. sourcecode:: python 17 | 18 | INSTALLED_APPS = ( 19 | ... 20 | 'djangocodemirror', 21 | ... 22 | ) 23 | 24 | #. Import default settings: 25 | 26 | .. sourcecode:: python 27 | 28 | from djangocodemirror.settings import * 29 | 30 | #. Optionally install `django-assets`_ to use asset bundles; 31 | 32 | Finally you may want to change available CodeMirror configurations from ``settings.CODEMIRROR_SETTINGS``: 33 | 34 | * If you need to add your own new configuration see :ref:`configurations-intro`; 35 | * If you just need to add/change some parameters from configurations see :ref:`helper-intro`. 36 | 37 | -------------------------------------------------------------------------------- /docs/library_references/assetrender.rst: -------------------------------------------------------------------------------- 1 | Asset tag renderer 2 | ================== 3 | 4 | .. autoclass:: djangocodemirror.templatetags.djangocodemirror_tags.CodemirrorAssetTagRender 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /docs/library_references/assets.rst: -------------------------------------------------------------------------------- 1 | .. automodule:: djangocodemirror.assets 2 | :members: 3 | -------------------------------------------------------------------------------- /docs/library_references/fields.rst: -------------------------------------------------------------------------------- 1 | .. automodule:: djangocodemirror.fields 2 | :members: 3 | :show-inheritance: 4 | -------------------------------------------------------------------------------- /docs/library_references/helper.rst: -------------------------------------------------------------------------------- 1 | .. automodule:: djangocodemirror.helper 2 | :members: codemirror_settings_update 3 | -------------------------------------------------------------------------------- /docs/library_references/manifest.rst: -------------------------------------------------------------------------------- 1 | .. automodule:: djangocodemirror.manifest 2 | :members: 3 | -------------------------------------------------------------------------------- /docs/library_references/templatetags.rst: -------------------------------------------------------------------------------- 1 | Template tags 2 | ============= 3 | 4 | codemirror_field_js_assets 5 | -------------------------- 6 | 7 | .. autosimplefunction:: djangocodemirror.templatetags.djangocodemirror_tags.codemirror_field_js_assets 8 | 9 | codemirror_field_css_assets 10 | --------------------------- 11 | 12 | .. autosimplefunction:: djangocodemirror.templatetags.djangocodemirror_tags.codemirror_field_css_assets 13 | 14 | codemirror_field_js_bundle 15 | -------------------------- 16 | 17 | .. autosimplefunction:: djangocodemirror.templatetags.djangocodemirror_tags.codemirror_field_js_bundle 18 | 19 | codemirror_field_css_bundle 20 | --------------------------- 21 | 22 | .. autosimplefunction:: djangocodemirror.templatetags.djangocodemirror_tags.codemirror_field_css_bundle 23 | 24 | codemirror_parameters 25 | --------------------- 26 | 27 | .. autosimplefunction:: djangocodemirror.templatetags.djangocodemirror_tags.codemirror_parameters 28 | 29 | codemirror_instance 30 | ------------------- 31 | 32 | .. autosimplefunction:: djangocodemirror.templatetags.djangocodemirror_tags.codemirror_instance 33 | -------------------------------------------------------------------------------- /docs/library_references/widgets.rst: -------------------------------------------------------------------------------- 1 | .. automodule:: djangocodemirror.widgets 2 | :members: 3 | :show-inheritance: 4 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | djangocodemirror 2 | -------------------------------------------------------------------------------- /sandbox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sveetch/djangocodemirror/02869149fb698315474b7f7544876def0e9fe21d/sandbox/__init__.py -------------------------------------------------------------------------------- /sandbox/demo_datas/css.txt: -------------------------------------------------------------------------------- 1 | /* Some example CSS */ 2 | 3 | @import url("something.css"); 4 | 5 | body { 6 | margin: 0; 7 | padding: 3em 6em; 8 | font-family: tahoma, arial, sans-serif; 9 | color: #000; 10 | } 11 | 12 | #navigation a { 13 | font-weight: bold; 14 | text-decoration: none !important; 15 | } 16 | 17 | h1 { 18 | font-size: 2.5em; 19 | } 20 | 21 | h2 { 22 | font-size: 1.7em; 23 | } 24 | 25 | h1:before, h2:before { 26 | content: "::"; 27 | } 28 | 29 | code { 30 | font-family: courier, monospace; 31 | font-size: 80%; 32 | color: #418A8A; 33 | } 34 | -------------------------------------------------------------------------------- /sandbox/demo_datas/html.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Plonk 9 | 10 | 20 | 21 | 22 | 23 | 24 |
25 |
26 |
27 |
28 |

Plonk

29 |
30 |
31 |
32 |
33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /sandbox/demo_datas/python.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Sample views 4 | """ 5 | from django.views.generic.edit import FormView 6 | from django.core.urlresolvers import reverse 7 | 8 | from .forms import SampleForm 9 | 10 | 11 | class BasicSampleFormView(FormView): 12 | template_name = 'form.html' 13 | form_class = SampleForm 14 | 15 | def get_success_url(self): 16 | return reverse('home') 17 | 18 | def get_context_data(self, **kwargs): 19 | context = super(BasicSampleFormView, self).get_context_data(**kwargs) 20 | context.update({ 21 | 'codemirror_mode': self.codemirror_mode, 22 | }) 23 | return context 24 | 25 | def get(self, request, *args, **kwargs): 26 | self.codemirror_mode = kwargs.get('mode', None) 27 | return super(BasicSampleFormView, self).get(request, *args, **kwargs) 28 | 29 | def post(self, request, *args, **kwargs): 30 | self.codemirror_mode = kwargs.get('mode', None) 31 | return super(BasicSampleFormView, self).post(request, *args, **kwargs) 32 | 33 | def get_initial(self): 34 | """ 35 | Returns the initial data to use for forms on this view. 36 | """ 37 | return self.initial.copy() 38 | -------------------------------------------------------------------------------- /sandbox/demo_datas/restructuredtext.txt: -------------------------------------------------------------------------------- 1 | .. djangocodemirror documentation master file, created by 2 | sphinx-quickstart on Tue Sept 15 00:09:10 2016. 3 | 4 | .. _CodeMirror: http://codemirror.net/ 5 | .. _Django: https://www.djangoproject.com/ 6 | .. _django-assets: http://pypi.python.org/pypi/django-assets 7 | 8 | Welcome to Django CodeMirror's documentation! 9 | ============================================= 10 | 11 | **Django CodeMirror** is a `Django`_ application to embed `CodeMirror`_. 12 | 13 | Links 14 | ***** 15 | 16 | * Read the documentation on `Read the docs `_; 17 | * Download its `PyPi package `_; 18 | * Clone it on its `Github repository `_; 19 | 20 | Dependancies 21 | ************ 22 | 23 | * `Django`_ >= 1.6, < 1.7; 24 | * Optionally `django-assets`_ == 0.8; 25 | 26 | User’s Guide 27 | ************ 28 | 29 | .. toctree:: 30 | :maxdepth: 2 31 | 32 | install.rst 33 | example.rst 34 | library_references/settings.rst 35 | library_references/templatetags.rst 36 | library_references/widgets.rst 37 | library_references/fields.rst 38 | library_references/manifest.rst 39 | library_references/assets.rst 40 | library_references/assetrender.rst 41 | 42 | Developer’s Guide 43 | ***************** 44 | 45 | .. toctree:: 46 | :maxdepth: 1 47 | 48 | development.rst 49 | changelog.rst 50 | -------------------------------------------------------------------------------- /sandbox/forms.py: -------------------------------------------------------------------------------- 1 | """ 2 | Sample forms 3 | """ 4 | from django import forms 5 | 6 | from djangocodemirror.fields import CodeMirrorField 7 | 8 | 9 | class SampleForm(forms.Form): 10 | """ 11 | Just a very basic form for tests 12 | """ 13 | foo = CodeMirrorField(label="Foo", 14 | required=True, 15 | config_name="basic", 16 | initial='Hello World!') 17 | 18 | 19 | class ManyFieldsSampleForm(forms.Form): 20 | """ 21 | Basic form for tests with multiple CodeMirrorField 22 | """ 23 | foo = CodeMirrorField(label="Foo", 24 | required=True, 25 | config_name="basic", 26 | initial='Hello World!') 27 | pika = CodeMirrorField(label="Pika", 28 | required=True, 29 | config_name="basic", 30 | initial='Catch them all') 31 | ping = CodeMirrorField(label="Ping", 32 | required=True, 33 | config_name="with-all", 34 | initial='Zouip') 35 | 36 | 37 | class NoBundleForm(forms.Form): 38 | """ 39 | Form for a field with a config without bundle 40 | """ 41 | foo = CodeMirrorField(label="Foo", 42 | required=True, 43 | config_name="without-bundle", 44 | initial='Hello World!') 45 | -------------------------------------------------------------------------------- /sandbox/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Sandbox management script 4 | """ 5 | import os 6 | 7 | from django.core import management 8 | 9 | if __name__ == "__main__": 10 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.demo") 11 | 12 | management.execute_from_command_line() 13 | -------------------------------------------------------------------------------- /sandbox/settings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sveetch/djangocodemirror/02869149fb698315474b7f7544876def0e9fe21d/sandbox/settings/__init__.py -------------------------------------------------------------------------------- /sandbox/settings/demo.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for project demonstration (will not work for unittests) 3 | 4 | Actually inherits from settings for Django 1.6. Intended to be used with 5 | ``make server``. 6 | """ 7 | import os, copy 8 | 9 | from sandbox.settings.base import * 10 | 11 | # 12 | # DjangoCodemirror settings 13 | # 14 | from djangocodemirror.settings import * 15 | 16 | # Keep default shipped configs 17 | old = copy.deepcopy(CODEMIRROR_SETTINGS) 18 | 19 | # Install tests required settings 20 | from sandbox.settings.djangocodemirror_app import * 21 | 22 | # Restore default shipped configs additionaly to the tests ones 23 | CODEMIRROR_SETTINGS.update(old) 24 | -------------------------------------------------------------------------------- /sandbox/settings/djangocodemirror_app.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django Codemirror application settings to share with various settings. 3 | 4 | Not all those configs won't work for real, there are almost all just for 5 | unittests 6 | """ 7 | CODEMIRROR_SETTINGS = { 8 | 'empty': {}, 9 | 'basic': { 10 | 'mode': 'rst', 11 | }, 12 | 'with-options': { 13 | 'mode': 'rst', 14 | 'lineWrapping': True, 15 | 'lineNumbers': True, 16 | }, 17 | 'with-modes': { 18 | 'mode': 'rst', 19 | 'modes': ['rst', 'python'], 20 | }, 21 | 'with-themes': { 22 | 'mode': 'rst', 23 | 'theme': 'elegant', 24 | 'themes': ['eclipse', 'elegant'], 25 | }, 26 | 'with-addons': { 27 | 'mode': 'rst', 28 | 'addons': [ 29 | "CodeMirror/lib/util/dialog.js", 30 | ], 31 | }, 32 | 'with-extra_css': { 33 | 'mode': 'rst', 34 | 'extra_css': [ 35 | "CodeMirror/theme/ambiance.css", 36 | ], 37 | }, 38 | 'without-bundle': { 39 | 'modes': ['rst', 'python'], 40 | 'css_bundle_name': None, 41 | 'js_bundle_name': None, 42 | 'themes': ['eclipse', 'elegant'], 43 | }, 44 | 'with-all': { 45 | 'mode': 'rst', 46 | 'lineWrapping': True, 47 | 'lineNumbers': True, 48 | 'addons': [ 49 | "CodeMirror/lib/util/dialog.js", 50 | ], 51 | 'modes': ['rst', 'python'], 52 | 'theme': 'neat', 53 | 'themes': ['eclipse', 'neat'], 54 | 'extra_css': [ 55 | "CodeMirror/theme/ambiance.css", 56 | ], 57 | }, 58 | } 59 | 60 | # Subset of some available themes 61 | CODEMIRROR_THEMES = { 62 | "ambiance": "CodeMirror/theme/ambiance.css", 63 | "eclipse": "CodeMirror/theme/eclipse.css", 64 | "elegant": "CodeMirror/theme/elegant.css", 65 | "neat": "CodeMirror/theme/neat.css", 66 | } 67 | -------------------------------------------------------------------------------- /sandbox/settings/tests.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for tests 3 | """ 4 | import os, copy 5 | 6 | from sandbox.settings.base import * 7 | 8 | # 9 | # DjangoCodemirror settings 10 | # 11 | from djangocodemirror.settings import * 12 | 13 | # Install tests required settings 14 | from sandbox.settings.djangocodemirror_app import * 15 | -------------------------------------------------------------------------------- /sandbox/templates/form.html: -------------------------------------------------------------------------------- 1 | {% extends "skeleton.html" %} 2 | {% load djangocodemirror_tags %} 3 | {% load static from staticfiles %} 4 | 5 | {% block head_title %}Basic form usage{% endblock %} 6 | 7 | {% block base_content %} 8 |

Basic form usage

9 | 10 |
11 |
{% csrf_token %} 12 | {{ form.as_p }} 13 | 14 |
15 |
16 | 17 | {% codemirror_field_css_assets form.foo %} 18 | {% codemirror_field_js_assets form.foo %} 19 | 25 | {% endblock %} 26 | -------------------------------------------------------------------------------- /sandbox/templates/homepage.html: -------------------------------------------------------------------------------- 1 | {% extends "skeleton.html" %} 2 | 3 | {% block base_content %} 4 |
5 |

Hello world!

6 | 7 | 12 |
13 | {% endblock %} -------------------------------------------------------------------------------- /sandbox/templates/modes.html: -------------------------------------------------------------------------------- 1 | {% extends "skeleton.html" %} 2 | {% load djangocodemirror_tags %} 3 | {% load static from staticfiles %} 4 | 5 | {% block head_title %}{% if codemirror_mode %}{{ codemirror_mode }}{% else %}Available modes{% endif %}{% endblock %} 6 | 7 | {% block base_content %} 8 |

Testing modes configurations

9 | 10 | {% if codemirror_mode %} 11 |

{{ codemirror_mode }}

12 |
13 |
{% csrf_token %} 14 | {{ form.as_p }} 15 | 16 |
17 |
18 | {% codemirror_instance codemirror_mode "foo_codemirror" form.foo.id_for_label %} 19 | {% else %} 20 |

Available modes

21 | 30 | {% endif %} 31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /sandbox/templates/raw.html: -------------------------------------------------------------------------------- 1 | {% extends "skeleton.html" %} 2 | {% load djangocodemirror_tags %} 3 | 4 | {% block head_title %}Usage on a HTML element{% endblock %} 5 | 6 | {% block base_content %} 7 |

Usage on a HTML element

8 | 9 |
10 | 11 |
12 | 13 | {% codemirror_instance 'restructuredtext' 'code_codemirror' 'code' %} 14 | {% endblock %} -------------------------------------------------------------------------------- /sandbox/templates/skeleton.html: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | 3 | 4 | {% block head_title %}Sample site{% endblock %}{% block head_assets %} 5 | {% endblock %} 6 | 7 | 8 | {% endspaceless %} 9 | {% block base_content %}{% endblock %}{% spaceless %} 10 | {% endspaceless %} -------------------------------------------------------------------------------- /sandbox/urls.py: -------------------------------------------------------------------------------- 1 | """ 2 | Sandbox URL Configuration 3 | """ 4 | from django.conf import settings 5 | from django.conf.urls import url 6 | 7 | from django.views.generic.base import TemplateView 8 | 9 | from sandbox.views import BasicSampleFormView, ModesSampleFormView 10 | 11 | 12 | urlpatterns = [ 13 | # Dummy homepage to list demo views 14 | url(r'^$', TemplateView.as_view( 15 | template_name="homepage.html" 16 | ), name='home'), 17 | 18 | # Sample with codemirror in the raw way 19 | url(r'^raw/$', TemplateView.as_view( 20 | template_name="raw.html" 21 | ), name='raw'), 22 | 23 | # Basic form sample 24 | url(r'^form/$', BasicSampleFormView.as_view( 25 | template_name="form.html" 26 | ), name='form'), 27 | 28 | # Mode index list 29 | url(r'^modes/$', ModesSampleFormView.as_view( 30 | template_name="modes.html" 31 | ), name='mode-index'), 32 | 33 | # Basic form sample with specific mode 34 | url(r'^modes/(?P[-\w]+)/$', ModesSampleFormView.as_view( 35 | template_name="modes.html" 36 | ), name='basic'), 37 | ] 38 | -------------------------------------------------------------------------------- /sandbox/views.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Sample views 4 | """ 5 | import io, os 6 | 7 | from django.conf import settings 8 | 9 | from django.views.generic.edit import FormView 10 | from django.urls import reverse 11 | 12 | from sandbox.forms import SampleForm 13 | 14 | 15 | class BasicSampleFormView(FormView): 16 | template_name = 'form.html' 17 | form_class = SampleForm 18 | 19 | def get_success_url(self): 20 | return reverse('home') 21 | 22 | 23 | class ModesSampleFormView(BasicSampleFormView): 24 | template_name = 'modes.html' 25 | 26 | def get_context_data(self, **kwargs): 27 | context = super(ModesSampleFormView, self).get_context_data(**kwargs) 28 | context.update({ 29 | 'codemirror_mode': self.codemirror_mode, 30 | }) 31 | return context 32 | 33 | def get_initial(self): 34 | """ 35 | Try to find a demo source for given mode if any, if finded use it to 36 | fill the demo textarea. 37 | """ 38 | initial = {} 39 | 40 | if self.kwargs.get('mode', None): 41 | filename = "{}.txt".format(self.kwargs['mode']) 42 | filepath = os.path.join(settings.BASE_DIR, 'demo_datas', filename) 43 | if os.path.exists(filepath): 44 | with io.open(filepath, 'r', encoding='utf-8') as fp: 45 | initial['foo'] = fp.read() 46 | 47 | return initial 48 | 49 | def get(self, request, *args, **kwargs): 50 | self.codemirror_mode = kwargs.get('mode', None) 51 | return super(ModesSampleFormView, self).get(request, *args, **kwargs) 52 | 53 | def post(self, request, *args, **kwargs): 54 | self.codemirror_mode = kwargs.get('mode', None) 55 | return super(ModesSampleFormView, self).post(request, *args, **kwargs) 56 | -------------------------------------------------------------------------------- /sandbox/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for DjangoPalette project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | """ 6 | 7 | import os 8 | 9 | from django.core.wsgi import get_wsgi_application 10 | 11 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.demo") 12 | 13 | application = get_wsgi_application() 14 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | from setuptools import setup 4 | 5 | setup() 6 | -------------------------------------------------------------------------------- /tests/002_forms/test_002_fields.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tests against form fields 3 | """ 4 | import pytest 5 | 6 | from djangocodemirror.fields import CodeMirrorField 7 | 8 | from tests.utils import assert_and_parse_html 9 | 10 | 11 | def test_field_basic(): 12 | """Basic field usage""" 13 | field = CodeMirrorField(label="Foo", required=True, 14 | config_name="basic", 15 | initial='Hello World!') 16 | 17 | rendered = field.widget.render("foo", "bar") 18 | 19 | expected = ("""""") 21 | 22 | assert assert_and_parse_html(rendered) == assert_and_parse_html(expected) 23 | -------------------------------------------------------------------------------- /tests/002_forms/test_003_forms.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tests against field usage inside a form 3 | """ 4 | import pytest 5 | 6 | from django import forms 7 | from django import VERSION as django_versioning 8 | 9 | from sandbox.forms import SampleForm 10 | 11 | from tests.utils import assert_and_parse_html 12 | 13 | 14 | def test_form_basic(): 15 | """Basic field usage""" 16 | f = SampleForm({'foo': 'bar'}) 17 | 18 | rendered = f.as_p() 19 | expected = ("""

""" 20 | """

""") 22 | 23 | assert assert_and_parse_html(rendered) == assert_and_parse_html(expected) 24 | 25 | -------------------------------------------------------------------------------- /tests/003_templatetags/test_001_input_config.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tests against template tags for Codemirror config 3 | """ 4 | import json 5 | import pytest 6 | 7 | from djangocodemirror.widgets import CodeMirrorWidget 8 | from djangocodemirror.templatetags import djangocodemirror_tags 9 | 10 | from sandbox.forms import ManyFieldsSampleForm 11 | 12 | 13 | @pytest.mark.parametrize('name,attempted', [ 14 | ( 15 | 'foo', 16 | { 17 | "mode": "rst", 18 | } 19 | ), 20 | ( 21 | 'ping', 22 | { 23 | "mode": "rst", 24 | "lineNumbers": True, 25 | "lineWrapping": True, 26 | "theme": "neat", 27 | } 28 | ), 29 | ], ids=["foo-basic", "ping-with-all"]) 30 | def test_codemirror_parameters(name, attempted): 31 | """Test codemirror_parameters tag""" 32 | f = ManyFieldsSampleForm() 33 | 34 | f.as_p() 35 | 36 | p = djangocodemirror_tags.codemirror_parameters(f.fields[name]) 37 | 38 | assert json.loads(p) == attempted 39 | -------------------------------------------------------------------------------- /tests/003_templatetags/test_003_css_assets.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tests against template tags for CSS assets 3 | """ 4 | import json 5 | import pytest 6 | 7 | from djangocodemirror.exceptions import CodeMirrorFieldBundleError 8 | from djangocodemirror.widgets import CodeMirrorWidget 9 | from djangocodemirror.templatetags.djangocodemirror_tags import ( 10 | codemirror_field_css_assets, 11 | codemirror_field_css_bundle, 12 | ) 13 | 14 | from sandbox.forms import SampleForm, ManyFieldsSampleForm, NoBundleForm 15 | 16 | 17 | def test_codemirror_single_field_js_assets(): 18 | """Test codemirror_field_js_assets tag for a single field""" 19 | f = SampleForm() 20 | 21 | f.as_p() 22 | 23 | assets = codemirror_field_css_assets(f.fields['foo']) 24 | 25 | assert assets == '' 26 | 27 | 28 | def test_codemirror_multiple_field_js_assets(): 29 | """Test codemirror_field_js_assets tag for a many field""" 30 | f = ManyFieldsSampleForm() 31 | 32 | f.as_p() 33 | 34 | assets = codemirror_field_css_assets( 35 | f.fields['foo'], 36 | f.fields['pika'], 37 | f.fields['ping'] 38 | ) 39 | 40 | assert assets == ("""""" 41 | """""" 42 | """""" 43 | """""") 44 | 45 | 46 | def test_codemirror_field_css_bundle(): 47 | """Test codemirror_field_css_bundle filter for a single field""" 48 | f = ManyFieldsSampleForm() 49 | 50 | f.as_p() 51 | 52 | name = codemirror_field_css_bundle(f.fields['foo']) 53 | 54 | assert name == 'dcm-basic_css' 55 | 56 | 57 | def test_codemirror_field_css_bundle_error(): 58 | """Test bundle exception from codemirror_field_css_bundle filter for a 59 | single field""" 60 | f = NoBundleForm() 61 | 62 | f.as_p() 63 | 64 | with pytest.raises(CodeMirrorFieldBundleError) as e: 65 | name = codemirror_field_css_bundle(f.fields['foo']) 66 | -------------------------------------------------------------------------------- /tests/003_templatetags/test_004_codemirror_instance.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Tests against template tags for Codemirror config 4 | """ 5 | import pytest 6 | 7 | from djangocodemirror.templatetags.djangocodemirror_tags import ( 8 | codemirror_instance, 9 | ) 10 | 11 | from sandbox.forms import SampleForm 12 | 13 | 14 | def test_codemirror_instance_without_assets(): 15 | html = codemirror_instance('basic', 'foo_codemirror', 'id_foo', assets=False) 16 | 17 | output = ("""""") 21 | 22 | assert html == output 23 | 24 | 25 | def test_codemirror_instance_varname_dash(): 26 | html = codemirror_instance('basic', 'foo_codemirror-0', 'id_foo', assets=False) 27 | 28 | output = ("""""") 32 | 33 | assert html == output 34 | 35 | 36 | def test_codemirror_instance_varname_messy(): 37 | html = codemirror_instance('basic', 'foo codemérror-0', 'id_foo', assets=False) 38 | 39 | output = ("""""") 43 | 44 | assert html == output 45 | 46 | 47 | def test_codemirror_instance_with_assets(): 48 | html = codemirror_instance('basic', 'foo_codemirror', 'id_foo', assets=True) 49 | 50 | output = ("""""" 51 | """""" 52 | """""") 55 | 56 | assert html == output 57 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | """ 2 | Some fixture methods 3 | """ 4 | import pytest 5 | 6 | from django.conf import settings 7 | 8 | from djangocodemirror.manifest import CodeMirrorManifest 9 | 10 | 11 | @pytest.fixture(scope="function") 12 | def manifesto(): 13 | """Return a CodeMirrorManifest instance""" 14 | return CodeMirrorManifest() 15 | -------------------------------------------------------------------------------- /tests/test_001_ping_urls.py: -------------------------------------------------------------------------------- 1 | """ 2 | Some dummy pinging to ensure urls are consistent 3 | """ 4 | import pytest 5 | 6 | from django.urls import reverse 7 | 8 | 9 | def test_ping_index(client): 10 | """Just pinging dummy homepage""" 11 | response = client.get(reverse('home')) 12 | assert response.status_code == 200 13 | -------------------------------------------------------------------------------- /tests/utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | Test utilities 3 | """ 4 | from django.test.html import HTMLParseError, parse_html 5 | 6 | 7 | def assert_and_parse_html(html): 8 | """ 9 | Shortand to use Django HTML parsing as object to use in assert 10 | """ 11 | dom = parse_html(html) 12 | return dom 13 | --------------------------------------------------------------------------------