aboutsummaryrefslogtreecommitdiffstats
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
parente9b5b0f0b424930b87708080c4e6ce671016177b (diff)
downloadvolse-hubzilla-a12264193ffe9daa04155aff78a1feaff82b7670.tar.gz
volse-hubzilla-a12264193ffe9daa04155aff78a1feaff82b7670.tar.bz2
volse-hubzilla-a12264193ffe9daa04155aff78a1feaff82b7670.zip
modularise the notification popups
-rw-r--r--install/database.sql4
-rw-r--r--install/update.php12
-rw-r--r--js/main.js26
-rw-r--r--version.inc2
-rw-r--r--view/tpl/nav.tpl15
5 files changed, 48 insertions, 11 deletions
diff --git a/install/database.sql b/install/database.sql
index 574aaa38e..342d93055 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -299,7 +299,7 @@ CREATE TABLE IF NOT EXISTS `deliverq` (
CREATE TABLE IF NOT EXISTS `event` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `account` int(10) unsigned NOT NULL DEFAULT '0',
+ `aid` int(10) unsigned NOT NULL DEFAULT '0',
`uid` int(11) NOT NULL,
`cid` int(11) NOT NULL,
`message_id` char(255) NOT NULL,
@@ -328,7 +328,7 @@ CREATE TABLE IF NOT EXISTS `event` (
KEY `adjust` (`adjust`),
KEY `nofinish` (`nofinish`),
KEY `ignore` (`ignore`),
- KEY `account` (`account`)
+ KEY `aid` (`aid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `fcontact` (
diff --git a/install/update.php b/install/update.php
index f767c2f22..e3394b5bc 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1002 );
+define( 'UPDATE_VERSION' , 1003 );
/**
*
@@ -61,3 +61,13 @@ function update_r1001() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+
+function update_r1002() {
+ $r = q("ALTER TABLE `event` CHANGE `account` `aid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r2 = q("alter table `event` drop index `account`, add index (`aid`)");
+
+ if($r && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
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) {
diff --git a/version.inc b/version.inc
index 24fb06e6d..bdbdd882b 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2012-12-16.171
+2012-12-18.173
diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl
index 234b20854..d052cde3f 100644
--- a/view/tpl/nav.tpl
+++ b/view/tpl/nav.tpl
@@ -14,16 +14,23 @@
{{ if $nav.network }}
<li id="nav-network-link" class="nav-menu $sel.network">
<a class="$nav.network.2" href="$nav.network.0" title="$nav.network.3" >$nav.network.1</a>
- <span id="net-update" class="nav-notify"></span>
+ <span id="net-update" class="nav-notify fakelink" onclick="notify_popup('network'); return false;" ></span>
</li>
{{ endif }}
{{ if $nav.home }}
<li id="nav-home-link" class="nav-menu $sel.home">
<a class="$nav.home.2" href="$nav.home.0" title="$nav.home.3" >$nav.home.1</a>
- <span id="home-update" class="nav-notify"></span>
+ <span id="home-update" class="nav-notify fakelink" onclick="notify_popup('home'); return false;" ></span>
</li>
{{ endif }}
-
+
+ {{ if $nav.all_events }}
+ <li id="nav-all-events-link" class="nav-menu $sel.all_events">
+ <a class="$nav.all_events.2" href="$nav.all_events.0" title="$nav.all_events.3" >$nav.all_events.1</a>
+ <span id="all-events-update" class="nav-notify fakelink" onclick="notify_popup('all_events'); return false;" ></span>
+ </li>
+ {{ endif }}
+
{{ if $nav.intros }}
<li id="nav-intros-link" class="nav-menu $sel.intros">
<a class="$nav.intros.2" href="$nav.intros.0" title="$nav.intros.3" >$nav.intros.1</a>
@@ -34,7 +41,7 @@
{{ if $nav.notifications }}
- <li id="nav-notifications-linkmenu" class="nav-menu fakelink" onclick="notify_popup(); return false;" title="$nav.notifications.1"><span class="icon s22 notify">$nav.notifications.1</span></a>
+ <li id="nav-notifications-linkmenu" class="nav-menu fakelink" onclick="notify_popup('notify'); return false;" title="$nav.notifications.1"><span class="icon s22 notify">$nav.notifications.1</span></a>
<span id="notify-update" class="nav-notify"></span>
<ul id="nav-notifications-menu" class="menu-popup">
<li id="nav-notifications-see-all"><a href="$nav.notifications.all.0">$nav.notifications.all.1</a></li>