wip
This commit is contained in:
parent
02582c6b06
commit
5473beb35d
7 changed files with 774 additions and 110 deletions
|
@ -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 = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue