Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 69320 invoked from network); 14 Jan 2009 16:48:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jan 2009 16:48:55 -0000 Received: (qmail 74621 invoked by uid 500); 14 Jan 2009 16:48:55 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 74590 invoked by uid 500); 14 Jan 2009 16:48:55 -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 74581 invoked by uid 99); 14 Jan 2009 16:48:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jan 2009 08:48:54 -0800 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; Wed, 14 Jan 2009 16:48:54 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B773B23888A5; Wed, 14 Jan 2009 08:48:33 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r734443 - in /couchdb/trunk/share/www: config.html script/jquery.couch.js style/layout.css Date: Wed, 14 Jan 2009 16:48:24 -0000 To: commits@couchdb.apache.org From: cmlenz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090114164833.B773B23888A5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cmlenz Date: Wed Jan 14 08:48:07 2009 New Revision: 734443 URL: http://svn.apache.org/viewvc?rev=734443&view=rev Log: Allow modification of existing config option values from Futon. Modified: couchdb/trunk/share/www/config.html couchdb/trunk/share/www/script/jquery.couch.js couchdb/trunk/share/www/style/layout.css Modified: couchdb/trunk/share/www/config.html URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/config.html?rev=734443&r1=734442&r2=734443&view=diff ============================================================================== --- couchdb/trunk/share/www/config.html (original) +++ couchdb/trunk/share/www/config.html Wed Jan 14 08:48:07 2009 @@ -22,9 +22,10 @@ + @@ -66,6 +83,10 @@ Configuration
+

+ Note: Some configuration options may require + restarting the server to take effect after modification. +

Modified: couchdb/trunk/share/www/script/jquery.couch.js URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/jquery.couch.js?rev=734443&r1=734442&r2=734443&view=diff ============================================================================== --- couchdb/trunk/share/www/script/jquery.couch.js [utf-8] (original) +++ couchdb/trunk/share/www/script/jquery.couch.js [utf-8] Wed Jan 14 08:48:07 2009 @@ -33,8 +33,23 @@ }, config: function(options, section, option, value) { + options = options || {}; + var url = "/_config/"; + if (section) { + url += encodeURIComponent(section) + "/"; + if (option) { + url += encodeURIComponent(option); + } + } + if (value === undefined) { + var method = "GET"; + } else { + var method = "PUT"; + var data = toJSON(value); + } $.ajax({ - type: "GET", url: "/_config/", + type: method, url: url, contentType: "application/json", + dataType: "json", data: toJSON(value), processData: false, complete: function(req) { var resp = $.httpData(req, "json"); if (req.status == 200) { @@ -42,8 +57,8 @@ } else if (options.error) { options.error(req.status, resp.error, resp.reason); } else { - alert("An error occurred retrieving the server configuration: " + - resp.reason); + alert("An error occurred retrieving/updating the server " + + "configuration: " + resp.reason); } } }); @@ -76,7 +91,7 @@ options = options || {}; $.ajax({ type: "PUT", url: this.uri, contentType: "application/json", - dataType: "json", data: "", processData: false, + dataType: "json", data: "", processData: false, complete: function(req) { var resp = $.httpData(req, "json"); if (req.status == 201) { Modified: couchdb/trunk/share/www/style/layout.css URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/style/layout.css?rev=734443&r1=734442&r2=734443&view=diff ============================================================================== --- couchdb/trunk/share/www/style/layout.css (original) +++ couchdb/trunk/share/www/style/layout.css Wed Jan 14 08:48:07 2009 @@ -104,11 +104,6 @@ table.listing tbody th :link, table.listing tbody th :visited { display: block; } -table.listing tbody.content th button { - background: transparent no-repeat; border: none; cursor: pointer; - float: left; margin: .2em 5px 0 -20px; padding: 0; width: 15px; height: 15px; -} -table.listing tbody.content th button:hover { background-position: -15px 0; } table.listing tbody.footer tr td { background: #e9e9e9; border-top: 1px solid #a7a7a7; color: #999; font-size: 90%; line-height: 1.8em; @@ -121,6 +116,22 @@ table.listing tbody.footer #paging label { color: #666; } table.listing tbody.footer #paging select { font-size: 90%; padding: 0; } +/* Inline editing */ + +span.editinline-tools { margin: 2px 2px 0; float: right; margin-right: -45px; } +span.editinline-tools button { background: transparent 0 0 no-repeat; + border: none; cursor: pointer; display: block; float: left; margin: 0 .2em; + width: 11px; height: 11px; +} +span.editinline-tools button:hover { background-position: 0 -22px; } +span.editinline-tools button:active { background-position: 0 -44px; } +span.editinline-tools button.apply { + background-image: url(../image/apply.gif); +} +span.editinline-tools button.cancel { + background-image: url(../image/cancel.gif); +} + /* Resizer grippies */ div.grippie { background: #e9e9e9 url(../image/grippie.gif) 50% 50% no-repeat; @@ -359,9 +370,12 @@ #fields { clear: right; table-layout: fixed; } #fields col.field { width: 33%; } #fields tbody.content th { padding-left: 25px; padding-right: 48px; } -#fields tbody.content th button { - background-image: url(../image/delete-mini.png);; +#fields tbody.content th button.delete { + background: url(../image/delete-mini.png) no-repeat; border: none; + cursor: pointer; float: left; margin: .2em 5px 0 -20px; padding: 0; + width: 15px; height: 15px; } +#fields tbody.content th button.delete:hover { background-position: -15px 0; } #fields tbody.content th b { display: block; padding: 2px 2px 2px 3px; } #fields tbody.content th b.editinline-container { padding: 0; } #fields tbody.content td { color: #999; padding-left: 14px; @@ -401,26 +415,6 @@ background: #f9f4f4; border-color: #b66 #ebb #ebb #b66; } #fields tbody.content div.grippie { padding: 0 1px; width: 100%; } - -#fields tbody.content span.editinline-tools { margin: 2px 2px 0; float: right; - margin-right: -45px; -} -#fields tbody.content span.editinline-tools button { - background: transparent 0 0 no-repeat; border: none; cursor: pointer; - display: block; float: left; margin: 0 .2em; width: 11px; height: 11px; -} -#fields tbody.content span.editinline-tools button:hover { - background-position: 0 -22px; -} -#fields tbody.content span.editinline-tools button:active { - background-position: 0 -44px; -} -#fields tbody.content span.editinline-tools button.apply { - background-image: url(../image/apply.gif); -} -#fields tbody.content span.editinline-tools button.cancel { - background-image: url(../image/cancel.gif); -} #fields tbody.content div.error { color: #d33; } #fields tbody.content td ul.attachments { list-style: none; margin: 0; @@ -486,14 +480,21 @@ /* Configuration */ -table#config tbody th { background: #e6e6e6; border-right: none; +#config tbody th { background: #e6e6e6; border-right: none; border-top: 1px solid #d9d9d9; } -table#config tbody td.name { border-left: 1px solid #d9d9d9; color: #333; +#config tbody td.name { border-left: 1px solid #d9d9d9; color: #333; font-weight: bold; } -table#config tbody td.value { - font-family: "DejaVu Sans Mono",Monaco,monospace; +#config tbody td.value { padding: 1px 48px 1px 1px; } +#config tbody td.value code { display: block; font-size: 11px; + padding: 2px 2px 2px 3px; +} +#config tbody td.value code.editinline-container { padding: 0; } +#config tbody td input { + background: #fff; border: 1px solid; border-color: #999 #ddd #ddd #999; + font: 11px normal "DejaVu Sans Mono",Monaco,monospace; + margin: 0; padding: 1px; width: 100%; } /* Replication */
Configuration