Skip to content
Snippets Groups Projects
Commit 705869c7 authored by kaloyane's avatar kaloyane
Browse files

[LMS-2633] functional version of BaSynthec browsing UI, still needs some final touches

SVN: 23736
parent caaefb63
No related branches found
No related tags found
No related merge requests found
Showing
with 17191 additions and 0 deletions
body { font: 14px "Trebuchet MS", sans-serif; }
h1 { font: 16px; }
h3 { font: 12px; }
.strains { padding-bottom: 10px; }
.strains table {
border-collapse: collapse;
}
.strains h2 {
color: #222;
}
.strains td {
font-family: "Verdana", sans-serif;
font-size: 12px;
width: 10%;
padding: 6px;
}
.strains td:hover {
font-size: 14px;
width: 10%;
background-color: steelblue;
font-weight: bold;
color: white;
padding: 2px;
}
.sequenced text {
fill: black;
}
.inspected {
font-weight: bold
}
/* Inspector */
div.inspector {
font: 12px "Verdana", sans-serif;
padding: 10px;
border: 1px solid gray;
margin: 10px 2px;
font-weight: bold;
}
.close {
float: right;
}
.close:hover {
opacity: 0.5;
color: #AAA;
cursor: pointer;
}
ul.dataSets {
list-style-type: none;
}
/**
* Downloads table
*/
.downloads {
color: steelblue;
background-color: #E3E3E3;
}
table.downloads {
font-family: "Trebuchet MS", sans-serif;
font-size: 18px;
font-variant: small-caps;
table-layout: fixed;
width: 100%;
}
.downloads td {
width: 50%;
text-align: left;
}
.downloads td:hover {
cursor: pointer;
font-weight: bold;
}
/**
* properties table
*/
table.properties {
margin: 5px;
}
table.properties td, th {
padding: 5px;
}
.propkey {
font-size: 10px;
white-space: nowrap;
}
.propvalue {
font-size: 10px;
}
button {
font: 14px "Trebuchet MS";
background-color: #222;
background-image: -moz-linear-gradient(top, rgba(255,255,255,.25), rgba(255,255,255,.11));
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,.25)),color-stop(1, rgba(255,255,255,.11)));
background-image: -webkit-linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.11));
color: #fff;
text-rendering: optimizeLegibility;
text-shadow: 0 -1px 1px #222;
padding: 3px 5px 3px 5px;
border: 0;
border-radius: 0;
border-bottom: 1px solid #222;
margin: 0;
-moz-box-shadow: 0 1px 3px #999;
-webkit-box-shadow: 0 1px 3px #999;
}
button.first {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
button.last {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
button.active {
background-color: rgb(65,102,133);
}
button:hover {
background-color: steelblue;
}
input {
font: 14px "Trebuchet MS";
background-image: -moz-linear-gradient(top, rgba(255,255,255,.25), rgba(255,255,255,.11));
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,.25)),color-stop(1, rgba(255,255,255,.11)));
background-image: -webkit-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.1));
color: #000;
text-rendering: optimizeLegibility;
padding: 3px 5px 3px 5px;
border: 0;
border-radius: 0;
margin: 0;
-moz-box-shadow: 0 1px 3px #999;
-webkit-box-shadow: 0 1px 3px #999;
}
\ No newline at end of file
<html>
<head>
<title>openBIS BaSynthec Browser</title>
<script type="text/javascript" src="d3.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script>
var pos = 0;
var testNodes;
var didCreateVis = false;
function createVis()
{
if (didCreateVis) return;
vis = d3.select("#main").append("table")
.attr("width", "100%")
.attr("class", "downloads")
.style("color", "steelblue");
;
didCreateVis = true;
}
function getData(d) {
return [ 1, 2, 3 ];
}
function updateDiagram()
{
vis.selectAll("caption").data(["Files"])
.enter()
.append("caption").text(function(d) { return d; });
// We just want to see non-directories here
var downloadTableRow = vis.selectAll("tr").data(getData, function(d) { return d });
// update
downloadTableRow
.append("tr")
.append("td")
.style("text-align", "left")
.text(function(d) { return d + pos; });
// add
downloadTableRow
.enter()
.append("tr")
.append("td")
.style("text-align", "left")
.text(function(d) { return d + pos; });
// remove
downloadTableRow
.exit()
.transition()
.duration(500)
.style("opacity", "0")
.remove();
}
$(document).ready(function() {
createVis()
$('#button').click(function() { pos = pos + 5; updateDiagram() });
});
</script>
</head>
<body>
<div id="main">
<div id="button-group">
<button id="button">Clickme</button>
</div>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*!
* Utility methods to ease Javascript development.
*
* Copyright 2011 ETH Zuerich, CISD
*/
/**
* Return true if str ends with suffix.
*/
function endsWith(str, suffix)
{
var lastIndex = str.lastIndexOf(suffix);
return (lastIndex != -1) && (lastIndex + suffix.length == str.length);
}
/**
*
* @param propName a name of property
* @returns {Function} a function that can be passed to
*/
function sortByProp(propName)
{
var sortFunction = function(a, b) { if (a[propName] == b[propName]) return 0; return (a[propName] < b[propName]) ? -1 : 1};
return sortFunction;
}
/**
* @param arr an array
* @returns the unique elements of an array
*/
function uniqueElements(arr)
{
var reduceFunc = function(list, elt) {
var size = list.length;
if (size == 0 || list[size - 1] != elt)
{
list.push(elt);
}
return list;
};
return arr.reduce(reduceFunc, []);
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment