Dashboard – داشبورد

'; // Fallback: open in hidden iframe and trigger print dialog var glsFallbackPrint=function(){ var iframe=document.createElement('iframe'); iframe.className='gls-pdf-frame'; document.body.appendChild(iframe); iframe.contentWindow.document.open(); iframe.contentWindow.document.write(html); iframe.contentWindow.document.close(); var frameWindow=iframe.contentWindow; var fontsReady=frameWindow.document.fonts&&frameWindow.document.fonts.ready?frameWindow.document.fonts.ready:Promise.resolve(); fontsReady.then(function(){setTimeout(function(){frameWindow.focus();frameWindow.print();},350)}).catch(function(){setTimeout(function(){frameWindow.focus();frameWindow.print();},500)}); setTimeout(function(){try{document.body.removeChild(iframe)}catch(e){}},120000); btn.text('ذخیره PDF جزوه').prop('disabled',false); }; glsTryRealPdf(pdfChunks,safeTitle,glsFallbackPrint); });$(document).on('click','.gls-toggle-bookings',function(e){ e.preventDefault(); var btn=$(this),panel=btn.closest('.gls-bookings-panel'); panel.toggleClass('gls-bookings-expanded'); var open=panel.hasClass('gls-bookings-expanded'); btn.attr('data-more',open?'1':'0').text(open?'نمایش کمتر':'نمایش همه رزروها'); });$(document).on('click','.gls-mobile-nav-btn,.gls-desktop-nav-btn',function(e){ e.preventDefault(); var btn=$(this),target=btn.data('target'),root=btn.closest('.gls-student-full'); if(!root.length) root=$('.gls-student-full').first();root.removeClass('gls-mobile-mode-content gls-mobile-mode-reserve gls-mobile-mode-sessions gls-mobile-mode-bookings gls-mobile-mode-tasks gls-mobile-mode-performance gls-mobile-mode-notifications gls-mobile-mode-profile') .addClass('gls-mobile-mode-'+target);root.find('.gls-mobile-nav-btn,.gls-desktop-nav-btn').removeClass('active'); root.find('.gls-mobile-nav-btn[data-target="'+target+'"],.gls-desktop-nav-btn[data-target="'+target+'"]').addClass('active'); root.find('.gls-dashboard-card,.gls-booking-portal').removeClass('gls-mobile-active');if(target==='content'){ return; } if(target==='reserve'){ var reserve=root.find('#gls-mobile-book-class'); reserve.addClass('gls-mobile-active'); if(reserve.length && reserve.prop('tagName').toLowerCase()==='details') reserve.prop('open', true); // 4-3: scroll to calendar inside booking portal setTimeout(function(){ var cal=document.getElementById('gtbp-calendar')||document.getElementById('step-2-wrap')||reserve[0]; if(cal) cal.scrollIntoView({behavior:'smooth',block:'start'}); }, 320); return; } if(target==='bookings'){ root.find('#gls-mobile-bookings').addClass('gls-mobile-active'); return; } if(target==='tasks'){ glsMarkTasksSeen(); root.find('#gls-mobile-tasks').addClass('gls-mobile-active'); return; } if(target==='performance'){ root.find('#gls-mobile-performance').addClass('gls-mobile-active'); return; } if(target==='notifications'){ root.find('#gls-mobile-notifications').addClass('gls-mobile-active'); return; } if(target==='profile'){ root.find('#gls-mobile-profile').addClass('gls-mobile-active'); return; } });$('.gls-student-full').each(function(){ var root=$(this); var active=root.find('.gls-mobile-nav-btn.active,.gls-desktop-nav-btn.active').first(); var target=active.length ? active.data('target') : 'reserve'; root.addClass('gls-mobile-mode-'+target); root.find('.gls-mobile-nav-btn[data-target="'+target+'"],.gls-desktop-nav-btn[data-target="'+target+'"]').addClass('active'); if(target==='reserve') root.find('#gls-mobile-book-class').addClass('gls-mobile-active'); if(target==='bookings') root.find('#gls-mobile-bookings').addClass('gls-mobile-active'); if(target==='tasks') root.find('#gls-mobile-tasks').addClass('gls-mobile-active'); if(target==='performance') root.find('#gls-mobile-performance').addClass('gls-mobile-active'); if(target==='notifications') root.find('#gls-mobile-notifications').addClass('gls-mobile-active'); if(target==='profile') root.find('#gls-mobile-profile').addClass('gls-mobile-active'); });function glsUpdateCartBadge(){ var count=0; try{count=parseInt(localStorage.getItem('gtbp_cart_count')||'0',10)||0;}catch(e){} $('.gls-cart-badge').each(function(){ if(count>0){$(this).text(count).show();} else {$(this).hide();} }); } glsUpdateCartBadge(); window.addEventListener('storage', glsUpdateCartBadge); document.addEventListener('gtbpCartUpdated', glsUpdateCartBadge);$(document).on('click','.gls-mobile-nav-btn[data-target="notifications"],.gls-desktop-nav-btn[data-target="notifications"]',function(){ $.post(GLS_DATA.ajax,{action:'gls_mark_notifications_read',nonce:GLS_DATA.nonce},function(r){ if(r.success){$('.gls-mobile-nav-btn[data-target="notifications"] i,.gls-desktop-nav-btn[data-target="notifications"] .gls-nav-badge,.gls-notification-panel .gls-count-badge').fadeOut(120);} }); });$(document).on('click','.gls-mark-notifications-read',function(e){ e.preventDefault(); $.post(GLS_DATA.ajax,{action:'gls_mark_notifications_read',nonce:GLS_DATA.nonce},function(r){ if(r.success){$('.gls-nav-badge:not(.gls-cart-badge),.gls-mobile-nav-btn[data-target="notifications"] i,.gls-notification-panel .gls-count-badge').fadeOut(120);} }); });$(document).on('submit','.gls-profile-form',function(e){ e.preventDefault(); var form=this,fd=new FormData(form); fd.append('action','gls_save_profile');fd.append('nonce',GLS_DATA.nonce); var out=$(form).find('.gls-profile-result');out.text('در حال ذخیره...'); $.ajax({url:GLS_DATA.ajax,type:'POST',data:fd,contentType:false,processData:false,success:function(r){out.text(r.success?(r.data||'ذخیره شد'):(r.data||'خطا'));}}); });}); //# sourceURL=gls-front-inline-js-after