diff --git a/buildcache.py b/buildcache.py index 10a9cba5..1986b4d8 100755 --- a/buildcache.py +++ b/buildcache.py @@ -1,7 +1,7 @@ #======================================================================= __version__ = '''0.0.01''' -__sub_version__ = '''20131018000820''' +__sub_version__ = '''20131018001840''' __copyright__ = '''(c) Alex A. Naanou 2011''' @@ -365,7 +365,7 @@ def build_images(path, config=CONFIG, gid_generator=hash_gid, dry_run=False, ver orientation = 0 # build a file-list... - ##!!! should this be split out into a seporate function??? + # XXX should this be split out into a seporate function??? filelist = pathjoin(path, cache_dir, config['filelist']) # NOTE: we do not need to filter anything here as all the filtering # will anyway happen later on... diff --git a/ui/TODO.otl b/ui/TODO.otl index 76401cef..30dd08ac 100755 --- a/ui/TODO.otl +++ b/ui/TODO.otl @@ -109,7 +109,7 @@ Roadmap [_] 27% Gen 3 current todo - [_] 54% High priority + [_] 55% High priority [_] 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"? @@ -215,7 +215,8 @@ Roadmap | - CouchDB | - SQL | - file-db - [_] BUG CLASS: file-name auto escaping... + [X] BUG CLASS: file-name auto escaping... + | mostly fixed, but need to check more thoroughly... [_] BUG CLASS: everything should work with empty ribbons... | currently some code breaks when seeing an empty ribbon... [_] BUG: jumping in ribbon sometimes does not load the ribbon correctly... diff --git a/ui/data.js b/ui/data.js index e6f9d895..ccefd782 100755 --- a/ui/data.js +++ b/ui/data.js @@ -172,10 +172,23 @@ function concatZip(){ } +function getImageFileName(gid, images, do_unescape){ + gid = gid == null ? getImageGID() : gid + images = images == null ? IMAGES : images + do_unescape = do_unescape == null ? true : do_unescape + + if(do_unescape){ + return unescape(images[gid].path.split('/').pop()) + } else { + return images[gid].path.split('/').pop() + } +} + + // Get the first sequence of numbers in the file name... function getImageNameSeq(gid, data){ data = data == null ? IMAGES : data - var n = data[gid].path.split('/').pop() + var n = getImageFileName(gid, data) var r = /([0-9]+)/m.exec(n) return r == null ? n : parseInt(r[1]) } @@ -185,7 +198,7 @@ function getImageNameSeq(gid, data){ // at the filename start... function getImageNameLeadingSeq(gid, data){ data = data == null ? IMAGES : data - var n = data[gid].path.split('/').pop() + var n = getImageFileName(gid, data) var r = /^([0-9]+)/g.exec(n) return r == null ? n : parseInt(r[1]) } diff --git a/ui/files.js b/ui/files.js index c38c65e8..c24179f6 100755 --- a/ui/files.js +++ b/ui/files.js @@ -196,7 +196,7 @@ function ribbonsFromFavDirs(path, images, cmp){ var index = {} var name for(var gid in images){ - name = images[gid].path.split('/').pop() + name = getImageFileName(gid) // XXX we assume that names are unique... index[name] = gid } @@ -643,7 +643,7 @@ function exportTo(path, im_name, dir_name, size){ var gid = ribbon[j] // get correct preview... var src = getBestPreview(gid, size).url - var orig = IMAGES[gid].path.split('/').pop() + var orig = getImageFileName(gid) // XXX might be a good idea to combine this with docs as a // single mechanism... diff --git a/ui/info.js b/ui/info.js index 68d31a25..62b15713 100755 --- a/ui/info.js +++ b/ui/info.js @@ -59,7 +59,7 @@ function updateGlobalImageInfo(image){ // path... ''+ ''+ - unescape(data.path.split('/').pop()) + + getImageFileName(gid) + ''+ '