mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
Remove file suffix when uploading
This commit is contained in:
parent
f53bb7acb6
commit
874f4bd681
@ -158,8 +158,9 @@ function handleFiles(files, type) {
|
||||
(type == "skin") ? MSP.changeSkin(img.src) : MSP.changeCape(img.src);
|
||||
let domTextureName = $('#name');
|
||||
if (domTextureName.val() === '' || domTextureName.val() === domTextureName.attr('data-last-file-name')) {
|
||||
domTextureName.attr('data-last-file-name', file.name);
|
||||
domTextureName.val(file.name);
|
||||
const fileName = file.name.replace(/\.[Pp][Nn][Gg]$/, '');
|
||||
domTextureName.attr('data-last-file-name', fileName);
|
||||
domTextureName.val(fileName);
|
||||
}
|
||||
};
|
||||
img.onerror = () => toastr.warning(trans('skinlib.fileExtError'));
|
||||
|
Loading…
Reference in New Issue
Block a user