mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-10-31 19:10:08 +00:00 
			
		
		
		
	updated features...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									777f5c6fe0
								
							
						
					
					
						commit
						35135af462
					
				| @ -98,7 +98,9 @@ module.FeatureProto = { | |||||||
| 
 | 
 | ||||||
| 		// mixin actions...
 | 		// mixin actions...
 | ||||||
| 		if(this.actions != null){ | 		if(this.actions != null){ | ||||||
| 			actions.mixin(this.actions) | 			this.tag ?  | ||||||
|  | 				actions.mixin(this.actions, {source_tag: this.tag})  | ||||||
|  | 				: actions.mixin(this.actions)  | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		// install handlers...
 | 		// install handlers...
 | ||||||
| @ -346,6 +348,8 @@ var FeatureSetProto = { | |||||||
| 		var missing = {} | 		var missing = {} | ||||||
| 		var conflicts = {} | 		var conflicts = {} | ||||||
| 
 | 
 | ||||||
|  | 		var exclusive = {} | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| 		// reverse dependency cache... 
 | 		// reverse dependency cache... 
 | ||||||
| 		var dependants = {} | 		var dependants = {} | ||||||
| @ -392,6 +396,7 @@ var FeatureSetProto = { | |||||||
| 
 | 
 | ||||||
| 			var deps = that[k].depends || [] | 			var deps = that[k].depends || [] | ||||||
| 			var refs = that[k].suggested || [] | 			var refs = that[k].suggested || [] | ||||||
|  | 			var excl = that[k].exclusive || [] | ||||||
| 
 | 
 | ||||||
| 			deps.forEach(function(n){ | 			deps.forEach(function(n){ | ||||||
| 				// expand lst with dependencies....
 | 				// expand lst with dependencies....
 | ||||||
| @ -406,8 +411,16 @@ var FeatureSetProto = { | |||||||
| 			refs.forEach(function(n){ | 			refs.forEach(function(n){ | ||||||
| 				lst.indexOf(n) < 0 && lst.push(n) | 				lst.indexOf(n) < 0 && lst.push(n) | ||||||
| 			}) | 			}) | ||||||
|  | 
 | ||||||
|  | 			// build exclusive table...
 | ||||||
|  | 			excl.forEach(function(n){ | ||||||
|  | 				var l = exclusive[n] = exclusive[n] || [] | ||||||
|  | 				l.indexOf(k) < 0 && l.push(k) | ||||||
|  | 			}) | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		console.log('EXCL:', exclusive) | ||||||
|  | 
 | ||||||
| 		// sort features by priority or position...
 | 		// sort features by priority or position...
 | ||||||
| 		lst = lst | 		lst = lst | ||||||
| 			// remove undefined and non-features...
 | 			// remove undefined and non-features...
 | ||||||
| @ -433,7 +446,7 @@ var FeatureSetProto = { | |||||||
| 			.filter(function(e){ return disabled.indexOf(e) < 0 }) | 			.filter(function(e){ return disabled.indexOf(e) < 0 }) | ||||||
| 			// build the sort table: [ <priority>, <index>, <elem> ]
 | 			// build the sort table: [ <priority>, <index>, <elem> ]
 | ||||||
| 			.map(function(e, i){ return [ that[e].getPriority(), i, e ] }) | 			.map(function(e, i){ return [ that[e].getPriority(), i, e ] }) | ||||||
| 			// do the sort...
 | 			// sort by priority then index...
 | ||||||
| 			// NOTE: JS compares lists as strings so we have to compare 
 | 			// NOTE: JS compares lists as strings so we have to compare 
 | ||||||
| 			// 		the list manually...
 | 			// 		the list manually...
 | ||||||
| 			.sort(function(a, b){ return a[0] - b[0] || a[1] - b[1] }) | 			.sort(function(a, b){ return a[0] - b[0] || a[1] - b[1] }) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user