diff options
author | Alexandre Hannud Abdo <abdo@member.fsf.org> | 2014-06-17 04:26:18 -0300 |
---|---|---|
committer | Alexandre Hannud Abdo <abdo@member.fsf.org> | 2014-06-19 15:13:32 -0300 |
commit | b20887995a2b3277659e01d99ae4de238f7175ef (patch) | |
tree | b0513171eccb338c55b7d1a50da0f67e6e8b6f65 /view/js/mod_settings.js | |
parent | c012c648e0691868370a5a8c1eb468020fef6330 (diff) | |
download | volse-hubzilla-b20887995a2b3277659e01d99ae4de238f7175ef.tar.gz volse-hubzilla-b20887995a2b3277659e01d99ae4de238f7175ef.tar.bz2 volse-hubzilla-b20887995a2b3277659e01d99ae4de238f7175ef.zip |
Implements a new permission level PERMS_PENDING
With this a user can allow some action to any user which connects
to them, even before they've connected back.
Ref.
https://mobiliza.org.br/display/478d9e71eaf55748dc646d3990651d6d34cfb7db5c38360538ec730ca3ccf908@zothub.com
Also some code cleanup and an alternative logic for handling
notifications of permission changes in zot.php.
This assumes that private posts are still restricted to people in
your addressbook. Regardless of your global permissions, a
pending channel won't get private posts, even if the post
only has a deny clause not matching the pending channel.
Diffstat (limited to 'view/js/mod_settings.js')
-rw-r--r-- | view/js/mod_settings.js | 142 |
1 files changed, 70 insertions, 72 deletions
diff --git a/view/js/mod_settings.js b/view/js/mod_settings.js index fa788280d..4daa7f704 100644 --- a/view/js/mod_settings.js +++ b/view/js/mod_settings.js @@ -25,100 +25,98 @@ $(document).ready(function() { }); function channel_privacy_macro(n) { - if(n == 0) { - $('#id_view_stream option').eq(0).attr('selected','selected'); - $('#id_view_profile option').eq(0).attr('selected','selected'); - $('#id_view_photos option').eq(0).attr('selected','selected'); - $('#id_view_contacts option').eq(0).attr('selected','selected'); - $('#id_view_storage option').eq(0).attr('selected','selected'); - $('#id_view_pages option').eq(0).attr('selected','selected'); - $('#id_send_stream option').eq(0).attr('selected','selected'); - $('#id_post_wall option').eq(0).attr('selected','selected'); - $('#id_post_comments option').eq(0).attr('selected','selected'); - $('#id_post_mail option').eq(0).attr('selected','selected'); - $('#id_post_photos option').eq(0).attr('selected','selected'); - $('#id_tag_deliver option').eq(0).attr('selected','selected'); - $('#id_chat option').eq(0).attr('selected','selected'); - $('#id_write_storage option').eq(0).attr('selected','selected'); - $('#id_write_pages option').eq(0).attr('selected','selected'); - $('#id_delegate option').eq(0).attr('selected','selected'); + if(n == 0) { + $('#id_view_stream option').eq(0).attr('selected','selected'); + $('#id_view_profile option').eq(0).attr('selected','selected'); + $('#id_view_photos option').eq(0).attr('selected','selected'); + $('#id_view_contacts option').eq(0).attr('selected','selected'); + $('#id_view_storage option').eq(0).attr('selected','selected'); + $('#id_view_pages option').eq(0).attr('selected','selected'); + $('#id_send_stream option').eq(0).attr('selected','selected'); + $('#id_post_wall option').eq(0).attr('selected','selected'); + $('#id_post_comments option').eq(0).attr('selected','selected'); + $('#id_post_mail option').eq(0).attr('selected','selected'); + $('#id_post_photos option').eq(0).attr('selected','selected'); + $('#id_tag_deliver option').eq(0).attr('selected','selected'); + $('#id_chat option').eq(0).attr('selected','selected'); + $('#id_write_storage option').eq(0).attr('selected','selected'); + $('#id_write_pages option').eq(0).attr('selected','selected'); + $('#id_delegate option').eq(0).attr('selected','selected'); $('#id_republish option').eq(0).attr('selected','selected'); $('#id_bookmark option').eq(0).attr('selected','selected'); $('#id_profile_in_directory_onoff .off').removeClass('hidden'); $('#id_profile_in_directory_onoff .on').addClass('hidden'); $('#id_profile_in_directory').val(0); } - if(n == 1) { - $('#id_view_stream option').eq(1).attr('selected','selected'); - $('#id_view_profile option').eq(1).attr('selected','selected'); - $('#id_view_photos option').eq(1).attr('selected','selected'); - $('#id_view_contacts option').eq(1).attr('selected','selected'); - $('#id_view_storage option').eq(1).attr('selected','selected'); - $('#id_view_pages option').eq(1).attr('selected','selected'); - $('#id_send_stream option').eq(1).attr('selected','selected'); - $('#id_post_wall option').eq(1).attr('selected','selected'); - $('#id_post_comments option').eq(1).attr('selected','selected'); - $('#id_post_mail option').eq(1).attr('selected','selected'); - $('#id_post_photos option').eq(1).attr('selected','selected'); - $('#id_tag_deliver option').eq(1).attr('selected','selected'); - $('#id_chat option').eq(1).attr('selected','selected'); - $('#id_write_storage option').eq(1).attr('selected','selected'); - $('#id_write_pages option').eq(1).attr('selected','selected'); - $('#id_delegate option').eq(0).attr('selected','selected'); + if(n == 1) { + $('#id_view_stream option').eq(1).attr('selected','selected'); + $('#id_view_profile option').eq(1).attr('selected','selected'); + $('#id_view_photos option').eq(1).attr('selected','selected'); + $('#id_view_contacts option').eq(1).attr('selected','selected'); + $('#id_view_storage option').eq(1).attr('selected','selected'); + $('#id_view_pages option').eq(1).attr('selected','selected'); + $('#id_send_stream option').eq(1).attr('selected','selected'); + $('#id_post_wall option').eq(1).attr('selected','selected'); + $('#id_post_comments option').eq(1).attr('selected','selected'); + $('#id_post_mail option').eq(1).attr('selected','selected'); + $('#id_post_photos option').eq(1).attr('selected','selected'); + $('#id_tag_deliver option').eq(1).attr('selected','selected'); + $('#id_chat option').eq(1).attr('selected','selected'); + $('#id_write_storage option').eq(1).attr('selected','selected'); + $('#id_write_pages option').eq(1).attr('selected','selected'); + $('#id_delegate option').eq(0).attr('selected','selected'); $('#id_republish option').eq(0).attr('selected','selected'); $('#id_bookmark option').eq(1).attr('selected','selected'); $('#id_profile_in_directory_onoff .off').removeClass('hidden'); $('#id_profile_in_directory_onoff .on').addClass('hidden'); $('#id_profile_in_directory').val(0); } - if(n == 2) { - $('#id_view_stream option').eq(6).attr('selected','selected'); - $('#id_view_profile option').eq(6).attr('selected','selected'); - $('#id_view_photos option').eq(6).attr('selected','selected'); - $('#id_view_contacts option').eq(6).attr('selected','selected'); - $('#id_view_storage option').eq(6).attr('selected','selected'); - $('#id_view_pages option').eq(6).attr('selected','selected'); - $('#id_send_stream option').eq(2).attr('selected','selected'); - $('#id_post_wall option').eq(1).attr('selected','selected'); - $('#id_post_comments option').eq(2).attr('selected','selected'); - $('#id_post_mail option').eq(1).attr('selected','selected'); - $('#id_post_photos option').eq(0).attr('selected','selected'); - $('#id_tag_deliver option').eq(1).attr('selected','selected'); - $('#id_chat option').eq(1).attr('selected','selected'); - $('#id_write_storage option').eq(0).attr('selected','selected'); - $('#id_write_pages option').eq(0).attr('selected','selected'); - $('#id_delegate option').eq(0).attr('selected','selected'); + if(n == 2) { + $('#id_view_stream option').eq(7).attr('selected','selected'); + $('#id_view_profile option').eq(7).attr('selected','selected'); + $('#id_view_photos option').eq(7).attr('selected','selected'); + $('#id_view_contacts option').eq(7).attr('selected','selected'); + $('#id_view_storage option').eq(7).attr('selected','selected'); + $('#id_view_pages option').eq(7).attr('selected','selected'); + $('#id_send_stream option').eq(2).attr('selected','selected'); + $('#id_post_wall option').eq(1).attr('selected','selected'); + $('#id_post_comments option').eq(2).attr('selected','selected'); + $('#id_post_mail option').eq(1).attr('selected','selected'); + $('#id_post_photos option').eq(0).attr('selected','selected'); + $('#id_tag_deliver option').eq(1).attr('selected','selected'); + $('#id_chat option').eq(1).attr('selected','selected'); + $('#id_write_storage option').eq(0).attr('selected','selected'); + $('#id_write_pages option').eq(0).attr('selected','selected'); + $('#id_delegate option').eq(0).attr('selected','selected'); $('#id_republish option').eq(1).attr('selected','selected'); $('#id_bookmark option').eq(1).attr('selected','selected'); $('#id_profile_in_directory_onoff .on').removeClass('hidden'); $('#id_profile_in_directory_onoff .off').addClass('hidden'); $('#id_profile_in_directory').val(1); } - if(n == 3) { - $('#id_view_stream option').eq(6).attr('selected','selected'); - $('#id_view_profile option').eq(6).attr('selected','selected'); - $('#id_view_photos option').eq(6).attr('selected','selected'); - $('#id_view_contacts option').eq(6).attr('selected','selected'); - $('#id_view_storage option').eq(6).attr('selected','selected'); - $('#id_view_pages option').eq(6).attr('selected','selected'); - $('#id_send_stream option').eq(4).attr('selected','selected'); - $('#id_post_wall option').eq(4).attr('selected','selected'); - $('#id_post_comments option').eq(4).attr('selected','selected'); - $('#id_post_mail option').eq(4).attr('selected','selected'); - $('#id_post_photos option').eq(2).attr('selected','selected'); - $('#id_tag_deliver option').eq(1).attr('selected','selected'); - $('#id_chat option').eq(4).attr('selected','selected'); - $('#id_write_storage option').eq(2).attr('selected','selected'); - $('#id_write_pages option').eq(2).attr('selected','selected'); - $('#id_delegate option').eq(0).attr('selected','selected'); - $('#id_republish option').eq(4).attr('selected','selected'); - $('#id_bookmark option').eq(4).attr('selected','selected'); + if(n == 3) { + $('#id_view_stream option').eq(7).attr('selected','selected'); + $('#id_view_profile option').eq(7).attr('selected','selected'); + $('#id_view_photos option').eq(7).attr('selected','selected'); + $('#id_view_contacts option').eq(7).attr('selected','selected'); + $('#id_view_storage option').eq(7).attr('selected','selected'); + $('#id_view_pages option').eq(7).attr('selected','selected'); + $('#id_send_stream option').eq(5).attr('selected','selected'); + $('#id_post_wall option').eq(5).attr('selected','selected'); + $('#id_post_comments option').eq(5).attr('selected','selected'); + $('#id_post_mail option').eq(5).attr('selected','selected'); + $('#id_post_photos option').eq(2).attr('selected','selected'); + $('#id_tag_deliver option').eq(1).attr('selected','selected'); + $('#id_chat option').eq(5).attr('selected','selected'); + $('#id_write_storage option').eq(2).attr('selected','selected'); + $('#id_write_pages option').eq(2).attr('selected','selected'); + $('#id_delegate option').eq(0).attr('selected','selected'); + $('#id_republish option').eq(5).attr('selected','selected'); + $('#id_bookmark option').eq(5).attr('selected','selected'); $('#id_profile_in_directory_onoff .on').removeClass('hidden'); $('#id_profile_in_directory_onoff .off').addClass('hidden'); $('#id_profile_in_directory').val(1); } - - } |