$(document).ready(function(){removeWcagLink();setupWcagCookies();setCustomContentTypesFiltersHeight();bindWcagButtons();bindAttachments();bindTooltips();blueimp.Gallery();backToTop();$('#printButton').click(function(){window.print();});});function removeWcagLink(){$('.slabowidzacy3').remove();} function bindAttachments(){$('#filesContent').on('show.bs.collapse',function(){if($('#filesContent #filesSpinner').length>0){let queryString=window.location.search;let urlParams=new URLSearchParams(queryString);let revisionId=urlParams.get('revision') let appendData='';if(revisionId){appendData='&RevisionId='+revisionId} let request=new Request();let data='Action=GET_BIP_ATTACHED_FILES2&PageId='+PAGE_ID+appendData;request.post(URL_CLIENT_REQUEST,data,function(data){if(typeof data.partialView!='undefined'&&typeof data.result!='undefined'){request.parsePartial(data.partialView,'#filesContent');}},'json');}})} function bindTooltips(){$('.cct-filter__info-icon').tooltip();} function backToTop(){$(window).scroll(function(){if($(this).scrollTop()>400){$('#goTopBipButton').fadeIn();}else{$('#goTopBipButton').fadeOut();}});$('#goTopBipButton').click(function(){$('body,html').animate({scrollTop:$('body').offset().top},800);return false;});} function bindWcagButtons(){$('#btn-wcag__toggler').click(function(){if($(this).hasClass('wcag-toolbox-hidden')){$(this).find($('.fa')).first().removeClass('fa-chevron-down').addClass('fa-chevron-up');$(this).find($('.btn-toolbox-toggler__text')).html('Ukryj panel ułatwień dostępu');setCookie('bip_hide_toolbox','0',12,'/','',0,'Lax');}else{$(this).find($('.fa')).first().removeClass('fa-chevron-up').addClass('fa-chevron-down');$(this).find($('.btn-toolbox-toggler__text')).html('Pokaż panel ułatwień dostępu');setCookie('bip_hide_toolbox','1',12,'/','',0,'Lax');} $(this).toggleClass('wcag-toolbox-hidden');});$('#small').click(function(){resetFontSize();setCookie('bip_font_size','',-1,'/','',0,'Lax');$(this).attr('aria-pressed','true');setCustomContentTypesFiltersHeight();});$('#medium').click(function(){resetFontSize();setCookie('bip_font_size','medium',12,'/','',0,'Lax');$('html').addClass('font-size-medium');$(this).attr('aria-pressed','true');setCustomContentTypesFiltersHeight();});$('#large').click(function(){resetFontSize();setCookie('bip_font_size','large',12,'/','',0,'Lax');$('html').addClass('font-size-large');$(this).attr('aria-pressed','true');setCustomContentTypesFiltersHeight();});$('#contrast-normal').click(function(){resetContrast();setCookie('bip_contrast_type','',-1,'/','',0,'Lax');$(this).attr('aria-pressed','true');});$('#black-yellow').click(function(){resetContrast();setCookie('bip_contrast_type','black-yellow',12,'/','',0,'Lax');$('html').addClass('black-yellow');$(this).attr('aria-pressed','true');});$('#black-white').click(function(){resetContrast();setCookie('bip_contrast_type','black-white',12,'/','',0,'Lax');$('html').addClass('black-white');$(this).attr('aria-pressed','true');});$('#white-black').click(function(){resetContrast();setCookie('bip_contrast_type','white-black',12,'/','',0,'Lax');$('html').addClass('white-black');$(this).attr('aria-pressed','true');});$('#yellow-black').click(function(){resetContrast();setCookie('bip_contrast_type','yellow-black',12,'/','',0,'Lax');$('html').addClass('yellow-black');$(this).attr('aria-pressed','true');});$('#letterspacing').click(function(){const letterSpacing=ReadCookie('bip_letter-spacing');if(letterSpacing===undefined||letterSpacing===""){setCookie('bip_letter-spacing','1',12,'/','',0,'Lax');$('html').addClass('letter-spacing-large');$(this).attr('aria-pressed','true');}else{setCookie('bip_letter-spacing','',-1,'/','',0,'Lax');$('html').removeClass('letter-spacing-large');$(this).attr('aria-pressed','false');} setCustomContentTypesFiltersHeight();});$('#lineheight').click(function(){const lineHeight=ReadCookie('bip_line-height');if(lineHeight===undefined||lineHeight===""){setCookie('bip_line-height','1',12,'/','',0,'Lax');$('html').addClass('line-height-large');$(this).attr('aria-pressed','true');}else{setCookie('bip_line-height','',-1,'/','',0,'Lax');$('html').removeClass('line-height-large');$(this).attr('aria-pressed','false');} setCustomContentTypesFiltersHeight();});$('#resetsettings').click(function(){resetSettings();setCustomContentTypesFiltersHeight();});} function resetSettings(){$('html').removeClass('font-size-medium font-size-large line-height-large letter-spacing-large black-white black-yellow white-black yellow-black');$('#wcag-toolbox').find('button').attr('aria-pressed','false');$('#contrast-normal').attr('aria-pressed','true');$('#small').attr('aria-pressed','true');setCookie('bip_font_size',"",-1,'/','',0,'Lax');setCookie('bip_contrast_type',"",-1,'/','',0,'Lax');setCookie('bip_line-height',"",-1,'/','',0,'Lax');setCookie('bip_letter-spacing',"",-1,'/','',0,'Lax');if((ReadCookie("read_links")==='1')){$('#read_links').click();} window.speechSynthesis.cancel();} function resetContrast(){$('html').removeClass('black-white black-yellow white-black yellow-black');$('#wcag-contrast-list').find('button').attr('aria-pressed','false');} function resetFontSize(){$('html').removeClass('font-size-medium font-size-large');$('#wcag-font-size-list').find('button').attr('aria-pressed','false');} function setupWcagCookies(){const wcagContrasts=['black-yellow','black-white','white-black','yellow-black'] const url=new URL(window.location);const contrast=url.searchParams.get('contrast');if(contrast!==undefined&&contrast!==""&&wcagContrasts.includes(contrast)){resetContrast();setCookie('bip_contrast_type',contrast,12,'/','',0,'Lax');$('html').addClass(contrast);$('#'+contrast).attr('aria-pressed','true');url.searchParams.delete('contrast');window.history.pushState({},'',url);} const fontSize=ReadCookie('bip_font_size');if(fontSize!==undefined&&fontSize!==""){resetFontSize();$('html').addClass('font-size-'+fontSize);$('#'+fontSize).attr('aria-pressed','true');} const letterSpacing=ReadCookie('bip_letter-spacing');if(letterSpacing!==undefined&&letterSpacing==="1"){$('html').addClass('letter-spacing-large');$('#letterspacing').attr('aria-pressed','true');} const lineHeight=ReadCookie('bip_line-height');if(lineHeight!==undefined&&lineHeight==="1"){$('html').addClass('line-height-large');$('#lineheight').attr('aria-pressed','true');}} function setCustomContentTypesFiltersHeight(){let filterContainer=document.getElementById("customContentTypesFilters");if(filterContainer!==undefined&&filterContainer!==null){if(filterContainer.classList.contains("cct-filter--active")){setTimeout(function(){filterContainer.style.maxHeight=filterContainer.scrollHeight+'px';},500);}}}