couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject git commit: updated refs/heads/replicator-redesign to b92f880
Date Mon, 23 Sep 2013 20:33:56 GMT
Updated Branches:
  refs/heads/replicator-redesign 464f8bc80 -> b92f880aa


Hide and show kinda hooked up.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/b92f880a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/b92f880a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/b92f880a

Branch: refs/heads/replicator-redesign
Commit: b92f880aaab33efc057a79b73f1c4d4485c4271a
Parents: 464f8bc
Author: suelockwood <deathbearbrown@gmail.com>
Authored: Mon Sep 23 16:33:49 2013 -0400
Committer: suelockwood <deathbearbrown@gmail.com>
Committed: Mon Sep 23 16:33:49 2013 -0400

----------------------------------------------------------------------
 .../app/addons/replication/templates/form.html  | 26 +++++++++-----------
 src/fauxton/app/addons/replication/views.js     | 21 +++++++++++++---
 2 files changed, 28 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b92f880a/src/fauxton/app/addons/replication/templates/form.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/replication/templates/form.html b/src/fauxton/app/addons/replication/templates/form.html
index b3001e2..02fd80e 100644
--- a/src/fauxton/app/addons/replication/templates/form.html
+++ b/src/fauxton/app/addons/replication/templates/form.html
@@ -11,7 +11,6 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-<span id="clickme">Hey guys</span>
 <form id="replication" class="form-horizontal">
 	<!-- SOURCE -->
 	<div class="row span12" id="step1">
@@ -31,41 +30,38 @@ the License.
 
 			<div class="tab-content small-tabs">
 				<div class="tab-pane active" id="source_local">
-					<select id="from_name" name="source" data-auth-selector="source_local" class="permission">
-							<option value="">Select a database</option>
-							<% _.each( databases, function( db, i ){ %>
-							  <option value="<%=db.name%>" <% if(selectedDB == db.name){%>selected<%}%>
><%=db.name%></option>
-							<% }); %>
-					</select>
+					<input type="text" id="from_name" name="source" data-auth-selector="source_local"
data-next-step="step2" class="permission next"  size="30" placeholder="Start typing the name
of your database you'd like to replicate...">
+
 					<div class="authArea_source_local"></div>
 				</div>
 
 				<div class="tab-pane" id="source_remote">
-					<input type="text" id="from_url" name="source" size="30" value="http://">
+					<input data-next-step="step2" type="text" id="from_url" name="source" size="30" value="http://"
class="next" data-next-step="step2">
 					<small>e.g. http://username:password@user.cloudant.com/database.</small>
 				</div>
 			</div>
 			<div id="options-here">
 			</div>
 		</div>
+
 	</div>
 
-	<div class="row span12" id="step2">
+	<div class="row span12 hide" id="step2">
 		<div class="span2">
 			<h3>TO:</h3>
 		</div>
 		<div class="target span10">
 			<p>Where do you want to replicate your data?</p>
 			<div class="btn-group" id="create_target">
-			  <button class="btn active" type="button" value="false">Existing Database</button>
-			  <button class="btn" type="button" value="true">New Database</button>
+			  <button data-next-step="step3" class="btn next" type="button" value="false">Existing
Database</button>
+			  <button data-next-step="step3" class="btn next" type="button" value="true">New
Database</button>
 			  <input type="checkbox" name="create_target" value="true" class="hide"/>
 			</div>
 		</div>
 	</div>
 
 	<!--TARGET-->
-	<div class="row span12" id="step3">
+	<div class="row span12 hide" id="step3">
 		<div class="span2">
 		</div>
 		<div class="target span10">
@@ -94,13 +90,13 @@ the License.
 
 			<label for="continuous">
 				<input type="checkbox" name="continuous" value="true" id="continuous">
-				Continuous
+				Make this replication continuous.
 			</label>
 
 		</div>
 
 	</div>
-	<div class="row span12" id="step1">
+	<div class="row span12 hide" id="step4">
 		<div class="span2">
 			<h3>NAME: </h3>
 		</div>
@@ -114,7 +110,7 @@ the License.
 
 
 	<div class="actions">
-		<button class="button green save fonticon-replicate" type="submit">Replicate</button>
+		<button class="button green save fonticon-replicate" type="submit" disabled>Replicate</button>
 	</div>
 </form>
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b92f880a/src/fauxton/app/addons/replication/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/replication/views.js b/src/fauxton/app/addons/replication/views.js
index 8e366c6..a137aba 100644
--- a/src/fauxton/app/addons/replication/views.js
+++ b/src/fauxton/app/addons/replication/views.js
@@ -49,6 +49,7 @@ function(app, FauxtonAPI, Components, replication) {
       "click .options": "toggleAdvancedOptions",
       "click .nav-tabs a": "tabs",
       "change .permission": "showMore",
+      "click .next": "nextStep",
       "click #create_target button": "createTarget"
     },
     initialize: function(options){
@@ -63,6 +64,11 @@ function(app, FauxtonAPI, Components, replication) {
         el: "input#to_name"
       });
 
+      this.dbSearchTypeahead = new Components.DbSearchTypeahead({
+        dbLimit: 30,
+        el: "input#from_name"
+      });
+
       this.dbSearchTypeahead.render();
     },
     beforeRender:  function(){
@@ -76,7 +82,7 @@ function(app, FauxtonAPI, Components, replication) {
     createTarget: function(e){
       var $currentTarget = this.$(e.currentTarget);
       checked = $currentTarget.attr('value')=="true";
-      
+
       this.$('[name="create_target"]').prop("checked",checked);
       $currentTarget.parents("#create_target").find('.active').removeClass('active');
       $currentTarget.addClass('active');
@@ -122,10 +128,14 @@ function(app, FauxtonAPI, Components, replication) {
       }
       return error;
     },
+    nextStep: function(e){
+      this.$("#"+this.$(e.currentTarget).attr('data-next-step')).removeClass('hide');
+    },
     serialize: function(){
       return {
         databases:  this.collection.toJSON(),
-        selectedDB: this.selectedDB
+        selectedDB: this.selectedDB,
+        host:  app.host+"/"
       };
     },
     showAdvancedOptions:  function(e){
@@ -136,8 +146,11 @@ function(app, FauxtonAPI, Components, replication) {
     showAuthFields: function(e){
       var dataAuthSelector = this.$(e.currentTarget).attr('data-auth-selector'),
           autharea = ".authArea_"+dataAuthSelector;
-      this.authfields = this.insertView(autharea, new View.AuthFields({type:dataAuthSelector}));
-      this.authfields.render();
+
+      if (this.dataAuthSelector){ this.dataAuthSelector.remove();}
+
+      this.dataAuthSelector = this.insertView(autharea, new View.AuthFields({type:dataAuthSelector}));
+      this.dataAuthSelector.render();
     },
     showMore: function(e){
       if (this.$(e.currentTarget).attr('data-auth-selector') === "source_local"){


Mime
View raw message