diff --git a/customize.dist/src/less2/include/forms.less b/customize.dist/src/less2/include/forms.less index 8d2cf791b..7fedfb9f2 100644 --- a/customize.dist/src/less2/include/forms.less +++ b/customize.dist/src/less2/include/forms.less @@ -64,12 +64,12 @@ } } &.mfa-enabled { - span, i { + span, i, svg { color: @cp_settings_enabled; } } &.mfa-disabled { - span, i { + span, i, svg { color: @cp_settings_disabled; } } diff --git a/www/common/common-icons.js b/www/common/common-icons.js index 9d33d006d..d05cfeeae 100644 --- a/www/common/common-icons.js +++ b/www/common/common-icons.js @@ -80,6 +80,7 @@ define([ "arrow-left": "arrow-left", "arrow-up": "arrow-up", "code": "code-xml", + "code-file": "file-code", "qr-code": "qr-code", "lock": "lock", "help": "info", @@ -103,6 +104,8 @@ define([ "calendar-description": "align-justify", "save": "save", "loading": "loader", // XXX + "notification" : "bell", + "cursor": "text-cursor", }; Icons.get = (name, attrs = {}) => { diff --git a/www/common/inner/mfa.js b/www/common/inner/mfa.js index 94516f0b9..ddf4ed3b3 100644 --- a/www/common/inner/mfa.js +++ b/www/common/inner/mfa.js @@ -10,8 +10,10 @@ define([ '/components/nthen/index.js', '/customize.dist/login.js', '/common/common-util.js', + '/customize/fonts/lucide.js', + '/common/common-icons.js', -], function ($, Messages, h, UI, nThen, Login, Util) { +], function ($, Messages, h, UI, nThen, Login, Util, Lucide, Icons) { const MFA = {}; MFA.totpSetup = function (common, config, content, enabled, cb) { @@ -23,10 +25,10 @@ define([ var $content = $(content).empty(); $content.append(h('div.cp-settings-mfa-hint.cp-settings-mfa-status' + (enabled ? '.mfa-enabled' : '.mfa-disabled'), [ - h('i.fa' + (enabled ? '.fa-check' : '.fa-times')), + (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); diff --git a/www/settings/app-settings.less b/www/settings/app-settings.less index 4d856b454..749bb6008 100644 --- a/www/settings/app-settings.less +++ b/www/settings/app-settings.less @@ -179,10 +179,9 @@ color: @cp_sidebar-hint; } .cp-settings-mfa-status { - & > i { - margin-right: 5px; - } margin: 1em 0; + display: inline-flex; + align-items: center; } .cp-settings-mfa { .cp-password-container { diff --git a/www/settings/inner.js b/www/settings/inner.js index 941b131fc..0c66987b6 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -384,7 +384,7 @@ define([ }); var button = h('button.btn.btn-danger', [ - h('i.fa.fa-trash-o'), + Icons.get('trash-full'), h('span', Messages.settings_cacheButton) ]); var buttonContainer = h('div.cp-settings-clear-cache', button); @@ -470,7 +470,7 @@ define([ if (!common.isLoggedIn()) { return cb(false); } var button = h('button.btn.btn-danger', [ - h('i.cptools.cptools-destroy'), + Icons.get('destroy'), Messages.settings_removeOwnedButton ]); var form = h('div', [ @@ -2033,7 +2033,7 @@ define([ $upButton.removeClass('btn-primary').addClass('btn-secondary'); $upButton.removeProp('title'); $upButton.text(Messages.profile_upload); - $upButton.prepend($('', {'class': 'fa fa-upload', 'aria-hidden': 'true'})); + $upButton.prepend(Icons.get('upload')); cb([ @@ -2118,16 +2118,16 @@ define([ }; var SIDEBAR_ICONS = { - account: 'fa fa-user-o', - profile: 'fa fa-user-circle', - drive: 'fa fa-hdd-o', - cursor: 'fa fa-i-cursor', - code: 'fa fa-file-code-o', - pad: 'cptools cptools-richtext', - security: 'fa fa-lock', - kanban: 'cptools cptools-kanban', - style: 'cptools cptools-palette', - notifications: 'fa fa-bell' + account: 'register-homepage', // XXX + profile: 'user-profile', + drive: 'drive', + cursor: 'cursor', + code: 'code-file', + pad: 'drive-file', + security: 'lock', + kanban: 'drive-file', // XXX + style: 'color-palette', + notifications: 'notification' }; let SIDEBAR_NAMES = {}; // for extension points @@ -2143,9 +2143,7 @@ define([ var iconClass = SIDEBAR_ICONS[key]; var icon; if (iconClass) { - icon = h('span', { - class: iconClass, - }); + icon = Icons.get(iconClass); } let name = SIDEBAR_NAMES[key] ||