| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | /********************************************************************** | 
					
						
							|  |  |  | *  | 
					
						
							|  |  |  | * | 
					
						
							|  |  |  | * | 
					
						
							|  |  |  | **********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | define(function(require){ var module = {} | 
					
						
							|  |  |  | console.log('>>> actions') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-25 14:58:52 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Might also be a good idea to add "relative terms" to be used as 
 | 
					
						
							|  |  |  | // arguments for actions (a-la jQuery collections):
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // 	Image			- current image
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | // 		.next(<offset> | 'all')
 | 
					
						
							|  |  |  | // 		.prev(..)
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | // 	Ribbon			- ribbon or ribbon images
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | // 		.next(..)
 | 
					
						
							|  |  |  | // 		.prev(..)
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // 	Images			- all images
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | // 	Marked			- marked images
 | 
					
						
							|  |  |  | // 	Bookmarked		- bookmarked images
 | 
					
						
							|  |  |  | //
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | //
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | // NOTE: these can also beused as a basis for actions...
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-25 18:34:53 +04:00
										 |  |  | // XXX test the context if it's a jQuery object use it's interface and 
 | 
					
						
							|  |  |  | // 		if it's a events.EventEmitter instance use that...
 | 
					
						
							| 
									
										
										
										
											2014-07-25 14:58:52 +04:00
										 |  |  | var fireEvent = | 
					
						
							|  |  |  | module.fireEvent = | 
					
						
							|  |  |  | function(context, name, args){ | 
					
						
							| 
									
										
										
										
											2014-07-25 18:34:53 +04:00
										 |  |  | 	var EventEmitter = nodejs != null  | 
					
						
							|  |  |  | 		? nodejs.require('events').EventEmitter  | 
					
						
							|  |  |  | 		: null | 
					
						
							|  |  |  | 	var jQuery = typeof(jQuery) != 'undefined' ? jQuery : null | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 	// jQuery event...
 | 
					
						
							| 
									
										
										
										
											2014-07-25 18:34:53 +04:00
										 |  |  | 	if(typeof(context) == typeof('str') | 
					
						
							|  |  |  | 			|| (jq_object != null  | 
					
						
							|  |  |  | 				&& context instanceof jQuery)){ | 
					
						
							| 
									
										
										
										
											2014-07-25 14:58:52 +04:00
										 |  |  | 		var c = $(context) | 
					
						
							|  |  |  | 			.trigger(name, args) | 
					
						
							| 
									
										
										
										
											2014-07-25 18:34:53 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 	// node event...
 | 
					
						
							| 
									
										
										
										
											2014-07-25 18:34:53 +04:00
										 |  |  | 	} else if(EventEmitter != null && context instanceof EventEmitter){ | 
					
						
							| 
									
										
										
										
											2014-07-25 14:58:52 +04:00
										 |  |  | 		var c = context | 
					
						
							|  |  |  | 			.emit.apply(context, [name].concat(args)) | 
					
						
							| 
									
										
										
										
											2014-07-25 18:34:53 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		console.error('Incompatible event context type:', context) | 
					
						
							| 
									
										
										
										
											2014-07-25 14:58:52 +04:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	return c | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | // NOTE: context is dynamic.
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var Action = | 
					
						
							|  |  |  | module.Action =  | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | function Action(context, name, doc, code){ | 
					
						
							|  |  |  | 	var action = function(){ | 
					
						
							|  |  |  | 		var args = args2array(arguments) | 
					
						
							| 
									
										
										
										
											2014-07-25 14:58:52 +04:00
										 |  |  | 		var c = fireEvent(context, name + '.pre', args) | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		// run compound action content...
 | 
					
						
							|  |  |  | 		if(code != null){ | 
					
						
							|  |  |  | 			// code is a function...
 | 
					
						
							|  |  |  | 			if(typeof(code) == typeof(function(){})){ | 
					
						
							|  |  |  | 				code.apply(this, [c].concat(args)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			// code is an object...
 | 
					
						
							|  |  |  | 			} else { | 
					
						
							|  |  |  | 				for(var a in code){ | 
					
						
							|  |  |  | 					var sargs = code[a] | 
					
						
							|  |  |  | 					sargs = sargs.constructor.name != 'Array' ? [sargs] : sargs | 
					
						
							|  |  |  | 					this[a].apply(this, sargs) | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-25 14:58:52 +04:00
										 |  |  | 		fireEvent(c, name, args) | 
					
						
							|  |  |  | 		fireEvent(c, name + '.post', args) | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 		return c | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	action.doc = doc == null ? name : doc | 
					
						
							|  |  |  | 	return action | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // if actions is given this will extend that action object, else a new 
 | 
					
						
							|  |  |  | // action object will be created.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // names format:
 | 
					
						
							|  |  |  | // 	{
 | 
					
						
							|  |  |  | // 		// basic action...
 | 
					
						
							|  |  |  | // 		<action-name>: <doc>,
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // 		// compound action...
 | 
					
						
							|  |  |  | // 		<action-name>: [<doc>, {
 | 
					
						
							|  |  |  | // 			<action-name>: <args>,
 | 
					
						
							|  |  |  | // 			...
 | 
					
						
							|  |  |  | // 		}],
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // 		// compound action with a JS function...
 | 
					
						
							|  |  |  | // 		<action-name>: [<doc>, 
 | 
					
						
							|  |  |  | // 			// this is run in the context of the action set...
 | 
					
						
							|  |  |  | // 			// NOTE: this will get the same arguments passed to the action
 | 
					
						
							|  |  |  | // 			//		preceded with the action event context.
 | 
					
						
							|  |  |  | // 			function(evt_context, ...){
 | 
					
						
							|  |  |  | // 				...
 | 
					
						
							|  |  |  | // 			}],
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // 		...
 | 
					
						
							|  |  |  | // 	}
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // NOTE: context is dynamic.
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var Actions = | 
					
						
							|  |  |  | module.Action =  | 
					
						
							| 
									
										
										
										
											2014-07-25 18:34:53 +04:00
										 |  |  | function Actions(context, names, actions, mode){ | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	actions = actions == null ? {} : actions | 
					
						
							|  |  |  | 	Object.keys(names).forEach(function(e){ | 
					
						
							|  |  |  | 		var doc = names[e] | 
					
						
							|  |  |  | 		var code = doc.constructor.name == 'Array' ? doc[1] : null | 
					
						
							|  |  |  | 		doc = code != null ? doc : doc[0] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-25 18:34:53 +04:00
										 |  |  | 		actions[e] = Action(context, e, doc, code, mode) | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	}) | 
					
						
							|  |  |  | 	return actions | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Action variables:
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // 	SCREEN_IMAGES		
 | 
					
						
							|  |  |  | // 		- screen width in images
 | 
					
						
							|  |  |  | // 		- resolves to number
 | 
					
						
							|  |  |  | // 		
 | 
					
						
							|  |  |  | // 	CURRENT				
 | 
					
						
							|  |  |  | // 		- current image
 | 
					
						
							|  |  |  | // 		- resolves to gid
 | 
					
						
							|  |  |  | // 		- support basic math: +/-
 | 
					
						
							|  |  |  | // 			e.g. CURRENT + 1	~ next image
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // 	RIBBON				
 | 
					
						
							|  |  |  | // 		- current ribbon
 | 
					
						
							|  |  |  | // 		- resolves to gid
 | 
					
						
							|  |  |  | // 		- support basic math: +/-
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // 	BASE				
 | 
					
						
							|  |  |  | // 		- base ribbon
 | 
					
						
							|  |  |  | // 		- resolves to gid
 | 
					
						
							|  |  |  | // 		- support basic math: +/-
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // XXX add action variables!!!
 | 
					
						
							|  |  |  | var SCREEN_IMAGES = null | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // XXX need a way to define compound actions...
 | 
					
						
							|  |  |  | // 		- compound action is like a normal action with a set of other 
 | 
					
						
							|  |  |  | // 			actions chanined to it's main event.
 | 
					
						
							|  |  |  | // 		- actions should accept arguments, both optional and required
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var BASE_ACTIONS = | 
					
						
							|  |  |  | module.BASE_ACTIONS = { | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	// basic editing...
 | 
					
						
							|  |  |  | 	shiftImageUp:  | 
					
						
							|  |  |  | 		'Shift image to the ribbon above current, creating one if ' | 
					
						
							|  |  |  | 		+'it does not exist', | 
					
						
							|  |  |  | 	shiftImageDown: | 
					
						
							|  |  |  | 		'Shift image to the ribbon below current, creating one if ' | 
					
						
							|  |  |  | 		+'it does not exist', | 
					
						
							| 
									
										
										
										
											2014-07-27 03:08:59 +04:00
										 |  |  | 	shiftImageUpNewRibbon: '', | 
					
						
							|  |  |  | 	shiftImageDownNewRibbon: '', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	shiftImageLeft: 'Shift image to the left', | 
					
						
							|  |  |  | 	shiftImageRight: 'Shift image to the right', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	moveRibbonUp: 'Move current ribbon one position up', | 
					
						
							|  |  |  | 	moveRibbonDown: 'Move current ribbon one position down', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	sortImages: '', | 
					
						
							|  |  |  | 	reverseImages: '', | 
					
						
							|  |  |  | 	setAsBaseRibbon: '', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// image adjustments...
 | 
					
						
							|  |  |  | 	rotateCW: '', | 
					
						
							|  |  |  | 	rotateCCW: '', | 
					
						
							|  |  |  | 	flipVertical: '', | 
					
						
							|  |  |  | 	flipHorizontal: '', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// external editors/viewers...
 | 
					
						
							|  |  |  | 	systemOpen: '', | 
					
						
							|  |  |  | 	openWith: '', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// crop...
 | 
					
						
							|  |  |  | 	// XXX should this be here on in a crop pligin...
 | 
					
						
							|  |  |  | 	cropRibbon: '', | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 	cropCurrentRibbonAndAbove: '', | 
					
						
							|  |  |  | 	uncropView: 'Uncrop to previous crop', | 
					
						
							|  |  |  | 	uncropAll: 'Uncrop to base', | 
					
						
							|  |  |  | 	uncropViewAndKeepOrder:  | 
					
						
							|  |  |  | 		'Uncrop view to previous crop, keeping current image order', | 
					
						
							|  |  |  | 	uncropAllAndKeepOrder: 'Uncrop to base, keeping current image order', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	openURL: '', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:35:24 +04:00
										 |  |  | 	//openHistory: '',
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 	saveOrder: '', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	saveState: '', | 
					
						
							|  |  |  | 	exportImages: '', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	exit: '', | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // XXX think of a better name...
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var setupBaseActions = | 
					
						
							|  |  |  | module.setupBaseActions = | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | function setupBaseActions(context, actions){ | 
					
						
							|  |  |  | 	return Actions(context, BASE_ACTIONS, actions) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var UI_ACTIONS = | 
					
						
							|  |  |  | module.UI_ACTIONS = { | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 	focusImage: '', | 
					
						
							|  |  |  | 	focusRibbon: '', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	// basic navigation...
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 	nextImage: ['Focus next image in current ribbon', { focusImage: 'next' }], | 
					
						
							|  |  |  | 	nextRibbon: ['Focus next ribbon (down)', { focusRibbon: 'next' }], | 
					
						
							|  |  |  | 	// XXX actions vars...
 | 
					
						
							|  |  |  | 	nextScreen: ['Show next screen width of images', { focusImage: SCREEN_IMAGES }], | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 	prevImage: ['Focus previous image in current ribbon', { focusImage: 'prev' }], | 
					
						
							|  |  |  | 	prevRibbon: ['Focus previous ribbon (up)', { focusRibbon: 'prev' }], | 
					
						
							|  |  |  | 	// XXX actions vars...
 | 
					
						
							|  |  |  | 	prevScreen: ['Show previous screen width of images', { focusImage: -SCREEN_IMAGES }], | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	firstImage: 'Focus first image in ribbon', | 
					
						
							|  |  |  | 	lastImage: 'Focus last image in ribbon', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// zooming...
 | 
					
						
							|  |  |  | 	zoomIn: 'Zoom in', | 
					
						
							|  |  |  | 	zoomOut: 'Zoom out', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// NOTE: if this gets a count argument it will fit count images, 
 | 
					
						
							|  |  |  | 	// 		default is one.
 | 
					
						
							|  |  |  | 	fitImage: 'Fit image', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// XXX should these be relative to screen rather than actual image counts?
 | 
					
						
							|  |  |  | 	fitTwo: ['Fit two images', { fitImage: 2, }], | 
					
						
							|  |  |  | 	fitThree: ['Fit three images', { fitImage: 3, }], | 
					
						
							|  |  |  | 	fitFour: ['Fit four images', { fitImage: 4, }], | 
					
						
							|  |  |  | 	fitFive: ['Fit five images', { fitImage: 5, }], | 
					
						
							|  |  |  | 	fitSix: ['Fit six images', { fitImage: 6, }], | 
					
						
							|  |  |  | 	fitSeven: ['Fit seven images', { fitImage: 7, }], | 
					
						
							|  |  |  | 	fitEight: ['Fit eight images', { fitImage: 8, }], | 
					
						
							|  |  |  | 	fitNine: ['Fit nine images', { fitImage: 9, }], | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	fitMax: 'Fit the maximum number of images', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	fitSmall: 'Show small image', | 
					
						
							|  |  |  | 	fitNormal: 'Show normal image', | 
					
						
							|  |  |  | 	fitScreen: 'Fit image to screen', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// modes...
 | 
					
						
							| 
									
										
										
										
											2014-07-27 03:08:59 +04:00
										 |  |  | 	singleImageMode: 'Show single image', | 
					
						
							|  |  |  | 	ribbonMode: 'Show ribbon', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-27 03:08:59 +04:00
										 |  |  | 	toggleTheme: 'Toggle themes', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:35:24 +04:00
										 |  |  | 	// dialogs...
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 	// XXX move to specific blocks...
 | 
					
						
							| 
									
										
										
										
											2014-07-27 03:08:59 +04:00
										 |  |  | 	openDialog: 'Show open diaolg', | 
					
						
							|  |  |  | 	historyDialog: 'Show history dialog', | 
					
						
							|  |  |  | 	cropDialog: 'Show crop dialog', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:35:24 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	// panels...
 | 
					
						
							|  |  |  | 	togglePanels: '', | 
					
						
							|  |  |  | 	showInfoPanel: '', | 
					
						
							|  |  |  | 	showTagsPanel: '', | 
					
						
							|  |  |  | 	showSearchPanel: '', | 
					
						
							|  |  |  | 	showQuickEditPanel: '', | 
					
						
							|  |  |  | 	showStatesPanel: '', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:35:24 +04:00
										 |  |  | 	showHistoryPanel: '', | 
					
						
							|  |  |  | 	showDirBrowserPanel: '', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	showConsolePanel: '', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// developer actions...
 | 
					
						
							| 
									
										
										
										
											2014-07-27 03:08:59 +04:00
										 |  |  | 	showConsole: 'Show application console', | 
					
						
							|  |  |  | 	showDevTools: 'Show development tools', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // XXX think of a better name...
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var setupUIActions = | 
					
						
							|  |  |  | module.setupUIActions = | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | function setupUIActions(context, actions){ | 
					
						
							|  |  |  | 	return Actions(context, UI_ACTIONS, actions) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Marks actions...
 | 
					
						
							|  |  |  | // XXX move to marks.js
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var MARKS_ACTIONS = | 
					
						
							|  |  |  | module.MARKS_ACTIONS = { | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	toggleMark: '', | 
					
						
							|  |  |  | 	toggleMarkBlock: '', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-27 03:08:59 +04:00
										 |  |  | 	nextMarked: '', | 
					
						
							|  |  |  | 	prevMarked: '', | 
					
						
							|  |  |  | 	nextMarkedInRibbon: '', | 
					
						
							|  |  |  | 	prevMarkedInRibbon: '', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	markRibbon: '', | 
					
						
							|  |  |  | 	unmarkRibbon: '', | 
					
						
							|  |  |  | 	markAll: '', | 
					
						
							|  |  |  | 	unmarkAll: '', | 
					
						
							|  |  |  | 	invertMarkedRibbon: '', | 
					
						
							|  |  |  | 	invertMarkedAll: '', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 	// placing...
 | 
					
						
							|  |  |  | 	placeMarkedAfter: 'Place marked images after current', | 
					
						
							|  |  |  | 	placeMarkedBefore: 'Place marked images before current', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	shiftMarkedUp: '', | 
					
						
							|  |  |  | 	shiftMarkedDown: '', | 
					
						
							|  |  |  | 	shiftMarkedLeft: '', | 
					
						
							|  |  |  | 	shiftMarkedRight: '', | 
					
						
							| 
									
										
										
										
											2014-07-27 03:08:59 +04:00
										 |  |  | 	shiftMarkedUpNewRibbon: '', | 
					
						
							|  |  |  | 	shiftMarkedDownNewRibbon: '', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	cropMarkedImages: '', | 
					
						
							|  |  |  | 	cropMarkedImagesToSingleRibbon: '', | 
					
						
							| 
									
										
										
										
											2014-08-01 19:20:11 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	markDialog: 'Show mark dialog', | 
					
						
							|  |  |  | 	placeMarkedDialog: '', | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var setupMarksActions =  | 
					
						
							|  |  |  | module.setupMarksActions =  | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | function setupMarksActions(context, actions){ | 
					
						
							|  |  |  | 	return Actions(context, MARKS_ACTIONS, actions) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Bookmarks actions...
 | 
					
						
							|  |  |  | // XXX move to bookmarks.js
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var BOOKMARKS_ACTIONS = | 
					
						
							|  |  |  | module.BOOKMARKS_ACTIONS = { | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	toggleBookmark: 'Toggle image bookmark', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-27 03:08:59 +04:00
										 |  |  | 	nextBookmarked: '', | 
					
						
							|  |  |  | 	prevBookmarked: '', | 
					
						
							|  |  |  | 	nextBookmarkedInRibbon: '', | 
					
						
							|  |  |  | 	prevBookmarkedInRibbon: '', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | 	bookmarkMarked: 'Bookmark marked images', | 
					
						
							|  |  |  | 	unbookmarkMarked: 'Remove bookmarks from marked images', | 
					
						
							|  |  |  | 	toggleBookmarkMarked: 'Toggle bookmarks on marked images', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	clearRibbonBookmarks: 'Remove bookmarks in ribbon', | 
					
						
							|  |  |  | 	clearAllBookmarks: 'Clear all bookmarks', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	cropBookmarkedImages: '', | 
					
						
							|  |  |  | 	cropBookmarkedImagesToSingleRibbon: '', | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | var setupBookmarksActions = | 
					
						
							|  |  |  | module.setupBookmarksActions = | 
					
						
							| 
									
										
										
										
											2014-07-20 02:25:36 +04:00
										 |  |  | function setupBookmarksActions(context, actions){ | 
					
						
							|  |  |  | 	return Actions(context, BOOKMARKS_ACTIONS, actions) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /********************************************************************** | 
					
						
							|  |  |  | * vim:set ts=4 sw=4 :                                                */ | 
					
						
							| 
									
										
										
										
											2014-07-21 18:21:36 +04:00
										 |  |  | return module }) |