Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions sites/eclipse/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,14 @@ <h3 id="repository">Eclipse p2 Repository
</h3>
<p>
To update your Eclipse installation to this development stream, you can use the software repository at
<br>
<code><a class="data-ref" href="${updatesP2RepositoryComposite}">${updatesP2RepositoryComposite}</a></code>
</p>
<ul>
<li><a class="data-ref" href="https://download.eclipse.org/eclipse/updates/${releaseShort}/">https://download.eclipse.org/eclipse/updates/${releaseShort}</a></li>
</ul>
<p>
To update your build to use this specific build, you can use the software repository at
<br>
<code><a class="data-ref" href="${updatesP2Repository}">${updatesP2Repository}</a></code>
</p>
<ul>
<li><a class="data-ref" href="https://download.eclipse.org/eclipse/updates/${releaseShort}/${identifier}/">https://download.eclipse.org/eclipse/updates/${releaseShort}/${identifier}</a></li>
</ul>
<table class="files-table" data-path="p2Repository"></table>

<h3 id="eclipse-sdk">Eclipse SDK
Expand Down Expand Up @@ -110,7 +108,22 @@ <h3 id="swt">SWT Binary and Source

</main>
<script>
loadPageData('buildproperties.json')
loadPageData('buildproperties.json', data => {
data.updatesP2RepositoryComposite = `https://download.eclipse.org/eclipse/updates/${data.releaseShort}`
const buildID = data.identifier
const buildType = buildID.charAt(0)
if (buildType == 'I' || buildType == 'Y') {
data.updatesP2RepositoryComposite += `-${buildType}-builds`
}
if (buildType == 'S') {
data.updatesP2RepositoryComposite += `-I-builds`
const timestamp = buildID.substring(buildID.lastIndexOf('-') + 1, buildID.length)
data.updatesP2Repository = `${data.updatesP2RepositoryComposite}/I${timestamp.substring(0, 8)}-${timestamp.substring(8, 12)}`
} else {
data.updatesP2Repository = `${data.updatesP2RepositoryComposite}/${buildID}`
}
return data
})

contentPostProcessor = (mainElement, build) => {
document.title = `${build.label} - ${document.title}`
Expand Down
11 changes: 7 additions & 4 deletions sites/eclipse/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ if (typeof Intl.DurationFormat !== 'undefined') {

function formatRuntime(runtime) {
const totalSeconds = Math.trunc(runtime);

// Try to use Temporal API if both Temporal and DurationFormat are available (not supported in all browsers yet)
if (typeof Temporal !== 'undefined' && Temporal.Duration && runtimeFormat) {
try {
Expand All @@ -133,12 +133,12 @@ function formatRuntime(runtime) {
// Fall through to fallback implementation
}
}

// Fallback implementation for browsers without Temporal/DurationFormat support
const hours = Math.floor(totalSeconds / 3600);
const minutes = Math.floor((totalSeconds % 3600) / 60);
const seconds = totalSeconds % 60;

if (hours > 0) {
// For durations >= 1 hour, show hours and minutes
return `${hours} hr, ${minutes} min`;
Expand All @@ -163,8 +163,11 @@ function fetchAllJSON(urls) {

let pageData = null

function loadPageData(dataPath) {
function loadPageData(dataPath, dataGenerator = null) {
pageData = fetch(dataPath).then(res => res.json())
if (dataGenerator) {
pageData = pageData.then(dataGenerator)
}
}

let contentPostProcessor = (_mainElement, _contentData) => {}
Expand Down
Loading