diff --git a/ui (gen4)/images.js b/ui (gen4)/images.js index 0bc9f89f..23fc3492 100755 --- a/ui (gen4)/images.js +++ b/ui (gen4)/images.js @@ -24,6 +24,9 @@ if(typeof(sha1) != 'undefined'){ } + + + /*********************************************************************/ // A stub image, also here for documentation... diff --git a/ui (gen4)/ribbons.js b/ui (gen4)/ribbons.js index 58678cda..2f4bb8cf 100755 --- a/ui (gen4)/ribbons.js +++ b/ui (gen4)/ribbons.js @@ -21,6 +21,26 @@ var IMAGE = '.image:not(.clone)' var RIBBON = '.ribbon:not(.clone)' + +/*********************************************************************/ + +function path2url(path){ + // test if we have a schema, and if yes return as-is... + if(/^(http|https|file|[\w-]*):[\\\/]{2}/.test(path)){ + return path + } + // skip encoding windows drives... + var drive = path.split(/^([a-z]:[\\\/])/i) + path = drive.pop() + drive = drive.pop() || '' + return drive + (path + .split(/[\\\/]/g) + .map(encodeURIComponent) + .join('/')) +} + + + /*********************************************************************/ // // This expects the following HTML structure... @@ -1107,6 +1127,7 @@ var RibbonsPrototype = { return image }, _loadImagePreviewURL: function(image, url){ + url = path2url(url) // pre-cache and load image... // NOTE: this will make images load without a blackout... var img = new Image() @@ -1243,7 +1264,8 @@ var RibbonsPrototype = { if(old_gid != gid // the new preview (p_url) is different to current... // NOTE: this may not work correctly for relative urls... - || image.css('background-image').indexOf(encodeURI(p_url)) < 0){ + //|| image.css('background-image').indexOf(encodeURI(p_url)) < 0){ + || image.css('background-image').indexOf(path2url(p_url)) < 0){ // sync load... if(sync){ that._loadImagePreviewURL(image, p_url) diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index b02ccf71..135bc0cb 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -4089,11 +4089,12 @@ module.AppControl = ImageGridFeatures.Feature({ handlers: [ ['start', function(){ - this.restoreWindowGeometry() - // XXX this messes up ribbon scale... // ...to close/fast? //this.toggleInterfaceScale('!') + + this.restoreWindowGeometry() + }], [[ 'close.pre',