MediaWiki:Wikia.js

/* */

$(document).ready(function {	// A big thanks to user:The Librarian who first pointed out the problem this code will fix. This restores normal upload form since the popup one ignores source and license policy. Adapted from http://es.pokemon.wikia.com/wiki/MediaWiki:Wikia.js via Wookieepedia.	$('a.wikia-button.upphotos').unbind('click',UploadPhotos.showDialog); });

// Welcome notification message // from sourcepedia.wikia.com // removed for preload testing

/* =========================  Custom preload templates for the new (2011) Wikia editor Version 0.2 23.12.11 with slight cosmetic changes from original =========================  Written by starwars:user:Grunny First published at: starwars:MediaWiki:Wikia.js =========================  Requires additional code at   Common.js   ========================= */

function customPreloadTemplates { if( wgAction !== 'edit' || !$( 'div.module_content' ).length ) { return; }	var	preloadOptionsHtml = '', $preloadOptionsList, preloadBaseHtml = ' Standard preloads: ' +			' Custom preload pagename: ';	$( 'div.module_content:first' ).append( preloadBaseHtml ); $.get( wgScript, { title: 'Template:Stdpreloads', action: 'raw', ctype: 'text/plain' }, function( data ) {		var lines = data.split( '\n' );		for( var i = 0; i < lines.length; i++ ) {			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 ) {					insertAtCursor( document.getElementById( 'wpTextbox1' ), data );				} ); }		} );		$( 'div#lf-preload' ).append( $preloadOptionsList );	} ); $( '#lf-preload-pagename-w' ).html( '' ); $( '#lf-preload-button-w' ).html( '' ); } $( customPreloadTemplates ); function doCustomPreloadOasis { var value = $( '#lf-preload-pagename-w > input' ).val; value = value.replace( ' ', '_' ); $.get( wgScript, { title: value, action: 'raw', ctype: 'text/plain' }, function( data ) {		insertAtCursor( document.getElementById( 'wpTextbox1' ), data );	} ); }

/* Open search results in new tab */ /* community.wikia.com/wiki/Admin_Forum:Open_search_results_in_new_tab._JS_or_CSS%3F */

/* $(function {   $('#WikiaSearch, #search, #powersearch').attr({ target: '_blank' }); }); WikiaSearchApp.initSuggest = function { $.loadJQueryAutocomplete(function {        WikiaSearchApp.searchField.autocomplete({ serviceUrl: wgServer + wgScript + "?action=ajax&rs=getLinkSuggest&format=json", onSelect: function (a, b) { WikiaSearchApp.track("suggest"); WikiaSearchApp.trackInternal("search_start_suggest", {                   sterm: encodeURIComponent(a.replace(/ /g, "_")),                    rver: 0                }); window.open(wgArticlePath.replace(/\$1/, encodeURIComponent(a.replace(/ /g, "_")))); },           appendTo: "#WikiaSearch", deferRequestBy: 250, maxHeight: 1000, selectedClass: "selected", width: "270px", skipBadQueries: true })   }) }; importScriptPage('SpoilerAlert/code.js', 'dev') importScriptPage('MediaWiki:Common.js/displayTimer.js'); importScriptPage('ListAdmins/code.js', 'dev'); importScriptPage('InactiveUsers/code.js', 'dev'); /* */