summaryrefslogtreecommitdiff
path: root/share/www/database.html
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-12-10 13:27:42 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-12-10 13:27:42 +0000
commit5ad12f26e8288a0bc4ae061b9c2f0465d1ada95d (patch)
tree7e5b7ad655b23f2e3e9db82cbcd8203d2c3c7063 /share/www/database.html
parent10e8a4b9d69e75b705f8e491a3a428fca7139d98 (diff)
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
Diffstat (limited to 'share/www/database.html')
-rw-r--r--share/www/database.html15
1 files changed, 14 insertions, 1 deletions
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.
<thead>
<tr>
<th class="key"><div>Key</div></th>
- <th class="value">Value</th>
+ <th class="value">
+ <label id="reduce"><input type="checkbox" autocomplete="off" checked> Reduce</label>
+ Value
+ </th>
</tr>
</thead>
<tbody class="content">