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) {