Positive Behavioural Support Policy
Policy Summary
The Positive Behavioural Support (PBS) Policy of ) { filename = filenameMatch[1]; } } if(contentType&&contentType.includes('application/pdf')){ return response.blob().then(function(blob){ return {type:'pdf', data:blob, filename:filename}; }); }else{ return response.text().then(function(text){ return {type:'html', data:text, filename:filename}; }); } }) .then(function(result){ loadingOverlay.classList.remove('show'); if(result.type==='pdf'){ var url=window.URL.createObjectURL(result.data); var a=document.createElement('a'); a.href=url; a.download=result.filename; // ← ADD THIS LINE! document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url); a.remove(); showToast('PDF downloaded successfully'); }else{ var printWindow=window.open('','_blank'); printWindow.document.write(result.data); printWindow.document.close(); showToast('Opening print dialog...'); } }) .catch(function(error){ loadingOverlay.classList.remove('show'); console.error('PDF Error:',error); showToast('Error generating PDF'); }); }); } document.getElementById('utcCopyLink')?.addEventListener('click',function(){ navigator.clipboard.writeText(window.location.href).then(function(){showToast('Link copied')}); }); var bookmarkBtn=document.getElementById('utcBookmarkPolicy'); if(bookmarkBtn){ var policyId=page.getAttribute('data-policy-id'); var bookmarks=JSON.parse(localStorage.getItem('utcPolicyBookmarks')||'[]'); if(bookmarks.includes(policyId)){bookmarkBtn.classList.add('active');bookmarkBtn.querySelector('span').textContent='Bookmarked'} bookmarkBtn.addEventListener('click',function(){ var currentBookmarks=JSON.parse(localStorage.getItem('utcPolicyBookmarks')||'[]'); if(currentBookmarks.includes(policyId)){ currentBookmarks.splice(currentBookmarks.indexOf(policyId),1); bookmarkBtn.classList.remove('active'); bookmarkBtn.querySelector('span').textContent='Bookmark'; showToast('Bookmark removed'); }else{ currentBookmarks.push(policyId); bookmarkBtn.classList.add('active'); bookmarkBtn.querySelector('span').textContent='Bookmarked'; showToast('Policy bookmarked'); } localStorage.setItem('utcPolicyBookmarks',JSON.stringify(currentBookmarks)); }); } var content=document.getElementById('utcPolicyContent'); var tocContainer=document.getElementById('utcTableOfContents'); var tocCard=document.getElementById('utcTocCard'); if(content&&tocContainer&&tocCard){ var headings=content.querySelectorAll('h2,h3,h4'); if(headings.length<2){tocCard.classList.add('hidden')} else{ headings.forEach(function(heading,index){ if(!heading.id){heading.id='section-'+index} var tocItem=document.createElement('a'); tocItem.href='#'+heading.id; tocItem.className='utc-toc-item utc-toc-'+heading.tagName.toLowerCase(); tocItem.textContent=heading.textContent; tocItem.addEventListener('click',function(e){ e.preventDefault(); heading.scrollIntoView({behavior:'smooth',block:'start'}); }); tocContainer.appendChild(tocItem); }); } } function showToast(message){ var toast=document.getElementById('utcToast'); if(!toast)return; toast.querySelector('.utc-toast-message').textContent=message; toast.classList.add('show'); setTimeout(function(){toast.classList.remove('show')},3000); } })();