add download extension in settings
This commit is contained in:
parent
893b23a985
commit
83a662a09e
9
main.js
9
main.js
|
@ -14,7 +14,8 @@ var defaultsettings =
|
||||||
password: "",
|
password: "",
|
||||||
sync: false,
|
sync: false,
|
||||||
tagsinlists: true,
|
tagsinlists: true,
|
||||||
uselinkpopup: true
|
uselinkpopup: true,
|
||||||
|
downloadextension: ".md"
|
||||||
};
|
};
|
||||||
|
|
||||||
//builtin
|
//builtin
|
||||||
|
@ -974,7 +975,7 @@ function sharehtml()
|
||||||
|
|
||||||
function getfilename(title)
|
function getfilename(title)
|
||||||
{
|
{
|
||||||
return title.replace(/[\?\"<>|\*:\/\\]/g, "_");
|
return title.replace(/[\?\"<>|\*:\/\\]/g, "_") + settings.downloadextension;
|
||||||
}
|
}
|
||||||
|
|
||||||
function download(filename, content)
|
function download(filename, content)
|
||||||
|
@ -1093,13 +1094,13 @@ function downloadnotewithsubs()
|
||||||
var note = withsubs();
|
var note = withsubs();
|
||||||
if (note)
|
if (note)
|
||||||
{
|
{
|
||||||
download(note.title + ".md", note.content);
|
download(getfilename(note.title), note.content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadnote()
|
function downloadnote()
|
||||||
{
|
{
|
||||||
download(title.value + ".md", md.value);
|
download(getfilename(title.value), md.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getguid(title)
|
function getguid(title)
|
||||||
|
|
Loading…
Reference in New Issue