mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 18:10:09 +00:00
bugfix + notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
5b0967f032
commit
99da7ca626
@ -618,6 +618,12 @@ var tasks = {
|
|||||||
var toc = {
|
var toc = {
|
||||||
__proto__: plugin,
|
__proto__: plugin,
|
||||||
|
|
||||||
|
// XXX not sure on what to build the hierarchy...
|
||||||
|
// this could be:
|
||||||
|
// - heading level
|
||||||
|
// - topology
|
||||||
|
// - both
|
||||||
|
// - ...
|
||||||
update: function(editor, elem){
|
update: function(editor, elem){
|
||||||
var outline = editor.outline
|
var outline = editor.outline
|
||||||
var tocs = [...outline.querySelectorAll('.toc .view')]
|
var tocs = [...outline.querySelectorAll('.toc .view')]
|
||||||
@ -632,7 +638,7 @@ var toc = {
|
|||||||
depth++ }
|
depth++ }
|
||||||
parent = parent.parentElement }
|
parent = parent.parentElement }
|
||||||
return depth }
|
return depth }
|
||||||
var headings = [...editor.outline.querySelectorAll('.heading .view')]
|
var headings = [...editor.outline.querySelectorAll('.block.heading>.view')]
|
||||||
.map(function(e){
|
.map(function(e){
|
||||||
return `<li>${ e.innerText.split(/\n/)[0] }</li>`
|
return `<li>${ e.innerText.split(/\n/)[0] }</li>`
|
||||||
})
|
})
|
||||||
@ -1186,7 +1192,7 @@ var Outline = {
|
|||||||
// NOTE: this needs to be before styling to prevent it from
|
// NOTE: this needs to be before styling to prevent it from
|
||||||
// treating '[_] ... [_]' as italic...
|
// treating '[_] ... [_]' as italic...
|
||||||
tasks,
|
tasks,
|
||||||
//toc,
|
toc,
|
||||||
styling,
|
styling,
|
||||||
// XXX
|
// XXX
|
||||||
//attributes,
|
//attributes,
|
||||||
@ -1316,7 +1322,7 @@ var Outline = {
|
|||||||
outline
|
outline
|
||||||
: node.parentElement === outline ?
|
: node.parentElement === outline ?
|
||||||
outline
|
outline
|
||||||
: node.parentElement.parentElement }
|
: node?.parentElement?.parentElement }
|
||||||
var children = function(node){
|
var children = function(node){
|
||||||
return node === outline ?
|
return node === outline ?
|
||||||
[...node.children]
|
[...node.children]
|
||||||
@ -1965,7 +1971,7 @@ var Outline = {
|
|||||||
var line = edited.getTextGeometry().line
|
var line = edited.getTextGeometry().line
|
||||||
if(line == 0){
|
if(line == 0){
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
that.focus('edited', 'prev') }
|
that.edit('prev') }
|
||||||
} else {
|
} else {
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
this.focus('focused', -1) } },
|
this.focus('focused', -1) } },
|
||||||
@ -1986,9 +1992,9 @@ var Outline = {
|
|||||||
var edited = this.get('edited')
|
var edited = this.get('edited')
|
||||||
if(edited){
|
if(edited){
|
||||||
var {line, lines} = edited.getTextGeometry()
|
var {line, lines} = edited.getTextGeometry()
|
||||||
if(line == lines - 1){
|
if(lines == 0 || line == lines - 1){
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
that.focus('edited', 'next') }
|
that.edit('next') }
|
||||||
} else {
|
} else {
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
this.focus('focused', 1) } },
|
this.focus('focused', 1) } },
|
||||||
|
|||||||
@ -48,13 +48,6 @@ var setup = function(){
|
|||||||
-
|
-
|
||||||
- ## Bugs:
|
- ## Bugs:
|
||||||
focused:: true
|
focused:: true
|
||||||
- BUG: deleting an element in edit mode breaks code (err)
|
|
||||||
- click the next line and press `backspace`
|
|
||||||
-
|
|
||||||
- BUG: navigation in edit mode broken...
|
|
||||||
-
|
|
||||||
- // can't go past this down...
|
|
||||||
-
|
|
||||||
- BUG: caret positioning broken
|
- BUG: caret positioning broken
|
||||||
- *TODO*::
|
- *TODO*::
|
||||||
- text text text
|
- text text text
|
||||||
@ -118,7 +111,9 @@ var setup = function(){
|
|||||||
- side margins are a bit too large (account for toolbat to the right)
|
- side margins are a bit too large (account for toolbat to the right)
|
||||||
-
|
-
|
||||||
- ## ToDo:
|
- ## ToDo:
|
||||||
- TOC?
|
- might be a good idea to make the heading level depend on its depth...
|
||||||
|
- Q: do we want to place the caret when moving between nodes???
|
||||||
|
- _would be nice to remember the caret horizontal offset for vertical movement_
|
||||||
- Q: should we use `HTMLTextAreaElement.autoUpdateSize(..)` or handle it globally in setup???
|
- Q: should we use `HTMLTextAreaElement.autoUpdateSize(..)` or handle it globally in setup???
|
||||||
- _...I'm leaning towards the later..._
|
- _...I'm leaning towards the later..._
|
||||||
- Q: can we place a cursor in a table correctly???
|
- Q: can we place a cursor in a table correctly???
|
||||||
@ -182,6 +177,7 @@ var setup = function(){
|
|||||||
- numbered lists: add counters to a depth of 6-7...
|
- numbered lists: add counters to a depth of 6-7...
|
||||||
- _or find a way to make them repeat..._
|
- _or find a way to make them repeat..._
|
||||||
- FEATURE: read-only mode
|
- FEATURE: read-only mode
|
||||||
|
- FEATURE: TOC (???)
|
||||||
- FEATURE: auto-shift done blocks to the end of siblings... (option?)
|
- FEATURE: auto-shift done blocks to the end of siblings... (option?)
|
||||||
- ...or should this be `sort:: done` -- i.e. sort children by done status??
|
- ...or should this be `sort:: done` -- i.e. sort children by done status??
|
||||||
- codeblock as a block
|
- codeblock as a block
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user