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/lib/codemirror.css | 64 ++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 4 deletions(-) (limited to 'imports/codemirror/lib/codemirror.css') diff --git a/imports/codemirror/lib/codemirror.css b/imports/codemirror/lib/codemirror.css index 2d79f4aa..191ac25a 100644 --- a/imports/codemirror/lib/codemirror.css +++ b/imports/codemirror/lib/codemirror.css @@ -1,10 +1,16 @@ .CodeMirror { line-height: 1em; font-family: monospace; + + /* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */ + position: relative; + /* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */ + overflow: hidden; } .CodeMirror-scroll { - overflow: auto; + overflow-x: auto; + overflow-y: hidden; height: 300px; /* This is needed to prevent an IE[67] bug where the scrolled content is visible outside of the scrolling box. */ @@ -12,6 +18,37 @@ outline: none; } +/* Vertical scrollbar */ +.CodeMirror-scrollbar { + float: right; + overflow-x: hidden; + overflow-y: scroll; + + /* This corrects for the 1px gap introduced to the left of the scrollbar + by the rule for .CodeMirror-scrollbar-inner. */ + margin-left: -1px; +} +.CodeMirror-scrollbar-inner { + /* This needs to have a nonzero width in order for the scrollbar to appear + in Firefox and IE9. */ + width: 1px; +} +.CodeMirror-scrollbar.cm-sb-overlap { + /* Ensure that the scrollbar appears in Lion, and that it overlaps the content + rather than sitting to the right of it. */ + position: absolute; + z-index: 1; + float: none; + right: 0; + min-width: 12px; +} +.CodeMirror-scrollbar.cm-sb-nonoverlap { + min-width: 12px; +} +.CodeMirror-scrollbar.cm-sb-ie7 { + min-width: 18px; +} + .CodeMirror-gutter { position: absolute; left: 0; top: 0; z-index: 10; @@ -29,6 +66,11 @@ .CodeMirror-lines { padding: .4em; white-space: pre; + cursor: text; +} +.CodeMirror-lines * { + /* Necessary for throw-scrolling to decelerate properly on Safari. */ + pointer-events: none; } .CodeMirror pre { @@ -42,11 +84,14 @@ padding: 0; margin: 0; white-space: pre; word-wrap: normal; + line-height: inherit; + color: inherit; } .CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; + word-break: normal; } .CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; @@ -61,8 +106,19 @@ position: absolute; visibility: hidden; border-left: 1px solid black; - border-right:none; - width:0; + border-right: none; + width: 0; +} +.cm-keymap-fat-cursor pre.CodeMirror-cursor { + width: auto; + border: 0; + background: transparent; + background: rgba(0, 200, 0, .4); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800); +} +/* Kludge to turn off filter in ie9+, which also accepts rgba */ +.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) { + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {} .CodeMirror-focused pre.CodeMirror-cursor { @@ -98,7 +154,7 @@ div.CodeMirror-selected { background: #d9d9d9; } .cm-s-default span.cm-bracket {color: #cc7;} .cm-s-default span.cm-tag {color: #170;} .cm-s-default span.cm-attribute {color: #00c;} -.cm-s-default span.cm-header {color: #a0a;} +.cm-s-default span.cm-header {color: blue;} .cm-s-default span.cm-quote {color: #090;} .cm-s-default span.cm-hr {color: #999;} .cm-s-default span.cm-link {color: #00c;} -- cgit v1.2.3