mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 11:20:09 +00:00 
			
		
		
		
	playing with tags api...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									db672e66c0
								
							
						
					
					
						commit
						b4b143f5be
					
				| @ -1,5 +1,11 @@ | |||||||
| /********************************************************************** | /********************************************************************** | ||||||
| *  | *  | ||||||
|  | * Features: | ||||||
|  | * 	- tag paths | ||||||
|  | * 		a/b/c | ||||||
|  | * 	- tag sets/relations | ||||||
|  | * 		a:b | ||||||
|  | * 	- serializable tag queries | ||||||
| * | * | ||||||
| * | * | ||||||
| **********************************************************************/ | **********************************************************************/ | ||||||
| @ -14,6 +20,98 @@ var util = require('lib/util') | |||||||
| 
 | 
 | ||||||
| /*********************************************************************/ | /*********************************************************************/ | ||||||
| 
 | 
 | ||||||
|  | var TagsClassPrototype = { | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | // XXX this should have the following sections:
 | ||||||
|  | // 		- tag-tag relations -- persistent
 | ||||||
|  | // 			- tags
 | ||||||
|  | // 			- paths
 | ||||||
|  | // 			- sets/relations
 | ||||||
|  | // 		- content (tag-object) -- volatile
 | ||||||
|  | // 			- tags
 | ||||||
|  | // 			- paths
 | ||||||
|  | // 			- sets/relations
 | ||||||
|  | // 			- tag-object references
 | ||||||
|  | var TagsPrototype = { | ||||||
|  | 
 | ||||||
|  | 	// Add/Remove/Modify tags API...
 | ||||||
|  | 	// XXX
 | ||||||
|  | 	path: function(){ | ||||||
|  | 		// XXX
 | ||||||
|  | 		return this | ||||||
|  | 	}, | ||||||
|  | 	alias: function(){ | ||||||
|  | 		// XXX
 | ||||||
|  | 		return this | ||||||
|  | 	}, | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 	// Add/Remove/Modify content API...
 | ||||||
|  | 	// XXX
 | ||||||
|  | 	tag: function(){ | ||||||
|  | 		// XXX
 | ||||||
|  | 		return this | ||||||
|  | 	}, | ||||||
|  | 	untag: function(){ | ||||||
|  | 		// XXX
 | ||||||
|  | 		return this | ||||||
|  | 	}, | ||||||
|  | 	 | ||||||
|  | 
 | ||||||
|  | 	// Query API...
 | ||||||
|  | 	// XXX
 | ||||||
|  | 	get: function(){ | ||||||
|  | 	}, | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 	// Object utility API...
 | ||||||
|  | 	//
 | ||||||
|  | 	// 	.clone()
 | ||||||
|  | 	// 	.clone('full')
 | ||||||
|  | 	// 		-> tags
 | ||||||
|  | 	//
 | ||||||
|  | 	// 	.clone('tags')
 | ||||||
|  | 	// 		-> tags
 | ||||||
|  | 	//
 | ||||||
|  | 	clone: function(mode){ | ||||||
|  | 		return new this.constructor(this.json(mode)) }, | ||||||
|  | 
 | ||||||
|  | 	// serialization...
 | ||||||
|  | 	//
 | ||||||
|  | 	// 	.json()
 | ||||||
|  | 	// 	.json('full')
 | ||||||
|  | 	// 		-> json
 | ||||||
|  | 	//
 | ||||||
|  | 	// 	.json('tags')
 | ||||||
|  | 	// 		-> json
 | ||||||
|  | 	//
 | ||||||
|  | 	//
 | ||||||
|  | 	// Format:
 | ||||||
|  | 	// 	{
 | ||||||
|  | 	// 	}
 | ||||||
|  | 	//
 | ||||||
|  | 	json: function(mode){ | ||||||
|  | 		// XXX
 | ||||||
|  | 	}, | ||||||
|  | 	load: function(json){ | ||||||
|  | 		// XXX
 | ||||||
|  | 		return this | ||||||
|  | 	}, | ||||||
|  | 
 | ||||||
|  | 	// constructor...
 | ||||||
|  | 	__init__: function(json){ | ||||||
|  | 		json  | ||||||
|  | 			&& this.load(json) }, | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | var Tags =  | ||||||
|  | module.Tags =  | ||||||
|  | object.makeConstructor('Tags',  | ||||||
|  | 		TagssClassPrototype,  | ||||||
|  | 		TagsPrototype) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user