From 57f2e6a118dc57af6dbd6c377b60bae7fdcd3d22 Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Wed, 1 Oct 2008 13:52:59 +0000 Subject: Make the database list in the sidebar in Futon a list of the 10 most recently used databases, to avoid excessive script/render time with instances containing very many databases. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@700767 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/browse/database.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'share/www/browse') diff --git a/share/www/browse/database.html b/share/www/browse/database.html index 0dd086db..fe17a47b 100644 --- a/share/www/browse/database.html +++ b/share/www/browse/database.html @@ -32,6 +32,13 @@ specific language governing permissions and limitations under the License. if (window != parent) { parent.updateNavigation(location.pathname, encodeURIComponent(location.search.split("/", 2)[0])); + var recentDbs = $.cookies.get("recent", "").split(","); + if ($.inArray(page.db.name, recentDbs) == -1) { + recentDbs.unshift(page.db.name); + if (recentDbs.length > 10) recentDbs.length = 10; + $.cookies.set("recent", recentDbs.join(","), parent.location.pathname); + parent.updateRecentDatabasesList(); + } } $(document).ready(function() { -- cgit v1.2.3