You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2010/07/21 17:43:07 UTC
svn commit: r966283 - in /couchdb/trunk/share/www: database.html
script/futon.browse.js style/layout.css
Author: fdmanana
Date: Wed Jul 21 15:43:07 2010
New Revision: 966283
URL: http://svn.apache.org/viewvc?rev=966283&view=rev
Log:
Add "Stale views" checkbox to Futon's database pages.
Closes COUCHDB-550.
Modified:
couchdb/trunk/share/www/database.html
couchdb/trunk/share/www/script/futon.browse.js
couchdb/trunk/share/www/style/layout.css
Modified: couchdb/trunk/share/www/database.html
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/database.html?rev=966283&r1=966282&r2=966283&view=diff
==============================================================================
--- couchdb/trunk/share/www/database.html [utf-8] (original)
+++ couchdb/trunk/share/www/database.html [utf-8] Wed Jul 21 15:43:07 2010
@@ -81,6 +81,9 @@ specific language governing permissions
$("#perpage").val($.futon.storage.get("per_page"));
+ var staleViews = $.futon.storage.get("stale");
+ $("#staleviews :checkbox")[0].checked = staleViews;
+
page.populateViewsMenu();
page.populateViewEditor();
if (page.isTempView) {
@@ -94,6 +97,9 @@ specific language governing permissions
location.href = "?" + encodeURIComponent(page.db.name) +
(viewName ? "/" + viewName : "");
});
+ $("#staleviews :checkbox").click(function() {
+ $.futon.storage.set("stale", this.checked);
+ });
$("#documents thead th.key span").click(function() {
$(this).closest("th").toggleClass("desc");
page.updateDocumentListing();
@@ -148,6 +154,11 @@ specific language governing permissions
<a class="raw" title="Raw view"></a>
</h1>
<div id="content">
+ <div id="staleviews">
+ <label>Stale views
+ <input name="staleviews" type="checkbox" />
+ </label>
+ </div>
<div id="switch">
<label>View: <select autocomplete="false">
<option value="_all_docs">All documents</option>
Modified: couchdb/trunk/share/www/script/futon.browse.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.browse.js?rev=966283&r1=966282&r2=966283&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Wed Jul 21 15:43:07 2010
@@ -107,7 +107,8 @@
reduce: {},
group_level: {defaultValue: 100},
per_page: {defaultValue: 10},
- view: {defaultValue: ""}
+ view: {defaultValue: ""},
+ stale: {defaultValue: false}
});
var viewName = (urlParts.length > 0) ? urlParts.join("/") : null;
@@ -765,6 +766,11 @@
db.query(currentMapCode, currentReduceCode, page.viewLanguage, options);
} else {
var viewParts = viewName.split('/');
+
+ if ($.futon.storage.get("stale")) {
+ options.stale = "ok";
+ }
+
db.view(viewParts[1] + "/" + viewParts[3], options);
}
}
Modified: couchdb/trunk/share/www/style/layout.css
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/style/layout.css?rev=966283&r1=966282&r2=966283&view=diff
==============================================================================
--- couchdb/trunk/share/www/style/layout.css (original)
+++ couchdb/trunk/share/www/style/layout.css Wed Jul 21 15:43:07 2010
@@ -324,6 +324,13 @@ body.loading #dialog h2 {
}
#switch select { font-size: 90%; }
+/* Stale views checkbox */
+
+#staleviews {
+ color: #666; float: right; font-size: 90%;
+ font-weight: bold; line-height: 16px; padding: 5px;
+}
+
/* View function editing */
#viewcode { background: #fff; border: 1px solid;