--- loncom/interface/lonfeedback.pm 2004/07/23 16:56:29 1.103 +++ loncom/interface/lonfeedback.pm 2004/07/27 23:35:34 1.107 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.103 2004/07/23 16:56:29 albertel Exp $ +# $Id: lonfeedback.pm,v 1.107 2004/07/27 23:35:34 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,7 @@ use Apache::loncommon(); use Apache::lontexconvert(); use Apache::lonlocal; # must not have () use Apache::lonhtmlcommon(); +use Apache::lonspeller(); sub discussion_open { my ($status)=@_; @@ -864,11 +865,6 @@ END } my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); my $htmlheader=&Apache::lonhtmlcommon::htmlareaheaders(); - my $onsubmit=''; - if ((&Apache::lonhtmlcommon::htmlareabrowser()) && - (!&Apache::lonhtmlcommon::htmlareablocked())) { - $onsubmit='document.mailform.onsubmit();'; - } my $send=&mt('Send'); $r->print(< @@ -912,7 +908,9 @@ $htmlheader } if (rec) { - $onsubmit + if (typeof(document.mailform.onsubmit)!='undefined') { + document.mailform.onsubmit(); + } document.mailform.submit(); } else { alert('Please check a feedback type.'); @@ -1430,6 +1428,7 @@ ENDREDIR sub no_redirect_back { my ($r,$feedurl) = @_; + my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); $r->print (< Feedback not sent @@ -1444,7 +1443,7 @@ ENDNOREDIR -Sorry, no feedback possible on this resource ... +$nofeed ENDNOREDIRTWO @@ -1511,25 +1510,25 @@ sub resource_output { sub clear_out_html { my ($message,$override)=@_; unless (&Apache::lonhtmlcommon::htmlareablocked()) { return $message; } +# Always allow the -tag + my %html=(M=>1); +# Check if more is allowed my $cid=$ENV{'request.course.id'}; if (($ENV{"course.$cid.allow_limited_html_in_feedback"} =~ m/yes/i) || ($override)) { # allows


      • #

        # - my %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1, - BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1, - M=>1, SUB=>1, SUP=>1, SPAN=>1, - H1=>1, H2=>1, H3=>1, H4=>1, H5=>1); - - $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ + %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1, + BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1, + M=>1, SUB=>1, SUP=>1, SPAN=>1, + H1=>1, H2=>1, H3=>1, H4=>1, H5=>1); + } +# Do the substitution of everything that is not explicitly allowed + $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\<$1"}/ge; - $message =~ s/(\]*)\>/ + $message =~ s/(\]*)\>/ {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\>"}/ge; - } else { - $message=~s/\/\>\;/g; - } return $message; } @@ -1748,6 +1747,7 @@ sub show_preview { my $r=shift; my $message=&clear_out_html($ENV{'form.comment'}); $message=~s/\n/\
        /g; + $message=&Apache::lonspeller::markeduptext($message); $message=&Apache::lontexconvert::msgtexconverted($message); my $subject=&clear_out_html($ENV{'form.subject'}); $subject=~s/\n/\
        /g; @@ -1758,13 +1758,13 @@ sub show_preview { } sub generate_preview_button { - my $pre=&mt("Show Preview"); + my $pre=&mt("Show Preview and Check Spelling"); return(< +onClick="if (typeof(document.mailform.onsubmit)!='undefined') {document.mailform.onsubmit();};this.form.comment.value=document.mailform.comment.value;this.form.subject.value=document.mailform.subject.value;this.form.submit();" /> ENDPREVIEW }