--- loncom/interface/londocs.pm 2013/04/01 22:09:56 1.540 +++ loncom/interface/londocs.pm 2013/04/02 00:07:08 1.541 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.540 2013/04/01 22:09:56 raeburn Exp $ +# $Id: londocs.pm,v 1.541 2013/04/02 00:07:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -902,7 +902,7 @@ sub print_paste_buffer { my ($pasteform,$form_start,$buttons,$form_end); if ($pasteitems) { $pasteitems .= '
'; - $form_start = '
'; + $form_start = ''; if (@pasteable) { $buttons = ''.(' 'x2); } @@ -1009,6 +1009,7 @@ sub paste_popup_js { my %lt = &Apache::lonlocal::texthash( show => 'Show Options', hide => 'Hide Options', + none => 'No items selected from clipboard.', ); return <<"END"; @@ -1038,6 +1039,29 @@ function showOptions(caller,suffix) { return; } +function validateClipboard() { + var numchk = 0; + if (document.pasteform.pasting.length > 1) { + for (var i=0; i 0) { + return true; + } else { + alert("$lt{'none'}"); + return false; + } +} + END } @@ -2351,24 +2375,30 @@ sub editor { my ($paste_res,$save_error,$pastemsgarray,$lockerror) = &do_paste_from_buffer($coursenum,$coursedom,$folder,$container, \%paste_errors); - if (ref($pastemsgarray) eq 'ARRAY') { - if (@{$pastemsgarray} > 0) { - - $r->print('

'. - join('
',@{$pastemsgarray}). - '

'); - } - } - if ($lockerror) { - $r->print('

'. - $lockerror. + if (ref($pastemsgarray) eq 'ARRAY') { + if (@{$pastemsgarray} > 0) { + $r->print('

'. + join('
',@{$pastemsgarray}). '

'); } - if ($save_error ne '') { - return $save_error; + } + if ($lockerror) { + $r->print('

'. + $lockerror. + '

'); + } + if ($save_error ne '') { + return $save_error; + } + if ($paste_res) { + my %errortext = &Apache::lonlocal::texthash ( + fail => 'Storage of folder contents failed', + failread => 'Reading folder contents failed', + failstore => 'Storage of folder contents failed', + ); + if ($errortext{$paste_res}) { + $r->print('

'.$errortext{$paste_res}.'

'); } - if ($paste_res ne 'ok') { - $r->print('

'.$paste_res.'

'); } if (keys(%paste_errors) > 0) { $r->print('

'."\n".