MediaWiki:Summaries.js

// ============================================================ // Preloadable Edit Summaries //  - Originally from Runescape Wiki //  - Modified by Eladkse for Casualty Wiki // ============================================================ $(function {	var $label = $('#wpSummaryLabel');	if (!$label.size) {		return;	}	$combo = $(' ').attr('id', 'stdSummaries').change(function { var val = $(this).val; if (val != '') { $('#wpSummaryEnhanced,#wpSummary').val(val); }	});	$label.after($combo);	$.ajax({ 'dataType': 'text', 'data': { 'title': 'Template:Stdsummaries', 'action': 'raw', 'ctype': 'text/plain' },		'url': wgScript, 'success': function(data) { var lines = data.split("\n"); for (var i in lines) { var val = (lines[i].indexOf('-- ') == 0) ? lines[i].substring(3) : ''; var $opt = $(' ').val(val).text(lines[i]); $combo.append($opt); }		}	});	$('#wpSummary').css({"margin-bottom": '8px'});	$('#stdSummaries').css({"width": '258px'});	$('#stdSummaries').css({"margin-bottom": '5px'}); });