[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /homework structuretags.pm

raeburn raeburn@source.lon-capa.org
Mon, 16 Aug 2010 18:38:28 -0000


raeburn		Mon Aug 16 18:38:28 2010 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom/homework	structuretags.pm 
  Log:
  - Backport 1.473, 1.474.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.465.2.3 loncom/homework/structuretags.pm:1.465.2.4
--- loncom/homework/structuretags.pm:1.465.2.3	Mon Aug 16 18:09:28 2010
+++ loncom/homework/structuretags.pm	Mon Aug 16 18:38:28 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.465.2.3 2010/08/16 18:09:28 raeburn Exp $
+# $Id: structuretags.pm,v 1.465.2.4 2010/08/16 18:38:28 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -177,12 +177,13 @@
 					   $parstack,$parser,$safeeval);
     }
 
-    $extra_head .= &homework_js();
-
-    if ($env{'environment.wysiwygeditor'} eq 'on') {
-	$extra_head .= &Apache::lonhtmlcommon::dragmath_js("FCKEditMathPopup");
-    } else {
-        $extra_head .= &Apache::lonhtmlcommon::dragmath_js("EditMathPopup");
+    $extra_head .= &homework_js().
+                   &Apache::lonhtmlcommon::dragmath_js("EditMathPopup");
+    if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+        my %textarea_args = (
+                                dragmath => 'math',
+                              );
+        $extra_head .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args);
     }
 
     my %body_args;
@@ -405,8 +406,6 @@
   <hr style="clear:both;" />
 </div>
 '.
-
-    &Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields()).
     "\n</form>\n".&Apache::loncommon::end_page();
 }
 
@@ -1198,7 +1197,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});
@@ -2057,17 +2055,15 @@
 	$result.=&Apache::edit::start_table($token)."<tr><td>".&mt('Text Block')."</td>"
                  .'<td><span class="LC_nobreak">'.&mt('Delete?').' '
                  .&Apache::edit::deletelist($target,$token)
-                 .'</span></td>';
-        unless ($env{'environment.wysiwygeditor'} eq 'on') {
-	    $result .= '<td align="left">'
-		.&Apache::lonhtmlcommon::dragmath_button($areaid,1)
-		.'</td>'
-		.'<td>'
-		.&Apache::edit::insertlist($target,$token)
-		.'</td>';
-	}
-	$result.='<td align="right" valign="top">' .
-	    &Apache::loncommon::helpLatexCheatsheet().
+                 .'</span></td>'
+	         .'<td align="left"><span id="math_'.$areaid.'" />'
+		 .&Apache::lonhtmlcommon::dragmath_button($areaid,1)
+		 .'</td>'
+		 .'<td>'
+		 .&Apache::edit::insertlist($target,$token)
+		 .'</td>'
+	         .'<td align="right" valign="top">' .
+	         &Apache::loncommon::helpLatexCheatsheet().
 		 &Apache::edit::end_row().
                  &Apache::edit::start_spanning_row()."\n".
 		 &Apache::edit::editfield($token->[1],$text,"",80,8,1);