Diff for /rat/lonwrapper.pm between versions 1.63 and 1.64

version 1.63, 2017/05/10 13:49:21 version 1.64, 2017/05/10 19:25:28
Line 38  use Apache::loncommon(); Line 38  use Apache::loncommon();
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
 use Apache::lonextresedit();  use Apache::lonextresedit();
 use Apache::lonexttool();  use Apache::lonexttool();
 use LONCAPA qw(:DEFAULT :match);;  use LONCAPA qw(:DEFAULT :match);
   use HTML::Entities();
   
 # ================================================================ Main Handler  # ================================================================ Main Handler
 sub wrapper {  sub wrapper {
Line 104  sub wrapper { Line 105  sub wrapper {
             if ($linktext eq '') {              if ($linktext eq '') {
                 $linktext = &mt('Launch External Tool');                  $linktext = &mt('Launch External Tool');
             }              }
               $url = &HTML::Entities::encode($url,'"<>&');
             if ($exttool eq 'tab') {              if ($exttool eq 'tab') {
                 $output .= '<div>'.                  $output .= '<div>'.
                            '<a href="'.$url.'" target="LCExternalToolTab" style="padding:0;clear:both;margin:0;border:0">'.                             '<a href="'.$url.'" target="LCExternalToolTab" style="padding:0;clear:both;margin:0;border:0">'.
Line 112  sub wrapper { Line 114  sub wrapper {
             } else {              } else {
                 $output .= <<"ENDLINK";                  $output .= <<"ENDLINK";
 <script type="text/javascript">  <script type="text/javascript">
   // <![CDATA[
 var windowObjectReference = null;   var windowObjectReference = null; 
 var PreviousUrl;   var PreviousUrl; 
                                                         
Line 128  function openSinglePopup(strUrl) { Line 131  function openSinglePopup(strUrl) {
     };      };
     PreviousUrl = strUrl;      PreviousUrl = strUrl;
 }  }
   // ]]>
 </script>  </script>
 <div>  <div>
 <a href="$url" target="LCExternalToolPopUp" onclick="openSinglePopup(this.href); return false;">  <a href="$url" target="LCExternalToolPopUp" onclick="openSinglePopup(this.href); return false;">
Line 139  ENDLINK Line 143  ENDLINK
                 $output .= '<div>'.$explanation.'</div>';                  $output .= '<div>'.$explanation.'</div>';
             }              }
         } else {          } else {
               my $dest = &HTML::Entities::encode($url.$anchor,'&<>"');
             $output .= '<div style="overflow:scroll; -webkit-overflow-scrolling:touch;">'."\n".              $output .= '<div style="overflow:scroll; -webkit-overflow-scrolling:touch;">'."\n".
                        '<iframe src="'.$url.$anchor.'" height="100%" width="100%" frameborder="0">'."\n".                         '<iframe src="'.$dest.'" height="100%" width="100%" frameborder="0">'."\n".
                        "$lt{'noif'} $noiframe\n".                         "$lt{'noif'} $noiframe\n".
                        "</iframe>\n".                         "</iframe>\n".
                        "</div>\n";                         "</div>\n";
Line 179  ENDLINK Line 184  ENDLINK
         window.onload = function(){  \$(window).trigger('resize') };          window.onload = function(){  \$(window).trigger('resize') };
 SCRIPT  SCRIPT
         # javascript will position the iframe if window was resized (or zoomed)          # javascript will position the iframe if window was resized (or zoomed)
           my $dest = &HTML::Entities::encode($url.$anchor,'&<>"');
         return <<ENDFRAME;          return <<ENDFRAME;
         $startpage          $startpage
         $script          $script
         <div class="LC_iframecontainer">          <div class="LC_iframecontainer">
             <iframe src="$url$anchor">$lt{'noif'} $noiframe</iframe>              <iframe src="$dest">$lt{'noif'} $noiframe</iframe>
         </div>          </div>
         $endpage          $endpage
 ENDFRAME  ENDFRAME
Line 339  described at http://www.lon-capa.org. Line 345  described at http://www.lon-capa.org.
   
 =over  =over
   
 =item wrapper($url,$brcrum,$absolute,$is_ext,$is_pdf,$title))  =item wrapper($url,$brcrum,$absolute,$is_ext,$is_pdf,$linktext,$explanation,$title,$width,$height)
   
 =over  =over
   

Removed from v.1.63  
changed lines
  Added in v.1.64


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