Browse Source

Releases v1.3.0

master
Pandao 10 years ago
parent
commit
e318f2fc9f
  1. 46
      CHANGE.md
  2. 28
      Gulpfile.js
  3. 2
      bower.json
  4. 5
      css/editormd.css
  5. 6
      css/editormd.css.map
  6. 4
      css/editormd.css.min.map
  7. 4
      css/editormd.logo.css
  8. 4
      css/editormd.logo.css.map
  9. 2
      css/editormd.logo.css.min.map
  10. 2
      css/editormd.logo.min.css
  11. 4
      css/editormd.min.css
  12. 4
      css/editormd.preview.css
  13. 4
      css/editormd.preview.css.map
  14. 2
      css/editormd.preview.css.min.map
  15. 2
      css/editormd.preview.min.css
  16. 649
      editormd.amd.js
  17. 8
      editormd.amd.min.js
  18. 2
      editormd.amd.min.js.map
  19. 649
      editormd.js
  20. 7
      editormd.min.js
  21. 2
      editormd.min.js.map
  22. 58
      examples/@links.html
  23. 42
      examples/auto-height.html
  24. 2
      examples/change-mode.html
  25. 13
      examples/custom-keyboard-shortcuts.html
  26. 2
      examples/emoji.html
  27. 35
      examples/html-preview-markdown-to-html.html
  28. 6
      examples/index.html
  29. 30
      examples/manually-load-modules.html
  30. 2
      examples/simple.html
  31. 4
      examples/test.md
  32. 122
      examples/toolbar-auto-fixed.html
  33. 9
      languages/en.js
  34. 7
      languages/zh-tw.js
  35. 436
      lib/codemirror/AUTHORS
  36. 19
      lib/codemirror/LICENSE
  37. 12
      lib/codemirror/README.md
  38. 10
      lib/codemirror/addon/edit/closebrackets.js
  39. 2
      lib/codemirror/addon/edit/closetag.js
  40. 2
      lib/codemirror/addon/edit/matchbrackets.js
  41. 16
      lib/codemirror/addon/fold/foldgutter.js
  42. 23
      lib/codemirror/addon/hint/show-hint.js
  43. 145
      lib/codemirror/addon/hint/sql-hint.js
  44. 3
      lib/codemirror/addon/lint/lint.js
  45. 334
      lib/codemirror/addon/merge/merge.js
  46. 48
      lib/codemirror/addon/scroll/annotatescrollbar.js
  47. 13
      lib/codemirror/addon/search/matchesonscrollbar.js
  48. 3
      lib/codemirror/addon/selection/selection-pointer.js
  49. 35
      lib/codemirror/addon/tern/tern.js
  50. 8
      lib/codemirror/addons.min.js
  51. 2
      lib/codemirror/addons.min.js.map
  52. 16
      lib/codemirror/bower.json
  53. 2
      lib/codemirror/codemirror.js
  54. 5
      lib/codemirror/codemirror.min.css
  55. 56
      lib/codemirror/codemirror.min.js
  56. 26
      lib/codemirror/lib/codemirror.css
  57. 1528
      lib/codemirror/lib/codemirror.js
  58. 6
      lib/codemirror/mode/clike/clike.js
  59. 159
      lib/codemirror/mode/css/css.js
  60. 62
      lib/codemirror/mode/css/test.js
  61. 2
      lib/codemirror/mode/cypher/cypher.js
  62. 180
      lib/codemirror/mode/forth/forth.js
  63. 75
      lib/codemirror/mode/forth/index.html
  64. 1
      lib/codemirror/mode/go/go.js
  65. 2
      lib/codemirror/mode/idl/idl.js
  66. 2
      lib/codemirror/mode/index.html
  67. 2
      lib/codemirror/mode/javascript/javascript.js
  68. 1
      lib/codemirror/mode/meta.js
  69. 2
      lib/codemirror/mode/sql/sql.js
  70. 104
      lib/codemirror/mode/stylus/index.html
  71. 444
      lib/codemirror/mode/stylus/stylus.js
  72. 211
      lib/codemirror/mode/verilog/verilog.js
  73. 18
      lib/codemirror/modes.min.js
  74. 2
      lib/codemirror/modes.min.js.map
  75. 21
      lib/codemirror/package.json
  76. 2
      lib/codemirror/theme/3024-day.css
  77. 2
      lib/codemirror/theme/3024-night.css
  78. 10
      lib/codemirror/theme/ambiance.css
  79. 2
      lib/codemirror/theme/base16-dark.css
  80. 2
      lib/codemirror/theme/base16-light.css
  81. 2
      lib/codemirror/theme/blackboard.css
  82. 2
      lib/codemirror/theme/cobalt.css
  83. 33
      lib/codemirror/theme/colorforth.css
  84. 2
      lib/codemirror/theme/erlang-dark.css
  85. 2
      lib/codemirror/theme/lesser-dark.css
  86. 2
      lib/codemirror/theme/mbo.css
  87. 2
      lib/codemirror/theme/mdn-like.css
  88. 2
      lib/codemirror/theme/midnight.css
  89. 2
      lib/codemirror/theme/monokai.css
  90. 2
      lib/codemirror/theme/night.css
  91. 2
      lib/codemirror/theme/paraiso-dark.css
  92. 2
      lib/codemirror/theme/paraiso-light.css
  93. 3
      lib/codemirror/theme/pastel-on-dark.css
  94. 2
      lib/codemirror/theme/rubyblue.css
  95. 12
      lib/codemirror/theme/solarized.css
  96. 2
      lib/codemirror/theme/the-matrix.css
  97. 35
      lib/codemirror/theme/tomorrow-night-bright.css
  98. 2
      lib/codemirror/theme/tomorrow-night-eighties.css
  99. 2
      lib/codemirror/theme/twilight.css
  100. 2
      lib/codemirror/theme/vibrant-ink.css

46
CHANGE.md

@ -302,4 +302,48 @@ v1.2.0 主要更新:
- 新增`Require.js/AMD`专用版本文件`editormd.amd.js`;
- 新建Gulp任务`amd`;
- 修改和新增以上改进等相关示例;
- 修改和新增以上改进等相关示例;
### v1.3
#### v1.3.0
主要更新:
- 预设键盘快捷键处理(粗体等),插入Markdown更加方便;
- 更新CodeMirror版本为`5.0`;
- 更新Marked版本为`0.3.3`;
- 新增自动高度和工具栏固定定位功能;
- 改进表格插入对话框;
- 工具栏新增三个按钮,分别是将所选文本首字母转成大写、转成小写、转成大写;
- 修改使用帮助文档;
- 修复多个Bug;
具体更新如下:
- 新增常用键盘快捷键预设处理;
- 新增属性`editormd.keyMaps`,预设一些常用操作,例如插入粗体等;
- 新增成员方法`registerKeyMaps()`;
- 退出HTML全屏预览快捷键更改为`Shift + ESC`;
- 新增配置项`disabledKeyMaps`,用于屏蔽一些快捷键操作;
- 更新CodeMirror版本为`5.0`;
- 修改无法输入`/`的问题;
- 更新Marked版本为`0.3.3`;
- 新增自动高度和工具栏固定定位(滚动条拖动时)模式;
- 新增配置项`settings.autoHeight`;
- 新增配置项`settings.toolbarAutoFixed`;
- 新增方法 `setToolbarAutoFixed(true|false)`
- 新增邮箱地址自动添加链接功能;
- 新增配置项`emailLink`,默认为`true`;
- 改进表格插入对话框;
- 工具栏新增三个按钮,分别是将所选文本首字母转成大写、转成小写、转成大写;
- 新增方法`editormd.ucwords()`,别名`editormd.wordsFirstUpperCase()`;
- 新增方法`editormd.ucfirst()`,别名`editormd.firstUpperCase()`;
- 新增两个成员方法`getSelections()`和`getSelections()`;
- 修复Font awesome 图标 emoji 部分无法解析的Bug,[#39](https://github.com/pandao/editor.md/issues/39)
- 改进@link功能[#40](https://github.com/pandao/editor.md/issues/40);
- 新增配置项`atLink`,默认为`true`;
- 修复无法输入`/`的问题 [#42](https://github.com/pandao/editor.md/issues/42);
- 修改使用帮助说明的错误 [#43](https://github.com/pandao/editor.md/issues/43);
- 新增配置项`pluginPath`,默认为空时,等于`settings.path + "../plugins/"`;

28
Gulpfile.js

@ -5,7 +5,7 @@ var gulp = require("gulp");
var gutil = require("gulp-util");
var sass = require("gulp-ruby-sass");
var jshint = require("gulp-jshint");
var uglify = require("gulp-uglify");
var uglify = require("gulp-uglifyjs");
var rename = require("gulp-rename");
var concat = require("gulp-concat");
var notify = require("gulp-notify");
@ -83,7 +83,7 @@ gulp.task("js", function() {
}}))
.pipe(gulp.dest("./"))
.pipe(rename({ suffix: ".min" }))
.pipe(uglify())
.pipe(uglify({outSourceMap: true, sourceRoot: './'}))
.pipe(gulp.dest("./"))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + ( (os.platform() === "win32") ? "\\" : "/") );
@ -93,18 +93,6 @@ gulp.task("js", function() {
.pipe(notify({ message: "editormd.js task complete" }));
});
gulp.task("plugins", function() {
var path = "plugins/test-plugin";
//return gulp.src([path + "/*.js", "!plugins/plugin-template.js", "!plugins/test-plugin/*.js"])
return gulp.src("plugins/test-plugin/test-plugin.js")
.pipe(gulp.dest(path))
.pipe(rename({ suffix: ".min" }))
.pipe(uglify())
.pipe(gulp.dest(path))
.pipe(notify({ message: "plugins task complete"}));
});
gulp.task("amd", function() {
var replaceText1 = [
'var cmModePath = "codemirror/mode/";',
@ -197,7 +185,7 @@ gulp.task("amd", function() {
.pipe(replace("/* Require.js assignment replace */", replaceText2))
.pipe(gulp.dest('./'))
.pipe(rename({ suffix: ".min" }))
.pipe(uglify())
.pipe(uglify({outSourceMap: true, sourceRoot: './'}))
.pipe(gulp.dest("./"))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + ( (os.platform() === "win32") ? "\\" : "/") );
@ -287,7 +275,7 @@ gulp.task("cm-mode", function() {
return gulp.src(modes)
.pipe(concat("modes.min.js"))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(uglify())
.pipe(uglify({outSourceMap: true, sourceRoot: codeMirror.path.dist}))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + "\\");
@ -309,7 +297,7 @@ gulp.task("cm-addon", function() {
return gulp.src(addons)
.pipe(concat("addons.min.js"))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(uglify())
.pipe(uglify({outSourceMap: true, sourceRoot: codeMirror.path.dist}))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + "\\");
@ -338,9 +326,9 @@ gulp.task("jsdoc2md", function() {
});
gulp.task("watch", function() {
gulp.watch("src/scss/editormd.scss", ["scss"]);
gulp.watch("src/scss/editormd.preview.scss", ["scss", "scss2"]);
gulp.watch("src/scss/editormd.logo.scss", ["scss", "scss3"]);
gulp.watch("scss/editormd.scss", ["scss"]);
gulp.watch("scss/editormd.preview.scss", ["scss", "scss2"]);
gulp.watch("scss/editormd.logo.scss", ["scss", "scss3"]);
gulp.watch("src/editormd.js", ["js", "amd"]);
});

2
bower.json

@ -1,6 +1,6 @@
{
"name": "editor.md",
"version": "1.2.0",
"version": "1.3.0",
"homepage": "https://github.com/pandao/editor.md",
"authors": [
"Pandao <pandao@vip.qq.com>"

5
css/editormd.css

@ -2,12 +2,12 @@
* Editor.md
*
* @file editormd.css
* @version v1.2.0
* @version v1.3.0
* @description A simple online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-10
* @updateTime 2015-03-12
*/
@charset "UTF-8";
@ -2375,6 +2375,7 @@
text-align: left;
overflow: hidden;
position: relative;
margin-bottom: 15px;
border: 1px solid #ddd;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;

6
css/editormd.css.map

File diff suppressed because one or more lines are too long

4
css/editormd.css.min.map

File diff suppressed because one or more lines are too long

4
css/editormd.logo.css

@ -2,12 +2,12 @@
* Editor.md
*
* @file editormd.logo.css
* @version v1.2.0
* @version v1.3.0
* @description A simple online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-10
* @updateTime 2015-03-12
*/
/*!

4
css/editormd.logo.css.map

@ -2,12 +2,12 @@
* Editor.md
*
* @file editormd.logo.css.map
* @version v1.2.0
* @version v1.3.0
* @description A simple online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-10
* @updateTime 2015-03-12
*/
{

2
css/editormd.logo.css.min.map

@ -1,2 +1,2 @@
/*! Editor.md v1.2.0 | editormd.logo.css.min.map | A simple online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-10 */
/*! Editor.md v1.3.0 | editormd.logo.css.min.map | A simple online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-12 */
{"version":3,"mappings":";;;;;;;;AAKA,UASC;EARA,WAAW,EAAE,eAAe;EAC5B,GAAG,EAAC,yCAAyC;EAC7C,GAAG,EAAC,sQAA4E;EAIhF,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;;AAGnB;;;;;;;;iBAQkB;EACjB,WAAW,EAAE,eAAe;EAC5B,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,MAAM;EACpB,cAAc,EAAE,IAAI;EACjB,SAAS,EAAE,OAAO;EACrB,WAAW,EAAE,CAAC;EACX,OAAO,EAAE,YAAY;EACrB,cAAc,EAAE,IAAI;EACpB,cAAc,EAAE,OAAO;EAG1B,sBAAsB,EAAE,WAAW;EACnC,uBAAuB,EAAE,SAAS;;AAE/B;;;;;;;;wBAAS;EACL,OAAO,EAAE,QAAQ;;;;;;;AAQzB,iBAAkB;EACd,SAAS,EAAE,GAAG;;;AAGlB,iBAAkB;EACd,SAAS,EAAE,KAAK;;;AAGpB,iBAAkB;EACd,SAAS,EAAE,GAAG;;;AAGlB,iBAAkB;EACd,SAAS,EAAE,GAAG;;;AAGlB,iBAAkB;EACd,SAAS,EAAE,GAAG;;;AAGlB,iBAAkB;EACd,SAAS,EAAE,GAAG;;;AAGlB,iBAAkB;EACd,SAAS,EAAE,GAAG;;;AAGlB,iBAAkB;EACd,SAAS,EAAE,GAAG;;;AAGlB,iBAAkB;EACd,SAAS,EAAE,GAAG;;;AAGlB,oBAAqB;EACjB,KAAK,EChFO,OAAU","sources"["../editormd.logo.scss","file:///D:/APMServ/www/htdocs/editor.md/scss/lib/variables.scss"],"names"[],"file":"editormd.logo.css"}

2
css/editormd.logo.min.css

@ -1,4 +1,4 @@
/*! Editor.md v1.2.0 | editormd.logo.min.css | A simple online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-10 */
/*! Editor.md v1.3.0 | editormd.logo.min.css | A simple online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-12 */
/*!
* prefixes.scss
* @author Pandao

4
css/editormd.min.css

File diff suppressed because one or more lines are too long

4
css/editormd.preview.css

@ -2,12 +2,12 @@
* Editor.md
*
* @file editormd.preview.css
* @version v1.2.0
* @version v1.3.0
* @description A simple online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-10
* @updateTime 2015-03-12
*/
/*!

4
css/editormd.preview.css.map

@ -2,12 +2,12 @@
* Editor.md
*
* @file editormd.preview.css.map
* @version v1.2.0
* @version v1.3.0
* @description A simple online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-10
* @updateTime 2015-03-12
*/
{

2
css/editormd.preview.css.min.map

File diff suppressed because one or more lines are too long

2
css/editormd.preview.min.css

@ -1,4 +1,4 @@
/*! Editor.md v1.2.0 | editormd.preview.min.css | A simple online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-10 */
/*! Editor.md v1.3.0 | editormd.preview.min.css | A simple online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-12 */
/*!
* prefixes.scss
* @author Pandao

649
editormd.amd.js

File diff suppressed because it is too large

8
editormd.amd.min.js

File diff suppressed because one or more lines are too long

2
editormd.amd.min.js.map

File diff suppressed because one or more lines are too long

649
editormd.js

File diff suppressed because it is too large

7
editormd.min.js

File diff suppressed because one or more lines are too long

2
editormd.min.js.map

File diff suppressed because one or more lines are too long

58
examples/@links.html

@ -11,31 +11,57 @@
<div id="layout">
<header>
<h1>@links</h1>
<p>Github Flavored Markdown extended syntax</p>
<p>Github Flavored Markdown extras syntax</p>
</header>
<div id="test-editormd">
<textarea style="display:none;">###@links
<textarea style="display:none;">### Disable @link & email address auto link
> Editor.md default enable @link & email address auto link;
> Unsupported xxxx@xxxxx, xxxx@localhost ...
```javascript
var testEditor;
$(function() {
// You can custom @link base url.
editormd.urls.atLinkBase = "https://github.com/";
testEditor = editormd("test-editormd", {
atLink : false, // disable @link
emailLink : false, // disable email address auto link
path : '../lib/'
});
});
```
###@links
[TOC]
~~@mentions~~, #refs @tylerlong `inline code @tylerlong`, [links](), **formatting**, and <del>tags</del> supported @pandao;
list syntax required (any unordered or ordered list supported) @pandao;
this is @pandao a complete item @pandao;
this is @pandao a complete item @pandao xxx.test@gmail.com;
link [@pandao](https://github.com/pandao "@pandao") &#64;
link [@pandao](https://github.com/pandao "@pandao") &#64 xxx.test@gmail.com;
link [&#64;pandao](https://github.com/pandao "&#64;pandao")
this is an incomplete item **@pandao**;
fsdafds [Gmail](mailto:xxx.test@gmail.com) this is an incomplete item **@pandao**;
*@pandao* this is an incomplete item ___@pandao___;
<xxx.test@gmail.com>
<mailto:xxx.test@gmail.com>
Email test : [email me](mailto:test@test.com) [Gmail](mailto:xxx.test@gmail.com) dsfdfsdfsdfsdf xxx.test@gmail.com fdfsdfsdf 5956565656565@vip.qq.com
# Github: @pandao
## Github: @pandao
### Github: @tylerlong
#### Github: @tylerlong
##### Github: @tylerlong
###### Github: @tylerlong
###### Github: @tylerlong [Gmail](mailto:xxx.test@gmail.com)
- dafssdfsdaf@chjj dfsdfsdf
- dafssdfsdaf@chjj dfsdfsdf [5956565656565@vip.qq.com](mailto:5956565656565@vip.qq.com)
- dafssdfsdaf@chjj dfsdfsdf
- dafssdfsdaf@chjj dfsdfsdf
- dafss@pandao dfsdaf@chjj dfsdfsdf
@ -78,18 +104,16 @@ This @pandao an H2 @pandao
$(function() {
// You can custom @link base url.
editormd.url = {
atLinkBase : "https://github.com/"
};
editormd.urls.atLinkBase = "https://github.com/";
testEditor = editormd("test-editormd", {
width : "90%",
height : 720,
toc : true,
todoList : true,
path : '../lib/',
onload : function() {
}
width : "90%",
height : 720,
toc : true,
//atLink : false, // disable @link
//emailLink : false, // disable email address auto link
todoList : true,
path : '../lib/'
});
});
</script>

42
examples/auto-height.html

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<title>Auto height - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
</head>
<body>
<div id="layout">
<header>
<h1>Auto height</h1>
</header>
<div id="test-editormd">
<textarea style="display:none;">### Settings
```javascript
var testEditor = editormd("test-editormd", {
width : "90%",
autoHeight : true,
path : '../lib/'
});
```
</textarea>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="../editormd.js"></script>
<script type="text/javascript">
var testEditor;
$(function() {
testEditor = editormd("test-editormd", {
width : "90%",
autoHeight : true,
path : '../lib/'
});
});
</script>
</body>
</html>

2
examples/change-mode.html

@ -25,7 +25,7 @@
</header>
<div class="btns">
<button id="get-code-btn">Get code source</button>
<button id="fullscreen-btn">Fullscreen (Press ESC exit)</button>
<button id="fullscreen-btn">Fullscreen (Press F11 into, ESC exit)</button>
</div>
<div id="codes">
<textarea id="html-code">&lt;!DOCTYPE html&gt;

13
examples/custom-keyboard-shortcuts.html

@ -13,13 +13,21 @@
<h1>Custom keyboard shortcuts</h1>
</header>
<div id="test-editormd">
<textarea style="display:none;">####Example
<textarea style="display:none;">#### Default
> If Editor.md code editor is on focus, you can use keyboard shortcuts.
> Editor.md have the default keyboard shortcuts handle. Plaese open the help dialog, can see all default keyboard shortcuts.
####Example
```javascript
var testEditor = editormd("test-editormd", {
width: "90%",
height: 720,
path : '../lib/',
disabledKeyMaps : [
"Ctrl-B", "F11", "F10" // disable some default keyboard shortcuts handle
],
onload : function() {
var keyMap = {
"Ctrl-S": function(cm) {
@ -58,6 +66,9 @@ var testEditor = editormd("test-editormd", {
width: "90%",
height: 720,
path : '../lib/',
disabledKeyMaps : [
"Ctrl-B", "F11", "F10" // disable some default keyboard shortcuts handle
],
onload : function() {
var keyMap = {
"Ctrl-S": function(cm) {

2
examples/emoji.html

@ -102,7 +102,7 @@ Emoji cheat sheet for Campfire and GitHub.
**Examples:**
:fa-wifi: :fa-twitter: :fa-google-plus: :fa-git-square: :fa-github-alt:
:fa-wifi: :fa-twitter: :fa-google-plus: :fa-git-square: :fa-github-alt: :fa-external-link-square:
###Editor.md logos

35
examples/html-preview-markdown-to-html.html

@ -23,8 +23,18 @@
<div id="test-editormd-view">
<textarea style="display:none;">###Hello world!</textarea>
</div>
</div>
<textarea id="append-test" style="display:none;">
<div id="test-editormd-view2">
<textarea id="append-test" style="display:none;">
###科学公式 TeX(KaTeX)
$$E=mc^2$$
行内的公式$$E=mc^2$$行内的公式,行内的$$E=mc^2$$公式。
$$\(\sqrt{3x-1}+(1+x)^2\)$$
$$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$
#####上标和下标
@ -50,10 +60,12 @@ alert("script");
&lt;script type="text/javscript"&gt;
alert("script");
&lt;/script&gt;</textarea>
&lt;/script&gt;</textarea>
</div>
</div>
<!-- <script src="js/zepto.min.js"></script>
<script>
var jQuery = Zepto; // 为了避免修改flowChart.js和sequence-diagram.js的源码,所以想支持flowChart/sequenceDiagram就得加上这一句
var jQuery = Zepto; // 为了避免修改flowChart.js和sequence-diagram.js的源码,所以使用Zepto.js时想支持flowChart/sequenceDiagram就得加上这一句
</script> -->
<script src="js/jquery.min.js"></script>
<script src="../lib/marked.min.js"></script>
@ -67,7 +79,7 @@ alert("script");
<script src="../editormd.js"></script>
<script type="text/javascript">
var testEditormdView;
var testEditormdView, testEditormdView2;
$(function() {
$.get("test.md", function(markdown) {
@ -84,10 +96,19 @@ alert("script");
sequenceDiagram : true, // 默认不解析
});
console.log("返回一个jQuery实例 =>", testEditormdView);
//console.log("返回一个jQuery实例 =>", testEditormdView);
// 获取Markdown源码
console.log(testEditormdView.getMarkdown());
//console.log(testEditormdView.getMarkdown());
});
testEditormdView2 = editormd.markdownToHTML("test-editormd-view2", {
htmlDecode : "style,script,iframe", // you can filter tags decode
emoji : true,
taskList : true,
tex : true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram : true, // 默认不解析
});
});
</script>

6
examples/index.html

@ -109,6 +109,12 @@
<li>
<a href="./multi-languages.html">多语言支持 <span>Multi-languages for l18n</span></a>
</li>
<li>
<a href="./auto-height.html">自动高度 <span>Auto height</span></a>
</li>
<li>
<a href="./toolbar-auto-fixed.html">工具栏自动固定定位的开启与禁用 <span>Enable / disable toolbar auto fixed position.</span></a>
</li>
<li>
<a href="./dynamic-create-editormd.html">动态创建Editor.md <span>Dynamic create Editor.md</span></a>
</li>

30
examples/manually-load-modules.html

@ -12,7 +12,7 @@
<h1>Manually load-modules</h1>
</header>
<div id="test-editormd">
<textarea style="display:none;">#Manually load modules exmaple
<textarea style="display:none;">#### Manually load modules exmaple
```html
&lt;script src="js/jquery.min.js"&gt;&lt;/script&gt;
@ -20,6 +20,8 @@
&lt;link rel="stylesheet" href="../lib/codemirror/addon/dialog/dialog.css" /&gt;
&lt;link rel="stylesheet" href="../lib/codemirror/addon/search/matchesonscrollbar.css" /&gt;
&lt;script src="../lib/codemirror/codemirror.min.js"&gt;&lt;/script&gt;
&lt;!-- Or, You can also one by one load CodeMirror modes & addons. --&gt;
&lt;script src="../lib/codemirror/addons.min.js"&gt;&lt;/script&gt;
&lt;script src="../lib/codemirror/modes.min.js"&gt;&lt;/script&gt;
@ -35,6 +37,10 @@
&lt;script src="../lib/flowchart.min.js"&gt;&lt;/script&gt;
&lt;script src="../lib/jquery.flowchart.min.js"&gt;&lt;/script&gt;
<!-- if setting tex == true -->
&lt;link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.css" /&gt;
&lt;script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="../css/editormd.css" /&gt;
&lt;script src="../editormd.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
@ -42,14 +48,17 @@
var testEditor = editormd("test-editormd", {
width : "90%",
height : 720,
path : "../lib/",
autoLoadModules : false // Manually load modules
});
testEditor.fullscreen(); // This can be synchronized using the member method
testEditor.fullscreen(); // In Manually load mode, You can be synchronized using the member method.
});
&lt;/script&gt;
```
#### KaTeX test
$$E = mc^2$$
</textarea>
</div>
</div>
@ -59,6 +68,8 @@
<link rel="stylesheet" href="../lib/codemirror/addon/dialog/dialog.css" />
<link rel="stylesheet" href="../lib/codemirror/addon/search/matchesonscrollbar.css" />
<script src="../lib/codemirror/codemirror.min.js"></script>
<!-- Or, You can also one by one load CodeMirror modes & addons. -->
<script src="../lib/codemirror/addons.min.js"></script>
<script src="../lib/codemirror/modes.min.js"></script>
@ -74,15 +85,20 @@
<script src="../lib/flowchart.min.js"></script>
<script src="../lib/jquery.flowchart.min.js"></script>
<!-- if setting tex == true -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.js"></script>
<link rel="stylesheet" href="../css/editormd.css" />
<script src="../editormd.js"></script>
<script type="text/javascript">
$(function() {
var testEditor = editormd("test-editormd", {
width : "90%",
height : 720,
path : "../lib/",
autoLoadModules : false // Manually load modules
width : "90%",
height : 720,
path : "../lib/",
tex : true,
autoLoadModules : false // Enable manually load modules
});
testEditor.fullscreen(); // This can be synchronized using the member method

2
examples/simple.html

@ -46,7 +46,7 @@
$(function() {
testEditor = editormd("test-editormd", {
width: "90%",
height: 540,
height: 640,
path : '../lib/'
});
});

4
examples/test.md

@ -66,7 +66,9 @@ The <abbr title="Hyper Text Markup Language">HTML</abbr> specification is mainta
[anchor-id]: http://www.this-anchor-link.com/
GFM a-tail link @pandao
[mailto:test.test@gmail.com](mailto:test.test@gmail.com)
GFM a-tail link @pandao 邮箱地址自动链接 test.test@gmail.com www@vip.qq.com
> @pandao

122
examples/toolbar-auto-fixed.html

@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<title>Simple - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
</head>
<body>
<div id="layout">
<header>
<h1>工具栏自动固定定位的开启与禁用</h1>
<p>Enable / disable toolbar auto fixed position.</p>
</header>
<div class="btns">
<button id="enable-btn">Enable</button>
<button id="disable-btn">Disable</button>
</div>
<div id="test-editormd">
<textarea style="display:none;">###Hello world!
codemirror
In-browser code editor
codemirror 6291 3 days ago
angular-ui-codemirror
This directive allows you to add CodeMirror to your textarea elements.
angular-ui 174 6 weeks ago
share-codemirror
Codemirror bindings for ShareJS
share 24 3 months ago
requirejs-codemirror
Load codemirror with needed modes and appending codemirror's css only when needed
tuchk4 14 2 months ago
codemirror-interactive-numbers
Drag and update literal numbers inside codemirror
fullstackio 4 17 months ago
cm-searchbox
CodeMirror addon for search and replace
coderaiser 3 4 days ago
ng-codemirror-dictionary-hint
Angular directive that adds hint support to a Codemirror instance based on a custom dictionary.
amarnus 3 3 months ago
opentok-editor
A real time collaborative editor for OpenTok using CodeMirror and ot.js
aullman 3 2 weeks ago
cirru-mode
Cirru mode for CodeMorror
Cirru 2 12 months ago
ckeditor-codemirror
A bower wrapper for the ckeditor codemirror plugin
friedolinfoerder 1 2 weeks ago
cm-show-invisibles
Addon for CodeMirror that helps to show invisibles.
coderaiser 1 6 days ago
angular-codemirror
Add CodeMirror to your AngularJS app
chouseknecht 0 12 months ago
codemirror-chord
Codemirror mode for guitar chords
zabudipar 0 3 weeks ago
codemirror-states
Export and import CodeMirror line classes, line widgets and markers
lusever 0 12 days ago
ember-cli-codemirror-shim
ES6 module shim for CodeMirror.
IvyApp 0 3 months ago
ivy-codemirror
Shim repository for ivy-codemirror.
IvyApp 0 2 months ago
ng-codemirror
Allows you to integrate AngularJS and Codemirror with compatibility for RequireJS 2.x.
VictorQueiroz 0 4 months ago
sml-codemirror-mode
Bower Distribution of the Sparqlification Mapping Language (SML) Syntax Highlighting Mode for CodeMirror
</textarea>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="../editormd.js"></script>
<script type="text/javascript">
var testEditor;
$(function() {
testEditor = editormd("test-editormd", {
width : "90%",
height : 1800,
path : "../lib/"
});
$("#enable-btn").bind("click", function() {
testEditor.setToolbarAutoFixed(true);
// or
//testEditor.config("toolbarAutoFixed", true);
});
$("#disable-btn").bind("click", function() {
testEditor.setToolbarAutoFixed(false);
// or
//testEditor.config("toolbarAutoFixed", false);
});
});
</script>
</body>
</html>

9
languages/en.js

@ -10,6 +10,9 @@
del : "Strikethrough",
italic : "Italic",
quote : "Block quote",
ucwords : "Words first letter convert to uppercase",
uppercase : "Selection text convert to uppercase",
lowercase : "Selection text convert to lowercase",
h1 : "Heading 1",
h2 : "Heading 2",
h3 : "Heading 3",
@ -18,7 +21,7 @@
h6 : "Heading 6",
"list-ul" : "Unordered list",
"list-ol" : "Ordered list",
hr : "Horizontal line",
hr : "Horizontal rule",
link : "Link",
anchor : "Anchor",
image : "Image",
@ -31,8 +34,8 @@
htmlEntities : "HTML Entities",
watch : "Unwatch",
unwatch : "Watch",
preview : "HTML Preview (Enter ESC exit)",
fullscreen : "Fullscreen (Enter ESC exit)",
preview : "HTML Preview (Press Shift + ESC exit)",
fullscreen : "Fullscreen (Press ESC exit)",
clear : "Clear",
help : "Help",
info : "About " + exports.title

7
languages/zh-tw.js

@ -10,6 +10,9 @@
del : "刪除線",
italic : "斜體",
quote : "引用",
ucwords : "將所選的每個單詞首字母轉成大寫",
uppercase : "將所選文本轉成大寫",
lowercase : "將所選文本轉成小寫",
h1 : "標題1",
h2 : "標題2",
h3 : "標題3",
@ -31,8 +34,8 @@
htmlEntities : "HTML 實體字符",
watch : "關閉實時預覽",
unwatch : "開啟實時預覽",
preview : "全窗口預覽HTML(可按ESC還原)",
fullscreen : "全屏(可按ESC還原)",
preview : "全窗口預覽HTML(可按Shift + ESC退出)",
fullscreen : "全屏(可按ESC退出)",
clear : "清空",
help : "使用幫助",
info : "關於" + exports.title

436
lib/codemirror/AUTHORS

@ -0,0 +1,436 @@
List of CodeMirror contributors. Updated before every release.
4r2r
Aaron Brooks
Abdelouahab
Abe Fettig
Adam Ahmed
Adam King
adanlobato
Adán Lobato
Adrian Aichner
aeroson
Ahmad Amireh
Ahmad M. Zawawi
ahoward
Akeksandr Motsjonov
Alberto González Palomo
Alberto Pose
Albert Xing
Alexander Pavlov
Alexander Schepanovski
Alexander Shvets
Alexander Solovyov
Alexandre Bique
alexey-k
Alex Piggott
Aliaksei Chapyzhenka
Amsul
amuntean
Amy
Ananya Sen
anaran
AndersMad
Anders Nawroth
Anderson Mesquita
Andrea G
Andreas Reischuck
Andre von Houck
Andrey Fedorov
Andrey Klyuchnikov
Andrey Lushnikov
Andy Joslin
Andy Kimball
Andy Li
angelozerr
angelo.zerr@gmail.com
Ankit
Ankit Ahuja
Ansel Santosa
Anthony Grimes
Anton Kovalyov
areos
as3boyan
AtomicPages LLC
Atul Bhouraskar
Aurelian Oancea
Bastian Müller
Bem Jones-Bey
benbro
Beni Cherniavsky-Paskin
Benjamin DeCoste
Ben Keen
Bernhard Sirlinger
Bert Chang
Billy Moon
binny
B Krishna Chaitanya
Blaine G
blukat29
boomyjee
borawjm
Brandon Frohs
Brandon Wamboldt
Brett Zamir
Brian Grinstead
Brian Sletten
Bruce Mitchener
Chandra Sekhar Pydi
Charles Skelton
Cheah Chu Yeow
Chris Coyier
Chris Granger
Chris Houseknecht
Chris Morgan
Christian Oyarzun
Christian Petrov
Christopher Brown
ciaranj
CodeAnimal
ComFreek
Curtis Gagliardi
dagsta
daines
Dale Jung
Dan Bentley
Dan Heberden
Daniel, Dao Quang Minh
Daniele Di Sarli
Daniel Faust
Daniel Huigens
Daniel KJ
Daniel Neel
Daniel Parnell
Danny Yoo
darealshinji
Darius Roberts
Dave Myers
David Mignot
David Pathakjee
David Vázquez
deebugger
Deep Thought
Devon Carew
dignifiedquire
Dimage Sapelkin
Dmitry Kiselyov
domagoj412
Dominator008
Domizio Demichelis
Doug Wikle
Drew Bratcher
Drew Hintz
Drew Khoury
Dror BG
duralog
eborden
edsharp
ekhaled
Enam Mijbah Noor
Eric Allam
eustas
Fabien O'Carroll
Fabio Zendhi Nagao
Faiza Alsaied
Fauntleroy
fbuchinger
feizhang365
Felipe Lalanne
Felix Raab
Filip Noetzel
flack
ForbesLindesay
Forbes Lindesay
Ford_Lawnmower
Forrest Oliphant
Frank Wiegand
Gabriel Gheorghian
Gabriel Horner
Gabriel Nahmias
galambalazs
Gautam Mehta
gekkoe
Gerard Braad
Gergely Hegykozi
Giovanni Calò
Glenn Jorde
Glenn Ruehle
Golevka
Gordon Smith
Grant Skinner
greengiant
Gregory Koberger
Guillaume Massé
Guillaume Massé
Gustavo Rodrigues
Hakan Tunc
Hans Engel
Hardest
Hasan Karahan
Herculano Campos
Hiroyuki Makino
hitsthings
Hocdoc
Ian Beck
Ian Dickinson
Ian Wehrman
Ian Wetherbee
Ice White
ICHIKAWA, Yuji
ilvalle
Ingo Richter
Irakli Gozalishvili
Ivan Kurnosov
Jacob Lee
Jakob Miland
Jakub Vrana
Jakub Vrána
James Campos
James Thorne
Jamie Hill
Jan Jongboom
jankeromnes
Jan Keromnes
Jan Odvarko
Jan T. Sott
Jared Forsyth
Jason
Jason Barnabe
Jason Grout
Jason Johnston
Jason San Jose
Jason Siefken
Jaydeep Solanki
Jean Boussier
jeffkenton
Jeff Pickhardt
jem (graphite)
Jeremy Parmenter
Jochen Berger
Johan Ask
John Connor
John Lees-Miller
John Snelson
John Van Der Loo
Jonathan Malmaud
jongalloway
Jon Malmaud
Jon Sangster
Joost-Wim Boekesteijn
Joseph Pecoraro
Joshua Newman
Josh Watzman
jots
jsoojeon
Juan Benavides Romero
Jucovschi Constantin
Juho Vuori
Justin Hileman
jwallers@gmail.com
kaniga
Ken Newman
Ken Rockot
Kevin Sawicki
Kevin Ushey
Klaus Silveira
Koh Zi Han, Cliff
komakino
Konstantin Lopuhin
koops
ks-ifware
kubelsmieci
KwanEsq
Lanfei
Lanny
Laszlo Vidacs
leaf corcoran
Leonid Khachaturov
Leon Sorokin
Leonya Khachaturov
Liam Newman
LM
lochel
Lorenzo Stoakes
Luciano Longo
Luke Stagner
lynschinzer
Maksim Lin
Maksym Taran
Malay Majithia
Manuel Rego Casasnovas
Marat Dreizin
Marcel Gerber
Marco Aurélio
Marco Munizaga
Marcus Bointon
Marek Rudnicki
Marijn Haverbeke
Mário Gonçalves
Mario Pietsch
Mark Lentczner
Marko Bonaci
Martin Balek
Martín Gaitán
Martin Hasoň
Mason Malone
Mateusz Paprocki
Mathias Bynens
mats cronqvist
Matthew Beale
Matthias Bussonnier
Matthias BUSSONNIER
Matt McDonald
Matt Pass
Matt Sacks
mauricio
Maximilian Hils
Maxim Kraev
Max Kirsch
Max Xiantu
mbarkhau
Metatheos
Micah Dubinko
Michael Lehenbauer
Michael Zhou
Mighty Guava
Miguel Castillo
mihailik
Mike
Mike Brevoort
Mike Diaz
Mike Ivanov
Mike Kadin
MinRK
Miraculix87
misfo
mloginov
Moritz Schwörer
mps
mtaran-google
Narciso Jaramillo
Nathan Williams
ndr
nerbert
nextrevision
ngn
nguillaumin
Ng Zhi An
Nicholas Bollweg
Nicholas Bollweg (Nick)
Nick Small
Niels van Groningen
nightwing
Nikita Beloglazov
Nikita Vasilyev
Nikolay Kostov
nilp0inter
Nisarg Jhaveri
nlwillia
Norman Rzepka
pablo
Page
Panupong Pasupat
paris
Patil Arpith
Patrick Stoica
Patrick Strawderman
Paul Garvin
Paul Ivanov
Pavel Feldman
Pavel Strashkin
Paweł Bartkiewicz
peteguhl
Peter Flynn
peterkroon
Peter Kroon
prasanthj
Prasanth J
Radek Piórkowski
Rahul
Randall Mason
Randy Burden
Randy Edmunds
Rasmus Erik Voel Jensen
Ray Ratchup
Richard van der Meer
Richard Z.H. Wang
Robert Crossfield
Roberto Abdelkader Martínez Pérez
robertop23
Robert Plummer
Ruslan Osmanov
Ryan Prior
sabaca
Samuel Ainsworth
sandeepshetty
Sander AKA Redsandro
santec
Sascha Peilicke
satchmorun
sathyamoorthi
SCLINIC\jdecker
Scott Aikin
Scott Goodhew
Sebastian Zaha
shaund
shaun gilchrist
Shawn A
sheopory
Shiv Deepak
Shmuel Englard
Shubham Jain
silverwind
snasa
soliton4
sonson
spastorelli
srajanpaliwal
Stanislav Oaserele
Stas Kobzar
Stefan Borsje
Steffen Beyer
Steve O'Hara
stoskov
Taha Jahangir
Takuji Shimokawa
Tarmil
tel
tfjgeorge
Thaddee Tyl
TheHowl
think
Thomas Dvornik
Thomas Schmid
Tim Alby
Tim Baumann
Timothy Farrell
Timothy Hatcher
TobiasBg
Tomas-A
Tomas Varaneckas
Tom Erik Støwer
Tom MacWright
Tony Jian
Travis Heppe
Triangle717
twifkak
Vestimir Markov
vf
Vincent Woo
Volker Mische
wenli
Wesley Wiser
Will Binns-Smith
William Jamieson
William Stein
Willy
Wojtek Ptak
Xavier Mendez
Yassin N. Hassan
YNH Webdev
Yunchi Luo
Yuvi Panda
Zachary Dremann
Zhang Hao
zziuni
魏鹏刚

19
lib/codemirror/LICENSE

@ -0,0 +1,19 @@
Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

12
lib/codemirror/README.md

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

10
lib/codemirror/addon/edit/closebrackets.js

@ -10,6 +10,7 @@
mod(CodeMirror);
})(function(CodeMirror) {
var DEFAULT_BRACKETS = "()[]{}''\"\"";
var DEFAULT_TRIPLES = "'\"";
var DEFAULT_EXPLODE_ON_ENTER = "[]{}";
var SPACE_CHAR_REGEX = /\s/;
@ -19,13 +20,14 @@
if (old != CodeMirror.Init && old)
cm.removeKeyMap("autoCloseBrackets");
if (!val) return;
var pairs = DEFAULT_BRACKETS, explode = DEFAULT_EXPLODE_ON_ENTER;
var pairs = DEFAULT_BRACKETS, triples = DEFAULT_TRIPLES, explode = DEFAULT_EXPLODE_ON_ENTER;
if (typeof val == "string") pairs = val;
else if (typeof val == "object") {
if (val.pairs != null) pairs = val.pairs;
if (val.triples != null) triples = val.triples;
if (val.explode != null) explode = val.explode;
}
var map = buildKeymap(pairs);
var map = buildKeymap(pairs, triples);
if (explode) map.Enter = buildExplodeHandler(explode);
cm.addKeyMap(map);
});
@ -52,7 +54,7 @@
}
}
function buildKeymap(pairs) {
function buildKeymap(pairs, triples) {
var map = {
name : "autoCloseBrackets",
Backspace: function(cm) {
@ -85,7 +87,7 @@
curType = "skipThree";
else
curType = "skip";
} else if (left == right && cur.ch > 1 &&
} else if (left == right && cur.ch > 1 && triples.indexOf(left) >= 0 &&
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == left + left &&
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left)) {
curType = "addFour";

2
lib/codemirror/addon/edit/closetag.js

@ -131,7 +131,7 @@
function autoCloseSlash(cm) {
if (cm.getOption("disableInput")) return CodeMirror.Pass;
autoCloseCurrent(cm, true);
return autoCloseCurrent(cm, true);
}
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };

2
lib/codemirror/addon/edit/matchbrackets.js

@ -81,7 +81,7 @@
if (marks.length) {
// Kludge to work around the IE bug from issue #1193, where text
// input stops going to the textare whever this fires.
if (ie_lt8 && cm.state.focused) cm.display.input.focus();
if (ie_lt8 && cm.state.focused) cm.focus();
var clear = function() {
cm.operation(function() {

16
lib/codemirror/addon/fold/foldgutter.js

@ -94,20 +94,26 @@
}
function onGutterClick(cm, line, gutter) {
var opts = cm.state.foldGutter.options;
var state = cm.state.foldGutter;
if (!state) return;
var opts = state.options;
if (gutter != opts.gutter) return;
cm.foldCode(Pos(line, 0), opts.rangeFinder);
}
function onChange(cm) {
var state = cm.state.foldGutter, opts = cm.state.foldGutter.options;
var state = cm.state.foldGutter;
if (!state) return;
var opts = state.options;
state.from = state.to = 0;
clearTimeout(state.changeUpdate);
state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600);
}
function onViewportChange(cm) {
var state = cm.state.foldGutter, opts = cm.state.foldGutter.options;
var state = cm.state.foldGutter;
if (!state) return;
var opts = state.options;
clearTimeout(state.changeUpdate);
state.changeUpdate = setTimeout(function() {
var vp = cm.getViewport();
@ -129,7 +135,9 @@
}
function onFold(cm, from) {
var state = cm.state.foldGutter, line = from.line;
var state = cm.state.foldGutter;
if (!state) return;
var line = from.line;
if (line >= state.from && line < state.to)
updateFoldInfo(cm, line, line + 1);
}

23
lib/codemirror/addon/hint/show-hint.js

@ -24,6 +24,18 @@
return cm.showHint(newOpts);
};
var asyncRunID = 0;
function retrieveHints(getter, cm, options, then) {
if (getter.async) {
var id = ++asyncRunID;
getter(cm, function(hints) {
if (asyncRunID == id) then(hints);
}, options);
} else {
then(getter(cm, options));
}
}
CodeMirror.defineExtension("showHint", function(options) {
// We want a single cursor position.
if (this.listSelections().length > 1 || this.somethingSelected()) return;
@ -34,10 +46,7 @@
if (!getHints) return;
CodeMirror.signal(this, "startCompletion", this);
if (getHints.async)
getHints(this, function(hints) { completion.showHints(hints); }, completion.options);
else
return completion.showHints(getHints(this, completion.options));
return retrieveHints(getHints, this, completion.options, function(hints) { completion.showHints(hints); });
});
function Completion(cm, options) {
@ -102,11 +111,7 @@
function update() {
if (finished) return;
CodeMirror.signal(data, "update");
var getHints = completion.options.hint;
if (getHints.async)
getHints(completion.cm, finishUpdate, completion.options);
else
finishUpdate(getHints(completion.cm, completion.options));
retrieveHints(completion.options.hint, completion.cm, completion.options, finishUpdate);
}
function finishUpdate(data_) {
data = data_;

145
lib/codemirror/addon/hint/sql-hint.js

@ -26,9 +26,26 @@
return CodeMirror.resolveMode(mode).keywords;
}
function getText(item) {
return typeof item == "string" ? item : item.text;
}
function getItem(list, item) {
if (!list.slice) return list[item];
for (var i = list.length - 1; i >= 0; i--) if (getText(list[i]) == item)
return list[i];
}
function shallowClone(object) {
var result = {};
for (var key in object) if (object.hasOwnProperty(key))
result[key] = object[key];
return result;
}
function match(string, word) {
var len = string.length;
var sub = word.substr(0, len);
var sub = getText(word).substr(0, len);
return string.toUpperCase() === sub.toUpperCase();
}
@ -44,53 +61,81 @@
}
}
function cleanName(name) {
// Get rid name from backticks(`) and preceding dot(.)
if (name.charAt(0) == ".") {
name = name.substr(1);
}
return name.replace(/`/g, "");
}
function insertBackticks(name) {
var nameParts = getText(name).split(".");
for (var i = 0; i < nameParts.length; i++)
nameParts[i] = "`" + nameParts[i] + "`";
var escaped = nameParts.join(".");
if (typeof name == "string") return escaped;
name = shallowClone(name);
name.text = escaped;
return name;
}
function nameCompletion(cur, token, result, editor) {
var useBacktick = (token.string.charAt(0) == "`");
var string = token.string.substr(1);
var prevToken = editor.getTokenAt(Pos(cur.line, token.start));
if (token.string.charAt(0) == "." || prevToken.string == "."){
//Suggest colunm names
if (prevToken.string == ".") {
var prevToken = editor.getTokenAt(Pos(cur.line, token.start - 1));
}
var table = prevToken.string;
//Check if backtick is used in table name. If yes, use it for columns too.
var useBacktickTable = false;
if (table.match(/`/g)) {
useBacktickTable = true;
table = table.replace(/`/g, "");
}
//Check if table is available. If not, find table by Alias
if (!tables.hasOwnProperty(table))
table = findTableByAlias(table, editor);
var columns = tables[table];
if (!columns) return;
if (useBacktick) {
addMatches(result, string, columns, function(w) {return "`" + w + "`";});
}
else if(useBacktickTable) {
addMatches(result, string, columns, function(w) {return ".`" + w + "`";});
}
else {
addMatches(result, string, columns, function(w) {return "." + w;});
// Try to complete table, colunm names and return start position of completion
var useBacktick = false;
var nameParts = [];
var start = token.start;
var cont = true;
while (cont) {
cont = (token.string.charAt(0) == ".");
useBacktick = useBacktick || (token.string.charAt(0) == "`");
start = token.start;
nameParts.unshift(cleanName(token.string));
token = editor.getTokenAt(Pos(cur.line, token.start));
if (token.string == ".") {
cont = true;
token = editor.getTokenAt(Pos(cur.line, token.start));
}
}
else {
//Suggest table names or colums in defaultTable
while (token.start && string.charAt(0) == ".") {
token = editor.getTokenAt(Pos(cur.line, token.start - 1));
string = token.string + string;
}
if (useBacktick) {
addMatches(result, string, tables, function(w) {return "`" + w + "`";});
addMatches(result, string, defaultTable, function(w) {return "`" + w + "`";});
}
else {
addMatches(result, string, tables, function(w) {return w;});
addMatches(result, string, defaultTable, function(w) {return w;});
}
// Try to complete table names
var string = nameParts.join(".");
addMatches(result, string, tables, function(w) {
return useBacktick ? insertBackticks(w) : w;
});
// Try to complete columns from defaultTable
addMatches(result, string, defaultTable, function(w) {
return useBacktick ? insertBackticks(w) : w;
});
// Try to complete columns
string = nameParts.pop();
var table = nameParts.join(".");
// Check if table is available. If not, find table by Alias
if (!getItem(tables, table))
table = findTableByAlias(table, editor);
var columns = getItem(tables, table);
if (columns && Array.isArray(tables) && columns.columns)
columns = columns.columns;
if (columns) {
addMatches(result, string, columns, function(w) {
if (typeof w == "string") {
w = table + "." + w;
} else {
w = shallowClone(w);
w.text = table + "." + w.text;
}
return useBacktick ? insertBackticks(w) : w;
});
}
return start;
}
function eachWord(lineText, f) {
@ -150,12 +195,10 @@
var lineText = query[i];
eachWord(lineText, function(word) {
var wordUpperCase = word.toUpperCase();
if (wordUpperCase === aliasUpperCase && tables.hasOwnProperty(previousWord)) {
table = previousWord;
}
if (wordUpperCase !== CONS.ALIAS_KEYWORD) {
if (wordUpperCase === aliasUpperCase && getItem(tables, previousWord))
table = previousWord;
if (wordUpperCase !== CONS.ALIAS_KEYWORD)
previousWord = word;
}
});
if (table) break;
}
@ -165,7 +208,7 @@
CodeMirror.registerHelper("hint", "sql", function(editor, options) {
tables = (options && options.tables) || {};
var defaultTableName = options && options.defaultTable;
defaultTable = (defaultTableName && tables[defaultTableName] || []);
defaultTable = (defaultTableName && getItem(tables, defaultTableName)) || [];
keywords = keywords || getKeywords(editor);
var cur = editor.getCursor();
@ -185,7 +228,7 @@
search = "";
}
if (search.charAt(0) == "." || search.charAt(0) == "`") {
nameCompletion(cur, token, result, editor);
start = nameCompletion(cur, token, result, editor);
} else {
addMatches(result, search, tables, function(w) {return w;});
addMatches(result, search, defaultTable, function(w) {return w;});

3
lib/codemirror/addon/lint/lint.js

@ -46,6 +46,7 @@
}
var poll = setInterval(function() {
if (tooltip) for (var n = node;; n = n.parentNode) {
if (n && n.nodeType == 11) n = n.host;
if (n == document.body) return;
if (!n) { hide(); break; }
}
@ -119,7 +120,7 @@
function startLinting(cm) {
var state = cm.state.lint, options = state.options;
var passOptions = options.options || options; // Support deprecated passing of `options` property in options
if (options.async)
if (options.async || options.getAnnotations.async)
options.getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
else
updateLinting(cm, options.getAnnotations(cm.getValue(), passOptions, cm));

334
lib/codemirror/addon/merge/merge.js

@ -31,8 +31,6 @@
insert: "CodeMirror-merge-r-inserted",
del: "CodeMirror-merge-r-deleted",
connect: "CodeMirror-merge-r-connect"};
if (mv.options.connect == "align")
this.aligners = [];
}
DiffView.prototype = {
@ -42,7 +40,8 @@
this.orig = CodeMirror(pane, copyObj({value: orig, readOnly: !this.mv.options.allowEditingOriginals}, copyObj(options)));
this.diff = getDiff(asString(orig), asString(options.value));
this.diffOutOfDate = false;
this.chunks = getChunks(this.diff);
this.diffOutOfDate = this.dealigned = false;
this.showDifferences = options.showDifferences !== false;
this.forceUpdate = registerUpdate(this);
@ -61,16 +60,20 @@
function ensureDiff(dv) {
if (dv.diffOutOfDate) {
dv.diff = getDiff(dv.orig.getValue(), dv.edit.getValue());
dv.chunks = getChunks(dv.diff);
dv.diffOutOfDate = false;
CodeMirror.signal(dv.edit, "updateDiff", dv.diff);
}
}
var updating = false;
function registerUpdate(dv) {
var edit = {from: 0, to: 0, marked: []};
var orig = {from: 0, to: 0, marked: []};
var debounceChange;
var debounceChange, updatingFast = false;
function update(mode) {
updating = true;
updatingFast = false;
if (mode == "full") {
if (dv.svg) clear(dv.svg);
if (dv.copyButtons) clear(dv.copyButtons);
@ -84,26 +87,38 @@
updateMarks(dv.orig, dv.diff, orig, DIFF_DELETE, dv.classes);
}
makeConnections(dv);
if (dv.mv.options.connect == "align")
alignChunks(dv);
updating = false;
}
function set(slow) {
function setDealign(fast) {
if (updating) return;
dv.dealigned = true;
set(fast);
}
function set(fast) {
if (updating || updatingFast) return;
clearTimeout(debounceChange);
debounceChange = setTimeout(update, slow == true ? 250 : 100);
if (fast === true) updatingFast = true;
debounceChange = setTimeout(update, fast === true ? 20 : 250);
}
function change() {
function change(_cm, change) {
if (!dv.diffOutOfDate) {
dv.diffOutOfDate = true;
edit.from = edit.to = orig.from = orig.to = 0;
}
set(true);
// Update faster when a line was added/removed
setDealign(change.text.length - 1 != change.to.line - change.from.line);
}
dv.edit.on("change", change);
dv.orig.on("change", change);
dv.edit.on("markerAdded", set);
dv.edit.on("markerCleared", set);
dv.orig.on("markerAdded", set);
dv.orig.on("markerCleared", set);
dv.edit.on("viewportChange", set);
dv.orig.on("viewportChange", set);
dv.edit.on("markerAdded", setDealign);
dv.edit.on("markerCleared", setDealign);
dv.orig.on("markerAdded", setDealign);
dv.orig.on("markerCleared", setDealign);
dv.edit.on("viewportChange", function() { set(false); });
dv.orig.on("viewportChange", function() { set(false); });
update();
return update;
}
@ -134,7 +149,7 @@
} else {
var halfScreen = .5 * sInfo.clientHeight, midY = sInfo.top + halfScreen;
var mid = editor.lineAtHeight(midY, "local");
var around = chunkBoundariesAround(dv.diff, mid, type == DIFF_INSERT);
var around = chunkBoundariesAround(dv.chunks, mid, type == DIFF_INSERT);
var off = getOffsets(editor, type == DIFF_INSERT ? around.edit : around.orig);
var offOther = getOffsets(other, type == DIFF_INSERT ? around.orig : around.edit);
var ratio = (midY - off.top) / (off.bot - off.top);
@ -259,19 +274,6 @@
function makeConnections(dv) {
if (!dv.showDifferences) return;
var align = dv.mv.options.connect == "align", oldScrollEdit, oldScrollOrig;
if (align) {
if (!dv.orig.curOp) return dv.orig.operation(function() {
makeConnections(dv);
});
oldScrollEdit = dv.edit.getScrollInfo().top;
oldScrollOrig = dv.orig.getScrollInfo().top;
for (var i = 0; i < dv.aligners.length; i++)
dv.aligners[i].clear();
dv.aligners.length = 0;
var extraSpaceAbove = {edit: 0, orig: 0};
}
if (dv.svg) {
clear(dv.svg);
var w = dv.gap.offsetWidth;
@ -281,34 +283,118 @@
var vpEdit = dv.edit.getViewport(), vpOrig = dv.orig.getViewport();
var sTopEdit = dv.edit.getScrollInfo().top, sTopOrig = dv.orig.getScrollInfo().top;
iterateChunks(dv.diff, function(topOrig, botOrig, topEdit, botEdit) {
if (topEdit <= vpEdit.to && botEdit >= vpEdit.from &&
topOrig <= vpOrig.to && botOrig >= vpOrig.from)
drawConnectorsForChunk(dv, topOrig, botOrig, topEdit, botEdit, sTopOrig, sTopEdit, w);
if (align && (topEdit <= vpEdit.to || topOrig <= vpOrig.to)) {
var above = (botEdit < vpEdit.from && botOrig < vpOrig.from);
alignChunks(dv, topOrig, botOrig, topEdit, botEdit, above && extraSpaceAbove);
for (var i = 0; i < dv.chunks.length; i++) {
var ch = dv.chunks[i];
if (ch.editFrom <= vpEdit.to && ch.editTo >= vpEdit.from &&
ch.origFrom <= vpOrig.to && ch.origTo >= vpOrig.from)
drawConnectorsForChunk(dv, ch, sTopOrig, sTopEdit, w);
}
}
function getMatchingOrigLine(editLine, chunks) {
var editStart = 0, origStart = 0;
for (var i = 0; i < chunks.length; i++) {
var chunk = chunks[i];
if (chunk.editTo > editLine && chunk.editFrom <= editLine) return null;
if (chunk.editFrom > editLine) break;
editStart = chunk.editTo;
origStart = chunk.origTo;
}
return origStart + (editLine - editStart);
}
function findAlignedLines(dv, other) {
var linesToAlign = [];
for (var i = 0; i < dv.chunks.length; i++) {
var chunk = dv.chunks[i];
linesToAlign.push([chunk.origTo, chunk.editTo, other ? getMatchingOrigLine(chunk.editTo, other.chunks) : null]);
}
if (other) {
for (var i = 0; i < other.chunks.length; i++) {
var chunk = other.chunks[i];
for (var j = 0; j < linesToAlign.length; j++) {
var align = linesToAlign[j];
if (align[1] == chunk.editTo) {
j = -1;
break;
} else if (align[1] > chunk.editTo) {
break;
}
}
if (j > -1)
linesToAlign.splice(j - 1, 0, [getMatchingOrigLine(chunk.editTo, dv.chunks), chunk.editTo, chunk.origTo]);
}
}
return linesToAlign;
}
function alignChunks(dv, force) {
if (!dv.dealigned && !force) return;
if (!dv.orig.curOp) return dv.orig.operation(function() {
alignChunks(dv, force);
});
if (align) {
if (extraSpaceAbove.edit)
dv.aligners.push(padBelow(dv.edit, 0, extraSpaceAbove.edit));
if (extraSpaceAbove.orig)
dv.aligners.push(padBelow(dv.orig, 0, extraSpaceAbove.orig));
dv.edit.scrollTo(null, oldScrollEdit);
dv.orig.scrollTo(null, oldScrollOrig);
dv.dealigned = false;
var other = dv.mv.left == dv ? dv.mv.right : dv.mv.left;
if (other) {
ensureDiff(other);
other.dealigned = false;
}
var linesToAlign = findAlignedLines(dv, other);
// Clear old aligners
var aligners = dv.mv.aligners;
for (var i = 0; i < aligners.length; i++)
aligners[i].clear();
aligners.length = 0;
var cm = [dv.orig, dv.edit], scroll = [];
if (other) cm.push(other.orig);
for (var i = 0; i < cm.length; i++)
scroll.push(cm[i].getScrollInfo().top);
for (var ln = 0; ln < linesToAlign.length; ln++)
alignLines(cm, linesToAlign[ln], aligners);
for (var i = 0; i < cm.length; i++)
cm[i].scrollTo(null, scroll[i]);
}
function drawConnectorsForChunk(dv, topOrig, botOrig, topEdit, botEdit, sTopOrig, sTopEdit, w) {
function alignLines(cm, lines, aligners) {
var maxOffset = 0, offset = [];
for (var i = 0; i < cm.length; i++) if (lines[i] != null) {
var off = cm[i].heightAtLine(lines[i], "local");
offset[i] = off;
maxOffset = Math.max(maxOffset, off);
}
for (var i = 0; i < cm.length; i++) if (lines[i] != null) {
var diff = maxOffset - offset[i];
if (diff > 1)
aligners.push(padAbove(cm[i], lines[i], diff));
}
}
function padAbove(cm, line, size) {
var above = true;
if (line > cm.lastLine()) {
line--;
above = false;
}
var elt = document.createElement("div");
elt.className = "CodeMirror-merge-spacer";
elt.style.height = size + "px"; elt.style.minWidth = "1px";
return cm.addLineWidget(line, elt, {height: size, above: above});
}
function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w) {
var flip = dv.type == "left";
var top = dv.orig.heightAtLine(topOrig, "local") - sTopOrig;
var top = dv.orig.heightAtLine(chunk.origFrom, "local") - sTopOrig;
if (dv.svg) {
var topLpx = top;
var topRpx = dv.edit.heightAtLine(topEdit, "local") - sTopEdit;
var topRpx = dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit;
if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; }
var botLpx = dv.orig.heightAtLine(botOrig, "local") - sTopOrig;
var botRpx = dv.edit.heightAtLine(botEdit, "local") - sTopEdit;
var botLpx = dv.orig.heightAtLine(chunk.origTo, "local") - sTopOrig;
var botRpx = dv.edit.heightAtLine(chunk.editTo, "local") - sTopEdit;
if (flip) { var tmp = botLpx; botLpx = botRpx; botRpx = tmp; }
var curveTop = " C " + w/2 + " " + topRpx + " " + w/2 + " " + topLpx + " " + (w + 2) + " " + topLpx;
var curveBot = " C " + w/2 + " " + botLpx + " " + w/2 + " " + botRpx + " -1 " + botRpx;
@ -321,48 +407,26 @@
"CodeMirror-merge-copy"));
var editOriginals = dv.mv.options.allowEditingOriginals;
copy.title = editOriginals ? "Push to left" : "Revert chunk";
copy.chunk = {topEdit: topEdit, botEdit: botEdit, topOrig: topOrig, botOrig: botOrig};
copy.chunk = chunk;
copy.style.top = top + "px";
if (editOriginals) {
var topReverse = dv.orig.heightAtLine(topEdit, "local") - sTopEdit;
var topReverse = dv.orig.heightAtLine(chunk.editFrom, "local") - sTopEdit;
var copyReverse = dv.copyButtons.appendChild(elt("div", dv.type == "right" ? "\u21dd" : "\u21dc",
"CodeMirror-merge-copy-reverse"));
copyReverse.title = "Push to right";
copyReverse.chunk = {topEdit: topOrig, botEdit: botOrig, topOrig: topEdit, botOrig: botEdit};
copyReverse.chunk = {editFrom: chunk.origFrom, editTo: chunk.origTo,
origFrom: chunk.editFrom, origTo: chunk.editTo};
copyReverse.style.top = topReverse + "px";
dv.type == "right" ? copyReverse.style.left = "2px" : copyReverse.style.right = "2px";
}
}
}
function alignChunks(dv, topOrig, botOrig, topEdit, botEdit, aboveViewport) {
var topOrigPx = dv.orig.heightAtLine(topOrig, "local");
var botOrigPx = dv.orig.heightAtLine(botOrig, "local");
var topEditPx = dv.edit.heightAtLine(topEdit, "local");
var botEditPx = dv.edit.heightAtLine(botEdit, "local");
var origH = botOrigPx -topOrigPx, editH = botEditPx - topEditPx;
var diff = editH - origH;
if (diff > 1) {
if (aboveViewport) aboveViewport.orig += diff;
else dv.aligners.push(padBelow(dv.orig, botOrig - 1, diff));
} else if (diff < -1) {
if (aboveViewport) aboveViewport.edit -= diff;
else dv.aligners.push(padBelow(dv.edit, botEdit - 1, -diff));
}
return 0;
}
function padBelow(cm, line, size) {
var elt = document.createElement("div");
elt.style.height = size + "px"; elt.style.minWidth = "1px";
return cm.addLineWidget(line, elt, {height: size});
}
function copyChunk(dv, to, from, chunk) {
if (dv.diffOutOfDate) return;
to.replaceRange(from.getRange(Pos(chunk.topOrig, 0), Pos(chunk.botOrig, 0)),
Pos(chunk.topEdit, 0), Pos(chunk.botEdit, 0));
to.replaceRange(from.getRange(Pos(chunk.origFrom, 0), Pos(chunk.origTo, 0)),
Pos(chunk.editFrom, 0), Pos(chunk.editTo, 0));
}
// Merge view, containing 0, 1, or 2 diff views.
@ -372,16 +436,11 @@
this.options = options;
var origLeft = options.origLeft, origRight = options.origRight == null ? options.orig : options.origRight;
if (origLeft && origRight) {
if (options.connect == "align")
throw new Error("connect: \"align\" is not supported for three-way merge views");
if (options.collapseIdentical)
throw new Error("collapseIdentical option is not supported for three-way merge views");
}
var hasLeft = origLeft != null, hasRight = origRight != null;
var panes = 1 + (hasLeft ? 1 : 0) + (hasRight ? 1 : 0);
var wrap = [], left = this.left = null, right = this.right = null;
var self = this;
if (hasLeft) {
left = this.left = new DiffView(this, "left");
@ -410,8 +469,17 @@
if (left) left.init(leftPane, origLeft, options);
if (right) right.init(rightPane, origRight, options);
if (options.collapseIdentical)
collapseIdenticalStretches(left || right, options.collapseIdentical);
if (options.collapseIdentical) {
updating = true;
this.editor().operation(function() {
collapseIdenticalStretches(self, options.collapseIdentical);
});
updating = false;
}
if (options.connect == "align") {
this.aligners = [];
alignChunks(this.left || this.right, true);
}
var onResize = function() {
if (left) makeConnections(left);
@ -463,10 +531,10 @@
if (this.left) this.left.setShowDifferences(val);
},
rightChunks: function() {
return this.right && getChunks(this.right);
if (this.right) { ensureDiff(this.right); return this.right.chunks; }
},
leftChunks: function() {
return this.left && getChunks(this.left);
if (this.left) { ensureDiff(this.left); return this.left.chunks; }
}
};
@ -494,7 +562,8 @@
return diff;
}
function iterateChunks(diff, f) {
function getChunks(diff) {
var chunks = [];
var startEdit = 0, startOrig = 0;
var edit = Pos(0, 0), orig = Pos(0, 0);
for (var i = 0; i < diff.length; ++i) {
@ -506,7 +575,8 @@
var endOff = endOfLineClean(diff, i) ? 1 : 0;
var cleanToEdit = edit.line + endOff, cleanToOrig = orig.line + endOff;
if (cleanToEdit > cleanFromEdit) {
if (i) f(startOrig, cleanFromOrig, startEdit, cleanFromEdit);
if (i) chunks.push({origFrom: startOrig, origTo: cleanFromOrig,
editFrom: startEdit, editTo: cleanFromEdit});
startEdit = cleanToEdit; startOrig = cleanToOrig;
}
} else {
@ -514,17 +584,9 @@
}
}
if (startEdit <= edit.line || startOrig <= orig.line)
f(startOrig, orig.line + 1, startEdit, edit.line + 1);
}
function getChunks(dv) {
ensureDiff(dv);
var collect = [];
iterateChunks(dv.diff, function(topOrig, botOrig, topEdit, botEdit) {
collect.push({origFrom: topOrig, origTo: botOrig,
editFrom: topEdit, editTo: botEdit});
});
return collect;
chunks.push({origFrom: startOrig, origTo: orig.line + 1,
editFrom: startEdit, editTo: edit.line + 1});
return chunks;
}
function endOfLineClean(diff, i) {
@ -545,18 +607,19 @@
return last.charCodeAt(last.length - 1) == 10;
}
function chunkBoundariesAround(diff, n, nInEdit) {
function chunkBoundariesAround(chunks, n, nInEdit) {
var beforeE, afterE, beforeO, afterO;
iterateChunks(diff, function(fromOrig, toOrig, fromEdit, toEdit) {
var fromLocal = nInEdit ? fromEdit : fromOrig;
var toLocal = nInEdit ? toEdit : toOrig;
for (var i = 0; i < chunks.length; i++) {
var chunk = chunks[i];
var fromLocal = nInEdit ? chunk.editFrom : chunk.origFrom;
var toLocal = nInEdit ? chunk.editTo : chunk.origTo;
if (afterE == null) {
if (fromLocal > n) { afterE = fromEdit; afterO = fromOrig; }
else if (toLocal > n) { afterE = toEdit; afterO = toOrig; }
if (fromLocal > n) { afterE = chunk.editFrom; afterO = chunk.origFrom; }
else if (toLocal > n) { afterE = chunk.editTo; afterO = chunk.origTo; }
}
if (toLocal <= n) { beforeE = toEdit; beforeO = toOrig; }
else if (fromLocal <= n) { beforeE = fromEdit; beforeO = fromOrig; }
});
if (toLocal <= n) { beforeE = chunk.editTo; beforeO = chunk.origTo; }
else if (fromLocal <= n) { beforeE = chunk.editFrom; beforeO = chunk.origFrom; }
}
return {edit: {before: beforeE, after: afterE}, orig: {before: beforeO, after: afterO}};
}
@ -579,25 +642,50 @@
return {mark: mark, clear: clear};
}
function collapseStretch(dv, origStart, editStart, size) {
var mOrig = collapseSingle(dv.orig, origStart, origStart + size);
var mEdit = collapseSingle(dv.edit, editStart, editStart + size);
mOrig.mark.on("clear", function() { mEdit.clear(); });
mEdit.mark.on("clear", function() { mOrig.clear(); });
function collapseStretch(size, editors) {
var marks = [];
function clear() {
for (var i = 0; i < marks.length; i++) marks[i].clear();
}
for (var i = 0; i < editors.length; i++) {
var editor = editors[i];
var mark = collapseSingle(editor.cm, editor.line, editor.line + size);
marks.push(mark);
mark.mark.on("clear", clear);
}
return marks[0].mark;
}
function unclearNearChunks(dv, margin, off, clear) {
for (var i = 0; i < dv.chunks.length; i++) {
var chunk = dv.chunks[i];
for (var l = chunk.editFrom - margin; l < chunk.editTo + margin; l++) {
var pos = l + off;
if (pos >= 0 && pos < clear.length) clear[pos] = false;
}
}
}
function collapseIdenticalStretches(dv, margin) {
function collapseIdenticalStretches(mv, margin) {
if (typeof margin != "number") margin = 2;
var lastOrig = dv.orig.firstLine(), lastEdit = dv.edit.firstLine();
iterateChunks(dv.diff, function(topOrig, botOrig, _topEdit, botEdit) {
var identicalSize = topOrig - margin - lastOrig;
if (identicalSize > margin)
collapseStretch(dv, lastOrig, lastEdit, identicalSize);
lastOrig = botOrig + margin; lastEdit = botEdit + margin;
});
var bottomSize = dv.orig.lastLine() + 1 - lastOrig;
if (bottomSize > margin)
collapseStretch(dv, lastOrig, lastEdit, bottomSize);
var clear = [], edit = mv.editor(), off = edit.firstLine();
for (var l = off, e = edit.lastLine(); l <= e; l++) clear.push(true);
if (mv.left) unclearNearChunks(mv.left, margin, off, clear);
if (mv.right) unclearNearChunks(mv.right, margin, off, clear);
for (var i = 0; i < clear.length; i++) {
if (clear[i]) {
var line = i + off;
for (var size = 1; i < clear.length - 1 && clear[i + 1]; i++, size++) {}
if (size > margin) {
var editors = [{line: line, cm: edit}];
if (mv.left) editors.push({line: getMatchingOrigLine(line, mv.left.chunks), cm: mv.left.orig});
if (mv.right) editors.push({line: getMatchingOrigLine(line, mv.right.chunks), cm: mv.right.orig});
var mark = collapseStretch(size, editors);
if (mv.options.onCollapse) mv.options.onCollapse(mv, line, size, mark);
}
}
}
}
// General utilities

48
lib/codemirror/addon/scroll/annotatescrollbar.js

@ -11,27 +11,46 @@
})(function(CodeMirror) {
"use strict";
CodeMirror.defineExtension("annotateScrollbar", function(className) {
return new Annotation(this, className);
CodeMirror.defineExtension("annotateScrollbar", function(options) {
if (typeof options == "string") options = {className: options};
return new Annotation(this, options);
});
function Annotation(cm, className) {
CodeMirror.defineOption("scrollButtonHeight", 0);
function Annotation(cm, options) {
this.cm = cm;
this.className = className;
this.options = options;
this.buttonHeight = options.scrollButtonHeight || cm.getOption("scrollButtonHeight");
this.annotations = [];
this.doRedraw = this.doUpdate = null;
this.div = cm.getWrapperElement().appendChild(document.createElement("div"));
this.div.style.cssText = "position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none";
this.computeScale();
function scheduleRedraw(delay) {
clearTimeout(self.doRedraw);
self.doRedraw = setTimeout(function() { self.redraw(); }, delay);
}
var self = this;
cm.on("refresh", this.resizeHandler = function(){
if (self.computeScale()) self.redraw();
cm.on("refresh", this.resizeHandler = function() {
clearTimeout(self.doUpdate);
self.doUpdate = setTimeout(function() {
if (self.computeScale()) scheduleRedraw(20);
}, 100);
});
cm.on("markerAdded", this.resizeHandler);
cm.on("markerCleared", this.resizeHandler);
if (options.listenForChanges !== false)
cm.on("change", this.changeHandler = function() {
scheduleRedraw(250);
});
}
Annotation.prototype.computeScale = function() {
var cm = this.cm;
var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight) /
var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight - this.buttonHeight * 2) /
cm.heightAtLine(cm.lastLine() + 1, "local");
if (hScale != this.hScale) {
this.hScale = hScale;
@ -44,12 +63,12 @@
this.redraw();
};
Annotation.prototype.redraw = function() {
Annotation.prototype.redraw = function(compute) {
if (compute !== false) this.computeScale();
var cm = this.cm, hScale = this.hScale;
if (!cm.display.barWidth) return;
var frag = document.createDocumentFragment(), anns = this.annotations;
for (var i = 0, nextTop; i < anns.length; i++) {
if (cm.display.barWidth) for (var i = 0, nextTop; i < anns.length; i++) {
var ann = anns[i];
var top = nextTop || cm.charCoords(ann.from, "local").top * hScale;
var bottom = cm.charCoords(ann.to, "local").bottom * hScale;
@ -59,11 +78,13 @@
ann = anns[++i];
bottom = cm.charCoords(ann.to, "local").bottom * hScale;
}
if (bottom == top) continue;
var height = Math.max(bottom - top, 3);
var elt = frag.appendChild(document.createElement("div"));
elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: " + top + "px; height: " + height + "px";
elt.className = this.className;
elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: "
+ (top + this.buttonHeight) + "px; height: " + height + "px";
elt.className = this.options.className;
}
this.div.textContent = "";
this.div.appendChild(frag);
@ -71,6 +92,9 @@
Annotation.prototype.clear = function() {
this.cm.off("refresh", this.resizeHandler);
this.cm.off("markerAdded", this.resizeHandler);
this.cm.off("markerCleared", this.resizeHandler);
if (this.changeHandler) this.cm.off("change", this.changeHandler);
this.div.parentNode.removeChild(this.div);
};
});

13
lib/codemirror/addon/search/matchesonscrollbar.js

@ -11,13 +11,18 @@
})(function(CodeMirror) {
"use strict";
CodeMirror.defineExtension("showMatchesOnScrollbar", function(query, caseFold, className) {
return new SearchAnnotation(this, query, caseFold, className);
CodeMirror.defineExtension("showMatchesOnScrollbar", function(query, caseFold, options) {
if (typeof options == "string") options = {className: options};
if (!options) options = {};
return new SearchAnnotation(this, query, caseFold, options);
});
function SearchAnnotation(cm, query, caseFold, className) {
function SearchAnnotation(cm, query, caseFold, options) {
this.cm = cm;
this.annotation = cm.annotateScrollbar(className || "CodeMirror-search-match");
var annotateOptions = {listenForChanges: false};
for (var prop in options) annotateOptions[prop] = options[prop];
if (!annotateOptions.className) annotateOptions.className = "CodeMirror-search-match";
this.annotation = cm.annotateScrollbar(annotateOptions);
this.query = query;
this.caseFold = caseFold;
this.gap = {from: cm.firstLine(), to: cm.lastLine() + 1};

3
lib/codemirror/addon/selection/selection-pointer.js

@ -16,6 +16,7 @@
if (data) {
CodeMirror.off(cm.getWrapperElement(), "mousemove", data.mousemove);
CodeMirror.off(cm.getWrapperElement(), "mouseout", data.mouseout);
CodeMirror.off(window, "scroll", data.windowScroll);
cm.off("cursorActivity", reset);
cm.off("scroll", reset);
cm.state.selectionPointer = null;
@ -26,12 +27,14 @@
value: typeof val == "string" ? val : "default",
mousemove: function(event) { mousemove(cm, event); },
mouseout: function(event) { mouseout(cm, event); },
windowScroll: function() { reset(cm); },
rects: null,
mouseX: null, mouseY: null,
willUpdate: false
};
CodeMirror.on(cm.getWrapperElement(), "mousemove", data.mousemove);
CodeMirror.on(cm.getWrapperElement(), "mouseout", data.mouseout);
CodeMirror.on(window, "scroll", data.windowScroll);
cm.on("cursorActivity", reset);
cm.on("scroll", reset);
}

35
lib/codemirror/addon/tern/tern.js

@ -130,6 +130,13 @@
data = self.options.responseFilter(doc, query, request, error, data);
c(error, data);
});
},
destroy: function () {
if (this.worker) {
this.worker.terminate();
this.worker = null;
}
}
};
@ -252,7 +259,9 @@
tip.appendChild(document.createTextNode(" — " + data.doc));
if (data.url) {
tip.appendChild(document.createTextNode(" "));
tip.appendChild(elt("a", null, "[docs]")).href = data.url;
var child = tip.appendChild(elt("a", null, "[docs]"));
child.href = data.url;
child.target = "_blank";
}
}
tempTooltip(cm, tip);
@ -582,15 +591,33 @@
// Tooltips
function tempTooltip(cm, content) {
if (cm.state.ternTooltip) remove(cm.state.ternTooltip);
var where = cm.cursorCoords();
var tip = makeTooltip(where.right + 1, where.bottom, content);
var tip = cm.state.ternTooltip = makeTooltip(where.right + 1, where.bottom, content);
function maybeClear() {
old = true;
if (!mouseOnTip) clear();
}
function clear() {
cm.state.ternTooltip = null;
if (!tip.parentNode) return;
cm.off("cursorActivity", clear);
cm.off('blur', clear);
cm.off('scroll', clear);
fadeOut(tip);
}
setTimeout(clear, 1700);
var mouseOnTip = false, old = false;
CodeMirror.on(tip, "mousemove", function() { mouseOnTip = true; });
CodeMirror.on(tip, "mouseout", function(e) {
if (!CodeMirror.contains(tip, e.relatedTarget || e.toElement)) {
if (old) clear();
else mouseOnTip = false;
}
});
setTimeout(maybeClear, 1700);
cm.on("cursorActivity", clear);
cm.on('blur', clear);
cm.on('scroll', clear);
}
function makeTooltip(x, y, content) {
@ -631,7 +658,7 @@
// Worker wrapper
function WorkerServer(ts) {
var worker = new Worker(ts.options.workerScript);
var worker = ts.worker = new Worker(ts.options.workerScript);
worker.postMessage({type: "init",
defs: ts.options.defs,
plugins: ts.options.plugins,

8
lib/codemirror/addons.min.js

File diff suppressed because one or more lines are too long

2
lib/codemirror/addons.min.js.map

File diff suppressed because one or more lines are too long

16
lib/codemirror/bower.json

@ -0,0 +1,16 @@
{
"name": "codemirror",
"version":"5.0.0",
"main": ["lib/codemirror.js", "lib/codemirror.css"],
"ignore": [
"**/.*",
"node_modules",
"components",
"bin",
"demo",
"doc",
"test",
"index.html",
"package.json"
]
}

2
lib/codemirror/codemirror.js

File diff suppressed because one or more lines are too long

5
lib/codemirror/codemirror.min.css

File diff suppressed because one or more lines are too long

56
lib/codemirror/codemirror.min.js

File diff suppressed because one or more lines are too long

26
lib/codemirror/lib/codemirror.css

@ -1,9 +1,21 @@
/*!
// CodeMirror v5.0, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// This is CodeMirror (http://codemirror.net), a code editor
// implemented in JavaScript on top of the browser's DOM.
//
// You can find some technical background for some of the code below
// at http://marijnhaverbeke.nl/blog/#cm-internals .
*/
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
color: black;
}
/* PADDING */
@ -139,11 +151,9 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
the editor. You probably shouldn't touch them. */
.CodeMirror {
line-height: 1;
position: relative;
overflow: hidden;
background: white;
color: black;
}
.CodeMirror-scroll {
@ -215,6 +225,11 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.CodeMirror-lines {
cursor: text;
@ -235,6 +250,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
@ -256,6 +272,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-widget {}
.CodeMirror-code {
outline: none;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
@ -283,6 +303,8 @@ div.CodeMirror-cursors {
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; }
.CodeMirror ::selection { background: #d7d4f0; }
.CodeMirror ::-moz-selection { background: #d7d4f0; }
.cm-searching {
background: #ffa;

1528
lib/codemirror/lib/codemirror.js

File diff suppressed because it is too large

6
lib/codemirror/mode/clike/clike.js

@ -354,7 +354,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
state.tokenize = null;
break;
}
escaped = stream.next() != "\\" && !escaped;
escaped = stream.next() == "\\" && !escaped;
}
return "string";
}
@ -398,6 +398,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
if (!stream.match('""')) return false;
state.tokenize = tokenTripleString;
return state.tokenize(stream, state);
},
"'": function(stream) {
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
return "atom";
}
}
});

159
lib/codemirror/mode/css/css.js

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

62
lib/codemirror/mode/css/test.js

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

2
lib/codemirror/mode/cypher/cypher.js

@ -60,7 +60,7 @@
};
var indentUnit = config.indentUnit;
var curPunc;
var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]);
var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]);
var preds = wordRegexp(["all", "and", "any", "has", "in", "none", "not", "or", "single", "xor"]);
var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]);
var operatorChars = /[*+\-<>=&|~%^]/;

180
lib/codemirror/mode/forth/forth.js

@ -0,0 +1,180 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Author: Aliaksei Chapyzhenka
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
function toWordList(words) {
var ret = [];
words.split(' ').forEach(function(e){
ret.push({name: e});
});
return ret;
}
var coreWordList = toWordList(
'INVERT AND OR XOR\
2* 2/ LSHIFT RSHIFT\
0= = 0< < > U< MIN MAX\
2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP\
>R R> R@\
+ - 1+ 1- ABS NEGATE\
S>D * M* UM*\
FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD\
HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2!\
ALIGN ALIGNED +! ALLOT\
CHAR [CHAR] [ ] BL\
FIND EXECUTE IMMEDIATE COUNT LITERAL STATE\
; DOES> >BODY\
EVALUATE\
SOURCE >IN\
<# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL\
FILL MOVE\
. CR EMIT SPACE SPACES TYPE U. .R U.R\
ACCEPT\
TRUE FALSE\
<> U> 0<> 0>\
NIP TUCK ROLL PICK\
2>R 2R@ 2R>\
WITHIN UNUSED MARKER\
I J\
TO\
COMPILE, [COMPILE]\
SAVE-INPUT RESTORE-INPUT\
PAD ERASE\
2LITERAL DNEGATE\
D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS\
M+ M*/ D. D.R 2ROT DU<\
CATCH THROW\
FREE RESIZE ALLOCATE\
CS-PICK CS-ROLL\
GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER\
PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER\
-TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL');
var immediateWordList = toWordList('IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE');
CodeMirror.defineMode('forth', function() {
function searchWordList (wordList, word) {
var i;
for (i = wordList.length - 1; i >= 0; i--) {
if (wordList[i].name === word.toUpperCase()) {
return wordList[i];
}
}
return undefined;
}
return {
startState: function() {
return {
state: '',
base: 10,
coreWordList: coreWordList,
immediateWordList: immediateWordList,
wordList: []
};
},
token: function (stream, stt) {
var mat;
if (stream.eatSpace()) {
return null;
}
if (stt.state === '') { // interpretation
if (stream.match(/^(\]|:NONAME)(\s|$)/i)) {
stt.state = ' compilation';
return 'builtin compilation';
}
mat = stream.match(/^(\:)\s+(\S+)(\s|$)+/);
if (mat) {
stt.wordList.push({name: mat[2].toUpperCase()});
stt.state = ' compilation';
return 'def' + stt.state;
}
mat = stream.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i);
if (mat) {
stt.wordList.push({name: mat[2].toUpperCase()});
return 'def' + stt.state;
}
mat = stream.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/);
if (mat) {
return 'builtin' + stt.state;
}
} else { // compilation
// ; [
if (stream.match(/^(\;|\[)(\s)/)) {
stt.state = '';
stream.backUp(1);
return 'builtin compilation';
}
if (stream.match(/^(\;|\[)($)/)) {
stt.state = '';
return 'builtin compilation';
}
if (stream.match(/^(POSTPONE)\s+\S+(\s|$)+/)) {
return 'builtin';
}
}
// dynamic wordlist
mat = stream.match(/^(\S+)(\s+|$)/);
if (mat) {
if (searchWordList(stt.wordList, mat[1]) !== undefined) {
return 'variable' + stt.state;
}
// comments
if (mat[1] === '\\') {
stream.skipToEnd();
return 'comment' + stt.state;
}
// core words
if (searchWordList(stt.coreWordList, mat[1]) !== undefined) {
return 'builtin' + stt.state;
}
if (searchWordList(stt.immediateWordList, mat[1]) !== undefined) {
return 'keyword' + stt.state;
}
if (mat[1] === '(') {
stream.eatWhile(function (s) { return s !== ')'; });
stream.eat(')');
return 'comment' + stt.state;
}
// // strings
if (mat[1] === '.(') {
stream.eatWhile(function (s) { return s !== ')'; });
stream.eat(')');
return 'string' + stt.state;
}
if (mat[1] === 'S"' || mat[1] === '."' || mat[1] === 'C"') {
stream.eatWhile(function (s) { return s !== '"'; });
stream.eat('"');
return 'string' + stt.state;
}
// numbers
if (mat[1] - 0xfffffffff) {
return 'number' + stt.state;
}
// if (mat[1].match(/^[-+]?[0-9]+\.[0-9]*/)) {
// return 'number' + stt.state;
// }
return 'atom' + stt.state;
}
}
};
});
CodeMirror.defineMIME("text/x-forth", "forth");
});

75
lib/codemirror/mode/forth/index.html

@ -0,0 +1,75 @@
<!doctype html>
<title>CodeMirror: Forth mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../../lib/codemirror.css">
<link rel=stylesheet href="../../theme/colorforth.css">
<script src="../../lib/codemirror.js"></script>
<script src="forth.js"></script>
<style>
.CodeMirror {
font-family: 'Droid Sans Mono', monospace;
font-size: 14px;
}
</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">Forth</a>
</ul>
</div>
<article>
<h2>Forth mode</h2>
<form><textarea id="code" name="code">
\ Insertion sort
: cell- 1 cells - ;
: insert ( start end -- start )
dup @ >r ( r: v )
begin
2dup <
while
r@ over cell- @ <
while
cell-
dup @ over cell+ !
repeat then
r> swap ! ;
: sort ( array len -- )
1 ?do
dup i cells + insert
loop drop ;</textarea>
</form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
lineWrapping: true,
indentUnit: 2,
tabSize: 2,
autofocus: true,
theme: "colorforth",
mode: "text/x-forth"
});
</script>
<p>Simple mode that handle Forth-Syntax (<a href="http://en.wikipedia.org/wiki/Forth_%28programming_language%29">Forth on WikiPedia</a>).</p>
<p><strong>MIME types defined:</strong> <code>text/x-forth</code>.</p>
</article>

1
lib/codemirror/mode/go/go.js

@ -117,6 +117,7 @@ CodeMirror.defineMode("go", function(config) {
return state.context = new Context(state.indented, col, type, null, state.context);
}
function popContext(state) {
if (!state.context.prev) return;
var t = state.context.type;
if (t == ")" || t == "]" || t == "}")
state.indented = state.context.indented;

2
lib/codemirror/mode/idl/idl.js

@ -275,7 +275,7 @@
// Handle non-detected items
stream.next();
return 'error';
return null;
};
CodeMirror.defineMode('idl', function() {

2
lib/codemirror/mode/index.html

@ -51,6 +51,7 @@ option.</p>
<li><a href="ecl/index.html">ECL</a></li>
<li><a href="eiffel/index.html">Eiffel</a></li>
<li><a href="erlang/index.html">Erlang</a></li>
<li><a href="forth/index.html">Forth</a></li>
<li><a href="fortran/index.html">Fortran</a></li>
<li><a href="mllike/index.html">F#</a></li>
<li><a href="gas/index.html">Gas</a> (AT&amp;T-style assembly)</li>
@ -108,6 +109,7 @@ option.</p>
<li><a href="smartymixed/index.html">Smarty/HTML mixed</a></li>
<li><a href="solr/index.html">Solr</a></li>
<li><a href="soy/index.html">Soy</a></li>
<li><a href="stylus/index.html">Stylus</a></li>
<li><a href="sql/index.html">SQL</a> (several dialects)</li>
<li><a href="sparql/index.html">SPARQL</a></li>
<li><a href="stex/index.html">sTeX, LaTeX</a></li>

2
lib/codemirror/mode/javascript/javascript.js

@ -118,7 +118,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} else if (state.lastType == "operator" || state.lastType == "keyword c" ||
state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) {
readRegexp(stream);
stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla
stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
return ret("regexp", "string-2");
} else {
stream.eatWhile(isOperatorChar);

1
lib/codemirror/mode/meta.js

@ -38,6 +38,7 @@
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
{name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},

2
lib/codemirror/mode/sql/sql.js

@ -190,7 +190,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
indent: function(state, textAfter) {
var cx = state.context;
if (!cx) return 0;
if (!cx) return CodeMirror.Pass;
var closing = textAfter.charAt(0) == cx.type;
if (cx.align) return cx.col + (closing ? 0 : 1);
else return cx.indent + (closing ? 0 : config.indentUnit);

104
lib/codemirror/mode/stylus/index.html

@ -0,0 +1,104 @@
<!doctype html>
<title>CodeMirror: Stylus mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<link rel="stylesheet" href="../../addon/hint/show-hint.css">
<script src="../../lib/codemirror.js"></script>
<script src="stylus.js"></script>
<script src="../../addon/hint/show-hint.js"></script>
<script src="../../addon/hint/css-hint.js"></script>
<style>.CodeMirror {background: #f8f8f8;} form{margin-bottom: .7em;}</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">Stylus</a>
</ul>
</div>
<article>
<h2>Stylus mode</h2>
<form><textarea id="code" name="code">
/* Stylus mode */
#id
.class
article
font-family Arial, sans-serif
#id,
.class,
article {
font-family: Arial, sans-serif;
}
// Variables
font-size-base = 16px
line-height-base = 1.5
font-family-base = "Helvetica Neue", Helvetica, Arial, sans-serif
text-color = lighten(#000, 20%)
body
font font-size-base/line-height-base font-family-base
color text-color
body {
font: 400 16px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #333;
}
// Variables
link-color = darken(#428bca, 6.5%)
link-hover-color = darken(link-color, 15%)
link-decoration = none
link-hover-decoration = false
// Mixin
tab-focus()
outline thin dotted
outline 5px auto -webkit-focus-ring-color
outline-offset -2px
a
color link-color
if link-decoration
text-decoration link-decoration
&:hover
&:focus
color link-hover-color
if link-hover-decoration
text-decoration link-hover-decoration
&:focus
tab-focus()
a {
color: #3782c4;
text-decoration: none;
}
a:hover,
a:focus {
color: #2f6ea7;
}
a:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
</textarea>
</form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
extraKeys: {"Ctrl-Space": "autocomplete"},
});
</script>
<p><strong>MIME types defined:</strong> <code>text/x-styl</code>.</p>
</article>

444
lib/codemirror/mode/stylus/stylus.js

File diff suppressed because one or more lines are too long

211
lib/codemirror/mode/verilog/verilog.js

@ -17,7 +17,8 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
dontAlignCalls = parserConfig.dontAlignCalls,
noIndentKeywords = parserConfig.noIndentKeywords || [],
multiLineStrings = parserConfig.multiLineStrings;
multiLineStrings = parserConfig.multiLineStrings,
hooks = parserConfig.hooks || {};
function words(str) {
var obj = {}, words = str.split(" ");
@ -107,7 +108,11 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
var statementKeywords = words("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while");
function tokenBase(stream, state) {
var ch = stream.peek();
var ch = stream.peek(), style;
if (hooks[ch] && (style = hooks[ch](stream, state)) != false) return style;
if (hooks.tokenBase && (style = hooks.tokenBase(stream, state)) != false)
return style;
if (/[,;:\.]/.test(ch)) {
curPunc = stream.next();
return null;
@ -280,12 +285,14 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
electricInput: buildElectricInputRegEx(),
startState: function(basecolumn) {
return {
var state = {
tokenize: null,
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
indented: 0,
startOfLine: true
};
if (hooks.startState) hooks.startState(state);
return state;
},
token: function(stream, state) {
@ -295,6 +302,7 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
state.indented = stream.indentation();
state.startOfLine = true;
}
if (hooks.token) hooks.token(stream, state);
if (stream.eatSpace()) return null;
curPunc = null;
curKeyword = null;
@ -304,17 +312,19 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
if (curPunc == ctx.type) {
popContext(state);
}
else if ((curPunc == ";" && ctx.type == "statement") ||
} else if ((curPunc == ";" && ctx.type == "statement") ||
(ctx.type && isClosing(curKeyword, ctx.type))) {
ctx = popContext(state);
while (ctx && ctx.type == "statement") ctx = popContext(state);
}
else if (curPunc == "{") { pushContext(state, stream.column(), "}"); }
else if (curPunc == "[") { pushContext(state, stream.column(), "]"); }
else if (curPunc == "(") { pushContext(state, stream.column(), ")"); }
else if (ctx && ctx.type == "endcase" && curPunc == ":") { pushContext(state, stream.column(), "statement"); }
else if (curPunc == "newstatement") {
} else if (curPunc == "{") {
pushContext(state, stream.column(), "}");
} else if (curPunc == "[") {
pushContext(state, stream.column(), "]");
} else if (curPunc == "(") {
pushContext(state, stream.column(), ")");
} else if (ctx && ctx.type == "endcase" && curPunc == ":") {
pushContext(state, stream.column(), "statement");
} else if (curPunc == "newstatement") {
pushContext(state, stream.column(), "statement");
} else if (curPunc == "newblock") {
if (curKeyword == "function" && ctx && (ctx.type == "statement" || ctx.type == "endgroup")) {
@ -335,13 +345,16 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
indent: function(state, textAfter) {
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
if (hooks.indent) {
var fromHook = hooks.indent(state);
if (fromHook >= 0) return fromHook;
}
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
var closing = false;
var possibleClosing = textAfter.match(closingBracketOrWord);
if (possibleClosing) {
if (possibleClosing)
closing = isClosing(possibleClosing[0], ctx.type);
}
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
else if (closingBracket.test(ctx.type) && ctx.align && !dontAlignCalls) return ctx.column + (closing ? 0 : 1);
else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
@ -354,11 +367,171 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
};
});
CodeMirror.defineMIME("text/x-verilog", {
name: "verilog"
});
CodeMirror.defineMIME("text/x-systemverilog", {
name: "systemverilog"
});
CodeMirror.defineMIME("text/x-verilog", {
name: "verilog"
});
CodeMirror.defineMIME("text/x-systemverilog", {
name: "verilog"
});
// SVXVerilog mode
var svxchScopePrefixes = {
">": "property", "->": "property", "-": "hr", "|": "link", "?$": "qualifier", "?*": "qualifier",
"@-": "variable-3", "@": "variable-3", "?": "qualifier"
};
function svxGenIndent(stream, state) {
var svxindentUnit = 2;
var rtnIndent = -1, indentUnitRq = 0, curIndent = stream.indentation();
switch (state.svxCurCtlFlowChar) {
case "\\":
curIndent = 0;
break;
case "|":
if (state.svxPrevPrevCtlFlowChar == "@") {
indentUnitRq = -2; //-2 new pipe rq after cur pipe
break;
}
if (svxchScopePrefixes[state.svxPrevCtlFlowChar])
indentUnitRq = 1; // +1 new scope
break;
case "M": // m4
if (state.svxPrevPrevCtlFlowChar == "@") {
indentUnitRq = -2; //-2 new inst rq after pipe
break;
}
if (svxchScopePrefixes[state.svxPrevCtlFlowChar])
indentUnitRq = 1; // +1 new scope
break;
case "@":
if (state.svxPrevCtlFlowChar == "S")
indentUnitRq = -1; // new pipe stage after stmts
if (state.svxPrevCtlFlowChar == "|")
indentUnitRq = 1; // 1st pipe stage
break;
case "S":
if (state.svxPrevCtlFlowChar == "@")
indentUnitRq = 1; // flow in pipe stage
if (svxchScopePrefixes[state.svxPrevCtlFlowChar])
indentUnitRq = 1; // +1 new scope
break;
}
var statementIndentUnit = svxindentUnit;
rtnIndent = curIndent + (indentUnitRq*statementIndentUnit);
return rtnIndent >= 0 ? rtnIndent : curIndent;
}
CodeMirror.defineMIME("text/x-svx", {
name: "verilog",
hooks: {
"\\": function(stream, state) {
var vxIndent = 0, style = false;
var curPunc = stream.string;
if ((stream.sol()) && (/\\SV/.test(stream.string))) {
curPunc = (/\\SVX_version/.test(stream.string))
? "\\SVX_version" : stream.string;
stream.skipToEnd();
if (curPunc == "\\SV" && state.vxCodeActive) {state.vxCodeActive = false;};
if ((/\\SVX/.test(curPunc) && !state.vxCodeActive)
|| (curPunc=="\\SVX_version" && state.vxCodeActive)) {state.vxCodeActive = true;};
style = "keyword";
state.svxCurCtlFlowChar = state.svxPrevPrevCtlFlowChar
= state.svxPrevCtlFlowChar = "";
if (state.vxCodeActive == true) {
state.svxCurCtlFlowChar = "\\";
vxIndent = svxGenIndent(stream, state);
}
state.vxIndentRq = vxIndent;
}
return style;
},
tokenBase: function(stream, state) {
var vxIndent = 0, style = false;
var svxisOperatorChar = /[\[\]=:]/;
var svxkpScopePrefixs = {
"**":"variable-2", "*":"variable-2", "$$":"variable", "$":"variable",
"^^":"attribute", "^":"attribute"};
var ch = stream.peek();
var vxCurCtlFlowCharValueAtStart = state.svxCurCtlFlowChar;
if (state.vxCodeActive == true) {
if (/[\[\]{}\(\);\:]/.test(ch)) {
// bypass nesting and 1 char punc
style = "meta";
stream.next();
} else if (ch == "/") {
stream.next();
if (stream.eat("/")) {
stream.skipToEnd();
style = "comment";
state.svxCurCtlFlowChar = "S";
} else {
stream.backUp(1);
}
} else if (ch == "@") {
// pipeline stage
style = svxchScopePrefixes[ch];
state.svxCurCtlFlowChar = "@";
stream.next();
stream.eatWhile(/[\w\$_]/);
} else if (stream.match(/\b[mM]4+/, true)) { // match: function(pattern, consume, caseInsensitive)
// m4 pre proc
stream.skipTo("(");
style = "def";
state.svxCurCtlFlowChar = "M";
} else if (ch == "!" && stream.sol()) {
// v stmt in svx region
// state.svxCurCtlFlowChar = "S";
style = "comment";
stream.next();
} else if (svxisOperatorChar.test(ch)) {
// operators
stream.eatWhile(svxisOperatorChar);
style = "operator";
} else if (ch == "#") {
// phy hier
state.svxCurCtlFlowChar = (state.svxCurCtlFlowChar == "")
? ch : state.svxCurCtlFlowChar;
stream.next();
stream.eatWhile(/[+-]\d/);
style = "tag";
} else if (svxkpScopePrefixs.propertyIsEnumerable(ch)) {
// special SVX operators
style = svxkpScopePrefixs[ch];
state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? "S" : state.svxCurCtlFlowChar; // stmt
stream.next();
stream.match(/[a-zA-Z_0-9]+/);
} else if (style = svxchScopePrefixes[ch] || false) {
// special SVX operators
state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? ch : state.svxCurCtlFlowChar;
stream.next();
stream.match(/[a-zA-Z_0-9]+/);
}
if (state.svxCurCtlFlowChar != vxCurCtlFlowCharValueAtStart) { // flow change
vxIndent = svxGenIndent(stream, state);
state.vxIndentRq = vxIndent;
}
}
return style;
},
token: function(stream, state) {
if (state.vxCodeActive == true && stream.sol() && state.svxCurCtlFlowChar != "") {
state.svxPrevPrevCtlFlowChar = state.svxPrevCtlFlowChar;
state.svxPrevCtlFlowChar = state.svxCurCtlFlowChar;
state.svxCurCtlFlowChar = "";
}
},
indent: function(state) {
return (state.vxCodeActive == true) ? state.vxIndentRq : -1;
},
startState: function(state) {
state.svxCurCtlFlowChar = "";
state.svxPrevCtlFlowChar = "";
state.svxPrevPrevCtlFlowChar = "";
state.vxCodeActive = true;
state.vxIndentRq = 0;
}
}
});
});

18
lib/codemirror/modes.min.js

File diff suppressed because one or more lines are too long

2
lib/codemirror/modes.min.js.map

File diff suppressed because one or more lines are too long

21
lib/codemirror/package.json

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

2
lib/codemirror/theme/3024-day.css

@ -10,6 +10,8 @@
.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}
.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}
.cm-s-3024-day.CodeMirror ::selection { background: #d6d5d4; }
.cm-s-3024-day.CodeMirror ::-moz-selection { background: #d9d9d9; }
.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}
.cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; }

2
lib/codemirror/theme/3024-night.css

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

10
lib/codemirror/theme/ambiance.css

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

2
lib/codemirror/theme/base16-dark.css

@ -10,6 +10,8 @@
.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;}
.cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;}
.cm-s-base16-dark.CodeMirror ::selection { background: rgba(48, 48, 48, .99); }
.cm-s-base16-dark.CodeMirror ::-moz-selection { background: rgba(48, 48, 48, .99); }
.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;}
.cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; }
.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; }

2
lib/codemirror/theme/base16-light.css

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

2
lib/codemirror/theme/blackboard.css

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

2
lib/codemirror/theme/cobalt.css

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

33
lib/codemirror/theme/colorforth.css

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

2
lib/codemirror/theme/erlang-dark.css

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

2
lib/codemirror/theme/lesser-dark.css

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

2
lib/codemirror/theme/mbo.css

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

2
lib/codemirror/theme/mdn-like.css

@ -9,6 +9,8 @@
*/
.cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; }
.cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; }
.cm-s-mdn-like.CodeMirror ::selection { background: #cfc; }
.cm-s-mdn-like.CodeMirror ::-moz-selection { background: #cfc; }
.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; }
.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; margin-left: 3px; }

2
lib/codemirror/theme/midnight.css

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

2
lib/codemirror/theme/monokai.css

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

2
lib/codemirror/theme/night.css

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

2
lib/codemirror/theme/paraiso-dark.css

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

2
lib/codemirror/theme/paraiso-light.css

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

3
lib/codemirror/theme/pastel-on-dark.css

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

2
lib/codemirror/theme/rubyblue.css

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

12
lib/codemirror/theme/solarized.css

@ -94,13 +94,13 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
border-bottom: 1px dotted #dc322f;
}
.cm-s-solarized.cm-s-dark .CodeMirror-selected {
background: #073642;
}
.cm-s-solarized.cm-s-dark .CodeMirror-selected { background: #073642; }
.cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); }
.cm-s-solarized.cm-s-dark.CodeMirror ::-moz-selection { background: rgba(7, 54, 66, 0.99); }
.cm-s-solarized.cm-s-light .CodeMirror-selected {
background: #eee8d5;
}
.cm-s-solarized.cm-s-light .CodeMirror-selected { background: #eee8d5; }
.cm-s-solarized.cm-s-light.CodeMirror ::selection { background: #eee8d5; }
.cm-s-solarized.cm-s-lightCodeMirror ::-moz-selection { background: #eee8d5; }
/* Editor styling */

2
lib/codemirror/theme/the-matrix.css

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

35
lib/codemirror/theme/tomorrow-night-bright.css

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

2
lib/codemirror/theme/tomorrow-night-eighties.css

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

2
lib/codemirror/theme/twilight.css

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

2
lib/codemirror/theme/vibrant-ink.css

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

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save