From 6573f36485530a37f6bdd5786477b3ad904a9cbf Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 21 Feb 2018 05:55:19 +0900 Subject: [PATCH] wip --- src/web/app/desktop/api/update-avatar.ts | 7 ++++-- src/web/app/desktop/api/update-banner.ts | 9 ++++--- .../desktop/views/components/crop-window.vue | 11 ++++++-- .../app/desktop/views/components/drive.vue | 2 +- .../views/components/progress-dialog.vue | 25 ++++++++++--------- .../views/components/settings.profile.vue | 6 +---- src/web/app/init.ts | 10 +++++--- webpack/webpack.config.ts | 6 +++++ 8 files changed, 47 insertions(+), 29 deletions(-) diff --git a/src/web/app/desktop/api/update-avatar.ts b/src/web/app/desktop/api/update-avatar.ts index eff072834..c3e0ce14c 100644 --- a/src/web/app/desktop/api/update-avatar.ts +++ b/src/web/app/desktop/api/update-avatar.ts @@ -8,7 +8,7 @@ export default (os: OS) => (cb, file = null) => { const w = new CropWindow({ propsData: { - file: file, + image: file, title: 'アバターとして表示する部分を選択', aspectRatio: 1 / 1 } @@ -60,7 +60,7 @@ export default (os: OS) => (cb, file = null) => { }; xhr.upload.onprogress = e => { - if (e.lengthComputable) (dialog as any).updateProgress(e.loaded, e.total); + if (e.lengthComputable) (dialog as any).update(e.loaded, e.total); }; xhr.send(data); @@ -70,6 +70,9 @@ export default (os: OS) => (cb, file = null) => { os.api('i/update', { avatar_id: file.id }).then(i => { + os.i.avatar_id = i.avatar_id; + os.i.avatar_url = i.avatar_url; + os.apis.dialog({ title: '%fa:info-circle%アバターを更新しました', text: '新しいアバターが反映されるまで時間がかかる場合があります。', diff --git a/src/web/app/desktop/api/update-banner.ts b/src/web/app/desktop/api/update-banner.ts index 575161658..9e94dc423 100644 --- a/src/web/app/desktop/api/update-banner.ts +++ b/src/web/app/desktop/api/update-banner.ts @@ -8,7 +8,7 @@ export default (os: OS) => (cb, file = null) => { const w = new CropWindow({ propsData: { - file: file, + image: file, title: 'バナーとして表示する部分を選択', aspectRatio: 16 / 9 } @@ -60,7 +60,7 @@ export default (os: OS) => (cb, file = null) => { }; xhr.upload.onprogress = e => { - if (e.lengthComputable) (dialog as any).updateProgress(e.loaded, e.total); + if (e.lengthComputable) (dialog as any).update(e.loaded, e.total); }; xhr.send(data); @@ -68,8 +68,11 @@ export default (os: OS) => (cb, file = null) => { const set = file => { os.api('i/update', { - avatar_id: file.id + banner_id: file.id }).then(i => { + os.i.banner_id = i.banner_id; + os.i.banner_url = i.banner_url; + os.apis.dialog({ title: '%fa:info-circle%バナーを更新しました', text: '新しいバナーが反映されるまで時間がかかる場合があります。', diff --git a/src/web/app/desktop/views/components/crop-window.vue b/src/web/app/desktop/views/components/crop-window.vue index 2ba62a3a6..27d89a9ff 100644 --- a/src/web/app/desktop/views/components/crop-window.vue +++ b/src/web/app/desktop/views/components/crop-window.vue @@ -1,10 +1,12 @@