[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm
foxr
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 01 Jul 2008 11:01:31 -0000
foxr Tue Jul 1 07:01:31 2008 EDT
Modified files:
/loncom/homework lonhomework.pm
Log:
bz 5744 - Add "Edit Math" button to bring up dragmath to edit equations and
insert the text into a resource being edited in xml editor.
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.293 loncom/homework/lonhomework.pm:1.294
--- loncom/homework/lonhomework.pm:1.293 Mon May 19 17:07:33 2008
+++ loncom/homework/lonhomework.pm Tue Jul 1 07:01:30 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.293 2008/05/19 21:07:33 www Exp $
+# $Id: lonhomework.pm,v 1.294 2008/07/01 11:01:30 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -937,6 +937,16 @@
&Apache::loncommon::resize_textarea_js().
&Apache::structuretags::setmode_javascript();
my $only_body = ($env{'environment.remote'} eq 'off')? 0 : 1;
+ my $dragmath = <<ENDDRAGMATH;
+ <script language="JavaScript">
+ function mathedit(textarea, doc) {
+ targetEntry = textarea;
+ targetDoc = doc;
+ newwin = window.open("/adm/dragmath/applet/EditMathPopup.html","","width=565,height=500,resizable");
+ }
+ </script>
+ <input type="button" value="Edit Math", onclick="javascript:mathedit('LC_editxmltext',document)" />
+ENDDRAGMATH
my $start_page =
&Apache::loncommon::start_page(&mt("EditXML [_1]",$file),$js,
{'no_auto_mt_title' => 1,
@@ -959,6 +969,7 @@
</table>
<div class="LC_edit_problem_discards">
<input type="hidden" name="problemmode" value="editxml" />
+
<input type="button" name="submitmode" accesskey="d" value="'.&mt('Discard Edits and View').'" '.
'onclick="javascript:setmode(this.form,'."'discard'".')" />
<input type="button" '.&Apache::edit::submit_ask_anyway('setmode(this.form,'."'edit'".')').'name="submitmode" accesskey="e" value="'.&mt('Edit').'" />
@@ -966,7 +977,8 @@
</div>
<div class="LC_edit_problem_saves">
<input type="submit" name="submitbutton" accesskey="s" value="'.&mt('Save').'" />
- <input type="submit" name="submitbutton" accesskey="v" value="'.&mt('Save and View').'" />
+ <input type="submit" name="submitbutton" accesskey="v" value="'.&mt('Save and View').'" />'
+ .$dragmath.'
</div>
<hr class="LC_edit_problem_divide" />
'.&Apache::lonxml::message_location().'