User:Szynka013/global.js

// Imports importScriptPage('MediaWiki:PortableCSSPad/code.js', 'dev');           // PortableCSSPad importScriptPage('MediaWiki:WHAM/pl/code.2.js', 'dev');                // WHAM! importScriptPage('User:Wedkarski/chatpack.js', 'wed');                 // ChatPack importScriptPage('user:Szynka013/chatpackExtended.js', 'szynka');      // ChatPackExtended importScriptPage('User:Wedkarski/SpongeKiller.js', 'wed');             // SpongeKiller importScriptPage('User:Joeytje50/ChatPMs.js', 'c');                    // MultiPriv importScriptPage('User:PlasmaTime/quickBlock.js','c');                 // QuickBlock importScriptPage('MediaWiki:MassRenameRevert/code.js', 'dev');         // MassRenameRevert importScriptPage('MediaWiki:Wikia Essentials/code.js', 'dev');         // Wikia_Essentials importScriptPage('MediaWiki:NullEditButton/code.js', 'dev');           // NullEditButton importScriptPage("MediaWiki:FileUsageAuto-update/code.js", "dev");     // FileUsageAuto-update importScriptPage("MediaWiki:QuickContribs/code.js", "dev");            // QuickContribs importScriptPage('MediaWiki:ViewRemoved/code.js', 'dev');              // ViewRemoved importScriptPage('MediaWiki:ReplyBottom/code.js', 'dev');              // ReplyBottom importScriptPage('MediaWiki:ListFiles/code.js', 'dev');                // ListFiles importScriptPage('MediaWiki:SearchSuggest/code.js', 'dev');            // SearchSuggest importScriptPage('MediaWiki:FindAndReplace/code.js', 'dev');           // FindAndReplace importScriptPage('MediaWiki:Interwiki.js', 'community');               // Interwiki importScriptPage('YouTubeModal/code.js', 'dev');                       // YouTubeModal importScriptPage('MediaWiki:PrivateMessageAlert/code.js', 'dev');      // PrivateMessageAlert importScriptPage('MediaWiki:DiscussionsFeed.js', 'dev');               // DiscussionsFeed importScriptPage('MediaWiki:ChatUserPageButton.js', 'dev');            // ChatUserPageButton importScriptPage('MediaWiki:QuickCreateUserPage.js', 'dev');           // QuickCreateUserPage importScriptPage('MediaWiki:Linksweeper/code.js', 'dev');              // Linksweeper importScriptPage('MediaWiki:DisableCode/code.js', 'dev');              // DisableCode // importScriptPage('MediaWiki:NotesModule/code.js', 'dev');              // NotesModule

// BUTTON MESSAGE WALL GREETING function AddNavigationLinks { $('Nagłówek tablicy').insertAfter($('.wds-global-navigation__user-menu li a[data-tracking-label="account.preferences"]').parent); } addOnloadHook(AddNavigationLinks);

// ABD batchDeleteDelay = 300; importArticles({   type: "script",    articles: [        'u:dev:AjaxBatchDelete/code.2.js'    ] });

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

// ChangeSkins window.monoBookText = "Monobook"; window.oasisText = "Oasis"; window.venusText = "Venus"; window.mobileText = "Mobile"; importScriptPage('MediaWiki:SkinSwitchButton/code.js', 'dev');

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

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



//SNIPPETS NEW NAV 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'}); });

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

/* ================================================ * 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 */ 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', 'Pirr', '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; });

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