chat client: rename is-open to is-visible
This commit is contained in:
parent
48f9d4fc10
commit
1bbf80c80a
4 changed files with 78 additions and 76 deletions
|
@ -281,7 +281,7 @@ do($ = window.jQuery, window) ->
|
|||
@showLoader()
|
||||
|
||||
@el
|
||||
.addClass('zammad-chat-is-open')
|
||||
.addClass('zammad-chat-is-visible')
|
||||
|
||||
if !@sessionId
|
||||
@el.animate { bottom: 0 }, 500, @onOpenAnimationEnd
|
||||
|
@ -315,7 +315,7 @@ do($ = window.jQuery, window) ->
|
|||
@el.animate { bottom: -remainerHeight }, 500, @onCloseAnimationEnd
|
||||
|
||||
onCloseAnimationEnd: =>
|
||||
@el.removeClass('zammad-chat-is-open')
|
||||
@el.removeClass('zammad-chat-is-visible')
|
||||
@disconnect()
|
||||
@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); }; },
|
||||
slice = [].slice;
|
||||
|
||||
|
@ -74,9 +13,10 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|||
host: '',
|
||||
port: 6042,
|
||||
debug: false,
|
||||
flat: false,
|
||||
fontSize: void 0,
|
||||
buttonSelector: '.open-zammad-chat',
|
||||
hiddenButtonClass: 'is-inactive',
|
||||
buttonClass: 'open-zammad-chat',
|
||||
inactiveClass: 'is-inactive',
|
||||
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.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-close').click(this.close);
|
||||
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() {
|
||||
$(this.options.buttonSelector).click(this.open).removeClass(this.hiddenButtonClass);
|
||||
$("." + this.options.buttonClass).click(this.open).removeClass(this.inactiveClass);
|
||||
if (this.options.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) {
|
||||
this.log('debug', message);
|
||||
return $(this.options.buttonSelector).hide();
|
||||
return $("." + this.options.buttonClass).hide();
|
||||
};
|
||||
|
||||
ZammadChat.prototype.reopenSession = function(data) {
|
||||
|
@ -423,7 +364,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|||
if (!this.sessionId) {
|
||||
this.showLoader();
|
||||
}
|
||||
this.el.addClass('zammad-chat-is-open');
|
||||
this.el.addClass('zammad-chat-is-visible');
|
||||
if (!this.sessionId) {
|
||||
this.el.animate({
|
||||
bottom: 0
|
||||
|
@ -465,7 +406,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|||
};
|
||||
|
||||
ZammadChat.prototype.onCloseAnimationEnd = function() {
|
||||
this.el.removeClass('zammad-chat-is-open');
|
||||
this.el.removeClass('zammad-chat-is-visible');
|
||||
this.disconnect();
|
||||
this.isOpen = false;
|
||||
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;
|
||||
})(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):
|
||||
|
@ -932,7 +934,7 @@ window.zammadChatTemplates["loader"] = function (__obj) {
|
|||
(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(__sanitize(this.T('Connecting')));
|
||||
__out.push(this.T('Connecting'));
|
||||
|
||||
__out.push('</span>\n</div>');
|
||||
|
||||
|
@ -1117,7 +1119,7 @@ window.zammadChatTemplates["timeout"] = function (__obj) {
|
|||
|
||||
__out.push('>');
|
||||
|
||||
__out.push(__sanitize(this.T('Start new conversation')));
|
||||
__out.push(this.T('Start new conversation'));
|
||||
|
||||
__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;
|
||||
}
|
||||
}
|
||||
.zammad-chat.zammad-chat-is-open {
|
||||
.zammad-chat.zammad-chat-is-visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
|||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
.zammad-chat.zammad-chat-is-open .zammad-chat-header {
|
||||
.zammad-chat.zammad-chat-is-visible .zammad-chat-header {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
@ -93,11 +93,11 @@
|
|||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.zammad-chat.zammad-chat-is-open .zammad-chat-header-icon-close {
|
||||
.zammad-chat.zammad-chat-is-visible .zammad-chat-header-icon-close {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue