mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
add checkbox in popup and handle case in popup.js
This commit is contained in:
parent
b731a051f1
commit
82c1b21d64
@ -27,6 +27,10 @@
|
||||
<div id="save-link-with-note-wrapper">
|
||||
<textarea id="save-link-with-note-textarea" rows="5"></textarea>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" id="keep-title-checkbox" name="keep-title-checkbox" value="Bike">
|
||||
<label for="keep-title-checkbox">Keep page title as note title</label><br>
|
||||
</div>
|
||||
<div style="display: flex;">
|
||||
<button type="submit" class="button wide" id="save-button">Save</button>
|
||||
|
||||
|
@ -35,6 +35,7 @@ $saveTabsButton.on("click", () => sendMessage({name: 'save-tabs'}));
|
||||
|
||||
const $saveLinkWithNoteWrapper = $("#save-link-with-note-wrapper");
|
||||
const $textNote = $("#save-link-with-note-textarea");
|
||||
const $keepTitle = $("#keep-title-checkbox");
|
||||
|
||||
$textNote.on('keypress', function (event) {
|
||||
if ((event.which === 10 || event.which === 13) && event.ctrlKey) {
|
||||
@ -66,6 +67,10 @@ async function saveLinkWithNote() {
|
||||
title = '';
|
||||
content = '';
|
||||
}
|
||||
else if ($keepTitle[0].checked){
|
||||
title = '';
|
||||
content = textNoteVal;
|
||||
}
|
||||
else {
|
||||
const match = /^(.*?)([.?!]\s|\n)/.exec(textNoteVal);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user