User:Sam Sailor/common.js/tier4 6 7.js

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* global SS, mw, $ */
/*  MODULE NAVIGATION:
    [Main loader: [[User:Sam_Sailor/common.js]]]
    [Modules: [[User:Sam_Sailor/common.js/tier1.js|Always]] | [[User:Sam_Sailor/common.js/tier2.js|C/C/H/W]] |
    [[User:Sam_Sailor/common.js/tier3.js|Work]] | [[User:Sam_Sailor/common.js/tier4.js|Exists]] |
    [[User:Sam_Sailor/common.js/tier4_0.js|NS 0]] | [[User:Sam_Sailor/common.js/tier4_0_118.js|NS 0/118]] |
    [[User:Sam_Sailor/common.js/tier4_118.js|NS 118]] | [[User:Sam_Sailor/common.js/tier4_118_2.js|NS 118/2]] |
    [[User:Sam_Sailor/common.js/tier4_2_3.js|NS 2/3]] | [[User:Sam_Sailor/common.js/tier4_4.js|NS 4]] |
    [[User:Sam_Sailor/common.js/tier4_4_odd.js|NS 4/ODD]] | [[User:Sam_Sailor/common.js/tier4_6_7.js|NS 6/7]] |
    [[User:Sam_Sailor/common.js/tier4_10_11.js|NS 10/11]] | [[User:Sam_Sailor/common.js/tier4_14_15.js|NS 14/15]] |
    [[User:Sam_Sailor/common.js/tier5.js|Special]]]
*/

    /**
     * ===============================================================
     * TIER 4 NS 6/7: File or file talk, if page exists, not history
     * ===============================================================
     */

window.SCRIPT_CONFIG.push(
    // [[User:Ahecht/Scripts/FileExporter.js]] adds an "Export to Commons" button to the page header, streamlining the migration of local files to Wikimedia Commons via the FileImporter tool.
    {
        page: 'User:Ahecht/Scripts/FileExporter.js',
        // Only relevant when viewing a file page (NS 6); not needed on file talk or in edit/history modes.
        condition: () => SS.inNS(6)() && SS.onAction('view')(),
        dependencies: ['mediawiki.util', 'jquery']
    },
    // [[User:Alex 21/script-imageres.js]] helps calculate and display image resolution details to comply with [[WP:IMAGERES]].
    {
        page: 'User:Alex_21/script-imageres.js',
        condition: () => SS.inNS(6)() && SS.onAction('view')(),
        dependencies: ['jquery', 'mediawiki.util']
    },
    // [[User:Alexis_Jazz/LuckyRename.js]] provides an automated workflow for renaming files, which includes updating all existing file usages and tagging the old redirect for cleanup.
    {
        page: 'User:Alexis_Jazz/LuckyRename.js',
        condition: () => SS.inNS(6, 7)() && SS.onAction('view')(),
        dependencies: ['mediawiki.api', 'mediawiki.util', 'jquery', 'jquery.ui']
    },
    // [[User:Novem Linguae/Scripts/MarkFreeUseRationale.js]] helps editors quickly correct non-free file metadata. Helpful at [[WP:NFUR]] review of [[:Category:Wikipedia non-free files for NFUR review]].
    {
        page: 'User:Novem Linguae/Scripts/MarkFreeUseRationale.js',
        condition: () => SS.inNS(6)() && SS.onAction('view')(),
        dependencies: ['mediawiki.api', 'mediawiki.util', 'jquery']
    },
    // [[User:Alexis_Jazz/RedirectCommonsRedirects.js]] intercepts automatic redirects to Wikimedia Commons, forcing the browser to stay on the local file page with ?redirect=no.
    {
        page: 'User:Alexis_Jazz/RedirectCommonsRedirects.js',
        // Specifically targets the file namespace during view mode to allow inspection of local file metadata/shadowed redirects.
        condition: () => SS.inNS(6)() && SS.onAction('view')(),
        dependencies: ['jquery']
    },
);