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 { | ||||
| 	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 = { | ||||
| 	dom: undefined, | ||||
| 
 | ||||
| @ -191,6 +221,8 @@ var Outline = { | ||||
| 			if(parent){ | ||||
| 				parent.append(cur) } }  | ||||
| 		return cur }, | ||||
| 	deindent: function(node='focused', indent=false){ | ||||
| 		return this.indent(node, indent) }, | ||||
| 	toggleCollapse: function(node='focused', state='next'){ | ||||
| 		var that = this | ||||
| 		if(node == 'all'){ | ||||
| @ -217,6 +249,10 @@ var Outline = { | ||||
| 				elem.updateSize() } } | ||||
| 		return node }, | ||||
| 
 | ||||
| 	// XXX
 | ||||
| 	remove: function(node){ | ||||
| 	}, | ||||
| 
 | ||||
| 	// block serialization...
 | ||||
| 	__code2html__: function(code){ | ||||
| 		return code }, | ||||
| @ -351,6 +387,9 @@ var Outline = { | ||||
| 			next?.focus() }, | ||||
| 
 | ||||
| 		// select...
 | ||||
| 		// XXX add:
 | ||||
| 		// 		ctrl-A
 | ||||
| 		// 		ctrl-D
 | ||||
| 		' ': function(evt){ | ||||
| 			if(this.get('edited') != null){ | ||||
| 				return } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user