summaryrefslogtreecommitdiff
path: root/share/www/index.html
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-10-01 13:52:59 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-10-01 13:52:59 +0000
commit57f2e6a118dc57af6dbd6c377b60bae7fdcd3d22 (patch)
tree9ed078c70e49c2a3e62f91783b5f60b019599d01 /share/www/index.html
parenta502eb9880d20dbd69ac206e5145c646fdb26232 (diff)
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
Diffstat (limited to 'share/www/index.html')
-rw-r--r--share/www/index.html24
1 files changed, 11 insertions, 13 deletions
diff --git a/share/www/index.html b/share/www/index.html
index 54cc9e15..b6919b93 100644
--- a/share/www/index.html
+++ b/share/www/index.html
@@ -28,19 +28,17 @@ specific language governing permissions and limitations under the License.
</style>
<script src="script/json2.js"></script>
<script src="script/jquery.js?1.2.6"></script>
+ <script src="script/jquery.cookies.js?0.8.0"></script>
<script src="script/jquery.couch.js?0.8.0"></script>
<script>
- function updateDatabaseList() {
- var list = $("#dbs").empty();
- var dbs = $.couch.allDbs({
- success: function(dbs, status) {
- for (var i = 0; i < dbs.length; i++) {
- var dbName = dbs[i];
- list.append("<li><a href='browse/database.html?" +
- encodeURIComponent(dbName) + "' target='content'>" + dbName +
- "</a></li>");
- }
- }
+ function updateRecentDatabasesList() {
+ $("#dbs").empty();
+ var recentDbs = $.cookies.get("recent", "").split(",");
+ recentDbs.sort();
+ $.each(recentDbs, function(idx, name) {
+ $("#dbs").append("<li><a href='browse/database.html?" +
+ encodeURIComponent(name) + "' target='content'>" + name +
+ "</a></li>");
});
}
function updateNavigation(path, queryString) {
@@ -76,7 +74,7 @@ specific language governing permissions and limitations under the License.
$("#version").text(info.version);
}
});
- updateDatabaseList();
+ updateRecentDatabasesList();
});
</script>
</head>
@@ -91,7 +89,7 @@ specific language governing permissions and limitations under the License.
<li><a href="config.html" target="content">Configuration</a></li>
<li><a href="couch_tests.html" target="content">Test Suite</a></li>
</ul></li>
- <li><span>Databases</span>
+ <li><span>Recent Databases</span>
<ul id="dbs"></ul>
</li>
</ul>