mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-30 10:30:08 +00:00
tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6843dde020
commit
c1e13787a4
@ -1075,7 +1075,7 @@ var JSONOutline = {
|
|||||||
.join('')
|
.join('')
|
||||||
return (
|
return (
|
||||||
`<div class="block ${ cls.join(' ') }" tabindex="0" ${ attrs.join(' ') }>\
|
`<div class="block ${ cls.join(' ') }" tabindex="0" ${ attrs.join(' ') }>\
|
||||||
<textarea class="code text" value="${ data.text }"></textarea>\
|
<textarea class="code text" value="${ data.text }">${ data.text }</textarea>\
|
||||||
<span class="view text">${ parsed.text }</span>\
|
<span class="view text">${ parsed.text }</span>\
|
||||||
<div class="children">${ children }</div>\
|
<div class="children">${ children }</div>\
|
||||||
</div>`) },
|
</div>`) },
|
||||||
@ -1821,13 +1821,15 @@ var Outline = {
|
|||||||
|
|
||||||
this.setUndo(this.path(cur), 'remove', [this.path(block)]) }
|
this.setUndo(this.path(cur), 'remove', [this.path(block)]) }
|
||||||
return block },
|
return block },
|
||||||
// XXX see inside...
|
/*/ XXX
|
||||||
load: function(data){
|
load: function(data){
|
||||||
var that = this
|
var that = this
|
||||||
data = typeof(data) == 'string' ?
|
data = typeof(data) == 'string' ?
|
||||||
this.parse(data)
|
this.parse(data)
|
||||||
: data instanceof Array ?
|
: data instanceof Array ?
|
||||||
data
|
data
|
||||||
|
: data == null ?
|
||||||
|
this.json()
|
||||||
: [data]
|
: [data]
|
||||||
// generate dom...
|
// generate dom...
|
||||||
var level = function(lst){
|
var level = function(lst){
|
||||||
@ -1851,9 +1853,31 @@ var Outline = {
|
|||||||
var f = that._updateTextareaSize
|
var f = that._updateTextareaSize
|
||||||
for(var e of [...that.outline.querySelectorAll('textarea')]){
|
for(var e of [...that.outline.querySelectorAll('textarea')]){
|
||||||
f(e) } }, 0)
|
f(e) } }, 0)
|
||||||
// restore focus...
|
|
||||||
this.focus()
|
|
||||||
return this },
|
return this },
|
||||||
|
/*/ // XXX JSON version...
|
||||||
|
load: function(data){
|
||||||
|
var that = this
|
||||||
|
data = typeof(data) == 'string' ?
|
||||||
|
this.parse(data)
|
||||||
|
: data instanceof Array ?
|
||||||
|
data
|
||||||
|
: data == null ?
|
||||||
|
this.json()
|
||||||
|
: [data]
|
||||||
|
|
||||||
|
this.outline.innerHTML = this.html(data)
|
||||||
|
|
||||||
|
// update sizes of all the textareas (transparent)...
|
||||||
|
// NOTE: this is needed to make initial clicking into multi-line
|
||||||
|
// blocks place the cursor into the clicked location.
|
||||||
|
// ...this is done by expanding the textarea to the element
|
||||||
|
// size and enabling it to intercept clicks correctly...
|
||||||
|
setTimeout(function(){
|
||||||
|
var f = that._updateTextareaSize
|
||||||
|
for(var e of [...that.outline.querySelectorAll('textarea')]){
|
||||||
|
f(e) } }, 0)
|
||||||
|
return this },
|
||||||
|
//*/
|
||||||
|
|
||||||
sync: function(){
|
sync: function(){
|
||||||
this.code = this.text()
|
this.code = this.text()
|
||||||
|
|||||||
@ -48,6 +48,10 @@ var setup = function(){
|
|||||||
-
|
-
|
||||||
- ## Bugs:
|
- ## Bugs:
|
||||||
focused:: true
|
focused:: true
|
||||||
|
- BUG: navigation in edit mode broken...
|
||||||
|
-
|
||||||
|
- // can't go past this down...
|
||||||
|
-
|
||||||
- BUG: caret positioning broken
|
- BUG: caret positioning broken
|
||||||
- Example:
|
- Example:
|
||||||
- text text text
|
- text text text
|
||||||
@ -110,6 +114,7 @@ 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:
|
||||||
|
- ASAP: edit/view sizes slightly different...
|
||||||
- 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???
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user