58 console.log("Launch browser notif check: setTimeout is set to launch 'first_execution' function after a wait of time_first_execution="+time_first_execution+". nowtime (time php page generation) = "+nowtime+" time_js_next_check = "+time_js_next_test);
59 } //first run auto check
60
61
62 function first_execution() {
63 console.log("Call first_execution then set repeat time to time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update);
64 check_events(); //one check before setting the new time for other checks
65 setInterval(check_events, time_auto_update * 1000); // Set new time to run next check events
66 }
67
68 function check_events() {
69 if (Notification.permission === "granted")
70 {
71 time_js_next_test += time_auto_update;
72 console.log("Call ajax to check_events with time_js_next_test = "+time_js_next_test);
148 console.log("No reminder to do found, next search at "+time_js_next_test);
149 }
150 }
151 });
152 }
153else
154 {
155 console.log("Cancel check_events. Useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https).");