mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Allow plugins to add custom icons
This commit is contained in:
parent
af522fd0fe
commit
6943524d5c
@ -1,8 +1,7 @@
|
||||
define([
|
||||
'jquery',
|
||||
'/common/hyperscript.js',
|
||||
'/customize/lucide.js'
|
||||
], function ($, h, Lucide) {
|
||||
], function (h, Lucide) {
|
||||
const Icons = {};
|
||||
|
||||
const map = {
|
||||
@ -243,19 +242,17 @@ define([
|
||||
"badge-moderator": "life-buoy",
|
||||
"badge-premium": "ticket-check",
|
||||
"badge-error": "circle-alert",
|
||||
// Accounts
|
||||
"pricing": "circle-star",
|
||||
"subscribe": "ticket",
|
||||
"trophy": "trophy",
|
||||
"credit-card": "credit-card",
|
||||
"circle-left": "circle-chevron-left",
|
||||
"user": "user-round",
|
||||
"notebook":"notepad-text",
|
||||
"sso": "id-card",
|
||||
// Other
|
||||
"maintenance": "construction",
|
||||
"release-notes": "notepad-text"
|
||||
};
|
||||
|
||||
Icons.add = (newIcons) => {
|
||||
Object.keys(newIcons).forEach(k => {
|
||||
map[k] = newIcons[k];
|
||||
});
|
||||
};
|
||||
|
||||
Icons.get = (name, attrs = {}) => {
|
||||
if (!map[name]) {
|
||||
alert(`Invalid icon: ${name}`);
|
||||
|
||||
@ -11,7 +11,6 @@ define([
|
||||
'/components/chainpad/chainpad.dist.js',
|
||||
'/common/common-realtime.js',
|
||||
'/common/common-constants.js',
|
||||
'/common/common-interface.js',
|
||||
'/common/common-feedback.js',
|
||||
'/common/outer/local-store.js',
|
||||
'/customize/messages.js',
|
||||
@ -22,7 +21,7 @@ define([
|
||||
|
||||
'/components/tweetnacl/nacl-fast.min.js',
|
||||
'/components/scrypt-async/scrypt-async.min.js', // better load speed
|
||||
], function (Listmap, Crypto, Util, NetConfig, Cred, ChainPad, Realtime, Constants, UI,
|
||||
], function (Listmap, Crypto, Util, NetConfig, Cred, ChainPad, Realtime, Constants,
|
||||
Feedback, LocalStore, Messages, nThen, Block, Hash, ServerCommand) {
|
||||
var Nacl = window.nacl;
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ define([
|
||||
'/common/events-channel.js',
|
||||
'/common/outer/login-block.js',
|
||||
'/common/common-credential.js',
|
||||
'/customize/login.js',
|
||||
'/common/common-login.js',
|
||||
'/common/store-interface.js',
|
||||
'/common/pad-types.js',
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user