Skip to content

Commit

Permalink
Merge branch 'master' into release_prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
cairijun committed Oct 21, 2014
2 parents 33a367d + 8b57b7e commit 0c93de4
Show file tree
Hide file tree
Showing 37 changed files with 1,512 additions and 1,104 deletions.
2 changes: 1 addition & 1 deletion init_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def outputs():


def RBSs():
_(RBS(name='BBa_B0034', alpha=1))
_(RBS(name='BBa_B0034', alpha=0.01))
_(RBS(name='BBa_B0033', alpha=0.01))
_(RBS(name='BBa_B0072', alpha=0.24))
_(RBS(name='BBa_B0073', alpha=1))
Expand Down
4 changes: 3 additions & 1 deletion server/static/css/circuit.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ body {
padding:0.25em;
}

#circuits li a:hover {color:#10cdcc!important;}
#circuits li.ui-tabs-active.ui-state-active a:hover {color:white!important;}
#circuits li .deletecircuit {float: right; margin: 0.4em 0.2em 0 0; cursor: pointer;}
#circuits li .deletecircuit:hover {color:#00B5AD}
#circuits li.ui-tabs-active.ui-state-active .deletecircuit:hover {color:white}
Expand Down Expand Up @@ -126,7 +128,7 @@ body {

/*right-container*/
#right-container {
position: absolute;
position: fixed;
top: 0;
right:-455px;
width: 445px;
Expand Down
80 changes: 56 additions & 24 deletions server/static/css/simulation.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ body {
}

#simulation_draw {
/*height: 60%;*/
height:500px;
width: 100%;
}
Expand Down Expand Up @@ -111,11 +110,52 @@ body {
float: left;
}

#simulation_circuit .ui.teal.inverted.menu {
width: 255px;
#simulation_circuit .ui.menu {
width: auto;
height: 15%;
background-color: transparent;
margin: 0;
color: white;
}

#simulation_circuit .ui.dropdown.item,
#simulation_circuit .ui.dropdown.item .item {
color: white;
}

#simulation_circuit .ui.dropdown.item .item {
background:rgba(0, 0, 0, 0.5);
}

#simulation_circuit .ui.dropdown.item:hover {
color:#00B5AD!important;
}

#simulation_circuit .ui.dropdown.item.active:hover {
color:white!important;
}

#simulation_circuit .menu a {
margin-top:10px;
border-radius:5px!important;
}

#simulation_circuit .menu a:hover {
color:#00B5AD!important;
}

#simulation_circuit .menu a.active:hover {
color:white!important;
}


#simulation_circuit .ui.dropdown.item.active,
#simulation_circuit .menu a.active {
background-color:rgba(0, 181, 173, 0.5)! important;
}

.ui.dropdown .menu {
background:none!important;
}

#simulation_circuit_main {
Expand All @@ -124,8 +164,8 @@ body {
}

#logic_box {
width: 320px;
height: 80%;
width: 300px;
height: 200;
overflow-y: auto;
margin: auto;
margin-top: 2%;
Expand All @@ -134,29 +174,21 @@ body {

.logic_item {
min-height:200px!important;
height: 200px!important;
width: 300px!important;
height: 100%;
width: 100%;
text-align:center;
background:rgba(0, 0, 0, 0.5)!important;
position: relative;
left: 0; top: 0;
}

.labelbg {
background:rgba(157, 183, 187, 1) !important;
background: rgba(157, 183, 187, 1) !important;
}

.logic_item > img {
width:120px;
height:120px;
}

#simulation_circuit .ui.teal.inverted.menu>a {
width: 33%;
background:#707070;
}


#simulation_circuit .ui.teal.inverted.menu>a.item.active {
background:#10cdcc;
width:140px;
height:140px;
}

#simulation_adjust_main {
Expand All @@ -181,7 +213,7 @@ body {
}

#simulation_adjust_main th:first-child {
width: 80%;
width: 90%;
}

.part {
Expand All @@ -190,7 +222,7 @@ body {
text-align: center;
position: relative;
left: 0; top: 0;
width: 20%;
width: 15%;
}


Expand All @@ -210,10 +242,10 @@ body {

.mid_line {
height: 5px;
width: 75%;
width: 60%;
background-color: gray;
position: relative;
left: 55px;
left: 42px;
top: 34px;
}

Expand Down
17 changes: 9 additions & 8 deletions server/static/js/circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Circuit.prototype.addOutput = function(newOutput) {
var newoutputcontainer = outputcontainer.clone(true);
newOutput.littleview.remove();
that.view.find(".outputs .items").append(newoutputcontainer);
that.outputsArr.slice(index, 1);
that.outputsArr.splice(index, 1);
} else {
that.deleteOutput(newOutput);
}
Expand Down Expand Up @@ -479,6 +479,9 @@ Circuit.prototype.recover = function(data) {
for (var i = 0; i < data.outputdatas.length; ++i) {
this.addOutput(new Output(data.outputdatas[i]));
}
if (this.isTogSwiTwoSelected) {
this.logicsArr.length = 0;
}
this.view.find(".logics .items").empty();
if (this.isRepSelected) {
this.logicsArr.push(new Logic(data.logicdatas[0]));
Expand All @@ -503,7 +506,6 @@ Circuit.prototype.recover = function(data) {
*/
Circuit.prototype.disableDrop = function() {
this.view.find(".items").droppable({disabled: true});
console.log("success");
}

/**
Expand Down Expand Up @@ -547,9 +549,8 @@ function Part(data) {
if (currentcircuit.partsArr.length == 1 && currentcircuit.isSingleInput) {
warnmessage.html("You can not choose this logic gate because you have choosed a single input logic gate!");
warning.modal("show");
} else {
} else if (!currentcircuit.isRepSelected){
currentcircuit.view.find(".parts .items").droppable({
disabled:false,
accept: that.view,
activeClass: "ui-state-highlight",
drop: function( event, ui ) {
Expand Down Expand Up @@ -623,6 +624,7 @@ function Output(data) {
currentcircuit.addOutput(newOutput);
newOutput.logicview.remove();
currentcircuit.logicsArr.pop();
currentcircuit.logicsArr.length = 1;
}
});
} else {
Expand Down Expand Up @@ -1239,8 +1241,8 @@ function addCircuit() {
*/
circuits.tabs({
activate: function(event, ui) {
var panelindex = ui.newTab.parent().children().index(ui.newTab);
currentcircuit = circuitsArr[panelindex - 1];
var panelId = ui.newPanel.attr("id");
currentcircuit = circuitsArr[parseInt(panelId.charAt(7)) - 1];
}
});

Expand All @@ -1251,12 +1253,11 @@ $("i.deletecircuit").unbind("click").click(function() {
if (circuitCounter == MAXCIRCUITSNUM) {
$("#addCircuit").removeClass("disabled").show();
}
var panelindex = $( this ).closest( "li" ).parent().children().index($( this ).closest( "li" ));
var panelId = $( this ).closest( "li" ).remove().attr( "aria-controls" );
$( "#" + panelId ).remove();
circuitNum = parseInt(panelId.charAt(7));
//circuitsArr.splice(panelindex - 1, 1);
circuitsArr[panelindex - 1] = null;
circuitsArr[circuitNum - 1] = null;
circuitFlag[circuitNum - 1] = false;
--circuitCounter;
circuits.tabs( "refresh" );
Expand Down
2 changes: 1 addition & 1 deletion server/static/js/input-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(function() {
width = el.width();
newPoint = (el.val() - el.attr("min")) / (el.attr("max") - el.attr("min"));
if ($(this).parent().prop('id') == 'static_adjust_input') {
offset = 11.5;
offset = 15.5;
} else {
offset = 8.6;
}
Expand Down
2 changes: 2 additions & 0 deletions server/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ $(document).ready(function() {

$(".modal").modal("setting", {onShow: function() {
$("#page").addClass("modal-active");
$("#right-container").addClass("modal-active");
}});

$(".modal").modal("setting", {onHide: function() {
$("#page").removeClass("modal-active");
$("#right-container").removeClass("modal-active");
}});

$("#showIndex").mouseenter(function() {
Expand Down
8 changes: 3 additions & 5 deletions server/static/js/shape-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,7 @@ g.Shapes.Logic = graphiti.shape.basic.Rectangle.extend({
for (var i = 0; i < logic.outputparts.length; ++i) {
for (var j = 0; j < logic.outputparts[i].length; ++j) {
var bio;
if (logic.outputparts[i][j].type === "output") {
logic.outputparts[i][j].type = "output" + i;
}
logic.outputparts[i][j].type += i;
bio = new g.Shapes.Biobrick(logic.outputparts[i][j]);
this.addBio(bio, i);
}
Expand Down Expand Up @@ -679,7 +677,7 @@ g.Shapes.Logic = graphiti.shape.basic.Rectangle.extend({
this.firstitem = item;
}
this.addFigure(item, item.locator);
if (item.data.type != "terminator") {
if (item.data.type.slice(0, 10) != "terminator") {
this.lastbio = item;
}
},
Expand Down Expand Up @@ -979,7 +977,7 @@ var lastFigure = null;
*/
ex.circle = function(source, target, index) {
var decorator = null, targetport, sourceport;
if (source.type.slice(0, 6) == "output" && target.type == "promoter") {
if (source.type.slice(0, 6) === "output" && target.type.slice(0, 8) === "promoter") {
decorator = new graphiti.decoration.connection.TDecorator();
var angle = [3.1415926 / 3.0, 3.1415926 * 5.0 / 3.0, 3.1415926];
targetport = target.createPort("hybrid", new graphiti.layout.locator.DeviceLocator(target, target.getWidth() / 2 - g.BiobrickWidth * 2.0 / 3.0 * Math.cos(angle[index]), target.getHeight() / 2 + g.BiobrickWidth * 2.0 / 3.0 * Math.sin(angle[index])));
Expand Down
Loading

0 comments on commit 0c93de4

Please sign in to comment.