dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22172
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10636: Removed unused js method isNumber. Renamed method isRealNumber to isNumber.
------------------------------------------------------------
revno: 10636
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-04-19 15:42:19 +0200
message:
Removed unused js method isNumber. Renamed method isRealNumber to isNumber.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2013-04-18 15:23:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2013-04-19 13:42:19 +0000
@@ -38,7 +38,7 @@
return;
}
- else if ( type == 'number' && !isRealNumber( fieldValue ) ) {
+ else if ( type == 'number' && !isNumber( fieldValue ) ) {
field.style.backgroundColor = '#ffcc00';
window.alert( i18n_value_must_number + '\n\n' + dataElementName );
field.focus();
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2013-03-15 15:34:40 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2013-04-19 13:42:19 +0000
@@ -1629,18 +1629,12 @@
* Allow any real number,optionally with a sign, no thousands seperators and a
* single decimal point.
*/
-function isRealNumber( value )
+function isNumber( value )
{
var regex = /^-?(0|[1-9]\d*)(\.\d+)?$/;
return regex.test( value );
}
-function isNumber( value )
-{
- var regex = /^[+-]?\d+(\.\d+)?([eE][+-]?\d+)?$/;
- return regex.test( value );
-}
-
function startsWith( string, substring )
{
return ( string && string.lastIndexOf( substring, 0 ) === 0 ) ? true : false;
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2013-01-26 17:30:38 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2013-04-19 13:42:19 +0000
@@ -160,7 +160,7 @@
{
return alertField( fieldId, i18n_value_must_integer + ': ' + dataElementName );
}
- if ( type == 'number' && !isRealNumber( value ) )
+ if ( type == 'number' && !isNumber( value ) )
{
return alertField( fieldId, i18n_value_must_number + ': ' + dataElementName );
}