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

raeburn raeburn at source.lon-capa.org
Sun Nov 17 09:40:31 EST 2013


raeburn		Sun Nov 17 14:40:31 2013 EDT

  Modified files:              
    /loncom/interface	londocs.pm lonhtmlcommon.pm 
  Log:
  - Course Editor's inline menu:
    - Update identifiers in active form field to reflect changes in categorization
    - Append tab identifier to activeTab set in lonhtmlcommon::resize_scrollbox_js()
      so icons/links  are still displayed for selected inline menu item after 
      completed action.
    - Clicking on a currently selected inline menu item will now deselect it.
  
  
-------------- next part --------------
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.569 loncom/interface/londocs.pm:1.570
--- loncom/interface/londocs.pm:1.569	Wed Nov 13 13:32:33 2013
+++ loncom/interface/londocs.pm	Sun Nov 17 14:40:31 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.569 2013/11/13 13:32:33 raeburn Exp $
+# $Id: londocs.pm,v 1.570 2013/11/17 14:40:31 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4638,9 +4638,11 @@
                 $script .= &dump_switchserver_js(@hosts); 
             }
         } else {
+            my $tid = 1;
             my @tabids;
             if ($supplementalflag) {
                 @tabids = ('002','ee2','ff2');
+                $tid = 2;
             } else {
                 @tabids = ('aa1','bb1','cc1','ff1');
                 unless ($env{'form.folderpath'} =~ /\:1$/) {
@@ -4652,7 +4654,7 @@
 	    $script .= &editing_js($udom,$uname,$supplementalflag).
                        &history_tab_js().
                        &inject_data_js().
-                       &Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr).
+                       &Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid).
                        &Apache::lonextresedit::extedit_javascript();
             $addentries = {
                             onload   => "javascript:resize_scrollbox('contentscroll','1','1');",
@@ -4947,7 +4949,7 @@
 
 	my $newnavform=(<<NNFORM);
 	<form action="/adm/coursedocs" method="post" name="newnav">
-	<input type="hidden" name="active" value="cc" />
+	<input type="hidden" name="active" value="ee" />
 	$pathitem
 	<input type="hidden" name="importdetail" 
 	value="$lt{'navc'}=/adm/navmaps" />
@@ -4957,7 +4959,7 @@
 NNFORM
 	my $newsmppageform=(<<NSPFORM);
 	<form action="/adm/coursedocs" method="post" name="newsmppg">
-	<input type="hidden" name="active" value="cc" />
+	<input type="hidden" name="active" value="ee" />
 	$pathitem
 	<input type="hidden" name="importdetail" value="" />
 	<a class="LC_menubuttons_link" href="javascript:makesmppage();"> $lt{'sipa'}</a>
@@ -4998,7 +5000,7 @@
 
 	my $newbulform=(<<NBFORM);
 	<form action="/adm/coursedocs" method="post" name="newbul">
-	<input type="hidden" name="active" value="cc" />
+	<input type="hidden" name="active" value="dd" />
 	$pathitem
 	<input type="hidden" name="importdetail" value="" />
 	<a class="LC_menubuttons_link" href="javascript:makebulboard();" >$lt{'bull'}</a>
@@ -5008,7 +5010,7 @@
 
 	my $newaboutmeform=(<<NAMFORM);
 	<form action="/adm/coursedocs" method="post" name="newaboutme">
-	<input type="hidden" name="active" value="cc" />
+	<input type="hidden" name="active" value="dd" />
 	$pathitem
 	<input type="hidden" name="importdetail" 
 	value="$plainname=/adm/$udom/$uname/aboutme" />
@@ -5019,7 +5021,7 @@
 
 	my $newaboutsomeoneform=(<<NASOFORM);
 	<form action="/adm/coursedocs" method="post" name="newaboutsomeone">
-	<input type="hidden" name="active" value="cc" />
+	<input type="hidden" name="active" value="dd" />
 	$pathitem
 	<input type="hidden" name="importdetail" value="" />
 	<a class="LC_menubuttons_link" href="javascript:makeabout();">$lt{'abou'}</a>
@@ -5028,7 +5030,7 @@
 
 	my $newrosterform=(<<NROSTFORM);
 	<form action="/adm/coursedocs" method="post" name="newroster">
-	<input type="hidden" name="active" value="cc" />
+	<input type="hidden" name="active" value="dd" />
 	$pathitem
 	<input type="hidden" name="importdetail" 
 	value="$lt{'rost'}=/adm/viewclasslist" />
@@ -5049,7 +5051,7 @@
         }
         my $newwebpageform =(<<NWEBFORM);
         <form action="/adm/coursedocs" method="post" name="newwebpage">
-        <input type="hidden" name="active" value="cc" />
+        <input type="hidden" name="active" value="ee" />
         $pathitem
         <input type="hidden" name="importdetail" value="$newwebpage" />
         <a class="LC_menubuttons_link" href="javascript:makewebpage();">$lt{'webp'}</a>
@@ -5073,7 +5075,7 @@
 	<form action="/adm/coursedocs" method="post" name="newpage">
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
-	<input type="hidden" name="active" value="cc" />
+	<input type="hidden" name="active" value="ee" />
 	<a class="LC_menubuttons_link" href="javascript:makenewpage(document.newpage,'$pageseq');">$lt{'newp'}</a>
 	$help{'Adding_Pages'}
 	</form>
@@ -5084,14 +5086,14 @@
 	<form action="/adm/coursedocs" method="post" name="newfolder">
 	$pathitem
 	<input type="hidden" name="importdetail" value="" />
-	<input type="hidden" name="active" value="aa" />
+	<input type="hidden" name="active" value="" />
 	<a href="javascript:makenewfolder(document.newfolder,'$folderseq');">$lt{'newf'}</a>$help{'Adding_Folders'}
 	</form>
 NFFORM
 
 	my $newsylform=(<<NSYLFORM);
 	<form action="/adm/coursedocs" method="post" name="newsyl">
-	<input type="hidden" name="active" value="cc" />
+	<input type="hidden" name="active" value="ee" />
 	$pathitem
 	<input type="hidden" name="importdetail" 
 	value="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" />
@@ -5103,7 +5105,7 @@
 
 	my $newgroupfileform=(<<NGFFORM);
 	<form action="/adm/coursedocs" method="post" name="newgroupfiles">
-	<input type="hidden" name="active" value="cc" />
+	<input type="hidden" name="active" value="dd" />
 	$pathitem
 	<input type="hidden" name="importdetail"
 	value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" />
@@ -5220,7 +5222,7 @@
 
 	my $supnewfolderform=(<<SNFFORM);
 	<form action="/adm/coursedocs" method="post" name="supnewfolder">
-	<input type="hidden" name="active" value="ee" />
+	<input type="hidden" name="active" value="" />
         $pathitem
 	<input type="hidden" name="importdetail" value="" />
 	<a class="LC_menubuttons_link" href="javascript:makenewfolder(document.supnewfolder,'$folderseq');">$lt{'newf'}</a> 
@@ -5585,7 +5587,7 @@
     my $form;
     my $activetab;
     my $active;
-    if (($env{'form.active'} ne '') && ($env{'form.active'} ne 'aa')) {
+    if (($env{'form.active'} ne '') && ($env{'form.active'} ne '00')) {
         $activetab = $env{'form.active'};
     }
     my $backicon = $iconpath.'clickhere.gif';
@@ -5620,7 +5622,7 @@
             $form .= '<li style="float:right" '.$active
                 .' onclick="javascript:showPage(this, \''.$name.$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');"><a href="javascript:;"><b>'.&mt(${$orderhash{$name}}[0]).'</b></a></li>'."\n";
         } else {
-	    $form .= '<li '.$active.' style="float:right">'.${$orderhash{$name}}[1].'</li>'."\n";
+	    $form .= '<li style="float:right">'.${$orderhash{$name}}[1].'</li>'."\n";
 
 	}
     }
@@ -6183,10 +6185,12 @@
 
 function hideAll(current, nav, data) {
 unselectInactive(nav);
-if(current.className == 'right'){
-	current.className = 'right active'
-	}else{
-	current.className = 'active';
+if (current) { 
+    if (current.className == 'right'){
+        current.className = 'right active'
+    } else {
+        current.className = 'active';
+    }
 }
 currentData = document.getElementById(data);
 currentDivs = currentData.getElementsByTagName('DIV');
@@ -6217,10 +6221,24 @@
 }
 
 function showPage(current, pageId, nav, data) {
+        currstate = current.className;
 	hideAll(current, nav, data);
 	openTabs(pageId);
 	unselectInactive(nav);
-	current.className = 'active';
+        if ((currstate == 'active') || (currstate == 'right active')) {
+            if (currstate == 'active') {
+	        current.className = '';
+            } else {
+                current.className = 'right';
+            }
+            activeTab = ''; 
+            toggleUpload();
+            toggleMap();
+            resize_scrollbox('contentscroll','1','0');
+            return;
+        } else {
+            current.className = 'active';
+        }
 	currentData = document.getElementById(pageId);
 	currentData.style.display = 'block';
         activeTab = pageId;
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.352 loncom/interface/lonhtmlcommon.pm:1.353
--- loncom/interface/lonhtmlcommon.pm:1.352	Mon Jul 22 11:46:23 2013
+++ loncom/interface/lonhtmlcommon.pm	Sun Nov 17 14:40:31 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.352 2013/07/22 11:46:23 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.353 2013/11/17 14:40:31 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2938,7 +2938,7 @@
 ##############################################
 
 sub resize_scrollbox_js {
-    my ($context,$tabidstr) = @_;
+    my ($context,$tabidstr,$tid) = @_;
     my (%names,$paddingwfrac,$offsetwfrac,$offsetv,$minw,$minv);
     if ($context eq 'docs') {
         %names = (
@@ -2974,9 +2974,11 @@
 
 ';
     if ($context eq 'docs') {
-        $output .= '
-var activeTab;
-';
+        if ($env{'form.active'}) {
+            $output .= "\nvar activeTab = '$env{'form.active'}$tid';\n";
+        } else {
+            $output .= "\nvar activeTab = '';\n";
+        }
     }
     $output .=  <<"FIRST";
 


More information about the LON-CAPA-cvs mailing list