fixed: share target

This commit is contained in:
quenousimporte 2024-01-24 11:07:39 +01:00
parent 27d0d845fd
commit d7cff56116
2 changed files with 4 additions and 5 deletions

View File

@ -1206,7 +1206,7 @@ function loadstorage()
localdata = item ? JSON.parse(item) : []; localdata = item ? JSON.parse(item) : [];
var params = new URLSearchParams(window.location.search); var params = new URLSearchParams(window.location.search);
var title = params.get("n"); var title = params.get("n") || params.get("name");
var line = params.get("l"); var line = params.get("l");
var tags = params.get("t"); var tags = params.get("t");
var clip = params.get("c"); var clip = params.get("c");
@ -1220,8 +1220,7 @@ function loadstorage()
msg.innerText = "Clipping..."; msg.innerText = "Clipping...";
notepage.appendChild(msg); notepage.appendChild(msg);
inserttodo("@clip " + clip) inserttodo("@clip " + clip).then(window.close);
.then(window.close);
} }
if (currentnote) if (currentnote)
@ -1233,7 +1232,7 @@ function loadstorage()
currentnote = getnote(title); currentnote = getnote(title);
if (!currentnote) if (!currentnote)
{ {
var newcontent = defaultheaders(tags); var newcontent = params.get("description") || defaultheaders(tags);
currentnote = {title: title, content: newcontent, pos: newcontent.length}; currentnote = {title: title, content: newcontent, pos: newcontent.length};
localdata.unshift(currentnote); localdata.unshift(currentnote);
} }

View File

@ -1,7 +1,7 @@
{ {
"share_target": "share_target":
{ {
"action": "/index.html", "action": "/",
"params": "params":
{ {
"title": "name", "title": "name",