From 069063b2c723b57922e7ff1e7abc3f9b3e877be8 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 25 Nov 2015 17:36:06 +0100 Subject: [PATCH] Use domain of users email address for preview. Added css auto load and css Url support. Added possibility to translation chat widget. --- .../app/controllers/_channel/chat.coffee | 44 ++-- .../app/views/channel/chat.jst.eco | 9 +- public/assets/chat/chat.coffee | 75 +++++-- public/assets/chat/chat.js | 202 +++++++++++------- public/assets/chat/chat.min.js | 2 +- public/assets/chat/index.html | 2 +- public/assets/chat/views/chat.eco | 2 +- public/assets/chat/znuny.html | 135 ++++++------ 8 files changed, 284 insertions(+), 187 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_channel/chat.coffee b/app/assets/javascripts/app/controllers/_channel/chat.coffee index 5fd4f65fd..5ce8032b4 100644 --- a/app/assets/javascripts/app/controllers/_channel/chat.coffee +++ b/app/assets/javascripts/app/controllers/_channel/chat.coffee @@ -30,10 +30,10 @@ class App.ChannelChat extends App.Controller apiOptions: [ { - name: 'channel' - default: "'default'" - type: 'String' - description: 'Name of the chat-channel.' + name: 'chatId' + default: '1' + type: 'Integer' + description: 'Identifier of the chat-topic.' } { name: 'show' @@ -54,18 +54,18 @@ class App.ChannelChat extends App.Controller description: "If left empty, the host gets auto-detected - in this case %s. The auto-detection reads out the host from the + .mockup { + vertical-align: bottom; + } + .settings { + position: fixed; + left: 20px; + top: 20px; + background: white; + font-size: 14px; + padding: 10px; + border-radius: 5px; + box-shadow: 0 3px 10px rgba(0,0,0,.3); + } + + .settings input { + vertical-align: middle; + } + .settings input + input { + margin-right: 3px; + } + + table td:first-child { + text-align: right; + padding-right: 0; + } + + td { + padding: 5px; + } + + h2 { + font-size: 1em; + margin: 0; + } + + @media only screen and (max-width: 768px) { + .settings { + display: none; + } + } + + .Box { + background: hsl(0,0%,91%); + width: 26px; + height: 24px; + color: hsl(0,0%,47%); + float: left; + } + .Box.Active { + background: hsl(0,0%,36%); + color: white; + } + + +
@@ -107,6 +109,7 @@ var chat = new ZammadChat({ chatId: 1, host: 'ws://localhost:6042', + cssUrl: 'http://localhost:3000/assets/chat/chat.css', debug: true, background: '#494d52', flat: true, @@ -144,4 +147,6 @@ } } }); - \ No newline at end of file + + + \ No newline at end of file