Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ajaxPlugPecGetAllNotifications() {
- let notifications = '';
- $.ajax({
- type: 'GET',
- dataType: "JSON",
- async: false,
- url: "index.php",
- data: 'getPlugPecAllNotifications',
- success: function (response) {
- for(r in response)
- {
- console.log(response[r]);
- for(r2 in response[r])
- {
- subtitle = r2;
- notifications += '<span class="sub-title">'+subtitle+'</span>';
- for(r3 in response[r][r2])
- {
- actorAvatar = response[r][r2][r3]['actorAvatar'];
- actorName = response[r][r2][r3]['actorName'];
- content = response[r][r2][r3]['contentHtml'];
- timeDiff = response[r][r2][r3]['timeDiff'];
- card = '<li>'+
- '<div class="joms-popover__avatar">'+
- '<div class="joms-avatar">'+
- '<img src="'+actorAvatar+'" alt="'+actorName+'">'+
- '</div>'+
- '</div>'+
- '<div class="joms-popover__content">'+content+
- '<small>'+timeDiff+'</small>'+
- '</div>'+
- '</li>';
- notifications += card;
- }
- }
- }
- notifications += '<a href="<?php echo $basePath?>profile/notifications" class="btn btn-primary">Ver todas as notificações</button>';
- $('#notifications-list').html(notifications);
- $('.joms-popover__content a').addClass('texto-colorido');
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement