Skip to content

Commit

Permalink
Update commit injection for GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
gitkrakel committed Apr 16, 2024
1 parent ecb4865 commit 6a8d819
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/hosts/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ export function injectionScope(url: string) {
const [, , , type] = this.uri.pathname.split('/');
switch (type) {
case 'commit':
insertions.set('.commit > * #browse-at-time-link', {
// This is inside a flexbox, so ml-auto adds a ballooning margin that pushes the element to the right
html: /*html*/ `<a data-gk class="btn ml-auto flex-self-start" style="padding-top:2px !important; padding-bottom:1px !important;" href="${url}" target="_blank" title="${label}" aria-label="${label}">${this.getGitKrakenSvg(
22,
undefined,
'position:relative; top:2px;',
)}</a>`,
position: 'beforebegin',
});

// For GitHub Enterprise 3.11.2
insertions.set('.commit > #browse-at-time-link', {
html: /*html*/ `<a data-gk class="btn mr-2 px-2 float-right" style="padding-top:2px !important; padding-bottom:1px !important;" href="${url}" target="_blank" title="${label}" aria-label="${label}">${this.getGitKrakenSvg(
22,
Expand Down

0 comments on commit 6a8d819

Please sign in to comment.