User:DuckeyD/common.js

//Scrolls Games left and right $('.CarouselArrowLeft').parent("td").on('click',function {    scroll = $('#FlagCarousel').scrollLeft;    $('#FlagCarousel').animate({'scrollLeft': scroll-540},1000); }); $('.CarouselArrowRight').parent("td").on('click',function {    scroll = $('#FlagCarousel').scrollLeft;    $('#FlagCarousel').animate({'scrollLeft': scroll+540},1000); }); //Opens and closes community links $('#communitytitle').click(function{   if (timerTime > 0) {        jQuery.noop;    } else {        if ($('#communitylinks').hasClass('closed')) {            $('#communitylinks').removeClass('closed').addClass('opened').animate({ height: "100%" }, 1000).css('padding-top','5px');            $('#communitytitle').text('Collapse Community Links');            timerTime = 500        } else if ($('#communitylinks').hasClass('opened')) {            $('#communitylinks').removeClass('opened').addClass('closed').animate({ height: "0px" }, 1000).css('padding-top','0px');            $('#communitytitle').text('More Community Links');            timerTime = 500        }    } }); (function (rollbacks) {  if (!rollbacks.length) return;   if ('view' !== ($.getUrlVar('action') || 'view')) return;   var rRegex = [];   for (var i = 0; i < rollbacks.length; i ++)      rRegex.push(rollbacks[i].replace(/[\[\]{}*+?.,\\^$|#\s-]/g, "\\$&"));   rRegex = (rRegex.length ? rRegex.join('|') : 0);  function addClassToProfilePage {      if (rRegex) {         var regex = new RegExp('(?:' + rRegex + ')(?:/|$)', 'i');         if (regex.test(wgTitle))            $('.masthead-avatar').addClass('rollback');      }   }   $(function { if ($('#UserProfileMasthead').length) addClassToProfilePage; }); }(rollbacks));