← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3048: Moved validationRules.json => .js. Updated getValidationRules() to just return the variable.

 

------------------------------------------------------------
revno: 3048
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-03-16 10:23:45 +0100
message:
  Moved validationRules.json => .js. Updated getValidationRules() to just return the variable.
renamed:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/validationRules.json => dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js
modified:
  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/main.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.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	2011-03-15 16:29:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2011-03-16 09:23:45 +0000
@@ -1092,17 +1092,6 @@
  * @return A dictionary containing the default validation rules.
  */
 function getValidationRules() {
-	var validationRules;
-
-	jQuery.ajax({
-		'url': '../dhis-web-commons/validationRules.json',
-		async: false,
-		cache: false,
-		success: function(data) {
-			validationRules = jQuery.parseJSON(data);
-		}
-	});
-
 	return validationRules;
 }
 

=== renamed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/validationRules.json' => 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/validationRules.json	2011-03-15 14:49:49 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js	2011-03-16 09:23:45 +0000
@@ -1,4 +1,5 @@
-{
+
+var validationRules = {
     "user": {
         "name": {
             "length": [2,140]

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2011-01-31 08:47:19 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2011-03-16 09:23:45 +0000
@@ -35,7 +35,8 @@
     <script type="text/javascript" src="../dhis-web-commons/javascripts/commons.ajax.js"></script>
     <script type="text/javascript" src="../dhis-web-commons/javascripts/lists.js"></script>
     <script type="text/javascript" src="../dhis-web-commons/javascripts/date.js"></script>
-		
+    <script type="text/javascript" src="../dhis-web-commons/javascripts/validationRules.js"></script>
+
     <script type="text/javascript" src="../dhis-web-commons/css/${stylesheetDirectory}/dom.js"></script>
 		
     <script type="text/javascript" src="../main.js"></script>