Tonne of updates
This commit is contained in:
@@ -62,9 +62,72 @@
|
||||
|
||||
<link rel="stylesheet" href="../../assets/css/video-player.css">
|
||||
|
||||
<link rel="stylesheet" href="../../assets/css/payment-widgets.css">
|
||||
|
||||
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
// API URL injected from MkDocs config.extra (set by env_config_hook.py)
|
||||
var apiUrl = "http://localhost:4002";
|
||||
if (!apiUrl) return;
|
||||
|
||||
var trackUrl = apiUrl + "/api/docs-analytics/track";
|
||||
|
||||
// Anonymous session UUID (sessionStorage — dies with tab close, no cookies)
|
||||
function getSessionHash() {
|
||||
var key = "__docs_sh";
|
||||
var hash = sessionStorage.getItem(key);
|
||||
if (!hash) {
|
||||
hash = crypto.randomUUID
|
||||
? crypto.randomUUID()
|
||||
: "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
||||
var r = (Math.random() * 16) | 0;
|
||||
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
|
||||
});
|
||||
sessionStorage.setItem(key, hash);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
function trackPageView(path) {
|
||||
var payload = JSON.stringify({
|
||||
path: path,
|
||||
referrer: document.referrer || undefined,
|
||||
sessionHash: getSessionHash(),
|
||||
});
|
||||
|
||||
// Prefer sendBeacon for reliability (works during tab close)
|
||||
if (navigator.sendBeacon) {
|
||||
navigator.sendBeacon(trackUrl, new Blob([payload], { type: "application/json" }));
|
||||
} else {
|
||||
fetch(trackUrl, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: payload,
|
||||
keepalive: true,
|
||||
}).catch(function () {});
|
||||
}
|
||||
}
|
||||
|
||||
// Track initial page load
|
||||
trackPageView(location.pathname);
|
||||
|
||||
// Subscribe to Material's SPA navigation observable (instant loading)
|
||||
if (typeof document$ !== "undefined") {
|
||||
document$.subscribe(function () {
|
||||
trackPageView(location.pathname);
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1840,6 +1903,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1962,6 +2027,8 @@
|
||||
|
||||
<script src="../../assets/js/video-player.js"></script>
|
||||
|
||||
<script src="../../assets/js/payment-widgets.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user