User:BlueDevil/global.js

//

// ***************************************************************** // Load various external scripts // *****************************************************************

//PurgeButtonText = 'purge'; //importScriptPage('PurgeButton/code.js', 'dev'); //ajaxPages = ["Special:RecentChanges","Special:Log","Special:WikiActivity"]; //importScriptPage('AjaxRC/code.js', 'dev'); //importScriptPage('User:Splarka/contribtools.js', 'c'); //importScriptPage('User:Splarka/interwikitools.js', 'c'); //importScriptPage('User:User:Splarka/stripsource.js', 'c'); //importScriptPage('User:Monchoman45/ChatHacks.js', 'c');

//if(skin=='monobook'){ //importScriptPage('User:Sannse/Imagelisttools.js', 'c'); //}

importArticles({   type: "script",    articles: [        'u:c:User:Sannse/Imagelisttools.js',        'u:dev:AllPagesHideRedirect/code.js',        'u:dev:DiscussionsFeed.js',        'u:dev:EditBio/code.js',        'u:dev:GlobalEditcount/code.js'        'u:vstf:User:Joeyaa/wham.js',        "u:dev:ShowAdsButton/code.js"    ] });

// ***************************************************************** // &bot=1 on contribs pages. // ***************************************************************** function hiderollback { var botlink = document.location.href; if(botlink.indexOf('?')==-1) { botlink += '?bot=1'; } else { botlink += '&bot=1'; } addPortletLink('p-cactions', botlink, '&bot=1', 'ca-bot'); } if((skin == "monobook")&&(wgCanonicalSpecialPageName == 'Contributions')) addOnloadHook(hiderollback)

// ***************************************************************** // Custom edit buttons // ***************************************************************** if (mwCustomEditButtons) {

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/central/images/1/12/Button_gallery.png", "speedTip": "Insert a picture gallery", "tagOpen": "\n", "sampleText": "File:Example.jpg|Caption1\nFile:Example.jpg|Caption2"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/central/images/4/4a/Button_table.png", "speedTip": "Insert a table", "tagOpen": '{| class="wikitable"\n|-\n', "tagClose": "\n|}", "sampleText": "! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/2/23/Button_code.png?1", "speedTip": " ", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/7/7b/Button_pre_nowiki.png?1", "speedTip": " tags", "tagOpen": "\n", "tagClose": "\n", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/7/73/Button_code_nowiki.png?1", "speedTip": " ", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/3/3b/Button_template_alt.png?1", "speedTip": "", "tagOpen": "", "sampleText": "wikia:User:BlueDevil"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/f/fc/Button_user_talk.png?1", "speedTip": "My global Usertalk template", "tagOpen": "", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/central/images/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT ",    "tagClose": "", "sampleText": "Insert text"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/central/images/1/13/Button_enter.png", "speedTip": "Line break", "tagOpen": " ", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/5/58/Button_small.png?1", "speedTip": "Small", "tagOpen": " ", "tagClose": " ", "sampleText": "Small Text"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/1/16/Button_reflink_alternate.png?1", "speedTip": "Insert a reference", "tagOpen": " ", "sampleText": "Insert footnote text here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/f/f6/Button_html_comment.png?1", "speedTip": "HTML comment", "tagOpen": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images4.wikia.nocookie.net/central/images/7/70/Button_disambig.png", "speedTip": "Disambiguation", "tagOpen": "", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/9/9f/Button_defaultsort.png?1", "speedTip": "defaultsort", "tagOpen": "", "sampleText": "Insert key here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/b/b4/Button_category03.png?1", "speedTip": "Category", "tagOpen": "[[Category:",    "tagClose": "]]", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/central/images/c/c9/Button_strike.png?1", "speedTip": "Strike", "tagOpen": " ", "tagClose": " ", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/4/4a/Button_welcome.png?1", "speedTip": "Welcome a user", "tagOpen": "BlueDevil--~", "tagClose": "", "sampleText": ""};

} /*********start fd setup ******************/ /*global jQuery, mediaWiki */ "use strict"; window.dev = window.dev || {}; // Don't load twice... if (window.dev.ajaxFastDelete !== undefined) { return false; }   var conf = mw.config.get([            'wgNamespaceNumber',            'wgPageName',            'skin'        ]), self = { version: '2.3', init: function { if (conf.wgNamespaceNumber === -1 || !window.fdButtons || !$('#ca-delete').length) { return; }               var deleteButtons = ''; switch (conf.skin) { case 'uncyclopedia': case 'wowwiki': case 'monobook': deleteButtons = window.fdButtons.map(function (b) {                           var sum = b.summary;                            return '' + b.label + '';                        }).join(''); $('#p-cactions > .pBody > ul').append(deleteButtons); break; case 'oasis': case 'wikia': var $profile = $('.UserProfileActionButton'); deleteButtons = window.fdButtons.map(function (b) {                           var sum = b.summary;                            return '' + b.label + '';                        }).join(' '); if ($profile.exists) { $profile.append(deleteButtons); } else if ($('.page-header__subtitle-blog-post').exists) { $('.page-header__subtitle-blog-post').append(deleteButtons); $('.page-header__blog-post-details').css('margin-right', '5px'); } else { $('.page-header__title').append(deleteButtons); mw.util.addCSS('a[data-id="fastdelete"]:nth-child(1){margin-left:5px}'); }                       break; }               if ($('a[data-id="fastdelete"]').length) { $('a[data-id="fastdelete"]').click(function {                       self.deletePage($(this).attr('data-summary'));                    }); }               mw.hook('fastdelete.init').fire(deleteButtons); },           deletePage: function (deleteReason) { (new mw.Api) .post({                       action: 'delete',                        title: conf.wgPageName,                        reason: deleteReason,                        token: mw.user.tokens.get('editToken')                    }) .done(function (res) {                       location.reload;                    }); }       };    window.dev.ajaxFastDelete = self; mw.loader.using(['mediawiki.util', 'mediawiki.api'], function {        $(self.init);    }); }(window, jQuery, mediaWiki)); // ***************************************************************** // Custom automatic delete buttons // ***************************************************************** // Adds customizable one-click deletion buttons to any deletable page. // Requires w:User:Splarka/fastdelete.js in appendScript; var fdButtons = []; fdButtons[fdButtons.length] = {   'summary': 'Requested deletion',    'label': 'reqst' }; fdButtons[fdButtons.length] = {    'summary': 'Spam ',    'label': 'Spam' }; fdButtons[fdButtons.length] = {    'summary': 'Housekeeping',    'label': 'hk' }; fdButtons[fdButtons.length] = {    'summary': 'Unused video',    'label': 'vid' }; // end Custom automatic delete buttons
 * (function (window, $, mw, undefined) {

/*************end fd************************************/

// Adds log link to deleted images header $(function {   if ($('#mw-imagepage-nofile').length) {        $('View logs for this page ').insertAfter('.page-header__title');    } });