Cybrkyd's Git Repositories

jottings - commit: 7430188

commit 7430188c818a20a824fcab23e861f31ba07b8193198a50dc4ef27e4bbfa72e54
author Cybrkyd <git@cybrkyd.com> 2026-06-19 21:44:01 +0100
committer Cybrkyd <git@cybrkyd.com> 2026-06-19 21:44:01 +0100

Commit Message

Cleanup

- Removed old ignore rules for nspell
- Begin changing "notes" to "jots" on UI

📊 Diffstat

resources/js/app.js 39
1 files changed, 12 insertions(+), 27 deletions(-)

Diff

diff --git a/resources/js/app.js b/resources/js/app.js
index d15e29b..b01675a 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -14,7 +14,6 @@ let spellReady = false;
let spellDebounce = null;
let menuTargetWord = null;
let menuTargetRange = null;
- let ignoreChars = '';
// DOM references
const editor = document.getElementById('editor');
@@ -108,9 +107,6 @@ async function initSpellcheck() {
const dic = await dicRes.text();
spell = new espells.Espells({ aff, dic });
- const ignoreMatch = aff.match(/^IGNORE\s+(\S+)/m);
- ignoreChars = ignoreMatch ? ignoreMatch[1] : '';
-
await loadPersonalDic();
spellReady = true;
runSpellcheck();
@@ -151,35 +147,24 @@ async function addToPersonalDic(word) {
runSpellcheck();
}
- function stripIgnored(word) {
- if (!ignoreChars) return word;
- let out = '';
- for (const ch of word) {
- if (ignoreChars.indexOf(ch) === -1) out += ch;
- }
- return out;
- }
-
function isIgnorableNumericPossessive(word) {
const m = word.match(/^(.*)['\u2019]s$/i);
if (!m) return false;
const base = m[1];
- return base.length > 0 && stripIgnored(base) === '';
+ return base.length > 0 && /^[0-9]+$/.test(base);
}
function isCorrect(word) {
- const stripped = stripIgnored(word);
- if (stripped === '') return true;
+ if (word === '') return true;
if (isIgnorableNumericPossessive(word)) return true;
- const result = spell.lookup(stripped);
+ const result = spell.lookup(word);
return result.correct && !result.forbidden;
}
function getSuggestions(word) {
if (isIgnorableNumericPossessive(word)) return [];
- const stripped = stripIgnored(word);
- if (stripped === '') return [];
- return spell.suggest(stripped);
+ if (word === '') return [];
+ return spell.suggest(word);
}
function getCheckableSpan(rawToken) {
@@ -627,7 +612,7 @@ async function loadDocuments() {
try {
notes = await readNotes();
} catch (e) {
- console.error("Could not load notes:", e);
+ console.error("Could not load jots:", e);
return;
}
@@ -683,7 +668,7 @@ async function loadDocuments() {
updateStatus();
}
} catch (e) {
- alert("Could not load note: " + e.message);
+ alert("Could not load jot: " + e.message);
}
};
@@ -720,7 +705,7 @@ async function saveDocument(text) {
const now = new Date().toISOString();
const newNote = {
id: newId,
- name: `Note ${newId}`,
+ name: `Jot ${newId}`,
content: text,
created: now,
updated: now
@@ -764,7 +749,7 @@ async function deleteDocument(id) {
}
async function renameDocument(id, currentName) {
- const newName = prompt("Enter a new name for this note:", currentName);
+ const newName = prompt("Enter a new name for this jot:", currentName);
if (newName === null) return;
const trimmed = newName.trim();
if (!trimmed) { alert("Name cannot be empty"); return; }
@@ -798,7 +783,7 @@ async function exportDocument() {
const defaultName = `${currentDocName || 'note'}.txt`;
try {
- const filename = await Neutralino.os.showSaveDialog('Export Note', {
+ const filename = await Neutralino.os.showSaveDialog('Export Jot', {
defaultPath: defaultName
});
@@ -816,7 +801,7 @@ async function exportDocument() {
if (currentDocId !== null) {
document.getElementById("docStatus").textContent = `Editing: ${currentDocName}`;
} else {
- document.getElementById("docStatus").textContent = "New Note";
+ document.getElementById("docStatus").textContent = "New Jot";
}
}, 5000);
@@ -841,7 +826,7 @@ function updateStatus() {
const status = document.getElementById("docStatus");
status.textContent = currentDocId !== null
? `Editing: ${currentDocName}`
- : "New Note";
+ : "New Jot";
}
// EVENT LISTENERS