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 22, 2014
2 parents 3a9ddcf + 0c591ee commit 3c0fe9e
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 11 deletions.
43 changes: 37 additions & 6 deletions server/static/css/simulation.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ body {
}

#simulation_adjust_main table {
width: 90%;
width: 100%;
height: 100%;
color: white;
}
Expand All @@ -213,7 +213,7 @@ body {
}

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

.part {
Expand Down Expand Up @@ -245,10 +245,41 @@ body {
width: 60%;
background-color: gray;
position: relative;
left: 42px;
left: 47px;
top: 34px;
}

.adjust_part {
width: 100%;
overflow: hidden;
position: relative;
left: 0; top: 0;
}

.adjust_part output {
bottom: 72%;
width: 70px;
}

.adjust_part>* {
float: left;
margin: 0;
}

.left.arrow.icon, .right.arrow.icon {
display: block;
width: 15%;
margin: 3px 0 3px 0;
}

.left.arrow.icon:hover, .right.arrow.icon:hover {
color: #D95C5C;
}

.adjust_part>input {
width: 70%;
}

#Static_main {
width: auto;
height: 100%;
Expand Down Expand Up @@ -362,28 +393,28 @@ body {

output {
position: absolute;
opacity: 0.7;
background-image: -moz-linear-gradient(top, #444444, #999999);
background-image: -o-linear-gradient(top, #444444, #999999);
background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#999999));
background-image: -webkit-linear-gradient(top, #444444, #999999);
height: 30px;
text-align: center;
color: white;
border-radius: 10px;
border-radius: 2px;
display: none;
bottom: 180%;
left: 0;
margin-left: -1%;
z-index: 99999;
background:rgba(0, 0, 0, 0.2);
}

output:after {
content: "";
position: absolute;
width: 0;
height: 0;
border-top: 10px solid #999999;
border-top: 10px solid rgba(0, 0, 0, 0.2);
border-left: 5px solid transparent;
border-right: 5px solid transparent;
top: 100%;
Expand Down
10 changes: 8 additions & 2 deletions server/static/js/input-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ $(ShowOutput = function() {
newPoint = (el.val() - el.attr("min")) / (el.attr("max") - el.attr("min"));
if ($(this).parent().prop('id') == 'static_adjust_input') {
offset = 15.5;
} else if ($(this).prop('name') == 'RIPS') {
offset = -2;
} else {
offset = 8;
}
Expand All @@ -18,7 +20,11 @@ $(ShowOutput = function() {
display: 'inline-block',
left: newPlace,
marginLeft: offset + "%"
})
.text(el.val());
});
if ($(this).prop('name') == 'RIPS') {
el.next("output").text(alphaList[parseInt(el.val())]);
} else {
el.next("output").text(el.val());
}
});
});
28 changes: 25 additions & 3 deletions server/static/js/simulation-ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,13 @@ function SetCircuits () {
var newLine = $(
'<tr class="adjust_line">' +
'<td class="main_parts"><div class="mid_line"></div></td>' +
'<td><input type="range" min="0" max="53" step="1" value="' +
recordAdjustValues[curCircuit]['circuitRBS'][curLogic][m] + '"/></td>' +
'<td class="adjust_part">' +
'<i class="left arrow icon"></i>' +
'<input name="RIPS" class="adjust_input" type="range" min="0" max="53" step="1" value="' +
recordAdjustValues[curCircuit]['circuitRBS'][curLogic][m] + '"/>' +
'<output for="RIPS"></output>' +
'<i class="right arrow icon"></i>' +
'</td>' +
'</tr>'
);
for (var n = 0; n < allParts[m].length; ++n) {
Expand All @@ -270,6 +275,7 @@ function SetCircuits () {
newLine.appendTo($('#simulation_adjust_main tbody'));
}
AdjustRBS();
SelectRBS();
};

/* Adjust RIPS. */
Expand Down Expand Up @@ -336,7 +342,23 @@ $(AdjustRBS = function() {
});
});

$(SelectRBS = function() {
ShowOutput();
$('.left.arrow.icon').unbind('click').bind('click', function() {
var input = $(this).parent().find('input[type=range]');
if (input.val() > 0) {
input.val(parseInt(input.val()) -1).change().mouseup();
}
});
$('.right.arrow.icon').unbind('click').bind('click', function() {
var input = $(this).parent().find('input[type=range]');
if (input.val() < 53) {
input.val(parseInt(input.val()) +1).change().mouseup();
}
});
});

/* The first logic of the first circuit selected by default. */
$(function() {
$('#simulation_circuit .ui.dropdown.item:first-child').find('a.item:first-child').click();
})
});
5 changes: 5 additions & 0 deletions server/static/js/simulation-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ $(function() {
/* Get RIPS of current logic of current circuit. */
$(function() {
window.RBSList = [];
window.alphaList = [];
$.ajax({
url: '/biobrick/RBS',
contentType: 'application/json',
Expand All @@ -127,6 +128,7 @@ $(function() {
success: function(data) {
for (var i = 0; i < data['result'].length; ++i) {
RBSList.push(data['result'][i]['name']);
alphaList.push(data['result'][i]['alpha']);
}
},
fail: function() {
Expand Down Expand Up @@ -193,6 +195,9 @@ function ShowData() {
console.log('RBSList: ');
console.log(RBSList);

console.log('alphaList: ');
console.log(alphaList);

console.log('recordAdjustValues: ');
console.log(recordAdjustValues);

Expand Down

0 comments on commit 3c0fe9e

Please sign in to comment.