From 2ffd808fd701b96d0e3433386b4822bcf923e360 Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Fri, 11 Apr 2008 21:19:59 +0000 Subject: Fix for double-encoded document IDs in Futon. Closes COUCHDB-39. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@647314 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/browse.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'share/www') diff --git a/share/www/script/browse.js b/share/www/script/browse.js index 7fafc252..8ae1e589 100644 --- a/share/www/script/browse.js +++ b/share/www/script/browse.js @@ -58,10 +58,11 @@ function CouchDatabasePage() { var urlParts = location.search.substr(1).split("/"); var dbName = urlParts.shift(); var viewName = (urlParts.length > 0) ? urlParts.join("/") : null; - if (!viewName) { - viewName = $.cookies.get(dbName + ".view") || ""; - } else { + if (viewName) { + viewName = decodeURIComponent(viewName); $.cookies.set(dbName + ".view", viewName); + } else { + viewName = $.cookies.get(dbName + ".view") || ""; } var db = new CouchDB(dbName); @@ -376,7 +377,7 @@ function CouchDocumentPage() { var urlParts = location.search.substr(1).split("/"); var dbName = urlParts.shift(); var idParts = urlParts.join("/").split("@", 2); - var docId = idParts[0]; + var docId = decodeURIComponent(idParts[0]); var docRev = (idParts.length > 1) ? idParts[1] : null; var db = new CouchDB(dbName); var doc = db.open(docId, {revs_info: true}); -- cgit v1.2.3