Owen Leonard
08900d5653
system preferences This patch adds CodeMirror plugins for linting JS, CSS, HTML, and YAML. When invalid data is entered in a linted CodeMirror editor an icon is displayed in the editor's "gutter." Hovering over the icon displays the error message. This patch renames the minified CodeMirror JS file to match convention but the version is unchanged. To test, apply the patch and go to Administration -> System preferences. Test preferences of each type and confirm that each type of CodeMirror editor shows an error indicator if you entry invalid data. Valid data should trigger no error indicator. - HTML: e.g. OpacMainUserBlock, opacheader. Enter invalid HTML, for example "<h1>Hello <h2>World</h2>." Example valid HTML: "<h1>Hello world</h1>" - JavaScript: e.g. OpacUserJS, IntranetUserJS. Example bad JS, "alert("Success!');" Example valid JS: "alert("Success!");" - CSS: e.g. IntranetUserCSS, SCOUserCSS. Example bad CSS, "p { color blue }" Example valid CSS, "p { color: blue; }" - YAML: e.g. OpacHiddenItems. Example bad YAML: "one: two, three: four" Example valid YAML: "one: two three: four" Also test that other CodeMirror instances still work correctly without linting: The advanced MARC editor, SQL reports editing. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
73 lines
2.9 KiB
CSS
73 lines
2.9 KiB
CSS
/* The lint marker gutter */
|
|
.CodeMirror-lint-markers {
|
|
width: 16px;
|
|
}
|
|
|
|
.CodeMirror-lint-tooltip {
|
|
background-color: #ffd;
|
|
border: 1px solid black;
|
|
border-radius: 4px 4px 4px 4px;
|
|
color: black;
|
|
font-family: monospace;
|
|
font-size: 10pt;
|
|
overflow: hidden;
|
|
padding: 2px 5px;
|
|
position: fixed;
|
|
white-space: pre;
|
|
white-space: pre-wrap;
|
|
z-index: 100;
|
|
max-width: 600px;
|
|
opacity: 0;
|
|
transition: opacity .4s;
|
|
-moz-transition: opacity .4s;
|
|
-webkit-transition: opacity .4s;
|
|
-o-transition: opacity .4s;
|
|
-ms-transition: opacity .4s;
|
|
}
|
|
|
|
.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning {
|
|
background-position: left bottom;
|
|
background-repeat: repeat-x;
|
|
}
|
|
|
|
.CodeMirror-lint-mark-error {
|
|
background-image:
|
|
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")
|
|
;
|
|
}
|
|
|
|
.CodeMirror-lint-mark-warning {
|
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
|
|
}
|
|
|
|
.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {
|
|
background-position: center center;
|
|
background-repeat: no-repeat;
|
|
cursor: pointer;
|
|
display: inline-block;
|
|
height: 16px;
|
|
width: 16px;
|
|
vertical-align: middle;
|
|
position: relative;
|
|
}
|
|
|
|
.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
|
|
padding-left: 18px;
|
|
background-position: top left;
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
|
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");
|
|
}
|
|
|
|
.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {
|
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=");
|
|
}
|
|
|
|
.CodeMirror-lint-marker-multiple {
|
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");
|
|
background-repeat: no-repeat;
|
|
background-position: right bottom;
|
|
width: 100%; height: 100%;
|
|
}
|