diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 02ebcc6..54d01eb 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -1570,6 +1570,8 @@ var Outline = { // NOTE: this does not internally handle undo as it would be too // granular... + // NOTE: to remove an attribute set it's value to null, undefined, + // 'null', or 'undefined' update: function(node='focused', data){ var node = this.get(node) data ??= this.data(node, false) @@ -1615,7 +1617,9 @@ var Outline = { : node.removeAttribute(attr) // dataset... } else { - if(value == null){ + if(value == null + || value == 'null' + || value == 'undefined'){ delete node.dataset[attr] } else { node.dataset[attr] = value } } } diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index 4a99aeb..e237d5e 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -143,15 +143,9 @@ var setup = function(){ |text|text|text| - - ## ToDo: - - attributes: `.data(..)`: read in element attributes... - - would be logical to store system attrs (`.__block_attrs__`) as attrs while the rest as data-attrs - this would bot simplify retrieval and avoid shadowing html attrs... - - TEST: this item has attr `moo` with value `"foo"` - moo::foo - - need a way to remove attributes from editor -- `null` or `undefined` special values?? - attributes: need to show/hide the attributes -- option? - TOC: Q: should we have both manual and auto headings??? - IMHO: no... - - DONE TOC: headings that do not show up in toc -- `# ...` shows up while `@ ...` does not... - TOC: tweaking: add args like depth, ... -- as attributes... - ASAP: expand sub-tree on follow link... - export auto-headings as normal/manual markdown headings... @@ -273,6 +267,12 @@ var setup = function(){ - `` -- field marker - each child node will copy the template and allow editing of only fields - not clear how to handle template changes... + - DONE attributes: need a way to remove attributes from editor -- `null` or `undefined` special values?? + - DONE attributes: `.data(..)`: read in element attributes... + collapsed:: true + - TEST: this item has attr `moo` with value `"foo"` + moo::foo + - DONE TOC: headings that do not show up in toc -- `# ...` shows up while `@ ...` does not... - DONE \TOC global/local - DONE FEATURE dynamic headings -- level depends on number of headings above... - DONE Experimental syntax: