(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_1200064 = document.getElementById('melde_1200064'); var meldeInst = new melde(meldeEl_1200064, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1200064 = new getXMLObject(); function ajaxNewspost_1200064() { if(xmlhttp1200064) { var melde_message = document.getElementById("melde_message_1200064").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1200064").value); xmlhttp1200064.open("POST","../meldung_send.php",true); xmlhttp1200064.onreadystatechange = handleServerResponse1200064; xmlhttp1200064.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1200064.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1200064() { if (xmlhttp1200064.readyState == 4) { if(xmlhttp1200064.status == 200) { document.getElementById("melde_message_1200064").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1200072 = document.getElementById('melde_1200072'); var meldeInst = new melde(meldeEl_1200072, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1200072 = new getXMLObject(); function ajaxNewspost_1200072() { if(xmlhttp1200072) { var melde_message = document.getElementById("melde_message_1200072").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1200072").value); xmlhttp1200072.open("POST","../meldung_send.php",true); xmlhttp1200072.onreadystatechange = handleServerResponse1200072; xmlhttp1200072.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1200072.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1200072() { if (xmlhttp1200072.readyState == 4) { if(xmlhttp1200072.status == 200) { document.getElementById("melde_message_1200072").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1200074 = document.getElementById('melde_1200074'); var meldeInst = new melde(meldeEl_1200074, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1200074 = new getXMLObject(); function ajaxNewspost_1200074() { if(xmlhttp1200074) { var melde_message = document.getElementById("melde_message_1200074").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1200074").value); xmlhttp1200074.open("POST","../meldung_send.php",true); xmlhttp1200074.onreadystatechange = handleServerResponse1200074; xmlhttp1200074.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1200074.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1200074() { if (xmlhttp1200074.readyState == 4) { if(xmlhttp1200074.status == 200) { document.getElementById("melde_message_1200074").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1200088 = document.getElementById('melde_1200088'); var meldeInst = new melde(meldeEl_1200088, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1200088 = new getXMLObject(); function ajaxNewspost_1200088() { if(xmlhttp1200088) { var melde_message = document.getElementById("melde_message_1200088").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1200088").value); xmlhttp1200088.open("POST","../meldung_send.php",true); xmlhttp1200088.onreadystatechange = handleServerResponse1200088; xmlhttp1200088.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1200088.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1200088() { if (xmlhttp1200088.readyState == 4) { if(xmlhttp1200088.status == 200) { document.getElementById("melde_message_1200088").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1200078 = document.getElementById('melde_1200078'); var meldeInst = new melde(meldeEl_1200078, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1200078 = new getXMLObject(); function ajaxNewspost_1200078() { if(xmlhttp1200078) { var melde_message = document.getElementById("melde_message_1200078").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1200078").value); xmlhttp1200078.open("POST","../meldung_send.php",true); xmlhttp1200078.onreadystatechange = handleServerResponse1200078; xmlhttp1200078.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1200078.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1200078() { if (xmlhttp1200078.readyState == 4) { if(xmlhttp1200078.status == 200) { document.getElementById("melde_message_1200078").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } } var meldeEl_1200090 = document.getElementById('melde_1200090'); var meldeInst = new melde(meldeEl_1200090, { openCallback: function() { console.log('Callback for when melde is open.'); }, closeCallback: function() { console.log('Callback for when melde is closed.'); } }); meldeInst.init(); var xmlhttp1200090 = new getXMLObject(); function ajaxNewspost_1200090() { if(xmlhttp1200090) { var melde_message = document.getElementById("melde_message_1200090").value; var melde_id = encodeURIComponent(document.getElementById("melde_id_1200090").value); xmlhttp1200090.open("POST","../meldung_send.php",true); xmlhttp1200090.onreadystatechange = handleServerResponse1200090; xmlhttp1200090.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp1200090.send("message=" + melde_message + "&melde_id=" + melde_id); } } function handleServerResponse1200090() { if (xmlhttp1200090.readyState == 4) { if(xmlhttp1200090.status == 200) { document.getElementById("melde_message_1200090").value=''; } else { alert("Upsal! Da hat es jetzt irgendwo ein Problem geben! Probier es einfach nochmal!"); } } }