diff --git a/experiments/outline-editor/editor.css b/experiments/outline-editor/editor.css index 901d8e8..e15df90 100755 --- a/experiments/outline-editor/editor.css +++ b/experiments/outline-editor/editor.css @@ -210,7 +210,7 @@ } .editor .outline [tabindex]>span>input[type=checkbox].todo { position: absolute; - margin-left: calc(-1 * var(--size) - var(--item-padding)); + margin-left: calc(-1 * var(--size) - var(--item-padding) * 2); } .editor .outline [tabindex]>span>input[type=checkbox].check { transform: translateY(calc(2 * var(--item-padding))); diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index a8d21c4..8d0dd0a 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -325,11 +325,6 @@ var Outline = { .replace(/^((\/\/|;)\s+.*)$/m, style('comment')) .replace(/^XXX\s+(.*)$/m, style('XXX')) .replace(/^(.*)\s*XXX$/m, style('XXX')) - // basic styling... - // XXX these are quite naive... - .replace(/\*(.*)\*/gm, '$1') - .replace(/~([^~]*)~/gm, '$1') - .replace(/_([^_]*)_/gm, '$1') // elements... .replace(/(\n|^)---*\h*(\n|$)/m, '$1
') // ToDo... @@ -337,8 +332,13 @@ var Outline = { .replace(/^DONE\s*(.*)$/m, '$1') // checkboxes... // XXX these can not be clicked (yet)... - .replace(/\[ \]/gm, '') + .replace(/\[_\]/gm, '') .replace(/\[[X]\]/gm, '') + // basic styling... + // XXX these are quite naive... + .replace(/\*(.*)\*/gm, '$1') + .replace(/~([^~]*)~/gm, '$1') + .replace(/_([^_]*)_/gm, '$1') return elem }, // serialization... @@ -624,12 +624,12 @@ var Outline = { var i = [...node.querySelectorAll('.check')].indexOf(elem) var to = elem.checked ? '[X]' - : '[ ]' + : '[_]' var toggle = function(m){ return i-- == 0 ? to : m } - text.value = text.value.replace(/\[[X ]\]/g, toggle) } }) + text.value = text.value.replace(/\[[X_]\]/g, toggle) } }) // heboard handling... outline.addEventListener('keydown', function(evt){ diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index 2910f3a..92785b3 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -79,7 +79,7 @@ var setup = function(){ - TODO undone item - DONE done item _(clicking the checkbox updates the item)_ - - Inline [X] checkboxes [ ] + - Inline [X] checkboxes [_] - A collapsed:: true - a