Diff for /loncom/xml/lonxml.pm between versions 1.501 and 1.502

version 1.501, 2009/11/30 21:17:41 version 1.502, 2009/11/30 21:29:41
Line 1612  FULLPAGE Line 1612  FULLPAGE
     }      }
 </script>  </script>
 FULLPAGE  FULLPAGE
           if ($filetype eq 'html') {            if ($filetype eq 'html' || $filetype eq 'tex') {
               $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');                $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');
               $dragmath_button = &Apache::lonhtmlcommon::dragmath_button('filecont',1);                $dragmath_button = &Apache::lonhtmlcommon::dragmath_button('filecont',1);
           }            }
Line 1742  sub handler { Line 1742  sub handler {
   
   
     my $file=&Apache::lonnet::filelocation("",$request->uri);      my $file=&Apache::lonnet::filelocation("",$request->uri);
     my $filetype;      my ($filetype,$breadcrumbtext);
     if ($file =~ /\.(sty|css|js|txt)$/) {      if ($file =~ /\.(sty|css|js|txt|tex)$/) {
  $filetype=$1;   $filetype=$1;
     } else {      } else {
  $filetype='html';   $filetype='html';
     }      }
       if ($filetype eq 'sty') {
           $breadcrumbtext = 'Style File Editor';
       } elsif ($filetype eq 'js') {
           $breadcrumbtext = 'Javascript Editor';
       } elsif ($filetype eq 'css') {
           $breadcrumbtext = 'CSS Editor';
       } elsif ($filetype eq 'txt') {
           $breadcrumbtext = 'Text Editor';
       } elsif ($filetype eq 'tex') {
           $breadcrumbtext = 'TeX Editor';
       } else {
           $breadcrumbtext = 'HTML Editor';
       }
   
 #  #
 # Edit action? Save file.  # Edit action? Save file.
Line 1782  ENDNOTFOUND Line 1795  ENDNOTFOUND
  $filecontents=&createnewsty();   $filecontents=&createnewsty();
             } elsif ($filetype eq 'js') {              } elsif ($filetype eq 'js') {
                 $filecontents=&createnewjs();                  $filecontents=&createnewjs();
             } elsif (($filetype ne 'css') && ($filetype ne 'txt')) {              } elsif ($filetype ne 'css' && $filetype ne 'txt' && $filetype ne 'tex') {
  $filecontents=&createnewhtml();   $filecontents=&createnewhtml();
     }      }
     $env{'form.editmode'}='Edit'; #force edit mode      $env{'form.editmode'}='Edit'; #force edit mode
Line 1806  ENDNOTFOUND Line 1819  ENDNOTFOUND
     # up if it did      # up if it did
         &Apache::structuretags::reset_problem_globals();          &Apache::structuretags::reset_problem_globals();
         &Apache::lonhomework::finished_parsing();          &Apache::lonhomework::finished_parsing();
               } elsif ($filetype eq 'tex') {
                   $result .= &Apache::lontexconvert::converted(\$filecontents);
             } else {              } else {
                 $result = $filecontents;                  $result = $filecontents;
             }              }
Line 1813  ENDNOTFOUND Line 1828  ENDNOTFOUND
     ['rawmode']);      ['rawmode']);
     if ($env{'form.rawmode'}) { $result = $filecontents; }      if ($env{'form.rawmode'}) { $result = $filecontents; }
             if ($filetype ne 'html') {              if ($filetype ne 'html') {
                 my $nochgview = 1;                   my $nochgview = 1;
                 my $controls = '';                  my $controls = '';
                     if ($env{'request.state'} eq 'construct') {                      if ($env{'request.state'} eq 'construct') {
                         $controls = &Apache::loncommon::head_subbox(                          $controls = &Apache::loncommon::head_subbox(
                                         &Apache::loncommon::CSTR_pageheader()                                          &Apache::loncommon::CSTR_pageheader()
                                        .&Apache::londefdef::edit_controls($nochgview));                                         .&Apache::londefdef::edit_controls($nochgview));
                     }                      }
                 if ($filetype ne 'sty') {                  if ($filetype ne 'sty' && $filetype ne 'tex') {
                     $result =~ s/</&lt;/g;                      $result =~ s/</&lt;/g;
                     $result =~ s/>/&gt;/g;                      $result =~ s/>/&gt;/g;
                     $result = '<table class="LC_sty_begin">'.                      $result = '<table class="LC_sty_begin">'.
Line 1833  ENDNOTFOUND Line 1848  ENDNOTFOUND
                         $brcrum = [{'href' => &Apache::loncommon::authorspace(),                          $brcrum = [{'href' => &Apache::loncommon::authorspace(),
                                     'text' => 'Construction Space'},                                      'text' => 'Construction Space'},
                                    {'href' => '',                                     {'href' => '',
                                     'text' => 'Editor'}];                                      'text' => $breadcrumbtext}];
                     } else {                      } else {
                         $brcrum = ''; # FIXME: Where are we?                          $brcrum = ''; # FIXME: Where are we?
                     }                      }
Line 1873  ENDNOTFOUND Line 1888  ENDNOTFOUND
                             'href' => &Apache::loncommon::authorspace(),                              'href' => &Apache::loncommon::authorspace(),
                             'text' => 'Construction Space'},                              'text' => 'Construction Space'},
                            {'href' => '',                             {'href' => '',
                             'text' => 'HTML Editor'}];                              'text' => $breadcrumbtext}];
                 $header = &Apache::loncommon::head_subbox(                  $header = &Apache::loncommon::head_subbox(
                               &Apache::loncommon::CSTR_pageheader());                                &Apache::loncommon::CSTR_pageheader());
             }              }

Removed from v.1.501  
changed lines
  Added in v.1.502


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>