Forked from kawanaka2141/redmine-submit-guard.js
Last active
August 29, 2015 14:20
-
-
Save seventhsense/05f6d227221fd5c82ff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Redmine Submit Guard | |
// @namespace https://github.com/kawanaka2141 | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js | |
// @match http://*/redmine/projects/*/issues/new | |
// @match http://*/redmine/issues/* | |
// ==/UserScript== | |
(function(){ | |
$('input').keypress(function(ev){ | |
if(ev.keyCode === 10 || ev.keyCode === 13){ | |
if(Event.element(ev).id == 'q') return true; | |
if($('#issue_subject').val().trim() == ''){ $('#issue_subject').focus(); return false; } | |
if($('#issue_description').val().trim() == ''){ $('#issue_description').focus(); return false; } | |
return false; | |
} | |
return true; | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment