Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. function ajaxPlugPecGetAllNotifications() {
  2. let notifications = '';
  3. $.ajax({
  4. type: 'GET',
  5. dataType: "JSON",
  6. async: false,
  7. url: "index.php",
  8. data: 'getPlugPecAllNotifications',
  9. success: function (response) {
  10. for(r in response)
  11. {
  12. console.log(response[r]);
  13. for(r2 in response[r])
  14. {
  15. subtitle = r2;
  16. notifications += '<span class="sub-title">'+subtitle+'</span>';
  17. for(r3 in response[r][r2])
  18. {
  19. actorAvatar = response[r][r2][r3]['actorAvatar'];
  20. actorName = response[r][r2][r3]['actorName'];
  21. content = response[r][r2][r3]['contentHtml'];
  22. timeDiff = response[r][r2][r3]['timeDiff'];
  23. card = '<li>'+
  24. '<div class="joms-popover__avatar">'+
  25. '<div class="joms-avatar">'+
  26. '<img src="'+actorAvatar+'" alt="'+actorName+'">'+
  27. '</div>'+
  28. '</div>'+
  29. '<div class="joms-popover__content">'+content+
  30. '<small>'+timeDiff+'</small>'+
  31. '</div>'+
  32. '</li>';
  33. notifications += card;
  34. }
  35. }
  36. }
  37. notifications += '<a href="<?php echo $basePath?>profile/notifications" class="btn btn-primary">Ver todas as notificações</button>';
  38. $('#notifications-list').html(notifications);
  39. $('.joms-popover__content a').addClass('texto-colorido');
  40. }
  41. });
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement