favlist = { "fair": "", "year": "", "lang": "", "favPageUrl": "", "init": function(fair, year, lang, favPageUrl) { favlist.fair = fair; favlist.year = year; favlist.lang = lang; favlist.favPageUrl = favPageUrl; $(function() { if($('#merkliste54').length==0 && $('.merklistenView').length==0 ) { var html = favlist.favButtonHtml; html = html.replace("##URL##", favlist.favPageUrl); html = html.replace("##KM_MERKLISTEOEFFNEN##", (favlist.lang==1 ? 'Merkliste öffnen' : 'open favlist')); html = html.replace("##MERKLISTE##", (favlist.lang==1 ? 'Merkliste' : 'Favorites')); $('body').append(html); } favlist.getcount(); }); // console.warn(favlist); }, "getcount": function() { var getfavlistcounter = "https://backends.koelnmesse.io/firstspirit/asdb.php?PHPSESSID="+favlist.getCookie("PHPSESSID")+"&sV="+favlist.fair+"&tV=0&sJ="+favlist.year+"&sS="+favlist.lang+"&route=merkliste/getfavlistcounter&fw_ajax=1&"; $.ajax({ "url": getfavlistcounter, "type": "post", "dataType": "html", "data": {}, "success": function (data) { if(data>0) { $('.marked_bar.calchexpseudoback.light').fadeIn(); } $('#markedcountNew').html(data); }, "error": function (request,status,error) { } }); }, "toggle": function(type, id, callback) { var ajaxMerkenPage = "https://backends.koelnmesse.io/firstspirit/asdb.php?PHPSESSID="+favlist.getCookie("PHPSESSID")+"&sV="+favlist.fair+"&tV=0&sJ="+favlist.year+"&sS="+favlist.lang+"&route=merkliste/merken&fw_ajax=1&"; $.ajax({ url: ajaxMerkenPage + 'type=' + type + '&id=' + id + "&_=" + (new Date()).getTime(), type: "GET", dataType: "html", success: function (data) { console.log(data); favlist.getcount(); favlist.cdscall(id, data.produktgruppen); if(typeof(callback)!="undefined") callback(); }, error: function () { } }); }, "getAusstellerinfos": function(productgroupids, filterfunction, resultlimit, excludearray, sortby, sortdir, callback) { var ajaxAusstellerinfos = "https://backends.koelnmesse.io/firstspirit/asdb.php?PHPSESSID="+favlist.getCookie("PHPSESSID")+"&sV="+favlist.fair+"&tV=0&sJ="+favlist.year+"&sS="+favlist.lang+"&route=merkliste/getAusstellerinfos&fw_ajax=1&developview=on&"; ajaxAusstellerinfos += 'productgroupids=' + productgroupids + '&filterfunction=' + filterfunction + '&resultlimit=' + resultlimit + '&excludearray=' + excludearray + '&sortby=' + sortby + '&sortdir=' + sortdir; ajaxAusstellerinfos += "&_=" + (new Date()).getTime(); $.ajax({ url: ajaxAusstellerinfos, type: "GET", dataType: "html", success: function (data) { data = favlist.stripAJAXResult(data); data = JSON.parse(data); //console.log(data); if(typeof(callback)!="undefined"){ callback(data); }else{ console.log(data); } }, error: function () { } }); }, "getProdukteinfos": function(productgroupids, filterfunction, resultlimit, customerspecificlimit, excludearray, sortby, sortdir, callback) { /*console.log("allCall start"); let startx = Date.now(); console.log(startx);*/ var ajaxProdukteinfos = "https://backends.koelnmesse.io/firstspirit/asdb.php?PHPSESSID="+favlist.getCookie("PHPSESSID")+"&sV="+favlist.fair+"&tV=0&sJ="+favlist.year+"&sS="+favlist.lang+"&route=merkliste/getProdukteinfos&fw_ajax=1&developview=on&"; ajaxProdukteinfos += 'productgroupids=' + productgroupids + '&filterfunction=' + filterfunction + '&resultlimit=' + resultlimit + '&customerspecificlimit=' + customerspecificlimit + '&excludearray=' + excludearray + '&sortby=' + sortby + '&sortdir=' + sortdir; $.ajax({ url: ajaxProdukteinfos + "&_=" + (new Date()).getTime(), type: "GET", dataType: "html", success: function (data) { data = favlist.stripAJAXResult(data); data = JSON.parse(data); //console.log(data); /*console.log("allCall end"); let endx = Date.now(); console.log(endx - startx);*/ if(typeof(callback)!="undefined"){ callback(data); }else{ console.log(data); } }, error: function () { } }); }, "getProdukteinfosSingleCalls": function(productgroupids, filterfunction, callback) { /*console.log("singelcall start"); let startx = Date.now(); console.log(startx);*/ var ajaxProdukteinfosSingleCalls = "https://backends.koelnmesse.io/firstspirit/asdb.php?PHPSESSID="+favlist.getCookie("PHPSESSID")+"&sV="+favlist.fair+"&tV=0&sJ="+favlist.year+"&sS="+favlist.lang+"&route=merkliste/getProdukteinfosSingleCalls&fw_ajax=1&developview=on&"; $.ajax({ url: ajaxProdukteinfosSingleCalls + 'productgroupids=' + productgroupids + '&filterfunction=' + filterfunction + "&_=" + (new Date()).getTime(), type: "GET", dataType: "html", success: function (data) { data = favlist.stripAJAXResult(data); data = JSON.parse(data); //console.log(data); /*console.log("allCall end"); let endx = Date.now(); console.log(endx - startx);*/ if(typeof(callback)!="undefined"){ callback(data); }else{ console.log(data); } }, error: function () { } }); }, "toggleexhibitor": function(id, callback) { this.toggle("aussteller", id, callback); }, "toggleproduct": function(id, callback) { this.toggle("produkte", id, callback); }, "toggleevent": function(id, callback) { this.toggle("event", id, callback); }, "getCookie": function(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i = 0; i ") != -1) { html = html.substr(html.indexOf("")); html = html.substr(html.indexOf(">") + 1); } return html; }, favButtonHtml: '', "cdscall": function(id, groups) { // API Ajax-Call } };