MediaWiki:Common.js

importArticles({   type: "script",    articles: [        "w:c:dev:Countdown/code.js",        "User:Jens_Ingels/common.js/flash.js",        "w:c:dev:RevealAnonIP/code.js",        "w:c:dev:FixWantedFiles/code.js",        "w:c:dev:UserTags/code.js",        "w:c:dev:SearchSuggest/code.js",        "MediaWiki:Common.js/Plugin/Cycle.js"    ] });

/* Block Language boards for ip users */ if ((mw.config.get("wgPageName") == 'Board:Español' || mw.config.get("wgPageName") == 'Board:Português' || mw.config.get("wgPageName") == 'Board:Deutsch') && !mw.config.get("wgUserName")) { $(".DiscussionBox, li.new-reply").hide; }

/* Thumbs Switch Controller */ $('.dc-switcher').prepend($('.dc-thumb2')); $('.dc-switcher').prepend($('.dc-thumb1')); $('.dc-switcher').prepend($('.dc-thumb0'));

$('td.dc-switcher').mouseenter(function { $("td.dc-switcher div").removeClass("dc-active"); $("div.dc-thumb3").addClass("dc-active"); });

$('td#thumb2-activator').mouseenter(function { $("td.dc-switcher div").removeClass("dc-active"); $("div.dc-thumb2").addClass("dc-active"); });

$('td#thumb1-activator').mouseenter(function { $("td.dc-switcher div").removeClass("dc-active"); $("div.dc-thumb1").addClass("dc-active"); });

$('td#thumb0-activator').mouseenter(function { $("td.dc-switcher div").removeClass("dc-active"); $("div.dc-thumb0").addClass("dc-active"); });

$('TR#dc-navbox-header').mouseleave(function { $("td.dc-switcher div").removeClass("dc-active"); $("td.dc-switcher div.dc-thumb3").addClass("dc-active"); });

/* Forum Description Controller */ $('.dc-switcher').prepend($('.dc-popup'));

/* Forum Design */ $('ul.boards').prepend(' Welcome to the Dragon City Wikia Forum. '); $('li.board-140142').before(' Questions  '); $('li.board-117992').before(' News  '); $('li.board-127124').before(' Report  '); $('li.board-117995').before(' Other  '); $('li.board-145201').before(' Other Languages  '); $('li.board-127124').before(' To report an game bugs, please visit the Bug Reporting & Known Issues</a> section, on social point forums. '); $('li.board-117995').before(' To post game suggestions, please visit the <a class="external text" href="http://forums.socialpointgames.com/forumdisplay.php?60-Your-Ideas-Suggestions-amp-Feedback">Your Ideas, Suggestions & Feedback</a> section, on the social point forums. If you just want to be creative than our <a href="http://dragoncityfannon.wikia.com/wiki/Dragon_City_Fannon_Wiki">Fannon Wikia</a> is the place for you. '); $('[data-board-namespace="2000"]').prepend('   <img src="http://images.wikia.com/dragoncity/images/d/d7/Navigation2.png" alt="heart">  The topic that you want to post can already exist. Please <a href="http://dragoncity.wikia.com/wiki/Special%3ASearch">navigate</a> arround before you post something.  <img src="http://images.wikia.com/dragoncity/images/d/d7/Navigation2.png" alt="heart">   ');

/* Replaces with the username */ function UserNameReplace { if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return; $("span.insertusername").html(wgUserName); } addOnloadHook(UserNameReplace);

/* Infobox Tab Names */ $('span#tab-overview').append('Overview'); $('span#tab-statistics').append('Statistics'); $('span#tab-earning').append('Earning'); $('span#tab-attacks').append('Attacks'); $('span#tab-damage_calculator').append('Damage Calculator'); $('span#tab-hitpoints').append('Hitpoints'); $('span#tab-breeding').append('Breeding'); $('span#tab-history').append('History'); $('div.mw-customtoggle-myTable').append('Hide/Reveal Content');

//switch tabs links tabName = window.location.hash; $(document).ready(function{ if (tabName == '#tab-overview') {   $('#tab-overview').trigger('click');  }   if (tabName == '#tab-statistics') {   $('#tab-statistics').trigger('click');  }   if (tabName == '#tab-earning') {   $('#tab-earning').trigger('click');  }   if (tabName == '#tab-attacks') {   $('#tab-attacks').trigger('click');  }   if (tabName == '#tab-damage_calculator') {   $('#tab-damage_calculator').trigger('click');  }   if (tabName == '#tab-hitpoints') {   $('#tab-hitpoints').trigger('click');  }   if (tabName == '#tab-breeding') {   $('#tab-breeding').trigger('click');  }   if (tabName == '#tab-history') {   $('#tab-history').trigger('click');  } });

/* Texttip tab switch controller */ //toggle-name $(".toggle-name").click(function { $('#tab-overview').trigger('click'); });

//toggle-habitat-lv (function {  var counth = 0;  $(".toggle-habitat-lv").click(function  { counth += 1; if (counth == 1) { $('#tab-earning').trigger('click'); }   if (counth == 2) { $('#tab-attacks').trigger('click'); }   if (counth == 3) { $('#tab-damage_calculator').trigger('click'); counth = 0 } }); });

//toggle-habitat (function {  var counthb = 0;  $(".toggle-habitat").click(function  { counthb += 1; if (counthb == 1) { $('#tab-damage_calculator').trigger('click'); }   if (counthb == 2) { $('#tab-attacks').trigger('click'); }   if (counthb == 3) { $('#tab-earning').trigger('click'); counthb = 0 } }); });

//toggle-shop $(".toggle-shop").click(function { $('#tab-history').trigger('click'); });

//toggle-breeding&hatching time (function {  var countt = 0;  $(".toggle-time").click(function  { countt += 1; if (countt == 1) { $('#tab-statistics').trigger('click'); }   if (countt == 2) { $('#tab-breeding').trigger('click'); countt = 0 } }); });

//toggle-category (function {  var countc = 0;  $(".toggle-category").click(function  { countc += 1; if (countc == 1) { $('#tab-attacks').trigger('click'); }   if (countc == 2) { $('#tab-damage_calculator').trigger('click'); }   if (countc == 3) { $('#tab-hitpoints').trigger('click'); countc = 0 } }); });

//toggle-generation (function {  var countg = 0;  $(".toggle-generation").click(function  { countg += 1; if (countg == 1) { $('#tab-breeding').trigger('click'); }   if (countg == 2) { $('#tab-statistics').trigger('click'); countg = 0 } }); });

/* Texttip tab switch controller - Lay-out */ $('span.toggle-generation, span.toggle-time').mouseenter(function { $("#tab-breeding, #tab-statistics").addClass("selected").mouseleave(function { $("#tab-breeding, #tab-statistics").removeClass("selected"); }); $('span.toggle-category').mouseenter(function { $("#tab-attacks, #tab-damage_calculator, #tab-hitpoints").addClass("selected"); }); $('span.toggle-category').mouseleave(function { $("#tab-attacks, #tab-damage_calculator, #tab-hitpoints").removeClass("selected"); }); $('span.toggle-name').mouseenter(function { $("#tab-overview").addClass("selected"); }); $('span.toggle-name').mouseleave(function { $("#tab-overview").removeClass("selected"); }); $('span.toggle-shop').mouseenter(function { $("#tab-history").addClass("selected"); }); $('span.toggle-shop').mouseleave(function { $("#tab-history").removeClass("selected"); }); $('span.toggle-habitat, span.toggle-habitat-lv').mouseenter(function { $("#tab-earning, #tab-attacks, #tab-damage_calculator").addClass("selected"); }); $('span.toggle-habitat, span.toggle-habitat-lv').mouseleave(function { $("#tab-earning, #tab-attacks, #tab-damage_calculator").removeClass("selected"); });

/*Alternate Tab Infobox*/ $('.tabBox').append('<style type="text/css">.tabTitle{display:inline-block;background:rgba(192,192,192,.1) !important;background:silver;padding:5px 5px 0;margin:-5px 5px 0;border-radius:100% 100% 0 0/10px 10px 0 0;-webkit-border-radius: 100% 100% 0 0/10px 10px 0 0;cursor:pointer;transition:background .5s;-moz-transition:background .5s;-webkit-transition:background .5s;-o-transition:background .5s}.tabTitle.active{background:rgba(192,192,192,.3) !important;font-weight:bold}.tabTitle:hover{background:rgba(192,192,192,.5) !important} '); $('.tabTitle').click(function{$('.tabTitle').removeClass('active');$(this).addClass('active');}); $('#tab-overview').click(function{$('.tabContent').hide;$('#tab-overview-content').show;}); $('#tab-statistics').click(function{$('.tabContent').hide;$('#tab-statistics-content').show;}); $('#tab-earning').click(function{$('.tabContent').hide;$('#tab-earning-content').show;}); $('#tab-attacks').click(function{$('.tabContent').hide;$('#tab-attacks-content').show;}); $('#tab-damage_calculator').click(function{$('.tabContent').hide;$('#tab-damage_calculator-content').show;}); $('#tab-hitpoints').click(function{$('.tabContent').hide;$('#tab-hitpoints-content').show;}); $('#tab-breeding').click(function{$('.tabContent').hide;$('#tab-breeding-content').show;}); $('#tab-history').click(function{$('.tabContent').hide;$('#tab-history-content').show;}); /* HeaderTabs Link Color Fix*/ $('div').removeClass('jquery-large .ui-widget-content a')

// This tooltip code was written by Pcj var $tfb; // hides the tooltip function hideTip { $tfb.html("").removeClass("tooltip-ready").addClass("hidden").css("visibility","hidden"); } // displays the tooltip function displayTip(e) { $tfb.not(":empty").removeClass("hidden").addClass("tooltip-ready"); moveTip(e); $tfb.not(":empty").css("visibility","visible"); } // moves the tooltip function moveTip(e) { var newTop = e.clientY + ((e.clientY > ($(window).height/2)) ? -($tfb.not(".hidden").innerHeight+20):20); var newLeft = e.clientX + ((e.clientX > ($(window).width/2)) ? -($tfb.not(".hidden").innerWidth+20):20); $tfb.not(".hidden").css({"position":"fixed","top":newTop + "px","left":newLeft + "px"}); } // AJAX tooltips function showTip(e) { $t=$(this); $p=$t.parent; if ($p.hasClass("selflink")==false) { $t.removeAttr("title"); $p.removeAttr("title"); $tfb.load("/"+$t.data("tt").replace(/ /g,"_").replace(/\?/g,"%3F")+"?action=render div.tooltip-content",function { if ($tfb.html == "") $tfb.html(' Error This target either has no tooltip or was not intended to have one. '); $tfb.find(".tooltip-content").css("display",""); displayTip(e); }); } } function bindTT { $t=$(this); $p=$t.parent; if ($p.hasClass("selflink") == false) $t.data("tt", $p.attr("title").replace(" (page does not exist)","").replace("?","%3F")).mouseover(showTip).mouseout(hideTip).mousemove(moveTip); } // check to see if it is active then do it $(function { if(skin=='oasis') { var BC = '#WikiaArticle'; }  else { var BC = '#bodyContent'; }  $(BC).mouseover(hideTip);  $(BC).append(' ');  $tfb = $("#tfb");  $(BC + " span.ajaxttlink").each(bindTT); });

/***********************************OTHER***********************************/ /*Alternate Tab Function - by ShermanTheMythran*/ //relies on Template:Tabs $('.tabBox').append('<style type="text/css">.tabTitle{display:inline-block;background:rgba(192,192,192,.1) !important;background:silver;padding:5px 5px 0;margin:-5px 5px 0;border-radius:100% 100% 0 0/10px 10px 0 0;-webkit-border-radius: 100% 100% 0 0/10px 10px 0 0;cursor:pointer;transition:background .5s;-moz-transition:background .5s;-webkit-transition:background .5s;-o-transition:background .5s}.tabTitle.active{background:rgba(192,192,192,.3) !important;font-weight:bold}.tabTitle:hover{background:rgba(192,192,192,.5) !important} '); $('.tabTitle').click(function{$('.tabTitle').removeClass('active');$(this).addClass('active');}); $('#tab-1').click(function{$('.tabContent').hide;$('#tab-1-content').show;}); $('#tab-2').click(function{$('.tabContent').hide;$('#tab-2-content').show;}); $('#tab-3').click(function{$('.tabContent').hide;$('#tab-3-content').show;}); $('#tab-4').click(function{$('.tabContent').hide;$('#tab-4-content').show;}); $('#tab-5').click(function{$('.tabContent').hide;$('#tab-5-content').show;}); $('#tab-6').click(function{$('.tabContent').hide;$('#tab-6-content').show;}); $('#tab-7').click(function{$('.tabContent').hide;$('#tab-7-content').show;}); $('#tab-8').click(function{$('.tabContent').hide;$('#tab-8-content').show;}); $('#tab-9').click(function{$('.tabContent').hide;$('#tab-9-content').show;}); $('#tab-10').click(function{$('.tabContent').hide;$('#tab-10-content').show;});