alice0775 / userChrome.js

457 stars 123 forks source link

popupTranslate #11

Open gorgelot opened 12 years ago

gorgelot commented 12 years ago

HI You can add that extra code to have an option to call the function from context menu:

/context menu element start/

(function (){ var contextMenu = document.getElementById("contentAreaContextMenu"); var translate = document.createElement("menuitem"); translate.setAttribute("id", "context-translate"); translate.setAttribute("label", "popup translate EN"); translate.setAttribute("oncommand","popupTranslate.onCommand(false);");

contextMenu.insertBefore(translate, document.getElementById("context-stop"));

})();

(function (){ var contextMenu = document.getElementById("contentAreaContextMenu"); var translate = document.createElement("menuitem"); translate.setAttribute("id", "context-translateJ"); translate.setAttribute("label", "popup translate JA"); translate.setAttribute("oncommand","popupTranslate.onCommand(true);");

contextMenu.insertBefore(translate, document.getElementById("context-stop"));

})();

/context menu element end/