Use FontAwesome as web font instead of vue component (#7469)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * Update yarn.lock * wip * wip
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
import { faAt, faListUl, faEye, faEyeSlash, faBan, faPencilAlt, faComments, faUsers, faMicrophoneSlash, faPlug, faExclamationCircle, faInfoCircle } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faSnowflake, faEnvelope } from '@fortawesome/free-regular-svg-icons';
|
||||
import { i18n } from '@client/i18n';
|
||||
import copyToClipboard from '@client/scripts/copy-to-clipboard';
|
||||
import { host } from '@client/config';
|
||||
@ -121,62 +119,62 @@ export function getUserMenu(user) {
|
||||
}
|
||||
|
||||
let menu = [{
|
||||
icon: faAt,
|
||||
icon: 'fas fa-at',
|
||||
text: i18n.locale.copyUsername,
|
||||
action: () => {
|
||||
copyToClipboard(`@${user.username}@${user.host || host}`);
|
||||
}
|
||||
}, {
|
||||
icon: faInfoCircle,
|
||||
icon: 'fas fa-info-circle',
|
||||
text: i18n.locale.info,
|
||||
action: () => {
|
||||
os.pageWindow(`/user-info/${user.id}`);
|
||||
}
|
||||
}, {
|
||||
icon: faEnvelope,
|
||||
icon: 'fas fa-envelope',
|
||||
text: i18n.locale.sendMessage,
|
||||
action: () => {
|
||||
os.post({ specified: user });
|
||||
}
|
||||
}, meId != user.id ? {
|
||||
type: 'link',
|
||||
icon: faComments,
|
||||
icon: 'fas fa-comments',
|
||||
text: i18n.locale.startMessaging,
|
||||
to: '/my/messaging/' + getAcct(user),
|
||||
} : undefined, null, {
|
||||
icon: faListUl,
|
||||
icon: 'fas fa-list-ul',
|
||||
text: i18n.locale.addToList,
|
||||
action: pushList
|
||||
}, meId != user.id ? {
|
||||
icon: faUsers,
|
||||
icon: 'fas fa-users',
|
||||
text: i18n.locale.inviteToGroup,
|
||||
action: inviteGroup
|
||||
} : undefined] as any;
|
||||
|
||||
if ($i && meId != user.id) {
|
||||
menu = menu.concat([null, {
|
||||
icon: user.isMuted ? faEye : faEyeSlash,
|
||||
icon: user.isMuted ? 'fas fa-eye' : 'fas fa-eye-slash',
|
||||
text: user.isMuted ? i18n.locale.unmute : i18n.locale.mute,
|
||||
action: toggleMute
|
||||
}, {
|
||||
icon: faBan,
|
||||
icon: 'fas fa-ban',
|
||||
text: user.isBlocking ? i18n.locale.unblock : i18n.locale.block,
|
||||
action: toggleBlock
|
||||
}]);
|
||||
|
||||
menu = menu.concat([null, {
|
||||
icon: faExclamationCircle,
|
||||
icon: 'fas fa-exclamation-circle',
|
||||
text: i18n.locale.reportAbuse,
|
||||
action: reportAbuse
|
||||
}]);
|
||||
|
||||
if ($i && ($i.isAdmin || $i.isModerator)) {
|
||||
menu = menu.concat([null, {
|
||||
icon: faMicrophoneSlash,
|
||||
icon: 'fas fa-microphone-slash',
|
||||
text: user.isSilenced ? i18n.locale.unsilence : i18n.locale.silence,
|
||||
action: toggleSilence
|
||||
}, {
|
||||
icon: faSnowflake,
|
||||
icon: 'fas fa-snowflake',
|
||||
text: user.isSuspended ? i18n.locale.unsuspend : i18n.locale.suspend,
|
||||
action: toggleSuspend
|
||||
}]);
|
||||
@ -185,7 +183,7 @@ export function getUserMenu(user) {
|
||||
|
||||
if ($i && meId === user.id) {
|
||||
menu = menu.concat([null, {
|
||||
icon: faPencilAlt,
|
||||
icon: 'fas fa-pencil-alt',
|
||||
text: i18n.locale.editProfile,
|
||||
action: () => {
|
||||
router.push('/settings/profile');
|
||||
@ -195,7 +193,7 @@ export function getUserMenu(user) {
|
||||
|
||||
if (userActions.length > 0) {
|
||||
menu = menu.concat([null, ...userActions.map(action => ({
|
||||
icon: faPlug,
|
||||
icon: 'fas fa-plug',
|
||||
text: action.title,
|
||||
action: () => {
|
||||
action.handler(user);
|
||||
|
@ -3,14 +3,6 @@
|
||||
*/
|
||||
|
||||
import autobind from 'autobind-decorator';
|
||||
import {
|
||||
faMagic,
|
||||
faSquareRootAlt,
|
||||
faAlignLeft,
|
||||
faList,
|
||||
faQuoteRight,
|
||||
faSortNumericUp,
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import { Hpml } from './evaluator';
|
||||
import { funcDefs } from './lib';
|
||||
|
||||
@ -22,13 +14,13 @@ export type Fn = {
|
||||
export type Type = 'string' | 'number' | 'boolean' | 'stringArray' | null;
|
||||
|
||||
export const literalDefs: Record<string, { out: any; category: string; icon: any; }> = {
|
||||
text: { out: 'string', category: 'value', icon: faQuoteRight, },
|
||||
multiLineText: { out: 'string', category: 'value', icon: faAlignLeft, },
|
||||
textList: { out: 'stringArray', category: 'value', icon: faList, },
|
||||
number: { out: 'number', category: 'value', icon: faSortNumericUp, },
|
||||
ref: { out: null, category: 'value', icon: faMagic, },
|
||||
aiScriptVar: { out: null, category: 'value', icon: faMagic, },
|
||||
fn: { out: 'function', category: 'value', icon: faSquareRootAlt, },
|
||||
text: { out: 'string', category: 'value', icon: 'fas fa-quote-right', },
|
||||
multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left', },
|
||||
textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list', },
|
||||
number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up', },
|
||||
ref: { out: null, category: 'value', icon: 'fas fa-magic', },
|
||||
aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic', },
|
||||
fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt', },
|
||||
};
|
||||
|
||||
export const blockDefs = [
|
||||
|
@ -6,27 +6,6 @@ import { Fn, HpmlScope } from '.';
|
||||
import { Expr } from './expr';
|
||||
import * as seedrandom from 'seedrandom';
|
||||
|
||||
import {
|
||||
faShareAlt,
|
||||
faPlus,
|
||||
faMinus,
|
||||
faTimes,
|
||||
faDivide,
|
||||
faQuoteRight,
|
||||
faEquals,
|
||||
faGreaterThan,
|
||||
faLessThan,
|
||||
faGreaterThanEqual,
|
||||
faLessThanEqual,
|
||||
faNotEqual,
|
||||
faDice,
|
||||
faExchangeAlt,
|
||||
faRecycle,
|
||||
faIndent,
|
||||
faCalculator,
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import { faFlag } from '@fortawesome/free-regular-svg-icons';
|
||||
|
||||
// https://stackoverflow.com/questions/38493564/chart-area-background-color-chartjs
|
||||
Chart.pluginService.register({
|
||||
beforeDraw: (chart, easing) => {
|
||||
@ -148,43 +127,43 @@ export function initAiLib(hpml: Hpml) {
|
||||
}
|
||||
|
||||
export const funcDefs: Record<string, { in: any[]; out: any; category: string; icon: any; }> = {
|
||||
if: { in: ['boolean', 0, 0], out: 0, category: 'flow', icon: faShareAlt, },
|
||||
for: { in: ['number', 'function'], out: null, category: 'flow', icon: faRecycle, },
|
||||
not: { in: ['boolean'], out: 'boolean', category: 'logical', icon: faFlag, },
|
||||
or: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: faFlag, },
|
||||
and: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: faFlag, },
|
||||
add: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faPlus, },
|
||||
subtract: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faMinus, },
|
||||
multiply: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faTimes, },
|
||||
divide: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faDivide, },
|
||||
mod: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faDivide, },
|
||||
round: { in: ['number'], out: 'number', category: 'operation', icon: faCalculator, },
|
||||
eq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: faEquals, },
|
||||
notEq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: faNotEqual, },
|
||||
gt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faGreaterThan, },
|
||||
lt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faLessThan, },
|
||||
gtEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faGreaterThanEqual, },
|
||||
ltEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faLessThanEqual, },
|
||||
strLen: { in: ['string'], out: 'number', category: 'text', icon: faQuoteRight, },
|
||||
strPick: { in: ['string', 'number'], out: 'string', category: 'text', icon: faQuoteRight, },
|
||||
strReplace: { in: ['string', 'string', 'string'], out: 'string', category: 'text', icon: faQuoteRight, },
|
||||
strReverse: { in: ['string'], out: 'string', category: 'text', icon: faQuoteRight, },
|
||||
join: { in: ['stringArray', 'string'], out: 'string', category: 'text', icon: faQuoteRight, },
|
||||
stringToNumber: { in: ['string'], out: 'number', category: 'convert', icon: faExchangeAlt, },
|
||||
numberToString: { in: ['number'], out: 'string', category: 'convert', icon: faExchangeAlt, },
|
||||
splitStrByLine: { in: ['string'], out: 'stringArray', category: 'convert', icon: faExchangeAlt, },
|
||||
pick: { in: [null, 'number'], out: null, category: 'list', icon: faIndent, },
|
||||
listLen: { in: [null], out: 'number', category: 'list', icon: faIndent, },
|
||||
rannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: faDice, },
|
||||
dailyRannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: faDice, },
|
||||
seedRannum: { in: [null, 'number', 'number'], out: 'number', category: 'random', icon: faDice, },
|
||||
random: { in: ['number'], out: 'boolean', category: 'random', icon: faDice, },
|
||||
dailyRandom: { in: ['number'], out: 'boolean', category: 'random', icon: faDice, },
|
||||
seedRandom: { in: [null, 'number'], out: 'boolean', category: 'random', icon: faDice, },
|
||||
randomPick: { in: [0], out: 0, category: 'random', icon: faDice, },
|
||||
dailyRandomPick: { in: [0], out: 0, category: 'random', icon: faDice, },
|
||||
seedRandomPick: { in: [null, 0], out: 0, category: 'random', icon: faDice, },
|
||||
DRPWPM: { in: ['stringArray'], out: 'string', category: 'random', icon: faDice, }, // dailyRandomPickWithProbabilityMapping
|
||||
if: { in: ['boolean', 0, 0], out: 0, category: 'flow', icon: 'fas fa-share-alt', },
|
||||
for: { in: ['number', 'function'], out: null, category: 'flow', icon: 'fas fa-recycle', },
|
||||
not: { in: ['boolean'], out: 'boolean', category: 'logical', icon: 'fas fa-flag', },
|
||||
or: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: 'fas fa-flag', },
|
||||
and: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: 'fas fa-flag', },
|
||||
add: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-plus', },
|
||||
subtract: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-minus', },
|
||||
multiply: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-times', },
|
||||
divide: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-divide', },
|
||||
mod: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-divide', },
|
||||
round: { in: ['number'], out: 'number', category: 'operation', icon: 'fas fa-calculator', },
|
||||
eq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: 'fas fa-equals', },
|
||||
notEq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: 'fas fa-not-equal', },
|
||||
gt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-greater-than', },
|
||||
lt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-less-than', },
|
||||
gtEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-greater-than-equal', },
|
||||
ltEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-less-than-equal', },
|
||||
strLen: { in: ['string'], out: 'number', category: 'text', icon: 'fas fa-quote-right', },
|
||||
strPick: { in: ['string', 'number'], out: 'string', category: 'text', icon: 'fas fa-quote-right', },
|
||||
strReplace: { in: ['string', 'string', 'string'], out: 'string', category: 'text', icon: 'fas fa-quote-right', },
|
||||
strReverse: { in: ['string'], out: 'string', category: 'text', icon: 'fas fa-quote-right', },
|
||||
join: { in: ['stringArray', 'string'], out: 'string', category: 'text', icon: 'fas fa-quote-right', },
|
||||
stringToNumber: { in: ['string'], out: 'number', category: 'convert', icon: 'fas fa-exchange-alt', },
|
||||
numberToString: { in: ['number'], out: 'string', category: 'convert', icon: 'fas fa-exchange-alt', },
|
||||
splitStrByLine: { in: ['string'], out: 'stringArray', category: 'convert', icon: 'fas fa-exchange-alt', },
|
||||
pick: { in: [null, 'number'], out: null, category: 'list', icon: 'fas fa-indent', },
|
||||
listLen: { in: [null], out: 'number', category: 'list', icon: 'fas fa-indent', },
|
||||
rannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: 'fas fa-dice', },
|
||||
dailyRannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: 'fas fa-dice', },
|
||||
seedRannum: { in: [null, 'number', 'number'], out: 'number', category: 'random', icon: 'fas fa-dice', },
|
||||
random: { in: ['number'], out: 'boolean', category: 'random', icon: 'fas fa-dice', },
|
||||
dailyRandom: { in: ['number'], out: 'boolean', category: 'random', icon: 'fas fa-dice', },
|
||||
seedRandom: { in: [null, 'number'], out: 'boolean', category: 'random', icon: 'fas fa-dice', },
|
||||
randomPick: { in: [0], out: 0, category: 'random', icon: 'fas fa-dice', },
|
||||
dailyRandomPick: { in: [0], out: 0, category: 'random', icon: 'fas fa-dice', },
|
||||
seedRandomPick: { in: [null, 0], out: 0, category: 'random', icon: 'fas fa-dice', },
|
||||
DRPWPM: { in: ['stringArray'], out: 'string', category: 'random', icon: 'fas fa-dice', }, // dailyRandomPickWithProbabilityMapping
|
||||
};
|
||||
|
||||
export function initHpmlLib(expr: Expr, scope: HpmlScope, randomSeed: string, visitor?: any) {
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { faHistory } from '@fortawesome/free-solid-svg-icons';
|
||||
import * as os from '@client/os';
|
||||
import { i18n } from '@client/i18n';
|
||||
import { router } from '@client/router';
|
||||
@ -37,7 +36,7 @@ export async function search() {
|
||||
// TODO
|
||||
//v.$root.$emit('warp', date);
|
||||
os.dialog({
|
||||
icon: faHistory,
|
||||
icon: 'fas fa-history',
|
||||
iconOnly: true, autoClose: true
|
||||
});
|
||||
return;
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { faUpload, faCloud, faLink } from '@fortawesome/free-solid-svg-icons';
|
||||
import * as os from '@client/os';
|
||||
import { i18n } from '@client/i18n';
|
||||
|
||||
@ -73,15 +72,15 @@ export function selectFile(src: any, label: string | null, multiple = false) {
|
||||
type: 'label'
|
||||
} : undefined, {
|
||||
text: i18n.locale.upload,
|
||||
icon: faUpload,
|
||||
icon: 'fas fa-upload',
|
||||
action: chooseFileFromPc
|
||||
}, {
|
||||
text: i18n.locale.fromDrive,
|
||||
icon: faCloud,
|
||||
icon: 'fas fa-cloud',
|
||||
action: chooseFileFromDrive
|
||||
}, {
|
||||
text: i18n.locale.fromUrl,
|
||||
icon: faLink,
|
||||
icon: 'fas fa-link',
|
||||
action: chooseFileFromUrl
|
||||
}], src);
|
||||
});
|
||||
|
Reference in New Issue
Block a user