mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-10-31 11:00:08 +00:00 
			
		
		
		
	refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									76f7a94559
								
							
						
					
					
						commit
						634eca4c86
					
				| @ -64,3 +64,5 @@ | |||||||
| .editor div:focus>textarea { | .editor div:focus>textarea { | ||||||
| 	background: rgba(0,0,0,0.1); | 	background: rgba(0,0,0,0.1); | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | |||||||
| @ -26,6 +26,36 @@ var atLine = function(elem, index){ | |||||||
| 
 | 
 | ||||||
| //---------------------------------------------------------------------
 | //---------------------------------------------------------------------
 | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | var Node = { | ||||||
|  | 	dom: undefined, | ||||||
|  | 	document: undefined, | ||||||
|  | 
 | ||||||
|  | 	get: function(){}, | ||||||
|  | 
 | ||||||
|  | 	get root(){}, | ||||||
|  | 	get parent(){}, | ||||||
|  | 	get children(){}, | ||||||
|  | 	get next(){}, | ||||||
|  | 	get prev(){}, | ||||||
|  | 
 | ||||||
|  | 	focus: function(){}, | ||||||
|  | 	edit: function(){}, | ||||||
|  | 
 | ||||||
|  | 	indent: function(){ }, | ||||||
|  | 	deindent: function(){ }, | ||||||
|  | 	toggleCollapse: function(){ }, | ||||||
|  | 
 | ||||||
|  | 	remove: function(){}, | ||||||
|  | 
 | ||||||
|  | 	json: function(){}, | ||||||
|  | 	text: function(){}, | ||||||
|  | 
 | ||||||
|  | 	load: function(){}, | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | // XXX might be a good idea to do a view-action model...
 | ||||||
| var Outline = { | var Outline = { | ||||||
| 	dom: undefined, | 	dom: undefined, | ||||||
| 
 | 
 | ||||||
| @ -191,6 +221,8 @@ var Outline = { | |||||||
| 			if(parent){ | 			if(parent){ | ||||||
| 				parent.append(cur) } }  | 				parent.append(cur) } }  | ||||||
| 		return cur }, | 		return cur }, | ||||||
|  | 	deindent: function(node='focused', indent=false){ | ||||||
|  | 		return this.indent(node, indent) }, | ||||||
| 	toggleCollapse: function(node='focused', state='next'){ | 	toggleCollapse: function(node='focused', state='next'){ | ||||||
| 		var that = this | 		var that = this | ||||||
| 		if(node == 'all'){ | 		if(node == 'all'){ | ||||||
| @ -217,6 +249,10 @@ var Outline = { | |||||||
| 				elem.updateSize() } } | 				elem.updateSize() } } | ||||||
| 		return node }, | 		return node }, | ||||||
| 
 | 
 | ||||||
|  | 	// XXX
 | ||||||
|  | 	remove: function(node){ | ||||||
|  | 	}, | ||||||
|  | 
 | ||||||
| 	// block serialization...
 | 	// block serialization...
 | ||||||
| 	__code2html__: function(code){ | 	__code2html__: function(code){ | ||||||
| 		return code }, | 		return code }, | ||||||
| @ -351,6 +387,9 @@ var Outline = { | |||||||
| 			next?.focus() }, | 			next?.focus() }, | ||||||
| 
 | 
 | ||||||
| 		// select...
 | 		// select...
 | ||||||
|  | 		// XXX add:
 | ||||||
|  | 		// 		ctrl-A
 | ||||||
|  | 		// 		ctrl-D
 | ||||||
| 		' ': function(evt){ | 		' ': function(evt){ | ||||||
| 			if(this.get('edited') != null){ | 			if(this.get('edited') != null){ | ||||||
| 				return } | 				return } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user