livechat 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/app/models/livechat/conversation.rb +6 -0
- data/app/views/layouts/livechat/application.html.erb +2 -1
- data/app/views/livechat/conversations/_thread_panel.html.erb +2 -7
- data/app/views/livechat/conversations/index.html.erb +1 -1
- data/config/locales/livechat.ar.yml +1 -1
- data/config/locales/livechat.bg.yml +1 -1
- data/config/locales/livechat.bn.yml +1 -1
- data/config/locales/livechat.de.yml +1 -1
- data/config/locales/livechat.el.yml +1 -1
- data/config/locales/livechat.en.yml +1 -1
- data/config/locales/livechat.es.yml +1 -1
- data/config/locales/livechat.fr.yml +1 -1
- data/config/locales/livechat.hi.yml +1 -1
- data/config/locales/livechat.hr.yml +1 -1
- data/config/locales/livechat.id.yml +1 -1
- data/config/locales/livechat.it.yml +1 -1
- data/config/locales/livechat.ja.yml +1 -1
- data/config/locales/livechat.ko.yml +1 -1
- data/config/locales/livechat.lb.yml +1 -1
- data/config/locales/livechat.nl.yml +1 -1
- data/config/locales/livechat.pl.yml +1 -1
- data/config/locales/livechat.pt.yml +1 -1
- data/config/locales/livechat.ro.yml +1 -1
- data/config/locales/livechat.ru.yml +1 -1
- data/config/locales/livechat.th.yml +1 -1
- data/config/locales/livechat.tr.yml +1 -1
- data/config/locales/livechat.uk.yml +1 -1
- data/config/locales/livechat.ur.yml +1 -1
- data/config/locales/livechat.vi.yml +1 -1
- data/config/locales/livechat.zh-CN.yml +1 -1
- data/lib/livechat/dashboard.js +3 -2
- data/lib/livechat/version.rb +1 -1
- data/lib/livechat/widget.js +22 -8
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dde311c3ece9cf024af38e37018971db6e9f5a17a33779a37f3230357959262b
|
|
4
|
+
data.tar.gz: 53175ed6be91ba5d011dc5183f98578c949d447919e43cce14421be333e0d5bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 571815fbdf33d0d5d78a3c759157da59bb252fa404701be47ec6378a9614eeb0f7d0e886fcd56ed3deec9fcf000be1186c27d3dbe23a54f072f8258aab66f1aa
|
|
7
|
+
data.tar.gz: 68dd083b3fbdff4eb89311ecc8bf140f88a66196ddb49e31ad920413c02906a3a50d67f5e655f44faf5655a2d60ebc8dfc822a85b3675f44dc673fded8793ea0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.4
|
|
4
|
+
|
|
5
|
+
- Hardened the visitor widget composer against host app form-control styles, so
|
|
6
|
+
embedded textareas no longer pick up an extra border or shadow.
|
|
7
|
+
- Matched the visitor widget's chat surface to the inbox pattern: white thread
|
|
8
|
+
background, gray support bubbles, and visible timestamps.
|
|
9
|
+
- Fixed stale typing indicators by clearing each side's typing hint when they
|
|
10
|
+
send and suppressing the hint when a new message arrives.
|
|
11
|
+
- Renamed the default inbox title to `LiveChat` across shipped locales while
|
|
12
|
+
keeping it overridable through `livechat.dashboard.title`.
|
|
13
|
+
- Simplified inbox conversation context by showing visitor email as plain text,
|
|
14
|
+
removing the page URL from the thread header, and keeping direct
|
|
15
|
+
`/livechat/:id` pages scrollable after the two-column inbox layout.
|
|
16
|
+
|
|
3
17
|
## 0.6.3
|
|
4
18
|
|
|
5
19
|
- Replaced the selected thread's separate status badge and resolve/reopen
|
|
@@ -49,6 +49,7 @@ module Livechat
|
|
|
49
49
|
message = messages.new(author_type: 'visitor', body: body)
|
|
50
50
|
attach(message, files)
|
|
51
51
|
message.save!
|
|
52
|
+
clear_typing!('visitor')
|
|
52
53
|
message
|
|
53
54
|
end
|
|
54
55
|
end
|
|
@@ -58,6 +59,7 @@ module Livechat
|
|
|
58
59
|
agent_id: agent_id.to_s, agent_label: agent_label)
|
|
59
60
|
attach(message, files)
|
|
60
61
|
message.save!
|
|
62
|
+
clear_typing!('agent')
|
|
61
63
|
message
|
|
62
64
|
end
|
|
63
65
|
|
|
@@ -109,6 +111,10 @@ module Livechat
|
|
|
109
111
|
Rails.cache.exist?(typing_cache_key(author_type))
|
|
110
112
|
end
|
|
111
113
|
|
|
114
|
+
def clear_typing!(author_type)
|
|
115
|
+
Rails.cache.delete(typing_cache_key(author_type))
|
|
116
|
+
end
|
|
117
|
+
|
|
112
118
|
private
|
|
113
119
|
|
|
114
120
|
# Attach only real uploads, and only where attachments are enabled — a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
|
-
<title><%= t('livechat.dashboard.title', default: '
|
|
4
|
+
<title><%= t('livechat.dashboard.title', default: 'LiveChat') %> — <%= Livechat.app_name %></title>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<%= csrf_meta_tags %>
|
|
7
7
|
<%# Same-origin script instead of inline handlers, so thread polling and
|
|
@@ -217,6 +217,7 @@
|
|
|
217
217
|
.lvc-convo .container { display: flex; flex-direction: column; padding-bottom: 16px; }
|
|
218
218
|
.lvc-convo .breadcrumb, .lvc-convo .head-row, .lvc-convo .context-line,
|
|
219
219
|
.lvc-convo .flash { flex: 0 0 auto; }
|
|
220
|
+
.lvc-convo .conversation-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
|
|
220
221
|
.lvc-convo .card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
|
|
221
222
|
.lvc-convo .thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
|
|
222
223
|
.lvc-convo .reply { flex: 0 0 auto; }
|
|
@@ -20,16 +20,11 @@
|
|
|
20
20
|
<% end %>
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
|
-
<%# One quiet line of live context: who
|
|
24
|
-
and the page of their LAST message (refreshed on every visitor write). %>
|
|
23
|
+
<%# One quiet line of live context: who the visitor is and the language to answer in. %>
|
|
25
24
|
<p class="muted context-line">
|
|
26
25
|
<% context = [] %>
|
|
27
|
-
<% context <<
|
|
26
|
+
<% context << conversation.visitor_email if conversation.visitor_email.present? %>
|
|
28
27
|
<% context << conversation.locale if conversation.locale.present? %>
|
|
29
|
-
<% if conversation.page_url.present? %>
|
|
30
|
-
<% context << link_to(conversation.page_url.sub(%r{\Ahttps?://}, ''), conversation.page_url,
|
|
31
|
-
target: '_blank', rel: 'noopener') %>
|
|
32
|
-
<% end %>
|
|
33
28
|
<%= safe_join(context, ' · ') %>
|
|
34
29
|
</p>
|
|
35
30
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<% content_for :body_class, 'lvc-inbox' %>
|
|
2
2
|
|
|
3
|
-
<h1><%= t('livechat.dashboard.title', default: '
|
|
3
|
+
<h1><%= t('livechat.dashboard.title', default: 'LiveChat') %></h1>
|
|
4
4
|
|
|
5
5
|
<div class="inbox-shell <%= 'has-selected' if @selected_conversation %>">
|
|
6
6
|
<aside class="inbox-sidebar" aria-label="<%= t('livechat.dashboard.conversations', default: 'Conversations') %>">
|
|
@@ -41,7 +41,7 @@ ar:
|
|
|
41
41
|
resolved: "قام %{agent} بحل المحادثة"
|
|
42
42
|
reopened: "قام %{agent} بإعادة فتح المحادثة"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "لا يوجد شيء هنا. عندما يكتب زائر، تظهر المحادثة في هذه الصفحة."
|
|
46
46
|
visitor: "الزائر"
|
|
47
47
|
last_message: "آخر رسالة"
|
|
@@ -41,7 +41,7 @@ bg:
|
|
|
41
41
|
resolved: "%{agent} разреши разговора"
|
|
42
42
|
reopened: "%{agent} отвори отново разговора"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Тук няма нищо. Когато посетител напише съобщение, разговорът се появява на тази страница."
|
|
46
46
|
visitor: "Посетител"
|
|
47
47
|
last_message: "Последно съобщение"
|
|
@@ -41,7 +41,7 @@ bn:
|
|
|
41
41
|
resolved: "%{agent} কথোপকথনটি সমাধান করেছেন"
|
|
42
42
|
reopened: "%{agent} কথোপকথনটি আবার খুলেছেন"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "এখানে এখনও কিছু নেই। কোনো দর্শনার্থী লিখলে কথোপকথনটি এই পৃষ্ঠায় দেখা যাবে।"
|
|
46
46
|
visitor: "দর্শনার্থী"
|
|
47
47
|
last_message: "শেষ বার্তা"
|
|
@@ -41,7 +41,7 @@ de:
|
|
|
41
41
|
resolved: "%{agent} hat die Unterhaltung gelöst"
|
|
42
42
|
reopened: "%{agent} hat die Unterhaltung wieder geöffnet"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Hier ist noch nichts. Wenn ein Besucher schreibt, erscheint die Unterhaltung auf dieser Seite."
|
|
46
46
|
visitor: "Besucher"
|
|
47
47
|
last_message: "Letzte Nachricht"
|
|
@@ -41,7 +41,7 @@ el:
|
|
|
41
41
|
resolved: "%{agent} επέλυσε τη συνομιλία"
|
|
42
42
|
reopened: "%{agent} άνοιξε ξανά τη συνομιλία"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Δεν υπάρχει τίποτα εδώ ακόμα. Όταν ένας επισκέπτης γράψει, η συνομιλία εμφανίζεται σε αυτήν τη σελίδα."
|
|
46
46
|
visitor: "Επισκέπτης"
|
|
47
47
|
last_message: "Τελευταίο μήνυμα"
|
|
@@ -41,7 +41,7 @@ en:
|
|
|
41
41
|
resolved: "%{agent} resolved the conversation"
|
|
42
42
|
reopened: "%{agent} reopened the conversation"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Nothing here. When a visitor writes, the conversation lands on this page."
|
|
46
46
|
visitor: "Visitor"
|
|
47
47
|
last_message: "Last message"
|
|
@@ -41,7 +41,7 @@ es:
|
|
|
41
41
|
resolved: "%{agent} resolvió la conversación"
|
|
42
42
|
reopened: "%{agent} reabrió la conversación"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Nada por aquí todavía. Cuando un visitante escriba, la conversación aparecerá en esta página."
|
|
46
46
|
visitor: "Visitante"
|
|
47
47
|
last_message: "Último mensaje"
|
|
@@ -41,7 +41,7 @@ fr:
|
|
|
41
41
|
resolved: "%{agent} a résolu la conversation"
|
|
42
42
|
reopened: "%{agent} a rouvert la conversation"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Rien ici pour l'instant. Lorsqu'un visiteur écrit, la conversation apparaît sur cette page."
|
|
46
46
|
visitor: "Visiteur"
|
|
47
47
|
last_message: "Dernier message"
|
|
@@ -41,7 +41,7 @@ hi:
|
|
|
41
41
|
resolved: "%{agent} ने बातचीत सुलझा दी"
|
|
42
42
|
reopened: "%{agent} ने बातचीत फिर से खोली"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "यहाँ अभी कुछ नहीं है। जब कोई विज़िटर लिखेगा, तो बातचीत इस पेज पर दिखाई देगी।"
|
|
46
46
|
visitor: "विज़िटर"
|
|
47
47
|
last_message: "आख़िरी संदेश"
|
|
@@ -41,7 +41,7 @@ hr:
|
|
|
41
41
|
resolved: "%{agent} je riješio/la razgovor"
|
|
42
42
|
reopened: "%{agent} je ponovno otvorio/la razgovor"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Ovdje još nema ničega. Kad posjetitelj napiše poruku, razgovor se pojavljuje na ovoj stranici."
|
|
46
46
|
visitor: "Posjetitelj"
|
|
47
47
|
last_message: "Zadnja poruka"
|
|
@@ -41,7 +41,7 @@ id:
|
|
|
41
41
|
resolved: "%{agent} menyelesaikan percakapan"
|
|
42
42
|
reopened: "%{agent} membuka kembali percakapan"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Belum ada apa-apa di sini. Saat pengunjung menulis, percakapan akan muncul di halaman ini."
|
|
46
46
|
visitor: "Pengunjung"
|
|
47
47
|
last_message: "Pesan terakhir"
|
|
@@ -41,7 +41,7 @@ it:
|
|
|
41
41
|
resolved: "%{agent} ha risolto la conversazione"
|
|
42
42
|
reopened: "%{agent} ha riaperto la conversazione"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Ancora niente qui. Quando un visitatore scrive, la conversazione compare in questa pagina."
|
|
46
46
|
visitor: "Visitatore"
|
|
47
47
|
last_message: "Ultimo messaggio"
|
|
@@ -41,7 +41,7 @@ lb:
|
|
|
41
41
|
resolved: "%{agent} huet d'Gespréich geléist"
|
|
42
42
|
reopened: "%{agent} huet d'Gespréich nees opgemaach"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Hei ass nach näischt. Wann e Besucher schreift, erschéngt d'Gespréich op dëser Säit."
|
|
46
46
|
visitor: "Besucher"
|
|
47
47
|
last_message: "Lescht Noriicht"
|
|
@@ -41,7 +41,7 @@ nl:
|
|
|
41
41
|
resolved: "%{agent} heeft het gesprek opgelost"
|
|
42
42
|
reopened: "%{agent} heeft het gesprek heropend"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Nog niets hier. Zodra een bezoeker schrijft, verschijnt het gesprek op deze pagina."
|
|
46
46
|
visitor: "Bezoeker"
|
|
47
47
|
last_message: "Laatste bericht"
|
|
@@ -41,7 +41,7 @@ pl:
|
|
|
41
41
|
resolved: "%{agent} rozwiązał(a) rozmowę"
|
|
42
42
|
reopened: "%{agent} wznowił(a) rozmowę"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Nic tu jeszcze nie ma. Gdy odwiedzający napisze, rozmowa pojawi się na tej stronie."
|
|
46
46
|
visitor: "Odwiedzający"
|
|
47
47
|
last_message: "Ostatnia wiadomość"
|
|
@@ -41,7 +41,7 @@ pt:
|
|
|
41
41
|
resolved: "%{agent} resolveu a conversa"
|
|
42
42
|
reopened: "%{agent} reabriu a conversa"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Nada por aqui ainda. Quando um visitante escrever, a conversa aparecerá nesta página."
|
|
46
46
|
visitor: "Visitante"
|
|
47
47
|
last_message: "Última mensagem"
|
|
@@ -41,7 +41,7 @@ ro:
|
|
|
41
41
|
resolved: "%{agent} a rezolvat conversația"
|
|
42
42
|
reopened: "%{agent} a redeschis conversația"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Nimic aici deocamdată. Când un vizitator scrie, conversația apare pe această pagină."
|
|
46
46
|
visitor: "Vizitator"
|
|
47
47
|
last_message: "Ultimul mesaj"
|
|
@@ -41,7 +41,7 @@ ru:
|
|
|
41
41
|
resolved: "%{agent} завершил(а) диалог"
|
|
42
42
|
reopened: "%{agent} возобновил(а) диалог"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Пока здесь пусто. Когда посетитель напишет, диалог появится на этой странице."
|
|
46
46
|
visitor: "Посетитель"
|
|
47
47
|
last_message: "Последнее сообщение"
|
|
@@ -41,7 +41,7 @@ th:
|
|
|
41
41
|
resolved: "%{agent} แก้ไขการสนทนาแล้ว"
|
|
42
42
|
reopened: "%{agent} เปิดการสนทนาอีกครั้ง"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "ยังไม่มีอะไรที่นี่ เมื่อผู้เยี่ยมชมส่งข้อความ การสนทนาจะปรากฏบนหน้านี้"
|
|
46
46
|
visitor: "ผู้เยี่ยมชม"
|
|
47
47
|
last_message: "ข้อความล่าสุด"
|
|
@@ -41,7 +41,7 @@ tr:
|
|
|
41
41
|
resolved: "%{agent} görüşmeyi çözdü"
|
|
42
42
|
reopened: "%{agent} görüşmeyi yeniden açtı"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Henüz burada bir şey yok. Bir ziyaretçi yazdığında görüşme bu sayfada görünür."
|
|
46
46
|
visitor: "Ziyaretçi"
|
|
47
47
|
last_message: "Son mesaj"
|
|
@@ -41,7 +41,7 @@ uk:
|
|
|
41
41
|
resolved: "%{agent} завершив(ла) розмову"
|
|
42
42
|
reopened: "%{agent} відновив(ла) розмову"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Поки що тут порожньо. Коли відвідувач напише, розмова з'явиться на цій сторінці."
|
|
46
46
|
visitor: "Відвідувач"
|
|
47
47
|
last_message: "Останнє повідомлення"
|
|
@@ -41,7 +41,7 @@ ur:
|
|
|
41
41
|
resolved: "%{agent} نے گفتگو حل کر دی"
|
|
42
42
|
reopened: "%{agent} نے گفتگو دوبارہ کھول دی"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "یہاں ابھی کچھ نہیں ہے۔ جب کوئی وزیٹر لکھے گا تو گفتگو اس صفحے پر نظر آئے گی۔"
|
|
46
46
|
visitor: "وزیٹر"
|
|
47
47
|
last_message: "آخری پیغام"
|
|
@@ -41,7 +41,7 @@ vi:
|
|
|
41
41
|
resolved: "%{agent} đã giải quyết cuộc trò chuyện"
|
|
42
42
|
reopened: "%{agent} đã mở lại cuộc trò chuyện"
|
|
43
43
|
dashboard:
|
|
44
|
-
title: "
|
|
44
|
+
title: "LiveChat"
|
|
45
45
|
empty: "Chưa có gì ở đây. Khi khách truy cập nhắn tin, cuộc trò chuyện sẽ xuất hiện trên trang này."
|
|
46
46
|
visitor: "Khách truy cập"
|
|
47
47
|
last_message: "Tin nhắn cuối"
|
data/lib/livechat/dashboard.js
CHANGED
|
@@ -460,8 +460,9 @@
|
|
|
460
460
|
.then(function (response) { return response.ok ? response.json() : null; })
|
|
461
461
|
.then(function (data) {
|
|
462
462
|
if (!data) return;
|
|
463
|
-
|
|
464
|
-
if (
|
|
463
|
+
var messages = data.messages || [];
|
|
464
|
+
if (messages.length) messages.forEach(append);
|
|
465
|
+
setTyping(!!data.typing && !messages.some(function (message) { return message.author === "visitor"; }));
|
|
465
466
|
if (atBottom) thread.scrollTop = thread.scrollHeight;
|
|
466
467
|
})
|
|
467
468
|
.catch(function () { /* transient network error — next tick retries */ });
|
data/lib/livechat/version.rb
CHANGED
data/lib/livechat/widget.js
CHANGED
|
@@ -890,8 +890,9 @@
|
|
|
890
890
|
if (isOpen) {
|
|
891
891
|
// Only an open panel renders (and thereby "consumes") messages;
|
|
892
892
|
// while closed, the poll feeds the badge and nothing else.
|
|
893
|
-
|
|
894
|
-
|
|
893
|
+
var messages = data.messages || [];
|
|
894
|
+
messages.forEach(appendMessage);
|
|
895
|
+
setTyping(!!data.typing && !messages.some(function (message) { return message.author === "agent"; }));
|
|
895
896
|
if (data.unread > 0) request("POST", "/read");
|
|
896
897
|
setUnread(0);
|
|
897
898
|
syncEmailRow();
|
|
@@ -947,9 +948,10 @@
|
|
|
947
948
|
if (message.author === "system") {
|
|
948
949
|
var line = document.createElement("div");
|
|
949
950
|
line.className = "lvc-system";
|
|
950
|
-
|
|
951
|
+
var text = message.event === "resolved"
|
|
951
952
|
? config.labels.eventResolved
|
|
952
953
|
: config.labels.eventReopened;
|
|
954
|
+
line.textContent = text + " · " + formatMessageTime(message.at);
|
|
953
955
|
listEl.appendChild(line);
|
|
954
956
|
lastAuthorKey = null;
|
|
955
957
|
keepTypingLast();
|
|
@@ -963,9 +965,10 @@
|
|
|
963
965
|
if (authorKey !== lastAuthorKey) {
|
|
964
966
|
var who = document.createElement("div");
|
|
965
967
|
who.className = "lvc-who lvc-who-" + message.author;
|
|
966
|
-
|
|
968
|
+
var name = message.author === "visitor"
|
|
967
969
|
? config.labels.you
|
|
968
970
|
: (message.label || config.labels.team);
|
|
971
|
+
who.textContent = name + " · " + formatMessageTime(message.at);
|
|
969
972
|
listEl.appendChild(who);
|
|
970
973
|
lastAuthorKey = authorKey;
|
|
971
974
|
}
|
|
@@ -1034,6 +1037,15 @@
|
|
|
1034
1037
|
if (listEl) listEl.scrollTop = listEl.scrollHeight;
|
|
1035
1038
|
}
|
|
1036
1039
|
|
|
1040
|
+
function formatMessageTime(value) {
|
|
1041
|
+
if (!value) return "";
|
|
1042
|
+
var date = new Date(value);
|
|
1043
|
+
if (isNaN(date.getTime())) return "";
|
|
1044
|
+
return date.toLocaleString(undefined, {
|
|
1045
|
+
day: "numeric", month: "short", hour: "2-digit", minute: "2-digit"
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1037
1049
|
function noteTyping() {
|
|
1038
1050
|
if (!hasThread || !inputEl || !inputEl.value.trim()) return;
|
|
1039
1051
|
var now = Date.now();
|
|
@@ -1105,6 +1117,7 @@
|
|
|
1105
1117
|
if (result.ok) {
|
|
1106
1118
|
inputEl.value = "";
|
|
1107
1119
|
autogrow();
|
|
1120
|
+
lastTypingSentAt = 0;
|
|
1108
1121
|
clearFiles();
|
|
1109
1122
|
hasThread = true;
|
|
1110
1123
|
appendMessage(result.data.message);
|
|
@@ -1222,7 +1235,7 @@
|
|
|
1222
1235
|
// min-height:0 lets this flex child actually scroll within the panel
|
|
1223
1236
|
// instead of overflowing it (the classic flexbox scroll gotcha).
|
|
1224
1237
|
"#lvc-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px;" +
|
|
1225
|
-
"background:var(--lvc-
|
|
1238
|
+
"background:var(--lvc-surface);display:flex;flex-direction:column;gap:4px}" +
|
|
1226
1239
|
// Class rules carry the #lvc-root prefix so they outrank the
|
|
1227
1240
|
// id-level `#lvc-root *` reset above.
|
|
1228
1241
|
"#lvc-root .lvc-who{font-size:11px;color:var(--lvc-muted);margin:8px 4px 2px}" +
|
|
@@ -1234,7 +1247,7 @@
|
|
|
1234
1247
|
"border-bottom-right-radius:4px}" +
|
|
1235
1248
|
"#lvc-root[dir=rtl] .lvc-visitor{align-self:flex-start;border-bottom-right-radius:14px;" +
|
|
1236
1249
|
"border-bottom-left-radius:4px}" +
|
|
1237
|
-
"#lvc-root .lvc-agent{align-self:flex-start;background:var(--lvc-
|
|
1250
|
+
"#lvc-root .lvc-agent{align-self:flex-start;background:var(--lvc-bg);border:1px solid var(--lvc-border);" +
|
|
1238
1251
|
"border-bottom-left-radius:4px}" +
|
|
1239
1252
|
"#lvc-root[dir=rtl] .lvc-agent{align-self:flex-end;border-bottom-left-radius:14px;" +
|
|
1240
1253
|
"border-bottom-right-radius:4px}" +
|
|
@@ -1258,8 +1271,9 @@
|
|
|
1258
1271
|
"#lvc-form:focus-within{border-color:var(--lvc-accent)}" +
|
|
1259
1272
|
// appearance:none flattens Safari's default textarea bevel, which would
|
|
1260
1273
|
// otherwise show as a second inset box inside the composer.
|
|
1261
|
-
"#lvc-root #lvc-input{-webkit-appearance:none;appearance:none;border:none;
|
|
1262
|
-
"resize:none;font:inherit;color:var(--lvc-text);
|
|
1274
|
+
"#lvc-root #lvc-input{-webkit-appearance:none!important;appearance:none!important;border:none!important;" +
|
|
1275
|
+
"box-shadow:none!important;background:transparent!important;resize:none;font:inherit;color:var(--lvc-text);" +
|
|
1276
|
+
"padding:4px 4px 0;max-height:120px;outline:none!important}" +
|
|
1263
1277
|
"#lvc-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px}" +
|
|
1264
1278
|
"#lvc-tools{display:flex;align-items:center;gap:2px}" +
|
|
1265
1279
|
// Tool buttons (attach, and room for more) are quiet — the accent is the
|