[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm
raeburn
raeburn at source.lon-capa.org
Tue Sep 13 22:42:43 EDT 2016
raeburn Wed Sep 14 02:42:43 2016 EDT
Modified files:
/loncom/homework structuretags.pm
Log:
- Unless codemirror disabled ...
- No "Edit Math" button at top of Text Block in colorful editor.
- No "Edit Math" button in editing buttons when using EditXML.
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.549 loncom/homework/structuretags.pm:1.550
--- loncom/homework/structuretags.pm:1.549 Mon Apr 4 17:34:01 2016
+++ loncom/homework/structuretags.pm Wed Sep 14 02:42:43 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.549 2016/04/04 17:34:01 raeburn Exp $
+# $Id: structuretags.pm,v 1.550 2016/09/14 02:42:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -419,9 +419,13 @@
$extra_head .= &homework_js().
&Apache::lonhtmlcommon::dragmath_js("EditMathPopup");
if (&Apache::lonhtmlcommon::htmlareabrowser()) {
- my %textarea_args = (
+ my %textarea_args;
+ if (($env{'request.state'} ne 'construct') ||
+ ($env{'environment.nocodemirror'})) {
+ %textarea_args = (
dragmath => 'math',
);
+ }
$extra_head .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args);
}
my $is_task = ($env{'request.uri'} =~ /\.task$/);
@@ -774,7 +778,9 @@
if ($mode eq 'editxml') {
$result.=&problem_edit_action_button('subedit','edit','e','Edit',1);
$result.=&problem_edit_action_button('subundo','undoxml','u','Undo',1);
- $result.=&Apache::lonhtmlcommon::dragmath_button("LC_editxmltext",1);
+ if ($env{'environment.nocodemirror'}) {
+ $result.=&Apache::lonhtmlcommon::dragmath_button("LC_editxmltext",1);
+ }
} else {
$result.=&problem_edit_action_button('subeditxml','editxml','x','EditXML',1);
$result.=&problem_edit_action_button('subundo','undo','u','Undo',1);
@@ -3003,9 +3009,13 @@
.'<td><span class="LC_nobreak">'.&mt('Delete?').' '
.&Apache::edit::deletelist($target,$token)
.'</span></td>'
- .'<td><span id="math_'.$areaid.'">'
- .&Apache::lonhtmlcommon::dragmath_button($areaid,1)
- .'</span></td>'
+ .'<td><span id="math_'.$areaid.'">';
+ if ($env{'environment.nocodemirror'}) {
+ $result.=&Apache::lonhtmlcommon::dragmath_button($areaid,1);
+ } else {
+ $result.=' ';
+ }
+ $result.='</span></td>'
.'<td>'
.&Apache::edit::insertlist($target,$token)
.'</td>'
More information about the LON-CAPA-cvs
mailing list