User:Ultimate Dark Carnage/wikia.js

(function($, mw){   if (mw.config.get('skin') == "oasis" || mw.config.get('skin') == "wikia" || mw.config.get('skin') == "venus"){        // Add clock to global navigation        var clock_style =             '.clock-container {' +                '\npadding-left: 10px;' +                 '\n}' +             '\n.clock-container .clock {' +                 '\ncolor: black;' +            '\n}';        function addZero(i){            if (i < 10) i = "0" + i;            return i;        }        if ($('.global-navigation').length && !$('.clock-container').length){            $('.global-navigation > .global-navigation-container').append($(' ', {                "class": "clock-container table-cell",                html: ''            }));            $('head').append('' + clock_style + ' ');            setInterval(function{ var d;               if (new Date){ d = new Date; $('.clock-container .clock').html(addZero(d.getHours) + ':' + addZero(d.getMinutes) + ':' + addZero(d.getSeconds)); }           }, 1000);        }        // Add username to global navigation        if (mw.config.get('wgUserName')){            $('.global-navigation a[data-id="userpage"]').append(function{ if (!$('.global-navigation a[data-id="userpage"] > span.user-name').length){ return $(' ', {                       "class": "user-name",                        "data-user": mw.config.get('wgUserName'),                        text: mw.config.get('wgUserName')                    }); }           });        }    } })(jQuery, mediaWiki);

navigator.info = (function{   var N = navigator.appName,        ua = navigator.userAgent,         tem,        M = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);    if (M && (tem = ua.match(/version\/([\.\d]+)/i))!== null) M[2] = tem[1];    M = M? [M[1], M[2]] : [N, navigator.appVersion, '-?'];    return M; }); function getBrowserName(name){ var browserName; if (name){ switch (name){ case 'MSIE': browserName = 'Internet Explorer'; break; case 'Firefox': browserName = 'Mozilla Firefox'; break; case 'Chrome': browserName = 'Google Chrome'; break; default: browserName = name; }       return browserName; } } function getBrowserVersion(value){ var v;   if (v > -1){ v = parseInt(value, 10); return v;   } } var browser = getBrowserName(navigator.info[0]), version = getBrowserVersion(navigator.info[1]); console.log('You are currently using ' + browser + ' ' + version + '!');