From e05e90e517a4ee6c5a710bf6b289a956b1363cd9 Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Mon, 22 Jun 2009 19:10:48 +0000 Subject: Added 'Jump to Document' in the database.htmlscreen. Would like maybe to see in the future about making it limit input to only existing doc ids, and perhaps only show on the 'All documents' view. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@787354 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/database.html | 24 ++++++++++++++++++++++++ share/www/script/futon.browse.js | 7 +++++++ share/www/style/layout.css | 7 +++++++ 3 files changed, 38 insertions(+) (limited to 'share') diff --git a/share/www/database.html b/share/www/database.html index fbc0a5d7..3a93ce0c 100644 --- a/share/www/database.html +++ b/share/www/database.html @@ -108,7 +108,26 @@ specific language governing permissions and limitations under the License. $("#toolbar button.add").click(page.addDocument); $("#toolbar button.compact").click(page.compactDatabase); $("#toolbar button.delete").click(page.deleteDatabase); + + $('#jumpto input').suggest(function(text, callback) { + page.db.allDocs({ + limit: 10, startkey: text, endkey: text + 'zzz', + success: function(docs) { + var matches = []; + for (var i = 0; i < docs.rows.length; i++) { + if (docs.rows[i].id.indexOf(text) == 0) { + matches[i] = docs.rows[i].id; + } + } + callback(matches); + } + }); + }); + + $("#jumpto input").keypress(page.jumpToDocument); + }); + @@ -126,6 +145,11 @@ specific language governing permissions and limitations under the License. +
+ +