--- loncom/interface/lonextresedit.pm 2016/11/29 16:28:16 1.8.2.1 +++ loncom/interface/lonextresedit.pm 2017/03/14 21:09:20 1.8.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: lonextresedit.pm,v 1.8.2.1 2016/11/29 16:28:16 raeburn Exp $ +# $Id: lonextresedit.pm,v 1.8.2.2 2017/03/14 21:09:20 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -229,6 +229,7 @@ sub extedit_form { $fieldsetstyle,$action,$hiddenelem,$form); $fieldsetstyle = 'display: none;'; $action = '/adm/coursedocs'; + my $protocol = ($ENV{'SERVER_PORT'} == 443?'https':'http'); if ($residx) { if ($caller eq 'direct') { $fieldsetstyle = 'display: block;'; @@ -252,7 +253,7 @@ sub extedit_form { $urlid = "exturl_$residx"; $srcclass = ' class="LC_nobreak"'; $extsrc = ''.$lt{'ul'}.' '; - $preview = ' '.$lt{'pr'}.''; + $preview = ' '.$lt{'pr'}.''; $title = ''.$lt{'ti'}.' '; $save = $lt{'sv'}; } else { @@ -263,7 +264,7 @@ sub extedit_form { $residx = 0; $orig_url = 'http://'; $orig_title = $lt{'ex'}; - $preview = ''; + $preview = ''; $save = $lt{'al'}; $pathitem .= '
'; } @@ -374,11 +375,16 @@ function editext(residx) { return; } -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,"externalpreview","height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1"); + } else { + openMyModal(url,500,400,'yes'); + } } else { alert("$js_lt{'invurl'}"); }