diff --git a/public/css/water.css b/public/css/water.css index 53088d6..614c97a 100755 --- a/public/css/water.css +++ b/public/css/water.css @@ -17,6 +17,9 @@ tbody tr:nth-child(2n+1) { #upsert > textarea { width: 100%; resize: vertical; + font-family: monospace; + font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; + white-space: pre-wrap; } #jobs > tbody > tr > td { @@ -43,6 +46,10 @@ tbody tr:nth-child(2n+1) { background: inherit; min-width: 40%; display: inline-block; - white-space: pre; + white-space: pre-wrap; } +::selection, +::-moz-selection { + background-color: #565f67; +} diff --git a/public/js/js.js b/public/js/js.js index f7c9587..b08da1d 100755 --- a/public/js/js.js +++ b/public/js/js.js @@ -27,7 +27,14 @@ function upsert() { function jsonifyForm(id) { var form = document.getElementById(id) var entries = new FormData(form).entries(); - var json = Object.assign(...Array.from(entries, ([x,y]) => ({[x]:y}))); + var json = Object.assign(...Array.from( + entries, + ([x,y]) => ({ + [x]:y + .replace(/\r\n/g, '\n') + .replace(/\r/g, '\n') + }) + )) json.disabled = json.disabled == "false" var s = JSON.stringify(json) return s