Skip to content

Commit 497add5

Browse files
Remove time box entirely on shared read-only page
1 parent 4c28525 commit 497add5

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

grades_dashboard.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,17 @@ body.read-only-mode #logoutBtn {
16621662
display: none !important;
16631663
}
16641664

1665+
body.read-only-mode .data-time-box .time-info,
1666+
body.read-only-mode .data-time-box .time-label,
1667+
body.read-only-mode .data-time-box .time-value,
1668+
body.read-only-mode #updateTime {
1669+
display: none !important;
1670+
}
1671+
1672+
body.read-only-mode .data-time-box {
1673+
gap: 0;
1674+
}
1675+
16651676
body.read-only-mode .header {
16661677
border-bottom: 1px solid var(--color-warning-muted);
1667-
}
1678+
}

grades_dashboard.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,11 +1172,14 @@ async function checkSharedLink() {
11721172
const indicator = document.createElement('div');
11731173
indicator.className = 'share-indicator';
11741174
indicator.innerHTML = '<span style="color: var(--color-warning); font-weight: bold; padding: 4px 8px; border: 1px solid var(--color-warning); border-radius: 4px; font-size: 12px;">僅供檢視 (唯讀)</span>';
1175-
// Insert before data-time-box
1175+
// Insert indicator and remove the whole time box in share/read-only view
11761176
const timeBox = document.querySelector('.data-time-box');
1177-
header.insertBefore(indicator, timeBox);
1178-
1179-
if (updateTime) updateTime.textContent = '分享存檔';
1177+
if (timeBox) {
1178+
header.insertBefore(indicator, timeBox);
1179+
timeBox.remove();
1180+
} else {
1181+
header.appendChild(indicator);
1182+
}
11801183
} else {
11811184
throw new Error(data.error);
11821185
}

0 commit comments

Comments
 (0)