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

tempelho tempelho@source.lon-capa.org
Wed, 01 Jul 2009 13:16:42 -0000


tempelho		Wed Jul  1 13:16:42 2009 EDT

  Modified files:              
    /loncom/interface	loncommon.pm londocs.pm 
  Log:
  loncommon: 
  	A few style Changes for LC_TabContent, inserted a LC_TabContent .right to displace the span tags used until now.
  londocs:
  	Making changes of the javascript functions hideAll, showPage and unselectInactive to support the usage of .right class.
  	Starting to generate a new javascript function showPage to let selected subtabs stay open, while switching the main tab.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.846 loncom/interface/loncommon.pm:1.847
--- loncom/interface/loncommon.pm:1.846	Tue Jun 30 10:18:52 2009
+++ loncom/interface/loncommon.pm	Wed Jul  1 13:16:41 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.846 2009/06/30 10:18:52 bisitz Exp $
+# $Id: loncommon.pm,v 1.847 2009/07/01 13:16:41 tempelho Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5800,7 +5800,7 @@
 }
 
 .LC_Box > .LC_hcell {
-    margin: 0 -10px;
+    margin: 0 -10px 10px -10px;
 }
 
 .LC_noBorder {
@@ -5895,14 +5895,22 @@
     vertical-align: middle;
 }
 
-ul.LC_TabContent ,
-ul.LC_TabContentBigger {
+ul.LC_TabContent {
 	display:block;
+	background: $sidebg;
+	border-bottom: solid 1px $lg_border_color
 	list-style:none;
-	margin: 0;
+	margin: -10px -10px 0 -10px;
 	padding: 0;
 }
 
+ul.LC_TabContentBigger {
+        display:block;
+        list-style:none;
+        padding: 0;
+}
+
+
 ul.LC_TabContent li,
 ul.LC_TabContentBigger li {
 	display: inline;
@@ -5918,7 +5926,7 @@
 }
 
 ul.LC_TabContent {
-	min-height:1.6em;
+	min-height:1.5em;
 }
 
 ul.LC_TabContent li {
@@ -5928,6 +5936,10 @@
 	border-bottom:solid 1px $lg_border_color;
 }
 
+ul.LC_TabContent .right {
+	float:right;
+}
+
 ul.LC_TabContent li a, ul.LC_TabContent li {
 	color:rgb(47,47,47);
 	text-decoration:none;
@@ -5957,7 +5969,7 @@
 
 ul.LC_TabContentBigger li:hover, 
 ul.LC_TabContentBigger li.active {
-	background:url(/adm/lonIcons/lightGreyBG.png) repeat-x right bottom;
+	background: #ffffff;
 }
 
 ul.LC_TabContentBigger li, 
@@ -5996,6 +6008,8 @@
 .LC_Box {
     border: solid 1px $lg_border_color;
     padding: 0 10px 10px 10px;
+    margin: 0;
+    clear: both;
 }
 
 .LC_AboutMe_Image {
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.373 loncom/interface/londocs.pm:1.374
--- loncom/interface/londocs.pm:1.373	Wed Jun 17 17:36:25 2009
+++ loncom/interface/londocs.pm	Wed Jul  1 13:16:42 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.373 2009/06/17 17:36:25 bisitz Exp $
+# $Id: londocs.pm,v 1.374 2009/07/01 13:16:42 tempelho Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2933,7 +2933,7 @@
         }
     }
     $r->print('<li '.$active.' onclick="javascript:showPage(this,\'supplCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>');
-    $r->print('</ul><div class="LC_Box" style="margin:0 0;padding:0 0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;">');
+    $r->print('</ul><div class="LC_Box"><div id="maincoursedoc" style="margin:0 0;padding:0 0;">');
 # --------------------------------------------------------- Standard documents
        my $savefolderpath;
        my $active = 'style="display: none;"';
@@ -3303,7 +3303,7 @@
                 );
 
 my $tid='2';
-my $varscd = 'supplCourseDocuments';
+my $varscd = 'Supplemental Course Documents';
 
 $r->print(&generate_edit_table($tid,$varscd,\%suporderhash));
 my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
@@ -3377,18 +3377,18 @@
     foreach my $name (sort(keys(%orderhash))){
         if($name eq 'zz'){
             if($activetab ne ''){
-               $active = '';
+               $active = 'class="right"';
             }else{
-               $active = 'class="active"';
+               $active = 'class="right active"';
             }
-            $form .= '<span class="LC_Right"><li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" '.$active.'>'.&mt(${$orderhash{$name}}[0]).'</li></span>';
+            $form .= '<li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" '.$active.'>'.&mt(${$orderhash{$name}}[0]).'</li>';
         }else{
             if($activetab eq '' || $activetab ne $name){
                $active = '';
             }elsif($activetab eq $name){
                $active = 'class="active"';
             }
-            $form .= '<li '.$active.' onclick="javascript:showPage(this, \''.substr(${$orderhash{$name}}[0],0,3).$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>';
+            $form .= '<li '.$active.' onclick="javascript:showPage(this, \''.$name.$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>';
         }
     }
     $form .= '</ul>';
@@ -3400,7 +3400,7 @@
         }elsif($activetab eq $field){
                 $active = 'style="display:block;"';
         }
-           $form .= '<div id="'.substr(${$orderhash{$field}}[0],0,3).$tid.'"'
+           $form .= '<div id="'.$field.$tid.'"'
                    .' class="LC_ContentBox" '.$active.'>'.${$orderhash{$field}}[1]
                    .'</div>';
         }
@@ -3615,13 +3615,21 @@
 currentNav = document.getElementById(nav);
 currentLis = currentNav.getElementsByTagName('LI');
 for (i = 0; i < currentLis.length; i++) {
-	currentLis[i].className = 'i';
+	if(currentLis[i].className == 'right active' || currentLis[i].className == 'right'){
+		currentLis[i].className = 'right';
+	}else{
+		currentLis[i].className = 'i';
+	}
 }
 }
 
 function hideAll(current, nav, data) {
 unselectInactive(nav);
-current.className = 'active';
+if(current.className == 'right'){
+	current.className = 'right active'
+	}else{
+	current.className = 'active';
+}
 currentData = document.getElementById(data);
 currentDivs = currentData.getElementsByTagName('DIV');
 for (i = 0; i < currentDivs.length; i++) {
@@ -3631,7 +3639,21 @@
 }
 }
 
+function openTabs(pageId) {
+	tabnav = document.getElementById(pageId).getElementsByTagName('UL');	
+	if(tabnav.length > 0 ){
+		currentNav = document.getElementById(tabnav[0].id);
+		currentLis = currentNav.getElementsByTagName('LI');
+		for(i = 0; i< currentLis.length; i++){
+			if(currentLis[i].className == 'active') {
+				currentLis[i].onclick;
+			}	
+		}
+	}
+}
+
 function showPage(current, pageId, nav, data) {
+	/*openTabs(pageId);*/
 	hideAll(current, nav, data);
 	unselectInactive(nav);
 	current.className = 'active';