Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

calibration prompt and sample row storage tweaks

  • Loading branch information...
commit 26b75ed5659c4f6170b2d5143da2c87eceaeece8 1 parent 934eef4
Jeffrey Warren authored
2  webserver/app/views/capture/_capture.html.erb
View
@@ -1,10 +1,10 @@
<div data-role="page" id="capture" data-theme="a">
<div data-theme="a" data-role="header">
+ <% if logged_in? && current_user.calibrations.length == 0 %><span style="float:right;padding:14px;font-size:14px;font-weight:normal;">To calibrate, <a href="http://publiclaboratory.org/wiki/spectral-workbench-calibration" target="_blank">save a CFL spectrum</a>.</span><% end %>
<h3 class="header" style="text-align:left;margin-left:15px;">
<img src="/images/spectralworkbench.png" />
<a style="margin-left:3px;color:white;text-decoration:none;" id="home" data-theme="b" href="/" target="_blank">SpectralWorkbench</a>
<% if params[:action] == "match" %>- <span style="font-weight:normal;">Matching in set "<i><%= @set.title %></i>"</span><% end %>
-
</h3>
</div>
2  webserver/app/views/capture/_tools.html.erb
View
@@ -27,7 +27,7 @@
<p><a href="https://github.com/jywarren/spectral-workbench">SpectralWorkbench is free software</a> by <a href="http://publiclaboratory.org">Public Lab</a> Your input is invaluable! See <a href="https://github.com/jywarren/spectral-workbench/issues">Github issues</a> to help design/refine/debug new features.<p>
- <a data-icon="gear" data-role="button" data-theme="a" href="#configure" data-panel="main">Configure</a>
+ <a onClick="setTimeout(function(){$('#samplerow-slider').val($W.sample_start_row)},500)" data-icon="gear" data-role="button" data-theme="a" href="#configure" data-panel="main">Configure</a>
<% if !logged_in? %><a data-role="button" data-theme="b" href="#login" data-panel="main">Log in</a><% end %>
<p>This interface works on <a href="https://www.google.com/intl/en/chrome/browser/">Chrome 21+</a>, Opera, and any browser which supports the HTML5 getUserMedia() call. <a href="https://play.google.com/store/apps/details?id=com.opera.browser">Opera Mobile</a> for Android also works! Don't see anything? <a href="http://publiclaboratory.org/wiki/spectral-workbench-web-video">Check if your browser is supported</a></p>
18 webserver/public/javascripts/capture.js
View
@@ -63,11 +63,11 @@ $W = {
$('video').height = "240"
}
+ // retrieve and apply locally stored sample row height
if (localStorage.getItem('sw:sample_start_row')) this.sample_start_row = parseInt(localStorage.getItem('sw:sample_start_row'))
if (localStorage.getItem('sw:sample_end_row')) this.sample_end_row = parseInt(localStorage.getItem('sw:sample_end_row'))
this.sample_height = this.sample_end_row - this.sample_start_row // how many pixels to sample
- $('#samplerow-slider').max = this.options.height // this doesn't work!!!
- setTimeout(function() {$('#samplerow-slider').val($W.sample_start_row)},1000)
+ $W.setSampleRow($W.sample_start_row)
},
@@ -301,12 +301,22 @@ $W = {
}
})
},
+
+ auto_detect_sample_row: function() {
+
+ },
+ setSampleRow: function(row) {
+ $W.sample_start_row = parseInt(row)
+ $('#samplerow-slider').val( $W.sample_start_row );
+ localStorage.setItem('sw:samplestartrow',$W.sample_start_row)
+ },
setSampleRows: function(start,end) {
$W.sample_start_row = start
$W.sample_end_row = end
localStorage.setItem('sw:samplestartrow',$W.sample_start_row)
localStorage.setItem('sw:sampleendrow',$W.sample_end_row)
},
+
getWavelength: function(col) {
return $W.start_wavelength+(col/$W.width)*($W.end_wavelength-$W.start_wavelength)
},
@@ -479,10 +489,6 @@ $W = {
return y
},
- auto_detect_sample_row: function() {
-
- },
-
/**
* Returns a canvas object of any rect from the offered canvas
*/
Please sign in to comment.
Something went wrong with that request. Please try again.