From commits-return-2680-apmail-couchdb-commits-archive=couchdb.apache.org@couchdb.apache.org Mon Jun 22 19:11:01 2009 Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 58392 invoked from network); 22 Jun 2009 19:11:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jun 2009 19:11:00 -0000 Received: (qmail 44543 invoked by uid 500); 22 Jun 2009 19:11:11 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 44500 invoked by uid 500); 22 Jun 2009 19:11:11 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 44491 invoked by uid 99); 22 Jun 2009 19:11:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 19:11:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 19:11:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 79E3F23888C2; Mon, 22 Jun 2009 19:10:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r787354 - in /couchdb/trunk/share/www: database.html script/futon.browse.js style/layout.css Date: Mon, 22 Jun 2009 19:10:49 -0000 To: commits@couchdb.apache.org From: damien@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090622191049.79E3F23888C2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: damien Date: Mon Jun 22 19:10:48 2009 New Revision: 787354 URL: http://svn.apache.org/viewvc?rev=787354&view=rev Log: 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. Modified: couchdb/trunk/share/www/database.html couchdb/trunk/share/www/script/futon.browse.js couchdb/trunk/share/www/style/layout.css Modified: couchdb/trunk/share/www/database.html URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/database.html?rev=787354&r1=787353&r2=787354&view=diff ============================================================================== --- couchdb/trunk/share/www/database.html [utf-8] (original) +++ couchdb/trunk/share/www/database.html [utf-8] Mon Jun 22 19:10:48 2009 @@ -108,7 +108,26 @@ $("#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 @@ +
+ +
  • Modified: couchdb/trunk/share/www/script/futon.browse.js URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.browse.js?rev=787354&r1=787353&r2=787354&view=diff ============================================================================== --- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original) +++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Mon Jun 22 19:10:48 2009 @@ -466,6 +466,13 @@ } } + this.jumpToDocument = function(e) { + if (e.which == 13) { + var docid = $('#jumpto input').val(); + location.href = 'document.html?' + encodeURIComponent(db.name) + '/' + encodeDocId(docid); + } + } + this.updateDocumentListing = function(options) { if (options === undefined) options = {}; if (options.limit === undefined) { Modified: couchdb/trunk/share/www/style/layout.css URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/style/layout.css?rev=787354&r1=787353&r2=787354&view=diff ============================================================================== --- couchdb/trunk/share/www/style/layout.css (original) +++ couchdb/trunk/share/www/style/layout.css Mon Jun 22 19:10:48 2009 @@ -274,6 +274,13 @@ visibility: hidden; } +/* Document quick jump */ + +#jumpto { float: right; padding: 5px 10px 5px 5px; line-height: 16px; + font-weight: bold; color: #666; font-size: 90%; } + +#jumpto input { font-size: 90%; } + /* View selector */ #switch { color: #666; float: right; font-size: 90%; font-weight: bold;