Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

re-added wavelength label for hovering for all you power users

  • Loading branch information...
commit 1a0bac17b75d75f4794feb55ca925b76e54095dd 1 parent 46410fe
@jywarren authored
View
5 webserver/app/views/analyze/spectrum.html.erb
@@ -1,8 +1,5 @@
<script src="/javascripts/show.js"> </script>
<script src="/javascripts/analyze.js"> </script>
-<script language="javascript" type="text/javascript" src="/javascripts/flot/jquery.flot.js"></script>
-<script language="javascript" type="text/javascript" src="/javascripts/flot/jquery.flot.crosshair.js"></script>
-
<%= render :partial => "clone" %>
<%= render :partial => "calibrate" %>
<%= render :partial => "select_row" %>
@@ -37,6 +34,7 @@
<a data-toggle="modal" class="btn btn-inverse" href="#comparemodal"><i class="icon icon-white icon-align-left"></i><span class="hidden-phone"> Compare</span></a>
<a rel="popover" data-placement="left" class="pull-right btn btn-inverse" data-content='<ul class="nav nav-list"><li><a onClick="$W.units()">Toggle units</a></li><li><a onClick="$W.toggle_mode()">Toggle RGB</a></li><li><a onClick="$W.extract()"><i class="icon icon-refresh"></i> Re-extract from photo</a></li><li><a href="#selectrowmodal" data-toggle="modal">Set sample row</a></li><li><a href="/spectra/rotate/<%= @spectrum.id %>">Rotate image</a></li><li><a href="/spectra/find_brightest_row/<%= @spectrum.id %>">Auto-detect brightest spectrum</a></li></ul>'><i class="icon icon-white icon-briefcase"></i><span class="hidden-phone"> More tools</span></a>
+ <b class="pull-right" style="padding-top:10px;margin-right:10px;"><span id="wavelength"></span> <span id="#unit_label">nm</span></b>
<a style="margin-right:4px;" class="pull-right hidden-desktop btn btn-inverse"><i class="icon icon-white icon-search"></i></a></span>
@@ -161,4 +159,3 @@
})()
</script>
-
View
3  webserver/app/views/layouts/bootstrap.html.erb
@@ -28,6 +28,9 @@ and justice issues. PLOTS provides an online research space for citizens, linkin
<%= javascript_include_tag "application" %>
<script src="/javascripts/jquery.min.js"></script>
+<!-- <script language="javascript" type="text/javascript" src="/javascripts/flot/jquery.js"></script> -->
+ <script language="javascript" type="text/javascript" src="/javascripts/flot/jquery.flot.js"></script>
+ <script language="javascript" type="text/javascript" src="/javascripts/flot/jquery.flot.crosshair.js"></script>
</head>
View
3  webserver/public/javascripts/analyze.js
@@ -5,14 +5,13 @@ flotoptions = {
lineWidth: 1,
},
},
- crosshair: { mode: "x" },
yaxis: { show: true, tickFormatter: function(n) { return (n+"").substr(0,4)+"%" }, max: 100, min: 0 },
xaxis: { show: false, tickFormatter: nanometers },
shadowSize: 0,
threshold: { below: 0, color: "#a00" }, //non-functional... not sure why
grid: {
clickable: true,
-// hoverable:true,
+ hoverable:true,
borderWidth: 0,
backgroundColor: "#444",
color: "#ddd",
View
3  webserver/public/javascripts/capture.js
@@ -166,7 +166,8 @@ $W = {
if ($W.mobile) {
// mobile will never need to flip, can't be installed "upside down"
//$W.ctx.save()
- $W.ctx.scale($('#canvas').width()/$('video').height(),1)
+ //$W.ctx.scale($('#canvas').width()/$('video').height(),1)
+ $W.ctx.scale(3,1)
$W.ctx.translate($('video').height()/2,0)
$W.ctx.rotate(Math.PI/2)
$W.ctx.drawImage(video, -startrow/4, -$W.height/2);
View
6 webserver/public/javascripts/show.js
@@ -4,6 +4,7 @@ var ajax_load = "<img src='/images/spinner-small.gif' alt='loading...' />";
spectrum = ""
$W = {
+ latestPosition: null,
updateLegendTimeout: null,
data: [],
mode: "average",
@@ -65,7 +66,7 @@ $W = {
init_hovers: function() {
$("#graph").bind("plothover", function (event, pos, item) {
- latestPosition = pos;
+ $W.latestPosition = pos;
if (!$W.updateLegendTimeout)
$W.updateLegendTimeout = setTimeout($W.updateLegend, 50);
});
@@ -80,7 +81,7 @@ $W = {
updateLegend: function() {
$W.updateLegendTimeout = null;
- var pos = latestPosition;
+ var pos = $W.latestPosition;
var axes = $W.plot.getAxes();
if (pos.x < axes.xaxis.min || pos.x > axes.xaxis.max ||
@@ -278,5 +279,4 @@ $W = {
var legends;
-var latestPosition = null;
Please sign in to comment.
Something went wrong with that request. Please try again.