[Client] Fix bug

This commit is contained in:
syuilo
2018-11-09 08:26:32 +09:00
parent 60ef3e3563
commit fccbecf159
44 changed files with 83 additions and 81 deletions

View File

@ -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() {

View File

@ -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

View File

@ -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 => {

View File

@ -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: [{

View File

@ -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

View File

@ -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;
});

View File

@ -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'));
});
}
}

View File

@ -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')
});

View File

@ -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', {

View File

@ -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();
}
}
});

View File

@ -139,7 +139,7 @@ export default Vue.extend({
},
post() {
(this as any).apis.post();
this.$root.apis.post();
},
drive() {

View File

@ -67,7 +67,7 @@ export default Vue.extend({
methods: {
post() {
(this as any).apis.post();
this.$root.apis.post();
},
toggleZenMode() {

View File

@ -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', {

View File

@ -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

View File

@ -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>

View File

@ -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', {

View File

@ -23,7 +23,7 @@ export default Vue.extend({
}
},
mounted() {
document.title = this.$root.os.instanceName;
document.title = this.$root.instanceName;
Progress.start();
},

View File

@ -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;
});
}

View File

@ -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)
});