]> git.mxchange.org Git - friendica.git/blobdiff - view/templates/item/compose-footer.tpl
Merge remote-tracking branch 'upstream/develop' into http-417
[friendica.git] / view / templates / item / compose-footer.tpl
index 8a854238a17fc51624da31cd1df64a94f105579e..7e18d18ff7aa4743321e8f06d7fbb15f43a07a23 100644 (file)
@@ -24,7 +24,7 @@
                        var textlen = $(this).val().length;
                        $('#character-counter').text(textlen);
                });
-               $textarea.editor_autocomplete(baseurl+"/acl");
+               $textarea.editor_autocomplete(baseurl + '/search/acl');
                $textarea.bbco_autocomplete('bbcode');
 
                let $acl_allow_input = $('#acl_allow');
                                e.stopPropagation()
                        }
                });
+               // Accessibility: enable space and enter to open a panel when focused
+               $('body').on('keyup', '[data-toggle="collapse"]:focus', function (e) {
+                       if (e.key === ' ' || e.key === 'Enter') {
+                               $(this).click();
+                               e.preventDefault();
+                               e.stopPropagation();
+                       }
+               });
 
                $('#visibility-public-panel').on('show.bs.collapse', function() {
                        $('#visibility-public').prop('checked', true);
                        $contact_allow_input.prop('disabled', true);
                        $group_deny_input.prop('disabled', true);
                        $contact_deny_input.prop('disabled', true);
+
+                       $('.profile-jot-net input[type=checkbox]').each(function() {
+                               // Restores checkbox state if it had been saved
+                               if ($(this).attr('data-checked') !== undefined) {
+                                       $(this).prop('checked', $(this).attr('data-checked') === 'true');
+                               }
+                       });
+                       $('.profile-jot-net input').attr('disabled', false);
                });
 
                $('#visibility-custom-panel').on('show.bs.collapse', function() {
                        $contact_allow_input.prop('disabled', false);
                        $group_deny_input.prop('disabled', false);
                        $contact_deny_input.prop('disabled', false);
+
+                       $('.profile-jot-net input[type=checkbox]').each(function() {
+                               // Saves current checkbox state
+                               $(this)
+                                       .attr('data-checked', $(this).prop('checked'))
+                                       .prop('checked', false);
+                       });
+                       $('.profile-jot-net input').attr('disabled', 'disabled');
                });
 
                if (document.querySelector('input[name="visibility"]:checked').value === 'custom') {
 
                $acl_allow_input.tagsinput({
                        confirmKeys: [13, 44],
-                       cancelConfirmKeysOnEmpty: true,
                        freeInput: false,
                        tagClass: function(item) {
                                switch (item.type) {