Jump to content

User:Levi OP/common.js

From Wikipedia, the free encyclopedia
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.
importScript('User:SD0001/dark-mode-toggle.js');        // [[User:SD0001/dark-mode-toggle.js]]
importScript('User:Jackmcbarn/editProtectedHelper.js'); // [[User:Jackmcbarn/editProtectedHelper.js]]
importScript('User:Bility/copySectionLink.js')          // [[User:Bility/copySectionLink.js]]
importScript('User:PerfektesChaos/js/lintHint/r.js')    // [[User:PerfektesChaos/js/lintHint/r.js]]
importScript('User:Evad37/rater.js')                    // [[User:Evad37/rater.js]]

// Custom script to open links from the search in a new tab
$(document.body).on('keydown', '#searchInput', function (e) {
	if (navigator.platform === "MacIntel" ? e.metaKey : e.ctrlKey) {
		$('#searchform').attr('target', '_blank');
        if (e.which === 13) {
            $("#searchButton").click();
        }
	}
}).on('keyup', '#searchform', function (e) {
    if (!(navigator.platform === "MacIntel" ? e.metaKey : e.ctrlKey)) {
        this.removeAttribute('target');
    }
});

// Fixing weird issue with computer 
$(function() {
	try {
		Array.from(document.querySelectorAll("script")).filter(function(e){return e.src.endsWith("/inject.js")})[0].remove();
		console.log("Removed script");
	} catch (e) {}
});
importScript('User:RedWarn/.js'); // Backlink: [[User:RedWarn/.js]]