MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

/****************************************/ /* sliders using jquery by User:Tierrie */ /****************************************/ //wsl.loadScript("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"); //wsl.loadScript("http://assassinscreed.wikia.com/index.php?title=MediaWiki:Jquery-ui.min.js&action=raw&ctype=text/javascript"); mw.loader.using( ['jquery.ui.tabs'], function { $(document).ready(function { var $tabs = $("#portal_slider").tabs({ fx: {opacity:'toggle', duration:100} } ); $("[class^=portal_sliderlink]").click(function { // bind click event to link   $tabs.tabs('select', this.className.replace("portal_sliderlink_", ""));    return false;  }); $('#portal_next').click(function {   $tabs.tabs('select', ($tabs.tabs('option', 'selected') == ($tabs.tabs('length'))-1) ? 0 : $tabs.tabs('option', 'selected') + 1 ); // switch to next tab   return false;  }); $('#portal_prev').click(function { // bind click event to link   $tabs.tabs('select', ($tabs.tabs('option', 'selected') == 0) ? ($tabs.tabs('length')-1) : $tabs.tabs('option', 'selected') - 1 ); // switch to previous tab   return false;  }); }); } );

/* ######################################################################## */ /* ### TITLE ICONS (Template:Games)                                    ### */ /* ### ### */ /* ### Description: Add icons to article title                          ### */ /* ### Credit:     User:Porter21                                       ### */ /* ######################################################################## */ function addTitleIcons { var iconBar = $('#va-titleicons'); var previewBar = $('#va-titleicons-preview'); if (skin != 'monobook' && skin != 'oasis' && skin != 'wikia') { return; }  if (iconBar.length > 0 && $('a', previewBar).length > 0) { if (skin == 'oasis' || skin == 'wikia') { var articleDiv = $('#WikiaArticle'); if (articleDiv.length > 0) { iconBar.css('display', 'block').prependTo(articleDiv); }     } else if (skin == 'monobook') { var firstHeading = $('#firstHeading').css('position', 'relative'); if (firstHeading.length > 0) { iconBar.css('display', 'block').appendTo(firstHeading.css('padding-right', previewBar.width + 25)); }     }      $('#va-titleicons-more').append(''); iconBar.hover(        function  {            $(this).addClass('va-titleicons-hover');         }, function  {            $(this).removeClass('va-titleicons-hover');         }); } }

if ((wgNamespaceNumber == 0 || wgNamespaceNumber == 4 || wgNamespaceNumber == 110 || wgNamespaceNumber == 502) &&     !wgIsMainpage) { addTitleIcons; }

// ================================================================ // BEGIN JavaScript title rewrite // jQuery version and Oasis skin fixes by Grunny of Wookiepedia // ================================================================ function rewriteTitle { if( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) { return; }	if( $('#title-meta').length == 0 ) { return; }	var newTitle = $('#title-meta').html; if( skin == "oasis" ) { $('header.WikiaPageHeader > h1').html(' ' + newTitle + ' '); $('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html + ';'); } else { $('.firstHeading').html(' ' + newTitle + ' '); $('.firstHeading').attr('style','text-align:' + $('#title-align').html + ';'); } } addOnloadHook( rewriteTitle ); function showEras(className) { if( skin == 'oasis' ) { return; }	if( typeof( SKIP_ERAS ) != 'undefined' && SKIP_ERAS ) return; var titleDiv = document.getElementById( className ); if( titleDiv == null || titleDiv == undefined ) return; var cloneNode = titleDiv.cloneNode(true); var firstHeading = getFirstHeading; firstHeading.insertBefore(cloneNode, firstHeading.childNodes[0]); cloneNode.style.display = "block"; } addOnloadHook(   function  {          $("#eraicons").css("display", "inline").appendTo($(".firstHeading"));    } ); addOnloadHook(   function  {         $(".WikiaPageHeader details .categories").remove;         $(".WikiaPageHeader details").append($("#eraicons"));    } ); // ================================================================ // END JavaScript title rewrite // ================================================================ // ================================================================ // BEGIN eraicons fix // Requires #mw-dismissable-notice span {display:none;} in .css // By Joeyaa // ================================================================ $('#mw-dismissable-notice > tbody > tr').prepend(' [dismiss] '); // ================================================================ // END eraicons fix // ================================================================

importScriptPage('ShowHide/code.js', 'dev');

importScriptPage('MediaWiki:Common.js/Autorefresh.js', 'prototype');

importScriptPage('User:Jgjake2/js/DISPLAYTITLE.js', 'deadisland');

importScriptPage('ShowHide/code.js', 'dev');