commit b9468c11741b82c9f38c5e57f3d66dbe4160a57d
parent c5cc89fbd94bdf52d570c92c8261f17bb4dcc490
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Tue, 17 Nov 2015 14:36:39 +0100
add button to prefill form, add more fields to prefill function
Diffstat:
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/js/history-form-prefiller.js b/js/history-form-prefiller.js
@@ -2,7 +2,39 @@ var PrefillMachine = {
prefillCorrectly: function() {
$("#sample_id").val("sample00");
+ $("#name").val("John Doe");
+ $("#email").val("john@doe.com");
+ $("#latitude").val("56.08");
+ $("#longitude").val("10.11");
+
+ $("#be_zobs").val("0.0");
+ $("#al_zobs").val("0.0");
+
+ $("#be_conc").val("5.67e5");
+ $("#al_conc").val("2.67e6");
+
+ $("#be_uncer").val("2.6");
+ $("#al_uncer").val("4.0");
+
+ $("#be_prod_muons").val("5.33");
+ $("#al_prod_muons").val("31.1");
+
+ $("#be_prod_spall").val("0.106");
+ $("#al_prod_spall").val("0.70");
+
+ $("#rock_density").val("2650");
+
+ $("#epsilon_gla_min").val("0.1");
+ $("#epsilon_gla_max").val("1000");
+
+ $("#epsilon_int_min").val("0.1");
+ $("#epsilon_int_max").val("1000");
+
+ $("#t_degla_min").val("10000");
+ $("#t_degla_max").val("12000");
+
+ $("input[name='rec_5kyr']").prop("checked", true);
}
}
diff --git a/pages/history.html b/pages/history.html
@@ -18,6 +18,13 @@
</p>
</div>
+ <div class="row center">
+ <div class="col s12 m12">
+ <input id="prefill" type="button" value="Load example data"
+ onclick="PrefillMachine.prefillCorrectly();">
+ </div>
+ </div>
+
<!--<div>
<a class="btn" onclick="Materialize.toast('I am a toast', 5000)">
<i class="material-icons tooltipped prefix">info_outline</i>
@@ -75,7 +82,7 @@
'Latitude of sampling location. Used for ' +
'anonymous statistical purposes. Format: ' +
'signed degrees format (DDD.ddd). South ' +
- 'latitudes must be preceded with a minus' +
+ 'latitudes must be preceded with a minus ' +
'sign.',
5000)">info_outline</i></a>
<input id="lat" name="lat" type="text"
@@ -261,7 +268,8 @@
'Measured or estimated rock density',
5000)">info_outline</i></a>
<input id="rock_density" name="rock_density" type="text"
- class="validate" value="2650" required>
+ class="validate" required>
+ <!--class="validate" value="2650" required>-->
<label for="rock_density" class="active">Density
<small>Required</small></label>
</div>