trimed trailing whitespaces

This commit is contained in:
quenousimporte 2023-09-11 09:57:00 +02:00
parent f716fb83f1
commit 36458ad166
10 changed files with 44 additions and 44 deletions

View File

@ -148,7 +148,7 @@ axios.post(`${settings.url}/handler.php`,
}
notes.unshift(currentnote);
console.log(`Creating new note: ${title}`);
editnote();
editnote();
}
break;
@ -158,7 +158,7 @@ axios.post(`${settings.url}/handler.php`,
console.log(`[${i}] ${notes[i].title}`);
}
break;
default:
var arg = command;
if (arg === "open" || arg === "edit")
@ -181,7 +181,7 @@ axios.post(`${settings.url}/handler.php`,
else
{
console.log(`Note ${arg} not found`);
}
}
break;
}
});

View File

@ -1 +1 @@
@node app %1 %2
@node app %1 %2

View File

@ -13,7 +13,7 @@ function editnote()
file.close();
os.exec(["cp", "data/note.md", "data/backup.md"]);
os.exec(settings.editor.concat("data/note.md"));
var newcontent = std.loadFile("data/note.md");
@ -38,7 +38,7 @@ function editnote()
file.puts(postdata);
file.close();
os.exec(["curl", "-X", "POST",
os.exec(["curl", "-X", "POST",
"-d", "@data/postdata",
settings.url + "/handler.php"]);
@ -92,7 +92,7 @@ else
}
notes.unshift(currentnote);
console.log(`Creating new note: ${title}`);
editnote();
editnote();
}
break;
@ -102,7 +102,7 @@ else
console.log(`[${i}] ${notes[i].title}`);
}
break;
default:
var arg = command;
if (arg === "open" || arg === "edit")
@ -125,7 +125,7 @@ else
else
{
console.log(`Note ${arg} not found`);
}
}
break;
}
}

View File

@ -37,7 +37,7 @@ else if (isset($_POST['action']))
else
{
echo '{}';
}
}
break;
case 'cal':

View File

@ -22,7 +22,7 @@
<script src="libs/jszip.min.js"></script>
<script src="libs/FileSaver.js"></script>
<script src="main.js"></script>
<div id="networkpage" hidden>
<div id="network"></div>
</div>

56
main.js
View File

@ -150,7 +150,7 @@ var themes =
fontsize: "16px",
fontcolor: "rgb(78,78,78)",
lineheight: "24px",
accentcolor: "rgb(54,54,54)"
accentcolor: "rgb(54,54,54)"
}
};
@ -429,7 +429,7 @@ function createsubnote(suggestedtitle)
var content = getrangecontent(range);
filter.placeholder = "Create subnote...";
searchinlist(name)
.then(title =>
.then(title =>
{
if (!title)
{
@ -443,7 +443,7 @@ function createsubnote(suggestedtitle)
}
else
{
var newnote =
var newnote =
{
title: title,
content: content
@ -475,7 +475,7 @@ function includesub()
if (confirm("Replace [[" + title + "]] by its content?"))
{
var subnote = getnote(title);
md.value =
md.value =
md.value.substring(0, range.start)
+ subnote.content
+ md.value.substring(range.end);
@ -520,7 +520,7 @@ function showinfo()
var tags = gettags(currentnote);
showtemporaryinfo(
[
"vault: " + currentvault,
"vault: " + currentvault,
"saved: " + saved,
"title: " + currentnote.title,
"cursor position: " + md.selectionStart + " (" + pospercent() + "%)",
@ -597,14 +597,14 @@ function switchvault()
if (confirm("Switch to " + newvault + "?"))
{
applyvault(newvault);
}
}
}
function ancestors(note)
{
var list = [note];
var result = [];
while (list.length)
{
var current = list.shift();
@ -621,7 +621,7 @@ function descendants(note)
{
var list = [note];
var result = [];
while (list.length)
{
var current = list.shift();
@ -652,7 +652,7 @@ function connected(note)
{
var list = [note];
var result = [];
while (list.length)
{
var current = list.shift();
@ -680,7 +680,7 @@ function shownotelinks()
var edges = [];
var list = [currentnote];
while (list.length)
{
var current = list.shift();
@ -704,7 +704,7 @@ function shownotelinks()
from: id(current),
to: id(buddy)
});
}
}
});
}
}
@ -714,7 +714,7 @@ function shownotelinks()
edges: edges
};
var options =
var options =
{
nodes:
{
@ -731,7 +731,7 @@ function shownotelinks()
}
}
};
var graph = new vis.Network(network, data, options);
graph.on("click", function(event)
{
@ -765,7 +765,7 @@ function showoutline()
else if (line == "---" && index != 0 && index != 3)
{
var next;
if (next = lines.find((current, i) =>
if (next = lines.find((current, i) =>
{
return i > index && current != "";
}))
@ -796,14 +796,14 @@ function linkrangeatpos()
{
var start = md.value.lastIndexOf("[[", md.selectionStart);
if (start == -1 || md.value.substring(start, md.selectionStart).indexOf("\n") != -1) return null
var end = md.value.indexOf("]]", md.selectionStart);
if (end == -1 || md.value.substring(md.selectionStart, end).indexOf("\n") != -1) return null;
return {
start: start,
end: end + 2
};
};
}
function linkatpos()
@ -825,7 +825,7 @@ function tagatpos()
var start = md.value.lastIndexOf(" ", md.selectionStart);
if (start == -1 || md.value.substring(start, md.selectionStart).indexOf("\n") != -1) return "";
var eol = md.value.indexOf("\n", md.selectionStart);
var end = md.value.indexOf(",", md.selectionStart);
@ -833,7 +833,7 @@ function tagatpos()
{
end = eol;
}
return md.value.substring(start + 1, end);
}
@ -1069,8 +1069,8 @@ function downloadnotewithsubs()
var note = withsubs();
if (note)
{
download(note.title + ".md", note.content);
}
download(note.title + ".md", note.content);
}
}
function downloadnote()
@ -1595,7 +1595,7 @@ function md2html(content)
{
converter.setOption("openLinksInNewWindow", true);
}
var html = converter.makeHtml(content);
// internal links
@ -2094,7 +2094,7 @@ function renamereferences(newname)
.forEach(note =>
{
note.content = note.content.replaceAll("[[" + currentnote.title + "]]", "[[" + newname + "]]");
});
});
}
function rename(newname)
@ -2410,7 +2410,7 @@ function withsubs()
{
try
{
descendants(currentnote);
descendants(currentnote);
}
catch (err)
{
@ -2418,7 +2418,7 @@ function withsubs()
return null;
}
var tempnote =
var tempnote =
{
title: currentnote.title + " (with subnotes)",
content: md.value
@ -2456,8 +2456,8 @@ function togglepreviewwithsubs()
{
resize();
md.focus();
}
}
}
}
}
function bindfile(note)
@ -2475,7 +2475,7 @@ function bindfile(note)
if (changed)
{
md.style.height = "0px";
}
}
resize();
// to improve...
@ -2499,7 +2499,7 @@ function loadnote(name)
if (!preview.hidden || (preview.hidden && gettags(note).indexOf("preview") !== -1))
{
togglepreview();
}
}
}
function sendpassword()

View File

@ -6,7 +6,7 @@ launch index.html from your web server or local computer, or try https://notes.o
your notes are stored in your browser local storage.
## remote mode
## remote mode
you can use remote mode with your own php server to access your notes from the cloud.

View File

@ -13,9 +13,9 @@ iframe {
}
#left {
float: left;
float: left;
}
#right {
float: right;
float: right;
}

View File

@ -13,5 +13,5 @@
<iframe src="index.html" id="right" name="right"></iframe>
</div>
</body>
</html>

View File

@ -50,7 +50,7 @@ body::-webkit-scrollbar-thumb {
color: inherit;
resize: none;
font-family: inherit;
font-size: inherit;
line-height: inherit;