From 8c14c55af559c39393458b9a2bda46da8faa599b Mon Sep 17 00:00:00 2001 From: Jakob Vogel Date: Tue, 13 Feb 2024 21:53:46 +0100 Subject: [PATCH] =?UTF-8?q?Modernises=20Javascript=20=F0=9F=8C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/index.html.pasta | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/templates/index.html.pasta b/src/main/resources/templates/index.html.pasta index e182bd7..0ad285d 100644 --- a/src/main/resources/templates/index.html.pasta +++ b/src/main/resources/templates/index.html.pasta @@ -23,7 +23,7 @@ } function checkBucketName() { - return new Promise(function (resolve, reject) { + return new Promise((resolve, reject) => { // make sure we have the text field const textfield = resolveTextfield(); if (!textfield) { @@ -45,13 +45,13 @@ * Checks the form for errors and styles the input accordingly. */ function checkForm() { - checkBucketName().then(function (name) { + checkBucketName().then(name => { // remove style class `error` const textfield = resolveTextfield(); if (textfield) { textfield.classList.remove('sci-border-red'); } - }).catch(function (name) { + }).catch(name => { // add style class `error` unless empty const textfield = resolveTextfield(); if (textfield) { @@ -67,9 +67,9 @@ * Checks the form for errors and submits the form if everything is fine. */ function submitForm() { - checkBucketName().then(function (name) { + checkBucketName().then(name => { location.href = '/ui/' + encodeURIComponent(name) + '?create' - }).catch(function () { + }).catch(() => { // ignore, error has already been indicated while typing }); }