Add CAA to Tools menu
Este commit está contenido en:
25
bootstrap.js
vendido
25
bootstrap.js
vendido
@@ -114,14 +114,36 @@ let button = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let menuitem = {
|
||||||
|
meta : {
|
||||||
|
id : "ca-archive-menu",
|
||||||
|
label : "Classic Add-ons Archive",
|
||||||
|
class : "menuitem-iconic"
|
||||||
|
},
|
||||||
|
install : function (w) {
|
||||||
|
let doc = w.document;
|
||||||
|
let m = doc.createElement("menuitem");
|
||||||
|
for (let a in this.meta) {
|
||||||
|
m.setAttribute(a, this.meta[a]);
|
||||||
|
}
|
||||||
|
m.style.listStyleImage = 'url("chrome://ca-archive/skin/button.png")';
|
||||||
|
|
||||||
|
let menu = $(doc, "menu_ToolsPopup");
|
||||||
|
menu.insertBefore(m, null);
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let caaIn = function (w) {
|
let caaIn = function (w) {
|
||||||
let b = button.install(w);
|
let b = button.install(w);
|
||||||
|
let m = menuitem.install(w);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init : function () {
|
init : function () {
|
||||||
w.addEventListener("customizationchange", button.onCustomize, false);
|
w.addEventListener("customizationchange", button.onCustomize, false);
|
||||||
w.addEventListener("aftercustomization", button.afterCustomize, false);
|
w.addEventListener("aftercustomization", button.afterCustomize, false);
|
||||||
b.addEventListener("command", this.run, false);
|
b.addEventListener("command", this.run, false);
|
||||||
|
m.addEventListener("command", this.run, false);
|
||||||
},
|
},
|
||||||
done : function () {
|
done : function () {
|
||||||
w.removeEventListener("customizationchange", button.onCustomize, false);
|
w.removeEventListener("customizationchange", button.onCustomize, false);
|
||||||
@@ -129,6 +151,9 @@ let caaIn = function (w) {
|
|||||||
b.removeEventListener("command", this.run, false);
|
b.removeEventListener("command", this.run, false);
|
||||||
b.parentNode.removeChild(b);
|
b.parentNode.removeChild(b);
|
||||||
b = null;
|
b = null;
|
||||||
|
m.removeEventListener("command", this.run, false);
|
||||||
|
m.parentNode.removeChild(m);
|
||||||
|
m = null;
|
||||||
},
|
},
|
||||||
run : function () {
|
run : function () {
|
||||||
if (Services.ppmm.childCount > 1) {
|
if (Services.ppmm.childCount > 1) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
-moz-box-orient: horizontal !important;
|
-moz-box-orient: horizontal !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ca-archive-button {
|
#ca-archive-button, #ca-archive-menu .menu-iconic-left {
|
||||||
-moz-image-region: rect(0, 48px, 16px, 32px);
|
-moz-image-region: rect(0, 48px, 16px, 32px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Referencia en una nueva incidencia
Block a user