User:Matěj Grabovský/common.js

var tab2tabHandler = function(e) { if(e.keyCode === 9) { insertTags('	', , ); e.preventDefault; } };

jQuery(function($) {	mediaWiki.loader.load([ 'jquery.textSelection' ]);	mediaWiki.loader.using('jquery.textSelection', function { var $editBox = $('#wpTextbox1'); $editBox.after(' Use tab2tab '); var $useTab2tab = $('#useTab2tab'); $useTab2tab.change(function {			if($useTab2tab.is(':checked')) {				$editBox.bind('keydown', tab2tabHandler);				localStorage['mw.useTab2tab'] = true;			} else {				$editBox.unbind('keydown', tab2tabHandler);				localStorage['mw.useTab2tab'] = false;			}		});

if(localStorage['mw.useTab2tab'] === "true") $useTab2tab.attr('checked', true); }); });