File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 22
22
const regex = / \. h t m l ? $ / ;
23
23
24
24
const link = document . createElement ( "a" ) ;
25
- link . className = "ghhp-btn btn btn-sm py-0 px-1 tooltipped tooltipped-n" ;
25
+ link . className = "ghhp-btn btn btn-sm py-0 px-1 mx-1 v-align-baseline tooltipped tooltipped-n" ;
26
26
link . setAttribute ( "aria-label" , "Open in new tab" ) ;
27
27
link . target = "_blank" ;
28
28
link . innerHTML = `
29
- <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="currentColor">
29
+ <svg class="octicon v-align-text-bottom" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="currentColor">
30
30
<path d="M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/>
31
31
</svg>` ;
32
32
33
33
function addLink ( el ) {
34
- const cell = el . closest ( "td.content " ) ;
34
+ const cell = el . closest ( ".js-navigation-item div:nth-child(2) span " ) ;
35
35
if ( ! $ ( ".ghhp-btn" , cell ) ) {
36
36
const preview = link . cloneNode ( true ) ;
37
37
preview . href = prefix + el . href ;
40
40
}
41
41
42
42
function init ( ) {
43
- if ( $ ( "table.files " ) ) {
44
- const files = $ ( ".file-wrap" ) ;
45
- $$ ( "td.content .js-navigation-open" , files ) . forEach ( el => {
43
+ if ( $ ( ".js-details-container " ) ) {
44
+ const files = $ ( "#files" ) . parentElement ;
45
+ $$ ( ".js-navigation-item div:nth-child(2) .js-navigation-open" , files ) . forEach ( el => {
46
46
if ( regex . test ( el . title ) ) {
47
47
addLink ( el ) ;
48
48
}
You can’t perform that action at this time.
0 commit comments