Merge branch 'develop' of github.com:martini/zammad into develop
This commit is contained in:
commit
85f371b0f4
9 changed files with 171 additions and 130 deletions
|
@ -10,19 +10,24 @@ class App.ChannelChat extends App.Controller
|
||||||
'blur .js-testurl-input': 'changeDemoWebsite'
|
'blur .js-testurl-input': 'changeDemoWebsite'
|
||||||
'click .js-selectBrowserWidth': 'selectBrowserWidth'
|
'click .js-selectBrowserWidth': 'selectBrowserWidth'
|
||||||
'click .js-swatch': 'usePaletteColor'
|
'click .js-swatch': 'usePaletteColor'
|
||||||
|
'click .js-toggle-chat': 'toggleChat'
|
||||||
|
'input .js-chatTitle': 'changeTitle'
|
||||||
|
|
||||||
elements:
|
elements:
|
||||||
'.js-browser': 'browser'
|
'.js-browser': 'browser'
|
||||||
|
'.js-browserBody': 'browserBody'
|
||||||
'.js-iframe': 'iframe'
|
'.js-iframe': 'iframe'
|
||||||
|
'.js-screenshot': 'screenshot'
|
||||||
|
'.js-website': 'website'
|
||||||
'.js-chat': 'chat'
|
'.js-chat': 'chat'
|
||||||
|
'.js-chatHeader': 'chatHeader'
|
||||||
|
'.js-chat-welcome': 'chatWelcome'
|
||||||
'.js-testurl-input': 'urlInput'
|
'.js-testurl-input': 'urlInput'
|
||||||
'.js-backgroundColor': 'chatBackground'
|
'.js-backgroundColor': 'chatBackground'
|
||||||
'.js-paramsBlock': 'paramsBlock'
|
'.js-paramsBlock': 'paramsBlock'
|
||||||
'.js-code': 'code'
|
'.js-code': 'code'
|
||||||
'.js-palette': 'palette'
|
'.js-palette': 'palette'
|
||||||
'.js-color': 'colorField'
|
'.js-color': 'colorField'
|
||||||
'.js-screenshot': 'screenshot'
|
|
||||||
'.js-website': 'website'
|
|
||||||
|
|
||||||
apiOptions: [
|
apiOptions: [
|
||||||
{
|
{
|
||||||
|
@ -94,6 +99,10 @@ class App.ChannelChat extends App.Controller
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
isOpen: true
|
||||||
|
browserWidth: 1280
|
||||||
|
chatHeight: 360
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
@load()
|
@load()
|
||||||
|
@ -131,6 +140,7 @@ class App.ChannelChat extends App.Controller
|
||||||
@code.each (i, block) ->
|
@code.each (i, block) ->
|
||||||
hljs.highlightBlock block
|
hljs.highlightBlock block
|
||||||
|
|
||||||
|
@adjustBrowserWidth()
|
||||||
@updateParams()
|
@updateParams()
|
||||||
|
|
||||||
selectBrowserWidth: (event) =>
|
selectBrowserWidth: (event) =>
|
||||||
|
@ -138,31 +148,42 @@ class App.ChannelChat extends App.Controller
|
||||||
|
|
||||||
# select tab
|
# select tab
|
||||||
tab.addClass('is-selected').siblings().removeClass('is-selected')
|
tab.addClass('is-selected').siblings().removeClass('is-selected')
|
||||||
value = tab.attr('data-value')
|
@browserWidth = tab.attr('data-value')
|
||||||
width = parseInt value, 10
|
@adjustBrowserWidth()
|
||||||
|
|
||||||
|
adjustBrowserWidth: ->
|
||||||
|
width = parseInt @browserWidth, 10
|
||||||
|
|
||||||
# reset zoom
|
# reset zoom
|
||||||
@chat
|
@chat
|
||||||
.css('transform', '')
|
|
||||||
.removeClass('is-fullscreen')
|
.removeClass('is-fullscreen')
|
||||||
|
.css 'transform', "translateY(#{ @getChatOffset() }px)"
|
||||||
@browser.css('width', '')
|
@browser.css('width', '')
|
||||||
@website.css
|
@website.css
|
||||||
transform: ''
|
transform: ''
|
||||||
width: ''
|
width: ''
|
||||||
height: ''
|
height: ''
|
||||||
|
|
||||||
return if value is 'fit'
|
return if @browserWidth is 'fit'
|
||||||
|
|
||||||
if width < @el.width()
|
if width < @el.width()
|
||||||
@chat.addClass('is-fullscreen')
|
@chat.addClass('is-fullscreen').css 'transform', "translateY(#{ @getChatOffset(true) }px)"
|
||||||
@browser.css('width', "#{ width }px")
|
@browser.css('width', "#{ width }px")
|
||||||
else
|
else
|
||||||
percentage = @el.width()/width
|
percentage = @el.width()/width
|
||||||
@chat.css('transform', "scale(#{ percentage })")
|
@chat.css 'transform', "translateY(#{ @getChatOffset() * percentage }px) scale(#{ percentage })"
|
||||||
@website.css
|
@website.css
|
||||||
transform: "scale(#{ percentage })"
|
transform: "scale(#{ percentage })"
|
||||||
width: @el.width() / percentage
|
width: @el.width() / percentage
|
||||||
height: @el.height() / percentage
|
height: @browserBody.height() / percentage
|
||||||
|
|
||||||
|
getChatOffset: (fullscreen) ->
|
||||||
|
return 0 if @isOpen
|
||||||
|
|
||||||
|
if fullscreen
|
||||||
|
return @browserBody.height() - @chatHeader.outerHeight()
|
||||||
|
else
|
||||||
|
return @chatHeight - @chatHeader.outerHeight()
|
||||||
|
|
||||||
changeDemoWebsite: (event) =>
|
changeDemoWebsite: (event) =>
|
||||||
event.preventDefault() if event
|
event.preventDefault() if event
|
||||||
|
@ -178,11 +199,11 @@ class App.ChannelChat extends App.Controller
|
||||||
|
|
||||||
@urlInput.addClass('is-loading')
|
@urlInput.addClass('is-loading')
|
||||||
|
|
||||||
# clear palette and iframe
|
|
||||||
@palette.empty()
|
@palette.empty()
|
||||||
@website.attr('data-mode', '')
|
|
||||||
@iframe.attr('src', '')
|
|
||||||
@screenshot.attr('src', '')
|
@screenshot.attr('src', '')
|
||||||
|
@website.attr('data-mode', 'iframe')
|
||||||
|
@iframe.attr('src', @url)
|
||||||
|
|
||||||
$.ajax
|
$.ajax
|
||||||
url: 'https://images.zammad.com/api/v1/webpage/combined'
|
url: 'https://images.zammad.com/api/v1/webpage/combined'
|
||||||
|
@ -196,12 +217,9 @@ class App.ChannelChat extends App.Controller
|
||||||
imageSource = data['data_url']
|
imageSource = data['data_url']
|
||||||
|
|
||||||
if imageSource
|
if imageSource
|
||||||
console.log "renderDemoWebsite", typeof imageSource, imageSource
|
|
||||||
@screenshot.attr 'src', imageSource
|
@screenshot.attr 'src', imageSource
|
||||||
|
@iframe.attr('src', '')
|
||||||
@website.attr('data-mode', 'screenshot')
|
@website.attr('data-mode', 'screenshot')
|
||||||
else
|
|
||||||
@iframe.attr 'src', @url
|
|
||||||
@website.attr('data-mode', 'iframe')
|
|
||||||
|
|
||||||
@renderPalette data['palette']
|
@renderPalette data['palette']
|
||||||
|
|
||||||
|
@ -235,6 +253,14 @@ class App.ChannelChat extends App.Controller
|
||||||
@colorField.val code
|
@colorField.val code
|
||||||
@updateParams()
|
@updateParams()
|
||||||
|
|
||||||
|
toggleChat: =>
|
||||||
|
@chat.toggleClass('is-open')
|
||||||
|
@isOpen = @chat.hasClass('is-open')
|
||||||
|
@adjustBrowserWidth()
|
||||||
|
|
||||||
|
changeTitle: (event) ->
|
||||||
|
@chatWelcome.html $(event.currentTarget).val()
|
||||||
|
|
||||||
new: (e) =>
|
new: (e) =>
|
||||||
new App.ControllerGenericNew(
|
new App.ControllerGenericNew(
|
||||||
pageData:
|
pageData:
|
||||||
|
@ -294,6 +320,7 @@ class App.ChannelChat extends App.Controller
|
||||||
params.flat = true
|
params.flat = true
|
||||||
else
|
else
|
||||||
@chat.removeClass('zammad-chat--flat')
|
@chat.removeClass('zammad-chat--flat')
|
||||||
|
@chatWelcome.html params.title
|
||||||
|
|
||||||
if @permanent
|
if @permanent
|
||||||
for key, value of @permanent
|
for key, value of @permanent
|
||||||
|
|
|
@ -78,7 +78,6 @@ class App.TicketOverview extends App.Controller
|
||||||
|
|
||||||
class Navbar extends App.Controller
|
class Navbar extends App.Controller
|
||||||
elements:
|
elements:
|
||||||
'.js-tabsHolder': 'tabsHolder'
|
|
||||||
'.js-tabsClone': 'clone'
|
'.js-tabsClone': 'clone'
|
||||||
'.js-tabClone': 'tabClone'
|
'.js-tabClone': 'tabClone'
|
||||||
'.js-tabs': 'tabs'
|
'.js-tabs': 'tabs'
|
||||||
|
@ -130,7 +129,9 @@ class Navbar extends App.Controller
|
||||||
items: items
|
items: items
|
||||||
isAgent: @isRole('Agent')
|
isAgent: @isRole('Agent')
|
||||||
|
|
||||||
while @clone.width() > @tabsHolder.width()
|
console.log @el.width(), @clone.width()
|
||||||
|
|
||||||
|
while @clone.width() > @el.width()
|
||||||
@tabClone.not('.hide').last().addClass('hide')
|
@tabClone.not('.hide').last().addClass('hide')
|
||||||
@tab.not('.hide').last().addClass('hide')
|
@tab.not('.hide').last().addClass('hide')
|
||||||
@dropdownItem.filter('.hide').last().removeClass('hide')
|
@dropdownItem.filter('.hide').last().removeClass('hide')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="tabsHolder js-tabsHolder">
|
<div class="tabsHolder">
|
||||||
<div class="tabs tabs--inline tabs--big js-tabs">
|
<div class="tabs tabs--inline tabs--big js-tabs">
|
||||||
<% if @items: %>
|
<% if @items: %>
|
||||||
<% for item in @items: %>
|
<% for item in @items: %>
|
||||||
|
|
|
@ -52,34 +52,34 @@
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<div class="select-tabs js-selectBrowserWidth">
|
<div class="select-tabs js-selectBrowserWidth">
|
||||||
<div class="tab" data-value="375">iPhone 6</div>
|
<div class="tab" data-value="375">iPhone 6</div>
|
||||||
<div class="tab is-selected" data-value="fit"><%- @T('1:1') %></div>
|
<div class="tab" data-value="fit"><%- @T('1:1') %></div>
|
||||||
<div class="tab" data-value="1280">MacBook</div>
|
<div class="tab is-selected" data-value="1280">MacBook</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label for="preview-iframe" class="formGroup-label"><%- @T('Preview') %></label>
|
<label for="preview-iframe" class="formGroup-label"><%- @T('Preview') %></label>
|
||||||
<div class="browser chat-demo js-browser">
|
<div class="browser chat-demo js-browser">
|
||||||
<div class="browser-head">
|
<div class="browser-head js-demo-head">
|
||||||
<form class="browser-input js-testurl" novalidate>
|
<form class="browser-input js-testurl" novalidate>
|
||||||
<input type="url" class="js-testurl-input" id="preview-iframe" placeholder="zammad.org">
|
<input type="url" class="js-testurl-input" id="preview-iframe" placeholder="zammad.org">
|
||||||
<div class="loading icon small muted"></div>
|
<div class="loading icon small muted"></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="browser-body js-demo">
|
<div class="browser-body js-browserBody">
|
||||||
<div class="browser-website js-website">
|
<div class="browser-website js-website">
|
||||||
<iframe class="js-iframe" sandbox></iframe>
|
<iframe class="js-iframe" sandbox="allow-scripts allow-same-origin"></iframe>
|
||||||
<img class="js-screenshot">
|
<img class="js-screenshot">
|
||||||
</div>
|
</div>
|
||||||
<style>@import "/assets/chat/chat.css";</style>
|
<style>@import "/assets/chat/chat.css";</style>
|
||||||
<div class="chat-demo-animationHolder">
|
<div class="chat-demo-animationHolder">
|
||||||
<div class="js-chat zammad-chat zammad-chat-is-visible zammad-chat-is-open" style="bottom: 0px;">
|
<div class="js-chat zammad-chat zammad-chat-is-open zammad-chat-is-visible is-open">
|
||||||
<div class="zammad-chat-header js-chat-open js-backgroundColor">
|
<div class="zammad-chat-header js-toggle-chat js-backgroundColor js-chatHeader">
|
||||||
<div class="zammad-chat-header-controls">
|
<div class="zammad-chat-header-controls">
|
||||||
<span class="zammad-chat-agent-status" data-status="online"><%- @T('Online') %></span>
|
<span class="zammad-chat-agent-status" data-status="online"><%- @T('Online') %></span>
|
||||||
<span class="zammad-chat-header-icon">
|
<span class="zammad-chat-header-icon">
|
||||||
<svg class="zammad-chat-header-icon-open" viewBox="0 0 13 7"><path d="M10.807 7l1.4-1.428-5-4.9L6.5-.02l-.7.7-4.9 4.9 1.414 1.413L6.5 2.886 10.807 7z" fill-rule="evenodd"></path></svg>
|
<svg class="zammad-chat-header-icon-open" viewBox="0 0 13 7"><path d="M10.807 7l1.4-1.428-5-4.9L6.5-.02l-.7.7-4.9 4.9 1.414 1.413L6.5 2.886 10.807 7z" fill-rule="evenodd"></path></svg>
|
||||||
<svg class="zammad-chat-header-icon-close js-chat-close" viewBox="0 0 13 13"><path d="m2.241.12l-2.121 2.121 4.243 4.243-4.243 4.243 2.121 2.121 4.243-4.243 4.243 4.243 2.121-2.121-4.243-4.243 4.243-4.243-2.121-2.121-4.243 4.243-4.243-4.243" fill-rule="evenodd"></path></svg>
|
<svg class="zammad-chat-header-icon-close" viewBox="0 0 13 13"><path d="m2.241.12l-2.121 2.121 4.243 4.243-4.243 4.243 2.121 2.121 4.243-4.243 4.243 4.243 2.121-2.121-4.243-4.243 4.243-4.243-2.121-2.121-4.243 4.243-4.243-4.243" fill-rule="evenodd"></path></svg>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="zammad-chat-agent">
|
<div class="zammad-chat-agent">
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="zammad-chat-welcome zammad-chat-is-hidden">
|
<div class="zammad-chat-welcome zammad-chat-is-hidden">
|
||||||
<svg class="zammad-chat-icon" viewBox="0 0 24 24"><path d="M2 5C2 4 3 3 4 3h16c1 0 2 1 2 2v10C22 16 21 17 20 17H4C3 17 2 16 2 15V5zM12 17l6 4v-4h-6z" fill-rule="evenodd"></path></svg>
|
<svg class="zammad-chat-icon" viewBox="0 0 24 24"><path d="M2 5C2 4 3 3 4 3h16c1 0 2 1 2 2v10C22 16 21 17 20 17H4C3 17 2 16 2 15V5zM12 17l6 4v-4h-6z" fill-rule="evenodd"></path></svg>
|
||||||
<span class="zammad-chat-welcome-text"><%- @T('<strong>Chat</strong> with us!') %></span>
|
<span class="zammad-chat-welcome-text js-chat-welcome"><strong>Chat</strong> with us!</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="zammad-chat-body">
|
<div class="zammad-chat-body">
|
||||||
|
@ -118,7 +118,7 @@
|
||||||
<label for="form-chat-title"><%- @T('Chat Title') %></label>
|
<label for="form-chat-title"><%- @T('Chat Title') %></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="form-chat-title" name="title" value="<strong>Chat</strong> with us!">
|
<input class="js-chatTitle" type="text" id="form-chat-title" name="title" value="<strong>Chat</strong> with us!">
|
||||||
</div>
|
</div>
|
||||||
<span class="help-block"><%- @T('Shown when the chat is closed.') %></span>
|
<span class="help-block"><%- @T('Shown when the chat is closed.') %></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -153,28 +153,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<table class="settings-list">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th style="white-space: nowrap;"><%- @T('Options') %></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<label class="inline-label">
|
|
||||||
<span class="checkbox-replacement checkbox-replacement--inline">
|
|
||||||
<input type="checkbox" name="debug" value="true">
|
|
||||||
<%- @Icon('checkbox', 'icon-unchecked') %>
|
|
||||||
<%- @Icon('checkbox-checked', 'icon-checked') %>
|
|
||||||
</span>
|
|
||||||
<%- @T('Enable debugging for implementation.') %>
|
|
||||||
</label>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h2><%- @T('Usage') %></h2>
|
<h2><%- @T('Usage') %></h2>
|
||||||
|
|
|
@ -7455,6 +7455,7 @@ output {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: white;
|
background: white;
|
||||||
|
border-radius: 0 0 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
@ -7484,7 +7485,7 @@ output {
|
||||||
.loading.icon {
|
.loading.icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 11px;
|
right: 11px;
|
||||||
top: 11px;
|
top: 10px;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7508,13 +7509,45 @@ output {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
transform-origin: right bottom;
|
transform-origin: right bottom;
|
||||||
transition: 500ms;
|
transition: 500ms;
|
||||||
|
user-select: none;
|
||||||
|
will-change: transform;
|
||||||
|
|
||||||
.zammad-chat-body {
|
.zammad-chat-welcome {
|
||||||
transition: 500ms;
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zammad-chat-header-icon-open {
|
||||||
|
display: inline !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zammad-chat-agent-status,
|
||||||
|
.zammad-chat-header-icon-close,
|
||||||
|
.zammad-chat-agent {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-open {
|
||||||
|
.zammad-chat-agent {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zammad-chat-header-icon-close,
|
||||||
|
.zammad-chat-agent-status {
|
||||||
|
display: inline-block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zammad-chat-welcome,
|
||||||
|
.zammad-chat-header-icon-open {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.is-fullscreen {
|
&.is-fullscreen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
.zammad-chat-controls {
|
||||||
|
border-radius: 0 0 5px 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -289,7 +289,7 @@ do($ = window.jQuery, window) ->
|
||||||
@showLoader()
|
@showLoader()
|
||||||
|
|
||||||
@el
|
@el
|
||||||
.addClass('zammad-chat-is-open')
|
.addClass('zammad-chat-is-visible')
|
||||||
|
|
||||||
if !@sessionId
|
if !@sessionId
|
||||||
@el.animate { bottom: 0 }, 500, @onOpenAnimationEnd
|
@el.animate { bottom: 0 }, 500, @onOpenAnimationEnd
|
||||||
|
@ -323,7 +323,7 @@ do($ = window.jQuery, window) ->
|
||||||
@el.animate { bottom: -remainerHeight }, 500, @onCloseAnimationEnd
|
@el.animate { bottom: -remainerHeight }, 500, @onCloseAnimationEnd
|
||||||
|
|
||||||
onCloseAnimationEnd: =>
|
onCloseAnimationEnd: =>
|
||||||
@el.removeClass('zammad-chat-is-open')
|
@el.removeClass('zammad-chat-is-visible')
|
||||||
@disconnect()
|
@disconnect()
|
||||||
@isOpen = false
|
@isOpen = false
|
||||||
|
|
||||||
|
|
|
@ -1,64 +1,3 @@
|
||||||
if (!window.zammadChatTemplates) {
|
|
||||||
window.zammadChatTemplates = {};
|
|
||||||
}
|
|
||||||
window.zammadChatTemplates["agent"] = function (__obj) {
|
|
||||||
if (!__obj) __obj = {};
|
|
||||||
var __out = [], __capture = function(callback) {
|
|
||||||
var out = __out, result;
|
|
||||||
__out = [];
|
|
||||||
callback.call(this);
|
|
||||||
result = __out.join('');
|
|
||||||
__out = out;
|
|
||||||
return __safe(result);
|
|
||||||
}, __sanitize = function(value) {
|
|
||||||
if (value && value.ecoSafe) {
|
|
||||||
return value;
|
|
||||||
} else if (typeof value !== 'undefined' && value != null) {
|
|
||||||
return __escape(value);
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
|
|
||||||
__safe = __obj.safe = function(value) {
|
|
||||||
if (value && value.ecoSafe) {
|
|
||||||
return value;
|
|
||||||
} else {
|
|
||||||
if (!(typeof value !== 'undefined' && value != null)) value = '';
|
|
||||||
var result = new String(value);
|
|
||||||
result.ecoSafe = true;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (!__escape) {
|
|
||||||
__escape = __obj.escape = function(value) {
|
|
||||||
return ('' + value)
|
|
||||||
.replace(/&/g, '&')
|
|
||||||
.replace(/</g, '<')
|
|
||||||
.replace(/>/g, '>')
|
|
||||||
.replace(/"/g, '"');
|
|
||||||
};
|
|
||||||
}
|
|
||||||
(function() {
|
|
||||||
(function() {
|
|
||||||
if (this.agent.avatar) {
|
|
||||||
__out.push('\n<img class="zammad-chat-agent-avatar" src="');
|
|
||||||
__out.push(__sanitize(this.agent.avatar));
|
|
||||||
__out.push('">\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
__out.push('\n<span class="zammad-chat-agent-sentence">\n <span class="zammad-chat-agent-name">');
|
|
||||||
|
|
||||||
__out.push(__sanitize(this.agent.name));
|
|
||||||
|
|
||||||
__out.push('</span>\n</span>');
|
|
||||||
|
|
||||||
}).call(this);
|
|
||||||
|
|
||||||
}).call(__obj);
|
|
||||||
__obj.safe = __objSafe, __obj.escape = __escape;
|
|
||||||
return __out.join('');
|
|
||||||
};
|
|
||||||
|
|
||||||
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
||||||
slice = [].slice;
|
slice = [].slice;
|
||||||
|
|
||||||
|
@ -74,9 +13,10 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
||||||
host: '',
|
host: '',
|
||||||
port: 6042,
|
port: 6042,
|
||||||
debug: false,
|
debug: false,
|
||||||
|
flat: false,
|
||||||
fontSize: void 0,
|
fontSize: void 0,
|
||||||
buttonSelector: '.open-zammad-chat',
|
buttonClass: 'open-zammad-chat',
|
||||||
hiddenButtonClass: 'is-inactive',
|
inactiveClass: 'is-inactive',
|
||||||
title: '<strong>Chat</strong> with us!'
|
title: '<strong>Chat</strong> with us!'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -206,6 +146,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
||||||
}));
|
}));
|
||||||
this.options.target.append(this.el);
|
this.options.target.append(this.el);
|
||||||
this.input = this.el.find('.zammad-chat-input');
|
this.input = this.el.find('.zammad-chat-input');
|
||||||
|
$("." + this.options.buttonClass).addClass(this.inactiveClass);
|
||||||
this.el.find('.js-chat-open').click(this.open);
|
this.el.find('.js-chat-open').click(this.open);
|
||||||
this.el.find('.js-chat-close').click(this.close);
|
this.el.find('.js-chat-close').click(this.close);
|
||||||
this.el.find('.zammad-chat-controls').on('submit', this.onSubmit);
|
this.el.find('.zammad-chat-controls').on('submit', this.onSubmit);
|
||||||
|
@ -298,7 +239,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
ZammadChat.prototype.onReady = function() {
|
ZammadChat.prototype.onReady = function() {
|
||||||
$(this.options.buttonSelector).click(this.open).removeClass(this.hiddenButtonClass);
|
$("." + this.options.buttonClass).click(this.open).removeClass(this.inactiveClass);
|
||||||
if (this.options.show) {
|
if (this.options.show) {
|
||||||
return this.show();
|
return this.show();
|
||||||
}
|
}
|
||||||
|
@ -306,7 +247,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
||||||
|
|
||||||
ZammadChat.prototype.onError = function(message) {
|
ZammadChat.prototype.onError = function(message) {
|
||||||
this.log('debug', message);
|
this.log('debug', message);
|
||||||
return $(this.options.buttonSelector).hide();
|
return $("." + this.options.buttonClass).hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
ZammadChat.prototype.reopenSession = function(data) {
|
ZammadChat.prototype.reopenSession = function(data) {
|
||||||
|
@ -423,7 +364,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
||||||
if (!this.sessionId) {
|
if (!this.sessionId) {
|
||||||
this.showLoader();
|
this.showLoader();
|
||||||
}
|
}
|
||||||
this.el.addClass('zammad-chat-is-open');
|
this.el.addClass('zammad-chat-is-visible');
|
||||||
if (!this.sessionId) {
|
if (!this.sessionId) {
|
||||||
this.el.animate({
|
this.el.animate({
|
||||||
bottom: 0
|
bottom: 0
|
||||||
|
@ -465,7 +406,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
ZammadChat.prototype.onCloseAnimationEnd = function() {
|
ZammadChat.prototype.onCloseAnimationEnd = function() {
|
||||||
this.el.removeClass('zammad-chat-is-open');
|
this.el.removeClass('zammad-chat-is-visible');
|
||||||
this.disconnect();
|
this.disconnect();
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
this.send('chat_session_close', {
|
this.send('chat_session_close', {
|
||||||
|
@ -724,6 +665,67 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
||||||
return window.ZammadChat = ZammadChat;
|
return window.ZammadChat = ZammadChat;
|
||||||
})(window.jQuery, window);
|
})(window.jQuery, window);
|
||||||
|
|
||||||
|
if (!window.zammadChatTemplates) {
|
||||||
|
window.zammadChatTemplates = {};
|
||||||
|
}
|
||||||
|
window.zammadChatTemplates["agent"] = function (__obj) {
|
||||||
|
if (!__obj) __obj = {};
|
||||||
|
var __out = [], __capture = function(callback) {
|
||||||
|
var out = __out, result;
|
||||||
|
__out = [];
|
||||||
|
callback.call(this);
|
||||||
|
result = __out.join('');
|
||||||
|
__out = out;
|
||||||
|
return __safe(result);
|
||||||
|
}, __sanitize = function(value) {
|
||||||
|
if (value && value.ecoSafe) {
|
||||||
|
return value;
|
||||||
|
} else if (typeof value !== 'undefined' && value != null) {
|
||||||
|
return __escape(value);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
|
||||||
|
__safe = __obj.safe = function(value) {
|
||||||
|
if (value && value.ecoSafe) {
|
||||||
|
return value;
|
||||||
|
} else {
|
||||||
|
if (!(typeof value !== 'undefined' && value != null)) value = '';
|
||||||
|
var result = new String(value);
|
||||||
|
result.ecoSafe = true;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (!__escape) {
|
||||||
|
__escape = __obj.escape = function(value) {
|
||||||
|
return ('' + value)
|
||||||
|
.replace(/&/g, '&')
|
||||||
|
.replace(/</g, '<')
|
||||||
|
.replace(/>/g, '>')
|
||||||
|
.replace(/"/g, '"');
|
||||||
|
};
|
||||||
|
}
|
||||||
|
(function() {
|
||||||
|
(function() {
|
||||||
|
if (this.agent.avatar) {
|
||||||
|
__out.push('\n<img class="zammad-chat-agent-avatar" src="');
|
||||||
|
__out.push(__sanitize(this.agent.avatar));
|
||||||
|
__out.push('">\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
__out.push('\n<span class="zammad-chat-agent-sentence">\n <span class="zammad-chat-agent-name">');
|
||||||
|
|
||||||
|
__out.push(__sanitize(this.agent.name));
|
||||||
|
|
||||||
|
__out.push('</span>\n</span>');
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
|
||||||
|
}).call(__obj);
|
||||||
|
__obj.safe = __objSafe, __obj.escape = __escape;
|
||||||
|
return __out.join('');
|
||||||
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
* "THE BEER-WARE LICENSE" (Revision 42):
|
* "THE BEER-WARE LICENSE" (Revision 42):
|
||||||
|
@ -932,7 +934,7 @@ window.zammadChatTemplates["loader"] = function (__obj) {
|
||||||
(function() {
|
(function() {
|
||||||
__out.push('<div class="zammad-chat-modal">\n <span class="zammad-chat-loading-animation">\n <span class="zammad-chat-loading-circle"></span>\n <span class="zammad-chat-loading-circle"></span>\n <span class="zammad-chat-loading-circle"></span>\n </span>\n <span class="zammad-chat-modal-text">');
|
__out.push('<div class="zammad-chat-modal">\n <span class="zammad-chat-loading-animation">\n <span class="zammad-chat-loading-circle"></span>\n <span class="zammad-chat-loading-circle"></span>\n <span class="zammad-chat-loading-circle"></span>\n </span>\n <span class="zammad-chat-modal-text">');
|
||||||
|
|
||||||
__out.push(__sanitize(this.T('Connecting')));
|
__out.push(this.T('Connecting'));
|
||||||
|
|
||||||
__out.push('</span>\n</div>');
|
__out.push('</span>\n</div>');
|
||||||
|
|
||||||
|
@ -1117,7 +1119,7 @@ window.zammadChatTemplates["timeout"] = function (__obj) {
|
||||||
|
|
||||||
__out.push('>');
|
__out.push('>');
|
||||||
|
|
||||||
__out.push(__sanitize(this.T('Start new conversation')));
|
__out.push(this.T('Start new conversation'));
|
||||||
|
|
||||||
__out.push('</div>\n </div>\n</div>');
|
__out.push('</div>\n </div>\n</div>');
|
||||||
|
|
||||||
|
|
2
public/assets/chat/chat.min.js
vendored
2
public/assets/chat/chat.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -26,7 +26,7 @@
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.zammad-chat.zammad-chat-is-open {
|
.zammad-chat.zammad-chat-is-visible {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.zammad-chat.zammad-chat-is-open .zammad-chat-header {
|
.zammad-chat.zammad-chat-is-visible .zammad-chat-header {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,11 +93,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.zammad-chat-header-icon-close,
|
.zammad-chat-header-icon-close,
|
||||||
.zammad-chat.zammad-chat-is-open .zammad-chat-header-icon-open {
|
.zammad-chat.zammad-chat-is-visible .zammad-chat-header-icon-open {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.zammad-chat.zammad-chat-is-open .zammad-chat-header-icon-close {
|
.zammad-chat.zammad-chat-is-visible .zammad-chat-header-icon-close {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue