Bernd Wurst
removed jquery and jqueryUI from webinterface
Bernd Wurst commited 112e0dc at 2023-04-29 11:47:42
function moreForward(e)
{
e.preventDefault();
last = [...document.querySelectorAll('div.vmail-forward')].at(-1);
last_id = parseInt(last.id.match(/\d+/g));
new_id = ++last_id;
if (new_id > 50) {
alert("Jetzt wird's merkwürdig. Bitte nutzen Sie eine Mailingliste wenn Sie so viele Empfänger brauchen!");
return;
}
var clone = last.cloneNode(true);
clone.id = clone.id.replace(/\d+$/, function(str) { return parseInt(str) + 1; });
// Find all elements in $clone that have an ID, and iterate using each()
clone.querySelectorAll('[id]').forEach(el => {
//Perform the same replace as above
el.id = el.id.replace(/\d+$/, function(str) { return parseInt(str) + 1; });
});
// Find all elements in $clone that have a name, and iterate using each()
clone.querySelectorAll('[name]').forEach(el => {
//Perform the same replace as above
el.name = el.name.replace(/\d+$/, function(str) { return parseInt(str) + 1; });
});
clone.querySelector('input').value = '';
clone.querySelector('div.delete_forward').addEventListener("click", removeForward);
clone.querySelector('input').addEventListener("change", checkForward);
clone.querySelector('input').addEventListener("keyup", checkForward);
clone.querySelector('input').addEventListener("paste", checkForward);
last.after(clone);
}
function removeForward(ev)
{
div = this.closest('div.vmail-forward');
input = div.querySelector('input');
input.value = '';
if ([...document.querySelectorAll('div.vmail-forward')].length > 1) {
div.remove();
}
}
function removeUnneededForwards() {
// Alle <div> nach dem Element mit der ID vmail_forward_1...
document.querySelectorAll('div#vmail_forward_1 ~ div').forEach(el => {
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX