Advertisement
Guest User

Untitled

a guest
May 22nd, 2023
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5.88 KB | None | 0 0
  1. <div class="wnbell-dropdown" id="wnbell-dropdown-id">
  2. <div class="wnbell-icon-badge-container" id="wnbell-icon-badge-container-id">
  3. <div class="wnbell-dropdown-toggle" id="wnbell-dropdown-toggle-id wnbell-dropdownMenu1" onclick="" style="outline:none;cursor:pointer;">
  4.     <svg xmlns="http://www.w3.org/2000/svg" height="32" viewBox="0 96 960 960" width="32"><path d="M124 489q0-81 34-153.5T255 212l41 45q-53 43-82.5 103.5T184 489h-60Zm653 0q0-68-28-128.5T668 257l41-45q62 52 95 124t33 153h-60ZM160 856v-60h84V490q0-84 49.5-149.5T424 258v-29q0-23 16.5-38t39.5-15q23 0 39.5 15t16.5 38v29q81 17 131 82.5T717 490v306h83v60H160Zm320-295Zm0 415q-32 0-56-23.5T400 896h160q0 33-23.5 56.5T480 976ZM304 796h353V490q0-74-51-126t-125-52q-74 0-125.5 52T304 490v306Z"/></svg>    <!-- </a> -->
  5.     </div>
  6. <p>    <span class="wnbell-count" id="wnbell-count-id"></span>
  7.     </div>
  8. <div class="wnbell-dropdown-box-wrap" id="wnbell-dropdown-box-wrap-id">
  9. <div class="wnbell_notifications_lists" id="" style="position: absolute; right:40px;">
  10. <div class="wnbell-spinner-wrap">
  11. <span class="wnbell-spinner"></span>
  12. </div>
  13. <div class="wnbell-dropdown-box" id="wnbell-dropdown-box-id"></div>
  14. </p></div>
  15. </div></div>
  16. <p>        <script type='text/javascript'>
  17. function wnbell_load_unseen_notification(view = '') {
  18.         jQuery.ajax({
  19.             type: "POST",
  20.             url: ajax_url,
  21.             data: {
  22.                 action: 'wnbell_list_ajax',
  23.                 _ajax_nonce:"68c9865f56",
  24.                 view: view,
  25.                 last_seen:last_seen_id
  26.             },
  27.             dataType: 'JSON',
  28.             success: function (data) {
  29.                 if (typeof wnbell_interval == 'undefined' || !wnbell_interval) {
  30.                     wnbell_interval = setInterval(function () {
  31.                         wnbell_load_unseen_notification();
  32.                     }, 600000);
  33.                     //data.interval);
  34.                 }
  35.                 if(data.last_seen){
  36.                     last_seen_id=data.last_seen;
  37.                 }
  38.                 //jQuery('.wnbell-dropdown-box').html(data.notification);
  39.                 jQuery('.wnbell-spinner').hide();
  40.                 jQuery('.wnbell-spinner').removeClass('wnbell-active-spinner');
  41.                 if (data.notification != '') {
  42.                     if(wnb_mediaQuery.matches) {
  43.        jQuery('.wnbell_dropdown_list_ss').html(data.notification);
  44.        jQuery('.wnbell-spinner-wrap-ss').hide();
  45.                 jQuery('.wnbell-spinner-ss').removeClass('wnbell-active-spinner-ss');
  46.     }else{
  47.                 jQuery('.wnbell-dropdown-box').html(data.notification);
  48.     }
  49.                     clearInterval(wnbell_interval);
  50.                     wnbell_interval = null;
  51.                 }
  52.                 if (data.unseen_notification > 0 && data.notification == '') {
  53.                   // if(!jQuery('.wnbell-count').hasClass('wnbell-badge')){
  54.                    jQuery('.wnbell-count').addClass('wnbell-badge wnbell-badge-shortcode wnbell-badge-danger');
  55.                     jQuery('.wnbell-count').html(data.unseen_notification);
  56.                 }
  57.             }
  58.         });
  59.     };
  60.     function wnbell_ajax_seen(notificationID = '', notification_type = '') {
  61.         jQuery.ajax({
  62.             type: "POST",
  63.             url: ajax_url,
  64.             data: {
  65.                 action: 'wnbell_seen_notification_ajax',
  66.                 _ajax_nonce:"68c9865f56",
  67.                 notificationID: notificationID,
  68.                 notification_type: notification_type
  69.             },
  70.             dataType: 'JSON',
  71.             success: function (data) {
  72.             }
  73.         });
  74.     };
  75.     var wnb_mediaQuery = window.matchMedia('(max-width: 768px)');
  76.     var last_seen_id=0;
  77.     jQuery(document).ready(function () {
  78.         // var last_seen_id=0;
  79.         wnbell_load_unseen_notification();
  80.         jQuery('.wnbell-dropdown-toggle').click(function () {</p>
  81. <p>            if (jQuery('.wnbell-dropdown-box').html() == '' && jQuery('.wnbell_dropdown_list_ss').html() == '') {
  82.                if(wnb_mediaQuery.matches) {
  83.                    jQuery('.wnbell_dropdown_list_ss').css('display', 'inline-block');
  84.                   //  jQuery('body').css("overflow","hidden");
  85.                   jQuery('.wnbell-spinner-wrap-ss').css('display', 'inline-block');
  86.              jQuery('.wnbell-spinner-ss').addClass('wnbell-active-spinner-ss');
  87.                 }else{
  88.              jQuery('.wnbell-dropdown-box-wrap').css('display', 'inline-block');</p>
  89. <p>                jQuery('.wnbell-spinner').css('display', 'inline-block');
  90.                 jQuery('.wnbell-spinner').addClass('wnbell-active-spinner');
  91.                 }
  92.                 //clearInterval(wnbell_interval);
  93.                 wnbell_load_unseen_notification('yes');
  94.             }
  95.             jQuery('.wnbell-count').html('');
  96.             jQuery('.wnbell-count').removeClass('wnbell-badge wnbell-badge-shortcode wnbell-badge-danger');
  97.         });
  98.         jQuery('html').click(function (e) {
  99.             if (!jQuery(e.target).parent().hasClass('wnbell-dropdown-box')) {
  100.                 if (jQuery('.wnbell-dropdown-box').html() != '') {
  101.                     jQuery(".wnbell-spinner").removeClass("wnbell-active-spinner");
  102.                     jQuery('.wnbell-spinner').hide();
  103.                     jQuery('.wnbell-dropdown-box-wrap').hide();
  104.                     jQuery('.wnbell-dropdown-box').html('');
  105.                     wnbell_load_unseen_notification();
  106.                 }
  107.             }</p>
  108. <p>        });
  109.         jQuery(document).on('click', '.wnbell-closebtn', function (e) {
  110.             jQuery('.wnbell_dropdown_list_ss').html('');
  111.             jQuery('.wnbell-dropdown-box').html('');
  112.             jQuery('.wnbell_dropdown_list_ss').hide();
  113.             jQuery('.wnbell-dropdown-box-wrap').hide();
  114.             wnbell_load_unseen_notification();
  115.             //jQuery('body').css("overflow", "auto");
  116.         });
  117.     });
  118. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement