MediaWiki:Wikia.js

/* */

/* Temporary fix for Wikia hubs: Gaming > Entertainment * by: User:The 888th Avatar */ $(document).ready(function {  if (skin == "oasis" || skin == "wikia") {      $('.CorporateFooter .WikiaHubBranding .wordmark').html('');      $('.hub').html('[ Entertainment ]');   } });

// ================================ //    Custom preload templates // ================================ /* @author Grunny @version 0.0.1 From http://harrypotter.wikia.com/wiki/MediaWiki:Wikia.js  Template list loaded from Template:Stdpreloads (originally from MediaWiki:PreloadTemplates), each syntax is loaded from the /preload subpage of the template. function customPreloadTemplates { if( wgAction !== 'edit' || (!$( 'div.module_content' ).length && skin === 'oasis') || (!$( 'div.editButtons' ).length && skin === 'monobook') ) { return; }	var	preloadOptionsHtml = '', $preloadOptionsList; $(function {	          if( skin === 'oasis' ) {		           $( 'div.module_content:first' ).append( ' Standard preloads: ' );	          } else if( skin === 'monobook' ) {		                  $( 'div.editButtons' ).append( ' Standard preloads: ' );	                  }        }); $.get( wgScript, { title: 'Template:Stdpreloads', action: 'raw', ctype: 'text/plain' }, function( data ) {		var lines = data.split( '\n' );		for( var i in lines ) {			var value = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : "";			preloadOptionsHtml += '' + lines[i] + ' ';		}		$preloadOptionsList = $( ' ' ).attr( 'id', 'stdSummaries' ).html( preloadOptionsHtml ).change( function { var value = $( this ).val; if ( value !== '' ) { value = 'Template:' + value + '/preload'; value = value.replace( ' ', '_' ); $.get( wgScript, { title: value, action: 'raw', ctype: 'text/plain' }, function( data ) {					if ( document.getElementById( 'wpTextbox1' ) ) {                                            insertAtCursor( document.getElementById( 'wpTextbox1' ), data );				        } else {                                              // Visual editor                                             insertAtCursor( document.getElementsByClassName( 'cke_source' )[0], data );                                                }                                } ); }		} );		$( 'div#lf-preload' ).append( $preloadOptionsList );	} ); } $( customPreloadTemplates );

/* */