Add tabbed period stats with lightweight charts on instance pages.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -597,29 +597,6 @@ function recomputeJournalRealRr(){
|
||||
}
|
||||
|
||||
|
||||
function switchStatsSegment(){
|
||||
const sel = document.getElementById("stats-segment-select");
|
||||
if(!sel) return;
|
||||
const key = sel.value;
|
||||
document.querySelectorAll(".stats-segment-panel").forEach(p=>{
|
||||
p.style.display = p.getAttribute("data-stats-segment") === key ? "block" : "none";
|
||||
});
|
||||
const q = new URLSearchParams(window.location.search);
|
||||
q.set("stats_segment", key);
|
||||
const qs = q.toString();
|
||||
history.replaceState(null, "", qs ? (window.location.pathname + "?" + qs) : window.location.pathname);
|
||||
}
|
||||
|
||||
function initStatsSegmentFromUrl(){
|
||||
const sel = document.getElementById("stats-segment-select");
|
||||
if(!sel) return;
|
||||
const key = new URLSearchParams(window.location.search).get("stats_segment");
|
||||
if(key && sel.querySelector('option[value="' + key.replace(/"/g, "") + '"]')){
|
||||
sel.value = key;
|
||||
}
|
||||
switchStatsSegment();
|
||||
}
|
||||
|
||||
function toggleStatsCard(){
|
||||
const card = document.getElementById("stats-card");
|
||||
const btn = document.getElementById("stats-toggle-btn");
|
||||
|
||||
Reference in New Issue
Block a user