Permalink
Browse files

calibration from new analyze interface

  • Loading branch information...
1 parent 86a6733 commit 12fb709b0150f1d0b7be5ed5d183ecc0653d0174 @jywarren committed Nov 27, 2012
View
2 webserver/app/controllers/spectrums_controller.rb
@@ -298,7 +298,7 @@ def calibrate
redirect_to "/spectra/show/"+@spectrum.id.to_s
else
flash[:error] = "You must be logged in and own this spectrum to calibrate."
- redirect_back
+ redirect_to "/spectra/show/"+@spectrum.id.to_s
end
end
View
2 webserver/app/views/layouts/bootstrap.html.erb
@@ -43,7 +43,7 @@ and justice issues. PLOTS provides an online research space for citizens, linkin
<div id="header">
<a id="logo" href="/"><img src="/images/logo.png" /></a>
- <h3 class="hidden-desktop visible-phone pull-left"><a class="title" href="/">Spectral Workbench</a></h3>
+ <h3 class="hidden-desktop visible-phone pull-left"><a class="title" href="/">SW</a></h3>
<h3 class="hidden-phone visible-desktop pull-left"><a class="title" href="/">Spectral Workbench</a><small> by <a href="http://publiclaboratory.org">Public Lab</a></small></h3>
<script> if ($('body').width() < 767) { $('#logo').addClass('mobile'); setTimeout(function() {$('#headerBtns').addClass('mobile'); },250) } </script>
View
27 webserver/app/views/spectrums/_calibrate.html.erb
@@ -0,0 +1,27 @@
+<div class="modal hide fade" id="calibratemodal1">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <b>Use a fluorescent bulb spectrum to calibrate your spectrometer</b>
+ </div>
+ <div class="modal-body">
+ <p>You'll need a clear fluorescent spectrum like the one shown here. First, click on the highest peak of the middle blue band:</p>
+ <p style="text-align:center;"><img class="img-rounded" src="/images/calibrate-blue.png"></p>
+ </div>
+ <div class="modal-footer">
+ <a data-dismiss="modal" class="btn" href="javascript:void();">Cancel</a>
+ <a data-dismiss="modal" class="btn btn-primary" href="#calibrationmodal2" onClick="$('#graph').bind('plotclick', function (event, pos, item) { $('#graph').unbind('plotclick');$W.second_calibration(pos.x,435.833);$('#calibratemodal2').modal('show'); })">Begin</a></p>
+ </div>
+</div>
+<div class="modal hide fade" id="calibratemodal2">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <b>Complete your calibration</b>
+ </div>
+ <div class="modal-body">
+ <p>Now, click at the peak of the green band as shown here: </p>
+ <p style="text-align:center;"><img class="img-rounded" src="/images/calibrate-green.png"></p>
+ </div>
+ <div class="modal-footer">
+ <a data-dismiss="modal" class="btn btn-primary" href="javascript:void();">Finish</a></p>
+ </div>
+</div>
View
5 webserver/app/views/spectrums/_embed.html.erb
@@ -1,11 +1,12 @@
-<div class="modal hide fade" id="embed">
+<div class="modal hide fade" id="embedmodal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<b>Embed this spectrum on your website</b>
</div>
<div class="modal-body">
<p>Copy this code onto your blog to share your spectral data:</p>
- <textarea cols="50" rows="4"><iframe width='500px' height='400px' border='0' src='http://spectralworkbench.org/spectra/embed/<%= @spectrum.id %>'></iframe></textarea>
+ <textarea id="embedcode" cols="50" rows="4"><iframe width='500px' height='400px' border='0' src='http://spectralworkbench.org/spectra/embed/<%= @spectrum.id %>'></iframe></textarea>
+ <p><a class="btn" href="javascript:void();" id="embed">Custom size</a></p>
</div>
<div class="modal-footer">
<a data-dismiss="modal" href="#" class="btn">Close</a>
View
28 webserver/app/views/spectrums/analyze.html.erb
@@ -6,15 +6,17 @@
<div class="container-fluid" style="clear:both;">
<div class="row-fluid" id="display">
- <img style="width:100%;height:100px;" id="image" src="<%= @spectrum.photo.url(:original) %>" />
+ <img style="width:95%;height:100px;padding:0 1% 0 4%;background:black;" id="image" src="<%= @spectrum.photo.url(:original) %>" />
<div id="graph" style="width:98%;height:200px;"></div>
<div class="navbar navbar-inverse navbar-static-bottom" style="margin:0;">
<div class="navbar-inner">
- <a class="btn btn-primary"><i class="icon icon-white icon-screenshot"></i><span class="hidden-phone"> Calibrate</span></a>
- <a href="#embed" class="btn btn-inverse" data-toggle="modal"><i class="icon icon-white icon-share"></i><span class="hidden-phone"> Embed</span></a>
+ <a data-toggle="modal" href="#calibratemodal1" class="btn btn-primary"><i class="icon icon-white icon-screenshot"></i><span class="hidden-phone"> Calibrate</span></a>
+ <%= render :partial => "calibrate" %>
+
+ <a href="#embedmodal" class="btn btn-inverse" data-toggle="modal"><i class="icon icon-white icon-share"></i><span class="hidden-phone"> Embed</span></a>
<%= render :partial => "embed" %>
- <a class="btn btn-inverse"><i class="icon icon-white icon-plus-sign"></i><span class="hidden-phone"> Add to set</span></a>
+ <a class="btn btn-inverse" href="javascript:void(0);" onClick="window.location = '/sets/add/'+prompt('Add to which set? (enter an id)')+'?spectrum_id=<%= @spectrum.id %>'"><i class="icon icon-white icon-plus-sign"></i><span class="hidden-phone"> Add to set</span></a>
<a class="btn btn-inverse"><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>Toggle units</a></li><li><a>Toggle RGB</a></li><li><a>Re-extract from photo</a></li><li><a>Set sample row</a></li></ul>'><i class="icon icon-white icon-briefcase"></i><span class="hidden-phone"> More tools</span></a>
@@ -43,16 +45,22 @@
<% end %>
<br />
<div class="btn-group">
- <a class="btn btn-small" href="<%= @spectrum.id %>.json"><b>JSON</b></a>
- <a class="btn btn-small" href="<%= @spectrum.id %>.csv"><b>CSV</b></a>
- <a class="btn btn-small" href="<%= @spectrum.id %>.xml"><b>XML</b></a>
+ <a class="btn btn-small" href="/spectra/show/<%= @spectrum.id %>.json"><b>JSON</b></a>
+ <a class="btn btn-small" href="/spectra/show/<%= @spectrum.id %>.csv"><b>CSV</b></a>
+ <a class="btn btn-small" href="/spectra/show/<%= @spectrum.id %>.xml"><b>XML</b></a>
<a rel="tooltip" class="btn btn-small" href="http://publiclaboratory.org/wiki/spectral-workbench-exporting" title="About export formats"><i class="icon icon-question-sign"></i></a>
</div>
- </div>
- <div class="span9">
-
+ <hr />
+ <div id="share">
+ <div class="fb-like" data-send="false" data-layout="button_count" data-width="50" data-show-faces="false" style="vertical-align:top;zoom:1;*display:inline"></div>
+ <a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+ </div>
+ </div>
+
+ <div class="span9">
<a name="comments"></a>
<h3>Comments (<%= @spectrum.comments.length %>)</h3>
View
BIN webserver/public/images/calibrate-blue.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN webserver/public/images/calibrate-green.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 12fb709

Please sign in to comment.