From b602f819402e42b3756cee3defc933812e7dea8e Mon Sep 17 00:00:00 2001
From: "Mr. Stallion" <mrstallion@nobody.nowhere.fauxdomain.ext>
Date: Sun, 19 Apr 2020 13:53:08 -0500
Subject: [PATCH] Cleanup

---
 chat/CharacterSearchHistory.vue | 39 ++++++++++++++++++++++++++++---
 chat/PmPartnerAdder.vue         | 12 ++++++++--
 chat/StatusPicker.vue           | 41 ++++++++++++++++++++++++++++++---
 readme.md                       |  1 -
 4 files changed, 84 insertions(+), 9 deletions(-)

diff --git a/chat/CharacterSearchHistory.vue b/chat/CharacterSearchHistory.vue
index c6c76eb..25b69f4 100644
--- a/chat/CharacterSearchHistory.vue
+++ b/chat/CharacterSearchHistory.vue
@@ -5,10 +5,12 @@
                 <div class="form-col radio-col">
                     <input type="radio" :id="'search_history_' + index" :name="'search_history_' + index" v-model="selectedSearch" v-bind:value="index" />
                 </div>
-                <div class="form-col content-col">
-                    <label class="custom-control-label" :for="'search_history_' + index" @dblclick="submit">
+                <div class="form-col content-col" @click="select(index)" @dblclick="submit">
+                    <span class="before-content"><i class="fas" :class="{ 'fa-check-circle': (index === selectedSearch) }" /></span>
+                    <label class="custom-control-label" :for="'search_history_' + index">
                         {{describeSearch(search)}}
                     </label>
+                    <span class="content-action" @click="removeSearchHistoryEntry(index)"><i class="fas fa-times-circle" /></span>
                 </div>
             </div>
         </form>
@@ -85,6 +87,18 @@
                 ', '
             );
         }
+
+
+        async removeSearchHistoryEntry(index: number): Promise<void> {
+          this.history.splice(index, 1);
+
+          await core.settingsStore.set('searchHistory', this.history);
+        }
+
+
+        select(index: number): void {
+            this.selectedSearch = index;
+        }
     }
 </script>
 
@@ -100,9 +114,28 @@
 
         .content-col {
             min-width: 100%;
+            display: flex;
 
             label {
-                min-width: 100%;
+                flex: 1;
+            }
+
+            .before-content {
+                width: 1.3rem;
+                margin-bottom: auto;
+                margin-top: auto;
+            }
+
+            .content-action {
+                float: right;
+                opacity: 0.2;
+                margin-bottom: auto;
+                margin-top: auto;
+                margin-left: 1rem;
+
+                &:hover {
+                    opacity: 0.8;
+                }
             }
         }
 
diff --git a/chat/PmPartnerAdder.vue b/chat/PmPartnerAdder.vue
index c6aacc7..33d9dce 100644
--- a/chat/PmPartnerAdder.vue
+++ b/chat/PmPartnerAdder.vue
@@ -1,7 +1,7 @@
 <template>
    <modal action="Open Conversation" ref="dialog" @submit="submit" style="width:98%" dialogClass="ads-dialog" buttonText="Open">
         <div>
-            <input type="text" id="name" v-model="name" placeholder="Name" />
+            <input type="text" id="name" v-model="name" placeholder="Name" ref="name" />
             <div class="error" v-if="error">{{error}}</div>
         </div>
 
@@ -10,7 +10,7 @@
 
 
 <script lang="ts">
-import { Component } from '@f-list/vue-ts';
+import { Component, Hook } from '@f-list/vue-ts';
 import CustomDialog from '../components/custom_dialog';
 import Modal from '../components/Modal.vue';
 import core from './core';
@@ -22,9 +22,17 @@ export default class PmPartnerAdder extends CustomDialog {
     name = '';
     error: string | null = null;
 
+
+    @Hook('activated')
+    async onMounted(): Promise<void> {
+      (this.$refs.name as HTMLInputElement).focus();
+    }
+
+
     submit(): void {
         const c = core.characters.get(this.name);
 
+
         if (c) {
             const conversation = core.conversations.getPrivate(c);
 
diff --git a/chat/StatusPicker.vue b/chat/StatusPicker.vue
index 0fd3b7d..6a52545 100644
--- a/chat/StatusPicker.vue
+++ b/chat/StatusPicker.vue
@@ -5,10 +5,12 @@
                 <div class="form-col radio-col">
                     <input type="radio" :id="'history_status_' + index" :name="'history_status_' + index" v-model="selectedStatus" v-bind:value="index" />
                 </div>
-                <div class="form-col content-col">
-                    <label class="custom-control-label" :for="'history_status_' + index" @dblclick="submit">
+                <div class="form-col content-col" @click="select(index)" @dblclick="submit">
+                    <span class="before-content"><i class="fas" :class="{ 'fa-check-circle': (index === selectedStatus) }" /></span>
+                    <label class="custom-control-label" :for="'history_status_' + index">
                         <bbcode :text="historicStatus"></bbcode>
                     </label>
+                    <span class="content-action" @click="removeStatusHistoryEntry(index)"><i class="fas fa-times-circle" /></span>
                 </div>
             </div>
         </form>
@@ -70,6 +72,20 @@
                 this.callback(this.history[this.selectedStatus]);
             }
         }
+
+
+        async removeStatusHistoryEntry(index: number): Promise<void> {
+          if(confirm('Are you sure you want to remove this status message?')) {
+              this.history.splice(index, 1);
+
+              await core.settingsStore.set('statusHistory', this.history);
+          }
+        }
+
+
+        select(index: number): void {
+            this.selectedStatus = index;
+        }
     }
 </script>
 
@@ -85,9 +101,28 @@
 
         .content-col {
             min-width: 100%;
+            display: flex;
 
             label {
-                min-width: 100%;
+                flex: 1;
+            }
+
+            .before-content {
+                width: 1.3rem;
+                margin-bottom: auto;
+                margin-top: auto;
+            }
+
+            .content-action {
+                float: right;
+                opacity: 0.2;
+                margin-bottom: auto;
+                margin-top: auto;
+                margin-left: 1rem;
+
+                &:hover {
+                    opacity: 0.8;
+                }
             }
         }
 
diff --git a/readme.md b/readme.md
index 0382fda..0976408 100644
--- a/readme.md
+++ b/readme.md
@@ -97,7 +97,6 @@ This repository contains a heavily customized version of the mainline F-Chat 3.0
 *   Bug? Usually submissive vs usually submissive shows up as 'maybe'
 *   Bug? YOU have 'loves humans'; THEY have 'no furry characters, just humans' -- THEIR ad shows green, not red -- your side of comparison is fully green, they just have 'no furry pairings' in red
 *   Bug? [color] acts weird
-*   Add new chat is case sensitive
 
 
 # F-List Exported