--- loncom/xml/scripttag.pm 2014/07/27 11:39:29 1.170 +++ loncom/xml/scripttag.pm 2015/01/19 15:36:16 1.173 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # '; + } + + } elsif ($target eq 'meta') { my $bodytext=&Apache::lonxml::get_all_text_unbalanced("/script",$parser); } @@ -141,8 +175,8 @@ sub start_script { } } } elsif (($type eq 'text/javascript') && ($bodytext ne '')) { - if ($url =~ m{^\Q/uploaded/$cdom/$cnum/docs/\E}) { - if ($bodytext =~ m{\.addMediaSrc\((["'])(?:(?!\1).)+\1\)}) { + if ($url =~ m{^\Q/uploaded/$cdom/$cnum/\E(docs|supplemental)/}) { + if ($bodytext =~ m{\.addMediaSrc\((["'])((?!\1).)+\1\);}) { my $quote = $1; if ($bodytext =~ m{\Q.addMediaSrc($quote\E([^$quote]+)\Q$quote)\E}) { my $fname = $1; @@ -225,6 +259,16 @@ sub start_script { } } } + if ($bodytext =~ m{loadScript\(\s*(['"])((?:(?!\1).)+\.js)\1,\s*function}is) { + my $fname = $2; + if ($fname) { + my $cleanhref = + &Apache::londefdef::clean_docs_httpref($fname,$url,$cdom,$cnum); + if ($cleanhref) { + &Apache::lonxml::extlink($cleanhref); + } + } + } } } }