update rich-text icons

This commit is contained in:
daria 2025-08-08 16:50:13 +03:00
parent b222b25626
commit d7931058af
No known key found for this signature in database
GPG Key ID: 3B75240E6B2F2701
5 changed files with 29 additions and 15 deletions

View File

@ -129,7 +129,10 @@ define([
"strikethrough": "strikethrough",
"quote": "quote",
"toc": "newspaper",
"embed": "image-plus"
"embed": "image-plus",
"expand-pad": "maximize-2",
"shrink-pad": "minimize-2",
"pad-settings": "file-cog"
};
Icons.get = (name, attrs = {}) => {

View File

@ -662,7 +662,7 @@ define([
tag: 'a',
attributes: attributes,
content: [
h('i',{ 'class': $icon.attr('class') }),
Icons.get($icon.attr('class')),
h('span', $button.text())
],
action: function () {

View File

@ -238,6 +238,9 @@ body.cp-app-pad {
}
}
#cke_1_contents {
svg {
margin: 0;
}
flex: 1;
display: flex;
height: auto !important;

View File

@ -10,8 +10,10 @@ define([
'/common/hyperscript.js',
'/common/common-interface.js',
'/common/common-ui-elements.js',
'/customize/messages.js'
], function($, Sortify, Util, Hash, h, UI, UIElements, Messages) {
'/customize/messages.js',
'/customize/fonts/lucide.js',
'/common/common-icons.js',
], function($, Sortify, Util, Hash, h, UI, UIElements, Messages, Lucide, Icons) {
var Comments = {};
/*
@ -314,11 +316,11 @@ define([
// Remove everything
Env.$container.html('');
var hideBtn = h('button.cp-pad-hide.btn.btn-default.fa.fa-chevron-right');
var hideBtn = h('button.cp-pad-hide.btn.btn-default', Icons.get('chevron-right'));
var showBtn = h('button.cp-pad-show.btn.btn-default', {
title: Messages.poll_comment_list
}, [
h('i.fa.fa-comment')
Icons.get('chat') // XXX can be changed, there are multiple alternatives
]);

View File

@ -46,6 +46,8 @@ define([
'/common/common-ui-elements.js',
'/common/hyperscript.js',
'/components/chainpad/chainpad.dist.js',
'/customize/fonts/lucide.js',
'/common/common-icons.js',
//'/customize/application_config.js',
//'/common/test.js',
@ -75,7 +77,9 @@ define([
UI,
UIElements,
h,
ChainPad/*,
ChainPad,
Lucide,
Icons/*,
AppConfig,
Test */
) {
@ -210,6 +214,7 @@ define([
var mkSettingsMenu = function(framework) {
var getSettings = function () {
setTimeout( () => Lucide.createIcons(), 0);
var $d = $(h('div.cp-pad-settings-dialog'));
var common = framework._.sfCommon;
var metadataMgr = common.getMetadataMgr();
@ -235,7 +240,7 @@ define([
input: { value: 1 },
label: { class: 'noTitle' }
});
var delWidth = h('button.btn.btn-default.fa.fa-times');
var delWidth = h('button.btn.btn-default', Icons.get('close'));
var width = h('div.cp-pad-settings-radio-container', [
opt1,
opt2,
@ -267,7 +272,7 @@ define([
input: { value: 1 },
label: { class: 'noTitle' }
});
var delOutline = h('button.btn.btn-default.fa.fa-times');
var delOutline = h('button.btn.btn-default', Icons.get('close'));
var outline = h('div.cp-pad-settings-radio-container', [
opt3,
opt4,
@ -299,7 +304,7 @@ define([
input: { value: 1 },
label: { class: 'noTitle' }
});
var delComments = h('button.btn.btn-default.fa.fa-times');
var delComments = h('button.btn.btn-default', Icons.get('close'));
var comments = h('div.cp-pad-settings-radio-container', [
opt5,
opt6,
@ -341,7 +346,7 @@ define([
drawer: true,
text: Messages.pad_settings_title,
name: 'pad-settings',
icon: 'fa-cog',
icon: 'pad-settings',
}, function () {
UI.alert(getSettings());
});
@ -642,6 +647,7 @@ define([
};
var andThen2 = function(editor, Ckeditor, framework) {
setTimeout(() => Lucide.createIcons());
var mediaTagMap = {};
var $contentContainer = $('#cke_1_contents');
var $html = $('html');
@ -812,8 +818,8 @@ define([
var store = window.cryptpadStore;
var key = 'pad-small-width';
var hideBtn = h('button.btn.btn-default.cp-pad-hide.fa.fa-compress');
var showBtn = h('button.btn.btn-default.cp-pad-show.fa.fa-expand');
var hideBtn = h('button.btn.btn-default.cp-pad-hide', Icons.get('shrink-pad'));
var showBtn = h('button.btn.btn-default.cp-pad-show', Icons.get('expand-pad'));
var localHide;
$(hideBtn).click(function () { // Expand
@ -882,11 +888,11 @@ define([
title: Util.stripTags($(el).text())
});
});
var hideBtn = h('button.btn.btn-default.cp-pad-hide.fa.fa-chevron-left');
var hideBtn = h('button.btn.btn-default.cp-pad-hide', Icons.get('chevron-left'));
var showBtn = h('button.btn.btn-default.cp-pad-show', {
title: Messages.pad_tocHide
}, [
h('i.fa.fa-list-ul')
Icons.get('list')
]);
var content = [
hideBtn,