diff --git a/_locales/de/messages.json b/_locales/de/messages.json index a7e722a..9cb8476 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -342,6 +342,10 @@ "message": "Benachrichtigungen deaktivieren", "description": "" }, + "showOptions": { + "message": "Einstellungen anzeigen", + "description": "" + }, "displayCallingStack": { "message": "Aufrufestack anzeigen", "description": "" diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 3bcb0ac..2e5f555 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -342,6 +342,10 @@ "message": "disable notifications", "description": "" }, + "showOptions": { + "message": "display settings", + "description": "" + }, "displayCallingStack": { "message": "display calling stack", "description": "" diff --git a/icons/pageAction-showOptions.svg b/icons/pageAction-showOptions.svg new file mode 100644 index 0000000..3550f80 --- /dev/null +++ b/icons/pageAction-showOptions.svg @@ -0,0 +1,100 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/pageAction/gui.js b/pageAction/gui.js index 85268c0..021f791 100644 --- a/pageAction/gui.js +++ b/pageAction/gui.js @@ -36,7 +36,7 @@ }(); - scope.createActionButtons = function createActionButtons(container, actions, data){ + scope.createActionButtons = function createActionButtons(container, actions, data, horizontal){ actions.forEach(function(action, i){ var button = document.createElement("button"); button.className = action.name + " action"; @@ -52,7 +52,7 @@ } button.addEventListener("click", action.callback.bind(undefined, data)); container.appendChild(button); - if (i % 3 === 2){ + if (horizontal || i % 3 === 2){ container.appendChild(document.createElement("br")); } }); diff --git a/pageAction/pageAction.css b/pageAction/pageAction.css index 6990464..f76fa34 100644 --- a/pageAction/pageAction.css +++ b/pageAction/pageAction.css @@ -67,6 +67,10 @@ button.action img { text-align: right; } +#globalActions .action { + margin-bottom: 4px; +} + .notifications .fakedCanvasContent { display: block; width: 100%; diff --git a/pageAction/pageAction.js b/pageAction/pageAction.js index 93f9cd5..8555c68 100644 --- a/pageAction/pageAction.js +++ b/pageAction/pageAction.js @@ -23,15 +23,30 @@ createActionButtons( document.getElementById("globalActions"), - [{ - name: "disableNotifications", - isIcon: true, - callback: function(){ - settings.showNotifications = false; - window.close(); + [ + { + name: "showOptions", + isIcon: true, + callback: function(){ + if (browser.runtime && browser.runtime.openOptionsPage){ + browser.runtime.openOptionsPage(); + } + else { + window.open(browser.extension.getURL("options/options.html"), "_blank"); + } + } + }, + { + name: "disableNotifications", + isIcon: true, + callback: function(){ + settings.showNotifications = false; + window.close(); + } } - }], - undefined + ], + undefined, + true ); if (!tabs.length){