[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm londocs.pm

tempelho tempelho@source.lon-capa.org
Fri, 30 Jan 2009 11:39:39 -0000


tempelho		Fri Jan 30 11:39:39 2009 EDT

  Modified files:              
    /loncom/interface	londocs.pm loncommon.pm 
  Log:
  added javascript function unselectInactive() to clear the class="active", when tab is closed; added parameter li.active to LC_ContentBox style.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.331 loncom/interface/londocs.pm:1.332
--- loncom/interface/londocs.pm:1.331	Fri Jan 30 10:02:46 2009
+++ loncom/interface/londocs.pm	Fri Jan 30 11:39:38 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.331 2009/01/30 10:02:46 muellerd Exp $
+# $Id: londocs.pm,v 1.332 2009/01/30 11:39:38 tempelho Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2872,7 +2872,7 @@
            $containertag = '<input type="hidden" name="folderpath" value="" />';
            $uploadtag = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($folderpath,'<>&"').'" />';
        }
-       ##############alter hashaufruf
+
        $r->print(&generate_admin_options($containertag,$uploadtag,\%lt,\%help,\%env));
        $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
 		     &mt('Editing the Table of Contents for your '.$type)));
@@ -3150,11 +3150,11 @@
 $r->print($specialdocumentsform);
 
 my %orderhash = (
-                'aa_eins' => 'New Document',
-                'bb_zwei' => 'Published Documents',
-                'cc_drei' => 'Special Documents',
-		'dd_vier' => 'More Options',
-                'zz_hide' => 'Hide all Option',
+                'aa' => 'New Document',
+                'bb' => 'Published Documents',
+                'cc' => 'Special Documents',
+		'dd' => 'More Options',
+                'zz' => 'Hide all Option',
                 );
 my %namehash = (
                 'New Document' => $fileuploadform,
@@ -3373,20 +3373,17 @@
 
 sub generate_edit_table {
     my ($varcd,$namehash_ref,$orderhash_ref) = @_;
-    #my %optionhash = %{$optionhash_ref};         #id verlinkt mit inhalt
-    #my %tablehash = %{$tablehash_ref};
     my %namehash = %{$namehash_ref};             #name verlinkt mit id
     my %orderhash = %{$orderhash_ref};           #name mit kürzel verlinkt mit name
-    #my %tablehash = %{$tablehash_ref};
     my $form;
 
     #foreach my $id (keys(%tablehash)){
     $form = '<div class="LC_ContentBoxSpecial"><h4 class="LC_hcell">'.&mt('Upload '.$varcd).'</h4>';
     
-    $form .= '<ul class="LC_TabContent">';
+    $form .= '<ul id="navigation" class="LC_TabContent">';
     foreach my $name (sort(keys(%orderhash))){
-        if($name eq 'zz_hide'){
-            $form .= '<li onclick="javascript:hideAll();">'.&mt($orderhash{$name}).'</li>';
+        if($name eq 'zz'){
+            $form .= '<li onclick="javascript:hideAll(this);" class="active">'.&mt($orderhash{$name}).'</li>';
         }else{
             $form .= '<li onclick="javascript:showPage(this, \''.$orderhash{$name}.'\');">'.&mt($orderhash{$name}).'</li>';
         }
@@ -3394,7 +3391,7 @@
     $form .= '<div id="content" style="padding: 0 0; margin: 0 0;">';
     foreach my $field (keys(%namehash)){
         $form .= '<div id="'.$field.'" class="LC_ContentBox" style="display: none;">'.$namehash{$field}.'</div>';
-    }
+      }
     $form .= '</div></div>';
 #}
     return $form;
@@ -3601,16 +3598,27 @@
     this.document.forms.renameform.submit();
 }
 
-function hideAll() {
+function unselectInactive() {
+currentNav = document.getElementById('navigation');
+currentLis = currentNav.getElementsByTagName('LI');
+for (i = 0; i < currentLis.length; i++) {
+currentLis[i].className = 'i';
+}
+}
+
+function hideAll(current) {
+	unselectInactive();
+	current.className = 'active';
 	currentData = document.getElementById('content');
-	currentDivs = currentData.getElementsByTagName('div');
+	currentDivs = currentData.getElementsByTagName('DIV');
 	for (i = 0; i < currentDivs.length; i++) {
 	currentDivs[i].style.display = 'none';
 	}
 }
 
 function showPage(current, pageId) {
-	hideAll();
+	hideAll(current);
+	unselectInactive();
 	current.className = 'active';
 	currentData = document.getElementById(pageId);
 	currentData.style.display = 'block';
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.737 loncom/interface/loncommon.pm:1.738
--- loncom/interface/loncommon.pm:1.737	Fri Jan 30 09:05:36 2009
+++ loncom/interface/loncommon.pm	Fri Jan 30 11:39:38 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.737 2009/01/30 09:05:36 tempelho Exp $
+# $Id: loncommon.pm,v 1.738 2009/01/30 11:39:38 tempelho Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5637,7 +5637,8 @@
 	font-weight:bold;
 	white-space:nowrap;
 }
-ul.LC_TabContent   li:hover{
+
+ul.LC_TabContent li:hover, ul.LC_TabContent li.active {
         background: url(/adm/lonIcons/lightGreyBG.png) repeat-x right bottom;
         color:#BF2317;
         text-decoration:none;