Jump to content

User:Sportzpikachu/common.js

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Sportzpikachu (talk | contribs) at 21:45, 31 May 2024. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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.
if (location.hostname.includes(".m.")) {
    console.log("on mobile, switch to desktop site to enable scripts");
} else {
    mw.loader.load('/w/index.php?title=User:Lupin/recent2.js&action=raw&ctype=text/javascript');
    mw.loader.load('/w/index.php?title=User:Sportzpikachu/bookmarks.js&action=raw&ctype=text/javascript');
    mw.loader.load('https://meta.wikimedia.org/wiki/User:DannyS712/Global_watchlist/stable.js?action=raw&ctype=text/javascript');
    
    // mw.loader.load( '/w/index.php?title=User:Sportzpikachu/sandbox.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Sportzpikachu/sandbox.js]]
    
	mw.loader.load( '/w/index.php?title=User:Sportzpikachu/viteload.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Sportzpikachu/viteload.js]]
	// mw.loader.load( 'http://localhost:4173/ultraviolet.cjs' );
	
    // RW/UV
    // mw.loader.load( '/w/index.php?title=User:10nm/beta.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:10nm/beta.js]]
    // mw.loader.load('/w/index.php?title=User:RedWarn/.js&action=raw&ctype=text/javascript');
    
    //mw.loader.load('http://localhost:9696/build.php');
    //mw.loader.load('/w/index.php?title=User:Sportshead/rw17dev.js&action=raw&ctype=text/javascript');
    //mw.loader.load( '/w/index.php?title=User:Sportshead/rw16.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Sportshead/rw16.js]]
    //mw.loader.load('http://localhost:45991/ultraviolet.js')

    window.watchlistOptions = {
        filter: ["unread", "!bot"]
    };
    mw.loader.load('/w/index.php?title=User:Sportzpikachu/watchlist-notice.js&action=raw&ctype=text/javascript');
    mw.loader.load('/w/index.php?title=User:Enterprisey/diff-permalink.js&action=raw&ctype=text/javascript');

	window.LocalComments = {
	    dateDifference: true,
	    dateFormat: 'ymd',
	    dayOfWeek: true,
	    dropDays: 0,
	    dropMonths: 0,
	    timeFirst: true,
	    twentyFourHours: true,
	};

    mw.loader.load('/w/index.php?title=User:Enterprisey/user-script-helper.js&action=raw&ctype=text/javascript'); // Backlink: [[User:Enterprisey/user-script-helper.js]]
    mw.loader.load('/w/index.php?title=User:Enterprisey/copy-section-link.js&action=raw&ctype=text/javascript'); // Backlink: [[User:Enterprisey/copy-section-link.js]]

    //window.replyLinkPreloadPingTpl = "{{re|##}} ";
    //mw.loader.load('/w/index.php?title=User:Enterprisey/reply-link.js&action=raw&ctype=text/javascript'); // Backlink: [[User:Enterprisey/reply-link.js]]
    
    mw.loader.load( '/w/index.php?title=User:Chlod/Scripts/UserHighlighter.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Chlod/Scripts/UserHighlighter.js]]

	mw.loader.load( '/w/index.php?title=User:Evad37/OneClickArchiver.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Evad37/OneClickArchiver.js]]
	mw.loader.load( '/w/index.php?title=User:Amorymeltzer/userinfo.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Amorymeltzer/userinfo.js]]
	mw.loader.load( '/w/index.php?title=User:Chlod/Scripts/GlobalUserToolbox.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Chlod/Scripts/GlobalUserToolbox.js]]
	mw.loader.load( '/w/index.php?title=User:Chlod/Scripts/GoToTitle.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Chlod/Scripts/GoToTitle.js]]
    //mw.loader.load( '/w/index.php?title=User:Awesome_Aasim/infiniscroll.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Awesome Aasim/infiniscroll.js]]
	mw.loader.load( '/w/index.php?title=User:Enterprisey/cv-revdel.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Enterprisey/cv-revdel.js]]

    // ripped off from [[User:SD0001/common.js]] who ripped it off from [[User:Enterprisey/search-shortcuts]]
    var expansions = {
        "wp:afd": "WP:Articles for deletion",
        "wp:tfd": "WP:Templates for discussion/Log",
        "wp:cfd": "WP:Categories for discussion/Log",
        "wp:rfd": "WP:Redirects for discussion/Log",
        "wp:ffd": "WP:Files for discussion/Log",
        "wp:mfd": "WP:Miscellany for deletion",
        "wp:drv": "WP:Deletion review",
        "wp:mrv": "WP:Move review",
        "template:dykn": "Template:Did you know nominations", // t: expands to template:
        "wp:pr": "WP:Peer review",
        "wp:gar": "WP:Good article reassessment",
        "wp:fac": "WP:Featured article candidates",
        "wp:rfa": "WP:Requests for adminship",
        "wp:rfb": "WP:Requests for bureaucratship",
        "wp:rfc": "WP:Requests for comment",
        "wp:brfa": "WP:Bots/Requests for approval",

        // namespaces
        "t": "Template",
        "c": "Category",
        "me": "User:Sportzpikachu",
        "alt": "User:Sportshead",
        "co": "Special:Contribs",
        "rw": "WP:RedWarn"
    };

	function shortcutCB(event) {
        if (event.key === "/" || event.key === ":") {
            var val = $(this).val().toLowerCase();
            if (expansions[val]) {
                $(this).val(expansions[val]);
            }
        }
    }

    $("#searchInput").on("keydown", shortcutCB);

	Array.isArray(window.GoToTitleHooks) ? window.GoToTitleHooks.push(shortcutCB) : window.GoToTitleHooks = [shortcutCB];

    mw.loader.using("ext.gadget.RTRC", function() {
        $('a[href*="RTRC"]').attr("href", "/wiki/Special:BlankPage/RTRC?opt=%7B%22app%22%3A%7B%22cvnDB%22%3Atrue%2C%22ores%22%3Atrue%2C%22autoDiff%22%3Atrue%7D%7D");
    }); // set RTRC options
    
    $(function() {
        if (window.location.hash&&(window.location.hash.includes("#noticeApplied-")||window.location.hash.includes("#redirectLatestRevision"))) {
            mw.util.addCSS(".archived-section-prompt{display:none}");
        }
    });
} // check for mobile