Skip to content

Commit

Permalink
Merge pull request gdcc#75 from gdcc/develop
Browse files Browse the repository at this point in the history
Deploying recent updates to github.io
  • Loading branch information
qqmyers authored Jun 27, 2024
2 parents 91e870b + 32864e5 commit e3f50f5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
12 changes: 6 additions & 6 deletions 6.1curlcommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"3D model Previewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/X3DPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/X3DPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand Down Expand Up @@ -1552,7 +1552,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"3D model Previewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/X3DPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/X3DPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand Down Expand Up @@ -1594,7 +1594,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"3D model Previewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/X3DPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/X3DPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand Down Expand Up @@ -1636,7 +1636,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"3D model Previewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/X3DPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/X3DPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand Down Expand Up @@ -1678,7 +1678,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"3D model Previewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/X3DPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/X3DPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand Down Expand Up @@ -1720,7 +1720,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"3D model Previewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/X3DPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/X3DPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand Down
1 change: 0 additions & 1 deletion previewers/betatest/HDF5Preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<title>H5Web</title>

<meta name="description" content="Web-based HDF5 file viewer." />
<script src="https://polyfill.io/v3/polyfill.min.js?features=globalThis"></script>
<script type="module" crossorigin src="./js/hdf5.js"></script>
<link rel="stylesheet" href="./css/hdf5.css">
</head>
Expand Down
20 changes: 16 additions & 4 deletions previewers/betatest/js/retriever.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,8 @@ function addStandardPreviewHeader(file, title, authors) {

// Add logo from source Dataverse or use a local one, unless we are in preview mode
$('#logo')
.attr('src', queryParams.siteUrl + '/logos/preview_logo.png')
.attr(
'onerror',
'this.onerror=null;this.src="images/logo_placeholder.png";');
.attr('src', queryParams.siteUrl + '/logos/preview_logo.svg')
.attr('onerror', "handleImageError(this)");
}
//Footer
var footer = $.i18n("footer");
Expand Down Expand Up @@ -305,3 +303,17 @@ function reportFailure(msg, statusCode) {
+ errorText
+ statusCode);
}

function handleImageError(image) {
let currentFallback = parseInt(image.getAttribute('data-fallback-index') || '0');

if(currentFallback == 0){
image.src = queryParams.siteUrl + '/logos/preview_logo.png';
image.dataset.fallbackIndex = 1;
}
else{
image.src = 'images/logo_placeholder.png';
image.onerror = null;
}

}
18 changes: 11 additions & 7 deletions previewers/react-source/hdf5-previewer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion previewers/v1.4/HDF5Preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<title>H5Web</title>

<meta name="description" content="Web-based HDF5 file viewer." />
<script src="https://polyfill.io/v3/polyfill.min.js?features=globalThis"></script>
<script type="module" crossorigin src="./js/hdf5.js"></script>
<link rel="stylesheet" href="./css/hdf5.css">
</head>
Expand Down

0 comments on commit e3f50f5

Please sign in to comment.