mirror of https://github.com/TriliumNext/Notes
Merge branch 'master' into next61
# Conflicts: # package-lock.json # src/public/app/services/note_content_renderer.js # src/public/app/widgets/note_tree.js # src/routes/routes.js # src/services/consistency_checks.js # src/services/notes.js # src/services/task_context.jspull/255/head
commit
b7f0fd2db3
@ -1,40 +0,0 @@
|
||||
import OptionsWidget from "../options_widget.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="options-section">
|
||||
<h4>Highlighted Text</h4>
|
||||
|
||||
<p>You can customize the highlighted text displayed in the right panel:</p>
|
||||
|
||||
</div>
|
||||
<label><input type="checkbox" class="highlighted-text-check" value="bold"> Bold font </label>
|
||||
<label><input type="checkbox" class="highlighted-text-check" value="italic"> Italic font </label>
|
||||
<label><input type="checkbox" class="highlighted-text-check" value="underline"> Underlined font </label>
|
||||
<label><input type="checkbox" class="highlighted-text-check" value="color"> Font with color </label>
|
||||
<label><input type="checkbox" class="highlighted-text-check" value="bgColor"> Font with background color </label>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
export default class HighlightedTextOptions extends OptionsWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.$hlt = this.$widget.find("input.highlighted-text-check");
|
||||
this.$hlt.on('change', () => {
|
||||
const hltVals = this.$widget.find('input.highlighted-text-check[type="checkbox"]:checked').map(function () {
|
||||
return this.value;
|
||||
}).get();
|
||||
this.updateOption('highlightedText', JSON.stringify(hltVals));
|
||||
});
|
||||
}
|
||||
|
||||
async optionsLoaded(options) {
|
||||
const hltVals = JSON.parse(options.highlightedText);
|
||||
this.$widget.find('input.highlighted-text-check[type="checkbox"]').each(function () {
|
||||
if ($.inArray($(this).val(), hltVals) !== -1) {
|
||||
$(this).prop("checked", true);
|
||||
} else {
|
||||
$(this).prop("checked", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
import OptionsWidget from "../options_widget.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="options-section">
|
||||
<h4>Highlights List</h4>
|
||||
|
||||
<p>You can customize the highlights list displayed in the right panel:</p>
|
||||
|
||||
</div>
|
||||
<label><input type="checkbox" class="highlights-list-check" value="bold"> Bold font </label>
|
||||
<label><input type="checkbox" class="highlights-list-check" value="italic"> Italic font </label>
|
||||
<label><input type="checkbox" class="highlights-list-check" value="underline"> Underlined font </label>
|
||||
<label><input type="checkbox" class="highlights-list-check" value="color"> Font with color </label>
|
||||
<label><input type="checkbox" class="highlights-list-check" value="bgColor"> Font with background color </label>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
export default class HighlightsListOptions extends OptionsWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.$hlt = this.$widget.find("input.highlights-list-check");
|
||||
this.$hlt.on('change', () => {
|
||||
const hltVals = this.$widget.find('input.highlights-list-check[type="checkbox"]:checked').map(function () {
|
||||
return this.value;
|
||||
}).get();
|
||||
this.updateOption('highlightsList', JSON.stringify(hltVals));
|
||||
});
|
||||
}
|
||||
|
||||
async optionsLoaded(options) {
|
||||
const hltVals = JSON.parse(options.highlightsList);
|
||||
this.$widget.find('input.highlights-list-check[type="checkbox"]').each(function () {
|
||||
if ($.inArray($(this).val(), hltVals) !== -1) {
|
||||
$(this).prop("checked", true);
|
||||
} else {
|
||||
$(this).prop("checked", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue