mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
add roles
This commit is contained in:
parent
5cfe9dc363
commit
902aaccc52
@ -84,7 +84,8 @@ define([
|
||||
avatar = h('span.cp-avatar',{
|
||||
tabindex: 0,
|
||||
title: Messages.user_profile,
|
||||
'aria-label': Messages.user_profile
|
||||
'aria-label': Messages.user_profile,
|
||||
role: 'button'
|
||||
});
|
||||
Common.displayAvatar($(avatar), userData.avatar, userData.displayName || userData.name);
|
||||
$(avatar).keydown(function (e) {
|
||||
@ -139,7 +140,7 @@ define([
|
||||
});
|
||||
|
||||
if (data.content.isClickable) {
|
||||
$(notif).find('.cp-notification-content').addClass("cp-clickable").on('click keypress', function (event) {
|
||||
$(notif).find('.cp-notification-content').addClass("cp-clickable").attr('role', 'link').on('click keypress', function (event) {
|
||||
if (event.type === 'click' || (event.type === 'keypress' && event.which === 13)) {
|
||||
data.content.handler();
|
||||
}
|
||||
@ -150,7 +151,8 @@ define([
|
||||
var dismiss = h('div.cp-notification-dismiss', {
|
||||
tabindex: 0,
|
||||
title: Messages.notifications_dismiss,
|
||||
'aria-label': Messages.notifications_dismiss
|
||||
'aria-label': Messages.notifications_dismiss,
|
||||
role: 'button'
|
||||
}, dismissIcon);
|
||||
$(dismiss).addClass("cp-clickable")
|
||||
.on('click keypress', function (event) {
|
||||
|
||||
@ -74,7 +74,7 @@ define([
|
||||
h("h5.cp-app-notifications-panel-title",
|
||||
(Messages.notificationsPage || "Notifications") + " - " + categoryName),
|
||||
h("div.cp-app-notifications-panel-titlebar-buttons", [
|
||||
dismissAll = h("div.cp-app-notifications-dismissall.cp-clickable", { tabindex: 0, title: Messages.notifications_dismissAll || "Dismiss All", 'aria-label': Messages.notifications_dismissAll || "Dismiss All" }, h("span.fa.fa-trash")),
|
||||
dismissAll = h("div.cp-app-notifications-dismissall.cp-clickable", { tabindex: 0, title: Messages.notifications_dismissAll || "Dismiss All", 'aria-label': Messages.notifications_dismissAll || "Dismiss All", role: 'button' }, h("span.fa.fa-trash")),
|
||||
]),
|
||||
]),
|
||||
notifsList = h("div.cp-app-notifications-panel-list", [
|
||||
@ -205,14 +205,14 @@ define([
|
||||
});
|
||||
};
|
||||
var createLeftside = function () {
|
||||
var $categories = $('<div>', {'class': 'cp-sidebarlayout-categories'})
|
||||
var $categories = $('<div>', {'class': 'cp-sidebarlayout-categories', 'role': 'menu' })
|
||||
.appendTo(APP.$leftside);
|
||||
var metadataMgr = common.getMetadataMgr();
|
||||
var privateData = metadataMgr.getPrivateData();
|
||||
var active = privateData.category || 'all';
|
||||
common.setHash(active);
|
||||
Object.keys(categories).forEach(function (key) {
|
||||
var $category = $('<div>', {'class': 'cp-sidebarlayout-category', 'tabindex': 0}).appendTo($categories);
|
||||
var $category = $('<div>', {'class': 'cp-sidebarlayout-category', 'tabindex': 0, 'role': 'menuitem'}).appendTo($categories);
|
||||
if (key === 'all') { $category.append($('<span>', {'class': 'fa fa-bars', 'aria-hidden': 'true'})); }
|
||||
if (key === 'friends') { $category.append($('<span>', {'class': 'fa fa-user', 'aria-hidden': 'true'})); }
|
||||
if (key === 'pads') { $category.append($('<span>', {'class': 'cptools cptools-richtext', 'aria-hidden': 'true'})); }
|
||||
@ -240,6 +240,7 @@ define([
|
||||
});
|
||||
|
||||
$category.append(Messages['notifications_cat_'+key] || key);
|
||||
$category.attr('role', 'menuitem');
|
||||
});
|
||||
showCategories(categories[active]);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user