User:JustLeafy/global.js

/* Imports */ importArticles({   type: 'script',    articles: [        'u:dev:Less/code.2.js',        'u:dev:Wikimarks/code.js',        "u:dev:EditConflictAlert/code.js",        'w:c:dev:RevealAnonIP/code.js',        'u:dev:View Source/code.js',        'u:dev:DedicatedTalkButton.js',        'w:c:dev:VisualSpellCheck/code.js',        'u:dev:UTCClock/code.js',        'u:dev:AdminDropdown.js',        'u:dev:SeeMoreActivityButton/code.js',        'u:dev:PurgeButton/code.js',        'u:dev:MediaWiki:FindAndReplace/code.js',        'u:dev:FollowDropdown/code.js',        "u:dev:AjaxDelete/code.js",        "u:dev:CommentPreview/code.js",        'u:dev:FandomizedChat/library.js',        'u:dev:EditBio/code.js',        'u:dev:BlogLink/code.js',        'u:dev:RedirectManagement/code.js',    ] });

WHAMDelay = 1000;

//__NOWYSIWYG__

window.DisplayClockJS = { offset: 180, format: '%2H:%2M:%2S %d %b %Y (CST)', };

if (mwCustomEditButtons.length) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://pixelgun.wikia.com/Special:FilePath/RedirectButton.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT [" + "[", "tagClose": "]]", "sampleText": "Insert text" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://pixelgun.wikia.com/Special:FilePath/Strike-ThroughButton.png", "speedTip": "Strike", "tagOpen": " ", "tagClose": " ", "sampleText": "Strike-through text" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://pixelgun.wikia.com/Special:FilePath/LineBreakButton.png", "speedTip": "Line break", "tagOpen": " ", "tagClose": "", "sampleText": "" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://pixelgun.wikia.com/Special:FilePath/CommentsButton.png", "speedTip": "Comment visible only for editors", "tagOpen": "", "sampleText": "Insert comment here" }; }

require(['fosl.wds'], function (wds) {   $('.foo').append(wds.icon('pencil')); });

require(['fosl.wds'], function (wds) {   $('.foo').append(wds.icon('trash', ['garbage'], 16)); });

require(['fosl.wds'], function (wds) {   $('.foo').html(' ... ');    wds.render('.foo'); });

if ( !document.getElementById( 'ca-randomwiki' ) ) { if ( skin === 'oasis' || skin === 'wikia' ) { $( 'Random wiki' ).appendTo( '.mcf-card-related-wikis__header' ); } else { $( 'Random wiki' ).appendTo( '#p-wikicities-nav > .pBody > ul' ); }	}

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

importScriptPage('MediaWiki:Nuke/code.js', 'dev');

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

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

// Random Page in Category

$(function{   function createButton(text, page) {        return $('', { href: mw.util.wikiGetlink(page), title: text, 'class': 'wds-button wds-is-squished wds-is-secondary' }).text(text);   }    $('.page-header__contribution-buttons').append;        createButton('Random Page In This Category', 'Special:RandomInCategory/'),        createButton('Layout Guide', 'Layout Guide:'); });

//Attempting a new button design for the wall greeting button

/*jshint browser:true jquery:true laxbreak:true smarttabs:true*/ /*global mediaWiki */ // // Add "Edit Greeting" button to Message Wall if (mediaWiki.config.get('wgNamespaceNumber') === 1200) { (function(window, $, mw) {	"use strict";	var messages = {		en: {			editGreeting: 'Edit greeting',			history: 'Greeting history',			wallHistory: 'Wall history'		},		be: {			editGreeting: 'Правіць прывітанне',			history: 'Гісторыя прывітання',			wallHistory: 'Гісторыя сцяны абмеркавання'		},		ca: {			editGreeting: 'Edita la benvinguda',			history: 'Historial de la benvinguda',			wallHistory: 'Historial del mur'		},		de: {			editGreeting: 'Begrüßung bearbeiten',			history: 'Versionen ansehen',			wallHistory: 'Versionen der Nachrichten'		},		es: {			editGreeting: 'Editar bienvenida',			history: 'Historial de la bienvenida',			wallHistory: 'Historial del muro'		},		fr: {			editGreeting: 'Modifier accueil',			history: 'Historique accueil',			wallHistory: 'Historique du mur'		},		gl: {			editGreeting: 'Editar benvida',			history: 'Historial da benvida',			wallHistory: 'Historial do muro'		},		hi: { editGreeting: 'ग्रीटिंग संपादित करें', history: 'बधाई इतिहास', wallHistory: 'वॉल इतिहास' },		hu: { editGreeting: 'Üdvözlet szerkesztése', history: 'Üdvözlet laptörténete', wallHistory: 'Fal története' },		it: { editGreeting: 'Modifica saluto', history: 'Cronologia del saluto', wallHistory: 'Cronologia della bacheca' },		kn: { editGreeting: 'ಸಂಪಾದಿಸು ಶುಭಾಶಯ', history: 'ಗ್ರೀಟಿಂಗ್ ಇತಿಹಾಸ', wallHistory: 'ವಾಲ್ ಇತಿಹಾಸ' },		mo: { editGreeting: 'Модификаря салутулуй', history: 'Историкул салутулуй', wallHistory: 'Историкул перетелуй де месаже' },		nl: { editGreeting: 'Bewerk prikbordbegroeting', history: 'Prikbordbegroeting geschiedenis', wallHistory: 'Prikbord geschiedenis' },		oc: { editGreeting: 'Editatz benvenguda', history: 'Istoric de la benvenguda', wallHistory: 'Istoric del mur' },		pl: { editGreeting: 'Edytuj powitanie', history: 'Historia powitania', wallHistory: 'Historia tablicy' },		pt: { editGreeting: 'Editar saudação', history: 'Histórico de saudações', wallHistory: 'Histórico do mural' },		'pt-br': { editGreeting: 'Editar saudação', history: 'Histórico de saudações', wallHistory: 'Histórico do mural' },		ro: { editGreeting: 'Modificarea salutului', history: 'Istoricul salutului', wallHistory: 'Istoricul peretelui de mesaje' },		ru: { editGreeting: 'Править приветствие', history: 'История приветствия', wallHistory: 'История стены обсуждения' },		uk: { editGreeting: 'Змінити привітання', history: 'Історія привітань', wallHistory: 'Історія обговорень' },		val: { editGreeting: 'Editar benvinguda', history: 'Historial de la benvinguda', wallHistory: 'Historial del mur' },		zh: { editGreeting: '编辑问候语', history: '问候语历史', wallHistory: '信息墙历史' },		'zh-hans': { editGreeting: '编辑问候语', history: '问候语历史', wallHistory: '信息墙历史' },		'zh-hant': { editGreeting: '編輯問候語', history: '問候語歷史', wallHistory: '信息牆歷史' },		'zh-tw': { editGreeting: '編輯問候語', history: '問候語歷史', wallHistory: '訊息牆歷史' },	};	messages = $.extend(messages.en, messages[mw.config.get('wgUserLanguage')]); function checkSetIn(map, what) { for (var i = 0, l = what.length ; i < l ; ++i) { if (map[what[i]]) { return true; } }		return false; }	// Message Walls are always in Edit mode in Oasis. if (({view:1, edit:1})[mw.config.get('wgAction')] !== 1) { return; } // We show the button for the owning user, and for sysops. // We don't show it for anyone else since you get a permission error when trying to // access someone else's message. Why? Beats me. var user = mw.config.get('wgTitle'); // NOTE: Anons can edit their greetings as well, not going to support that though since //   I can't easily see what their IP address is to figure out if they own the wall or not. if (user !== mw.config.get('wgUserName')) { // Not self if (!checkSetIn({sysop:1, staff:1, threadmoderator:1}, mw.config.get('wgUserGroups')) || // Not sysop			user.indexOf('/') !== -1 // Archived talk page			) { return; }	}	function createOasis(url, wallUrl) { if ($('#EditMessageWallGreeting').length) { return; } // Double run var $button = $(window.Mustache.render( ' ' +			' ' +			'' + ' ' + '' +			' ' + // Whitespace is needed here for negative margin on drop to work ' ' +		   '' + '<path d="M6 9l4-5H2" fill-rule="evenodd"> ' + '<ul class="wds-list wds-is-linked">' + '<div class="wds-dropdown__content wds-is-not-scrollable">' + '</a></li>' + '</a></li>' + '</ul> ', messages )).prependTo('#WikiaMainContentContainer').children; if (window.WikiaButtons && window.WikiaButtons.menuButtons) { window.WikiaButtons.add($button); }	}	function createMonobook(url) { $('#ca-edit > a').prop('href', url + '?action=edit').text(messages.editGreeting); }	mw.loader.load(['mediawiki.Title', 'wikia.mustache'], null, true); $(function {		mw.loader.using(['mediawiki.Title', 'wikia.mustache'], function { (mw.config.get('skin') === 'oasis' ? createOasis : createMonobook)(				new mw.Title(user, 1202).getUrl, // Message Wall Greeting				new mw.Title(user, 1200).getUrl // Message Wall			); });	}); })(window, jQuery, mediaWiki); } // Remove the [broken] talk page link from the Greeting page. if (mediaWiki.config.get('wgNamespaceNumber') === 1202) { jQuery(function($) { // Monobook, Oasis $('#ca-talk, .WikiaPageHeader a[data-id="comment"]').remove; }); }