From 143aa3b990c0e0fac98c4a097d68e9f7518f1940 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 21 Apr 2017 18:52:42 +0300 Subject: [PATCH] Started captcha and better avatar control, improved login form to fit register link better. --- src/components/login_form/login_form.vue | 22 ++++++++--- src/components/registration/registration.vue | 14 ++++++- src/components/settings/settings.js | 20 ++++++++-- src/components/settings/settings.vue | 40 +++++++++++++++++++- 4 files changed, 84 insertions(+), 12 deletions(-) diff --git a/src/components/login_form/login_form.vue b/src/components/login_form/login_form.vue index bf3f24e76b..585af6f64e 100644 --- a/src/components/login_form/login_form.vue +++ b/src/components/login_form/login_form.vue @@ -15,14 +15,14 @@
- +
{{authError}}
-
- Register new account -
@@ -42,8 +42,8 @@ } .btn { - margin-top: 1.0em; min-height: 28px; + width: 10em; } .error { @@ -53,6 +53,18 @@ min-height: 28px; line-height: 28px; } + + .register { + flex: 1 1; + } + + .login-bottom { + margin-top: 1.0em; + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + } } diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index 5267f0e163..f010d8ab01 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -31,6 +31,13 @@ +
@@ -63,7 +70,7 @@ } .terms-of-service { - flex: 0 1 55%; + flex: 0 1 50%; margin: 0.8em; } @@ -99,6 +106,11 @@ padding: 0.1em 0.2em 0.2em 0.2em; } + .captcha { + max-width: 350px; + margin-bottom: 0.4em; + } + .btn { //align-self: flex-start; //width: 10em; diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 883e5caaea..e4ea56f63c 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -7,7 +7,8 @@ const settings = { hideAttachmentsLocal: this.$store.state.config.hideAttachments, hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv, hideNsfwLocal: this.$store.state.config.hideNsfw, - muteWordsString: this.$store.state.config.muteWords.join('\n') + muteWordsString: this.$store.state.config.muteWords.join('\n'), + previewfile: null } }, components: { @@ -25,15 +26,26 @@ const settings = { const reader = new FileReader() reader.onload = ({target}) => { const img = target.result - - this.$store.state.api.backendInteractor.updateAvatar({params: {img}}).then((user) => { + this.previewfile = img + /*this.$store.state.api.backendInteractor.updateAvatar({params: {img}}).then((user) => { if (!user.error) { this.$store.commit('addNewUsers', [user]) this.$store.commit('setCurrentUser', user) } - }) + })*/ } reader.readAsDataURL(file) + }, + submitAvatar () { + if (!this.previewfile) + return + const img = this.previewfile + this.$store.state.api.backendInteractor.updateAvatar({params: {img}}).then((user) => { + if (!user.error) { + this.$store.commit('addNewUsers', [user]) + this.$store.commit('setCurrentUser', user) + } + }) } }, watch: { diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 7ceac828b0..bdc0f35186 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -8,12 +8,17 @@

Theme

-
+

Avatar

- +

Your current avatar:

+ +

Set new avatar:

+ +
+

Filtering

@@ -51,6 +56,37 @@ width: 100%; height: 100px; } + + .old-avatar { + width: 128px; + border-radius: 5px; + } + + .new-avatar { + max-width: 100%; + border-radius: 5px; + } + + .btn { + margin-top: 1em; + min-height: 28px; + width: 10em; + } + + .cropper { + //position: absolute; + cursor: move; + width: 128px; + height: 128px; + border:1px solid #fff; + background-color: #000000; + .sub { + width: 100%; + height: 100%; + margin: -1px -1px -1px -1px ; + border:1px dashed #000; + } + } } .setting-list { list-style-type: none;