Skip to content
This repository was archived by the owner on Aug 21, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ai-maintenance-manual.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AI Site Maintenance (manual)
name: AI Site Maintenance (manual)
on:
workflow_dispatch:

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ai-maintenance-run.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
on:
push:
branches: [ main ]
on:
workflow_dispatch:

permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ai-maintenance-v3.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AI Site Maintenance (v3, manual)
name: AI Site Maintenance (v3, manual)
on:
workflow_dispatch:

Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ai-maintenance.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: AI Site Maintenance
name: AI Site Maintenance
on:
schedule:
- cron: "17 2 * * *"
workflow_dispatch: {}
workflow_dispatch:

permissions:
contents: write
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ai-ops.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: AI Ops Issue to PR
name: AI Ops Issue to PR
on:
issues:
types: [opened, edited, labeled]
workflow_dispatch:

permissions:
contents: write
Expand Down
3 changes: 3 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
Last updated: {{ page.last_updated }}
</p>
{% endif %}
<script src="{{ '/assets/gpt5.js' | relative_url }}?v=3" defer></script>
<script src="{{ '/assets/gpt5-actions.js' | relative_url }}?v=2" defer></script> <!-- if you kept the AI Summary card -->
<script src="{{ '/assets/gpt5-select.js' | relative_url }}?v=1" defer></script>

</main>
{% include footer.html %}
Expand Down
4 changes: 4 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1634,3 +1634,7 @@ textarea { resize:vertical; }
font-size: 0.95rem;
color: #333;
}
/* Optional polish for selection summarize UI */
#gpt5-sel-btn { transition: transform .06s ease; }
#gpt5-sel-btn:active { transform: scale(.98); }
#gpt5-sel-panel { backdrop-filter: saturate(1.2); }
81 changes: 81 additions & 0 deletions assets/gpt5-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// ES5-safe helpers that use window.gpt5 (from /assets/gpt5.js)
(function () {
if (!window.gpt5) {
console.error("gpt5 helper not found. Include /assets/gpt5.js first.");
return;
}

function $(id) { return document.getElementById(id); }

function textFromPage() {
var el =
document.querySelector("main") ||
document.querySelector("article") ||
document.querySelector(".content") ||
document.querySelector(".post-content") ||
document.getElementById("content") ||
document.body;
var t = el && (el.innerText || el.textContent) || "";
t = (t || "").replace(/\s+/g, " ").trim();
if (t.length > 6000) t = t.slice(0, 6000); // keep the demo snappy
return t;
}

function setBtn(disabled, label) {
var b = $("ai-summary-btn");
if (b) {
b.disabled = !!disabled;
if (label != null) b.textContent = label;
}
}
document.addEventListener("DOMContentLoaded", function () {
var btn = document.getElementById("ai-summary-btn");
var stop = document.getElementById("ai-summary-stop");
var out = document.getElementById("ai-summary");
if (!btn || !out || !stop) return;

function setBtn(disabled, label) {
btn.disabled = !!disabled;
if (label != null) btn.textContent = label;
}

stop.addEventListener("click", function () {
try { gpt5.abort(); } catch (e) {}
setBtn(false, "AI Summary");
});

btn.addEventListener("click", function () {
var el =
document.querySelector("main") ||
document.querySelector("article") ||
document.querySelector(".content") ||
document.querySelector(".post-content") ||
document.getElementById("content") ||
document.body;
var content = el && (el.innerText || el.textContent) || "";
content = (content || "").replace(/\s+/g, " ").trim();
if (content.length > 6000) content = content.slice(0, 6000);

if (!content) {
out.textContent = "Sorry—no readable content found on this page.";
return;
}

out.textContent = "Thinking…";
setBtn(true, "Summarizing…");
var full = "";

gpt5.stream({
system: "You are LLbot for OraDigit.com. Summarize for executives and prospects. 5–7 bullet points. Clear, concrete, jargon-light.",
messages: [{ role: "user", content: "Summarize this page for a prospective client:\n\n" + content }],
onToken: function (t) { full += t; out.textContent = full; }
})
.then(function () { setBtn(false, "AI Summary"); })
.catch(function (e) {
out.textContent = "Error: " + (e && e.message ? e.message : e);
setBtn(false, "AI Summary");
});
});
});


204 changes: 204 additions & 0 deletions assets/gpt5-select.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
// Highlight-to-Summarize for OraDigit (ES5-safe)
// Requires window.gpt5 from /assets/gpt5.js
(function () {
if (!window.gpt5) { console.warn("gpt5.js not loaded."); return; }

var BTN_ID = "gpt5-sel-btn";
var PANEL_ID = "gpt5-sel-panel";
var OUT_ID = "gpt5-sel-out";
var STOP_ID = "gpt5-sel-stop";
var CLOSE_ID = "gpt5-sel-close";
var inProgress = false;

function ensureBtn() {
var b = document.getElementById(BTN_ID);
if (b) return b;
b = document.createElement("button");
b.id = BTN_ID;
b.type = "button";
b.textContent = "Summarize";
b.setAttribute("aria-label", "Summarize selection with AI");
b.style.position = "fixed";
b.style.display = "none";
b.style.zIndex = "2147483647";
b.style.padding = "6px 10px";
b.style.borderRadius = "9999px";
b.style.border = "1px solid #d1d5db";
b.style.background = "#111";
b.style.color = "#fff";
b.style.font = "14px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial";
b.style.boxShadow = "0 2px 8px rgba(0,0,0,.15)";
b.onkeydown = function (e) {
if (e.key === "Escape") hideBtn();
};
document.body.appendChild(b);
return b;
}

function ensurePanel() {
var p = document.getElementById(PANEL_ID);
if (p) return p;

p = document.createElement("div");
p.id = PANEL_ID;
p.style.position = "fixed";
p.style.right = "16px";
p.style.bottom = "16px";
p.style.maxWidth = "520px";
p.style.width = "min(92vw,520px)";
p.style.maxHeight = "60vh";
p.style.overflow = "auto";
p.style.background = "#fff";
p.style.border = "1px solid #e5e7eb";
p.style.borderRadius = "12px";
p.style.boxShadow = "0 10px 30px rgba(0,0,0,.12)";
p.style.padding = "12px";
p.style.font = "14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Arial";
p.style.color = "#111";
p.style.zIndex = "2147483647";

var row = document.createElement("div");
row.style.display = "flex";
row.style.alignItems = "center";
row.style.gap = "8px";
row.style.marginBottom = "8px";

var h = document.createElement("div");
h.textContent = "AI Summary";
h.style.fontWeight = "600";
h.style.flex = "1";

var stop = document.createElement("button");
stop.id = STOP_ID;
stop.type = "button";
stop.textContent = "Stop";
stop.style.padding = "6px 10px";
stop.style.border = "1px solid #d1d5db";
stop.style.borderRadius = "8px";
stop.style.background = "#fff";
stop.onclick = function () {
try { window.gpt5.abort(); } catch (e) {}
inProgress = false;
};

var close = document.createElement("button");
close.id = CLOSE_ID;
close.type = "button";
close.textContent = "Close";
close.style.padding = "6px 10px";
close.style.border = "1px solid #d1d5db";
close.style.borderRadius = "8px";
close.style.background = "#fff";
close.onclick = function () { p.remove(); };

row.appendChild(h);
row.appendChild(stop);
row.appendChild(close);

var out = document.createElement("div");
out.id = OUT_ID;
out.setAttribute("aria-live", "polite");
out.style.whiteSpace = "pre-wrap";

p.appendChild(row);
p.appendChild(out);
document.body.appendChild(p);
return p;
}

function getSelectionText() {
var sel = window.getSelection && window.getSelection();
if (!sel || sel.isCollapsed) return "";
var s = sel.toString() || "";
s = s.replace(/\s+/g, " ").trim();
if (s.length > 6000) s = s.slice(0, 6000);
return s;
}

function showBtnNearSelection() {
var btn = ensureBtn();
var sel = window.getSelection && window.getSelection();
if (!sel || sel.isCollapsed) { hideBtn(); return; }
if (!sel.rangeCount) { hideBtn(); return; }
var r = sel.getRangeAt(0);
var rect = r.getBoundingClientRect();
if (!rect || (!rect.width && !rect.height)) { hideBtn(); return; }

// Only show for reasonable lengths
var text = getSelectionText();
if (text.length < 20) { hideBtn(); return; }

var x = rect.right + window.scrollX - btn.offsetWidth - 4;
var y = rect.top + window.scrollY - 36;
if (x < 8) x = 8;
if (y < 8) y = rect.bottom + window.scrollY + 8;

btn.style.left = x + "px";
btn.style.top = y + "px";
btn.style.display = "inline-block";
}

function hideBtn() {
var b = document.getElementById(BTN_ID);
if (b) b.style.display = "none";
}

function summarize(text) {
var panel = ensurePanel();
var out = document.getElementById(OUT_ID);
var stop = document.getElementById(STOP_ID);
var btn = document.getElementById(BTN_ID);
if (!out) return;

out.textContent = "Thinking…";
inProgress = true;
if (btn) btn.disabled = true;
if (stop) stop.disabled = false;

var full = "";
window.gpt5.stream({
system: "You are LLbot for OraDigit.com. Summarize clearly for business stakeholders in 5–7 short bullets.",
messages: [{ role: "user", content: "Summarize this selection:\n\n" + text }],
onToken: function (t) { full += t; out.textContent = full; }
})
.then(function () {
inProgress = false;
if (btn) btn.disabled = false;
if (stop) stop.disabled = true;
})
.catch(function (e) {
inProgress = false;
if (btn) btn.disabled = false;
if (stop) stop.disabled = true;
out.textContent = "Error: " + (e && e.message ? e.message : e);
});
}

// Button click handler
document.addEventListener("click", function (e) {
var btn = document.getElementById(BTN_ID);
if (btn && e.target === btn) {
var text = getSelectionText();
hideBtn();
if (text) summarize(text);
}
});

// Show button when user selects text (mouseup / keyup)
document.addEventListener("mouseup", function () { setTimeout(showBtnNearSelection, 0); });
document.addEventListener("keyup", function (e) {
if (e.key === "Escape") hideBtn();
else setTimeout(showBtnNearSelection, 0);
});

// Optional hotkey: Alt+S to summarize current selection
document.addEventListener("keydown", function (e) {
if (e.altKey && (e.key === "s" || e.key === "S")) {
var t = getSelectionText();
if (t) summarize(t);
}
});

// Hide on scroll (optional)
window.addEventListener("scroll", function () { hideBtn(); }, { passive: true });
})();
Loading