Minor style changes
Metadata loading animation
@@ -6,10 +6,32 @@ var sourcePaths = [];
var pathLog = [];
var pathLogIndex = 0;
var isDragging = false;
-var file_metadata_alert = '<div id="#fb-metadata-default" class="text-center text-muted" role="alert">' +
- '<div>Select a file to see file type metadata.</div>' +
- '<hr><span class="fa-stack fa-lg text-center"><i class="fa fa-file-o fa-stack-2x" aria-hidden="true"></i>' +
- '<i class="fa fa-mouse-pointer fa-stack-1x" aria-hidden="true"style="top: 14px;"></i></span></div>';
+var file_metadata_alert = `
+ <div id="#fb-metadata-default" class="alert alert-info text-center" role="alert">
+ <div>Select a file to see file type metadata.</div>
+ <hr>
+ <span class="fa-stack fa-lg text-center"><i class="fa fa-file-o fa-stack-2x" aria-hidden="true"></i>
+ <i class="fa fa-mouse-pointer fa-stack-1x" aria-hidden="true"style="top: 14px;"></i>
+ </span>
+ </div>
+`;
+
+var no_metadata_alert = `
+ <div class="alert alert-warning text-center" role="alert">
+ <div>No file type metadata exists for this file.</div>
+ <hr>
+ <i class="fa fa-eye-slash fa-3x" aria-hidden="true"></i>
+ </div>
+`;
+
+var loading_metadata_alert = `
+ <div class="text-center" role="alert">
+ <br>
+ <i class="fa fa-spinner fa-spin fa-3x fa-fw icon-blue"></i>
+ <span class="sr-only">Loading...</span>
+ </div>
+`;
+
const MAX_FILE_SIZE = 1024; // MB
@@ -485,6 +507,7 @@ function bindFileBrowserItemEvents() {
onOpenFolder();
});
$("#hs-file-browser li.fb-folder, #hs-file-browser li.fb-file").click(function () {
+ $("#fileTypeMetaData").html(loading_metadata_alert);
timer = setTimeout(function () {
if (!prevent) {
showFileTypeMetadata(false, "");
@@ -562,11 +585,11 @@ function showFileTypeMetadata(file_type_time_series, url){
// when viewing timeseries file metadata by series id, *file_type_time_series* parameter must be
// set to true and the *url* must be set
// remove anything displayed currently for the aggregation metadata
- $("#fileTypeMetaData").html(file_metadata_alert);
var selectedItem = $("#fb-files-container li.ui-selected");
var logical_file_id = selectedItem.attr("data-logical-file-id");
if (!logical_file_id || (logical_file_id && logical_file_id.length == 0)) {
+ $("#fileTypeMetaData").html(no_metadata_alert);
return;
}
