Difference between revisions of "Template:Waterloo/Pages/cal-heatmap-test"

 
(14 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
<script src="https://2015.igem.org/wiki/index.php?title=Template:Waterloo/JS/cal-heatmap&action=raw&ctype=text/javascript"></script>
 
<script src="https://2015.igem.org/wiki/index.php?title=Template:Waterloo/JS/cal-heatmap&action=raw&ctype=text/javascript"></script>
 
<script src="https://2015.igem.org/wiki/index.php?title=Template:Waterloo/JS/days&action=raw&ctype=text/javascript"></script>
 
<script src="https://2015.igem.org/wiki/index.php?title=Template:Waterloo/JS/days&action=raw&ctype=text/javascript"></script>
 +
<script src="https://2015.igem.org/wiki/index.php?title=Template:Waterloo/JS/notes&action=raw&ctype=text/javascript"></script>
 +
<script>
 +
var month = new Array();
 +
month[0] = "Jan";
 +
month[1] = "Feb";
 +
month[2] = "Mar";
 +
month[3] = "Apr";
 +
month[4] = "May";
 +
month[5] = "Jun";
 +
month[6] = "Jul";
 +
month[7] = "Aug";
 +
month[8] = "Sep";
 +
month[9] = "Oct";
 +
month[10] = "Nov";
 +
month[11] = "Dec";
 +
</script>
 
<link rel="stylesheet" href="https://2015.igem.org/wiki/index.php?title=Template:Waterloo/CSS/cal-heatmap&action=raw&ctype=text/css"></link>
 
<link rel="stylesheet" href="https://2015.igem.org/wiki/index.php?title=Template:Waterloo/CSS/cal-heatmap&action=raw&ctype=text/css"></link>
  
 
<div id="cal-heatmap"></div>
 
<div id="cal-heatmap"></div>
<div id="onClick-placeholder">
+
<div>
 +
<h1 id="onClick-placeholder"></h1>
 +
<ul id="notes-table"></ul>
 +
</div>
 
<script type="text/javascript">
 
<script type="text/javascript">
 
var cal = new CalHeatMap();
 
var cal = new CalHeatMap();
Line 17: Line 36:
 
    subDomain : "day",
 
    subDomain : "day",
 
    range : 5,
 
    range : 5,
    itemName: ['%','%'],
+
    cellSize: 32,
    cellSize: 20,
+
 
subDomainTextFormat: "%d",
 
subDomainTextFormat: "%d",
 +
displayLegend: false,
 
onClick: function(date, nb) {
 
onClick: function(date, nb) {
$("#onClick-placeholder").html("You just clicked <br/>on <b>" +
+
$("#onClick-placeholder").html("<b>" +
date + "</b> <br/>with <b>" +
+
date.toDateString() + "</b>"
(nb === null ? "unknown" : nb) + "</b> items"
+
);
 +
var message = ""
 +
var key = month[date.getMonth()]+(date.getDate())
 +
if (key in notes){
 +
$.each(notes[key], function( index, value ) {
 +
message += "<li>"+value+"</li>";
 +
});}
 +
$("#notes-table").html(message
 
);
 
);
 
}
 
}

Latest revision as of 23:53, 13 September 2015