3D viewer overhaul: full-bleed + responsive, Web Worker STEP parse, progress bar, caption stats, inline models in text notes, STL fix, app widget; weekday dates (dateText); fix shields badge escaping; docs + licenses
This commit is contained in:
+13
-3
@@ -114,10 +114,19 @@ function run() {
|
||||
}
|
||||
}
|
||||
|
||||
const WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
||||
function dateText(raw) {
|
||||
const iso = String(raw || "").slice(0, 10);
|
||||
if (!iso) return "";
|
||||
const d = new Date(iso);
|
||||
if (isNaN(d)) return iso;
|
||||
return WEEKDAYS[d.getUTCDay()] + " " + iso;
|
||||
}
|
||||
|
||||
function renderArticles(list) {
|
||||
const lines = [];
|
||||
for (const a of list) {
|
||||
const date = (a.getLabelValue("date") || a.dateCreated).slice(0, 10);
|
||||
const date = dateText(a.getLabelValue("date") || a.dateCreated);
|
||||
const cat = a.getLabelValue("category") || "";
|
||||
const summary = a.getLabelValue("summary") || "";
|
||||
const link = `${SHARE_BASE}/${encodeURIComponent(a.getLabelValue("shareAlias") || a.noteId)}`;
|
||||
@@ -184,7 +193,7 @@ function run() {
|
||||
const link = SHARE_BASE + "/" + encodeURIComponent(a.getLabelValue("shareAlias") || a.noteId);
|
||||
const type = a.type || "text";
|
||||
const state = a.getLabelValue("state") || "";
|
||||
const date = (a.getLabelValue("date") || a.dateCreated).slice(0, 10);
|
||||
const date = dateText(a.getLabelValue("date") || a.dateCreated);
|
||||
html += `<tr><td><a href="${escapeHtml(link)}">${escapeHtml(a.title)}</a></td><td><span class="note-type">${escapeHtml(type)}</span></td><td>${state ? `<span class="note-state ${stateClass(state)}"><i class="${stateIcon(state)}"></i>${escapeHtml(state)}</span>` : ""}</td><td>${escapeHtml(date)}</td></tr>`;
|
||||
}
|
||||
html += '</tbody></table>';
|
||||
@@ -395,7 +404,8 @@ function run() {
|
||||
summary: a.getLabelValue("summary") || "",
|
||||
tags: tagList(a),
|
||||
category: a.getLabelValue("category") || "",
|
||||
date: (a.getLabelValue("date") || a.dateCreated).slice(0, 10)
|
||||
date: (a.getLabelValue("date") || a.dateCreated).slice(0, 10),
|
||||
dateText: dateText(a.getLabelValue("date") || a.dateCreated)
|
||||
}));
|
||||
const html = `<script>window.blogData = ${JSON.stringify({ articles: list })};</script>`;
|
||||
if (dataNote.getContent() !== html) {
|
||||
|
||||
Reference in New Issue
Block a user