summaryrefslogtreecommitdiff
path: root/share/www
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
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')
-rw-r--r--share/www/_sidebar.html65
-rw-r--r--share/www/browse/index.html87
-rw-r--r--share/www/config.html21
-rw-r--r--share/www/couch_tests.html23
-rw-r--r--share/www/database.html (renamed from share/www/browse/database.html)43
-rw-r--r--share/www/dialog/_compact_database.html (renamed from share/www/browse/_compact_database.html)0
-rw-r--r--share/www/dialog/_create_database.html (renamed from share/www/browse/_create_database.html)0
-rw-r--r--share/www/dialog/_create_document.html (renamed from share/www/browse/_create_document.html)0
-rw-r--r--share/www/dialog/_delete_database.html (renamed from share/www/browse/_delete_database.html)0
-rw-r--r--share/www/dialog/_delete_document.html (renamed from share/www/browse/_delete_document.html)0
-rw-r--r--share/www/dialog/_save_view_as.html (renamed from share/www/browse/_save_view_as.html)0
-rw-r--r--share/www/dialog/_upload_attachment.html (renamed from share/www/browse/_upload_attachment.html)0
-rw-r--r--share/www/document.html (renamed from share/www/browse/document.html)41
-rw-r--r--share/www/index.html131
-rw-r--r--share/www/replicator.html21
-rw-r--r--share/www/script/browse.js35
-rw-r--r--share/www/style/layout.css21
17 files changed, 244 insertions, 244 deletions
diff --git a/share/www/_sidebar.html b/share/www/_sidebar.html
new file mode 100644
index 00000000..9bddda37
--- /dev/null
+++ b/share/www/_sidebar.html
@@ -0,0 +1,65 @@
+<div id="sidebar">
+ <a href="index.html">
+ <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="index.html">Overview</a></li>
+ <li><a href="replicator.html">Replicator</a></li>
+ <li><a href="config.html">Configuration</a></li>
+ <li><a href="couch_tests.html?script/couch_tests.js">Test Suite</a></li>
+ </ul></li>
+ <li><span>Recent Databases</span>
+ <ul id="dbs"></ul>
+ </li>
+ </ul>
+ <div id="footer">
+ Futon on <a href="http://couchdb.apache.org/">Apache CouchDB</a>
+ <span id="version">?</span>
+ </div>
+</div>
+<script type="text/javascript">
+ function updateNavigation(path, queryString) {
+ function fixupPath(path) { // hack for IE/Win
+ return (path.charAt(0) != "/") ? ("/" + path) : path;
+ }
+ if (!path) {
+ path = location.pathname;
+ if (!queryString) {
+ queryString = location.search;
+ }
+ } else if (!queryString) {
+ queryString = "";
+ }
+ var href = fixupPath(path + queryString);
+ $("#nav li").removeClass("selected");
+ $("#nav li a").each(function() {
+ if (fixupPath(this.pathname) + this.search != href) return;
+ $(this).parent("li").addClass("selected").parents("li").addClass("selected");
+ });
+ }
+
+ function updateRecentDatabasesList() {
+ $("#dbs").empty();
+ var recentDbs = $.cookies.get("recent", "").split(",");
+ recentDbs.sort();
+ $.each(recentDbs, function(idx, name) {
+ if (name) {
+ $("#dbs").append("<li><a href='database.html?" +
+ encodeURIComponent(name) + "'>" + name +
+ "</a></li>");
+ }
+ });
+ }
+
+ $(function() {
+ document.title = "Apache CouchDB - Futon: " + document.title;
+ $.couch.info({
+ success: function(info, status) {
+ $("#version").text(info.version);
+ }
+ });
+ updateRecentDatabasesList();
+ updateNavigation();
+ });
+</script>
diff --git a/share/www/browse/index.html b/share/www/browse/index.html
deleted file mode 100644
index 93f5a21a..00000000
--- a/share/www/browse/index.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
- <head>
- <title>Welcome</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">
- <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.dialog.js?0.8.0"></script>
- <script src="../script/browse.js?0.8.0"></script>
- <script src="../script/pprint.js?0.8.0"></script>
- <script>
- var page = new CouchIndexPage();
- $(document).ready(function() {
- var dbsPerPage = $.cookies.get("perpage");
- if (dbsPerPage) $("#perpage").val(dbsPerPage);
- $("#perpage").change(function() {
- page.updateDatabaseListing();
- $.cookies.set("perpage", this.value);
- });
-
- page.updateDatabaseListing();
-
- $("#toolbar button.add").click(function() {
- page.addDatabase();
- });
- if (window != parent) parent.updateNavigation();
- });
- </script>
- </head>
- <body>
- <h1><strong>Overview</strong></h1>
- <div id="wrap">
- <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>
- </body>
-</html>
diff --git a/share/www/config.html b/share/www/config.html
index 391bc403..7eab0448 100644
--- a/share/www/config.html
+++ b/share/www/config.html
@@ -17,14 +17,17 @@ specific language governing permissions and limitations under the License.
<head>
<title>Configuration</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">
+ <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.couch.js?0.8.0"></script>
- <script src="script/pprint.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/pprint.js?0.9.0"></script>
<script>
$(document).ready(function() {
- if (window !== parent) parent.updateNavigation();
+ $.get("_sidebar.html", function(resp) {
+ $(resp).insertAfter("#wrap");
+ });
$(document.body).addClass("loading");
$.couch.config({
@@ -61,14 +64,14 @@ specific language governing permissions and limitations under the License.
});
</script>
</head>
- <body>
+ <body><div id="wrap">
<h1>
- <a href="browse/index.html">Overview</a>
+ <a href="index.html">Overview</a>
<strong>Configuration</strong>
</h1>
- <div id="wrap">
+ <div id="content">
- <table id="config" class="listing">
+ <table id="config" class="listing" cellspacing="0">
<caption>Configuration</caption>
<thead><tr>
<th>Section</th>
@@ -79,5 +82,5 @@ specific language governing permissions and limitations under the License.
</table>
</div>
- </body>
+ </div></body>
</html>
diff --git a/share/www/couch_tests.html b/share/www/couch_tests.html
index f1ab443b..de471382 100644
--- a/share/www/couch_tests.html
+++ b/share/www/couch_tests.html
@@ -17,17 +17,22 @@ specific language governing permissions and limitations under the License.
<head>
<title>Test Suite</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">
+ <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/couch.js?0.8.0"></script>
- <script src="script/pprint.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/couch.js?0.9.0"></script>
+ <script src="script/pprint.js?0.9.0"></script>
<script src="script/couch_test_runner.js"></script>
<script>
$(function() {
+ $.get("_sidebar.html", function(resp) {
+ $(resp).insertAfter("#wrap");
+ });
+
updateTestsListing();
$("#toolbar button.run").click(runAllTests);
- if (window != parent) parent.updateNavigation();
$("#toolbar button.load").click(function() {
location.reload(true);
});
@@ -36,12 +41,12 @@ specific language governing permissions and limitations under the License.
loadTests(testsPath||"script/couch_tests.js")
</script>
</head>
- <body>
+ <body><div id="wrap">
<h1>
- <a href="browse/index.html">Overview</a>
+ <a href="index.html">Overview</a>
<strong>Test Suite</strong>
</h1>
- <div id="wrap">
+ <div id="content">
<ul id="toolbar">
<li><button class="run">Run All</button></li>
<li><button class="load">Reload</button></li>
@@ -52,6 +57,7 @@ specific language governing permissions and limitations under the License.
some time, and you'll not be able to do much with your browser while
a test is being executed.
</p>
+
<table class="listing" id="tests" cellspacing="0">
<caption>Tests</caption>
<thead>
@@ -70,6 +76,7 @@ specific language governing permissions and limitations under the License.
</tr>
</tbody>
</table>
+
</div>
- </body>
+ </div></body>
</html>
diff --git a/share/www/browse/database.html b/share/www/database.html
index 6b12ed7d..abe9e28c 100644
--- a/share/www/browse/database.html
+++ b/share/www/database.html
@@ -17,31 +17,34 @@ specific language governing permissions and limitations under the License.
<head>
<title>Browse Database</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">
- <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.dialog.js?0.8.0"></script>
- <script src="../script/jquery.resizer.js?0.8.0"></script>
- <script src="../script/jquery.suggest.js?0.8.0"></script>
- <script src="../script/browse.js?0.8.0"></script>
- <script src="../script/pprint.js?0.8.0"></script>
+ <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.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/jquery.resizer.js?0.9.0"></script>
+ <script src="script/jquery.suggest.js?0.9.0"></script>
+ <script src="script/browse.js?0.9.0"></script>
+ <script src="script/pprint.js?0.9.0"></script>
<script>
var page = new CouchDatabasePage();
- if (window != parent) {
- parent.updateNavigation(location.pathname,
- encodeURIComponent(location.search.split("/", 2)[0]));
+
+ $.get("_sidebar.html", function(resp) {
+ $(resp).insertAfter("#wrap");
+
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();
+ $.cookies.set("recent", recentDbs.join(","));
+ updateRecentDatabasesList();
}
- }
- $(document).ready(function() {
+ updateNavigation(location.pathname, "?" + page.db.name);
+ });
+
+ $(function() {
$("h1 strong").text(page.db.name);
$("#viewcode span").click(function() {
$("#viewcode").toggleClass("collapsed");
@@ -107,12 +110,12 @@ specific language governing permissions and limitations under the License.
</script>
</head>
- <body>
+ <body><div id="wrap">
<h1>
<a href="index.html">Overview</a>
<strong>?</strong>
</h1>
- <div id="wrap">
+ <div id="content">
<div id="switch">
<label>Select view: <select autocomplete="false">
<option value="">All documents</option>
@@ -182,5 +185,5 @@ specific language governing permissions and limitations under the License.
</table>
</div>
- </body>
+ </div></body>
</html>
diff --git a/share/www/browse/_compact_database.html b/share/www/dialog/_compact_database.html
index efa5d345..efa5d345 100644
--- a/share/www/browse/_compact_database.html
+++ b/share/www/dialog/_compact_database.html
diff --git a/share/www/browse/_create_database.html b/share/www/dialog/_create_database.html
index 5c909a7a..5c909a7a 100644
--- a/share/www/browse/_create_database.html
+++ b/share/www/dialog/_create_database.html
diff --git a/share/www/browse/_create_document.html b/share/www/dialog/_create_document.html
index fc9eef02..fc9eef02 100644
--- a/share/www/browse/_create_document.html
+++ b/share/www/dialog/_create_document.html
diff --git a/share/www/browse/_delete_database.html b/share/www/dialog/_delete_database.html
index 16be8f30..16be8f30 100644
--- a/share/www/browse/_delete_database.html
+++ b/share/www/dialog/_delete_database.html
diff --git a/share/www/browse/_delete_document.html b/share/www/dialog/_delete_document.html
index 6b5497a4..6b5497a4 100644
--- a/share/www/browse/_delete_document.html
+++ b/share/www/dialog/_delete_document.html
diff --git a/share/www/browse/_save_view_as.html b/share/www/dialog/_save_view_as.html
index a7f10785..a7f10785 100644
--- a/share/www/browse/_save_view_as.html
+++ b/share/www/dialog/_save_view_as.html
diff --git a/share/www/browse/_upload_attachment.html b/share/www/dialog/_upload_attachment.html
index 941fcc47..941fcc47 100644
--- a/share/www/browse/_upload_attachment.html
+++ b/share/www/dialog/_upload_attachment.html
diff --git a/share/www/browse/document.html b/share/www/document.html
index 09136533..3f39cb75 100644
--- a/share/www/browse/document.html
+++ b/share/www/document.html
@@ -17,27 +17,28 @@ specific language governing permissions and limitations under the License.
<head>
<title>View Document</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">
- <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.dialog.js?0.8.0"></script>
- <script src="../script/jquery.form.js?0.8.0"></script>
- <script src="../script/jquery.resizer.js?0.8.0"></script>
- <script src="../script/browse.js?0.8.0"></script>
- <script src="../script/pprint.js?0.8.0"></script>
+ <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.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/jquery.form.js?0.9.0"></script>
+ <script src="script/jquery.resizer.js?0.9.0"></script>
+ <script src="script/browse.js?0.9.0"></script>
+ <script src="script/pprint.js?0.9.0"></script>
<script>
var page = new CouchDocumentPage();
- if (window != parent) {
- var dbLink = $("h1 a.dbname").get(0);
- parent.updateNavigation(
- location.pathname.replace(/document\.html/, "database.html"),
- encodeURIComponent(location.search.split("/")[0])
- );
- }
$(function() {
+ $.get("_sidebar.html", function(resp) {
+ $(resp).insertAfter("#wrap");
+
+ updateNavigation(
+ location.pathname.replace(/document\.html/, "database.html"),
+ "?" + page.db.name);
+ });
+
$("h1 a.dbname").text(page.dbName)
.attr("href", "database.html?" + encodeURIComponent(page.db.name));
$("h1 strong").text(page.docId);
@@ -68,13 +69,13 @@ specific language governing permissions and limitations under the License.
</script>
</head>
- <body>
+ <body><div id="wrap">
<h1>
<a href="index.html">Overview</a>
<a class="dbname" href="#">?</a>
<strong>?</strong>
</h1>
- <div id="wrap">
+ <div id="content">
<ul id="toolbar">
<li><button class="save">Save Document</button></li>
<li><button class="add">Add Field</button></li>
@@ -113,5 +114,5 @@ specific language governing permissions and limitations under the License.
</table>
</div>
- </body>
+ </div></body>
</html>
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>
diff --git a/share/www/replicator.html b/share/www/replicator.html
index e6f7f429..32ad52cd 100644
--- a/share/www/replicator.html
+++ b/share/www/replicator.html
@@ -17,14 +17,17 @@ specific language governing permissions and limitations under the License.
<head>
<title>Replicator</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">
+ <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.couch.js?0.8.0"></script>
- <script src="script/pprint.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/pprint.js?0.9.0"></script>
<script>
$(document).ready(function() {
- if (window !== parent) parent.updateNavigation();
+ $.get("_sidebar.html", function(resp) {
+ $(resp).insertAfter("#wrap");
+ });
$("fieldset input[type=radio]").click(function() {
var radio = this;
@@ -95,12 +98,12 @@ specific language governing permissions and limitations under the License.
});
</script>
</head>
- <body>
+ <body><div id="wrap">
<h1>
- <a href="browse/index.html">Overview</a>
+ <a href="index.html">Overview</a>
<strong>Replicator</strong>
</h1>
- <div id="wrap">
+ <div id="content">
<form id="replicator">
<fieldset id="source">
@@ -129,7 +132,7 @@ specific language governing permissions and limitations under the License.
</p>
</form>
- <table id="records" class="listing">
+ <table id="records" class="listing" cellspacing="0">
<caption>Replication History</caption>
<thead><tr>
<th>Event</th>
@@ -141,5 +144,5 @@ specific language governing permissions and limitations under the License.
</table>
</div>
- </body>
+ </div></body>
</html>
diff --git a/share/www/script/browse.js b/share/www/script/browse.js
index 39483c1a..66acd679 100644
--- a/share/www/script/browse.js
+++ b/share/www/script/browse.js
@@ -17,7 +17,7 @@ function CouchIndexPage() {
page = this;
this.addDatabase = function() {
- $.showDialog("_create_database.html", {
+ $.showDialog("dialog/_create_database.html", {
submit: function(data, callback) {
if (!data.name || data.name.length == 0) {
callback({name: "Please enter a name."});
@@ -119,7 +119,7 @@ function CouchDatabasePage() {
page = this;
this.addDocument = function() {
- $.showDialog("_create_document.html", {
+ $.showDialog("dialog/_create_document.html", {
submit: function(data, callback) {
db.saveDoc(data.docid ? {_id: data.docid} : {}, {
error: function(status, error, reason) {
@@ -135,7 +135,7 @@ function CouchDatabasePage() {
}
this.compactDatabase = function() {
- $.showDialog("_compact_database.html", {
+ $.showDialog("dialog/_compact_database.html", {
submit: function(data, callback) {
db.compact({
success: function(resp) {
@@ -147,16 +147,25 @@ function CouchDatabasePage() {
}
this.deleteDatabase = function() {
- $.showDialog("_delete_database.html", {
+ $.showDialog("dialog/_delete_database.html", {
submit: function(data, callback) {
db.drop({
success: function(resp) {
callback();
location.href = "index.html";
if (window !== null) {
- parent.$("#dbs li").filter(function(index) {
+ $("#dbs li").filter(function(index) {
return $("a", this).text() == dbName;
}).remove();
+
+ // remove database from recent databases list
+ var recentDbs = $.cookies.get("recent", "").split(",");
+ var recentIdx = $.inArray(db.name, recentDbs)
+ if (recentIdx >= 0) {
+ recentDbs.splice(recentIdx, 1);
+ $.cookies.set("recent", recentDbs.join(","));
+ updateRecentDatabasesList();
+ }
}
}
});
@@ -173,7 +182,7 @@ function CouchDatabasePage() {
dirtyTimeout = setTimeout(function() {
var buttons = $("#viewcode button.save, #viewcode button.revert");
page.isDirty = ($("#viewcode_map").val() != page.storedViewCode.map)
- || ($("#viewcode_reduce").val() != page.storedViewCode.reduce);
+ || ($("#viewcode_reduce").val() != (page.storedViewCode.reduce || ""));
if (page.isDirty) {
buttons.removeAttr("disabled");
} else {
@@ -182,9 +191,7 @@ function CouchDatabasePage() {
}, 100);
}
$("#viewcode textarea").bind("input", updateDirtyState);
- if ($.browser.msie) { // sorry, browser detection
- $("#viewcode textarea").get(0).onpropertychange = updateDirtyState
- } else if ($.browser.safari) {
+ if ($.browser.msie || $.browser.safari) {
$("#viewcode textarea").bind("paste", updateDirtyState)
.bind("change", updateDirtyState)
.bind("keydown", updateDirtyState)
@@ -272,7 +279,7 @@ function CouchDatabasePage() {
} else {
var designDocId = "", localViewName = ""
}
- $.showDialog("_save_view_as.html", {
+ $.showDialog("dialog/_save_view_as.html", {
load: function(elem) {
$("#input_docid", elem).val(designDocId).suggest(function(text, callback) {
db.allDocs({
@@ -490,7 +497,7 @@ function CouchDatabasePage() {
}
if (!viewName) {
- $("#switch select").get(0).selectedIndex = 0;
+ $("#switch select")[0].selectedIndex = 0;
db.allDocs(options);
} else {
if (viewName == "_slow_view") {
@@ -641,7 +648,7 @@ function CouchDocumentPage() {
}
this.deleteDocument = function() {
- $.showDialog("_delete_document.html", {
+ $.showDialog("dialog/_delete_document.html", {
submit: function(data, callback) {
db.removeDoc(page.doc, {
success: function(resp) {
@@ -670,7 +677,7 @@ function CouchDocumentPage() {
"document before you can attach a new file.");
return false;
}
- $.showDialog("_upload_attachment.html", {
+ $.showDialog("dialog/_upload_attachment.html", {
load: function(elem) {
$("input[name='_rev']", elem).val(page.doc._rev);
},
@@ -919,4 +926,4 @@ function encodeAttachment(name) {
encoded.push(encodeURIComponent(parts[i]));
};
return encoded.join('/');
-} \ No newline at end of file
+}
diff --git a/share/www/style/layout.css b/share/www/style/layout.css
index b81f4e46..e67fa78a 100644
--- a/share/www/style/layout.css
+++ b/share/www/style/layout.css
@@ -15,8 +15,11 @@ specific language governing permissions and limitations under the License.
/* General styles */
-html, body { background: transparent; color: #000;
- font: normal 90% Arial,Helvetica,sans-serif; margin: 0; padding: 0;
+html, body { color: #000; font: normal 90% Arial,Helvetica,sans-serif;
+ height: 100%; margin: 0; padding: 0; overflow: hidden;
+}
+body { background: #fff url(../image/bg.png) 100% 0 repeat-y;
+ padding-right: 210px;
}
:link, :visited { color: #ba1e16; text-decoration: none; }
:link img, :visited img { border: none; }
@@ -130,9 +133,10 @@ ul.suggest-dropdown li.selected { cursor: pointer; background: Highlight;
/* Logo & Navigation */
-#wrap { padding: 0 20px 3em; }
-
-#logo { position: absolute; top: 20px; right: 18px; }
+#sidebar { background: #fff; position: absolute; top: 0; right: 0;
+ width: 210px; height: 100%;
+}
+#logo { padding: 20px 18px; }
#nav { color: #333; font-size: 110%; font-weight: bold; list-style: none;
margin: 0; overflow: auto; padding: 0; position: absolute; top: 185px;
@@ -164,9 +168,10 @@ ul.suggest-dropdown li.selected { cursor: pointer; background: Highlight;
font-size: 80%; opacity: .7; padding: 5px 10px; position: absolute; right: 0;
bottom: 0; min-height: 1.3em; width: 190px; text-align: right;
}
-#view { position: absolute; left: 0; right: 210px; top: 0; bottom: 0;
- height: 100%;
-}
+#footer :link, #footer :visited { color: #000; }
+
+#wrap { height: 100%; overflow: auto; }
+#content { padding: 0 20px 3em; }
/* Toolbar */