@@ -105,7 +105,7 @@ export interface ButtonContributionParams {
105105 * Each manipulation contains a CSS selector (element) that is used to find the element to manipulate and optionally
106106 * the classnames to remove and add.
107107 */
108- manipulations ?: { element : string ; remove ?: string ; add ?: string ; style ?: Partial < CSSStyleDeclaration > } [ ] ;
108+ manipulations ?: { element : string ; removeClassName ?: string ; addClassName ?: string ; style ?: Partial < CSSStyleDeclaration > , setAttribute ?: { name : string , value : string } [ ] } [ ] ;
109109
110110 /**
111111 * A function that can be used to transform the URL that should be opened when the Gitpod button is clicked.
@@ -140,7 +140,7 @@ export const buttonContributions: ButtonContributionParams[] = [
140140 manipulations : [
141141 {
142142 element : "div.repos-files-header-commandbar.scroll-hidden" ,
143- remove : "scroll-hidden" ,
143+ removeClassName : "scroll-hidden" ,
144144 } ,
145145 ] ,
146146 urlTransformer ( originalUrl ) {
@@ -198,7 +198,7 @@ export const buttonContributions: ButtonContributionParams[] = [
198198 {
199199 // make the clone button secondary
200200 element : "#clone-dropdown" ,
201- remove : "btn-confirm" ,
201+ removeClassName : "btn-confirm" ,
202202 } ,
203203 ] ,
204204 } ,
@@ -224,7 +224,7 @@ export const buttonContributions: ButtonContributionParams[] = [
224224 // make the clone button secondary
225225 element :
226226 "#fileHolder > div.js-file-title.file-title-flex-parent > div.gl-display-flex.gl-flex-wrap.file-actions > div.gl-sm-ml-3.gl-mr-3 > div > button" ,
227- remove : "btn-confirm" ,
227+ removeClassName : "btn-confirm" ,
228228 } ,
229229 ] ,
230230 } ,
@@ -241,7 +241,7 @@ export const buttonContributions: ButtonContributionParams[] = [
241241 // make the clone button secondary
242242 element :
243243 "#content-body > div.merge-request .js-issuable-actions > div.dropdown.gl-dropdown > button" ,
244- remove : "btn-confirm" ,
244+ removeClassName : "btn-confirm" ,
245245 } ,
246246 ] ,
247247 } ,
@@ -267,6 +267,16 @@ export const buttonContributions: ButtonContributionParams[] = [
267267 containerElement : createElement ( "div" , { } ) ,
268268 additionalClassNames : [ "medium" ] ,
269269 application : "github" ,
270+ manipulations : [
271+ {
272+ // make the clone button secondary
273+ element :
274+ "xpath://button[contains(., 'Code')]" ,
275+ setAttribute : [
276+ { name : "data-variant" , value : "default" } ,
277+ ] ,
278+ } ,
279+ ] ,
270280 match : ( ) => {
271281 const regex = / ^ h t t p s ? : \/ \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) ( \/ ( t r e e \/ .* ) ? ) ? $ / ;
272282 return document . querySelector ( "div.file-navigation" ) === null && regex . test ( window . location . href ) ;
@@ -290,20 +300,12 @@ export const buttonContributions: ButtonContributionParams[] = [
290300 {
291301 id : "gh-issue" ,
292302 exampleUrls : [ "https://github.com/svenefftinge/browser-extension-test/issues/1" ] ,
293- selector : "#partial-discussion-header > div.gh-header-show > div > div" ,
294- containerElement : createElement ( "div" , {
295- order : "2" ,
296- } ) ,
303+ selector : "[data-component='PH_Actions'] > div" , //
304+ insertBefore : "[data-component='PH_Actions'] > div > button" ,
305+ containerElement : createElement ( "div" , { } ) ,
297306 match : / \/ i s s u e s \/ / ,
298307 application : "github" ,
299- manipulations : [
300- {
301- // make the code button secondary
302- element : "#partial-discussion-header > div.gh-header-show > div > div > a" ,
303- remove : "Button--primary" ,
304- add : "Button--secondary" ,
305- } ,
306- ] ,
308+ additionalClassNames : [ "tall" ] ,
307309 } ,
308310 {
309311 id : "gh-issue-new" , // this isn't referring to "new issue", but to new "issue"
0 commit comments