From 53e353abf2abe43b14f05fbf38e232a68f0689ad Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 18 Jan 2018 12:44:40 +0100 Subject: consolidate navbar tucson and some javascript cleanup --- view/css/navbar_tucson.css | 3 - view/js/main.js | 15 +--- view/tpl/hdr.tpl | 3 - view/tpl/navbar_tucson.tpl | 168 +++++++++++++-------------------------------- 4 files changed, 48 insertions(+), 141 deletions(-) (limited to 'view') diff --git a/view/css/navbar_tucson.css b/view/css/navbar_tucson.css index 79f95fe63..e69de29bb 100644 --- a/view/css/navbar_tucson.css +++ b/view/css/navbar_tucson.css @@ -1,3 +0,0 @@ -#notifications { - display: none; -} diff --git a/view/js/main.js b/view/js/main.js index 52b836936..0e3dcb0ec 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -878,18 +878,10 @@ function justifyPhotosAjax(id) { function notify_popup_loader(notifyType) { - /* 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 - //var notifications_tt_only = unescape($('
').append( $("#tt-" + notifyType + "-only").clone() ).html()); //outerHtml hack - //var notifications_cn_only = unescape($('
').append( $("#cn-" + notifyType + "-only").clone() ).html()); //outerHtml hack - //var notifications_empty = unescape($("#nav-" + notifyType + "-menu").html()); - var notify_menu = $("#nav-" + notifyType + "-menu"); - var pingExCmd = 'ping/' + notifyType + ((localUser != 0) ? '?f=&uid=' + localUser : ''); + $.get(pingExCmd, function(data) { if(data.invalid == 1) { @@ -904,10 +896,8 @@ function notify_popup_loader(notifyType) { notify_menu.html(''); $(data.notify).each(function() { - html = navbar_notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top); - $("#navbar-" + notifyType + "-menu").append(html); html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top); - $("#nav-" + notifyType + "-menu").append(html); + notify_menu.append(html); }); $(".dropdown-menu img[data-src], .notification img[data-src]").each(function(i, el){ @@ -920,7 +910,6 @@ function notify_popup_loader(notifyType) { $('#nav-' + notifyType + '-menu [data-thread_top=false]').hide(); var filter = $('#cn-' + notifyType + '-input').val(); - if(filter) { $('#nav-' + notifyType + '-menu .notification').each(function(i, el){ var cn = $(el).data('contact_name').toLowerCase(); diff --git a/view/tpl/hdr.tpl b/view/tpl/hdr.tpl index 29137c740..e69de29bb 100644 --- a/view/tpl/hdr.tpl +++ b/view/tpl/hdr.tpl @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/view/tpl/navbar_tucson.tpl b/view/tpl/navbar_tucson.tpl index 08fc40656..2c9570938 100755 --- a/view/tpl/navbar_tucson.tpl +++ b/view/tpl/navbar_tucson.tpl @@ -16,12 +16,9 @@ {{/if}}
{{/if}} - - - {{if $userinfo}} -