From 5ad12f26e8288a0bc4ae061b9c2f0465d1ada95d Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Thu, 10 Dec 2009 13:27:42 +0000 Subject: Add a "Reduce" checkbox to the database view page in Futon, which controls the `reduce=true|false` query string parameter. I had to add `reduce=false` support for temp views on the server side to make the feature not-confusing. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@889256 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/database.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'share/www/database.html') diff --git a/share/www/database.html b/share/www/database.html index 400081b0..3609cc7b 100644 --- a/share/www/database.html +++ b/share/www/database.html @@ -73,6 +73,8 @@ specific language governing permissions and limitations under the License. // Restore preferences/state from cookies var desc = $.cookies.get(page.db.name + ".desc"); if (desc) $("#documents thead th.key").addClass("desc"); + var reduce = $.cookies.get(page.db.name + ".doreduce"); + $("#reduce :checkbox")[0].checked = reduce; var rowsPerPage = $.cookies.get(page.db.name + ".perpage"); if (rowsPerPage) $("#perpage").val(rowsPerPage); @@ -93,6 +95,14 @@ specific language governing permissions and limitations under the License. $(this).toggleClass("desc"); page.updateDocumentListing(); }); + $("#documents thead th.value #reduce :checkbox").click(function() { + page.updateDocumentListing(); + if (this.checked) { + $.cookies.set(page.db.name + ".doreduce", "1"); + } else { + $.cookies.remove(page.db.name + ".doreduce"); + } + }); $("#perpage").change(function() { page.updateDocumentListing(); $.cookies.set(page.db.name + ".perpage", this.value); @@ -187,7 +197,10 @@ specific language governing permissions and limitations under the License.
Key
- Value + + + Value + -- cgit v1.2.3