couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [16/17] git commit: updated refs/heads/1807-Replication to 80a5e6e
Date Thu, 05 Sep 2013 17:34:59 GMT
Fixed Create target. Change swap to icon,  added tooltips, made inputs wider.


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

Branch: refs/heads/1807-Replication
Commit: 87321a362be11d3e38647e380819f8319d63a7b0
Parents: 6ff89dc
Author: suelockwood <deathbearbrown@gmail.com>
Authored: Mon Aug 26 12:32:37 2013 -0400
Committer: suelockwood <deathbearbrown@gmail.com>
Committed: Thu Sep 5 13:34:32 2013 -0400

----------------------------------------------------------------------
 .../replication/assets/less/replication.less    | 82 +++++---------------
 .../app/addons/replication/templates/form.html  |  9 ++-
 src/fauxton/app/addons/replication/views.js     | 16 ++--
 3 files changed, 39 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/87321a36/src/fauxton/app/addons/replication/assets/less/replication.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/replication/assets/less/replication.less b/src/fauxton/app/addons/replication/assets/less/replication.less
index fe544ea..dafc086 100644
--- a/src/fauxton/app/addons/replication/assets/less/replication.less
+++ b/src/fauxton/app/addons/replication/assets/less/replication.less
@@ -13,26 +13,27 @@
 	position: relative;
 
 	.form_set{
-		width: 300px;
+		width: 350px;
 		display: inline-block;
 		border: 1px solid @greyBrown;
-		padding: 10px;
+		padding: 15px 10px 0;
 		margin-bottom: 20px;
 		&.middle{
-			width: 200px;
+			width: 100px;
 			border: none;
 			position: relative;
 			height: 100px;
 			margin: 0;
 		}
 		input, select {
-			margin: 0 0 16px 35px;
+			margin: 0 0 16px 5px;
 			height: 40px;
+			width: 318px;
 		}
 		.btn-group{
-			margin: 0 0 16px 35px;
+			margin: 0 0 16px 5px;
 			.btn {
-				padding: 10px 30px;
+				padding: 10px 57px;
 			}
 		}
 		&.local{
@@ -101,11 +102,9 @@
 			min-width: 130px;
 			padding-left: 0px;
 		}
-		input[type=text],
 		input[type=radio],
-		input[type=checkbox],
-		select {
-
+		input[type=checkbox]{
+			margin: 0 0 2px 0;
 		}
 	}
 
@@ -113,7 +112,7 @@
 		z-index: 0;
 		position: absolute;
 		top: 20px;
-		left: 63px;
+		left: 15px;
 
 		&:after {
 			width: 70px;
@@ -129,56 +128,17 @@
 		}
 	}
 	.swap {
-			z-index: 30;
-			cursor: pointer;
-			position: absolute;
-			font-size: 12px;
-			width: 27px;
-			height: 12px;
-			display: block;
-			border-top: 3px solid @greyBrown;
-			border-bottom: 3px solid @greyBrown;
-			top: 50px;
-			left: 84px;
-			&:hover {
-				border-color: #2C2C2C;
-				&:before {
-					bottom: -8px;
-					right: 23px;
-					position: absolute;
-					border-right: 7px solid #2C2C2C;
-					border-top: 7px solid rgba(44, 44, 44, 0);
-					border-bottom: 7px solid rgba(44, 44, 44, 0);
-					content: "";
-				}
-				&:after {
-					top: -8px;
-					left: 23px;
-					position: absolute;
-					border-left: 7px solid #2C2C2C;
-					border-top: 7px solid rgba(44, 44, 44, 0);
-					border-bottom: 7px solid rgba(44, 44, 44, 0);
-					content: "";
-				}
-		}
-		&:before {
-			bottom: -8px;
-			right: 23px;
-			position: absolute;
-			border-right: 7px solid @greyBrown;
-			border-top: 7px solid rgba(44, 44, 44, 0);
-			border-bottom: 7px solid rgba(44, 44, 44, 0);
-			content: "";
-
-		}
-		&:after {
-			top: -8px;
-			left: 23px;
-			position: absolute;
-			border-left: 7px solid @greyBrown;
-			border-top: 7px solid rgba(44, 44, 44, 0);
-			border-bottom: 7px solid rgba(44, 44, 44, 0);
-			content: "";
+		text-decoration: none;
+		z-index: 30;
+		cursor: pointer;
+		position: absolute;
+		font-size: 40px;
+		width: 27px;
+		height: 12px;
+		top: 31px;
+		left: 30px;
+		&:hover {
+			color: @greyBrown;
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/87321a36/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 2a70889..eeb3081 100644
--- a/src/fauxton/app/addons/replication/templates/form.html
+++ b/src/fauxton/app/addons/replication/templates/form.html
@@ -33,7 +33,9 @@ the License.
 
 		<div class="form_set middle">
 			<span class="circle "></span>
-			<span class="swap">
+				<a href="#" title="Switch Target and Source" class="swap">
+					<span class="fonticon-swap-arrows"></span>
+				</a>
 			</span>
 		</div>
 
@@ -58,6 +60,11 @@ the License.
 				<input type="checkbox" name="continuous" value="true" id="continuous">
 				Continuous
 			</label>
+
+			<label for="createTarget">
+				<input type="checkbox" name="create_target" value="true" id="createTarget">
+				Create Target <i class="icon-question-sign " rel="tooltip" title="Create the target
database"></i>
+			</label>
 		</div>
 
 		<button class="btn btn-success btn-large save" type="submit">Replicate</button>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/87321a36/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 ea87432..b2b8728 100644
--- a/src/fauxton/app/addons/replication/views.js
+++ b/src/fauxton/app/addons/replication/views.js
@@ -120,6 +120,14 @@ function(app, FauxtonAPI, replication) {
 					error = true;
 				}
 			}
+
+			if (this.$('input#to_name').is(':visible')){
+				var alreadyExists = this.collection.where({"name":this.$('input#to_name').val()});
+				if (alreadyExists.length === 0){
+					error = true;
+				}
+			}
+
 			return error;
 		},
 		serialize: function(){
@@ -166,21 +174,17 @@ function(app, FauxtonAPI, replication) {
 			var formJSON = {};
 			_.map(this.$(e.currentTarget).serializeArray(), function(formData){
 				if(formData.value !== ''){
-					formJSON[formData.name] = (formData.value ==="true"? true: formData.value.replace(/\s/g,
''));
+					formJSON[formData.name] = (formData.value ==="true"? true: formData.value.replace(/\s/g,
'').toLowerCase());
 
 				}
 			});
 
-			var alreadyExists = this.collection.where({"name":$('input#to_name').val()});
-
-			if (alreadyExists.length === 0){
-				formJSON.create_target = true;
-			}
 			console.log($(e.currentTarget).serializeArray(), formJSON);
 			this.updateButtonText(true);
 			this.startReplication(formJSON);
 		},	
 		swapFields: function(e){
+			e.preventDefault();
 			//WALL O' VARIABLES
 			var $fromSelect = this.$('#from_name'),
 					$toSelect = this.$('#to_name'),


Mime
View raw message