diff --git a/src/config.ts b/src/config.ts index 7d22004..f4e49d7 100644 --- a/src/config.ts +++ b/src/config.ts @@ -5,12 +5,14 @@ export interface Config { gitpodURL: string; openAsPopup: boolean; rewritePeriodKeybind: boolean; + useLatest: boolean; } export const DEFAULT_CONFIG: Config = { gitpodURL: "https://gitpod.io", openAsPopup: false, - rewritePeriodKeybind: false + rewritePeriodKeybind: false, + useLatest: false, }; export interface ConfigListener { diff --git a/src/injectors/bitbucket-injector.ts b/src/injectors/bitbucket-injector.ts index 542d6bd..707075b 100644 --- a/src/injectors/bitbucket-injector.ts +++ b/src/injectors/bitbucket-injector.ts @@ -60,7 +60,7 @@ abstract class ButtonInjectorBase implements ButtonInjector { abstract isApplicableToCurrentPage(): boolean; - inject(urlInfo: UrlInfo, openAsPopup: boolean) { + inject(urlInfo: UrlInfo, openAsPopup: boolean, useLatest: boolean) { let actionbar = select(this.parent); if (actionbar && this.up) { for (let i = 0; i < this.up; i++) { diff --git a/src/injectors/github-injector.ts b/src/injectors/github-injector.ts index c7fb872..b4a1499 100644 --- a/src/injectors/github-injector.ts +++ b/src/injectors/github-injector.ts @@ -81,7 +81,7 @@ abstract class ButtonInjectorBase implements ButtonInjector { // do nothing } - inject(urlInfo: UrlInfo, openAsPopup: boolean) { + inject(urlInfo: UrlInfo, openAsPopup: boolean, useLatest: boolean) { const actionbar = select(this.parentSelector); if (!actionbar) { return; diff --git a/src/injectors/gitlab-injector.ts b/src/injectors/gitlab-injector.ts index 431d8ba..ab9bfa5 100644 --- a/src/injectors/gitlab-injector.ts +++ b/src/injectors/gitlab-injector.ts @@ -57,7 +57,7 @@ class RepositoryInjector implements ButtonInjector { return result; } - inject(urlInfo: UrlInfo, openAsPopup: boolean) { + inject(urlInfo: UrlInfo, openAsPopup: boolean, useLatest: boolean) { const parent = select(RepositoryInjector.PARENT_SELECTOR); if (!parent || !parent.firstElementChild) { return; diff --git a/src/injectors/injector.ts b/src/injectors/injector.ts index 9db8d24..581ae10 100644 --- a/src/injectors/injector.ts +++ b/src/injectors/injector.ts @@ -37,7 +37,7 @@ export interface ButtonInjector { * Injects the actual button * @param currentUrl The currently configured Gitpod URL */ - inject(urlInfo: UrlInfo, openAsPopup: boolean): void; + inject(urlInfo: UrlInfo, openAsPopup: boolean, useLatest: boolean): void; } export abstract class InjectorBase implements Injector { @@ -55,7 +55,7 @@ export abstract class InjectorBase implements Injector { const urlInfo = renderGitpodUrl(this.config.gitpodURL); for (const injector of this.buttonInjectors) { if (injector.isApplicableToCurrentPage()) { - injector.inject(urlInfo, this.config.openAsPopup); + injector.inject(urlInfo, this.config.openAsPopup, this.config.useLatest); if (singleInjector) { break; } diff --git a/src/options/options.html b/src/options/options.html index ab52ed3..62da782 100644 --- a/src/options/options.html +++ b/src/options/options.html @@ -2,7 +2,7 @@
- +