var pfAWN;
var runstep2embedgoskebi_sitia = function (){
var targetdiv = document.getElementById("skebi_sitia");
if(typeof pfAWN == "undefined"){
pfAWN = new AWN({
position: "top-right",
durations: {
global: 5000,
success: 3000,
warning: 5000,
alert: 0,
info: 4000,
tip: 2000
},
labels: {
success: "SUCCESS",
warning: "EMBEDDING WARNING!",
alert: "EMBEDDING ERROR!",
info: "INFO",
tip: ""
},
icons: {
prefix: ""
}
});
}else{
}
if(targetdiv){
if (!('cliente' in targetdiv.dataset)) {
pfAWN.alert('target [ skebi_sitia ] (div da elaborare) non ha attributo obbligatorio [ data-cliente ]!');
}else{
var c = targetdiv.getAttribute('data-cliente');
if (!('key' in targetdiv.dataset)) {
pfAWN.alert('target [ skebi_sitia ] (div da elaborare) non ha attributo obbligatorio [ data-key ]!');
}else{
var k = targetdiv.getAttribute('data-key');
if (!('host' in targetdiv.dataset)) {
var h = window.location.hostname;
}else{
var h = targetdiv.getAttribute('data-host');
}
let hostnames = h.split('.');
h = hostnames[hostnames.length-2] + '.' + hostnames[hostnames.length-1];
var param_accettati = {'data-autocc':'^cc$','data-anamorfico':'^[a-z0-9_]{3,}$','data-bcolor':'^[A-F0-9]{6}$','data-icolor':'^[A-F0-9]{6}$','data-lang':'^[a-z]{2}$'
};
var optional = {};
for (var att, i = 0, atts = targetdiv.attributes, n = atts.length; i < n; i++){
att = atts[i];
if(Object.keys(param_accettati).indexOf(att.nodeName) != -1){
var regex = new RegExp(Object.values(param_accettati)[Object.keys(param_accettati).indexOf(att.nodeName)]);
if(!regex.test(att.nodeValue)) { // input non accettato
pfAWN.warning('target [ skebi_sitia ] (div da elaborare) ha attributo '+att.nodeName+' non conforme '+Object.values(param_accettati)[Object.keys(param_accettati).indexOf(att.nodeName)]+'!',
{ icons: {
suffix: "' style='width: 36px; filter: invert(36%) sepia(85%) saturate(1988%) hue-rotate(20deg) brightness(94%) contrast(101%);' />"
}}
);
}else{
optional[ att.nodeName ] = att.nodeValue;
}
}
}
var queryString = Object.keys(optional).map(function(key) {
return key.replace('data-', '') + '=' + optional[key]
}).join('&');
if(queryString.length){queryString='/'+queryString};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)){ return; }
js = d.createElement(s); js.id = id;
js.onload = function(){
// remote script has loaded
runstep3goskebi_sitia();
};
js.src = "https://skebi.net/3d/skebi_sitia/"+c+"/"+k+"/"+h+"/goembedlist"+queryString;
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'jsskebi_sitia'));
}
}
}else{console.log('target [ skebi_sitia ] (div da elaborare) non trovato!');
}
}
function waitUntilAWNandrunstep2embedlistgoskebi_sitia( delay) {
if(typeof AWN != "undefined"){
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)){
//waitUntilJQueryandrunstep22modalgoskebi_sitia(100);
runstep2embedgoskebi_sitia();
}else{
if (typeof iframeResizer != "undefined") {
var targetdiv = document.getElementById("skebi_sitia");
if(targetdiv){
//waitUntilmagnificrunstep23modalgoskebi_sitia(100);
runstep2embedgoskebi_sitia();
}else{
console.log('target [ skebi_sitia ] (div da elaborare) non trovato!');
}
}else{
js = d.createElement(s);
js.id = id;
js.onload = function(){
;
// remote script has loaded
//waitUntilJQueryandrunstep22modalgoskebi_sitia(100);
runstep2embedgoskebi_sitia();
};
js.src = "https://skebi.net/js/iframeResizer.min.js";
fjs.parentNode.insertBefore(js, fjs.nextSibling);
}
}
}(document, 'script', 'pf_iframeResizerjs'));
} else {
setTimeout(()=>waitUntilAWNandrunstep2embedlistgoskebi_sitia( delay), delay);
}
}
(function(d, s, id){
var js,jss, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)){
waitUntilAWNandrunstep2embedlistgoskebi_sitia(100);
}else{
if (typeof AWN != "undefined") {
waitUntilAWNandrunstep2embedlistgoskebi_sitia(100);
}else{
var AWNcss = document.createElement('link');
AWNcss.type = 'text/css';
AWNcss.id = 'pf_AWNcss';
AWNcss.rel = 'stylesheet';
AWNcss.href = "https://skebi.net/3d/css/static/AWN.css";
document.getElementsByTagName('head')[0].appendChild(AWNcss);
js = d.createElement(s);
js.id = id;
js.onload = function(){
// remote script has loaded
waitUntilAWNandrunstep2embedlistgoskebi_sitia(100);
};
js.src = "https://skebi.net/3d/libs/static/AWN.js";
fjs.parentNode.insertBefore(js, fjs);
}
}
}(document, 'script', 'pf_AWNjs'));