1
0
Fork 0

issue #86: don't suppress backspace and cursor keys

This commit is contained in:
Jan Steemann 2012-05-23 19:10:35 +02:00
parent d5beb4bc7b
commit 516e642b64
2 changed files with 14 additions and 4 deletions

View File

@ -104,7 +104,7 @@
</tr>
<tr><td>journalSize:</td></td>
<td>
<input type="text" onkeypress='validate(event)'class="smallInput" id="createCollSize"></input>
<input type="text" onkeypress='validate(event)' class="smallInput" id="createCollSize"></input>
</td>
<td class="longTD">
(MB) The maximal size of a journal or datafile. Note that this also limits the maximal size of a single object. Must be at least 1MB.

View File

@ -1326,7 +1326,7 @@ var logTable = $('#logTableID').dataTable({
collSize = JSON.parse(collSize) * 1024 * 1024;
if (collName == '') {
alert("Nothing to do...");
alert("No collection name entered. Aborting...");
return 0;
}
@ -1344,7 +1344,13 @@ var logTable = $('#logTableID').dataTable({
drawCollectionsTable();
},
error: function(data) {
alert(JSON.stringify(data));
try {
var responseText = JSON.parse(data.responseText);
alert(responseText.errorMessage);
}
catch (e) {
alert(data.responseText);
}
}
});
});
@ -2277,8 +2283,12 @@ function evaloutput (data) {
function validate(evt) {
var theEvent = evt || window.event;
var key = theEvent.keyCode || theEvent.which;
if ((key == 37 || key == 39) && !theEvent.shiftKey) {
return;
}
key = String.fromCharCode( key );
var regex = /[0-9]|\./;
var regex = /[0-9\.\b]/;
if( !regex.test(key) ) {
theEvent.returnValue = false;
if(theEvent.preventDefault) theEvent.preventDefault();