Warning : session_start(): open(/var/lib/php/sessions/sess_6eafvm83hgd8ekfqm383k22e5l, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning : session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// assume jquery is already loaded
try {
console.log("lang: " + GTranslateGetCurrentLang());
} catch (err) {
console.log(err);
}
var chatBot_n = #N#;
var chatBot_interval = 1000;
var chatBot_nInitial = chatBot_n;
var chatBot_showActions = false;
var chatBot_cookie = localStorage.getItem('chatbot-cookie');
console.log("cookie 1: " + chatBot_cookie);
if (!chatBot_cookie) {
chatBot_cookie = Math.random().toString(36).substr(2, 9);
localStorage.setItem('chatbot-cookie', chatBot_cookie);
console.log("cookie 2: " + chatBot_cookie);
}
// workaround to get $ from wordpress version of jQuery
jQuery(document).ready(function ($) {
console.log("loading 2");
// bot styles (#1025978)
$('head').append(' ');
// bootstrap
function dynamicallyLoadScript(url) {
var script = document.createElement("script");
script.src = url;
document.head.appendChild(script);
}
// bootstrap js
dynamicallyLoadScript('https://botcompany.de/1014036/raw/1025981?contentType=text/javascript');
// scripts for bot
$(function(){
$("#addClass").click(function () {
console.log("Opening chat bot");
$('#qnimate').addClass('popup-box-on');
$("#scrollme").scrollTop(1E10);
$('#status_message').focus();
return false;
});
$("#removeClass").click(function () {
$('#qnimate').removeClass('popup-box-on');
return false;
});
});
function chatBot_showAction(action) {
if (chatBot_showActions) {
$("#actionMsg").html(action);
$("#actionMsg").show();
}
console.log(action);
}
window.chatBot_appendAction = function(action) {
if (chatBot_showActions) {
$("#actionMsg").append(" | " + action);
$("#actionMsg").show();
}
};
window.chatBot_hideAction = function() {
$("#actionMsg").hide();
$("#actionMsg").html("");
};
window.chatBot_start = function() {
url = "#INCREMENTALURL#";
if (url != '' && url != ("#INC" + "REMENTALURL#")) {
chatBot_showAction("Loading " + url + chatBot_n);
$.get(url + chatBot_n + "&cookie=" + chatBot_cookie, function(src) {
chatBot_showAction("Loaded");
var match = src.match(/\d+/);
if (match != null) {
var newN = parseInt(match[0]);
if (src.match(/NEW DIALOG -->/))
$(".direct-chat-messages").html(src);
else
$(".direct-chat-messages").append(src);
chatBot_n = newN;
$("#scrollme").scrollTop(1E10);
chatBot_showAction("Appended " + src.length);
console.log(src);
} else
chatBot_showAction("chatBot_n=" + chatBot_n + " (initial=" + chatBot_nInitial + ")");
chatBot_appendAction("Rescheduling");
setTimeout(chatBot_start, chatBot_interval);
chatBot_appendAction("Rescheduled");
}, 'text')
.fail(function() {
chatBot_showAction("Rescheduling after fail");
setTimeout(chatBot_start, chatBot_interval);
});
}
};
window.submitMsg = function() {
/*if (status_message.value == 'new dialog')
document.forms['msgform'].submit();
else*/ {
url = '#MSGURL#' + encodeURIComponent(status_message.value) + "&cookie=" + chatBot_cookie;
chatBot_showAction('Submitting ' + url);
$.get(url);
status_message.value = '';
}
};
$('body').append(`