mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-25 20:31:58 +00:00
Compare commits
No commits in common. "934cae33f37c975f6c04306e125eab9ec893f742" and "5cd04af9f226c90c6cefc84e266f805ca266da28" have entirely different histories.
934cae33f3
...
5cd04af9f2
@ -1776,20 +1776,7 @@ var Outline = {
|
|||||||
|
|
||||||
// serialization...
|
// serialization...
|
||||||
data: function(elem, deep=true){
|
data: function(elem, deep=true){
|
||||||
var that = this
|
elem = this.get(elem)
|
||||||
elem =
|
|
||||||
// all elements...
|
|
||||||
(elem == 'all' || elem == 'root' || elem == '*') ?
|
|
||||||
[...this.outline.children]
|
|
||||||
: elem instanceof Array ?
|
|
||||||
elem
|
|
||||||
: this.get(elem)
|
|
||||||
// multiple nodes...
|
|
||||||
if(elem instanceof Array){
|
|
||||||
return elem
|
|
||||||
.map(function(elem){
|
|
||||||
return that.data(elem) }) }
|
|
||||||
// single node...
|
|
||||||
// XXX move these to config...
|
// XXX move these to config...
|
||||||
var attrs = this.__block_attrs__
|
var attrs = this.__block_attrs__
|
||||||
var cls_attrs = ['focused']
|
var cls_attrs = ['focused']
|
||||||
@ -1808,23 +1795,17 @@ var Outline = {
|
|||||||
&& (res[attr] = true) }
|
&& (res[attr] = true) }
|
||||||
return res }, {})),
|
return res }, {})),
|
||||||
...(deep ?
|
...(deep ?
|
||||||
//{children: this.json(elem)}
|
{children: this.json(elem)}
|
||||||
{children: [...elem.lastChild.children]
|
|
||||||
.map(function(elem){
|
|
||||||
return that.data(elem) })}
|
|
||||||
: {}),
|
: {}),
|
||||||
} },
|
} },
|
||||||
// XXX do we need both this and data???
|
json: function(node){
|
||||||
// ...the only differences are:
|
var that = this
|
||||||
// - the default behavior node vs all
|
var children = [...(node ?
|
||||||
// - .json() always returns an array
|
node.lastChild.children
|
||||||
// XXX should this always return a list???
|
: this.outline.children)]
|
||||||
json: function(node='all'){
|
return children
|
||||||
return [this.data(...(
|
.map(function(elem){
|
||||||
arguments.length == 0 ?
|
return that.data(elem) }) },
|
||||||
['all']
|
|
||||||
: arguments))]
|
|
||||||
.flat() },
|
|
||||||
|
|
||||||
// XXX should this handle children???
|
// XXX should this handle children???
|
||||||
// XXX revise name...
|
// XXX revise name...
|
||||||
|
|||||||
@ -144,6 +144,8 @@ var setup = function(){
|
|||||||
- add loading spinner -- `.loading` class set on `.load(..)` and unset when done...
|
- add loading spinner -- `.loading` class set on `.load(..)` and unset when done...
|
||||||
- DONE set/unset class
|
- DONE set/unset class
|
||||||
- add animation
|
- add animation
|
||||||
|
- `.json(..)`, `.data(..)`, ... should be signature compatible with `.get(..)` (???)
|
||||||
|
- _current state causes constant confusion..._
|
||||||
- Time to think about a standalone client -- at least to edit own notes as a test...
|
- Time to think about a standalone client -- at least to edit own notes as a test...
|
||||||
- _also this would be a nice opportunity to start the move to a newer electron version_
|
- _also this would be a nice opportunity to start the move to a newer electron version_
|
||||||
- Q: Make the heading level depend on its depth??
|
- Q: Make the heading level depend on its depth??
|
||||||
@ -256,7 +258,6 @@ var setup = function(){
|
|||||||
- `<editable/>` -- field marker
|
- `<editable/>` -- field marker
|
||||||
- each child node will copy the template and allow editing of only fields
|
- each child node will copy the template and allow editing of only fields
|
||||||
- not clear how to handle template changes...
|
- not clear how to handle template changes...
|
||||||
- DONE `.json(..)`, `.data(..)`, ... should be signature compatible with `.get(..)` (???)
|
|
||||||
- DONE Q: Should we use `HTMLTextAreaElement.autoUpdateSize(..)` or handle it globally in setup???
|
- DONE Q: Should we use `HTMLTextAreaElement.autoUpdateSize(..)` or handle it globally in setup???
|
||||||
collapsed:: true
|
collapsed:: true
|
||||||
- _...I'm leaning towards the later..._
|
- _...I'm leaning towards the later..._
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user