diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da31b17..7bd00e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,3 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: npx semantic-release - - - name: Set output if new release published to npm - if: success() && steps.semantic_release.outputs.new_release_published == 'true' - run: echo "::set-output name=new_release_published::true" diff --git a/.github/workflows/trigger-teamcity-builds.yml b/.github/workflows/trigger-teamcity-builds.yml index 408527e..28130ec 100644 --- a/.github/workflows/trigger-teamcity-builds.yml +++ b/.github/workflows/trigger-teamcity-builds.yml @@ -11,21 +11,37 @@ jobs: trigger-teamcity: runs-on: ubuntu-latest # Either a manual run or the Build-Test-Release workflow has completed successfully and a new release was published to npm - if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.outputs.new_release_published == 'true') }} + if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && (startsWith(github.event.workflow_run.head_commit.message, 'fix:') || startsWith(github.event.workflow_run.head_commit.message, 'feat:'))) }} steps: - - name: Trigger TeamCity Build for Bloom Reader Alpha - uses: fjogeleit/http-request-action@v1 - with: - url: '${{ secrets.TEAMCITY_URL }}/app/rest/buildQueue' - method: 'POST' - contentType: 'application/json' - customHeaders: '{"Authorization": "Bearer ${{ secrets.TEAMCITY_TOKEN_RUN_BUILD }}"}' - data: '{"buildType": {"id": "Bloom_BloomReader_BloomReaderMasterAlphaContinuousPublish"}}' - - name: Trigger TeamCity Build for Bloom Desktop Alpha - uses: fjogeleit/http-request-action@v1 - with: - url: '${{ secrets.TEAMCITY_URL }}/app/rest/buildQueue' - method: 'POST' - contentType: 'application/json' - customHeaders: '{"Authorization": "Bearer ${{ secrets.TEAMCITY_TOKEN_RUN_BUILD }}"}' - data: '{"buildType": {"id": "bt222"}}' + - name: Trigger TeamCity Build for alpha.bloomlibrary.org + uses: fjogeleit/http-request-action@v1 + with: + url: '${{ secrets.TEAMCITY_URL }}/app/rest/buildQueue' + method: 'POST' + contentType: 'application/json' + customHeaders: '{"Authorization": "Bearer ${{ secrets.TEAMCITY_TOKEN_RUN_BUILD }}"}' + data: '{"buildType": {"id": "Bloom_BloomLibraryOrg_BloomLibraryAlphaAlphaBloomlibraryOrgContinuous"}}' + - name: Trigger TeamCity Build for Bloom Reader Alpha + uses: fjogeleit/http-request-action@v1 + with: + url: '${{ secrets.TEAMCITY_URL }}/app/rest/buildQueue' + method: 'POST' + contentType: 'application/json' + customHeaders: '{"Authorization": "Bearer ${{ secrets.TEAMCITY_TOKEN_RUN_BUILD }}"}' + data: '{"buildType": {"id": "Bloom_BloomReader_BloomReaderMasterAlphaContinuousPublish"}}' + - name: Trigger TeamCity Build for Bloom Desktop Alpha + uses: fjogeleit/http-request-action@v1 + with: + url: '${{ secrets.TEAMCITY_URL }}/app/rest/buildQueue' + method: 'POST' + contentType: 'application/json' + customHeaders: '{"Authorization": "Bearer ${{ secrets.TEAMCITY_TOKEN_RUN_BUILD }}"}' + data: '{"buildType": {"id": "bt222"}}' + - name: Trigger TeamCity Build for dev-alpha.bloomlibrary.org + uses: fjogeleit/http-request-action@v1 + with: + url: '${{ secrets.TEAMCITY_URL }}/app/rest/buildQueue' + method: 'POST' + contentType: 'application/json' + customHeaders: '{"Authorization": "Bearer ${{ secrets.TEAMCITY_TOKEN_RUN_BUILD }}"}' + data: '{"buildType": {"id": "Bloom_BloomLibraryOrg_BloomLibrary2masterDevAlphaBloomlibraryOrgContinuous"}}' diff --git a/src/bloom-player-core.tsx b/src/bloom-player-core.tsx index 9bf947f..b267512 100644 --- a/src/bloom-player-core.tsx +++ b/src/bloom-player-core.tsx @@ -380,6 +380,15 @@ export class BloomPlayerCore extends React.Component { } handleDocumentLevelClick(e: any) { + const hrefValue = (e.target as HTMLElement)?.attributes["href"] + ?.value as string; + if (hrefValue) { + if (hrefValue.startsWith("bloomnav://")) { + // This is a link to a page in another book. We need to send a message to the host. + this.handleBloomNavLink(hrefValue, e); + } + return; + } const targetElement = (e.target as HTMLElement).closest( "[data-href]", ) as HTMLElement; @@ -397,9 +406,7 @@ export class BloomPlayerCore extends React.Component { e.stopPropagation(); } else if (href.startsWith("bloomnav://")) { // This is a link to a page in another book. We need to send a message to the host. - sendMessageToHost({ messageType: "bloomnav", href: href }); - e.preventDefault(); - e.stopPropagation(); + this.handleBloomNavLink(href, e); } else if ( href.startsWith("http://") || href.startsWith("https://") @@ -414,6 +421,19 @@ export class BloomPlayerCore extends React.Component { } } + private handleBloomNavLink(href: string, e: any) { + const page = (e.target as HTMLElement).closest(".bloom-page"); + sendMessageToHost({ + messageType: "bloomnav", + href: href, + // used for backreference to the page that initiated the navigation + sourceUrl: this.sourceUrl, + sourcePageNumber: page?.getAttribute("data-page-number") + }); + e.preventDefault(); + e.stopPropagation(); + } + private handleWindowFocus() { const readDuration = localStorage.getItem(kLocalStorageDurationKey); const savedBookUrl = localStorage.getItem(kLocalStorageBookUrlKey); diff --git a/src/narration.ts b/src/narration.ts index 47adf86..c18718d 100644 --- a/src/narration.ts +++ b/src/narration.ts @@ -1303,6 +1303,7 @@ export function showVideoError(video: HTMLVideoElement): void { msgDiv.textContent = badVideoMessage; msgDiv.style.display = "block"; msgDiv.style.color = "black"; + msgDiv.style.backgroundColor = "rgba(255, 255, 255, 0.5)"; // semi-transparent white msgDiv.style.position = "absolute"; msgDiv.style.left = "10%"; msgDiv.style.top = "10%";