You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by cm...@apache.org on 2009/12/12 00:00:17 UTC
svn commit: r889846 - /couchdb/trunk/share/www/script/futon.browse.js
Author: cmlenz
Date: Fri Dec 11 23:00:17 2009
New Revision: 889846
URL: http://svn.apache.org/viewvc?rev=889846&view=rev
Log:
Futon: Remember tabular vs. source tab preference in a cookie.
Modified:
couchdb/trunk/share/www/script/futon.browse.js
Modified: couchdb/trunk/share/www/script/futon.browse.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.browse.js?rev=889846&r1=889845&r2=889846&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Fri Dec 11 23:00:17 2009
@@ -731,6 +731,8 @@
}
var db = $.couch.db(dbName);
+ $.futon.storage.declare("tab", {defaultValue: "tabular", scope: "cookie"});
+
this.dbName = dbName;
this.db = db;
this.docId = docId;
@@ -742,13 +744,16 @@
if ($("#fields tbody.source textarea").length > 0)
return;
+ $.futon.storage.set("tab", "tabular");
$("#tabs li").removeClass("active").filter(".tabular").addClass("active");
$("#fields thead th:first").text("Field").attr("colspan", 1).next().show();
$("#fields tbody.content").show();
$("#fields tbody.source").hide();
+ return false;
}
this.activateSourceView = function() {
+ $.futon.storage.set("tab", "source");
$("#tabs li").removeClass("active").filter(".source").addClass("active");
$("#fields thead th:first").text("Source").attr("colspan", 2).next().hide();
$("#fields tbody.content").hide();
@@ -789,6 +794,7 @@
}
});
}).end().show();
+ return false;
}
this.addField = function() {
@@ -855,7 +861,7 @@
$("#fields tbody.footer td span").text("Showing revision " +
(revs.length - currentIndex) + " of " + revs.length);
}
- if (location.hash == "#source" && !noReload) {
+ if ($.futon.storage.get("tab") == "source") {
page.activateSourceView();
}
}