Skip to content
Permalink
Browse files

MDL-51117 JavaScript: Convert alert to M.core.alert in dndupload

This also updates a language string to use string params instead of
hard-prefixing.
  • Loading branch information...
andrewnicols committed Aug 14, 2015
1 parent 9d5d9c6 commit 296af14b195f625c71068e6c1305ed58722eceaf
Showing with 11 additions and 7 deletions.
  1. +5 −5 course/dndupload.js
  2. +1 −1 course/dnduploadlib.php
  3. +1 −0 lang/en/deprecated.txt
  4. +4 −1 lang/en/moodle.php
@@ -743,7 +743,7 @@ M.course_dndupload = {
var self = this;

if (file.size > this.maxbytes) {
alert("'"+file.name+"' "+M.util.get_string('filetoolarge', 'moodle'));
new M.core.alert({message: M.util.get_string('namedfiletoolarge', 'moodle', {filename: file.name})});
return;
}

@@ -777,11 +777,11 @@ M.course_dndupload = {
} else {
// Error - remove the dummy element
resel.parent.removeChild(resel.li);
alert(result.error);
new M.core.alert({message: result.error});
}
}
} else {
alert(M.util.get_string('servererror', 'moodle'));
new M.core.alert({message: M.util.get_string('servererror', 'moodle')});
}
}
};
@@ -1002,11 +1002,11 @@ M.course_dndupload = {
} else {
// Error - remove the dummy element
resel.parent.removeChild(resel.li);
alert(result.error);
new M.core.alert({message: result.error});
}
}
} else {
alert(M.util.get_string('servererror', 'moodle'));
new M.core.alert({message: M.util.get_string('servererror', 'moodle')});
}
}
};
@@ -61,7 +61,7 @@ function dndupload_add_to_course($course, $modnames) {
array('dndworkingtextlink', 'moodle'),
array('dndworkingtext', 'moodle'),
array('dndworkinglink', 'moodle'),
array('filetoolarge', 'moodle'),
array('namedfiletoolarge', 'moodle'),
array('actionchoice', 'moodle'),
array('servererror', 'moodle'),
array('upload', 'moodle'),
@@ -27,3 +27,4 @@ othertags,core_tag
tagtype,core_tag
manageofficialtags,core_tag
settypeofficial,core_tag
filetoolarge,core
@@ -775,7 +775,6 @@
$string['file'] = 'File';
$string['fileexists'] = 'There is already a file called {$a}';
$string['filemissing'] = '{$a} is missing';
$string['filetoolarge'] = 'is too large to upload';
$string['files'] = 'Files';
$string['filesanduploads'] = 'Files and uploads';
$string['filesfolders'] = 'Files/folders';
@@ -1226,6 +1225,7 @@
$string['mymoodledashboard'] = 'My Moodle dashboard';
$string['myprofile'] = 'My profile';
$string['name'] = 'Name';
$string['namedfiletoolarge'] = 'The file \'{$a->filename}\' is too large and cannot be uploaded';
$string['nameforlink'] = 'What do you want to call this link?';
$string['nameforpage'] = 'Name';
$string['navigation'] = 'Navigation';
@@ -2052,3 +2052,6 @@
$string['yourteacher'] = 'your {$a}';
$string['yourwordforx'] = 'Your word for \'{$a}\'';
$string['zippingbackup'] = 'Zipping backup';
// Deprecated since Moodle 3.1.
$string['filetoolarge'] = 'is too large to upload';

0 comments on commit 296af14

Please sign in to comment.
You can’t perform that action at this time.