--- loncom/interface/lonhtmlcommon.pm 2013/07/10 22:07:37 1.349 +++ loncom/interface/lonhtmlcommon.pm 2013/07/22 11:46:23 1.352 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.349 2013/07/10 22:07:37 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.352 2013/07/22 11:46:23 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,9 +64,15 @@ use HTML::Entities(); use LONCAPA qw(:DEFAULT :match); sub java_not_enabled { - return "\n".''. - &mt('The required Java applet could not be started. Please make sure to have Java installed and active in your browser.'). - "\n"; + if (($env{'browser.mobile'}) && ($env{'browser.mobile'} =~ /^ipad|ipod|iphone$/i)) { + return "\n".''. + &mt('The required Java applet could not be started, because Java is not supported by your mobile device.'). + "\n"; + } else { + return "\n".''. + &mt('The required Java applet could not be started. Please make sure to have Java installed and active in your browser.'). + "\n"; + } } sub coursepreflink { @@ -2234,7 +2240,7 @@ sub course_selection { $output .= '
'; $output .= ''; @@ -2942,10 +2948,7 @@ sub resize_scrollbox_js { scroll => 'contentscroll', boxh => 'contenteditor', ); - $paddingwfrac = 0; - unless ($env{'browser.mobile'}) { - $paddingwfrac = 0.09; - } + $paddingwfrac = 0.09; $offsetwfrac = 0.015; $offsetv = 20; $minw = 250; @@ -2984,6 +2987,7 @@ function resize_scrollbox(scrollboxname, var scrolltableid = 'table_'+scrollboxname; var scrollbox; var scrolltable; + var ismobile = '$env{'browser.mobile'}'; if (document.getElementById("$names{'boxw'}") == null) { return; @@ -3020,6 +3024,7 @@ FIRST } $output .= <<"SECOND"; var listwchange; + var scrollchange; if (chkw == 1) { var boxw = document.getElementById("$names{'boxw'}").offsetWidth; var itemw; @@ -3031,6 +3036,7 @@ FIRST var scrollboxw = scrollbox.offsetWidth; var scrollboxscrollw = scrollbox.scrollWidth; + var scrollstart = scrollboxw; var offsetw = parseInt(vpw * $offsetwfrac); var paddingw = parseInt(vpw * $paddingwfrac); @@ -3105,11 +3111,19 @@ PARAMSONE } } + if (newscrollboxw != scrollboxw) { + scrollchange = 1; + } + if (itemid.offsetWidth != itemwstart) { listwchange = 1; } } if ((chkh == 1) || (listwchange)) { + var itemid = document.getElementById("$names{'item'}"); + if (itemid != null) { + itemh = itemid.offsetHeight; + } var primaryheight = document.getElementById('LC_nav_bar').offsetHeight; var secondaryheight; if (document.getElementById('LC_secondary_menu') != null) { @@ -3130,6 +3144,7 @@ PARAMSONE var scrollboxheight = scrollbox.offsetHeight; var scrollboxscrollheight = scrollbox.scrollHeight; + var scrollboxh = scrollboxheight; var minvscrollbox = $minv; var offsetv = $offsetv; @@ -3160,6 +3175,13 @@ PARAMSONE scrollbox.style.height = newscrollheight+"px"; } } + var newscrollboxh = scrollbox.offsetHeight; + if (scrollboxh != newscrollboxh) { + scrollchange = 1; + } + } + if (ismobile && scrollchange) { + \$("#div_$names{'scroll'}").getNiceScroll().onResize(); } return; }
'.$$codetitles[0].'
'."\n". '
'.$$codetitles[$i].'
'."\n". ''."\n". '