From d8dcc4da275230e332fad0eb6ce09703d08aec30 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sat, 1 Sep 2018 23:12:51 +0900 Subject: [PATCH 01/11] Use string interpolation --- src/client/app/auth/views/index.vue | 2 +- src/client/app/boot.js | 2 +- src/client/app/common/scripts/streaming/stream.ts | 4 ++-- src/client/app/common/views/components/autocomplete.vue | 4 ++-- .../views/components/connect-failed.troubleshooter.vue | 2 +- src/client/app/common/views/components/url-preview.vue | 2 +- src/client/app/common/views/directives/autocomplete.ts | 4 ++-- src/client/app/common/views/filters/note.ts | 2 +- src/client/app/common/views/filters/user.ts | 2 +- src/client/app/common/views/pages/follow.vue | 2 +- src/client/app/desktop/views/components/drive.folder.vue | 2 +- src/client/app/desktop/views/components/drive.vue | 4 ++-- src/client/app/desktop/views/components/media-image.vue | 2 +- src/client/app/desktop/views/components/post-form.vue | 6 +++--- src/client/app/desktop/views/pages/drive.vue | 2 +- src/client/app/desktop/views/pages/games/reversi.vue | 4 ++-- src/client/app/desktop/views/pages/messaging-room.vue | 2 +- src/client/app/mobile/views/components/post-form.vue | 6 +++--- src/client/app/mobile/views/components/ui.nav.vue | 2 +- src/client/app/mobile/views/pages/drive.vue | 4 ++-- src/client/app/mobile/views/pages/followers.vue | 2 +- src/client/app/mobile/views/pages/following.vue | 2 +- src/client/app/mobile/views/pages/games/reversi.vue | 4 ++-- src/client/app/mobile/views/pages/settings.vue | 2 +- src/client/app/mobile/views/pages/user-lists.vue | 2 +- src/client/app/mobile/views/pages/user.vue | 2 +- src/daemons/notes-stats.ts | 2 +- src/daemons/server-stats.ts | 2 +- src/mfm/html-to-mfm.ts | 2 +- src/mfm/html.ts | 4 ++-- src/misc/fa.ts | 2 +- src/remote/activitypub/renderer/hashtag.ts | 2 +- src/server/activitypub.ts | 2 +- src/server/api/endpoints.ts | 2 +- src/server/api/stream/notes-stats.ts | 2 +- src/server/api/stream/server-stats.ts | 2 +- src/server/web/docs.ts | 2 +- src/server/web/views/user.pug | 2 +- src/services/drive/add-file.ts | 2 +- webpack.config.ts | 4 ++-- 40 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/client/app/auth/views/index.vue b/src/client/app/auth/views/index.vue index 609e758994..ba7df911e5 100644 --- a/src/client/app/auth/views/index.vue +++ b/src/client/app/auth/views/index.vue @@ -80,7 +80,7 @@ export default Vue.extend({ accepted() { this.state = 'accepted'; if (this.session.app.callbackUrl) { - location.href = this.session.app.callbackUrl + '?token=' + this.session.token; + location.href = `${this.session.app.callbackUrl}?token=${this.session.token}`; } } } diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 54397c98c6..dd2cf93a89 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -94,7 +94,7 @@ // Get salt query const salt = localStorage.getItem('salt') - ? '?salt=' + localStorage.getItem('salt') + ? `?salt=${localStorage.getItem('salt')}` : ''; // Load an app script diff --git a/src/client/app/common/scripts/streaming/stream.ts b/src/client/app/common/scripts/streaming/stream.ts index fefa8e5ced..4ab78f1190 100644 --- a/src/client/app/common/scripts/streaming/stream.ts +++ b/src/client/app/common/scripts/streaming/stream.ts @@ -44,11 +44,11 @@ export default class Connection extends EventEmitter { const query = params ? Object.keys(params) - .map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k])) + .map(k => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`) .join('&') : null; - this.socket = new ReconnectingWebsocket(`${wsUrl}/${endpoint}${query ? '?' + query : ''}`); + this.socket = new ReconnectingWebsocket(`${wsUrl}/${endpoint}${query ? `?${query}` : ''}`); this.socket.addEventListener('open', this.onOpen); this.socket.addEventListener('close', this.onClose); this.socket.addEventListener('message', this.onMessage); diff --git a/src/client/app/common/views/components/autocomplete.vue b/src/client/app/common/views/components/autocomplete.vue index b274eaa0a0..ea05afd6dc 100644 --- a/src/client/app/common/views/components/autocomplete.vue +++ b/src/client/app/common/views/components/autocomplete.vue @@ -125,7 +125,7 @@ export default Vue.extend({ } if (this.type == 'user') { - const cacheKey = 'autocomplete:user:' + this.q; + const cacheKey = `autocomplete:user:${this.q}`; const cache = sessionStorage.getItem(cacheKey); if (cache) { const users = JSON.parse(cache); @@ -148,7 +148,7 @@ export default Vue.extend({ this.hashtags = JSON.parse(localStorage.getItem('hashtags') || '[]'); this.fetching = false; } else { - const cacheKey = 'autocomplete:hashtag:' + this.q; + const cacheKey = `autocomplete:hashtag:${this.q}`; const cache = sessionStorage.getItem(cacheKey); if (cache) { const hashtags = JSON.parse(cache); diff --git a/src/client/app/common/views/components/connect-failed.troubleshooter.vue b/src/client/app/common/views/components/connect-failed.troubleshooter.vue index 6c23cc7969..f64cae6b4b 100644 --- a/src/client/app/common/views/components/connect-failed.troubleshooter.vue +++ b/src/client/app/common/views/components/connect-failed.troubleshooter.vue @@ -57,7 +57,7 @@ export default Vue.extend({ } // Check internet connection - fetch('https://google.com?rand=' + Math.random(), { + fetch(`https://google.com?rand=${Math.random()}`, { mode: 'no-cors' }).then(() => { this.internet = true; diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue index d5dda0c80a..e182e7f8cb 100644 --- a/src/client/app/common/views/components/url-preview.vue +++ b/src/client/app/common/views/components/url-preview.vue @@ -170,7 +170,7 @@ export default Vue.extend({ return; } - fetch('/url?url=' + encodeURIComponent(this.url)).then(res => { + fetch(`/url?url=${encodeURIComponent(this.url)}`).then(res => { res.json().then(info => { if (info.url == null) return; this.title = info.title; diff --git a/src/client/app/common/views/directives/autocomplete.ts b/src/client/app/common/views/directives/autocomplete.ts index b252cf5c1f..26bc13871d 100644 --- a/src/client/app/common/views/directives/autocomplete.ts +++ b/src/client/app/common/views/directives/autocomplete.ts @@ -191,7 +191,7 @@ class Autocomplete { const acct = renderAcct(value); // 挿入 - this.text = trimmedBefore + '@' + acct + ' ' + after; + this.text = `${trimmedBefore}@${acct} ${after}`; // キャレットを戻す this.vm.$nextTick(() => { @@ -207,7 +207,7 @@ class Autocomplete { const after = source.substr(caret); // 挿入 - this.text = trimmedBefore + '#' + value + ' ' + after; + this.text = `${trimmedBefore}#${value} ${after}`; // キャレットを戻す this.vm.$nextTick(() => { diff --git a/src/client/app/common/views/filters/note.ts b/src/client/app/common/views/filters/note.ts index a611dc8685..3c9c8b7485 100644 --- a/src/client/app/common/views/filters/note.ts +++ b/src/client/app/common/views/filters/note.ts @@ -1,5 +1,5 @@ import Vue from 'vue'; Vue.filter('notePage', note => { - return '/notes/' + note.id; + return `/notes/${note.id}`; }); diff --git a/src/client/app/common/views/filters/user.ts b/src/client/app/common/views/filters/user.ts index ca0910fc53..e5220229b7 100644 --- a/src/client/app/common/views/filters/user.ts +++ b/src/client/app/common/views/filters/user.ts @@ -11,5 +11,5 @@ Vue.filter('userName', user => { }); Vue.filter('userPage', (user, path?) => { - return '/@' + Vue.filter('acct')(user) + (path ? '/' + path : ''); + return `/@${Vue.filter('acct')(user)}${(path ? `/${path}` : '')}`; }); diff --git a/src/client/app/common/views/pages/follow.vue b/src/client/app/common/views/pages/follow.vue index 13d855d20a..ec74b3a9b9 100644 --- a/src/client/app/common/views/pages/follow.vue +++ b/src/client/app/common/views/pages/follow.vue @@ -1,6 +1,6 @@ From ebeaef94e2545098ee81f143503180defa731793 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 5 Sep 2018 01:08:18 +0900 Subject: [PATCH 05/11] Improve media list --- locales/ja-JP.yml | 13 +-- .../app/common/views/components/index.ts | 2 + .../common/views/components/media-banner.vue | 85 ++++++++++++++ .../common/views/components/media-list.vue | 109 +++++++++--------- .../app/desktop/views/components/index.ts | 2 - .../desktop/views/components/media-audio.vue | 67 ----------- .../views/components/media-download.vue | 79 ------------- .../desktop/views/components/media-image.vue | 2 +- .../desktop/views/components/media-video.vue | 21 +--- .../mobile/views/components/media-image.vue | 2 +- 10 files changed, 152 insertions(+), 230 deletions(-) create mode 100644 src/client/app/common/views/components/media-banner.vue delete mode 100644 src/client/app/desktop/views/components/media-audio.vue delete mode 100644 src/client/app/desktop/views/components/media-download.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 193c3c5022..de5505e7db 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -250,6 +250,10 @@ common/views/components/connect-failed.troubleshooter.vue: flush: "キャッシュの削除" set-version: "バージョン指定" +common/views/components/media-banner.vue: + sensitive: "閲覧注意" + click-to-show: "クリックして表示" + common/views/components/messaging.vue: search-user: "ユーザーを探す" you: "あなた" @@ -583,15 +587,6 @@ desktop/views/components/media-video.vue: sensitive: "閲覧注意" click-to-show: "クリックして表示" -desktop/views/components/media-audio.vue: - sensitive: "閲覧注意" - click-to-show: "クリックして表示" - -desktop/views/components/media-download.vue: - sensitive: "閲覧注意" - click-to-show: "クリックして表示" - download: "ダウンロード" - desktop/views/components/follow-button.vue: following: "フォロー中" follow: "フォロー" diff --git a/src/client/app/common/views/components/index.ts b/src/client/app/common/views/components/index.ts index 4700b6269e..43cde6c54f 100644 --- a/src/client/app/common/views/components/index.ts +++ b/src/client/app/common/views/components/index.ts @@ -18,6 +18,7 @@ import reactionsViewer from './reactions-viewer.vue'; import time from './time.vue'; import timer from './timer.vue'; import mediaList from './media-list.vue'; +import mediaBanner from './media-banner.vue'; import uploader from './uploader.vue'; import specialMessage from './special-message.vue'; import streamIndicator from './stream-indicator.vue'; @@ -59,6 +60,7 @@ Vue.component('mk-reactions-viewer', reactionsViewer); Vue.component('mk-time', time); Vue.component('mk-timer', timer); Vue.component('mk-media-list', mediaList); +Vue.component('mk-media-banner', mediaBanner); Vue.component('mk-uploader', uploader); Vue.component('mk-special-message', specialMessage); Vue.component('mk-stream-indicator', streamIndicator); diff --git a/src/client/app/common/views/components/media-banner.vue b/src/client/app/common/views/components/media-banner.vue new file mode 100644 index 0000000000..69cd579446 --- /dev/null +++ b/src/client/app/common/views/components/media-banner.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/src/client/app/common/views/components/media-list.vue b/src/client/app/common/views/components/media-list.vue index 0312c2dfda..e949c063ab 100644 --- a/src/client/app/common/views/components/media-list.vue +++ b/src/client/app/common/views/components/media-list.vue @@ -1,12 +1,15 @@ @@ -32,62 +35,64 @@ export default Vue.extend({ diff --git a/src/client/app/desktop/views/components/index.ts b/src/client/app/desktop/views/components/index.ts index 159ead4983..7b7a38afa2 100644 --- a/src/client/app/desktop/views/components/index.ts +++ b/src/client/app/desktop/views/components/index.ts @@ -13,7 +13,6 @@ import ellipsisIcon from './ellipsis-icon.vue'; import mediaImage from './media-image.vue'; import mediaImageDialog from './media-image-dialog.vue'; import mediaVideo from './media-video.vue'; -import mediaAudio from './media-audio.vue'; import notifications from './notifications.vue'; import noteForm from './post-form.vue'; import renoteForm from './renote-form.vue'; @@ -44,7 +43,6 @@ Vue.component('mk-ellipsis-icon', ellipsisIcon); Vue.component('mk-media-image', mediaImage); Vue.component('mk-media-image-dialog', mediaImageDialog); Vue.component('mk-media-video', mediaVideo); -Vue.component('mk-media-audio', mediaAudio); Vue.component('mk-notifications', notifications); Vue.component('mk-post-form', noteForm); Vue.component('mk-renote-form', renoteForm); diff --git a/src/client/app/desktop/views/components/media-audio.vue b/src/client/app/desktop/views/components/media-audio.vue deleted file mode 100644 index 5d41947b17..0000000000 --- a/src/client/app/desktop/views/components/media-audio.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/components/media-download.vue b/src/client/app/desktop/views/components/media-download.vue deleted file mode 100644 index 236b065204..0000000000 --- a/src/client/app/desktop/views/components/media-download.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/components/media-image.vue b/src/client/app/desktop/views/components/media-image.vue index 0284872c68..904dc7f832 100644 --- a/src/client/app/desktop/views/components/media-image.vue +++ b/src/client/app/desktop/views/components/media-image.vue @@ -89,7 +89,7 @@ export default Vue.extend({ text-align center font-size 12px - > b + > * display block diff --git a/src/client/app/desktop/views/components/media-video.vue b/src/client/app/desktop/views/components/media-video.vue index 6c60f2da96..0a374acb8f 100644 --- a/src/client/app/desktop/views/components/media-video.vue +++ b/src/client/app/desktop/views/components/media-video.vue @@ -6,19 +6,11 @@ @@ -34,9 +26,6 @@ export default Vue.extend({ type: Object, required: true }, - inlinePlayable: { - default: false - }, hide: { type: Boolean, default: true @@ -68,12 +57,6 @@ export default Vue.extend({ diff --git a/src/client/app/mobile/views/components/media-image.vue b/src/client/app/mobile/views/components/media-image.vue index e40069bbe3..c8766f5464 100644 --- a/src/client/app/mobile/views/components/media-image.vue +++ b/src/client/app/mobile/views/components/media-image.vue @@ -65,7 +65,7 @@ export default Vue.extend({ text-align center font-size 12px - > b + > * display block From 299f83684bbced1cabd36836ca37ccc1684ce750 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 5 Sep 2018 18:01:47 +0900 Subject: [PATCH 06/11] media-banner darkmode --- src/client/app/common/views/components/media-banner.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/app/common/views/components/media-banner.vue b/src/client/app/common/views/components/media-banner.vue index 69cd579446..48b0d03d30 100644 --- a/src/client/app/common/views/components/media-banner.vue +++ b/src/client/app/common/views/components/media-banner.vue @@ -70,7 +70,10 @@ export default Vue.extend({ > .mk-media-banner-icon font-size 1.6em - .mk-media-banner-download + .mk-media-banner-download[data-darkmode] + background #21242d + + .mk-media-banner-download:not([data-darkmode]) background #f7f7f7 .mk-media-banner-sensitive From 4257fed5009a30b7815fe3254d18b4b87806fe51 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 5 Sep 2018 19:46:55 +0900 Subject: [PATCH 07/11] fix mk-media darkmode --- .../app/common/views/components/media-banner.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/client/app/common/views/components/media-banner.vue b/src/client/app/common/views/components/media-banner.vue index 48b0d03d30..5c83925a32 100644 --- a/src/client/app/common/views/components/media-banner.vue +++ b/src/client/app/common/views/components/media-banner.vue @@ -42,7 +42,7 @@ export default Vue.extend({ From 952a49f7496c5c6a6dae8998e8d42ea53281db2e Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 15 Sep 2018 22:22:41 +0900 Subject: [PATCH 08/11] =?UTF-8?q?revert=20=E3=83=87=E3=82=B9=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=81=AE=E5=8B=95=E7=94=BB=E5=9F=8B?= =?UTF-8?q?=E3=82=81=E8=BE=BC=E3=81=BF=E3=82=92=E5=BB=83=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../desktop/views/components/media-video.vue | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/client/app/desktop/views/components/media-video.vue b/src/client/app/desktop/views/components/media-video.vue index 0a374acb8f..8af5f9b07e 100644 --- a/src/client/app/desktop/views/components/media-video.vue +++ b/src/client/app/desktop/views/components/media-video.vue @@ -6,11 +6,19 @@ @@ -19,13 +27,15 @@