diff --git a/6.1curlcommands.md b/6.1curlcommands.md index 11eb4d2..80d0a69 100644 --- a/6.1curlcommands.md +++ b/6.1curlcommands.md @@ -255,6 +255,47 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin ] }' ``` +```bash +curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \ +'{ + "displayName":"Play Audio", + "description":"Listen to an audio file.", + "toolName":"audioPreviewer", + "scope":"file", + "types":["preview"], + "toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/AudioPreview.html", + "toolParameters": { + "queryParameters":[ + {"fileid":"{fileId}"}, + {"siteUrl":"{siteUrl}"}, + {"datasetid":"{datasetId}"}, + {"datasetversion":"{datasetVersion}"}, + {"locale":"{localeCode}"} + ] + }, + "contentType":"audio/mp4", + "allowedApiCalls": [ + { + "name": "retrieveFileContents", + "httpMethod": "GET", + "urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true", + "timeOut": 3600 + }, + { + "name": "downloadFile", + "httpMethod": "GET", + "urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false", + "timeOut": 3600 + }, + { + "name": "getDatasetVersionMetadata", + "httpMethod": "GET", + "urlTemplate": "/api/v1/datasets/{datasetId}/versions/{datasetVersion}", + "timeOut": 3600 + } + ] +}' +``` ```bash curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \ diff --git a/localinstall.sh b/localinstall.sh old mode 100644 new mode 100755 index d6f3456..8876160 --- a/localinstall.sh +++ b/localinstall.sh @@ -25,11 +25,20 @@ source replace_js.sh cat urls_js.txt echo Downloading local copies of remote CSS files: -sed -n 's/.* replace_css.sh +sed -n 's/.* replace_css.sh sed -n 's/.* urls_css.txt source replace_css.sh cat urls_css.txt + +echo Downloading local copies of remote fonts: +fonturl=`grep -m 1 https://stackpath.bootstrapcdn.com/ replace_css.sh | cut -d',' -f 2 | sed s,css/bootstrap.min.css,fonts,` +echo $fonturl/glyphicons-halflings-regular.eot > urls_fonts.txt +echo $fonturl/glyphicons-halflings-regular.svg >> urls_fonts.txt +echo $fonturl/glyphicons-halflings-regular.ttf >> urls_fonts.txt +echo $fonturl/glyphicons-halflings-regular.woff >> urls_fonts.txt +echo $fonturl/glyphicons-halflings-regular.woff2 >> urls_fonts.txt + if [ ! -d ./lib ]; then mkdir ./lib fi @@ -38,6 +47,14 @@ while read url; do wget --quiet $url done < "../urls_js.txt" +cd ".." +if [ ! -d ./fonts ]; then + mkdir ./fonts +fi +cd ./fonts +while read url; do + wget --quiet $url +done < "../urls_fonts.txt" cd ".." if [ ! -d ./css ]; then @@ -63,8 +80,9 @@ fi echo Cleaning Up... rm urls_js.txt rm urls_css.txt +rm urls_fonts.txt rm replace_js.sh rm replace_css.sh echo Done -exit 0 \ No newline at end of file +exit 0 diff --git a/previewers/betatest/css/preview.css b/previewers/betatest/css/preview.css index 9c2ec37..943e84f 100644 --- a/previewers/betatest/css/preview.css +++ b/previewers/betatest/css/preview.css @@ -122,6 +122,7 @@ This has been done for the Rich Html Previewer, which also has the reverse issue min-width: 600px; display: table; max-width: 100%; + max-height: 100%; } #logo { @@ -204,4 +205,4 @@ This has been done for the Rich Html Previewer, which also has the reverse issue max-height: 500px; word-break: break-all; overflow-y: auto; -} \ No newline at end of file +} diff --git a/previewers/betatest/js/spreadsheet.js b/previewers/betatest/js/spreadsheet.js index 200daa5..6b6afe7 100644 --- a/previewers/betatest/js/spreadsheet.js +++ b/previewers/betatest/js/spreadsheet.js @@ -23,7 +23,9 @@ function writeContent(fileUrl, file, title, authors) { var csv = e.target.result; var data = Papa.parse(csv, { header: true, - skipEmptyLines: true + skipEmptyLines: true, + quoteChar:'"', + delimitersToGuess:['\t',','] }) handsontableContainer.innerHTML = ''; @@ -42,4 +44,4 @@ function writeContent(fileUrl, file, title, authors) { request.send(); } - \ No newline at end of file + diff --git a/previewers/betatest/js/video.js b/previewers/betatest/js/video.js index a8167ef..5291308 100644 --- a/previewers/betatest/js/video.js +++ b/previewers/betatest/js/video.js @@ -9,5 +9,119 @@ function translateBaseHtmlPage() { function writeContent(fileUrl, file, title, authors) { addStandardPreviewHeader(file, title, authors); - $(".preview").append($("