diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-08-28 19:59:30 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-08-28 19:59:30 +0900 |
| commit | a5f80a81b431c483d55536106ba6b5bd3f116ec1 (patch) | |
| tree | 50a811f04675d95e3000111246807548201c655f | |
| parent | :v: (diff) | |
| download | misskey-a5f80a81b431c483d55536106ba6b5bd3f116ec1.tar.gz misskey-a5f80a81b431c483d55536106ba6b5bd3f116ec1.tar.bz2 misskey-a5f80a81b431c483d55536106ba6b5bd3f116ec1.zip | |
#163
Diffstat (limited to '')
| -rw-r--r-- | locales/en.yml | 6 | ||||
| -rw-r--r-- | locales/ja.yml | 6 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/page/settings/profile.tag | 50 |
3 files changed, 62 insertions, 0 deletions
diff --git a/locales/en.yml b/locales/en.yml index 6d636a1108..bfec7ebb54 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -356,6 +356,12 @@ mobile: location: "Location" description: "Description" birthday: "Birthday" + avatar: "Avatar" + banner: "Banner" + avatar-saved: "Avatar updated successfully" + banner-saved: "Banner updated successfully" + set-avatar: "Choose an avatar" + set-banner: "Choose a banner" save: "Save" saved: "Profile updated successfully" diff --git a/locales/ja.yml b/locales/ja.yml index 75b1fd6275..e2c537fc41 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -356,6 +356,12 @@ mobile: location: "場所" description: "自己紹介" birthday: "誕生日" + avatar: "アバター" + banner: "バナー" + avatar-saved: "アバターを保存しました" + banner-saved: "バナーを保存しました" + set-avatar: "アバターを選択する" + set-banner: "バナーを選択する" save: "保存" saved: "プロフィールを保存しました" diff --git a/src/web/app/mobile/tags/page/settings/profile.tag b/src/web/app/mobile/tags/page/settings/profile.tag index dfe0586c1c..1f9455cd2c 100644 --- a/src/web/app/mobile/tags/page/settings/profile.tag +++ b/src/web/app/mobile/tags/page/settings/profile.tag @@ -34,6 +34,14 @@ <p>%i18n:mobile.tags.mk-profile-setting.birthday%</p> <input ref="birthday" type="date" value={ I.profile.birthday }/> </label> + <label> + <p>%i18n:mobile.tags.mk-profile-setting.avatar%</p> + <button onclick={ setAvatar } disabled={ avatarSaving }>%i18n:mobile.tags.mk-profile-setting.set-avatar%</button> + </label> + <label> + <p>%i18n:mobile.tags.mk-profile-setting.banner%</p> + <button onclick={ setBanner } disabled={ bannerSaving }>%i18n:mobile.tags.mk-profile-setting.set-banner%</button> + </label> <button class="save" onclick={ save } disabled={ saving }><i class="fa fa-check"></i>%i18n:mobile.tags.mk-profile-setting.save%</button> <style> :scope @@ -84,6 +92,48 @@ this.mixin('i'); this.mixin('api'); + this.setAvatar = () => { + const i = riot.mount(document.body.appendChild(document.createElement('mk-drive-selector')), { + multiple: false + })[0]; + i.one('selected', file => { + this.update({ + avatarSaving: true + }); + + this.api('i/update', { + avatar_id: file.id + }).then(() => { + this.update({ + avatarSaving: false + }); + + alert('%i18n:mobile.tags.mk-profile-setting.avatar-saved%'); + }); + }); + }; + + this.setBanner = () => { + const i = riot.mount(document.body.appendChild(document.createElement('mk-drive-selector')), { + multiple: false + })[0]; + i.one('selected', file => { + this.update({ + bannerSaving: true + }); + + this.api('i/update', { + banner_id: file.id + }).then(() => { + this.update({ + bannerSaving: false + }); + + alert('%i18n:mobile.tags.mk-profile-setting.banner-saved%'); + }); + }); + }; + this.save = () => { this.update({ saving: true |