User:Szynka013/global.js

// ABD batchDeleteDelay = 300;

// AjaxRC window.ajaxPages = ["Special:RecentChanges","Specjalna:Ostatnie_zmiany"]; window.AjaxRCRefreshText = 'Automatyczne odświeżanie'; window.AjaxRCRefreshHoverText = 'Włącza automatyczne odświeżanie strony';

// IMPORTS importArticles({   type: "script",    articles: [        'u:dev:AjaxBatchDelete/code.2.js',                      // AjaxBatchDelete        'u:dev:MediaWiki:AjaxRC/code.js',                       // AjaxRC        'u:dev:MediaWiki:CategoryRenameAuto-update/code.js',    // CategoryRenameAuto-update        'u:dev:ConsistentNotifications.js',                     // ConsistentNotifications        'u:dev:MediaWiki:DisableCode/code.js',                  // DisableCode        'u:dev:MediaWiki:DiscussionsFeed.js',                   // DiscussionsFeed         'u:dev:DiscussionsViewer/code.js',                      // DiscussionsViewer         'u:dev:MediaWiki:FileUsageAuto-update/code.js',         // FileUsageAuto-update        'u:dev:MediaWiki:FindAndReplace/code.js',               // FindAndReplace        'u:dev:MediaWiki:ListFiles/code.js',                    // ListFiles        'u:dev:MediaWiki:MassRenameRevert/code.js',             // MassRenameRevert 'u:dev:MediaWiki:NullEditButton/code.js',              // NullEditButton 'u:dev:MediaWiki:QuickContribs/code.js',               // QuickContribs 'u:dev:MediaWiki:RCStats.js',                          // RCStats 'u:dev:MediaWiki:SearchSuggest/code.js',               // SearchSuggest 'u:dev:MediaWiki:WallGreetingButton/code.js',          // WallGreetingButton 'u:dev:MediaWiki:WHAM/pl/code.2.js',                   // WHAM! 'u:dev:MediaWiki:YouTubeModal/code.js'                 // YouTubeModal ] });

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

// 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; });

/* DODATKOWE PRZYCISKI W EDYTORZE ŹRÓDŁA by Wedkarski if (typeof (mwCustomEditButtons) != 'undefined') { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/szynka013/images/c/c3/Cudzyslow-icon.png/revision/latest?path-prefix=pl", "speedTip": "Wstaw polskie cudzysłowy", "tagOpen": "„", "tagClose": "”", "sampleText": "" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/szynka013/images/b/b1/Polpauza-icon.png/revision/latest?path-prefix=pl", "speedTip": "Wstaw półpauzę", "tagOpen": "–", "tagClose": "", "sampleText": "" }; } */

// INFOBOX BUILDER BLOCKER by Vuh if ($('.template-classification-type-text').data('type') == 'infobox') $('#ca-edit').attr('href', function(a) {return this.href + '&useeditor=source';}) if(window.location.pathname.indexOf('Special:InfoboxBuilder') != -1) {var pname = window.location.pathname.split('Special:InfoboxBuilder/')[1]; location.replace(document.URL.replace(window.location.href.split('/wiki/')[1],'Template:'+pname+'?action=edit&useeditor=source'));}

// Makes the Lua console auto scroll to bottom on textarea focus $(function {   setTimeout(function { $('#mw-scribunto-input').focus(function {           $('#mw-scribunto-output').scrollTop($('#mw-scribunto-output')[0].scrollHeight);        }); }, 5000); });

// LICENSES FILE function emptyLicenseAlert(form) { var msg = "Licencja pliku nie została wybrana. Możesz spróbować ponownie, ale pamiętaj, że pliki bez licencji są usuwane." if(window.emptyLicenseWarningDelivered) return true; if($('#wpLicense').val == '') { alert(msg); window.emptyLicenseWarningDelivered = true return false }	return true; } $('#mw-upload-form').submit(function(e) {return emptyLicenseAlert(this);}); $(".wikia-gallery-item .thumbimage").each(function(i,elem) {		$(elem).attr('title',$(elem).attr('alt'));	}); $(".wikia-gallery-item .image").each(function(i,elem) {		$(elem).attr('title',$(elem).attr('alt')); });

/* ================================================ * 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: ['Baakamono', 'Bartd94', 'Benios912', 'Ciastkoo', 'Damian102', 'DarknessEyes23', 'DeXart', 'Diode24q', 'Duckey Detective', 'Ex q', 'Freshyy', 'Isthealice', 'Kung Führer', 'Light22', 'Lukisiak', 'Luqgreg', 'MaciekP42', 'Matik7', 'Marchewka97', 'MesserWoland', 'Myslec', 'Nanaki', 'Ofkorse', 'OwocekTV', 'Painto', 'Pio387', 'PiotrekD', 'ProOski', 'Rafi862', 'Railfail536', 'RavenZuza', 'Runouw', 'Sandy97', 'Szynka013', 'Tragolipus', 'Vengir', 'Vuh', 'Wedkarski', 'WindMarine12'], 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; });