some cleanup, updated todo...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-05-26 03:34:15 +04:00
parent c286950508
commit cbc448089d
3 changed files with 23 additions and 10 deletions

View File

@ -1,5 +1,5 @@
[_] 24% Gen 3 current todo [_] 22% Gen 3 current todo
[_] 48% High priority [_] 44% High priority
[_] BUG: aligning still sometimes gets off... [_] BUG: aligning still sometimes gets off...
| ...after rotating a number of images | ...after rotating a number of images
| |
@ -20,8 +20,10 @@
| prior sizing after recycling... | prior sizing after recycling...
| ...check if centerRibbon(...) and correctImageProportionsForRotation(...) | ...check if centerRibbon(...) and correctImageProportionsForRotation(...)
| are called in right sequence... | are called in right sequence...
[_] ASAP: support relative paths in cache... [_] BUG: changing window size in single image modes messes things up...
| until we cycle to ribbon mode and back...
[_] ASAP: load/view un-cached directories... [_] ASAP: load/view un-cached directories...
[_] slideshow mode...
[_] import fav dirs (wo. index)... [_] import fav dirs (wo. index)...
[_] add ability to save/load ranges of images and the structures around them [_] 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 | e.g.load image 100 to current ribbon -> will load 100 images
@ -81,6 +83,7 @@
[_] thresholds and frame size [_] thresholds and frame size
[_] remove extra and repetitive actions [_] remove extra and repetitive actions
[_] caching config [_] caching config
[X] ASAP: support relative paths in cache...
[X] ASAP: account for image rotation with screen proportions while positioning [X] ASAP: account for image rotation with screen proportions while positioning
| getRelativeVisualPosition(...) gives an odd position when: | getRelativeVisualPosition(...) gives an odd position when:
| - image is rotated | - image is rotated

View File

@ -324,6 +324,9 @@ function normalizePath(url, base, mode){
mode = mode == null ? 'absolute' : mode mode = mode == null ? 'absolute' : mode
base = base == null ? BASE_URL : base base = base == null ? BASE_URL : base
// windows path...
// absolute path... // absolute path...
if(/^(file|http|https):\/\/.*$/.test(url)){ if(/^(file|http|https):\/\/.*$/.test(url)){
// check if we start with base, and remove it if so... // check if we start with base, and remove it if so...
@ -652,13 +655,17 @@ function loadLocalStorageData(attr){
if(data == null){ if(data == null){
data = '{}' data = '{}'
} }
return JSON.parse(data) return {
data: JSON.parse(data),
base_url: localStorage[attr + '_BASE_URL'],
}
} }
function saveLocalStorageData(attr){ function saveLocalStorageData(attr){
attr = attr == null ? DATA_ATTR : attr attr = attr == null ? DATA_ATTR : attr
localStorage[attr] = JSON.stringify(DATA) localStorage[attr] = JSON.stringify(DATA)
localStorage[attr + '_BASE_URL'] = BASE_URL
} }
@ -683,7 +690,9 @@ function saveLocalStorageImages(attr){
// generic save/load... // generic save/load...
function loadLocalStorage(attr){ function loadLocalStorage(attr){
attr = attr == null ? DATA_ATTR : attr attr = attr == null ? DATA_ATTR : attr
DATA = loadLocalStorageData(attr) var d = loadLocalStorageData(attr)
BASE_URL = d.base_url
DATA = d.data
IMAGES = loadLocalStorageImages(attr) IMAGES = loadLocalStorageImages(attr)
return loadData() return loadData()
} }
@ -751,7 +760,6 @@ function loadFileImages(path, callback){
} }
// XXX add relative path support (via. normalizePath(...))
function loadFile(data_path, image_path, callback){ function loadFile(data_path, image_path, callback){
var base = data_path.split(CACHE_DIR)[0] var base = data_path.split(CACHE_DIR)[0]
base = base == data_path ? '.' : base base = base == data_path ? '.' : base
@ -835,11 +843,11 @@ function openImage(){
// XXX need revision... // XXX need revision...
function loadDir(path){ function loadDir(path){
return loadFile(path +'/data.json') return loadFile(BASE_URL +'/data.json')
.fail(function(){ .fail(function(){
loadFile(path +'/.ImageGrindCache/data.json') loadFile(BASE_URL +'/'+ CACHE_DIR +'/data.json')
.fail(function(){ .fail(function(){
// XXX load separate images... // XXX load plain images...
// XXX // XXX
}) })
}) })

View File

@ -461,7 +461,9 @@ $(function(){
if((DATA_ATTR + '_IMAGES_FILE') in localStorage){ if((DATA_ATTR + '_IMAGES_FILE') in localStorage){
var loading = loadFileImages(localStorage[DATA_ATTR + '_IMAGES_FILE']) var loading = loadFileImages(localStorage[DATA_ATTR + '_IMAGES_FILE'])
.done(function(){ .done(function(){
DATA = loadLocalStorageData() var d = loadLocalStorageData()
DATA = d.data
BASE_URL = d.base_url
loadData() loadData()
}) })