Merge branch 'develop' of github.com:martini/zammad into develop
This commit is contained in:
commit
600649d51a
10 changed files with 119 additions and 95 deletions
|
@ -1892,24 +1892,24 @@ class App.CustomerChatRef extends App.Controller
|
|||
else
|
||||
@nextQuestion()
|
||||
|
||||
class CustomerChatRouter extends App.ControllerPermanent
|
||||
constructor: (params) ->
|
||||
super
|
||||
# class CustomerChatRouter extends App.ControllerPermanent
|
||||
# constructor: (params) ->
|
||||
# super
|
||||
|
||||
# check authentication
|
||||
return if !@authenticate()
|
||||
# # check authentication
|
||||
# return if !@authenticate()
|
||||
|
||||
App.TaskManager.execute(
|
||||
key: 'CustomerChatRef'
|
||||
controller: 'CustomerChatRef'
|
||||
params: {}
|
||||
show: true
|
||||
persistent: true
|
||||
)
|
||||
# App.TaskManager.execute(
|
||||
# key: 'CustomerChatRef'
|
||||
# controller: 'CustomerChatRef'
|
||||
# params: {}
|
||||
# show: true
|
||||
# persistent: true
|
||||
# )
|
||||
|
||||
App.Config.set( 'layout_ref/customer_chat', CustomerChatRouter, 'Routes' )
|
||||
App.Config.set( 'CustomerChatRef', { controller: 'CustomerChatRef', authentication: true }, 'permanentTask' )
|
||||
App.Config.set( 'CustomerChatRef', { prio: 1200, parent: '', name: 'Customer Chat', target: '#layout_ref/customer_chat', key: 'CustomerChatRef', role: ['Agent'], class: 'chat' }, 'NavBar' )
|
||||
# App.Config.set( 'layout_ref/customer_chat', CustomerChatRouter, 'Routes' )
|
||||
# App.Config.set( 'CustomerChatRef', { controller: 'CustomerChatRef', authentication: true }, 'permanentTask' )
|
||||
# App.Config.set( 'CustomerChatRef', { prio: 1200, parent: '', name: 'Customer Chat', target: '#layout_ref/customer_chat', key: 'CustomerChatRef', role: ['Agent'], class: 'chat' }, 'NavBar' )
|
||||
|
||||
|
||||
class chatWindowRef extends Spine.Controller
|
||||
|
|
|
@ -6890,6 +6890,11 @@ output {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
datepicker resets some css it potentially inherits when its rendered inside a table
|
||||
*/
|
||||
|
||||
.datepicker {
|
||||
background: hsl(234,10%,19%);
|
||||
color: white;
|
||||
|
@ -6909,6 +6914,14 @@ output {
|
|||
}
|
||||
}
|
||||
|
||||
th {
|
||||
background: none;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.next,
|
||||
.prev {
|
||||
cursor: pointer;
|
||||
|
@ -6938,7 +6951,7 @@ output {
|
|||
width: 27px;
|
||||
height: 26px;
|
||||
border-radius: 100%;
|
||||
padding: 1px 0 0;
|
||||
padding: 1px 0 0 !important;
|
||||
}
|
||||
|
||||
.month,
|
||||
|
|
|
@ -46,10 +46,9 @@ do($ = window.jQuery, window) ->
|
|||
|
||||
@el.find('.zammad-chat-header').click @toggle
|
||||
@el.find('.zammad-chat-controls').on 'submit', @onSubmit
|
||||
@el.find('.zammad-chat-input').on(
|
||||
@el.find('.zammad-chat-input').on
|
||||
keydown: @checkForEnter
|
||||
input: @onInput
|
||||
).autoGrow { extraLine: false }
|
||||
|
||||
@session_id = undefined
|
||||
|
||||
|
@ -122,7 +121,10 @@ do($ = window.jQuery, window) ->
|
|||
console.log 'Zammad Chat: Too many clients in queue. Clients in queue: ', pipe.data.queue
|
||||
|
||||
onReady: =>
|
||||
@show() if @options.show
|
||||
if @options.show
|
||||
@show()
|
||||
@el.find('.zammad-chat-input').autoGrow
|
||||
extraLine: false
|
||||
|
||||
onInput: =>
|
||||
# remove unread-state from messages
|
||||
|
|
|
@ -170,12 +170,14 @@
|
|||
margin: 0.5em 0; }
|
||||
|
||||
.zammad-chat-message-body {
|
||||
padding: 0.6em 1em;
|
||||
padding: 0.5em 1em;
|
||||
line-height: 1.4;
|
||||
border-radius: 1em;
|
||||
background: #f6f8f9;
|
||||
display: inline-block;
|
||||
max-width: 70%;
|
||||
white-space: pre;
|
||||
white-space: pre-line;
|
||||
word-wrap: break-word;
|
||||
box-shadow: 0 2px rgba(255, 255, 255, 0.15) inset, 0 0 0 1px rgba(0, 0, 0, 0.08) inset, 0 1px rgba(0, 0, 0, 0.02); }
|
||||
|
||||
.zammad-chat-message--customer {
|
|
@ -1,3 +1,68 @@
|
|||
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> ');
|
||||
|
||||
__out.push(this.agentPhrase);
|
||||
|
||||
__out.push('\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); }; };
|
||||
|
||||
(function($, window) {
|
||||
|
@ -85,8 +150,6 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|||
this.el.find('.zammad-chat-input').on({
|
||||
keydown: this.checkForEnter,
|
||||
input: this.onInput
|
||||
}).autoGrow({
|
||||
extraLine: false
|
||||
});
|
||||
this.session_id = void 0;
|
||||
if (!window.WebSocket) {
|
||||
|
@ -197,7 +260,10 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|||
|
||||
ZammadChat.prototype.onReady = function() {
|
||||
if (this.options.show) {
|
||||
return this.show();
|
||||
this.show();
|
||||
return this.el.find('.zammad-chat-input').autoGrow({
|
||||
extraLine: false
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -427,69 +493,6 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|||
});
|
||||
})(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() {
|
||||
__out.push('<img class="zammad-chat-agent-avatar" src="');
|
||||
|
||||
__out.push(__sanitize(this.agent.avatar));
|
||||
|
||||
__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> ');
|
||||
|
||||
__out.push(this.agentPhrase);
|
||||
|
||||
__out.push('\n</span>');
|
||||
|
||||
}).call(this);
|
||||
|
||||
}).call(__obj);
|
||||
__obj.safe = __objSafe, __obj.escape = __escape;
|
||||
return __out.join('');
|
||||
};
|
||||
|
||||
/*!
|
||||
* ----------------------------------------------------------------------------
|
||||
* "THE BEER-WARE LICENSE" (Revision 42):
|
||||
|
@ -782,7 +785,7 @@ window.zammadChatTemplates["status"] = function (__obj) {
|
|||
|
||||
__out.push(__sanitize(this.label));
|
||||
|
||||
__out.push('</strong>');
|
||||
__out.push('</strong> ');
|
||||
|
||||
__out.push(__sanitize(this.time));
|
||||
|
||||
|
|
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
|
@ -203,12 +203,14 @@ $baseTextColor: if($luminance < 0.2, white, black);
|
|||
}
|
||||
|
||||
.zammad-chat-message-body {
|
||||
padding: 0.6em 1em;
|
||||
padding: 0.5em 1em;
|
||||
line-height: 1.4;
|
||||
border-radius: 1em;
|
||||
background: desaturate(lightenMax($themeColor, 50%, 97%), 50%);
|
||||
display: inline-block;
|
||||
max-width: 70%;
|
||||
white-space: pre;
|
||||
white-space: pre-line;
|
||||
word-wrap: break-word;
|
||||
box-shadow:
|
||||
0 2px rgba(255,255,255,.15) inset,
|
||||
0 0 0 1px rgba(0,0,0,.08) inset,
|
|
@ -11,7 +11,7 @@ var merge = require('merge-stream');
|
|||
var plumber = require('gulp-plumber');
|
||||
|
||||
gulp.task('css', function(){
|
||||
return gulp.src('style.scss')
|
||||
return gulp.src('chat.scss')
|
||||
.pipe(sass.sync().on('error', gutil.log))
|
||||
.pipe(autoprefixer({
|
||||
browsers: ['last 4 versions'],
|
||||
|
@ -40,7 +40,7 @@ gulp.task('js', function(){
|
|||
});
|
||||
|
||||
gulp.task('default', function(){
|
||||
var cssWatcher = gulp.watch('style.scss', ['css']);
|
||||
var cssWatcher = gulp.watch('chat.scss', ['css']);
|
||||
cssWatcher.on('change', function(event) {
|
||||
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
|
||||
});
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Zammad Chat</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="stylesheet" href="chat.css">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
|
||||
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35738/livereload.js?snipver=1"></' + 'script>')</script>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<% if @agent.avatar: %>
|
||||
<img class="zammad-chat-agent-avatar" src="<%= @agent.avatar %>">
|
||||
<% end %>
|
||||
<span class="zammad-chat-agent-sentence">
|
||||
<span class="zammad-chat-agent-name"><%= @agent.name %></span> <%- @agentPhrase %>
|
||||
</span>
|
Loading…
Reference in a new issue