couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r659522 - /incubator/couchdb/trunk/share/www/script/browse.js
Date Fri, 23 May 2008 12:52:24 GMT
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);
         }



Mime
View raw message