mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Do not display notifications when popup is open (and remove traces)
This commit is contained in:
parent
0b3c42bb03
commit
5c9822111d
@ -65,12 +65,17 @@ function getEvents(reply){
|
|||||||
// Discriminate the new events
|
// Discriminate the new events
|
||||||
newEvents=fetchNewEvents(fetchedEvents,storedEvents);
|
newEvents=fetchNewEvents(fetchedEvents,storedEvents);
|
||||||
|
|
||||||
// Display the notifications
|
// Display the notifications only if popup is not showing
|
||||||
|
var views = chrome.extension.getViews({ type: "popup" });
|
||||||
|
if (views.length == 0) {
|
||||||
for(var k=0;k<newEvents.length;k++){
|
for(var k=0;k<newEvents.length;k++){
|
||||||
localStorage["new_events"]++;
|
localStorage["new_events"]++;
|
||||||
displayNotification (newEvents[k])
|
displayNotification (newEvents[k])
|
||||||
alertsSound(newEvents[k]);
|
alertsSound(newEvents[k]);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
localStorage["new_events"] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
storedEvents = fetchedEvents;
|
storedEvents = fetchedEvents;
|
||||||
|
|
||||||
@ -114,6 +119,7 @@ function parseReplyEvents (reply) {
|
|||||||
for(var i=0;i<e_array.length;i++){
|
for(var i=0;i<e_array.length;i++){
|
||||||
// Avoid to parse empty lines
|
// Avoid to parse empty lines
|
||||||
if (e_array[i].length == 0) continue;
|
if (e_array[i].length == 0) continue;
|
||||||
|
|
||||||
var event=e_array[i].split(";");
|
var event=e_array[i].split(";");
|
||||||
fetchedEvents.push({
|
fetchedEvents.push({
|
||||||
'id' : event[0],
|
'id' : event[0],
|
||||||
|
@ -92,12 +92,6 @@ function disable(state){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function windowClose() {
|
|
||||||
//window.close();
|
|
||||||
console.log("close");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Add callbacks to elements
|
//Add callbacks to elements
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
|
||||||
@ -167,5 +161,4 @@ $(document).ready (function () {
|
|||||||
$("#close").click (function () {
|
$("#close").click (function () {
|
||||||
window.close();
|
window.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -64,7 +64,6 @@ function showError(text){
|
|||||||
function showEvents(){
|
function showEvents(){
|
||||||
|
|
||||||
clearError();
|
clearError();
|
||||||
console.log("showEvents!!");
|
|
||||||
$('#events').empty();
|
$('#events').empty();
|
||||||
var e_refr = document.getElementById('event_temp');
|
var e_refr = document.getElementById('event_temp');
|
||||||
if(e_refr){
|
if(e_refr){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user