(function(){ var activeThumb = 0; var DEFAULTS = { inputBullets: 'Keinerlei Programmierkenntnisse noetig, alle erforderlichen Eingaben erfolgen direkt und intuitiv im online Editor.\nFarbliche Personalisierung moeglich per Farbauswahlfunktion im Editor\nLive Vorschau, sie sehen sofort was ihre Eingabe bewirkt.\nbis zu 12 Bilder\nHTML Export direkt in den Zwischenspeicher (klicken, einfuegen, fertig)' }; function setDefaults(){ var csDefaults=[ {img:'https://primary.jwwb.nl/public/k/s/j/temp-ffjdsjxsjdrzqjuhntwc/01_00227-hirschmann-elka-4012-pg-7-4-polig-gerade-10-high.jpg',title:'Hirschmann ELKA 4012 PG 7'}, {img:'https://primary.jwwb.nl/public/k/s/j/temp-ffjdsjxsjdrzqjuhntwc/01_00224-pv140r1k1t1nfr1-parker-dension-axial-kolben-pumpe-mit-variabler-verdr-ngung-07-high.jpg',title:'Parker Axialkolbenpumpe'}, {img:'https://primary.jwwb.nl/public/k/s/j/temp-ffjdsjxsjdrzqjuhntwc/01_00196-siemens-3nw7534-1hg-sicherungshalter-30-a-600-v-high.jpg',title:'Siemens Sicherungshalter'}, {img:'https://primary.jwwb.nl/public/k/s/j/temp-ffjdsjxsjdrzqjuhntwc/01_00181-abb-3hne00313-1-teach-pendant-handprogrammierger-t-high.jpg',title:'ABB Teach Pendant'}, {img:'https://primary.jwwb.nl/public/k/s/j/temp-ffjdsjxsjdrzqjuhntwc/01_00180-phoenix-fiber-optic-termination-kit-fast-connection-tool-glasfaserkabel-werkzeugkoffer-02-high.jpg',title:'Phoenix Fiber Optic Kit'} ]; csDefaults.forEach(function(d,i){ var imgEl=document.getElementById('cs-img-'+(i+1)); var titleEl=document.getElementById('cs-title-'+(i+1)); if(imgEl&&!imgEl.value.trim()) imgEl.value=d.img; if(titleEl&&!titleEl.value.trim()) titleEl.value=d.title; }); Object.keys(DEFAULTS).forEach(function(id){ var el=document.getElementById(id); if(el && !el.value.trim()) el.value=DEFAULTS[id]; }); } function buildModal(id,title,warnBg,warnColor,warnText,placeholder){ if(document.getElementById("modal-"+id)) return; var m=document.createElement("div"); m.id="modal-"+id; m.style.cssText="display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.55);z-index:99999;align-items:center;justify-content:center;"; var rid="rte-modal-"+id; m.innerHTML='
' +'
' +''+title+'' +'
' +'
'+warnText+'
' +'
' +'' +'' +'' +'' +'
' +'
'+placeholder+'
' +'
' +'' +'' +'
'; document.body.appendChild(m); } function buildColorPickers(){ var eBody=document.getElementById('editor-body'); if(!eBody||document.getElementById('custom-colors')) return; var cmEl=document.getElementById('colorMain'); if(!cmEl) return; var rowEl=cmEl; while(rowEl.parentNode!==eBody) rowEl=rowEl.parentNode; var pal=['#002f6c','#1a3a6b','#003366','#0066cc','#0099cc','#2c3e50','#e53238','#cc0000','#8b0000','#d4351c','#ff6600','#f39c12','#008000','#2e8b57','#27ae60','#1abc9c','#800080','#9b59b6','#000000','#333333','#555555','#777777','#999999','#ffffff']; var div=document.createElement('div'); div.id='custom-colors'; function mkRow(lbl,tgt,defVal){ var h='
'+lbl+':
'; h+='
'; for(var i=0;i
';} h+='
'; return h; } var caVal=(document.getElementById('colorAccent')||{value:'#e53238'}).value; div.innerHTML=mkRow('Hauptfarbe','Main',cmEl.value)+mkRow('Akzentfarbe','Accent',caVal); eBody.insertBefore(div,rowEl.nextElementSibling); } function buildColorPresets(){ var eBody=document.getElementById('editor-body'); if(!eBody||document.getElementById('color-presets')) return; var cc=document.getElementById('custom-colors'); if(!cc) return; var pr=[['Classic eBay','#002f6c','#e53238'],['Luxury Gold','#1a1a2e','#d4a832'],['Bold Tech','#1a1a1a','#cc0000'],['Nature Outdoor','#2d572c','#ff6600'],['Clean Eco','#333333','#27ae60'],['Sport Energy','#0047ab','#ff8c00'],['Elegant Wine','#800020','#d4a832'],['Modern Teal','#008080','#ff6b6b'],['Modern Tech','#2d2d2d','#e53238'],['Midnight Blue','#0f172a','#38bdf8']]; var div=document.createElement('div'); div.id='color-presets'; var h='
Schnellkonfig:
'; h+='
'; for(var i=0;i'; h+='
SHOP • KONTAKT
'; h+='
'; h+=''+p[0]+''; h+='49,95
'; h+='
AKTIV
TAB
'; h+='
'; } h+=''; div.innerHTML=h; eBody.insertBefore(div,cc); } function buildLogoAlign(){ var eBody=document.getElementById('editor-body'); if(!eBody||document.getElementById('logo-align-btns')) return; var imgInp=document.getElementById('inputLogoImg'); if(!imgInp) return; var imgParent=imgInp; while(imgParent.parentNode!==eBody) imgParent=imgParent.parentNode; var div=document.createElement('div'); div.id='logo-align-btns'; div.style.cssText='display:flex;gap:4px;margin-bottom:8px;'; div.innerHTML='Ausrichtung:' +'' +'' +''; eBody.insertBefore(div,imgParent.nextSibling); } function buildCategoryPreview(){ var badges=document.getElementById('pv-badges'); if(!badges||!badges.parentNode) return; if(document.getElementById('pv-categories')) return; var cat=document.createElement('div'); cat.id='pv-categories'; cat.style.cssText='display:none;'; badges.parentNode.insertBefore(cat,badges.nextSibling); } function buildCategoryEditor(){ var eBody=document.getElementById('editor-body'); if(!eBody||document.getElementById('cat-section')) return; var inputLogo=document.getElementById('inputLogo'); if(!inputLogo) return; var logoParent=inputLogo; while(logoParent.parentNode!==eBody) logoParent=logoParent.parentNode; var logoTitle=logoParent.previousElementSibling; var sec=document.createElement('div'); sec.id='cat-section'; sec.innerHTML='
Shop-Kategorieleiste
' +'
Nur eBay-interne Links verwenden!
' +'
' +''; eBody.insertBefore(sec,logoTitle); } function init(){ var app=document.getElementById('app'); if(!app) return; document.body.appendChild(app); var _tn=document.getElementById('pv-topnav'); if(_tn&&_tn.parentNode) Array.from(_tn.parentNode.children).forEach(function(ch){ if(ch.tagName==='P'&&!ch.textContent.trim()) ch.style.display='none'; }); var _cr2=document.querySelector('.color-row'); if(_cr2){ _cr2.querySelectorAll('p').forEach(function(p){ if(!p.textContent.trim()) p.style.display='none'; }); _cr2.querySelectorAll('br').forEach(function(br){ br.style.display='none'; }); } app.style.cssText='position:fixed!important;top:32px!important;left:0!important;right:0!important;bottom:0!important;display:flex!important;z-index:9000!important;background:#e9ecef!important;'; setDefaults(); if(typeof applyCrossSell==='function') applyCrossSell(); applyColors(); applyLinks(); applyLogo(); applyProduct(); applyGallery(); applyTabs(); buildModal("impressum","Impressum bearbeiten","#fff3cd","#856404","Pflichtangabe gemaess SS 5 TMG fuer gewerbliche Anbieter.","

[Firmenname]

[Strasse Hausnummer]

[PLZ Ort]

E-Mail: [ihre@email.de]

Tel.: [+49 ...]

"); buildModal("agb","AGB bearbeiten","#fff3cd","#856404","Verwenden Sie eigene, rechtlich geprufte AGB.","

[Ihre AGB hier eintragen]

"); buildModal("widerruf","Widerrufsbelehrung bearbeiten","#f8d7da","#721c24","Rechtspflicht gemaess SS 312g, 355 BGB.","

[Widerrufsbelehrung hier eintragen]

"); buildModal("datenschutz","Datenschutz bearbeiten","#d1ecf1","#0c5460","Datenschutzerklaerung gemaess DSGVO Art.13 erforderlich.","

[Datenschutzerklaerung hier eintragen]

"); buildModal("barriere","Barrierefreiheit bearbeiten","#d1ecf1","#0c5460","BFSG gilt ab 28.06.2025 fuer gewerbliche Anbieter.","

[Erklaerung zur Barrierefreiheit hier eintragen]

"); window._logoAlign='left'; buildLogoAlign(); buildColorPickers(); buildColorPresets(); var _cr=document.querySelector('.color-row'); var _cc=document.getElementById('custom-colors'); if(_cr&&_cc&&_cr.parentNode){ var _resetEl=_cr.nextElementSibling; while(_resetEl&&(_resetEl.id==='color-presets'||_resetEl.id==='custom-colors')) _resetEl=_resetEl.nextElementSibling; var _imgUrl='https://templates24-uiuzqhzpfq.live-website.com/wp-content/uploads/2026/06/Farbpicker.png'; var _fp=document.createElement('div'); _fp.id='free-color-pick'; _fp.innerHTML='
Freie Farbauswahl:
' +'
' +'
Hauptfarbe
' +'
Akzent
' +'
'; _cc.parentNode.insertBefore(_fp,_cc.nextSibling); var _mw=document.getElementById('fcp-main-wrap'); var _aw=document.getElementById('fcp-accent-wrap'); _mw.innerHTML=''; _aw.innerHTML=''; var _cmI=document.getElementById('colorMain'); var _caI=document.getElementById('colorAccent'); _cmI.style.cssText='position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer;'; _caI.style.cssText='position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer;'; _mw.appendChild(_cmI); _aw.appendChild(_caI); _cr.style.display='none'; if(_resetEl){ _resetEl.style.cssText='margin-top:10px;'; _fp.appendChild(_resetEl); } } buildCategoryPreview(); buildCategoryEditor(); applyCategories(); setTimeout(function(){ applyProduct(); applyGallery(); applyTabs(); applyCategories(); }, 100); } window.openModal=function(id){var m=document.getElementById(id);if(m)m.style.display="flex";}; window.closeModal=function(id){var m=document.getElementById(id);if(m){m.style.display="none";applyTabs();}}; window.applyColors = function(){ var cm=(document.getElementById('colorMain')||{value:'#002f6c'}).value; var ca=(document.getElementById('colorAccent')||{value:'#e53238'}).value; var _hm=document.getElementById('hexMain'); if(_hm) _hm.value=cm; var _hp=document.getElementById('hexMainPrev'); if(_hp) _hp.style.background=cm; var _ha=document.getElementById('hexAccent'); if(_ha) _ha.value=ca; var _hp2=document.getElementById('hexAccentPrev'); if(_hp2) _hp2.style.background=ca; var el; el=document.getElementById('pv-topnav'); if(el) el.style.background=cm; el=document.getElementById('pv-logo-row'); if(el) el.style.borderBottomColor=cm; el=document.getElementById('pv-price'); if(el) el.style.color=ca; ['badge1','badge2','badge3'].forEach(function(id){ var b=document.getElementById(id); if(b) b.style.color=cm; }); document.querySelectorAll('.pv-thumb.active').forEach(function(t){ t.style.borderColor=cm; }); // Tab-Farben aktualisieren var cm2 = cm; document.querySelectorAll('.pvt-label').forEach(function(l){ l.style.background = l.classList.contains('active') ? cm2 : '#1a3a6b'; }); el=document.getElementById('pv-tabs'); if(el){ el.style.borderBottomColor='transparent'; el.style.borderBottomWidth='0'; } // Alle pvt-labels faerben (Produkt + Legal) document.querySelectorAll('.pvt-label').forEach(function(l){ l.style.background=l.classList.contains('active')?ca:cm; l.style.color='#fff'; }); // RTE-Felder: Fokus-Rahmen in Hauptfarbe document.querySelectorAll('.rte-content').forEach(function(r){ r.style.borderColor=cm; }); // Akzentfarbe: aktiver Tab Unterstrich document.querySelectorAll('.pvt-label.active').forEach(function(l){ }); var catBar=document.getElementById('pv-categories'); if(catBar&&catBar.firstElementChild) catBar.firstElementChild.style.background=cm; }; window.applyLinks = function(){ var map={linkShop:'pv-link-shop',linkKontakt:'pv-link-kontakt',linkBew:'pv-link-bew'}; Object.keys(map).forEach(function(inp){ var i=document.getElementById(inp), l=document.getElementById(map[inp]); if(i&&l) l.href=i.value||'#'; }); }; window.applyLogo = function(){ var text=document.getElementById('inputLogo'); var imgInp=document.getElementById('inputLogoImg'); var pvText=document.getElementById('pv-logo-text'); var pvImg=document.getElementById('pv-logo-img'); if(!pvText||!pvImg) return; var imgVal=imgInp?imgInp.value.trim():''; if(imgVal){ pvImg.src=imgVal; pvImg.style.cssText='display:inline-block;max-width:100%;max-height:150px;object-fit:contain;'; pvText.style.display='none'; } else { pvText.textContent=(text&&text.value.trim())?text.value.trim():'[Ihr Firmenname / Shop-Name]'; pvText.style.display='inline'; pvImg.style.display='none'; } var logoRow=document.getElementById('pv-logo-row'); if(logoRow) logoRow.style.textAlign=window._logoAlign||'left'; }; window.applyProduct = function(){ var ca=(document.getElementById('colorAccent')||{value:'#e53238'}).value; var titleEl=document.getElementById('pv-title'); var titleIn=document.getElementById('inputTitle'); if(titleEl) titleEl.textContent=(titleIn&&titleIn.value.trim())?titleIn.value.trim():'[Ihr Artikeltitel]'; var priceEl=document.getElementById('pv-price'); var priceIn=document.getElementById('inputPrice'); if(priceEl){ priceEl.innerHTML=((priceIn&&priceIn.value.trim())?priceIn.value.trim():'0,00')+' €'; priceEl.style.color=ca; } var bulletsEl=document.getElementById('pv-bullets'); var bulletsIn=document.getElementById('inputBullets'); if(bulletsEl&&bulletsIn){ var ca2=ca; var html=''; bulletsIn.value.split('\n').forEach(function(l){ var ln=l.trim(); if(ln) html+='
' +''+ln+'
'; }); bulletsEl.innerHTML=html; } }; window.applyGallery = function(){ var cm=(document.getElementById('colorMain')||{value:'#002f6c'}).value; var rows=document.querySelectorAll('#img-list .img-row input'); var urls=[]; rows.forEach(function(inp){ var v=inp.value.trim(); if(v) urls.push(v); }); var mainImg=document.getElementById('pv-main-img'); var thumbsEl=document.getElementById('pv-thumbs'); if(!mainImg||!thumbsEl) return; if(urls.length===0){ mainImg.innerHTML='Kein Bild'; thumbsEl.innerHTML=''; return; } if(activeThumb>=urls.length) activeThumb=0; mainImg.innerHTML=''; var thumbHTML=''; urls.forEach(function(url,i){ var border=i===activeThumb?'2px solid '+cm:'1px solid #ddd'; thumbHTML+='
' +'
'; }); thumbsEl.innerHTML=thumbHTML; }; window.setThumb=function(idx){ activeThumb=idx; applyGallery(); }; window.addImg=function(){ var list=document.getElementById('img-list'); if(!list) return; var rows=list.querySelectorAll('.img-row'); if(rows.length>=12){ alert('Maximal 12 Bilder erlaubt.'); return; } var div=document.createElement('div'); div.className='img-row'; div.innerHTML='' +''; list.appendChild(div); }; window.removeImg=function(btn){ var row=btn.parentElement; row.parentElement.removeChild(row); applyGallery(); }; // ---- TABS ---- window.showLegalTab=function(idx){ var legalIds=[3,4,5,6,7]; // Legal pvt-content active setzen legalIds.forEach(function(i){ var el=document.getElementById("pvt"+i); if(el) el.classList.toggle("active", i===idx); }); // Legal nav labels active setzen var navEl=document.getElementById("pv-tabs-legal-nav"); if(navEl) navEl.querySelectorAll(".pvt-label").forEach(function(l,i){ l.classList.toggle("active", legalIds[i]===idx); }); applyColors(); }; window.showTab=function(idx){ document.querySelectorAll('.pvt-label').forEach(function(l,i){ l.classList.toggle('active',i===idx); }); document.querySelectorAll('.pvt-content').forEach(function(c,i){ c.classList.toggle('active',i===idx); }); applyColors(); // Tab-Farben aktualisieren }; window.applyTabs=function(){ var el; el=document.getElementById('pvt0'); var b=document.getElementById('rte-beschr'); if(el&&b) el.innerHTML=b.innerHTML; // Zahlung: Toggle-Auswahl + Text var zahlung=''; var onBtns=[]; document.querySelectorAll('#zahlung-btns .tgl-btn.on').forEach(function(b){ onBtns.push(b.innerHTML); }); if(onBtns.length){ zahlung='

Akzeptierte Zahlungsarten:

'; zahlung+='
' +onBtns.map(function(h){ return ''+h+''; }).join('') +'
'; } var rz=document.getElementById('rte-zahlung'); if(rz) zahlung+=rz.innerHTML; el=document.getElementById('pvt1'); if(el) el.innerHTML=zahlung; // Versand: Toggle-Auswahl + Text var versand=''; var onShip=[]; document.querySelectorAll('#versand-btns .tgl-btn.on').forEach(function(b){ onShip.push(b.innerHTML); }); if(onShip.length){ versand='

Versandoptionen:

'; versand+='
' +onShip.map(function(h){ return ''+h+''; }).join('') +'
'; } var rv=document.getElementById('rte-versand'); if(rv) versand+=rv.innerHTML; el=document.getElementById('pvt2'); if(el) el.innerHTML=versand; var _imp=document.getElementById('rte-modal-impressum'); el=document.getElementById('pvt3'); if(el) el.innerHTML=_imp?_imp.innerHTML:'

[Impressum hier eintragen]

'; var _a=document.getElementById('rte-modal-agb'); el=document.getElementById('pvt4'); if(el) el.innerHTML=_a?_a.innerHTML:'

[AGB hier eintragen]

'; var _w=document.getElementById('rte-modal-widerruf'); el=document.getElementById('pvt5'); if(el) el.innerHTML=_w?_w.innerHTML:'

[Widerruf hier eintragen]

'; var _d=document.getElementById('rte-modal-datenschutz'); el=document.getElementById('pvt6'); if(el) el.innerHTML=_d?_d.innerHTML:'

[Datenschutz hier eintragen]

'; var _b=document.getElementById('rte-modal-barriere'); el=document.getElementById('pvt7'); if(el) el.innerHTML=_b?_b.innerHTML:'

[Barrierefreiheit hier eintragen]

'; }; // ---- RTE ---- window.applyCrossSell=function(){ var cs=document.getElementById('pv-crosssell'); if(!cs) return; var items=[]; for(var i=1;i<=5;i++){ var img=(document.getElementById('cs-img-'+i)||{value:''}).value.trim(); var title=(document.getElementById('cs-title-'+i)||{value:''}).value.trim(); var url=(document.getElementById('cs-url-'+i)||{value:''}).value.trim(); if(title||img) items.push({img:img,title:title,url:url}); } if(items.length===0){ cs.style.display='none'; cs.innerHTML=''; return; } cs.style.display='block'; var html='
'; html+='
Das koennte Sie auch interessieren
'; html+='
'; items.forEach(function(p){ html+=''; html+='
'; if(p.img) html+=''; else html+='
'; html+='
'+p.title+'
'; html+='
'; }); html+='
'; cs.innerHTML=html; }; window.applyCategories=function(){ var cm=(document.getElementById('colorMain')||{value:'#002f6c'}).value; var catEl=document.getElementById('pv-categories'); if(!catEl) return; var rows=document.querySelectorAll('#cat-list .cat-row'); var items=[]; rows.forEach(function(row){ var nameInp=row.querySelector('.cat-name'); var urlInp=row.querySelector('.cat-url'); var name=nameInp?nameInp.value.trim():''; var url=urlInp?urlInp.value.trim():''; if(name) items.push({name:name,url:url}); }); if(items.length===0){ catEl.style.display='none'; catEl.innerHTML=''; return; } catEl.style.display='block'; var html='
' +'
'; items.forEach(function(item){ html+=''+item.name+''; }); html+='
'; catEl.innerHTML=html; }; window.addCat=function(){ var list=document.getElementById('cat-list'); if(!list) return; var rows=list.querySelectorAll('.cat-row'); if(rows.length>=8){ alert('Maximal 8 Kategorien erlaubt.'); return; } var div=document.createElement('div'); div.className='cat-row'; div.style.cssText='display:flex;gap:4px;margin-bottom:4px;'; div.innerHTML='' +'' +''; list.appendChild(div); }; window.removeCat=function(btn){ var row=btn.parentElement; row.parentElement.removeChild(row); applyCategories(); }; window.setLogoAlign=function(align){ window._logoAlign=align; var ca=(document.getElementById('colorAccent')||{value:'#e53238'}).value; document.querySelectorAll('#logo-align-btns button').forEach(function(btn){ var isActive=btn.getAttribute('data-align')===align; btn.style.background=isActive?ca:'#f8f9fa'; btn.style.color=isActive?'#fff':'#333'; btn.style.borderColor=isActive?ca:'#ced4da'; }); applyLogo(); }; window.pickColor=function(tgt,color){ if(!/^#[0-9a-fA-F]{6}$/.test(color)) return; var inp=document.getElementById('color'+tgt); if(inp) inp.value=color; var hex=document.getElementById('hex'+tgt); if(hex) hex.value=color; var prev=document.getElementById('hex'+tgt+'Prev'); if(prev) prev.style.background=color; applyColors(); applyProduct(); applyGallery(); }; window.applyPreset=function(main,accent){ var cm=document.getElementById('colorMain'); var ca=document.getElementById('colorAccent'); if(cm) cm.value=main; if(ca) ca.value=accent; applyColors(); applyProduct(); applyGallery(); }; window.rteCmd=function(id,cmd){ var el=document.getElementById(id); if(!el) return; el.focus(); document.execCommand(cmd,false,null); applyTabs(); }; window.rteSize=function(id,size){ var el=document.getElementById(id); if(!el) return; el.focus(); document.execCommand('fontSize',false,'7'); var fonts=el.querySelectorAll('font[size="7"]'); fonts.forEach(function(f){ var span=document.createElement('span'); span.style.fontSize=size; span.innerHTML=f.innerHTML; f.parentNode.replaceChild(span,f); }); applyTabs(); }; window.rteClear=function(id){ var el=document.getElementById(id); if(!el) return; el.focus(); document.execCommand('removeFormat',false,null); applyTabs(); }; // ---- TOGGLE BUTTONS ---- window.togglePay=function(btn){ btn.classList.toggle('on'); applyTabs(); }; window.toggleShip=function(btn){ btn.classList.toggle('on'); applyTabs(); }; // ---- FARBEN RESET ---- window.resetColors=function(){ document.getElementById('colorMain').value='#002f6c'; document.getElementById('colorAccent').value='#e53238'; applyColors(); applyProduct(); applyGallery(); }; // ---- DESIGN SPEICHERN ---- window.saveDesign=function(){ var imgUrls=[]; document.querySelectorAll('#img-list .img-row input').forEach(function(inp){ imgUrls.push(inp.value.trim()); }); var payOn=[]; var payOnHTML=[]; document.querySelectorAll('#zahlung-btns .tgl-btn.on').forEach(function(b){ payOn.push(b.textContent.trim()); payOnHTML.push(b.innerHTML); }); var shipOn=[]; var shipOnHTML=[]; document.querySelectorAll('#versand-btns .tgl-btn.on').forEach(function(b){ shipOn.push(b.textContent.trim()); shipOnHTML.push(b.innerHTML); }); var catItems=[]; document.querySelectorAll('#cat-list .cat-row').forEach(function(row){ var n=row.querySelector('.cat-name'); var u=row.querySelector('.cat-url'); catItems.push({name:n?n.value.trim():'',url:u?u.value.trim():''}); }); var csItems=[]; for(var i=1;i<=5;i++) csItems.push({img:(document.getElementById('cs-img-'+i)||{value:''}).value,title:(document.getElementById('cs-title-'+i)||{value:''}).value,url:(document.getElementById('cs-url-'+i)||{value:''}).value}); var design={ version:2, colorMain:(document.getElementById('colorMain')||{value:'#002f6c'}).value, colorAccent:(document.getElementById('colorAccent')||{value:'#e53238'}).value, linkShop:(document.getElementById('linkShop')||{value:''}).value, linkKontakt:(document.getElementById('linkKontakt')||{value:''}).value, linkBew:(document.getElementById('linkBew')||{value:''}).value, inputLogo:(document.getElementById('inputLogo')||{value:''}).value, inputLogoImg:(document.getElementById('inputLogoImg')||{value:''}).value, inputTitle:(document.getElementById('inputTitle')||{value:''}).value, inputPrice:(document.getElementById('inputPrice')||{value:''}).value, inputBullets:(document.getElementById('inputBullets')||{value:''}).value, imgUrls:imgUrls, rteBeschr:(document.getElementById('rte-beschr')||{innerHTML:''}).innerHTML, rteZahlung:(document.getElementById('rte-zahlung')||{innerHTML:''}).innerHTML, rteVersand:(document.getElementById('rte-versand')||{innerHTML:''}).innerHTML, rteImpressum:(document.getElementById('rte-modal-impressum')||{innerHTML:''}).innerHTML, rteAgb:(document.getElementById('rte-modal-agb')||{innerHTML:''}).innerHTML, rteWiderruf:(document.getElementById('rte-modal-widerruf')||{innerHTML:''}).innerHTML, rteDatenschutz:(document.getElementById('rte-modal-datenschutz')||{innerHTML:''}).innerHTML, rteBarriere:(document.getElementById('rte-modal-barriere')||{innerHTML:''}).innerHTML, csItems:csItems, payOn:payOn, shipOn:shipOn, catItems:catItems, logoAlign:window._logoAlign||'left' }; var blob=new Blob([JSON.stringify(design,null,2)],{type:'application/json'}); var url=URL.createObjectURL(blob); var a=document.createElement('a'); a.href=url; a.download='mein-ebay-design.json'; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); }; // ---- DESIGN LADEN ---- window.loadDesign=function(event){ var file=event.target.files[0]; if(!file) return; var reader=new FileReader(); reader.onload=function(e){ try { var d=JSON.parse(e.target.result); function setVal(id,val){ var el=document.getElementById(id); if(el&&val!==undefined) el.value=val; } function setHTML(id,val){ var el=document.getElementById(id); if(el&&val!==undefined) el.innerHTML=val; } setVal('colorMain',d.colorMain); setVal('colorAccent',d.colorAccent); setVal('linkShop',d.linkShop); setVal('linkKontakt',d.linkKontakt); setVal('linkBew',d.linkBew); setVal('inputLogo',d.inputLogo); setVal('inputLogoImg',d.inputLogoImg); setVal('inputTitle',d.inputTitle); setVal('inputPrice',d.inputPrice); setVal('inputBullets',d.inputBullets); setHTML('rte-beschr',d.rteBeschr); setHTML('rte-zahlung',d.rteZahlung); setHTML('rte-versand',d.rteVersand); // Rechtstext-Modals if(d.rteImpressum!==undefined) setHTML('rte-modal-impressum',d.rteImpressum); if(d.rteAgb!==undefined) setHTML('rte-modal-agb',d.rteAgb); if(d.rteWiderruf!==undefined) setHTML('rte-modal-widerruf',d.rteWiderruf); if(d.rteDatenschutz!==undefined) setHTML('rte-modal-datenschutz',d.rteDatenschutz); if(d.rteBarriere!==undefined) setHTML('rte-modal-barriere',d.rteBarriere); if(d.csItems&&Array.isArray(d.csItems)) d.csItems.forEach(function(p,i){ setVal('cs-img-'+(i+1),p.img); setVal('cs-title-'+(i+1),p.title); setVal('cs-url-'+(i+1),p.url); }); if(typeof applyCrossSell==='function') applyCrossSell(); // Bilder if(d.imgUrls&&Array.isArray(d.imgUrls)){ var list=document.getElementById('img-list'); if(list){ list.innerHTML=''; d.imgUrls.forEach(function(url,i){ var div=document.createElement('div'); div.className='img-row'; div.innerHTML='' +''; list.appendChild(div); }); } } // Toggle-Buttons if(d.payOn) document.querySelectorAll('#zahlung-btns .tgl-btn').forEach(function(b){ b.classList.toggle('on', d.payOn.indexOf(b.textContent.trim())>-1); }); if(d.shipOn) document.querySelectorAll('#versand-btns .tgl-btn').forEach(function(b){ b.classList.toggle('on', d.shipOn.indexOf(b.textContent.trim())>-1); }); if(d.catItems&&Array.isArray(d.catItems)){ var catList=document.getElementById('cat-list'); if(catList){ catList.innerHTML=''; d.catItems.forEach(function(item){ if(!item.name&&!item.url) return; var div=document.createElement('div'); div.className='cat-row'; div.style.cssText='display:flex;gap:4px;margin-bottom:4px;'; div.innerHTML='' +'' +''; catList.appendChild(div); }); } } if(d.logoAlign&&typeof setLogoAlign==='function') setLogoAlign(d.logoAlign); applyColors(); applyLinks(); applyLogo(); applyProduct(); applyGallery(); applyTabs(); applyCategories(); var btn=document.querySelector('.btn-load'); if(btn){ var o=btn.textContent; btn.textContent='\u2713 Geladen!'; btn.style.background='#28a745'; setTimeout(function(){ btn.textContent=o; btn.style.background=''; },2000); } } catch(err){ alert('Fehler: Ungueltige Design-Datei.'); } }; reader.readAsText(file); event.target.value=''; }; // ---- EXPORT ---- window.exportHTML=function(){ var cm=(document.getElementById('colorMain')||{value:'#002f6c'}).value; var ca=(document.getElementById('colorAccent')||{value:'#e53238'}).value; var logo=(document.getElementById('inputLogo')||{value:''}).value.trim(); var logoImg=(document.getElementById('inputLogoImg')||{value:''}).value.trim(); var lShop=(document.getElementById('linkShop')||{value:'https://ebay.de'}).value||'https://ebay.de'; var lKon=(document.getElementById('linkKontakt')||{value:'https://ebay.de'}).value||'https://ebay.de'; var lBew=(document.getElementById('linkBew')||{value:'https://ebay.de'}).value||'https://ebay.de'; var title=(document.getElementById('inputTitle')||{value:''}).value.trim(); var price=((document.getElementById('inputPrice')||{value:'0,00'}).value.trim())||'0,00'; var bulletsRaw=(document.getElementById('inputBullets')||{value:''}).value; var urls=[]; document.querySelectorAll('#img-list .img-row input').forEach(function(inp){ var v=inp.value.trim(); if(v) urls.push(v); }); // Tab-Inhalte var tabBeschr=(document.getElementById('rte-beschr')||{innerHTML:''}).innerHTML; var payOn=[]; var payOnHTML=[]; document.querySelectorAll('#zahlung-btns .tgl-btn.on').forEach(function(b){ payOn.push(b.textContent.trim()); payOnHTML.push(b.innerHTML); }); var shipOn=[]; var shipOnHTML=[]; document.querySelectorAll('#versand-btns .tgl-btn.on').forEach(function(b){ shipOn.push(b.textContent.trim()); shipOnHTML.push(b.innerHTML); }); var tabZahlung=''; if(payOnHTML.length){ tabZahlung='

Akzeptierte Zahlungsarten:

'; tabZahlung+='
' +payOnHTML.map(function(h){ return ''+h+''; }).join('') +'
'; } tabZahlung+=((document.getElementById('rte-zahlung')||{innerHTML:''}).innerHTML); var tabVersand=''; if(shipOnHTML.length){ tabVersand='

Versandoptionen:

'; tabVersand+='
' +shipOnHTML.map(function(h){ return ''+h+''; }).join('') +'
'; } tabVersand+=((document.getElementById('rte-versand')||{innerHTML:''}).innerHTML); // Galerie var galHTML=''; if(urls.length>0){ var radios='',mains='',css=''; galHTML='
'+radios+css +'
'+mains+'
' +'
'+thumbsH+'
'; } else { galHTML='
'; } var logoHTML=logoImg?'Logo' :''+(logo||'[Shop-Name]')+''; var bulletsHTML=''; bulletsRaw.split('\n').forEach(function(l){ var ln=l.trim(); if(ln) bulletsHTML+='
' +''+ln+'
'; }); // CSS-only Tab-System fuer Export var pIds=['ptab1','ptab2','ptab3']; var pLabels=['PRODUKTBESCHREIBUNG','ZAHLUNG','VERSAND']; var pContents=[tabBeschr,tabZahlung,tabVersand]; var pRadios=''; var pCSS=''; var pNav='
'; for(var i=0;i<3;i++) pNav+=''; pNav+='
'; var pBody='
'; for(var i=0;i<3;i++) pBody+=''; pBody+='
'; var prodBlock='
'+pRadios+pCSS+pNav+pBody+'
'; var lIds=['ltab1','ltab2','ltab3','ltab4','ltab5']; var lLabels=['IMPRESSUM','AGB','WIDERRUF','DATENSCHUTZ','BARRIEREFREIHEIT']; var _impE=(document.getElementById('rte-modal-impressum')||{innerHTML:''}).innerHTML; var _agbE=(document.getElementById('rte-modal-agb')||{innerHTML:''}).innerHTML; var _widE=(document.getElementById('rte-modal-widerruf')||{innerHTML:''}).innerHTML; var _datE=(document.getElementById('rte-modal-datenschutz')||{innerHTML:''}).innerHTML; var _barE=(document.getElementById('rte-modal-barriere')||{innerHTML:''}).innerHTML; var lContents=[_impE,_agbE,_widE,_datE,_barE]; var lRadios=''; var lCSS=''; var lNav='
'; for(var i=0;i<5;i++) lNav+=''; lNav+='
'; var lBody='
'; for(var i=0;i<5;i++) lBody+=''; lBody+='
'; // Cross-Selling Export var csExp=''; var csExpItems=[]; for(var i=1;i<=5;i++){ var csImg=(document.getElementById('cs-img-'+i)||{value:''}).value.trim(); var csTitle=(document.getElementById('cs-title-'+i)||{value:''}).value.trim(); var csUrl=(document.getElementById('cs-url-'+i)||{value:''}).value.trim(); if(csTitle||csImg) csExpItems.push({img:csImg,title:csTitle,url:csUrl}); } if(csExpItems.length>0){ csExp='
'; csExp+='
Das koennte Sie auch interessieren
'; csExp+='
'; csExpItems.forEach(function(p){ csExp+=''; csExp+='
'; if(p.img) csExp+=''; else csExp+='
'; csExp+='
'+p.title+'
'; csExp+='
'; }); csExp+='
'; } var legalBlock='
'+''+lRadios+lCSS+lNav+lBody+'
'; var catExpItems=[]; document.querySelectorAll('#cat-list .cat-row').forEach(function(row){ var n=row.querySelector('.cat-name'); var u=row.querySelector('.cat-url'); if(n&&n.value.trim()) catExpItems.push({name:n.value.trim(),url:u?u.value.trim():''}); }); var catBarExp=''; if(catExpItems.length>0){ catBarExp='
'; catExpItems.forEach(function(item){ catBarExp+=''+item.name+''; }); catBarExp+='
'; } var html='
' +'
' +'SHOP' +'KONTAKT' +'BEWERTUNGEN
' +'
' +'Top-Bewertet' +'+ Blitzversand' +'Gepruefter Haendler
' +catBarExp +'
'+logoHTML+'
' +'' +'' +'
'+galHTML+'' +'
'+title+'
' +'
'+price+' €
' +'
'+bulletsHTML+'
' +prodBlock+csExp+legalBlock +'
Template-Design by template-generator24.de
'+'
Zahlungs- und Versand-Icons: Matthias Slovig, 50north.de, Lizenz: CC BY 4.0
' +'
'; navigator.clipboard.writeText(html).then(function(){ var btn=document.getElementById('btn-copy'); if(btn){ var o=btn.textContent; btn.textContent='\u2713 Kopiert!'; btn.style.background='#28a745'; setTimeout(function(){ btn.textContent=o; btn.style.background=''; },2000); } }).catch(function(){ var ta=document.createElement('textarea'); ta.value=html; ta.style.cssText='position:fixed;opacity:0;'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); var btn=document.getElementById('btn-copy'); if(btn){ btn.textContent='\u2713 Kopiert!'; setTimeout(function(){ btn.textContent='eBay Template Code kopieren'; },2000); } }); }; if(document.readyState==='loading'){ document.addEventListener('DOMContentLoaded',init); } else { init(); } })();