summaryrefslogtreecommitdiff
path: root/share/www/index.html
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-01-08 10:19:20 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-01-08 10:19:20 +0000
commit539a418b1d7bfbffdcb377a7a9a43fd1a3753b6a (patch)
tree61e3563b03327c5157bf0b502a92cb96d992ad33 /share/www/index.html
parent2408beee6fbef4acbae40e7fa6de98a0c35a53ed (diff)
Get rid of the iframe structure in Futon to allow easy bookmarking, reloading and back/forward button support across all browsers. Resolves COUCHDB-186 and COUCHDB-56.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@732675 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/index.html')
-rw-r--r--share/www/index.html131
1 files changed, 62 insertions, 69 deletions
diff --git a/share/www/index.html b/share/www/index.html
index 37217384..07bc63d4 100644
--- a/share/www/index.html
+++ b/share/www/index.html
@@ -15,87 +15,80 @@ specific language governing permissions and limitations under the License.
-->
<html lang="en">
<head>
- <title>Apache CouchDB: Futon Utility Client</title>
+ <title>Overview</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
- <link rel="stylesheet" href="style/layout.css?0.8.0" type="text/css">
- <style type="text/css">
- html { height: 100%; overflow: hidden; }
- body { background: #fff url(image/bg.png) 100% 0 repeat-y;
- padding: 0; height: 100%; overflow: hidden;
- }
- * html body { padding-right: 210px; }
- iframe { background: transparent; border: none; width: 100%; height: 100%; }
- </style>
+ <link rel="stylesheet" href="style/layout.css?0.9.0" type="text/css">
<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 src="script/jquery.cookies.js?0.9.0"></script>
+ <script src="script/jquery.couch.js?0.9.0"></script>
+ <script src="script/jquery.dialog.js?0.9.0"></script>
+ <script src="script/browse.js?0.9.0"></script>
+ <script src="script/pprint.js?0.9.0"></script>
<script>
- 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) {
- function fixupPath(path) { // hack for IE/Win
- return (path.charAt(0) != "/") ? ("/" + path) : path;
- }
- if (path == null) {
- var l = frames["content"].location;
- path = l.pathname;
- if (queryString == null) {
- queryString = l.search;
- }
- }
- var href = fixupPath(path + queryString);
- $("#nav li li a").each(function() {
- if (fixupPath(this.pathname) + this.search == href) {
- $(this).parent("li").addClass("selected");
- } else {
- $(this).parent("li").removeClass("selected");
+ var page = new CouchIndexPage();
+ $(document).ready(function() {
+ $.get("_sidebar.html", function(resp) {
+ $(resp).insertAfter("#wrap");
+ if (!/index\.html$/.test(location.pathname)) {
+ updateNavigation(location.pathname + "index.html");
}
});
- $("#nav>li").each(function() {
- if ($(this).is(":has(li.selected)")) {
- $(this).addClass("selected");
- } else {
- $(this).removeClass("selected");
- }
+ var dbsPerPage = $.cookies.get("perpage");
+ if (dbsPerPage) $("#perpage").val(dbsPerPage);
+ $("#perpage").change(function() {
+ page.updateDatabaseListing();
+ $.cookies.set("perpage", this.value);
});
- }
- $(function() {
- $.couch.info({
- success: function(info, status) {
- $("#version").text(info.version);
- }
+
+ page.updateDatabaseListing();
+
+ $("#toolbar button.add").click(function() {
+ page.addDatabase();
});
- updateRecentDatabasesList();
});
</script>
</head>
<body>
- <a href="browse/index.html" target="content">
- <img id="logo" src="image/logo.png" width="175" height="150" alt="Apache CouchDB: Relax">
- </a>
- <ul id="nav">
- <li><span>Tools</span><ul>
- <li><a href="browse/index.html" target="content">Overview</a></li>
- <li><a href="replicator.html" target="content">Replicator</a></li>
- <li><a href="config.html" target="content">Configuration</a></li>
- <li><a href="couch_tests.html?script/couch_tests.js" target="content">Test Suite</a></li>
- </ul></li>
- <li><span>Recent Databases</span>
- <ul id="dbs"></ul>
- </li>
- </ul>
- <div id="footer">Futon on Apache CouchDB <span id="version">?</span></div>
- <div id="view">
- <iframe name="content" src="browse/index.html" allowtransparency="true">
+ <div id="wrap">
+ <h1><strong>Overview</strong></h1>
+ <div id="content">
+ <ul id="toolbar">
+ <li><button class="add">Create Database …</button></li>
+ </ul>
+
+ <table class="listing" id="databases" cellspacing="0">
+ <caption>Databases</caption>
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th class="size">Size</th>
+ <th class="count">Number of Documents</th>
+ <th class="seq">Update Seq</th>
+ </tr>
+ </thead>
+ <tbody class="content">
+ </tbody>
+ <tbody class="footer">
+ <tr>
+ <td colspan="4">
+ <div id="paging">
+ <a class="prev">← Previous Page</a> |
+ <label>Rows per page: <select id="perpage">
+ <option selected>10</option>
+ <option>25</option>
+ <option>50</option>
+ <option>100</option>
+ </select></label> |
+ <a class="next">Next Page →</a>
+ </div>
+ <span></span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+
</div>
</body>
</html>