← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8827: Impl js function startsWith

 

------------------------------------------------------------
revno: 8827
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-11-01 18:33:54 +0300
message:
  Impl js function startsWith
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.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-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	2012-10-22 16:02:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2012-11-01 15:33:54 +0000
@@ -1603,6 +1603,11 @@
 	return regex.test( value );
 }
 
+function startsWith( string, substring )
+{
+	return ( string && string.lastIndexOf( substring, 0 ) === 0 ) ? true : false;
+}
+
 function isPositiveNumber( value )
 {
 	return isNumber( value ) && parseFloat( value ) > 0;