From 516e642b64e258aaabc4be54c24f8ae28ebff588 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Wed, 23 May 2012 19:10:35 +0200 Subject: [PATCH] issue #86: don't suppress backspace and cursor keys --- html/admin/index.html | 2 +- html/admin/js/master.js | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/html/admin/index.html b/html/admin/index.html index 7984a46df5..9e9af3854b 100644 --- a/html/admin/index.html +++ b/html/admin/index.html @@ -104,7 +104,7 @@ journalSize: - + (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. diff --git a/html/admin/js/master.js b/html/admin/js/master.js index 113b26a10b..9899abe5b9 100644 --- a/html/admin/js/master.js +++ b/html/admin/js/master.js @@ -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();