2018-10-16 16:28:42 +00:00
( function ( $ , sr ) {
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function ( func , threshold , execAsap ) {
var timeout ;
return function debounced ( ) {
var obj = this , args = arguments ;
function delayed ( ) {
if ( ! execAsap )
func . apply ( obj , args ) ;
timeout = null ;
}
if ( timeout )
clearTimeout ( timeout ) ;
else if ( execAsap )
func . apply ( obj , args ) ;
timeout = setTimeout ( delayed , threshold || 100 ) ;
} ;
} ;
// smartresize
jQuery . fn [ sr ] = function ( fn ) {
return fn ? this . bind ( 'resize' , debounce ( fn ) ) : this . trigger ( sr ) ;
} ;
} ) ( jQuery , 'smartresize' ) ;
/ * *
* To change this license header , choose License Headers in Project Properties .
* To change this template file , choose Tools | Templates
* and open the template in the editor .
* /
var CURRENT _URL = window . location . href . split ( '?' ) [ 0 ] ,
$BODY = $ ( 'body' ) ,
$MENU _TOGGLE = $ ( '#menu_toggle' ) ,
$SIDEBAR _MENU = $ ( '#sidebar-menu' ) ,
$SIDEBAR _FOOTER = $ ( '.sidebar-footer' ) ,
$LEFT _COL = $ ( '.left_col' ) ,
$RIGHT _COL = $ ( '.right_col' ) ,
$NAV _MENU = $ ( '.nav_menu' ) ,
$FOOTER = $ ( 'footer' ) ;
// Sidebar
$ ( document ) . ready ( function ( ) {
// TODO: This is some kind of easy fix, maybe we can improve this
var setContentHeight = function ( ) {
// reset height
$RIGHT _COL . css ( 'min-height' , $ ( window ) . height ( ) ) ;
var bodyHeight = $BODY . outerHeight ( ) ,
footerHeight = $BODY . hasClass ( 'footer_fixed' ) ? - 10 : $FOOTER . height ( ) ,
leftColHeight = $LEFT _COL . eq ( 1 ) . height ( ) + $SIDEBAR _FOOTER . height ( ) ,
contentHeight = bodyHeight < leftColHeight ? leftColHeight : bodyHeight ;
// normalize content
contentHeight -= $NAV _MENU . height ( ) + footerHeight ;
$RIGHT _COL . css ( 'min-height' , contentHeight ) ;
} ;
$SIDEBAR _MENU . find ( 'a' ) . on ( 'click' , function ( ev ) {
var $li = $ ( this ) . parent ( ) ;
if ( $li . is ( '.active' ) ) {
$li . removeClass ( 'active active-sm' ) ;
$ ( 'ul:first' , $li ) . slideUp ( function ( ) {
setContentHeight ( ) ;
} ) ;
} else {
// prevent closing menu if we are on child menu
if ( ! $li . parent ( ) . is ( '.child_menu' ) ) {
$SIDEBAR _MENU . find ( 'li' ) . removeClass ( 'active active-sm' ) ;
$SIDEBAR _MENU . find ( 'li ul' ) . slideUp ( ) ;
}
$li . addClass ( 'active' ) ;
$ ( 'ul:first' , $li ) . slideDown ( function ( ) {
setContentHeight ( ) ;
} ) ;
}
} ) ;
// toggle small or large menu
$MENU _TOGGLE . on ( 'click' , function ( ) {
if ( $BODY . hasClass ( 'nav-md' ) ) {
$SIDEBAR _MENU . find ( 'li.active ul' ) . hide ( ) ;
$SIDEBAR _MENU . find ( 'li.active' ) . addClass ( 'active-sm' ) . removeClass ( 'active' ) ;
} else {
$SIDEBAR _MENU . find ( 'li.active-sm ul' ) . show ( ) ;
$SIDEBAR _MENU . find ( 'li.active-sm' ) . addClass ( 'active' ) . removeClass ( 'active-sm' ) ;
}
$BODY . toggleClass ( 'nav-md nav-sm' ) ;
setContentHeight ( ) ;
} ) ;
// check active menu
$SIDEBAR _MENU . find ( 'a[href="' + CURRENT _URL + '"]' ) . parent ( 'li' ) . addClass ( 'current-page' ) ;
$SIDEBAR _MENU . find ( 'a' ) . filter ( function ( ) {
return this . href == CURRENT _URL ;
} ) . parent ( 'li' ) . addClass ( 'current-page' ) . parents ( 'ul' ) . slideDown ( function ( ) {
setContentHeight ( ) ;
} ) . parent ( ) . addClass ( 'active' ) ;
// recompute content when resizing
$ ( window ) . smartresize ( function ( ) {
setContentHeight ( ) ;
} ) ;
setContentHeight ( ) ;
// fixed sidebar
if ( $ . fn . mCustomScrollbar ) {
$ ( '.menu_fixed' ) . mCustomScrollbar ( {
autoHideScrollbar : true ,
theme : 'minimal' ,
mouseWheel : {
preventDefault : true ,
deltaFactor : 1000
}
} ) ;
}
} ) ;
// /Sidebar
// Panel toolbox
$ ( document ) . ready ( function ( ) {
$ ( '.collapse-link' ) . on ( 'click' , function ( ) {
var $BOX _PANEL = $ ( this ) . closest ( '.x_panel' ) ,
$ICON = $ ( this ) . find ( 'i' ) ,
$BOX _CONTENT = $BOX _PANEL . find ( '.x_content' ) ;
// fix for some div with hardcoded fix class
if ( $BOX _PANEL . attr ( 'style' ) ) {
$BOX _CONTENT . slideToggle ( 200 , function ( ) {
$BOX _PANEL . removeAttr ( 'style' ) ;
} ) ;
} else {
$BOX _CONTENT . slideToggle ( 200 ) ;
$BOX _PANEL . css ( 'height' , 'auto' ) ;
}
$ICON . toggleClass ( 'fa-chevron-up fa-chevron-down' ) ;
} ) ;
$ ( '.close-link' ) . click ( function ( ) {
var $BOX _PANEL = $ ( this ) . closest ( '.x_panel' ) ;
$BOX _PANEL . remove ( ) ;
} ) ;
} ) ;
// /Panel toolbox
// Tooltip
$ ( document ) . ready ( function ( ) {
$ ( '[data-toggle="tooltip"]' ) . tooltip ( {
container : 'body'
} ) ;
} ) ;
// /Tooltip
// Accordion
$ ( document ) . ready ( function ( ) {
$ ( ".expand" ) . on ( "click" , function ( ) {
$ ( this ) . next ( ) . slideToggle ( 200 ) ;
$expand = $ ( this ) . find ( ">:first-child" ) ;
if ( $expand . text ( ) == "+" ) {
$expand . text ( "-" ) ;
} else {
$expand . text ( "+" ) ;
}
} ) ;
} ) ;
function getDate ( date ) {
let d = date . getDate ( ) ;
if ( d < 10 )
d = "0" + d ;
let m = date . getMonth ( ) + 1 ;
if ( m < 10 )
m = "0" + m ;
let y = date . getFullYear ( ) ;
let h = date . getHours ( ) ;
if ( h < 10 )
h = "0" + h ;
let mm = date . getMinutes ( ) ;
if ( mm < 10 )
mm = "0" + mm ;
return d + "." + m + "." + y ;
}
$ ( function ( ) {
let defaultDate ;
if ( $ ( '#datepicker' ) . val ( ) ) {
defaultDate = new Date ( $ ( '#datepicker' ) . val ( ) ) ;
} else {
defaultDate = new Date ( ) ;
}
$ ( '#datetimepicker' ) . datetimepicker ( {
format : 'DD.MM.YYYY HH:mm' ,
stepping : '10' ,
sideBySide : true ,
showTodayButton : true ,
icons : {
time : "fa fa-clock-o" ,
date : "fa fa-calendar" ,
up : "fa fa-arrow-up" ,
down : "fa fa-arrow-down"
}
} ) ;
$ ( '#datepicker' ) . datetimepicker ( {
format : 'DD.MM.YYYY' ,
date : defaultDate ,
viewDate : defaultDate ,
stepping : '10' ,
sideBySide : true ,
showTodayButton : true ,
icons : {
time : "fa fa-clock-o" ,
date : "fa fa-calendar" ,
up : "fa fa-arrow-up" ,
down : "fa fa-arrow-down"
}
} ) ;
} ) ;
$ ( 'select[name=category]' ) . change ( function ( ) {
if ( this . value == "new-category" ) {
$ ( '#new-category' ) . show ( ) ;
} else {
$ ( '#new-category' ) . hide ( ) ;
}
} ) ;
$ ( '#new-category-submit' ) . click ( function ( ) {
var name = $ ( 'input[name=new-category-name]' ) . val ( ) ;
var display _name = $ ( 'input[name=new-category-display-name]' ) . val ( ) ;
$ . ajax ( {
2018-10-17 11:56:22 +00:00
url : "/admin/blog/new_category" ,
2018-10-16 16:28:42 +00:00
type : "POST" ,
data : {
name : name ,
display _name : display _name
} ,
success : function ( data ) {
console . log ( data ) ;
var duplicates = $ ( 'select[name="category"] option[value="' + data + '"]' ) . eq ( 0 ) ;
if ( jQuery . isEmptyObject ( duplicates ) ) {
console . log ( 'test' ) ;
$ ( 'select[name="category"]' ) . append ( '<option value="' + data + '" selected="">' + display _name + '</option>' ) ;
} else {
console . log ( 'kein guter Test' ) ;
duplicates . attr ( 'selected' , '' ) ;
}
}
} ) ;
} ) ;
$ ( window ) . load ( function ( ) {
var date = new Date ( ) ,
d = date . getDate ( ) ,
m = date . getMonth ( ) ,
y = date . getFullYear ( ) ,
started ,
categoryClass ;
var calendar = $ ( '#calendar' ) . fullCalendar ( {
header : {
left : 'prev,next today' ,
center : 'title' ,
right : 'month,agendaWeek,agendaDay'
} ,
selectable : true ,
selectHelper : true ,
select : function ( start , end , allDay ) {
$ ( '#fc_create' ) . click ( ) ;
started = start ;
ended = end ;
$ ( ".antosubmit" ) . on ( "click" , function ( ) {
var title = $ ( "#title" ) . val ( ) ;
if ( end ) {
ended = end ;
}
categoryClass = $ ( "#event_type" ) . val ( ) ;
if ( title ) {
calendar . fullCalendar ( 'renderEvent' , {
title : title ,
start : started ,
end : end ,
allDay : allDay
} ,
true // make the event "stick"
) ;
}
$ ( '#title' ) . val ( '' ) ;
calendar . fullCalendar ( 'unselect' ) ;
$ ( '.antoclose' ) . click ( ) ;
return false ;
} ) ;
} ,
eventClick : function ( calEvent , jsEvent , view ) {
$ ( '#fc_edit' ) . click ( ) ;
$ ( '#title2' ) . val ( calEvent . title ) ;
categoryClass = $ ( "#event_type" ) . val ( ) ;
$ ( ".antosubmit2" ) . on ( "click" , function ( ) {
calEvent . title = $ ( "#title2" ) . val ( ) ;
calendar . fullCalendar ( 'updateEvent' , calEvent ) ;
$ ( '.antoclose2' ) . click ( ) ;
} ) ;
calendar . fullCalendar ( 'unselect' ) ;
} ,
editable : true ,
events : '/admin/calendar/getAllEvents' ,
locale : 'de' ,
eventClick : function ( ) {
alert ( 'Test' ) ;
}
} ) ;
} ) ;
// tinymce.init({
// selector: '.tinymce-textarea',
// plugins: [
// 'image, imagetools, code, media, link, colorpicker, paste, table, textcolor, advlist',
// 'anchor, autolink, autoresize, autosave, charmap, codesample, contextmenu, emoticons, fullscreen, hr',
// 'insertdatetime, layer, preview, searchreplace, textpattern, wordcount, jbimages'
// ],
// toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image jbimages media codesample | toc emoticons insertdatetime hr | preview searchreplace',
// textpattern_patterns: [
// {start: '*', end: '*', format: 'italic'},
// {start: '**', end: '**', format: 'bold'},
// {start: '#', format: 'h1'},
// {start: '##', format: 'h2'},
// {start: '###', format: 'h3'},
// {start: '####', format: 'h4'},
// {start: '#####', format: 'h5'},
// {start: '######', format: 'h6'},
// {start: '1. ', cmd: 'InsertOrderedList'},
// {start: '* ', cmd: 'InsertUnorderedList'},
// {start: '- ', cmd: 'InsertUnorderedList'}
// ],
// relative_urls: false,
// content_css: '/assets/css/bootstrap-3.0.0.css,/assets/css/main.css',
// content_style: 'html{padding:0 50px}body{max-width:1170px;}'
// });
$ ( '#title-input' ) . keyup ( function ( ) {
var title = $ ( '#title-input' ) . val ( ) . toLowerCase ( ) ;
title = title . replace ( / /g , '-' ) ;
title = title . replace ( /[^a-z1-9-]/g , '' ) ;
$ ( '#url-input' ) . val ( encodeURI ( title ) ) ;
} ) ;
$ ( '#tags-input' ) . keypress ( function ( event ) {
if ( event . keyCode === 13 ) {
event . preventDefault ( ) ;
}
} ) ;
var deletePost = function ( id ) {
var row = $ ( "#post-" + id ) ;
$ . ajax ( {
2018-10-17 11:56:22 +00:00
url : "/admin/blog/delete" ,
2018-10-16 16:28:42 +00:00
data : {
id : id
} ,
method : 'POST' ,
beforeSend : function ( ) {
row . children ( ) . fadeOut ( 1000 ) ;
row . append ( '<td id="loader" colspan="12" style="text-align:center"><i class="fa fa-spinner fa-spin"></i></td>' ) ;
} ,
success : function ( data ) {
setTimeout ( function ( ) {
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'background-color' , '#2ecc71' ) ;
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'color' , '#fff' ) ;
row . find ( '#loader .fa' ) . delay ( 1000 ) . removeClass ( 'fa-spinner' ) . removeClass ( 'fa-spin' ) . addClass ( 'fa-check' ) ;
setTimeout ( function ( ) {
row . fadeOut ( 1000 ) ;
setTimeout ( function ( ) {
row . remove ( ) ;
} , 2000 ) ;
} , 2000 ) ;
} , 2000 ) ;
} ,
error : function ( ) {
setTimeout ( function ( ) {
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'background-color' , '#e74c3c' ) ;
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'color' , '#fff' ) ;
row . find ( '#loader .fa' ) . delay ( 1000 ) . removeClass ( 'fa-spinner' ) . removeClass ( 'fa-spin' ) . addClass ( 'fa-times' ) ;
setTimeout ( function ( ) {
row . find ( '#loader' ) . fadeOut ( 1000 ) ;
row . children ( ) . fadeIn ( 1000 ) ;
setTimeout ( function ( ) {
row . find ( '#loader' ) . remove ( ) ;
} , 2000 ) ;
} , 2000 ) ;
} , 2000 ) ;
}
} ) ;
} ;
$ ( '#deleteModal' ) . on ( 'show.bs.modal' , function ( event ) {
var button = $ ( event . relatedTarget ) ;
var type = button . data ( 'type' ) ;
var title = button . data ( 'title' ) ;
var id = button . data ( 'id' ) ;
var modal = $ ( this ) ;
modal . find ( '.modal-body' ) . html ( "<div class='alert alert-danger'><b>Durch das Klicken auf den Bestätigungs-Button wird der/die/das " + type + " <b>unwiederruflich</b> gelöscht und kann nicht wiederhergestellt werden!</b></div><p>Diese Aktion kann <b>NICHT</b> rückgängig gemacht werden. Dies wird alle Kommentare, Statistiken, Likes und Inhalte von <b>" + title + "</b> unwiederruflich löschen.</p><p>Bitte gib zur Bestätigung den Titel des Eintrags unter Berücksichtigung der Groß- und Kleinschreibung ein:</p><input class='form-control' id='confirm-delete-input' data-title='" + title + "'>" ) ;
modal . find ( '.modal-footer .btn-red' ) . attr ( 'disabled' , '' ) ;
$ ( '#confirm-delete-input' ) . keyup ( function ( ) {
var removeButton = $ ( '.modal-footer .btn-red' , '#deleteModal' ) ;
if ( $ ( this ) . val ( ) == title ) {
removeButton . removeAttr ( 'disabled' ) ;
switch ( type ) {
case "Blog-Post" :
2018-10-17 11:56:22 +00:00
removeButton . attr ( 'onclick' , 'deletePostFinally(' + id + ', "/admin/blog/deleteFinally", "post")' ) ;
2018-10-16 16:28:42 +00:00
break ;
case "Projekt" :
2018-10-17 11:56:22 +00:00
removeButton . attr ( 'onclick' , 'deletePostFinally(' + id + ', "/admin/projects/delete", "entry")' ) ;
2018-10-16 16:28:42 +00:00
break ;
case "Projekt-Kategorie" :
2018-10-17 11:56:22 +00:00
removeButton . attr ( 'onclick' , 'deletePostFinally(' + id + ', "/admin/projects/delete_category", "category")' ) ;
2018-10-16 16:28:42 +00:00
break ;
case "Datei" :
2018-10-17 11:56:22 +00:00
removeButton . attr ( 'onclick' , 'deletePostFinally(' + id + ', "/admin/files/delete", "file")' ) ;
2018-10-16 16:28:42 +00:00
break ;
}
removeButton . css ( 'cursor' , 'pointer' ) ;
} else {
removeButton . attr ( 'disabled' , '' ) ;
removeButton . removeAttr ( 'onclick' ) ;
removeButton . css ( 'cursor' , 'auto' ) ;
}
} ) ;
} ) ;
function deletePostFinally ( id , url , selector ) {
var row = $ ( "#" + selector + "-" + id ) ;
console . log ( row ) ;
$ . ajax ( {
url : url ,
method : 'POST' ,
data : {
id : id
} ,
beforeSend : function ( ) {
$ ( '#deleteModal' ) . modal ( 'hide' ) ;
row . children ( ) . fadeOut ( 1000 ) ;
row . append ( '<td id="loader" colspan="12" style="text-align:center"><i class="fa fa-spinner fa-spin"></i></td>' ) ;
} ,
success : function ( data ) {
setTimeout ( function ( ) {
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'background-color' , '#2ecc71' ) ;
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'color' , '#fff' ) ;
row . find ( '#loader .fa' ) . delay ( 1000 ) . removeClass ( 'fa-spinner' ) . removeClass ( 'fa-spin' ) . addClass ( 'fa-check' ) ;
setTimeout ( function ( ) {
row . fadeOut ( 1000 ) ;
setTimeout ( function ( ) {
row . remove ( ) ;
} , 2000 ) ;
} , 2000 ) ;
} , 2000 ) ;
} ,
error : function ( data ) {
setTimeout ( function ( ) {
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'background-color' , '#e74c3c' ) ;
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'color' , '#fff' ) ;
row . find ( '#loader .fa' ) . delay ( 1000 ) . removeClass ( 'fa-spinner' ) . removeClass ( 'fa-spin' ) . addClass ( 'fa-times' ) ;
setTimeout ( function ( ) {
row . find ( '#loader' ) . fadeOut ( 1000 ) ;
row . children ( ) . fadeIn ( 1000 ) ;
setTimeout ( function ( ) {
row . find ( '#loader' ) . remove ( ) ;
} , 2000 ) ;
} , 2000 ) ;
} , 2000 ) ;
}
} ) ;
}
function restorePost ( id ) {
var row = $ ( "#post-" + id ) ;
$ . ajax ( {
2018-10-17 11:56:22 +00:00
url : "/admin/blog/restore" ,
2018-10-16 16:28:42 +00:00
data : {
id : id
} ,
method : 'POST' ,
beforeSend : function ( ) {
row . children ( ) . fadeOut ( 1000 ) ;
row . append ( '<td id="loader" colspan="12" style="text-align:center"><i class="fa fa-spinner fa-spin"></i></td>' ) ;
} ,
success : function ( data ) {
setTimeout ( function ( ) {
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'background-color' , '#2ecc71' ) ;
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'color' , '#fff' ) ;
row . find ( '#loader .fa' ) . delay ( 1000 ) . removeClass ( 'fa-spinner' ) . removeClass ( 'fa-spin' ) . addClass ( 'fa-check' ) ;
setTimeout ( function ( ) {
row . fadeOut ( 1000 ) ;
setTimeout ( function ( ) {
row . remove ( ) ;
} , 2000 ) ;
} , 2000 ) ;
} , 2000 ) ;
} ,
error : function ( ) {
setTimeout ( function ( ) {
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'background-color' , '#e74c3c' ) ;
row . find ( '#loader' ) . delay ( 1000 ) . css ( 'color' , '#fff' ) ;
row . find ( '#loader .fa' ) . delay ( 1000 ) . removeClass ( 'fa-spinner' ) . removeClass ( 'fa-spin' ) . addClass ( 'fa-times' ) ;
setTimeout ( function ( ) {
row . find ( '#loader' ) . fadeOut ( 1000 ) ;
row . children ( ) . fadeIn ( 1000 ) ;
setTimeout ( function ( ) {
row . find ( '#loader' ) . remove ( ) ;
} , 2000 ) ;
} , 2000 ) ;
} , 2000 ) ;
}
} ) ;
}
$ ( window ) . load ( function ( ) {
imageUploadSwitch ( ) ;
} ) ;
function imageUploadSwitch ( ) {
if ( $ ( '#imageUrl' ) . is ( ':checked' ) ) {
$ ( '.image-upload' ) . hide ( ) ;
$ ( '.image-url' ) . show ( ) ;
} else {
$ ( '.image-url' ) . hide ( ) ;
$ ( '.image-upload' ) . show ( ) ;
}
}
function fillSecond ( ) {
$ ( '#second-form input[name="title"]' ) . val ( $ ( '#title' ) . html ( ) ) ;
$ ( '#second-form input[name="description"]' ) . val ( $ ( '#description' ) . html ( ) ) ;
}
$ ( ".table" ) . DataTable ( {
language : {
"sEmptyTable" : "Keine Daten in der Tabelle vorhanden" ,
"sInfo" : "_START_ bis _END_ von _TOTAL_ Einträgen" ,
"sInfoEmpty" : "0 bis 0 von 0 Einträgen" ,
"sInfoFiltered" : "(gefiltert von _MAX_ Einträgen)" ,
"sInfoPostFix" : "" ,
"sInfoThousands" : "." ,
"sLengthMenu" : "_MENU_ Einträge anzeigen" ,
"sLoadingRecords" : "Wird geladen..." ,
"sProcessing" : "Bitte warten..." ,
"sSearch" : "Suchen" ,
"sZeroRecords" : "Keine Einträge vorhanden." ,
"oPaginate" : {
"sFirst" : "Erste" ,
"sPrevious" : "Zurück" ,
"sNext" : "Nächste" ,
"sLast" : "Letzte"
} ,
"oAria" : {
"sSortAscending" : ": aktivieren, um Spalte aufsteigend zu sortieren" ,
"sSortDescending" : ": aktivieren, um Spalte absteigend zu sortieren"
} ,
select : {
rows : {
_ : '%d Zeilen ausgewählt' ,
0 : 'Zum Auswählen auf eine Zeile klicken' ,
1 : '1 Zeile ausgewählt'
}
}
}
} ) ;
function loadNotificationsAsync ( ) {
$ . ajax ( {
2018-10-17 11:56:22 +00:00
url : '/Main/getNotifications' ,
2018-10-16 16:28:42 +00:00
method : 'post' ,
success : ( data ) => {
console . log ( data ) ;
if ( data . status === 'success' ) {
for ( let notification of data . notifications ) {
$ ( '#notificationMenu' ) . append ( `
< li >
< a href = "${notification.link}" target = "_blank" >
< span class = "image" > < img src = "${notification.image}" alt = "${notification.sender}" / > < / s p a n >
< span >
< span > $ { notification . sender } < / s p a n >
< span class = "time" > $ { notification . time } < / s p a n >
< / s p a n >
< span class = "message" > $ { notification . message } < / s p a n >
< / a >
< / l i > ` ) ;
}
if ( data . notifications . length > 0 ) {
$ ( '#notificationCount' ) . text ( data . notifications . length ) ;
}
}
} ,
error : ( data ) => {
// TODO: Fallback hinzufügen
}
} )
}
loadNotificationsAsync ( ) ;