mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
🐛 Fix preview and insertion of images with non-lowercase extension
This commit is contained in:
@@ -149,7 +149,7 @@
|
|||||||
filename = filename.replace(/@3x|@2x|@1x/, '');
|
filename = filename.replace(/@3x|@2x|@1x/, '');
|
||||||
filename = filename.replace(/\(/g, '%28');
|
filename = filename.replace(/\(/g, '%28');
|
||||||
filename = filename.replace(/\)/g, '%29');
|
filename = filename.replace(/\)/g, '%29');
|
||||||
if (filename.match(/\.(jpg|jpeg|png|gif)$/)) {
|
if (filename.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)) {
|
||||||
editor.doc.replaceSelection('');
|
editor.doc.replaceSelection('');
|
||||||
} else {
|
} else {
|
||||||
editor.doc.replaceSelection('[' + decodeURI(filename) + '](' + filename + ')');
|
editor.doc.replaceSelection('[' + decodeURI(filename) + '](' + filename + ')');
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
thisDropzone.files.push(mockFile);
|
thisDropzone.files.push(mockFile);
|
||||||
thisDropzone.options.addedfile.call(thisDropzone, mockFile);
|
thisDropzone.options.addedfile.call(thisDropzone, mockFile);
|
||||||
|
|
||||||
if (filename.match(/\.(jpg|jpeg|png|gif)$/)) {
|
if (filename.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)) {
|
||||||
thisDropzone.options.thumbnail.call(thisDropzone, mockFile, data.url);
|
thisDropzone.options.thumbnail.call(thisDropzone, mockFile, data.url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user