/* EditorMultiwikiNotice Gadget - JS Initialisation, Setup, Events. The editor now shows if this is a multiwiki master / slave page See detailed documentation in Dev/mediawiki deferrable:YES -- This is just an augmentation */ (function() { let masterWikiDomain = { clearnet: 'www.kicksecure.com', onion: 'www.w5j6stm77zs6652pgsij4awcjeel3eco7kvipheu6mtr623eyyehj4yd.onion', }; let urlParts = { protocol: { clearnet: 'https://', onion: 'http://', }, info: '/wiki/Dev/mediawiki#MultiWiki', edit: '/w/index.php?action=edit&title=', }; // Only active if a page gets edited and if the page is MultiWiki if( (new URLSearchParams( window.location.search )).get('action') != 'edit' || ! $('#wpTextbox1').val().match(/\[\[\s*Category\s*:\s*MultiWiki\s*\]\]/) ) return; let domain = (new URL( window.location.href )).hostname; let domainType = domain.match(/\.onion$/) ? 'onion' : 'clearnet'; let multiWikiInfo = $( '' + '' ); $('#mw-content-text').prepend( multiWikiInfo ); multiWikiInfo.find('.multiwiki-info').attr( 'href', urlParts.protocol[domainType] + masterWikiDomain[domainType] + urlParts.info ); multiWikiInfo.find('.multiwiki-edit-master').attr( 'href', urlParts.protocol[domainType] + masterWikiDomain[domainType] + urlParts.edit + (new URLSearchParams( window.location.search )).get('title') ); })(); /* [[Category:MultiWiki]] */