<commit_before>// Copyright (c) 2006-2009 by <NAME> <<EMAIL>>
// Copyright (c) 2007-2009 by <NAME> <<EMAIL>>
// Copyright (c) 2008-2010 by <NAME> <maglione.k at Gmail>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
"use strict";

var Config = Module("config", ConfigBase, {
    name: "pentadactyl",
    appName: "Pentadactyl",
    idName: "PENTADACTYL",
    fileExt: "penta",
    host: "Firefox",
    hostbin: "firefox",

    Local: function Local(dactyl, modules, window)
        let ({ config } = modules) ({

        dialogs: {
            about: ["About Firefox",
                function () { window.openDialog("chrome://browser/content/aboutDialog.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
            addbookmark: ["Add bookmark for the current page",
                function () { window.PlacesCommandHook.bookmarkCurrentPage(true, window.PlacesUtils.bookmarksRootId); }],
            addons: ["Manage Add-ons",
                function () { window.BrowserOpenAddonsMgr(); }],
            bookmarks: ["List your bookmarks",
                function () { window.openDialog("chrome://browser/content/bookmarks/bookmarksPanel.xul", "Bookmarks", "dialog,centerscreen,width=600,height=600"); }],
            checkupdates: ["Check for updates",
                function () { window.checkForUpdates(); },
                function () "checkForUpdates" in window],
            cleardata: ["Clear private data",
                function () { Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue).sanitize(window || null); }],
            cookies: ["List your cookies",
                function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }],
            console: ["JavaScript console",
                function () { window.toJavaScriptConsole(); }],
            customizetoolbar: ["Customize the Toolbar",
                function () { window.BrowserCustomizeToolbar(); }],
            dominspector: ["DOM Inspector",
                function () { window.inspectDOMDocument(window.content.document); },
                function () "inspectDOMDocument" in window],
            downloads: ["Manage Downloads",
                function () { window.toOpenWindowByType("Download:Manager", "chrome://mozapps/content/downloads/downloads.xul", "chrome,dialog=no,resizable"); }],
            history: ["List your history",
                function () { window.openDialog("chrome://browser/content/history/history-panel.xul", "History", "dialog,centerscreen,width=600,height=600"); }],
            import: ["Import Preferences, Bookmarks, History, etc. from other browsers",
                function () { window.BrowserImport(); }],
            openfile: ["Open the file selector dialog",
                function () { window.BrowserOpenFileWindow(); }],
            pageinfo: ["Show information about the current page",
                function () { window.BrowserPageInfo(); }],
            pagesource: ["View page source",
                function () { window.BrowserViewSourceOfDocument(window.content.document); }],
            passwords: ["Passwords dialog",
                function () { window.openDialog("chrome://passwordmgr/content/passwordManager.xul"); }],
            places: ["Places Organizer: Manage your bookmarks and history",
                function () { window.PlacesCommandHook.showPlacesOrganizer(window.ORGANIZER_ROOT_BOOKMARKS); }],
            preferences: ["Show Firefox preferences dialog",
                function () { window.openPreferences(); }],
            printpreview: ["Preview the page before printing",
                function () { PrintUtils.printPreview(window.PrintPreviewListener || onEnterPrintPreview, window.onExitPrintPreview); }],
            printsetup: ["Setup the page size and orientation before printing",
                function () { PrintUtils.showPageSetup(); }],
            print: ["Show print dialog",
                function () { PrintUtils.print(); }],
            saveframe: ["Save frame to disk",
                function () { window.saveFrameDocument(); }],
            savepage: ["Save page to disk",
                function () { window.saveDocument(window.content.document); }],
            searchengines: ["Manage installed search engines",
                function () { window.openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
            selectionsource: ["View selection source",
                function () { buffer.viewSelectionSource(); }],
            venkman: ["The JavaScript debugger",
                function () { dactyl.assert("start_venkman" in window, "Venkman is not installed"); window.start_venkman() },
                function () "start_venkman" in window]
        },

        get visualbellWindow() this.browser.mPanelContainer,

        removeTab: function (tab) {
            if (this.tabbrowser.mTabs.length > 1)
                this.tabbrowser.removeTab(tab);
            else {
                if (buffer.URL != "about:blank" || window.getWebNavigation().sessionHistory.count > 0) {
                    dactyl.open("about:blank", dactyl.NEW_BACKGROUND_TAB);
                    this.tabbrowser.removeTab(tab);
                }
                else
                    dactyl.beep();
            }
        },

        get tempFile() {
            let prefix = this.name.toLowerCase();
            try {
                prefix += "-" + window.content.document.location.hostname;
            }
            catch (e) {}

            return prefix + ".tmp";
        }
    }),

    overlayChrome: ["chrome://browser/content/browser.xul"],

    styleableChrome: ["chrome://browser/content/browser.xul"],

    autocommands: {<commit_msg>Fix bad module reference in relocated config.js. Closes issue #220.<commit_after>// Copyright (c) 2006-2009 by <NAME> <<EMAIL>>
// Copyright (c) 2007-2009 by <NAME> <<EMAIL>>
// Copyright (c) 2008-2010 by <NAME> <maglione.k at Gmail>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
"use strict";

var Config = Module("config", ConfigBase, {
    name: "pentadactyl",
    appName: "Pentadactyl",
    idName: "PENTADACTYL",
    fileExt: "penta",
    host: "Firefox",
    hostbin: "firefox",

    Local: function Local(dactyl, modules, window)
        let ({ config } = modules) ({

        dialogs: {
            about: ["About Firefox",
                function () { window.openDialog("chrome://browser/content/aboutDialog.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
            addbookmark: ["Add bookmark for the current page",
                function () { window.PlacesCommandHook.bookmarkCurrentPage(true, window.PlacesUtils.bookmarksRootId); }],
            addons: ["Manage Add-ons",
                function () { window.BrowserOpenAddonsMgr(); }],
            bookmarks: ["List your bookmarks",
                function () { window.openDialog("chrome://browser/content/bookmarks/bookmarksPanel.xul", "Bookmarks", "dialog,centerscreen,width=600,height=600"); }],
            checkupdates: ["Check for updates",
                function () { window.checkForUpdates(); },
                function () "checkForUpdates" in window],
            cleardata: ["Clear private data",
                function () { Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue).sanitize(window || null); }],
            cookies: ["List your cookies",
                function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }],
            console: ["JavaScript console",
                function () { window.toJavaScriptConsole(); }],
            customizetoolbar: ["Customize the Toolbar",
                function () { window.BrowserCustomizeToolbar(); }],
            dominspector: ["DOM Inspector",
                function () { window.inspectDOMDocument(window.content.document); },
                function () "inspectDOMDocument" in window],
            downloads: ["Manage Downloads",
                function () { window.toOpenWindowByType("Download:Manager", "chrome://mozapps/content/downloads/downloads.xul", "chrome,dialog=no,resizable"); }],
            history: ["List your history",
                function () { window.openDialog("chrome://browser/content/history/history-panel.xul", "History", "dialog,centerscreen,width=600,height=600"); }],
            import: ["Import Preferences, Bookmarks, History, etc. from other browsers",
                function () { window.BrowserImport(); }],
            openfile: ["Open the file selector dialog",
                function () { window.BrowserOpenFileWindow(); }],
            pageinfo: ["Show information about the current page",
                function () { window.BrowserPageInfo(); }],
            pagesource: ["View page source",
                function () { window.BrowserViewSourceOfDocument(window.content.document); }],
            passwords: ["Passwords dialog",
                function () { window.openDialog("chrome://passwordmgr/content/passwordManager.xul"); }],
            places: ["Places Organizer: Manage your bookmarks and history",
                function () { window.PlacesCommandHook.showPlacesOrganizer(window.ORGANIZER_ROOT_BOOKMARKS); }],
            preferences: ["Show Firefox preferences dialog",
                function () { window.openPreferences(); }],
            printpreview: ["Preview the page before printing",
                function () { PrintUtils.printPreview(window.PrintPreviewListener || onEnterPrintPreview, window.onExitPrintPreview); }],
            printsetup: ["Setup the page size and orientation before printing",
                function () { PrintUtils.showPageSetup(); }],
            print: ["Show print dialog",
                function () { PrintUtils.print(); }],
            saveframe: ["Save frame to disk",
                function () { window.saveFrameDocument(); }],
            savepage: ["Save page to disk",
                function () { window.saveDocument(window.content.document); }],
            searchengines: ["Manage installed search engines",
                function () { window.openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
            selectionsource: ["View selection source",
                function () { buffer.viewSelectionSource(); }],
            venkman: ["The JavaScript debugger",
                function () { dactyl.assert("start_venkman" in window, "Venkman is not installed"); window.start_venkman() },
                function () "start_venkman" in window]
        },

        get visualbellWindow() this.browser.mPanelContainer,

        removeTab: function (tab) {
            if (this.tabbrowser.mTabs.length > 1)
                this.tabbrowser.removeTab(tab);
            else {
                if (modules.buffer.URL != "about:blank" || window.getWebNavigation().sessionHistory.count > 0) {
                    dactyl.open("about:blank", dactyl.NEW_BACKGROUND_TAB);
                    this.tabbrowser.removeTab(tab);
                }
                else
                    dactyl.beep();
            }
        },

        get tempFile() {
            let prefix = this.name.toLowerCase();
            try {
                prefix += "-" + window.content.document.location.hostname;
            }
            catch (e) {}

            return prefix + ".tmp";
        }
    }),

    overlayChrome: ["chrome://browser/content/browser.xul"],

    styleableChrome: ["chrome://browser/content/browser.xul"],

    autocommands: {
{'fraction_non_alphanumeric': 0.13598715348208248, 'fraction_numerical': 0.006845841784989858, 'mean_word_length': 2.3731470923603193, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6586934', 'n_tokens_mistral': 3197, 'n_tokens_neox': 3024, 'n_words': 663}