Auto-deploy: 2026-09-17 20:03:51
This commit is contained in:
+12
-26
@@ -751,7 +751,7 @@
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
pane.innerHTML = `<div class="lja-error">❌ ${err.message}</div>`;
|
||||
pane.textContent = '❌ ' + err.message;
|
||||
} finally {
|
||||
loading.style.display = 'none';
|
||||
analyzeBtn.disabled = false;
|
||||
@@ -761,6 +761,10 @@
|
||||
|
||||
// ─── Markdown Renderer ───────────────────────────────────────────────────
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function renderMarkdown(text) {
|
||||
try {
|
||||
const startIdx = text.indexOf('{');
|
||||
@@ -770,11 +774,11 @@
|
||||
let html = '<div style="display:flex;flex-direction:column;gap:10px;">';
|
||||
const entries = Object.entries(parsed);
|
||||
entries.forEach(([q, a], idx) => {
|
||||
const safeAnswer = String(a).replace(/"/g, '"').replace(/'/g, ''');
|
||||
const safeAnswer = escapeHtml(a);
|
||||
html += `<div style="background: rgba(255,255,255,0.06); padding: 10px 12px; border-radius: 8px; border-left: 3px solid #6c63ff;">
|
||||
<div style="font-weight: 600; font-size: 12px; color: #aaa; margin-bottom: 4px;">❓ ${q}</div>
|
||||
<div style="font-weight: 600; font-size: 12px; color: #aaa; margin-bottom: 4px;">❓ ${escapeHtml(q)}</div>
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<div style="color: #4caf50; font-size: 14px; font-weight: 500; flex: 1;" id="lja-qa-answer-${idx}">💡 ${a}</div>
|
||||
<div style="color: #4caf50; font-size: 14px; font-weight: 500; flex: 1;" id="lja-qa-answer-${idx}">💡 ${escapeHtml(a)}</div>
|
||||
<button class="lja-qa-copy-btn" data-answer="${safeAnswer}" style="background: rgba(108,99,255,0.2); border: none; border-radius: 4px; padding: 4px 8px; cursor: pointer; color: #b0b0ff; font-size: 14px; flex-shrink: 0;" title="Copy answer">📋</button>
|
||||
</div>
|
||||
</div>`;
|
||||
@@ -886,29 +890,11 @@
|
||||
|
||||
// ─── Utilities ───────────────────────────────────────────────────────────
|
||||
|
||||
// Markers that identify a profile saved before the CV was rewritten around
|
||||
// the Senior Mobile Architect positioning. A profile containing any of these
|
||||
// is describing a person who no longer matches the master CV, so every prompt
|
||||
// built from it would contradict the PDF that actually gets sent.
|
||||
const STALE_PROFILE_MARKERS = [
|
||||
'CTO & Technical Architect',
|
||||
'Senior Backend Engineer & Systems Architect',
|
||||
'IntaleqMaps',
|
||||
'hamzaayed.dev@gmail.com'
|
||||
];
|
||||
|
||||
function isStaleProfile(text) {
|
||||
if (!text) return true;
|
||||
return STALE_PROFILE_MARKERS.some(marker => text.includes(marker));
|
||||
}
|
||||
|
||||
function getSettings() {
|
||||
return new Promise(resolve => {
|
||||
chrome.storage.sync.get(['apiKey', 'userProfile', 'language'], (data) => {
|
||||
if (isStaleProfile(data.userProfile) && typeof renderProfileText === 'function') {
|
||||
console.warn('[LJA] Stored profile is out of date with the master CV — migrating to profile_data.js.');
|
||||
if (!data.userProfile && typeof renderProfileText === 'function') {
|
||||
data.userProfile = renderProfileText();
|
||||
chrome.storage.sync.set({ userProfile: data.userProfile });
|
||||
}
|
||||
resolve(data);
|
||||
});
|
||||
@@ -1084,13 +1070,13 @@
|
||||
`;
|
||||
if (res.verdict === 'YES') {
|
||||
badge.style.background = 'linear-gradient(135deg, #00d67e, #00a65e)';
|
||||
badge.innerHTML = `✅ MATCH: ${res.reason}`;
|
||||
badge.textContent = `✅ MATCH: ${res.reason}`;
|
||||
} else if (res.verdict === 'NO') {
|
||||
badge.style.background = 'linear-gradient(135deg, #ff4d6d, #d90429)';
|
||||
badge.innerHTML = `❌ SKIP: ${res.reason}`;
|
||||
badge.textContent = `❌ SKIP: ${res.reason}`;
|
||||
} else {
|
||||
badge.style.background = 'linear-gradient(135deg, #ffb347, #ff9200)';
|
||||
badge.innerHTML = `⚠️ MAYBE: ${res.reason}`;
|
||||
badge.textContent = `⚠️ MAYBE: ${res.reason}`;
|
||||
}
|
||||
|
||||
const contentContainer = jobItem.element.querySelector('.artdeco-entity-lockup__content');
|
||||
|
||||
Reference in New Issue
Block a user