$(document).ready(function(){ var helpWindow = $('#help_window') var openMessage = null function lessThanOneWeekAgo(date){ const WEEK = 1000 * 60 * 60 * 24 * 7; const aWeekAgo = Date.now() - WEEK; return date < aWeekAgo; } function showHelpNotice(){ var buttonHtml = `` $.each([ { icon: 'share-square-o', color: 'default', text: 'ShinobiShop Subscriptions', href: 'https://licenses.shinobi.video/subscribe', class: '' }, { icon: 'paypal', color: 'success', text: 'Donate by PayPal', href: 'https://www.paypal.me/ShinobiCCTV', class: '' }, { icon: 'bank', color: 'default', text: 'University of Zurich (UZH)', href: 'https://www.media.uzh.ch/en/Press-Releases/2017/Generosity.html', class: '' }, { icon: 'cube', color: 'danger', text: lang[`Don't Show for 1 Week`], href: '#', class: 'hide_donate', }, ],function(n,button){ buttonHtml += `
${ button.text }
` }) openMessage = new PNotify({ title: `It's a proven fact`, text: `
Generosity makes you a happier person, please consider supporting the development.
If you are already supporting the development, please contact us or use your provided license key and we can get this popup to go away for you Cheers!
${buttonHtml}`, hide: false, }) } function dontShowForOneWeek(){ if(openMessage){ openMessage.remove() } dashboardOptions('subscription_checked',new Date()); } if(!userHasSubscribed && !dashboardOptions().subscription_checked || lessThanOneWeekAgo(new Date(dashboardOptions().subscription_checked))){ setTimeout(function(){ showHelpNotice() },1000 * 60 * 0.2) } $('body').on('click','.hide_donate',function(e){ e.preventDefault() dontShowForOneWeek() return false; }) console.log('Please support the Shinobi developement.') console.log('https://licenses.shinobi.video/subscribe') })