MediaWiki:Common.js/preloadTemplatesWikia.js

/** * jQuery version of fillPreloads * @author Grunny */ function fillPreloads { if( !$( '#lf-preload' ).length ) { return; }	var	preloadOptionsHtml = '', $preloadOptionsList; $( '#lf-preload' ).attr( 'style', 'display: block' ); $.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 ) {					insertAtCursor( document.getElementById( 'wpTextbox1' ), data );				} ); }		} );		$( '#lf-preload-cbox' ).html( $preloadOptionsList );	} ); $( '#lf-preload-pagename' ).html( '' ); $( '#lf-preload-button' ).html( '' ); } function doCustomPreload { doPreload(document.getElementById('lf-preload-pagename').getElementsByTagName('input')[0].value); }