Commit 2cb5ed19 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

js/model.js: 'short_name' format for sample keys

parent e038cedb
......@@ -171,6 +171,7 @@
<div class="menu_box">
point key</br>
<div class="buttonSelector" onclick="m.changeTimeFormat('name', true)"><input type="radio" name="time" value="name" checked>name</input></div>
<div class="buttonSelector" onclick="m.changeTimeFormat('short_name', true)"><input type="radio" name="time" value="short_name" checked>name (short)</input></div>
<div class="buttonSelector" onclick="m.changeTimeFormat('sampling_date', true)"><input type="radio" name="time" value="sampling_date" >sampling date</input></div>
<div class="buttonSelector" onclick="m.changeTimeFormat('delta_date', true)"><input type="radio" name="time" value="delta_date">day after first sample</input></div>
</div>
......
......@@ -1426,6 +1426,7 @@ Model.prototype = {
switch (format) {
case "name":
case "short_name":
if (typeof this.samples.names != 'undefined' && this.samples.names[timeID] != ""){
result = this.samples.names[timeID]
}else{
......@@ -1433,6 +1434,9 @@ Model.prototype = {
result = result.split('/')[result.split('/').length-1]
result = result.split('.')[0]
}
if (format == "short_name"){
result = result.substring(0, 8);
}
break;
case "sampling_date":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment