Přeskočit na hlavní obsah

Rozdílné nastavení pro web a mobil

Javascript


var _msgokConfigWeb = {
"recipient":"mujucet",
"payload":"%7B%22runId%22%3A%22abc%3Amojesamoobsluha%22%7D",
"src":"templates/mujucet",
"type":"popup",
"classes": ["msgokWidget--fix-to-right", "msgokWidget--size-text"],
"title": "Online pomoc"
};

var _msgokConfigMobile = {
"recipient":"mujucet",
"payload":"%7B%22runId%22%3A%22abc%3Arozcestnik%22%7D",
"src":"templates/mujucet",
"type":"popup",
"classes": ["msgokWidget--fix-to-right", "msgokWidget--size-text"],
"title": "Pomoc"
};

var e = document.createElement("script");
e.src = "https://cdn.msgok.net/client/v10.js";
e.async = true;
e.defer = true;
e.addEventListener("load",function(){
let w;
if(window.msgokWidget.isMobile()){
w = window.msgokWidget.create("#msgokpreview", _msgokConfigMobile);
}
else{
w = window.msgokWidget.create("#msgokpreview", _msgokConfigWeb);
}

w.show();
});
document.getElementsByTagName("head")[0].appendChild(e);