This commit is contained in:
pika 2025-04-14 23:33:50 +02:00
parent 02582c6b06
commit 5473beb35d
7 changed files with 774 additions and 110 deletions

View file

@ -249,7 +249,14 @@
styleActiveLine: true,
autoCloseBrackets: true,
extraKeys: {
"Enter": "newlineAndIndentContinueMarkdownList"
"Enter": "newlineAndIndentContinueMarkdownList",
"Ctrl-S": function(cm) {
// Prevent browser's save dialog
event.preventDefault();
// Trigger document save
document.getElementById('save-document').click();
return false;
}
}
});
@ -510,13 +517,21 @@
const tagName = tagInput.value.trim();
if (tagName) {
// Check for duplicate
// Check for duplicate (case insensitive)
const existingTags = Array.from(document.querySelectorAll('.tag')).map(tag =>
tag.textContent.trim().toLowerCase());
if (!existingTags.includes(tagName.toLowerCase())) {
addTag(tagName);
} else {
// Flash the input to indicate duplicate
tagInput.classList.add('border-red-500');
setTimeout(() => {
tagInput.classList.remove('border-red-500');
}, 500);
}
tagInput.value = '';
}
}
});