diff --git a/ui/TODO.otl b/ui/TODO.otl index 9e33f0b7..c9b87c1f 100755 --- a/ui/TODO.otl +++ b/ui/TODO.otl @@ -1,6 +1,6 @@ Priority work - [_] 63% Preview II - [_] 40% save state + [_] 67% Preview II + [_] 42% save state [X] minimal: Local Storage (manual) | works across all targets (CEF, PhoneGap, browser) [_] local JSON (file) @@ -8,10 +8,12 @@ Priority work [_] 0% autosave [_] on edit [_] on timer + [X] manual save + [_] manual named save [X] versions/history - [_] 33% load state + [_] 66% load state [X] load mechanics - [_] auto-load last state on startup + [X] auto-load last state on startup [_] manual [_] 50% load folder [X] drag'n'drop diff --git a/ui/fullscreen.html b/ui/fullscreen.html index 674ee72c..8091bb8c 100755 --- a/ui/fullscreen.html +++ b/ui/fullscreen.html @@ -117,8 +117,9 @@ function setup(){ // XXX not allowed... //$.getJSON('images.js', loadImages}) // XXX STUB - //loadImages(image_list) - loadJSON(image_list) + //loadJSON(image_list) + + ImageGrid.load() // set the default position and init... $('.current.image').click() diff --git a/ui/gallery-prototype.js b/ui/gallery-prototype.js index 1f2a22a7..207d1995 100755 --- a/ui/gallery-prototype.js +++ b/ui/gallery-prototype.js @@ -1096,17 +1096,19 @@ function makeImage(url, order, set_order){ -function loadImages(json){ - var images = json.images - var ribbon = $('.ribbon').last() +function loadImagesFromList(images){ + var field = $('.field') - $('.image').remove() + field.children('.ribbon').remove() + + var ribbon = $('
') + .appendTo(field) for(var i = 0; i < images.length; i++){ makeImage(images[i], i) .appendTo(ribbon) } - ribbon.children().first().click() + $('.image').first().click() } @@ -1153,7 +1155,6 @@ function buildJSON(get_order){ -// XXX use this instead of loadImages(...) // XXX might be good to add images in packs here, not one by one... function loadJSON(data, set_order){ if(set_order == null){ @@ -1286,6 +1287,12 @@ function makeKeyboardHandler(keybindings, ignore, unhandled){ /************************************************ Mode & UI Actions **/ ImageGrid.GROUP('Mode: All', + ImageGrid.ACTION({ + title: 'Save current state.', + }, + function saveState(){ + ImageGrid.save() + }), ImageGrid.ACTION({ title: 'Get the background mode', display: false, diff --git a/ui/keybindings.js b/ui/keybindings.js index 8f9e5888..cb4f359f 100755 --- a/ui/keybindings.js +++ b/ui/keybindings.js @@ -24,6 +24,7 @@ var keybindings = { 73: ImageGrid.toggleCurrentRibbonOpacity, // i 77: toggleMarkers, // m + 87: ImageGrid.saveState, // w 27: ImageGrid.closeOverlay, // Esc