aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-12-18 16:17:08 -0800
committerfriendica <info@friendica.com>2012-12-18 16:17:08 -0800
commita12264193ffe9daa04155aff78a1feaff82b7670 (patch)
tree2a852d9fe1c91fa2fce5e6b03e021190249e1765 /js
parente9b5b0f0b424930b87708080c4e6ce671016177b (diff)
downloadvolse-hubzilla-a12264193ffe9daa04155aff78a1feaff82b7670.tar.gz
volse-hubzilla-a12264193ffe9daa04155aff78a1feaff82b7670.tar.bz2
volse-hubzilla-a12264193ffe9daa04155aff78a1feaff82b7670.zip
modularise the notification popups
Diffstat (limited to 'js')
-rw-r--r--js/main.js26
1 files changed, 23 insertions, 3 deletions
diff --git a/js/main.js b/js/main.js
index 144db15e6..86f0601b5 100644
--- a/js/main.js
+++ b/js/main.js
@@ -280,7 +280,26 @@
if(data.notify == 0) { data.notify = ''; $('#notify-update').removeClass('show') } else { $('#notify-update').addClass('show') }
$('#notify-update').html(data.notify);
-
+ if(data.register == 0) { data.register = ''; $('#register-update').removeClass('show') } else { $('#register-update').addClass('show') }
+ $('#register-update').html(data.register);
+
+ if(data.events == 0) { data.events = ''; $('#events-update').removeClass('show') } else { $('#events-update').addClass('show') }
+ $('#events-update').html(data.events);
+
+ if(data.events_today == 0) { data.events_today = ''; $('#events-today-update').removeClass('show') } else { $('#events-today-update').addClass('show') }
+ $('#events-today-update').html(data.events_today);
+
+ if(data.birthdays == 0) { data.birthdays = ''; $('#birthdays-update').removeClass('show') } else { $('#birthdays-update').addClass('show') }
+ $('#birthdays-update').html(data.birthdays);
+
+ if(data.birthdays_today == 0) { data.birthdays_today = ''; $('#birthdays-today-update').removeClass('show') } else { $('#birthdays-today-update').addClass('show') }
+ $('#birthdays-today-update').html(data.birthdays_today);
+
+ if(data.all_events == 0) { data.all_events = ''; $('#all-events-update').removeClass('show') } else { $('#all-events-update').addClass('show') }
+ $('#all-events-update').html(data.all_events);
+ if(data.all_events_today == 0) { data.all_events_today = ''; $('#all-events-today-update').removeClass('show') } else { $('#all-events-today-update').addClass('show') }
+ $('#all-events-today-update').html(data.all_events_today);
+
$(data.notice).each(function() {
$.jGrowl(this.message, { sticky: true, theme: 'notice' });
@@ -487,13 +506,14 @@ function updateConvItems(mode,data) {
$(node).removeClass("drop").addClass("drophide");
}
- function notify_popup() {
+ function notify_popup(notifyType) {
if($("#nav-notifications-menu").is(":visible")) {
$("#nav-notifications-menu").hide();
return;
}
+
/* notifications template */
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
var notifications_all = unescape($('<div>').append( $("#nav-notifications-see-all").clone() ).html()); //outerHtml hack
@@ -502,7 +522,7 @@ function updateConvItems(mode,data) {
var notify_menu = $("#nav-notifications-menu");
- var pingExCmd = 'ping/notify' + ((localUser != 0) ? '?f=&uid=' + localUser : '');
+ var pingExCmd = 'ping/' + notifyType + ((localUser != 0) ? '?f=&uid=' + localUser : '');
$.get(pingExCmd,function(data) {
if(data.invalid == 1) {