mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-10 09:24:49 +00:00
misc
This commit is contained in:
parent
9446f47d44
commit
cc68e99a94
1 changed files with 15 additions and 7 deletions
|
@ -38,14 +38,22 @@ function getOriginUrl() {
|
|||
}
|
||||
|
||||
function getFileExtension(fileName) {
|
||||
var tmpFileName = fileName.split('.').pop();
|
||||
if (tmpFileName.indexOf('?') > 0) {
|
||||
tmpFileName = tmpFileName.split('?')[0];
|
||||
try {
|
||||
var tmpFileName = fileName.split('.').pop();
|
||||
if (tmpFileName.indexOf('?') > 0) {
|
||||
tmpFileName = tmpFileName.split('?')[0];
|
||||
}
|
||||
tmpFileName = tmpFileName.toLowerCase();
|
||||
if (tmpFileName === 'jpg') {
|
||||
tmpFileName = 'jpeg';
|
||||
} else if (tmpFileName.trim() === '') {
|
||||
return 'jpeg'; //TODO
|
||||
}
|
||||
return tmpFileName;
|
||||
} catch (e) {
|
||||
console.log('Error:', e);
|
||||
return 'jpeg'; //TODO
|
||||
}
|
||||
if (tmpFileName.trim() === '') {
|
||||
return 'jpg'; //TODO
|
||||
}
|
||||
return tmpFileName;
|
||||
}
|
||||
|
||||
function getHref(hrefTxt) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue