diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-01-07 18:21:23 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-01-07 18:21:23 +0000 |
commit | aa48faa19166a1f31d3f2ba6a7c28cc7535b7c6d (patch) | |
tree | fdf7a81cf1c66f7c9d202084936ea9a24e85050b /share/www/index.html | |
parent | f4d88a0164ac42b3781ebd9d170668ff95f7d9ca (diff) |
Futon history browsing - applied patch from COUCHDB-186
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@732413 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/index.html')
-rw-r--r-- | share/www/index.html | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/share/www/index.html b/share/www/index.html index 37217384..a20754b8 100644 --- a/share/www/index.html +++ b/share/www/index.html @@ -30,7 +30,8 @@ specific language governing permissions and limitations under the License. <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> + <script src="script/jquery.history.js?0.8.0"></script> + <script type="text/javascript"> function updateRecentDatabasesList() { $("#dbs").empty(); var recentDbs = $.cookies.get("recent", "").split(","); @@ -41,6 +42,17 @@ specific language governing permissions and limitations under the License. "</a></li>"); }); } + var baseURL = location.pathname.match(/.*\//).toString(); + function updateIFrame(hash) { + var l = frames['content'].location; + var title = frames['content'].document.title + " - Apache CouchDB: Futon Utility Client"; + document.title = title; + var href = baseURL + hash; + // For some reason the onload event fires twice; the 2nd time with URL-decoded l.href + if (hash != '' && decodeURIComponent(l.pathname + l.search) != decodeURIComponent(href)) { + l.href = href; + } + } function updateNavigation(path, queryString) { function fixupPath(path) { // hack for IE/Win return (path.charAt(0) != "/") ? ("/" + path) : path; @@ -69,6 +81,11 @@ specific language governing permissions and limitations under the License. }); } $(function() { + $.historyInit(updateIFrame); + $('#content').load(function() { + var l = frames["content"].location; + $.historyLoad(l.pathname.substring(baseURL.length) + l.search); + }); $.couch.info({ success: function(info, status) { $("#version").text(info.version); @@ -95,7 +112,7 @@ specific language governing permissions and limitations under the License. </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"> + <iframe name="content" src="browse/index.html" allowtransparency="true" id="content"> </div> </body> </html> |