diff options
author | zotlabs <mike@macgirvin.com> | 2017-12-02 17:32:19 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-12-02 17:32:19 -0800 |
commit | d5763ba476290fca6083c7b415a4ae4d177919cf (patch) | |
tree | 90ab2e185423eccf806a3cc830fe797c52d5c8a6 /view/js | |
parent | 8a8689c19139f075145001b46a15dea56ff21c77 (diff) | |
parent | dd2c4c37ff03eef6470ef0364217b2c6208c38c0 (diff) | |
download | volse-hubzilla-d5763ba476290fca6083c7b415a4ae4d177919cf.tar.gz volse-hubzilla-d5763ba476290fca6083c7b415a4ae4d177919cf.tar.bz2 volse-hubzilla-d5763ba476290fca6083c7b415a4ae4d177919cf.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 14 | ||||
-rw-r--r-- | view/js/mod_cloud.js | 23 |
2 files changed, 32 insertions, 5 deletions
diff --git a/view/js/main.js b/view/js/main.js index 888934ea8..11a09b647 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -874,6 +874,7 @@ function notify_popup_loader(notifyType) { var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html()); var notifications_all = unescape($('<div>').append( $("#nav-" + notifyType + "-see-all").clone() ).html()); //outerHtml hack var notifications_mark = unescape($('<div>').append( $("#nav-" + notifyType + "-mark-all").clone() ).html()); //outerHtml hack + var notifications_tt_only = unescape($('<div>').append( $("#tt-" + notifyType + "-only").clone() ).html()); //outerHtml hack var notifications_empty = unescape($("#nav-" + notifyType + "-menu").html()); var notify_menu = $("#nav-" + notifyType + "-menu"); @@ -885,14 +886,15 @@ function notify_popup_loader(notifyType) { window.location.href=window.location.href; } - $("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark); - $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark); + $("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark + notifications_tt_only); + $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark + notifications_tt_only); + $("." + notifyType + "-update").html(data.notify.length); $(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); + 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); + 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); }); @@ -901,8 +903,12 @@ function notify_popup_loader(notifyType) { $(el).attr('src', $(el).data("src")); $(el).removeAttr("data-src"); }); + + if($('#tt-' + notifyType + '-only').hasClass('active')) + $('#nav-' + notifyType + '-menu [data-thread_top=false]').hide(); }); + setTimeout(function() { if(notify_menu.hasClass('show')) { console.log('updating ' + notifyType + ' notifications...'); diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index 9f2a007f3..031895caf 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -23,12 +23,33 @@ function UploadInit() { url: 'file_upload', dataType: 'json', dropZone: filedrag, - formData: $('#ajax-upload-files').serializeArray(), maxChunkSize: 4 * 1024 * 1024, add: function(e,data) { $(data.files).each( function() { this.count = ++ count; prepareHtml(this); }); + var allow_cid = ($('#ajax-upload-files').data('allow_cid') || []); + var allow_gid = ($('#ajax-upload-files').data('allow_gid') || []); + var deny_cid = ($('#ajax-upload-files').data('deny_cid') || []); + var deny_gid = ($('#ajax-upload-files').data('deny_gid') || []); + + $('.acl-field').remove(); + + $(allow_gid).each(function(i,v) { + $('#ajax-upload-files').append("<input class='acl-field' type='hidden' name='group_allow[]' value='"+v+"'>"); + }); + $(allow_cid).each(function(i,v) { + $('#ajax-upload-files').append("<input class='acl-field' type='hidden' name='contact_allow[]' value='"+v+"'>"); + }); + $(deny_gid).each(function(i,v) { + $('#ajax-upload-files').append("<input class='acl-field' type='hidden' name='group_deny[]' value='"+v+"'>"); + }); + $(deny_cid).each(function(i,v) { + $('#ajax-upload-files').append("<input class='acl-field' type='hidden' name='contact_deny[]' value='"+v+"'>"); + }); + + data.formData = $('#ajax-upload-files').serializeArray(); + data.submit(); }, |