Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

add notification when download ends #324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ var chapter_name = sanitize((chapterindex+1)+'. '+coursedata['chapters'][chapter
function downloadLecture(chapterindex,lectureindex,num_lectures,chapter_name){
if(downloaded==toDownload){
resetCourse($course.find('.download-success'));
sendNotification(course_name);
return;
}else if(lectureindex==num_lectures){
downloadChapter(++chapterindex,0);
Expand Down Expand Up @@ -822,6 +823,15 @@ function resetCourse($elem){

}

// The purpose here is to have a notification sent, so the user can understand that the download ended
// The title of the notification should be translated but since the translate function is in index.html and to avoid code duplication
// I would like to have your feedback in this
function sendNotification(course_name){
var downloadFinishedNotif = new Notification('Download finished', {
body: course_name
});
}

$('.courses-sidebar').click(function(){
$('.content .ui.section').hide();
$('.content .ui.courses.section').show();
Expand Down