User:Lustiger seth/global.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
// copied from http://de.wikipedia.org/wiki/Benutzer:Olliminatore/monobook.js and modified
function importPage(page, proj, lang, script_path) { // all languages support
ns = 'User:'; // canonical name, works in all mediawikis
if(!proj) proj = 'wikipedia';
if(!lang) lang = wgContentLanguage;
if(!script_path) script_path = wgScriptPath; // e.g. "/w"
if(typeof(mw) !== "undefined"
&& typeof(mw.config) !== "undefined"
&& mw.config.get('wgServer').indexOf('https://') === 0
){
script_path = '/wikipedia/' + lang + script_path;
lang = 'secure';
proj = 'wikimedia';
}
page = '//' + lang + '.' + proj + '.org' + script_path + '/index.php?title=' + ns + page +
'&action=raw&ctype=text/javascript&smaxage=2678400';
return mw.loader.load(page);
}
// install [[w:en:user:Cacycle/wikEdDiff]] enhanced diff view using ajax
importPage('Cacycle/wikEdDiff.js', 'wikipedia', 'en', '/w');
// remove spam addon
// importPage('Mike.lifeguard/removeSpam.js', 'wikimedia', 'meta', '/w');
// install [[w:de:user:lustiger_seth/unsigned.js]] for signing unsigned posts
importPage('lustiger_seth/unsigned.js', 'wikipedia', 'de', '/w');
// edit section 0
importPage('lustiger_seth/editsection0.js', 'wikipedia', 'de', '/w');
// section jumpers (needs fixes since 2022-12)
//importPage('lustiger_seth/section_jumpers.js', 'wikipedia', 'de', '/w');
// modifications of the left hand sidebar menu (broken since 2022-12)
importPage('lustiger_seth/left_menu_adaptions.js', 'wikipedia', 'de', '/w');
// modifications of the top toolbar menu
importPage('lustiger_seth/toolbar_adaptions.js', 'wikipedia', 'de', '/w');
// change bg-color of edit-tab depending on protection state of page
importPage('Jogo.obb/js/sperrstatus.js', 'wikipedia', 'de', '/w');
// convert log lists to tables
importPage('lustiger_seth/list2table.js', 'wikipedia', 'de', '/w');
// replace "Benutzer" with "user:" in titles ;-)
importPage('lustiger_seth/canonical_title.js', 'wikipedia', 'de', '/w');
// clean talk pages
importPage('lustiger_seth/clean_talk_page.js', 'wikipedia', 'de', '/w');
// admin functions
importPage('lustiger_seth/admin_stuff.js', 'wikipedia', 'de', '/w');
// check whether srf url is geoblocked (does not work, because of CORS)
//importPage('lustiger_seth/check_geoblocked.js', 'wikipedia', 'de', '/w');
// export pages, see https://de.wikipedia.org/wiki/Wikipedia:Importwünsche/Versionsimport
//importPage('Brackenheim/export.js', 'wikipedia', 'de', '/w');
// show maintenance categories in watchlist
if(typeof mw.libs.watchCategories !== "object" || ! mw.libs.watchCategories){
mw.libs.watchCategories = {};
}
mw.libs.watchCategories.cats = [
"Wikipedia:Schnelllöschen",
//"Benutzer:Statische_IP_(ungeschützt)",
"Benutzer:Sperrprüfung"
];
importPage('PerfektesChaos/js/watchCategories/r.js', 'wikipedia', 'en', '/w');
/* ================================================================================
* source: https://www.mediawiki.org/wiki/MediaWiki:Gadget-vector-headanchor.js
* last sync: 2022-02-13 */
/*!
* Vector HeadAnchors gadget, from <https://mediawiki.org/wiki/MediaWiki:Gadget-vector-headanchor.js>
*
* Copyright 2013-2020 Timo Tijhof
* @license MIT <https://opensource.org/licenses/MIT>
*/
mw.hook( 'wikipage.content' ).add( function ( $content ) {
$content.find( 'span.mw-headline' ).each( function ( i, el ) {
var heading = el.parentNode;
if ( !el.id || heading.querySelector( '.tpl-vheadanchor') ) {
// No anchor possible, or anchor already inserted
return;
}
heading.classList.add('tpl-vheadanchor-heading');
// Insert anchor.
anchor = document.createElement( 'a' );
anchor.href = '#' + el.id;
anchor.textContent = '#';
anchor.title = 'Link to this section';
anchor.className = 'tpl-vheadanchor';
heading.insertBefore( anchor, el.nextSibling );
} );
} );
/* ================================================================================ */