← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3184: Cleanup

 

------------------------------------------------------------
revno: 3184
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-03-28 15:52:32 +0200
message:
  Cleanup
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/dhis-web-commons/javascripts/lists.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-28 10:32:09 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2011-03-28 13:52:32 +0000
@@ -231,6 +231,7 @@
 		item.disabled = true;
 	});
 }
+
 /**
  * Enables the element with the given identifier if the element exists in parent
  * window of frame.
@@ -851,7 +852,6 @@
     }
 }
 
-
 /**
  * Create jQuery datepicker for input text with id * *
  * 
@@ -958,7 +958,6 @@
  * @param enddate
  *            the id of input field which you want enter end date *
  */
-
 function datePickerInRange ( startdate, enddate, setCurrentStartDate, setCurrentEndDate )
 {
 	if( setCurrentStartDate == undefined ) setCurrentStartDate = true;
@@ -1074,15 +1073,13 @@
 	setCaretToPos( inputArea, inputArea.value.length );
 }
 
-// ==============================================================================
-// FORM VALIDATION
-// ==============================================================================
+// -----------------------------------------------------------------------------
+// Form validation
+// -----------------------------------------------------------------------------
 
 /**
  * Create validator for fileds in form *
- */
-
-/*
+ *
  * this should replace validation() at some point, but theres just to much code
  * depending on the old version for now.
  * 
@@ -1116,7 +1113,7 @@
 	return validator;	
 }
 
-/*
+/**
  * @return A dictionary containing the default validation rules.
  */
 function getValidationRules() {
@@ -1236,9 +1233,9 @@
 	});
 }
 
-// ==============================================================================
-// MESSAGE
-// ==============================================================================
+// -----------------------------------------------------------------------------
+// Message
+// -----------------------------------------------------------------------------
 
 /**
  * Show message at the top-right of screen, this message will hide automatic
@@ -1308,10 +1305,9 @@
 	return  next.length > 0 ;
 }
 
-
-// =================================================================================
-// GUI
-// =================================================================================
+// -----------------------------------------------------------------------------
+// GUI operations
+// -----------------------------------------------------------------------------
 
 /**
  * Clock screen by mask *
@@ -1374,6 +1370,7 @@
 	hideById( id );
 	unLockScreen();
 }
+
 /**
  * Removes the opacity div from the document. function deleteDivEffect()
  */
@@ -1387,7 +1384,7 @@
 	}
 }
 
-/*
+/**
  * Paging
  */
 function changePageSize( baseLink )
@@ -1427,6 +1424,26 @@
 	}
 }
 
+function relativePeriodsChecked()
+{
+    if ( isChecked( "reportingMonth" ) == true ||
+         isChecked( "monthsThisYear" ) == true ||
+         isChecked( "quartersThisYear" ) == true ||
+         isChecked( "thisYear" ) == true ||
+         isChecked( "monthsLastYear" ) == true ||
+         isChecked( "quartersLastYear" ) == true ||
+         isChecked( "lastYear" ) == true )
+    {
+        return true;
+    }
+    
+    return false;
+}
+
+// -----------------------------------------------------------------------------
+// Math methods
+// -----------------------------------------------------------------------------
+
 function isNumber( value )
 {
 	var regex = /^[+-]?\d+(\.\d+)?([eE][+-]?\d+)?$/;
@@ -1458,19 +1475,3 @@
 {
 	return Math.floor( 1000000 * Math.random() );
 }
-
-function relativePeriodsChecked()
-{
-    if ( isChecked( "reportingMonth" ) == true ||
-         isChecked( "monthsThisYear" ) == true ||
-         isChecked( "quartersThisYear" ) == true ||
-         isChecked( "thisYear" ) == true ||
-         isChecked( "monthsLastYear" ) == true ||
-         isChecked( "quartersLastYear" ) == true ||
-         isChecked( "lastYear" ) == true )
-    {
-        return true;
-    }
-    
-    return false;
-}

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js	2010-12-21 07:10:25 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js	2011-03-28 13:52:32 +0000
@@ -1,4 +1,3 @@
-var NS4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5);
 
 function addValue( theSel, theText, theValue ) {
     var newOpt = new Option( theText, theValue );
@@ -56,8 +55,6 @@
         for(i=selectedCount-1; i>=0; i--) {
             addValue(targetList, selectedText[i], selectedValues[i]);
         }
-
-        if(NS4) history.go(0)
     }
 }