Diff for /loncom/xml/lonxml.pm between versions 1.451 and 1.452

version 1.451, 2007/08/17 21:24:21 version 1.452, 2007/08/18 00:08:36
Line 1355  sub inserteditinfo { Line 1355  sub inserteditinfo {
 #      my $editheader='<a href="#editsection">Edit below</a><hr />';  #      my $editheader='<a href="#editsection">Edit below</a><hr />';
       my $xml_help = '';        my $xml_help = '';
       my $initialize='';        my $initialize='';
       my $add_to_onload;        my $textarea_id = 'filecont';
         my ($add_to_onload, $add_to_onresize);
       if ($filetype eq 'html') {        if ($filetype eq 'html') {
   my $addbuttons=&Apache::lonhtmlcommon::htmlareaaddbuttons();    my $addbuttons=&Apache::lonhtmlcommon::htmlareaaddbuttons();
   $initialize=&Apache::lonhtmlcommon::spellheader();    $initialize=&Apache::lonhtmlcommon::spellheader();
   if (!&Apache::lonhtmlcommon::htmlareablocked() &&    if (!&Apache::lonhtmlcommon::htmlareablocked() &&
       &Apache::lonhtmlcommon::htmlareabrowser()) {        &Apache::lonhtmlcommon::htmlareabrowser()) {
         $textarea_id .= '_htmlarea';
       $initialize.=(<<FULLPAGE);        $initialize.=(<<FULLPAGE);
 <script type="text/javascript">  <script type="text/javascript">
 $addbuttons  $addbuttons
Line 1375  $addbuttons Line 1377  $addbuttons
    function () {     function () {
        HTMLArea._addEvents(editor._doc,         HTMLArea._addEvents(editor._doc,
    ["keypress","mousedown"], unClean);     ["keypress","mousedown"], unClean);
          editor._iframe.id = '$textarea_id';
          resize_textarea('$textarea_id','LC_aftertextarea');";
    },300);     },300);
     }      }
 </script>  </script>
Line 1384  FULLPAGE Line 1388  FULLPAGE
 <script type="text/javascript">  <script type="text/javascript">
 $addbuttons  $addbuttons
     function initDocument() {      function initDocument() {
    resize_textarea('$textarea_id','LC_aftertextarea');";
     }      }
 </script>  </script>
 FULLPAGE  FULLPAGE
   }    }
   $add_to_onload = 'initDocument();';    $add_to_onload = 'initDocument();';
     $add_to_onresize = "resize_textarea('$textarea_id','LC_aftertextarea');";
   $xml_help=&Apache::loncommon::helpLatexCheatsheet();    $xml_help=&Apache::loncommon::helpLatexCheatsheet();
       }        }
   
       my $cleanbut = '';        my $cleanbut = '';
   
       my $titledisplay=&display_title();        my $titledisplay=&display_title();
Line 1418  $xml_help Line 1425  $xml_help
 <input type="hidden" name="editmode" value="$lt{'ed'}" />  <input type="hidden" name="editmode" value="$lt{'ed'}" />
 $buttons<br />  $buttons<br />
 <textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea>  <textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea>
   <div id="LC_aftertextarea">
 <br />$buttons  <br />$buttons
 <br />  <br />
 </form>  
 $titledisplay  $titledisplay
   </div>
   </form>
 </body>  </body>
 ENDFOOTER  ENDFOOTER
       return ($editfooter,$add_to_onload);;        return ($editfooter,$add_to_onload,$add_to_onresize);;
 }  }
   
 sub get_target {  sub get_target {
Line 1535  ENDNOTFOUND Line 1544  ENDNOTFOUND
     unless ($env{'request.state'} eq 'published') {      unless ($env{'request.state'} eq 'published') {
  if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))   if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))
  {   {
     my ($edit_info, $add_to_onload)=      my ($edit_info, $add_to_onload, $add_to_onresize)=
  &inserteditinfo($filecontents,$filetype);   &inserteditinfo($filecontents,$filetype);
   
     my $displayfile=$request->uri;      my $displayfile=$request->uri;
     $displayfile=~s/^\/[^\/]*//;      $displayfile=~s/^\/[^\/]*//;
     my %options =       my %options = 
  ('add_entries' =>   ('add_entries' =>
     {'onload'   => $add_to_onload, });                     {'onresize' => $add_to_onresize,
       'onload'   => $add_to_onload,   });
   
     if ($env{'environment.remote'} ne 'off') {      if ($env{'environment.remote'} ne 'off') {
  $options{'bgcolor'}   = '#FFFFFF';   $options{'bgcolor'}   = '#FFFFFF';
  $options{'only_body'} = 1;   $options{'only_body'} = 1;
     }      }
     my $js = &Apache::edit::js_change_detection();      my $js =
    &Apache::edit::js_change_detection().
    &Apache::loncommon::resize_textarea_js();
     my $start_page = &Apache::loncommon::start_page(undef,$js,      my $start_page = &Apache::loncommon::start_page(undef,$js,
     \%options);      \%options);
     $result=$start_page.      $result=$start_page.

Removed from v.1.451  
changed lines
  Added in v.1.452


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