|
Lines 52-57
function suffixOf (s, tok) {
Link Here
|
| 52 |
return s.substring(index + 1); |
52 |
return s.substring(index + 1); |
| 53 |
} |
53 |
} |
| 54 |
|
54 |
|
|
|
55 |
$("body").on("keypress", ".noEnterSubmit", function(e){ |
| 56 |
return checkEnter(e); |
| 57 |
}); |
| 58 |
|
| 59 |
// http://jennifermadden.com/javascript/stringEnterKeyDetector.html |
| 60 |
function checkEnter(e){ //e is event object passed from function invocation |
| 61 |
var characterCode; // literal character code will be stored in this variable |
| 62 |
if(e && e.which){ //if which property of event object is supported (NN4) |
| 63 |
characterCode = e.which; //character code is contained in NN4's which property |
| 64 |
} else { |
| 65 |
characterCode = e.keyCode; //character code is contained in IE's keyCode property |
| 66 |
} |
| 67 |
if( characterCode == 13 //if generated character code is equal to ascii 13 (if enter key) |
| 68 |
&& e.target.nodeName == "INPUT" |
| 69 |
&& e.target.type != "submit" // Allow enter to submit using the submit button |
| 70 |
){ |
| 71 |
return false; |
| 72 |
} else { |
| 73 |
return true; |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 55 |
// Adapted from https://gist.github.com/jnormore/7418776 |
77 |
// Adapted from https://gist.github.com/jnormore/7418776 |
| 56 |
function confirmModal(message, title, yes_label, no_label, callback) { |
78 |
function confirmModal(message, title, yes_label, no_label, callback) { |
| 57 |
$("#bootstrap-confirm-box-modal").data('confirm-yes', false); |
79 |
$("#bootstrap-confirm-box-modal").data('confirm-yes', false); |
| 58 |
- |
|
|