User:Professor Hershel Theodore Layton/global.js

// CONFIGURATING SCRIPTS var pws = [ {	wiki: 'layton', lang: 'de', label: 'Professor Layton-Wiki', page: 'Special:WikiActivity' }, {	wiki: 'mazerunner', lang: 'de', label: 'Die Auserwählten Wiki', page: 'Special:WikiActivity' } ];

// GLOBAL NAVIGATION MODIFICATIONS // Fandom logo links to community central $('.wds-global-navigation__logo').attr('href', '//community.fandom.com/de/wiki/Spezial:WikiActivity');

// Customizable wiki dropdown list in global nav -- HTML code var pws_html = 'Meine Wikis    '; $.each( pws, function(i, pws_wiki) { if (pws_wiki.hasOwnProperty( 'url' )) {	pws_url = pws_wiki["url"];  } else if (pws_wiki.hasOwnProperty( 'wiki' )) {  pws_url = '//' + pws_wiki["wiki"] + '.';    if (pws_wiki.hasOwnProperty( 'fandom' ) && pws_wiki["fandom"] === false) {	  pws_url += 'wikia.org/';    } else {  	  pws_url += 'fandom.com/';    }    if (pws_wiki.hasOwnProperty( 'lang' )) {  	  pws_url += pws_wiki["lang"] + '/';    }    pws_url += 'wiki/';    if (pws_wiki.hasOwnProperty( 'page' )) {	  pws_url += pws_wiki["page"];    }  } else {	pws_url = '//community.fandom.com/wiki/';  }  if (!pws_wiki.hasOwnProperty( 'label' )) {	if (pws_wiki.hasOwnProperty( 'wiki' )) {	  pws_wiki["label"] = pws_wiki["wiki"];	} else {	  pws_wiki["label"] = 'Wiki #' + (i + 1);	}  }  pws_html += '' + pws_wiki["label"] + ''; }); pws_html += ' '; // Clicking on profile picture in header opens profile page $('#us-h-profilelink').click(function { window.open('Special:MyPage', '_self'); }); $('.wds-avatar').wrap(''); // Changing the "start a wikia" button to "recent changes" button $('.wds-global-navigation__start-a-wiki-button').attr('href','/wiki/Special:RecentChanges?hidebots=0').text('Letzte Änderungen');

// TOOLBAR MODIFICATIONS // Scroll to top button var wikiaToolbar = document.getElementsByClassName('toolbar'); [].slice.call(wikiaToolbar).forEach(function (ToolbarTop) { ToolbarTop.innerHTML += ' '; }); function phtlScrollTop { $('html, body').animate({scrollTop: 0 }, 'slow'); }

// TRIGGER SCRIPTS (waits until page has loaded) $( document ).ready( function { // Add purge option to action buttons  $('.page-header__contribution-buttons .wds-dropdown__content ul').append('Cache leeren</a></li>');

// Removing messages without providing a reason $('#WikiaConfirmOk').removeAttr('disabled');

// Customizable wiki dropdown list in global nav -- Insert HTML $( document ).ready( function {	$( '#globalNavigation .wds-global-navigation__content-bar-left' ).append( pws_html ); }); });