User:ThundercraftBot/global.js

// Quick Comment Delete Config window.AjaxCommentDeleteConfig = { fastDelete: "Comment Was #|Off Topic/Spam/Vandalism" };

// Batch Delete Script Config window.batchDeleteDelay = 5; window.batchUnDeleteDelay = 5; // Mass Edit Config window.MassEditConfig = { interval: 10, placement: { element: "toolbar", type: "append" } }; // STD summaries window.dev = window.dev || {}; window.dev.editSummaries = { css: '#stdSummaries { ... }',   select: [ '(click to browse)', 'Quick', [ 'Formatting', 'Removing vandalism', 'Fixing error(s)', 'Corrected spelling/grammar', 'Corrected formatting/layout' ],       'General', [ 'Added/removed/corrected link(s)', 'Cleanup', 'HTML/Source mode cleanup', 'Expanded', 'Grammar', 'Punctuation', 'Redlink removal', 'Refactoring', 'Re-ordering/re-organizing', 'Revised', 'Spelling correction', 'Style/layout', 'Netural point of view (NPOV)', 'Tidying', 'Updating', 'Wikifying', 'Added/removed/corrected template(s)', 'Adding new features', 'Testing new features', 'Making source code look better', ],       'Templates', [ 'Parser function modification', 'Fixing template bugs', 'Creating documentation subpage', 'Magic word correction/modification', ],       'Advanced code', [ 'Logic cleanup/Optimiziation', 'Function cleanup', 'Adding comments', 'Fixing errors/bugs', 'Removing deprecated features', 'Minor changes', ],       'Removal/Reversion', [ 'Reverted Spam/Vandalism', 'Reverted test edit', 'Reverted Copy vio\'' ],       'Categories', [ 'Added category(ies)', 'Alphabetised category(ies)', 'Creating Category page', 'Modified category(ies)', ],   ], };

// AjaxRC window.ajaxRefresh = 30000; window.ajaxPages = [ "Special:RecentChanges", "Special:WikiActivity", "Special:Watchlist", "Special:Log", "Special:Contributions", "Special:AbuseLog", ]; $.extend(true, window, {dev: {i18n: {overrides: {AjaxRC: {   'ajaxrc-refresh-text': 'Auto Refresh',    'ajaxrc-refresh-hover': 'Enable automatically refreshing of this page', }}}}});

//MassBlock delay window.massBlockDelay = 5; // AjaxBlock Config window.AjaxBlock = { blockReasons: { 'Spam/Vandalism': 'General Spam/Vandalism', 'Disruptive Editing':'Disruptive Editing', 'Removing Content From Pages': 'Removing Content form Pages', 'Abusing Multiple Accouts (Sockpuppetry)': 'Sockpuppety', 'Vandalism-Only Account': 'VoA Account', 'Inserting False Information': 'Inserting False Information', 'Creating Nonsense/Vandalism Articles': 'Creating Spam Articles', 'Unacceptable username': 'Unacceptable Username', 'Long-Term Abuse': 'Long-Term Abuse', 'Spamming Nonsense Comments': 'Nonsense Comments', 'Inserting nonsense/gibberish into pages': 'Inserting nonsense/gibberish into pages', 'Spamming Links to External Sites': 'External Link Spam', 'Personal Attacks': 'Personal Attacks', 'Intimidating Behavior/Harassment': 'Intimidating Behavior/Harassment', 'Edit Warring': 'Edit Warring', 'Intimidating/Harrasing Comments': 'Intimidating/Harrasing Comments', 'Open Proxy/VPN': "Open Proxy/VPN", },   expiryTimes: { '24 hours': '1 day', '3 days': '3 days', '1 week': '1 week', '2 weeks': '2 weeks', '3 weeks': '3 weeks', '1 month': '1 month', '6 weeks': '6 weeks', '2 months': '2 months', '3 months': '3 months', '4 months': '4 months', '6 months': '6 months', '9 months': '9 months', '1 year': '1 year', '18 months': '18 months', '3 years': '3 years', 'infinite': 'all of eternity', },   check: { talk: true, autoBlock: true, override: true }, }; // AjaxDelete Config window.AjaxDelete = { deleteReasons: { 'Spam/Vandalism': 'Spam/Vandalism', 'Marked for Deletion': 'MfD', 'Empty Article': 'Empty', 'Author request': 'Author request', 'Irrelevant to The Wiki': 'Irrelevant', 'Housekeeping': 'Housekeeping', 'Spam/Vandalism Article': 'Spam Article', 'Deprecated/Unused': 'Deprecated/Unused', 'Personal Attack article': 'PAA', 'Disinformation/Hoax': 'Disinformation/Hoax', 'Broken Redirect': 'Broken Redirect', 'Unused Redirect': 'Unused redirect', 'Redirect left from pagemove': 'Page Move redirect', },   imageDeleteReasons: { 'Offensive Image': 'Offensive', 'Inappropriate Image': 'Inappropriate', 'Harassment-Only image': 'Harassment', 'Housekeeping': 'Housekeeping', 'Copyright infringement': 'Copyright', 'Author request': 'Author request', 'Duplicate/Superseded File': 'Duplicate/Superseded', 'Improper Image format': 'Improper Format', 'Spam/Vandalism': 'Spam/Vandalism', },   autoCheckWatch: true, noUndelete: false, reload: false, };

//Nuke Config window.nukeDelay = 5; //WHAM tool config window.WHAMBlockReason = "vandalism"; window.WHAMDelay = 5; window.WHAMBlockDuration = '3 months'; window.WHAMDeleteReason = "deleting spam/vandalism";

//AutoRenamePages Config window.PRAoptions = { editSummary: 'Updating page links (automatic)' }; // Mass Rename Pages Config window.massRenameDelay = 25; //ThreadDelete config window.AjaxThreadDeleteConfig = { fastDelete: false, reason: 'Thread/Comment Deleted: The Thread/Comment Has Containted the Following: Spam / Vandalism / #|Roasting/Heated Arguments' }; //MassProtect Delay window.massProtectDelay = 5; //MassUndelete delay window.batchUndeleteDelay = 5;

LIRoptions = { bottomMessage: '', editSummary: 'Updating file links (automatic)', singleButtonText: 'Rename and update', queueButtonText: 'Add to queue', delay: 10 }; // Global userpage window.AutoCreateUserPagesConfig = { content:{ 2:,       3:,        1202:''    },    summary: 'Creating userpage(es)', };

// Edit Conflict alert check window.EditConflictAlertInterval = 15000;

// DeleteUserpage config window.delUserpage = { doProtect: true, };

// AnchoredRollback window.anchoredRollbackBot = true;

//================================ // GlobalNavButtons //================================= window.globalNavButtons = [ //=================================== // Community Centeral //=================================== // Main Button {   text: 'Community', url: 'https://community.fandom.com', isMain: true, whoIsMain: false, shortName: 'C' }, // New users Log (Anti-spam) {   text: 'New users log', url: 'https://community.fandom.com/wiki/Special:Log/newusers', isMain: false, whoIsMain: 'C', shortName: 'NU' }, // User avatar Log (Anti-spam) {   text: 'User Avatar Log log', url: 'https://community.fandom.com/wiki/Special:Log/useravatar', isMain: false, whoIsMain: 'C', shortName: 'AVL' }, // Recent Changes {   text: 'Recent Activity log', url: 'https://community.fandom.com/wiki/Special:RecentChanges?hidelogs=1&namespace=2&days=1', isMain: false, whoIsMain: 'C', shortName: 'RA' }, // Abuse Log (Anti-spam) {   text: 'Abuse Log', url: 'https://community.fandom.com/wiki/Special:AbuseLog?limit=500', isMain: false, whoIsMain: 'C', shortName: 'AL' }, // Wikis Log {   text: 'Wikis log', url: 'https://community.fandom.com/wiki/Special:Newwikis', isMain: false, whoIsMain: 'C', shortName: 'WL' }, //===================================  // SOAP (for Reports) //================================== // Main Button {   text: 'SOAP', url: 'https://soap.fandom.com', isMain: true, whoIsMain: false, shortName: 'S' }, // Profiles {   text: 'Profiles', url: 'https://soap.fandom.com/wiki/Report:User_profile_headers', isMain: false, whoIsMain: 'S', shortName: 'R:P' }, // Spam {   text: 'Spam', url: 'https://soap.fandom.com/wiki/Report:Spam', isMain: false, whoIsMain: 'S', shortName: 'R:S' }, {    text: 'Vandalism', url: 'https://soap.fandom.com/wiki/Report:Vandalism', isMain: false, whoIsMain: 'S', shortName: 'R:V' }, {    text: 'Wiki', url: 'https://soap.fandom.com/wiki/Report:Wiki', isMain: false, whoIsMain: 'S', shortName: 'R:W' }, {    text: 'Biglist', url: 'https://soap.fandom.com/wiki/Report:Spam/Biglist', isMain: false, whoIsMain: 'S', shortName: 'R:BL' }, //=========================================  // Wikis (Personal) //======================================== // Main Button {   text: 'Wikis', url: '#', isMain: true, whoIsMain: false, shortName: 'W' }, // Hypixel SkyBlock Wiki {   text: 'Hypixel SkyBlock Wiki', url: 'https://hypixel-skyblock.fandom.com/wiki/Special:RecentChanges', isMain: false, whoIsMain: 'W', shortName: 'HSW' }, // Minecraft Wiki {   text: 'Minecraft', url: 'https://minecraft.fandom.com/wiki/Special:RecentChanges', isMain: false, whoIsMain: 'W', shortName: 'MCW' }, // Hypixel SkyBlock Korean Wiki {   text: 'Hypixel SkyBlock Korean Wiki', url: 'https://hypixel-skyblock.fandom.com/ko/wiki/Special:RecentChanges', isMain: false, whoIsMain: 'W', shortName: 'HSKW' }, // Community Centeral {   text: 'Community Centeral', url: 'https://community.fandom.com/wiki/Special:RecentChanges', isMain: false, whoIsMain: 'W', shortName: 'CC' }, //=========================================  // Hypixel SkyBlock wiki Stuff //======================================== // Main Button {   text: 'HSW', url: 'https://hypixel-skyblock.fandom.com/wiki/', isMain: true, whoIsMain: false, shortName: 'HSWDR' }, // Recent Changes {   text: 'Recent Changes', url: 'https://hypixel-skyblock.fandom.com/wiki/Special:RecentChanges', isMain: false, whoIsMain: 'HSWDR', shortName: 'HSWRC' }, // Logs {   text: 'All Logs', url: 'https://hypixel-skyblock.fandom.com/wiki/Special:Log', isMain: false, whoIsMain: 'HSWDR', shortName: 'HSWL' }, // Block List {   text: 'Block List', url: 'https://hypixel-skyblock.fandom.com/wiki/Special:BlockList', isMain: false, whoIsMain: 'HSWDR', shortName: 'HSWBL' }, // Abuse Log {   text: 'Abuse Log', url: 'https://hypixel-skyblock.fandom.com/wiki/Special:AbuseLog', isMain: false, whoIsMain: 'HSWDR', shortName: 'HSWAL' }, ];

//Ignore all announcements window.announcementsIgnore = { option: 'opt-out-all', exceptWikiIds: [], };

window.ajaxAbuseLog = {}; config = window.ajaxAbuseLog || {}; var userGroups = mw.config.get('wgUserGroups');
 * (function($, mw) {

function logMsg(msg) { console.log('[AjaxAbuseLog V0.2] [LOG]:', msg); }   if (!/sysop|util|staff|helper|global-discussions-moderator|wiki-manager|soap/.test(userGroups.join('\n')) ||        config.init    ) { logMsg('Script Double loaded, or user rights requirements not met, skipping import.'); return; }   config.init = true;

var pagePathname = mw.config.get('wgArticlePath').replace('$1', '');

mw.util.addCSS('.mw-abuselog-details { width: 100% !important; } .qdmodal { width: 100% !important; height: 100% !important }');

function entryExists(entry) { return new mw.Api.post({           "action": "query",            "format": "json",            "list": "abuselog",            "afllimit": "1",            "afllogid": Number(entry),        }).then(function(afData) {            return !(afData.query.abuselog[0].id < Number(entry))        }); }

function main(e) { if (e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) { logMsg('Key to prevent modal has been pressed, exiting...'); return; }

var id = Number($(this).attr('href').match(/Special:AbuseLog\/(\d{1,})/)[1]); e.preventDefault; $.ajax({           cache: true,            dataType: "script",            url: "https://dev.fandom.com/load.php?mode=articles&only=scripts&articles=MediaWiki:QDmodal.js"        }).done(function {            var myModal = new mw.libs.QDmodal("ajax-abuselog-modal");            $('.qdmodal-container').remove;            myModal                .show({ content: $(' ', {                       css: {                            'text-align': 'center',                        },                        html: $(' ', { src: 'https://vignette.wikia.nocookie.net/dev/images/c/c5/Circle_throbber.gif/revision/latest?cb=20170831081511', size: '32px', 'padding-top': '25%', css: { margin: 'auto', },                       }),                    }),                    title: "Abuse log details for entry " + id, buttons: [{ text: "Open link", href: "https://hypixel-skyblock.fandom.com/wiki/Special:AbuseLog/" + id, }]               });

logMsg('Successfully showed the modal!');

$.get('https://hypixel-skyblock.fandom.com/wiki/Special:AbuseLog/' + id).done(function(data) {               var $content = $(' ', { html: $(data) .children('#WikiaPage') .children('.WikiaPageContentWrapper') .children('#WikiaMainContent') .children('#WikiaMainContentContainer') .children('#WikiaArticle') .children('#mw-content-text') .children('fieldset') .html, });

logMsg('Successfully fetched abuselog HTML!');

$content.children('legend').remove;

entryExists(id + 1).then(function(exists) {

$content.children('table.diff').before(                       $(' ', { style: "margin-top: 2em", html: [!((id - 1) <= 0) ? $('', {                                   html: "← Older Entry",                                    href: pagePathname + 'Special:AbuseLog/' + (id - 1),                                    title: 'Special:AbuseLog/' + (id - 1),                                    click: main,                                    style: "float: left; padding-left: 25%;",                                }) : "", exists ? $('', {                                   html: "Newer Entry →",                                    href: pagePathname + 'Special:AbuseLog/' + (id + 1),                                    title: 'Special:AbuseLog/' + (id + 1),                                    click: main,                                    style: "float: right; padding-right: 25%;",                                }) : "", ]                       })                    );                }).then(function { $content.children('h3').css('border-bottom', '1px solid #5e484a'); $('div#ajax-abuselog-modal > section').html($content); });           });        });    }

mw.loader.load(['mediawiki.action.history.diff', "mediawiki.diff.styles", 'skin.oasis.diff.runtimeStyles']); mw.loader.load('ext.abuseFilter'); $(document.body).on("click", "a[href^=\"/wiki/Special:AbuseLog/\"]", main); logMsg('Successfully added click event handlers!');

})(jQuery, mediaWiki);

/*=============================================== *Imports *=============================================== importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxDelete/code.js',        'u:dev:MediaWiki:AjaxBatchDelete.js',        'u:dev:MediaWiki:MassPatrol/code.js',        'u:dev:MediaWiki:AjaxThreadDelete/code.js',        'u:dev:MediaWiki:MassProtect/code.js',        'u:dev:MediaWiki:QuickCreateUserPage/code.js',        'u:dev:MediaWiki:FastOldImageDelete/code.js',        'u:dev:MediaWiki:MassRollback.js',        'u:dev:MediaWiki:AdminDashboard block/code.js',        'u:dev:MediaWiki:AddArticleToCategory/code.js',        'u:dev:MediaWiki:AdminDashboard JS-Button/code.js',        'u:dev:MediaWiki:AjaxPatrol/code.js',        'u:dev:MediaWiki:PurgeButton/code.js',        'u:dev:MediaWiki:AjaxBatchUndelete.js',        'u:dev:MediaWiki:MassRename/code.js',        'u:dev:MediaWiki:MassRedirect/code.1.js',        'u:dev:MediaWiki:MassBlock/code.js', 'u:dev:MediaWiki:ViewDeleted/code.js', 'u:dev:MediaWiki:RefreshThreads/code.js', 'u:dev:MediaWiki:AjaxUserRights.js', 'u:dev:MediaWiki:CommentPreview/code.js', 'u:dev:MediaWiki:MessageWallImprovements.js', 'u:dev:MediaWiki:CodeEditor.js', 'u:dev:MediaWiki:QuickToolsv2/code.js', 'u:dev:MediaWiki:QuickDiff/code.js', 'u:dev:MediaWiki:AjaxRC.js', 'u:dev:MediaWiki:SearchEnhancements.js', 'u:dev:MediaWiki:MassCategorization/code.js', 'u:dev:MediaWiki:GlobalEditcount/code.js', 'u:dev:MediaWiki:FindAndReplace/code.js', 'u:dev:MediaWiki:AjaxCommentDelete/code.js', 'u:dev:MediaWiki:DupImageList/code.js', 'u:dev:MediaWiki:TemplateTypeButtons/code.js', 'u:dev:MediaWiki:MultipleFileDelete/code.js', 'u:dev:MediaWiki:AnchoredRollback/code.js', 'u:dev:MediaWiki:MassRenameRevert/code.js', 'u:dev:MediaWiki:AjaxUndo/code.js', 'u:dev:MediaWiki:CodeLinksDropdown.js', 'u:dev:MediaWiki:Rollback/code.js', 'u:dev:MediaWiki:FileUsageAuto-update/code.js', 'u:dev:MediaWiki:RevealAnonIP/usercode.js', 'u:dev:MediaWiki:VanguardTools.js', 'u:dev:MediaWiki:EditConflictAlert/code.js', 'u:dev:MediaWiki:NullEditButton/code.js', 'u:dev:MediaWiki:MassNullEdit/code.js', 'u:dev:MediaWiki:Standard_Edit_Summary/code.js', 'u:dev:MediaWiki:AutoCreateUserPages.js', 'u:dev:MediaWiki:AllPagesHideRedirect/code.js', 'u:dev:MediaWiki:JWB/load.js', 'u:dev:MediaWiki:GlobalNavButtons.js', 'u:dev:MediaWiki:RedirectManagement/code.js', 'u:dev:MediaWiki:AnnouncementsIgnore.js', 'u:dev:MediaWiki:EditBio/code.js', 'u:dev:MediaWiki:LinkToDiscussionsProfileIfTheyDontHaveLivePosts/code.js', //'u:dev:MediaWiki:AjaxAbuseLog.js',

//Personal Imports 'url:community.fandom.com:User:Thundercraft5/global.js/WHAM-custom.javascript', 'url:community.fandom.com:User:Thundercraft5/global.js/AjaxBlock-custom.javascript', 'url:community.fandom.com:User:Thundercraft5/global.js/MoreDropdown.javascript', 'url:community.fandom.com:User:Thundercraft5/global.js/PowerDelete-custom.javascript', 'url:community.fandom.com:User:Thundercraft5/global.js/AjaxRedirect-custom.javascript', 'url:community.fandom.com:User:Thundercraft5/global.js/DeleteUserpage.javascript', 'url:community.fandom.com:User:Thundercraft5/global.js/UserAndIPtools.javascript', 'url:community.fandom.com:User:Thundercraft5/global.js/Nuke-Custom.javascript', 'url:community.fandom.com:User:Thundercraft5/global.js/EditHelper.javascript',

] });