User:343TheGuiltyProphet/global.js

importScriptPage('User:The Mol Man/Annihilate.js','answers');

importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); http://mlp.wikia.com/wiki/MediaWiki:Chat-welcome-message importScript('MediaWiki:Gadget-HotCat.js', 'answers'); mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/RTRC.js&action=raw&ctype=text/javascript'); if ( wgNamespaceNumber !=undefined && !window.ToolbarLinksLoads ) { addOnloadHook( addToolbarLinkss ); } AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; var ToolbarLinksLoads = true; function addToolbarLinkss { $('Kill tool').insertAfter('ul.tools > li:first-childRTRC').insertAfter('ul.tools > li:first-child'); }

function addToolbarLinkss { $('Discussions Feed').insertAfter('ul.tools > li:first-childRTRC').insertAfter('ul.tools > li:first-child'); } function addToolbarLinkss { $('<li id="Kill tool">Random Page</a></li>').insertAfter('ul.tools > li:first-child<li id="RTRC">RTRC</a></li>').insertAfter('ul.tools > li:first-child'); } // Chat hacks. Credits to Callofduty4

importScript('User:Callofduty4/ChatHacks.js', 'c');

// Move template

importScriptPage("User:Jr Mime/MarkForTemplate/General.js","mlp");

// List Admins quick link $('#my-tools-menu').prepend(' List Admins</a></li>');

// Information on prefixes button importScriptPage("User:343 TheGuiltyProphet/MarkForTemplate.js","mlp");

//Wham

importScriptPage("WHAM/code.js","dev");

// Ajax undo

importScriptPage( 'AjaxUndo/code.js', 'dev' );

// Chat block button, credit to Ozuzanna importArticles( {   type: 'script',    articles: [        // ...        'u:dev:ChatBlockButton/code.js',        // ...    ] } );

// Signature button if (mwCustomEditButtons) { if (wgAction == "edit" || wgAction == "submit") { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://img4.wikia.nocookie.net/__cb20110824125615/mlp/images/a/a6/Pictogram_voting_comment.svg", "speedTip": "Local Signature", "tagOpen": "\{\{User:343 TheGuiltyProphet/Sig\}\}", "tagClose": "\~\~\~\~\~", "sampleText": " "}; } }

// Signature button if (mwCustomEditButtons) { if (wgAction == "edit" || wgAction == "submit") { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://img4.wikia.nocookie.net/__cb20110824125615/mlp/images/a/a6/Pictogram_voting_comment.svg", "speedTip": "Global Signature", "tagOpen": "\{\{w:User:343 TheGuiltyProphet/Sig\}\}", "tagClose": "\~\~\~\~\~", "sampleText": " "}; } }

// From http://dev.wikia.com/wiki/QuickCreateUserPage (modified by AmonFatalis) ( function( $, mw, window ) {	'use strict';	var QuickCreateUserPage = {		init: function {			var $qcLink = $( ' ' ).attr( 'id', 'quick-cup' ).html( $( '' ).attr( 'title', QuickCreateUserPage.langMsg( 'button-tooltip', true ) ) .attr( 'style', 'cursor: pointer' ).text( QuickCreateUserPage.langMsg( 'button-link-text', true ) ) .click( QuickCreateUserPage.createUserPage ) );			if ( mw.config.get( 'skin' ) === 'oasis' ) {				$( '#AccountNavigation' ).find( 'li > ul.subnav' ).prepend( $qcLink );			} else {				$( '#column-one' ).find( '#p-personal > .pBody > ul' ).prepend( $qcLink );			}		},		langConfig: {			//Lang			en: {				'button-link-text': 'Create user page',				'button-tooltip': 'Create user page',				'buttontalk-link-text': 'Create user talk page',				'buttontalk-tooltip': 'Create your user talk page',				'cup-reason': 'Creating user page',				'cup-success-text': 'Successfully created page!',				'cup-error-exists': 'Page already exists!',				'cup-error-failed': 'Creating page failed!'			}		},		langMsg: function ( name, userLang ) {			if ( userLang && mw.config.get( 'wgUserLanguage' ) in QuickCreateUserPage.langConfig && name in QuickCreateUserPage.langConfig[mw.config.get( 'wgUserLanguage' )] ) {				return QuickCreateUserPage.langConfig[mw.config.get( 'wgUserLanguage' )][name]; }			if ( !userLang && mw.config.get( 'wgContentLanguage' ) in QuickCreateUserPage.langConfig && name in QuickCreateUserPage.langConfig[mw.config.get( 'wgContentLanguage' )] ) { return QuickCreateUserPage.langConfig[mw.config.get( 'wgContentLanguage' )][name]; }			return QuickCreateUserPage.langConfig.en[name]; },		createUserPage: function { var userPageContent = window.qtUserPageTemplate || '', pageName = 'User:' + mw.config.get( 'wgUserName' ), overwriteUserPage = window.qtEnableUserPageOverwrite || true; if ( overwriteUserPage === true ) { QuickCreateUserPage.makeEdit( pageName, userPageContent ); return; }			$.getJSON( mw.util.wikiScript( 'api' ), {				action: 'query',				prop: 'revisions',				titles: pageName,				format: 'json'			} ).done( function ( data ) {				var	pageIds = Object.keys( data.query.pages ),					pageId = pageIds[0];				if ( pageId !== '-1' ) {					QuickCreateUserPage.showResult( 'ok', 'cup-error-exists' );				} else {					QuickCreateUserPage.makeEdit( pageName, userPageContent );				}			} ); },		makeEdit: function( pageName, pageContent ) { $.ajax( {				type: 'POST',				url: mw.util.wikiScript( 'api' ),				dataType: 'json',				data: {					action: 'edit',					title: pageName,					summary: QuickCreateUserPage.langMsg( 'cup-reason', false ),					text: pageContent,					format: 'json',					token: mw.user.tokens.get( 'editToken' )				}			} ).done( function ( data ) {				if ( data.edit.result === 'Success' ) {					QuickCreateUserPage.showResult( 'ok', 'cup-success-text' );				} else {					QuickCreateUserPage.showResult( 'error', 'cup-error-failed' );				}			} ).fail( function ( data ) {				QuickCreateUserPage.showResult( 'error', 'cup-error-failed' );			} ); },		showResult: function( result, message ) { if ( mw.config.get( 'skin' ) === 'monobook' ) { mw.util.$content.prepend(					'<div class="' + ( result === 'error' ? 'errorbox' : 'successbox' ) + '"> <img src="' +					mw.config.get( 'wgBlankImgUrl' ) + '" class="sprite ' + result + '"> ' + QuickCreateUserPage.langMsg( message, true ) + ' ' +					' '				); } else { var resultClass = ( result === 'error' ? 'error' : 'confirm' ); window.GlobalNotification.show( QuickCreateUserPage.langMsg( message, true ), resultClass ); }		}	};	$( QuickCreateUserPage.init ); }( jQuery, mediaWiki, this ) );

//test

importArticles({   type: 'script',    articles: [        'u:dev:DiscussionsFeed.js',    ] });

/* Original script: http://dev.wikia.com/wiki/MarkForDeletion /*jshint forin:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, unused:true, curly:true, browser:true, jquery:true */ /*global mediaWiki */ if (mediaWiki.config.get("wgAction") === "view" && mediaWiki.config.get("wgNamespaceNumber") !== -1 && mediaWiki.config.get("wgUserName") !== null) { (function ($, mw, window, document) {                   "use strict";                    var wgServer = mw.config.get("wgServer"),                            wgPageNameEncoded = window.encodeURIComponent(mw.config.get("wgPageName"));                    // uses MW API to automatically edit the page and insert the delete template at the top                    function setDeleteNotice(deleteReason) {                            var xhr = new XMLHttpRequest,                                    summary = "Adding template: {" + "{" + deleteReason + "}}",                                    content = "{" + "{" + deleteReason + "}}",                                    editToken = mw.user.tokens.get("editToken"),                                    url = wgServer + "/api.php?action=edit&title=" + wgPageNameEncoded + "&summary=" + window.encodeURIComponent(summary) + "&format=json&appendtext=" + window.encodeURIComponent(content) + "&token=" + window.encodeURIComponent(editToken); xhr.open("POST", url); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function { if (this.readyState === 4) { window.location.reload; }                           };                            xhr.send; }                   // adds a "Mark for deletion" button to the user's toolbar function initDeleteNoticeButton { var $button, toolbar, $mytoolsLI, $customizeLI; // create button $button = $('Userpage</a></li>'); $button.click(function deleteNoticeButtonClickHandler {                                   var promptedDeleteReason = "w:User:TheRequiemEmpire";                                    if (typeof window.c === "object" && window.Template !== null && typeof window.Template.promptedDeleteReason === "string") {                                            promptedDeleteReason = window.Template.promptedDeleteReason;                                    }                                    var deleteReason = window.prompt("Enter template name here - Signature must already be in the template - Don't add extra  – ", promptedDeleteReason);                                    if (typeof deleteReason === "string" && deleteReason.length > 0) {                                            setDeleteNotice(deleteReason);                                    }                            }); // add button to toolbar toolbar = document.getElementById("WikiaBarWrapper"); if (toolbar !== null) { // oasis $mytoolsLI = $(toolbar).find("li.mytools"); if ($mytoolsLI.length > 0) { // insert link before My Tools $mytoolsLI.before($button); } else { // try to insert link before Customize $customizeLI = $(toolbar).find("a.tools-customize").parent; $customizeLI.before($button); }                           } else { // monobook toolbar = document.getElementById("p-tb"); if (toolbar !== null) { $(toolbar).find("ul").append($button); }                           }                    }                    // add button on DOMReady $(initDeleteNoticeButton); }(jQuery, mediaWiki, window, document));   }