diff options
| author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-07-21 15:43:07 +0000 | 
|---|---|---|
| committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-07-21 15:43:07 +0000 | 
| commit | 6bd11d1195f63380bcfd4a1ac6aa6a10700ad5f2 (patch) | |
| tree | a11960fd717b3cd70c5e2412245f28f316ab39db | |
| parent | 5fc1e706ee5015e6a555f46a5eea601b4ec3bf63 (diff) | |
Add "Stale views" checkbox to Futon's database pages.
Closes COUCHDB-550.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@966283 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | share/www/database.html | 11 | ||||
| -rw-r--r-- | share/www/script/futon.browse.js | 8 | ||||
| -rw-r--r-- | share/www/style/layout.css | 7 | 
3 files changed, 25 insertions, 1 deletions
diff --git a/share/www/database.html b/share/www/database.html index 5142ed1b..39507398 100644 --- a/share/www/database.html +++ b/share/www/database.html @@ -81,6 +81,9 @@ specific language governing permissions and limitations under the License.          $("#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 and limitations under the License.            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 and limitations under the License.        <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> diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index 0e8b4213..5f687941 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -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);              }            } diff --git a/share/www/style/layout.css b/share/www/style/layout.css index 191f3874..a8abd491 100644 --- a/share/www/style/layout.css +++ b/share/www/style/layout.css @@ -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;  | 
