From f13e02a1a952134965ee0ca3446f150cfb4cb7f2 Mon Sep 17 00:00:00 2001 From: nakanishi Date: Wed, 26 Sep 2018 09:16:15 +0900 Subject: [PATCH 1/3] Added font-awesome icons to user defined icon --- Gruntfile.js | 1 + .../editor-client/src/js/font-awesome.js | 828 ++++++++++++++++++ .../@node-red/editor-client/src/js/nodes.js | 1 + .../@node-red/editor-client/src/js/ui/diff.js | 3 +- .../editor-client/src/js/ui/editor.js | 6 +- .../editor-client/src/js/ui/palette.js | 5 +- .../editor-client/src/js/ui/search.js | 3 +- .../editor-client/src/js/ui/typeSearch.js | 3 +- .../editor-client/src/js/ui/utils.js | 59 +- .../@node-red/editor-client/src/js/ui/view.js | 84 +- .../editor-client/src/sass/diff.scss | 5 + .../editor-client/src/sass/editor.scss | 8 + .../editor-client/src/sass/palette.scss | 11 +- .../editor-client/src/sass/search.scss | 9 + 14 files changed, 992 insertions(+), 34 deletions(-) create mode 100644 packages/node_modules/@node-red/editor-client/src/js/font-awesome.js diff --git a/Gruntfile.js b/Gruntfile.js index 44abf1e40..5b566534b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -128,6 +128,7 @@ module.exports = function(grunt) { "packages/node_modules/@node-red/editor-client/src/js/text/format.js", "packages/node_modules/@node-red/editor-client/src/js/ui/state.js", "packages/node_modules/@node-red/editor-client/src/js/nodes.js", + "packages/node_modules/@node-red/editor-client/src/js/font-awesome.js", "packages/node_modules/@node-red/editor-client/src/js/history.js", "packages/node_modules/@node-red/editor-client/src/js/validators.js", "packages/node_modules/@node-red/editor-client/src/js/ui/utils.js", diff --git a/packages/node_modules/@node-red/editor-client/src/js/font-awesome.js b/packages/node_modules/@node-red/editor-client/src/js/font-awesome.js new file mode 100644 index 000000000..0e56ef97c --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/js/font-awesome.js @@ -0,0 +1,828 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +RED.nodes.fontAwesome = (function() { + + var iconMap = { + "fa-glass": "\uf000", + "fa-music": "\uf001", + "fa-search": "\uf002", + "fa-envelope-o": "\uf003", + "fa-heart": "\uf004", + "fa-star": "\uf005", + "fa-star-o": "\uf006", + "fa-user": "\uf007", + "fa-film": "\uf008", + "fa-th-large": "\uf009", + "fa-th": "\uf00a", + "fa-th-list": "\uf00b", + "fa-check": "\uf00c", + "fa-remove": "\uf00d", + "fa-close": "\uf00d", + "fa-times": "\uf00d", + "fa-search-plus": "\uf00e", + "fa-search-minus": "\uf010", + "fa-power-off": "\uf011", + "fa-signal": "\uf012", + "fa-gear": "\uf013", + "fa-cog": "\uf013", + "fa-trash-o": "\uf014", + "fa-home": "\uf015", + "fa-file-o": "\uf016", + "fa-clock-o": "\uf017", + "fa-road": "\uf018", + "fa-download": "\uf019", + "fa-arrow-circle-o-down": "\uf01a", + "fa-arrow-circle-o-up": "\uf01b", + "fa-inbox": "\uf01c", + "fa-play-circle-o": "\uf01d", + "fa-rotate-right": "\uf01e", + "fa-repeat": "\uf01e", + "fa-refresh": "\uf021", + "fa-list-alt": "\uf022", + "fa-lock": "\uf023", + "fa-flag": "\uf024", + "fa-headphones": "\uf025", + "fa-volume-off": "\uf026", + "fa-volume-down": "\uf027", + "fa-volume-up": "\uf028", + "fa-qrcode": "\uf029", + "fa-barcode": "\uf02a", + "fa-tag": "\uf02b", + "fa-tags": "\uf02c", + "fa-book": "\uf02d", + "fa-bookmark": "\uf02e", + "fa-print": "\uf02f", + "fa-camera": "\uf030", + "fa-font": "\uf031", + "fa-bold": "\uf032", + "fa-italic": "\uf033", + "fa-text-height": "\uf034", + "fa-text-width": "\uf035", + "fa-align-left": "\uf036", + "fa-align-center": "\uf037", + "fa-align-right": "\uf038", + "fa-align-justify": "\uf039", + "fa-list": "\uf03a", + "fa-dedent": "\uf03b", + "fa-outdent": "\uf03b", + "fa-indent": "\uf03c", + "fa-video-camera": "\uf03d", + "fa-photo": "\uf03e", + "fa-image": "\uf03e", + "fa-picture-o": "\uf03e", + "fa-pencil": "\uf040", + "fa-map-marker": "\uf041", + "fa-adjust": "\uf042", + "fa-tint": "\uf043", + "fa-edit": "\uf044", + "fa-pencil-square-o": "\uf044", + "fa-share-square-o": "\uf045", + "fa-check-square-o": "\uf046", + "fa-arrows": "\uf047", + "fa-step-backward": "\uf048", + "fa-fast-backward": "\uf049", + "fa-backward": "\uf04a", + "fa-play": "\uf04b", + "fa-pause": "\uf04c", + "fa-stop": "\uf04d", + "fa-forward": "\uf04e", + "fa-fast-forward": "\uf050", + "fa-step-forward": "\uf051", + "fa-eject": "\uf052", + "fa-chevron-left": "\uf053", + "fa-chevron-right": "\uf054", + "fa-plus-circle": "\uf055", + "fa-minus-circle": "\uf056", + "fa-times-circle": "\uf057", + "fa-check-circle": "\uf058", + "fa-question-circle": "\uf059", + "fa-info-circle": "\uf05a", + "fa-crosshairs": "\uf05b", + "fa-times-circle-o": "\uf05c", + "fa-check-circle-o": "\uf05d", + "fa-ban": "\uf05e", + "fa-arrow-left": "\uf060", + "fa-arrow-right": "\uf061", + "fa-arrow-up": "\uf062", + "fa-arrow-down": "\uf063", + "fa-mail-forward": "\uf064", + "fa-share": "\uf064", + "fa-expand": "\uf065", + "fa-compress": "\uf066", + "fa-plus": "\uf067", + "fa-minus": "\uf068", + "fa-asterisk": "\uf069", + "fa-exclamation-circle": "\uf06a", + "fa-gift": "\uf06b", + "fa-leaf": "\uf06c", + "fa-fire": "\uf06d", + "fa-eye": "\uf06e", + "fa-eye-slash": "\uf070", + "fa-warning": "\uf071", + "fa-exclamation-triangle": "\uf071", + "fa-plane": "\uf072", + "fa-calendar": "\uf073", + "fa-random": "\uf074", + "fa-comment": "\uf075", + "fa-magnet": "\uf076", + "fa-chevron-up": "\uf077", + "fa-chevron-down": "\uf078", + "fa-retweet": "\uf079", + "fa-shopping-cart": "\uf07a", + "fa-folder": "\uf07b", + "fa-folder-open": "\uf07c", + "fa-arrows-v": "\uf07d", + "fa-arrows-h": "\uf07e", + "fa-bar-chart-o": "\uf080", + "fa-bar-chart": "\uf080", + "fa-twitter-square": "\uf081", + "fa-facebook-square": "\uf082", + "fa-camera-retro": "\uf083", + "fa-key": "\uf084", + "fa-gears": "\uf085", + "fa-cogs": "\uf085", + "fa-comments": "\uf086", + "fa-thumbs-o-up": "\uf087", + "fa-thumbs-o-down": "\uf088", + "fa-star-half": "\uf089", + "fa-heart-o": "\uf08a", + "fa-sign-out": "\uf08b", + "fa-linkedin-square": "\uf08c", + "fa-thumb-tack": "\uf08d", + "fa-external-link": "\uf08e", + "fa-sign-in": "\uf090", + "fa-trophy": "\uf091", + "fa-github-square": "\uf092", + "fa-upload": "\uf093", + "fa-lemon-o": "\uf094", + "fa-phone": "\uf095", + "fa-square-o": "\uf096", + "fa-bookmark-o": "\uf097", + "fa-phone-square": "\uf098", + "fa-twitter": "\uf099", + "fa-facebook-f": "\uf09a", + "fa-facebook": "\uf09a", + "fa-github": "\uf09b", + "fa-unlock": "\uf09c", + "fa-credit-card": "\uf09d", + "fa-feed": "\uf09e", + "fa-rss": "\uf09e", + "fa-hdd-o": "\uf0a0", + "fa-bullhorn": "\uf0a1", + "fa-bell-o": "\uf0a2", + "fa-certificate": "\uf0a3", + "fa-hand-o-right": "\uf0a4", + "fa-hand-o-left": "\uf0a5", + "fa-hand-o-up": "\uf0a6", + "fa-hand-o-down": "\uf0a7", + "fa-arrow-circle-left": "\uf0a8", + "fa-arrow-circle-right": "\uf0a9", + "fa-arrow-circle-up": "\uf0aa", + "fa-arrow-circle-down": "\uf0ab", + "fa-globe": "\uf0ac", + "fa-wrench": "\uf0ad", + "fa-tasks": "\uf0ae", + "fa-filter": "\uf0b0", + "fa-briefcase": "\uf0b1", + "fa-arrows-alt": "\uf0b2", + "fa-group": "\uf0c0", + "fa-users": "\uf0c0", + "fa-chain": "\uf0c1", + "fa-link": "\uf0c1", + "fa-cloud": "\uf0c2", + "fa-flask": "\uf0c3", + "fa-cut": "\uf0c4", + "fa-scissors": "\uf0c4", + "fa-copy": "\uf0c5", + "fa-files-o": "\uf0c5", + "fa-paperclip": "\uf0c6", + "fa-save": "\uf0c7", + "fa-floppy-o": "\uf0c7", + "fa-square": "\uf0c8", + "fa-navicon": "\uf0c9", + "fa-reorder": "\uf0c9", + "fa-bars": "\uf0c9", + "fa-list-ul": "\uf0ca", + "fa-list-ol": "\uf0cb", + "fa-strikethrough": "\uf0cc", + "fa-underline": "\uf0cd", + "fa-table": "\uf0ce", + "fa-magic": "\uf0d0", + "fa-truck": "\uf0d1", + "fa-pinterest": "\uf0d2", + "fa-pinterest-square": "\uf0d3", + "fa-google-plus-square": "\uf0d4", + "fa-google-plus": "\uf0d5", + "fa-money": "\uf0d6", + "fa-caret-down": "\uf0d7", + "fa-caret-up": "\uf0d8", + "fa-caret-left": "\uf0d9", + "fa-caret-right": "\uf0da", + "fa-columns": "\uf0db", + "fa-unsorted": "\uf0dc", + "fa-sort": "\uf0dc", + "fa-sort-down": "\uf0dd", + "fa-sort-desc": "\uf0dd", + "fa-sort-up": "\uf0de", + "fa-sort-asc": "\uf0de", + "fa-envelope": "\uf0e0", + "fa-linkedin": "\uf0e1", + "fa-rotate-left": "\uf0e2", + "fa-undo": "\uf0e2", + "fa-legal": "\uf0e3", + "fa-gavel": "\uf0e3", + "fa-dashboard": "\uf0e4", + "fa-tachometer": "\uf0e4", + "fa-comment-o": "\uf0e5", + "fa-comments-o": "\uf0e6", + "fa-flash": "\uf0e7", + "fa-bolt": "\uf0e7", + "fa-sitemap": "\uf0e8", + "fa-umbrella": "\uf0e9", + "fa-paste": "\uf0ea", + "fa-clipboard": "\uf0ea", + "fa-lightbulb-o": "\uf0eb", + "fa-exchange": "\uf0ec", + "fa-cloud-download": "\uf0ed", + "fa-cloud-upload": "\uf0ee", + "fa-user-md": "\uf0f0", + "fa-stethoscope": "\uf0f1", + "fa-suitcase": "\uf0f2", + "fa-bell": "\uf0f3", + "fa-coffee": "\uf0f4", + "fa-cutlery": "\uf0f5", + "fa-file-text-o": "\uf0f6", + "fa-building-o": "\uf0f7", + "fa-hospital-o": "\uf0f8", + "fa-ambulance": "\uf0f9", + "fa-medkit": "\uf0fa", + "fa-fighter-jet": "\uf0fb", + "fa-beer": "\uf0fc", + "fa-h-square": "\uf0fd", + "fa-plus-square": "\uf0fe", + "fa-angle-double-left": "\uf100", + "fa-angle-double-right": "\uf101", + "fa-angle-double-up": "\uf102", + "fa-angle-double-down": "\uf103", + "fa-angle-left": "\uf104", + "fa-angle-right": "\uf105", + "fa-angle-up": "\uf106", + "fa-angle-down": "\uf107", + "fa-desktop": "\uf108", + "fa-laptop": "\uf109", + "fa-tablet": "\uf10a", + "fa-mobile-phone": "\uf10b", + "fa-mobile": "\uf10b", + "fa-circle-o": "\uf10c", + "fa-quote-left": "\uf10d", + "fa-quote-right": "\uf10e", + "fa-spinner": "\uf110", + "fa-circle": "\uf111", + "fa-mail-reply": "\uf112", + "fa-reply": "\uf112", + "fa-github-alt": "\uf113", + "fa-folder-o": "\uf114", + "fa-folder-open-o": "\uf115", + "fa-smile-o": "\uf118", + "fa-frown-o": "\uf119", + "fa-meh-o": "\uf11a", + "fa-gamepad": "\uf11b", + "fa-keyboard-o": "\uf11c", + "fa-flag-o": "\uf11d", + "fa-flag-checkered": "\uf11e", + "fa-terminal": "\uf120", + "fa-code": "\uf121", + "fa-mail-reply-all": "\uf122", + "fa-reply-all": "\uf122", + "fa-star-half-empty": "\uf123", + "fa-star-half-full": "\uf123", + "fa-star-half-o": "\uf123", + "fa-location-arrow": "\uf124", + "fa-crop": "\uf125", + "fa-code-fork": "\uf126", + "fa-unlink": "\uf127", + "fa-chain-broken": "\uf127", + "fa-question": "\uf128", + "fa-info": "\uf129", + "fa-exclamation": "\uf12a", + "fa-superscript": "\uf12b", + "fa-subscript": "\uf12c", + "fa-eraser": "\uf12d", + "fa-puzzle-piece": "\uf12e", + "fa-microphone": "\uf130", + "fa-microphone-slash": "\uf131", + "fa-shield": "\uf132", + "fa-calendar-o": "\uf133", + "fa-fire-extinguisher": "\uf134", + "fa-rocket": "\uf135", + "fa-maxcdn": "\uf136", + "fa-chevron-circle-left": "\uf137", + "fa-chevron-circle-right": "\uf138", + "fa-chevron-circle-up": "\uf139", + "fa-chevron-circle-down": "\uf13a", + "fa-html5": "\uf13b", + "fa-css3": "\uf13c", + "fa-anchor": "\uf13d", + "fa-unlock-alt": "\uf13e", + "fa-bullseye": "\uf140", + "fa-ellipsis-h": "\uf141", + "fa-ellipsis-v": "\uf142", + "fa-rss-square": "\uf143", + "fa-play-circle": "\uf144", + "fa-ticket": "\uf145", + "fa-minus-square": "\uf146", + "fa-minus-square-o": "\uf147", + "fa-level-up": "\uf148", + "fa-level-down": "\uf149", + "fa-check-square": "\uf14a", + "fa-pencil-square": "\uf14b", + "fa-external-link-square": "\uf14c", + "fa-share-square": "\uf14d", + "fa-compass": "\uf14e", + "fa-toggle-down": "\uf150", + "fa-caret-square-o-down": "\uf150", + "fa-toggle-up": "\uf151", + "fa-caret-square-o-up": "\uf151", + "fa-toggle-right": "\uf152", + "fa-caret-square-o-right": "\uf152", + "fa-euro": "\uf153", + "fa-eur": "\uf153", + "fa-gbp": "\uf154", + "fa-dollar": "\uf155", + "fa-usd": "\uf155", + "fa-rupee": "\uf156", + "fa-inr": "\uf156", + "fa-cny": "\uf157", + "fa-rmb": "\uf157", + "fa-yen": "\uf157", + "fa-jpy": "\uf157", + "fa-ruble": "\uf158", + "fa-rouble": "\uf158", + "fa-rub": "\uf158", + "fa-won": "\uf159", + "fa-krw": "\uf159", + "fa-bitcoin": "\uf15a", + "fa-btc": "\uf15a", + "fa-file": "\uf15b", + "fa-file-text": "\uf15c", + "fa-sort-alpha-asc": "\uf15d", + "fa-sort-alpha-desc": "\uf15e", + "fa-sort-amount-asc": "\uf160", + "fa-sort-amount-desc": "\uf161", + "fa-sort-numeric-asc": "\uf162", + "fa-sort-numeric-desc": "\uf163", + "fa-thumbs-up": "\uf164", + "fa-thumbs-down": "\uf165", + "fa-youtube-square": "\uf166", + "fa-youtube": "\uf167", + "fa-xing": "\uf168", + "fa-xing-square": "\uf169", + "fa-youtube-play": "\uf16a", + "fa-dropbox": "\uf16b", + "fa-stack-overflow": "\uf16c", + "fa-instagram": "\uf16d", + "fa-flickr": "\uf16e", + "fa-adn": "\uf170", + "fa-bitbucket": "\uf171", + "fa-bitbucket-square": "\uf172", + "fa-tumblr": "\uf173", + "fa-tumblr-square": "\uf174", + "fa-long-arrow-down": "\uf175", + "fa-long-arrow-up": "\uf176", + "fa-long-arrow-left": "\uf177", + "fa-long-arrow-right": "\uf178", + "fa-apple": "\uf179", + "fa-windows": "\uf17a", + "fa-android": "\uf17b", + "fa-linux": "\uf17c", + "fa-dribbble": "\uf17d", + "fa-skype": "\uf17e", + "fa-foursquare": "\uf180", + "fa-trello": "\uf181", + "fa-female": "\uf182", + "fa-male": "\uf183", + "fa-gittip": "\uf184", + "fa-gratipay": "\uf184", + "fa-sun-o": "\uf185", + "fa-moon-o": "\uf186", + "fa-archive": "\uf187", + "fa-bug": "\uf188", + "fa-vk": "\uf189", + "fa-weibo": "\uf18a", + "fa-renren": "\uf18b", + "fa-pagelines": "\uf18c", + "fa-stack-exchange": "\uf18d", + "fa-arrow-circle-o-right": "\uf18e", + "fa-arrow-circle-o-left": "\uf190", + "fa-toggle-left": "\uf191", + "fa-caret-square-o-left": "\uf191", + "fa-dot-circle-o": "\uf192", + "fa-wheelchair": "\uf193", + "fa-vimeo-square": "\uf194", + "fa-turkish-lira": "\uf195", + "fa-try": "\uf195", + "fa-plus-square-o": "\uf196", + "fa-space-shuttle": "\uf197", + "fa-slack": "\uf198", + "fa-envelope-square": "\uf199", + "fa-wordpress": "\uf19a", + "fa-openid": "\uf19b", + "fa-institution": "\uf19c", + "fa-bank": "\uf19c", + "fa-university": "\uf19c", + "fa-mortar-board": "\uf19d", + "fa-graduation-cap": "\uf19d", + "fa-yahoo": "\uf19e", + "fa-google": "\uf1a0", + "fa-reddit": "\uf1a1", + "fa-reddit-square": "\uf1a2", + "fa-stumbleupon-circle": "\uf1a3", + "fa-stumbleupon": "\uf1a4", + "fa-delicious": "\uf1a5", + "fa-digg": "\uf1a6", + "fa-pied-piper-pp": "\uf1a7", + "fa-pied-piper-alt": "\uf1a8", + "fa-drupal": "\uf1a9", + "fa-joomla": "\uf1aa", + "fa-language": "\uf1ab", + "fa-fax": "\uf1ac", + "fa-building": "\uf1ad", + "fa-child": "\uf1ae", + "fa-paw": "\uf1b0", + "fa-spoon": "\uf1b1", + "fa-cube": "\uf1b2", + "fa-cubes": "\uf1b3", + "fa-behance": "\uf1b4", + "fa-behance-square": "\uf1b5", + "fa-steam": "\uf1b6", + "fa-steam-square": "\uf1b7", + "fa-recycle": "\uf1b8", + "fa-automobile": "\uf1b9", + "fa-car": "\uf1b9", + "fa-cab": "\uf1ba", + "fa-taxi": "\uf1ba", + "fa-tree": "\uf1bb", + "fa-spotify": "\uf1bc", + "fa-deviantart": "\uf1bd", + "fa-soundcloud": "\uf1be", + "fa-database": "\uf1c0", + "fa-file-pdf-o": "\uf1c1", + "fa-file-word-o": "\uf1c2", + "fa-file-excel-o": "\uf1c3", + "fa-file-powerpoint-o": "\uf1c4", + "fa-file-photo-o": "\uf1c5", + "fa-file-picture-o": "\uf1c5", + "fa-file-image-o": "\uf1c5", + "fa-file-zip-o": "\uf1c6", + "fa-file-archive-o": "\uf1c6", + "fa-file-sound-o": "\uf1c7", + "fa-file-audio-o": "\uf1c7", + "fa-file-movie-o": "\uf1c8", + "fa-file-video-o": "\uf1c8", + "fa-file-code-o": "\uf1c9", + "fa-vine": "\uf1ca", + "fa-codepen": "\uf1cb", + "fa-jsfiddle": "\uf1cc", + "fa-life-bouy": "\uf1cd", + "fa-life-buoy": "\uf1cd", + "fa-life-saver": "\uf1cd", + "fa-support": "\uf1cd", + "fa-life-ring": "\uf1cd", + "fa-circle-o-notch": "\uf1ce", + "fa-ra": "\uf1d0", + "fa-resistance": "\uf1d0", + "fa-rebel": "\uf1d0", + "fa-ge": "\uf1d1", + "fa-empire": "\uf1d1", + "fa-git-square": "\uf1d2", + "fa-git": "\uf1d3", + "fa-y-combinator-square": "\uf1d4", + "fa-yc-square": "\uf1d4", + "fa-hacker-news": "\uf1d4", + "fa-tencent-weibo": "\uf1d5", + "fa-qq": "\uf1d6", + "fa-wechat": "\uf1d7", + "fa-weixin": "\uf1d7", + "fa-send": "\uf1d8", + "fa-paper-plane": "\uf1d8", + "fa-send-o": "\uf1d9", + "fa-paper-plane-o": "\uf1d9", + "fa-history": "\uf1da", + "fa-circle-thin": "\uf1db", + "fa-header": "\uf1dc", + "fa-paragraph": "\uf1dd", + "fa-sliders": "\uf1de", + "fa-share-alt": "\uf1e0", + "fa-share-alt-square": "\uf1e1", + "fa-bomb": "\uf1e2", + "fa-soccer-ball-o": "\uf1e3", + "fa-futbol-o": "\uf1e3", + "fa-tty": "\uf1e4", + "fa-binoculars": "\uf1e5", + "fa-plug": "\uf1e6", + "fa-slideshare": "\uf1e7", + "fa-twitch": "\uf1e8", + "fa-yelp": "\uf1e9", + "fa-newspaper-o": "\uf1ea", + "fa-wifi": "\uf1eb", + "fa-calculator": "\uf1ec", + "fa-paypal": "\uf1ed", + "fa-google-wallet": "\uf1ee", + "fa-cc-visa": "\uf1f0", + "fa-cc-mastercard": "\uf1f1", + "fa-cc-discover": "\uf1f2", + "fa-cc-amex": "\uf1f3", + "fa-cc-paypal": "\uf1f4", + "fa-cc-stripe": "\uf1f5", + "fa-bell-slash": "\uf1f6", + "fa-bell-slash-o": "\uf1f7", + "fa-trash": "\uf1f8", + "fa-copyright": "\uf1f9", + "fa-at": "\uf1fa", + "fa-eyedropper": "\uf1fb", + "fa-paint-brush": "\uf1fc", + "fa-birthday-cake": "\uf1fd", + "fa-area-chart": "\uf1fe", + "fa-pie-chart": "\uf200", + "fa-line-chart": "\uf201", + "fa-lastfm": "\uf202", + "fa-lastfm-square": "\uf203", + "fa-toggle-off": "\uf204", + "fa-toggle-on": "\uf205", + "fa-bicycle": "\uf206", + "fa-bus": "\uf207", + "fa-ioxhost": "\uf208", + "fa-angellist": "\uf209", + "fa-cc": "\uf20a", + "fa-shekel": "\uf20b", + "fa-sheqel": "\uf20b", + "fa-ils": "\uf20b", + "fa-meanpath": "\uf20c", + "fa-buysellads": "\uf20d", + "fa-connectdevelop": "\uf20e", + "fa-dashcube": "\uf210", + "fa-forumbee": "\uf211", + "fa-leanpub": "\uf212", + "fa-sellsy": "\uf213", + "fa-shirtsinbulk": "\uf214", + "fa-simplybuilt": "\uf215", + "fa-skyatlas": "\uf216", + "fa-cart-plus": "\uf217", + "fa-cart-arrow-down": "\uf218", + "fa-diamond": "\uf219", + "fa-ship": "\uf21a", + "fa-user-secret": "\uf21b", + "fa-motorcycle": "\uf21c", + "fa-street-view": "\uf21d", + "fa-heartbeat": "\uf21e", + "fa-venus": "\uf221", + "fa-mars": "\uf222", + "fa-mercury": "\uf223", + "fa-intersex": "\uf224", + "fa-transgender": "\uf224", + "fa-transgender-alt": "\uf225", + "fa-venus-double": "\uf226", + "fa-mars-double": "\uf227", + "fa-venus-mars": "\uf228", + "fa-mars-stroke": "\uf229", + "fa-mars-stroke-v": "\uf22a", + "fa-mars-stroke-h": "\uf22b", + "fa-neuter": "\uf22c", + "fa-genderless": "\uf22d", + "fa-facebook-official": "\uf230", + "fa-pinterest-p": "\uf231", + "fa-whatsapp": "\uf232", + "fa-server": "\uf233", + "fa-user-plus": "\uf234", + "fa-user-times": "\uf235", + "fa-hotel": "\uf236", + "fa-bed": "\uf236", + "fa-viacoin": "\uf237", + "fa-train": "\uf238", + "fa-subway": "\uf239", + "fa-medium": "\uf23a", + "fa-yc": "\uf23b", + "fa-y-combinator": "\uf23b", + "fa-optin-monster": "\uf23c", + "fa-opencart": "\uf23d", + "fa-expeditedssl": "\uf23e", + "fa-battery-4": "\uf240", + "fa-battery": "\uf240", + "fa-battery-full": "\uf240", + "fa-battery-3": "\uf241", + "fa-battery-three-quarters": "\uf241", + "fa-battery-2": "\uf242", + "fa-battery-half": "\uf242", + "fa-battery-1": "\uf243", + "fa-battery-quarter": "\uf243", + "fa-battery-0": "\uf244", + "fa-battery-empty": "\uf244", + "fa-mouse-pointer": "\uf245", + "fa-i-cursor": "\uf246", + "fa-object-group": "\uf247", + "fa-object-ungroup": "\uf248", + "fa-sticky-note": "\uf249", + "fa-sticky-note-o": "\uf24a", + "fa-cc-jcb": "\uf24b", + "fa-cc-diners-club": "\uf24c", + "fa-clone": "\uf24d", + "fa-balance-scale": "\uf24e", + "fa-hourglass-o": "\uf250", + "fa-hourglass-1": "\uf251", + "fa-hourglass-start": "\uf251", + "fa-hourglass-2": "\uf252", + "fa-hourglass-half": "\uf252", + "fa-hourglass-3": "\uf253", + "fa-hourglass-end": "\uf253", + "fa-hourglass": "\uf254", + "fa-hand-grab-o": "\uf255", + "fa-hand-rock-o": "\uf255", + "fa-hand-stop-o": "\uf256", + "fa-hand-paper-o": "\uf256", + "fa-hand-scissors-o": "\uf257", + "fa-hand-lizard-o": "\uf258", + "fa-hand-spock-o": "\uf259", + "fa-hand-pointer-o": "\uf25a", + "fa-hand-peace-o": "\uf25b", + "fa-trademark": "\uf25c", + "fa-registered": "\uf25d", + "fa-creative-commons": "\uf25e", + "fa-gg": "\uf260", + "fa-gg-circle": "\uf261", + "fa-tripadvisor": "\uf262", + "fa-odnoklassniki": "\uf263", + "fa-odnoklassniki-square": "\uf264", + "fa-get-pocket": "\uf265", + "fa-wikipedia-w": "\uf266", + "fa-safari": "\uf267", + "fa-chrome": "\uf268", + "fa-firefox": "\uf269", + "fa-opera": "\uf26a", + "fa-internet-explorer": "\uf26b", + "fa-tv": "\uf26c", + "fa-television": "\uf26c", + "fa-contao": "\uf26d", + "fa-500px": "\uf26e", + "fa-amazon": "\uf270", + "fa-calendar-plus-o": "\uf271", + "fa-calendar-minus-o": "\uf272", + "fa-calendar-times-o": "\uf273", + "fa-calendar-check-o": "\uf274", + "fa-industry": "\uf275", + "fa-map-pin": "\uf276", + "fa-map-signs": "\uf277", + "fa-map-o": "\uf278", + "fa-map": "\uf279", + "fa-commenting": "\uf27a", + "fa-commenting-o": "\uf27b", + "fa-houzz": "\uf27c", + "fa-vimeo": "\uf27d", + "fa-black-tie": "\uf27e", + "fa-fonticons": "\uf280", + "fa-reddit-alien": "\uf281", + "fa-edge": "\uf282", + "fa-credit-card-alt": "\uf283", + "fa-codiepie": "\uf284", + "fa-modx": "\uf285", + "fa-fort-awesome": "\uf286", + "fa-usb": "\uf287", + "fa-product-hunt": "\uf288", + "fa-mixcloud": "\uf289", + "fa-scribd": "\uf28a", + "fa-pause-circle": "\uf28b", + "fa-pause-circle-o": "\uf28c", + "fa-stop-circle": "\uf28d", + "fa-stop-circle-o": "\uf28e", + "fa-shopping-bag": "\uf290", + "fa-shopping-basket": "\uf291", + "fa-hashtag": "\uf292", + "fa-bluetooth": "\uf293", + "fa-bluetooth-b": "\uf294", + "fa-percent": "\uf295", + "fa-gitlab": "\uf296", + "fa-wpbeginner": "\uf297", + "fa-wpforms": "\uf298", + "fa-envira": "\uf299", + "fa-universal-access": "\uf29a", + "fa-wheelchair-alt": "\uf29b", + "fa-question-circle-o": "\uf29c", + "fa-blind": "\uf29d", + "fa-audio-description": "\uf29e", + "fa-volume-control-phone": "\uf2a0", + "fa-braille": "\uf2a1", + "fa-assistive-listening-systems": "\uf2a2", + "fa-asl-interpreting": "\uf2a3", + "fa-american-sign-language-interpreting": "\uf2a3", + "fa-deafness": "\uf2a4", + "fa-hard-of-hearing": "\uf2a4", + "fa-deaf": "\uf2a4", + "fa-glide": "\uf2a5", + "fa-glide-g": "\uf2a6", + "fa-signing": "\uf2a7", + "fa-sign-language": "\uf2a7", + "fa-low-vision": "\uf2a8", + "fa-viadeo": "\uf2a9", + "fa-viadeo-square": "\uf2aa", + "fa-snapchat": "\uf2ab", + "fa-snapchat-ghost": "\uf2ac", + "fa-snapchat-square": "\uf2ad", + "fa-pied-piper": "\uf2ae", + "fa-first-order": "\uf2b0", + "fa-yoast": "\uf2b1", + "fa-themeisle": "\uf2b2", + "fa-google-plus-circle": "\uf2b3", + "fa-google-plus-official": "\uf2b3", + "fa-fa": "\uf2b4", + "fa-font-awesome": "\uf2b4", + "fa-handshake-o": "\uf2b5", + "fa-envelope-open": "\uf2b6", + "fa-envelope-open-o": "\uf2b7", + "fa-linode": "\uf2b8", + "fa-address-book": "\uf2b9", + "fa-address-book-o": "\uf2ba", + "fa-vcard": "\uf2bb", + "fa-address-card": "\uf2bb", + "fa-vcard-o": "\uf2bc", + "fa-address-card-o": "\uf2bc", + "fa-user-circle": "\uf2bd", + "fa-user-circle-o": "\uf2be", + "fa-user-o": "\uf2c0", + "fa-id-badge": "\uf2c1", + "fa-drivers-license": "\uf2c2", + "fa-id-card": "\uf2c2", + "fa-drivers-license-o": "\uf2c3", + "fa-id-card-o": "\uf2c3", + "fa-quora": "\uf2c4", + "fa-free-code-camp": "\uf2c5", + "fa-telegram": "\uf2c6", + "fa-thermometer-4": "\uf2c7", + "fa-thermometer": "\uf2c7", + "fa-thermometer-full": "\uf2c7", + "fa-thermometer-3": "\uf2c8", + "fa-thermometer-three-quarters": "\uf2c8", + "fa-thermometer-2": "\uf2c9", + "fa-thermometer-half": "\uf2c9", + "fa-thermometer-1": "\uf2ca", + "fa-thermometer-quarter": "\uf2ca", + "fa-thermometer-0": "\uf2cb", + "fa-thermometer-empty": "\uf2cb", + "fa-shower": "\uf2cc", + "fa-bathtub": "\uf2cd", + "fa-s15": "\uf2cd", + "fa-bath": "\uf2cd", + "fa-podcast": "\uf2ce", + "fa-window-maximize": "\uf2d0", + "fa-window-minimize": "\uf2d1", + "fa-window-restore": "\uf2d2", + "fa-times-rectangle": "\uf2d3", + "fa-window-close": "\uf2d3", + "fa-times-rectangle-o": "\uf2d4", + "fa-window-close-o": "\uf2d4", + "fa-bandcamp": "\uf2d5", + "fa-grav": "\uf2d6", + "fa-etsy": "\uf2d7", + "fa-imdb": "\uf2d8", + "fa-ravelry": "\uf2d9", + "fa-eercast": "\uf2da", + "fa-microchip": "\uf2db", + "fa-snowflake-o": "\uf2dc", + "fa-superpowers": "\uf2dd", + "fa-wpexplorer": "\uf2de", + "fa-meetup": "\uf2e0" + }; + + var iconList = []; + var isUsed = {}; + Object.keys(iconMap).forEach(function(icon) { + var unicode = iconMap[icon]; + // skip icons with a same unicode + if (isUsed[unicode] !== true) { + iconList.push(icon); + isUsed[unicode] = true; + } + }); + isUsed = undefined; + + return { + getIconUnicode: function(name) { + return iconMap[name]; + }, + getIconList: function() { + return iconList; + }, + } +})(); diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index ce8441a86..b67ae87f7 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -174,6 +174,7 @@ RED.nodes = (function() { }, setIconSets: function(sets) { iconSets = sets; + iconSets["font-awesome"] = RED.nodes.fontAwesome.getIconList(); }, getIconSets: function() { return iconSets; diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js index 457ba5638..7f6234ba8 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js @@ -498,7 +498,8 @@ RED.diff = (function() { nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - $('
',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer); + var iconPath = RED.utils.separateIconPath(icon_url); + RED.utils.createIconElement(iconPath.module, iconPath.file, iconContainer, false); return nodeDiv; } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js index 18e9e3ec5..c61beebf8 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js @@ -750,7 +750,7 @@ RED.editor = (function() { iconDiv.data('icon',icon_url) nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - $('
',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer); + RED.utils.createIconElement(moduleName, icon, iconContainer, true); if (iconPath.module === moduleName && iconPath.file === icon) { iconDiv.addClass("selected"); @@ -820,7 +820,7 @@ RED.editor = (function() { var icon_url = RED.utils.getNodeIcon(node._def,node); nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - var iconDiv = $('
',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer); + var iconElements = RED.utils.createDynamicIconElement(icon_url, iconContainer); iconButton.click(function(e) { e.preventDefault(); @@ -834,7 +834,7 @@ RED.editor = (function() { showIconPicker(iconRow,node,iconPath,function(newIcon) { $("#node-settings-icon").text(newIcon||""); var icon_url = RED.utils.getNodeIcon(node._def,{type:node.type,icon:newIcon}); - iconDiv.css("backgroundImage","url("+icon_url+")"); + RED.utils.changeIconElement(icon_url, iconElements.image, iconElements.fa); }); }) $('
').text(node.icon).appendTo(iconRow); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js index d3aa044b9..4e7dc7312 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js @@ -130,8 +130,9 @@ RED.palette = (function() { function setIcon(element,sf) { var iconElement = element.find(".palette_icon"); + var faIconElement = element.find("i"); var icon_url = RED.utils.getNodeIcon(sf._def,sf); - iconElement.attr("style", "background-image: url("+icon_url+")"); + RED.utils.changeIconElement(icon_url, iconElement, faIconElement); } function escapeNodeType(nt) { @@ -169,7 +170,7 @@ RED.palette = (function() { if (def.icon) { var icon_url = RED.utils.getNodeIcon(def); var iconContainer = $('
',{class:"palette_icon_container"+(def.align=="right"?" palette_icon_container_right":"")}).appendTo(d); - $('
',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer); + RED.utils.createDynamicIconElement(icon_url, iconContainer); } d.style.backgroundColor = RED.utils.getNodeColor(nt,def); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js index 837f6831e..e5d330813 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js @@ -203,7 +203,8 @@ RED.search = (function() { nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - $('
',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer); + var iconPath = RED.utils.separateIconPath(icon_url); + RED.utils.createIconElement(iconPath.module, iconPath.file, iconContainer, true); var contentDiv = $('
',{class:"red-ui-search-result-description"}).appendTo(div); if (node.z) { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js index 7e3368bad..8689685af 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js @@ -133,7 +133,8 @@ RED.typeSearch = (function() { nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - $('
',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer); + var iconPath = RED.utils.separateIconPath(icon_url); + RED.utils.createIconElement(iconPath.module, iconPath.file, iconContainer, false); if (def.inputs > 0) { $('
',{class:"red-ui-search-result-node-port"}).appendTo(nodeDiv); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js index bdfd2088b..a39781a40 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js @@ -706,7 +706,11 @@ RED.utils = (function() { function separateIconPath(icon) { var result = {module: "", file: ""}; if (icon) { - var index = icon.indexOf('/'); + var index = icon.indexOf('icons/'); + if (index !== -1) { + icon = icon.substring(index+6); + } + index = icon.indexOf('/'); if (index !== -1) { result.module = icon.slice(0, index); result.file = icon.slice(index + 1); @@ -763,7 +767,9 @@ RED.utils = (function() { return RED.settings.apiRootUrl+"icons/node-red/alert.png" } else if (node && node.icon) { var iconPath = separateIconPath(node.icon); - if (isIconExists(iconPath)) { + if (iconPath.module === "font-awesome") { + return node.icon; + } else if (isIconExists(iconPath)) { return RED.settings.apiRootUrl+"icons/" + node.icon; } } @@ -774,7 +780,11 @@ RED.utils = (function() { return RED.settings.apiRootUrl+"icons/node-red/subflow.png"; } } - return RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file; + if (iconPath.module === "font-awesome") { + return iconPath.module+"/"+iconPath.file; + } else { + return RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file; + } } function getNodeLabel(node,defaultLabel) { @@ -882,6 +892,44 @@ RED.utils = (function() { return parts; } + function createIconElement(moduleName, iconName, iconContainer, isLarge) { + if (moduleName === "font-awesome") { + var faLarge = isLarge ? "fa-lg " : ""; + $('').appendTo(iconContainer); + } else { + var iconUrl = RED.settings.apiRootUrl+"icons/"+moduleName+"/"+iconName; + $('
',{class:"palette_icon",style:"background-image: url("+iconUrl+")"}).appendTo(iconContainer); + } + } + + function createDynamicIconElement(iconUrl, iconContainer) { + var imageIconElement = $('
',{class:"palette_icon"}).appendTo(iconContainer); + var faIconElement = $('').appendTo(iconContainer); + var iconPath = separateIconPath(iconUrl); + if (iconPath.module === "font-awesome") { + faIconElement.addClass("palette_icon_fa fa fa-lg fa-fw " + iconPath.file); + } else { + imageIconElement.css("backgroundImage", "url("+iconUrl+")"); + } + var iconElements = { + "image": imageIconElement, + "fa": faIconElement + }; + return iconElements; + } + + function changeIconElement(iconUrl, imageIconElement, faIconElement) { + var iconPath = separateIconPath(iconUrl); + faIconElement.removeClass(); + if (iconPath.module === "font-awesome") { + imageIconElement.hide(); + faIconElement.addClass("palette_icon_fa fa fa-lg fa-fw " + iconPath.file); + } else { + imageIconElement.css("backgroundImage", "url("+iconUrl+")"); + imageIconElement.show(); + } + } + return { createObjectElement: buildMessageElement, getMessageProperty: getMessageProperty, @@ -894,6 +942,9 @@ RED.utils = (function() { getNodeColor: getNodeColor, addSpinnerOverlay: addSpinnerOverlay, decodeObject: decodeObject, - parseContextKey: parseContextKey + parseContextKey: parseContextKey, + createIconElement: createIconElement, + createDynamicIconElement: createDynamicIconElement, + changeIconElement: changeIconElement } })(); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 6e6560418..393dafc7c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -1868,6 +1868,50 @@ RED.view = (function() { RED.touch.radialMenu.show(obj,pos,options); resetMouseVars(); } + + function updateIconAttributes(iconUrl, icon, fontAwesomeIcon, d) { + var isIconImage = true; + if (iconUrl.indexOf("font-awesome/") === 0) { + var iconName = iconUrl.substr(13); + var fontAwesomeUnicode = RED.nodes.fontAwesome.getIconUnicode(iconName); + if (fontAwesomeUnicode) { + isIconImage = false; + fontAwesomeIcon.text(fontAwesomeUnicode); + } else { + var iconPath = RED.utils.getDefaultNodeIcon(d._def, d); + iconUrl = "icons/"+iconPath.module+"/"+iconPath.file; + } + } + if (isIconImage) { + // Hide font-awesome icon. + fontAwesomeIcon.attr("xlink:href",null); + fontAwesomeIcon.text(null); + + var img = new Image(); + img.src = iconUrl; + img.onload = function() { + icon.attr("width",Math.min(img.width,30)); + icon.attr("height",Math.min(img.height,30)); + icon.attr("x",15-Math.min(img.width,30)/2); + icon.attr("xlink:href",iconUrl); + icon.style("display",null); + //if ("right" == d._def.align) { + // icon.attr("x",function(d){return d.w-img.width-1-(d.outputs>0?5:0);}); + // icon_shade.attr("x",function(d){return d.w-30}); + // icon_shade_border.attr("d",function(d){return "M "+(d.w-30)+" 1 l 0 "+(d.h-2);}); + //} + } + } else { + // Hide icon image. + icon.attr("xlink:href",null); + icon.style("display","none"); + + fontAwesomeIcon.attr("xlink:href",iconUrl); + } + + return iconUrl; + } + function redraw() { vis.attr("transform","scale("+scaleFactor+")"); outer.attr("width", space_width*scaleFactor).attr("height", space_height*scaleFactor); @@ -2118,6 +2162,16 @@ RED.view = (function() { .attr("width","30") .attr("height","30"); + var fontAwesomeIcon = icon_group.append("text") + .attr("xlink:href",icon_url) + .attr("class","fa-lg") + .attr("x",15) + .attr("y",21) + .attr("stroke","none") + .attr("fill","#ffffff") + .attr("text-anchor","middle") + .attr("font-family", "FontAwesome"); + var icon_shade_border = icon_group.append("path") .attr("d",function(d) { return "M 30 1 l 0 "+(d.h-2)}) .attr("class","node_icon_shade_border") @@ -2142,18 +2196,7 @@ RED.view = (function() { // icon_shade.attr("width",35); //icon.attr("x",5); //} - var img = new Image(); - img.src = icon_url; - img.onload = function() { - icon.attr("width",Math.min(img.width,30)); - icon.attr("height",Math.min(img.height,30)); - icon.attr("x",15-Math.min(img.width,30)/2); - //if ("right" == d._def.align) { - // icon.attr("x",function(d){return d.w-img.width-1-(d.outputs>0?5:0);}); - // icon_shade.attr("x",function(d){return d.w-30}); - // icon_shade_border.attr("d",function(d){return "M "+(d.w-30)+" 1 l 0 "+(d.h-2);}); - //} - } + updateIconAttributes(icon_url, icon, fontAwesomeIcon, d); //icon.style("pointer-events","none"); icon_group.style("pointer-events","none"); @@ -2292,17 +2335,16 @@ RED.view = (function() { if (d._def.icon) { icon = thisNode.select(".node_icon"); - var current_url = icon.attr("xlink:href"); + var faIcon = thisNode.select(".fa-lg"); + var current_url; + if (icon.attr("xlink:href")) { + current_url = icon.attr("xlink:href"); + } else { + current_url = faIcon.attr("xlink:href"); + } var new_url = RED.utils.getNodeIcon(d._def,d); if (new_url !== current_url) { - icon.attr("xlink:href",new_url); - var img = new Image(); - img.src = new_url; - img.onload = function() { - icon.attr("width",Math.min(img.width,30)); - icon.attr("height",Math.min(img.height,30)); - icon.attr("x",15-Math.min(img.width,30)/2); - } + updateIconAttributes(new_url, icon, faIcon, d); } } diff --git a/packages/node_modules/@node-red/editor-client/src/sass/diff.scss b/packages/node_modules/@node-red/editor-client/src/sass/diff.scss index 48a1492c4..171d14da4 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/diff.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/diff.scss @@ -257,6 +257,11 @@ background-position: 49% 50%; width: 15px; } + .palette_icon_fa { + position: relative; + top: -2.5px; + left: 0px; + } .palette_icon_container { width: 18px; } diff --git a/packages/node_modules/@node-red/editor-client/src/sass/editor.scss b/packages/node_modules/@node-red/editor-client/src/sass/editor.scss index 15f4b7ba2..616fcb916 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/editor.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/editor.scss @@ -57,6 +57,10 @@ .editor-tray-content { overflow: auto; position: relative; + .palette_icon_fa { + top: 6px; + left: 4px; + } } .editor-tray-header { @include disable-selection; @@ -403,6 +407,10 @@ border-color: white; } } + .palette_icon_fa { + top: 6px; + left: 3px; + } } .red-ui-icon-list-module { background: $palette-header-background; diff --git a/packages/node_modules/@node-red/editor-client/src/sass/palette.scss b/packages/node_modules/@node-red/editor-client/src/sass/palette.scss index b81f97740..e74c5c77b 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/palette.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/palette.scss @@ -188,7 +188,12 @@ background-size: contain; background-repeat: no-repeat; } - +.palette_icon_fa { + color: white; + position: absolute; + top: 7px; + left: 3px; +} .palette_node_small { display: inline-block; position: relative; @@ -206,4 +211,8 @@ margin-left: -1px; width: 15px; } + .palette_icon_fa { + top: 2px; + left: 1px; + } } diff --git a/packages/node_modules/@node-red/editor-client/src/sass/search.scss b/packages/node_modules/@node-red/editor-client/src/sass/search.scss index 6e64db8f3..3926d6f5f 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/search.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/search.scss @@ -62,6 +62,11 @@ font-size: 13px; border-left-width: 3px; border-right-width: 3px; + .palette_icon_fa { + position: relative; + top: -2.5px; + left: 0px; + } } .red-ui-search-result-separator { border-bottom: 3px solid #ddd; @@ -145,6 +150,10 @@ display: table; clear: both; } + .palette_icon_fa { + top: 6px; + left: 3px; + } } .red-ui-search-result-node { From 8789d983ed13928dfb931b274b3b85139e35b219 Mon Sep 17 00:00:00 2001 From: nakanishi Date: Fri, 28 Sep 2018 17:07:55 +0900 Subject: [PATCH 2/3] Show icon element with either icon image or fa-icon --- .../@node-red/editor-client/src/js/ui/diff.js | 3 +- .../editor-client/src/js/ui/editor.js | 10 +-- .../editor-client/src/js/ui/palette.js | 7 +- .../editor-client/src/js/ui/search.js | 3 +- .../editor-client/src/js/ui/typeSearch.js | 3 +- .../editor-client/src/js/ui/utils.js | 59 ++++++--------- .../@node-red/editor-client/src/js/ui/view.js | 74 +++++++++---------- 7 files changed, 69 insertions(+), 90 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js index 7f6234ba8..37315974e 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js @@ -498,8 +498,7 @@ RED.diff = (function() { nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - var iconPath = RED.utils.separateIconPath(icon_url); - RED.utils.createIconElement(iconPath.module, iconPath.file, iconContainer, false); + RED.utils.createIconElement(icon_url, iconContainer, false); return nodeDiv; } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js index c61beebf8..8bc91561d 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js @@ -746,11 +746,11 @@ RED.editor = (function() { var iconDiv = $('
',{class:"red-ui-icon-list-icon"}).appendTo(iconList); var nodeDiv = $('
',{class:"red-ui-search-result-node"}).appendTo(iconDiv); var colour = RED.utils.getNodeColor(node.type, node._def); - var icon_url = "icons/"+moduleName+"/"+icon; - iconDiv.data('icon',icon_url) + var icon_url = RED.settings.apiRootUrl+"icons/"+moduleName+"/"+icon; + iconDiv.data('icon',icon_url); nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - RED.utils.createIconElement(moduleName, icon, iconContainer, true); + RED.utils.createIconElement(icon_url, iconContainer, true); if (iconPath.module === moduleName && iconPath.file === icon) { iconDiv.addClass("selected"); @@ -820,7 +820,7 @@ RED.editor = (function() { var icon_url = RED.utils.getNodeIcon(node._def,node); nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - var iconElements = RED.utils.createDynamicIconElement(icon_url, iconContainer); + RED.utils.createIconElement(icon_url, iconContainer, true); iconButton.click(function(e) { e.preventDefault(); @@ -834,7 +834,7 @@ RED.editor = (function() { showIconPicker(iconRow,node,iconPath,function(newIcon) { $("#node-settings-icon").text(newIcon||""); var icon_url = RED.utils.getNodeIcon(node._def,{type:node.type,icon:newIcon}); - RED.utils.changeIconElement(icon_url, iconElements.image, iconElements.fa); + RED.utils.createIconElement(icon_url, iconContainer, true); }); }) $('
').text(node.icon).appendTo(iconRow); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js index 4e7dc7312..e3b91d180 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js @@ -129,10 +129,9 @@ RED.palette = (function() { } function setIcon(element,sf) { - var iconElement = element.find(".palette_icon"); - var faIconElement = element.find("i"); var icon_url = RED.utils.getNodeIcon(sf._def,sf); - RED.utils.changeIconElement(icon_url, iconElement, faIconElement); + var iconContainer = element.find(".palette_icon_container"); + RED.utils.createIconElement(icon_url, iconContainer, true); } function escapeNodeType(nt) { @@ -170,7 +169,7 @@ RED.palette = (function() { if (def.icon) { var icon_url = RED.utils.getNodeIcon(def); var iconContainer = $('
',{class:"palette_icon_container"+(def.align=="right"?" palette_icon_container_right":"")}).appendTo(d); - RED.utils.createDynamicIconElement(icon_url, iconContainer); + RED.utils.createIconElement(icon_url, iconContainer, true); } d.style.backgroundColor = RED.utils.getNodeColor(nt,def); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js index e5d330813..cce7dddf3 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js @@ -203,8 +203,7 @@ RED.search = (function() { nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - var iconPath = RED.utils.separateIconPath(icon_url); - RED.utils.createIconElement(iconPath.module, iconPath.file, iconContainer, true); + RED.utils.createIconElement(icon_url, iconContainer, true); var contentDiv = $('
',{class:"red-ui-search-result-description"}).appendTo(div); if (node.z) { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js index 8689685af..0e0ce98b3 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js @@ -133,8 +133,7 @@ RED.typeSearch = (function() { nodeDiv.css('backgroundColor',colour); var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv); - var iconPath = RED.utils.separateIconPath(icon_url); - RED.utils.createIconElement(iconPath.module, iconPath.file, iconContainer, false); + RED.utils.createIconElement(icon_url, iconContainer, false); if (def.inputs > 0) { $('
',{class:"red-ui-search-result-node-port"}).appendTo(nodeDiv); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js index a39781a40..7c4647045 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js @@ -892,42 +892,33 @@ RED.utils = (function() { return parts; } - function createIconElement(moduleName, iconName, iconContainer, isLarge) { - if (moduleName === "font-awesome") { + /** + * Create or update an icon element and append it to iconContainer. + * @param iconUrl - Url of icon. + * @param iconContainer - icon container element with palette_icon_container class. + * @param isLarge - whether the icon size is large. + */ + function createIconElement(iconUrl, iconContainer, isLarge) { + // Removes the previous icon when icon was changed. + var iconElement = iconContainer.find(".palette_icon"); + if (iconElement.length !== 0) { + iconElement.remove(); + } + var faIconElement = iconContainer.find("i"); + if (faIconElement.length !== 0) { + faIconElement.remove(); + } + + // Show either icon image or font-awesome icon + var iconPath = separateIconPath(iconUrl); + if (iconPath.module === "font-awesome") { + var faIconElement = $('').appendTo(iconContainer); var faLarge = isLarge ? "fa-lg " : ""; - $('').appendTo(iconContainer); - } else { - var iconUrl = RED.settings.apiRootUrl+"icons/"+moduleName+"/"+iconName; - $('
',{class:"palette_icon",style:"background-image: url("+iconUrl+")"}).appendTo(iconContainer); - } - } - - function createDynamicIconElement(iconUrl, iconContainer) { - var imageIconElement = $('
',{class:"palette_icon"}).appendTo(iconContainer); - var faIconElement = $('').appendTo(iconContainer); - var iconPath = separateIconPath(iconUrl); - if (iconPath.module === "font-awesome") { - faIconElement.addClass("palette_icon_fa fa fa-lg fa-fw " + iconPath.file); + faIconElement.addClass("palette_icon_fa fa fa-fw " + faLarge + iconPath.file); } else { + var imageIconElement = $('
',{class:"palette_icon"}).appendTo(iconContainer); imageIconElement.css("backgroundImage", "url("+iconUrl+")"); } - var iconElements = { - "image": imageIconElement, - "fa": faIconElement - }; - return iconElements; - } - - function changeIconElement(iconUrl, imageIconElement, faIconElement) { - var iconPath = separateIconPath(iconUrl); - faIconElement.removeClass(); - if (iconPath.module === "font-awesome") { - imageIconElement.hide(); - faIconElement.addClass("palette_icon_fa fa fa-lg fa-fw " + iconPath.file); - } else { - imageIconElement.css("backgroundImage", "url("+iconUrl+")"); - imageIconElement.show(); - } } return { @@ -943,8 +934,6 @@ RED.utils = (function() { addSpinnerOverlay: addSpinnerOverlay, decodeObject: decodeObject, parseContextKey: parseContextKey, - createIconElement: createIconElement, - createDynamicIconElement: createDynamicIconElement, - changeIconElement: changeIconElement + createIconElement: createIconElement } })(); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 393dafc7c..365f506b2 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -1869,23 +1869,36 @@ RED.view = (function() { resetMouseVars(); } - function updateIconAttributes(iconUrl, icon, fontAwesomeIcon, d) { - var isIconImage = true; + function createIconAttributes(iconUrl, icon_group, d) { + var fontAwesomeUnicode = null; if (iconUrl.indexOf("font-awesome/") === 0) { var iconName = iconUrl.substr(13); var fontAwesomeUnicode = RED.nodes.fontAwesome.getIconUnicode(iconName); - if (fontAwesomeUnicode) { - isIconImage = false; - fontAwesomeIcon.text(fontAwesomeUnicode); - } else { + if (!fontAwesomeUnicode) { var iconPath = RED.utils.getDefaultNodeIcon(d._def, d); - iconUrl = "icons/"+iconPath.module+"/"+iconPath.file; + iconUrl = RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file; } } - if (isIconImage) { - // Hide font-awesome icon. - fontAwesomeIcon.attr("xlink:href",null); - fontAwesomeIcon.text(null); + if (fontAwesomeUnicode) { + // Since Node-RED workspace uses SVG, i tag cannot be used for font-awesome icon. + // On SVG, use text tag as an alternative. + icon_group.append("text") + .attr("xlink:href",iconUrl) + .attr("class","fa-lg") + .attr("x",15) + .attr("y",21) + .attr("stroke","none") + .attr("fill","#ffffff") + .attr("text-anchor","middle") + .attr("font-family", "FontAwesome") + .text(fontAwesomeUnicode); + } else { + var icon = icon_group.append("image") + .attr("xlink:href",iconUrl) + .attr("class","node_icon") + .attr("x",0) + .attr("width","30") + .attr("height","30"); var img = new Image(); img.src = iconUrl; @@ -1901,15 +1914,7 @@ RED.view = (function() { // icon_shade_border.attr("d",function(d){return "M "+(d.w-30)+" 1 l 0 "+(d.h-2);}); //} } - } else { - // Hide icon image. - icon.attr("xlink:href",null); - icon.style("display","none"); - - fontAwesomeIcon.attr("xlink:href",iconUrl); } - - return iconUrl; } function redraw() { @@ -2155,22 +2160,7 @@ RED.view = (function() { .attr("fill-opacity","0.05") .attr("height",function(d){return Math.min(50,d.h-4);}); - var icon = icon_group.append("image") - .attr("xlink:href",icon_url) - .attr("class","node_icon") - .attr("x",0) - .attr("width","30") - .attr("height","30"); - - var fontAwesomeIcon = icon_group.append("text") - .attr("xlink:href",icon_url) - .attr("class","fa-lg") - .attr("x",15) - .attr("y",21) - .attr("stroke","none") - .attr("fill","#ffffff") - .attr("text-anchor","middle") - .attr("font-family", "FontAwesome"); + createIconAttributes(icon_url, icon_group, d); var icon_shade_border = icon_group.append("path") .attr("d",function(d) { return "M 30 1 l 0 "+(d.h-2)}) @@ -2196,8 +2186,6 @@ RED.view = (function() { // icon_shade.attr("width",35); //icon.attr("x",5); //} - updateIconAttributes(icon_url, icon, fontAwesomeIcon, d); - //icon.style("pointer-events","none"); icon_group.style("pointer-events","none"); } @@ -2334,17 +2322,23 @@ RED.view = (function() { }); if (d._def.icon) { - icon = thisNode.select(".node_icon"); + var icon = thisNode.select(".node_icon"); var faIcon = thisNode.select(".fa-lg"); var current_url; - if (icon.attr("xlink:href")) { + if (!icon.empty()) { current_url = icon.attr("xlink:href"); } else { current_url = faIcon.attr("xlink:href"); } var new_url = RED.utils.getNodeIcon(d._def,d); if (new_url !== current_url) { - updateIconAttributes(new_url, icon, faIcon, d); + if (!icon.empty()) { + icon.remove(); + } else { + faIcon.remove(); + } + var iconGroup = thisNode.select(".node_icon_group"); + createIconAttributes(new_url, iconGroup, d); } } From ba49b2c6813f3ac4e29b7ae9155d2d54705b088f Mon Sep 17 00:00:00 2001 From: nakanishi Date: Mon, 1 Oct 2018 18:39:43 +0900 Subject: [PATCH 3/3] Hide brand icons of font-awesome from icon tile --- .../editor-client/src/js/font-awesome.js | 369 +++++++++--------- 1 file changed, 186 insertions(+), 183 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/font-awesome.js b/packages/node_modules/@node-red/editor-client/src/js/font-awesome.js index 0e56ef97c..3f41529dd 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/font-awesome.js +++ b/packages/node_modules/@node-red/editor-client/src/js/font-awesome.js @@ -149,8 +149,6 @@ RED.nodes.fontAwesome = (function() { "fa-arrows-h": "\uf07e", "fa-bar-chart-o": "\uf080", "fa-bar-chart": "\uf080", - "fa-twitter-square": "\uf081", - "fa-facebook-square": "\uf082", "fa-camera-retro": "\uf083", "fa-key": "\uf084", "fa-gears": "\uf085", @@ -161,22 +159,16 @@ RED.nodes.fontAwesome = (function() { "fa-star-half": "\uf089", "fa-heart-o": "\uf08a", "fa-sign-out": "\uf08b", - "fa-linkedin-square": "\uf08c", "fa-thumb-tack": "\uf08d", "fa-external-link": "\uf08e", "fa-sign-in": "\uf090", "fa-trophy": "\uf091", - "fa-github-square": "\uf092", "fa-upload": "\uf093", "fa-lemon-o": "\uf094", "fa-phone": "\uf095", "fa-square-o": "\uf096", "fa-bookmark-o": "\uf097", "fa-phone-square": "\uf098", - "fa-twitter": "\uf099", - "fa-facebook-f": "\uf09a", - "fa-facebook": "\uf09a", - "fa-github": "\uf09b", "fa-unlock": "\uf09c", "fa-credit-card": "\uf09d", "fa-feed": "\uf09e", @@ -223,10 +215,6 @@ RED.nodes.fontAwesome = (function() { "fa-table": "\uf0ce", "fa-magic": "\uf0d0", "fa-truck": "\uf0d1", - "fa-pinterest": "\uf0d2", - "fa-pinterest-square": "\uf0d3", - "fa-google-plus-square": "\uf0d4", - "fa-google-plus": "\uf0d5", "fa-money": "\uf0d6", "fa-caret-down": "\uf0d7", "fa-caret-up": "\uf0d8", @@ -240,7 +228,6 @@ RED.nodes.fontAwesome = (function() { "fa-sort-up": "\uf0de", "fa-sort-asc": "\uf0de", "fa-envelope": "\uf0e0", - "fa-linkedin": "\uf0e1", "fa-rotate-left": "\uf0e2", "fa-undo": "\uf0e2", "fa-legal": "\uf0e3", @@ -294,7 +281,6 @@ RED.nodes.fontAwesome = (function() { "fa-circle": "\uf111", "fa-mail-reply": "\uf112", "fa-reply": "\uf112", - "fa-github-alt": "\uf113", "fa-folder-o": "\uf114", "fa-folder-open-o": "\uf115", "fa-smile-o": "\uf118", @@ -329,13 +315,10 @@ RED.nodes.fontAwesome = (function() { "fa-calendar-o": "\uf133", "fa-fire-extinguisher": "\uf134", "fa-rocket": "\uf135", - "fa-maxcdn": "\uf136", "fa-chevron-circle-left": "\uf137", "fa-chevron-circle-right": "\uf138", "fa-chevron-circle-up": "\uf139", "fa-chevron-circle-down": "\uf13a", - "fa-html5": "\uf13b", - "fa-css3": "\uf13c", "fa-anchor": "\uf13d", "fa-unlock-alt": "\uf13e", "fa-bullseye": "\uf140", @@ -375,8 +358,6 @@ RED.nodes.fontAwesome = (function() { "fa-rub": "\uf158", "fa-won": "\uf159", "fa-krw": "\uf159", - "fa-bitcoin": "\uf15a", - "fa-btc": "\uf15a", "fa-file": "\uf15b", "fa-file-text": "\uf15c", "fa-sort-alpha-asc": "\uf15d", @@ -387,77 +368,32 @@ RED.nodes.fontAwesome = (function() { "fa-sort-numeric-desc": "\uf163", "fa-thumbs-up": "\uf164", "fa-thumbs-down": "\uf165", - "fa-youtube-square": "\uf166", - "fa-youtube": "\uf167", - "fa-xing": "\uf168", - "fa-xing-square": "\uf169", - "fa-youtube-play": "\uf16a", - "fa-dropbox": "\uf16b", - "fa-stack-overflow": "\uf16c", - "fa-instagram": "\uf16d", - "fa-flickr": "\uf16e", - "fa-adn": "\uf170", - "fa-bitbucket": "\uf171", - "fa-bitbucket-square": "\uf172", - "fa-tumblr": "\uf173", - "fa-tumblr-square": "\uf174", "fa-long-arrow-down": "\uf175", "fa-long-arrow-up": "\uf176", "fa-long-arrow-left": "\uf177", "fa-long-arrow-right": "\uf178", - "fa-apple": "\uf179", - "fa-windows": "\uf17a", - "fa-android": "\uf17b", - "fa-linux": "\uf17c", - "fa-dribbble": "\uf17d", - "fa-skype": "\uf17e", - "fa-foursquare": "\uf180", - "fa-trello": "\uf181", "fa-female": "\uf182", "fa-male": "\uf183", - "fa-gittip": "\uf184", - "fa-gratipay": "\uf184", "fa-sun-o": "\uf185", "fa-moon-o": "\uf186", "fa-archive": "\uf187", "fa-bug": "\uf188", - "fa-vk": "\uf189", - "fa-weibo": "\uf18a", - "fa-renren": "\uf18b", - "fa-pagelines": "\uf18c", - "fa-stack-exchange": "\uf18d", "fa-arrow-circle-o-right": "\uf18e", "fa-arrow-circle-o-left": "\uf190", "fa-toggle-left": "\uf191", "fa-caret-square-o-left": "\uf191", "fa-dot-circle-o": "\uf192", "fa-wheelchair": "\uf193", - "fa-vimeo-square": "\uf194", "fa-turkish-lira": "\uf195", "fa-try": "\uf195", "fa-plus-square-o": "\uf196", "fa-space-shuttle": "\uf197", - "fa-slack": "\uf198", "fa-envelope-square": "\uf199", - "fa-wordpress": "\uf19a", - "fa-openid": "\uf19b", "fa-institution": "\uf19c", "fa-bank": "\uf19c", "fa-university": "\uf19c", "fa-mortar-board": "\uf19d", "fa-graduation-cap": "\uf19d", - "fa-yahoo": "\uf19e", - "fa-google": "\uf1a0", - "fa-reddit": "\uf1a1", - "fa-reddit-square": "\uf1a2", - "fa-stumbleupon-circle": "\uf1a3", - "fa-stumbleupon": "\uf1a4", - "fa-delicious": "\uf1a5", - "fa-digg": "\uf1a6", - "fa-pied-piper-pp": "\uf1a7", - "fa-pied-piper-alt": "\uf1a8", - "fa-drupal": "\uf1a9", - "fa-joomla": "\uf1aa", "fa-language": "\uf1ab", "fa-fax": "\uf1ac", "fa-building": "\uf1ad", @@ -466,19 +402,12 @@ RED.nodes.fontAwesome = (function() { "fa-spoon": "\uf1b1", "fa-cube": "\uf1b2", "fa-cubes": "\uf1b3", - "fa-behance": "\uf1b4", - "fa-behance-square": "\uf1b5", - "fa-steam": "\uf1b6", - "fa-steam-square": "\uf1b7", "fa-recycle": "\uf1b8", "fa-automobile": "\uf1b9", "fa-car": "\uf1b9", "fa-cab": "\uf1ba", "fa-taxi": "\uf1ba", "fa-tree": "\uf1bb", - "fa-spotify": "\uf1bc", - "fa-deviantart": "\uf1bd", - "fa-soundcloud": "\uf1be", "fa-database": "\uf1c0", "fa-file-pdf-o": "\uf1c1", "fa-file-word-o": "\uf1c2", @@ -494,29 +423,12 @@ RED.nodes.fontAwesome = (function() { "fa-file-movie-o": "\uf1c8", "fa-file-video-o": "\uf1c8", "fa-file-code-o": "\uf1c9", - "fa-vine": "\uf1ca", - "fa-codepen": "\uf1cb", - "fa-jsfiddle": "\uf1cc", "fa-life-bouy": "\uf1cd", "fa-life-buoy": "\uf1cd", "fa-life-saver": "\uf1cd", "fa-support": "\uf1cd", "fa-life-ring": "\uf1cd", "fa-circle-o-notch": "\uf1ce", - "fa-ra": "\uf1d0", - "fa-resistance": "\uf1d0", - "fa-rebel": "\uf1d0", - "fa-ge": "\uf1d1", - "fa-empire": "\uf1d1", - "fa-git-square": "\uf1d2", - "fa-git": "\uf1d3", - "fa-y-combinator-square": "\uf1d4", - "fa-yc-square": "\uf1d4", - "fa-hacker-news": "\uf1d4", - "fa-tencent-weibo": "\uf1d5", - "fa-qq": "\uf1d6", - "fa-wechat": "\uf1d7", - "fa-weixin": "\uf1d7", "fa-send": "\uf1d8", "fa-paper-plane": "\uf1d8", "fa-send-o": "\uf1d9", @@ -526,28 +438,15 @@ RED.nodes.fontAwesome = (function() { "fa-header": "\uf1dc", "fa-paragraph": "\uf1dd", "fa-sliders": "\uf1de", - "fa-share-alt": "\uf1e0", - "fa-share-alt-square": "\uf1e1", "fa-bomb": "\uf1e2", "fa-soccer-ball-o": "\uf1e3", "fa-futbol-o": "\uf1e3", "fa-tty": "\uf1e4", "fa-binoculars": "\uf1e5", "fa-plug": "\uf1e6", - "fa-slideshare": "\uf1e7", - "fa-twitch": "\uf1e8", - "fa-yelp": "\uf1e9", "fa-newspaper-o": "\uf1ea", "fa-wifi": "\uf1eb", "fa-calculator": "\uf1ec", - "fa-paypal": "\uf1ed", - "fa-google-wallet": "\uf1ee", - "fa-cc-visa": "\uf1f0", - "fa-cc-mastercard": "\uf1f1", - "fa-cc-discover": "\uf1f2", - "fa-cc-amex": "\uf1f3", - "fa-cc-paypal": "\uf1f4", - "fa-cc-stripe": "\uf1f5", "fa-bell-slash": "\uf1f6", "fa-bell-slash-o": "\uf1f7", "fa-trash": "\uf1f8", @@ -559,28 +458,14 @@ RED.nodes.fontAwesome = (function() { "fa-area-chart": "\uf1fe", "fa-pie-chart": "\uf200", "fa-line-chart": "\uf201", - "fa-lastfm": "\uf202", - "fa-lastfm-square": "\uf203", "fa-toggle-off": "\uf204", "fa-toggle-on": "\uf205", "fa-bicycle": "\uf206", "fa-bus": "\uf207", - "fa-ioxhost": "\uf208", - "fa-angellist": "\uf209", "fa-cc": "\uf20a", "fa-shekel": "\uf20b", "fa-sheqel": "\uf20b", "fa-ils": "\uf20b", - "fa-meanpath": "\uf20c", - "fa-buysellads": "\uf20d", - "fa-connectdevelop": "\uf20e", - "fa-dashcube": "\uf210", - "fa-forumbee": "\uf211", - "fa-leanpub": "\uf212", - "fa-sellsy": "\uf213", - "fa-shirtsinbulk": "\uf214", - "fa-simplybuilt": "\uf215", - "fa-skyatlas": "\uf216", "fa-cart-plus": "\uf217", "fa-cart-arrow-down": "\uf218", "fa-diamond": "\uf219", @@ -603,23 +488,13 @@ RED.nodes.fontAwesome = (function() { "fa-mars-stroke-h": "\uf22b", "fa-neuter": "\uf22c", "fa-genderless": "\uf22d", - "fa-facebook-official": "\uf230", - "fa-pinterest-p": "\uf231", - "fa-whatsapp": "\uf232", "fa-server": "\uf233", "fa-user-plus": "\uf234", "fa-user-times": "\uf235", "fa-hotel": "\uf236", "fa-bed": "\uf236", - "fa-viacoin": "\uf237", "fa-train": "\uf238", "fa-subway": "\uf239", - "fa-medium": "\uf23a", - "fa-yc": "\uf23b", - "fa-y-combinator": "\uf23b", - "fa-optin-monster": "\uf23c", - "fa-opencart": "\uf23d", - "fa-expeditedssl": "\uf23e", "fa-battery-4": "\uf240", "fa-battery": "\uf240", "fa-battery-full": "\uf240", @@ -637,8 +512,6 @@ RED.nodes.fontAwesome = (function() { "fa-object-ungroup": "\uf248", "fa-sticky-note": "\uf249", "fa-sticky-note-o": "\uf24a", - "fa-cc-jcb": "\uf24b", - "fa-cc-diners-club": "\uf24c", "fa-clone": "\uf24d", "fa-balance-scale": "\uf24e", "fa-hourglass-o": "\uf250", @@ -661,23 +534,8 @@ RED.nodes.fontAwesome = (function() { "fa-trademark": "\uf25c", "fa-registered": "\uf25d", "fa-creative-commons": "\uf25e", - "fa-gg": "\uf260", - "fa-gg-circle": "\uf261", - "fa-tripadvisor": "\uf262", - "fa-odnoklassniki": "\uf263", - "fa-odnoklassniki-square": "\uf264", - "fa-get-pocket": "\uf265", - "fa-wikipedia-w": "\uf266", - "fa-safari": "\uf267", - "fa-chrome": "\uf268", - "fa-firefox": "\uf269", - "fa-opera": "\uf26a", - "fa-internet-explorer": "\uf26b", "fa-tv": "\uf26c", "fa-television": "\uf26c", - "fa-contao": "\uf26d", - "fa-500px": "\uf26e", - "fa-amazon": "\uf270", "fa-calendar-plus-o": "\uf271", "fa-calendar-minus-o": "\uf272", "fa-calendar-times-o": "\uf273", @@ -689,20 +547,7 @@ RED.nodes.fontAwesome = (function() { "fa-map": "\uf279", "fa-commenting": "\uf27a", "fa-commenting-o": "\uf27b", - "fa-houzz": "\uf27c", - "fa-vimeo": "\uf27d", - "fa-black-tie": "\uf27e", - "fa-fonticons": "\uf280", - "fa-reddit-alien": "\uf281", - "fa-edge": "\uf282", "fa-credit-card-alt": "\uf283", - "fa-codiepie": "\uf284", - "fa-modx": "\uf285", - "fa-fort-awesome": "\uf286", - "fa-usb": "\uf287", - "fa-product-hunt": "\uf288", - "fa-mixcloud": "\uf289", - "fa-scribd": "\uf28a", "fa-pause-circle": "\uf28b", "fa-pause-circle-o": "\uf28c", "fa-stop-circle": "\uf28d", @@ -710,13 +555,7 @@ RED.nodes.fontAwesome = (function() { "fa-shopping-bag": "\uf290", "fa-shopping-basket": "\uf291", "fa-hashtag": "\uf292", - "fa-bluetooth": "\uf293", - "fa-bluetooth-b": "\uf294", "fa-percent": "\uf295", - "fa-gitlab": "\uf296", - "fa-wpbeginner": "\uf297", - "fa-wpforms": "\uf298", - "fa-envira": "\uf299", "fa-universal-access": "\uf29a", "fa-wheelchair-alt": "\uf29b", "fa-question-circle-o": "\uf29c", @@ -730,28 +569,12 @@ RED.nodes.fontAwesome = (function() { "fa-deafness": "\uf2a4", "fa-hard-of-hearing": "\uf2a4", "fa-deaf": "\uf2a4", - "fa-glide": "\uf2a5", - "fa-glide-g": "\uf2a6", "fa-signing": "\uf2a7", "fa-sign-language": "\uf2a7", "fa-low-vision": "\uf2a8", - "fa-viadeo": "\uf2a9", - "fa-viadeo-square": "\uf2aa", - "fa-snapchat": "\uf2ab", - "fa-snapchat-ghost": "\uf2ac", - "fa-snapchat-square": "\uf2ad", - "fa-pied-piper": "\uf2ae", - "fa-first-order": "\uf2b0", - "fa-yoast": "\uf2b1", - "fa-themeisle": "\uf2b2", - "fa-google-plus-circle": "\uf2b3", - "fa-google-plus-official": "\uf2b3", - "fa-fa": "\uf2b4", - "fa-font-awesome": "\uf2b4", "fa-handshake-o": "\uf2b5", "fa-envelope-open": "\uf2b6", "fa-envelope-open-o": "\uf2b7", - "fa-linode": "\uf2b8", "fa-address-book": "\uf2b9", "fa-address-book-o": "\uf2ba", "fa-vcard": "\uf2bb", @@ -766,9 +589,6 @@ RED.nodes.fontAwesome = (function() { "fa-id-card": "\uf2c2", "fa-drivers-license-o": "\uf2c3", "fa-id-card-o": "\uf2c3", - "fa-quora": "\uf2c4", - "fa-free-code-camp": "\uf2c5", - "fa-telegram": "\uf2c6", "fa-thermometer-4": "\uf2c7", "fa-thermometer": "\uf2c7", "fa-thermometer-full": "\uf2c7", @@ -792,14 +612,197 @@ RED.nodes.fontAwesome = (function() { "fa-window-close": "\uf2d3", "fa-times-rectangle-o": "\uf2d4", "fa-window-close-o": "\uf2d4", + "fa-microchip": "\uf2db", + "fa-snowflake-o": "\uf2dc" + }; + + var brandIconMap = { + "fa-twitter-square": "\uf081", + "fa-facebook-square": "\uf082", + "fa-linkedin-square": "\uf08c", + "fa-github-square": "\uf092", + "fa-twitter": "\uf099", + "fa-facebook-f": "\uf09a", + "fa-facebook": "\uf09a", + "fa-github": "\uf09b", + "fa-pinterest": "\uf0d2", + "fa-pinterest-square": "\uf0d3", + "fa-google-plus-square": "\uf0d4", + "fa-google-plus": "\uf0d5", + "fa-linkedin": "\uf0e1", + "fa-github-alt": "\uf113", + "fa-maxcdn": "\uf136", + "fa-html5": "\uf13b", + "fa-css3": "\uf13c", + "fa-btc": "\uf15a", + "fa-bitcoin": "\uf15a", + "fa-youtube-square": "\uf166", + "fa-youtube": "\uf167", + "fa-xing": "\uf168", + "fa-xing-square": "\uf169", + "fa-youtube-play": "\uf16a", + "fa-dropbox": "\uf16b", + "fa-stack-overflow": "\uf16c", + "fa-instagram": "\uf16d", + "fa-flickr": "\uf16e", + "fa-adn": "\uf170", + "fa-bitbucket": "\uf171", + "fa-bitbucket-square": "\uf172", + "fa-tumblr": "\uf173", + "fa-tumblr-square": "\uf174", + "fa-apple": "\uf179", + "fa-windows": "\uf17a", + "fa-android": "\uf17b", + "fa-linux": "\uf17c", + "fa-dribbble": "\uf17d", + "fa-skype": "\uf17e", + "fa-foursquare": "\uf180", + "fa-trello": "\uf181", + "fa-gittip": "\uf184", + "fa-gratipay": "\uf184", + "fa-vk": "\uf189", + "fa-weibo": "\uf18a", + "fa-renren": "\uf18b", + "fa-pagelines": "\uf18c", + "fa-stack-exchange": "\uf18d", + "fa-vimeo-square": "\uf194", + "fa-slack": "\uf198", + "fa-wordpress": "\uf19a", + "fa-openid": "\uf19b", + "fa-yahoo": "\uf19e", + "fa-google": "\uf1a0", + "fa-reddit": "\uf1a1", + "fa-reddit-square": "\uf1a2", + "fa-stumbleupon-circle": "\uf1a3", + "fa-stumbleupon": "\uf1a4", + "fa-delicious": "\uf1a5", + "fa-digg": "\uf1a6", + "fa-pied-piper-pp": "\uf1a7", + "fa-pied-piper-alt": "\uf1a8", + "fa-drupal": "\uf1a9", + "fa-joomla": "\uf1aa", + "fa-behance": "\uf1b4", + "fa-behance-square": "\uf1b5", + "fa-steam": "\uf1b6", + "fa-steam-square": "\uf1b7", + "fa-spotify": "\uf1bc", + "fa-deviantart": "\uf1bd", + "fa-soundcloud": "\uf1be", + "fa-vine": "\uf1ca", + "fa-codepen": "\uf1cb", + "fa-jsfiddle": "\uf1cc", + "fa-ra": "\uf1d0", + "fa-rebel": "\uf1d0", + "fa-resistance": "\uf1d0", + "fa-ge": "\uf1d1", + "fa-empire": "\uf1d1", + "fa-git-square": "\uf1d2", + "fa-git": "\uf1d3", + "fa-yc-square": "\uf1d4", + "fa-hacker-news": "\uf1d4", + "fa-y-combinator-square": "\uf1d4", + "fa-tencent-weibo": "\uf1d5", + "fa-qq": "\uf1d6", + "fa-wechat": "\uf1d7", + "fa-weixin": "\uf1d7", + "fa-share-alt": "\uf1e0", + "fa-share-alt-square": "\uf1e1", + "fa-slideshare": "\uf1e7", + "fa-twitch": "\uf1e8", + "fa-yelp": "\uf1e9", + "fa-paypal": "\uf1ed", + "fa-google-wallet": "\uf1ee", + "fa-cc-visa": "\uf1f0", + "fa-cc-mastercard": "\uf1f1", + "fa-cc-discover": "\uf1f2", + "fa-cc-amex": "\uf1f3", + "fa-cc-paypal": "\uf1f4", + "fa-cc-stripe": "\uf1f5", + "fa-lastfm": "\uf202", + "fa-lastfm-square": "\uf203", + "fa-ioxhost": "\uf208", + "fa-angellist": "\uf209", + "fa-meanpath": "\uf20c", + "fa-buysellads": "\uf20d", + "fa-connectdevelop": "\uf20e", + "fa-dashcube": "\uf210", + "fa-forumbee": "\uf211", + "fa-leanpub": "\uf212", + "fa-sellsy": "\uf213", + "fa-shirtsinbulk": "\uf214", + "fa-simplybuilt": "\uf215", + "fa-skyatlas": "\uf216", + "fa-facebook-official": "\uf230", + "fa-pinterest-p": "\uf231", + "fa-whatsapp": "\uf232", + "fa-viacoin": "\uf237", + "fa-medium": "\uf23a", + "fa-yc": "\uf23b", + "fa-y-combinator": "\uf23b", + "fa-optin-monster": "\uf23c", + "fa-opencart": "\uf23d", + "fa-expeditedssl": "\uf23e", + "fa-cc-jcb": "\uf24b", + "fa-cc-diners-club": "\uf24c", + "fa-gg": "\uf260", + "fa-gg-circle": "\uf261", + "fa-tripadvisor": "\uf262", + "fa-odnoklassniki": "\uf263", + "fa-odnoklassniki-square": "\uf264", + "fa-get-pocket": "\uf265", + "fa-wikipedia-w": "\uf266", + "fa-safari": "\uf267", + "fa-chrome": "\uf268", + "fa-firefox": "\uf269", + "fa-opera": "\uf26a", + "fa-internet-explorer": "\uf26b", + "fa-contao": "\uf26d", + "fa-500px": "\uf26e", + "fa-amazon": "\uf270", + "fa-houzz": "\uf27c", + "fa-vimeo": "\uf27d", + "fa-black-tie": "\uf27e", + "fa-fonticons": "\uf280", + "fa-reddit-alien": "\uf281", + "fa-edge": "\uf282", + "fa-codiepie": "\uf284", + "fa-modx": "\uf285", + "fa-fort-awesome": "\uf286", + "fa-usb": "\uf287", + "fa-product-hunt": "\uf288", + "fa-mixcloud": "\uf289", + "fa-scribd": "\uf28a", + "fa-bluetooth": "\uf293", + "fa-bluetooth-b": "\uf294", + "fa-gitlab": "\uf296", + "fa-wpbeginner": "\uf297", + "fa-wpforms": "\uf298", + "fa-envira": "\uf299", + "fa-glide": "\uf2a5", + "fa-glide-g": "\uf2a6", + "fa-viadeo": "\uf2a9", + "fa-viadeo-square": "\uf2aa", + "fa-snapchat": "\uf2ab", + "fa-snapchat-ghost": "\uf2ac", + "fa-snapchat-square": "\uf2ad", + "fa-pied-piper": "\uf2ae", + "fa-first-order": "\uf2b0", + "fa-yoast": "\uf2b1", + "fa-themeisle": "\uf2b2", + "fa-google-plus-circle": "\uf2b3", + "fa-google-plus-official": "\uf2b3", + "fa-fa": "\uf2b4", + "fa-font-awesome": "\uf2b4", + "fa-linode": "\uf2b8", + "fa-quora": "\uf2c4", + "fa-free-code-camp": "\uf2c5", + "fa-telegram": "\uf2c6", "fa-bandcamp": "\uf2d5", "fa-grav": "\uf2d6", "fa-etsy": "\uf2d7", "fa-imdb": "\uf2d8", "fa-ravelry": "\uf2d9", "fa-eercast": "\uf2da", - "fa-microchip": "\uf2db", - "fa-snowflake-o": "\uf2dc", "fa-superpowers": "\uf2dd", "fa-wpexplorer": "\uf2de", "fa-meetup": "\uf2e0" @@ -819,7 +822,7 @@ RED.nodes.fontAwesome = (function() { return { getIconUnicode: function(name) { - return iconMap[name]; + return iconMap[name] || brandIconMap[name]; }, getIconList: function() { return iconList;