zimbra fluid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var counter = 0; | |
var repeat_all_of = 3; | |
var over = 400; | |
var id = 'zti__main_Mail__2_textCell'; | |
var badge = function () { | |
var field = document.getElementById(id); | |
var html = field.innerHTML; | |
var test = /Réception \([0-9]+\)/; | |
if (test.test(html)) { | |
var badge = html.replace(/.*Réception \(([0-9]+)\).*/g, "$1"); | |
counter++; | |
if (window.fluid.dockBadge != badge) { | |
counter = 0; | |
window.fluid.requestUserAttention(false); | |
} else if (counter >= over) { | |
window.fluid.requestUserAttention(true); | |
} else if (counter++ % repeat_all_of == 0) { | |
window.fluid.requestUserAttention(false); | |
} | |
window.fluid.dockBadge = badge; | |
} else { | |
window.fluid.dockBadge = ""; | |
counter = 0; | |
} | |
} | |
var timing = 5000; | |
var cron = function() { | |
badge(); | |
}; | |
window.setInterval(cron, timing); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment