1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-17 06:45:05 -05:00
SickRage/gui/slick/js/ajaxNotifications.js

25 lines
647 B
JavaScript
Raw Normal View History

2014-09-30 18:20:37 -04:00
var message_url = sbRoot + '/ui/get_messages';
$.pnotify.defaults.pnotify_width = "340px";
$.pnotify.defaults.pnotify_history = false;
$.pnotify.defaults.pnotify_delay = 4000;
function check_notifications() {
2014-09-30 18:20:37 -04:00
$.getJSON(message_url, function(data){
$.each(data, function(name,data){
$.pnotify({
pnotify_type: data.type,
pnotify_hide: data.type == 'notice',
pnotify_title: data.title,
pnotify_text: data.message
});
2014-09-30 18:20:37 -04:00
});
});
2014-09-30 18:20:37 -04:00
setTimeout(check_notifications, 3000)
}
2014-09-30 18:20:37 -04:00
$(document).ready(function(){
check_notifications();
});