[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /xml lonxml.pm

raeburn raeburn at source.lon-capa.org
Sat Jun 21 19:39:28 EDT 2014


raeburn		Sat Jun 21 23:39:28 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/xml	lonxml.pm 
  Log:
  - For 2.11
    - Backport 1.548.
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.531.2.15 loncom/xml/lonxml.pm:1.531.2.16
--- loncom/xml/lonxml.pm:1.531.2.15	Sat Jun 21 20:58:12 2014
+++ loncom/xml/lonxml.pm	Sat Jun 21 23:39:27 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.531.2.15 2014/06/21 20:58:12 raeburn Exp $
+# $Id: lonxml.pm,v 1.531.2.16 2014/06/21 23:39:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1615,52 +1615,56 @@
       my $xml_help = '';
       my $initialize='';
       my $textarea_id = 'filecont';
-      my ($dragmath_button,$deps_button);
-      my ($add_to_onload, $add_to_onresize);
+      my ($dragmath_button,$deps_button,$context,$cnum,$cdom,$add_to_onload,
+          $add_to_onresize,$init_dragmath);
       $initialize=&Apache::lonhtmlcommon::spellheader();
-      if (($filetype eq 'html') && (&Apache::lonhtmlcommon::htmlareabrowser())) {
-	  my $lang = &Apache::lonhtmlcommon::htmlarea_lang();
-          my %textarea_args = (
-                                fullpage => 'true',
-                                dragmath => 'math',
-                              );
-          $initialize .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); 
+      if ($filetype eq 'html') {
+          if ($env{'request.course.id'}) {
+              $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+              $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+              if ($uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E}) {
+                  $context = 'syllabus';
+              }
+          }
+          if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+	      my $lang = &Apache::lonhtmlcommon::htmlarea_lang();
+              my %textarea_args = (
+                                    fullpage => 'true',
+                                    dragmath => 'math',
+                                  );
+              $initialize .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args);
+              if ($context eq 'syllabus') {
+                  $init_dragmath = "editmath_visibility('filecont','none')";
+              }
+          }
       }
       $initialize .= (<<FULLPAGE);
 <script type="text/javascript">
 // <![CDATA[
     function initDocument() {
 	resize_textarea('$textarea_id','LC_aftertextarea');
+        $init_dragmath
     }
 // ]]>
 </script>
 FULLPAGE
       my $textareaclass;
       if ($filetype eq 'html') {
-          my $context;
-          if ($env{'request.course.id'}) {
-              my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
-              my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
-              if ($uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E}) {
-                  $context = 'syllabus';
-                  $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
-                  $initialize .=
-                      &Apache::lonhtmlcommon::dependencycheck_js(undef,&mt('Syllabus'),
-                                                                 $uri,undef,
-                                                                 "/public/$cdom/$cnum/syllabus").
-                      "\n";
-                  if (&Apache::lonhtmlcommon::htmlareabrowser()) {
-                      $textareaclass = 'class="LC_richDefaultOn"';
-                  }
-              }
-          }
-          unless ($context eq 'syllabus') {
-              if ($symb || $folderpath) {
-                  $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
-                  $initialize .=
-                      &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle,
-                                                                 undef,$folderpath,$uri)."\n";
+          if ($context eq 'syllabus') {
+              $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
+              $initialize .=
+                  &Apache::lonhtmlcommon::dependencycheck_js(undef,&mt('Syllabus'),
+                                                             $uri,undef,
+                                                             "/public/$cdom/$cnum/syllabus").
+                  "\n";
+              if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+                  $textareaclass = 'class="LC_richDefaultOn"';
               }
+          } elsif ($symb || $folderpath) {
+              $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
+              $initialize .=
+                  &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle,
+                                                             undef,$folderpath,$uri)."\n";
           }
           $dragmath_button = '<span id="math_filecont">'.&Apache::lonhtmlcommon::dragmath_button('filecont',1).'</span>';
           $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');




More information about the LON-CAPA-cvs mailing list