From 3f79c9ae4927d4186c708e130ecbb1ea4f72d9fa Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 9 Nov 2018 16:00:29 +0900 Subject: Refactor client (#3178) * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip --- src/client/app/common/scripts/check-for-update.ts | 7 +++---- src/client/app/common/scripts/fuck-ad-block.ts | 4 ++-- src/client/app/common/scripts/note-mixin.ts | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/client/app/common/scripts') diff --git a/src/client/app/common/scripts/check-for-update.ts b/src/client/app/common/scripts/check-for-update.ts index a4c59fd350..ac0b5d09c8 100644 --- a/src/client/app/common/scripts/check-for-update.ts +++ b/src/client/app/common/scripts/check-for-update.ts @@ -1,8 +1,7 @@ -import MiOS from '../../mios'; import { clientVersion as current } from '../../config'; -export default async function(mios: MiOS, force = false, silent = false) { - const meta = await mios.getMeta(force); +export default async function($root: any, force = false, silent = false) { + const meta = await $root.getMeta(force); const newer = meta.clientVersion; if (newer != current) { @@ -23,7 +22,7 @@ export default async function(mios: MiOS, force = false, silent = false) { } if (!silent) { - mios.apis.dialog({ + $root.$dialog({ title: '%i18n:common.update-available-title%', text: '%i18n:common.update-available%'.replace('{newer}', newer).replace('{current}', current) }); diff --git a/src/client/app/common/scripts/fuck-ad-block.ts b/src/client/app/common/scripts/fuck-ad-block.ts index 0c802f1648..b749d363f2 100644 --- a/src/client/app/common/scripts/fuck-ad-block.ts +++ b/src/client/app/common/scripts/fuck-ad-block.ts @@ -1,10 +1,10 @@ declare const fuckAdBlock: any; -export default (os) => { +export default ($root: any) => { require('fuckadblock'); function adBlockDetected() { - os.apis.dialog({ + $root.$dialog({ title: '%fa:exclamation-triangle%%i18n:common.adblock.detected%', text: '%i18n:common.adblock.warning%', actins: [{ diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts index 6d86c70820..dd5098f4cd 100644 --- a/src/client/app/common/scripts/note-mixin.ts +++ b/src/client/app/common/scripts/note-mixin.ts @@ -88,7 +88,7 @@ export default (opts: Opts = {}) => ({ methods: { reply(viaKeyboard = false) { - this.$root.apis.post({ + this.$root.$post({ reply: this.appearNote, animation: !viaKeyboard, cb: () => { @@ -98,7 +98,7 @@ export default (opts: Opts = {}) => ({ }, renote(viaKeyboard = false) { - this.$root.apis.post({ + this.$root.$post({ renote: this.appearNote, animation: !viaKeyboard, cb: () => { -- cgit v1.2.3-freya