Here is a little userChrome.js hack for those of you using Thunderbird. This will add the option "CopyBBCodeLink" to the Custom Buttons 0.1.3 Context Menu. Now posting Thunderbird buttons on the forum will be much easier. This should be a nice band aid until George gets around to finishing up making the extension work with TB.
- Show CopyBBCodeLink
- Code: Select all
(function() {
if(typeof custombuttons != "object") return;
var mItem = document.createElement("menuitem");
mItem.id = "custombuttons-contextpopup-copy";
mItem.setAttribute("label", "CopyBBCodeLink");
mItem.setAttribute("oncommand", "custombuttons.copyHyper();");
mItem.style.listStyleImage = "url('data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAB3R\
JTUUH1wYPERkqSZPKSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAA\
xQTFRFAAAAwsV3o7K/S2iDrZWMQgAAAAF0Uk5TAEDm2GYAAAAuS\
URBVHjaY2DAAIwggMRgZAIBkACYwQgUYGZmhqgFMiACCO2DTADd\
pWh+QfctAG6iAN320GrNAAAAAElFTkSuQmCC')";
var separator2 = document.getElementById("custombuttons-contextpopup-separator2");
separator2.parentNode.insertBefore(mItem, separator2);
})();
window.setTimeout(function() {
if(typeof custombuttons != "object") return;
custombuttons.copyHyper = function () {
var Button = document.popupNode;
var num = this.getNumber(Button.id);
var values = this.getButtonParameters(num);
var uri = "[cb=custombutton://" + escape(values.name +
"][" + values.image +
"][" + values.code +
"][" + values.initCode) +
"," + unescape(values.image) +
"]" + unescape(values.name) + "[/cb]";
const gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper);
gClipboardHelper.copyString(uri);
}
});