Skip to content

Commit

Permalink
Merge branch 'master' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-polk committed Nov 14, 2024
2 parents b5db9b4 + a9bc9d4 commit 1f6f1ca
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 24 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
50 changes: 33 additions & 17 deletions .github/workflows/trigger-teamcity-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}'
26 changes: 23 additions & 3 deletions src/bloom-player-core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,15 @@ export class BloomPlayerCore extends React.Component<IProps, IState> {
}

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;
Expand All @@ -397,9 +406,7 @@ export class BloomPlayerCore extends React.Component<IProps, IState> {
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://")
Expand All @@ -414,6 +421,19 @@ export class BloomPlayerCore extends React.Component<IProps, IState> {
}
}

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);
Expand Down
1 change: 1 addition & 0 deletions src/narration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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%";
Expand Down

0 comments on commit 1f6f1ca

Please sign in to comment.