User:You are my strange addiction/global.js

window.fdButtons = []; window.fdButtons.push(   {        summary: 'Nieużywany plik',        label: 'NU'    },    {        summary: 'Niepotrzebna strona',        label: 'NP'    },    {        summary: 'Naruszenie praw autorskich',        label: 'NPA'    },    {        summary: 'Wandalizm',        label: 'V'    },    {        summary: 'Spam',        label: 'S'    },    {        summary: 'Brak licencji',        label: 'BL'    },    {        summary: 'Zbędne przekierowanie',        label: 'ZP'    },    {        summary: 'Niedziałający film',        label: 'F'    } ); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',        'u:dev:MediaWiki:MassNullEdit/code.js',        'u:dev:MediaWiki:MassCategorization/code.js',        'u:dev:MediaWiki:UserActivityLink.js',        'u:dev:MediaWiki:MassEdit/code.js',        'u:dev:MediaWiki:QuickIW/code.js',        'u:dev:MediaWiki:FastDelete/code.js',        'u:dev:MediaWiki:MassRename/code.js',        'u:dev:MediaWiki:YouShallNotPass/code.js',        'u:dev:MediaWiki:WHAM/code.2.js',    ] });

// DODATKOWE PRZYCISKI W GLOBALNEJ NAWIGACJI I NAGŁÓWKU by Nanaki $(function {   $('.wds-community-header__wiki-buttons a[data-tracking="wiki-activity"]').attr({href: '/wiki/Special:RecentChanges', title: 'Ostatnie zmiany', 'data-tracking': 'recent-changes'});    $('.wds-community-header__wiki-buttons .wds-dropdown__content .wds-list.wds-is-linked li > a[data-tracking="more-recent-changes"]').remove; });

// DUCKEY RULEZ mw.hook('rcstats.link').add(function (data) {   data.elem.insertAfter($('.wiki-button-add-video').parent).find('a').text('Statystyki') })

/* ================================================ * Sprawdzanie urodzin by User:Duckey Detective * ================================================ * * Opis: * Powiadamia Cię o urodzinach użytkownika z ustalonej listy. * * Instalacja: * 1. Skopiuj kod do twojego /wikia.js lub /global.js * 2. Edytuj bday.users, tak aby zawierał osoby, o których urodzinach chcesz dostać przypomnienie (w tym Twoje) * 3. Ustaw bday.debug na false, jeżeli irytują Cię wiadomości w konsoli * * Uwaga: * Skrypt korzysta z localStorage, a co za tym idzie zapisuje dane lokalnie * * Specjalne podziękowania dla: Szynka013 * Psst! DUCKEY RULEZ!!! */ var bday = { users: ['NoxiVentus', 'Elementalist Mateuszlu1!', 'Akodone', 'Miti37', 'You are my strange addiction'], debug: true, init: function init { bday.log('Initializing'); if (typeof Storage === "undefined") { bday.log('localStorage isn\'t supported by your browser', 'error'); return; }   var userName = mw.config.get('wgUserName'); var d = new Date; var storage = JSON.parse(localStorage.getItem('bday')); var today = d.getFullYear + '-' + (d.getMonth + 1) + '-' + d.getDate; bday.log('userName: ' + userName); bday.log('today: ' + today); if (storage === null || !storage[today]) { bday.log('No checks today'); var obj = {}; obj[today] = true; localStorage.setItem('bday', JSON.stringify(obj)); new mw.Api.get({       action: 'query',        list: 'users',        ususers: bday.users.join('|')      }).done(function (data) {        bday.log('Users id obtained');        var _loop = function _loop {          if (_isArray) {            if (_i >= _iterator.length) return 'break';            _ref = _iterator[_i++];          } else {            _i = _iterator.next;            if (_i.done) return 'break';            _ref = _i.value;          }          var user = _ref;          $.ajax({ url: 'https://services.wikia.com/user-attribute/user/' + user.userid }).done(function (data) { for (var _iterator2 = data._embedded.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator];;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next; if (_i2.done) break; _ref2 = _i2.value; }             var prop = _ref2; if (prop.name === 'UserProfilePagesV3_birthday') { bday.log('birthday found: ' + prop.value + ' - ' + user.name); if (prop.value === d.getMonth + 1 + '-' + d.getDate) { bday.log(user.name + '\'s birthday'); var message = user.name === userName ? 'Wszystkiego najlepszego!' : user.name + ' ma dziś urodziny!'; if ($('#WikiaNotifications').length === 0) { bday.log('creating WikiaNotifications'); $('#WikiaBarWrapper').append(' ' + message + ' '); } else { bday.log('WikiaNotifications exists'); $('#WikiaNotifications').append(' ' + message + ' '); }               }              }            }          }).fail(function  { bday.log('Couldn\'t get user data', 'error'); });       };        for (var _iterator = data.query.users, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator];;) {         var _ref;          var _ret = _loop;          if (_ret === 'break') break;        }      }); } else { bday.log('Already checked today. Aborting', 'warn'); } },  refresh: function refresh { bday.log('Refreshing', 'warn'); localStorage.removeItem('bday'); bday.log('localStorage cleared'); bday.init; }, log: function log(msg) { var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'log'; if (bday.debug === true) { var prefixed = 'BDAY: ' + msg + '.'; switch (type) { case 'log': console.log(prefixed); break; case 'warn': console.warn(prefixed); break; case 'error': console.error(prefixed); break; default: console.log(prefixed); break; }   }  } }; mw.loader.using('mediawiki.api').then(function  {  bday.init; });