Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Production NV cookie banner #387

Open
exactlyallan opened this issue Jul 15, 2024 · 0 comments
Open

Add Production NV cookie banner #387

exactlyallan opened this issue Jul 15, 2024 · 0 comments
Assignees
Labels
1 - On Deck To be worked on next

Comments

@exactlyallan
Copy link
Member

Add this script to header for production:

<!-- OneTrust Cookies Consent Notice start for rapids.ai -->
<script src=""https://cdn.cookielaw.org/scripttemplates/otSDKStub.js"" data-document-language=""true"" type=""text/javascript"" charset=""UTF-8"" data-domain-script=""018e2d71-40f3-7e89-90b8-e10ec6012ab0"" ></script>
<script type=""text/javascript"">
function OptanonWrapper() { }
</script>
<!-- OneTrust Cookies Consent Notice end for rapids.ai -->
<!-- OneTrust gpc signal detection script start -->
<script type=""text/javascript"">   
(function() {
    ""use strict"";    
        const observer = new MutationObserver(function (mutations, mutationInstance) {                
                const otPreferencePanel = document.getElementById('onetrust-pc-sdk');                        
                if(otPreferencePanel) {        
                const otBanner = document.getElementById('onetrust-banner-sdk');         
                if (otBanner && navigator.globalPrivacyControl) {
                        setNvDone();
                }
        mutationInstance.disconnect();
        }
        });
        observer.observe(document, {
                childList: true,
                subtree: true
        });
         
        const setNvDone = function () {
                        // Hide elements by their IDs
                        var acceptbtn = document.getElementById('onetrust-accept-btn-handler');
                        var rejectbtn = document.getElementById('onetrust-reject-all-handler');
                        if(acceptbtn){
                                acceptbtn.style.display = 'none';
                        }
                        if(rejectbtn){
                                rejectbtn.style.display = 'none';
                        }
                        const doneButton = document.createElement('button');
                        doneButton.id = 'nv-done-btn-handler';
                        doneButton.textContent = 'Done';

                        document.getElementById('onetrust-button-group').appendChild(doneButton);

                        // Add click event listener to the new button
                        doneButton.addEventListener('click', function () {
                                OneTrust.Close();
                        });
                };
})();

</script>
<!-- OneTrust gpc signal detection script end -->
@exactlyallan exactlyallan added the 1 - On Deck To be worked on next label Jul 15, 2024
@exactlyallan exactlyallan self-assigned this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - On Deck To be worked on next
Projects
None yet
Development

No branches or pull requests

1 participant