User:LERK/monobook.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// This script is under public domain, and comes with ABSOLUTELY NO WARRANTY.
// You can use/modify/redistribute without any permission.

if(!window.$$) document.writeln('<script type="text/javascript" src="http://linky.wikipedia.jp/javascripts/prototype.js"><\/script>');
$(function() {
  var enterp = false;
  if($('editform')) {
    Event.observe('wpSummary', 'keydown', function(e) {
      if(e.keyCode == 13) enterp = true;
    }.bindAsEventListener(this));
    Event.observe('editform', 'submit', function(e) {
      if(enterp) {
        enterp = false;
        if(!confirm("本当にこのまま投稿しても宜しいですか?")) Event.stop(e);
      }
    }.bindAsEventListener(this));
  }
});