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.
Revisions
-
kawanaka2141 revised this gist
Jun 19, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,7 @@ (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; -
kawanaka2141 created this gist
Jun 19, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ // ==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($('#issue_subject').val().trim() == ''){ $('#issue_subject').focus(); return false; } if($('#issue_description').val().trim() == ''){ $('#issue_description').focus(); return false; } return false; } return true; }); })();