(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_1184972 = document.getElementById('melde_1184972'); var meldeInst = new melde(meldeEl_1184972, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1184972 = new getXMLObject(); function ajaxNewspost_1184972() { if(xmlhttp1184972) { var melde_message = document.getElementById("melde_message_1184972").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1184972").value); xmlhttp1184972.open("POST","../meldung_send.php",true); xmlhttp1184972.onreadystatechange = handleServerResponse1184972; xmlhttp1184972.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1184972.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1184972() { if (xmlhttp1184972.readyState == 4) { if(xmlhttp1184972.status == 200) { document.getElementById("melde_message_1184972").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1184953 = document.getElementById('melde_1184953'); var meldeInst = new melde(meldeEl_1184953, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1184953 = new getXMLObject(); function ajaxNewspost_1184953() { if(xmlhttp1184953) { var melde_message = document.getElementById("melde_message_1184953").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1184953").value); xmlhttp1184953.open("POST","../meldung_send.php",true); xmlhttp1184953.onreadystatechange = handleServerResponse1184953; xmlhttp1184953.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1184953.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1184953() { if (xmlhttp1184953.readyState == 4) { if(xmlhttp1184953.status == 200) { document.getElementById("melde_message_1184953").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1184943 = document.getElementById('melde_1184943'); var meldeInst = new melde(meldeEl_1184943, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1184943 = new getXMLObject(); function ajaxNewspost_1184943() { if(xmlhttp1184943) { var melde_message = document.getElementById("melde_message_1184943").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1184943").value); xmlhttp1184943.open("POST","../meldung_send.php",true); xmlhttp1184943.onreadystatechange = handleServerResponse1184943; xmlhttp1184943.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1184943.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1184943() { if (xmlhttp1184943.readyState == 4) { if(xmlhttp1184943.status == 200) { document.getElementById("melde_message_1184943").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1184942 = document.getElementById('melde_1184942'); var meldeInst = new melde(meldeEl_1184942, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1184942 = new getXMLObject(); function ajaxNewspost_1184942() { if(xmlhttp1184942) { var melde_message = document.getElementById("melde_message_1184942").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1184942").value); xmlhttp1184942.open("POST","../meldung_send.php",true); xmlhttp1184942.onreadystatechange = handleServerResponse1184942; xmlhttp1184942.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1184942.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1184942() { if (xmlhttp1184942.readyState == 4) { if(xmlhttp1184942.status == 200) { document.getElementById("melde_message_1184942").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1184941 = document.getElementById('melde_1184941'); var meldeInst = new melde(meldeEl_1184941, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1184941 = new getXMLObject(); function ajaxNewspost_1184941() { if(xmlhttp1184941) { var melde_message = document.getElementById("melde_message_1184941").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1184941").value); xmlhttp1184941.open("POST","../meldung_send.php",true); xmlhttp1184941.onreadystatechange = handleServerResponse1184941; xmlhttp1184941.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1184941.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1184941() { if (xmlhttp1184941.readyState == 4) { if(xmlhttp1184941.status == 200) { document.getElementById("melde_message_1184941").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1184940 = document.getElementById('melde_1184940'); var meldeInst = new melde(meldeEl_1184940, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1184940 = new getXMLObject(); function ajaxNewspost_1184940() { if(xmlhttp1184940) { var melde_message = document.getElementById("melde_message_1184940").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1184940").value); xmlhttp1184940.open("POST","../meldung_send.php",true); xmlhttp1184940.onreadystatechange = handleServerResponse1184940; xmlhttp1184940.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1184940.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1184940() { if (xmlhttp1184940.readyState == 4) { if(xmlhttp1184940.status == 200) { document.getElementById("melde_message_1184940").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } }