From 491856fa79cad2fd2b352af46fd45146b42e7e54 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 11 Oct 2017 15:12:49 -0700 Subject: [PATCH 1/9] the template is needed for the old-style notifications --- view/tpl/hdr.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/view/tpl/hdr.tpl b/view/tpl/hdr.tpl index e69de29bb..4eec1500a 100644 --- a/view/tpl/hdr.tpl +++ b/view/tpl/hdr.tpl @@ -0,0 +1,3 @@ + \ No newline at end of file From a652e546cccf270f8e837a549fb31b9d619239b5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 11 Oct 2017 15:19:06 -0700 Subject: [PATCH 2/9] add local_channel as a comanche condition variable --- Zotlabs/Render/Comanche.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index c787b19ae..8831bd117 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -153,6 +153,7 @@ class Comanche { * $observer.address - xchan_addr or false * $observer.name - xchan_name or false * $observer - xchan_hash of observer or empty string + * $local_channel - logged in channel_id or false */ function get_condition_var($v) { @@ -162,6 +163,9 @@ class Comanche { return get_config($x[1],$x[2]); elseif($x[0] === 'request') return $_SERVER['REQUEST_URI']; + elseif($x[0] === 'local_channel') { + return local_channel(); + } elseif($x[0] === 'observer') { if(count($x) > 1) { if($x[1] == 'language') From 6acd96fd33038f0e3535af6861d1ba658098abc8 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 11 Oct 2017 17:52:03 -0700 Subject: [PATCH 3/9] typo --- include/zot.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/zot.php b/include/zot.php index b6df6bca8..da1f3bfa1 100644 --- a/include/zot.php +++ b/include/zot.php @@ -312,6 +312,7 @@ function zot_refresh($them, $channel = null, $force = false) { logger('zot_refresh: ' . $url, LOGGER_DATA, LOG_INFO); + $result = z_post_url($url . $rhs,$postvars); if ($result['success']) { @@ -4045,7 +4046,7 @@ function zotinfo($arr) { $id = $e['channel_id']; - $x = [ 'channel_id' => $id, 'protocols' => 'zot' ]; + $x = [ 'channel_id' => $id, 'protocols' => ['zot'] ]; call_hooks('channel_protocols',$x); $protocols = $x['protocols']; From e6c166a182f53be9abb819b9c8a80275fc815d29 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 12 Oct 2017 11:36:25 -0700 Subject: [PATCH 4/9] sort out the notification ids --- Zotlabs/Web/HTTPSig.php | 3 ++- view/js/main.js | 8 +++++++- view/tpl/hdr.tpl | 2 +- view/tpl/navbar_tucson.tpl | 24 ++++++++++++------------ 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php index 445ba200b..1c66b8cf4 100644 --- a/Zotlabs/Web/HTTPSig.php +++ b/Zotlabs/Web/HTTPSig.php @@ -72,7 +72,8 @@ class HTTPSig { return $result; } - logger('sig_block: ' . print_r($sig_block,true), LOGGER_DATA); + // Warning: This log statement includes binary data + // logger('sig_block: ' . print_r($sig_block,true), LOGGER_DATA); $result['header_signed'] = true; diff --git a/view/js/main.js b/view/js/main.js index ea8d1a3ab..0aeb4d36d 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -963,7 +963,8 @@ function justifyPhotosAjax(id) { function notify_popup_loader(notifyType) { - /* notifications template */ + /* notifications template - different for navbar and notifications widget */ + var navbar_notifications_tpl= unescape($("#navbar-notifications-template[rel=template]").html()); var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html()); var notifications_all = unescape($('
').append( $("#nav-" + notifyType + "-see-all").clone() ).html()); //outerHtml hack var notifications_mark = unescape($('
').append( $("#nav-" + notifyType + "-mark-all").clone() ).html()); //outerHtml hack @@ -979,11 +980,16 @@ function notify_popup_loader(notifyType) { } if(data.notify.length == 0){ + $("#navbar-" + notifyType + "-menu").html(aStr[nothingnew]); $("#nav-" + notifyType + "-menu").html(aStr[nothingnew]); } else { + $("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark); $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark); $(data.notify).each(function() { + html = navbar_notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass); + $("#navbar-" + notifyType + "-menu").append(html); + html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass); $("#nav-" + notifyType + "-menu").append(html); }); diff --git a/view/tpl/hdr.tpl b/view/tpl/hdr.tpl index 4eec1500a..43965748e 100644 --- a/view/tpl/hdr.tpl +++ b/view/tpl/hdr.tpl @@ -1,3 +1,3 @@ -