Skip to content

Commit

Permalink
ISSUTRAC-82 update codemirror to 5.5, it fixes some IE11 related issue
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Aug 4, 2015
1 parent 2239d6b commit bd23f44
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 82 deletions.
2 changes: 1 addition & 1 deletion misc/RESOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ elastic text area

codemirror:

- core + markdown + placeholder v3.21 @ http://codemirror.net/doc/compress.html
- core + markdown + markdown-fold + placeholder v5.5 @ http://codemirror.net/doc/compress.html
187 changes: 111 additions & 76 deletions src/main/webapp/css/codemirror.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
min-height: 24px;
border: 1px solid #CCCCCC;
}
.CodeMirror-scroll {
/* Set scrolling behaviour here */
overflow: auto;
color: black;
}

/* PADDING */
Expand Down Expand Up @@ -38,42 +33,85 @@
min-width: 20px;
text-align: right;
color: #999;
-moz-box-sizing: content-box;
box-sizing: content-box;
white-space: nowrap;
}

.CodeMirror-guttermarker { color: black; }
.CodeMirror-guttermarker-subtle { color: #999; }

/* CURSOR */

.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid black;
z-index: 3;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}

.cm-animate-fat-cursor {
width: auto;
border: 0;
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
background-color: #7e7;
}
@-moz-keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
@-webkit-keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
@keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}

/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
div.CodeMirror-overwrite div.CodeMirror-cursor {}

.cm-tab { display: inline-block; text-decoration: inherit; }

.cm-tab { display: inline-block; }
.CodeMirror-ruler {
border-left: 1px solid #ccc;
position: absolute;
}

/* DEFAULT THEME */

.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}

.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable {color: black;}
.cm-s-default .cm-variable,
.cm-s-default .cm-punctuation,
.cm-s-default .cm-property,
.cm-s-default .cm-operator {}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3 {color: #085;}
.cm-s-default .cm-property {color: black;}
.cm-s-default .cm-operator {color: black;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
Expand All @@ -83,22 +121,19 @@
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}

.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}

.cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;}

.CodeMirror-composing { border-bottom: 2px solid; }

/* Default styles for common addons */

div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
.CodeMirror-activeline-background {background: #e8f2ff;}

/* STOP */
Expand All @@ -107,26 +142,24 @@ 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 {
overflow: scroll !important; /* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-right: -30px;
padding-bottom: 30px; padding-right: 30px;
padding-bottom: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
}

/* The fake, visible scrollbars. Used to force redraw during scrolling
Expand Down Expand Up @@ -156,29 +189,42 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}

.CodeMirror-gutters {
position: absolute; left: 0; top: 0;
padding-bottom: 30px;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
-moz-box-sizing: content-box;
box-sizing: content-box;
padding-bottom: 30px;
margin-bottom: -32px;
display: inline-block;
margin-bottom: -30px;
/* Hack to make IE7 behave */
*zoom:1;
*display:inline;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
background: none !important;
border: none !important;
}
.CodeMirror-gutter-background {
position: absolute;
top: 0; bottom: 0;
z-index: 4;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}

.CodeMirror-lines {
cursor: text;
min-height: 1px; /* prevents collapsing before first draw */
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
Expand All @@ -195,22 +241,14 @@ 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;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-code pre {
border-right: 30px solid transparent;
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
}
.CodeMirror-wrap .CodeMirror-code pre {
border-right: none;
width: auto;
}

.CodeMirror-linebackground {
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
Expand All @@ -225,8 +263,18 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}

.CodeMirror-widget {}

.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
.CodeMirror-code {
outline: none;
}

/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}

.CodeMirror-measure {
Expand All @@ -240,16 +288,24 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}

.CodeMirror div.CodeMirror-cursor {
position: absolute;
visibility: hidden;
border-right: none;
width: 0;
}
.CodeMirror-focused div.CodeMirror-cursor {

div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}

.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; }
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }

.cm-searching {
background: #ffa;
Expand All @@ -259,39 +315,18 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span { *vertical-align: text-bottom; }

/* Used to force a border model for a node */
.cm-force-border { padding-right: .1px; }

@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursor {
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}

/* variable height : http://codemirror.net/demo/variableheight.html */
.CodeMirror {border: 1px solid silver; border-width: 1px 2px; }

.cm-header-1 { font-size: 150%; }
.cm-header-2 { font-size: 130%; }
.cm-header-3 { font-size: 120%; }
.cm-header-4 { font-size: 110%; }
.cm-header-5 { font-size: 100%; }
.cm-header-6 { font-size: 90%; }
.cm-strong { font-size: 140%; }

/* resize http://codemirror.net/demo/resize.html */
.CodeMirror {
border: 1px solid #ccc;
height: auto;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
}
.CodeMirror-scroll {
overflow-y: hidden;
overflow-x: auto;
}

.CodeMirror, .CodeMirror-scroll {
min-height: 75px;
}

/* placeholder http://codemirror.net/demo/placeholder.html */
/* See issue #2901 */
.cm-tab-wrap-hack:after { content: ''; }

.CodeMirror pre.CodeMirror-placeholder { color: #999; }
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext { background: none; }
34 changes: 33 additions & 1 deletion src/main/webapp/css/lvg-general.css
Original file line number Diff line number Diff line change
Expand Up @@ -1076,4 +1076,36 @@ li.notification ul.notification-controls li {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
}


/* code mirror specific code */
/* variable height : http://codemirror.net/demo/variableheight.html */
.CodeMirror {border: 1px solid silver; border-width: 1px 2px; }

.cm-header-1 { font-size: 150%; }
.cm-header-2 { font-size: 130%; }
.cm-header-3 { font-size: 120%; }
.cm-header-4 { font-size: 110%; }
.cm-header-5 { font-size: 100%; }
.cm-header-6 { font-size: 90%; }
.cm-strong { font-size: 140%; }

/* resize http://codemirror.net/demo/resize.html */
.CodeMirror {
border: 1px solid #ccc;
height: auto;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
}
.CodeMirror-scroll {
overflow-y: hidden;
overflow-x: auto;
}

.CodeMirror, .CodeMirror-scroll {
min-height: 75px;
}

/* placeholder http://codemirror.net/demo/placeholder.html */

.CodeMirror pre.CodeMirror-placeholder { color: #999; }
23 changes: 19 additions & 4 deletions src/main/webapp/js/codemirror-compressed.js

Large diffs are not rendered by default.

0 comments on commit bd23f44

Please sign in to comment.