dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00347
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 105: dhis-web-maintenance-datadictionary: Codestyle fix
------------------------------------------------------------
revno: 105
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2009-03-23 17:35:57 +0100
message:
dhis-web-maintenance-datadictionary: Codestyle fix
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupEditor.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupEditor.js
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupEditor.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupEditor.js 2009-03-13 14:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupEditor.js 2009-03-23 16:35:57 +0000
@@ -35,6 +35,7 @@
selectedDataElements[id] = availableDataElements[id];
}
+
filterSelectedDataElements();
filterAvailableDataElements();
}
@@ -128,6 +129,7 @@
selectedList.length = 0;
name = xmlObject.getElementsByTagName('name')[0].firstChild.nodeValue;
var dataElementList = xmlObject.getElementsByTagName('dataElement');
+
for ( var i = 0; i < dataElementList.length; i++ )
{
dataElement = dataElementList.item(i);
@@ -135,10 +137,10 @@
var value = dataElement.firstChild.nodeValue;
selectedDataElements[id] = value;
}
+
filterSelectedDataElements();
setMessage(i18n_member_of + " <b>" + name + "</b>");
document.getElementById('availableDataElements').disabled=false;
-
}
function updateDataElementGroupMembers()
@@ -197,7 +199,7 @@
{
var type = xmlObject.getAttribute( 'type' );
- if(type=='success')
+ if ( type=='success' )
{
var dataElementGroupsSelect = document.getElementById( 'dataElementGroups' );
dataElementGroupsSelect.remove( dataElementGroupsSelect.selectedIndex );
@@ -218,14 +220,12 @@
setPositionCenter( 'addDataElementGroupForm' );
showById('addDataElementGroupForm');
document.getElementById( 'groupName' ).value = name;
- showDivEffect();
-
+ showDivEffect();
}
catch(e)
{
alert(i18n_select_dataelement_group);
}
-
}
function validateRenameDataElementGroup()
@@ -243,11 +243,11 @@
{
var type = xmlObject.getAttribute( 'type' );
- if(type=='input')
+ if ( type=='input' )
{
alert(xmlObject.firstChild.nodeValue);
}
- if(type=='success')
+ if ( type=='success' )
{
renameDataElementGroup();
}
@@ -297,11 +297,11 @@
{
var type = xmlObject.getAttribute( 'type' );
- if(type=='input')
+ if ( type=='input' )
{
alert(xmlObject.firstChild.nodeValue);
}
- if(type=='success')
+ if ( type=='success' )
{
createNewGroup();
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupEditor.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupEditor.js 2009-03-13 14:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupEditor.js 2009-03-23 16:35:57 +0000
@@ -1,4 +1,6 @@
-function initList() {
+
+function initList()
+{
var list = document.getElementById('indicatorGroups');
var id;
@@ -59,8 +61,8 @@
* Get Indicator
*==============================================================================*/
- function getIndicatorGroup( listbox ){
-
+function getIndicatorGroup( listbox )
+{
selectedIndicators = new Object();
var id = listbox.options[ listbox.selectedIndex ].value;
var request = new Request();
@@ -92,7 +94,8 @@
* Filter Indicator
*==============================================================================*/
-function filterSelectedIndicators(){
+function filterSelectedIndicators()
+{
var filter = document.getElementById( 'selecteIndicatorsFilter' ).value;
var list = document.getElementById( 'selectedIndicators' );
@@ -149,15 +152,17 @@
* New Indicator Group
*==============================================================================*/
-
-function showAddIndicatorGroupForm(){
+function showAddIndicatorGroupForm()
+{
document.getElementById( 'groupName' ).value='';
document.getElementById( 'addRenameGroupButton' ).onclick=validateAddIndicatorGroup;
setPositionCenter( 'addIndicatorGroupForm' );
showDivEffect();
toggleById('addIndicatorGroupForm');
}
-function validateAddIndicatorGroup(){
+
+function validateAddIndicatorGroup()
+{
var name = getFieldValue('groupName');
var request = new Request();
request.setResponseTypeXML( 'xmlObject' );
@@ -169,17 +174,18 @@
{
var type = xmlObject.getAttribute( 'type' );
- if(type=='input')
+ if ( type=='input' )
{
alert(xmlObject.firstChild.nodeValue);
}
- if(type=='success')
+ if ( type=='success' )
{
createNewGroup();
}
}
-function createNewGroup(){
+function createNewGroup()
+{
var name = document.getElementById( 'groupName' ).value;
var request = new Request();
request.setResponseTypeXML( 'xmlObject' );
@@ -206,22 +212,26 @@
* Update Indicator Group
*==============================================================================*/
-function showRenameIndicatorGroupForm(){
-
+function showRenameIndicatorGroupForm()
+{
var list = byId('indicatorGroups');
- if(list.value==''){
+
+ if( list.value== '' )
+ {
alert(i18n_select_indicator_group);
- }else{
+ }
+ else
+ {
document.getElementById( 'groupName' ).value = list.options[ list.selectedIndex ].text
document.getElementById( 'addRenameGroupButton' ).onclick=validateRenameIndicatorGroup;
setPositionCenter( 'addIndicatorGroupForm' );
showDivEffect();
toggleById('addIndicatorGroupForm');
- }
-
+ }
}
-function validateRenameIndicatorGroup(){
+function validateRenameIndicatorGroup()
+{
var name = getFieldValue('groupName');
var request = new Request();
request.setResponseTypeXML( 'xmlObject' );
@@ -233,23 +243,28 @@
{
var type = xmlObject.getAttribute( 'type' );
- if(type=='input')
+ if( type=='input' )
{
alert(xmlObject.firstChild.nodeValue);
}
- if(type=='success')
+
+ if( type=='success' )
{
renameGroup();
}
}
-function renameGroup(){
+
+function renameGroup()
+{
var name = document.getElementById( 'groupName' ).value;
var request = new Request();
request.setResponseTypeXML( 'xmlObject' );
request.setCallbackSuccess( renameGroupReceived );
request.send( 'renameIndicatorGroupEditor.action?name=' + name + "&mode=editor&id=" + byId('indicatorGroups').value);
}
-function renameGroupReceived( xmlObject ){
+
+function renameGroupReceived( xmlObject )
+{
var name = xmlObject.getElementsByTagName( "name" )[0].firstChild.nodeValue;
var list = document.getElementById( 'indicatorGroups' );
list.options[ list.selectedIndex ].text = name;
@@ -262,8 +277,10 @@
* Update Member of Indicator Group
*==============================================================================*/
-function updateIndicatorGroupMembers(){
- try{
+function updateIndicatorGroupMembers()
+{
+ try
+ {
var indicatorGroupsSelect = document.getElementById( 'indicatorGroups' );
var id = indicatorGroupsSelect.options[ indicatorGroupsSelect.selectedIndex ].value;
@@ -284,8 +301,10 @@
request.setResponseTypeXML( 'xmlObject' );
request.setCallbackSuccess( updateIndicatorGroupMembersReceived );
request.send( requestString );
- }catch( e ){
- alert(i18n_select_indicator_group);
+ }
+ catch( e )
+ {
+ alert( i18n_select_indicator_group );
}
}
@@ -299,9 +318,10 @@
* Delete Indicator Group
*==============================================================================*/
-function deleteIndicatorGroup(){
-
- if( window.confirm( i18n_confirm_delete ) ){
+function deleteIndicatorGroup()
+{
+ if( window.confirm( i18n_confirm_delete ) )
+ {
var indicatorGroupsSelect = document.getElementById( 'indicatorGroups' );
var id = indicatorGroupsSelect.options[ indicatorGroupsSelect.selectedIndex ].value;
@@ -316,12 +336,11 @@
{
var type = xmlObject.getAttribute( 'type' );
- if(type=='success')
+ if ( type == 'success' )
{
var indicatorGroupsSelect = document.getElementById( 'indicatorGroups' );
indicatorGroupsSelect.remove( indicatorGroupsSelect.selectedIndex );
}
-
}
\ No newline at end of file
--
Trunk
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.