mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fixed "add date" for ckeditor
This commit is contained in:
parent
5001e7e630
commit
372cce8f8e
@ -20,7 +20,7 @@ $(document).bind('keydown', 'alt+t', () => {
|
|||||||
const date = new Date();
|
const date = new Date();
|
||||||
const dateString = formatDateTime(date);
|
const dateString = formatDateTime(date);
|
||||||
|
|
||||||
$('#note-detail').summernote('insertText', dateString);
|
link.addTextToEditor(dateString);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).bind('keydown', 'f5', () => {
|
$(document).bind('keydown', 'f5', () => {
|
||||||
|
@ -70,6 +70,13 @@ const link = (function() {
|
|||||||
doc.enqueueChanges(() => editor.data.insertLink(linkTitle, linkHref), doc.selection);
|
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
|
// 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
|
// of opening the link in new window/tab
|
||||||
$(document).on('click', "a[action='note']", goToInternalNote);
|
$(document).on('click', "a[action='note']", goToInternalNote);
|
||||||
@ -80,6 +87,7 @@ const link = (function() {
|
|||||||
getNodePathFromLabel,
|
getNodePathFromLabel,
|
||||||
getNotePathFromLink,
|
getNotePathFromLink,
|
||||||
createNoteLink,
|
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…
x
Reference in New Issue
Block a user