[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm structuretags.pm /interface lonfeedback.pm lonhtmlcommon.pm lonsimplepage.pm lonsyllabus.pm /localize/localize de.pm fr.pm ja.pm pt.pm ru.pm /xml lonxml.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 03 Jun 2004 14:28:40 -0000


This is a MIME encoded message

--www1086272920
Content-Type: text/plain

www		Thu Jun  3 10:28:40 2004 EDT

  Modified files:              
    /loncom/homework	inputtags.pm structuretags.pm 
    /loncom/interface	lonfeedback.pm lonhtmlcommon.pm lonsimplepage.pm 
                     	lonsyllabus.pm 
    /loncom/localize/localize	de.pm fr.pm ja.pm pt.pm ru.pm 
    /loncom/xml	lonxml.pm 
  Log:
  HTMLarea - only have 5 minutes.
  
  There are lots of odd problems with Mozilla, not just meta-refresh, but
  also popup windows and one random segmentation fault.
  
  
--www1086272920
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20040603102840.txt"

Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.142 loncom/homework/inputtags.pm:1.143
--- loncom/homework/inputtags.pm:1.142	Thu May 20 19:11:12 2004
+++ loncom/homework/inputtags.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.142 2004/05/20 23:11:12 albertel Exp $
+# $Id: inputtags.pm,v 1.143 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -122,15 +122,17 @@
 	    my $cols = &Apache::lonxml::get_param('cols',$parstack,$safeeval);
 	    if ( $cols eq '') { $cols = 80; }
 	    my $rows = &Apache::lonxml::get_param('rows',$parstack,$safeeval);
-	    if ( $rows eq '') { $rows = 10; }
+	    if ( $rows eq '') { $rows = 16; }
 	    my $addchars=&Apache::lonxml::get_param('addchars',$parstack,$safeeval);
 	    $result='';
 	    if ($addchars) {
 		$result.=&addchars('HWVAL_'.$resid,$addchars);
 	    }
-	    $result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" '.
+	    push @Apache::lonxml::htmlareafields,'HWVAL_'.$resid;
+	    $result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '.
 		"rows=\"$rows\" cols=\"$cols\">".$oldresponse;
 	    if ($oldresponse ne '') {
+
 		#get rid of any startup text if the user has already responded
 		&Apache::lonxml::get_all_text("/textfield",$parser);
 	    }
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.253 loncom/homework/structuretags.pm:1.254
--- loncom/homework/structuretags.pm:1.253	Fri May 28 15:26:05 2004
+++ loncom/homework/structuretags.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.253 2004/05/28 19:26:05 albertel Exp $
+# $Id: structuretags.pm,v 1.254 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -25,9 +25,7 @@
 #
 # http://www.lon-capa.org/
 #
-# 2/19 Guy
-# 6/26/2001 fixed extra web display at end of <web></web> tags
-# 8/17,8/18,8/20 Gerd Kortemeyer
+###
 
 
 package Apache::structuretags; 
@@ -84,7 +82,9 @@
     if (!defined($found{'html'})) {
 	$result=&Apache::londefdef::start_html($target,$token,$tagstack,
 					       $parstack,$parser,$safeeval);
-	$head_tag_start='<head>'.&Apache::lonmenu::registerurl(undef,$target);
+	$head_tag_start='<head>'.&Apache::lonmenu::registerurl(undef,$target).
+	    &Apache::lonhtmlcommon::htmlareaheaders();
+	@Apache::lonxml::htmlareafields=();
     }
     my $body_tag_start;
     if (!defined($found{'body'})) {
@@ -634,7 +634,9 @@
 	   ) {
 	    if ($target ne 'tex' &&
 		$ENV{'form.answer_output_mode'} ne 'tex') {
-		$result.="</form></body>\n";
+		$result.="</form>";
+		$result.=&Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields);
+		$result.="</body>\n";
 	    }
 	    if ($target eq 'web') {
 		$result.=&Apache::lonxml::xmlend();
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.87 loncom/interface/lonfeedback.pm:1.88
--- loncom/interface/lonfeedback.pm:1.87	Wed Jun  2 12:47:33 2004
+++ loncom/interface/lonfeedback.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.87 2004/06/02 16:47:33 www Exp $
+# $Id: lonfeedback.pm,v 1.88 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -412,7 +412,7 @@
 <font size="1">Note: in anonymous discussion, your name is visible only to
 course faculty</font><br />
 <b>Title:</b>&nbsp;<input type="text" name="subject" value="" size="30" /><br /><br />
-<textarea name="comment" cols="60" rows="10" wrap="hard"></textarea>
+<textarea name="comment" cols="60" rows="12" wrap="hard"></textarea>
 <p>
 Attachment (128 KB max size): <input type="file" name="attachment" />
 </p>
@@ -675,14 +675,17 @@
 
 sub clear_out_html {
   my ($message,$override)=@_;
+  unless (&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }
   my $cid=$ENV{'request.course.id'};
   if (($ENV{"course.$cid.allow_limited_html_in_feedback"} =~ m/yes/i) ||
       ($override)) {
       # allows <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <STRONG> 
-      # <BLOCKQUOTE> <DIV .*> <DIV> <IMG>
+      # <BLOCKQUOTE> <DIV .*> <DIV> <IMG> <M> <SPAN> <H1> <H2> <H3> <H4> <SUB>
+      # <SUP>
       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);
+                M=>1, SUB=>1, SUP=>1, SPAN=>1, 
+		H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);
 
       $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/
 	  {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\&lt;$1"}/ge;
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.71 loncom/interface/lonhtmlcommon.pm:1.72
--- loncom/interface/lonhtmlcommon.pm:1.71	Wed Jun  2 12:41:46 2004
+++ loncom/interface/lonhtmlcommon.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.71 2004/06/02 16:41:46 www Exp $
+# $Id: lonhtmlcommon.pm,v 1.72 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -896,6 +896,18 @@
 ENDSCRIPT
 }
 
+# ----------------------------------------- Script to activate only some fields
+
+sub htmlareaselectactive {
+    if (&htmlareablocked()) { return ''; }
+    my $output='<script type="text/javascript" defer="1">';
+    foreach(@_) {
+	$output.="\nHTMLArea.replace('$_');";
+    }
+    $output.="\n</script>";
+    return $output;
+}
+
 # --------------------------------------------------------------------- Blocked
 
 sub htmlareablocked {
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.20 loncom/interface/lonsimplepage.pm:1.21
--- loncom/interface/lonsimplepage.pm:1.20	Wed May 12 15:25:15 2004
+++ loncom/interface/lonsimplepage.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.20 2004/05/12 19:25:15 albertel Exp $
+# $Id: lonsimplepage.pm,v 1.21 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,7 +104,8 @@
 # --------------------------------------- There is such a user, get environment
 
     if ($target ne 'tex') {
-	$r->print('</head>'.&Apache::loncommon::bodytag
+	$r->print(&Apache::lonhtmlcommon::htmlareaheaders().
+		  '</head>'.&Apache::loncommon::bodytag
 		  ("Course Page",$forcestudent,$addentries,'',$dom,$ENV{'form.register'}));
     }
 
@@ -138,7 +139,10 @@
     if (($allowed) && ($ENV{'form.storesyl'})) {
 	foreach (keys %syllabusfields) {
 	    my $field=$ENV{'form.'.$_};
+	    chomp($field);
 	    $field=~s/\s+$//s;
+	    $field=~s/^\s+//s;
+	    $field=~s/\<br\s*\/*\>$//s;
 	    $field=&Apache::lonfeedback::clear_out_html($field,1);
 	    $syllabus{$_}=$field;
 	}
@@ -193,7 +197,7 @@
 		    }
 		    if ($allowed) {
 			if ($target ne 'tex') {
-			    $r->print('<br /><textarea cols="80" rows="20" name="'.$_.'">'.
+			    $r->print('<br /><textarea cols="80" rows="24" name="'.$_.'" id="'.$_.'">'.
 				      $syllabus{$_}.
 				      '</textarea><input type="submit" name="storesyl" value="Store" />');
 			} else {
@@ -223,7 +227,8 @@
 	    }
 	}
 	if ($allowed && ($ENV{'form.grade_target'} ne 'tex')) {
-	    $r->print('</form>');
+	    $r->print(&Apache::lonhtmlcommon::htmlareaselectactive
+		      ('bbb_content').'</form>');
 	}
 	if ($ENV{'form.grade_target'} ne 'tex') {$r->print('</p>');}
     } else {
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.32 loncom/interface/lonsyllabus.pm:1.33
--- loncom/interface/lonsyllabus.pm:1.32	Tue Jun  1 20:42:15 2004
+++ loncom/interface/lonsyllabus.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.32 2004/06/02 00:42:15 www Exp $
+# $Id: lonsyllabus.pm,v 1.33 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -182,8 +182,11 @@
        if (($allowed) && ($ENV{'form.storesyl'})) {
 	   foreach (keys %syllabusfields) {
                my $field=$ENV{'form.'.$_};
+	       chomp($field);
                $field=~s/\s+$//s;
-               $field=&Apache::lonfeedback::clear_out_html($field,1);
+	       $field=~s/^\s+//s;
+	       $field=~s/\<br\s*\/*\>$//s;
+	       $field=&Apache::lonfeedback::clear_out_html($field,1);
 	       $syllabus{$_}=$field;
                if ($_ eq 'lll_includeurl') { # clean up included URLs
                   my $field='';
@@ -240,6 +243,7 @@
 	   $r->print('<form method="post">'.
 		     '<input type="hidden" name="forceedit" value="edit" />');
        }
+       my @htmlids=();
        foreach (sort keys %syllabusfields) {
           if (($syllabus{$_}=~/\w/) || ($allowed)) {
               my $message=$syllabus{$_};
@@ -280,17 +284,19 @@
 		     $r->print('\\\\\textbf{'.$syllabusfields{$_}.'}\\\\'.
 			       &Apache::lonxml::xmlparse($r,'tex',$message).'\\\\');
 		 }
+		 push @htmlids,$_;
 	     }
               if ($allowed) {
-                 $r->print('<br /><textarea cols="80" rows="6" name="'.$_.'">'.
+                 $r->print(
+	   '<br /><textarea cols="80" rows="12" name="'.$_.'" id="'.$_.'">'.
 			   $syllabus{$_}.
-           '</textarea><input type="submit" name="storesyl" value="Store" />');
+           '</textarea> <input type="submit" name="storesyl" value="Store" />');
 	      }
 	  }
        }
        if ($allowed) {
 	   $r->print('</form>'.
-		     &Apache::lonhtmlcommon::htmlareaactive());
+		     &Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));
        }
        if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');}
     } else {
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.53 loncom/localize/localize/de.pm:1.54
--- loncom/localize/localize/de.pm:1.53	Sat Apr 17 10:36:38 2004
+++ loncom/localize/localize/de.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.53 2004/04/17 14:36:38 www Exp $
+# $Id: de.pm,v 1.54 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -42,6 +42,7 @@
 'date_days'    => 'So,Mo,Di,Mi,Do,Fr,Sa',
 'date_am' => 'vormittags',
 'date_pm' => 'nachmittags',
+'htmlarea_lang' => 'de',
 
    'Domain'
 => 'Domäne',
Index: loncom/localize/localize/fr.pm
diff -u loncom/localize/localize/fr.pm:1.4 loncom/localize/localize/fr.pm:1.5
--- loncom/localize/localize/fr.pm:1.4	Tue Feb 17 21:06:27 2004
+++ loncom/localize/localize/fr.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # French Localization Lexicon
 #
-# $Id: fr.pm,v 1.4 2004/02/18 02:06:27 www Exp $
+# $Id: fr.pm,v 1.5 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -43,7 +43,7 @@
 'date_am' => 'matin',
 'date_pm' => 'soir',
 'textual_remote_display' => 'on',
-
+'htmlarea_lang' => 'fr',
 
    'Domain'
 => 'Domaine',
Index: loncom/localize/localize/ja.pm
diff -u loncom/localize/localize/ja.pm:1.13 loncom/localize/localize/ja.pm:1.14
--- loncom/localize/localize/ja.pm:1.13	Tue Dec  9 17:10:23 2003
+++ loncom/localize/localize/ja.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Japanese Localization Lexicon
 #
-# $Id: ja.pm,v 1.13 2003/12/09 22:10:23 www Exp $
+# $Id: ja.pm,v 1.14 2004/06/03 14:28:39 www Exp $
 #
 # Copyright i-Learning Limited Partnership Company
 #
@@ -41,6 +41,7 @@
 'date_am' => 'am',
 'date_pm' => 'pm',
 'textual_remote_display' => 'on',
+'htmlarea_lang' => 'ja-utf8',
 
 
    'Domain'
Index: loncom/localize/localize/pt.pm
diff -u loncom/localize/localize/pt.pm:1.22 loncom/localize/localize/pt.pm:1.23
--- loncom/localize/localize/pt.pm:1.22	Tue Mar  9 11:55:48 2004
+++ loncom/localize/localize/pt.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Portuguese Localization Lexicon
 #
-# $Id: pt.pm,v 1.22 2004/03/09 16:55:48 www Exp $
+# $Id: pt.pm,v 1.23 2004/06/03 14:28:39 www Exp $
 #
 # Copyright UNICAMP, Sao Paulo
 # Supported in part by Partnership in Global Learning
@@ -57,6 +57,7 @@
 'date_am' => 'manhã',
 'date_pm' => 'tarde',
 'textual_remote_display' => 'on',
+'htmlarea_lang' => 'pt_br',
 
 'anno.gif' => 'pt/anno_pt.gif',
 'ccrs.gif' => 'pt/ccrs_pt.gif',
Index: loncom/localize/localize/ru.pm
diff -u loncom/localize/localize/ru.pm:1.43 loncom/localize/localize/ru.pm:1.44
--- loncom/localize/localize/ru.pm:1.43	Wed Jun  2 13:32:14 2004
+++ loncom/localize/localize/ru.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Russian Localization Lexicon
 #
-# $Id: ru.pm,v 1.43 2004/06/02 17:32:14 sakharuk Exp $
+# $Id: ru.pm,v 1.44 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -41,6 +41,7 @@
 'date_am' => 'am',
 'date_pm' => 'pm',
 'textual_remote_display' => 'on',
+'htmlarea_lang' => 'ru',
 
    'calendar'
 => 'ËÁÌÅÎÄÁÒØ',
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.319 loncom/xml/lonxml.pm:1.320
--- loncom/xml/lonxml.pm:1.319	Thu May 27 00:25:13 2004
+++ loncom/xml/lonxml.pm	Thu Jun  3 10:28:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.319 2004/05/27 04:25:13 albertel Exp $
+# $Id: lonxml.pm,v 1.320 2004/06/03 14:28:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -40,7 +40,7 @@
 
 package Apache::lonxml; 
 use vars 
-qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $errorcount $warningcount);
+qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $errorcount $warningcount @htmlareafields);
 use strict;
 use HTML::LCParser();
 use HTML::TreeBuilder();

--www1086272920--