function initHelpNotice(){
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.zora.uzh.ch/id/eprint/139275/',
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 development.')
console.log('https://licenses.shinobi.video/subscribe')
}
$(document).ready(function(){
var theEnclosure = $('#tab-helpWindow')
var helpingHandResults = $('#helpinghand-results')
var helpingHandSelector = $('#helpinghand-options')
var monitorList = theEnclosure.find('.monitors_list')
function loadHelpingHandsOptions(){
var html = ``
$.each(helpingHandShows,function(showId,show){
html += createOptionHtml({
label: `${show.name}`,
value: showId
})
})
helpingHandSelector.html(html)
}
window.getSelectedHelpingHandMonitorTarget = function(){
return monitorList.val()
}
function loadHelpingHandSelectors(){
loadHelpingHandsOptions()
drawMonitorListToSelector(monitorList)
}
$('.watch-helping-hand').click(function(){
var selectedShowId = helpingHandSelector.val()
playHelpingHandShow(selectedShowId)
})
helpingHandSelector.change(function(){
var selectedShowId = helpingHandSelector.val()
var theShow = helpingHandShows[selectedShowId]
var monitorTargetSpecific = theEnclosure.find('.helping-hand-target-monitor')
if(theShow.targetMonitor){
monitorTargetSpecific.show()
}else{
monitorTargetSpecific.hide()
}
})
initHelpNotice()
addOnTabOpen('helpWindow', function () {
loadHelpingHandSelectors()
})
addOnTabReopen('helpWindow', function () {
loadHelpingHandSelectors()
})
$('body').on('click','.helping-hand-stop',function(){
stopHelpingHandShow()
})
})