mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-11-04 04:50:09 +00:00 
			
		
		
		
	added overtravel pauses + cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									857c1ae9a7
								
							
						
					
					
						commit
						4c9597e27b
					
				@ -1390,6 +1390,7 @@ var Outline = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// XXX move the code here into methods/actions...
 | 
						// XXX move the code here into methods/actions...
 | 
				
			||||||
	// XXX use keyboard.js...
 | 
						// XXX use keyboard.js...
 | 
				
			||||||
 | 
						__overtravel_timeout: undefined,
 | 
				
			||||||
	keyboard: {
 | 
						keyboard: {
 | 
				
			||||||
		// vertical navigation...
 | 
							// vertical navigation...
 | 
				
			||||||
		// XXX this is a bit hacky but it works -- the caret blinks at 
 | 
							// XXX this is a bit hacky but it works -- the caret blinks at 
 | 
				
			||||||
@ -1397,6 +1398,18 @@ var Outline = {
 | 
				
			|||||||
		// 		nice po prevent this...
 | 
							// 		nice po prevent this...
 | 
				
			||||||
		ArrowUp: function(evt){
 | 
							ArrowUp: function(evt){
 | 
				
			||||||
			var that = this
 | 
								var that = this
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// overtravel...
 | 
				
			||||||
 | 
								var overtravel = 
 | 
				
			||||||
 | 
									this.__overtravel_timeout != null 
 | 
				
			||||||
 | 
										&& this.get() === this.get(0)
 | 
				
			||||||
 | 
								this.__overtravel_timeout != null
 | 
				
			||||||
 | 
									&& clearTimeout(this.__overtravel_timeout)
 | 
				
			||||||
 | 
								this.__overtravel_timeout = setTimeout(function(){
 | 
				
			||||||
 | 
									that.__overtravel_timeout = undefined }, 100)
 | 
				
			||||||
 | 
								if(overtravel){
 | 
				
			||||||
 | 
									return }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			var edited = this.get('edited')
 | 
								var edited = this.get('edited')
 | 
				
			||||||
			if(edited){
 | 
								if(edited){
 | 
				
			||||||
				var line = edited.getTextGeometry().line
 | 
									var line = edited.getTextGeometry().line
 | 
				
			||||||
@ -1408,6 +1421,18 @@ var Outline = {
 | 
				
			|||||||
				this.focus('focused', -1) } },
 | 
									this.focus('focused', -1) } },
 | 
				
			||||||
		ArrowDown: function(evt){
 | 
							ArrowDown: function(evt){
 | 
				
			||||||
			var that = this
 | 
								var that = this
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// overtravel...
 | 
				
			||||||
 | 
								var overtravel = 
 | 
				
			||||||
 | 
									this.__overtravel_timeout != null 
 | 
				
			||||||
 | 
										&& this.get() === this.get(-1)
 | 
				
			||||||
 | 
								this.__overtravel_timeout != null
 | 
				
			||||||
 | 
									&& clearTimeout(this.__overtravel_timeout)
 | 
				
			||||||
 | 
								this.__overtravel_timeout = setTimeout(function(){
 | 
				
			||||||
 | 
									that.__overtravel_timeout = undefined }, 100)
 | 
				
			||||||
 | 
								if(overtravel){
 | 
				
			||||||
 | 
									return }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			var edited = this.get('edited')
 | 
								var edited = this.get('edited')
 | 
				
			||||||
			if(edited){
 | 
								if(edited){
 | 
				
			||||||
				var {line, lines} = edited.getTextGeometry()
 | 
									var {line, lines} = edited.getTextGeometry()
 | 
				
			||||||
@ -1441,6 +1466,19 @@ var Outline = {
 | 
				
			|||||||
				this.toggleCollapse(true)
 | 
									this.toggleCollapse(true)
 | 
				
			||||||
				: this.focus('parent') },
 | 
									: this.focus('parent') },
 | 
				
			||||||
		ArrowRight: function(evt){
 | 
							ArrowRight: function(evt){
 | 
				
			||||||
 | 
								var that = this
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// overtravel...
 | 
				
			||||||
 | 
								var overtravel = 
 | 
				
			||||||
 | 
									this.__overtravel_timeout != null 
 | 
				
			||||||
 | 
										&& this.get() === this.get(-1)
 | 
				
			||||||
 | 
								this.__overtravel_timeout != null
 | 
				
			||||||
 | 
									&& clearTimeout(this.__overtravel_timeout)
 | 
				
			||||||
 | 
								this.__overtravel_timeout = setTimeout(function(){
 | 
				
			||||||
 | 
									that.__overtravel_timeout = undefined }, 100)
 | 
				
			||||||
 | 
								if(overtravel){
 | 
				
			||||||
 | 
									return }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			var edited = this.get('edited')
 | 
								var edited = this.get('edited')
 | 
				
			||||||
			if(edited){
 | 
								if(edited){
 | 
				
			||||||
				// move caret to next element...
 | 
									// move caret to next element...
 | 
				
			||||||
 | 
				
			|||||||
@ -51,15 +51,6 @@ var setup = function(){
 | 
				
			|||||||
  -
 | 
					  -
 | 
				
			||||||
- ## ToDo:
 | 
					- ## ToDo:
 | 
				
			||||||
  - crop: show crop path (and depth)
 | 
					  - crop: show crop path (and depth)
 | 
				
			||||||
  - identify a block:
 | 
					 | 
				
			||||||
    - DONE index (flat)
 | 
					 | 
				
			||||||
	- DONE path (index)
 | 
					 | 
				
			||||||
    - id
 | 
					 | 
				
			||||||
	  - _the id attr is done, but we still need to get the node via id_
 | 
					 | 
				
			||||||
  - focus:
 | 
					 | 
				
			||||||
    - DONE `<editor>.autofocus`
 | 
					 | 
				
			||||||
	- DONE `focused:: true` attr (`.text(..)`/`.json(..)`/`.load(..)`)
 | 
					 | 
				
			||||||
	- focusing editor -> focus focused block
 | 
					 | 
				
			||||||
  - undo 
 | 
					  - undo 
 | 
				
			||||||
    collapsed:: true
 | 
					    collapsed:: true
 | 
				
			||||||
	- edit stack (position, action, ...)
 | 
						- edit stack (position, action, ...)
 | 
				
			||||||
@ -88,9 +79,9 @@ var setup = function(){
 | 
				
			|||||||
  - Nerd fonts (option???)
 | 
					  - Nerd fonts (option???)
 | 
				
			||||||
  - multiple node selection
 | 
					  - multiple node selection
 | 
				
			||||||
  - smooth scrolling
 | 
					  - smooth scrolling
 | 
				
			||||||
    - _...this is more complicated that adding `behavior: "smooth"` to `.scrollIntoView(..)` as scrolling animation will get interrupted by next user input..._
 | 
					    - _...this is more complicated than adding `behavior: "smooth"` to `.scrollIntoView(..)` as scrolling animation will get interrupted by next user input..._
 | 
				
			||||||
    - need to cancel animation of things are moving too fast...
 | 
					    - need to cancel animation if things are moving too fast...
 | 
				
			||||||
    - make this generic
 | 
					    - make this generic (???)
 | 
				
			||||||
  - FEATURE? block templates...
 | 
					  - FEATURE? block templates...
 | 
				
			||||||
    collapsed:: true
 | 
					    collapsed:: true
 | 
				
			||||||
    - something like: `TPL: [_] <editable/> -- <editable/>`
 | 
					    - something like: `TPL: [_] <editable/> -- <editable/>`
 | 
				
			||||||
@ -118,6 +109,18 @@ var setup = function(){
 | 
				
			|||||||
           block text
 | 
					           block text
 | 
				
			||||||
    - NOTE: this is only a problem if making list-items manually -- disable???
 | 
					    - NOTE: this is only a problem if making list-items manually -- disable???
 | 
				
			||||||
  - empty item height is a bit off...
 | 
					  - empty item height is a bit off...
 | 
				
			||||||
 | 
					  - DONE over-travel pause -- when going fast over start/end stop...
 | 
				
			||||||
 | 
					  - DONE focus:
 | 
				
			||||||
 | 
					    collapsed:: true
 | 
				
			||||||
 | 
					    - DONE `<editor>.autofocus`
 | 
				
			||||||
 | 
						- DONE `focused:: true` attr (`.text(..)`/`.json(..)`/`.load(..)`)
 | 
				
			||||||
 | 
						- DONE focusing editor -> focus focused block
 | 
				
			||||||
 | 
					  - DONE identify a block:
 | 
				
			||||||
 | 
					    collapsed:: true
 | 
				
			||||||
 | 
					    - DONE index (flat)
 | 
				
			||||||
 | 
						- DONE path (index)
 | 
				
			||||||
 | 
					    - DONE id
 | 
				
			||||||
 | 
						  - _the id attr is done, but we still need to get the node via id_
 | 
				
			||||||
  - DONE pgup/pgdown/home/end buttons
 | 
					  - DONE pgup/pgdown/home/end buttons
 | 
				
			||||||
  - DONE FEATURE: "crop" -- view block tree separately...
 | 
					  - DONE FEATURE: "crop" -- view block tree separately...
 | 
				
			||||||
  - DONE unify attr parsing
 | 
					  - DONE unify attr parsing
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user