/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const Menu = require("resource://devtools/client/framework/menu.js"); const MenuItem = require("resource://devtools/client/framework/menu-item.js");
// This WeakMap will be used to know if strings have already been loaded in a given // window, which will be used as key. const stringsLoaded = new WeakMap();
/** *Lazilyloadstringsfortheeditmenu.
*/ function loadEditMenuStrings(win) { if (stringsLoaded.has(win)) { return;
}
if (win.MozXULElement) {
stringsLoaded.set(win, true);
win.MozXULElement.insertFTLIfNeeded("toolkit/global/textActions.ftl");
}
}
/** *Returnan'edit'menuforainputfield.Thisintegratesdirectly *withdocshellcommandstoprovidetherightenabledstateandeditor *functionality. * *You'llneedtocallmenu.popup()yourself,thisjustreturnstheMenuinstance. * *@param{Window}winparentwindowreference *@param{string}idmenuID * *@returns{Menu}
*/ function createEditContextMenu(win, id) { // Localized strings for the menu are loaded lazily.
loadEditMenuStrings(win);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.