User:Sophiedp/global.js

/* Add a clear reason button on Special:Delete */ if (mw.config.get("wgAction") === "delete") { $("#wpReason").after(' ⌫ '); $("#wpClearReason").click(function {       $("#wpReason").val("").focus;    }); }

/* Disable 5 second edit save delay */ GlobalTriggers.bind("WikiaEditorReady", function(point) {   if (point.controls) {        point.controls.editform.off("submit").on("submit", function { point.setState(3); });   } });

/* Standard Edit Summary config */ window.dev = window.dev || {}; window.dev.editSummaries = { select: [ '(click to browse)', [ 'Redlink removal', 'Duplicate image', 'Fixing error(s)', 'Removing vandalism/spam', 'Credit to the Wikia Watchers' ]   ] };

/* Show bot edits on RecentChanges */ if (mw.config.get("wgPageName") == "Special:RecentChanges") { if (window.location.href.indexOf("hidebots=") == -1 && window.location.href.indexOf("?") == -1) { window.location.href = window.location.href + "?hidebots=0"; } else if (window.location.href.indexOf("hidebots=") == -1 && window.location.href.indexOf("?") !== -1) { window.location.href = window.location.href + "&hidebots=0"; } }

/* QuickCreateProfile */ $('', {id: 'qcp'}) .html('Create profile') .prependTo('#my-tools-menu') .click(function {   $.ajax({ type: 'POST', url: mw.util.wikiScript('api'), dataType: 'json', data: { action: 'edit', title: 'User:Sophiedp', summary: 'Creating profile (script)', text: '', format: 'json', token: mw.user.tokens.get('editToken') }   }).done(function (data) { if (data.edit.result === 'Success') { new BannerNotification("Successfully created profile!","confirm").show; } else { new BannerNotification("An error occurred while creating profile.","error").show; }   }).fail(function (data) { new BannerNotification("An error occurred while creating profile.","error").show; }); });

/* QuickCreateMessageWallGreeting */ $.ajax({   type: 'HEAD',    url: mw.config.get("wgServer") + '/wiki/Message_Wall:Sophiedp',    success: function {        $('', {id: 'qcmwg'})        .html('Create Greeting')        .prependTo('#my-tools-menu')        .click(function { $.ajax({           type: 'POST',            url: mw.util.wikiScript('api'),            dataType: 'json',            data: {                action: 'edit',                title: 'Message_Wall_Greeting:Sophiedp', //at this page                summary: 'Creating message wall greeting (script)', //with this edit summary                text: '', //using this template                format: 'json',                token: mw.user.tokens.get('editToken')            }            }).done(function (data) {                if (data.edit.result === 'Success') {                    new BannerNotification("Successfully created message wall greeting!","confirm").show;                } else {                    new BannerNotification("An error occurred creating while message wall greeting.","error").show;            }            }).fail(function (data) {                new BannerNotification("An error occurred while creating message wall greeting.","error").show; });       });    },    error: function { //if it doesn't exist return; //do nothing } });

/* Links to all subpages */ //Add new links $('SU Subpages').insertBefore('.wds-global-navigation__wikis-menu li:last'); $('Global.js').insertBefore('.wds-global-navigation__wikis-menu li:last'); $('Global.css</a></li>').insertBefore('.wds-global-navigation__wikis-menu li:last'); $('<a class="wds-global-navigation__dropdown-link" href="http://starmanw.wikia.com/wiki/User:Sophiedp/common.js">Common.js</a></li>').insertBefore('.wds-global-navigation__wikis-menu li:last'); $('<a class="wds-global-navigation__dropdown-link" href="http://wlb.wikia.com/wiki/User:Sophiedp/availability">WLB</a></li>').insertBefore('.wds-global-navigation__wikis-menu li:last'); //Remove old links $('.wds-list > li:has(a[data-tracking-label="link.explore"])').remove; $('.wds-list > li:has(a[data-tracking-label="link.fandom-university"])').remove; $('.wds-list > li:has(a[data-tracking-label="link.community-central"])').remove; //Change the title of the menu $('.wds-global-navigation__wikis-menu > div > span').text('Links');

/* FastDelete config */ var fdButtons = []; window.fdButtons.push({summary: 'Housekeeping', label: 'HK' });

/* PageCreator config */ window.pageCreatorAvatar = true; window.pageCreatorTimestamp = true; window.pageCreatorNamespaces = Object.keys(mw.config.get("wgFormattedNamespaces")).map(Number);

/* LastEdited config */ window.lastEdited = { namespaces: { include: Object.keys(mw.config.get("wgFormattedNamespaces")).map(Number) } };

/* ViewRemoved config */ window.ViewRemovedAlways = true;

/* Link to report page */ $('', {id:'report'}) .html('<a href="http://steven-universe.wikia.com/wiki/Project:Report/Logs/Index">Report</a>') .prependTo('.toolbar .tools');

/* Link to Special:Maintenance */ $('', {id:'maintenance'}) .html('<a href="/wiki/Special:Maintenance">Maintenance</a>') .prependTo('#my-tools-menu');

/* Link to history */ $('', {id:'history'}) .html('<a href="?action=history">History</a>') .prependTo('.toolbar .tools');

/* Link to subpages */ $('', {id:'subpages'}) .html('<a href="/wiki/Special:PrefixIndex/' + mw.config.get('wgPageName') + '">Subpages</a>') .prependTo('#my-tools-menu');

/* Imports */ importArticles({   type: "script",    articles: [        'u:dev:MediaWiki:AjaxRC/code.js',        'u:dev:MediaWiki:AjaxUndo/code.js',        'u:dev:MediaWiki:FastDelete/code.js',        'u:dev:MediaWiki:CacheCheck/code.js',        'u:dev:MediaWiki:MarkBlocked.js',        'u:dev:MediaWiki:LastEdited/code.js',        'u:dev:MediaWiki:PageCreator/code2.js',        'u:dev:MediaWiki:HoverEditCount/code.js',        'u:dev:MediaWiki:QuickDiff/code.js',        'u:dev:MediaWiki:ViewRemoved/code.js',        'u:dev:MediaWiki:UserAccountAge/code.js',        'u:dev:MediaWiki:ContribsLink/code.js',        'u:dev:MediaWiki:DupImageList/code.js',        'u:dev:MediaWiki:DisplayTimer/code.js',        'u:dev:MediaWiki:DisableCode/code.js',        'u:dev:MediaWiki:CodeQuickLinks/code.js',        'u:dev:MediaWiki:WorkingMoreUsersCount.js',        'u:dev:MediaWiki:WallGreetingButton/code.js',        'u:dev:MediaWiki:OldFilePages/code.js', 'u:dev:MediaWiki:Rollback/code.2.js', 'u:dev:MediaWiki:Standard_Edit_Summary/code.js', 'u:dev:MediaWiki:Thread_Inspection/code.js', 'u:dev:MediaWiki:RecentChangesMultiple/code.2.js', 'u:kocka:User:KockaAdmiralac/UnhideUserMasthead.javascript', 'u:kocka:User:KockaAdmiralac/MastheadGender.javascript', 'u:kocka:MediaWiki:AjaxCommentDelete/code.js', 'u:kocka:MediaWiki:AjaxThreadDelete/code.js', 'u:admintools:MediaWiki:Common.js/Maintenance.js', 'u:noreply:MediaWiki:FileUsage.js' ] });