← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2067: Removed unused js file

 

------------------------------------------------------------
revno: 2067
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Mon 2010-09-06 09:24:59 +0200
message:
  Removed unused js file
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/oust.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
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/oust.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/oust.js	2009-10-01 08:05:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/oust.js	1970-01-01 00:00:00 +0000
@@ -1,296 +0,0 @@
-
-// -----------------------------------------------------------------------------
-// Author:   Torgeir Lorange Ostby
-// Version:  $Id: oust.js 5791 2008-10-02 11:04:41Z larshelg $
-// -----------------------------------------------------------------------------
-
-var selectionTreeSelection = new SelectionTreeSelection();
-var selectionTree = new SelectionTree();
-
-// -----------------------------------------------------------------------------
-// Selection
-// -----------------------------------------------------------------------------
-
-function SelectionTreeSelection()
-{
-    var onSelectFunction;
-    
-    var listenerFunction;
-    
-    var multipleSelectionAllowed = true;
-
-    this.setOnSelectFunction = function( onSelectFunction_ )
-    {
-        onSelectFunction = onSelectFunction_;
-    };
-
-    this.setListenerFunction = function( listenerFunction_ )
-    {
-        listenerFunction = listenerFunction_;
-    };
-
-    this.setMultipleSelectionAllowed = function( allowed )
-    {
-        multipleSelectionAllowed = allowed;
-    };
-	
-    this.select = function( unitId ){
-        if ( onSelectFunction ){
-            onSelectFunction();
-        }
-        
-        var request = new Request();
-        request.setCallbackSuccess( responseReceived );
-        request.setResponseTypeXML( 'selected' );
-        
-        var unitTag = document.getElementById( getTagId( unitId ));
-        var linkTags = unitTag.getElementsByTagName( 'a' );
-
-        if ( linkTags[0].className == 'selected' ){
-        	if ( multipleSelectionAllowed ){
-        	  if( ( parent.document.getElementById( "button5" ).disabled == false )
-								&& ( parent.document.getElementById( "button6" ).disabled == false )
-								&& ( parent.document.getElementById( "button7" ).disabled == false )
-								&& (parent.document.getElementById( "button8" ).disabled == false ) ){
-		                request.send( 'lockorgunit.action?id=' + unitId );
-		                linkTags[0].className = 'locked';
-            }
-          }         
-        }
-        else if ( linkTags[0].className == 'locked' ){
-	        if( ( parent.document.getElementById( "button5" ).disabled == false )
-								&& ( parent.document.getElementById( "button6" ).disabled == false )
-								&& ( parent.document.getElementById( "button7" ).disabled == false )
-								&& (parent.document.getElementById( "button8" ).disabled == false ) ){
-			            	request.send( 'removelockorgunit.action?id=' + unitId );
-			            	linkTags[0].className = 'selected';
-            }
-        }
-        else{    
-        	request.send( 'noactionfordatalocking.action?' );   
-            linkTags[0].className = '';  
-            enableLockComponents();       
-        }
-    };
-
-    function responseReceived( rootElement ){
-        if ( !listenerFunction ){
-            return;
-        }
-
-        var unitIds = new Array();
-        var unitIdElements = rootElement.getElementsByTagName( 'unitId' );
-        
-        for ( var i = 0, unitIdElement; ( unitIdElement = unitIdElements[i] ); ++i )
-        {
-            unitIds[i] = unitIdElement.firstChild.nodeValue;
-        }   
-        listenerFunction( unitIds );
-    }
-
-    function getTagId( unitId ){
-        return 'oustOrgUnit' + unitId;
-    }
-}
-
-// -----------------------------------------------------------------------------
-// Subtree
-// -----------------------------------------------------------------------------
-
-function SelectionTree(){	
-    this.toggle = function( unitId ){
-        var parentTag = document.getElementById( getTagId( unitId ));
-        var children = parentTag.getElementsByTagName( 'ul' );
-
-        var request = new Request();
-        request.setResponseTypeXML( 'units' );
-
-        if ( children.length < 1 || !isVisible( children[0] ))
-        {
-            request.setCallbackSuccess( processExpand );
-            request.send( 'expandSubtree.action?parentId=' + unitId );
-        }
-        else
-        {
-            setVisible( children[0], false );
-            setToggle( parentTag, false );
-        }
-    };
-
-    this.buildSelectionTree = function(){
-        var treeTag = document.getElementById( 'selectionTree' );  
-        setLoadingMessage( treeTag );
-        var children = treeTag.getElementsByTagName( 'ul' );
-        
-        if ( children.length > 0 )
-        {
-            treeTag.removeChild( children[0] );
-        }
-
-        var request = new Request();
-        request.setResponseTypeXML( 'units' );
-        request.setCallbackSuccess( treeReceived );
-        request.send( 'getExpandedTreeForLock.action' );   
-           
-    };
-
-    function processExpand( rootElement ){
-        var parentElements = rootElement.getElementsByTagName( 'parent' );
-        for ( var i = 0, parentElement; ( parentElement = parentElements[i] ); ++i )
-        {
-            var parentId = parentElement.getAttribute( 'parentId' );
-            var parentTag = document.getElementById( getTagId( parentId ));
-            var children = parentTag.getElementsByTagName( 'ul' );
-
-            if ( children.length < 1 )
-            {
-                createChildren( parentTag, parentElement );
-            }
-            else
-            {
-                setVisible( children[0], true );
-                setToggle( parentTag, true );
-            }
-        }
-    }
-
-    function treeReceived( rootElement ){
-        var rootsElement = rootElement.getElementsByTagName( 'roots' )[0];
-        var unitElements = rootsElement.getElementsByTagName( 'unit' );
-        
-        var treeTag = document.getElementById( 'selectionTree' );
-        var rootsTag = document.createElement( 'ul' );
-
-        for ( var i = 0; i < unitElements.length; ++i )
-        {
-            var unitTag = createTreeElementTag( unitElements[i] );
-            rootsTag.appendChild( unitTag );
-        }
-
-        treeTag.appendChild( rootsTag );
-        var childrenElement = rootElement.getElementsByTagName( 'children' )[0];
-        var parentElements = childrenElement.getElementsByTagName( 'parent' );
-
-        for ( var i = 0, parentElement; ( parentElement = parentElements[i] ); ++i ){
-            var parentId = parentElement.getAttribute( 'parentId' );
-            var parentTag = document.getElementById( getTagId( parentId ));
-            createChildren( parentTag, parentElement );
-        }
-        
-        clearLoadingMessage( treeTag );
-        enableLockComponents();		
-    }
-
-    function createChildren( parentTag, parentElement ){
-        var children = parentElement.getElementsByTagName( 'child' );
-        var childrenTag = document.createElement( 'ul' );
-
-        for ( var i = 0, child; ( child = children[i] ); ++i ){
-            var childTag = createTreeElementTag( child );
-            childrenTag.appendChild( childTag );
-        }
-
-        setVisible( childrenTag, true );
-        setToggle( parentTag, true );
-
-        parentTag.appendChild( childrenTag );
-    }
-
-    function createTreeElementTag( child ){
-        var childId = child.getAttribute( 'id' );
-        var hasChildren = child.getAttribute( 'hasChildren' ) != '0';
-
-        var toggleTag = document.createElement( 'span' );
-        toggleTag.className = 'toggle';
-
-        if ( hasChildren ){
-            toggleTag.onclick = new Function( 'selectionTree.toggle( ' + childId + ' )' );
-            toggleTag.appendChild( getToggleExpand() );
-        }
-        else{
-            toggleTag.appendChild( getToggleBlank() );
-        }
-
-        var linkTag = document.createElement( 'a' );
-        linkTag.href = 'javascript:void selectionTreeSelection.select( ' + childId + ' )';
-        linkTag.appendChild( document.createTextNode( child.firstChild.nodeValue ));
-
-        if ( child.getAttribute( 'selected' ) == 'true' ){
-            linkTag.className = 'selected';
-        }
-        if ( child.getAttribute( 'locked' ) == 'true' ){
-            linkTag.className = 'locked';
-        }
- 
-        var childTag = document.createElement( 'li' );
-        childTag.id = getTagId( childId );
-        childTag.appendChild( document.createTextNode( ' ' ));
-        childTag.appendChild( toggleTag );
-        childTag.appendChild( document.createTextNode( ' ' ));
-        childTag.appendChild( linkTag );
-        
-        return childTag;
-    }
-
-    function setToggle( unitTag, expanded ){
-        var spans = unitTag.getElementsByTagName( 'span' );
-        var toggleTag = spans[0];
-        var toggleImg = expanded ? getToggleCollapse() : getToggleExpand();
-
-        if ( toggleTag.firstChild ){
-        	toggleTag.replaceChild( toggleImg, toggleTag.firstChild );
-				}
-				else{
-					toggleTag.appendChild( toggleImg );
-			}				
-    }
-
-    function setVisible( tag, visible ){
-        tag.style.display = visible ? 'block' : 'none';
-    }
-
-    function isVisible( tag ){
-        return tag.style.display != 'none';
-    }
-
-    function getTagId( unitId ){
-        return 'oustOrgUnit' + unitId;
-    }
-    
-    function getToggleExpand(){
-        var imgTag = getToggleImage();
-        imgTag.src = '../images/plus.png';
-        imgTag.alt = '[+]';
-        return imgTag;
-    }
-    
-    function getToggleCollapse(){
-        var imgTag = getToggleImage();
-        imgTag.src = '../images/minus.png';
-        imgTag.alt = '[-]';
-        return imgTag;
-    }
-
-	  function getToggleBlank(){
-			var imgTag = getToggleImage();
-			imgTag.src = '../images/transparent.gif';
-			imgTag.alt = '';
-			return imgTag;
-		}
-	    
-    function getToggleImage(){
-        var imgTag = document.createElement( 'img' );
-        imgTag.width = '9';
-        imgTag.height = '9';
-        return imgTag;
-    }
-    
-    function setLoadingMessage( treeTag ){
-        treeTag.style.backgroundImage = 'url( ../images/loading.png )';
-        treeTag.style.backgroundRepeat = 'no-repeat';
-    }
-    
-    function clearLoadingMessage( treeTag ){
-        treeTag.style.backgroundImage = 'none';
-    }
-}