This commit is contained in:
Chuck
2019-06-26 13:53:41 -04:00
parent b9a80f38d0
commit 60a31dc494
2 changed files with 19 additions and 15 deletions

View File

@@ -327,7 +327,7 @@
<div id="RecordingStatusLabel" class="message"> <div id="RecordingStatusLabel" class="message">
<!-- TO DO: Show errors in bag manager --> <!-- TO DO: Show errors in bag manager -->
</div> </div>
<div class="tagging-options open" id="teachTags"> <div class="tagging-options" id="teachTags">
<div class="col-md-10"> <div class="col-md-10">
<!--full with naming box search:no new:yes--> <!--full with naming box search:no new:yes-->
<select id="teachBagFileName" placeholder="Filename"></select> <select id="teachBagFileName" placeholder="Filename"></select>
@@ -337,8 +337,8 @@
<select id="teachBagTags" placeholder="Tags"></select> <select id="teachBagTags" placeholder="Tags"></select>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<i class="fas fa-check-circle" onclick="hideTaggingOptions('teachTags', true)"></i> <i class="fas fa-check-circle" onclick="hideTaggingOptions('teach', true)"></i>
<i class="fas fa-times-circle" onclick="hideTaggingOptions('teachTags', false)"></i> <i class="fas fa-times-circle" onclick="hideTaggingOptions('teach', false)"></i>
</div> </div>
</div> </div>
<div id="playTagError" class="col-md-10"></div> <div id="playTagError" class="col-md-10"></div>
@@ -382,7 +382,7 @@
<!-- TO DO: Show errors in bag manager --> <!-- TO DO: Show errors in bag manager -->
</div> </div>
<!-- TO DO: Bagfile name must not start with "/" --> <!-- TO DO: Bagfile name must not start with "/" -->
<div class="tagging-options open" id="playTags"> <div class="tagging-options" id="playTags">
<div class="col-md-10"> <div class="col-md-10">
<!--full with naming box search:no new:yes--> <!--full with naming box search:no new:yes-->
<select id="playBagFileName" placeholder="Filename"></select> <select id="playBagFileName" placeholder="Filename"></select>
@@ -392,8 +392,8 @@
<select id="playBagTags" placeholder="Tags"></select> <select id="playBagTags" placeholder="Tags"></select>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<i class="fas fa-check-circle" onclick="hideTaggingOptions('playTags', true)"></i> <i class="fas fa-check-circle" onclick="hideTaggingOptions('play', true)"></i>
<i class="fas fa-times-circle" onclick="hideTaggingOptions('playTags', false)"></i> <i class="fas fa-times-circle" onclick="hideTaggingOptions('play', false)"></i>
</div> </div>
</div> </div>
<div> <div>

View File

@@ -74,7 +74,7 @@ setTimeout(function(){
updateRecordingsList() updateRecordingsList()
}, 1000); }, 1000);
}, 1000); }, 10000);
setTimeout(function(){ setTimeout(function(){
@@ -88,7 +88,7 @@ setTimeout(function(){
function displayTaggingOptions(mode) { function displayTaggingOptions(mode) {
var modeTag = '#' + mode + 'Tag'; var modeTag = '#' + mode + 'Tags';
var fileNameSelector = '#' + mode + 'BagFileName'; var fileNameSelector = '#' + mode + 'BagFileName';
var categorySelector = '#' + mode + 'BagCategory'; var categorySelector = '#' + mode + 'BagCategory';
var tagSelector = '#' + mode + 'BagTags'; var tagSelector = '#' + mode + 'BagTags';
@@ -129,8 +129,8 @@ function displayTaggingOptions(mode) {
var categoryNameSelectize = $categoryNameSelect[0].selectize; var categoryNameSelectize = $categoryNameSelect[0].selectize;
categoryNameSelectize.clearOptions() categoryNameSelectize.clearOptions()
getBagCategoryList(function(result){ getBagCategoryList(function(results){
categoryNameSelectize.addOption(['Production', 'Test'].map(function(bagName){ categoryNameSelectize.addOption(results.map(function(bagName){
return {name : bagName} return {name : bagName}
})); }));
}) })
@@ -139,7 +139,7 @@ function displayTaggingOptions(mode) {
valueField: 'name', valueField: 'name',
labelField: 'name', labelField: 'name',
searchField: ['name'], searchField: ['name'],
maxItems: 3, maxItems: 20,
options: [], options: [],
create: true, create: true,
placeholder : "Enter or select tags for the bag" placeholder : "Enter or select tags for the bag"
@@ -148,17 +148,21 @@ function displayTaggingOptions(mode) {
var tagSelectize = $tagSelect[0].selectize; var tagSelectize = $tagSelect[0].selectize;
tagSelectize.clearOptions() tagSelectize.clearOptions()
getBagTagList(function(results){ getBagTagList(function(results){
tagSelectize.addOption(['single-arm', 'dual-arm', 'palpation', 'demo'].map(function(bagName){ tagSelectize.addOption(results.map(function(bagName){
return {name : bagName} return {name : bagName}
})); }));
}) })
} }
function hideTaggingOptions(id, updateValues=false) { function hideTaggingOptions(mode, updateValues=false) {
if(updateValues) { if(updateValues) {
//get values from the elements var modeTag = '#' + mode + 'Tags';
updateBagMetadata(mode, bag_name, modified_bag_name, category, tags) var fileNameSelector = '#' + mode + 'BagFileName';
var categorySelector = '#' + mode + 'BagCategory';
var tagSelector = '#' + mode + 'BagTags';
updateBagMetadata(mode, bag_name, fileNameSelector, categorySelector, tagSelector)
} }
//TO DO: Wait for the response from the backend before setting the display to none //TO DO: Wait for the response from the backend before setting the display to none
document.getElementById(id).setAttribute('overflow', 'hidden'); document.getElementById(id).setAttribute('overflow', 'hidden');