ScoreboardPage = { TimerCh: 0, Init: function () { var thisclass = this; ISWidgetOlympicGames.Type = 'scoreboard'; ISWidgetOlympicGames.Init(); ScoreboardPage.MailInit(); $(".image").hover(function () { $(this).find('.toiningImgNew').fadeOut(200); }, function () { $(this).find('.toiningImgNew').fadeIn(200); }); this.RegionActiveShow(); this.SportActiveShow(); this.SportPopularityShow(); var today = new Date(); /* $.ajax({ url: '/ajax/getcalendar?v=' + ISCommon.GetV(), type: "POST", data: { type: 'All', date: (today.getDate() < 10 ? "0" : "") + today.getDate() + '.' + (today.getMonth() < 9 ? "0" : "") + (today.getMonth() + 1) + '.' + today.getFullYear() }, success: function (d) { if (d.Result == 'yes') { $(".events-calendar .scroll-container").mCustomScrollbar('destroy'); $('.page-content.regions-content.scoreboard #events .scroll-container').html(d.Calendar); $(".events-calendar .scroll-container").mCustomScrollbar({ theme: "my-theme", scrollButtons: { enable: true, scrollAmount: 50, }, }); if (d.Count > 0) { $('#calendar-widget').parents('.box-for-scoreboard').show(); if ($('#calendar-widget div.calendar').height() > $('#calendar-widget div.calendar table').height()) { $('#calendar-widget div.calendar, #calendar-widget div.calendar .scroll-wrapper,#calendar-widget div.calendar .scroll-container').height($('#calendar-widget div.calendar table').height()); } } } } }); */ if ($('#calendar-widget').length) { $(".events-calendar .scroll-container").mCustomScrollbar('destroy'); $(".events-calendar .scroll-container").mCustomScrollbar({ theme: "my-theme", scrollButtons: { enable: true, scrollAmount: 50, }, }); if ($('#calendar-widget div.calendar').height() > $('#calendar-widget div.calendar table').height()) $('#calendar-widget div.calendar, #calendar-widget div.calendar .scroll-wrapper,#calendar-widget div.calendar .scroll-container').height($('#calendar-widget div.calendar table').height()); } ScoreboardPage.Timer(); $('#persons100last').click(function () { $('#persons-last6-list').hide(); $('#persons-last100-list').show(); $('#persons100last-close').show(); $(this).hide(); return false; }); $('#persons100last-close').click(function () { $('#persons-last6-list').show(); $('#persons-last100-list').hide(); $('#persons100last').show(); $(this).hide(); return false; }); $('#organizations100last').click(function () { $('#organizations6last-list').hide(); $('#organizations-last100-list').show(); $(this).hide(); $('#organizations100last-close').show(); return false; }); $('#organizations100last-close').click(function () { //$('#organizations6last-list').show(); $('#organizations-last100-list').hide(); $(this).hide(); $('#organizations100last').show(); return false; }); $('#persons-last100-list a.person').click(function () { ISPerson.AtletPopupToggle($(this)); ISPerson.PersonClick($(this).data('personid')); return false; }); $('#organizations-last100-list a.organization').click(function () { //ISOrganizations.AtletPopupToggle($(this)); return false; }); if ('#structureofpersons' == location.hash) $('#persons100last').click(); if ('#structureoforganizations' == location.hash) $('#organizations100last').click(); }, MailInit: function () { $('.icon_mail').click(function () { $('.mail-popup, .mail-popup .inside_popup').show(); $('.mail-popup .mesageforremove').hide(); return false; }); $('.mail-popup .close').click(function () { $('.mail-popup').hide(); return false; }); $('.mail-popup button').click(function () { ISCommon.DisabledPage(); $.ajax({ type: "POST", url: "/ajax/mailaddscoreboard?v=" + ISCommon.GetV(), data: { Email: $('.mail-popup #email').val() }, success: function (d) { if (1 == d.status) $('.mail-popup .messageemail').text($('.mail-popup #email').val() + " - такой адрес уже есть в базе данных!"); else if (2 == d.status) $('.mail-popup .messageemail').text(" Ваш e-mail " + $('.mail-popup #email').val() + " успешно подписан на рассылку \"Отраслевое табло\""); else if (3 == d.status) $('.mail-popup .messageemail').text($('.footer .subscribe form #email').val() + " В вашем E-mail ошибка!"); ISCommon.IncludedPage(); } }); return false; }); }, Timer: function () { ScoreboardPage.TimerCh++; if (ScoreboardPage.TimerCh > 1000) ScoreboardPage.TimerCh = 1; var today = new Date(); $('.page-heading .page-title #time').html((today.getHours() < 10 ? '0' : '') + today.getHours() + ':' + (today.getMinutes() < 10 ? '0' : '') + today.getMinutes()); setTimeout(function () { ScoreboardPage.Timer(); }, 1000); }, RegionActiveShow: function () { var maxPane = 0; var maxPaneObj; $(".regions-list .activity-pane-wrap .value-label").each(function () { if (parseInt($(this).text()) > maxPane) { maxPane = parseInt($(this).text()); maxPaneObj = $(this); } }); maxPaneObj.parents('.pane').addClass('p100'); $(".regions-list .activity-pane-wrap .pane").each(function () { if (!$(this).hasClass('p100')) { var percent = parseInt($(this).find('.value-label').text()) * 90 / maxPane; $(this).addClass('p' + (10 + Math.round(percent / 10) * 10)); var PanesHeight = Math.round(percent / 10); $(this).find('div.label').text($(this).find('div.label').text()); } }); var i = 0; var j = 1000; $(".regions-list .activity-pane-wrap .value").each(function () { var th = $(this); setTimeout(function () { th.animate({ top: '15px' }, { duration: j, easing: 'swing' }); i += 300; j += 500; }, i); }); var prevValue = 0; var intervalID = setInterval(function () { var randomValue = Math.floor(Math.random() * 23); while (randomValue == prevValue) { randomValue = Math.floor(Math.random() * 23); } var th = $(".regions-list .activity-pane-wrap").find(".value").eq(randomValue); if (th.find('.value-label').length > 0 && parseInt(th.find('.value-label').text()) != 0) th.stop(true).animate({ top: 15 }, { duration: 50, easing: 'swing', complete: function () { th.animate({ top: 5 }, { duration: 100, easing: 'swing', }); prevValue = randomValue; } }); }, 100); }, SportActiveShow: function () { var maxPane = 0; var maxPaneObj; $(".sports-list.activity-month .activity-pane-wrap .value-label").each(function () { if (parseInt($(this).text()) > maxPane) { maxPane = parseInt($(this).text()); maxPaneObj = $(this); } }); maxPaneObj.parents('.pane').addClass('p100'); $(".sports-list.activity-month .activity-pane-wrap .pane").each(function () { if (!$(this).hasClass('p100')) { var percent = parseInt($(this).find('.value-label').text()) * 90 / maxPane; $(this).addClass('p' + (10 + Math.round(percent / 10) * 10)); } }); var i = 0; var j = 1000; $(".sports-list.activity-month .activity-pane-wrap .value").each(function () { var th = $(this); setTimeout(function () { th.animate({ top: '15px' }, { duration: j, easing: 'swing' }); i += 300; j += 500; }, i); }); var prevValue = 0; var intervalID = setInterval(function () { var randomValue = Math.floor(Math.random() * 23); while (randomValue == prevValue) { randomValue = Math.floor(Math.random() * 23); } var th = $(".sports-list.activity-month .activity-pane-wrap").find(".value").eq(randomValue); if (th.find('.value-label').length > 0 && parseInt(th.find('.value-label').text()) != 0) th.stop(true).animate({ top: 15 }, { duration: 50, easing: 'swing', complete: function () { th.animate({ top: 5 }, { duration: 100, easing: 'swing', }); prevValue = randomValue; } }); }, 100); }, SportPopularityShow: function () { var maxPane = 0; var maxPaneObj; $(".sports-list.popularity-month .activity-pane-wrap .value-label").each(function () { if (parseInt($(this).text()) > maxPane) { maxPane = parseInt($(this).text()); maxPaneObj = $(this); } }); if (maxPaneObj) { maxPaneObj.parents('.pane').addClass('p100'); $(".sports-list.popularity-month .activity-pane-wrap .pane").each(function () { if (!$(this).hasClass('p100')) { var percent = parseInt($(this).find('.value-label').text()) * 90 / maxPane; $(this).addClass('p' + (10 + Math.round(percent / 10) * 10)); } }); var i = 0; var j = 1000; $(".sports-list.popularity-month .activity-pane-wrap .value").each(function () { var th = $(this); setTimeout(function () { th.animate({ top: '15px' }, { duration: j, easing: 'swing' }); i += 300; j += 500; }, i); }); var prevValue = 0; var intervalID = setInterval(function () { var randomValue = Math.floor(Math.random() * 23); while (randomValue == prevValue) { randomValue = Math.floor(Math.random() * 23); } var th = $(".sports-list.popularity-month .activity-pane-wrap").find(".value").eq(randomValue); if (th.find('.value-label').length > 0 && parseInt(th.find('.value-label').text()) != 0) th.stop(true).animate({ top: 15 }, { duration: 50, easing: 'swing', complete: function () { th.animate({ top: 5 }, { duration: 100, easing: 'swing', }); prevValue = randomValue; } }); }, 50); } } }