From 8d6750d9c2816e33a0444cd978f94009d8b85d47 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Fri, 5 Jul 2019 10:17:44 +0300
Subject: eslint --fix --ext .js,.vue src

---
 src/components/conversation/conversation.vue | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

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

diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 0b4998c3..f5642c73 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -1,25 +1,34 @@
 <template>
-  <div class="timeline panel-default" :class="[isExpanded ? 'panel' : 'panel-disabled']">
-    <div v-if="isExpanded" class="panel-heading conversation-heading">
+  <div
+    class="timeline panel-default"
+    :class="[isExpanded ? 'panel' : 'panel-disabled']"
+  >
+    <div
+      v-if="isExpanded"
+      class="panel-heading conversation-heading"
+    >
       <span class="title"> {{ $t('timeline.conversation') }} </span>
       <span v-if="collapsable">
-        <a href="#" @click.prevent="toggleExpanded">{{ $t('timeline.collapse') }}</a>
+        <a
+          href="#"
+          @click.prevent="toggleExpanded"
+        >{{ $t('timeline.collapse') }}</a>
       </span>
     </div>
     <status
       v-for="status in conversation"
-      @goto="setHighlight"
-      @toggleExpanded="toggleExpanded"
       :key="status.id"
-      :inlineExpanded="collapsable && isExpanded"
+      :inline-expanded="collapsable && isExpanded"
       :statusoid="status"
-      :expandable='!isExpanded'
-      :showPinned="showPinned"
+      :expandable="!isExpanded"
+      :show-pinned="showPinned"
       :focused="focused(status.id)"
-      :inConversation="isExpanded"
+      :in-conversation="isExpanded"
       :highlight="getHighlight()"
       :replies="getReplies(status.id)"
+      @goto="setHighlight"
       class="status-fadein panel-body"
+      @toggleExpanded="toggleExpanded"
     />
   </div>
 </template>
-- 
cgit v1.2.3-70-g09d2


From 1ec4caa0bbea18854a8a7bccaa7e2a0ea8bdf79e Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Sat, 6 Jul 2019 23:52:10 +0300
Subject: fix merge conflict

---
 src/components/conversation/conversation.vue       |   2 +-
 .../post_status_form/post_status_form.vue          | 165 ++++++++++++++++++---
 2 files changed, 143 insertions(+), 24 deletions(-)

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

diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index f5642c73..5a900607 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -26,8 +26,8 @@
       :in-conversation="isExpanded"
       :highlight="getHighlight()"
       :replies="getReplies(status.id)"
-      @goto="setHighlight"
       class="status-fadein panel-body"
+      @goto="setHighlight"
       @toggleExpanded="toggleExpanded"
     />
   </div>
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 8ffacd75..379c9f3b 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -58,30 +58,150 @@
           <span v-if="safeDMEnabled">{{ $t('post_status.direct_warning_to_first_only') }}</span>
           <span v-else>{{ $t('post_status.direct_warning_to_all') }}</span>
         </p>
-      </EmojiInput>
-      <div class="visibility-tray">
-        <scope-selector
-          :showAll="showAllScopes"
-          :userDefault="userDefaultScope"
-          :originalScope="copyMessageScope"
-          :initialScope="newStatus.visibility"
-          :onScopeChange="changeVis"/>
-
-        <div class="text-format" v-if="postFormats.length > 1">
-          <label for="post-content-type" class="select">
-            <select id="post-content-type" v-model="newStatus.contentType" class="form-control">
-              <option v-for="postFormat in postFormats" :key="postFormat" :value="postFormat">
-                {{$t(`post_status.content_type["${postFormat}"]`)}}
-              </option>
-            </select>
-            <i class="icon-down-open"></i>
-          </label>
+        <EmojiInput
+          v-if="newStatus.spoilerText || alwaysShowSubject"
+          v-model="newStatus.spoilerText"
+          :suggest="emojiSuggestor"
+          class="form-control"
+        >
+          <input
+
+            v-model="newStatus.spoilerText"
+            type="text"
+            :placeholder="$t('post_status.content_warning')"
+            class="form-post-subject"
+          >
+        </EmojiInput>
+        <EmojiInput
+          v-model="newStatus.status"
+          :suggest="emojiUserSuggestor"
+          class="form-control main-input"
+        >
+          <textarea
+            ref="textarea"
+            v-model="newStatus.status"
+            :placeholder="$t('post_status.default')"
+            rows="1"
+            :disabled="posting"
+            class="form-post-body"
+            @keydown.meta.enter="postStatus(newStatus)"
+            @keyup.ctrl.enter="postStatus(newStatus)"
+            @drop="fileDrop"
+            @dragover.prevent="fileDrag"
+            @input="resize"
+            @paste="paste"
+          />
+          <p
+            v-if="hasStatusLengthLimit"
+            class="character-counter faint"
+            :class="{ error: isOverLengthLimit }"
+          >
+            {{ charactersLeft }}
+          </p>
+        </EmojiInput>
+        <div class="visibility-tray">
+          <scope-selector
+            :show-all="showAllScopes"
+            :user-default="userDefaultScope"
+            :original-scope="copyMessageScope"
+            :initial-scope="newStatus.visibility"
+            :on-scope-change="changeVis"
+          />
+
+          <div
+            v-if="postFormats.length > 1"
+            class="text-format"
+          >
+            <label
+              for="post-content-type"
+              class="select"
+            >
+              <select
+                id="post-content-type"
+                v-model="newStatus.contentType"
+                class="form-control"
+              >
+                <option
+                  v-for="postFormat in postFormats"
+                  :key="postFormat"
+                  :value="postFormat"
+                >
+                  {{ $t(`post_status.content_type["${postFormat}"]`) }}
+                </option>
+              </select>
+              <i class="icon-down-open" />
+            </label>
+          </div>
+          <div
+            v-if="postFormats.length === 1 && postFormats[0] !== 'text/plain'"
+            class="text-format"
+          >
+            <span class="only-format">
+              {{ $t(`post_status.content_type["${postFormats[0]}"]`) }}
+            </span>
+          </div>
         </div>
-        <div class="text-format" v-if="postFormats.length === 1 && postFormats[0] !== 'text/plain'">
-          <span class="only-format">
-            {{$t(`post_status.content_type["${postFormats[0]}"]`)}}
-          </span>
+      </div>
+      <poll-form
+        v-if="pollsAvailable"
+        ref="pollForm"
+        :visible="pollFormVisible"
+        @update-poll="setPoll"
+      />
+      <div class="form-bottom">
+        <div class="form-bottom-left">
+          <media-upload
+            ref="mediaUpload"
+            :drop-files="dropFiles"
+            @uploading="disableSubmit"
+            @uploaded="addMediaFile"
+            @upload-failed="uploadFailed"
+          />
+          <div
+            v-if="pollsAvailable"
+            class="poll-icon"
+          >
+            <i
+              :title="$t('polls.add_poll')"
+              class="icon-chart-bar btn btn-default"
+              :class="pollFormVisible && 'selected'"
+              @click="togglePollForm"
+            />
+          </div>
         </div>
+
+        <button
+          v-if="posting"
+          disabled
+          class="btn btn-default"
+        >
+          {{ $t('post_status.posting') }}
+        </button>
+        <button
+          v-else-if="isOverLengthLimit"
+          disabled
+          class="btn btn-default"
+        >
+          {{ $t('general.submit') }}
+        </button>
+        <button
+          v-else
+          :disabled="submitDisabled"
+          type="submit"
+          class="btn btn-default"
+        >
+          {{ $t('general.submit') }}
+        </button>
+      </div>
+      <div
+        v-if="error"
+        class="alert error"
+      >
+        Error: {{ error }}
+        <i
+          class="button-icon icon-cancel"
+          @click="clearError"
+        />
       </div>
       <div class="attachments">
         <div
@@ -203,7 +323,6 @@
     cursor: pointer;
   }
 
-
   .error {
     text-align: center;
   }
-- 
cgit v1.2.3-70-g09d2


From 4b444708f2594028e47dad91f1e90728592474ae Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Thu, 15 Aug 2019 13:07:07 -0400
Subject: fix pin showing logic in conversation

---
 src/components/conversation/conversation.js  | 7 +++++--
 src/components/conversation/conversation.vue | 2 +-
 src/components/status/status.vue             | 2 +-
 src/components/timeline/timeline.vue         | 2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

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

diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index a2b3aeab..cb4db8ea 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -1,4 +1,4 @@
-import { reduce, filter, findIndex, clone } from 'lodash'
+import { reduce, filter, findIndex, clone, keyBy } from 'lodash'
 import Status from '../status/status.vue'
 
 const sortById = (a, b) => {
@@ -42,7 +42,7 @@ const conversation = {
     'statusoid',
     'collapsable',
     'isPage',
-    'showPinned'
+    'pinnedStatusIds'
   ],
   created () {
     if (this.isPage) {
@@ -104,6 +104,9 @@ const conversation = {
     },
     isExpanded () {
       return this.expanded || this.isPage
+    },
+    pinnedStatusIdsObject () {
+      return keyBy(this.pinnedStatusIds, id => id)
     }
   },
   components: {
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 5a900607..d4e199c1 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -21,7 +21,7 @@
       :inline-expanded="collapsable && isExpanded"
       :statusoid="status"
       :expandable="!isExpanded"
-      :show-pinned="showPinned"
+      :show-pinned="pinnedStatusIdsObject[status.id]"
       :focused="focused(status.id)"
       :in-conversation="isExpanded"
       :highlight="getHighlight()"
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index ab506632..64218f6e 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -32,7 +32,7 @@
     </template>
     <template v-else>
       <div
-        v-if="showPinned && statusoid.pinned"
+        v-if="showPinned"
         class="status-pin"
       >
         <i class="fa icon-pin faint" />
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index 0cb4b3ef..23795bec 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -35,7 +35,7 @@
             class="status-fadein"
             :statusoid="timeline.statusesObject[statusId]"
             :collapsable="true"
-            :show-pinned="true"
+            :pinned-status-ids="pinnedStatusIds"
           />
         </template>
         <template v-for="status in timeline.visibleStatuses">
-- 
cgit v1.2.3-70-g09d2


From 1146119d6af4bdd3d15bd635806520df78504ad2 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Thu, 15 Aug 2019 13:16:55 -0400
Subject: generate idObj at timeline level

---
 src/components/conversation/conversation.js  | 7 ++-----
 src/components/conversation/conversation.vue | 2 +-
 src/components/timeline/timeline.js          | 3 +++
 src/components/timeline/timeline.vue         | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

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

diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index cb4db8ea..19dcb257 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -1,4 +1,4 @@
-import { reduce, filter, findIndex, clone, keyBy } from 'lodash'
+import { reduce, filter, findIndex, clone } from 'lodash'
 import Status from '../status/status.vue'
 
 const sortById = (a, b) => {
@@ -42,7 +42,7 @@ const conversation = {
     'statusoid',
     'collapsable',
     'isPage',
-    'pinnedStatusIds'
+    'pinnedStatusIdsObject'
   ],
   created () {
     if (this.isPage) {
@@ -104,9 +104,6 @@ const conversation = {
     },
     isExpanded () {
       return this.expanded || this.isPage
-    },
-    pinnedStatusIdsObject () {
-      return keyBy(this.pinnedStatusIds, id => id)
     }
   },
   components: {
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index d4e199c1..f184c071 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -21,7 +21,7 @@
       :inline-expanded="collapsable && isExpanded"
       :statusoid="status"
       :expandable="!isExpanded"
-      :show-pinned="pinnedStatusIdsObject[status.id]"
+      :show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
       :focused="focused(status.id)"
       :in-conversation="isExpanded"
       :highlight="getHighlight()"
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index aac3869f..2e317e8e 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -59,6 +59,9 @@ const Timeline = {
       const ids = getExcludedStatusIdsByPinning(this.timeline.visibleStatuses, this.pinnedStatusIds)
       // Convert id array to object
       return keyBy(ids, id => id)
+    },
+    pinnedStatusIdsObject () {
+      return keyBy(this.pinnedStatusIds, id => id)
     }
   },
   components: {
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index 23795bec..4ad51714 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -35,7 +35,7 @@
             class="status-fadein"
             :statusoid="timeline.statusesObject[statusId]"
             :collapsable="true"
-            :pinned-status-ids="pinnedStatusIds"
+            :pinned-status-ids-object="pinnedStatusIdsObject"
           />
         </template>
         <template v-for="status in timeline.visibleStatuses">
-- 
cgit v1.2.3-70-g09d2

