version 1.176, 2008/07/07 11:02:05
|
version 1.179, 2008/08/24 12:56:28
|
Line 68 use LONCAPA;
|
Line 68 use LONCAPA;
|
|
|
=pod |
=pod |
|
|
=item dragmath |
=item dragmath_button |
|
|
Creates a button that will allow dragmath to edit an equation into |
Creates a button that launches a dragmath popup-window, in which an |
a specified textbox. |
expression can be edited and pasted as LaTeX into a specified textarea. |
|
|
|
textarea - Name of the textarea to edit. |
|
helpicon - If true, show a help icon to the right of the button. |
|
|
textarea - Name of the text area to edit. |
|
=cut |
=cut |
|
|
############################################## |
sub dragmath_button { |
# TODO: Figure out a way to only emit the mathedit function once. |
my ($textarea,$helpicon) = @_; |
# per html output document. |
my $help_text; |
# |
if ($helpicon) { |
|
$help_text = &Apache::loncommon::help_open_topic('Authoring_Math_Editor'); |
|
} |
|
my $buttontext=&mt('Edit Math'); |
|
return <<ENDDRAGMATH; |
|
<input type="button" value="$buttontext", onclick="javascript:mathedit('$textarea',document)" />$help_text |
|
ENDDRAGMATH |
|
} |
|
|
############################################## |
############################################## |
|
|
sub dragmath { |
=pod |
my ($textarea) = @_; |
|
|
|
return <<ENDDRAGMATH; |
=item dragmath_js |
<script language="JavaScript"> |
|
|
Javascript used to open pop-up window containing dragmath applet which |
|
can be used to paste LaTeX into a textarea. |
|
|
|
=cut |
|
|
|
sub dragmath_js { |
|
return <<ENDDRAGMATHJS; |
|
<script type="text/javascript"> |
function mathedit(textarea, doc) { |
function mathedit(textarea, doc) { |
targetEntry = textarea; |
targetEntry = textarea; |
targetDoc = doc; |
targetDoc = doc; |
newwin = window.open("/adm/dragmath/applet/EditMathPopup.html","","width=565,height=500,resizable"); |
newwin = window.open("/adm/dragmath/applet/EditMathPopup.html","","width=565,height=500,resizable"); |
} |
} |
</script> |
</script> |
<input type="button" value="Edit Math", onclick="javascript:mathedit('$textarea',document)" /> |
|
ENDDRAGMATH |
ENDDRAGMATHJS |
} |
} |
|
|
############################################## |
############################################## |
Line 1710 sub course_custom_roles {
|
Line 1727 sub course_custom_roles {
|
|
|
############################################## |
############################################## |
############################################## |
############################################## |
|
|
|
# topic_bar |
|
# |
|
# Generates a div containing a numbered (static image) followed by a title |
|
# with a background color defined in the corresponding CSS: LC_topic_bar |
|
# |
|
sub topic_bar { |
|
my ($imgnum,$title) = @_; |
|
return ' |
|
<div class="LC_topic_bar"> |
|
<img alt="'.&mt('Step [_1]',$imgnum). |
|
'"src="/res/adm/pages/bl_step'.$imgnum.'.gif" /> |
|
<span>'.$title.'</span> |
|
</div> |
|
'; |
|
} |
|
|
|
############################################## |
|
############################################## |
|
|
# echo_form_input |
# echo_form_input |
# |
# |