User:Shodai Tsuchi/scripts.js

// Imports Scripts importArticles({   type: 'script',    articles: [    'u:dev:PortableCSSPad/code.js',    'u:dev:LastEdited/code.js',    'u:dev:CacheCheck/code.js',    'w:c:wikimarks:Client.js',    'u:dev:AjaxBatchDelete/code.2.js',    'u:dev:View_Source/code.js',    'u:dev:PurgeButton/code.js',    'u:dev:Message/code.js',    'u:dev:AutoEditDropdown/code.js',    'u:dev:Quick_Management/code.js',    'u:dev:QuickDiff/code.js',    'u:dev:CategoryRenameAuto-update/code.js',    'u:dev:AjaxRC/code.js',    'u:dev:AjaxUndo/code.js',    'u:kiddo:User:Shodai_Tsuchi/buttons.js',    'u:dev:QuickContribs/code.js',     'u:dev:WHAM/code.js',    'u:dev:QuickToolsv2/code.js',     'u:dev:QuickTemplate/code.js',    'u:dev:NullEditButton/code.js',    'u:dev:RevealAnonIP/usercode.js',    'u:dev:NoImageLightbox/code.js',    'u:dev:MassNullEdit/code.js',    'u:dev:DisplayTimer/code.js',    'u:c:User:Ozuzanna/nuke.js',    'u:dev:RecentChangesMultiple/code.js', ] });

// AJAX window.ajaxRefresh = 3000; AjaxRCRefreshText = 'AJAX'; AjaxRCRefreshHoverText = 'Automaticamente recarregar a página'; window.ajaxPages = [ "Special:WikiActivity", "Special:RecentChanges", "Special:Watchlist", "Special:Log", "Special:Contributions", "Special:Block", "Special:Unblock" ]; batchDeleteDelay = 10; var qtUserPageTemplate = ''; var qtEnableUserPageOverwrite = true;

// Original Code by Uberfuzzy. Fixed and formatted by Shodai Tsuchi. if (mw.config.get('skin') === 'oasis') { $('Refresh' ).appendTo($( '.UserProfileMasthead .masthead-info h2' )); } function Purge { $.get('/index.php?title=' + encodeURIComponent (wgPageName) + '&action=purge', function {        location.reload(true);    }); $('html, body').css({           display: 'block',            overflow: 'hidden'        }); $(' ').appendTo(document.body) .css('height', $(window).height); }

// FastDelete Buttons importScriptPage('FastDelete/code.js', 'dev'); var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'vandalism', 'label': 'V' }; fdButtons[fdButtons.length] = { 'summary': 'spam', 'label': 'S' }; fdButtons[fdButtons.length] = { 'summary': 'cleanup', 'label': 'C↑' }; fdButtons[fdButtons.length] = { 'summary': 'Violation of the ToU', 'label': 'ToU' }; fdButtons[fdButtons.length] = { 'summary': 'Sem sentido', 'label': 'SS' }; fdButtons[fdButtons.length] = { 'summary': 'Fanon content', 'label': 'FC' }; fdButtons[fdButtons.length] = { 'summary': 'Sem necessidade', 'label': 'SN' };

if (wgDBname == "wikia") { $("link[rel='shortcut icon'").attr("href",       "http://vignette2.wikia.nocookie.net/monchbox/images/f/f3/Icon-staff.png"    ); }

// Special:CreatePage $(function {	if ( !document.getElementById( 'ca-skins' ) ) {		if ( skin === 'oasis' || skin === 'monobook' ) {		$(window).load(function { $('a.createpage').off('click').attr('href', '/wiki/Special:CreatePage'); });	}   } });

//UserPage is an script based on code QuickCreateUserPage(@Grunny) - Written by Shodai Tsuchi function wikiabar { var wikiabar = $('UserPage'); $(window.WikiaBar.wikiaBarWrapperObj.find('.tools')).append(wikiabar); } function UserPage { mw.util.addCSS(".modalWrapper{background-color:gray;"); $.showCustomModal('QuickCreateUserPage',       '  Languages  ', {            id: "cancel",            width: 450,            buttons: [{                message: "EN",                handler: function {                    en;            }            },{                message: "PT",                handler: function {                    pt;               }            },{                message: "ES",                handler: function {                    es;               }            },{                message: "FR",                handler: function {                    fr;               }            },{                message: "IT",                handler: function {                    it;               }            },{                message: "DE",                handler: function {                    de;               }            },{                message: "PL", handler: function { pl; }           },{                message: "ID", handler: function { id; }           },{                defaultButton: true, message: "Cancel", handler: function { closeModal; }       }]    }); } function closeModal {    $("#cancel").closeModal; }

function Saved { alert("Saved!"); $("#cancel").closeModal; } function en { $.post(mw.util.wikiScript("api"), {            format: "json",            action: "edit",            title: "User:Shodai Tsuchi",            text: "",            summary: "Creating:userpage",            token: mw.user.tokens.get("editToken"),            success: Saved    }); } function pt { $.post(mw.util.wikiScript("api"), {            format: "json",            action: "edit",            title: "User:Shodai Tsuchi",            text: "",            summary: "Creating:userpage",            token: mw.user.tokens.get("editToken"),            success: Saved    }); } function es { $.post(mw.util.wikiScript("api"), {            format: "json",            action: "edit",            title: "User:Shodai Tsuchi",            text: "",            summary: "Creating:userpage",            token: mw.user.tokens.get("editToken"),            success: Saved    }); } function fr { $.post(mw.util.wikiScript("api"), {            format: "json",            action: "edit",            title: "User:Shodai Tsuchi",            text: "",            summary: "Creating:userpage",            token: mw.user.tokens.get("editToken"),            success: Saved    }); } function it { $.post(mw.util.wikiScript("api"), {            format: "json",            action: "edit",            title: "User:Shodai Tsuchi",            text: "",            summary: "Creating:userpage",            token: mw.user.tokens.get("editToken"),            success: Saved    }); } function de { $.post(mw.util.wikiScript("api"), {            format: "json",            action: "edit",            title: "User:Shodai Tsuchi",            text: "",            summary: "Creating:userpage",            token: mw.user.tokens.get("editToken"),            success: Saved    }); }

function pl { $.post(mw.util.wikiScript("api"), {            format: "json",            action: "edit",            title: "User:Shodai Tsuchi",            text: "",            summary: "Creating:userpage",            token: mw.user.tokens.get("editToken"),            success: Saved    }); }

function id { $.post(mw.util.wikiScript("api"), {            format: "json",            action: "edit",            title: "User:Shodai Tsuchi",            text: "",            summary: "Creating:userpage",            token: mw.user.tokens.get("editToken"),            success: Saved    }); } $(wikiabar);

// move edit links to after header $('.editsection').each(function {    $(this).css({ 'float': 'none', 'padding-left': '1em', 'display': 'inline' }).parent.append(this); }); // if 'useskin' parameter exists, set it as a cookie var customSkin = mw.util.getParamValue('useskin'); if (customSkin !== null) { $.cookie('useskin', customSkin, {   domain: mw.config.get('wgCookieDomain'),    path: mw.config.get('wgCookiePath')  }); } // disable redirect links $('.mw-redirect, .allpagesredirect > a').each(function {  var link = new mw.Uri(this.href);  link.extend({ redirect: 'no' }); $(this).attr('href', link.toString); }); // don't create redirect when moving files if (mw.config.get('wgPageName').indexOf('Special:MovePage/File:') !== -1) { $('#wpLeaveRedirect').prop('checked', false); } $(window).load(function {  // add 'used templates' link in wide-mode edit panel  if (mw.config.get('wgAction') === 'edit') {    $('.text-links').clone(true).css('display', 'none').appendTo('.checkboxes').find('a').html('Used templates');  } }); // quick prefix search function getPrefixLI(ns, nsname) { return 'Prefix search (' + (nsname || ns) + ')'; } if (mw.config.get('wgNamespaceNumber') !== -1) { var toolstoadd = getPrefixLI('0', 'Main'); if (mw.config.get('skin') === 'oasis') { $('#my-tools-menu').prepend(toolstoadd); } else if (mw.config.get('skin') === 'monobook') { $('#p-tb > .pBody > ul').append(toolstoadd); } } // add contribs and watchlist links to user menu $('.user-menu > li:has(a[data-id="preferences"])') .after('My watchlist</li>' +   '<a href="' + mw.util.getUrl('Special:Contributions/' + mw.config.get('wgUserName')) + '">My contributions</a></li>'); // add button to unhide removed messages on thread pages $('.removed-info').append('<button class="secondary showremovedmessage" style="margin-left:10px;">Show '); $('.showremovedmessage').click(function {  $(this).closest('.message-removed').removeClass('hide'); });