mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-15 19:59:43 +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) {
|
function getFileExtension(fileName) {
|
||||||
|
try {
|
||||||
var tmpFileName = fileName.split('.').pop();
|
var tmpFileName = fileName.split('.').pop();
|
||||||
if (tmpFileName.indexOf('?') > 0) {
|
if (tmpFileName.indexOf('?') > 0) {
|
||||||
tmpFileName = tmpFileName.split('?')[0];
|
tmpFileName = tmpFileName.split('?')[0];
|
||||||
}
|
}
|
||||||
if (tmpFileName.trim() === '') {
|
tmpFileName = tmpFileName.toLowerCase();
|
||||||
return 'jpg'; //TODO
|
if (tmpFileName === 'jpg') {
|
||||||
|
tmpFileName = 'jpeg';
|
||||||
|
} else if (tmpFileName.trim() === '') {
|
||||||
|
return 'jpeg'; //TODO
|
||||||
}
|
}
|
||||||
return tmpFileName;
|
return tmpFileName;
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Error:', e);
|
||||||
|
return 'jpeg'; //TODO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHref(hrefTxt) {
|
function getHref(hrefTxt) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue