diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-06-27 00:55:44 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-27 00:55:44 +0900 |
| commit | 9ac34badad7a99166907e1a42f8a817413a74d58 (patch) | |
| tree | eb45b75f1f5f87a36f0eefec42f449fda109a6ad /src/client/app/common/scripts | |
| parent | New translations ja.yml (Portuguese) (diff) | |
| parent | Merge pull request #1789 from syuilo/greenkeeper/uuid-3.3.0 (diff) | |
| download | misskey-9ac34badad7a99166907e1a42f8a817413a74d58.tar.gz misskey-9ac34badad7a99166907e1a42f8a817413a74d58.tar.bz2 misskey-9ac34badad7a99166907e1a42f8a817413a74d58.zip | |
Merge branch 'master' into l10n_master
Diffstat (limited to 'src/client/app/common/scripts')
| -rw-r--r-- | src/client/app/common/scripts/can-hide-text.ts | 16 | ||||
| -rw-r--r-- | src/client/app/common/scripts/check-for-update.ts | 5 | ||||
| -rw-r--r-- | src/client/app/common/scripts/compose-notification.ts | 62 | ||||
| -rw-r--r-- | src/client/app/common/scripts/get-kao.ts | 2 |
4 files changed, 39 insertions, 46 deletions
diff --git a/src/client/app/common/scripts/can-hide-text.ts b/src/client/app/common/scripts/can-hide-text.ts deleted file mode 100644 index 4a4be8d9d0..0000000000 --- a/src/client/app/common/scripts/can-hide-text.ts +++ /dev/null @@ -1,16 +0,0 @@ -export default function(note) { - if (note.text == null) return true; - - let txt = note.text; - - if (note.media) { - note.media.forEach(file => { - txt = txt.replace(file.url, ''); - if (file.src) txt = txt.replace(file.src, ''); - }); - - if (txt == '') return true; - } - - return false; -} diff --git a/src/client/app/common/scripts/check-for-update.ts b/src/client/app/common/scripts/check-for-update.ts index b5ba6916d1..4445eefc39 100644 --- a/src/client/app/common/scripts/check-for-update.ts +++ b/src/client/app/common/scripts/check-for-update.ts @@ -23,7 +23,10 @@ export default async function(mios: MiOS, force = false, silent = false) { } if (!silent) { - alert('%i18n:common.update-available%'.replace('{newer}', newer).replace('{current}', current)); + mios.apis.dialog({ + title: '%i18n:common.update-available-title%', + text: '%i18n:common.update-available%'.replace('{newer}', newer).replace('{current}', current) + }); } return newer; diff --git a/src/client/app/common/scripts/compose-notification.ts b/src/client/app/common/scripts/compose-notification.ts index cc28f75998..2e58649ac2 100644 --- a/src/client/app/common/scripts/compose-notification.ts +++ b/src/client/app/common/scripts/compose-notification.ts @@ -20,34 +20,6 @@ export default function(type, data): Notification { icon: data.url + '?thumbnail&size=64' }; - case 'mention': - return { - title: `${getUserName(data.user)}さんから:`, - body: getNoteSummary(data), - icon: data.user.avatarUrl + '?thumbnail&size=64' - }; - - case 'reply': - return { - title: `${getUserName(data.user)}さんから返信:`, - body: getNoteSummary(data), - icon: data.user.avatarUrl + '?thumbnail&size=64' - }; - - case 'quote': - return { - title: `${getUserName(data.user)}さんが引用:`, - body: getNoteSummary(data), - icon: data.user.avatarUrl + '?thumbnail&size=64' - }; - - case 'reaction': - return { - title: `${getUserName(data.user)}: ${getReactionEmoji(data.reaction)}:`, - body: getNoteSummary(data.note), - icon: data.user.avatarUrl + '?thumbnail&size=64' - }; - case 'unread_messaging_message': return { title: `${getUserName(data.user)}さんからメッセージ:`, @@ -62,6 +34,40 @@ export default function(type, data): Notification { icon: data.parent.avatarUrl + '?thumbnail&size=64' }; + case 'notification': + switch (data.type) { + case 'mention': + return { + title: `${getUserName(data.user)}さんから:`, + body: getNoteSummary(data), + icon: data.user.avatarUrl + '?thumbnail&size=64' + }; + + case 'reply': + return { + title: `${getUserName(data.user)}さんから返信:`, + body: getNoteSummary(data), + icon: data.user.avatarUrl + '?thumbnail&size=64' + }; + + case 'quote': + return { + title: `${getUserName(data.user)}さんが引用:`, + body: getNoteSummary(data), + icon: data.user.avatarUrl + '?thumbnail&size=64' + }; + + case 'reaction': + return { + title: `${getUserName(data.user)}: ${getReactionEmoji(data.reaction)}:`, + body: getNoteSummary(data.note), + icon: data.user.avatarUrl + '?thumbnail&size=64' + }; + + default: + return null; + } + default: return null; } diff --git a/src/client/app/common/scripts/get-kao.ts b/src/client/app/common/scripts/get-kao.ts index 2168c5be88..d380187510 100644 --- a/src/client/app/common/scripts/get-kao.ts +++ b/src/client/app/common/scripts/get-kao.ts @@ -1,5 +1,5 @@ export default () => [ '(=^・・^=)', - 'v(‘ω’)v', + 'v('ω')v', '🐡( \'-\' 🐡 )フグパンチ!!!!' ][Math.floor(Math.random() * 3)]; |