File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 605605
606606 var tabnavExtras = commentForm . parentNode . parentNode . querySelector ( ".comment-form-head .tabnav-right, .comment-form-head .right" ) ;
607607 if ( tabnavExtras ) {
608+ var elem = commentForm ;
609+ while ( ( elem = elem . parentNode ) && elem . nodeType !== 9 && ! elem . classList . contains ( "timeline-inline-comments" ) ) { }
610+ var sponsoredText = elem !== document ? " Github Comment Enhancer" : " Enhanced by Github Comment Enhancer" ;
608611 var sponsored = document . createElement ( "a" ) ;
609612 sponsored . setAttribute ( "target" , "_blank" ) ;
610613 sponsored . setAttribute ( "href" , "https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer" ) ;
611614 sponsored . classList . add ( "tabnav-widget" , "text" , "tabnav-extras" , "tabnav-extra" ) ;
612615 var sponsoredIcon = document . createElement ( "span" ) ;
613616 sponsoredIcon . classList . add ( "octicon" , "octicon-question" ) ;
614617 sponsored . appendChild ( sponsoredIcon ) ;
615- sponsored . appendChild ( document . createTextNode ( "Enhanced by Github Comment Enhancer" ) ) ;
618+ sponsored . appendChild ( document . createTextNode ( sponsoredText ) ) ;
616619 tabnavExtras . insertBefore ( sponsored , tabnavExtras . firstElementChild ) ;
617620 }
618621 }
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ Every comment field also got a toolbar, consisting of the following buttons:
6262* ** 2.5.0**
6363 * Fixed not running everywhere (fixes https://github.com/jerone/UserScripts/issues/66 );
6464 * Better clear button icon;
65+ * Fixed comment form header on inline comments;
6566* ** 2.4.1**
6667 * Fixed a small bug with cached suggestions for emoji when returning to an issue/PR;
6768* ** 2.4.0**
You can’t perform that action at this time.
0 commit comments