Merge branch 'staging' of github.com:cryptpad/cryptpad into staging

This commit is contained in:
yflory 2025-03-17 15:28:11 +01:00
commit 8de9cb2ab2
3 changed files with 9 additions and 2 deletions

View File

@ -146,6 +146,8 @@ define(req, function(AppConfig, Default, Language) {
Messages.admin_addAdminsHint = "Add administrators from their public key or from your contacts list";
Messages.admin_addAdminsAdd = "Promote a contact to admin";
Messages.admin_addKeyLabel = "Add an admin using their public key";
Messages.admin_errorAddKeyLabel = "Add a valid public key";
Messages.admin_errorAddAdmins = "Pick a contact to promote to admin";
Messages.admin_listName = "Admin name";
Messages.admin_listKey = "Admin key";

View File

@ -367,6 +367,9 @@ define([
let addBtn = blocks.button('primary', 'fa-plus', Messages.tag_add);
Util.onClickEnter($(addBtn), () => {
var $sel = $(contactsGrid.div).find('.cp-usergrid-user.cp-selected');
if (!$sel.length) {
return UI.warn(Messages.admin_errorAddAdmins);
}
nThen((waitFor) => {
$sel.each((i, el) => {
const $el = $(el);
@ -392,7 +395,9 @@ define([
Util.onClickEnter($keyBtn, () => {
let val = $keyInput.val().trim();
let key = Keys.canonicalize(val);
if (!key) { return; }
if (!key) {
return UI.warn(Messages.admin_errorAddKeyLabel);
}
// We have a valid key
let name = Messages.admin_admin;
try {

View File

@ -64,7 +64,7 @@ define([
let prefix = icon.slice(0, icon.indexOf('-'));
cls = `.${prefix}.${icon}`;
}
return h(`i${cls}`);
return h(`i${cls}`, { 'aria-hidden': 'true' });
};
blocks.button = (type, icon, text) => {
type = type || 'primary';