From af522fd0feedf86c6c65e8809089c38041ecd0b7 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 1 Oct 2025 16:38:53 +0200 Subject: [PATCH 01/10] Lucide icons with MutationObserver --- customize.dist/loading.js | 4 +--- customize.dist/pages.js | 4 +--- customize.dist/pages/recovery.js | 3 +-- customize.dist/pages/register.js | 3 +-- customize.dist/template.js | 4 +--- www/admin/inner.js | 8 ------- www/calendar/inner.js | 10 -------- www/checkup/main.js | 3 +-- www/common/common-icons.js | 32 ++++++++++++++++++++++++-- www/common/common-interface.js | 10 +------- www/common/common-ui-elements.js | 5 +--- www/common/diffMarked.js | 4 +--- www/common/drive-ui.js | 8 ------- www/common/inner/access.js | 5 +--- www/common/inner/common-mediatag.js | 3 +-- www/common/inner/common-modal.js | 4 +--- www/common/inner/mfa.js | 5 +--- www/common/inner/sidebar-layout.js | 3 --- www/common/inner/snapshots.js | 3 +-- www/common/make-backup.js | 3 +-- www/common/messenger-ui.js | 7 +----- www/common/notifications.js | 3 +-- www/common/onlyoffice/history.js | 4 +--- www/common/onlyoffice/inner.js | 2 -- www/common/sframe-common-codemirror.js | 3 +-- www/common/sframe-common-file.js | 5 +--- www/common/sframe-common-history.js | 5 +--- www/common/sframe-common-mailbox.js | 4 +--- www/common/sframe-common.js | 2 -- www/common/toolbar.js | 7 +----- www/contacts/inner.js | 5 +--- www/debug/inner.js | 2 -- www/drive/index.html | 1 - www/drive/inner.html | 1 - www/form/inner.js | 15 ------------ www/install/main.js | 3 +-- www/install/onboardscreen.js | 3 --- www/kanban/inner.js | 6 ----- www/kanban/jkanban_cp.js | 4 +--- www/login/index.html | 1 - www/moderation/inner.js | 3 --- www/notifications/inner.js | 4 ---- www/oldadmin/inner.js | 2 -- www/pad/comments.js | 4 +--- www/pad/inner.js | 5 ---- www/poll/inner.js | 2 -- www/poll/render.js | 3 +-- www/profile/inner.js | 6 ----- www/register/index.html | 1 - www/register/main.js | 4 +--- www/secureiframe/inner.js | 6 +---- www/settings/inner.js | 5 ---- www/slide/inner.js | 2 -- www/ssoauth/main.js | 3 +-- www/support/inner.js | 3 --- www/support/ui.js | 7 +----- www/teams/inner.js | 7 ------ www/todo/inner.js | 2 -- www/whiteboard/inner.js | 3 --- 59 files changed, 62 insertions(+), 217 deletions(-) diff --git a/customize.dist/loading.js b/customize.dist/loading.js index 7d8a57e93..a62ea71d3 100644 --- a/customize.dist/loading.js +++ b/customize.dist/loading.js @@ -7,9 +7,8 @@ // text #3F4141 define([ '/customize/messages.js', - '/customize/lucide.js', 'less!/customize/src/less2/include/loading.less' -], function (Messages, Lucide) { +], function (Messages) { var urlArgs = window.location.href.replace(/^.*\?([^\?]*)$/, function (all, x) { return x; }); var elem = document.createElement('div'); elem.setAttribute('id', 'cp-loading'); @@ -101,7 +100,6 @@ define([ if (el2) { el2.innerHTML = makeList(data); } var el3 = document.querySelector('.cp-loading-progress-container'); if (el3) { el3.innerHTML = makeBar(data); } - Lucide.createIcons(); } catch (e) { } }; diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 666db2362..d33fbc4d1 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -12,15 +12,13 @@ define([ '/api/config', '/common/extensions.js', 'optional!/api/instance', - '/customize/lucide.js', '/common/common-icons.js', ], function (h, Language, Util, AppConfig, Msg, $, ApiConfig, - Extensions, Instance, Lucide, Icons) { + Extensions, Instance, Icons) { var Pages = {}; Pages.setHTML = function (e, html) { e.innerHTML = html; - setTimeout(() => Lucide.createIcons(), 0); return e; }; diff --git a/customize.dist/pages/recovery.js b/customize.dist/pages/recovery.js index 5aec19e0f..5eb7678ca 100644 --- a/customize.dist/pages/recovery.js +++ b/customize.dist/pages/recovery.js @@ -9,9 +9,8 @@ define([ '/common/common-interface.js', '/customize/messages.js', '/customize/pages.js', - '/customize/lucide.js', '/common/common-icons.js', -], function (Config, $, h, UI, Msg, Pages, Lucide, Icons) { +], function (Config, $, h, UI, Msg, Pages, Icons) { return function () { document.title = Msg.recovery_header; diff --git a/customize.dist/pages/register.js b/customize.dist/pages/register.js index 7c4c6a7a0..d481ea646 100644 --- a/customize.dist/pages/register.js +++ b/customize.dist/pages/register.js @@ -9,9 +9,8 @@ define([ '/common/common-interface.js', '/customize/messages.js', '/customize/pages.js', - '/customize/lucide.js', '/common/common-icons.js', -], function (Config, $, h, UI, Msg, Pages, Lucide, Icons) { +], function (Config, $, h, UI, Msg, Pages, Icons) { return function () { document.title = Msg.register_header; var tos = $(UI.createCheckbox('accept-terms')).find('.cp-checkmark-label').append(Msg.register_acceptTerms).parent()[0]; diff --git a/customize.dist/template.js b/customize.dist/template.js index e7f5fcc93..b71136e71 100644 --- a/customize.dist/template.js +++ b/customize.dist/template.js @@ -7,8 +7,7 @@ define([ '/common/hyperscript.js', '/customize/pages.js', '/components/nthen/index.js', - '/customize/lucide.js', -], function ($, h, Pages, nThen, Lucide) { +], function ($, h, Pages, nThen) { // we consider that there is no valid reason to load any of the info pages // in an iframe. abort everything if you detect that you are embedded. if (window.top !== window) { return; } @@ -55,7 +54,6 @@ $(function () { titleSuffix = window.location.hostname; } document.title = document.title + ' - ' + titleSuffix; - setTimeout(() => Lucide.createIcons(), 0); $('#placeholder').remove(); $body.append($main); diff --git a/www/admin/inner.js b/www/admin/inner.js index 5e63fcbb0..0940103df 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -22,7 +22,6 @@ define([ '/api/instance', '/lib/datepicker/flatpickr.js', '/install/onboardscreen.js', - '/customize/lucide.js', '/common/common-icons.js', 'css!/lib/datepicker/flatpickr.min.css', @@ -48,7 +47,6 @@ define([ Instance, Flatpickr, Onboarding, - Lucide, Icons ) { @@ -387,7 +385,6 @@ define([ }).nThen(() => { APP.updateStatus(function () { evRefreshAdmins.fire(); - Lucide.createIcons(); }); }); }); @@ -415,7 +412,6 @@ define([ // refresh APP.updateStatus(function () { evRefreshAdmins.fire(); - Lucide.createIcons(); }); }); }); @@ -734,7 +730,6 @@ define([ } row(reportContentLabel, copyToClipboard(data)); - setTimeout(() => Lucide.createIcons()); return tableObj.table; }; @@ -1999,7 +1994,6 @@ define([ wide: true, }); }); - Lucide.createIcons(); }); var keyEl = h('code.cp-limit-key', key); @@ -2391,7 +2385,6 @@ define([ } row(reportContentLabel, copyToClipboard(data)); - setTimeout(() => Lucide.createIcons()); return tableObj.table; }; @@ -3057,7 +3050,6 @@ define([ })); }).nThen(() => { onRefreshSupportEvt.fire({moderators, supportKey}); - Lucide.createIcons(); }); }; const getMyData = () => { diff --git a/www/calendar/inner.js b/www/calendar/inner.js index 2cc767ff9..31f57e0d5 100644 --- a/www/calendar/inner.js +++ b/www/calendar/inner.js @@ -33,7 +33,6 @@ define([ '/common/sframe-common-codemirror.js', 'cm/lib/codemirror', - '/customize/lucide.js', '/common/common-icons.js', 'cm/addon/display/autorefresh', @@ -72,7 +71,6 @@ define([ diffMk, SFCodeMirror, CodeMirror, - Lucide, Icons ) { @@ -804,7 +802,6 @@ define([ }); } if (APP.$calendars) { APP.$calendars.append(calendar); } - Lucide.createIcons(); return calendar; }; @@ -936,7 +933,6 @@ define([ $(showCalendarsBtn).append(Icons.get(iconClass)); $(showCalendarsBtn).append(h('span.cp-calendar-title', visible ? Messages.calendar_hide : Messages.calendar_show)); $(showCalendarsBtn).append(h('span')); - Lucide.createIcons(); }).appendTo($showContainer); } else {visible = true;} @@ -958,7 +954,6 @@ define([ onCalendarsUpdate.fire(); } }); - Lucide.createIcons(); }); onCalendarsUpdate.fire(); }; @@ -1367,7 +1362,6 @@ ICS ==> create a new event with the same UID and a RECURRENCE-ID field (with a v APP.toolbar.$bottomL.append(h('div.cp-calendar-browse', [ goLeft, goToday, goRight, goDate ])); - Lucide.createIcons(); }; @@ -2045,7 +2039,6 @@ APP.recurrenceRule = { }); $list.append(span); APP.notificationsEntries.push(minutes); - Lucide.createIcons(); }; $(addNotif).click(function () { var unit = $block.getValue(); @@ -2460,12 +2453,10 @@ APP.recurrenceRule = { if (node.classList && node.classList.contains('tui-full-calendar-popup') && !node.classList.contains('tui-full-calendar-popup-detail')) { onCalendarPopup(node); - Lucide.createIcons(); } if (node.classList && node.classList.contains('tui-full-calendar-popup') && node.classList.contains('tui-full-calendar-popup-detail')) { onCalendarEditPopup(node); - Lucide.createIcons(); } } catch (e) {} } @@ -2524,7 +2515,6 @@ APP.recurrenceRule = { APP.initTime = privateData.calendarOpts.time; } store.get('calendarView', makeCalendar); - Lucide.createIcons(); UI.removeLoadingScreen(); }); diff --git a/www/checkup/main.js b/www/checkup/main.js index aa2d86e14..8bd387ded 100644 --- a/www/checkup/main.js +++ b/www/checkup/main.js @@ -21,7 +21,6 @@ define([ '/checkup/checkup-tools.js', '/customize/application_config.js', '/common/onlyoffice/current-version.js', - '/customize/lucide.js', '/common/common-icons.js', '/components/tweetnacl/nacl-fast.min.js', @@ -29,7 +28,7 @@ define([ ], function ($, ApiConfig, Assertions, h, Messages, DomReady, nThen, SFCommonO, Login, Hash, Util, Pinpad, NetConfig, Block, Pages, Tools, AppConfig, - OOCurrentVersion, Lucide, Icons) { + OOCurrentVersion, Icons) { window.CHECKUP_MAIN_LOADED = true; var Assert = Assertions(); diff --git a/www/common/common-icons.js b/www/common/common-icons.js index b3a9eeaba..52e5899ed 100644 --- a/www/common/common-icons.js +++ b/www/common/common-icons.js @@ -1,6 +1,8 @@ define([ - '/common/hyperscript.js' -], function (h) { + 'jquery', + '/common/hyperscript.js', + '/customize/lucide.js' +], function ($, h, Lucide) { const Icons = {}; const map = { @@ -265,6 +267,32 @@ define([ return h('i', attrs); }; + if (!window.CP_Lucide_observer) { + window.CP_Lucide_observer = true; + Lucide.createIcons(); + const observer = new MutationObserver((mutations) => { + let found = mutations.some((mutation) => { + for (var i = 0; i < mutation.addedNodes.length; i++) { + let added = mutation.addedNodes[i]; + if (added.tagName === "svg") { continue; } + if (added?.hasAttribute?.('data-lucide')) { + return true; + } + if (added?.querySelector?.(':not(svg)[data-lucide]')) { + return true; + } + } + }); + if (found) { Lucide.createIcons(); } + }); + observer.observe(document.body, { + attributes: true, + childList: true, + characterData: false, + subtree: true + }); + } + return Icons; }); diff --git a/www/common/common-interface.js b/www/common/common-interface.js index b57cbc2f0..c5b5b9340 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -22,7 +22,6 @@ define([ '/lib/tippy/tippy.min.js', '/common/hyperscript.js', '/customize/loading.js', - '/customize/lucide.js', '/common/common-icons.js', //'/common/test.js', @@ -31,7 +30,7 @@ define([ 'css!/lib/tippy/tippy.css', 'css!/lib/jquery-ui/jquery-ui.min.css' ], function ($, Messages, Util, Hash, Notifier, AppConfig, - Alertify, Tippy, h, Loading, Lucide, Icons /*, Test */) { + Alertify, Tippy, h, Loading, Icons /*, Test */) { var UI = {}; /* @@ -356,7 +355,6 @@ define([ $container.append($form); isEdit = false; called = false; - Lucide.createIcons(); }); }; resetUI(); @@ -638,7 +636,6 @@ define([ }); addTabListener(frame); - Lucide.createIcons(); return frame; }; @@ -685,7 +682,6 @@ define([ show: function () { $blockContainer.css('display', 'flex'); addTabListener($blockContainer); - Lucide.createIcons(); }, hide: hide }; @@ -856,7 +852,6 @@ define([ document.body.appendChild(frame); addTabListener(frame); - Lucide.createIcons(); listener = listenForKeys(function () { // Only trigger OK if cancel is not focused if (document.activeElement === $cancel[0]) { @@ -1041,11 +1036,9 @@ define([ $eye.empty().append(passwordReveal); $eye.attr('aria-label', Messages.show_password).attr('aria-pressed', 'false'); } - Lucide.createIcons(); }); } - Lucide.createIcons(); return h('span.cp-password-container', [ input, eye @@ -1181,7 +1174,6 @@ define([ } }); } - Lucide.createIcons(); }; UI.getNewIcon = function (type) { diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 0c188585b..2860c9af5 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -21,11 +21,10 @@ define([ '/common/inner/invitation.js', '/common/visible.js', '/common/pad-types.js', - '/customize/lucide.js', '/common/common-icons.js', ], function ($, Config, Broadcast, Util, Hash, Language, UI, Constants, Feedback, h, Clipboard, - Messages, AppConfig, Pages, NThen, InviteInner, Visible, PadTypes, Lucide, Icons) { + Messages, AppConfig, Pages, NThen, InviteInner, Visible, PadTypes, Icons) { var UIElements = {}; var urlArgs = Config.requireConf.urlArgs; @@ -2725,7 +2724,6 @@ define([ }; */ UIElements.getPadCreationScreen = function (common, cfg, appCfg, cb) { - setTimeout(() => Lucide.createIcons()); appCfg = appCfg || {}; if (!common.isLoggedIn()) { return void cb(); } var sframeChan = common.getSframeChannel(); @@ -3015,7 +3013,6 @@ define([ $('.cp-creation-template-container').find('[tabindex]:not([tabindex="-1"])').filter(':visible').first().focus(); }); if (i < TEMPLATES_DISPLAYED) { $(left).addClass('hidden'); } - Lucide.createIcons(); }; if (fromFileData) { var todo = function (thumbnail) { diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index c78c4687c..ff13b95e0 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -14,13 +14,12 @@ define([ '/customize/messages.js', '/lib/less.min.js', '/customize/pages.js', - '/customize/lucide.js', '/lib/highlight/highlight.pack.js', '/lib/diff-dom/diffDOM.js', '/components/tweetnacl/nacl-fast.min.js', 'css!/lib/highlight/styles/'+ (window.CryptPad_theme === 'dark' ? 'dark.css' : 'github.css') -],function ($, ApiConfig, Marked, Hash, Util, h, MT, MediaTag, Messages, Less, Pages, Lucide) { +],function ($, ApiConfig, Marked, Hash, Util, h, MT, MediaTag, Messages, Less, Pages) { var DiffMd = {}; var Highlight = window.hljs; @@ -215,7 +214,6 @@ define([ r = r.replace(/
<\/div>/g, getTOC()); } toc = []; - setTimeout(() => Lucide.createIcons()); return r; }; diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index e33ea39c6..543ac1703 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -26,7 +26,6 @@ define([ '/customize/pages.js', '/common/pad-types.js', '/common/onlyoffice/broken-formats.js', - '/customize/lucide.js', '/common/common-icons.js' ], function ( $, @@ -50,7 +49,6 @@ define([ Pages, PadTypes, BrokenFormats, - Lucide, Icons) { @@ -770,7 +768,6 @@ define([ }, ready: function (state) { appStatus.isReady = state; - Lucide.createIcons(); if (state) { appStatus._onReady.forEach(function (h) { h(); @@ -1346,7 +1343,6 @@ define([ }); var content = h("div.cp-app-drive-color-picker", colorsElements); UI.alert(content); - Lucide.createIcons(); }; var getFolderColor = function (path) { @@ -2248,7 +2244,6 @@ define([ $(icon).addClass('cp-app-drive-element-icon'); $name.addClass('cp-app-drive-element-name-icon'); $name.prepend($(icon)); - Lucide.createIcons(); // Clean up setTimeout(function() { $name.closest('li').children('svg').remove(); @@ -2904,7 +2899,6 @@ define([ buttons: buttons }); UI.openCustomModal(m); - Lucide.createIcons(); }; var createEmptyTrashButton = function () { var button = h('button.btn.btn-danger', [ @@ -4074,7 +4068,6 @@ define([ createTitle($path, obj._path); $list.append($element); - Lucide.createIcons(); }; if (_folders.length) { getFolderListHeader(true, true).appendTo($list); } _folders.forEach(function (el) { @@ -4611,7 +4604,6 @@ define([ displayDirectory(path); } } - Lucide.createIcons(); }); if (LS.wasFolderOpened(path) || (manager.isSubpath(currentPath, path) && path.length < currentPath.length)) { diff --git a/www/common/inner/access.js b/www/common/inner/access.js index 7813a811a..78177f252 100644 --- a/www/common/inner/access.js +++ b/www/common/inner/access.js @@ -13,10 +13,9 @@ define([ '/common/hyperscript.js', '/customize/messages.js', '/components/nthen/index.js', - '/customize/lucide.js', '/common/common-icons.js', ], function ($, Util, Hash, UI, UIElements, Types, Modal, h, - Messages, nThen, Lucide, Icons) { + Messages, nThen, Icons) { var Access = {}; var getOwnersTab = function (Env, data, opts, _cb) { @@ -400,7 +399,6 @@ define([ $div1.append(drawRemove(false)).append(drawRemove(true)); $div2.append(drawAdd()); called = false; - setTimeout(() => Lucide.createIcons(),0); }); }; redrawAll(); @@ -1044,7 +1042,6 @@ define([ } }); }); - Lucide.createIcons(); }); }); $(passwordOk).on('keydown', function (e) { diff --git a/www/common/inner/common-mediatag.js b/www/common/inner/common-mediatag.js index 8c07c95fe..f40f12442 100644 --- a/www/common/inner/common-mediatag.js +++ b/www/common/inner/common-mediatag.js @@ -13,14 +13,13 @@ define([ '/common/inner/badges.js', '/customize/messages.js', '/customize/application_config.js', - '/customize/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, Lucide, Icons) { + Messages, AppConfig, Icons) { var MT = {}; // Configure MediaTags to use our local viewer diff --git a/www/common/inner/common-modal.js b/www/common/inner/common-modal.js index 0fcca34b6..4fe7d6bef 100644 --- a/www/common/inner/common-modal.js +++ b/www/common/inner/common-modal.js @@ -10,8 +10,7 @@ define([ '/common/common-ui-elements.js', '/customize/messages.js', '/components/nthen/index.js', - '/customize/lucide.js' -], function ($, Util, Hash, UI, UIElements, Messages, nThen, Lucide) { +], function ($, Util, Hash, UI, UIElements, Messages, nThen) { var Modal = {}; Modal.override = function (data, obj) { @@ -182,7 +181,6 @@ define([ Env.evRedrawAll.fire(); }; metadataMgr.onChange(f); - setTimeout(() => Lucide.createIcons(),0); }); }; diff --git a/www/common/inner/mfa.js b/www/common/inner/mfa.js index 6a2ff15eb..b8380a46d 100644 --- a/www/common/inner/mfa.js +++ b/www/common/inner/mfa.js @@ -10,10 +10,9 @@ define([ '/components/nthen/index.js', '/customize.dist/login.js', '/common/common-util.js', - '/customize/lucide.js', '/common/common-icons.js', -], function ($, Messages, h, UI, nThen, Login, Util, Lucide, Icons) { +], function ($, Messages, h, UI, nThen, Login, Util, Icons) { const MFA = {}; MFA.totpSetup = function (common, config, content, enabled, cb) { @@ -28,7 +27,6 @@ define([ (enabled ? Icons.get('check') : Icons.get('close')), h('span', enabled ? Messages.mfa_status_on : Messages.mfa_status_off) ])); - setTimeout(() => Lucide.createIcons()); if (enabled) { (function () { var button = h('button.btn', Messages.mfa_disable); @@ -240,7 +238,6 @@ define([ $content.find('.alert-danger').removeClass('alert-danger').addClass('alert-success'); $(button).prop('disabled', 'disabled'); $(nextButton).removeAttr('disabled'); - Lucide.createIcons(); }); }).nThen(function () { var randomSecret = function () { diff --git a/www/common/inner/sidebar-layout.js b/www/common/inner/sidebar-layout.js index dc417ab70..6422d945b 100644 --- a/www/common/inner/sidebar-layout.js +++ b/www/common/inner/sidebar-layout.js @@ -12,7 +12,6 @@ define([ '/common/common-hash.js', '/customize/messages.js', '/common/hyperscript.js', - '/customize/lucide.js', '/common/common-icons.js', ], function( $, @@ -24,7 +23,6 @@ define([ Hash, Messages, h, - Lucide, Icons ) { const Sidebar = {}; @@ -400,7 +398,6 @@ define([ common.setHash(active); setTimeout(() => { sidebar.openCategory(active); }); - Lucide.createIcons(); $leftside.append(container); }; diff --git a/www/common/inner/snapshots.js b/www/common/inner/snapshots.js index 2deaee7b1..c0149b948 100644 --- a/www/common/inner/snapshots.js +++ b/www/common/inner/snapshots.js @@ -9,9 +9,8 @@ define([ '/customize/messages.js', '/components/nthen/index.js', '/components/chainpad/chainpad.dist.js', - '/customize/lucide.js', '/common/common-icons.js', -], function ($, UI, h, Messages, nThen, ChainPad, Lucide, Icons /* JsonOT */) { +], function ($, UI, h, Messages, nThen, ChainPad, Icons /* JsonOT */) { var Snapshots = {}; Snapshots.create = function (common, config) { diff --git a/www/common/make-backup.js b/www/common/make-backup.js index 08ca54fd8..a1d2d8556 100644 --- a/www/common/make-backup.js +++ b/www/common/make-backup.js @@ -15,11 +15,10 @@ define([ '/customize/messages.js', '/components/nthen/index.js', '/components/saferphore/index.js', - '/customize/lucide.js', '/common/common-icons.js', '/components/jszip/dist/jszip.min.js', ], function ($, FileCrypto, Hash, Util, UI, h, Feedback, UO, - Cache, Messages, nThen, Saferphore, Lucide, Icons, JsZip) { + Cache, Messages, nThen, Saferphore, Icons, JsZip) { var saveAs = window.saveAs; var sanitize = function (str) { diff --git a/www/common/messenger-ui.js b/www/common/messenger-ui.js index c1b5fe927..bcab06f7a 100644 --- a/www/common/messenger-ui.js +++ b/www/common/messenger-ui.js @@ -11,9 +11,8 @@ define([ '/common/inner/badges.js', '/common/hyperscript.js', '/common/diffMarked.js', - '/customize/lucide.js', '/common/common-icons.js', -], function ($, Messages, Util, UI, UIElements, Badges, h, DiffMd, Lucide, Icons) { +], function ($, Messages, Util, UI, UIElements, Badges, h, DiffMd, Icons) { 'use strict'; var debug = console.log; @@ -381,7 +380,6 @@ define([ avatars[friend.avatar] = $img[0].outerHTML; } $(rightCol).insertAfter($avatar); - Lucide.createIcons(); }, friend.uid, friend.badge); } @@ -637,7 +635,6 @@ define([ avatars[friendData.avatar] = $img[0].outerHTML; } $room.append(rightCol); - Lucide.createIcons(); }, friendData.uid, friendData.badge); } $room.append(status); @@ -827,7 +824,6 @@ define([ $container.removeClass('cp-app-contacts-initializing'); display(room.id); } - setTimeout( () => Lucide.createIcons()); }); }; @@ -946,7 +942,6 @@ define([ $button.off('click'); $button.click(function () { UI.alert(content); - Lucide.createIcons(); }).show(); }); }; diff --git a/www/common/notifications.js b/www/common/notifications.js index 75357b51d..30a8d83f6 100644 --- a/www/common/notifications.js +++ b/www/common/notifications.js @@ -12,10 +12,9 @@ define([ '/common/common-constants.js', '/customize/messages.js', '/customize/pages.js', - '/customize/lucide.js', '/common/common-icons.js', 'tui-date-picker' -], function($, h, Hash, UI, UIElements, Util, Constants, Messages, Pages, Lucide, Icons, DatePicker) { +], function($, h, Hash, UI, UIElements, Util, Constants, Messages, Pages, Icons, DatePicker) { var handlers = {}; diff --git a/www/common/onlyoffice/history.js b/www/common/onlyoffice/history.js index 9ed928f85..cd16adcd7 100644 --- a/www/common/onlyoffice/history.js +++ b/www/common/onlyoffice/history.js @@ -6,10 +6,9 @@ define([ 'jquery', '/common/common-interface.js', '/common/hyperscript.js', - '/customize/lucide.js', '/common/common-icons.js', -], function ($, UI, h, Lucide, Icons) { +], function ($, UI, h, Icons) { //var ChainPad = window.ChainPad; var History = {}; @@ -384,7 +383,6 @@ define([ display(); showVersion(true); - setTimeout(()=> Lucide.createIcons()); //return void loadMoreOOHistory(); }; diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index ae0dcf81c..5b13a8176 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -26,7 +26,6 @@ define([ '/common/onlyoffice/current-version.js', '/common/onlyoffice/broken-formats.js', - '/customize/lucide.js', '/common/common-icons.js', '/components/file-saver/FileSaver.min.js', @@ -55,7 +54,6 @@ define([ Channel, OOCurrentVersion, BrokenFormats, - Lucide, Icons) { var saveAs = window.saveAs; diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index 5ba93e78d..2d6fd5f24 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -14,9 +14,8 @@ define([ '/common/text-cursor.js', '/components/chainpad/chainpad.dist.js', '/common/hyperscript.js', - '/customize/lucide.js', '/common/common-icons.js', -], function ($, Modes, Themes, Messages, UIElements, MT, Hash, Util, TextCursor, ChainPad, h, Lucide, Icons) { +], function ($, Modes, Themes, Messages, UIElements, MT, Hash, Util, TextCursor, ChainPad, h, Icons) { var module = {}; var cursorToPos = module.cursorToPos = function(cursor, oldText) { diff --git a/www/common/sframe-common-file.js b/www/common/sframe-common-file.js index fa6f7158e..8f1ef6bf1 100644 --- a/www/common/sframe-common-file.js +++ b/www/common/sframe-common-file.js @@ -17,11 +17,10 @@ define([ '/customize/pages.js', '/components/nthen/index.js', '/common/media-tag.js', - '/customize/lucide.js', '/common/common-icons.js', '/components/file-saver/FileSaver.min.js', -], function ($, ApiConfig, FileCrypto, MakeBackup, Thumb, UI, UIElements, Util, Hash, h, Messages, Pages, nThen, MT, Lucide, Icons) { +], function ($, ApiConfig, FileCrypto, MakeBackup, Thumb, UI, UIElements, Util, Hash, h, Messages, Pages, nThen, MT, Icons) { var module = {}; var blobToArrayBuffer = function (blob, cb) { @@ -143,7 +142,6 @@ define([ var $row = $table.find('tr[id="'+id+'"]'); $row.find('.cp-fileupload-table-cancel').addClass('success').html('').append(Icons.get('minus')); - Lucide.createIcons(); var $pv = $row.find('.cp-fileupload-table-progress-value'); var $pb = $row.find('.cp-fileupload-table-progressbar'); var $link = $row.find('.cp-fileupload-table-link'); @@ -314,7 +312,6 @@ define([ if (diff && diff > 0) { $table.css('margin-right', diff+'px'); } - Lucide.createIcons(); queue.next(); }; diff --git a/www/common/sframe-common-history.js b/www/common/sframe-common-history.js index 97f1a18fe..65068d700 100644 --- a/www/common/sframe-common-history.js +++ b/www/common/sframe-common-history.js @@ -10,11 +10,10 @@ define([ '/customize/messages.js', '/components/nthen/index.js', '/common/common-icons.js', - '/customize/lucide.js', //'/components/chainpad-json-validator/json-ot.js', '/components/chainpad/chainpad.dist.js', -], function ($, UI, Util, h, Messages, nThen, Icons, Lucide, ChainPad /* JsonOT */) { +], function ($, UI, Util, h, Messages, nThen, Icons, ChainPad /* JsonOT */) { //var ChainPad = window.ChainPad; var History = {}; @@ -293,7 +292,6 @@ define([ var spinner = UI.makeSpinner($hist); spinner.spin(); - Lucide.createIcons(); let closeAll = () => { History.state = false; @@ -435,7 +433,6 @@ define([ // Create the history toolbar var display = function () { - setTimeout(()=> Lucide.createIcons()); $hist.html(''); $hist.removeClass('cp-history-init'); diff --git a/www/common/sframe-common-mailbox.js b/www/common/sframe-common-mailbox.js index b3d30143b..bb3fb7708 100644 --- a/www/common/sframe-common-mailbox.js +++ b/www/common/sframe-common-mailbox.js @@ -12,8 +12,7 @@ define([ '/common/hyperscript.js', '/customize/messages.js', '/common/common-icons.js', - '/customize/lucide.js', -], function ($, Util, Hash, UI, UIElements, Notifications, h, Messages, Icons, Lucide) { +], function ($, Util, Hash, UI, UIElements, Notifications, h, Messages, Icons) { var Mailbox = {}; Mailbox.create = function (Common) { @@ -188,7 +187,6 @@ define([ if (isNotification(data.type)) { Notifications.add(Common, data); el = createElement(data); - setTimeout(() => Lucide.createIcons()); } f(data, el); } catch (e) { diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index a78ecbf5c..69abc5927 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -35,7 +35,6 @@ define([ '/components/localforage/dist/localforage.min.js', '/common/hyperscript.js', '/common/extensions.js', - '/customize/lucide.js', '/common/common-icons.js' ], function ( $, @@ -69,7 +68,6 @@ define([ localForage, h, Ext, - Lucide, Icons ) { // Chainpad Netflux Inner diff --git a/www/common/toolbar.js b/www/common/toolbar.js index fc40cdf84..7ffe7f827 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -19,10 +19,9 @@ define([ '/customize/messages.js', '/customize/pages.js', '/common/pad-types.js', - '/customize/lucide.js', '/common/common-icons.js', ], function ($, Config, ApiConfig, Broadcast, UIElements, UI, Hash, Util, Feedback, MT, Badges, h, -MessengerUI, Messages, Pages, PadTypes, Lucide, Icons) { +MessengerUI, Messages, Pages, PadTypes, Icons) { var Common; var Bar = { @@ -381,7 +380,6 @@ MessengerUI, Messages, Pages, PadTypes, Lucide, Icons) { Common.displayAvatar($avatar, data.avatar, name, function () { $span.append($rightCol); onAvatar.fire(); - Lucide.createIcons(); }, data.uid); $span.data('uid', data.uid); if (data.badge && data.edPublic) { @@ -431,7 +429,6 @@ MessengerUI, Messages, Pages, PadTypes, Lucide, Icons) { viewText += numberOfViewUsers + ' ' + viewerText + '
'; $editUsers.append(viewText); } - Lucide.createIcons(); }; var initUserList = function (toolbar, config) { @@ -530,7 +527,6 @@ MessengerUI, Messages, Pages, PadTypes, Lucide, Icons) { Icons.get('chevron-up', {title: Messages.toolbar_collapse}); $button.find('[data-lucide]').replaceWith(newIcon); - Lucide.createIcons(); }); }; @@ -899,7 +895,6 @@ MessengerUI, Messages, Pages, PadTypes, Lucide, Icons) { 'role': 'button', 'aria-label': buttonTitle }).append(UI.getIcon(privateData.app)).append(Icons.get(toMain ? 'homepage' : 'drive')); //append both icons - Lucide.createIcons(); var onClick = function (e) { e.preventDefault(); diff --git a/www/contacts/inner.js b/www/contacts/inner.js index 6b34c1a8a..68c529023 100644 --- a/www/contacts/inner.js +++ b/www/contacts/inner.js @@ -12,7 +12,6 @@ define([ '/common/messenger-ui.js', '/customize/messages.js', '/common/common-interface.js', - '/customize/lucide.js', 'css!/components/bootstrap/dist/css/bootstrap.min.css', 'less!/contacts/app-contacts.less', @@ -25,8 +24,7 @@ define([ h, MessengerUI, Messages, - UI, - Lucide + UI ) { var APP = {}; @@ -63,6 +61,5 @@ define([ common.setTabTitle(Messages.contacts); UI.removeLoadingScreen(); - Lucide.createIcons(); }); }); diff --git a/www/debug/inner.js b/www/debug/inner.js index 29eea159a..00b7e3ede 100644 --- a/www/debug/inner.js +++ b/www/debug/inner.js @@ -21,7 +21,6 @@ define([ '/customize/application_config.js', '/common/common-ui-elements.js', '/debug/chainpad.dist.js', - '/customize/lucide.js', '/common/common-icons.js', 'css!/components/bootstrap/dist/css/bootstrap.min.css', @@ -45,7 +44,6 @@ define([ AppConfig, UIElements, ChainWalk, - Lucide, Icons) { var APP = window.APP = { diff --git a/www/drive/index.html b/www/drive/index.html index 01b502dcd..f72c9e669 100644 --- a/www/drive/index.html +++ b/www/drive/index.html @@ -15,7 +15,6 @@ SPDX-License-Identifier: AGPL-3.0-or-later - diff --git a/www/drive/inner.html b/www/drive/inner.html index 534b7da68..a213ecc27 100644 --- a/www/drive/inner.html +++ b/www/drive/inner.html @@ -10,7 +10,6 @@ SPDX-License-Identifier: AGPL-3.0-or-later -