Move strikethrough back to pop up menu. Minor corrections.

This commit is contained in:
T. H. Wright 2019-11-13 11:24:30 -05:00
parent 86b88d73dd
commit dccad779fc
2 changed files with 13 additions and 10 deletions

View File

@ -9,14 +9,6 @@ api.onToolbarCreate(toolbar => {
perform: e => e.applySurround('[u]', '[/u]', 'underline_text') perform: e => e.applySurround('[u]', '[/u]', 'underline_text')
}); });
}); });
api.onToolbarCreate(toolbar => {
toolbar.addButton({
id: "strikethrough_button",
group: "fontStyles",
icon: "strikethrough",
perform: e => e.applySurround('<s>', '</s>', 'strikethrough_text')
});
});
api.onToolbarCreate(toolbar => { api.onToolbarCreate(toolbar => {
toolbar.addButton({ toolbar.addButton({
id: "align_center_button", id: "align_center_button",
@ -43,6 +35,13 @@ api.onToolbarCreate(toolbar => {
}); });
// EXTRAS // EXTRAS
api.addToolbarPopupMenuOptionsCallback(() => {
return {
action: "strikethrough",
icon: "strikethrough",
label: "strikethrough_button"
};
});
api.addToolbarPopupMenuOptionsCallback(() => { api.addToolbarPopupMenuOptionsCallback(() => {
return { return {
action: "floatleft", action: "floatleft",
@ -71,8 +70,12 @@ api.addToolbarPopupMenuOptionsCallback(() => {
label: "subscript_button" label: "subscript_button"
}; };
}); });
api.modifyClass("controller:composer", { api.modifyClass("controller:composer", {
actions: { actions: {
strikethrough() {
this.get("toolbarEvent").applySurround("<s>", "</s>", "strikethrough_prompt");
},
floatleft() { floatleft() {
this.get("toolbarEvent").applySurround('[wrap="floatl"]\n', '\n[/wrap]', "float_left_text"); this.get("toolbarEvent").applySurround('[wrap="floatl"]\n', '\n[/wrap]', "float_left_text");
}, },
@ -83,7 +86,7 @@ api.modifyClass("controller:composer", {
this.get("toolbarEvent").applySurround("<sup>", "</sub>", "superscript_text"); this.get("toolbarEvent").applySurround("<sup>", "</sub>", "superscript_text");
}, },
subscript() { subscript() {
this.get("toolbarEvent").applySurround("<sub>", "</sub>", "suvscript_text"); this.get("toolbarEvent").applySurround("<sub>", "</sub>", "subscript_text");
} }
} }
}); });

View File

@ -67,7 +67,7 @@ columns_button:
description: description:
en: Enter the text for the title of the button in the composer. en: Enter the text for the title of the button in the composer.
columns_text: columns_text:
default: "Use the closing tag to mark where the column ends." default: "Use the closing tag to mark where the column ends. Once done. Columns must be equal height."
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. en: Enter the placeholder text that appears in the composer after the user clicks the button.