Skip to content

Commit

Permalink
Modernises Javascript 🌟
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobvogel committed Feb 13, 2024
1 parent e31b284 commit 8c14c55
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/resources/templates/index.html.pasta
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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
});
}
Expand Down

0 comments on commit 8c14c55

Please sign in to comment.