Skip to content

Commit

Permalink
Fixed issues after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
luddaniel committed Aug 9, 2023
1 parent 035da63 commit ca1cee6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/dvwebloader.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<main>
<div>
<img id='logo' alt='Site Logo'>
<h1>Folder Upload</h1>
<h1><span id="title-text">Folder Upload</span></h1>
<div id='help'>
<a href='https://github.com/gdcc/dvwebloader/wiki' target='_blank'><span id="help-tutorial-text">Help/Tutorial</span></a>
</div>
Expand Down
9 changes: 6 additions & 3 deletions src/js/fileupload2.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import getLocalizedString from './lang.js';

var fileList = [];
var rawFileMap = {};
var toRegisterFileList = [];
Expand Down Expand Up @@ -174,6 +176,7 @@ function addIconAndLogo(siteUrl) {

}
function initTranslation() {
initSpanTxt('title-text', 'title');
initSpanTxt('select-dir-text', 'selectDir');
initSpanTxt('help-tutorial-text', 'helpTutorial');
initSpanTxt('sponsor-text', 'sponsor');
Expand Down Expand Up @@ -289,7 +292,7 @@ function setupDirectUpload(enabled) {
var config = { childList: true };
var callback = function(mutations) {
mutations.forEach(function(mutation) {
for (i = 0; i < mutation.addedNodes.length; i++) {
for (let i = 0; i < mutation.addedNodes.length; i++) {
//Add a listener on any replacement file 'select' widget
if (mutation.addedNodes[i].id === 'datasetForm:fileUpload_input') {
fileInput = mutation.addedNodes[i];
Expand Down Expand Up @@ -851,7 +854,7 @@ async function directUploadFinished() {
processData: false,
success: function(body, statusText, jqXHR) {
console.log("All files sent to " + siteUrl + '/dataset.xhtml?persistentId=doi:' + datasetPid + '&version=DRAFT');
addMessage('success', 'Upload complete, all files in dataset. Close this window and refresh your dataset page to see the uploaded files.');
addMessage('success', 'msgUploadComplete');
},
error: function(jqXHR, textStatus, errorThrown) {
console.log('Failure: ' + jqXHR.status);
Expand All @@ -868,7 +871,7 @@ async function directUploadFinished() {
} else {
if ((inProgress < 4) && (inProgress < inList)) {
filesInProgress = filesInProgress + 1;
for (i = 0; i < fileList.length; i++) {
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].state === UploadState.QUEUED) {
fileList[i].startRequestForDirectUploadUrl();
break;
Expand Down
2 changes: 2 additions & 0 deletions src/js/lang.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const defaultLocale = 'en';
const translations = {
en: {
title: "Folder Upload",
selectDir: "Select a Directory",
helpTutorial: "Help/Tutorial",
sponsor: ", development sponsored by UiT/DataverseNO",
Expand All @@ -16,6 +17,7 @@ const translations = {
msgUploadComplete: "Upload complete, all files in dataset. Close this window and refresh your dataset page to see the uploaded files.",
},
fr: {
title: "Envoi d'un dossier",
selectDir: "Sélectionner un répertoire",
helpTutorial: "Aide/Tutoriel",
sponsor: ", développement sponsorisé par UiT/DataverseNO",
Expand Down

0 comments on commit ca1cee6

Please sign in to comment.