prettier textareas in ktxt2 editor
This commit is contained in:
@@ -51,6 +51,9 @@
|
|||||||
|
|
||||||
// Paragraph displaying and allowing editing the comment
|
// Paragraph displaying and allowing editing the comment
|
||||||
(set p.value text)
|
(set p.value text)
|
||||||
|
(set p.rows .length (text.split "\n"))
|
||||||
|
(p.setAttribute "class" "block")
|
||||||
|
(p.setAttribute "style" "width: 90%;")
|
||||||
(p.addEventListener "input"
|
(p.addEventListener "input"
|
||||||
->(addEditTimeout idx ->{(p.blur)(replaceComment (nth ktxt2Elements idx) p.value)}))
|
->(addEditTimeout idx ->{(p.blur)(replaceComment (nth ktxt2Elements idx) p.value)}))
|
||||||
(content.appendChild blockLinkBefore)
|
(content.appendChild blockLinkBefore)
|
||||||
@@ -119,16 +122,18 @@
|
|||||||
exportLink (document.createElement "a")]
|
exportLink (document.createElement "a")]
|
||||||
(outerDiv.setAttribute "class" "container")
|
(outerDiv.setAttribute "class" "container")
|
||||||
(outerDiv.setAttribute "style" "display: flex;")
|
(outerDiv.setAttribute "style" "display: flex;")
|
||||||
(sourceDiv.setAttribute "style" "width: 50%; white-space: pre;")
|
(sourceDiv.setAttribute "style" "width: 50%;")
|
||||||
(sourceDiv.setAttribute "class" "block")
|
(sourceDiv.setAttribute "class" "block")
|
||||||
(sourceDiv.addEventListener "input"
|
(sourceDiv.addEventListener "input"
|
||||||
->(addEditTimeout idx ->{(sourceDiv.blur)(replaceSourceBlock (nth ktxt2Elements idx) sourceDiv.value)}))
|
->(addEditTimeout idx ->{(sourceDiv.blur)(replaceSourceBlock (nth ktxt2Elements idx) sourceDiv.value)}))
|
||||||
(set sourceDiv.value source)
|
(set sourceDiv.value source)
|
||||||
(outputDiv.setAttribute "style" "flex-grow: 1; white-space: pre;")
|
(set sourceDiv.rows .length (source.split "\n"))
|
||||||
|
(outputDiv.setAttribute "style" "flex-grow: 1;")
|
||||||
(outputDiv.setAttribute "class" "block")
|
(outputDiv.setAttribute "class" "block")
|
||||||
(outputDiv.addEventListener "input"
|
(outputDiv.addEventListener "input"
|
||||||
->(addEditTimeout idx ->{(outputDiv.blur)(replaceOutputBlock (nth ktxt2Elements idx) outputDiv.value)}))
|
->(addEditTimeout idx ->{(outputDiv.blur)(replaceOutputBlock (nth ktxt2Elements idx) outputDiv.value)}))
|
||||||
(set outputDiv.value output)
|
(set outputDiv.value output)
|
||||||
|
(set outputDiv.rows .length (output.split "\n"))
|
||||||
|
|
||||||
// Link that will delete the whole block:
|
// Link that will delete the whole block:
|
||||||
(set xLink.innerHTML "x")
|
(set xLink.innerHTML "x")
|
||||||
|
@@ -75,6 +75,8 @@
|
|||||||
<style>
|
<style>
|
||||||
.block {
|
.block {
|
||||||
border: 1px solid white;
|
border: 1px solid white;
|
||||||
|
background-color: #222222;
|
||||||
|
color: #eeeeee;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
Reference in New Issue
Block a user