Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 78917 invoked from network); 11 Jan 2011 00:20:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jan 2011 00:20:59 -0000 Received: (qmail 50789 invoked by uid 500); 11 Jan 2011 00:20:59 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 50748 invoked by uid 500); 11 Jan 2011 00:20:59 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 50741 invoked by uid 99); 11 Jan 2011 00:20:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jan 2011 00:20:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jan 2011 00:20:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C172F238890A; Tue, 11 Jan 2011 00:20:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1057422 - in /couchdb/branches/1.0.x/share/www: database.html script/futon.browse.js Date: Tue, 11 Jan 2011 00:20:35 -0000 To: commits@couchdb.apache.org From: jan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110111002035.C172F238890A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jan Date: Tue Jan 11 00:20:35 2011 New Revision: 1057422 URL: http://svn.apache.org/viewvc?rev=1057422&view=rev Log: Avoid overzealous URI encoding. Fix raw view document link. Closes COUCHDB-998 Modified: couchdb/branches/1.0.x/share/www/database.html couchdb/branches/1.0.x/share/www/script/futon.browse.js Modified: couchdb/branches/1.0.x/share/www/database.html URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/share/www/database.html?rev=1057422&r1=1057421&r2=1057422&view=diff ============================================================================== --- couchdb/branches/1.0.x/share/www/database.html [utf-8] (original) +++ couchdb/branches/1.0.x/share/www/database.html [utf-8] Tue Jan 11 00:20:35 2011 @@ -40,6 +40,10 @@ specific language governing permissions $("h1 strong").text(page.db.name); var viewPath = page.viewName || "_all_docs"; if (viewPath != "_temp_view" && viewPath != "_design_docs") { + viewPath = $.map(viewPath.split("/"), function (part) { + return encodeURIComponent(part); + }).join("/"); + $("h1 a.raw").attr("href", "/" + encodeURIComponent(page.db.name) + "/" + viewPath); } Modified: couchdb/branches/1.0.x/share/www/script/futon.browse.js URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/share/www/script/futon.browse.js?rev=1057422&r1=1057421&r2=1057422&view=diff ============================================================================== --- couchdb/branches/1.0.x/share/www/script/futon.browse.js [utf-8] (original) +++ couchdb/branches/1.0.x/share/www/script/futon.browse.js [utf-8] Tue Jan 11 00:20:35 2011 @@ -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"; }