summaryrefslogtreecommitdiff
path: root/share/www/database.html
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-12-11 18:58:12 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-12-11 18:58:12 +0000
commitf6447a3f18a3a1ee51cd488af7e65b51f10c0131 (patch)
treeccfed74c72275196b4cc32745e24fe3b4bd0230a /share/www/database.html
parent908f1a6068f6a055b15790289643d0e0a53f53a2 (diff)
Futon: Improve storage of session state by storing short-term settings in the window.name.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@889766 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/database.html')
-rw-r--r--share/www/database.html22
1 files changed, 7 insertions, 15 deletions
diff --git a/share/www/database.html b/share/www/database.html
index c44d83fc..a4dedfcf 100644
--- a/share/www/database.html
+++ b/share/www/database.html
@@ -20,7 +20,6 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/jquery.js?1.3.2"></script>
- <script src="script/jquery.cookies.js?0.11.0"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/jquery.resizer.js?0.11.0"></script>
@@ -70,13 +69,10 @@ specific language governing permissions and limitations under the License.
horizontal: true
});
- // 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);
+ // Restore preferences/state
+ $("#documents thead th.key").toggleClass("desc", $.futon.storage.get("desc"));
+ $("#reduce :checkbox")[0].checked = $.futon.storage.get("reduce");
+ $("#perpage").val($.futon.storage.get("per_page"));
page.populateViewsMenu();
page.populateViewEditor();
@@ -87,7 +83,7 @@ specific language governing permissions and limitations under the License.
$("#switch select").change(function() {
var viewName = $(this).val();
- if (!viewName) $.cookies.remove(page.db.name + ".view");
+ if (!viewName) $.futon.storage.del("view");
location.href = "?" + encodeURIComponent(page.db.name) +
(viewName ? "/" + viewName : "");
});
@@ -97,15 +93,11 @@ specific language governing permissions and limitations under the License.
});
$("#reduce :checkbox").click(function() {
page.updateDocumentListing();
- if (this.checked) {
- $.cookies.set(page.db.name + ".doreduce", "1");
- } else {
- $.cookies.remove(page.db.name + ".doreduce");
- }
+ $.futon.storage.set("reduce", this.checked);
});
$("#perpage").change(function() {
page.updateDocumentListing();
- $.cookies.set(page.db.name + ".perpage", this.value);
+ $.futon.storage.set("per_page", this.value);
});
$("#toolbar button.add").click(page.newDocument);
$("#toolbar button.compact").click(page.compactDatabase);