couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1095524 - in /couchdb/branches/1.1.x: ./ LICENSE NOTICE THANKS etc/default/couchdb share/www/replicator.html share/www/script/jquery-ui-1.8.11.custom.min.js share/www/style/jquery-ui-1.8.11.custom.css
Date Wed, 20 Apr 2011 21:44:32 GMT
Author: davisp
Date: Wed Apr 20 21:44:32 2011
New Revision: 1095524

URL: http://svn.apache.org/viewvc?rev=1095524&view=rev
Log:
Replace replication destination db UI element.

This is a backport of 1095523 from trunk.


Added:
    couchdb/branches/1.1.x/share/www/script/jquery-ui-1.8.11.custom.min.js
      - copied unchanged from r1095523, couchdb/trunk/share/www/script/jquery-ui-1.8.11.custom.min.js
    couchdb/branches/1.1.x/share/www/style/jquery-ui-1.8.11.custom.css
      - copied unchanged from r1095523, couchdb/trunk/share/www/style/jquery-ui-1.8.11.custom.css
Modified:
    couchdb/branches/1.1.x/   (props changed)
    couchdb/branches/1.1.x/LICENSE
    couchdb/branches/1.1.x/NOTICE
    couchdb/branches/1.1.x/THANKS
    couchdb/branches/1.1.x/etc/default/couchdb   (props changed)
    couchdb/branches/1.1.x/share/www/replicator.html

Propchange: couchdb/branches/1.1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 21:44:32 2011
@@ -6,4 +6,4 @@
 /couchdb/branches/list-iterator:782292-784593
 /couchdb/branches/tail_header:775760-778477
 /couchdb/tags/0.10.0:825400
-/couchdb/trunk:1045203,1064417,1081107-1083320
+/couchdb/trunk:1045203,1064417,1081107-1083320,1095523

Modified: couchdb/branches/1.1.x/LICENSE
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/LICENSE?rev=1095524&r1=1095523&r2=1095524&view=diff
==============================================================================
--- couchdb/branches/1.1.x/LICENSE (original)
+++ couchdb/branches/1.1.x/LICENSE Wed Apr 20 21:44:32 2011
@@ -239,6 +239,35 @@ For the share/www/script/jquery.js compo
   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
+For the share/www/script/jquery-ui-1.8.11.custom.min.js and
+    share/www/style/jquery-ui-1.8.11.custom.css components:
+
+  Copyright (c) 2011 Paul Bakaus, http://jqueryui.com/
+
+  This software consists of voluntary contributions made by many
+  individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
+  contribution history, see the revision history and logs, available
+  at http://jquery-ui.googlecode.com/svn/
+
+  Permission is hereby granted, free of charge, to any person obtaining
+  a copy of this software and associated documentation files (the
+  "Software"), to deal in the Software without restriction, including
+  without limitation the rights to use, copy, modify, merge, publish,
+  distribute, sublicense, and/or sell copies of the Software, and to
+  permit persons to whom the Software is furnished to do so, subject to
+  the following conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
 For the share/www/script/jquery.form.js component:
 
   http://malsup.com/jquery/form/

Modified: couchdb/branches/1.1.x/NOTICE
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/NOTICE?rev=1095524&r1=1095523&r2=1095524&view=diff
==============================================================================
--- couchdb/branches/1.1.x/NOTICE (original)
+++ couchdb/branches/1.1.x/NOTICE Wed Apr 20 21:44:32 2011
@@ -17,6 +17,10 @@ This product also includes the following
  * jQuery (http://jquery.com/)
 
    Copyright 2010, John Resig
+ 
+ * jQuery UI (http://jqueryui.com)
+
+   Copyright 2011, Paul Bakaus
 
  * json2.js (http://www.json.org/)
 

Modified: couchdb/branches/1.1.x/THANKS
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/THANKS?rev=1095524&r1=1095523&r2=1095524&view=diff
==============================================================================
--- couchdb/branches/1.1.x/THANKS (original)
+++ couchdb/branches/1.1.x/THANKS Wed Apr 20 21:44:32 2011
@@ -77,5 +77,6 @@ suggesting improvements or submitting ch
  * Mike Leddy <mike@loop.com.br>
  * Felix Hummel <apache@felixhummel.de>
  * Tim Smith <tim@couchbase.com>
+ * Sam Bisbee <sam@sbisbee.com>
 
 For a list of authors see the `AUTHORS` file.

Propchange: couchdb/branches/1.1.x/etc/default/couchdb
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 21:44:32 2011
@@ -6,5 +6,5 @@
 /couchdb/branches/list-iterator/etc/default/couchdb:782292-784593
 /couchdb/branches/tail_header/etc/default/couchdb:775760-778477
 /couchdb/tags/0.10.0/etc/default/couchdb:825400
-/couchdb/trunk/etc/default/couchdb:1045203,1064417,1081107-1083320
+/couchdb/trunk/etc/default/couchdb:1045203,1064417,1081107-1083320,1095523
 /incubator/couchdb/trunk/etc/default/couchdb:642419-694440

Modified: couchdb/branches/1.1.x/share/www/replicator.html
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/share/www/replicator.html?rev=1095524&r1=1095523&r2=1095524&view=diff
==============================================================================
--- couchdb/branches/1.1.x/share/www/replicator.html [utf-8] (original)
+++ couchdb/branches/1.1.x/share/www/replicator.html [utf-8] Wed Apr 20 21:44:32 2011
@@ -18,14 +18,18 @@ specific language governing permissions 
     <title>Replicator</title>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
     <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
+    <link rel="stylesheet" href="style/jquery-ui-1.8.11.custom.css" type="text/css">
     <script src="script/json2.js"></script>
     <script src="script/sha1.js"></script>
     <script src="script/jquery.js?1.4.2"></script>
     <script src="script/jquery.couch.js?0.11.0"></script>
     <script src="script/jquery.dialog.js?0.11.0"></script>
     <script src="script/futon.js?0.11.0"></script>
+    <script src="script/jquery-ui-1.8.11.custom.min.js"></script>
     <script>
       $(document).ready(function() {
+        var allDatabases;
+
         $("fieldset input[type=radio]").click(function() {
           var radio = this;
           var fieldset = $(this).parents("fieldset").get(0);
@@ -33,24 +37,30 @@ specific language governing permissions 
             this.disabled = radio.value == "local";
             if (!this.disabled) this.focus();
           });
-          $("select", fieldset).each(function() {
+          $('.local', fieldset).each(function() {
             this.disabled = radio.value == "remote";
             if (!this.disabled) this.focus();
           });
         });
 
-        $.couch.allDbs({
-          success: function(dbs) {
-            dbs.sort();
-            $("fieldset select").each(function() {
-              var select = this;
-              $.each(dbs, function(idx, dbName) {
-                $("<option></option>").text(dbName).appendTo(select);
+        var getDatabases = function() {
+          $.couch.allDbs({
+            success: function(dbs) {
+              allDatabases = dbs.sort();
+
+              $("fieldset select").each(function() {
+                var select = this;
+                $.each(dbs, function(idx, dbName) {
+                  $("<option></option>").text(dbName).appendTo(select);
+                });
+                select.selectedIndex = 0;
               });
-              select.selectedIndex = 0;
-            });
-          }
-        });
+
+              $('#to_name').autocomplete({ source: dbs });
+            }
+          });
+        };
+        getDatabases();
 
         $("button#swap").click(function() {
           var fromName = $("#source select").val();
@@ -76,9 +86,20 @@ specific language governing permissions 
 
         $("button#replicate").click(function() {
           $("#records tbody.content").empty();
+          var targetIsLocal = $('#to_local:checked').length > 0;
           var source = $("#from_local")[0].checked ? $("#from_name").val() : $("#from_url").val();
-          var target = $("#to_local")[0].checked ? $("#to_name").val() : $("#to_url").val();
+          var target = targetIsLocal ? $("#to_name").val() : $("#to_url").val();
           var repOpts = {};
+
+          if (targetIsLocal && $.inArray(target, allDatabases) < 0) {
+            if(!confirm('This will create a database named '+target+'. Ok?')) {
+              return;
+            }
+            else {
+              repOpts.create_target = true;
+            }
+          }
+
           if ($("#continuous")[0].checked) {
             repOpts.continuous = true;
           }
@@ -97,6 +118,10 @@ specific language governing permissions 
                 });
                 $("#records tbody tr").removeClass("odd").filter(":odd").addClass("odd");
                 $("#records tbody.footer td").text("Replication session " + resp.session_id);
+
+                if (repOpts.create_target) {
+                  getDatabases();
+                }
               }
             }
           }, repOpts);
@@ -117,7 +142,7 @@ specific language governing permissions 
           <p>
             <input type="radio" id="from_local" name="from_type" value="local" checked>

             <label for="from_local">Local Database: </label>
-            <select id="from_name" name="from_name"></select>
+            <select id="from_name" name="from_name" class="local"></select>
           </p><p>
             <input type="radio" id="from_to_remote" name="from_type" value="remote">

             <label for="from_to_remote">Remote database: </label>
@@ -130,7 +155,7 @@ specific language governing permissions 
           <p>
             <input type="radio" id="to_local" name="to_type" value="local" checked>

             <label for="to_local">Local database: </label>
-            <select id="to_name" name="to_name"></select>
+            <input type="text" id="to_name" name="to_name" class="local"></select>
           </p><p>
             <input type="radio" id="to_remote" name="to_type" value="remote"> 
             <label for="to_remote">Remote database: </label>



Mime
View raw message