Diff for /rat/lonratedt.pm between versions 1.105.2.7 and 1.112

version 1.105.2.7, 2015/03/11 21:09:04 version 1.112, 2016/01/15 19:13:04
Line 43  use HTML::Entities(); Line 43  use HTML::Entities();
 # --------------------------------------------------------- Build up RAT screen  # --------------------------------------------------------- Build up RAT screen
 sub ratedt {  sub ratedt {
   my ($r,$url)=@_;    my ($r,$url)=@_;
   my %layout = ('border' => "0");  
   if ($env{'environment.remote'} eq 'off') {  
       $layout{'rows'} = "1,250,*";  
   } else {  
       $layout{'rows'} = "1,70,*";  
   }  
   my $js ='  
 <script type="text/javascript">  
     var flag=0;  
 </script>';  
   
   my $start_page =   
       &Apache::loncommon::start_page('Edit Sequence',$js,  
      {'frameset'    => 1,  
       'add_entries' => \%layout});  
   
   my $end_page =   
       &Apache::loncommon::end_page({'frameset' => 1});  
   
   $r->print(<<ENDDOCUMENT);    $r->print(<<ENDDOCUMENT);
 $start_page  <!DOCTYPE html>
 <frame name="server" src="$url/loadonly/ratserver" noresize="noresize"  <html>
        noscroll="noscroll" />    <head>
 <frame name="code" src="$url/loadonly/adveditmenu" />      <title>Edit Sequence</title>
 <frame name="mapout" src="/adm/rat/map.html" />      
 $end_page      <style>
   html, body {
     margin: 0;
     padding: 0;
   }
   #server {
     display: none;
   }
   #top {
     position: absolute;
     left: 0;
     top: 0;
     width: 100%;
     height: 20%;
     border: 0;
   }
   #bottom {
     position: absolute;
     left: 0;
     bottom: 0;
     width: 100%;
     height: 80%;
     border: 0;
   }
   #code, #mapout {
     position: absolute;
     width: 100%;
     height: 100%;
     border: 0;
   }
   #infout {
     position: absolute;
     z-index: 1;
     right: 16px;
     bottom: 0;
     width: 420px;
     min-width: 200px;
     height: 300px;
     border: 1px solid black;
     overflow: auto;
   }
       </style>
     </head>
     
     <body>
       <iframe id="server" name="server" src="$url/loadonly/ratserver"></iframe>
       <div id="top"><iframe id="code" name="code" src="$url/loadonly/adveditmenu"></iframe></div>
       <div id="bottom"><iframe id="mapout" name="mapout" src="/adm/rat/map.html"></iframe></div>
       <iframe id="infout"></iframe>
       <script>
   var flag=0;
   
   var resize = function(e) {
       // auto-resize top iframe
       var code = document.getElementById('code');
       var codedoc = (code.contentDocument) ? code.contentDocument : code.contentWindow.document;
       var top = document.getElementById('top');
       top.style.height = ''; // reset height in case it needs to be reduced
       codedoc.body.style.overflow = 'hidden'; // to hide scrollbar
       var topHeight = codedoc.body.scrollHeight;
       top.style.height = topHeight + 'px';
       // set remainder to the other iframe
       var bottom = document.getElementById('bottom');
       bottom.style.height = window.innerHeight - topHeight + 'px';
       // fix right position of infout depending on scrollbar width
       var mapout = document.getElementById('mapout');
       var mapoutdoc = (mapout.contentDocument) ? mapout.contentDocument : mapout.contentWindow.document;
       var infout = document.getElementById('infout');
       infout.style.right = (mapout.offsetWidth - mapoutdoc.body.clientWidth) + 'px';
   }
   var iframe = document.getElementById('code');
   iframe.onload = resize;
   window.addEventListener('resize', resize, false);
       </script>
       
     </body>
   </html>
 ENDDOCUMENT  ENDDOCUMENT
 }  }
   
Line 235  sub smpedt { Line 292  sub smpedt {
        unless ($fatal) {         unless ($fatal) {
    $targetmsg=&Apache::lonhtmlcommon::confirm_success(&mt('Saved'));     $targetmsg=&Apache::lonhtmlcommon::confirm_success(&mt('Saved'));
        } else {         } else {
            $targetmsg=&Apache::lonhtmlcommon::confirm_success(     $targetmsg=&Apache::lonhtmlcommon::confirm_success(
                             &mt('An error occurred while saving.'),1);                            &mt('An error occurred while saving.'),1);
        }         }
    }     }
    if ($env{'form.revert'}) {     if ($env{'form.revert'}) {
Line 245  sub smpedt { Line 302  sub smpedt {
        my ($errtext,$fatal)=         my ($errtext,$fatal)=
    &LONCAPA::map::mapread(&Apache::lonnet::filelocation('',$url),'');     &LONCAPA::map::mapread(&Apache::lonnet::filelocation('',$url),'');
    }     }
    $targetmsg = &Apache::loncommon::confirmwrapper($targetmsg) if ($targetmsg);      $targetmsg = &Apache::loncommon::confirmwrapper($targetmsg) if ($targetmsg);
    if (-e $tmpfn) {     if (-e $tmpfn) {
        $targetmsg=        $targetmsg=
            '<p class="LC_warning">'          '<p class="LC_warning">'
           .&mt('You are working with an unsaved version of your map.')         .&mt('You are working with an unsaved version of your map.')
           .'</p>';         .'</p>';
        my ($errtext,$fatal)=&LONCAPA::map::mapread($tmpfn,'');        my ($errtext,$fatal)=&LONCAPA::map::mapread($tmpfn,'');
    }     }
    $errtext = '<p class="LC_error">'.$errtext.'</p>' if ($errtext);     $errtext = '<p class="LC_error">'.$errtext.'</p>' if ($errtext);
 # ---------------------------------------------------------- Process form input  # ---------------------------------------------------------- Process form input
Line 496  sub smpedt { Line 553  sub smpedt {
    my $editscript=&editscript('simple');     my $editscript=&editscript('simple');
   
    my %lt=&Apache::lonlocal::texthash(     my %lt=&Apache::lonlocal::texthash(
                                       'sm' => 'Select Map',        'sm' => 'Select Map',
       'sa' => 'Save',        'sa' => 'Save',
       'nt' => 'New Title',        'nt' => 'New Title',
       'se' => 'Search',        'se' => 'Search',
Line 629  $importwindow Line 686  $importwindow
 </td>  </td>
 <td bgcolor="#FFFFAA" align="center">  <td bgcolor="#FFFFAA" align="center">
 $lt{'cs'}<br />  $lt{'cs'}<br />
 <input type="submit" name="cut" value="&lt;&lt;&lt;" /><p>  <input type="submit" name="cut" value="&lt;&lt;&lt;" />
 <hr />  <hr />
 $lt{'ps'}<br />  $lt{'ps'}<br />
 <input type="submit" name="copy" value="&lt;--" /><p>  <input type="submit" name="copy" value="&lt;--" />
 <h /r>  <hr />
 $lt{'pas'}<br />  $lt{'pas'}<br />
 <input type="submit" name="paste" value="--&gt;" />  <input type="submit" name="paste" value="--&gt;" />
 </td>  </td>

Removed from v.1.105.2.7  
changed lines
  Added in v.1.112


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