mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 06:54:44 +08:00
fixed "add date" for ckeditor
This commit is contained in:
parent
5001e7e630
commit
372cce8f8e
4 changed files with 12 additions and 4 deletions
|
@ -20,7 +20,7 @@ $(document).bind('keydown', 'alt+t', () => {
|
|||
const date = new Date();
|
||||
const dateString = formatDateTime(date);
|
||||
|
||||
$('#note-detail').summernote('insertText', dateString);
|
||||
link.addTextToEditor(dateString);
|
||||
});
|
||||
|
||||
$(document).bind('keydown', 'f5', () => {
|
||||
|
|
|
@ -70,6 +70,13 @@ const link = (function() {
|
|||
doc.enqueueChanges(() => editor.data.insertLink(linkTitle, linkHref), doc.selection);
|
||||
}
|
||||
|
||||
function addTextToEditor(text) {
|
||||
const editor = noteEditor.getEditor();
|
||||
const doc = editor.document;
|
||||
|
||||
doc.enqueueChanges(() => editor.data.insertText(text), doc.selection);
|
||||
}
|
||||
|
||||
// when click on link popup, in case of internal link, just go the the referenced note instead of default behavior
|
||||
// of opening the link in new window/tab
|
||||
$(document).on('click', "a[action='note']", goToInternalNote);
|
||||
|
@ -80,6 +87,7 @@ const link = (function() {
|
|||
getNodePathFromLabel,
|
||||
getNotePathFromLink,
|
||||
createNoteLink,
|
||||
addLinkToEditor
|
||||
addLinkToEditor,
|
||||
addTextToEditor
|
||||
};
|
||||
})();
|
2
public/libraries/ckeditor/ckeditor.js
vendored
2
public/libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue