Skip to content

Commit

Permalink
Updated CodeMirror to branch 5.19.0 (5.20.0+ moved to ES6 which uglif…
Browse files Browse the repository at this point in the history
…y can't handle yet)

+ Added call editor refresh to update rener screen (Issue #2)
+ Added codemirror-overlay to generation (Issue #3)
+ List of modes sorted alphabetically to create consistent output (Issue #3)
+ Added additional syntax types in the dropdown list
  - DockerFile
  - SCSS
  - Erlang
  - Go
  - TCL
  - APL
  - Asterisk
  - BrainFuck
  - Cassandra
  - CMake
  - Cobol
  - Django
  - GitHub Markdown
  - MiriaDB
  - mbox
  - mIRC
  - MSSQL
  - MySQL
  - Nginx Config
  - PGP
  - PgSQL
  - Powershell
  - SASS
  - Sieve
  - Smarty
  - Visual Basic
  - VB Script
  • Loading branch information
luggs-co committed Dec 8, 2016
1 parent b51de89 commit 703bfe8
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 18 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -19,6 +19,7 @@ js-codemirror-modes:
js-codemirror:
./develop/js-sha1-versioned.sh www/jslibs/codemirror - < source/CodeMirror/lib/codemirror.js
./develop/js-sha1-versioned.sh www/jslibs/codemirror-simple - < source/CodeMirror/addon/mode/simple.js
./develop/js-sha1-versioned.sh www/jslibs/codemirror-overlay - < source/CodeMirror/addon/mode/overlay.js

js-tpl: $(JAVASCRIPTS)
./develop/make-javascripts-tpl.sh
Expand Down
2 changes: 1 addition & 1 deletion develop/codemirror-combine-modes.sh
Expand Up @@ -8,7 +8,7 @@ trap 'rm -rf "${tmpdir}"' EXIT
(
cd "source"
# assume folder names are "sane"
for d in $(find "CodeMirror/mode" -mindepth 1 -type d); do
for d in $(find "CodeMirror/mode" -mindepth 1 -type d | sort); do
mode=$(basename "${d}")
f="${d}/${mode}.js"
if [ -e "${f}" ]; then
Expand Down
8 changes: 4 additions & 4 deletions develop/make-javascripts-tpl.sh
Expand Up @@ -59,16 +59,16 @@ findjs() {
done
printf '\t\t\t\tfunction() {'
printf '\n\t\t\t\t\thead.load(\n'

first=1
for s in codemirror-simple jquery.textchange; do
for s in codemirror-simple codemirror-overlay jquery.textchange; do
printf '\t\t\t\t\t\t"'
findjs "jslibs/${s}"
printf '",\n'
done
printf '\t\t\t\t\t\tfunction() {'
printf '\n\t\t\t\t\t\t\thead.load(\n'

first=1
for s in codemirror-modes main; do
if [ 0 -eq "${first}" ]; then printf ',\n'; fi
Expand All @@ -77,7 +77,7 @@ findjs() {
printf '"'
first=0
done

printf '\n\t\t\t\t\t\t\t);'
printf '\n\t\t\t\t\t\t}'
printf '\n\t\t\t\t\t);'
Expand Down
2 changes: 1 addition & 1 deletion source/CodeMirror
3 changes: 3 additions & 0 deletions source/core.js
Expand Up @@ -347,6 +347,9 @@ $( function() {
}
}

// force the editor to refresh (Fixes github issue #2)
editor.refresh();

if( blob )
{
$( '#saveas' ).show().on( 'click', function() {
Expand Down
51 changes: 39 additions & 12 deletions www/inc/config.inc.php
Expand Up @@ -51,42 +51,69 @@
[ 'text/x-csrc' , 'C' ],
[ 'text/x-c++src' , 'C++' ],
[ 'text/x-csharp' , 'C#' ],
[ 'text/x-java' , 'Java' ],
[ 'text/css' , 'CSS' ],
[ 'text/x-dockerfile' , 'DockerFile' ],
[ 'text/x-less' , 'LESS' ],
[ 'text/x-scss' , 'SCSS' ],
[ 'text/x-erlang' , 'Erlang' ],
[ 'text/x-go' , 'Go' ],
[ 'htmlmixed' , 'HTML mixed-mode' ],
[ 'text/x-java' , 'Java' ],
[ 'text/javascript' , 'JavaScript' ],
[ 'text/x-perl' , 'Perl' ],
[ 'application/x-httpd-php' , 'PHP' ],
[ 'application/x-httpd-php' , 'PHP' ],
[ 'text/x-python' , 'Python' ],
[ 'text/x-ruby' , 'Ruby' ],
[ 'text/x-plsql' , 'SQL' ],
[ 'text/x-sql' , 'SQL' ],
[ 'text/x-tcl' , 'TCL' ],
[ 'application/xml' , 'XML' ],
'Other Formats',
[ 'text/apl' , 'APL' ],
[ 'text/x-asterisk' , 'Asterisk' ],
[ 'text/x-brainfuck' , 'BrainFuck' ],
[ 'text/x-cassandra' , 'Cassandra' ],
[ 'text/x-clojure' , 'Clojure' ],
[ 'text/x-coffeescript' , 'CoffeeScript' ],
[ 'text/x-diff' , 'diff' ],
[ 'text/x-cmake' , 'CMake' ],
[ 'text/x-coffeescript' , 'CoffeeScript' ],
[ 'text/x-cobol' , 'Cobol' ],
[ 'text/x-diff' , 'Diff' ],
[ 'text/x-django' , 'Django' ],
[ 'text/x-eiffel' , 'Eiffel' ],
[ 'text/x-gfm' , 'GitHub Markdown' ],
[ 'text/x-groovy' , 'Groovy' ],
[ 'text/x-haskell' , 'Haskell' ],
[ 'text/html' , 'HTML embedded scripts' ],
[ 'application/x-jsp' , 'JavaServer Pages' ],
[ 'application/json' , 'JSON' ],
[ 'jinja2' , 'Jinja2' ],
[ 'text/less' , 'LESS' ],
[ 'application/x-jsp' , 'JavaServer Pages' ],
[ 'application/json' , 'JSON' ],
[ 'jinja2' , 'Jinja2' ],
[ 'text/x-lua' , 'Lua' ],
[ 'text/x-mariadb' , 'MariaDB' ],
[ 'text/x-markdown' , 'Markdown' ],
[ 'application/mbox' , 'mbox' ],
[ 'text/mirc' , 'mIRC' ],
[ 'text/x-mssql' , 'MSSQL' ],
[ 'text/x-mysql' , 'MySQL' ],
[ 'text/x-nginx-conf' , 'Nginx Config' ],
[ 'text/n-triples' , 'NTriples' ],
[ 'text/x-pascal' , 'Pascal' ],
[ 'application/pgp' , 'PGP' ],
[ 'text/x-pgsql' , 'PGSQL' ],
[ 'application/x-powershell' , 'PowerShell' ],
[ 'text/x-rsc' , 'R' ],
[ 'text/x-rst' , 'reStructuredText' ],
[ 'text/x-rust' , 'Rust' ],
[ 'text/x-russrct' , 'Rust' ],
[ 'text/x-sass' , 'SASS' ],
[ 'text/x-scheme' , 'Scheme' ],
[ 'application/sieve' , 'Sieve' ],
[ 'text/x-stsrc' , 'Smalltalk' ],
[ 'application/sparql' , 'SPARQL' ],
[ 'text/x-smarty' , 'Smarty' ],
[ 'application/sparql' , 'SPARQL' ],
[ 'text/x-stex' , 'sTeX, LaTeX' ],
[ 'text/x-tiddlywiki' , 'Tiddlywiki' ],
[ 'text/x-tiddlywiki' , 'Tiddlywiki' ],
[ 'text/velocity' , 'Velocity' ],
[ 'text/x-verilog' , 'Verilog' ],
[ 'text/x-vb' , 'Visual Basic' ],
[ 'text/vbscript' , 'VB Script' ],
[ 'text/x-yaml' , 'YAML' ],
];

Expand Down

0 comments on commit 703bfe8

Please sign in to comment.