--- loncom/xml/lonxml.pm 2014/06/21 20:56:40 1.547 +++ loncom/xml/lonxml.pm 2014/06/21 23:36:05 1.548 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.547 2014/06/21 20:56:40 raeburn Exp $ +# $Id: lonxml.pm,v 1.548 2014/06/21 23:36:05 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1521,52 +1521,56 @@ sub inserteditinfo { my $xml_help = ''; my $initialize=''; my $textarea_id = 'filecont'; - my ($dragmath_button,$deps_button); - my ($add_to_onload, $add_to_onresize); + my ($dragmath_button,$deps_button,$context,$cnum,$cdom,$add_to_onload, + $add_to_onresize,$init_dragmath); $initialize=&Apache::lonhtmlcommon::spellheader(); - if (($filetype eq 'html') && (&Apache::lonhtmlcommon::htmlareabrowser())) { - my $lang = &Apache::lonhtmlcommon::htmlarea_lang(); - my %textarea_args = ( - fullpage => 'true', - dragmath => 'math', - ); - $initialize .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); + if ($filetype eq 'html') { + if ($env{'request.course.id'}) { + $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + if ($uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E}) { + $context = 'syllabus'; + } + } + if (&Apache::lonhtmlcommon::htmlareabrowser()) { + my $lang = &Apache::lonhtmlcommon::htmlarea_lang(); + my %textarea_args = ( + fullpage => 'true', + dragmath => 'math', + ); + $initialize .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); + if ($context eq 'syllabus') { + $init_dragmath = "editmath_visibility('filecont','none')"; + } + } } $initialize .= (< // FULLPAGE my $textareaclass; if ($filetype eq 'html') { - my $context; - if ($env{'request.course.id'}) { - my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; - my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; - if ($uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E}) { - $context = 'syllabus'; - $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n"; - $initialize .= - &Apache::lonhtmlcommon::dependencycheck_js(undef,&mt('Syllabus'), - $uri,undef, - "/public/$cdom/$cnum/syllabus"). - "\n"; - if (&Apache::lonhtmlcommon::htmlareabrowser()) { - $textareaclass = 'class="LC_richDefaultOn"'; - } - } - } - unless ($context eq 'syllabus') { - if ($symb || $folderpath) { - $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n"; - $initialize .= - &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle, - undef,$folderpath,$uri)."\n"; + if ($context eq 'syllabus') { + $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n"; + $initialize .= + &Apache::lonhtmlcommon::dependencycheck_js(undef,&mt('Syllabus'), + $uri,undef, + "/public/$cdom/$cnum/syllabus"). + "\n"; + if (&Apache::lonhtmlcommon::htmlareabrowser()) { + $textareaclass = 'class="LC_richDefaultOn"'; } + } elsif ($symb || $folderpath) { + $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n"; + $initialize .= + &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle, + undef,$folderpath,$uri)."\n"; } $dragmath_button = ''.&Apache::lonhtmlcommon::dragmath_button('filecont',1).''; $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');