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
2 changes: 1 addition & 1 deletion sites/eclipse/build/buildlogs/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h3 id="comparator">Comparator Logs</h3>
if (beautifyText) {
if (text.startsWith('s') && text.endsWith('.log')) {
const firstDash = text.indexOf('_')
text = text.substring(firstDash + 1, text.length - 4).replace('_', ' ')
text = text.substring(firstDash + 1, text.length - 4).replaceAll('_', ' ')
}
}
item.innerHTML = `<a href="${linkPrefix}${file.name}">${text}</a> (${file.size})`
Expand Down
2 changes: 1 addition & 1 deletion sites/eclipse/build/gitLog.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<body>
<div data-generate="generateDefaultBreadcrumb(this, eclipseBreadcrumbBase)">
<a href="..">Downloads</a>
<a href="../..">Downloads</a>
<a class="data-ref" href=".">${label}</a>
<span>GIT Log</span>
</div>
Expand Down
8 changes: 4 additions & 4 deletions sites/eclipse/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<body>
<div data-generate="generateDefaultBreadcrumb(this, eclipseBreadcrumbBase)">
<a href="..">Downloads</a>
<a href="../..">Downloads</a>
<span class="data-ref">${label}</span>
</div>

Expand Down Expand Up @@ -116,7 +116,7 @@ <h3 id="swt">SWT Binary and Source
data.updatesP2RepositoryComposite += `-${buildType}-builds`
}
if (buildType == 'S') {
data.updatesP2RepositoryComposite += `-I-builds`
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 {
Expand All @@ -133,7 +133,7 @@ <h3 id="swt">SWT Binary and Source
const testJobsFolderURL = getJenkinsTestJobsFolderURL(build)

const testResultsOverview = fetchAllJSON(build.expectedTests.map(c => `testresults/${jobNamePrefix}-${c}.json`))
const testResultsTable = document.getElementById("tests-overview-table")
const testResultsTable = document.getElementById('tests-overview-table')
const tBody = testResultsTable.createTBody()
testResultsOverview.then(testResults => {
let completedTests = 0
Expand Down Expand Up @@ -172,7 +172,7 @@ <h3 id="swt">SWT Binary and Source
}

// Inject resource files
const dataTables = Array.from(mainElement.getElementsByClassName("files-table"))
const dataTables = Array.from(mainElement.getElementsByClassName('files-table'))
for (const table of dataTables) {
const dataPath = table.getAttribute('data-path')
const filesData = getValue(build, dataPath)
Expand Down
12 changes: 6 additions & 6 deletions sites/eclipse/build/tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<body>
<div data-generate="generateDefaultBreadcrumb(this, eclipseBreadcrumbBase)">
<a href="..">Downloads</a>
<a href="../..">Downloads</a>
<a class="data-ref" href=".">${label}</a>
<span>Test Results</span>
</div>
Expand Down Expand Up @@ -99,9 +99,9 @@ <h3>Plugins containing access errors or warnings</h3>
const jobNamePrefix = getJenkinsTestJobNamePrefix(build)

const testResultsSummaries = fetchAllJSON(build.expectedTests.map(c => `testresults/${jobNamePrefix}-${c}-summary.json`))
const testResultsTable = document.getElementById("test-results-summary")
const testsHeadlineCell = document.getElementById("tests-header")
const testConfigsHeadline = document.getElementById("test-configurations-headline")
const testResultsTable = document.getElementById('test-results-summary')
const testsHeadlineCell = document.getElementById('tests-header')
const testConfigsHeadline = document.getElementById('test-configurations-headline')
const expectedTestConfigsCount = build.expectedTests.length
testsHeadlineCell.colSpan = expectedTestConfigsCount
const expectedTestsLongNames = []
Expand Down Expand Up @@ -149,8 +149,8 @@ <h3>Plugins containing access errors or warnings</h3>
}

function injectCompilerSummaryTable(compilerSummary) {
const generalIssues = document.getElementById("compiler-warnings-summary")
const accessIssues = document.getElementById("compiler-access-summary")
const generalIssues = document.getElementById('compiler-warnings-summary')
const accessIssues = document.getElementById('compiler-access-summary')
for (const pluginName in compilerSummary) {
const issues = compilerSummary[pluginName]
const basicLink = `compilelogs/plugins/${issues.path}`
Expand Down
2 changes: 1 addition & 1 deletion sites/eclipse/overview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h3 id="beta-java-builds">Beta Java Builds</h3>
TWENTYFOUR_HOURS_AGO.setTime(TWENTYFOUR_HOURS_AGO.getTime() - 24 * 60 * 60 * 1000)

contentPostProcessor = (mainElement, contentData) => {
const dataTables = Array.from(mainElement.getElementsByClassName("builds-table"))
const dataTables = Array.from(mainElement.getElementsByClassName('builds-table'))
for (const table of dataTables) {
const dataPath = table.getAttribute('data-path');
const tableData = dataPath != 'latest'
Expand Down
48 changes: 24 additions & 24 deletions sites/eclipse/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ function getCPUArchLabel(name) {
}
}

const BUILD_DATE_FORMAT = new Intl.DateTimeFormat("en-GB", {
timeZone: "UTC",
year: "numeric",
month: "short",
day: "2-digit",
weekday: "short",
const BUILD_DATE_FORMAT = new Intl.DateTimeFormat('en-GB', {
timeZone: 'UTC',
year: 'numeric',
month: 'short',
day: '2-digit',
weekday: 'short',
hour12: false,
hour: "2-digit",
minute: "2-digit",
hour: '2-digit',
minute: '2-digit',
})

function formatBuildDate(date) {
Expand All @@ -112,7 +112,7 @@ function formatBuildDate(date) {
let runtimeFormat = null;
if (typeof Intl.DurationFormat !== 'undefined') {
try {
runtimeFormat = new Intl.DurationFormat("en", { style: "short" });
runtimeFormat = new Intl.DurationFormat('en', { style: 'short' });
} catch (e) {
// Intl.DurationFormat not available
}
Expand All @@ -126,8 +126,8 @@ function formatRuntime(runtime) {
try {
const duration = Temporal.Duration.from({ seconds: totalSeconds });
return runtimeFormat.format(duration.round({
largestUnit: "hours",
smallestUnit: totalSeconds >= 3600 ? "minutes" : "seconds"
largestUnit: 'hours',
smallestUnit: totalSeconds >= 3600 ? 'minutes' : 'seconds'
}));
} catch (e) {
// Fall through to fallback implementation
Expand Down Expand Up @@ -161,12 +161,12 @@ function fetchAllJSON(urls) {
return Promise.all(promises)
}

let pageData = null
let _pageData = null

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

Expand All @@ -189,12 +189,12 @@ function generate() {
}

const generatedBody = generateBody();
document.body.replaceChildren(...generatedBody);
document.body.replaceChildren(generatedBody);

generateTOCItems(document.body) // assume no headers (for the TOC) are generated dynamically

if (pageData) {
pageData.then(data => {
if (_pageData) {
_pageData.then(data => {
const mainElement = document.body.querySelector('main')
const contentMain = mainElement.querySelector('main') // This is the main element of the calling html file
resolveDataReferences(document, data)
Expand All @@ -221,12 +221,12 @@ function generateTOCItems(mainElement) {
}
}

const dataReferencePattern = /\${(?<path>[\w-\.]+)}/g
const dataReferencePattern = /\${(?<path>[\w\-\.]+)}/g

function resolveDataReferences(contextElement, contextData) {
const dataElements = Array.from(contextElement.getElementsByClassName("data-ref"))
const dataElements = Array.from(contextElement.getElementsByClassName('data-ref'))
for (const element of dataElements) {
element.classList.remove("data-ref") // Prevent multiple processing in subsequent passes with different context (therefore a copy is created from the list)
element.classList.remove('data-ref') // Prevent multiple processing in subsequent passes with different context (therefore a copy is created from the list)
element.outerHTML = element.outerHTML.replaceAll(dataReferencePattern, (_match, pathGroup, _offset, _string) => {
return getValue(contextData, pathGroup)
})
Expand All @@ -245,14 +245,14 @@ function getValue(data, path) {
}

function logException(message, loggedObject) {
document.body.prepend(...toElements(`<span>Failed to generate content: <span><b style="color: FireBrick">${message}</b><br/>`));
document.body.prepend(toElement(`<p>Failed to generate content: <b style="color: FireBrick">${message}</b></p>`));
console.log(loggedObject);
}

function generateBody() {
const hasHeadersForTOC = document.querySelector('h1[id], h2[id], h3[id], h4[id]') !== null;
const col = hasHeadersForTOC ? 'col-md-18' : ' col-md-24';
return toElements(`
return toElement(`
<div>
${generateHeader()}
<main id="content">
Expand Down Expand Up @@ -345,7 +345,7 @@ function generateMainContent() {
if (main != null) {
return main.outerHTML
}
return "<main>The body specifies no content.</main>";
return '<main>The body specifies no content.</main>';
}

function generateHeader() {
Expand Down Expand Up @@ -444,7 +444,7 @@ function toElements(text) {
function toElement(text) {
const elements = toElements(text)
if (elements.length != 1) {
throw new Error("Not exactly one element: " + elements.length)
throw new Error(`Not exactly one element: ${elements.length}`)
}
return elements[0]
}
Expand Down
4 changes: 2 additions & 2 deletions sites/equinox/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<body>
<div data-generate="generateDefaultBreadcrumb(this, equinoxBreadcrumbBase)">
<a href="..">Downloads</a>
<a href="../..">Downloads</a>
<span class="data-ref">${label}</span>
</div>

Expand Down Expand Up @@ -72,7 +72,7 @@ <h3 id="other">Other Information</h3>
document.getElementById('build-timestamp').innerHTML = `<b>${formatBuildDate(build.timestamp)} (UTC)</b>`

// Inject resource files
const dataTables = Array.from(mainElement.getElementsByClassName("files-table"))
const dataTables = Array.from(mainElement.getElementsByClassName('files-table'))
for (const table of dataTables) {
const dataPath = table.getAttribute('data-path')
const filesData = getValue(build, dataPath)
Expand Down
2 changes: 1 addition & 1 deletion sites/equinox/overview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3 id="integration-builds">Integration Builds</h3>
loadPageData('data.json')

contentPostProcessor = (mainElement, contentData) => {
const dataTables = Array.from(mainElement.getElementsByClassName("builds-table"))
const dataTables = Array.from(mainElement.getElementsByClassName('builds-table'))
for (const table of dataTables) {
const dataPath = table.getAttribute('data-path');
const tableData = dataPath != 'latest'
Expand Down
Loading