From 2d91c9d949e5a696585de566f2a5498bdd3c9ffa Mon Sep 17 00:00:00 2001
From: Xiaofeng An <futureweb2020@yandex.com>
Date: Fri, 8 Feb 2019 10:50:27 -0500
Subject: make bio field auto-complete

---
 src/components/user_settings/user_settings.vue | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/components/user_settings/user_settings.vue')

diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index ea5b3de5..c5ee672f 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -11,7 +11,7 @@
             <p>{{$t('settings.name')}}</p>
             <input class='name-changer' id='username' v-model="newName"></input>
             <p>{{$t('settings.bio')}}</p>
-            <textarea class="bio" v-model="newBio"></textarea>
+            <auto-complete-input :classObj="{ bio: true }" v-model="newBio"/>
             <p>
               <input type="checkbox" v-model="newLocked" id="account-locked">
               <label for="account-locked">{{$t('settings.lock_account_description')}}</label>
-- 
cgit v1.2.3-70-g09d2


From 128dcc637edb5550168423941171f5b567365b7c Mon Sep 17 00:00:00 2001
From: Xiaofeng An <futureweb2020@yandex.com>
Date: Fri, 8 Feb 2019 11:01:12 -0500
Subject: make name field auto-complete

---
 .../autocomplete_input/autocomplete_input.vue         | 19 +++++++++++++++++++
 src/components/user_settings/user_settings.vue        |  4 ++--
 2 files changed, 21 insertions(+), 2 deletions(-)

(limited to 'src/components/user_settings/user_settings.vue')

diff --git a/src/components/autocomplete_input/autocomplete_input.vue b/src/components/autocomplete_input/autocomplete_input.vue
index 1c049891..d3bda597 100644
--- a/src/components/autocomplete_input/autocomplete_input.vue
+++ b/src/components/autocomplete_input/autocomplete_input.vue
@@ -1,6 +1,7 @@
 <template>
   <div>
     <textarea
+      v-if="multiline"
       ref="textarea"
       :value="text"
       @input="text = $event.target.value, $emit('input', $event.target.value), autoResize && resize($event)" 
@@ -17,6 +18,24 @@
       @keydown.meta.enter="keydownMetaEnter && keydownMetaEnter()"
       @keyup.ctrl.enter="keyupCtrlEnter && keyupCtrlEnter()">
     </textarea>
+    <input
+      v-else
+      ref="textarea"
+      :value="text"
+      :id="id"
+      @input="text = $event.target.value, $emit('input', $event.target.value), autoResize && resize($event)" 
+      @click="setCaret"
+      @keyup="setCaret" :placeholder="placeholder" rows="1" :class="classObj"
+      @keydown.down="cycleForward"
+      @keydown.up="cycleBackward"
+      @keydown.shift.tab="cycleBackward"
+      @keydown.tab="cycleForward"
+      @keydown.enter="replaceCandidate"
+      @drop="drop && drop()"
+      @dragover.prevent="dragoverPrevent && dragoverPrevent()"
+      @paste="paste && paste()"
+      @keydown.meta.enter="keydownMetaEnter && keydownMetaEnter()"
+      @keyup.ctrl.enter="keyupCtrlEnter && keyupCtrlEnter()"/>
     <div style="position:relative;" v-if="candidates">
       <div class="autocomplete-panel">
         <div v-for="candidate in candidates" @click="replace(candidate.utf || (candidate.screen_name + ' '))">
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index c5ee672f..7f81af1b 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -9,9 +9,9 @@
           <div class="setting-item" >
             <h2>{{$t('settings.name_bio')}}</h2>
             <p>{{$t('settings.name')}}</p>
-            <input class='name-changer' id='username' v-model="newName"></input>
+            <auto-complete-input :classObj="{ 'name-changer': true }" :id="'username'" v-model="newName"/>
             <p>{{$t('settings.bio')}}</p>
-            <auto-complete-input :classObj="{ bio: true }" v-model="newBio"/>
+            <auto-complete-input :classObj="{ bio: true }" v-model="newBio" :multiline="true"/>
             <p>
               <input type="checkbox" v-model="newLocked" id="account-locked">
               <label for="account-locked">{{$t('settings.lock_account_description')}}</label>
-- 
cgit v1.2.3-70-g09d2

