User:Killr833/global.js

if (skin == 'oasis' && wgDB == 'runescape' && wgPageName == 'RuneScape_Wiki') { void(open('http://' + wgDB + '.wikia.com/wiki/' + encodeURIComponent(wgPageName) + '?useskin=monaco','_self','resizable,location,menubar,toolbar,scrollbars,status')); };

function hideShoutBoxMessagesFromUser(username) { if ($('.WidgetShoutBoxChat li').length > 0) { $('.WidgetShoutBoxChat li').each(function {           var text = this.text;            var regex = new RegExp('\[([12]?\d:[0-5]\d|[123]?\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))\] <' + username + '> .*');                if (text.match(regex)) {                    function nextMatch(jQueryObject) {                        var next = jQueryObject.next;                        var text = next.text;                        var regex = new RegExp('\[([12]?\d:[0-5]\d|[123]?\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))\] ... .*');                           if (text.match(regex)) {                                nextMatch(next);                                next.remove;                            }                    }                    nextMatch($(this));                    var siblings = this.siblings;                    this.remove;                    siblings.each(function { this.removeClass('msgOdd'); this.filter(':nth-child(even)').addClass('msgOdd'); });               }        });    }    window.setTimeout(hideShoutBoxMessagesFromUser(username), 10000); }

function shoutboxAjaxUpdate { var id = $('.WidgetShoutBox').attr('id'); $('#widget_' + id + '_content').html('').addClass('widget_loading'); $.getJSON(wgScript + '?action=ajax&rs=WidgetFrameworkAjax&actionType=configure&id=' + id + '&skin=' + skin + '&message=', function (res) {       if (res.success) {            $('#widget_' + res.id + '_content').removeClass('widget_loading').html(res.body);            if (res.title) {                $('#widget_' + res.id + '_header').html(res.title);            }            $('#widget_' + res.id + '_message').focus;        }    }); }

$(document).ready(function {   if ($('.WidgetShoutBox').length === 1) {        var $img = $('');        $('.WidgetShoutBox .widgetToolbox').append($img);        $('.WidgetShoutBox img.sprite-small.ajaxupdate').click(function { shoutboxAjaxUpdate; });   } });