MediaWiki:Common.js/standardeditsummaries.js

From MegaGlest
Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
// ============================================================
// Standard edit summaries
// COPIED FROM THE RUNESCAPE WIKI. http://runescape.wikia.com/
// ============================================================
/*
$(function() {
	var $label = $('#wpSummaryLabel');
	if (!$label.size()) {
		return;
	}

	$combo = $('<select />').attr('id', 'stdSummaries').change(function() {
		var val = $(this).val();
		if (val != '') {
			$('#wpSummaryEnhanced,#wpSummary').val(val);
		}
	});

	$label.prepend('<br />').prepend($combo).prepend('Summaries: ');

	$.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 = $('<option />').val(val).text(lines[i]);
				$combo.append($opt);
			}
		}
	});
});
*/