Return-Path: Delivered-To: apmail-incubator-couchdb-commits-archive@locus.apache.org Received: (qmail 59637 invoked from network); 23 May 2008 12:52:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 May 2008 12:52:47 -0000 Received: (qmail 83274 invoked by uid 500); 23 May 2008 12:52:49 -0000 Delivered-To: apmail-incubator-couchdb-commits-archive@incubator.apache.org Received: (qmail 83244 invoked by uid 500); 23 May 2008 12:52:49 -0000 Mailing-List: contact couchdb-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-dev@incubator.apache.org Delivered-To: mailing list couchdb-commits@incubator.apache.org Received: (qmail 83235 invoked by uid 99); 23 May 2008 12:52:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 May 2008 05:52:49 -0700 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; Fri, 23 May 2008 12:52:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9A2832388A0B; Fri, 23 May 2008 05:52:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r659522 - /incubator/couchdb/trunk/share/www/script/browse.js Date: Fri, 23 May 2008 12:52:24 -0000 To: couchdb-commits@incubator.apache.org From: cmlenz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080523125224.9A2832388A0B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cmlenz Date: Fri May 23 05:52:23 2008 New Revision: 659522 URL: http://svn.apache.org/viewvc?rev=659522&view=rev Log: Fixes for map/reduce support in Futon. Modified: incubator/couchdb/trunk/share/www/script/browse.js Modified: incubator/couchdb/trunk/share/www/script/browse.js URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/browse.js?rev=659522&r1=659521&r2=659522&view=diff ============================================================================== --- incubator/couchdb/trunk/share/www/script/browse.js [utf-8] (original) +++ incubator/couchdb/trunk/share/www/script/browse.js [utf-8] Fri May 23 05:52:23 2008 @@ -359,7 +359,7 @@ $("#documents tbody.content").empty(); this.updateDesignDocLink(); - function handleResults(resp) { + options.success = function(resp) { if (resp.offset === undefined) { resp.offset = 0; } @@ -426,10 +426,8 @@ $("#documents").addClass("reduced"); } $("#documents tbody tr:odd").addClass("odd"); - $(document.body).removeClass("loading"); } - options.success = handleResults; options.error = function(status, error, reason) { alert("Error: " + error + "\n\n" + reason); $(document.body).removeClass("loading"); @@ -444,6 +442,7 @@ var mapFun = $("#viewcode_map").val(); $.cookies.set(db.name + ".map", mapFun); var reduceFun = $("#viewcode_reduce").val() || null; + window.console.log(reduceFun); if (reduceFun != null) { $.cookies.set(db.name + ".reduce", reduceFun); } else { @@ -456,9 +455,10 @@ db.allDocs(options); } else { $("#viewcode").show(); - var currentViewCode = $("#viewcode_map").val(); + var currentMapCode = $("#viewcode_map").val(); + var currentReduceCode = $("#viewcode_reduce").val() || null; if (page.isDirty) { - db.query(currentViewCode, options); + db.query(currentMapCode, currentReduceCode, null, options); } else { db.view(viewName.substr(8), options); }