From 6ce291d3d3ccac65c082c787e9540fd187c225be Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Tue, 11 Jan 2011 00:20:35 +0000 Subject: Avoid overzealous URI encoding. Fix raw view document link. Closes COUCHDB-998 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1057422 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/futon.browse.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'share/www/script') diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index 17975de2..6b3c979c 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -116,7 +116,7 @@ var viewName = (urlParts.length > 0) ? urlParts.join("/") : null; if (viewName) { - $.futon.storage.set("view", viewName); + $.futon.storage.set("view", decodeURIComponent(viewName)); } else { viewName = $.futon.storage.get("view"); if (viewName) { @@ -128,6 +128,7 @@ var db = $.couch.db(dbName); this.dbName = dbName; + viewName = decodeURIComponent(viewName); this.viewName = viewName; this.viewLanguage = "javascript"; this.db = db; @@ -578,7 +579,7 @@ this.updateDesignDocLink = function() { if (viewName && /^_design/.test(viewName)) { - var docId = "_design/" + decodeURIComponent(viewName.split("/")[1]); + var docId = "_design/" + encodeURIComponent(decodeURIComponent(viewName).split("/")[1]); $("#designdoc-link").attr("href", "document.html?" + encodeURIComponent(dbName) + "/" + $.couch.encodeDocId(docId)).text(docId); } else { @@ -774,8 +775,7 @@ if (page.isDirty) { db.query(currentMapCode, currentReduceCode, page.viewLanguage, options); } else { - var viewParts = viewName.split('/'); - + var viewParts = decodeURIComponent(viewName).split('/'); if ($.futon.storage.get("stale")) { options.stale = "ok"; } -- cgit v1.2.3