|
@@ -375,7 +375,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|
|
if (!this.sessionId) {
|
|
|
this.showLoader();
|
|
|
}
|
|
|
- this.el.addClass('zammad-chat-is-visible');
|
|
|
+ this.el.addClass('zammad-chat-is-open');
|
|
|
if (!this.sessionId) {
|
|
|
this.el.animate({
|
|
|
bottom: 0
|
|
@@ -410,6 +410,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|
|
|
|
|
ZammadChat.prototype.closeWindow = function() {
|
|
|
var remainerHeight;
|
|
|
+ this.el.removeClass('zammad-chat-is-open');
|
|
|
remainerHeight = this.el.height() - this.el.find('.zammad-chat-header').outerHeight();
|
|
|
return this.el.animate({
|
|
|
bottom: -remainerHeight
|
|
@@ -429,7 +430,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|
|
};
|
|
|
|
|
|
ZammadChat.prototype.hide = function() {
|
|
|
- return this.el.removeClass('zammad-chat-is-visible');
|
|
|
+ return this.el.removeClass('zammad-chat-is-shown');
|
|
|
};
|
|
|
|
|
|
ZammadChat.prototype.show = function() {
|
|
@@ -437,7 +438,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|
|
if (this.state === 'off' || this.state === 'unsupported') {
|
|
|
return this.state;
|
|
|
}
|
|
|
- this.el.addClass('zammad-chat-is-visible');
|
|
|
+ this.el.addClass('zammad-chat-is-shown');
|
|
|
if (!this.inputInitialized) {
|
|
|
this.inputInitialized = true;
|
|
|
this.input.autoGrow({
|
|
@@ -683,6 +684,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):
|
|
@@ -760,67 +822,6 @@ jQuery.fn.autoGrow = function(options) {
|
|
|
|
|
|
});
|
|
|
};
|
|
|
-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('');
|
|
|
-};
|
|
|
-
|
|
|
if (!window.zammadChatTemplates) {
|
|
|
window.zammadChatTemplates = {};
|
|
|
}
|