From f111c5c325fec1139ee7ea36c691de452469fa5a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 13 Dec 2016 17:30:02 -0800 Subject: mail preview (basic functionality) --- view/js/main.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 3981d4266..1d6eca91d 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1146,6 +1146,25 @@ function preview_post() { return true; } +function preview_mail() { + $("#mail-preview").val("1"); + $("#mail-preview-content").show(); + $.post( + "mail", + $("#prvmail-form").serialize(), + function(data) { + if(data.preview) { + $("#mail-preview-content").html(data.preview); + $("#mail-preview-content" + " a").click(function() { return false; }); + } + }, + "json" + ); + $("#mail-preview").val("0"); + return true; +} + + function unpause() { // unpause auto reloads if they are currently stopped totStopped = false; -- cgit v1.2.3 From 0394a3e93957b5bb6574ca95e290e414ed049404 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 13 Dec 2016 20:01:38 -0800 Subject: tag and mention handling in private mail (which required refactoring the bbcode cleanup stuff in mod_item) --- view/js/mod_mail.js | 1 + 1 file changed, 1 insertion(+) (limited to 'view/js') diff --git a/view/js/mod_mail.js b/view/js/mod_mail.js index 46574a63d..15a45519b 100644 --- a/view/js/mod_mail.js +++ b/view/js/mod_mail.js @@ -4,4 +4,5 @@ $(document).ready(function() { }); $(".autotime").timeago() $('#prvmail-text').bbco_autocomplete('bbcode'); + $("#prvmail-text").editor_autocomplete(baseurl+"/acl"); }); -- cgit v1.2.3 From 6bde70d60a02e9e461bc8cb6dcb475778c435fec Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 16 Dec 2016 16:14:01 +0100 Subject: move the sticky-kit^Cquery plugin to /lib and see if we want this for the whole app --- view/js/main.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 1d6eca91d..5d6867c94 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -666,6 +666,8 @@ function updateConvItems(mode,data) { $('.item_' + bParam_mid.substring(0,32)).addClass('item-highlight'); } + $(document.body).trigger("sticky_kit:recalc"); + } function collapseHeight() { -- cgit v1.2.3 From 6eed7eb54054502d438ea18a9411d3be7cdf14fc Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 16 Dec 2016 22:50:19 +0100 Subject: display inline instead of floating --- view/js/main.js | 1 - 1 file changed, 1 deletion(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 5d6867c94..534029275 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1166,7 +1166,6 @@ function preview_mail() { return true; } - function unpause() { // unpause auto reloads if they are currently stopped totStopped = false; -- cgit v1.2.3 From 827d4c5fb094715a65d4559f8c6159eb5d31d5f7 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 16 Dec 2016 19:54:07 -0800 Subject: use lock colour to indicate that permissions have been set by the software to something you might not expect rather than an exclamation mark. This may not be the best colour in this page context, but it serves the intended purpose. Perhaps orange might be less intrusive and still convey the desired information. --- view/js/acl.js | 1 + 1 file changed, 1 insertion(+) (limited to 'view/js') diff --git a/view/js/acl.js b/view/js/acl.js index c11997c43..4dd60d303 100644 --- a/view/js/acl.js +++ b/view/js/acl.js @@ -276,6 +276,7 @@ ACL.prototype.update_view = function(value) { /* jot acl */ $('#jot-perms-icon, #dialog-perms-icon, #' + that.form_id[0].id + ' .jot-perms-icon').removeClass('fa-lock').addClass('fa-unlock'); + $('#jot-perms-icon').removeClass('jot-lock-warn'); $('#dbtn-jotnets').show(); $('.profile-jot-net input').attr('disabled', false); -- cgit v1.2.3 From 9c5f2de4ec28ad3878fc565485d8d544caa8c66a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 19 Dec 2016 09:48:01 +0100 Subject: this is not needed --- view/js/main.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 534029275..bfe9d25a3 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -666,8 +666,6 @@ function updateConvItems(mode,data) { $('.item_' + bParam_mid.substring(0,32)).addClass('item-highlight'); } - $(document.body).trigger("sticky_kit:recalc"); - } function collapseHeight() { -- cgit v1.2.3 From a12b2c8d337e864a707e069f80fde3ef33450e1a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 19 Dec 2016 20:36:40 +0100 Subject: fix contextualHelpFocus() to work wit sticky aside --- view/js/main.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index bfe9d25a3..7b0a1ebed 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -451,10 +451,18 @@ function contextualHelpFocus(target, openSidePanel) { else { $("main").removeClass('region_1-on'); } + + var css_position = $(target).parent().css('position'); + if (css_position === 'fixed') { + $(target).parent().css('position', 'static'); + } + $('html,body').animate({ scrollTop: $(target).offset().top - $('nav').outerHeight(true) - $('#contextual-help-content').outerHeight(true)}, 'slow'); for (i = 0; i < 3; i++) { $(target).fadeTo('slow', 0.1).fadeTo('slow', 1.0); } + + $(target).parent().css('position', css_position); } } -- cgit v1.2.3 From 7b7fa5f77b57eeb1fca6dafb5f1de1232c8e8d57 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 20 Dec 2016 14:53:21 +0100 Subject: turns out we do need this in certain situations --- view/js/main.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 7b0a1ebed..5f961f6e9 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -674,6 +674,8 @@ function updateConvItems(mode,data) { $('.item_' + bParam_mid.substring(0,32)).addClass('item-highlight'); } + $(document.body).trigger("sticky_kit:recalc"); + } function collapseHeight() { -- cgit v1.2.3 From 493aa9f20d3a48132a83b1da0c643f80c038e617 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 20 Dec 2016 18:43:20 -0800 Subject: progress on abook_vcard --- view/js/mod_connedit.js | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'view/js') diff --git a/view/js/mod_connedit.js b/view/js/mod_connedit.js index 84fff5ed1..252ed9e7c 100644 --- a/view/js/mod_connedit.js +++ b/view/js/mod_connedit.js @@ -16,6 +16,71 @@ $(document).ready(function() { connectFullShare(); }); + $(document).on('click', '.vcard-header, .vcard-cancel-btn', updateView); + $(document).on('click', '.add-field', doAdd); + $(document).on('click', '.remove-field', doRemove); + + function updateView() { + var id = $(this).data('id'); + var action = $(this).data('action'); + var header = $('#vcard-header-' + id); + var cancel = $('#vcard-cancel-' + id); + var addField = $('#vcard-add-field-' + id); + var info = $('#vcard-info-' + id); + var vcardPreview = $('#vcard-preview-' + id); + var fn = $('#vcard-fn-' + id); + + if(action === 'open') { + $(header).addClass('active'); + $(cancel).show(); + $(addField).show(); + $(info).show(); + $(fn).show(); + $(vcardPreview).hide(); + } + else { + $(header).removeClass('active'); + $(cancel).hide(); + $(addField).hide(); + $(info).hide(); + $(fn).hide(); + $(vcardPreview).show(); + } + } + + function doAdd() { + var what = $(this).data('add'); + var id = $(this).data('id'); + var element = '#template-form-' + what; + var where = '#abook-edit-form'; + + $(element + ' .remove-field').attr('data-id', id) + + if(what === 'vcard-adr') { + var adrCount = $(where + ' .form-' + what).length; + var attrName = 'adr[' + adrCount + '][]'; + $(element + ' input').attr('name', attrName); + } + + if(what === 'vcard-org' || what === 'vcard-title' || what === 'vcard-note') { + $(where + ' .add-' + what).hide() + } + + $(element).clone().removeAttr('id').appendTo(where + ' .form-' + what + '-wrapper'); + } + + function doRemove() { + var what = $(this).data('remove'); + var element = $(this).parents('div.form-' + what); + var where = '#abook_edit_form' + $(this).data('id'); + + if(what === 'vcard-org' || what === 'vcard-title' || what === 'vcard-note') { + $(where + ' .add-' + what).show() + } + + $(element).remove(); + } + }); function connectFullShare() { -- cgit v1.2.3 From 6c7da13cd392e6c06ce7970bfbe4ddbb9854737a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 30 Dec 2016 20:50:12 +0100 Subject: prevent eventual double scrollbar --- view/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 5f961f6e9..c67f1c167 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -434,12 +434,12 @@ function contextualHelp() { if(container.hasClass('contextual-help-content-open')) { container.removeClass('contextual-help-content-open'); - $('main').css('top', '') + $('main').css('margin-top', '') } else { container.addClass('contextual-help-content-open'); var mainTop = container.outerHeight(true); - $('main').css('top', mainTop + 'px'); + $('main').css('margin-top', mainTop + 'px'); } } -- cgit v1.2.3 From 9831b358f823e688c924ace7af97c10283e4dcae Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 1 Jan 2017 13:29:27 -0800 Subject: profile vcard - preliminary work --- view/js/mod_profiles.js | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'view/js') diff --git a/view/js/mod_profiles.js b/view/js/mod_profiles.js index a7754e0c5..acc9f9953 100644 --- a/view/js/mod_profiles.js +++ b/view/js/mod_profiles.js @@ -1,4 +1,70 @@ $(document).ready(function() { $('form').areYouSure(); // Warn user about unsaved settings $('textarea').bbco_autocomplete('bbcode'); + + $(document).on('click', '.vcard-header, .vcard-cancel-btn', updateView); + $(document).on('click', '.add-field', doAdd); + $(document).on('click', '.remove-field', doRemove); + + function updateView() { + var id = $(this).data('id'); + var action = $(this).data('action'); + var header = $('#vcard-header-' + id); + var cancel = $('#vcard-cancel-' + id); + var addField = $('#vcard-add-field-' + id); + var info = $('#vcard-info-' + id); + var vcardPreview = $('#vcard-preview-' + id); + var fn = $('#vcard-fn-' + id); + + if(action === 'open') { + $(header).addClass('active'); + $(cancel).show(); + $(addField).show(); + $(info).show(); + $(fn).show(); + $(vcardPreview).hide(); + } + else { + $(header).removeClass('active'); + $(cancel).hide(); + $(addField).hide(); + $(info).hide(); + $(fn).hide(); + $(vcardPreview).show(); + } + } + + function doAdd() { + var what = $(this).data('add'); + var id = $(this).data('id'); + var element = '#template-form-' + what; + var where = '#abook-edit-form'; + + $(element + ' .remove-field').attr('data-id', id) + + if(what === 'vcard-adr') { + var adrCount = $(where + ' .form-' + what).length; + var attrName = 'adr[' + adrCount + '][]'; + $(element + ' input').attr('name', attrName); + } + + if(what === 'vcard-org' || what === 'vcard-title' || what === 'vcard-note') { + $(where + ' .add-' + what).hide() + } + + $(element).clone().removeAttr('id').appendTo(where + ' .form-' + what + '-wrapper'); + } + + function doRemove() { + var what = $(this).data('remove'); + var element = $(this).parents('div.form-' + what); + var where = '#abook_edit_form' + $(this).data('id'); + + if(what === 'vcard-org' || what === 'vcard-title' || what === 'vcard-note') { + $(where + ' .add-' + what).show() + } + + $(element).remove(); + } + }); -- cgit v1.2.3 From ece1dd1d7edc800085def93e50efc25a3dda55a7 Mon Sep 17 00:00:00 2001 From: Hubzilla Date: Fri, 20 Jan 2017 12:03:46 -0800 Subject: js errors with raw message-id, string update --- view/js/main.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index c67f1c167..2fc912093 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -662,7 +662,13 @@ function updateConvItems(mode,data) { } // auto-scroll to a particular comment in a thread (designated by mid) when in single-thread mode - if($('.item_' + bParam_mid.substring(0,32)).length && !$('.item_' + bParam_mid.substring(0,32)).hasClass('toplevel_item') && mode == 'replace') { + // use the same method to generate the submid as we use in ThreadItem, + // substr(0,32) + base64_encode + replace(['+','='],['','']); + var submid = bParam_mid; + var submid_encoded = ((submid.length) ? submid.substring(0,32) : 'abcdefg'); + submid_encoded = window.btoa(submid_encoded); + submid_encoded = submid_encoded.replace(/[\+\=]/g,''); + if($('.item_' + submid_encoded).length && !$('.item_' + submid_encoded).hasClass('toplevel_item') && mode == 'replace') { if($('.collapsed-comments').length) { var scrolltoid = $('.collapsed-comments').attr('id').substring(19); $('#collapsed-comments-' + scrolltoid + ' .autotime').timeago(); @@ -670,8 +676,8 @@ function updateConvItems(mode,data) { $('#hide-comments-' + scrolltoid).html(aStr.showfewer); $('#hide-comments-total-' + scrolltoid).hide(); } - $('html, body').animate({ scrollTop: $('.item_' + bParam_mid.substring(0,32)).offset().top - $('nav').outerHeight() }, 'slow'); - $('.item_' + bParam_mid.substring(0,32)).addClass('item-highlight'); + $('html, body').animate({ scrollTop: $('.item_' + submid_encoded).offset().top - $('nav').outerHeight() }, 'slow'); + $('.item_' + submid_encoded).addClass('item-highlight'); } $(document.body).trigger("sticky_kit:recalc"); -- cgit v1.2.3 From 8794106e85f8d2486d636fd37605fb3408c73ee0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 21 Jan 2017 23:28:57 +0100 Subject: add observer.language to autocomplete and return a default value for observer --- view/js/autocomplete.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'view/js') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 62fc37420..5a616b6fc 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -270,7 +270,7 @@ function string2bb(element) { $.fn.bbco_autocomplete = function(type) { if(type=='bbcode') { - var open_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'superscript', 'subscript', 'quote', 'code', 'open', 'spoiler', 'map', 'nobb', 'list', 'checklist', 'ul', 'ol', 'dl', 'li', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer', 'embed', 'highlight']; + var open_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'superscript', 'subscript', 'quote', 'code', 'open', 'spoiler', 'map', 'nobb', 'list', 'checklist', 'ul', 'ol', 'dl', 'li', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer', 'observer.language','embed', 'highlight']; var open_elements = ['observer.baseurl', 'observer.address', 'observer.photo', 'observer.name', 'observer.webname', 'observer.url', '*', 'hr', ]; var elements = open_close_elements.concat(open_elements); @@ -309,6 +309,10 @@ function string2bb(element) { return ['\[' + element + '\]' + '\n\[*=Item name\] ', '\n\[/' + element + '\]']; } else if(element === 'table') { return ['\[' + element + '\]' + '\n\[tr\]', '\[/tr\]\n\[/' + element + '\]']; + } else if(element === 'observer') { + return ['\[' + element + '=1\]', '\[/observer\]']; + } else if(element === 'observer.language') { + return ['\[' + element + '=en\]', '\[/observer\]']; } else { return ['\[' + element + '\]', '\[/' + element + '\]']; -- cgit v1.2.3 From cde7a3f66cd8d48f0c7aea2391a2778fe494f884 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 1 Feb 2017 12:52:19 +0100 Subject: more work on app-bin --- view/js/main.js | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 2fc912093..ed2f6a2e1 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -308,12 +308,6 @@ $(function() { } } - // fancyboxes - // Is this actually used anywhere? - $("a.popupbox").colorbox({ - 'transition' : 'elastic' - }); - NavUpdate(); // Allow folks to stop the ajax page updates with the pause/break key $(document).keydown(function(event) { @@ -376,28 +370,28 @@ function NavUpdate() { if(data.network == 0) { data.network = ''; - $('.net-update').removeClass('show'); + $('.net-update, .net-button').hide(); } else { - $('.net-update').addClass('show'); + $('.net-update, .net-button').show(); } $('.net-update').html(data.network); - if(data.home == 0) { data.home = ''; $('.home-update').removeClass('show'); } else { $('.home-update').addClass('show'); } + if(data.home == 0) { data.home = ''; $('.home-update, .home-button').hide(); } else { $('.home-update, .home-button').show(); } $('.home-update').html(data.home); - if(data.intros == 0) { data.intros = ''; $('.intro-update').removeClass('show'); } else { $('.intro-update').addClass('show'); } + if(data.intros == 0) { data.intros = ''; $('.intro-update, .intro-button').hide(); } else { $('.intro-update, .intro-button').show(); } $('.intro-update').html(data.intros); - if(data.mail == 0) { data.mail = ''; $('.mail-update').removeClass('show'); } else { $('.mail-update').addClass('show'); } + if(data.mail == 0) { data.mail = ''; $('.mail-update, .mail-button').hide(); } else { $('.mail-update, .mail-button').show(); } $('.mail-update').html(data.mail); - if(data.notify == 0) { data.notify = ''; $('.notify-update').removeClass('show'); } else { $('.notify-update').addClass('show'); } + if(data.notify == 0) { data.notify = ''; $('.notify-update, .notify-button').hide(); } else { $('.notify-update, .notify-button').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'); } + if(data.events == 0) { data.events = ''; $('.events-update, .events-button').hide(); } else { $('.events-update, .events-button').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-update').html(data.events + '*'); } @@ -409,7 +403,7 @@ function NavUpdate() { if(data.birthdays_today == 0) { data.birthdays_today = ''; $('.birthdays-today-update').removeClass('show'); } else { $('.birthdays-today-update').addClass('show'); $('.birthdays-update').html(data.birthdays + '*'); } $('.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'); } + if(data.all_events == 0) { data.all_events = ''; $('.all_events-update, .all_events-button').hide(); } else { $('.all_events-update, .all_events-button').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-update').html(data.all_events + '*'); } -- cgit v1.2.3 From a5c1685ea0323de974d4a1469f122283e278e91a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 3 Feb 2017 11:00:35 +0100 Subject: hide notifications button if there are none --- view/js/main.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index ed2f6a2e1..11dd1b817 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -368,6 +368,14 @@ function NavUpdate() { updateCountsOnly = false; + if(data.network || data.home || data.intros || data.mail || data.all_events || data.notify) { + $('#notifications-btn').show(); + } + else { + $('#notifications-btn').hide(); + $('#navbar-collapse-1').removeClass('in'); + } + if(data.network == 0) { data.network = ''; $('.net-update, .net-button').hide(); -- cgit v1.2.3 From 631a8278d34da70ff312b0dcc11f8e486a4d4597 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 3 Feb 2017 11:21:06 +0100 Subject: do not hide button - just gray it out --- view/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 11dd1b817..db37925e5 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -369,10 +369,10 @@ function NavUpdate() { updateCountsOnly = false; if(data.network || data.home || data.intros || data.mail || data.all_events || data.notify) { - $('#notifications-btn').show(); + $('#notifications-btn').css('color', 'white').prop('disabled', false); } else { - $('#notifications-btn').hide(); + $('#notifications-btn').css('color', 'grey').prop('disabled', true); $('#navbar-collapse-1').removeClass('in'); } -- cgit v1.2.3 From 6a083e845233475edaa711f4752e64eb42159c33 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 6 Feb 2017 14:32:50 -0800 Subject: bring back view links for all notification types (esp: network, channel) for easy access --- view/js/main.js | 7 ------- 1 file changed, 7 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index db37925e5..5de4aa9a2 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -774,13 +774,6 @@ function liveUpdate() { update_mode = 'append'; } else { -// if(bParam_static) { -// in_progress = false; -// if(timer) clearTimeout(timer); -// timer = setTimeout(NavUpdate,10000); -// return; -// } - update_mode = 'update'; var orgHeight = $("#region_2").height(); } -- cgit v1.2.3 From b2bae867d02b62708e09e5abf0ebd03a4d2b095e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 7 Feb 2017 16:08:27 -0800 Subject: more background work for permcat support --- view/js/mod_connedit.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'view/js') diff --git a/view/js/mod_connedit.js b/view/js/mod_connedit.js index 252ed9e7c..d750f3a2f 100644 --- a/view/js/mod_connedit.js +++ b/view/js/mod_connedit.js @@ -1,6 +1,7 @@ $(document).ready(function() { - $('form').areYouSure({'addRemoveFieldsMarksDirty':true, 'message': aStr['leavethispage'] }); // Warn user about unsaved settings + // Warn member about unsaved settings + $('form').areYouSure({'addRemoveFieldsMarksDirty':true, 'message': aStr['leavethispage'] }); if(typeof(after_following) !== 'undefined' && after_following) { if(typeof(connectDefaultShare) !== 'undefined') @@ -102,3 +103,23 @@ function connectFullShare() { $('#me_id_perms_republish').attr('checked','checked'); $('#me_id_perms_post_like').attr('checked','checked'); } + +function loadAbookRole(name) { + + if(! name) + name = 'default'; + + $('.abook-edit-me').each(function() { + if(! $(this).is(':disabled')) + $(this).removeAttr('checked'); + }); + + $.get('permcat/' + name, function(data) { + $(data.perms).each(function() { + if(this.value) + $('#me_id_perms_' + this.name).attr('checked','checked'); + }); + }); +} + + -- cgit v1.2.3 From 723b51c931e7365b3c8d531bf25c6c02308cba9f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 7 Feb 2017 17:17:38 -0800 Subject: provide a few system defined permcats; will require a permission editor page to define new (personal) ones. --- view/js/mod_connedit.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'view/js') diff --git a/view/js/mod_connedit.js b/view/js/mod_connedit.js index d750f3a2f..4739c490c 100644 --- a/view/js/mod_connedit.js +++ b/view/js/mod_connedit.js @@ -17,6 +17,15 @@ $(document).ready(function() { connectFullShare(); }); + + $('#id_permcat').change(function() { + $('.loading-role-rotator').spin(true); + var permName = $('#id_permcat').val(); + loadAbookRole(permName); + }); + + + $(document).on('click', '.vcard-header, .vcard-cancel-btn', updateView); $(document).on('click', '.add-field', doAdd); $(document).on('click', '.remove-field', doRemove); @@ -119,6 +128,7 @@ function loadAbookRole(name) { if(this.value) $('#me_id_perms_' + this.name).attr('checked','checked'); }); + $('.loading-role-rotator').spin(false); }); } -- cgit v1.2.3 From 91819bfc2d475e1b16d3f5e9ca685ca2531a9084 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 8 Feb 2017 17:21:32 -0800 Subject: bringer - all basic functionality is implemented --- view/js/mod_settings.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'view/js') diff --git a/view/js/mod_settings.js b/view/js/mod_settings.js index db321ae70..5c729fa48 100644 --- a/view/js/mod_settings.js +++ b/view/js/mod_settings.js @@ -17,6 +17,16 @@ $(document).ready(function() { else $('#advanced-perm').hide(); }); + + $('#id_permcat_list').change(function() { + $('.loading-role-rotator').spin(true); + var permName = $('#id_permcat').val(); + loadPermcat(permName); + }); + + + + }); @@ -137,3 +147,25 @@ function channel_privacy_macro(n) { $('#id_profile_in_directory').val(1); } } + + + +function loadPermcat(name) { + + if(! name) + name = 'default'; + + $('.abook-edit-me').each(function() { + if(! $(this).is(':disabled')) + $(this).removeAttr('checked'); + }); + + $.get('permcat/' + name, function(data) { + $(data.perms).each(function() { + if(this.value) + $('#me_id_perms_' + this.name).attr('checked','checked'); + }); + $('.loading-role-rotator').spin(false); + }); +} + -- cgit v1.2.3 From bbacfbdd6ac09786194502350deb50b0244166b2 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 21 Feb 2017 15:24:39 -0800 Subject: display page not updating after comment --- view/js/mod_display.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 view/js/mod_display.js (limited to 'view/js') diff --git a/view/js/mod_display.js b/view/js/mod_display.js new file mode 100644 index 000000000..60a1cdaa8 --- /dev/null +++ b/view/js/mod_display.js @@ -0,0 +1,7 @@ + -- cgit v1.2.3 From 79e8e4599ef8af2ee70250a206b3d956abcfca3d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 2 Mar 2017 11:03:33 +0100 Subject: reset schema value after we empty and repopulate it. first half of fix for #624 --- view/js/mod_settings.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'view/js') diff --git a/view/js/mod_settings.js b/view/js/mod_settings.js index 5c729fa48..cf77db9bb 100644 --- a/view/js/mod_settings.js +++ b/view/js/mod_settings.js @@ -37,12 +37,14 @@ function setTheme(elm) { function previewTheme(elm) { theme = $(elm).val(); + var schema = $('#id_schema').val(); $.getJSON('theme_info/' + theme,function(data) { $('#theme-preview').html('
' + data.desc + '
' + data.version + '
' + data.credits + '
' + theme + ''); $('#id_schema').empty(); $(data.schemas).each(function(index,item) { $('