v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:Lethosor/ignore blank summary.js

From Dwarf Fortress Wiki
Jump to navigation Jump to 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
// Adds an option to the edit form to ignore a blank edit summary (when the warning is enabled in preferences)
jQuery(function($){
	var IBS = window.IBS = {};
	IBS.init = function() {
		var watch = $('.editCheckboxes #mw-editpage-watch');
		IBS.div = watch.clone();
		IBS.div.attr({
			id: null,
		});
		IBS.checkbox = IBS.div.find('input').attr({
			type: 'checkbox', 
			name: 'wpIgnoreBlankSummary', 
			id: 'wpIgnoreBlankSummary', 
			tabindex: 4,
			accesskey: null,
		});
		IBS.label = IBS.div.find('label').attr({
			for: 'wpIgnoreBlankSummary',
			title: null,
		}).text('Ignore blank summary');
		IBS.div.find('#wpWatchthisWidget').attr({
			id: null,
			'data-ooui': null,
		});
		if (mw.config.get('wgCanonicalNamespace').toLowerCase().indexOf('talk') >= 0) {
			IBS.checkbox.prop('checked', 1);
		}
		IBS.div.insertAfter(watch);
		$('[type=hidden][name=wpIgnoreBlankSummary]').remove();
	};
	$(IBS.init);
});