setHTML -> innerHTML

This commit is contained in:
Fortune Ngwenya 2023-09-29 21:53:37 +02:00 committed by Lena Fuhrimann
parent 583849062c
commit a149099ba3

View file

@ -265,7 +265,7 @@ function uploadFile(file, url) {
function createNotification(fileName) { function createNotification(fileName) {
notificationTemplate = document.getElementById('notification-template'); notificationTemplate = document.getElementById('notification-template');
notification = notificationTemplate.cloneNode(true); notification = notificationTemplate.cloneNode(true);
notification.getElementsByTagName('p')[0].setHTML(fileName); notification.getElementsByTagName('p')[0].innerHTML = fileName;
notification.removeAttribute("id"); notification.removeAttribute("id");
notification.removeAttribute("style"); notification.removeAttribute("style");
return notification; return notification;
@ -277,7 +277,7 @@ function handleOpenDownloadLinkModal(objectName) {
const createLinkModalElement = document.getElementById('modal-create-download-link') const createLinkModalElement = document.getElementById('modal-create-download-link')
document.getElementById('generated-link').setAttribute('value', ""); document.getElementById('generated-link').setAttribute('value', "");
document.getElementById('gen-url-error').setHTML(""); document.getElementById('gen-url-error').innerHTML = "";
const modalInstance = M.Modal.init(createLinkModalElement); const modalInstance = M.Modal.init(createLinkModalElement);
modalInstance.open() modalInstance.open()
} }
@ -293,7 +293,7 @@ function handleGenerateDownloadLink(event) {
const expiryTime = formData.get('day') * 24 * 60 * 60 + formData.get('hour') * 60 * 60 + formData.get('minute') * 60; const expiryTime = formData.get('day') * 24 * 60 * 60 + formData.get('hour') * 60 * 60 + formData.get('minute') * 60;
if(expiryTime > 7 * 24 * 60 * 60) { if(expiryTime > 7 * 24 * 60 * 60) {
genUrlMessage.setHTML("Expiry time must be less than 7 days"); genUrlMessage.innerHTML = "Expiry time must be less than 7 days";
return; return;
} }
@ -301,11 +301,11 @@ function handleGenerateDownloadLink(event) {
type: 'GET', type: 'GET',
url: '/api/buckets/' + {{ $.BucketName }}+ "/objects/" + objectName + "/url?expiry=" + expiryTime, url: '/api/buckets/' + {{ $.BucketName }}+ "/objects/" + objectName + "/url?expiry=" + expiryTime,
success: function (result) { success: function (result) {
genUrlMessage.setHTML("") genUrlMessage.innerHTML = "";
document.getElementById("generated-link").setAttribute('value', JSON.parse(result).url); document.getElementById("generated-link").setAttribute('value', JSON.parse(result).url);
}, },
error: function(request, status, error) { error: function(request, status, error) {
genUrlMessage.setHTML("Error when generating url") genUrlMessage.innerHTML = "Error when generating url";
} }
}); });
} }