diff --git a/ui/gallery-prototype.js b/ui/gallery-prototype.js index bcdbf487..f144fd64 100755 --- a/ui/gallery-prototype.js +++ b/ui/gallery-prototype.js @@ -1312,6 +1312,9 @@ function loadJSON(data, position, set_order, escape_urls){ if(ribbons == null){ return } + if(escape_urls == null){ + escape_urls = true + } // store the structure... ImageGrid.image_data = data @@ -1332,14 +1335,6 @@ function loadJSON(data, position, set_order, escape_urls){ .appendTo(field) for(var j in images){ var image = images[j] - if(escape_urls == true){ - // escape the url ... - var o = /([a-zA-Z0-9]*:\/\/)(.*)/.exec(image.url) - if(o.length == 3){ - image.url = o[1] + escape(o[2]) - } - image.url = escape(image.url) - } // create image... makeImage(image.url, j, set_order) .appendTo(ribbon) diff --git a/ui/persistance.js b/ui/persistance.js index 863ac561..ab55ac03 100755 --- a/ui/persistance.js +++ b/ui/persistance.js @@ -9,13 +9,36 @@ * */ -function loadJSONfile(path){ +function loadJSONfile(path, escape_urls){ + if(escape_urls == null){ + escape_urls = true + } // XXX CEF (file) - binding if(CEF_loadJSON != null){ - return CEF_loadJSON(path) + var data = CEF_loadJSON(path) } // XXX PhoneGap (file) - binding // XXX browser - open file dialog + + // escape the URLs... + var ribbons = data.ribbons + for(var i=0; i