mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
update icons
This commit is contained in:
parent
91497394e7
commit
f130de70b9
@ -197,6 +197,7 @@ define([
|
||||
"badge-error": "circle-alert",
|
||||
"remove-history": "eraser",
|
||||
"square": "square",
|
||||
"timer": "hourglass"
|
||||
};
|
||||
|
||||
Icons.get = (name, attrs = {}) => {
|
||||
|
||||
@ -2983,7 +2983,7 @@ define([
|
||||
$span.attr('aria-checked', true);
|
||||
}
|
||||
if (!obj.thumbnail) {
|
||||
$span.append(obj.icon || h('span.cptools.cptools-template'));
|
||||
$span.append(obj.icon || Icons.get('file-template'));
|
||||
}
|
||||
$('<span>', {'class': 'cp-creation-template-element-name'}).text(name)
|
||||
.appendTo($span);
|
||||
|
||||
@ -13,12 +13,14 @@ define([
|
||||
'/common/inner/badges.js',
|
||||
'/customize/messages.js',
|
||||
'/customize/application_config.js',
|
||||
'/customize/fonts/lucide.js',
|
||||
'/common/common-icons.js',
|
||||
|
||||
'/components/croppie/croppie.min.js',
|
||||
'/components/file-saver/FileSaver.min.js',
|
||||
'css!/components/croppie/croppie.css',
|
||||
], function ($, ApiConfig, Util, Hash, UI, h, MediaTag, Badges,
|
||||
Messages, AppConfig) {
|
||||
Messages, AppConfig, Lucide, Icons) {
|
||||
var MT = {};
|
||||
|
||||
// Configure MediaTags to use our local viewer
|
||||
@ -331,11 +333,11 @@ define([
|
||||
modal.show();
|
||||
var $modal = modal.$modal.focus();
|
||||
var $container = $modal.find('.cp-modal').append([
|
||||
h('div.cp-mediatag-control', left = h('span.fa.fa-chevron-left')),
|
||||
h('div.cp-mediatag-control', left = Icons.get('chevron-left')),
|
||||
h('div.cp-mediatag-container', [
|
||||
h('div.cp-loading-spinner-container', h('span.cp-spinner')),
|
||||
]),
|
||||
h('div.cp-mediatag-control', right = h('span.fa.fa-chevron-right')),
|
||||
h('div.cp-mediatag-control', right = Icons.get('chevron-right')),
|
||||
]);
|
||||
var $close = $modal.find('.cp-modal-close');
|
||||
var $left = $(left);
|
||||
@ -484,37 +486,36 @@ define([
|
||||
}, [
|
||||
h('li.cp-svg', h('a.cp-app-code-context-open.dropdown-item', {
|
||||
'tabindex': '-1',
|
||||
'data-icon': "fa-eye",
|
||||
}, Messages.pad_mediatagPreview)),
|
||||
}, [
|
||||
Icons.get('preview'),
|
||||
Messages.pad_mediatagPreview
|
||||
])),
|
||||
h('li', h('a.cp-app-code-context-openin.dropdown-item', {
|
||||
'tabindex': '-1',
|
||||
'data-icon': "fa-external-link",
|
||||
}, Messages.pad_mediatagOpen)),
|
||||
}, [
|
||||
Icons.get('external-link'),
|
||||
Messages.pad_mediatagOpen
|
||||
])),
|
||||
h('li', h('a.cp-app-code-context-share.dropdown-item', {
|
||||
'tabindex': '-1',
|
||||
'data-icon': "fa-shhare-alt",
|
||||
}, Messages.pad_mediatagShare)),
|
||||
}, [
|
||||
Icons.get('share'),
|
||||
Messages.pad_mediatagShare
|
||||
])),
|
||||
h('li', h('a.cp-app-code-context-saveindrive.dropdown-item', {
|
||||
'tabindex': '-1',
|
||||
'data-icon': "fa-cloud-upload",
|
||||
}, Messages.pad_mediatagImport)),
|
||||
}, [
|
||||
Icons.get('cloud-upload'),
|
||||
Messages.pad_mediatagImport
|
||||
])),
|
||||
h('li.cp-svg', h('a.cp-app-code-context-download.dropdown-item', {
|
||||
'tabindex': '-1',
|
||||
'data-icon': "fa-download",
|
||||
}, Messages.download_mt_button)),
|
||||
},[
|
||||
Icons.get('download'),
|
||||
Messages.download_mt_button
|
||||
])),
|
||||
])
|
||||
]);
|
||||
// create the icon for each contextmenu option
|
||||
$(menu).find("li a.dropdown-item").each(function (i, el) {
|
||||
var $icon = $("<span>");
|
||||
if ($(el).attr('data-icon')) {
|
||||
var font = $(el).attr('data-icon').indexOf('cptools') === 0 ? 'cptools' : 'fa';
|
||||
$icon.addClass(font).addClass($(el).attr('data-icon'));
|
||||
} else {
|
||||
$icon.text($(el).text());
|
||||
}
|
||||
$(el).prepend($icon);
|
||||
});
|
||||
var m = UI.createContextMenu(menu);
|
||||
|
||||
mediatagContextMenu = m;
|
||||
|
||||
@ -275,9 +275,9 @@ MessengerUI, Messages, Pages, PadTypes, Lucide, Icons) {
|
||||
if (isMe && !priv.readOnly) {
|
||||
if (!Config.disableProfile) {
|
||||
var $button = $('<button>', {
|
||||
'class': 'fa fa-pencil cp-toolbar-userlist-button',
|
||||
'class': 'cp-toolbar-userlist-button',
|
||||
title: Messages.user_rename
|
||||
}).appendTo($nameSpan);
|
||||
}, Icons.get('edit')).appendTo($nameSpan);
|
||||
$button.hover(function (e) { e.preventDefault(); e.stopPropagation(); });
|
||||
$button.mouseenter(function (e) {
|
||||
e.preventDefault();
|
||||
@ -329,27 +329,27 @@ MessengerUI, Messages, Pages, PadTypes, Lucide, Icons) {
|
||||
&& !priv.readOnly) {
|
||||
if (pendingFriends[data.curvePublic]) {
|
||||
$('<button>', {
|
||||
'class': 'fa fa-hourglass-half cp-toolbar-userlist-button',
|
||||
'class': 'cp-toolbar-userlist-button',
|
||||
'title': Messages.profile_friendRequestSent
|
||||
}).appendTo($nameSpan);
|
||||
}, Icons.get('timer')).appendTo($nameSpan);
|
||||
} else if (friendRequests[data.curvePublic]) {
|
||||
$('<button>', {
|
||||
'class': 'fa fa-bell cp-toolbar-userlist-button',
|
||||
'class': ' cp-toolbar-userlist-button',
|
||||
'data-cptippy-html': true,
|
||||
'title': Messages._getKey('friendRequest_received', [safeName]),
|
||||
}).appendTo($nameSpan).click(function (e) {
|
||||
}, Icons.get('notification')).appendTo($nameSpan).click(function (e) {
|
||||
e.stopPropagation();
|
||||
UIElements.displayFriendRequestModal(Common, friendRequests[data.curvePublic]);
|
||||
});
|
||||
|
||||
} else {
|
||||
$('<button>', {
|
||||
'class': 'fa fa-user-plus cp-toolbar-userlist-button',
|
||||
'class': 'cp-toolbar-userlist-button',
|
||||
'data-cptippy-html': true,
|
||||
'title': Messages._getKey('userlist_addAsFriendTitle', [
|
||||
safeName,
|
||||
])
|
||||
}).appendTo($nameSpan).click(function (e) {
|
||||
}, Icons.get('add-friend')).appendTo($nameSpan).click(function (e) {
|
||||
e.stopPropagation();
|
||||
Common.sendFriendRequest(data, function (err, obj) {
|
||||
if (err || (obj && obj.error)) {
|
||||
@ -361,9 +361,9 @@ MessengerUI, Messages, Pages, PadTypes, Lucide, Icons) {
|
||||
}
|
||||
} else if (Common.isLoggedIn() && data.curvePublic && friends[data.curvePublic]) {
|
||||
$('<button>', {
|
||||
'class': 'fa fa-comments-o cp-toolbar-userlist-button',
|
||||
'class': 'cp-toolbar-userlist-button',
|
||||
'title': Messages.contact_chat
|
||||
}).appendTo($nameSpan).click(function (e) {
|
||||
}, Icons.get('comment')).appendTo($nameSpan).click(function (e) {
|
||||
e.stopPropagation();
|
||||
Common.openURL('/contacts/');
|
||||
});
|
||||
|
||||
@ -1231,7 +1231,7 @@ define([
|
||||
var $publish = common.createButton('', true, {
|
||||
name: 'publish',
|
||||
text: Messages.poll_publish_button,
|
||||
icon: 'fa-check',
|
||||
icon: 'check',
|
||||
drawer: false,
|
||||
hiddenReadOnly: true
|
||||
}).click(function () { publish(!APP.proxy.published); }).appendTo(APP.toolbar.$bottomM);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user