diff --git a/resources/assets/src/js/admin/customize.js b/resources/assets/src/js/admin/customize.js index 6dda2a93..f9fc5e90 100644 --- a/resources/assets/src/js/admin/customize.js +++ b/resources/assets/src/js/admin/customize.js @@ -17,7 +17,7 @@ function submitColor() { data: { color_scheme: current_skin } }).then(({ errno, msg }) => { (errno == 0) ? toastr.success(msg) : toastr.warning(msg); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } $('#color-submit').click(submitColor); diff --git a/resources/assets/src/js/admin/players.js b/resources/assets/src/js/admin/players.js index 11b3613a..0103a5cc 100644 --- a/resources/assets/src/js/admin/players.js +++ b/resources/assets/src/js/admin/players.js @@ -11,7 +11,7 @@ function changePreference() { } }).then(({ errno, msg }) => { (errno == 0) ? toastr.success(msg) : toastr.warning(msg); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changeTexture(pid, playerName) { @@ -58,7 +58,7 @@ function ajaxChangeTexture(pid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changePlayerName(pid, oldName) { @@ -85,7 +85,7 @@ function changePlayerName(pid, oldName) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changeOwner(pid) { @@ -113,7 +113,7 @@ function changeOwner(pid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); $('.swal2-input').on('input', debounce(() => { let uid = $('.swal2-input').val(); @@ -158,7 +158,7 @@ function deletePlayer(pid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } if (typeof require !== 'undefined' && typeof module !== 'undefined') { diff --git a/resources/assets/src/js/admin/plugins.js b/resources/assets/src/js/admin/plugins.js index 87d091cc..216cba85 100644 --- a/resources/assets/src/js/admin/plugins.js +++ b/resources/assets/src/js/admin/plugins.js @@ -13,7 +13,7 @@ function enablePlugin(name) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function disablePlugin(name) { @@ -29,7 +29,7 @@ function disablePlugin(name) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function deletePlugin(name) { @@ -49,7 +49,7 @@ function deletePlugin(name) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } if (typeof require !== 'undefined' && typeof module !== 'undefined') { diff --git a/resources/assets/src/js/admin/update.js b/resources/assets/src/js/admin/update.js index 22f22f86..e7c088ab 100644 --- a/resources/assets/src/js/admin/update.js +++ b/resources/assets/src/js/admin/update.js @@ -39,7 +39,7 @@ function downloadUpdates() { console.log('Downloading finished'); console.log(json); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); // Downloading progress polling let interval_id = window.setInterval(() => { @@ -70,7 +70,7 @@ function downloadUpdates() { }, function() { window.location = url('/'); }); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } else { fetch({ @@ -80,11 +80,11 @@ function downloadUpdates() { progress = (json.size / fileSize * 100).toFixed(2); console.log('Progress: ' + progress); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } }, 300); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } diff --git a/resources/assets/src/js/admin/users.js b/resources/assets/src/js/admin/users.js index 456ff5f2..228c048b 100644 --- a/resources/assets/src/js/admin/users.js +++ b/resources/assets/src/js/admin/users.js @@ -25,7 +25,7 @@ function changeUserEmail(uid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changeUserNickName(uid) { @@ -53,7 +53,7 @@ function changeUserNickName(uid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changeUserPwd(uid) { @@ -68,7 +68,7 @@ function changeUserPwd(uid) { data: { uid: uid, password: password } })).then(({ errno, msg }) => { (errno == 0) ? toastr.success(msg) : toastr.warning(msg); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changeUserScore(uid, score) { @@ -80,7 +80,7 @@ function changeUserScore(uid, score) { data: { uid: uid.slice(5), score: score } }).then(({ errno, msg }) => { (errno == 0) ? toastr.success(msg) : toastr.warning(msg); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changeBanStatus(uid) { @@ -107,7 +107,7 @@ function changeBanStatus(uid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changeAdminStatus(uid) { @@ -134,7 +134,7 @@ function changeAdminStatus(uid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function deleteUserAccount(uid) { @@ -154,7 +154,7 @@ function deleteUserAccount(uid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } $('body').on('keypress', '.score', function(event){ diff --git a/resources/assets/src/js/common/texture-preview.js b/resources/assets/src/js/common/texture-preview.js index e4f4ea7c..007b7f90 100644 --- a/resources/assets/src/js/common/texture-preview.js +++ b/resources/assets/src/js/common/texture-preview.js @@ -33,7 +33,7 @@ class TexturePreview { } else { MSP.changeSkin(textureUrl); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } return this; diff --git a/resources/assets/src/js/skinlib/operations.js b/resources/assets/src/js/skinlib/operations.js index f245da0b..4032aa3f 100644 --- a/resources/assets/src/js/skinlib/operations.js +++ b/resources/assets/src/js/skinlib/operations.js @@ -47,7 +47,7 @@ function ajaxAddToCloset(tid, name) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function removeFromCloset(tid) { @@ -70,7 +70,7 @@ function removeFromCloset(tid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changeTextureName(tid, oldName) { @@ -96,7 +96,7 @@ function changeTextureName(tid, oldName) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } /** @@ -151,7 +151,7 @@ function changePrivacy(tid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function deleteTexture(tid) { @@ -172,7 +172,7 @@ function deleteTexture(tid) { } else { swal({ type: 'warning', html: msg }); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } if (typeof require !== 'undefined' && typeof module !== 'undefined') { diff --git a/resources/assets/src/js/user/closet.js b/resources/assets/src/js/user/closet.js index 56fd5685..5a144e9a 100644 --- a/resources/assets/src/js/user/closet.js +++ b/resources/assets/src/js/user/closet.js @@ -26,7 +26,7 @@ $(document).ready(function () { page, $('input[name=q]').val() ) })); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); $('input[name=q]').on('input', debounce(() => { let category = $('#skin-category').hasClass('active') ? 'skin' : 'cape'; @@ -67,7 +67,7 @@ $('body').on('click', '.item-body', function () { } else if (cape != undefined) { $indicator.text(trans('general.cape')); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); }); $('body').on('click', '.category-switch', () => { @@ -158,7 +158,7 @@ function reloadCloset(category, page, search) { currentPage: page, totalPages: total_pages }); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function renameClosetItem(tid, oldName) { @@ -184,7 +184,7 @@ function renameClosetItem(tid, oldName) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function removeFromCloset(tid) { @@ -214,7 +214,7 @@ function removeFromCloset(tid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function setAsAvatar(tid) { @@ -239,7 +239,7 @@ function setAsAvatar(tid) { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } if (typeof require !== 'undefined' && typeof module !== 'undefined') { diff --git a/resources/assets/src/js/user/player.js b/resources/assets/src/js/user/player.js index 6158972a..332dd4b5 100644 --- a/resources/assets/src/js/user/player.js +++ b/resources/assets/src/js/user/player.js @@ -17,7 +17,7 @@ $('body').on('click', '.player', function () { data: { pid: $(this).attr('pid'), preference: $(this).val() } }).then(({ errno, msg }) => { (errno == 0) ? toastr.success(msg) : toastr.warning(msg); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); }); function showPlayerTexturePreview(pid) { @@ -48,7 +48,7 @@ function showPlayerTexturePreview(pid) { console.log(`Texture previews of player ${result.player_name} rendered.`); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changePlayerName(pid) { @@ -77,7 +77,7 @@ function changePlayerName(pid) { } else { swal({ type: 'error', html: msg }); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function clearTexture(pid) { @@ -122,7 +122,7 @@ function ajaxClearTexture(pid) { }).then(({ errno, msg }) => { swal({ type: errno == 0 ? 'success' : 'error', html: msg }); $('.modal').modal('hide'); - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function deletePlayer(pid) { @@ -147,7 +147,7 @@ function deletePlayer(pid) { } else { swal({ type: 'error', html: msg }); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function addNewPlayer() { @@ -167,7 +167,7 @@ function addNewPlayer() { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function setTexture() { @@ -200,7 +200,7 @@ function setTexture() { } else { toastr.warning(msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } } diff --git a/resources/assets/src/js/user/profile.js b/resources/assets/src/js/user/profile.js index 1071b71d..94c6f7a1 100644 --- a/resources/assets/src/js/user/profile.js +++ b/resources/assets/src/js/user/profile.js @@ -27,7 +27,7 @@ function changeNickName() { } else { return swal({ type: 'warning', html: msg }); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function changePassword() { @@ -67,11 +67,11 @@ function changePassword() { if (errno == 0) { window.location = url('auth/login'); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } else { return swal({ type: 'warning', text: msg }); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } } @@ -117,11 +117,11 @@ function changeEmail() { if (errno == 0) { window.location = url('auth/login'); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } else { return swal({ type: 'warning', text: msg }); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } function deleteAccount() { @@ -147,7 +147,7 @@ function deleteAccount() { } else { return swal({ type: 'warning', html: msg }); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } if (typeof require !== 'undefined' && typeof module !== 'undefined') { diff --git a/resources/assets/src/js/user/sign.js b/resources/assets/src/js/user/sign.js index 4235352a..2e59b42e 100644 --- a/resources/assets/src/js/user/sign.js +++ b/resources/assets/src/js/user/sign.js @@ -24,7 +24,7 @@ function sign() { } else { toastr.warning(result.msg); } - }).catch(err => showAjaxError(err)); + }).catch(showAjaxError); } if (typeof require !== 'undefined' && typeof module !== 'undefined') {