Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="wnbell-dropdown" id="wnbell-dropdown-id">
- <div class="wnbell-icon-badge-container" id="wnbell-icon-badge-container-id">
- <div class="wnbell-dropdown-toggle" id="wnbell-dropdown-toggle-id wnbell-dropdownMenu1" onclick="" style="outline:none;cursor:pointer;">
- <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> -->
- </div>
- <p> <span class="wnbell-count" id="wnbell-count-id"></span>
- </div>
- <div class="wnbell-dropdown-box-wrap" id="wnbell-dropdown-box-wrap-id">
- <div class="wnbell_notifications_lists" id="" style="position: absolute; right:40px;">
- <div class="wnbell-spinner-wrap">
- <span class="wnbell-spinner"></span>
- </div>
- <div class="wnbell-dropdown-box" id="wnbell-dropdown-box-id"></div>
- </p></div>
- </div></div>
- <p> <script type='text/javascript'>
- function wnbell_load_unseen_notification(view = '') {
- jQuery.ajax({
- type: "POST",
- url: ajax_url,
- data: {
- action: 'wnbell_list_ajax',
- _ajax_nonce:"68c9865f56",
- view: view,
- last_seen:last_seen_id
- },
- dataType: 'JSON',
- success: function (data) {
- if (typeof wnbell_interval == 'undefined' || !wnbell_interval) {
- wnbell_interval = setInterval(function () {
- wnbell_load_unseen_notification();
- }, 600000);
- //data.interval);
- }
- if(data.last_seen){
- last_seen_id=data.last_seen;
- }
- //jQuery('.wnbell-dropdown-box').html(data.notification);
- jQuery('.wnbell-spinner').hide();
- jQuery('.wnbell-spinner').removeClass('wnbell-active-spinner');
- if (data.notification != '') {
- if(wnb_mediaQuery.matches) {
- jQuery('.wnbell_dropdown_list_ss').html(data.notification);
- jQuery('.wnbell-spinner-wrap-ss').hide();
- jQuery('.wnbell-spinner-ss').removeClass('wnbell-active-spinner-ss');
- }else{
- jQuery('.wnbell-dropdown-box').html(data.notification);
- }
- clearInterval(wnbell_interval);
- wnbell_interval = null;
- }
- if (data.unseen_notification > 0 && data.notification == '') {
- // if(!jQuery('.wnbell-count').hasClass('wnbell-badge')){
- jQuery('.wnbell-count').addClass('wnbell-badge wnbell-badge-shortcode wnbell-badge-danger');
- jQuery('.wnbell-count').html(data.unseen_notification);
- }
- }
- });
- };
- function wnbell_ajax_seen(notificationID = '', notification_type = '') {
- jQuery.ajax({
- type: "POST",
- url: ajax_url,
- data: {
- action: 'wnbell_seen_notification_ajax',
- _ajax_nonce:"68c9865f56",
- notificationID: notificationID,
- notification_type: notification_type
- },
- dataType: 'JSON',
- success: function (data) {
- }
- });
- };
- var wnb_mediaQuery = window.matchMedia('(max-width: 768px)');
- var last_seen_id=0;
- jQuery(document).ready(function () {
- // var last_seen_id=0;
- wnbell_load_unseen_notification();
- jQuery('.wnbell-dropdown-toggle').click(function () {</p>
- <p> if (jQuery('.wnbell-dropdown-box').html() == '' && jQuery('.wnbell_dropdown_list_ss').html() == '') {
- if(wnb_mediaQuery.matches) {
- jQuery('.wnbell_dropdown_list_ss').css('display', 'inline-block');
- // jQuery('body').css("overflow","hidden");
- jQuery('.wnbell-spinner-wrap-ss').css('display', 'inline-block');
- jQuery('.wnbell-spinner-ss').addClass('wnbell-active-spinner-ss');
- }else{
- jQuery('.wnbell-dropdown-box-wrap').css('display', 'inline-block');</p>
- <p> jQuery('.wnbell-spinner').css('display', 'inline-block');
- jQuery('.wnbell-spinner').addClass('wnbell-active-spinner');
- }
- //clearInterval(wnbell_interval);
- wnbell_load_unseen_notification('yes');
- }
- jQuery('.wnbell-count').html('');
- jQuery('.wnbell-count').removeClass('wnbell-badge wnbell-badge-shortcode wnbell-badge-danger');
- });
- jQuery('html').click(function (e) {
- if (!jQuery(e.target).parent().hasClass('wnbell-dropdown-box')) {
- if (jQuery('.wnbell-dropdown-box').html() != '') {
- jQuery(".wnbell-spinner").removeClass("wnbell-active-spinner");
- jQuery('.wnbell-spinner').hide();
- jQuery('.wnbell-dropdown-box-wrap').hide();
- jQuery('.wnbell-dropdown-box').html('');
- wnbell_load_unseen_notification();
- }
- }</p>
- <p> });
- jQuery(document).on('click', '.wnbell-closebtn', function (e) {
- jQuery('.wnbell_dropdown_list_ss').html('');
- jQuery('.wnbell-dropdown-box').html('');
- jQuery('.wnbell_dropdown_list_ss').hide();
- jQuery('.wnbell-dropdown-box-wrap').hide();
- wnbell_load_unseen_notification();
- //jQuery('body').css("overflow", "auto");
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement