Roadmap
	[_] 64% Pre-Alpha - limited preview
		[_] 50% Supported formats
			[X] jpeg
			[_] RAW
		[_] 33% Usecases
			[_] view unprepared dir (read-only / tmp-cache / mem-cache)
			| XXX initially lags for hi-res images...
			[_] view unprepared dir (cache in background)
			| XXX initially lags for hi-res images...
			[X] view prepared dir
		[_] 57% UI
			[_] 0% Tablet-specific
				[_] screen buttons
			[X] 100% modes
				[X] single image
				[X] slideshow (single image)
				[X] ribbon
				[X] cropped mode
				| show only selected images
			[_] 71% other
				[X] load/open
				[X] browse for location (open)
				[X] select saved set
				[X] keyboard help
				[_] general help
				[_] settings
				[X] image info
		[X] 100% navigation
			[X] image next/prev
			[X] ribbon next/prev
			[X] screen next/prev
			[X] bookmarks next/prev
		[X] slideshow
		[_] 71% editing
			[X] 100% ribbon
				[X] merge up/down
				| via. marking... 
				|
				| still thinking if this is the right way...
				[X] sort
			[_] 92% image
				[X] shift up/down
				[X] shift left/right
				[X] mark/unmark (selection)
				[X] rotate left/right
				[X] flip H/V
				[_] 50% metadata
					[_] tag
					[X] note
				[X] open with external software
			[_] 42% marked (selected) set
				[X] crop (marked only mode)
				[_] tag
				[X] shift up/down
				[_] shift left/right
				[_] group
				[_] note
				[X] save as set
			[_] 50% crop selection via
				[X] marked
				[X] ribbon
				[_] tag
				[_] date
		[_] 54% storage and loading
			[_] 75% ImageGrid cache
				[X] generate
				[X] load
				[X] save
				[_] update
				| needs revision...
			[_] 75% fav tree
				[X] generate
				[X] load
				[X] save
				[_] update
				| at this time images are added to the tree but not removed...
			[_] 0% xmp files
				[_] generate
				| XXX make this native
				[_] load
				[_] save
				[_] update
			[_] 66% raw directory tree
				[X] load
				[X] save
				[_] update
		[_] 50% build targets
			[X] 100% Windows
				[X] CEF (Python/...)
				[X] node-webkit
			[X] MacOS X (node-webkit)
			| needs more work...
			[_] Android (PhoneGap)
			[_] iOS (PhoneGap)
			[_] Windows 8 (Native?)
			[X] Linux ia32 (node-webkit)
			[X] Linux x64 (node-webkit)
			[_] Windows Phone 8 (PhoneGap/Native)
	[_] 0% Alpha - limited preview
		[_] 0% editing
			[_] 0% ribbon
				[_] flatten
			[_] 0% image
				[_] crop
	[_] 0% Beta - public?
	[_] 0% 1.0 - public
	


[_] 31% Gen 3 current todo
	[_] 62% High priority
		[_] Might be a good idea to use sparse arrays for things like marks...
		| eliminate:	
		| 	- need for keeping things sorted all the time
		| 	- speed-up access -- everything has the same index
		| 	- speed-up modification -- just mirror all the operations
		| 	- searching in more than one place
		|
		| introduce:
		| 	- memory overhead - each array is always N elements
		| 	- conversion on import, export and crop
		| 		need to clear / insert all the nulls
		|
		| candidates:
		| 	- marks
		| 	- bookmarks
		| 	- tags
		[_] BUG: sorting breaks when at or near the end of a ribbon...
		|
		| Race condition...
		|
		| Procedure:
		| 	- go to end of a ribbon
		| 	- shift-s 
		| 		- select a sort method
		| 		- click "OK"
		|
		| NOTE: this will not break of sorting will not change the order of
		| 		visible images...
		| 		thus, if this the above procedure does not break do one of:
		| 			- ctrl-r (reverse) before sorting
		| 			- check "Descending" in the sort dialog
		| NOTE: this breaks because current the current image is not 
		| 		yet loaded/created when reloadViewer(..) tries to focus it...
		|
		| Temporary workaround:
		| 	because there is nothing wrong with sorting itself, just the
		| 	UI, the resulting state can be fixed by simply reloading the 
		| 	viewer (reloadViewer(true) or ctrl-alt-r)
		[_] BUG: sorting mis-aligns ribbons in some cases...
		| Example:
		| 				 oooo...	--[reverse]->	   ...oooo
		| 		...oooo[o]oooo...					...oooo[o]oooo...
		|
		| 		Should be:
		| 				 oooo...	--[reverse]->	 ...oooo
		| 		...oooo[o]oooo...					...oooo[o]oooo...
		|
		| 	The above can happen when, for example, sorting the images via data
		| 	and then sorting them in the same way with reverse checked...
		|
		| XXX is this related to?
		|	BUG: sorting breaks when at or near the end of a ribbon...
		[_] BUG: panels: open/close events get triggered on panel drag/sort...
		[_] buildcache: add option to control image sort...
		[_] ASAP: Need visual indicators for long operations...
		[_] 66% tags
			[X] local tags
			[_] global tag list
			[X] 100% actions
				[X] add
				[X] remove
				[X] update
				[X] select
				[X] list operations
				[X] ribbon (list) operations
				[X] marked (list) operations
				[X] bookmarked (list) operations
				[X] mark/unmark tagged
				[X] crop
		[_] 51% Panels
			[X] 100% panel constructors
				[X] panel
				[X] side-panel
				[X] sub-panel
			[_] 0% panel state
				[_] track panel state
				[_] use panel state for defaults when opening panels
			[_] 75% actions
				[X] 100% openPanel
					[X] if panel is not loaded load it
					[X] if a panel is not open, open it and all parents
					| XXX need to open auto-hidden side panels...
					[X] blink panel
				[_] openPanels
				[X] closePanel
				| collapse a panel...
				[X] removePanel
				| remove a panel
			[X] open panel dialog
			| list all registered panels...
			[_] 0% mechanics
				[_] serialization -- save/load panel state
				[_] sub-panel-oriented actions / key bindings
				| open a sub panel should:
				| 	- if it does not exist create it and create a parent panel
				| 	- if it exists, show it (open all parents)
				[_] data handlers work only if a panel is loaded/visible/open
				| and not break stuff when it's closed (as is now)...
				[_] show hide all panels (TAB key)
			[_] 33% new panels
				[_] info
					[_] general info
					[_] EXIF
					[_] IPCT / comment
				[_] tags
					[_] cloud
					[_] search
					[_] tree
				[X] editor
					[X] filters
					[X] snapshots
		[_] BUG: closing editor panel breaks next/prev image in single image mode
		| caused by editor action breaking and affecting image move...
		|
		| Procedure:
		| 	- Enter		- single image mode
		| 	- ctrl-e	- open editor
		| 	- close editor panel (destroy editor sub-panels)
		| 	- left or right
		|
		| This will produce an error in editor functionality that will break
		| image loading...
		|
		| NOTE: not fixing this right away as the way panel infrastructure 
		| 		is connected to the system needs a rewrite that will likely
		| 		fix this and other connected bugs...
		|
		[_] BUG: showImage(..) does not load the ribbons correctly...
		|
		| Procedure:
		| 	Load ribbon with ~28 images @ 4 images per screen width:
		|	lastImage()
		|	showImage(getImageGID(getRibbon().find('.image').first()))
		| or:
		| 	Load ribbon with ~28 images @ 4 images per screen width:
		|	firstImage()
		|	showImage(getImageGID(getRibbon().find('.image').last()))
		|
		| Expected:
		| 	- ribbon loaded and fills screen
		|
		| Effect:
		| 	- ribbon not loaded after current image
		| 	- reloadViewer() loads the state correctly
		|
		[_] BUG: OSX: unable to load absolute paths...
		[_] OSX: add alternatives to function buttons...
		[_] 50% normalize ribbons -- top-align sorted chunks
			[X] basic mechanics
			| splitData(...)
			| mergeData(...)
			| alignDataToRibbon(...)
			| shiftRibbonBy(...)
			[_] manual invoke mechanics
			| ctrl-s is a good candidate
			|
			| NOTE: might need a good preview to make this understandable...
			[_] auto-invoke mechanics (???)
			[X] 100% 'unsorted' tag mechanics...
				[X] remove tag on shift
				[X] remove tag on alignToRibbon(..)
				[X] add tag for new images (buildcache)
		[_] 33% FAST thumbnail generation strategies
			[_] 0% pass 1: generate really fast previews
				[_] ~1/3 screen - for ribbon
				[_] ~1 screen - for single image mode
			[X] pass 2: generate normal previews
			[_] extract existing raw thumbnails/previews (for RAW files)
		[_] EXTERNAL BUG: Chrome: CSS filters degrade scaled images. 
		| ...if at least one filter is applied, appears to only affect 
		| scaled images.
		|
		| Actual cause:
		| 	Bug in Blink-CSS-filters (BUG#329091) causing filters to 
		| 	mess up scaled (via CSS transforms) images.
		| 	Filed at:
		| 		https://code.google.com/p/chromium/issues/detail?id=329091&thanks=329091&ts=1387246111
		|
		| Status:
		| 	- Waiting for feedback...
		| 	- got a "Wont Fix" status, still negotiating...
		|
		| Workaround:
		| 	Make image size similar to screen size, in the best case 
		| 	scenario dynamic (too complex for what it gives), in the 
		| 	worse, just big enough.
		[_] 66% Bookmarks
			[X] toggle
			[X] save/load
			[X] 100% navigate
				[X] next/prev
			[X] crop
			[_] global
			[_] 0% metadata
				[_] comment
				[_] tags
		[_] BUG: opening a dir form history sometimes loads wrong size previews
		| this happens in part of the view and a refresh, reload or image
		| update (updateImages()) fixes the issue...
		[_] BUG: Something is causing previews to reload...
		|
		| Procedure:
		| 	- moving left/right in one ribbon
		| 	- adjacent ribbon is not moving
		|
		| Expected:
		| 	- all unmoving ribbons remain static
		|
		| Effect:
		| 	- previews get reloaded/redrawn
		|
		[_] UI: touch controls / toolbars...
		|
		| 	+-+-----------------------+-+
		| 	| |    				  	  | |
		| 	| |    				  	  | |
		| 	| |    	+-----------+ 	  | |
		| 	| |    	|			| 	  |<--- Button bar
		| 	| |    	|	Image	| 	  | |
		| 	| |    	|			| 	  | |
		| 	| |    	+-----------+ 	  | |
		| 	| |    				  	  | |
		| 	| |    				  	  | |
		| 	+-+-----------------------+-+
		|
		|
		| Basic layout:
		| 		Left bar			Right bar
		| 			help				config		+ low priority
		|
		| 			up					up			+
		| 			prev				next		| main controls
		| 			down				down		+  (under thumbs)
		|
		|											+
		| 			...					...			| misc controls
		|											+
		|
		| Things to have in buttons:
		| 	- navigation
		| 	- shift
		| 	- crop select / exit crop
		| 	- modes
		| 		- slideshow
		| 		- image/ribbon toggle
		| 	- zoom
		| 	- tags/metadata editor toggle
		| 	- image editor toggle
		| 	- open/history/...
		| 	- sort
		| 	- export
		[_] editable list of external commands...
		| to add things like exportdirs.py etc.
		[_] Export data...
		| same as export dirs but also include .ImageGrid/ dir with current
		| data and images...
		[_] BUG: after loading a non-existing dir, opening a new dir raises an error
		| i.e. the open dialog does not close, while the images are loaded...
		[_] BUG: sometimes opening a dir (open dialog) does not do anything...
		| Uncaught TypeError: Cannot call method 'indexOf' of undefined -- data.js:576
		[_] would be good to unify buildcache and viewer to use the same code...
		| rewrite buildcache in js?
		|
		| XXX this will need code reorganization to support node.js' require(...)
		| 		mechanics...
		[_] 75% add data updating to buildcache
			[X] non-destructive updates...
			| force create new data-set, backup old data 
			| default: update
			|
			| find and add new images to images.json and data.json
			| should be added as updates, i.e. 201310101445-data.json
			| and 201310101445-images-diff.json
			|
			| add new images to base ribbon
			|
			| NOTE: fav dirs are ignored by buildcache
			[X] --base-ribbon=N
			| default N=0 i.e. top ribbon
			[_] --reset-gids (???)
			| replace gids in data.json and images.json
			[X] fast update by default
			| - store a file-list in .ImageGrid/filelist.json
			| - make a pedantic update (current) optional via
			|   	--force-full-scan
		[_] add data updating to viewer...
		| make this separate from ribbonsFromFavDirs(...)
		|
		| might be good to make this semi-manual:
		| 	- notify user of "directory updated, load new data?"
		| 	- ctrl-r reload and load new data
		[_] 66% plugins -- isolate functionality:
			[X] register setup/init function...
			| a module can register setup function...
			[X] register image update functions...
			[_] isolate context key bindings...
			| essentially this may consist of:
			| 	injecting new config
			| 	shadowing 
		[_] update data set...
		| - add new images to the set
		| - update changed images
		[_] merge data sets...
		| combine two or more separate data.json and images.json sets...
		|
		| this can be done in two ways:
		| 	- live
		| 		the view jumps between sets and saves the changes to its 
		| 		origin set.
		| 		some operations like shifting left/right would be difficult
		| 	- full merge (preferred)
		| 		save a new data set.
		| 		not different to single data set.
		| 		will eventually need fragmenting...
		[_] fragmenting of data/images/marks support...
		| split data into chunks...
		|
		| need a simple way to split chunks to:
		| 	1) make the scheme as simple as possible
		| 	2) make things fast -- minimal read/write/cache
		| 	3) try not to depend on sort order
		|
		| a possible simple way out of this is to use a DB
		| 	- CouchDB
		| 	- SQL
		| 	- file-db
			[_] add ability to save/load ranges of images and the structures around them
			| e.g.load image 100 to current ribbon -> will load 100 images
			| for current ribbon and all the in between images from other
			| ribbons above and below...
		[_] BUG CLASS: everything should work with empty ribbons...
		| currently some code breaks when seeing an empty ribbon...
		[_] BUG: sometimes loading a raw directory stops at "error loading data.json"
		| and some times it does not err..
		|
		| Q: did not see this for some time, is this resolved???
		[_] BUG: sometimes images.json folder is created...
		| can't repeat this yet, and seen only once...
		[_] 0% full archive index
			[_] segmented loading of images and data
			[_] ribbon separation
			| split ribbon into manageable chunks
			|
			| this can be done naturally by:
			| 	- date
			| 	- event
			|	- tag
			[_] index and group ALL files in an archive
			[_] import metadata
			[_] real GIDs
		[_] save settings to config.json
		[_] Q: do we need separate theme settings?
		| ...for ribbon and single-image modes?
		[_] 0% keyboard.js
			[_] multiple key handler...
			| handle multiple key presses...
			|
			| one way to do this:
			| 	- a generic handler with timeout
			| 		- if key N pressed before timeout kandle it's action
			| 		- if timeout handle default action
			|
			| Q: how do we organize the config for this?
			| 	a) <key-spec> syntax, some thing like 'A, B'
			| 	b) complex handler with keys (in addition to modifiers)
			|
			[_] 0% online config editor API...
				[_] onKey(<key-spec>, handler[, mode])
				| <key-spec> should be something simple like a string
				|
				| Examples that should work:
				| 	'Enter'
				| 	'alt-F4'
				|
				| NOTE: with current config structure this is not that 
				| 		trivial
				[_] offKey(<key-spec>[, mode])
				[_] introspection
				| this is partially done already, need a simpler API for 
				| the user...
		[_] 50% Undo/Redo
			[X] basic one step (revert to last save)
			[_] push/pop state stack
		[_] revise reporting scheme...
		| showStatus(...) should be called uniformly, either at the source 
		| or a specific reporting layer...
		[_] side-by side view...
		[_] Simplify tool-tip structure in dialogs...
		| might also bee good to unify tool-tips across the app...
		[_] 55% mark-based operations
			[_] 75% cropping selection
				[X] marked
				[X] ribbon
				[X] by tag/collection
				[_] by group
			[X] shift up/down
			[X] tag
			[_] group
			| a group should behave as a single image but is 
			| viewable/expandable as a ribbon...
			|
			| should be two types of groups:
			| 	- strict - always as a single image
			| 		like a set of versions, processed and processing 
			| 		versions of the same image.
			| 		(auto-group?)
			| 	- loose - similar images, could be named collections
			| 		viewed individually, but can be accessed either from 
			| 		a list or a member image (primary).
			[_] collection
			| make or add to existing collection
		[_] 0% grouping / meta-image
			[_] versions w. label image
			| a set of images that is represented by one of the group
			[_] collection
		[_] 0% CSS
			[_] cleanup
			[_] split themes and layout
		[_] workflow editor (external app?)...
		| edit sequence of actions and events...
		|
		| Example:	
		| 	- on mount volume name X
		| 		-> make previews
		| 		-> make cache
		| 		-> import to index
		| 		-> run Viewer
		| 	- on Viewer data change
		| 		-> run exportdirs.py
		| 	- on tweak 
		| 		-> run Irfan view
		| 	- on edit
		| 		-> run Photoshop
		| 	- on PSD created
		| 		-> make preview
		| 		-> add to index
		| 		-> group with preview
		| 	...
		|
		|
		[_] BUG (low priority): dragging a sub-panel, over and out again is odd..
		| i.e. if the placeholder moves...
		|
		| Expected:
		| 	create a new panel and drop into it or revert
		|
		| Actual:
		| 	drops to last placeholder
		|
		[_] single image mode transition (alpha-blend/fade/none)
		[X] crop/filter/search dialog...
		| make a number of fields each accepting a filter -- string/regexp
		[X] Q: how do we mark unsorted sections in base ribbon after aligning?
		| - there is a big gap in the ribbon below, but it's not visible...
		| - can we "mark" big gaps? ...what's the threshold of "big"?
		|
		| Possible approaches:
		| 	- do not mark
		| 		In theory the base ribbon is always "final", thus marking and 
		| 		sorted/unsorted categories are un-needed complexity.
		| 		This plays well with the "auto-align" mechanics...
		| 		This may play well with bookmarking...
		| 	- sorted/unsorted images marking (viewed/unviewed)
		| 		This can be done in several ways:
		| 			- track viewing
		| 			- anything in the aligned group is "sorted"
		| 			- ...
		| 		Added complexity
		| 	- manual bookmarking
		|
		| Approach used:
		| 	- tag all new images with 'unsorted'
		| 	- remove tag on:
		| 		- shift up/down (i.e. on sort)
		| 		- align to ribbon
		| 		  this will remove the tag form images that were not 
		| 		  shifted.
		|
		| NOTE: with this approach effectively the base ribbon is the one,
		| 		and the only one, that contains 'unsorted' images.
		[X] 100% UI: side-panels...
			|
			| 	+-----+---------------+-----+
			| 	|	  |				  |		|
			| 	|	  |				  |		|
			| 	|	  |	+-----------+ |		|
			| 	|	  |	|			| |	  <---- side-panel
			| 	|	  |	|	Image	| |		|
			| 	|	  |	|			| |		|
			| 	|	  |	+-----------+ |		|
			| 	|	  |				  |		|
			| 	|	  |				  |		|
			| 	+-----+---------------+-----+
			|
			|		  +---------------+
			|			Viewer
			|
			|
			| NOTE: panes should be outside the viewer, so as not to overlap
			| 		with the image...
			| NOTE: we can also try and use top and bottom panes, but that 
			| 		might over-complicate things...
			[X] construct
			[X] style
			[X] lock/pin
			[X] autohide
		[X] BUG: shifting around images in very short ribbons produces lots of errors
		| Procedure:
		| 	- crop a ribbon of two-three images
		| 	- start shifting
		|
		| Problems:
		| 	- wrong alignment
		| 	- sometimes by shifting an image up the focus shifts to the 
		| 	  upper ribbon
		|
		| The direct cause of the problem:
		| 	- errors:
		| 		- SyntaxError - likely the JSON parser in getImageGID()
		| 		- TypeError - property of null
		|
		| Likely causes:
		| 	- we access images BEFORE they are initialized properly...
		|
		| Solution strategy:
		| 	- make aligning independent of DOM state where possible...
		| 	- make parts of the code wait for updates to finish...
		|
		|
		| Actual case:
		| 	- this was not a problem with race conditions...
		| 	- essentially all this took is a careful look at event and 
		| 	  action ordering, and a forgotten filter...
		| 	  (filtering for images is a possible bug class)
		[X] BUG: appear to be leaking memory on very large sets of images (>8K)
		| don't remember it before, so it might be due to the new 
		| loadImagesAround(..)
		|
		| Another place to check is pre-caching...
		|
		| Ran a test session -- we appear to never invalidate cache...
		|
		| Actual Cause: range check bug in getGIDsAfter(..) that caused
		| 		wrapping around 0 and caching of all images in the ribbon
		| 		by preCacheRibbonImages(..)...
		[X] BUG: shifting last image out of a ribbon misaligns the current ribbon
		| i.e. the prev ribbon was deleted and the new focused ribbon
		| is aligned as if it was not current...
		|
		| this is due to a race condition -- the alignment is done BEFORE 
		| the current image is set...
		[X] BUG: zooming vertical images in single image view results in size jumping...
		| Reason:
		| 	This is due to the proportion ratio changing in one step...
		|
		| Solution:
		| 	Make the proportion transition smoothly, at least in two zoom-steps
		[X] BUG: jumping more than one image in single image view messes up scale...
		|
		| Procedure:
		| 	- load: file:///L:/mnt/hdd13 (photo)/NTFS2/media/img/my/work/- 20131122Y.001/DCIM/preview (RAW)/
		| 	- go to single image mode
		| 	- press 2
		| 	- go to end
		| 	- press [ until a long jump between vertical and horizontal pics
		|
		| Effect:
		| 	- the size of the images will change
		|
		| Solution:
		| 	moved the proportions mode switch to preFittingImages handler
		|
		| Side-effect:
		| 	vertical images, in horizontal viewer, and vice-versa jump 
		| 	in size a bit when zooming past the threshold...
		| 	the amount of "jump" depends on viewer proportions vs. image
		| 	proportions...
		[X] BUG: history dialog is focused on a disabled field...
		| Procedure:
		| 	- open a dir
		| 	- rename dir
		| 	- ctrl-H
		|
		| Expected:
		| 	- current dir disabled and current
		| 	- first enabled field focused/checked
		|
		| Result:
		| 	- current dir is both focused/checked and disabled
		|
		[X] devise a better strategy to pruneBaseURLHistory(..)...
		| currently it will remove anything that does not exist.
		|
		| consider:
		|	- push non-existing to back
		|	- mark non-existing and show as disabled 
		[X] Feature: basic editor...
		| use CSS3 filters to edit and save edit values for:
		| 	- brightness
		| 	- contrast
		| 	- saturation
		| 	- hue
		| 	- grayscale
		| 	- sepia
		| 	- invert
		| 	- blur
		|
		| save settings and load them on a per preview basis...
		|
		| see: http://html5-demos.appspot.com/static/css/filters/index.html
		|
		| For UI use a left/right pane to "hold" the sliders...
		[X] BUG: editor also affects the image background and border...
		| to view just set invert to 1
		| 	- background turns white...
		| 	- red border turns blue...
		|
		| need to either compensate or figure out a way to work around 
		| this without adding ne tags...
		[X] URL history...
		[X] BUG: ribbons above and below are still sometimes loaded incorrectly
		| likely due to trying to align 
		[X] BUG: cropping in single image mode will change image scale...
		| likely a problem with reloadViewer(...)
		[X] BUG: align problems are back...
		| default data set (browser/images.js) same images #4 (going 
		| from right) & #5 (going from left) of 18 in the first ribbon 
		| get aligned wrong...
		|
		| this is at a zoom level with screen proportions...
		|
		| zooming to a different level affects which images are 
		| misaligned, at "max" #2 and #5 are affected...
		|
		| centerView() fixes this, but only for the current image...
		[X] BUG CLASS: file-name auto escaping...
		| mostly fixed, but need to check more thoroughly...
		[X] BUG: @ 9 image width, jumping to end of ribbon length 39 messes up loading...
		| problem likely in loadImagesAround(...)
		|
		|	- ribbon length 178 also ends up messing things up, while 68 and
		|	  69 pose no problems...
		|	- 19 images @ 5 per ribbon also breaks things...
		|
		| was a bug in rollImages(...)
		[X] BUG CLASS (ASAP!): race conditions due to browser rendering lag...
		| this happens when updating/adding lots of elements:
		| 
		| the update code is done and returns BEFORE the browser is done 
		| rendering the updates...
		|
		| one of the side-effects is that the updates or added elements
		| do not yet exist when the code is done and returned.
		|
		| XXX I do not know why or how but this appears to have gotten fixed
		| 		by rewriting loadImages(...) to loadImagesAround(...)
		[X] BUG: reloadViewer(...) loses image focus...
		| ...if the image is not near ribbon start.
		|
		| This is due to the fact that we are trying to focus an image
		| before the DOM is ready...
		|
		| To fix:
		| 	- make focusImage(...) in reload viewer run AFTER all the 
		| 	  images are created...
		|
		| XXX this is the cause for several other bugs...
		[X] BUG: sometimes duplicate images get loaded...
		| this happens when jumping back and forth on the mid ribbon until
		| the last element shows up and then moving left until the frame
		| around the image disappears...
		| at this point, this will return 2:
		|
		| 	$('[order='+$('.current.image').attr('order')+']').length
		|
		| happens when:
		| 	ribbon length: ~42
		| 	screen width: 4
		| 	jumping to end from start of ribbon
		|
		| Example 1:
		| 	1) first ribbon in (loaded at first image):
		|	 "F:\work\ImageGrid\cur\ImageGrid\src\ui\BUGS\ribbon loading error\"
		|	2) ctrl-end (error state in "jumping ribbon .." bug)
		|	3) left/right (next/prev image)
		|	now the last portion of the ribbon is loaded twice
		|
		| XXX possibly related to 
		|		 BUG CLASS (ASAP!): race conditions due to browser rendering lag...
		[X] BUG: jumping in ribbon sometimes does not load the ribbon correctly...
		| Example 1:
		| 	first ribbon in (loaded at first image):
		|	 "F:\work\ImageGrid\cur\ImageGrid\src\ui\BUGS\ribbon loading error\"
		|	jumping to the end will result in an inconsistent view:
		|		- ribbon not aligned at the correct spot
		|		- wrong image is .current
		|		- part of the images appear to be loaded but misaligned...
		|
		| Example 2:
		| 	load same data at same position as in #1
		| 		- shift-F2 to marked-only view
		| 		- go to end of ribbon (any means work)
		| 		- shift-F2 or Esc out of marked-only mode
		| 	this will result in a state very similar (if not identical) to
		| 	example #1...
		|
		|
		| NOTE: jumping back and forth several times will make this problem
		| 		go away...
		| 		Q: could this be initial load/state error?
		|
		| XXX possibly related to 
		|		 BUG CLASS (ASAP!): race conditions due to browser rendering lag...
		|
		| Appears to be fixed...
		[X] BUG: something wrong with the export dialog...
		| when a different destination is specified nothing is copied 
		| form the base ribbon...
		[X] BUG: need to prioretize marks loading...
		| if no markes.json is empty then localstorage marks will get 
		| loaded...
		[X] rework the marks.js/modes.js to enable multi-level ribbon cropping...
		[X] add indicator to ribbon up/down navigation in full screen...
		| this might be a number or some kind of animation...
		[X] BUG: scaling #2 in single image mode fits image to screen on wide screens
		[X] BUG: cropping in cropped mode will not save the whole data...
		[X] 100% BUG: sometimes the previews are not updated...
			[X] wrong resolution preview is loaded
			| when coming out of single-image-mode after moving to a 
			| different position (so as ribbons go reloaded)
			[X] previews do not get replaced at all, e.g. everything 
			| behaves correctly (order, etc.) but the previews are 
			| from wrong (ones before re-attaching) images
			| (this I can't repeat at this point)
			|
			| Example:
			|	URL: "file:///L:/mnt/P7000 (photo)/PHOTOS/Last week of September 2011/"
			|	going through the previews in the top row forward and backward
			|	watch the ribbon below -- on the way back everything is aligned
			|	correctly but the images are different.
			|	also, there are times when the ribbon below is partially loaded 
			|	or at it's edge when there are other images...
			|	NOTE: calling updateImages() will load the correct previews.
			|
			| The mechanics of this bug:
			| 	- sometimes the .onload handler gets the right image ref in 
			| 	  the closue but a wrong p_url, how can this happen I do not
			| 	  know.
			| 	- slowing down the browser appears to make this happen 
			| 	  less often, is this a race condition?
			|
			| Might be caused by fast sequential updating/reloading of an image:
			| 	- call the updateImage(...) in order several times
			| 	- cache .onload events get called in order of images loading 
			| 	  not in order of updateImage(...) calls...
			| (this cause is not confirmed)
			|
			| Apparently fixed by storing the preview URL in image.data(), this 
			| is slower but avoids problems with multiple updates and races...
		[X] make tooltip balloons on top of everything else...
		| currently a tooltip balloon is bellow the next tooltip...
		[X] add min-height to tooltips
		| one line tooltip-right get messed-up...
		[X] add option to export either original or preview (exportDialog)
		[X] BUG: when creating previews for small-ish pics the original is not used
		| after updating the image...
		|
		| e.g. for a 900px image, 150px and 350px images are created and
		| the 350px is used in full screen.
		[X] 100% basic dialogs
			[X] select from list
			[X] alert
			[X] prompt
			[X] open directory (native)
		[X] BUG: context status does not get updated on Ctrl-D
		[X] single ribbon mode
		| should this have up/down navigation?
		|
		| something like showGidsAsRibbon(gids) would be generic and logical...
		[X] build cache in background...
		| this must be done while updating IMAGES live...
		[X] 100% dialog constructor
			[X] widget: text
			[X] widget: bool
			[X] widget: choice
			[X] widget: dir/ndir
			| browser native (dir) and custom (ndir) directory selector...
		[X] 100% image sorting (date/name/...)
			[X] 100% sort by:
				[X] date
				[X] name
				[X] manual shift left/right/position
				| position shift is mark and shift here..
			[X] 100% Sort ui
				[X] reverse
				[X] select sort method
		[X] usable empty view -- w.o. data...
		[X] 100% UI elements
			[X] indicators
			[X] image info
			[X] stub info dialog
			[X] detailed image info
		[X] build for windows (node-webkit)
		[X] BUG: scaling is again broken with rotated images
		| - rotate an image
		| - scale it to 1 (press 1)
		[X] BUG: BASE_URL seems to gain a new trailing '/' on each save...
		| low priority as this does not affect anything...
		[X] 100% gesture support
			[X] up/down - navigate
			[X] left/right - navigate
		[X] make the marks in single image mode show in corner of viewer, not image
		| and think of a uniform indicator position...
		|
		| 	+---------------------------+
		| 	|					   oooo	| <-- global indicators
		| 	|							|		(all modes)
		| 	|							|
		| 	|							|
		| 	|							|
		| 	|							|
		| 	|							|
		| 	|							|
		| 	|							|
		| 	|					   oooo	| <-- context indicators
		| 	+---------------------------+		(single image mode)
		|
		| make global indicators semi-transparent in single-image-mode, so as to 
		| indicate their lesser priority than context/image indicators...
		|
		| keep image indicators within the image square for ribbon mode...
		|
		| possible indicator styles:
		| 	- letter, expand on hover
		| 	- colored circle -- show text of same color under or to the side on hover
		|
		| might bee nice too use both styles, one for images one for global...
		[X] BUG: shifting ribbon left sometimes results in wrong order...
		| i.e. an image with order 12 before image with order 11
		|
		| Example:
		| 	- default image set
		| 	- move first image 2 positions right
		|
		| Resulting state:
		| 	- current image order: 12
		| 	- next image order: 11
		| 	- prev image order: 10
		|
		| This is stably reproducible.
		[X] BUG: changing window size (F11) in single image modes messes things up...
		| some images are of different sizes (newly loaded) and aligned in a wrong way...
		|
		| appears not to affect square-fit view...
		|
		| until we cycle to ribbon mode and back...
		| 
		| Q: does this trigger the on-resize event???
		| A: no, not connected...
		|
		| possible that this is connected with the align/load bug...
		|
		| appears to be a state leak, this affects:
		| 	- correctImageProportionsForRotation(image) -- mis-alignes images
		| 	  while after cycling single image mode, behaves correctly...
		| 	- affects finNImages(...) -- uses old size of viewer...
		[X] BUG: aligning still sometimes gets off...
		| ...after rotating a number of images
		|
		| happens when:
		| 	- getScreenWidthInImages() < 2
		| 	- looking through images in one direction and back, some get misaligned
		| 		...this is stable behaviour by centerRibbon(...), 
		| 		calling it again will not fix this.
		| 		moving next/prev will fix the issue until it comes back again
		| 	- affected by LOAD_SCREENS and number of images in ribbon
		| 		current figures:
		| 			Ribbon: 18
		| 			Position going forward: 4
		| 			Position going back: 1
		| 			LOAD_SCREENS: 6
		| 	NOTE: changing LOAD_SCREENS moves the affected positions.
		| 	NOTE: had a similar bug where some images still kept their 
		| 			prior sizing after recycling...
		| 			...check if centerRibbon(...) and correctImageProportionsForRotation(...)
		| 			are called in right sequence...
		[X] BUG: keyboard.js, some combinations resolve problems...
		| in current help shows E, F4, alt-F4 as "Open image in ..."
		| 	- E and F4 work OK
		| 	- alt-F4 both close the viewer (default) and open an image.
		|
		| Example:
		| 	E: doc('Open image in external software', openImage),
		|	F4: {
		|			default: 'E',
		|			alt: doc('Close viewer'),
		|		},
		|
		[X] reverse ribbons...
		[X] slideshow mode...
		[X] default STUB image...
		| or a loading animation..
		|
		| ...would be good to make something pixilated so as to look nise 
		| on various magnifications.
		|
		| keep always cached.
		[X] import fav dirs (wo. index)...
		[X] ASAP: load/view un-cached directories...
		[X] ASAP: support relative paths in cache...
		[X] ASAP: account for image rotation with screen proportions while positioning
		| getRelativeVisualPosition(...) gives an odd position when:
		| 	- image is rotated
		| 	- image is screen-proportioned
		[X] NOTE: rotating might still produce alignment errors
		| this is due:
		| 	- most outerWidth/outerHeight being used do not account for margins...
		[X] ASAP: rotate images in the viewer...
		| This is a tad complicated by:
		| 	- marks
		| 	- image elem proportions that can change
		[X] 100% themes
			[X] light
			[X] gray
			[X] dark
		[X] make focus up/down chose a closest independently of direction...
		| navigation should be stable and moving up then down should yield 
		| exactly the same result...
		[X] ASAP: rewrite binSearch!! 
		| linSearch obviously is not usable for large sets of data...
		[X] split saving/loading into files and localStorage
		| DATA
		| 	- stored in localStorage
		| 	- stored in file
		| IMAGES
		| 	- stored only in files (does not change)
		|
		[X] 100% modes
			[X] ribbon
			[X] single-image
		[X] Save/load state
		[X] 100% action visual indication
			[X] first/last image
			[X] shift up/down
	[_] Low priority
		[_] Help
		[_] Keyboard config
		[_] general config
		


[_] 74% Gen 3 UI implementation
	[X] 100% Infinite ribbon (lib)
		[X] cyclic ribbon
		[X] image block generation
		[X] image block update
		[X] ribbon head/tail management
		| must be adaptive to current user scroll speed...
		|
		| at least a couple of screens at current zoom level...
	[_] Partial save/load
	| save only a block or changed data...
	[X] Adaptive preview size (lib)
	[X] Multiple ribbon (reuse)
	[_] 44% User actions
		| see [[controls.otl]] for basic actions...
		|
		| additional actions:
		[X] 100% toggle mark image
			[X] mark between
			| mark all images between closest marks
			[X] mark all/none
			[X] mark invert
		[X] show marked only in ribbon (crop selection)
		[_] crop image
		| shows a red/blue rectangle around image
		|
		| can be:
		| 	turned +/- 90 deg
		| 	turned arbitrarily
		| 	scaled with constrained proportions
			[_] show crop as red rectangle
			[_] show only cropped area
			[_] show crop as black veil
		[X] add note to image
		| a-la flickr notes...
		[_] edit IPCT
		[_] add/edit tags (set of images)
		[_] add/edit tags (single image)
		[X] rotate image
	[X] 100% UI modes
		[X] 100% single ribbon
			[X] show marked only
			[X] show current ribbon
			[X] show images shifted (all / above only / below only) in current ribbon
		[X] 100% multiple ribbons
			[X] show images above/below
			[X] show marked only
		[X] 100% single image


.
| vim:set spell :
