--- loncom/interface/lonsyllabus.pm 2017/03/14 21:27:51 1.138.2.2 +++ loncom/interface/lonsyllabus.pm 2017/03/15 03:31:48 1.138.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network # Syllabus # -# $Id: lonsyllabus.pm,v 1.138.2.2 2017/03/14 21:27:51 raeburn Exp $ +# $Id: lonsyllabus.pm,v 1.138.2.3 2017/03/15 03:31:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -627,11 +627,16 @@ function toggleEditor(pick) { var regexp = $urlregexp; -function extUrlPreview(caller) { +function extUrlPreview(caller,protocol) { if (document.getElementById(caller)) { var url = document.getElementById(caller).value; if (regexp.test(url)) { - openMyModal(url,500,400,'yes'); + var http_regex = /^http\:\/\//gi; + if ((protocol == 'https') && (http_regex.test(url))) { + window.open(url,"syllabuspreview","height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1"); + } else { + openMyModal(url,500,400,'yes'); + } } else { alert("$invurl"); } @@ -819,6 +824,7 @@ sub chooser { $checked{'templatebox'} = $check; $display{'templatebox'} = 'block'; } + my $protocol = ($ENV{'SERVER_PORT'} == 443?'https':'http'); my $output = '
'."\n". @@ -831,7 +837,7 @@ sub chooser { $output .= ''."\n". '
'."\n". '
'.$lt{'chourl'}.''."\n". - ''.$lt{'pr'}.' '."\n". + ''.$lt{'pr'}.' '."\n". ''."\n". ' '."\n". '
'."\n".