fixed a bug with escaped filenames containing spaces, now normalizePath(...) unescapes by default (watchout for auto-escaping as a bug class)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-10-16 03:42:42 +04:00
parent 943410fceb
commit 80fc58593a
4 changed files with 13 additions and 6 deletions

View File

@ -109,7 +109,7 @@ Roadmap
[_] 27% Gen 3 current todo [_] 27% Gen 3 current todo
[_] 55% High priority [_] 54% High priority
[_] Q: how do we mark unsorted sections in base ribbon after aligning? [_] 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... | - 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"? | - can we "mark" big gaps? ...what's the threshold of "big"?
@ -387,6 +387,9 @@ Roadmap
[_] remove extra and repetitive actions [_] remove extra and repetitive actions
[_] caching config [_] caching config
[_] side-by side view... [_] side-by side view...
[X] BUG: something wrong with the export dialog...
| when a different destination is specified nothing is copied
| form the base ribbon...
[X] BUG: need to prioretize marks loading... [X] BUG: need to prioretize marks loading...
| if no markes.json is empty then localstorage marks will get | if no markes.json is empty then localstorage marks will get
| loaded... | loaded...

View File

@ -580,10 +580,12 @@ function setBaseURL(url){
// - return relative paths as-is // - return relative paths as-is
// //
// NOTE: mode can be either 'absolute' (default) or 'relative'... // NOTE: mode can be either 'absolute' (default) or 'relative'...
function normalizePath(url, base, mode){ function normalizePath(url, base, mode, do_unescape){
base = base == null ? getBaseURL() : base base = base == null ? getBaseURL() : base
//mode = /^\./.test(base) && mode == null ? 'relative' : null //mode = /^\./.test(base) && mode == null ? 'relative' : null
mode = mode == null ? 'absolute' : mode mode = mode == null ? 'absolute' : mode
// XXX is this the correct default?
do_unescape = do_unescape == null ? true : do_unescape
res = '' res = ''
@ -626,7 +628,11 @@ function normalizePath(url, base, mode){
// XXX legacy support... // XXX legacy support...
res = res.replace('.ImageGridCache', CACHE_DIR) res = res.replace('.ImageGridCache', CACHE_DIR)
return res if(do_unescape){
return unescape(res)
} else {
return res
}
} }
@ -1547,7 +1553,6 @@ function updateRibbonOrder(no_reload_viewer){
} }
// Action wrapper of alignDataToRibbon(...) // Action wrapper of alignDataToRibbon(...)
// //
// Align ribbons to the current ribbon. // Align ribbons to the current ribbon.

View File

@ -59,7 +59,7 @@ function updateGlobalImageInfo(image){
// path... // path...
'<span class="expanding-text path">'+ '<span class="expanding-text path">'+
'<span class="shown">'+ '<span class="shown">'+
data.path.split('/').pop() + unescape(data.path.split('/').pop()) +
'</span>'+ '</span>'+
'<span class="hidden" '+ '<span class="hidden" '+
'style="position:absolute;'+ 'style="position:absolute;'+

View File

@ -325,7 +325,6 @@ function getStatus(){
} }
// XXX move to ui.js?
function makeIndicator(text){ function makeIndicator(text){
return $('<span class="indicator expanding-text">'+ return $('<span class="indicator expanding-text">'+
'<span class="hidden">'+ text +'</span>'+ '<span class="hidden">'+ text +'</span>'+