replace carriage returns client side
parent
9bd9c47895
commit
e9c09f13d1
|
|
@ -17,6 +17,9 @@ tbody tr:nth-child(2n+1) {
|
||||||
#upsert > textarea {
|
#upsert > textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
resize: vertical;
|
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 {
|
#jobs > tbody > tr > td {
|
||||||
|
|
@ -43,6 +46,10 @@ tbody tr:nth-child(2n+1) {
|
||||||
background: inherit;
|
background: inherit;
|
||||||
min-width: 40%;
|
min-width: 40%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
white-space: pre;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::selection,
|
||||||
|
::-moz-selection {
|
||||||
|
background-color: #565f67;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,14 @@ function upsert() {
|
||||||
function jsonifyForm(id) {
|
function jsonifyForm(id) {
|
||||||
var form = document.getElementById(id)
|
var form = document.getElementById(id)
|
||||||
var entries = new FormData(form).entries();
|
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"
|
json.disabled = json.disabled == "false"
|
||||||
var s = JSON.stringify(json)
|
var s = JSON.stringify(json)
|
||||||
return s
|
return s
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue