diff --git a/common/head_tag.html b/common/head_tag.html index 630ade2..cc97eed 100644 --- a/common/head_tag.html +++ b/common/head_tag.html @@ -9,14 +9,6 @@ api.onToolbarCreate(toolbar => { perform: e => e.applySurround('[u]', '[/u]', 'underline_text') }); }); -api.onToolbarCreate(toolbar => { - toolbar.addButton({ - id: "strikethrough_button", - group: "fontStyles", - icon: "strikethrough", - perform: e => e.applySurround('', '', 'strikethrough_text') - }); -}); api.onToolbarCreate(toolbar => { toolbar.addButton({ id: "align_center_button", @@ -43,6 +35,13 @@ api.onToolbarCreate(toolbar => { }); // EXTRAS +api.addToolbarPopupMenuOptionsCallback(() => { + return { + action: "strikethrough", + icon: "strikethrough", + label: "strikethrough_button" + }; +}); api.addToolbarPopupMenuOptionsCallback(() => { return { action: "floatleft", @@ -71,8 +70,12 @@ api.addToolbarPopupMenuOptionsCallback(() => { label: "subscript_button" }; }); + api.modifyClass("controller:composer", { actions: { + strikethrough() { + this.get("toolbarEvent").applySurround("", "", "strikethrough_prompt"); + }, floatleft() { this.get("toolbarEvent").applySurround('[wrap="floatl"]\n', '\n[/wrap]', "float_left_text"); }, @@ -83,7 +86,7 @@ api.modifyClass("controller:composer", { this.get("toolbarEvent").applySurround("", "", "superscript_text"); }, subscript() { - this.get("toolbarEvent").applySurround("", "", "suvscript_text"); + this.get("toolbarEvent").applySurround("", "", "subscript_text"); } } }); diff --git a/settings.yml b/settings.yml index f372453..379b590 100644 --- a/settings.yml +++ b/settings.yml @@ -67,7 +67,7 @@ columns_button: description: en: Enter the text for the title of the button in the composer. 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: en: Enter the placeholder text that appears in the composer after the user clicks the button.