Skip to content

Commit

Permalink
Merge pull request #4 from MichaelWoodc/degree-required-integrated
Browse files Browse the repository at this point in the history
Degree required integrated
  • Loading branch information
MichaelWoodc authored Oct 29, 2024
2 parents ef63386 + 54e2ba0 commit 7898743
Show file tree
Hide file tree
Showing 27 changed files with 229,768 additions and 2,020 deletions.
52 changes: 52 additions & 0 deletions CUUR0000SA0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
+-------------+------+--------+---------+-----------+
| series id | year | period | value | footnotes |
+-------------+------+--------+---------+-----------+
| CUUR0000SA0 | 2014 | M12 | 234.812 | |
| CUUR0000SA0 | 2014 | M11 | 236.151 | |
| CUUR0000SA0 | 2014 | M10 | 237.433 | |
| CUUR0000SA0 | 2014 | M09 | 238.031 | |
| CUUR0000SA0 | 2014 | M08 | 237.852 | |
| CUUR0000SA0 | 2014 | M07 | 238.250 | |
| CUUR0000SA0 | 2014 | M06 | 238.343 | |
| CUUR0000SA0 | 2014 | M05 | 237.900 | |
| CUUR0000SA0 | 2014 | M04 | 237.072 | |
| CUUR0000SA0 | 2014 | M03 | 236.293 | |
| CUUR0000SA0 | 2014 | M02 | 234.781 | |
| CUUR0000SA0 | 2014 | M01 | 233.916 | |
| CUUR0000SA0 | 2013 | M12 | 233.049 | |
| CUUR0000SA0 | 2013 | M11 | 233.069 | |
| CUUR0000SA0 | 2013 | M10 | 233.546 | |
| CUUR0000SA0 | 2013 | M09 | 234.149 | |
| CUUR0000SA0 | 2013 | M08 | 233.877 | |
| CUUR0000SA0 | 2013 | M07 | 233.596 | |
| CUUR0000SA0 | 2013 | M06 | 233.504 | |
| CUUR0000SA0 | 2013 | M05 | 232.945 | |
| CUUR0000SA0 | 2013 | M04 | 232.531 | |
| CUUR0000SA0 | 2013 | M03 | 232.773 | |
| CUUR0000SA0 | 2013 | M02 | 232.166 | |
| CUUR0000SA0 | 2013 | M01 | 230.280 | |
| CUUR0000SA0 | 2012 | M12 | 229.601 | |
| CUUR0000SA0 | 2012 | M11 | 230.221 | |
| CUUR0000SA0 | 2012 | M10 | 231.317 | |
| CUUR0000SA0 | 2012 | M09 | 231.407 | |
| CUUR0000SA0 | 2012 | M08 | 230.379 | |
| CUUR0000SA0 | 2012 | M07 | 229.104 | |
| CUUR0000SA0 | 2012 | M06 | 229.478 | |
| CUUR0000SA0 | 2012 | M05 | 229.815 | |
| CUUR0000SA0 | 2012 | M04 | 230.085 | |
| CUUR0000SA0 | 2012 | M03 | 229.392 | |
| CUUR0000SA0 | 2012 | M02 | 227.663 | |
| CUUR0000SA0 | 2012 | M01 | 226.665 | |
| CUUR0000SA0 | 2011 | M12 | 225.672 | |
| CUUR0000SA0 | 2011 | M11 | 226.230 | |
| CUUR0000SA0 | 2011 | M10 | 226.421 | |
| CUUR0000SA0 | 2011 | M09 | 226.889 | |
| CUUR0000SA0 | 2011 | M08 | 226.545 | |
| CUUR0000SA0 | 2011 | M07 | 225.922 | |
| CUUR0000SA0 | 2011 | M06 | 225.722 | |
| CUUR0000SA0 | 2011 | M05 | 225.964 | |
| CUUR0000SA0 | 2011 | M04 | 224.906 | |
| CUUR0000SA0 | 2011 | M03 | 223.467 | |
| CUUR0000SA0 | 2011 | M02 | 221.309 | |
| CUUR0000SA0 | 2011 | M01 | 220.223 | |
+-------------+------+--------+---------+-----------+
4 changes: 4 additions & 0 deletions OEWS000000419020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
+-----------+------+--------+-------+-----------+
| series id | year | period | value | footnotes |
+-----------+------+--------+-------+-----------+
+-----------+------+--------+-------+-----------+
52 changes: 52 additions & 0 deletions SUUR0000SA0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
+-------------+------+--------+---------+-----------+
| series id | year | period | value | footnotes |
+-------------+------+--------+---------+-----------+
| SUUR0000SA0 | 2014 | M12 | 134.207 | |
| SUUR0000SA0 | 2014 | M11 | 135.107 | |
| SUUR0000SA0 | 2014 | M10 | 135.891 | |
| SUUR0000SA0 | 2014 | M09 | 136.211 | |
| SUUR0000SA0 | 2014 | M08 | 136.127 | |
| SUUR0000SA0 | 2014 | M07 | 136.392 | |
| SUUR0000SA0 | 2014 | M06 | 136.433 | |
| SUUR0000SA0 | 2014 | M05 | 136.216 | |
| SUUR0000SA0 | 2014 | M04 | 135.771 | |
| SUUR0000SA0 | 2014 | M03 | 135.375 | |
| SUUR0000SA0 | 2014 | M02 | 134.542 | |
| SUUR0000SA0 | 2014 | M01 | 134.017 | |
| SUUR0000SA0 | 2013 | M12 | 133.509 | |
| SUUR0000SA0 | 2013 | M11 | 133.596 | |
| SUUR0000SA0 | 2013 | M10 | 133.876 | |
| SUUR0000SA0 | 2013 | M09 | 134.255 | |
| SUUR0000SA0 | 2013 | M08 | 134.098 | |
| SUUR0000SA0 | 2013 | M07 | 133.919 | |
| SUUR0000SA0 | 2013 | M06 | 133.900 | |
| SUUR0000SA0 | 2013 | M05 | 133.626 | |
| SUUR0000SA0 | 2013 | M04 | 133.421 | |
| SUUR0000SA0 | 2013 | M03 | 133.558 | |
| SUUR0000SA0 | 2013 | M02 | 133.204 | |
| SUUR0000SA0 | 2013 | M01 | 132.137 | |
| SUUR0000SA0 | 2012 | M12 | 131.770 | |
| SUUR0000SA0 | 2012 | M11 | 132.208 | |
| SUUR0000SA0 | 2012 | M10 | 132.892 | |
| SUUR0000SA0 | 2012 | M09 | 132.988 | |
| SUUR0000SA0 | 2012 | M08 | 132.430 | |
| SUUR0000SA0 | 2012 | M07 | 131.731 | |
| SUUR0000SA0 | 2012 | M06 | 131.956 | |
| SUUR0000SA0 | 2012 | M05 | 132.154 | |
| SUUR0000SA0 | 2012 | M04 | 132.284 | |
| SUUR0000SA0 | 2012 | M03 | 131.905 | |
| SUUR0000SA0 | 2012 | M02 | 130.953 | |
| SUUR0000SA0 | 2012 | M01 | 130.438 | |
| SUUR0000SA0 | 2011 | M12 | 129.844 | |
| SUUR0000SA0 | 2011 | M11 | 130.196 | |
| SUUR0000SA0 | 2011 | M10 | 130.373 | |
| SUUR0000SA0 | 2011 | M09 | 130.635 | |
| SUUR0000SA0 | 2011 | M08 | 130.351 | |
| SUUR0000SA0 | 2011 | M07 | 129.983 | |
| SUUR0000SA0 | 2011 | M06 | 129.846 | |
| SUUR0000SA0 | 2011 | M05 | 129.999 | |
| SUUR0000SA0 | 2011 | M04 | 129.483 | |
| SUUR0000SA0 | 2011 | M03 | 128.585 | |
| SUUR0000SA0 | 2011 | M02 | 127.363 | |
| SUUR0000SA0 | 2011 | M01 | 126.778 | |
+-------------+------+--------+---------+-----------+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
139 changes: 139 additions & 0 deletions app copy 2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
// Backup from 10/25 before adding jobs table
const jobslist = document.getElementById('jobslist');
const searchBar = document.getElementById('searchBar');
const mainCategory = document.getElementById('mainCategory');
let jobData = [];

// Event listener for the search bar
searchBar.addEventListener('keyup', (e) => {
const searchString = e.target.value.toLowerCase();
const searchWords = searchString.split(' ').filter(word => word.length > 0);

if (searchWords.length === 0) {
displayJobs(jobData.flatMap(category => {
return Object.entries(category.jobs).map(([jobTitle, job]) => ({
main_category: category.main_category,
jobTitle,
job
}));
}));
return;
}

const filteredJobs = jobData.flatMap(category => {
return Object.entries(category.jobs)
.filter(([jobTitle, job]) => {
const jobTitleMatch = searchWords.some(word => jobTitle.toLowerCase().includes(word));
const linksMatch = job.links.some(link =>
searchWords.some(word =>
link.url.toLowerCase().includes(word) ||
link.category.toLowerCase().includes(word)
)
);
return jobTitleMatch || linksMatch;
})
.map(([jobTitle, job]) => ({
main_category: category.main_category,
jobTitle,
job
}));
});

displayJobs(filteredJobs);
});

// Function to load jobs data
const loadJobs = async () => {
try {
const res = await fetch('jobs.json'); // Adjust the path if necessary
jobData = await res.json(); // Load all categories and jobs
displayJobs(jobData.flatMap(category => {
return Object.entries(category.jobs).map(([jobTitle, job]) => ({
main_category: category.main_category,
jobTitle,
job
}));
}));
} catch (err) {
console.error(err);
}
};

const displayJobs = (jobs) => {
let lastCategory = '';
const htmlString = jobs.map(({ main_category, jobTitle, job }) => {
const isNewCategory = main_category !== lastCategory;
lastCategory = main_category;

const linksHtml = job.links.map(link => {
return `
<li class="link">
<span class="category">${link.category}</span>
<a href="${link.url}" target="_blank">${link.url}</a>
</li>
`;
}).join('');

const videosHtml = job.videos.map(video => {
const videoId = extractVideoId(video.url);
const thumbnailUrl = `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`;

return `
<div class="video-wrapper" data-video-id="${videoId}" style="margin-bottom: 20px;">
<img src="${thumbnailUrl}" class="video-thumbnail" alt="Video thumbnail" style="cursor: pointer;" />
</div>
`;
}).join('');

// Display degree required in a separate text box next to the job title
return `
${isNewCategory ? `<h2 class="main-category">${main_category}</h2>` : ''}
<div class="job-section">
<h3 class="job-title">${jobTitle}</h3>
<span class="degree-box">Degree Required: ${job.degree_required}</span> <!-- Degree info in a separate box -->
<ul class="links-list">${linksHtml}</ul>
<div class="videos-container">${videosHtml}</div>
</div>
`;
}).join('');

jobslist.innerHTML = htmlString;
updateMainCategory(jobs);

// Add event listeners for lazy loading videos
document.querySelectorAll('.video-thumbnail').forEach(thumbnail => {
thumbnail.addEventListener('click', function() {
const videoWrapper = this.closest('.video-wrapper');
const videoId = videoWrapper.dataset.videoId;

const iframe = document.createElement('iframe');
iframe.src = `https://www.youtube.com/embed/${videoId}?autoplay=1`;
iframe.setAttribute('frameborder', '0');
iframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture');
iframe.setAttribute('allowfullscreen', true);
iframe.setAttribute('loading', 'lazy');

videoWrapper.innerHTML = ''; // Clear the thumbnail
videoWrapper.appendChild(iframe);
});
});
};

// Function to update the main category display
const updateMainCategory = (jobs) => {
const firstJob = jobs[0];
if (firstJob) {
mainCategory.textContent = firstJob.main_category;
} else {
mainCategory.textContent = ''; // Clear the main category if no jobs
}
};

// Function to extract the YouTube video ID from the URL
const extractVideoId = (url) => {
const urlParams = new URLSearchParams(new URL(url).search);
return urlParams.get('v') || url.split('/').pop();
};

// Load jobs data when the page is ready
document.addEventListener('DOMContentLoaded', loadJobs);
144 changes: 144 additions & 0 deletions app copy 3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
// 10/25/24 backup
const jobslist = document.getElementById('jobslist');
const searchBar = document.getElementById('searchBar');
const mainCategory = document.getElementById('mainCategory');
let jobData = [];

// Event listener for the search bar
searchBar.addEventListener('keyup', (e) => {
const searchString = e.target.value.toLowerCase();
const searchWords = searchString.split(' ').filter(word => word.length > 0);

if (searchWords.length === 0) {
displayJobs(jobData.flatMap(category => {
return Object.entries(category.jobs).map(([jobTitle, job]) => ({
main_category: category.main_category,
jobTitle,
job
}));
}));
return;
}

const filteredJobs = jobData.flatMap(category => {
return Object.entries(category.jobs)
.filter(([jobTitle, job]) => {
const jobTitleMatch = searchWords.some(word => jobTitle.toLowerCase().includes(word));
const linksMatch = job.links.some(link =>
searchWords.some(word =>
link.url.toLowerCase().includes(word) ||
link.category.toLowerCase().includes(word)
)
);
return jobTitleMatch || linksMatch;
})
.map(([jobTitle, job]) => ({
main_category: category.main_category,
jobTitle,
job
}));
});

displayJobs(filteredJobs);
});

// Function to load jobs data
const loadJobs = async () => {
try {
const res = await fetch('jobs.json'); // Adjust the path if necessary
jobData = await res.json(); // Load all categories and jobs
displayJobs(jobData.flatMap(category => {
return Object.entries(category.jobs).map(([jobTitle, job]) => ({
main_category: category.main_category,
jobTitle,
job
}));
}));
} catch (err) {
console.error(err);
}
};

const displayJobs = (jobs) => {
let lastCategory = '';
const htmlString = jobs.map(({ main_category, jobTitle, job }) => {
const isNewCategory = main_category !== lastCategory;
lastCategory = main_category;

const linksHtml = job.links.map(link => {
return `
<li class="link">
<span class="category">${link.category}</span>
<a href="${link.url}" target="_blank">${link.url}</a>
</li>
`;
}).join('');

const videosHtml = job.videos.map(video => {
const videoId = extractVideoId(video.url);
const thumbnailUrl = `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`;

return `
<div class="video-wrapper" data-video-id="${videoId}" style="margin-bottom: 20px;">
<img src="${thumbnailUrl}" class="video-thumbnail" alt="Video thumbnail" style="cursor: pointer;" />
</div>
`;
}).join('');

// Check if a jobs table exists for the job
const jobsTableHtml = job.jobs_table ? job.jobs_table : '';

// Display degree required in a separate text box next to the job title
return `
${isNewCategory ? `<h2 class="main-category">${main_category}</h2>` : ''}
<div class="job-section">
<h3 class="job-title">${jobTitle}</h3>
<span class="degree-box">Degree Required: ${job.degree_required}</span>
<ul class="links-list">${linksHtml}</ul>
<div class="videos-container">${videosHtml}</div>
<!-- Add the job table if it exists -->
<div class="jobs-table">${jobsTableHtml}</div>
</div>
`;
}).join('');

jobslist.innerHTML = htmlString;
updateMainCategory(jobs);

// Add event listeners for lazy loading videos
document.querySelectorAll('.video-thumbnail').forEach(thumbnail => {
thumbnail.addEventListener('click', function() {
const videoWrapper = this.closest('.video-wrapper');
const videoId = videoWrapper.dataset.videoId;

const iframe = document.createElement('iframe');
iframe.src = `https://www.youtube.com/embed/${videoId}?autoplay=1`;
iframe.setAttribute('frameborder', '0');
iframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture');
iframe.setAttribute('allowfullscreen', true);
iframe.setAttribute('loading', 'lazy');

videoWrapper.innerHTML = ''; // Clear the thumbnail
videoWrapper.appendChild(iframe);
});
});
};

// Function to update the main category display
const updateMainCategory = (jobs) => {
const firstJob = jobs[0];
if (firstJob) {
mainCategory.textContent = firstJob.main_category;
} else {
mainCategory.textContent = ''; // Clear the main category if no jobs
}
};

// Function to extract the YouTube video ID from the URL
const extractVideoId = (url) => {
const urlParams = new URLSearchParams(new URL(url).search);
return urlParams.get('v') || url.split('/').pop();
};

// Load jobs data when the page is ready
document.addEventListener('DOMContentLoaded', loadJobs);
Loading

0 comments on commit 7898743

Please sign in to comment.