From 3defd7d7b14f3140567e25c4e31a75ad0e204ca2 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 6 Nov 2013 11:11:01 -0600 Subject: [PATCH] fixed issue 1763 user of arrows in numerical fields --- VERSION | 2 +- applications/admin/static/js/web2py.js | 6 ++++-- applications/examples/static/js/web2py.js | 6 ++++-- applications/welcome/static/js/web2py.js | 6 ++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 59566188..47039e24 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.7.4-stable+timestamp.2013.11.06.10.29.44 +Version 2.7.4-stable+timestamp.2013.11.06.11.10.08 diff --git a/applications/admin/static/js/web2py.js b/applications/admin/static/js/web2py.js index d9cc0407..3c8b568a 100644 --- a/applications/admin/static/js/web2py.js +++ b/applications/admin/static/js/web2py.js @@ -167,10 +167,12 @@ else t.fadeOut(); }); doc.on('keyup', 'input.integer', function () { - this.value = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse(); + var nvalue = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse(); + if(this.value!=nvalue) this.value = nvalue; }); doc.on('keyup', 'input.double, input.decimal', function () { - this.value = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse(); + var nvalue = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse(); + if(this.value!=nvalue) this.value = nvalue; }); var confirm_message = (typeof w2p_ajax_confirm_message != 'undefined') ? w2p_ajax_confirm_message : "Are you sure you want to delete this object?"; doc.on('click', "input[type='checkbox'].delete", function () { diff --git a/applications/examples/static/js/web2py.js b/applications/examples/static/js/web2py.js index d9cc0407..3c8b568a 100644 --- a/applications/examples/static/js/web2py.js +++ b/applications/examples/static/js/web2py.js @@ -167,10 +167,12 @@ else t.fadeOut(); }); doc.on('keyup', 'input.integer', function () { - this.value = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse(); + var nvalue = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse(); + if(this.value!=nvalue) this.value = nvalue; }); doc.on('keyup', 'input.double, input.decimal', function () { - this.value = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse(); + var nvalue = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse(); + if(this.value!=nvalue) this.value = nvalue; }); var confirm_message = (typeof w2p_ajax_confirm_message != 'undefined') ? w2p_ajax_confirm_message : "Are you sure you want to delete this object?"; doc.on('click', "input[type='checkbox'].delete", function () { diff --git a/applications/welcome/static/js/web2py.js b/applications/welcome/static/js/web2py.js index d9cc0407..3c8b568a 100644 --- a/applications/welcome/static/js/web2py.js +++ b/applications/welcome/static/js/web2py.js @@ -167,10 +167,12 @@ else t.fadeOut(); }); doc.on('keyup', 'input.integer', function () { - this.value = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse(); + var nvalue = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse(); + if(this.value!=nvalue) this.value = nvalue; }); doc.on('keyup', 'input.double, input.decimal', function () { - this.value = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse(); + var nvalue = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse(); + if(this.value!=nvalue) this.value = nvalue; }); var confirm_message = (typeof w2p_ajax_confirm_message != 'undefined') ? w2p_ajax_confirm_message : "Are you sure you want to delete this object?"; doc.on('click', "input[type='checkbox'].delete", function () {