Skip to content

Commit

Permalink
Merge pull request #1108 from AlessSala/show-img-prevw-attachments-#6…
Browse files Browse the repository at this point in the history
…20-feature

Add show-hide preview for attachment images too
  • Loading branch information
averissimo committed Jan 29, 2020
2 parents e0470e4 + 35ea0c4 commit c9a1cf3
Show file tree
Hide file tree
Showing 27 changed files with 61 additions and 31 deletions.
3 changes: 2 additions & 1 deletion src/locales/bn.json
Expand Up @@ -41,7 +41,8 @@
"search": "লোকেদের অনুসন্ধান করুন",
"new_message": "নতুন বার্তা",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "প্রজ্ঞাপন",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/br.json
Expand Up @@ -41,7 +41,8 @@
"search": "Klask tud",
"new_message": "Kemennadenn nevez degemeret",
"new_attachment": "Kemennadenn nevez degemeret (skeudenn pe video)",
"open_link": "O tigeriñ an ere er merdeer..."
"open_link": "O tigeriñ an ere er merdeer...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Rebuzadur",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/cs.json
Expand Up @@ -41,7 +41,8 @@
"search": "Vyhledat osoby",
"new_message": "Nová zpráva",
"new_attachment": "Obdržena nová zpráva (obraz nebo video)",
"open_link": "Otevírání odkazu v prohlížeči…"
"open_link": "Otevírání odkazu v prohlížeči…",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Oznámení",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/da.json
Expand Up @@ -41,7 +41,8 @@
"search": "Søg efter mennesker",
"new_message": "Ny besked",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Notifikation",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/de.json
Expand Up @@ -41,7 +41,8 @@
"search": "Kontakte suchen",
"new_message": "Neue Nachricht",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Benachrichtigung",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json.template
Expand Up @@ -42,7 +42,8 @@
"search": "Search people",
"new_message": "New message received",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Notification",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/es.json
Expand Up @@ -41,7 +41,8 @@
"search": "Buscar personas",
"new_message": "Nuevo Mensaje",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Notificación",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/fr.json
Expand Up @@ -41,7 +41,8 @@
"search": "Chercher des contacts",
"new_message": "Nouveau message",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Notification",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/he.json
Expand Up @@ -41,7 +41,8 @@
"search": "חיפוש אנשים",
"new_message": "הודעה חדשה",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "התראה",
Expand Down
7 changes: 4 additions & 3 deletions src/locales/it.json
Expand Up @@ -40,8 +40,9 @@
"leave_confirm": "Vuoi davvero lasciare la conversazione?",
"search": "Cerca Persone",
"new_message": "Nuovo Messaggio",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"new_attachment": "Nuovo Messaggio (immagine o video)",
"open_link": "Sto aprendo il collegamento sul browser...",
"no_preview_image_click_to_open": "Anteprima immagine disabilitata: clicca qui per vederla sul browser"
},
"notification": {
"one": "Notifica",
Expand Down Expand Up @@ -90,7 +91,7 @@
"copy_image": "Copia immagine",
"select_all": "Seleziona tutto",
"language": "Lingua (Language)",
"dateformat": "Use system date format"
"dateformat": "Usa il formato data del tuo sistema"
},
"view": {
"title": "Visualizza",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ja.json
Expand Up @@ -41,7 +41,8 @@
"search": "コンタクト検索",
"new_message": "新メッセージ",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "通知",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ko.json
Expand Up @@ -41,7 +41,8 @@
"search": "사용자 검색",
"new_message": "새 메시지",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "알림",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/nl.json
Expand Up @@ -41,7 +41,8 @@
"search": "Contactpersonen doorzoeken",
"new_message": "Nieuw bericht",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Melding",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/pl.json
Expand Up @@ -41,7 +41,8 @@
"search": "Szukaj uczestników",
"new_message": "Nowa Wiadomość",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Powiadomienie",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/pt.json
Expand Up @@ -42,7 +42,8 @@
"search": "Procurar pessoas",
"new_message": "Nova mensagem recebida",
"new_attachment": "Nova mensagem recebida (imagem ou vídeo)",
"open_link": "A abrir o link no browser..."
"open_link": "A abrir o link no browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Notificação",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/pt_BR.json
Expand Up @@ -41,7 +41,8 @@
"search": "Procurar pessoas",
"new_message": "Nova mensagem recebida",
"new_attachment": "Nova messagem recebida (imagem ou vídeo)",
"open_link": "Abrindo o link no navegador..."
"open_link": "Abrindo o link no navegador...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Notificação",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ro.json
Expand Up @@ -41,7 +41,8 @@
"search": "Caută persoane",
"new_message": "Nou mesaj",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Notificare",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ru.json
Expand Up @@ -41,7 +41,8 @@
"search": "Поиск людей",
"new_message": "Новое сообщение",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Уведомление",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/sk.json
Expand Up @@ -40,7 +40,9 @@
"leave_confirm": "Naozaj opustiť konverzáciu?",
"search": "Vyhľadať osoby",
"new_message": "Nová správa",
"new_attachment": "New message received (image or video)"
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Oznámenie",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/sl_SI.json
Expand Up @@ -41,7 +41,8 @@
"search": "Najdi ljudi",
"new_message": "Novo sporočilo",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Obvestilo",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/sv_SE.json
Expand Up @@ -41,7 +41,8 @@
"search": "Sök personer",
"new_message": "Nytt meddelande",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Notifiering",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ta.json
Expand Up @@ -41,7 +41,8 @@
"search": "மக்களை தேடு",
"new_message": "புதிய செய்தியிடல்",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "அறிவிப்பு",
Expand Down
1 change: 1 addition & 0 deletions src/locales/te.json
Expand Up @@ -120,6 +120,7 @@
"settings": "సంభాషణ యొక్క ప్రాధాన్యతలు",
"new_attachment": "క్రొత్త చిత్రం వచ్చింది",
"open_link": "లింకును మీ బ్రౌజర్‌లో తెరుస్తున్నాం",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser",
"edit": "సంభాషణను సవరించు",
"leave": "సంభాషణ నుండి నిష్క్రమించు",
"delete": "సంభాషణను తొలగించు"
Expand Down
3 changes: 2 additions & 1 deletion src/locales/tr.json
Expand Up @@ -41,7 +41,8 @@
"search": "Kişi ara",
"new_message": "Yeni Mesaj",
"new_attachment": "New message received (image or video)",
"open_link": "Opening the link in the browser..."
"open_link": "Opening the link in the browser...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Bildirim",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/uk_UA.json
Expand Up @@ -41,7 +41,8 @@
"search": "Пошук людей",
"new_message": "Нове повідомлення",
"new_attachment": "Отримано нове повідомлення (картинка або відео)",
"open_link": "Відкриваю лінк в браузері..."
"open_link": "Відкриваю лінк в браузері...",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "Сповіщення",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/zh_CN.json
Expand Up @@ -41,7 +41,8 @@
"search": "搜索用户",
"new_message": "收到新消息",
"new_attachment": "收到新消息 (图片或视频)",
"open_link": "在浏览器中打开链接……"
"open_link": "在浏览器中打开链接……",
"no_preview_image_click_to_open": "Image preview is disabled: click to open it in the browser"
},
"notification": {
"one": "通知",
Expand Down
11 changes: 7 additions & 4 deletions src/ui/views/messages.coffee
Expand Up @@ -72,8 +72,8 @@ onclick = (e) ->

# Showing message with 3 second delay showing the user that something is happening
notr {
html: i18n.__ 'conversation.open_link:Opening the link in the browser...'
stay: 3000
html: i18n.__ 'conversation.open_link:Opening the link in the browser...'
stay: 3000
}

xhr.onreadystatechange = (e) ->
Expand Down Expand Up @@ -446,8 +446,11 @@ formatAttachment = (att) ->
# here we assume attachments are only images
if preload thumb
div class:'attach', ->
a {href, onclick}, -> img src:thumb

a {href, onclick}, ->
if models.viewstate.showImagePreview
img src:thumb
else
i18n.__('conversation.no_preview_image_click_to_open:Image preview is disabled: click to open it in the browser')

handle 'loadedimg', ->
# allow controller to record current position
Expand Down

0 comments on commit c9a1cf3

Please sign in to comment.