--- loncom/interface/lonhtmlcommon.pm 2003/03/07 19:09:11 1.16 +++ loncom/interface/lonhtmlcommon.pm 2003/03/10 20:21:45 1.17 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.16 2003/03/07 19:09:11 albertel Exp $ +# $Id: lonhtmlcommon.pm,v 1.17 2003/03/10 20:21:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -249,6 +249,42 @@ sub get_date_from_form { ############################################## ############################################## +=pod + +=item &javascript_nothing() + +Return an appropriate null for the users browser. This is used +as the first arguement for window.open calls when you want a blank +window that you can then write to. + +=cut + +############################################## +############################################## +sub javascript_nothing { + # mozilla and other browsers work with "''", but IE on mac does not. + my $nothing = "''"; + my $user_browser; + my $user_os; + $user_browser = $ENV{'browser.type'} if (exists($ENV{'browser.type'})); + $user_os = $ENV{'browser.os'} if (exists($ENV{'browser.os'})); + if (! defined($user_browser) || ! defined($user_os)) { + (undef,$user_browser,undef,undef,undef,$user_os) = + &Apache::loncommon::decode_user_agent(); + } + &Apache::lonnet::logthis(" os = :".$user_os.":"); + &Apache::lonnet::logthis(" browser = :".$user_browser.":"); + if ($user_browser eq 'explorer' && $user_os =~ 'mac') { + $nothing = "'javascript:void(0);'"; + } + return $nothing; +} + +############################################## +############################################## + + + sub AscendOrderOptions { my ($order, $page, $formName)=@_;