(function() { 'use strict'; function classReg(cl) { return new RegExp('(\\s|^)'+ cl +'(\\s|$)'); } function hasClass(el, cl) { return el.className.match(classReg(cl)); } function addClass(el, cl) { if (!hasClass(el, cl)) { el.className += ' ' + cl; } } function removeClass(el, cl) { if (hasClass(el, cl)) { el.className = el.className.replace(classReg(cl), ''); } } function extend(obj1, obj2) { var obj = {}; for (var key in obj1) { obj[key] = obj2[key] === undefined ? obj1[key] : obj2[key]; } return obj; } var melde = function(el, opts) { this.melde = el, this.triggerBtn = document.querySelectorAll('[data-trigger-melde="' + this.melde.id + '"]'), this.closeBtn = this.melde.querySelectorAll('[data-close-melde]'), this.body = document.body, this.defaults = { activeClass: 'melde--active', bodyClass: 'melde-is-active', overlay: true, overlayClass: 'melde__overlay', openCallback: null, closeCallback: null }, this.opts = extend(this.defaults, opts); }; melde.prototype = { init: function() { this.meldeTriggering(); }, meldeTriggering: function() { var self = this; for (var i = 0; i < self.triggerBtn.length; i++) { self.triggerBtn[i].addEventListener('click', self.openmelde.bind(this)); } }, openmelde: function() { var self = this; if (self.opts.overlay) { self.appendOverlay(); } addClass(self.melde, self.opts.activeClass); addClass(self.body, self.opts.bodyClass); for (var i = 0; i < self.closeBtn.length; i++) { self.closeBtn[i].addEventListener('click', this.closemelde.bind(this)); } if (self.opts.openCallback) { self.opts.openCallback.call(self); } setTimeout(function() { self.closeBtn[0].focus(); }, 500); }, closemelde: function() { var self = this; removeClass(self.melde, self.opts.activeClass); removeClass(self.body, self.opts.bodyClass); for (var i = 0; i < self.closeBtn.length; i++) { self.closeBtn[i].removeEventListener('click', this.closemelde.bind(this)); } if (self.opts.overlay) { self.removeOverlay(); } if (self.opts.closeCallback) { self.opts.closeCallback.call(self); } }, appendOverlay: function() { var self = this; self.overlay = document.createElement('div'); self.overlay.className = self.opts.overlayClass; self.melde.appendChild(self.overlay); }, removeOverlay: function() { var self = this; setTimeout(function() { self.overlay.remove(); }, 500); } }; window.melde = melde; })(); var meldeEl_1268064 = document.getElementById('melde_1268064'); var meldeInst = new melde(meldeEl_1268064, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1268064 = new getXMLObject(); function ajaxNewspost_1268064() { if(xmlhttp1268064) { var melde_message = document.getElementById("melde_message_1268064").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1268064").value); xmlhttp1268064.open("POST","../meldung_send.php",true); xmlhttp1268064.onreadystatechange = handleServerResponse1268064; xmlhttp1268064.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1268064.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1268064() { if (xmlhttp1268064.readyState == 4) { if(xmlhttp1268064.status == 200) { document.getElementById("melde_message_1268064").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1268059 = document.getElementById('melde_1268059'); var meldeInst = new melde(meldeEl_1268059, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1268059 = new getXMLObject(); function ajaxNewspost_1268059() { if(xmlhttp1268059) { var melde_message = document.getElementById("melde_message_1268059").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1268059").value); xmlhttp1268059.open("POST","../meldung_send.php",true); xmlhttp1268059.onreadystatechange = handleServerResponse1268059; xmlhttp1268059.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1268059.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1268059() { if (xmlhttp1268059.readyState == 4) { if(xmlhttp1268059.status == 200) { document.getElementById("melde_message_1268059").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1268050 = document.getElementById('melde_1268050'); var meldeInst = new melde(meldeEl_1268050, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1268050 = new getXMLObject(); function ajaxNewspost_1268050() { if(xmlhttp1268050) { var melde_message = document.getElementById("melde_message_1268050").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1268050").value); xmlhttp1268050.open("POST","../meldung_send.php",true); xmlhttp1268050.onreadystatechange = handleServerResponse1268050; xmlhttp1268050.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1268050.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1268050() { if (xmlhttp1268050.readyState == 4) { if(xmlhttp1268050.status == 200) { document.getElementById("melde_message_1268050").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1268049 = document.getElementById('melde_1268049'); var meldeInst = new melde(meldeEl_1268049, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1268049 = new getXMLObject(); function ajaxNewspost_1268049() { if(xmlhttp1268049) { var melde_message = document.getElementById("melde_message_1268049").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1268049").value); xmlhttp1268049.open("POST","../meldung_send.php",true); xmlhttp1268049.onreadystatechange = handleServerResponse1268049; xmlhttp1268049.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1268049.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1268049() { if (xmlhttp1268049.readyState == 4) { if(xmlhttp1268049.status == 200) { document.getElementById("melde_message_1268049").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1268048 = document.getElementById('melde_1268048'); var meldeInst = new melde(meldeEl_1268048, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1268048 = new getXMLObject(); function ajaxNewspost_1268048() { if(xmlhttp1268048) { var melde_message = document.getElementById("melde_message_1268048").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1268048").value); xmlhttp1268048.open("POST","../meldung_send.php",true); xmlhttp1268048.onreadystatechange = handleServerResponse1268048; xmlhttp1268048.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1268048.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1268048() { if (xmlhttp1268048.readyState == 4) { if(xmlhttp1268048.status == 200) { document.getElementById("melde_message_1268048").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1268047 = document.getElementById('melde_1268047'); var meldeInst = new melde(meldeEl_1268047, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1268047 = new getXMLObject(); function ajaxNewspost_1268047() { if(xmlhttp1268047) { var melde_message = document.getElementById("melde_message_1268047").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1268047").value); xmlhttp1268047.open("POST","../meldung_send.php",true); xmlhttp1268047.onreadystatechange = handleServerResponse1268047; xmlhttp1268047.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1268047.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1268047() { if (xmlhttp1268047.readyState == 4) { if(xmlhttp1268047.status == 200) { document.getElementById("melde_message_1268047").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } }