User:Superwatery/wikia.js

/*I don't want to add a new topic, I wanted to edit the article talk page, so this one solves the problem*/ qwebirc //Please be reminded that talk pages are always odd numbered

(function {   if (mw.config.get('wgNamespaceNumber') !== 1, 3, 5, 7, 9, 11, 13, 119) return;    $('#ca-addsection').each(function { var copy_to = $('#ca-edit').attr('class', 'wds-button').clone(true); var copy_from = $(this).removeAttr('class').clone(true); $('#ca-edit').replaceWith(copy_from); $(this).replaceWith(copy_to); }); }); //*- /*Determines the article area's background color and returns it as a string in the format of a CSS color value.*Determines the article area's background color and returns it as a string in the format of a CSS color value.*/ function getBackgroundColor { var bgColor = $('#WikiaPageBackground').css('background-color'); if (bgColor === 'transparent') { bgColor = $('#WikiaPage').css('background-color'); }   if (bgColor === 'transparent') { bgColor = $('#EditPageHeader').css('background-color'); }   return bgColor; }

/*!bang*/ $('.wds-global-navigation__search-input').on('keyup', function{	var txt = $(this).val,		m = txt.match(/^\!([a-z]+) /),		namespaces;	if (m) {		namespaces = {			t: "Template",			mw: "MediaWiki",			s: "Special",			h: "Help",			m: "Module",			f: "File",			u: "User",			p: "Project",			c: "Category",			me: "Message Wall",			/* Message Wall Greeting is required*/			mwg: "Message Wall Greeting",			/*Adoption is a custom namespace at Community Central*/			a: "Adoption",			b: "Bot scan",			f: "Forum",			ac: "Admin Central",			m: "Media"		};		if (namespaces.hasOwnProperty(m[1])) {			$(this).val(namespaces[m[1]] + /*This adds a colon after the namespace*/ ":" + txt.substr(m[1].length + 2));		}	} }); /*Responsive mobile*/

$('head').append('');

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:ContribRC/code.js'    ] });