From 925dad9f98e07953634dabadb7301db1270ed3e0 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 22 Aug 2022 17:12:03 +0200 Subject: [PATCH] Convert legacy icons --- com.woltlab.wcf/templates/wysiwygToolbar.tpl | 42 +++++++++---------- wcfsetup/install/files/acp/js/WCF.ACP.js | 14 ++++++- .../files/acp/templates/wysiwygToolbar.tpl | 42 +++++++++---------- .../redactor2/plugins/WoltLabButton.js | 19 +++++++-- wcfsetup/install/files/js/WCF.Attachment.js | 5 ++- wcfsetup/install/files/js/WCF.Comment.js | 28 +++++++++++-- wcfsetup/install/files/js/WCF.ImageViewer.js | 14 ++++--- wcfsetup/install/files/js/WCF.Poll.js | 6 +-- wcfsetup/install/files/js/WCF.User.js | 4 +- wcfsetup/install/files/js/WCF.js | 8 ++-- wcfsetup/install/files/style/ui/redactor.scss | 10 ----- 11 files changed, 116 insertions(+), 76 deletions(-) diff --git a/com.woltlab.wcf/templates/wysiwygToolbar.tpl b/com.woltlab.wcf/templates/wysiwygToolbar.tpl index 276f79a30a..881abd65f5 100644 --- a/com.woltlab.wcf/templates/wysiwygToolbar.tpl +++ b/com.woltlab.wcf/templates/wysiwygToolbar.tpl @@ -1,25 +1,25 @@ buttonOptions = { - alignment: { icon: 'fa-align-left', title: '{jslang}wcf.editor.button.alignment{/jslang}' }, - bold: { icon: 'fa-bold', title: '{jslang}wcf.editor.button.bold{/jslang}' }, - deleted: { icon: 'fa-strikethrough', title: '{jslang}wcf.editor.button.strikethrough{/jslang}' }, - format: { icon: 'fa-header', title: '{jslang}wcf.editor.button.format{/jslang}' }, - html: { icon: 'fa-file-code-o', title: '{jslang}wcf.editor.button.html{/jslang}' }, - italic: { icon: 'fa-italic', title: '{jslang}wcf.editor.button.italic{/jslang}' }, - link: { icon: 'fa-link', title: '{jslang}wcf.editor.button.link{/jslang}' }, - lists: { icon: 'fa-list', title: '{jslang}wcf.editor.button.lists{/jslang}' }, - redo: { icon: 'fa-repeat', title: '{jslang}wcf.editor.button.redo{/jslang}' }, - subscript: { icon: 'fa-subscript', title: '{jslang}wcf.editor.button.subscript{/jslang}' }, - superscript: { icon: 'fa-superscript', title: '{jslang}wcf.editor.button.superscript{/jslang}' }, - table: { icon: 'fa-table', title: '{jslang}wcf.editor.button.table{/jslang}' }, - underline: { icon: 'fa-underline', title: '{jslang}wcf.editor.button.underline{/jslang}' }, - undo: { icon: 'fa-undo', title: '{jslang}wcf.editor.button.undo{/jslang}' }, - woltlabColor: { icon: 'fa-paint-brush', title: '{jslang}wcf.editor.button.color{/jslang}' }, - woltlabFont: { icon: 'fa-font', title: '{jslang}wcf.editor.button.font{/jslang}' }, - woltlabFullscreen: { icon: 'fa-expand', title: '{jslang}wcf.editor.button.fullscreen{/jslang}' }, - woltlabImage: { icon: 'fa-picture-o', title: '{jslang}wcf.editor.button.image{/jslang}' }, - woltlabMedia: { icon: 'fa-file-o', title: '{jslang}wcf.editor.button.media{/jslang}' }, - woltlabQuote: { icon: 'fa-quote-left', title: '{jslang}wcf.editor.button.quote{/jslang}' }, - woltlabSize: { icon: 'fa-text-height', title: '{jslang}wcf.editor.button.size{/jslang}' } + alignment: { icon: 'align-left;false', title: '{jslang}wcf.editor.button.alignment{/jslang}' }, + bold: { icon: 'bold;false', title: '{jslang}wcf.editor.button.bold{/jslang}' }, + deleted: { icon: 'strikethrough;false', title: '{jslang}wcf.editor.button.strikethrough{/jslang}' }, + format: { icon: 'heading;false', title: '{jslang}wcf.editor.button.format{/jslang}' }, + html: { icon: 'code;false', title: '{jslang}wcf.editor.button.html{/jslang}' }, + italic: { icon: 'italic;false', title: '{jslang}wcf.editor.button.italic{/jslang}' }, + link: { icon: 'link;false', title: '{jslang}wcf.editor.button.link{/jslang}' }, + lists: { icon: 'list;false', title: '{jslang}wcf.editor.button.lists{/jslang}' }, + redo: { icon: 'arrow-rotate-right;false', title: '{jslang}wcf.editor.button.redo{/jslang}' }, + subscript: { icon: 'subscript;false', title: '{jslang}wcf.editor.button.subscript{/jslang}' }, + superscript: { icon: 'superscript;false', title: '{jslang}wcf.editor.button.superscript{/jslang}' }, + table: { icon: 'table;false', title: '{jslang}wcf.editor.button.table{/jslang}' }, + underline: { icon: 'underline;false', title: '{jslang}wcf.editor.button.underline{/jslang}' }, + undo: { icon: 'arrow-rotate-left;false', title: '{jslang}wcf.editor.button.undo{/jslang}' }, + woltlabColor: { icon: 'paintbrush;false', title: '{jslang}wcf.editor.button.color{/jslang}' }, + woltlabFont: { icon: 'font;false', title: '{jslang}wcf.editor.button.font{/jslang}' }, + woltlabFullscreen: { icon: 'expand;false', title: '{jslang}wcf.editor.button.fullscreen{/jslang}' }, + woltlabImage: { icon: 'image;false', title: '{jslang}wcf.editor.button.image{/jslang}' }, + woltlabMedia: { icon: 'file;false', title: '{jslang}wcf.editor.button.media{/jslang}' }, + woltlabQuote: { icon: 'quote-left;true', title: '{jslang}wcf.editor.button.quote{/jslang}' }, + woltlabSize: { icon: 'text-height;false', title: '{jslang}wcf.editor.button.size{/jslang}' } }; buttonMobile = ['format', 'bold', 'italic', 'underline', 'lists', 'link', 'woltlabImage']; diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index a72c8acc71..dbca7251c5 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -803,7 +803,12 @@ WCF.ACP.Package.Update.Search = Class.extend({ this._dialog = null; if (!bindOnExistingButtons === true) { - $('
  • ' + WCF.Language.get('wcf.acp.package.searchForUpdates') + '
  • ').prependTo($('.contentHeaderNavigation > ul')); + $(`
  • + +
  • `).prependTo($('.contentHeaderNavigation > ul')); } this._button = elBySel('.jsButtonSearchForUpdates'); @@ -904,7 +909,12 @@ WCF.ACP.PluginStore.PurchasedItems.Search = Class.extend({ success: $.proxy(this._success, this) }); - var $button = $('
  • ' + WCF.Language.get('wcf.acp.pluginStore.purchasedItems.button.search') + '
  • '); + var $button = $(`
  • + +
  • `); $button.prependTo($('.contentHeaderNavigation > ul')).click($.proxy(this._click, this)); }, diff --git a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl index 276f79a30a..881abd65f5 100644 --- a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl @@ -1,25 +1,25 @@ buttonOptions = { - alignment: { icon: 'fa-align-left', title: '{jslang}wcf.editor.button.alignment{/jslang}' }, - bold: { icon: 'fa-bold', title: '{jslang}wcf.editor.button.bold{/jslang}' }, - deleted: { icon: 'fa-strikethrough', title: '{jslang}wcf.editor.button.strikethrough{/jslang}' }, - format: { icon: 'fa-header', title: '{jslang}wcf.editor.button.format{/jslang}' }, - html: { icon: 'fa-file-code-o', title: '{jslang}wcf.editor.button.html{/jslang}' }, - italic: { icon: 'fa-italic', title: '{jslang}wcf.editor.button.italic{/jslang}' }, - link: { icon: 'fa-link', title: '{jslang}wcf.editor.button.link{/jslang}' }, - lists: { icon: 'fa-list', title: '{jslang}wcf.editor.button.lists{/jslang}' }, - redo: { icon: 'fa-repeat', title: '{jslang}wcf.editor.button.redo{/jslang}' }, - subscript: { icon: 'fa-subscript', title: '{jslang}wcf.editor.button.subscript{/jslang}' }, - superscript: { icon: 'fa-superscript', title: '{jslang}wcf.editor.button.superscript{/jslang}' }, - table: { icon: 'fa-table', title: '{jslang}wcf.editor.button.table{/jslang}' }, - underline: { icon: 'fa-underline', title: '{jslang}wcf.editor.button.underline{/jslang}' }, - undo: { icon: 'fa-undo', title: '{jslang}wcf.editor.button.undo{/jslang}' }, - woltlabColor: { icon: 'fa-paint-brush', title: '{jslang}wcf.editor.button.color{/jslang}' }, - woltlabFont: { icon: 'fa-font', title: '{jslang}wcf.editor.button.font{/jslang}' }, - woltlabFullscreen: { icon: 'fa-expand', title: '{jslang}wcf.editor.button.fullscreen{/jslang}' }, - woltlabImage: { icon: 'fa-picture-o', title: '{jslang}wcf.editor.button.image{/jslang}' }, - woltlabMedia: { icon: 'fa-file-o', title: '{jslang}wcf.editor.button.media{/jslang}' }, - woltlabQuote: { icon: 'fa-quote-left', title: '{jslang}wcf.editor.button.quote{/jslang}' }, - woltlabSize: { icon: 'fa-text-height', title: '{jslang}wcf.editor.button.size{/jslang}' } + alignment: { icon: 'align-left;false', title: '{jslang}wcf.editor.button.alignment{/jslang}' }, + bold: { icon: 'bold;false', title: '{jslang}wcf.editor.button.bold{/jslang}' }, + deleted: { icon: 'strikethrough;false', title: '{jslang}wcf.editor.button.strikethrough{/jslang}' }, + format: { icon: 'heading;false', title: '{jslang}wcf.editor.button.format{/jslang}' }, + html: { icon: 'code;false', title: '{jslang}wcf.editor.button.html{/jslang}' }, + italic: { icon: 'italic;false', title: '{jslang}wcf.editor.button.italic{/jslang}' }, + link: { icon: 'link;false', title: '{jslang}wcf.editor.button.link{/jslang}' }, + lists: { icon: 'list;false', title: '{jslang}wcf.editor.button.lists{/jslang}' }, + redo: { icon: 'arrow-rotate-right;false', title: '{jslang}wcf.editor.button.redo{/jslang}' }, + subscript: { icon: 'subscript;false', title: '{jslang}wcf.editor.button.subscript{/jslang}' }, + superscript: { icon: 'superscript;false', title: '{jslang}wcf.editor.button.superscript{/jslang}' }, + table: { icon: 'table;false', title: '{jslang}wcf.editor.button.table{/jslang}' }, + underline: { icon: 'underline;false', title: '{jslang}wcf.editor.button.underline{/jslang}' }, + undo: { icon: 'arrow-rotate-left;false', title: '{jslang}wcf.editor.button.undo{/jslang}' }, + woltlabColor: { icon: 'paintbrush;false', title: '{jslang}wcf.editor.button.color{/jslang}' }, + woltlabFont: { icon: 'font;false', title: '{jslang}wcf.editor.button.font{/jslang}' }, + woltlabFullscreen: { icon: 'expand;false', title: '{jslang}wcf.editor.button.fullscreen{/jslang}' }, + woltlabImage: { icon: 'image;false', title: '{jslang}wcf.editor.button.image{/jslang}' }, + woltlabMedia: { icon: 'file;false', title: '{jslang}wcf.editor.button.media{/jslang}' }, + woltlabQuote: { icon: 'quote-left;true', title: '{jslang}wcf.editor.button.quote{/jslang}' }, + woltlabSize: { icon: 'text-height;false', title: '{jslang}wcf.editor.button.size{/jslang}' } }; buttonMobile = ['format', 'bold', 'italic', 'underline', 'lists', 'link', 'woltlabImage']; diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js index 94a2615b96..c8ce014822 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js @@ -61,11 +61,24 @@ $.Redactor.prototype.WoltLabButton = function() { } icon = buttonData.icon; - iconIsImage = (!icon.match(/^fa-/) && icon.match(/\.(gif|jpe?g|png|svg)$/)); + iconIsImage = icon.match(/\.(gif|jpe?g|png|svg)$/); // set icon - //noinspection CssUnknownTarget - this.button.setIcon(button, ''); + if (iconIsImage) { + this.button.setIcon(button, ``); + } else{ + if (icon.includes(";")) { + const [iconName, forceSolid] = icon.split(";", 2); + if (forceSolid === "true") { + this.button.setIcon(button, ``); + } else{ + this.button.setIcon(button, ``); + } + } else { + this.button.setIcon(button, ''); + } + } + if (!button[0]) { throw new Error("Missing button element for '" + buttonName + "'."); } diff --git a/wcfsetup/install/files/js/WCF.Attachment.js b/wcfsetup/install/files/js/WCF.Attachment.js index b6b28ce083..c01ff782c1 100644 --- a/wcfsetup/install/files/js/WCF.Attachment.js +++ b/wcfsetup/install/files/js/WCF.Attachment.js @@ -488,7 +488,7 @@ WCF.Attachment.Upload = WCF.Upload.extend({ * @see WCF.Upload._initFile() */ _initFile: function (file) { - var $li = $('
  • ' + WCF.String.escapeHTML(file.name) + '

    • ').data('filename', file.name); + var $li = $('
    • ' + WCF.String.escapeHTML(file.name) + '

      • ').data('filename', file.name); this._fileListSelector.append($li); this._fileListSelector.show(); @@ -498,7 +498,8 @@ WCF.Attachment.Upload = WCF.Upload.extend({ $li.find('progress').remove(); // upload icon - $li.children('.fa-spinner').removeClass('fa-spinner').addClass('fa-ban'); + const icon = $li[0].querySelector("fa-icon"); + icon.setIcon("ban"); // error message $li.find('div > div').append($('' + WCF.Language.get('wcf.attachment.upload.error.tooLarge') + '')); diff --git a/wcfsetup/install/files/js/WCF.Comment.js b/wcfsetup/install/files/js/WCF.Comment.js index f660cfda84..b05a5fa0b7 100644 --- a/wcfsetup/install/files/js/WCF.Comment.js +++ b/wcfsetup/install/files/js/WCF.Comment.js @@ -419,12 +419,22 @@ WCF.Comment.Handler = Class.extend({ } if (comment.data('canEdit')) { - var $editButton = $('
      • '); + var $editButton = $(`
      • + +
      • `); $editButton.appendTo(comment.find('ul.buttonList:eq(0)')); } if (comment.data('canDelete')) { - var $deleteButton = $('
      • '); + var $deleteButton = $(`
      • + +
      • `); $deleteButton.data('commentID', commentID).appendTo(comment.find('ul.buttonList:eq(0)')).click($.proxy(this._delete, this)); } @@ -532,12 +542,22 @@ WCF.Comment.Handler = Class.extend({ */ _initResponse: function(responseID, response) { if (response.data('canEdit')) { - var $editButton = $('
      • '); + var $editButton = $(`
      • + +
      • `); $editButton.data('responseID', responseID).appendTo(response.find('ul.buttonList:eq(0)')); } if (response.data('canDelete')) { - var $deleteButton = $('
      • '); + var $deleteButton = $(`
      • + +
      • `); var self = this; $deleteButton.data('responseID', responseID).appendTo(response.find('ul.buttonList:eq(0)')).click(function(event) { self._delete(event, true); }); diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.js b/wcfsetup/install/files/js/WCF.ImageViewer.js index 0fcd4ab604..6157be4d0d 100644 --- a/wcfsetup/install/files/js/WCF.ImageViewer.js +++ b/wcfsetup/install/files/js/WCF.ImageViewer.js @@ -895,11 +895,11 @@ $.widget('ui.wcfImageViewer', { var $imageContainer = $('
        ').appendTo(this._container); var $imageList = $('').appendTo(this._container); var $slideshowContainer = $('