forked from xebia/github-copilot-updates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsku-script.js
39 lines (35 loc) · 1.88 KB
/
sku-script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
document.addEventListener('DOMContentLoaded', function() {
fetch('data.json')
.then(response => response.json())
.then(data => {
const businessFeatures = document.getElementById('business-features');
const enterpriseFeatures = document.getElementById('enterprise-features');
const newsContainer = document.createElement('div');
newsContainer.className = 'news-container';
newsContainer.id = 'news-container';
document.body.appendChild(newsContainer);
// Load existing features
data.features.videos.forEach(feature => {
const featureGrid = document.createElement('div');
featureGrid.className = 'feature-grid';
const skuName = document.createElement('h2');
skuName.textContent = feature.sku;
featureGrid.appendChild(skuName);
feature.items.forEach(item => {
const featureBox = document.createElement('div');
featureBox.className = 'video-box';
featureBox.innerHTML = `<h3>${item.title}</h3>`;
featureBox.addEventListener('click', () => {
window.location.href = `detail.html?title=${encodeURIComponent(item.title)}&videoUrl=${encodeURIComponent(item.videoUrl)}&description=${encodeURIComponent(item.description)}`;
});
featureGrid.appendChild(featureBox);
});
if (feature.sku === "GitHub Copilot Business") {
businessFeatures.appendChild(featureGrid);
} else if (feature.sku === "GitHub Copilot Enterprise") {
enterpriseFeatures.appendChild(featureGrid);
}
});
})
.catch(error => console.error('Error loading SKU data:', error));
});