<commit_before>/* See license.txt for terms of usage */

define([
    "firebug/lib/object",
    "firebug/firebug",
    "firebug/firefox/firefox",
    "firebug/lib/css",
],
function(Obj, Firebug, Firefox, Css) {

// ********************************************************************************************* //
// Constants

const Cc = Components.classes;
const Ci = Components.interfaces;

// ********************************************************************************************* //
// Module Implementation

Firebug.FirebugMenu = Obj.extend(Firebug.Module,
{
    dispatchName: "firebugMenu",

    initializeUI: function()
    {
        Firebug.Module.initializeUI.apply(this, arguments);

        FBTrace.sysout("firebugMenu.initializeUI");

        // Put Firebug version on all "About" menu items. This men item appears in
        // Firefox Tools menu (Firefox UI) as well as Firebug Icon menu (Firebug UI)
        this.updateAboutMenu(document);
        this.updateAboutMenu(top.document);

        // Initialize Firebug Tools, Web Developer and Firebug Icon menus.
        var firebugMenuPopup = Firefox.getElementById("fbFirebugMenuPopup");

        // If 'Web Developer' menu is available (introduced in Firefox 6)
        // Remove the old entry in Tools menu.
        if (Firefox.getElementById("menu_webDeveloper_firebug"))
        {
            var menuFirebug = Firefox.getElementById("menu_firebug");
            if (menuFirebug)
                menuFirebug.parentNode.removeChild(menuFirebug);
        }

        // Initialize content of Firebug menu at various places.
        this.initializeMenu(Firefox.getElementById("menu_webDeveloper_firebug"), firebugMenuPopup);
        this.initializeMenu(Firefox.getElementById("menu_firebug"), firebugMenuPopup);
        this.initializeMenu(Firefox.getElementById("appmenu_firebug"), firebugMenuPopup);
        this.initializeMenu(Firebug.chrome.$("fbFirebugMenu"), firebugMenuPopup);
    },

    /**
     * Append version info to all "About" menu items.
     * @param {Object} doc The scope document where to look for XUL menu elements.
     */
    updateAboutMenu: function(doc)
    {
        var version = Firebug.getVersion();
        if (version)
        {
            var nodes = doc.querySelectorAll(".firebugAbout");
            for (var i=0; i<nodes.length; i++)
            {
                var node = nodes[i];
                var aboutLabel = node.getAttribute("label");
                node.setAttribute("label", aboutLabel + " " + version);
                Css.removeClass(node, "firebugAbout");
            }
        }
    },

    /**
     * Insert Firebug menu into specified location in the UI. Firebug menu appears
     * at several location depending on Firefox version and/or application (e.g. SeaMonkey)
     */
    initializeMenu: function(parentMenu, popupMenu)
    {
        if (!parentMenu)
            return;

        if (parentMenu.getAttribute("initialized"))
            return;

        parentMenu.appendChild(popupMenu.cloneNode(true));
        parentMenu.setAttribute("initialized", "true");
    },
});

// ********************************************************************************************* //
// Registration

Firebug.registerModule(Firebug.FirebugMenu);

// ********************************************************************************************* //

return Firebug.FirebugMenu;
});
/* See license.txt for terms of usage */

define([
    "firebug/lib/object",
    "firebug/firebug",
    "firebug/firefox/firefox",
],
function(Obj, Firebug, Firefox) {

// ********************************************************************************************* //
// Constants

const Cc = Components.classes;
const Ci = Components.interfaces;

// ********************************************************************************************* //
// Module Implementation

Firebug.FirebugMenu = Obj.extend(Firebug.Module,
{
    dispatchName: "firebugMenu",

    initializeUI: function()
    {
        Firebug.Module.initializeUI.apply(this, arguments);

        FBTrace.sysout("firebugMenu.initializeUI");

        // Put Firebug version on all "About" menu items. This men item appears in
        // Firefox Tools menu (Firefox UI) as well as Firebug Icon menu (Firebug UI)
        this.updateAboutMenu(document);
        this.updateAboutMenu(top.document);

        // Initialize Firebug Tools, Web Developer and Firebug Icon menus.
        var firebugMenuPopup = Firefox.getElementById("fbFirebugMenuPopup");

        // If 'Web Developer' menu is available (introduced in Firefox 6)
        // Remove the old entry in Tools menu.
        if (Firefox.getElementById("menu_webDeveloper_firebug"))
        {
            var menuFirebug = Firefox.getElementById("menu_firebug");
            if (menuFirebug)
                menuFirebug.parentNode.removeChild(menuFirebug);
        }

        // Initialize content of Firebug menu at various places.
        this.initializeMenu(Firefox.getElementById("menu_webDeveloper_firebug"), firebugMenuPopup);
        this.initializeMenu(Firefox.getElementById("menu_firebug"), firebugMenuPopup);
        this.initializeMenu(Firefox.getElementById("appmenu_firebug"), firebugMenuPopup);
        this.initializeMenu(Firebug.chrome.$("fbFirebugMenu"), firebugMenuPopup);
    },

    /**
     * Append version info to all "About" menu items.
     * @param {Object} doc The scope document where to look for XUL menu elements.
     */
    updateAboutMenu: function(doc)
    {
        var version = Firebug.getVersion();
        if (version)
        {
            var nodes = doc.querySelectorAll(".firebugAbout");
            for (var i=0; i<nodes.length; i++)
            {
                var node = nodes[i];
                var aboutLabel = node.getAttribute("label");
                node.setAttribute("label", aboutLabel + " " + version);
            }
        }
    },

    /**
     * Insert Firebug menu into specified location in the UI. Firebug menu appears
     * at several location depending on Firefox version and/or application (e.g. SeaMonkey)
     */
    initializeMenu: function(parentMenu, popupMenu)
    {
        if (!parentMenu)
            return;

        if (parentMenu.getAttribute("initialized"))
            return;

        parentMenu.appendChild(popupMenu.cloneNode(true));
        parentMenu.setAttribute("initialized", "true");
    },
});

// ********************************************************************************************* //
// Registration

Firebug.registerModule(Firebug.FirebugMenu);

// ********************************************************************************************* //

return Firebug.FirebugMenu;
});<commit_msg>[1.8] Typo in firebug/firefox/firebugMenu.js + clone result of querySelectorAll<commit_after>/* See license.txt for terms of usage */

define([
    "firebug/lib/object",
    "firebug/firebug",
    "firebug/firefox/firefox",
    "firebug/lib/css",
    "firebug/lib/array",
],
function(Obj, Firebug, Firefox, Css, Arr) {

// ********************************************************************************************* //
// Constants

const Cc = Components.classes;
const Ci = Components.interfaces;

// ********************************************************************************************* //
// Module Implementation

Firebug.FirebugMenu = Obj.extend(Firebug.Module,
{
    dispatchName: "firebugMenu",

    initializeUI: function()
    {
        Firebug.Module.initializeUI.apply(this, arguments);

        FBTrace.sysout("firebugMenu.initializeUI");

        // Put Firebug version on all "About" menu items. This men item appears in
        // Firefox Tools menu (Firefox UI) as well as Firebug Icon menu (Firebug UI)
        this.updateAboutMenu(document);
        this.updateAboutMenu(top.document);

        // Initialize Firebug Tools, Web Developer and Firebug Icon menus.
        var firebugMenuPopup = Firefox.getElementById("fbFirebugMenuPopup");

        // If 'Web Developer' menu is available (introduced in Firefox 6)
        // Remove the old entry in Tools menu.
        if (Firefox.getElementById("menu_webDeveloper_firebug"))
        {
            var menuFirebug = Firefox.getElementById("menu_firebug");
            if (menuFirebug)
                menuFirebug.parentNode.removeChild(menuFirebug);
        }

        // Initialize content of Firebug menu at various places.
        this.initializeMenu(Firefox.getElementById("menu_webDeveloper_firebug"), firebugMenuPopup);
        this.initializeMenu(Firefox.getElementById("menu_firebug"), firebugMenuPopup);
        this.initializeMenu(Firefox.getElementById("appmenu_firebug"), firebugMenuPopup);
        this.initializeMenu(Firebug.chrome.$("fbFirebugMenu"), firebugMenuPopup);
    },

    /**
     * Append version info to all "About" menu items.
     * @param {Object} doc The scope document where to look for XUL menu elements.
     */
    updateAboutMenu: function(doc)
    {
        var version = Firebug.getVersion();
        if (version)
        {
            var nodes = doc.querySelectorAll(".firebugAbout");
            nodes = Arr.cloneArray(nodes);
            for (var i=0; i<nodes.length; i++)
            {
                var node = nodes[i];
                var aboutLabel = node.getAttribute("label");
                node.setAttribute("label", aboutLabel + " " + version);
                Css.removeClass(node, "firebugAbout");
            }
        }
    },

    /**
     * Insert Firebug menu into specified location in the UI. Firebug menu appears
     * at several location depending on Firefox version and/or application (e.g. SeaMonkey)
     */
    initializeMenu: function(parentMenu, popupMenu)
    {
        if (!parentMenu)
            return;

        if (parentMenu.getAttribute("initialized"))
            return;

        parentMenu.appendChild(popupMenu.cloneNode(true));
        parentMenu.setAttribute("initialized", "true");
    },
});

// ********************************************************************************************* //
// Registration

Firebug.registerModule(Firebug.FirebugMenu);

// ********************************************************************************************* //

return Firebug.FirebugMenu;
});
{'fraction_non_alphanumeric': 0.20878371798617198, 'fraction_numerical': 0.0007790437238289999, 'mean_word_length': 2.9821636293136873, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3306754', 'n_tokens_mistral': 2654, 'n_tokens_neox': 2552, 'n_words': 609}