diff --git a/gulpfile.ts b/gulpfile.ts index 93002cbf37..95aeb6e06b 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -20,6 +20,12 @@ import * as mocha from 'gulp-mocha'; import * as replace from 'gulp-replace'; import * as htmlmin from 'gulp-htmlmin'; const uglifyes = require('uglify-es'); +const fontawesome = require('@fortawesome/fontawesome'); +const solid = require('@fortawesome/fontawesome-free-solid'); + +// Adds all the icons from the Solid style into our library for easy lookup +fontawesome.library.add(solid); + import version from './src/version'; const uglify = uglifyComposer(uglifyes, console); @@ -169,7 +175,8 @@ gulp.task('build:client:pug', [ gulp.src('./src/web/app/base.pug') .pipe(pug({ locals: { - themeColor: constants.themeColor + themeColor: constants.themeColor, + facss: fontawesome.dom.css() } })) .pipe(htmlmin({ diff --git a/package.json b/package.json index 22d74a2206..df82e1f67c 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ "format": "gulp format" }, "dependencies": { + "@fortawesome/fontawesome": "^1.0.0", + "@fortawesome/fontawesome-free-solid": "^5.0.0", "@prezzemolo/rap": "0.1.2", "@prezzemolo/zip": "0.0.3", "@types/bcryptjs": "2.4.1", diff --git a/src/web/app/base.pug b/src/web/app/base.pug index 4ad669ade8..cb8806c1da 100644 --- a/src/web/app/base.pug +++ b/src/web/app/base.pug @@ -21,7 +21,8 @@ html script include ./../../../built/web/assets/safe.js - script(src='https://use.fontawesome.com/db921426cb.js' async) + // FontAwesome style + style #{facss} body noscript: p diff --git a/src/web/app/ch/tags/channel.tag b/src/web/app/ch/tags/channel.tag index 716d61cde4..cc8ce1ed9e 100644 --- a/src/web/app/ch/tags/channel.tag +++ b/src/web/app/ch/tags/channel.tag @@ -244,10 +244,10 @@

>>{ reply.index } ({ reply.user.name }): [x]

- - + +
@@ -269,7 +269,7 @@ display flex > button - > i + > [data-fa] margin-right 0.25em &:last-child diff --git a/src/web/app/common/tags/error.tag b/src/web/app/common/tags/error.tag index 51c2a6c13c..a5b8d14898 100644 --- a/src/web/app/common/tags/error.tag +++ b/src/web/app/common/tags/error.tag @@ -96,17 +96,17 @@ -

%i18n:common.tags.mk-error.troubleshooter.title%

+

%fa:wrench%%i18n:common.tags.mk-error.troubleshooter.title%

-

{ network == null ? '%i18n:common.tags.mk-error.troubleshooter.checking-network%' : '%i18n:common.tags.mk-error.troubleshooter.network%' }

-

{ internet == null ? '%i18n:common.tags.mk-error.troubleshooter.checking-internet%' : '%i18n:common.tags.mk-error.troubleshooter.internet%' }

-

{ server == null ? '%i18n:common.tags.mk-error.troubleshooter.checking-server%' : '%i18n:common.tags.mk-error.troubleshooter.server%' }

+

%fa:check%%fa:times%{ network == null ? '%i18n:common.tags.mk-error.troubleshooter.checking-network%' : '%i18n:common.tags.mk-error.troubleshooter.network%' }

+

%fa:check%%fa:times%{ internet == null ? '%i18n:common.tags.mk-error.troubleshooter.checking-internet%' : '%i18n:common.tags.mk-error.troubleshooter.internet%' }

+

%fa:check%%fa:times%{ server == null ? '%i18n:common.tags.mk-error.troubleshooter.checking-server%' : '%i18n:common.tags.mk-error.troubleshooter.server%' }

%i18n:common.tags.mk-error.troubleshooter.finding%

-

%i18n:common.tags.mk-error.troubleshooter.no-network%
%i18n:common.tags.mk-error.troubleshooter.no-network-desc%

-

%i18n:common.tags.mk-error.troubleshooter.no-internet%
%i18n:common.tags.mk-error.troubleshooter.no-internet-desc%

-

%i18n:common.tags.mk-error.troubleshooter.no-server%
%i18n:common.tags.mk-error.troubleshooter.no-server-desc%

-

%i18n:common.tags.mk-error.troubleshooter.success%
%i18n:common.tags.mk-error.troubleshooter.success-desc%

+

%fa:exclamation-triangle%%i18n:common.tags.mk-error.troubleshooter.no-network%
%i18n:common.tags.mk-error.troubleshooter.no-network-desc%

+

%fa:exclamation-triangle%%i18n:common.tags.mk-error.troubleshooter.no-internet%
%i18n:common.tags.mk-error.troubleshooter.no-internet-desc%

+

%fa:exclamation-triangle%%i18n:common.tags.mk-error.troubleshooter.no-server%
%i18n:common.tags.mk-error.troubleshooter.no-server-desc%

+

%fa:info-circle%%i18n:common.tags.mk-error.troubleshooter.success%
%i18n:common.tags.mk-error.troubleshooter.success-desc%

diff --git a/src/web/app/common/tags/uploader.tag b/src/web/app/common/tags/uploader.tag index 1453391696..ce026bf05e 100644 --- a/src/web/app/common/tags/uploader.tag +++ b/src/web/app/common/tags/uploader.tag @@ -2,7 +2,7 @@
    0 }>
  1. -

    { name }

    +

    %fa:spinner .pluse%{ name }

    %i18n:common.tags.mk-uploader.waiting%{ String(Math.floor(progress.value / 1024)).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') }KB / { String(Math.floor(progress.max / 1024)).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') }KB{ Math.floor((progress.value / progress.max) * 100) }

    @@ -60,7 +60,7 @@ text-overflow ellipsis overflow hidden - > i + > [data-fa] margin-right 4px > .status diff --git a/src/web/app/desktop/scripts/fuck-ad-block.ts b/src/web/app/desktop/scripts/fuck-ad-block.ts index 8be3c80ea1..ddeb600b6e 100644 --- a/src/web/app/desktop/scripts/fuck-ad-block.ts +++ b/src/web/app/desktop/scripts/fuck-ad-block.ts @@ -12,7 +12,7 @@ export default () => { }; function adBlockDetected() { - dialog('広告ブロッカーを無効にしてください', + dialog('%fa:exclamation-triangle%広告ブロッカーを無効にしてください', 'Misskeyは広告を掲載していませんが、広告をブロックする機能が有効だと一部の機能が利用できなかったり、不具合が発生する場合があります。', [{ text: 'OK' diff --git a/src/web/app/desktop/scripts/not-implemented-exception.ts b/src/web/app/desktop/scripts/not-implemented-exception.ts index dd00c7662f..b4660fa62f 100644 --- a/src/web/app/desktop/scripts/not-implemented-exception.ts +++ b/src/web/app/desktop/scripts/not-implemented-exception.ts @@ -1,7 +1,7 @@ import dialog from './dialog'; export default () => { - dialog('Not implemented yet', + dialog('%fa:exclamation-triangle%Not implemented yet', '要求された操作は実装されていません。
    Misskeyの開発に参加する', [{ text: 'OK' }]); diff --git a/src/web/app/desktop/scripts/update-avatar.ts b/src/web/app/desktop/scripts/update-avatar.ts index 356f4e6f9d..fea5db80bb 100644 --- a/src/web/app/desktop/scripts/update-avatar.ts +++ b/src/web/app/desktop/scripts/update-avatar.ts @@ -63,7 +63,7 @@ export default (I, cb, file = null) => { api(I, 'i/update', { avatar_id: file.id }).then(i => { - dialog('アバターを更新しました', + dialog('%fa:info-circle%アバターを更新しました', '新しいアバターが反映されるまで時間がかかる場合があります。', [{ text: 'わかった' @@ -78,7 +78,7 @@ export default (I, cb, file = null) => { } else { const browser = (riot as any).mount(document.body.appendChild(document.createElement('mk-select-file-from-drive-window')), { multiple: false, - title: 'アバターにする画像を選択' + title: '%fa:image%アバターにする画像を選択' })[0]; browser.one('selected', file => { diff --git a/src/web/app/desktop/scripts/update-banner.ts b/src/web/app/desktop/scripts/update-banner.ts index 1996b75642..325775622d 100644 --- a/src/web/app/desktop/scripts/update-banner.ts +++ b/src/web/app/desktop/scripts/update-banner.ts @@ -63,7 +63,7 @@ export default (I, cb, file = null) => { api(I, 'i/update', { banner_id: file.id }).then(i => { - dialog('バナーを更新しました', + dialog('%fa:info-circle%バナーを更新しました', '新しいバナーが反映されるまで時間がかかる場合があります。', [{ text: 'わかりました。' @@ -78,7 +78,7 @@ export default (I, cb, file = null) => { } else { const browser = (riot as any).mount(document.body.appendChild(document.createElement('mk-select-file-from-drive-window')), { multiple: false, - title: 'バナーにする画像を選択' + title: '%fa:image%バナーにする画像を選択' })[0]; browser.one('selected', file => { diff --git a/src/web/app/desktop/tags/big-follow-button.tag b/src/web/app/desktop/tags/big-follow-button.tag index 8897748ae1..cd14d6f4d9 100644 --- a/src/web/app/desktop/tags/big-follow-button.tag +++ b/src/web/app/desktop/tags/big-follow-button.tag @@ -1,6 +1,10 @@ - -
    + +
    %fa:spinner .pluse .fw%
    diff --git a/src/web/app/desktop/tags/home-widgets/access-log.tag b/src/web/app/desktop/tags/home-widgets/access-log.tag index 44f1cadf4b..91a71022a7 100644 --- a/src/web/app/desktop/tags/home-widgets/access-log.tag +++ b/src/web/app/desktop/tags/home-widgets/access-log.tag @@ -1,6 +1,6 @@ -

    %i18n:desktop.tags.mk-access-log-home-widget.title%

    +

    %fa:server%%i18n:desktop.tags.mk-access-log-home-widget.title%

    @@ -27,7 +27,7 @@ color #888 box-shadow 0 1px rgba(0, 0, 0, 0.07) - > i + > [data-fa] margin-right 4px > div diff --git a/src/web/app/desktop/tags/home-widgets/channel.tag b/src/web/app/desktop/tags/home-widgets/channel.tag index f22a5f76ef..545bc38acf 100644 --- a/src/web/app/desktop/tags/home-widgets/channel.tag +++ b/src/web/app/desktop/tags/home-widgets/channel.tag @@ -1,9 +1,9 @@ -

    { +

    %fa:tv%{ channel ? channel.title : '%i18n:desktop.tags.mk-channel-home-widget.title%' }

    - +

    %i18n:desktop.tags.mk-channel-home-widget.get-started%

    @@ -25,7 +25,7 @@ color #888 box-shadow 0 1px rgba(0, 0, 0, 0.07) - > i + > [data-fa] margin-right 4px > button diff --git a/src/web/app/desktop/tags/home-widgets/donation.tag b/src/web/app/desktop/tags/home-widgets/donation.tag index 99ded1b5d4..a51a7bebbb 100644 --- a/src/web/app/desktop/tags/home-widgets/donation.tag +++ b/src/web/app/desktop/tags/home-widgets/donation.tag @@ -1,6 +1,6 @@
    -

    %i18n:desktop.tags.mk-donation-home-widget.title%

    +

    %fa:heart%%i18n:desktop.tags.mk-donation-home-widget.title%

    {'%i18n:desktop.tags.mk-donation-home-widget.text%'.substr(0, '%i18n:desktop.tags.mk-donation-home-widget.text%'.indexOf('{'))}@syuilo{'%i18n:desktop.tags.mk-donation-home-widget.text%'.substr('%i18n:desktop.tags.mk-donation-home-widget.text%'.indexOf('}') + 1)}

    diff --git a/src/web/app/desktop/tags/home-widgets/post-form.tag b/src/web/app/desktop/tags/home-widgets/post-form.tag index 9ca7fecfe7..c8ccc5a30e 100644 --- a/src/web/app/desktop/tags/home-widgets/post-form.tag +++ b/src/web/app/desktop/tags/home-widgets/post-form.tag @@ -2,7 +2,7 @@ -

    %i18n:desktop.tags.mk-post-form-home-widget.title%

    +

    %fa:pencil-alt%%i18n:desktop.tags.mk-post-form-home-widget.title%

    @@ -25,7 +25,7 @@ color #888 box-shadow 0 1px rgba(0, 0, 0, 0.07) - > i + > [data-fa] margin-right 4px > textarea diff --git a/src/web/app/desktop/tags/home-widgets/recommended-polls.tag b/src/web/app/desktop/tags/home-widgets/recommended-polls.tag index 5bfa839820..8b3713caea 100644 --- a/src/web/app/desktop/tags/home-widgets/recommended-polls.tag +++ b/src/web/app/desktop/tags/home-widgets/recommended-polls.tag @@ -1,15 +1,15 @@ -

    %i18n:desktop.tags.mk-recommended-polls-home-widget.title%

    - +

    %fa:pie-chart%%i18n:desktop.tags.mk-recommended-polls-home-widget.title%

    +

    %i18n:desktop.tags.mk-recommended-polls-home-widget.nothing%

    -

    %i18n:common.loading%

    +

    %fa:spinner .pluse .fw%%i18n:common.loading%

    diff --git a/src/web/app/desktop/tags/home-widgets/rss-reader.tag b/src/web/app/desktop/tags/home-widgets/rss-reader.tag index 12c1bee91e..55ef6e2ab1 100644 --- a/src/web/app/desktop/tags/home-widgets/rss-reader.tag +++ b/src/web/app/desktop/tags/home-widgets/rss-reader.tag @@ -1,12 +1,12 @@ -

    RSS

    - +

    %fa:rss-square%RSS

    +
    -

    %i18n:common.loading%

    +

    %fa:spinner .pluse .fw%%i18n:common.loading%

    diff --git a/src/web/app/desktop/tags/home-widgets/server.tag b/src/web/app/desktop/tags/home-widgets/server.tag index b37d347361..c2eeb46b5b 100644 --- a/src/web/app/desktop/tags/home-widgets/server.tag +++ b/src/web/app/desktop/tags/home-widgets/server.tag @@ -1,9 +1,9 @@ -

    %i18n:desktop.tags.mk-server-home-widget.title%

    - +

    %fa:server%%i18n:desktop.tags.mk-server-home-widget.title%

    +
    -

    %i18n:common.loading%

    +

    %fa:spinner .pluse .fw%%i18n:common.loading%

    @@ -31,7 +31,7 @@ color #888 box-shadow 0 1px rgba(0, 0, 0, 0.07) - > i + > [data-fa] margin-right 4px > button @@ -57,7 +57,7 @@ text-align center color #aaa - > i + > [data-fa] margin-right 4px @@ -235,7 +235,7 @@
    -

    CPU

    +

    %fa:microchip%CPU

    { cores } Cores

    { model }

    @@ -261,7 +261,7 @@ &:first-child font-weight bold - > i + > [data-fa] margin-right 4px &:after @@ -292,7 +292,7 @@
    -

    Memory

    +

    %fa:flask%Memory

    Total: { bytesToSize(total, 1) }

    Used: { bytesToSize(used, 1) }

    Free: { bytesToSize(free, 1) }

    @@ -319,7 +319,7 @@ &:first-child font-weight bold - > i + > [data-fa] margin-right 4px &:after @@ -358,7 +358,7 @@
    -

    Storage

    +

    %fa:R hdd%Storage

    Total: { bytesToSize(total, 1) }

    Available: { bytesToSize(available, 1) }

    Used: { bytesToSize(used, 1) }

    @@ -385,7 +385,7 @@ &:first-child font-weight bold - > i + > [data-fa] margin-right 4px &:after diff --git a/src/web/app/desktop/tags/home-widgets/slideshow.tag b/src/web/app/desktop/tags/home-widgets/slideshow.tag index 4acb680e42..53fe047000 100644 --- a/src/web/app/desktop/tags/home-widgets/slideshow.tag +++ b/src/web/app/desktop/tags/home-widgets/slideshow.tag @@ -5,7 +5,7 @@
    - + diff --git a/src/web/app/desktop/tags/home-widgets/user-recommendation.tag b/src/web/app/desktop/tags/home-widgets/user-recommendation.tag index cf563db535..1f38a73210 100644 --- a/src/web/app/desktop/tags/home-widgets/user-recommendation.tag +++ b/src/web/app/desktop/tags/home-widgets/user-recommendation.tag @@ -1,7 +1,7 @@ -

    %i18n:desktop.tags.mk-user-recommendation-home-widget.title%

    - +

    %fa:users%%i18n:desktop.tags.mk-user-recommendation-home-widget.title%

    +

    %i18n:desktop.tags.mk-user-recommendation-home-widget.no-one%

    -

    %i18n:common.loading%

    +

    %fa:spinner .pluse .fw%%i18n:common.loading%

    diff --git a/src/web/app/desktop/tags/home.tag b/src/web/app/desktop/tags/home.tag index 55f36e0977..50f6c84604 100644 --- a/src/web/app/desktop/tags/home.tag +++ b/src/web/app/desktop/tags/home.tag @@ -1,6 +1,6 @@
    - 完了 + %fa:check%完了

    ウィジェットを追加:

    @@ -96,7 +96,7 @@ background darken($theme-color, 10%) transition background 0s ease - > i + > [data-fa] margin-right 8px > div @@ -221,7 +221,7 @@ } if (this.opts.customize) { - dialog('カスタマイズのヒント', + dialog('%fa:info-circle%カスタマイズのヒント', '

    ホームのカスタマイズでは、ウィジェットを追加/削除したり、ドラッグ&ドロップして並べ替えたりすることができます。

    ' + '

    一部のウィジェットは、クリックすることで表示を変更することができます。

    ' + '

    ウィジェットを削除するには、ヘッダーの「ゴミ箱」と書かれたエリアにウィジェットをドラッグ&ドロップします。

    ' + diff --git a/src/web/app/desktop/tags/input-dialog.tag b/src/web/app/desktop/tags/input-dialog.tag index 78fd62ee8b..f175277547 100644 --- a/src/web/app/desktop/tags/input-dialog.tag +++ b/src/web/app/desktop/tags/input-dialog.tag @@ -1,7 +1,7 @@ - { parent.title } + %fa:i-cursor%{ parent.title }
    @@ -19,7 +19,7 @@ > mk-window [data-yield='header'] - > i + > [data-fa] margin-right 4px [data-yield='content'] diff --git a/src/web/app/desktop/tags/messaging/room-window.tag b/src/web/app/desktop/tags/messaging/room-window.tag index 1c6ff7c4bc..7c0bb0d76e 100644 --- a/src/web/app/desktop/tags/messaging/room-window.tag +++ b/src/web/app/desktop/tags/messaging/room-window.tag @@ -1,6 +1,6 @@ - メッセージ: { parent.user.name } + %fa:comments%メッセージ: { parent.user.name } @@ -9,7 +9,7 @@ :scope > mk-window [data-yield='header'] - > i + > [data-fa] margin-right 4px [data-yield='content'] diff --git a/src/web/app/desktop/tags/messaging/window.tag b/src/web/app/desktop/tags/messaging/window.tag index 5e478f0367..529db11af1 100644 --- a/src/web/app/desktop/tags/messaging/window.tag +++ b/src/web/app/desktop/tags/messaging/window.tag @@ -1,6 +1,6 @@ - メッセージ + %fa:comments%メッセージ @@ -9,7 +9,7 @@ :scope > mk-window [data-yield='header'] - > i + > [data-fa] margin-right 4px [data-yield='content'] diff --git a/src/web/app/desktop/tags/notifications.tag b/src/web/app/desktop/tags/notifications.tag index d7855363ea..b65f1a6a65 100644 --- a/src/web/app/desktop/tags/notifications.tag +++ b/src/web/app/desktop/tags/notifications.tag @@ -16,7 +16,7 @@ avatar @@ -24,7 +24,7 @@ avatar @@ -32,7 +32,7 @@ avatar @@ -40,7 +40,7 @@ avatar @@ -48,7 +48,7 @@ avatar @@ -56,18 +56,18 @@ avatar
    -

    { notification._datetext }{ notifications[i + 1]._datetext }

    +

    %fa:angle-up%{ notification._datetext }%fa:angle-down%{ notifications[i + 1]._datetext }

    ありません!

    -

    %i18n:common.loading%

    +

    %fa:spinner .pluse .fw%%i18n:common.loading%

    diff --git a/src/web/app/desktop/tags/pages/entrance.tag b/src/web/app/desktop/tags/pages/entrance.tag index 02aeb922fe..44548e4183 100644 --- a/src/web/app/desktop/tags/pages/entrance.tag +++ b/src/web/app/desktop/tags/pages/entrance.tag @@ -150,7 +150,7 @@ - + %fa:question%

    { user ? user.name : 'アカウント' }

    @@ -194,7 +194,7 @@ &:active color #222 - > i + > [data-fa] padding 14px > .form @@ -295,7 +295,7 @@ - + diff --git a/src/web/app/desktop/tags/pages/post.tag b/src/web/app/desktop/tags/pages/post.tag index 4a9672c1ef..6d3b030e05 100644 --- a/src/web/app/desktop/tags/pages/post.tag +++ b/src/web/app/desktop/tags/pages/post.tag @@ -1,9 +1,9 @@
    - %i18n:desktop.tags.mk-post-page.next% + %fa:angle-up%%i18n:desktop.tags.mk-post-page.next% - %i18n:desktop.tags.mk-post-page.prev% + %fa:angle-down%%i18n:desktop.tags.mk-post-page.prev%
    diff --git a/src/web/app/desktop/tags/search-posts.tag b/src/web/app/desktop/tags/search-posts.tag index 4025f87332..14baa41919 100644 --- a/src/web/app/desktop/tags/search-posts.tag +++ b/src/web/app/desktop/tags/search-posts.tag @@ -2,8 +2,13 @@
    -

    「{ query }」に関する投稿は見つかりませんでした。

    - +

    %fa:search%「{ query }」に関する投稿は見つかりませんでした。

    + + + %fa:moon% + %fa:spinner .pluse .fw% + + diff --git a/src/web/app/desktop/tags/widgets/activity.tag b/src/web/app/desktop/tags/widgets/activity.tag index baf385fe92..e98049e4cd 100644 --- a/src/web/app/desktop/tags/widgets/activity.tag +++ b/src/web/app/desktop/tags/widgets/activity.tag @@ -1,9 +1,9 @@ -

    %i18n:desktop.tags.mk-activity-widget.title%

    - +

    %fa:bar-chart%%i18n:desktop.tags.mk-activity-widget.title%

    +
    -

    %i18n:common.loading%

    +

    %fa:spinner .pluse .fw%%i18n:common.loading%

    diff --git a/src/web/app/desktop/tags/widgets/calendar.tag b/src/web/app/desktop/tags/widgets/calendar.tag index 5f00d5cf29..abe9981873 100644 --- a/src/web/app/desktop/tags/widgets/calendar.tag +++ b/src/web/app/desktop/tags/widgets/calendar.tag @@ -1,8 +1,8 @@ - +

    { '%i18n:desktop.tags.mk-calendar-widget.title%'.replace('{1}', year).replace('{2}', month) }

    - +
    @@ -41,7 +41,7 @@ color #888 box-shadow 0 1px rgba(0, 0, 0, 0.07) - > i + > [data-fa] margin-right 4px > button diff --git a/src/web/app/desktop/tags/window.tag b/src/web/app/desktop/tags/window.tag index 256cfb7900..a47eb60b4c 100644 --- a/src/web/app/desktop/tags/window.tag +++ b/src/web/app/desktop/tags/window.tag @@ -5,8 +5,8 @@

    - - + +
    @@ -171,7 +171,7 @@ &:active color darken(#000, 30%) - > i + > [data-fa] padding 0 width $header-height line-height $header-height diff --git a/src/web/app/dev/tags/new-app-form.tag b/src/web/app/dev/tags/new-app-form.tag index dc63145d71..e1fad7dce9 100644 --- a/src/web/app/dev/tags/new-app-form.tag +++ b/src/web/app/dev/tags/new-app-form.tag @@ -10,13 +10,13 @@
    @@ -71,7 +71,7 @@

    通知を操作する。

    -

    アプリ作成後も変更できますが、新たな権限を付与する場合、その時点で関連付けられているユーザーキーはすべて無効になります。

    +

    %fa:exclamation-triangle%アプリ作成後も変更できますが、新たな権限を付与する場合、その時点で関連付けられているユーザーキーはすべて無効になります。

    @@ -91,7 +91,7 @@ color #616161 font-size 0.95em - > i + > [data-fa] margin-right 0.25em color #96adac @@ -100,7 +100,7 @@ margin 4px 0 font-size 0.8em - > i + > [data-fa] margin-right 0.3em section.permission @@ -141,7 +141,7 @@ font-size 0.8em color #999 - > i + > [data-fa] margin-right 4px [type=text] diff --git a/src/web/app/mobile/tags/drive-folder-selector.tag b/src/web/app/mobile/tags/drive-folder-selector.tag index eebd62df6c..35d0208a07 100644 --- a/src/web/app/mobile/tags/drive-folder-selector.tag +++ b/src/web/app/mobile/tags/drive-folder-selector.tag @@ -2,8 +2,8 @@

    %i18n:mobile.tags.mk-drive-folder-selector.select-folder%

    - - + +
    diff --git a/src/web/app/mobile/tags/drive-selector.tag b/src/web/app/mobile/tags/drive-selector.tag index 2edae67c1b..f8bc49dab0 100644 --- a/src/web/app/mobile/tags/drive-selector.tag +++ b/src/web/app/mobile/tags/drive-selector.tag @@ -2,8 +2,8 @@

    %i18n:mobile.tags.mk-drive-selector.select-file% 0 }>({ files.length })

    - - + +
    diff --git a/src/web/app/mobile/tags/drive.tag b/src/web/app/mobile/tags/drive.tag index 2c36c43ac5..8350ce07e1 100644 --- a/src/web/app/mobile/tags/drive.tag +++ b/src/web/app/mobile/tags/drive.tag @@ -1,16 +1,16 @@ @@ -81,7 +81,7 @@ &:last-child font-weight bold - > i + > [data-fa] margin-right 4px > span diff --git a/src/web/app/mobile/tags/drive/file-viewer.tag b/src/web/app/mobile/tags/drive/file-viewer.tag index 2cec4f329e..21203c8aaf 100644 --- a/src/web/app/mobile/tags/drive/file-viewer.tag +++ b/src/web/app/mobile/tags/drive/file-viewer.tag @@ -1,7 +1,7 @@
    { - + %fa:file%
    { file.properties.width } @@ -23,26 +23,26 @@ { bytesToSize(file.datasize) } - + %fa:R clock%

    - %i18n:mobile.tags.mk-drive-file-viewer.hash% + %fa:hashtag%%i18n:mobile.tags.mk-drive-file-viewer.hash%

    { file.md5 }
    @@ -114,7 +114,7 @@ > .created-at color #bdbdbd - > i + > [data-fa] margin-right 2px > .menu @@ -149,7 +149,7 @@ border-color #444 box-shadow 0 1px 3px rgba(0, 0, 0, 0.075), inset 0 0 5px rgba(0, 0, 0, 0.2) - > i + > [data-fa] margin-right 4px > .hash @@ -167,7 +167,7 @@ color #555 font-size 0.9em - > i + > [data-fa] margin-right 4px > code diff --git a/src/web/app/mobile/tags/drive/file.tag b/src/web/app/mobile/tags/drive/file.tag index 1499e8d7b7..93a8dba7e5 100644 --- a/src/web/app/mobile/tags/drive/file.tag +++ b/src/web/app/mobile/tags/drive/file.tag @@ -15,7 +15,7 @@

    { bytesToSize(file.datasize) }

    - + %fa:R clock%

    @@ -112,7 +112,7 @@ padding 0 color #BDBDBD - > i + > [data-fa] margin-right 2px &[data-is-selected] diff --git a/src/web/app/mobile/tags/drive/folder.tag b/src/web/app/mobile/tags/drive/folder.tag index 27e86662c7..196e7e326b 100644 --- a/src/web/app/mobile/tags/drive/folder.tag +++ b/src/web/app/mobile/tags/drive/folder.tag @@ -1,6 +1,6 @@
    -

    { folder.name }

    +

    %fa:folder%{ folder.name }

    %fa:angle-right%
    diff --git a/src/web/app/mobile/tags/init-following.tag b/src/web/app/mobile/tags/init-following.tag index 6357f86a29..552b43348b 100644 --- a/src/web/app/mobile/tags/init-following.tag +++ b/src/web/app/mobile/tags/init-following.tag @@ -6,9 +6,9 @@

    おすすめのユーザーは見つかりませんでした。

    -

    読み込んでいます

    +

    %fa:spinner .pluse .fw%読み込んでいます

    もっと見る - + diff --git a/src/web/app/mobile/tags/notification-preview.tag b/src/web/app/mobile/tags/notification-preview.tag index 1fdcc57641..0472ca2521 100644 --- a/src/web/app/mobile/tags/notification-preview.tag +++ b/src/web/app/mobile/tags/notification-preview.tag @@ -9,41 +9,41 @@ avatar
    -

    { notification.post.user.name }

    +

    %fa:retweet%{ notification.post.user.name }

    { getPostSummary(notification.post.repost) }

    avatar
    -

    { notification.post.user.name }

    +

    %fa:quote-left%{ notification.post.user.name }

    { getPostSummary(notification.post) }

    avatar
    -

    { notification.user.name }

    +

    %fa:user-plus%{ notification.user.name }

    avatar
    -

    { notification.post.user.name }

    +

    %fa:reply%{ notification.post.user.name }

    { getPostSummary(notification.post) }

    avatar
    -

    { notification.post.user.name }

    +

    %fa:at%{ notification.post.user.name }

    { getPostSummary(notification.post) }

    avatar
    -

    { notification.user.name }

    +

    %fa:pie-chart%{ notification.user.name }

    { getPostSummary(notification.post) }

    diff --git a/src/web/app/mobile/tags/notification.tag b/src/web/app/mobile/tags/notification.tag index 53222b9dbe..e3575a4920 100644 --- a/src/web/app/mobile/tags/notification.tag +++ b/src/web/app/mobile/tags/notification.tag @@ -18,7 +18,7 @@

    - + %fa:retweet% { notification.post.user.name }

    { getPostSummary(notification.post.repost) } @@ -30,7 +30,7 @@

    - + %fa:quote-left% { notification.post.user.name }

    { getPostSummary(notification.post) } @@ -42,7 +42,7 @@

    - + %fa:user-plus% { notification.user.name }

    @@ -53,7 +53,7 @@

    - + %fa:reply% { notification.post.user.name }

    { getPostSummary(notification.post) } @@ -65,7 +65,7 @@

    - + %fa:at% { notification.post.user.name }

    { getPostSummary(notification.post) } @@ -77,7 +77,7 @@

    - + %fa:pie-chart% { notification.user.name }

    { getPostSummary(notification.post) } diff --git a/src/web/app/mobile/tags/notifications.tag b/src/web/app/mobile/tags/notifications.tag index 7406fd95e2..102631cd79 100644 --- a/src/web/app/mobile/tags/notifications.tag +++ b/src/web/app/mobile/tags/notifications.tag @@ -2,14 +2,14 @@
    -

    { notification._datetext }{ notifications[i + 1]._datetext }

    +

    %fa:angle-up%{ notification._datetext }%fa:angle-down%{ notifications[i + 1]._datetext }

    %i18n:mobile.tags.mk-notifications.empty%

    -

    %i18n:common.loading%

    +

    %fa:spinner .pluse .fw%%i18n:common.loading%

    diff --git a/src/web/app/mobile/tags/page/drive.tag b/src/web/app/mobile/tags/page/drive.tag index 218960c702..1d2c595416 100644 --- a/src/web/app/mobile/tags/page/drive.tag +++ b/src/web/app/mobile/tags/page/drive.tag @@ -12,11 +12,11 @@ this.on('mount', () => { document.title = 'Misskey Drive'; - ui.trigger('title', '%i18n:mobile.tags.mk-drive-page.drive%'); + ui.trigger('title', '%fa:cloud%%i18n:mobile.tags.mk-drive-page.drive%'); ui.trigger('func', () => { this.refs.ui.refs.browser.openContextMenu(); - }, 'ellipsis-h'); + }, '%fa:ellipsis-h%'); this.refs.ui.refs.browser.on('begin-fetch', () => { Progress.start(); @@ -37,7 +37,7 @@ history.pushState(null, title, '/i/drive'); document.title = title; - ui.trigger('title', '%i18n:mobile.tags.mk-drive-page.drive%'); + ui.trigger('title', '%fa:cloud%%i18n:mobile.tags.mk-drive-page.drive%'); }); this.refs.ui.refs.browser.on('open-folder', (folder, silent) => { @@ -50,7 +50,7 @@ document.title = title; // TODO: escape html characters in folder.name - ui.trigger('title', '' + folder.name); + ui.trigger('title', '%fa:folder-open%' + folder.name); }); this.refs.ui.refs.browser.on('open-file', (file, silent) => { diff --git a/src/web/app/mobile/tags/page/entrance/signup.tag b/src/web/app/mobile/tags/page/entrance/signup.tag index 3798c94349..7b11bcad4d 100644 --- a/src/web/app/mobile/tags/page/entrance/signup.tag +++ b/src/web/app/mobile/tags/page/entrance/signup.tag @@ -1,6 +1,6 @@ - + diff --git a/src/web/app/mobile/tags/page/home.tag b/src/web/app/mobile/tags/page/home.tag index 1b2a4b1e13..99cc6b29bf 100644 --- a/src/web/app/mobile/tags/page/home.tag +++ b/src/web/app/mobile/tags/page/home.tag @@ -22,12 +22,12 @@ this.on('mount', () => { document.title = 'Misskey' - ui.trigger('title', '%i18n:mobile.tags.mk-home.home%'); + ui.trigger('title', '%fa:home%%i18n:mobile.tags.mk-home.home%'); document.documentElement.style.background = '#313a42'; ui.trigger('func', () => { openPostForm(); - }, 'pencil'); + }, '%fa:pencil-alt%'); Progress.start(); diff --git a/src/web/app/mobile/tags/page/messaging-room.tag b/src/web/app/mobile/tags/page/messaging-room.tag index e66e03177f..00ee265120 100644 --- a/src/web/app/mobile/tags/page/messaging-room.tag +++ b/src/web/app/mobile/tags/page/messaging-room.tag @@ -24,7 +24,7 @@ document.title = `%i18n:mobile.tags.mk-messaging-room-page.message%: ${user.name} | Misskey`; // TODO: ユーザー名をエスケープ - ui.trigger('title', '' + user.name); + ui.trigger('title', '%fa:R comments%' + user.name); }); }); diff --git a/src/web/app/mobile/tags/page/messaging.tag b/src/web/app/mobile/tags/page/messaging.tag index 11e8f8cb48..29e98ce092 100644 --- a/src/web/app/mobile/tags/page/messaging.tag +++ b/src/web/app/mobile/tags/page/messaging.tag @@ -13,7 +13,7 @@ this.on('mount', () => { document.title = 'Misskey | %i18n:mobile.tags.mk-messaging-page.message%'; - ui.trigger('title', '%i18n:mobile.tags.mk-messaging-page.message%'); + ui.trigger('title', '%fa:R comments%%i18n:mobile.tags.mk-messaging-page.message%'); this.refs.ui.refs.index.on('navigate-user', user => { this.page('/i/messaging/' + user.username); diff --git a/src/web/app/mobile/tags/page/notifications.tag b/src/web/app/mobile/tags/page/notifications.tag index 743de04393..1db9c5d661 100644 --- a/src/web/app/mobile/tags/page/notifications.tag +++ b/src/web/app/mobile/tags/page/notifications.tag @@ -14,12 +14,12 @@ this.on('mount', () => { document.title = 'Misskey | %i18n:mobile.tags.mk-notifications-page.notifications%'; - ui.trigger('title', '%i18n:mobile.tags.mk-notifications-page.notifications%'); + ui.trigger('title', '%fa:R bell%%i18n:mobile.tags.mk-notifications-page.notifications%'); document.documentElement.style.background = '#313a42'; ui.trigger('func', () => { this.readAll(); - }, 'check'); + }, '%fa:check%'); Progress.start(); diff --git a/src/web/app/mobile/tags/page/post.tag b/src/web/app/mobile/tags/page/post.tag index 6888229f89..91babd0b15 100644 --- a/src/web/app/mobile/tags/page/post.tag +++ b/src/web/app/mobile/tags/page/post.tag @@ -1,11 +1,11 @@
    - %i18n:mobile.tags.mk-post-page.next% + %fa:angle-up%%i18n:mobile.tags.mk-post-page.next%
    - %i18n:mobile.tags.mk-post-page.prev% + %fa:angle-down%%i18n:mobile.tags.mk-post-page.prev%
    diff --git a/src/web/app/mobile/tags/page/settings/api.tag b/src/web/app/mobile/tags/page/settings/api.tag index 25413e2d80..8de0e96963 100644 --- a/src/web/app/mobile/tags/page/settings/api.tag +++ b/src/web/app/mobile/tags/page/settings/api.tag @@ -11,7 +11,7 @@ this.on('mount', () => { document.title = 'Misskey | API'; - ui.trigger('title', 'API'); + ui.trigger('title', '%fa:key%API'); }); diff --git a/src/web/app/mobile/tags/page/settings/authorized-apps.tag b/src/web/app/mobile/tags/page/settings/authorized-apps.tag index 78efd13e47..8d538eba5d 100644 --- a/src/web/app/mobile/tags/page/settings/authorized-apps.tag +++ b/src/web/app/mobile/tags/page/settings/authorized-apps.tag @@ -11,7 +11,7 @@ this.on('mount', () => { document.title = 'Misskey | %i18n:mobile.tags.mk-authorized-apps-page.application%'; - ui.trigger('title', '%i18n:mobile.tags.mk-authorized-apps-page.application%'); + ui.trigger('title', '%fa:puzzle-piece%%i18n:mobile.tags.mk-authorized-apps-page.application%'); }); diff --git a/src/web/app/mobile/tags/page/settings/profile.tag b/src/web/app/mobile/tags/page/settings/profile.tag index 305f16fec5..8881e95190 100644 --- a/src/web/app/mobile/tags/page/settings/profile.tag +++ b/src/web/app/mobile/tags/page/settings/profile.tag @@ -11,7 +11,7 @@ this.on('mount', () => { document.title = 'Misskey | %i18n:mobile.tags.mk-profile-setting-page.title%'; - ui.trigger('title', '%i18n:mobile.tags.mk-profile-setting-page.title%'); + ui.trigger('title', '%fa:user%%i18n:mobile.tags.mk-profile-setting-page.title%'); document.documentElement.style.background = '#313a42'; }); @@ -19,7 +19,7 @@
    -

    %i18n:mobile.tags.mk-profile-setting.will-be-published%

    +

    %fa:info-circle%%i18n:mobile.tags.mk-profile-setting.will-be-published%

    avatar @@ -49,7 +49,7 @@
    - +
    diff --git a/src/web/app/mobile/tags/page/settings/signin.tag b/src/web/app/mobile/tags/page/settings/signin.tag index a91ebfb140..19aae34736 100644 --- a/src/web/app/mobile/tags/page/settings/signin.tag +++ b/src/web/app/mobile/tags/page/settings/signin.tag @@ -11,7 +11,7 @@ this.on('mount', () => { document.title = 'Misskey | %i18n:mobile.tags.mk-signin-history-page.signin-history%'; - ui.trigger('title', '%i18n:mobile.tags.mk-signin-history-page.signin-history%'); + ui.trigger('title', '%fa:sign-in%%i18n:mobile.tags.mk-signin-history-page.signin-history%'); }); diff --git a/src/web/app/mobile/tags/page/settings/twitter.tag b/src/web/app/mobile/tags/page/settings/twitter.tag index 870eeeb5bc..d8e19cb3e4 100644 --- a/src/web/app/mobile/tags/page/settings/twitter.tag +++ b/src/web/app/mobile/tags/page/settings/twitter.tag @@ -11,7 +11,7 @@ this.on('mount', () => { document.title = 'Misskey | %i18n:mobile.tags.mk-twitter-setting-page.twitter-integration%'; - ui.trigger('title', '%i18n:mobile.tags.mk-twitter-setting-page.twitter-integration%'); + ui.trigger('title', '%fa:twitter%%i18n:mobile.tags.mk-twitter-setting-page.twitter-integration%'); }); diff --git a/src/web/app/mobile/tags/page/user.tag b/src/web/app/mobile/tags/page/user.tag index 1abeab492a..78ca534eb0 100644 --- a/src/web/app/mobile/tags/page/user.tag +++ b/src/web/app/mobile/tags/page/user.tag @@ -20,7 +20,7 @@ Progress.done(); document.title = user.name + ' | Misskey'; // TODO: ユーザー名をエスケープ - ui.trigger('title', '' + user.name); + ui.trigger('title', '%fa:user%' + user.name); }); }); diff --git a/src/web/app/mobile/tags/post-detail.tag b/src/web/app/mobile/tags/post-detail.tag index 28071a5cac..cfc5ee2f40 100644 --- a/src/web/app/mobile/tags/post-detail.tag +++ b/src/web/app/mobile/tags/post-detail.tag @@ -1,7 +1,7 @@
    @@ -15,7 +15,7 @@

    avatar - + %fa:retweet% { post.user.name } がRepost @@ -44,16 +44,16 @@

    diff --git a/src/web/app/mobile/tags/post-form.tag b/src/web/app/mobile/tags/post-form.tag index 2912bfdfa2..a408006949 100644 --- a/src/web/app/mobile/tags/post-form.tag +++ b/src/web/app/mobile/tags/post-form.tag @@ -1,6 +1,6 @@
    - +
    { 1000 - refs.text.value.length } @@ -14,15 +14,15 @@
  2. -
  3. +
  4. %fa:plus%
  5. - - - - + + + +
    diff --git a/src/web/app/status/tags/index.tag b/src/web/app/status/tags/index.tag index cb379f66bc..dcadc66172 100644 --- a/src/web/app/status/tags/index.tag +++ b/src/web/app/status/tags/index.tag @@ -1,6 +1,6 @@

    MisskeyStatus

    -

    %i18n:status.all-systems-maybe-operational%

    +

    %fa:info-circle%%i18n:status.all-systems-maybe-operational%

    @@ -19,7 +19,7 @@ font-size 24px font-weight normal - > i + > [data-fa] font-style normal color #f43b16 @@ -31,7 +31,7 @@ //border solid 1px #99ccb2 border-radius 4px - > i + > [data-fa] margin-right 5px > main diff --git a/webpack/module/rules/fa.ts b/webpack/module/rules/fa.ts new file mode 100644 index 0000000000..57691f9899 --- /dev/null +++ b/webpack/module/rules/fa.ts @@ -0,0 +1,54 @@ +/** + * Replace fontawesome symbols + */ + +const StringReplacePlugin = require('string-replace-webpack-plugin'); + +const fontawesome = require('@fortawesome/fontawesome'); +const solid = require('@fortawesome/fontawesome-free-solid'); + +// Adds all the icons from the Solid style into our library for easy lookup +fontawesome.library.add(solid); + +export default () => ({ + enforce: 'pre', + test: /\.(tag|js|ts)$/, + exclude: /node_modules/, + loader: StringReplacePlugin.replace({ + replacements: [{ + pattern: /%fa:(.+?)%/g, replacement: (_, key) => { + const args = key.split(' '); + let prefix = 'fas'; + let klass = ''; + let transform = ''; + let name; + + args.forEach(arg => { + if (arg == 'R' || arg == 'S') { + prefix = + arg == 'R' ? 'far' : + arg == 'S' ? 'fas' : + ''; + } else if (arg[0] == '.') { + klass += arg.substr(1) + ' '; + } else if (arg[0] == '-') { + transform = arg.substr(1).split('|').join(' '); + } else { + name = arg; + } + }); + + const icon = fontawesome.icon({ prefix, iconName: name }); + + if (icon) { + icon.class = klass; + icon.transform = fontawesome.parse.transform(transform); + return `${icon.html[0]}`; + } else { + console.warn(`'${name}' not found in fa`); + return ''; + } + } + }] + }) +}); diff --git a/webpack/module/rules/index.ts b/webpack/module/rules/index.ts index 9c1262b3d6..79740ce48e 100644 --- a/webpack/module/rules/index.ts +++ b/webpack/module/rules/index.ts @@ -1,4 +1,5 @@ import i18n from './i18n'; +import fa from './fa'; import base64 from './base64'; import themeColor from './theme-color'; import tag from './tag'; @@ -7,6 +8,7 @@ import typescript from './typescript'; export default (lang, locale) => [ i18n(lang, locale), + fa(), base64(), themeColor(), tag(),