You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2013/08/26 18:32:33 UTC
git commit: updated refs/heads/1807-Replication to e1fb7f8
Updated Branches:
refs/heads/1807-Replication 7a32352c8 -> e1fb7f826
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/e1fb7f82
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e1fb7f82
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e1fb7f82
Branch: refs/heads/1807-Replication
Commit: e1fb7f826814a411b672ae6229a963685af36589
Parents: 7a32352
Author: suelockwood <de...@gmail.com>
Authored: Mon Aug 26 12:32:37 2013 -0400
Committer: suelockwood <de...@gmail.com>
Committed: Mon Aug 26 12:32:37 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/e1fb7f82/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/e1fb7f82/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/e1fb7f82/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'),