Skip to content

Commit

Permalink
Merge pull request #85 from Bill77/feature/callout-link-to-bible-app
Browse files Browse the repository at this point in the history
Feature/callout link to bible app
  • Loading branch information
tim-hub authored Mar 10, 2023
2 parents 2d7fb43 + 9840980 commit cbf520f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/VerseSuggesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class VerseSuggesting implements IVerseSuggesting {
public getVerseReference(): string {
return ` [${
this.bibleProvider.BibleReferenceHead
} - ${this.bibleVersion.toUpperCase()}](${this.bibleProvider.QueryURL})`
} - ${this.bibleVersion.toUpperCase()}](${this.bibleProvider.VerseLinkURL})`
}

/**
Expand Down
11 changes: 10 additions & 1 deletion src/provider/BibleProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ export abstract class BibleProvider {
* for example, https://api.scripture.api.bible/v1/bibles/de4e0c8c-9c29-44c7-a8c3-c8a9c1b9d6a0/verses/ESV/
*/
public get QueryURL(): string {
return this._queryUrl
return this._queryUrl;
}

/**
* Get the Callout Link URL for the verse query
* By default it's the Query URL, but for some API there is a provided web app, so it will link to that.
* In the Bolly Life interface, it's just the same URL location except without `/get-text`
*/
public get VerseLinkURL(): string {
return this._queryUrl;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/provider/BollyLifeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export class BollyLifeProvider extends BibleProvider {
this._chapterApiUrl = this._apiUrl
}

public get VerseLinkURL(): string {
return this._queryUrl.replace("/get-text", "");
}

public buildRequestURL(
bookName: string,
chapter: number,
Expand Down

0 comments on commit cbf520f

Please sign in to comment.