diff --git a/gulpfile.ts b/gulpfile.ts index 93002cbf3..dd8fc7a63 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -20,6 +20,16 @@ import * as mocha from 'gulp-mocha'; import * as replace from 'gulp-replace'; import * as htmlmin from 'gulp-htmlmin'; const uglifyes = require('uglify-es'); +import * as fontawesome from '@fortawesome/fontawesome'; +import * as regular from '@fortawesome/fontawesome-free-regular'; +import * as solid from '@fortawesome/fontawesome-free-solid'; +import * as brands from '@fortawesome/fontawesome-free-brands'; + +// Add icons +fontawesome.library.add(regular); +fontawesome.library.add(solid); +fontawesome.library.add(brands); + import version from './src/version'; const uglify = uglifyComposer(uglifyes, console); @@ -169,7 +179,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 26a953d8c..fe882f0e5 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,10 @@ "format": "gulp format" }, "dependencies": { + "@fortawesome/fontawesome": "^1.0.0", + "@fortawesome/fontawesome-free-brands": "^5.0.0", + "@fortawesome/fontawesome-free-regular": "^5.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 4ad669ade..cb8806c1d 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 716d61cde..cc8ce1ed9 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 51c2a6c13..a5b8d1489 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 145339169..ce026bf05 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/common/tags/url.tag b/src/web/app/common/tags/url.tag index 330acf821..2690afc5d 100644 --- a/src/web/app/common/tags/url.tag +++ b/src/web/app/common/tags/url.tag @@ -1,14 +1,20 @@ -{ schema }//{ hostname }:{ port }{ pathname }{ query }{ hash } + + + { schema }// + { hostname } + :{ port } + { pathname } + { query } + { hash } + %fa:external-link-square-alt% + 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 44f1cadf4..91a71022a 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 f22a5f76e..545bc38ac 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 99ded1b5d..a51a7bebb 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 9ca7fecfe..c8ccc5a30 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 5bfa83982..9bc29054d 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:chart-pie%%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 12c1bee91..55ef6e2ab 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 b37d34736..c2eeb46b5 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 4acb680e4..53fe04700 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 cf563db53..d95b50661 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 55f36e097..50f6c8460 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 78fd62ee8..f17527754 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 1c6ff7c4b..7c0bb0d76 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 5e478f036..529db11af 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 d7855363e..65334ddb2 100644 --- a/src/web/app/desktop/tags/notifications.tag +++ b/src/web/app/desktop/tags/notifications.tag @@ -8,7 +8,10 @@ avatar @@ -16,7 +19,10 @@ avatar @@ -24,7 +30,8 @@ avatar @@ -32,7 +39,7 @@ avatar @@ -40,7 +47,8 @@ avatar @@ -48,7 +56,8 @@ avatar @@ -56,18 +65,24 @@ 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 02aeb922f..44548e418 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 4a9672c1e..6d3b030e0 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 4025f8733..14baa4191 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 baf385fe9..2419a75ca 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:chart-bar%%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 5f00d5cf2..abe998187 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 256cfb790..5b4b3c83e 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 dc63145d7..e1fad7dce 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 eebd62df6..35d0208a0 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 2edae67c1..f8bc49dab 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 2c36c43ac..8350ce07e 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 2cec4f329..da895359d 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 1499e8d7b..93a8dba7e 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 27e86662c..196e7e326 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 6357f86a2..552b43348 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 1fdcc5764..ab923ea9d 100644 --- a/src/web/app/mobile/tags/notification-preview.tag +++ b/src/web/app/mobile/tags/notification-preview.tag @@ -3,48 +3,48 @@ avatar

    { notification.user.name }

    -

    { getPostSummary(notification.post) }

    +

    %fa:quote-left%{ getPostSummary(notification.post) }%fa:quote-right%

    avatar
    -

    { notification.post.user.name }

    -

    { getPostSummary(notification.post.repost) }

    +

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

    +

    %fa:quote-left%{ getPostSummary(notification.post.repost) }%fa:quote-right%

    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 }

    -

    { getPostSummary(notification.post) }

    +

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

    +

    %fa:quote-left%{ getPostSummary(notification.post) }%fa:quote-right%

    diff --git a/src/web/app/mobile/tags/page/drive.tag b/src/web/app/mobile/tags/page/drive.tag index 218960c70..0033ffe65 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:R 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 3798c9434..7b11bcad4 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 1b2a4b1e1..99cc6b29b 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 e66e03177..00ee26512 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 11e8f8cb4..29e98ce09 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 743de0439..1db9c5d66 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 6888229f8..5303ca8d3 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%
    @@ -20,14 +20,14 @@

    ' + I.name + '') }/>

    ver { _VERSION_ } (葵 aoi)

    diff --git a/src/web/app/mobile/tags/page/settings/signin.tag b/src/web/app/mobile/tags/page/settings/signin.tag index a91ebfb14..1a9e63886 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-alt%%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 870eeeb5b..02661d3b6 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:B 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 1abeab492..78ca534eb 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 28071a5ca..ceac56340 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 @@

    @@ -126,7 +126,7 @@ margin 0 8px 0 0 border-radius 6px - i + [data-fa] margin-right 4px .name @@ -208,16 +208,6 @@ @media (min-width 500px) font-size 24px - .link - &:after - content "\f14c" - display inline-block - padding-left 2px - font-family FontAwesome - font-size .9em - font-weight 400 - font-style normal - > mk-url-preview margin-top 8px diff --git a/src/web/app/mobile/tags/post-form.tag b/src/web/app/mobile/tags/post-form.tag index 2912bfdfa..3ac7296f7 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 cb379f66b..dcadc6617 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 000000000..15f8775f0 --- /dev/null +++ b/webpack/module/rules/fa.ts @@ -0,0 +1,60 @@ +/** + * Replace fontawesome symbols + */ + +const StringReplacePlugin = require('string-replace-webpack-plugin'); + +import * as fontawesome from '@fortawesome/fontawesome'; +import * as regular from '@fortawesome/fontawesome-free-regular'; +import * as solid from '@fortawesome/fontawesome-free-solid'; +import * as brands from '@fortawesome/fontawesome-free-brands'; + +// Add icons +fontawesome.library.add(regular); +fontawesome.library.add(solid); +fontawesome.library.add(brands); + +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'; + const classes = []; + let transform = ''; + let name; + + args.forEach(arg => { + if (arg == 'R' || arg == 'S' || arg == 'B') { + prefix = + arg == 'R' ? 'far' : + arg == 'S' ? 'fas' : + arg == 'B' ? 'fab' : + ''; + } else if (arg[0] == '.') { + classes.push('fa-' + arg.substr(1)); + } else if (arg[0] == '-') { + transform = arg.substr(1).split('|').join(' '); + } else { + name = arg; + } + }); + + const icon = fontawesome.icon({ prefix, iconName: name }, { + classes: classes + }); + + if (icon) { + 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 9c1262b3d..79740ce48 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(),