[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm structuretags.pm /interface lonbulletin.pm loncommon.pm lonfeedback.pm lonhtmlcommon.pm lonmsgdisplay.pm lonsimplepage.pm lonsyllabus.pm /xml lonxml.pm
raeburn
raeburn@source.lon-capa.org
Sat, 07 Aug 2010 19:24:03 -0000
This is a MIME encoded message
--raeburn1281209043
Content-Type: text/plain
raeburn Sat Aug 7 19:24:03 2010 EDT
Modified files:
/loncom/interface lonbulletin.pm loncommon.pm lonfeedback.pm
lonhtmlcommon.pm lonmsgdisplay.pm
lonsimplepage.pm lonsyllabus.pm
/loncom/xml lonxml.pm
/loncom/homework structuretags.pm inputtags.pm
Log:
- Eliminate routines no longer needed following switch from FCKEditor 2 to CKEdi
tor 3
- Eliminate checking for environment.wysiwygeditor (no longer used).
- Access to "Richtext" editor available via link on each textarea for which it is
to be made available.
- When editing an HTML document provide "Edit Math" button to allow
insertion of TeX within the textarea. Button is hidden if Richtext editor in use.
- Additional tags permitted by clear_out_html() - <pre> and <chem>.
--raeburn1281209043
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20100807192403.txt"
Index: loncom/interface/lonbulletin.pm
diff -u loncom/interface/lonbulletin.pm:1.60 loncom/interface/lonbulletin.pm:1.61
--- loncom/interface/lonbulletin.pm:1.60 Sat Jun 5 22:07:05 2010
+++ loncom/interface/lonbulletin.pm Sat Aug 7 19:23:50 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Bulletin Board Handler
#
-# $Id: lonbulletin.pm,v 1.60 2010/06/05 22:07:05 www Exp $
+# $Id: lonbulletin.pm,v 1.61 2010/08/07 19:23:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -265,7 +265,6 @@
&Apache::lonnet::allowuploaded('/adm/syllabus',
$syllabus{'uploaded.photourl'});
}
- my @htmlids=();
#Outputbox and Inputbox for Image upload
if ($allowed) {
my $message = '<img src="'.$syllabus{'uploaded.photourl'}.'" alt="'.&mt('Image').'"/>';
@@ -285,11 +284,11 @@
}
my %custom_handlers = ( 'aaa_title' => sub {} );
- @htmlids = &Apache::lontemplate::print_template_fields($r, \%syllabus, \%syllabusfields,
+ &Apache::lontemplate::print_template_fields($r, \%syllabus, \%syllabusfields,
$target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_handlers);
if ($allowed) {
$r->print('</form>'.
- &Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));
+ &Apache::lonhtmlcommon::htmlareaselectactive());
}
if ($target ne 'tex'){
$r->print('<br/><br/><hr/><br/>');
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.971 loncom/interface/loncommon.pm:1.972
--- loncom/interface/loncommon.pm:1.971 Fri Jul 9 14:40:20 2010
+++ loncom/interface/loncommon.pm Sat Aug 7 19:23:50 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.971 2010/07/09 14:40:20 raeburn Exp $
+# $Id: loncommon.pm,v 1.972 2010/08/07 19:23:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -6585,10 +6585,6 @@
sub xml_begin {
my $output='';
- if ($env{'internal.start_page'}==1) {
- &Apache::lonhtmlcommon::init_htmlareafields();
- }
-
if ($env{'browser.mathml'}) {
$output='<?xml version="1.0"?>'
#.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>'."\n"
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.296 loncom/interface/lonfeedback.pm:1.297
--- loncom/interface/lonfeedback.pm:1.296 Tue Jun 8 16:56:57 2010
+++ loncom/interface/lonfeedback.pm Sat Aug 7 19:23:50 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.296 2010/06/08 16:56:57 www Exp $
+# $Id: lonfeedback.pm,v 1.297 2010/08/07 19:23:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -847,7 +847,12 @@
if ($crstype eq 'Community') {
$lt{'note'} = &mt('Note: in anonymous discussion, your name is visible only to community facilitators');
}
- my $postingform = (<<ENDDISCUSS);
+ my ($postingform,$textareaclass);
+ if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+ $postingform = &Apache::lonhtmlcommon::htmlareaselectactive();
+ $textareaclass = 'class="LC_richDefaultOff"';
+ }
+ $postingform .= (<<ENDDISCUSS);
<form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="$lt{'podi'}" />
<input type="submit" name="anondiscuss" value="$lt{'poan'}" /> <input type="hidden" name="symb" value="$ressymb" />
<input type="hidden" name="sendit" value="true" />
@@ -855,7 +860,7 @@
<br /><a name="newpost"></a>
<font size="1">$lt{'note'}</font><br />
<b>$lt{'title'}:</b> <input type="text" name="subject" value="$subject" size="30" /><br /><br />
-<textarea name="comment" cols="80" rows="14" >$comment</textarea>
+<textarea name="comment" cols="80" rows="14" id="comment" $textareaclass>$comment</textarea>
ENDDISCUSS
if ($env{'form.origpage'}) {
$postingform .= '<input type="hidden" name="origpage" value="'.
@@ -1674,6 +1679,12 @@
</script>
END
+ my ($textareaheader,$textareaclass);
+ if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+ $textareaheader = &Apache::lonhtmlcommon::htmlareaselectactive();
+ $textareaclass = 'class="LC_richDefaultOff"';
+ }
+
# Breadcrumbs
my $brcrum = [{'href' => '',
'text' => 'Resource Feedback and Discussion'}];
@@ -1713,14 +1724,16 @@
$r->print(<<END);
$options<hr />
$quote
-<p>$lt{'myqu'}</p>
+<p>$lt{'myqu'}
+$textareaheader
+</p>
<p>
$latexHelp
</p>
<p>
$lt{'title'}: <input type="text" name="subject" size="30" value="$subject" /></p>
<p>
-<textarea name="comment" id="comment" cols="60" rows="10">$comment
+<textarea name="comment" id="comment" cols="60" rows="10" $textareaclass>$comment
</textarea></p>
END
if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) {
@@ -1798,7 +1811,6 @@
}
}
$r->print(&generate_preview_button().
- &Apache::lonhtmlcommon::htmlareaselectactive('comment').
&Apache::loncommon::end_page());
}
@@ -2672,9 +2684,7 @@
}
sub clear_out_html {
- my ($message,$override,$ignore_htmlarea)=@_;
- if (!$ignore_htmlarea
- && !&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }
+ my ($message,$override)=@_;
# Always allow the <m>-tag
my %html=(M=>1);
# Check if more is allowed
@@ -2685,8 +2695,8 @@
# <BLOCKQUOTE> <DIV .*> <DIV> <IMG> <M> <SPAN> <H1> <H2> <H3> <H4> <SUB>
# <SUP> <TABLE> <TR> <TD> <TH> <TBODY>
%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, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1,
+ BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, PRE=>1, DIV=>1, IMG=>1,
+ M=>1, CHEM=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1,
H1=>1, H2=>1, H3=>1, H4=>1, H5=>1, H6=>1,
TABLE=>1, TR=>1, TD=>1, TH=>1, TBODY=>1);
}
@@ -2934,7 +2944,7 @@
&newline_to_br(\$message);
$message=&Apache::lonspeller::markeduptext($message);
$message=&Apache::lontexconvert::msgtexconverted($message);
- my $subject=&clear_out_html($env{'form.subject'},undef,1);
+ my $subject=&clear_out_html($env{'form.subject'});
$subject=~s/\n/\<br \/\>/g;
$subject=&Apache::lontexconvert::msgtexconverted($subject);
@@ -3046,7 +3056,7 @@
{'bread_crumbs' => $brcrum,});
my $orig_subject = &unescape($env{'form.subject'});
- my $subject=&clear_out_html($orig_subject,undef,1);
+ my $subject=&clear_out_html($orig_subject);
$subject=~s/\n/\<br \/\>/g;
$subject=&Apache::lontexconvert::msgtexconverted($subject);
my $timestamp=$env{'form.timestamp'};
@@ -3894,8 +3904,7 @@
my ($typestyle,%to) = &Apache::lonmsg::decide_receiver($feedurl);
# Actually send mail
- my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'},
- undef,1),
+ my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'}),
$feedurl,$email,$citations,
$attachmenturl,$usersymb,%to);
@@ -3904,7 +3913,7 @@
if ( ($env{'form.discuss'} ne ''
&& $env{'form.discuss'} !~ /^(?:author|question|course|policy)/)
|| $env{'form.anondiscuss'} ne '') {
- my $subject = &clear_out_html($env{'form.subject'},undef,1);
+ my $subject = &clear_out_html($env{'form.subject'});
my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
$subject);
@@ -3915,7 +3924,7 @@
my $blog='';
if ($env{'form.blog'}) {
- my $subject = &clear_out_html($env{'form.subject'},undef,1);
+ my $subject = &clear_out_html($env{'form.subject'});
$status.=&Apache::lonrss::addentry($env{'user.name'},
$env{'user.domain'},
'CourseBlog_'.$env{'request.course.id'},
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.280 loncom/interface/lonhtmlcommon.pm:1.281
--- loncom/interface/lonhtmlcommon.pm:1.280 Fri Jul 9 14:40:20 2010
+++ loncom/interface/lonhtmlcommon.pm Sat Aug 7 19:23:50 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.280 2010/07/09 14:40:20 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.281 2010/08/07 19:23:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1212,23 +1212,7 @@
ENDLINK
}
-# ------------------------------------------------- Output headers for HTMLArea
-
-{
- my @htmlareafields;
- sub init_htmlareafields {
- undef(@htmlareafields);
- }
-
- sub add_htmlareafields {
- my (@newfields) = @_;
- push(@htmlareafields,@newfields);
- }
-
- sub get_htmlareafields {
- return @htmlareafields;
- }
-}
+# ------------------------------------------------- Output headers for CKEditor
sub htmlareaheaders {
my $s="";
@@ -1275,22 +1259,43 @@
# ----------------------------------------- Script to activate only some fields
sub htmlareaselectactive {
- my @fields=@_;
+ my ($args) = @_;
unless (&htmlareabrowser()) { return ''; }
my $output='<script type="text/javascript" defer="defer">'."\n"
.'// <![CDATA['."\n";
my $lang = &htmlarea_lang();
+ my $fullpage = 'false';
+ my $dragmath_prefix;
+ if (ref($args) eq 'HASH') {
+ if (exists($args->{'lang'})) {
+ if ($args->{'lang'} ne '') {
+ $lang = $args->{'lang'};
+ }
+ }
+ if (exists($args->{'fullpage'})) {
+ if ($args->{'fullpage'} eq 'true') {
+ $fullpage = $args->{'fullpage'};
+ }
+ }
+ if (exists($args->{'dragmath'})) {
+ if ($args->{'dragmath'} ne '') {
+ $dragmath_prefix = $args->{'dragmath'};
+ }
+ }
+ }
$output.='
function containsBlockHtml(id) {
- var re = $("#"+id).html().search(/(?:\<\;|\<)(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div)[\s]*((?:\/[\s]*(?:\>\;|\>)|(?:\>\;|\>)[\s\S]*(?:\<\;|\<)\/[\s]*\1[\s]*\(?:\>\;|\>))/im);
+ var re = $("#"+id).html().search(/(?:\<\;|\<)(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div)[\s]*((?:[\/]*[\s]*(?:\>\;|\>)|(?:\>\;|\>)[\s\S]*(?:\<\;|\<)\/[\s]*\1[\s]*\(?:\>\;|\>))/im);
return (re >= 0);
}
function startRichEditor(id) {
CKEDITOR.replace(id,
{
- customConfig: "/ckeditor/loncapaconfig.js"
+ customConfig: "/ckeditor/loncapaconfig.js",
+ language : "'.$lang.'",
+ fullPage : '.$fullpage.',
}
);
}
@@ -1301,9 +1306,10 @@
function editorHandler(event) {
var rawid = $(this).attr("id");
- var id = new RegExp("LC_rt_(.*)").exec(rawid)[1]
+ var id = new RegExp("LC_rt_(.*)").exec(rawid)[1];
event.preventDefault();
- if ($(this).hasClass("LC_enable_rt")) {
+ var rt_enabled = $(this).hasClass("LC_enable_rt");
+ if (rt_enabled) {
startRichEditor(id);
$("#LC_rt_"+id).html("<b>« Plain text</b>");
$("#LC_rt_"+id).attr("title", "Disable rich text formatting and edit in plain text");
@@ -1315,24 +1321,40 @@
$("#LC_rt_"+id).attr("title", "Enable rich text formatting (bold, italic, etc.)");
$("#LC_rt_"+id).addClass("LC_enable_rt");
$("#LC_rt_"+id).removeClass("LC_disable_rt");
- }
- }
-
+ }';
+ if ($dragmath_prefix ne '') {
+ $output .= "\n var visible = '';
+ if (rt_enabled) {
+ visible = 'none';
+ }
+ editmath_visibility(id,visible);\n";
+ }
+ $output .= '
+ }
$(document).ready(function(){
$(".LC_richAlwaysOn").each(function() {
startRichEditor($(this).attr("id"));
});
$(".LC_richDetectHtml").each(function() {
var id = $(this).attr("id");
- if(containsBlockHtml(id)) {
+ var rt_enabled = containsBlockHtml(id);
+ if(rt_enabled) {
$(this).before("<div><a href=\"#\" id=\"LC_rt_"+id+"\" title=\"Disable rich text formatting and edit in plain text\" class=\"LC_disable_rt\"><b>« Plain text</b></a></div>");
startRichEditor(id);
- $("#LC_rt_"+id).click(editorHandler);
+ $("#LC_rt_"+id).click(editorHandler);
}
else {
$(this).before("<div><a href=\"#\" id=\"LC_rt_"+id+"\" title=\"Enable rich text formatting (bold, italic, etc.)\" class=\"LC_enable_rt\"><b>Rich formatting »</b></a></div>");
$("#LC_rt_"+id).click(editorHandler);
- }
+ }';
+ if ($dragmath_prefix ne '') {
+ $output .= "\n var visible = '';
+ if (rt_enabled) {
+ visible = 'none';
+ }
+ editmath_visibility(id,visible);\n";
+ }
+ $output .= '
});
$(".LC_richDefaultOn").each(function() {
var id = $(this).attr("id");
@@ -1343,14 +1365,31 @@
$(".LC_richDefaultOff").each(function() {
var id = $(this).attr("id");
$(this).before("<div><a href=\"#\" id=\"LC_rt_"+id+"\" title=\"Enable rich text formatting (bold, italic, etc.)\" class=\"LC_enable_rt\"><b>Rich formatting »</b></a></div>");
- $("#LC_rt_"+id).click(editorHandler);
+ $("#LC_rt_"+id).click(editorHandler);
});
-
});
-';
+';
+ if ($dragmath_prefix ne '') {
+ $output .= '
+
+ function editmath_visibility(id,value) {
+
+ if ((id == "") || (id == null)) {
+ return;
+ }
+ var mathid = "'.$dragmath_prefix.'_"+id;
+ mathele = document.getElementById(mathid);
+ if (mathele == null) {
+ return;
+ }
+ mathele.style.display = value;
+ }
+';
+
+ }
$output.="\nwindow.status='Activated Editfields';\n"
.'// ]]>'."\n"
- .'</script><br />';
+ .'</script>';
return $output;
}
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.153 loncom/interface/lonmsgdisplay.pm:1.154
--- loncom/interface/lonmsgdisplay.pm:1.153 Sun Jun 6 02:40:30 2010
+++ loncom/interface/lonmsgdisplay.pm Sat Aug 7 19:23:51 2010
@@ -1,7 +1,7 @@
-# The LearningOnline Network with CAPA
+# $textareaclass The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.153 2010/06/06 02:40:30 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.154 2010/08/07 19:23:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -626,9 +626,7 @@
return;
} else {
$hasfloat = 1;
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print('<div class="LC_left_float">');
- }
+ $r->print('<div class="LC_left_float">');
my %Sortby = (
active => {},
previous => {},
@@ -701,9 +699,7 @@
}
}
}
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print('</div>');
- }
+ $r->print('</div>');
}
return $hasfloat;
}
@@ -1423,11 +1419,7 @@
if ($group eq '') {
my $studentsel = &discourse(\%access_status);
if ($studentsel) {
- if ($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print($studentsel);
- } else {
- $r->print('<div class="LC_left_float">'.$studentsel.'</div>');
- }
+ $r->print('<div class="LC_left_float">'.$studentsel.'</div>');
$hasfloat = 1;
}
} else {
@@ -1523,11 +1515,7 @@
if ($env{'form.text'}) { $dismsg=$env{'form.text'}; }
if ($env{'form.subject'}) { $dissub=$env{'form.subject'}; }
if ($hasfloat) {
- if ($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print($broadcast_js);
- } else {
- $r->print($broadcast_js.'<div class="LC_left_float">');
- }
+ $r->print($broadcast_js.'<div class="LC_left_float">');
$onsubmit = ' onsubmit="javascript:courseRecipients();" ';
}
$r->print(
@@ -1637,7 +1625,11 @@
}
}
my $latexHelp = &Apache::loncommon::helpLatexCheatsheet(undef,undef,1);
- my $wysiwyglink=&Apache::lonhtmlcommon::htmlareaselectactive('message').'<br />';
+ my $textareaclass;
+ if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+ $r->print(&Apache::lonhtmlcommon::htmlareaselectactive());
+ $textareaclass = 'class="LC_richDefaultOff"';
+ }
my $subj_size;
if ($multiforward) {
$r->print(&additional_rec_row(\%lt));
@@ -1659,8 +1651,7 @@
<tr><td align="left">'."\n".
$latexHelp."<br />\n".
&mt("Any new text to display before the text of the original messages:").'<br />'."\n".
-'<textarea name="message" id="message" cols="80" rows="5" wrap="hard"></textarea>'.
-$wysiwyglink);
+'<textarea name="message" id="message" cols="80" rows="5" wrap="hard" $textareaclass></textarea>');
my @to_forward = &Apache::loncommon::get_env_multiple('form.delmark');
foreach my $msg (@to_forward) {
$r->print('<input type="hidden" name="delmark" value="'.$msg.'" />');
@@ -1680,8 +1671,9 @@
$attachrow
</table><br />
$latexHelp<br />
-<textarea name="message" id="message" cols="80" rows="15" wrap="hard">$dismsg
-</textarea>$wysiwyglink
+<textarea name="message" id="message" cols="80" rows="15" wrap="hard" $textareaclass>$dismsg
+</textarea>
+<br />
$sendmode
$dispcrit
$disbase
@@ -1706,8 +1698,8 @@
Subject: <input type="text" size="50" name="subject" />
</p>
<p>$lt{'gmt'}:<br />
-<textarea name="message" id="message" cols="60" rows="10" wrap="hard">$dismsg
-</textarea>$wysiwyglink</p>
+<textarea name="message" id="message" cols="60" rows="10" wrap="hard" $textareaclass>$dismsg
+</textarea></p>
<p>
$lt{'tff'}:
ENDBLOCK
@@ -1733,9 +1725,7 @@
}
$r->print('</form>');
if ($hasfloat) {
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print('</div><div class="LC_clear_float_footer"></div>');
- }
+ $r->print('</div><div class="LC_clear_float_footer"></div>');
}
$r->print(&generate_preview_form);
}
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.95 loncom/interface/lonsimplepage.pm:1.96
--- loncom/interface/lonsimplepage.pm:1.95 Mon Mar 29 00:37:36 2010
+++ loncom/interface/lonsimplepage.pm Sat Aug 7 19:23:51 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Simple Page Editor
#
-# $Id: lonsimplepage.pm,v 1.95 2010/03/29 00:37:36 raeburn Exp $
+# $Id: lonsimplepage.pm,v 1.96 2010/08/07 19:23:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -393,8 +393,8 @@
$target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_handlers, $group);
if ($allowed && ($env{'form.grade_target'} ne 'tex')) {
- $r->print(&Apache::lonhtmlcommon::htmlareaselectactive
- ('bbb_content').'</form>');
+ $r->print(&Apache::lonhtmlcommon::htmlareaselectactive().
+ '</form>');
}
} else {
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.109 loncom/interface/lonsyllabus.pm:1.110
--- loncom/interface/lonsyllabus.pm:1.109 Wed Apr 14 14:15:15 2010
+++ loncom/interface/lonsyllabus.pm Sat Aug 7 19:23:51 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Syllabus
#
-# $Id: lonsyllabus.pm,v 1.109 2010/04/14 14:15:15 bisitz Exp $
+# $Id: lonsyllabus.pm,v 1.110 2010/08/07 19:23:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -386,7 +386,6 @@
$r->print('<form method="post" action="">'.
'<input type="hidden" name="forceedit" value="edit" />');
}
- my @htmlids=();
my $url_include_handler = sub {
my ($r, $field, $message, $group, $data_ref, $fields_ref, $target, $allowed) = @_;
my %data = %{$data_ref};
@@ -428,11 +427,11 @@
}
};
my %custom_hash = ( 'lll_includeurl' => $url_include_handler );
- @htmlids = &Apache::lontemplate::print_template_fields($r, \%syllabus, \%syllabusfields,
+ &Apache::lontemplate::print_template_fields($r, \%syllabus, \%syllabusfields,
$target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_hash);
if ($allowed) {
$r->print('</form>'.
- &Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));
+ &Apache::lonhtmlcommon::htmlareaselectactive());
}
} else {
if ($target ne 'tex') {$r->print('<p>');} else {$r->print('\par ');}
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.511 loncom/xml/lonxml.pm:1.512
--- loncom/xml/lonxml.pm:1.511 Mon Jul 26 09:58:53 2010
+++ loncom/xml/lonxml.pm Sat Aug 7 19:23:56 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.511 2010/07/26 09:58:53 foxr Exp $
+# $Id: lonxml.pm,v 1.512 2010/08/07 19:23:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1492,45 +1492,25 @@
my $dragmath_button;
my ($add_to_onload, $add_to_onresize);
$initialize=&Apache::lonhtmlcommon::spellheader();
- if ($filetype eq 'html'
- && (!&Apache::lonhtmlcommon::htmlareablocked() &&
- &Apache::lonhtmlcommon::htmlareabrowser())) {
- $textarea_id .= '___Frame';
+ if (($filetype eq 'html') && (&Apache::lonhtmlcommon::htmlareabrowser())) {
my $lang = &Apache::lonhtmlcommon::htmlarea_lang();
- $initialize.=(<<FULLPAGE);
+ my %textarea_args = (
+ fullpage => 'true',
+ dragmath => 'math',
+ );
+ $initialize .=
+ &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args).
+ (<<FULLPAGE);
<script type="text/javascript">
-lonca
function initDocument() {
- var oFCKeditor = new FCKeditor('filecont');
- oFCKeditor.Config['CustomConfigurationsPath'] = '/fckeditor/loncapaconfig.js' ;
- oFCKeditor.Config['FullPage'] = true
- oFCKeditor.Config['AutoDetectLanguage'] = false;
- oFCKeditor.Config['DefaultLanguage'] = "$lang";
- oFCKeditor.ReplaceTextarea();
- }
- function check_if_dirty(editor) {
- if (editor.IsDirty()) {
- unClean();
- }
- }
- function FCKeditor_OnComplete(editor) {
- editor.Events.AttachEvent("OnSelectionChange",check_if_dirty);
resize_textarea('$textarea_id','LC_aftertextarea');
}
</script>
FULLPAGE
- } else {
- $initialize.=(<<FULLPAGE);
-<script type="text/javascript">
- function initDocument() {
- resize_textarea('$textarea_id','LC_aftertextarea');
- }
-</script>
-FULLPAGE
- if ($filetype eq 'html' || $filetype eq 'tex') {
+ }
+ if ($filetype eq 'html' || $filetype eq 'tex') {
+ $dragmath_button = '<div id="math_filecont">'.&Apache::lonhtmlcommon::dragmath_button('filecont',1).'</div>';
$initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');
- $dragmath_button = &Apache::lonhtmlcommon::dragmath_button('filecont',1);
- }
}
$add_to_onload = 'initDocument();';
@@ -1541,13 +1521,13 @@
}
my $titledisplay=&display_title();
- my $wysiwyglink;
+ my $textareaclass;
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',
'vi' => 'Save and View',
'dv' => 'Discard Edits and View',
'un' => 'undo',
'ed' => 'Edit');
- my $spelllink .=&Apache::lonhtmlcommon::spelllink('xmledit','filecont');
+ my $spelllink = &Apache::lonhtmlcommon::spelllink('xmledit','filecont');
my $textarea_events = &Apache::edit::element_change_detection();
my $form_events = &Apache::edit::form_change_detection();
my $htmlerror;
@@ -1557,11 +1537,7 @@
$htmlerror='<span class="LC_error">'.$htmlerror.'</span>';
}
if (&Apache::lonhtmlcommon::htmlareabrowser()) {
- if (&Apache::lonhtmlcommon::htmlareablocked()) {
- $wysiwyglink = &Apache::lonhtmlcommon::enablelink($textarea_id);
- } else {
- $wysiwyglink = &Apache::lonhtmlcommon::disablelink($textarea_id);
- }
+ $textareaclass = 'class="LC_richDetectHtml"';
}
}
my $editfooter=(<<ENDFOOTER);
@@ -1578,16 +1554,16 @@
<div class="LC_edit_problem_discards">
<input type="submit" name="discardview" accesskey="d" value="$lt{'dv'}" />
<input type="submit" name="Undo" accesskey="u" value="$lt{'un'}" />
- $dragmath_button $spelllink $htmlerror
+ $spelllink $htmlerror
</div>
<div class="LC_edit_problem_saves">
<input type="submit" name="savethisfile" accesskey="s" value="$lt{'st'}" />
<input type="submit" name="viewmode" accesskey="v" value="$lt{'vi'}" />
</div>
</div>
- <textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea>
+$dragmath_button
+ <textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont" $textareaclass>$filecontents</textarea>
<div id="LC_aftertextarea">
- $wysiwyglink
<br />
$titledisplay
</div>
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.472 loncom/homework/structuretags.pm:1.473
--- loncom/homework/structuretags.pm:1.472 Sun Aug 1 03:57:27 2010
+++ loncom/homework/structuretags.pm Sat Aug 7 19:24:03 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.472 2010/08/01 03:57:27 raeburn Exp $
+# $Id: structuretags.pm,v 1.473 2010/08/07 19:24:03 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -401,8 +401,6 @@
<hr style="clear:both;" />
</div>
'.
-
- &Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields()).
"\n</form>\n".&Apache::loncommon::end_page();
}
@@ -1183,7 +1181,6 @@
if ($target ne 'tex' &&
$env{'form.answer_output_mode'} ne 'tex') {
$result.="</form>";
- $result.= &Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields());
}
if ($target eq 'web') {
$result.= &Apache::loncommon::end_page({'discussion' => 1});
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.265 loncom/homework/inputtags.pm:1.266
--- loncom/homework/inputtags.pm:1.265 Mon Jun 21 02:15:37 2010
+++ loncom/homework/inputtags.pm Sat Aug 7 19:24:03 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.265 2010/06/21 02:15:37 raeburn Exp $
+# $Id: inputtags.pm,v 1.266 2010/08/07 19:24:03 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -186,9 +186,11 @@
if ($addchars) {
$result.=&addchars('HWVAL_'.$resid,$addchars);
}
- &Apache::lonhtmlcommon::add_htmlareafields('HWVAL_'.$resid);
+ $result .= &Apache::lonhtmlcommon::htmlareaselectactive();
+ my $textareaclass = 'class="LC_richDetectHtml"';
$result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '.
- "rows=\"$rows\" cols=\"$cols\">".$oldresponse;
+ 'rows="'.$rows.'" cols="'.$cols.'" '.$textareaclass.'>'.
+ $oldresponse;
if ($oldresponse ne '') {
#get rid of any startup text if the user has already responded
--raeburn1281209043--