[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm /interface lonhtmlcommon.pm

foxr foxr at source.lon-capa.org
Mon Sep 24 07:04:20 EDT 2012


foxr		Mon Sep 24 11:04:20 2012 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  BZ838 - support the spellcheck attribute in the multicolored editor for 
          <textfield><textline>  Alter Javascript so that if language is 'none' 
          spellchecking is not performed.
  
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.310 loncom/homework/inputtags.pm:1.311
--- loncom/homework/inputtags.pm:1.310	Mon Sep 24 10:34:19 2012
+++ loncom/homework/inputtags.pm	Mon Sep 24 11:04:16 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.310 2012/09/24 10:34:19 foxr Exp $
+# $Id: inputtags.pm,v 1.311 2012/09/24 11:04:16 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -266,10 +266,12 @@
 	my $bodytext=&Apache::lonxml::get_all_text("/textfield",$parser,
 						   $style);
 	$result.=&Apache::edit::editfield($token->[1],$bodytext,'Text you want to appear by default:',80,2);
+	$result .= &Apache::edit::select_arg('Spellcheck for; ', 'spellcheck',
+					     ['none', 'en', 'de', 'fr'], $token);
     } elsif ($target eq 'modified') {
 	my $constructtag=&Apache::edit::get_new_args($token,$parstack,
 						     $safeeval,'rows','cols',
-						     'addchars');
+						     'addchars', 'spellcheck');
 	if ($constructtag) {
 	    $result = &Apache::edit::rebuild_tag($token);
 	} else {
@@ -453,12 +455,14 @@
 				    'addchars',$token,10);
         $result.=&Apache::edit::select_arg('Readonly:','readonly',
 					   ['no','yes'],$token);
+	$result.=&Apache::edit::select_arg("Spellcheck for: ", 'spellcheck',
+					   ['none', 'en', 'de', 'fr'], $token);
 	$result.=&Apache::edit::end_row();
 	$result.=&Apache::edit::end_table();
     } elsif ($target eq 'modified') {
 	my $constructtag=&Apache::edit::get_new_args($token,$parstack,
 						     $safeeval,'size',
-						     'addchars','readonly');
+						     'addchars','readonly', 'spellcheck');
 	if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
     } elsif ($target eq 'tex' 
 	     && $Apache::lonhomework::type ne 'exam') {
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.324 loncom/interface/lonhtmlcommon.pm:1.325
--- loncom/interface/lonhtmlcommon.pm:1.324	Mon Sep 24 10:47:26 2012
+++ loncom/interface/lonhtmlcommon.pm	Mon Sep 24 11:04:20 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.324 2012/09/24 10:47:26 foxr Exp $
+# $Id: lonhtmlcommon.pm,v 1.325 2012/09/24 11:04:20 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1425,9 +1425,14 @@
 
 			});
 
+    /* the muli colored editor can generate spellcheck with language 'none'
+       to disable spellcheck as well
+    */
     function doSpellcheck(element, lang) {
-	\$(element).spellchecker('option', {lang: lang});
-	\$(element).spellchecker('check');
+	if (lang != 'none') {
+ 	    \$(element).spellchecker('option', {lang: lang});
+	    \$(element).spellchecker('check');
+        }
     }
 
 




More information about the LON-CAPA-cvs mailing list