User:Ultimate Dark Carnage/wikia.js

importArticles({   type: 'style',    articles: [        'User:Ultimate_Dark_Carnage/advancedui.css',        'User:Ultimate_Dark_Carnage/toolbar.css'    ] }/*, {    type: 'script',    articles: [        'u:dev:DoTheHarlemShake/code.js'    ] }*/);

$(document).ready(function{ });

// Add custom module function createModal($title, $modal_html, $config){ if (!$('#' + $config.id)) $('.WikiaSiteWrapper').append(           $(' ')            .addClass('modal-blackout modal-wrapper')            .on( 'click', function(event){ if (!$(event.target).is('.modal-body, .modal-body *')){ $close_modal($('.modal-wrapper').attr('id'), function(modal){                           return this;                        }); }               }            )            .html( $(' ')               .addClass('modal-body _modal') .attr({ 'id': $config.id || 'custom-modal-body', 'data-title': $title }) .html(function{                   var $header =                         $(' ')                        .addClass('modal-header')                        .html([ $(' ').text($title), $('') .attr('href', '#') .attr('id', 'close-modal') .addClass('close-modal') .text('✕') .on('click', function(event){                               $close_modal($('.modal-wrapper').attr('id'), function(modal){ return this; });                           })                        ]),                        $content =                            $(' ')                            .addClass('modal-content')                            .html($modal_html || 'Test'),                        $footer =                            $(' ')                            .addClass('modal-footer right')                        .   html(function{ var $buttons = $config.buttons, buttons = [], def_func = function(modal){ return this; };                               for (var btn in $buttons){ var $b = $('') .addClass('modal-button' + (($buttons[btn].classNames.length) ? ' ' + $buttons[btn].classNames.join(' ') : '')) .attr('id', $buttons[btn].id) .text(btn) .on('click', $close_modal($('.modal-wrapper').attr('id'), $buttons[btn].action || def_func)); buttons[buttons.length] = $b; }                               return buttons; });                   return [$header, $content, $footer];                }) )       );    var $close_modal = $close_modal || function(id, action){ var $modal = null; if (!jQuery) $modal = document.getElementById(id); else $modal = $('#' + id); if (!jQuery){ if ($modal.className.indexOf('modal-wrapper') > -1){ var parent = $modal.parentElement || $modal.parentNode; parent.removeChild($modal); } else return false; } else { if ($modal.hasClass('modal-wrapper')){ $modal.remove; }       }        if (action instanceof Function) Function.prototype.apply.call(action, window, [$modal]); }; }

(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}';        var addZero = 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': case 'Netscape': browserName = 'Internet Explorer'; break; case 'Firefox': browserName = 'Mozilla Firefox'; break; case 'Chrome': browserName = 'Google Chrome'; break; default: browserName = name; }       return browserName; } } function getBrowserVersion(value){ value = Number(value.split('.')[0]); if (!isNaN(value)){ return value; } else { return NaN; } } var browser = getBrowserName(navigator.info[0]), version = getBrowserVersion(navigator.info[1]); console.log('You are currently using ' + browser + ' ' + version + '!');