Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better comparison interface, overexposure warning

  • Loading branch information...
commit 734d5dac7ddf0471c481071c3b41291a6a9740e7 1 parent ccc8fd1
@jywarren authored
View
2  webserver/app/controllers/analyze_controller.rb
@@ -6,7 +6,7 @@ def spectrum
@spectrum.extract_data
@spectrum.save
end
- @spectra = Spectrum.find(:all, :limit => 4, :order => "created_at DESC", :conditions => ["id != ?",@spectrum.id])
+ @spectra = Spectrum.find(:all, :limit => 12, :order => "created_at DESC", :conditions => ["id != ?",@spectrum.id])
@calibrations = current_user.calibrations if logged_in?
@comment = Comment.new
render :layout => "bootstrap"
View
2  webserver/app/controllers/spectrums_controller.rb
@@ -76,7 +76,7 @@ def author
# non REST
def compare
@spectrum = Spectrum.find(params[:id])
- @spectra = Spectrum.find(:all, :conditions => ['id != ? AND (title LIKE ? OR notes LIKE ?)',@spectrum.id,"%"+params[:q]+"%", "%"+params[:q]+"%"],:limit => 20,:order => "created_at DESC")
+ @spectra = Spectrum.find(:all, :conditions => ['id != ? AND (title LIKE ? OR notes LIKE ? OR author LIKE ?)',@spectrum.id,"%"+params[:q]+"%", "%"+params[:q]+"%","%"+params[:q]+"%"],:limit => 20,:order => "created_at DESC")
render :partial => "analyze/compare_search", :layout => false
end
View
4 webserver/app/views/analyze/_compare_search.html.erb
@@ -1,8 +1,8 @@
<table class="table">
<% @spectra.each do |spectrum| %>
<tr id="spectrum_<%= spectrum.id %>">
- <td><img width="120px" class="img" src="<%= spectrum.photo.url(:thumb) %>" /></td>
- <td width="160px;"><b><%= spectrum.title %></b><br /> <%= time_ago_in_words(spectrum.created_at) %> ago</td>
+ <td width="120px;"><img width="120px" class="img" src="<%= spectrum.photo.url(:thumb) %>" /></td>
+ <td width="240px;"><b><%= spectrum.title %></b><br /> by <a href="/profile/<%= spectrum.author %>"><%= spectrum.author %></a> <%= time_ago_in_words(spectrum.created_at) %> ago</td>
<!--<a class="" id="spectrum_btn_<%= spectrum.id %>" href="javascript:void(0);">Add +</a> <span id="scaledFlag_<%= spectrum.id %>"></span>-->
<td><% if @spectrum %><a data-dismiss="modal" class="btn btn-primary" id="spectrum_btn_<%= spectrum.id %>" href="javascript:void(0)">Compare</a><% end %></td>
View
18 webserver/app/views/analyze/spectrum.html.erb
@@ -26,18 +26,16 @@
<div class="navbar navbar-inverse navbar-static-bottom" style="margin:0;">
<div class="navbar-inner">
- <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>
+ <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>
- <a href="#embedmodal" class="btn btn-inverse hidden-phone" 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" 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 hidden-phone" id="createSet" href="javascript:void(0);"><i class="icon icon-white icon-list"></i><span class="hidden-phone"> Save as set</span></a>
- <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 href="#embedmodal" class="btn btn-inverse hidden-phone" 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" 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 hidden-phone" id="createSet" href="javascript:void(0);"><i class="icon icon-white icon-list"></i><span class="hidden-phone"> Save as set</span></a>
+ <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>
+ <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>
</div>
</div>
View
6 webserver/public/javascripts/capture.js
@@ -400,7 +400,7 @@ $W = {
})
},
- overexposure_threshold: 20, // how many pixels of consecutive 100% triggers an overexposure warning
+ overexposure_threshold: 15, // how many pixels of consecutive 100% triggers an overexposure warning
/* Inspects a given color channel recursively for sequential
* pixels of 100%, which would indicate overexposure. Returns
* whether it passed the threshold and the last inspected index.
@@ -484,6 +484,10 @@ $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.