(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_1176811 = document.getElementById('melde_1176811'); var meldeInst = new melde(meldeEl_1176811, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1176811 = new getXMLObject(); function ajaxNewspost_1176811() { if(xmlhttp1176811) { var melde_message = document.getElementById("melde_message_1176811").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1176811").value); xmlhttp1176811.open("POST","../meldung_send.php",true); xmlhttp1176811.onreadystatechange = handleServerResponse1176811; xmlhttp1176811.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1176811.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1176811() { if (xmlhttp1176811.readyState == 4) { if(xmlhttp1176811.status == 200) { document.getElementById("melde_message_1176811").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1176822 = document.getElementById('melde_1176822'); var meldeInst = new melde(meldeEl_1176822, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1176822 = new getXMLObject(); function ajaxNewspost_1176822() { if(xmlhttp1176822) { var melde_message = document.getElementById("melde_message_1176822").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1176822").value); xmlhttp1176822.open("POST","../meldung_send.php",true); xmlhttp1176822.onreadystatechange = handleServerResponse1176822; xmlhttp1176822.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1176822.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1176822() { if (xmlhttp1176822.readyState == 4) { if(xmlhttp1176822.status == 200) { document.getElementById("melde_message_1176822").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1176826 = document.getElementById('melde_1176826'); var meldeInst = new melde(meldeEl_1176826, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1176826 = new getXMLObject(); function ajaxNewspost_1176826() { if(xmlhttp1176826) { var melde_message = document.getElementById("melde_message_1176826").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1176826").value); xmlhttp1176826.open("POST","../meldung_send.php",true); xmlhttp1176826.onreadystatechange = handleServerResponse1176826; xmlhttp1176826.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1176826.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1176826() { if (xmlhttp1176826.readyState == 4) { if(xmlhttp1176826.status == 200) { document.getElementById("melde_message_1176826").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1176862 = document.getElementById('melde_1176862'); var meldeInst = new melde(meldeEl_1176862, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1176862 = new getXMLObject(); function ajaxNewspost_1176862() { if(xmlhttp1176862) { var melde_message = document.getElementById("melde_message_1176862").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1176862").value); xmlhttp1176862.open("POST","../meldung_send.php",true); xmlhttp1176862.onreadystatechange = handleServerResponse1176862; xmlhttp1176862.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1176862.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1176862() { if (xmlhttp1176862.readyState == 4) { if(xmlhttp1176862.status == 200) { document.getElementById("melde_message_1176862").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1176941 = document.getElementById('melde_1176941'); var meldeInst = new melde(meldeEl_1176941, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1176941 = new getXMLObject(); function ajaxNewspost_1176941() { if(xmlhttp1176941) { var melde_message = document.getElementById("melde_message_1176941").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1176941").value); xmlhttp1176941.open("POST","../meldung_send.php",true); xmlhttp1176941.onreadystatechange = handleServerResponse1176941; xmlhttp1176941.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1176941.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1176941() { if (xmlhttp1176941.readyState == 4) { if(xmlhttp1176941.status == 200) { document.getElementById("melde_message_1176941").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1179437 = document.getElementById('melde_1179437'); var meldeInst = new melde(meldeEl_1179437, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1179437 = new getXMLObject(); function ajaxNewspost_1179437() { if(xmlhttp1179437) { var melde_message = document.getElementById("melde_message_1179437").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1179437").value); xmlhttp1179437.open("POST","../meldung_send.php",true); xmlhttp1179437.onreadystatechange = handleServerResponse1179437; xmlhttp1179437.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1179437.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1179437() { if (xmlhttp1179437.readyState == 4) { if(xmlhttp1179437.status == 200) { document.getElementById("melde_message_1179437").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } }