~glacambre/firenvim

eb3abef4520d17dbd9957f5d23ada74b853133e4 — glacambre 2 years ago 76aa726
Add link to troubleshooting guide to browserAction
3 files changed, 5 insertions(+), 0 deletions(-)

M src/background.ts
M src/browserAction.html
M src/browserAction.ts
M src/background.ts => src/background.ts +1 -0
@@ 304,6 304,7 @@ Object.assign(window, {
    },
    toggleDisabled: () => toggleDisabled(),
    updateSettings: () => updateSettings(),
    openTroubleshootingGuide: () => browser.tabs.create({ active: true, url: "https://github.com/glacambre/firenvim/blob/master/TROUBLESHOOTING.md" }),
} as any);

browser.runtime.onMessage.addListener(async (request: any, sender: any, _sendResponse: any) => {

M src/browserAction.html => src/browserAction.html +1 -0
@@ 17,6 17,7 @@
    <body style="padding: 2pt; width: 135pt">
        <button id="reloadSettings">Reload settings</button>
        <button id="disableFirenvim">Disable in this tab</button>
        <button id="troubleshooting">Troubleshooting guide</button>
        <div id="errors"></div>
        <div id="warnings"></div>
    </body>

M src/browserAction.ts => src/browserAction.ts +3 -0
@@ 42,6 42,9 @@ addEventListener("DOMContentLoaded", () => {
        browser.runtime.sendMessage( { funcName: ["toggleDisabled"] })
            .then(updateDisableButton);
    });
    document.getElementById("troubleshooting").addEventListener("click", () => {
        browser.runtime.sendMessage( { funcName: ["openTroubleshootingGuide"] });
    })
    displayErrorsAndWarnings();
    updateDisableButton();
});