[LON-CAPA-cvs] cvs: loncom /interface lonsyllabus.pm
raeburn
raeburn at source.lon-capa.org
Wed May 15 14:45:29 EDT 2013
raeburn Wed May 15 18:45:29 2013 EDT
Modified files:
/loncom/interface lonsyllabus.pm
Log:
- javascript to prompt for confirmation when "Delete" buttons pressed for
uploaded syllabus file or minimal template.
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.125 loncom/interface/lonsyllabus.pm:1.126
--- loncom/interface/lonsyllabus.pm:1.125 Wed May 15 17:47:57 2013
+++ loncom/interface/lonsyllabus.pm Wed May 15 18:45:29 2013
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Syllabus
#
-# $Id: lonsyllabus.pm,v 1.125 2013/05/15 17:47:57 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.126 2013/05/15 18:45:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1434,6 +1434,11 @@
}
sub editbutton_js {
+ my %lt = &Apache::lonlocal::texthash(
+ min => 'Are you sure you want to delete the contents of the syllabus template?',
+ file => 'Are you sure you want to delete the uploaded syllabus file?',
+ noundo => 'This action cannot be reversed.'
+ );
return <<ENDJS;
<script type="text/javascript">
// <![CDATA[
@@ -1442,7 +1447,17 @@
}
function dodelete(caller,url) {
document.syllabus.deleteuploaded.value=caller;
- document.syllabus.submit();
+ if (caller == 'minimal') {
+ if (confirm("$lt{'min'}"+"\\n"+"$lt{'noundo'}")) {
+ document.syllabus.submit();
+ }
+ }
+ if (caller == 'file') {
+ if (confirm("$lt{'file'}"+"\\n"+"$lt{'noundo'}")) {
+ document.syllabus.submit();
+ }
+ }
+ return;
}
// ]]>
</script>
More information about the LON-CAPA-cvs
mailing list