(function(a,b){"function"==typeof define&&define.amd?define("frontAPI",[],b):"object"==typeof module&&module.exports?module.exports=b():a.frontAPI?a["frontAPI"+b().getVersion().replace(/\./g,"")]=b():a.frontAPI=b()})(window,function(){function a(){return window.Shop&&Shop.values?Shop.values.currency||"PLN":"PLN"}function b(){return window.Shop&&Shop.lang?Shop.lang.name||"pl_PL":"pl_PL"}function c(a,b){return a.replace(/\{(.+?)\}/g,function(a,c){return c in b?b[c]:a})}function d(d,e){var f;return f=c(d,{id:e.id||"",lang:e.lang||b(),currency:e.currency||a(),search:e.search||""}),e.urlParams&&(f+=e.urlParams),f}function e(a,b,c,d){return"function"!=typeof c&&(c=!1),d=d||{},d.data&&(d.data=JSON.stringify(d.data)),!0===d.noCache&&(b+="?noCache"+Date.now()),!1===c?(syncReq=g.send(b,d.data||"",function(){},a,!1,d.headers),syncReq.responseText?JSON.parse(syncReq.responseText):200===syncReq.status):void i.push({url:b,data:d.data||"",callback:c,method:a,headers:d.headers})}var f,g,h,i;i={requestInProgress:!1,maxRequests:3,requests:0,queue:[],push:function(a){this.queue.push(a),this.requestsb?1:a { var smaName = sm_a.name.split('__'); if (sm_a.type == 1 && smaName[0] == 'Kompatybilność') { smaAttributes[smaName[1]+'-'+sm_a.value] = sm_tmp_id; }; sm_tmp_id++; }); Object.keys(attrName).forEach((ak) => { var smaCode = ak.split('-'); if (smaCode[0] == 'Kompatybilność (zestaw)') { var smaSets = smaCode[1].split(','); var sm_cnt_valid = 0; smaSets.forEach((s) => { var smaSet = s.split(':'); if (smaAttributes[smaSet[0].trim()+'-'+smaSet[1].trim()]) { sm_cnt_valid++; } }); if (sm_cnt_valid == smaSets.length) { console.log('cnt:'+sm_cnt_valid); var newAttr = {'name':smaCode[0], 'value':smaCode[1], 'type':0}; sm_attributes.push(newAttr); /* Dodaję atrybut zestawu */ /* Usuwam podstawowe atrybuty */ smaSets.forEach((s) => { var smaSet = s.split(':'); sm_attributes.splice(smaAttributes[smaSet[0].trim()+'-'+smaSet[1].trim()], 1); }); } } }); var sm_gap_sid = '9'; var sm_gap_url = 'https://gap.shopmod.pl/img/9/'; function showGAP() { var sm_location = document.getElementsByClassName('product-main-box')[0].getElementsByClassName('basket')[0]; var sm_add_img = ''; sm_attributes.forEach((sm_a) => { if (attrName[sm_a.name + '-' + sm_a.value]) { sm_add_img += smSetImg(attrName[sm_a.name + '-' + sm_a.value]['img'], attrName[sm_a.name + '-' + sm_a.value]['info']); }; }); sm_location.outerHTML = sm_location.outerHTML + '
' + sm_add_img + '
'; } function smSetImg(img, info) { var sHtml = ''; sHtml += '
'; if (info != '') sHtml += '
'; sHtml += ''; if (info != '') sHtml += '
'+info+'
'; sHtml += '
'; return sHtml; } showGAP();