added: default headers
This commit is contained in:
parent
30f9f786c2
commit
b1c687e9a5
15
main.js
15
main.js
|
@ -1347,7 +1347,7 @@ function getorcreate(title, content, putontop)
|
|||
var note = getnote(title);
|
||||
if (!note)
|
||||
{
|
||||
note = {title: title, content: content};
|
||||
note = {title: title, content: content, pos: content.length};
|
||||
localdata.push(note)
|
||||
}
|
||||
|
||||
|
@ -2487,9 +2487,20 @@ function bindfile(note)
|
|||
setpos(note.pos || 0);
|
||||
}
|
||||
|
||||
function defaultheaders(title)
|
||||
{
|
||||
return [
|
||||
"---",
|
||||
"title: " + title,
|
||||
"date: " + timestamp().substr(0,10),
|
||||
"tags: ",
|
||||
"---",
|
||||
"",""].join("\n");
|
||||
}
|
||||
|
||||
function loadnote(name)
|
||||
{
|
||||
var note = getorcreate(name, "", true);
|
||||
var note = getorcreate(name, defaultheaders(name), true);
|
||||
bindfile(note);
|
||||
|
||||
stat.cur.q = 0;
|
||||
|
|
Loading…
Reference in New Issue