updated version docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-12-20 06:37:08 +04:00
parent 457f295f10
commit b8d3cfde4d
3 changed files with 31 additions and 15 deletions

View File

@ -5,6 +5,8 @@
**********************************************************************/ **********************************************************************/
// list of bookmarked gids... // list of bookmarked gids...
//
// NOTE: this must be sorted in the same order as DATA.order
var BOOKMARKS= [] var BOOKMARKS= []
// bookmark data // bookmark data
@ -78,14 +80,6 @@ var toggleBookmark = makeMarkToggler(
// add a bookmark... // add a bookmark...
if(action == 'on'){ if(action == 'on'){
if(BOOKMARKS.indexOf(gid) == -1){ if(BOOKMARKS.indexOf(gid) == -1){
/*
BOOKMARKS.push(gid)
// XXX is this too expensive???
// ...a way to avoid sorting is to:
// BOOKMARKS.splice(
// getGIDBefore(gid, BOOKMARKS)+1, 0, gid)
BOOKMARKS.sort(imageOrderCmp)
*/
insertGIDToPosition(gid, BOOKMARKS) insertGIDToPosition(gid, BOOKMARKS)
} }

View File

@ -14,14 +14,35 @@
// Major version change mean a significant incompatibility. // Major version change mean a significant incompatibility.
// //
// Minor version changes mean some detail changed and can be handled // Minor version changes mean some detail changed and can be handled
// by it's specific handler seamlessly. // by it's specific handler seamlessly. Backwards compatible.
//
//
// For more info see:
// DATA - main data
// IMAGES - image data
// MARKED - marks data
// BOOKMARKS - bookmarks data
// BOOKMARKS_DATA - bookmarks metadata
//
// //
// Changes: // Changes:
// 2.0 - completely and incompatible new format // none - Gen1 data format, mostly experimental,
// - use convertDataGen1(..) to update old data // - has no explicit version set,
// 2.1 - MARKED now maintained sorted // - not used for real data.
// - will auto-update on loading marks to 2.1 of 2.1 data, will // 2.0 - Gen3 data format, still experimental,
// need a re-save // - completely and incompatibly new structure,
// - use convertDataGen1(..) to convert Gen1 to 2.0
// - auto-convert form gen1 on load...
// - used for my archive, not public,
// 2.1 - Minor update to format spec,
// - MARKED now maintained sorted, live,
// - will auto-sort marks on load of 2.0 data and change
// data version to 2.1, will need a re-save,
//
// NOTE: Gen1 and Gen3 refer to code generations rather than data format
// iterations, Gen2 is skipped here as it is a different project
// (PortableMag) mostly built on the same code base as
// ImageGrid.Viewer
var DATA_VERSION = '2.1' var DATA_VERSION = '2.1'

View File

@ -6,6 +6,7 @@
//var DEBUG = DEBUG != null ? DEBUG : true //var DEBUG = DEBUG != null ? DEBUG : true
// NOTE: this must be sorted in the same order as DATA.order
var MARKED = [] var MARKED = []
var MARKED_FILE_DEFAULT = 'marked.json' var MARKED_FILE_DEFAULT = 'marked.json'
@ -562,7 +563,7 @@ var loadFileMarks = makeFileLoader(
// XXX is this the correct way to do this??? // XXX is this the correct way to do this???
DATA.version = DATA_VERSION DATA.version = DATA_VERSION
console.warn('Marks: sort: done ('+( t1 - t0 )+'ms) -- resave the data.') console.warn('Marks: sort: done ('+( t1 - t0 )+'ms) -- re-save the data.')
}, 0) }, 0)
} }
}, },