(function(connector) { 'use strict'; var style = 'default'; if(document.body.dataset.feedbackstyle) { style = document.body.dataset.feedbackstyle; } var iframe; var flag; var col = 'light'; //TODO color css //TODO abbrechen close anders var closeFlag = function(ev) { flag.classList.add('closing'); iframe.classList.add('closing'); setTimeout(function() { flag.style.opacity = 0; iframe.style.opacity = 0; setTimeout(function() { flag.remove(); iframe.remove(); document.body.style.overflowY = 'auto'; },500); },1000); } var openFlag = function(ev, infos=false) { flag = document.createElement('div'); document.body.style.overflowY = 'hidden'; flag.id = 'flag-overlay'; iframe = document.createElement('iframe'); iframe.src= ''; iframe.name = 'flag-iframe'; iframe.id = 'flag-iframe'; document.body.appendChild(flag); setTimeout(function() { flag.addEventListener('click',function(){ closeFlag(); //console.log('close2'); }); },3000); document.body.appendChild(iframe); var form = document.createElement('form'); form.action = connector+"?style="+style; form.target = 'flag-iframe'; form.method = 'POST'; const screenshotTarget = document.body; /*html2canvas(screenshotTarget).then((canvas) => { const base64image = canvas.toDataURL("image/png"); window.location.href = base64image; });*/ var fields = {}; fields['s'] = window.location.hostname; var datas = document.querySelectorAll('[data-flaginfo]'); if(datas) { for(var i=0; i { //console.log(event); if(event.data == 'close') { //console.log('close1'); closeFlag(); } }); var links = document.getElementsByClassName('flag-link'); if(links.length > 0) { for(var l=0;l