From 0e04fff0ea80fa5cbe96b8354db38bd334aea83a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 16 Jul 2012 16:04:05 -0700 Subject: upgrade to codemirror 2.3 Signed-off-by: Ananya Sen Conflicts: js/code-editor/codemirror-ninja/theme/lesser-dark-ninja.css Signed-off-by: Ananya Sen --- imports/codemirror/mode/tiddlywiki/tiddlywiki.css | 35 +++++++++-------------- imports/codemirror/mode/tiddlywiki/tiddlywiki.js | 28 +++++++++--------- 2 files changed, 28 insertions(+), 35 deletions(-) (limited to 'imports/codemirror/mode/tiddlywiki') diff --git a/imports/codemirror/mode/tiddlywiki/tiddlywiki.css b/imports/codemirror/mode/tiddlywiki/tiddlywiki.css index dba05c0f..9a69b639 100644 --- a/imports/codemirror/mode/tiddlywiki/tiddlywiki.css +++ b/imports/codemirror/mode/tiddlywiki/tiddlywiki.css @@ -1,21 +1,14 @@ -.cm-s-default span.cm-header {color: blue; font-weight:bold;} -.cm-s-default span.cm-code {color: #a50;} -.cm-s-default span.cm-code-inline {color: #660;} - -.cm-s-default span.cm-quote {color: #555;} -.cm-s-default span.cm-list {color: #c60;} -.cm-s-default span.cm-hr {color: #999;} -.cm-s-default span.cm-em {font-style: italic;} -.cm-s-default span.cm-strong {font-weight: bold;} - -.cm-s-default span.cm-link-external {color: blue;} -.cm-s-default span.cm-brace {color: #170; font-weight: bold;} -.cm-s-default span.cm-macro {color: #9E3825;} -.cm-s-default span.cm-table {color: blue; font-weight: bold;} -.cm-s-default span.cm-warning {color: red; font-weight: bold;} - -.cm-s-default span.cm-underlined {text-decoration: underline;} -.cm-s-default span.cm-line-through {text-decoration: line-through;} - -.cm-s-default span.cm-comment {color: #666;} - +span.cm-underlined { + text-decoration: underline; +} +span.cm-strikethrough { + text-decoration: line-through; +} +span.cm-brace { + color: #170; + font-weight: bold; +} +span.cm-table { + color: blue; + font-weight: bold; +} diff --git a/imports/codemirror/mode/tiddlywiki/tiddlywiki.js b/imports/codemirror/mode/tiddlywiki/tiddlywiki.js index 1d26967e..74fcd496 100644 --- a/imports/codemirror/mode/tiddlywiki/tiddlywiki.js +++ b/imports/codemirror/mode/tiddlywiki/tiddlywiki.js @@ -107,10 +107,10 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) { return ret('quote', 'quote'); } if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) { - return ret('code', 'code'); + return ret('code', 'comment'); } if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) { - return ret('code', 'code'); + return ret('code', 'comment'); } if (stream.match(reHR)) { return ret('hr', 'hr'); @@ -125,26 +125,26 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) { } if (ch == "*") { // tw list stream.eatWhile('*'); - return ret("list", "list"); + return ret("list", "comment"); } if (ch == "#") { // tw numbered list stream.eatWhile('#'); - return ret("list", "list"); + return ret("list", "comment"); } if (ch == ";") { // definition list, term stream.eatWhile(';'); - return ret("list", "list"); + return ret("list", "comment"); } if (ch == ":") { // definition list, description stream.eatWhile(':'); - return ret("list", "list"); + return ret("list", "comment"); } if (ch == ">") { // single line quote stream.eatWhile(">"); return ret("quote", "quote"); } if (ch == '|') { - return ret('table', 'table'); + return ret('table', 'header'); } } @@ -155,7 +155,7 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) { // rudimentary html:// file:// link matching. TW knows much more ... if (/[hf]/i.test(ch)) { if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { - return ret("link-external", "link-external"); + return ret("link", "link"); } } // just a little string indicator, don't want to have the whole string covered @@ -173,7 +173,7 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) { } if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting stream.eatWhile(isSpaceName); - return ret("link-external", "link-external"); + return ret("link", "link"); } if (/\d/.test(ch)) { // numbers stream.eatWhile(/\d/); @@ -266,21 +266,21 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) { var ch, sb = state.block; if (sb && stream.current()) { - return ret("code", "code"); + return ret("code", "comment"); } if (!sb && stream.match(reUntilCodeStop)) { state.tokenize = jsTokenBase; - return ret("code", "code-inline"); + return ret("code", "comment"); } if (sb && stream.sol() && stream.match(reCodeBlockStop)) { state.tokenize = jsTokenBase; - return ret("code", "code"); + return ret("code", "comment"); } ch = stream.next(); - return (sb) ? ret("code", "code") : ret("code", "code-inline"); + return (sb) ? ret("code", "comment") : ret("code", "comment"); } // tw em / italic @@ -324,7 +324,7 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) { } maybeEnd = (ch == "-"); } - return ret("text", "line-through"); + return ret("text", "strikethrough"); } // macro -- cgit v1.2.3