--- loncom/html/res/adm/pages/annotator/admannotations.pm 2008/09/11 20:44:54 1.28 +++ loncom/html/res/adm/pages/annotator/admannotations.pm 2009/02/19 22:05:28 1.34 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # This will take annotations and then plug them into a page. # -# $Id: admannotations.pm,v 1.28 2008/09/11 20:44:54 tempelho Exp $ +# $Id: admannotations.pm,v 1.34 2009/02/19 22:05:28 schafran Exp $ # # Copyright Michigan State University Board of Trustees # @@ -27,6 +27,7 @@ # ################## + package Apache::admannotations; use strict; @@ -40,8 +41,7 @@ use Apache::lonlocal; sub write_annotation { my ($symb, $enc, $annotation) = @_; - - $annotation=~s/$^\s*$//; + $annotation=~s/^\s*$//; my $key = $symb; if (!$enc) { $key = @@ -75,6 +75,11 @@ sub construct_editor { my $get_symb = &js_get_symb(); + my %lt = ( 'close no save' => "Close", + 'save' => "Save", + 'cancel' => "Cancel",); + %lt = &Apache::lonlocal::texthash(%lt); + my $js = < var timeout; @@ -89,6 +94,11 @@ function changed() { } timeout=setTimeout('changed();','1000'); } + +function renameButton(){ + document.getElementById("close").value="$lt{'cancel'}"; +} + ENDJS @@ -102,20 +112,17 @@ ENDJS my $end_page = &Apache::loncommon::end_page(); - my %lt = ( 'close no save' => "Close (no save)", - 'save' => "Save and Update",); - %lt = &Apache::lonlocal::texthash(%lt); return(<
-
+
-
@@ -179,8 +186,8 @@ sub handler { my $page; - my ($symb_old,$symb_old_enc) = &Apache::loncommon::clean_symb($env{'form.symbold'}); - my ($symb_new,$symb_new_enc) = &Apache::loncommon::clean_symb($env{'form.symbnew'}); + my ($symb_old,$symb_old_enc) = &Apache::loncommon::clean_symb($env{'form.symbold'},1); + my ($symb_new,$symb_new_enc) = &Apache::loncommon::clean_symb($env{'form.symbnew'},1); my $annotation=$env{'form.annotation'}; @@ -205,3 +212,41 @@ sub handler { 1; __END__ +=pod + +=head1 NAME + +Apache::admannotations + +=head1 SYNOPSIS + +This will take annotations and then plug them into a page. + +This is part of the LearningOnline Network with CAPA project +described at http://www.lon-capa.org. + +=head1 OVERVIEW + +(empty) + +=head1 SUBROUTINES + +=over write_annotation() + +Put annotation + +=item js_get_symb() + +Construct editor + +=item construct_editor() + +=item construct_error() + +=item handler() + +=back + +=cut + +