mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
Added button to open options page from pageAction popup
This commit is contained in:
parent
e9fe20d966
commit
a85ea32a74
@ -342,6 +342,10 @@
|
|||||||
"message": "Benachrichtigungen deaktivieren",
|
"message": "Benachrichtigungen deaktivieren",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
"showOptions": {
|
||||||
|
"message": "Einstellungen anzeigen",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
"displayCallingStack": {
|
"displayCallingStack": {
|
||||||
"message": "Aufrufestack anzeigen",
|
"message": "Aufrufestack anzeigen",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
@ -342,6 +342,10 @@
|
|||||||
"message": "disable notifications",
|
"message": "disable notifications",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
"showOptions": {
|
||||||
|
"message": "display settings",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
"displayCallingStack": {
|
"displayCallingStack": {
|
||||||
"message": "display calling stack",
|
"message": "display calling stack",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
100
icons/pageAction-showOptions.svg
Normal file
100
icons/pageAction-showOptions.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 10 KiB |
@ -36,7 +36,7 @@
|
|||||||
}();
|
}();
|
||||||
|
|
||||||
|
|
||||||
scope.createActionButtons = function createActionButtons(container, actions, data){
|
scope.createActionButtons = function createActionButtons(container, actions, data, horizontal){
|
||||||
actions.forEach(function(action, i){
|
actions.forEach(function(action, i){
|
||||||
var button = document.createElement("button");
|
var button = document.createElement("button");
|
||||||
button.className = action.name + " action";
|
button.className = action.name + " action";
|
||||||
@ -52,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
button.addEventListener("click", action.callback.bind(undefined, data));
|
button.addEventListener("click", action.callback.bind(undefined, data));
|
||||||
container.appendChild(button);
|
container.appendChild(button);
|
||||||
if (i % 3 === 2){
|
if (horizontal || i % 3 === 2){
|
||||||
container.appendChild(document.createElement("br"));
|
container.appendChild(document.createElement("br"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -67,6 +67,10 @@ button.action img {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#globalActions .action {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.notifications .fakedCanvasContent {
|
.notifications .fakedCanvasContent {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -23,15 +23,30 @@
|
|||||||
|
|
||||||
createActionButtons(
|
createActionButtons(
|
||||||
document.getElementById("globalActions"),
|
document.getElementById("globalActions"),
|
||||||
[{
|
[
|
||||||
|
{
|
||||||
|
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",
|
name: "disableNotifications",
|
||||||
isIcon: true,
|
isIcon: true,
|
||||||
callback: function(){
|
callback: function(){
|
||||||
settings.showNotifications = false;
|
settings.showNotifications = false;
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
}],
|
}
|
||||||
undefined
|
],
|
||||||
|
undefined,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!tabs.length){
|
if (!tabs.length){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user