couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r889841 - in /couchdb/trunk/share/www: database.html script/futon.browse.js script/futon.js
Date Fri, 11 Dec 2009 22:39:34 GMT
Author: cmlenz
Date: Fri Dec 11 22:39:29 2009
New Revision: 889841

URL: http://svn.apache.org/viewvc?rev=889841&view=rev
Log:
Futon: A couple of bug fixes:
 * Enable tab insertion in text areas for temp views.
 * Properly sync disabled status of "grouping" control on page load.

Modified:
    couchdb/trunk/share/www/database.html
    couchdb/trunk/share/www/script/futon.browse.js
    couchdb/trunk/share/www/script/futon.js

Modified: couchdb/trunk/share/www/database.html
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/database.html?rev=889841&r1=889840&r2=889841&view=diff
==============================================================================
--- couchdb/trunk/share/www/database.html [utf-8] (original)
+++ couchdb/trunk/share/www/database.html [utf-8] Fri Dec 11 22:39:29 2009
@@ -71,8 +71,13 @@
 
         // Restore preferences/state
         $("#documents thead th.key").toggleClass("desc", $.futon.storage.get("desc"));
+        var reduce = $.futon.storage.get("reduce");
+        $("#reduce :checkbox")[0].checked = reduce;
         $("#grouplevel select").val($.futon.storage.get("group_level"));
-        $("#reduce :checkbox")[0].checked = $.futon.storage.get("reduce");
+        $("#grouplevel").toggleClass("disabled", !reduce).find("select").each(function()
{
+          this.disabled = !reduce;
+        });
+
         $("#perpage").val($.futon.storage.get("per_page"));
 
         page.populateViewsMenu();

Modified: couchdb/trunk/share/www/script/futon.browse.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.browse.js?rev=889841&r1=889840&r2=889841&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Fri Dec 11 22:39:29 2009
@@ -101,8 +101,8 @@
       $.futon.storage.declareWithPrefix(dbName + ".", {
         desc: {},
         language: {defaultValue: "javascript"},
-        map_fun: {},
-        reduce_fun: {},
+        map_fun: {defaultValue: ""},
+        reduce_fun: {defaultValue: ""},
         reduce: {},
         group_level: {defaultValue: 100},
         per_page: {defaultValue: 10},
@@ -197,6 +197,7 @@
                   map: $("#viewcode_map").val(),
                   reduce: $("#viewcode_reduce").val()
                 };
+                $("#reduce, #grouplevel").toggle(!!viewCode.reduce);
                 page.isDirty = (viewCode.map != page.storedViewCode.map)
                   || (viewCode.reduce != (page.storedViewCode.reduce || ""))
                   || page.viewLanguage != page.storedViewLanguage;
@@ -205,7 +206,6 @@
                 } else {
                   buttons.attr("disabled", "disabled");
                 }
-                $("#reduce, #grouplevel").toggle(!!viewCode.reduce);
               }, 100);
             }
             $("#viewcode textarea").enableTabInsertion()
@@ -222,10 +222,11 @@
             page.updateDocumentListing();
           });
         } else if (viewName == "_temp_view") {
+          $("#viewcode textarea").enableTabInsertion();
           page.viewLanguage = $.futon.storage.get("language");
           page.updateViewEditor(
-            $.futon.storage.get("map", templates[page.viewLanguage]),
-            $.futon.storage.get("reduce")
+            $.futon.storage.get("map_fun", templates[page.viewLanguage]),
+            $.futon.storage.get("reduce_fun")
           );
         } else {
           $("#grouplevel, #reduce").hide();
@@ -671,8 +672,6 @@
               } else {
                 options.reduce = false;
               }
-            } else {
-              $.futon.storage.del("reduce");
             }
             $.futon.storage.set("language", page.viewLanguage);
             db.query(mapFun, reduceFun, page.viewLanguage, options);

Modified: couchdb/trunk/share/www/script/futon.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.js?rev=889841&r1=889840&r2=889841&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.js (original)
+++ couchdb/trunk/share/www/script/futon.js Fri Dec 11 22:39:29 2009
@@ -168,7 +168,11 @@
 
     this.set = function(name, value) {
       lookup(name, function(decl) {
-        handlers[decl.scope].set(decl.prefix + name, value);
+        if (value == decl.defaultValue) {
+          handlers[decl.scope].del(decl.prefix + name);
+        } else {
+          handlers[decl.scope].set(decl.prefix + name, value);
+        }
       });
     }
 



Mime
View raw message