From 46ffb17d92880f80e0b39d6ff2cd37424669c66c Mon Sep 17 00:00:00 2001 From: waridrox Date: Mon, 26 Jul 2021 18:35:31 +0530 Subject: [PATCH] Making use of the new capture code from sw.js library --- app/assets/config/manifest.js | 4 +- app/views/capture/index2.html.erb | 199 +++++++----------------------- 2 files changed, 46 insertions(+), 157 deletions(-) diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 1e961f9ee..a2cd856e4 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -6,4 +6,6 @@ //= link new-capture.css //= link capture.css //= link capture.js -//= link new-capture.js \ No newline at end of file +//= link new-capture.js +//= link spectral-workbench/examples/capture/capture.js +//= link spectral-workbench/dist/capture.dist.js \ No newline at end of file diff --git a/app/views/capture/index2.html.erb b/app/views/capture/index2.html.erb index 36146ffcf..2482f9e95 100644 --- a/app/views/capture/index2.html.erb +++ b/app/views/capture/index2.html.erb @@ -1,5 +1,6 @@ - +<%= javascript_include_tag "spectral-workbench/examples/capture/capture.js" %> +<%= javascript_include_tag "spectral-workbench/dist/capture.dist.js" %> <%= javascript_include_tag "new-capture" %> @@ -57,98 +58,31 @@
- -
+ <%# %> +

@@ -170,11 +104,10 @@ -
- +

-
- + <%# %> +

Requesting camera access...
(Firefox, Opera or Chrome on Android, or Bowser on iOS). Please click "Allow" when prompted, or try the Upload interface.

@@ -222,11 +155,10 @@ <% end %> }) -
- +
-
- + <%# %> +
- -

Once you save the capture, you cannot go back here.

+ + +

Once you save the capture, you cannot go back here.

-
-
-
- -
- -<% if @calibration %> -

Using spectrum <%= @calibration.id %> "<%= @calibration.title %>" (captured <%= time_ago_in_words(@calibration.created_at) %> ago) as a calibration reference.

-

If that's wrong, you can ignore this, and calibrate later with the correct reference. Or choose a new calibration:

-
-
- - Switch calibration -
-
-<% end %> - -<%= render :partial => "save" %> - -
+
+

Using calibration:

+ + Switch calibration +
+
+
+
+ <%# %> +
+ <%= render :partial => "save" %> +
- - \ No newline at end of file