mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
feat: move to npm fontawesome dependency and support fa pro (#11820)
* feat: move to npm fontawesome dependency * feat: move shims to a separate file * fix: thin style prefix * feat: proper style and FA pro handling in icon selector * docs: add fontawesome properties to openAPI * fix: default for styles * feat: select all styles by default Turns out browsers lazy-load fonts. So since the actual CSS for each style is small, there is no perf reason for defaulting to free styles for FA pro users. This means they'll have to only change one setting. Still, the option to select styles remains for those who want it. * fix: remove console.log
This commit is contained in:
@@ -10,6 +10,7 @@ const plugins = require('../plugins');
|
||||
const translator = require('../translator');
|
||||
const languages = require('../languages');
|
||||
const { generateToken } = require('../middleware/csrf');
|
||||
const utils = require('../utils');
|
||||
|
||||
const apiController = module.exports;
|
||||
|
||||
@@ -19,6 +20,9 @@ const asset_base_url = nconf.get('asset_base_url');
|
||||
const socketioTransports = nconf.get('socket.io:transports') || ['polling', 'websocket'];
|
||||
const socketioOrigins = nconf.get('socket.io:origins');
|
||||
const websocketAddress = nconf.get('socket.io:address') || '';
|
||||
const fontawesome_pro = nconf.get('fontawesome:pro') || false;
|
||||
const fontawesome_styles = utils.getFontawesomeStyles();
|
||||
const fontawesome_version = utils.getFontawesomeVersion();
|
||||
|
||||
apiController.loadConfig = async function (req) {
|
||||
const config = {
|
||||
@@ -86,6 +90,11 @@ apiController.loadConfig = async function (req) {
|
||||
iconBackgrounds: await user.getIconBackgrounds(req.uid),
|
||||
emailPrompt: meta.config.emailPrompt,
|
||||
useragent: req.useragent,
|
||||
fontawesome: {
|
||||
pro: fontawesome_pro,
|
||||
styles: fontawesome_styles,
|
||||
version: fontawesome_version,
|
||||
},
|
||||
};
|
||||
|
||||
let settings = config;
|
||||
|
||||
Reference in New Issue
Block a user