UNPKG

@transcend-io/consent-manager-ui

Version:
68 lines (61 loc) 1.95 kB
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>Transcend Consent Manager Playground</title> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!-- <link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css" /> --> <link rel="stylesheet" href="../../build/playground.css" /> <!-- Stub transcendInit --> <script> if (!self.transcend) { /** * Check for loadOptions in local storage, and inject onto transcendInit * This is before ui.js so we make sure to load our options before initializing the ui */ let loadOptions = {}; const loadOptionsInStorage = localStorage.getItem('loadOptions'); if (loadOptionsInStorage) { try { loadOptions = JSON.parse(loadOptionsInStorage); } catch (err) {} } const stub = { consentManagerConfig: loadOptions, readyQueue: [], ready(callback) { this.readyQueue.push(callback); }, ...self.transcend, }; self.transcend = stub; } </script> <!-- Stub airgapInit --> <script> if (!self.airgap) { self.airgap = { readyQueue: [], ready(callback) { this.readyQueue.push(callback); }, ...self.airgap, }; } </script> </head> <body style="height: 100%"> <!-- App injection div --> <main> <div id="playground"></div> </main> <!-- Start Consent Manager UI --> <script src="../../build/ui.js"></script> <!-- Set up playground, stub airgap API --> <script src="../../build/playground.js"></script> <!-- Flush readyQueue (make airgap.js ready) --> <script> self.airgap.readyQueue.forEach((callback) => callback(self.airgap)); </script> </body> </html>