couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r817820 - in /couchdb/branches/0.10.x: ./ THANKS etc/default/couchdb share/www/script/futon.browse.js share/www/style/layout.css
Date Tue, 22 Sep 2009 20:25:51 GMT
Author: davisp
Date: Tue Sep 22 20:25:45 2009
New Revision: 817820

URL: http://svn.apache.org/viewvc?rev=817820&view=rev
Log:
Backporting r817793


Modified:
    couchdb/branches/0.10.x/   (props changed)
    couchdb/branches/0.10.x/THANKS
    couchdb/branches/0.10.x/etc/default/couchdb   (props changed)
    couchdb/branches/0.10.x/share/www/script/futon.browse.js
    couchdb/branches/0.10.x/share/www/style/layout.css

Propchange: couchdb/branches/0.10.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 22 20:25:45 2009
@@ -3,4 +3,4 @@
 /couchdb/branches/form:729440-730015
 /couchdb/branches/list-iterator:782292-784593
 /couchdb/branches/tail_header:775760-778477
-/couchdb/trunk:806983,807208-807478,807771,808574,808632,808716,808876,809134,809977,810015,810028,810350,810358,810435,811910,813803,815921,817278,817398,817400,817403,817749
+/couchdb/trunk:806983,807208-807478,807771,808574,808632,808716,808876,809134,809977,810015,810028,810350,810358,810435,811910,813803,815921,817278,817398,817400,817403,817749,817793

Modified: couchdb/branches/0.10.x/THANKS
URL: http://svn.apache.org/viewvc/couchdb/branches/0.10.x/THANKS?rev=817820&r1=817819&r2=817820&view=diff
==============================================================================
--- couchdb/branches/0.10.x/THANKS (original)
+++ couchdb/branches/0.10.x/THANKS Tue Sep 22 20:25:45 2009
@@ -35,5 +35,7 @@
  * Kevin Ilchmann Jørgensen <kijmail@gmail.com>
  * Dirkjan Ochtman <dirkjan@ochtman.nl>
  * Sebastian Cohnen <sebastian.cohnen@gmx.net>
+ * Sven Helmberger <sven.helmberger@gmx.de>
+ * Dan Walters <dan@danwalters.net>
 
 For a list of authors see the `AUTHORS` file.

Propchange: couchdb/branches/0.10.x/etc/default/couchdb
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 22 20:25:45 2009
@@ -3,5 +3,5 @@
 /couchdb/branches/form/etc/default/couchdb:729440-730015
 /couchdb/branches/list-iterator/etc/default/couchdb:782292-784593
 /couchdb/branches/tail_header/etc/default/couchdb:775760-778477
-/couchdb/trunk/etc/default/couchdb:806983,807208-807478,807771,808574,808632,808716,808876,809134,809977,810015,810028,810350,810358,810435,811910,813803,815921,817277-817278,817398,817400,817403,817749
+/couchdb/trunk/etc/default/couchdb:806983,807208-807478,807771,808574,808632,808716,808876,809134,809977,810015,810028,810350,810358,810435,811910,813803,815921,817277-817278,817398,817400,817403,817749,817793
 /incubator/couchdb/trunk/etc/default/couchdb:642419-694440

Modified: couchdb/branches/0.10.x/share/www/script/futon.browse.js
URL: http://svn.apache.org/viewvc/couchdb/branches/0.10.x/share/www/script/futon.browse.js?rev=817820&r1=817819&r2=817820&view=diff
==============================================================================
--- couchdb/branches/0.10.x/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/branches/0.10.x/share/www/script/futon.browse.js [utf-8] Tue Sep 22 20:25:45 2009
@@ -688,6 +688,9 @@
       page = this;
 
       this.activateTabularView = function() {
+        if ($("#fields tbody.source textarea").length > 0)
+          return;
+
         $("#tabs li").removeClass("active").filter(".tabular").addClass("active");
         $("#fields thead th:first").text("Field").attr("colspan", 1).next().show();
         $("#fields tbody.content").show();
@@ -699,7 +702,41 @@
         $("#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})));
+          $(this).html($("<pre></pre>").html($.futon.formatJSON(page.doc, {html:
true})))
+            .makeEditable({allowEmpty: false,
+              createInput: function(value) {
+                return $("<textarea rows='8' cols='80' spellcheck='false'></textarea>");
+              },
+              prepareInput: function(input) {
+                $(input).makeResizable({vertical: true});
+              },
+              end: function() {
+                $(this).html($("<pre></pre>").html($.futon.formatJSON(page.doc,
{html: true})));
+              },
+              accept: function(newValue) {
+                page.doc = JSON.parse(newValue);
+                page.isDirty = true;
+                page.updateFieldListing(true);
+              },
+              populate: function(value) {
+                return $.futon.formatJSON(page.doc);
+              },
+              validate: function(value) {
+                try {
+                  var doc = JSON.parse(value);
+                  if (typeof doc != "object")
+                    throw new SyntaxError("Please enter a valid JSON document (for example,
{}).");
+                  return true;
+                } catch (err) {
+                  var msg = err.message;
+                  if (msg == "parseJSON" || msg == "JSON.parse") { 
+                    msg = "There is a syntax error in the document.";
+                  }
+                  $("<div class='error'></div>").text(msg).appendTo(this);
+                  return false;
+                }
+              }
+            });
         }).end().show();
       }
 
@@ -732,7 +769,7 @@
         }
       }
 
-      this.updateFieldListing = function() {
+      this.updateFieldListing = function(noReload) {
         $("#fields tbody.content").empty();
 
         function handleResult(doc, revs) {
@@ -767,11 +804,16 @@
             $("#fields tbody.footer td span").text("Showing revision " +
               (revs.length - currentIndex) + " of " + revs.length);
           }
-          if (location.hash == "#source") {
+          if (location.hash == "#source" && !noReload) {
             page.activateSourceView();
           }
         }
 
+        if (noReload) {
+          handleResult(page.doc, []);
+          return;
+        }
+
         if (!page.isNew) {
           db.openDoc(docId, {revs_info: true,
             success: function(doc) {

Modified: couchdb/branches/0.10.x/share/www/style/layout.css
URL: http://svn.apache.org/viewvc/couchdb/branches/0.10.x/share/www/style/layout.css?rev=817820&r1=817819&r2=817820&view=diff
==============================================================================
--- couchdb/branches/0.10.x/share/www/style/layout.css (original)
+++ couchdb/branches/0.10.x/share/www/style/layout.css Tue Sep 22 20:25:45 2009
@@ -428,22 +428,23 @@
   float: left; margin-left: 0; padding-left: 2px; padding-right: .5em;
   padding-top: 2px;
 }
-#fields tbody.content input, #fields tbody.content textarea {
+#fields tbody.content input, #fields tbody.content textarea, #fields tbody.source textarea
{
   background: #fff; border: 1px solid; border-color: #999 #ddd #ddd #999;
   margin: 0; padding: 1px; width: 100%;
 }
 #fields tbody.content th input { font-family: inherit; font-size: inherit;
   font-weight: bold;
 }
-#fields tbody.content td input, #fields tbody.content td textarea {
+#fields tbody.content td input, #fields tbody.content td textarea, #fields tbody.source textarea
{
   font: 11px normal "DejaVu Sans Mono",Monaco,monospace;
 }
 #fields tbody.content input.invalid,
-#fields tbody.content textarea.invalid {
+#fields tbody.content textarea.invalid,
+#fields tbody.source textarea.invalid {
   background: #f9f4f4; border-color: #b66 #ebb #ebb #b66;
 }
-#fields tbody.content div.grippie { padding: 0 1px; width: 100%; }
-#fields tbody.content div.error { color: #d33; }
+#fields tbody.content div.grippie, #fields tbody.source div.gripple { padding: 0 1px; width:
100%; }
+#fields tbody.content div.error, #fields tbody.source div.error { color: #d33; }
 
 #fields tbody.content td ul.attachments { list-style: none; margin: 0;
   padding: 0;
@@ -469,6 +470,7 @@
 #fields tbody.source td pre { color: #999; font-size: 11px; line-height: 1.6em;
   margin: 0; overflow: auto; white-space: pre-wrap; width: 100%;
 }
+#fields tbody.source td.editinline-container { padding-left: 14px; padding-right: 48px; }
 
 /* Test suite */
 



Mime
View raw message