summaryrefslogtreecommitdiff
path: root/share/www/document.html
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-01-12 21:40:59 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-01-12 21:40:59 +0000
commit7ec87a86a24d0f0d96d7df417e2f1c46ddc6fbfa (patch)
tree3c47ce1fd74c34e6eeb523f2c665f107cf8b4a63 /share/www/document.html
parenta58246859370c52b5209fe94a043bdcc7f8b7001 (diff)
Move `browse.js` code into the `futon` namespace, and restore the selected tab based on the hash in the URL. Applies a small part of the patch to COUCHDB-200.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@733912 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/document.html')
-rw-r--r--share/www/document.html22
1 files changed, 4 insertions, 18 deletions
diff --git a/share/www/document.html b/share/www/document.html
index a6a4821c..5e8831ce 100644
--- a/share/www/document.html
+++ b/share/www/document.html
@@ -26,10 +26,10 @@ specific language governing permissions and limitations under the License.
<script src="script/jquery.form.js?0.9.0"></script>
<script src="script/jquery.resizer.js?0.9.0"></script>
<script src="script/futon.js?0.9.0"></script>
- <script src="script/browse.js?0.9.0"></script>
+ <script src="script/futon.browse.js?0.9.0"></script>
<script src="script/futon.format.js?0.9.0"></script>
<script>
- var page = new CouchDocumentPage();
+ var page = new $.futon.CouchDocumentPage();
$.futon.navigation.ready(function() {
this.addDatabase(page.db.name);
@@ -46,22 +46,8 @@ specific language governing permissions and limitations under the License.
+'/'+encodeURIComponent(page.docId)+'>'+page.docId+'</a>');
page.updateFieldListing();
- $("#tabs li.tabular a").click(function() {
- $("#tabs li").removeClass("active");
- $(this).parent().addClass("active");
- $("#fields thead th:first").text("Field").attr("colspan", 1).next().show();
- $("#fields tbody.content").show();
- $("#fields tbody.source").hide();
- });
- $("#tabs li.source a").click(function() {
- $("#tabs li").removeClass("active");
- $(this).parent().addClass("active");
- $("#fields thead th:first").text("Source").attr("colspan", 2).next().hide();
- $("#fields tbody.content").hide();
- $("#fields tbody.source").find("td").each(function() {
- $(this).html($("<pre></pre>").html($.futon.formatJSON(page.doc, {html: true})));
- }).end().show();
- });
+ $("#tabs li.tabular a").click(page.activateTabularView);
+ $("#tabs li.source a").click(page.activateSourceView);
$("#toolbar button.save").click(page.saveDocument);
$("#toolbar button.add").click(page.addField);