chore: update to ext and cv page

This commit is contained in:
Andre Henriques 2024-09-29 11:45:53 +01:00
parent aa407f2273
commit 8bb068499b
4 changed files with 132 additions and 49 deletions

View File

@ -3,6 +3,33 @@
});*/
browser.runtime.onMessage.addListener(async (message, sender, sendResponse) => {
if (message.type === "REGISTER_INTEREST") {
let interestList =
(await browser.storage.local.get("interesetWindows"))
.interesetWindows ?? [];
// Already has interest!
if (interestList.includes(sender.tab.id)) {
return;
}
interestList.push(sender.tab.id);
await browser.storage.local.set({
interesetWindows: interestList,
});
return;
}
if (message.type === "GOT_INFO_R") {
// TODO then send this information back to that page
let interestList =
(await browser.storage.local.get("interesetWindows"))
.interesetWindows ?? [];
interestList.forEach((a) => {
browser.tabs.sendMessage(a, message);
});
return;
}
if (message.type !== "MY_GET_URL") return;
let windowList = (await browser.storage.local.get("windows")).windows ?? [];
@ -28,11 +55,10 @@ browser.runtime.onMessage.addListener(async (message, sender, sendResponse) => {
});
});
browser.runtime.onInstalled.addListener(async () => {
console.log(browser);
async function startup() {
await browser.storage.local.set({
windows: [],
interesetWindows: [],
});
// Clear the menus from the prev install
@ -70,4 +96,6 @@ browser.runtime.onInstalled.addListener(async () => {
windows: windowList,
});
});
});
}
browser.runtime.onInstalled.addListener(startup);

View File

@ -1,6 +1,16 @@
browser.runtime.onMessage.addListener(function (message) {
if (message.type === "MY_GET_URL_R") {
window.postMessage(message);
} else if (message.type === "GET_DATA_FROM_PAGE") {
let company = document
.querySelector('header[data-test="job-details-header"]')
.children[0].children[0].querySelector("h4").innerHTML;
let jobTitle = document
.querySelector('header[data-test="job-details-header"]')
.querySelector("h1").innerHTML;
browser.runtime.sendMessage({ type: "GOT_INFO_R", company, jobTitle });
} else if (message.type === "GOT_INFO_R") {
window.postMessage(message);
}
});
@ -10,10 +20,7 @@ window.addEventListener("message", function (e) {
} else if (e.data.type === "HAS_EXTENSION_Q") {
console.log("Got request for ext");
window.postMessage({ type: "HAS_EXTENSION" });
} else if (e.data.type === "GET_DATA_FROM_PAGE") {
console.log(
document.querySelector('header[data-test="job-details-header"]'),
);
} else if (e.data.type === "REGISTER_INTEREST") {
browser.runtime.sendMessage({ type: "REGISTER_INTEREST" });
}
//console.log("here2", e);
});

View File

@ -22,30 +22,38 @@
<div class="flex items-center w-full flex-col">
<div class="max-w-[210mm] px-5 py-16">
<div class="w-full flex">
<h1 class="dark:text-white text-black text-5xl">Andre Henriques</h1>
<div class="flex-grow"></div>
<div class="text-right">
<ul>
<li class="px-1">
<a class="text-white underline" href="mailto:contact@andr3h3nriqu3s.com"
>contact@andr3h3nriqu3s.com</a
>
</li>
<li class="px-1">
<a class="text-white underline" href="tel:+4407823391342">+44 0 782339 1342</a>
</li>
</ul>
<div class="bg-white rounded-lg p-3">
<div class="w-full flex">
<h1 class="dark:text-white text-black text-5xl">Andre Henriques</h1>
<div class="flex-grow"></div>
<div class="text-right">
<ul>
<li class="px-1">
<a class="underline" href="mailto:contact@andr3h3nriqu3s.com"
>contact@andr3h3nriqu3s.com</a
>
</li>
<li class="px-1">
<a class="underline" href="tel:+4407823391342"
>+44 0 782339 1342</a
>
</li>
</ul>
</div>
</div>
</div>
<div class="p-5"></div>
<div class="w-full flex py-10">
<div class="text-white">
I am a dedicated and versatile programmer with for year of professional experience. <br />
During those years mainly worked with Typescript, JavaScript, React, Svelte. <br />
I thrive in high paced new environments, and I am always striving to learn new skills and technologies.
<br />
I also am knowable in various other technologies and am always learning new ones. <br />
<div class="p-5"></div>
<div class="w-full flex py-10">
<div>
I am a dedicated and versatile programmer with four years of professional
experience. <br />
During those years mainly worked with Typescript, JavaScript, React, Svelte.
<br />
I thrive in high paced new environments, and I am always striving to learn new skills
and technologies.
<br />
I also am knowable in various other technologies and am always learning new ones.
<br />
</div>
</div>
</div>
{#if application}
@ -53,11 +61,11 @@
<div>TODO: Application Information</div>
{/if}
<div class="p-5"></div>
<div class="dark:text-white text-black">
<h2 class="py-2 text-3xl">Work Expericence</h2>
<div class="text-black bg-white p-4 rounded-lg">
<h2 class="pb-2 text-3xl">Work Expericence</h2>
<div>
<div>
<h1>Planum Solucoes, Lda</h1>
<h1>Senior Software Developer @ Planum Solucoes</h1>
<div class="ml-5">
<h2>4 year - May 2020 - Present</h2>
<h3>Working with:</h3>
@ -72,19 +80,20 @@
<ul class="pl-5 list-disc">
<li>Developed web-based tools for the DevOps team to use</li>
<li>
Updated Jenkins pipelines that the team uses to manage one of the most important
pipelines that the team manages.
Updated Jenkins pipelines that the team uses to manage one of the
most important pipelines that the team manages.
</li>
<li>
Created new scripts that were used to clean up multiple terabytes of unused data
that led to improvements in the performance of the other scripts running on the same
server as well as the performance of the backup system
Created new scripts that were used to clean up multiple terabytes of
unused data that led to improvements in the performance of the other
scripts running on the same server as well as the performance of the
backup system
</li>
</ul>
</div>
</div>
<div>
<h1>Sky UK</h1>
<h1>Associate Devops Engineer @ Sky UK</h1>
<div class="ml-5">
<h2>1 year - July 2022 - June 2023</h2>
<h3>Working with:</h3>
@ -99,13 +108,14 @@
<ul class="pl-5 list-disc">
<li>Developed web-based tools for the DevOps team to use</li>
<li>
Updated Jenkins pipelines that the team uses to manage one of the most important
pipelines that the team manages.
Updated Jenkins pipelines that the team uses to manage one of the
most important pipelines that the team manages.
</li>
<li>
Created new scripts that were used to clean up multiple terabytes of unused data
that led to improvements in the performance of the other scripts running on the same
server as well as the performance of the backup system
Created new scripts that were used to clean up multiple terabytes of
unused data that led to improvements in the performance of the other
scripts running on the same server as well as the performance of the
backup system
</li>
</ul>
</div>
@ -113,8 +123,8 @@
</div>
</div>
<div class="p-5"></div>
<div class="dark:text-white text-black">
<h2 class="py-2 text-3xl">Education</h2>
<div class="bg-white p-3 text-black rounded-lg">
<h2 class="pb-2 text-3xl">Education</h2>
<div>
<div>
<h1>University of Surrey</h1>

View File

@ -20,6 +20,8 @@
let preparingToDrop = $state(false);
let lastExtData: any = $state(undefined);
async function activate(item?: Application) {
if (!item) {
return;
@ -58,6 +60,8 @@
console.log('info data', e);
}
applicationStore.loadApplications(true);
lastExtData = undefined;
}
function openWindow(url: string) {
@ -84,6 +88,32 @@
}
}
// Load Ext
$effect(() => {
function onMessage(e: MessageEvent) {
if (e.data.type === 'GOT_INFO_R') {
lastExtData = e.data;
}
}
console.log('setting up interest');
window.addEventListener('message', onMessage);
window.postMessage({ type: 'REGISTER_INTEREST' });
return () => {
window.removeEventListener('message', onMessage);
};
});
function setExtData() {
if (!lastExtData || !activeItem) return;
activeItem.title = `${lastExtData.company} - ${lastExtData.jobTitle}`;
window.requestAnimationFrame(() => {
save();
lastExtData = undefined;
});
}
onMount(() => {
userStore.checkLogin();
loadActive();
@ -103,6 +133,7 @@
return;
}
applicationStore.loadApplications(true);
applicationStore.loadAplyed(true);
activeItem = undefined;
//openedWindow?.close();
//openedWindow = undefined;
@ -240,6 +271,9 @@
<button class="btn-primary" onclick={() => extractTokens.showModal()}>
Extract Flair
</button>
{#if lastExtData !== undefined}
<button class="btn-primary" onclick={() => setExtData()}> Ext Data </button>
{/if}
{#if activeItem.original_url == null}
<button class="btn-primary" onclick={() => changeUrl.showModal()}> Update Url </button>
{/if}
@ -275,7 +309,11 @@
ondragover={preventDefault(() => {})}
ondragenter={preventDefault(() => {})}
ondrop={() => {
moveStatus(ApplicationStatus.Expired);
if (activeItem && activeItem.status === ApplicationStatus.Expired) {
moveStatus(ApplicationStatus.ToApply);
} else {
moveStatus(ApplicationStatus.Expired);
}
}}
>
<span