← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4716: Cleaned up concept javascript

 

------------------------------------------------------------
revno: 4716
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-09-27 14:08:17 +0200
message:
  Cleaned up concept javascript
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/concept.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm


--
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-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/concept.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/concept.js	2011-06-22 18:53:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/concept.js	2011-09-27 12:08:17 +0000
@@ -4,17 +4,10 @@
 
 function showConceptDetails( conceptId )
 {
-    var request = new Request();
-    request.setResponseTypeXML( 'concept' );
-    request.setCallbackSuccess( conceptReceived );
-    request.send( 'getConcept.action?id=' + conceptId );
-}
-
-function conceptReceived( conceptElement )
-{
-    setFieldValue( 'nameField', getElementValue( conceptElement, 'name' ) );
-
-    showDetails();
+    jQuery.post( 'getConcept.action', { id : conceptId }, function( json ) {
+		setInnerHTML( 'nameField', json.concept.name );
+		showDetails();
+	});
 }
 
 // -----------------------------------------------------------------------------
@@ -25,31 +18,3 @@
 {
     removeItem( conceptId, conceptName, i18n_confirm_delete, 'removeConcept.action' );
 }
-
-// -----------------------------------------------------------------------------
-// Add/Update category concept
-// -----------------------------------------------------------------------------
-
-function validateAddUpdateConcept( mode )
-{
-    var name = $( "#name" ).val();
-
-    $.getJSON( "validateAddUpdateConcept.action", {
-        "name" : name,
-        "mode" : mode
-    }, function( json )
-    {
-        if ( json.response == "success" )
-        {
-            if ( mode == "add" )
-            {
-                byId( "addConceptForm" ).submit();
-                return;
-            }
-            byId( "updateConceptForm" ).submit();
-        } else if ( json.response == "input" )
-        {
-            setHeaderDelayMessage( json.message );
-        }
-    } );
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm	2011-09-27 07:36:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm	2011-09-27 12:08:17 +0000
@@ -4,31 +4,8 @@
 	});
 
     var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_concept" ) , "'")';
-	// Are you sure you want to delete this?
 	var i18n_adding_concept_failed = '$encoder.jsEscape( $i18n.getString( "adding_concept_failed" ) , "'")';
 	var i18n_saving_concept_failed = '$encoder.jsEscape( $i18n.getString( "saving_concept_failed" ) , "'")';
-	
-	
-	// -----------------------------------------------------------------------------
-	// View details
-	// -----------------------------------------------------------------------------
-
-	function showConceptDetails( conceptId )
-	{
-	    jQuery.post( 'getConcept.action', { id : conceptId }, function( json ) {
-			setInnerHTML( 'nameField', json.concept.name );
-			showDetails();
-		});
-	}
-
-	// -----------------------------------------------------------------------------
-	// Remove category concept
-	// -----------------------------------------------------------------------------
-
-	function removeConcept( conceptId, conceptName )
-	{
-	    removeItem( conceptId, conceptName, i18n_confirm_delete, 'removeConcept.action' );
-	}
 </script>
 
 <h3>$i18n.getString( "concept_management" ) #openHelp( "concept" )</h3>