summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-11-09 08:26:32 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-11-09 08:26:32 +0900
commitfccbecf15994f23fc4fbe9627a8eb902b76b6bb7 (patch)
tree6bdd7f1e5c6b72929afd41ef042b9e866465fb47 /src/client
parentRefactor & Clean up (diff)
downloadsharkey-fccbecf15994f23fc4fbe9627a8eb902b76b6bb7.tar.gz
sharkey-fccbecf15994f23fc4fbe9627a8eb902b76b6bb7.tar.bz2
sharkey-fccbecf15994f23fc4fbe9627a8eb902b76b6bb7.zip
[Client] Fix bug
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/common/scripts/note-mixin.ts4
-rw-r--r--src/client/app/common/views/components/api-settings.vue2
-rw-r--r--src/client/app/common/views/components/games/reversi/reversi.index.vue2
-rw-r--r--src/client/app/common/views/components/messaging-room.form.vue2
-rw-r--r--src/client/app/common/views/components/password-settings.vue10
-rw-r--r--src/client/app/common/views/widgets/slideshow.vue2
-rw-r--r--src/client/app/desktop/views/components/drive.file.vue8
-rw-r--r--src/client/app/desktop/views/components/drive.folder.vue4
-rw-r--r--src/client/app/desktop/views/components/drive.vue8
-rw-r--r--src/client/app/desktop/views/components/home.vue2
-rw-r--r--src/client/app/desktop/views/components/post-form.vue15
-rw-r--r--src/client/app/desktop/views/components/renote-form.vue4
-rw-r--r--src/client/app/desktop/views/components/settings.2fa.vue10
-rw-r--r--src/client/app/desktop/views/components/settings.vue8
-rw-r--r--src/client/app/desktop/views/components/timeline.vue2
-rw-r--r--src/client/app/desktop/views/components/ui.header.post.vue2
-rw-r--r--src/client/app/desktop/views/components/ui.sidebar.vue2
-rw-r--r--src/client/app/desktop/views/components/ui.vue2
-rw-r--r--src/client/app/desktop/views/components/user-lists-window.vue2
-rw-r--r--src/client/app/desktop/views/pages/deck/deck.column.vue2
-rw-r--r--src/client/app/desktop/views/pages/deck/deck.notification.vue8
-rw-r--r--src/client/app/desktop/views/pages/deck/deck.vue4
-rw-r--r--src/client/app/desktop/views/pages/home.vue2
-rw-r--r--src/client/app/desktop/views/pages/user/user.header.vue2
-rw-r--r--src/client/app/desktop/views/pages/user/user.profile.vue2
-rw-r--r--src/client/app/init.ts3
-rw-r--r--src/client/app/mobile/views/components/drive.file-detail.vue2
-rw-r--r--src/client/app/mobile/views/components/drive.vue2
-rw-r--r--src/client/app/mobile/views/components/note-detail.vue4
-rw-r--r--src/client/app/mobile/views/components/post-form.vue4
-rw-r--r--src/client/app/mobile/views/pages/drive.vue8
-rw-r--r--src/client/app/mobile/views/pages/favorites.vue2
-rw-r--r--src/client/app/mobile/views/pages/followers.vue2
-rw-r--r--src/client/app/mobile/views/pages/following.vue2
-rw-r--r--src/client/app/mobile/views/pages/games/reversi.vue2
-rw-r--r--src/client/app/mobile/views/pages/home.vue4
-rw-r--r--src/client/app/mobile/views/pages/messaging-room.vue2
-rw-r--r--src/client/app/mobile/views/pages/messaging.vue2
-rw-r--r--src/client/app/mobile/views/pages/note.vue2
-rw-r--r--src/client/app/mobile/views/pages/search.vue2
-rw-r--r--src/client/app/mobile/views/pages/settings.vue4
-rw-r--r--src/client/app/mobile/views/pages/user-lists.vue2
-rw-r--r--src/client/app/mobile/views/pages/user.vue2
-rw-r--r--src/client/app/mobile/views/pages/widgets.vue2
44 files changed, 83 insertions, 81 deletions
diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts
index 93debf81e8..6d86c70820 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 as any).apis.post({
+ this.$root.apis.post({
reply: this.appearNote,
animation: !viaKeyboard,
cb: () => {
@@ -98,7 +98,7 @@ export default (opts: Opts = {}) => ({
},
renote(viaKeyboard = false) {
- (this as any).apis.post({
+ this.$root.apis.post({
renote: this.appearNote,
animation: !viaKeyboard,
cb: () => {
diff --git a/src/client/app/common/views/components/api-settings.vue b/src/client/app/common/views/components/api-settings.vue
index 139aa44077..a6b74d7bb4 100644
--- a/src/client/app/common/views/components/api-settings.vue
+++ b/src/client/app/common/views/components/api-settings.vue
@@ -50,7 +50,7 @@ export default Vue.extend({
methods: {
regenerateToken() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-password'),
type: 'password'
}).then(password => {
diff --git a/src/client/app/common/views/components/games/reversi/reversi.index.vue b/src/client/app/common/views/components/games/reversi/reversi.index.vue
index eb657365ab..f020e82083 100644
--- a/src/client/app/common/views/components/games/reversi/reversi.index.vue
+++ b/src/client/app/common/views/components/games/reversi/reversi.index.vue
@@ -100,7 +100,7 @@ export default Vue.extend({
},
match() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-username')
}).then(username => {
this.$root.api('users/show', {
diff --git a/src/client/app/common/views/components/messaging-room.form.vue b/src/client/app/common/views/components/messaging-room.form.vue
index 32cceb0c06..7c45df47d1 100644
--- a/src/client/app/common/views/components/messaging-room.form.vue
+++ b/src/client/app/common/views/components/messaging-room.form.vue
@@ -131,7 +131,7 @@ export default Vue.extend({
},
chooseFileFromDrive() {
- (this as any).apis.chooseDriveFile({
+ this.$root.apis.chooseDriveFile({
multiple: false
}).then(file => {
this.file = file;
diff --git a/src/client/app/common/views/components/password-settings.vue b/src/client/app/common/views/components/password-settings.vue
index 01396bf32b..048770401f 100644
--- a/src/client/app/common/views/components/password-settings.vue
+++ b/src/client/app/common/views/components/password-settings.vue
@@ -12,20 +12,20 @@ export default Vue.extend({
i18n: i18n('common/views/components/password-settings.vue'),
methods: {
reset() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-current-password'),
type: 'password'
}).then(currentPassword => {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-new-password'),
type: 'password'
}).then(newPassword => {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-new-password-again'),
type: 'password'
}).then(newPassword2 => {
if (newPassword !== newPassword2) {
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: null,
text: this.$t('not-match'),
actions: [{
@@ -38,7 +38,7 @@ export default Vue.extend({
currentPasword: currentPassword,
newPassword: newPassword
}).then(() => {
- (this as any).apis.notify(this.$t('changed'));
+ this.$root.apis.notify(this.$t('changed'));
});
});
});
diff --git a/src/client/app/common/views/widgets/slideshow.vue b/src/client/app/common/views/widgets/slideshow.vue
index 6890481724..58b19d0ab3 100644
--- a/src/client/app/common/views/widgets/slideshow.vue
+++ b/src/client/app/common/views/widgets/slideshow.vue
@@ -114,7 +114,7 @@ export default define({
});
},
choose() {
- (this as any).apis.chooseDriveFolder().then(folder => {
+ this.$root.apis.chooseDriveFolder().then(folder => {
this.props.folder = folder ? folder.id : null;
this.save();
this.fetch();
diff --git a/src/client/app/desktop/views/components/drive.file.vue b/src/client/app/desktop/views/components/drive.file.vue
index 779856006d..c403418b21 100644
--- a/src/client/app/desktop/views/components/drive.file.vue
+++ b/src/client/app/desktop/views/components/drive.file.vue
@@ -149,7 +149,7 @@ export default Vue.extend({
},
rename() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('contextmenu.rename-file'),
placeholder: this.$t('contextmenu.input-new-file-name'),
default: this.file.name,
@@ -171,7 +171,7 @@ export default Vue.extend({
copyUrl() {
copyToClipboard(this.file.url);
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('contextmenu.copied'),
text: this.$t('contextmenu.copied-url-to-clipboard'),
actions: [{
@@ -181,11 +181,11 @@ export default Vue.extend({
},
setAsAvatar() {
- (this as any).apis.updateAvatar(this.file);
+ this.$root.apis.updateAvatar(this.file);
},
setAsBanner() {
- (this as any).apis.updateBanner(this.file);
+ this.$root.apis.updateBanner(this.file);
},
addApp() {
diff --git a/src/client/app/desktop/views/components/drive.folder.vue b/src/client/app/desktop/views/components/drive.folder.vue
index 7ce9f74018..2f595ddbe3 100644
--- a/src/client/app/desktop/views/components/drive.folder.vue
+++ b/src/client/app/desktop/views/components/drive.folder.vue
@@ -156,7 +156,7 @@ export default Vue.extend({
}).catch(err => {
switch (err) {
case 'detected-circular-definition':
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('unable-to-process'),
text: this.$t('circular-reference-detected'),
actions: [{
@@ -196,7 +196,7 @@ export default Vue.extend({
},
rename() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('contextmenu.rename-folder'),
placeholder: this.$t('contextmenu.input-new-folder-name'),
default: this.folder.name
diff --git a/src/client/app/desktop/views/components/drive.vue b/src/client/app/desktop/views/components/drive.vue
index 8c004af875..cf9b8e7152 100644
--- a/src/client/app/desktop/views/components/drive.vue
+++ b/src/client/app/desktop/views/components/drive.vue
@@ -314,7 +314,7 @@ export default Vue.extend({
}).catch(err => {
switch (err) {
case 'detected-circular-definition':
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('unable-to-process'),
text: this.$t('circular-reference-detected'),
actions: [{
@@ -335,7 +335,7 @@ export default Vue.extend({
},
urlUpload() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('url-upload'),
placeholder: this.$t('url-of-file')
}).then(url => {
@@ -344,7 +344,7 @@ export default Vue.extend({
folderId: this.folder ? this.folder.id : undefined
});
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('url-upload-requested'),
text: this.$t('may-take-time'),
actions: [{
@@ -355,7 +355,7 @@ export default Vue.extend({
},
createFolder() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('create-folder'),
placeholder: this.$t('folder-name')
}).then(name => {
diff --git a/src/client/app/desktop/views/components/home.vue b/src/client/app/desktop/views/components/home.vue
index 315171e3a7..aa25b5b952 100644
--- a/src/client/app/desktop/views/components/home.vue
+++ b/src/client/app/desktop/views/components/home.vue
@@ -186,7 +186,7 @@ export default Vue.extend({
methods: {
hint() {
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('@.customization-tips.title'),
text: this.$t('@.customization-tips.paragraph'),
actions: [{
diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue
index 483908b7a0..0af8a63aee 100644
--- a/src/client/app/desktop/views/components/post-form.vue
+++ b/src/client/app/desktop/views/components/post-form.vue
@@ -36,7 +36,7 @@
<button class="drive" :title="$t('attach-media-from-drive')" @click="chooseFileFromDrive"><fa icon="cloud"/></button>
<button class="kao" :title="$t('insert-a-kao')" @click="kao"><fa :icon="['far', 'smile']"/></button>
<button class="poll" :title="$t('create-poll')" @click="poll = !poll"><fa icon="chart-pie"/></button>
- <button class="cw%" :title="$t('hide-contents%')" @click="useCw = !useCw"><fa icon="eye-slash"/></button>
+ <button class="cw" :title="$t('hide-contents%')" @click="useCw = !useCw"><fa icon="eye-slash"/></button>
<button class="geo" :title="$t('attach-location-information')" @click="geo ? removeGeo() : setGeo()"><fa icon="map-marker-alt"/></button>
<button class="visibility" :title="$t('visibility')" @click="setVisibility" ref="visibilityButton">
<span v-if="visibility === 'public'"><fa icon="globe"/></span>
@@ -45,9 +45,9 @@
<span v-if="visibility === 'specified'"><fa icon="envelope"/></span>
<span v-if="visibility === 'private'"><fa icon="lock"/></span>
</button>
- <p class="text-count" :class="{ over: this.trimmedLength(text) > this.maxNoteTextLength }">{{ this.maxNoteTextLength - this.trimmedLength(text) }}</p>
+ <p class="text-count" :class="{ over: trimmedLength(text) > maxNoteTextLength }">{{ maxNoteTextLength - trimmedLength(text) }}</p>
<button :class="{ posting }" class="submit" :disabled="!canPost" @click="post">
- {{ posting ? this.$t('posting') : submitText }}<mk-ellipsis v-if="posting"/>
+ {{ posting ? $t('posting') : submitText }}<mk-ellipsis v-if="posting"/>
</button>
<input ref="file" type="file" multiple="multiple" tabindex="-1" @change="onChangeFile"/>
<div class="dropzone" v-if="draghover"></div>
@@ -245,7 +245,7 @@ export default Vue.extend({
},
chooseFileFromDrive() {
- (this as any).apis.chooseDriveFile({
+ this.$root.apis.chooseDriveFile({
multiple: true
}).then(files => {
files.forEach(this.attachMedia);
@@ -363,7 +363,7 @@ export default Vue.extend({
},
addVisibleUser() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-username')
}).then(acct => {
if (acct.startsWith('@')) acct = acct.substr(1);
@@ -401,13 +401,13 @@ export default Vue.extend({
this.clear();
this.deleteDraft();
this.$emit('posted');
- (this as any).apis.notify(this.renote
+ this.$root.apis.notify(this.renote
? this.$t('reposted')
: this.reply
? this.$t('replied')
: this.$t('posted'));
}).catch(err => {
- (this as any).apis.notify(this.renote
+ this.$root.apis.notify(this.renote
? this.$t('renote-failed')
: this.reply
? this.$t('reply-failed')
@@ -689,6 +689,7 @@ export default Vue.extend({
> .drive
> .kao
> .poll
+ > .cw
> .geo
> .visibility
display inline-block
diff --git a/src/client/app/desktop/views/components/renote-form.vue b/src/client/app/desktop/views/components/renote-form.vue
index 79e21a28a3..d2b3c25c0c 100644
--- a/src/client/app/desktop/views/components/renote-form.vue
+++ b/src/client/app/desktop/views/components/renote-form.vue
@@ -34,9 +34,9 @@ export default Vue.extend({
renoteId: this.note.id
}).then(data => {
this.$emit('posted');
- (this as any).apis.notify(this.$t('success'));
+ this.$root.apis.notify(this.$t('success'));
}).catch(err => {
- (this as any).apis.notify(this.$t('failure'));
+ this.$root.apis.notify(this.$t('failure'));
}).then(() => {
this.wait = false;
});
diff --git a/src/client/app/desktop/views/components/settings.2fa.vue b/src/client/app/desktop/views/components/settings.2fa.vue
index 71d4eeb788..885b19d424 100644
--- a/src/client/app/desktop/views/components/settings.2fa.vue
+++ b/src/client/app/desktop/views/components/settings.2fa.vue
@@ -35,7 +35,7 @@ export default Vue.extend({
},
methods: {
register() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-password'),
type: 'password'
}).then(password => {
@@ -48,14 +48,14 @@ export default Vue.extend({
},
unregister() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-password'),
type: 'password'
}).then(password => {
this.$root.api('i/2fa/unregister', {
password: password
}).then(() => {
- (this as any).apis.notify(this.$t('unregistered'));
+ this.$root.apis.notify(this.$t('unregistered'));
this.$store.state.i.twoFactorEnabled = false;
});
});
@@ -65,10 +65,10 @@ export default Vue.extend({
this.$root.api('i/2fa/done', {
token: this.token
}).then(() => {
- (this as any).apis.notify(this.$t('success'));
+ this.$root.apis.notify(this.$t('success'));
this.$store.state.i.twoFactorEnabled = true;
}).catch(() => {
- (this as any).apis.notify(this.$t('failed'));
+ this.$root.apis.notify(this.$t('failed'));
});
}
}
diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue
index 81177b3f63..0019288135 100644
--- a/src/client/app/desktop/views/components/settings.vue
+++ b/src/client/app/desktop/views/components/settings.vue
@@ -513,7 +513,7 @@ export default Vue.extend({
this.$emit('done');
},
updateWallpaper() {
- (this as any).apis.chooseDriveFile({
+ this.$root.apis.chooseDriveFile({
multiple: false
}).then(file => {
this.$root.api('i/update', {
@@ -537,12 +537,12 @@ export default Vue.extend({
this.checkingForUpdate = false;
this.latestVersion = newer;
if (newer == null) {
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('no-updates'),
text: this.$t('no-updates-desc')
});
} else {
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('update-available'),
text: this.$t('update-available-desc')
});
@@ -551,7 +551,7 @@ export default Vue.extend({
},
clean() {
localStorage.clear();
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('cache-cleared'),
text: this.$t('cache-cleared-desc')
});
diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue
index 3629b19f3f..d0929c4dc4 100644
--- a/src/client/app/desktop/views/components/timeline.vue
+++ b/src/client/app/desktop/views/components/timeline.vue
@@ -109,7 +109,7 @@ export default Vue.extend({
icon: 'plus',
text: this.$t('add-list'),
action: () => {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('list-name'),
}).then(async title => {
const list = await this.$root.api('users/lists/create', {
diff --git a/src/client/app/desktop/views/components/ui.header.post.vue b/src/client/app/desktop/views/components/ui.header.post.vue
index 85f202f7a9..79c1abd872 100644
--- a/src/client/app/desktop/views/components/ui.header.post.vue
+++ b/src/client/app/desktop/views/components/ui.header.post.vue
@@ -12,7 +12,7 @@ export default Vue.extend({
i18n: i18n('desktop/views/components/ui.header.post.vue'),
methods: {
post() {
- (this as any).apis.post();
+ this.$root.apis.post();
}
}
});
diff --git a/src/client/app/desktop/views/components/ui.sidebar.vue b/src/client/app/desktop/views/components/ui.sidebar.vue
index f1396093bc..ac6740b93c 100644
--- a/src/client/app/desktop/views/components/ui.sidebar.vue
+++ b/src/client/app/desktop/views/components/ui.sidebar.vue
@@ -139,7 +139,7 @@ export default Vue.extend({
},
post() {
- (this as any).apis.post();
+ this.$root.apis.post();
},
drive() {
diff --git a/src/client/app/desktop/views/components/ui.vue b/src/client/app/desktop/views/components/ui.vue
index 18465922f2..09a3aa7900 100644
--- a/src/client/app/desktop/views/components/ui.vue
+++ b/src/client/app/desktop/views/components/ui.vue
@@ -67,7 +67,7 @@ export default Vue.extend({
methods: {
post() {
- (this as any).apis.post();
+ this.$root.apis.post();
},
toggleZenMode() {
diff --git a/src/client/app/desktop/views/components/user-lists-window.vue b/src/client/app/desktop/views/components/user-lists-window.vue
index c8d789deab..2f4ed16d83 100644
--- a/src/client/app/desktop/views/components/user-lists-window.vue
+++ b/src/client/app/desktop/views/components/user-lists-window.vue
@@ -29,7 +29,7 @@ export default Vue.extend({
},
methods: {
add() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('list-name'),
}).then(async title => {
const list = await this.$root.api('users/lists/create', {
diff --git a/src/client/app/desktop/views/pages/deck/deck.column.vue b/src/client/app/desktop/views/pages/deck/deck.column.vue
index c23e32783e..1fad1ddd81 100644
--- a/src/client/app/desktop/views/pages/deck/deck.column.vue
+++ b/src/client/app/desktop/views/pages/deck/deck.column.vue
@@ -168,7 +168,7 @@ export default Vue.extend({
icon: 'pencil-alt',
text: this.$t('rename'),
action: () => {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('rename'),
default: this.name,
allowEmpty: false
diff --git a/src/client/app/desktop/views/pages/deck/deck.notification.vue b/src/client/app/desktop/views/pages/deck/deck.notification.vue
index f1b482f3ab..9418007f2b 100644
--- a/src/client/app/desktop/views/pages/deck/deck.notification.vue
+++ b/src/client/app/desktop/views/pages/deck/deck.notification.vue
@@ -137,7 +137,7 @@ export default Vue.extend({
align-items baseline
white-space nowrap
- i, .mk-reaction-icon
+ [data-icon], .mk-reaction-icon
margin-right 4px
> .mk-time
@@ -159,15 +159,15 @@ export default Vue.extend({
margin-right 3px
&.renote
- > div > header i
+ > div > header [data-icon]
color #77B255
&.follow
- > div > header i
+ > div > header [data-icon]
color #53c7ce
&.receiveFollowRequest
- > div > header i
+ > div > header [data-icon]
color #888
</style>
diff --git a/src/client/app/desktop/views/pages/deck/deck.vue b/src/client/app/desktop/views/pages/deck/deck.vue
index 8acc908ecc..a702053c18 100644
--- a/src/client/app/desktop/views/pages/deck/deck.vue
+++ b/src/client/app/desktop/views/pages/deck/deck.vue
@@ -131,7 +131,7 @@ export default Vue.extend({
},
mounted() {
- document.title = this.$root.os.instanceName;
+ document.title = this.$root.instanceName;
document.documentElement.style.overflow = 'hidden';
},
@@ -255,7 +255,7 @@ export default Vue.extend({
icon: 'hashtag',
text: this.$t('@deck.hashtag'),
action: () => {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-hashtag-tl-title')
}).then(title => {
this.$store.dispatch('settings/addDeckColumn', {
diff --git a/src/client/app/desktop/views/pages/home.vue b/src/client/app/desktop/views/pages/home.vue
index 3195f948aa..19e00880af 100644
--- a/src/client/app/desktop/views/pages/home.vue
+++ b/src/client/app/desktop/views/pages/home.vue
@@ -23,7 +23,7 @@ export default Vue.extend({
}
},
mounted() {
- document.title = this.$root.os.instanceName;
+ document.title = this.$root.instanceName;
Progress.start();
},
diff --git a/src/client/app/desktop/views/pages/user/user.header.vue b/src/client/app/desktop/views/pages/user/user.header.vue
index c433c0f507..1ac45d027d 100644
--- a/src/client/app/desktop/views/pages/user/user.header.vue
+++ b/src/client/app/desktop/views/pages/user/user.header.vue
@@ -81,7 +81,7 @@ export default Vue.extend({
onBannerClick() {
if (!this.$store.getters.isSignedIn || this.$store.state.i.id != this.user.id) return;
- (this as any).apis.updateBanner().then(i => {
+ this.$root.apis.updateBanner().then(i => {
this.user.bannerUrl = i.bannerUrl;
});
}
diff --git a/src/client/app/desktop/views/pages/user/user.profile.vue b/src/client/app/desktop/views/pages/user/user.profile.vue
index c40be90799..d6bcd72f5a 100644
--- a/src/client/app/desktop/views/pages/user/user.profile.vue
+++ b/src/client/app/desktop/views/pages/user/user.profile.vue
@@ -101,7 +101,7 @@ export default Vue.extend({
listId: list.id,
userId: this.user.id
});
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: 'Done!',
text: this.$t('list-pushed').replace('{user}', this.user.name).replace('{list}', list.title)
});
diff --git a/src/client/app/init.ts b/src/client/app/init.ts
index 0817c92f19..10745aadea 100644
--- a/src/client/app/init.ts
+++ b/src/client/app/init.ts
@@ -285,7 +285,8 @@ export default (callback: (launch: (router: VueRouter, api?: (os: MiOS) => API)
windows: os.windows
},
stream: os.stream,
- apis: os.apis
+ apis: os.apis,
+ instanceName: os.instanceName
};
},
methods: {
diff --git a/src/client/app/mobile/views/components/drive.file-detail.vue b/src/client/app/mobile/views/components/drive.file-detail.vue
index 83ee03d1ea..68a16a8350 100644
--- a/src/client/app/mobile/views/components/drive.file-detail.vue
+++ b/src/client/app/mobile/views/components/drive.file-detail.vue
@@ -101,7 +101,7 @@ export default Vue.extend({
},
move() {
- (this as any).apis.chooseDriveFolder().then(folder => {
+ this.$root.apis.chooseDriveFolder().then(folder => {
this.$root.api('drive/files/update', {
fileId: this.file.id,
folderId: folder == null ? null : folder.id
diff --git a/src/client/app/mobile/views/components/drive.vue b/src/client/app/mobile/views/components/drive.vue
index 7c0a2cd74a..90e2a325ca 100644
--- a/src/client/app/mobile/views/components/drive.vue
+++ b/src/client/app/mobile/views/components/drive.vue
@@ -439,7 +439,7 @@ export default Vue.extend({
alert(this.$t('root-move-alert'));
return;
}
- (this as any).apis.chooseDriveFolder().then(folder => {
+ this.$root.apis.chooseDriveFolder().then(folder => {
this.$root.api('drive/folders/update', {
parentId: folder ? folder.id : null,
folderId: this.folder.id
diff --git a/src/client/app/mobile/views/components/note-detail.vue b/src/client/app/mobile/views/components/note-detail.vue
index f6cbc82dd8..bd9bc0a4d0 100644
--- a/src/client/app/mobile/views/components/note-detail.vue
+++ b/src/client/app/mobile/views/components/note-detail.vue
@@ -196,13 +196,13 @@ export default Vue.extend({
},
reply() {
- (this as any).apis.post({
+ this.$root.apis.post({
reply: this.p
});
},
renote() {
- (this as any).apis.post({
+ this.$root.apis.post({
renote: this.p
});
},
diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue
index a6e50934a9..832914357f 100644
--- a/src/client/app/mobile/views/components/post-form.vue
+++ b/src/client/app/mobile/views/components/post-form.vue
@@ -220,7 +220,7 @@ export default Vue.extend({
},
chooseFileFromDrive() {
- (this as any).apis.chooseDriveFile({
+ this.$root.apis.chooseDriveFile({
multiple: true
}).then(files => {
files.forEach(this.attachMedia);
@@ -279,7 +279,7 @@ export default Vue.extend({
},
addVisibleUser() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('username-prompt')
}).then(acct => {
if (acct.startsWith('@')) acct = acct.substr(1);
diff --git a/src/client/app/mobile/views/pages/drive.vue b/src/client/app/mobile/views/pages/drive.vue
index ac207f1d51..e5085d2aa1 100644
--- a/src/client/app/mobile/views/pages/drive.vue
+++ b/src/client/app/mobile/views/pages/drive.vue
@@ -45,7 +45,7 @@ export default Vue.extend({
window.addEventListener('popstate', this.onPopState);
},
mounted() {
- document.title = `${this.$root.os.instanceName} Drive`;
+ document.title = `${this.$root.instanceName} Drive`;
},
beforeDestroy() {
window.removeEventListener('popstate', this.onPopState);
@@ -64,7 +64,7 @@ export default Vue.extend({
(this.$refs as any).browser.openContextMenu();
},
onMoveRoot(silent) {
- const title = `${this.$root.os.instanceName} Drive`;
+ const title = `${this.$root.instanceName} Drive`;
if (!silent) {
// Rewrite URL
@@ -77,7 +77,7 @@ export default Vue.extend({
this.folder = null;
},
onOpenFolder(folder, silent) {
- const title = `${folder.name} | ${this.$root.os.instanceName} Drive`;
+ const title = `${folder.name} | ${this.$root.instanceName} Drive`;
if (!silent) {
// Rewrite URL
@@ -90,7 +90,7 @@ export default Vue.extend({
this.folder = folder;
},
onOpenFile(file, silent) {
- const title = `${file.name} | ${this.$root.os.instanceName} Drive`;
+ const title = `${file.name} | ${this.$root.instanceName} Drive`;
if (!silent) {
// Rewrite URL
diff --git a/src/client/app/mobile/views/pages/favorites.vue b/src/client/app/mobile/views/pages/favorites.vue
index 35f639ec05..ed6095bd7a 100644
--- a/src/client/app/mobile/views/pages/favorites.vue
+++ b/src/client/app/mobile/views/pages/favorites.vue
@@ -30,7 +30,7 @@ export default Vue.extend({
this.fetch();
},
mounted() {
- document.title = `${this.$root.os.instanceName} | %i18n:@notifications%`;
+ document.title = `${this.$root.instanceName} | %i18n:@notifications%`;
},
methods: {
fetch() {
diff --git a/src/client/app/mobile/views/pages/followers.vue b/src/client/app/mobile/views/pages/followers.vue
index 4d69d2cf5c..e5efe185c8 100644
--- a/src/client/app/mobile/views/pages/followers.vue
+++ b/src/client/app/mobile/views/pages/followers.vue
@@ -50,7 +50,7 @@ export default Vue.extend({
this.user = user;
this.fetching = false;
- document.title = `${this.$t('followers-of').replace('{}', this.name)} | ${this.$root.os.instanceName}`;
+ document.title = `${this.$t('followers-of').replace('{}', this.name)} | ${this.$root.instanceName}`;
});
},
onLoaded() {
diff --git a/src/client/app/mobile/views/pages/following.vue b/src/client/app/mobile/views/pages/following.vue
index 52f74eff29..e55a3b4cd6 100644
--- a/src/client/app/mobile/views/pages/following.vue
+++ b/src/client/app/mobile/views/pages/following.vue
@@ -49,7 +49,7 @@ export default Vue.extend({
this.user = user;
this.fetching = false;
- document.title = `${this.$t('followers-of').replace('{}', this.name)} | ${this.$root.os.instanceName}`;
+ document.title = `${this.$t('followers-of').replace('{}', this.name)} | ${this.$root.instanceName}`;
});
},
onLoaded() {
diff --git a/src/client/app/mobile/views/pages/games/reversi.vue b/src/client/app/mobile/views/pages/games/reversi.vue
index 4663ec7f19..470f5cb163 100644
--- a/src/client/app/mobile/views/pages/games/reversi.vue
+++ b/src/client/app/mobile/views/pages/games/reversi.vue
@@ -15,7 +15,7 @@ export default Vue.extend({
XReversi: () => import('../../../../common/views/components/games/reversi/reversi.vue')
},
mounted() {
- document.title = `${this.$root.os.instanceName} %i18n:@reversi%`;
+ document.title = `${this.$root.instanceName} %i18n:@reversi%`;
},
methods: {
nav(game, actualNav) {
diff --git a/src/client/app/mobile/views/pages/home.vue b/src/client/app/mobile/views/pages/home.vue
index 8849397df1..dd4785e0ad 100644
--- a/src/client/app/mobile/views/pages/home.vue
+++ b/src/client/app/mobile/views/pages/home.vue
@@ -128,7 +128,7 @@ export default Vue.extend({
},
mounted() {
- document.title = this.$root.os.instanceName;
+ document.title = this.$root.instanceName;
Progress.start();
@@ -139,7 +139,7 @@ export default Vue.extend({
methods: {
fn() {
- (this as any).apis.post();
+ this.$root.apis.post();
},
saveSrc() {
diff --git a/src/client/app/mobile/views/pages/messaging-room.vue b/src/client/app/mobile/views/pages/messaging-room.vue
index 784c1fcaa5..2bd506b6a6 100644
--- a/src/client/app/mobile/views/pages/messaging-room.vue
+++ b/src/client/app/mobile/views/pages/messaging-room.vue
@@ -49,7 +49,7 @@ export default Vue.extend({
this.user = user;
this.fetching = false;
- document.title = `${this.$t('@.messaging')}: ${Vue.filter('userName')(this.user)} | ${this.$root.os.instanceName}`;
+ document.title = `${this.$t('@.messaging')}: ${Vue.filter('userName')(this.user)} | ${this.$root.instanceName}`;
});
}
}
diff --git a/src/client/app/mobile/views/pages/messaging.vue b/src/client/app/mobile/views/pages/messaging.vue
index 59b5410286..9af5d1cd1e 100644
--- a/src/client/app/mobile/views/pages/messaging.vue
+++ b/src/client/app/mobile/views/pages/messaging.vue
@@ -13,7 +13,7 @@ import getAcct from '../../../../../misc/acct/render';
export default Vue.extend({
i18n: i18n(),
mounted() {
- document.title = `${this.$root.os.instanceName} ${this.$t('@.messaging')}`;
+ document.title = `${this.$root.instanceName} ${this.$t('@.messaging')}`;
},
methods: {
navigate(user) {
diff --git a/src/client/app/mobile/views/pages/note.vue b/src/client/app/mobile/views/pages/note.vue
index a0449298eb..79757ea374 100644
--- a/src/client/app/mobile/views/pages/note.vue
+++ b/src/client/app/mobile/views/pages/note.vue
@@ -33,7 +33,7 @@ export default Vue.extend({
this.fetch();
},
mounted() {
- document.title = this.$root.os.instanceName;
+ document.title = this.$root.instanceName;
},
methods: {
fetch() {
diff --git a/src/client/app/mobile/views/pages/search.vue b/src/client/app/mobile/views/pages/search.vue
index 00723c26fd..fbabfdf6a0 100644
--- a/src/client/app/mobile/views/pages/search.vue
+++ b/src/client/app/mobile/views/pages/search.vue
@@ -36,7 +36,7 @@ export default Vue.extend({
}
},
mounted() {
- document.title = `%i18n:@search%: ${this.q} | ${this.$root.os.instanceName}`;
+ document.title = `%i18n:@search%: ${this.q} | ${this.$root.instanceName}`;
this.fetch();
},
diff --git a/src/client/app/mobile/views/pages/settings.vue b/src/client/app/mobile/views/pages/settings.vue
index bc1af8c57d..68dd9bfbbb 100644
--- a/src/client/app/mobile/views/pages/settings.vue
+++ b/src/client/app/mobile/views/pages/settings.vue
@@ -343,12 +343,12 @@ export default Vue.extend({
this.checkingForUpdate = false;
this.latestVersion = newer;
if (newer == null) {
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('no-updates'),
text: this.$t('no-updates-desc')
});
} else {
- (this as any).apis.dialog({
+ this.$root.apis.dialog({
title: this.$t('update-available'),
text: this.$t('update-available-desc')
});
diff --git a/src/client/app/mobile/views/pages/user-lists.vue b/src/client/app/mobile/views/pages/user-lists.vue
index 5cd9d144db..2f0c25b4a8 100644
--- a/src/client/app/mobile/views/pages/user-lists.vue
+++ b/src/client/app/mobile/views/pages/user-lists.vue
@@ -38,7 +38,7 @@ export default Vue.extend({
},
methods: {
fn() {
- (this as any).apis.input({
+ this.$root.apis.input({
title: this.$t('enter-list-name'),
}).then(async title => {
const list = await this.$root.api('users/lists/create', {
diff --git a/src/client/app/mobile/views/pages/user.vue b/src/client/app/mobile/views/pages/user.vue
index 5b915bc1e1..7ac6e17723 100644
--- a/src/client/app/mobile/views/pages/user.vue
+++ b/src/client/app/mobile/views/pages/user.vue
@@ -110,7 +110,7 @@ export default Vue.extend({
this.fetching = false;
Progress.done();
- document.title = `${Vue.filter('userName')(this.user)} | ${this.$root.os.instanceName}`;
+ document.title = `${Vue.filter('userName')(this.user)} | ${this.$root.instanceName}`;
});
},
diff --git a/src/client/app/mobile/views/pages/widgets.vue b/src/client/app/mobile/views/pages/widgets.vue
index 739d6ecadd..8db5399cfd 100644
--- a/src/client/app/mobile/views/pages/widgets.vue
+++ b/src/client/app/mobile/views/pages/widgets.vue
@@ -104,7 +104,7 @@ export default Vue.extend({
},
mounted() {
- document.title = this.$root.os.instanceName;
+ document.title = this.$root.instanceName;
},
methods: {