Auto-deploy: 2026-05-17 23:17:07
This commit is contained in:
25
content.js
25
content.js
@@ -638,6 +638,17 @@
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Attach inline copy button listeners
|
||||
if (tab === 'qa') {
|
||||
pane.querySelectorAll('.lja-qa-copy-btn').forEach(btn => {
|
||||
btn.addEventListener('click', function() {
|
||||
navigator.clipboard.writeText(this.getAttribute('data-answer'));
|
||||
this.textContent = '✅';
|
||||
setTimeout(() => this.textContent = '📋', 1200);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
copyBtn.style.display = 'block';
|
||||
|
||||
// Show auto-fill button for Q&A tab
|
||||
@@ -810,12 +821,7 @@ Brief honest assessment of this opportunity for my profile`
|
||||
<div style="font-weight: 600; font-size: 12px; color: #aaa; margin-bottom: 4px;">❓ ${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>
|
||||
<button onclick="
|
||||
const text = document.getElementById('lja-qa-answer-${idx}').textContent.replace('💡 ', '');
|
||||
navigator.clipboard.writeText(text);
|
||||
this.textContent = '✅';
|
||||
setTimeout(() => this.textContent = '📋', 1200);
|
||||
" 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>
|
||||
<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>`;
|
||||
});
|
||||
@@ -1056,7 +1062,12 @@ Brief honest assessment of this opportunity for my profile`
|
||||
|
||||
let results;
|
||||
try {
|
||||
results = JSON.parse(resultText);
|
||||
const match = resultText.match(/\[[\s\S]*\]/);
|
||||
if (match) {
|
||||
results = JSON.parse(match[0]);
|
||||
} else {
|
||||
results = JSON.parse(resultText);
|
||||
}
|
||||
} catch(e) {
|
||||
console.error(resultText);
|
||||
throw new Error('Failed to parse AI response');
|
||||
|
||||
14
prompts.js
14
prompts.js
@@ -2,10 +2,8 @@
|
||||
// LANGUAGE RULES: Analysis = match job language. Everything else = ENGLISH ALWAYS.
|
||||
|
||||
function buildPromptV2(tab, job, userProfile, language) {
|
||||
// Only analysis follows job language; rest is always English
|
||||
const analysisLang = language === 'arabic' ? 'Respond entirely in Arabic.'
|
||||
: language === 'english' ? 'Respond entirely in English.'
|
||||
: 'Respond in the same language as the job posting.';
|
||||
// Force Arabic for the analysis tab to ensure full comprehension
|
||||
const analysisLang = 'Respond ENTIRELY in Arabic. All headings, explanations, and bullets MUST be in Arabic. and RTL';
|
||||
|
||||
const ctx = [
|
||||
'Job Title: ' + (job.jobTitle || 'Not specified'),
|
||||
@@ -113,7 +111,7 @@ Respond EXACTLY:
|
||||
## NEW BULLET POINTS TO ADD
|
||||
- [2-3 new achievement bullets ready to paste into CV — in English]`;
|
||||
|
||||
const dynamicQuestions = job.questions && job.questions.length > 0
|
||||
const dynamicQuestions = job.questions && job.questions.length > 0
|
||||
? job.questions.map((q, i) => `${i + 1}. "${q.question}" [type: ${q.type}]`).join('\n')
|
||||
: '1. "Why are you interested in this role?" [type: text]\n2. "What is your relevant experience?" [type: text]\n3. "What are your salary expectations?" [type: text]\n4. "When can you start?" [type: text]\n5. "Do you require visa sponsorship?" [type: text]';
|
||||
|
||||
@@ -139,10 +137,10 @@ ${ctx}
|
||||
QUESTIONS TO ANSWER:
|
||||
${dynamicQuestions}
|
||||
|
||||
RESPOND WITH ONLY THIS FORMAT (raw JSON, no wrapping):
|
||||
RESPOND WITH ONLY THIS FORMAT (raw JSON, no wrapping, answering ONLY the questions listed above):
|
||||
{
|
||||
"exact question text here": "concise answer",
|
||||
"another question": "answer"
|
||||
"question 1 text here": "concise answer",
|
||||
"question 2 text here": "concise answer"
|
||||
}`;
|
||||
|
||||
P.benefits = `You are a career analyst specializing in tech compensation in MENA.
|
||||
|
||||
Reference in New Issue
Block a user