function addMod(userEmail,listEmail){ $.post('/api/list/add_mod',{list:listEmail,email:userEmail},reload,'json'); } function addPermission(userEmail,permission){ if (confirm("Wirklich Berechtigung an "+userEmail+" geben?")){ $.post('/api/user/addpermission',{email:userEmail,permissions:permission},reload,'json'); } } function disableList(listEmail){ $.post('/api/list/disable',{list:listEmail},showListResult,'json'); } function dropList(listEmail){ $.post('/api/list/drop',{list:listEmail},showListResult,'json'); } function dropMail(mailId){ $.post('/api/mail/drop',{message_id:mailId},showListResult,'json'); } function dropMember(userEmail,listEmail){ $.post('/api/list/drop_member',{list:listEmail,email:userEmail},reload,'json'); } function dropMod(userEmail,listEmail){ $.post('/api/list/drop_mod',{list:listEmail,email:userEmail},reload,'json'); } function dropPermission(userEmail,permission){ if (confirm("Wirklich Berechtigung von "+userEmail+" wegnehmen?")){ $.post('/api/user/droppermission',{email:userEmail,permissions:permission},reload,'json'); } } function enableList(listEmail){ $.post('/api/list/enable',{list:listEmail},showListResult,'json'); } function hideList(listEmail){ $.post('/api/list/hide',{list:listEmail},showListResult,'json'); } function loadArchive(listEmail,month){ $.get('/api/list/archive?month='+month+'&list='+listEmail,showListArchive,'json'); } function loadArchiveSummary(listEmail){ $.get('/api/list/archive?list='+listEmail,showListArchiveSummary,'json'); } function loadListDetail(listEmail){ $.post('/api/list/detail',{list:listEmail},showListDetail,'json'); } function loadListOfModeratedLists(){ $.getJSON('/api/list/moderated', showListOfModeratedLists); } function loadListOfSubscribableLists(){ $.getJSON('/api/list/subscribable', showListList); } function loadMembers(listEmail){ $.post('/api/list/members',{list:listEmail},showMembers,'json'); } function loadUserList(){ $.getJSON('/api/user/list', showUserList); } function reload(){ window.location.reload(true); } function showList(listEmail){ $.post('/api/list/show',{list:listEmail},showListResult,'json'); } function showListArchive(data){ console.log(data); let moderator = data.archive.moderator; console.log('moderator: ',moderator); let posts = data.archive.posts; for (let time in posts){ let post = posts[time]; let row = $(''); var url = 'post?id='+post.id; $('').html(''+post.date+'').appendTo(row); $('').html(''+post.from_name+'').appendTo(row); $('').html(''+post.subject+'').appendTo(row); if (moderator){ $('