diff --git a/ui/TODO.otl b/ui/TODO.otl index 144e1a0b..e367fcf1 100755 --- a/ui/TODO.otl +++ b/ui/TODO.otl @@ -1,7 +1,7 @@ Priority work - [_] 62% Preview II - [_] 5% dynamic loading of images - [_] 11% stream on navigate + [_] 66% Preview II + [_] 41% dynamic loading of images + [_] 83% stream on navigate | parameters that affect loading: | - current view size -> image size must be closest | above this @@ -16,18 +16,18 @@ Priority work | can reach an image not just by navigating close but | also by scrolling/dragging to it (without changing the | current image)... - [_] store structure separately from ui (mirror context) + [X] store structure separately from ui (mirror context) | an alternative would be to store the whole thing (sans images) | in DOM, but that ma get very big. | | storing the structure will enable us to have partial structures | thus updating the structure of a very big set without the user | noticing. - [_] 33% sync context (handle edit events) + [_] 50% sync context (handle edit events) [X] identify action position | use id... - [_] handle edit events - [_] update ui structure (handle navigate/move events) + [_] handle edit events XXX + [X] update ui structure (handle navigate/move events) [_] sizes on zoom [_] make shift up/down direction-aware... | i.e. if we are going through images in a direction select the diff --git a/ui/experiments/dynamic-loading.html b/ui/experiments/dynamic-loading.html index b598942d..cbb7bb77 100755 --- a/ui/experiments/dynamic-loading.html +++ b/ui/experiments/dynamic-loading.html @@ -116,7 +116,7 @@ function enumerate(obj, predicate){ function makeImage(id){ return $('
') .attr({id: id}) - .click(selectImage) + .mousedown(selectImage) .addClass('unloaded') } @@ -136,12 +136,11 @@ function loadJSON(json){ makeImage(j).appendTo(ribbon) } } - $('#'+cur_id).click() + $('#'+cur_id).mousedown() } -function updateRibbon(img){ +function updateRibbonImages(img, r){ var images = img.parents('.ribbon').children('.image') - var r = Math.floor(LOAD/2) var cur_i = images.index(img) @@ -151,15 +150,13 @@ function updateRibbon(img){ loading.push(images[i]) images[i] = {} } - loading + // do the loading... + loading.filter('.unloaded') .addClass('loaded') .removeClass('unloaded') // unload... images.filter('.loaded').removeClass('loaded').addClass('unloaded') - //$('.image.loaded').not('._cur').removeClass('loaded').addClass('unloaded') - //images.filter('._cur').removeClass('_cur') - $('.image._cur').removeClass('_cur') } function selectImage(){ @@ -170,7 +167,7 @@ function selectImage(){ json.position = $(this).attr('id') // update visible images... //loadJSON(json) - updateRibbon($('.current.image')) + updateRibbonImages($('.current.image'), Math.floor(LOAD/2)) } loadJSON(json) diff --git a/ui/fullscreen.html b/ui/fullscreen.html index d9bdd99f..b48e86b3 100755 --- a/ui/fullscreen.html +++ b/ui/fullscreen.html @@ -86,6 +86,8 @@ $(document) // XXX need to avoid data URLs here and use plain old paths... ribbon.append(makeImage(e.target.result, i)) $('.image').first().click() + // XXX really UGLY and bad... + ImageGrid.image_data = buildJSON() } }(i, ribbon) reader.readAsDataURL(f) diff --git a/ui/gallery-prototype.js b/ui/gallery-prototype.js index 8b01205c..342e702f 100755 --- a/ui/gallery-prototype.js +++ b/ui/gallery-prototype.js @@ -1162,7 +1162,67 @@ function makeImage(url, order, set_order){ } return (setupImageEventHandlers( set_order($('') - .css({ 'background-image': 'url('+url+')' }), order))) + //.css({ 'background-image': 'url('+url+')' }), order))) + , order))) +} + +// NOTE: this is largely independent of ImageGrid.image_data structure, +// it needs only content... +function getURL(id){ + var json = ImageGrid.image_data + var ribbons = json.ribbons + + for(var i=0; i