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 = {
|
||||
__proto__: plugin,
|
||||
|
||||
// XXX not sure on what to build the hierarchy...
|
||||
// this could be:
|
||||
// - heading level
|
||||
// - topology
|
||||
// - both
|
||||
// - ...
|
||||
update: function(editor, elem){
|
||||
var outline = editor.outline
|
||||
var tocs = [...outline.querySelectorAll('.toc .view')]
|
||||
@ -632,7 +638,7 @@ var toc = {
|
||||
depth++ }
|
||||
parent = parent.parentElement }
|
||||
return depth }
|
||||
var headings = [...editor.outline.querySelectorAll('.heading .view')]
|
||||
var headings = [...editor.outline.querySelectorAll('.block.heading>.view')]
|
||||
.map(function(e){
|
||||
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
|
||||
// treating '[_] ... [_]' as italic...
|
||||
tasks,
|
||||
//toc,
|
||||
toc,
|
||||
styling,
|
||||
// XXX
|
||||
//attributes,
|
||||
@ -1316,7 +1322,7 @@ var Outline = {
|
||||
outline
|
||||
: node.parentElement === outline ?
|
||||
outline
|
||||
: node.parentElement.parentElement }
|
||||
: node?.parentElement?.parentElement }
|
||||
var children = function(node){
|
||||
return node === outline ?
|
||||
[...node.children]
|
||||
@ -1965,7 +1971,7 @@ var Outline = {
|
||||
var line = edited.getTextGeometry().line
|
||||
if(line == 0){
|
||||
evt.preventDefault()
|
||||
that.focus('edited', 'prev') }
|
||||
that.edit('prev') }
|
||||
} else {
|
||||
evt.preventDefault()
|
||||
this.focus('focused', -1) } },
|
||||
@ -1986,9 +1992,9 @@ var Outline = {
|
||||
var edited = this.get('edited')
|
||||
if(edited){
|
||||
var {line, lines} = edited.getTextGeometry()
|
||||
if(line == lines - 1){
|
||||
if(lines == 0 || line == lines - 1){
|
||||
evt.preventDefault()
|
||||
that.focus('edited', 'next') }
|
||||
that.edit('next') }
|
||||
} else {
|
||||
evt.preventDefault()
|
||||
this.focus('focused', 1) } },
|
||||
|
||||
@ -48,13 +48,6 @@ var setup = function(){
|
||||
-
|
||||
- ## Bugs:
|
||||
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
|
||||
- *TODO*::
|
||||
- text text text
|
||||
@ -118,7 +111,9 @@ var setup = function(){
|
||||
- side margins are a bit too large (account for toolbat to the right)
|
||||
-
|
||||
- ## 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???
|
||||
- _...I'm leaning towards the later..._
|
||||
- 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...
|
||||
- _or find a way to make them repeat..._
|
||||
- FEATURE: read-only mode
|
||||
- FEATURE: TOC (???)
|
||||
- FEATURE: auto-shift done blocks to the end of siblings... (option?)
|
||||
- ...or should this be `sort:: done` -- i.e. sort children by done status??
|
||||
- codeblock as a block
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user