@@ -105,7 +105,7 @@ export interface ButtonContributionParams {
105
105
* Each manipulation contains a CSS selector (element) that is used to find the element to manipulate and optionally
106
106
* the classnames to remove and add.
107
107
*/
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 } [ ] } [ ] ;
109
109
110
110
/**
111
111
* 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[] = [
140
140
manipulations : [
141
141
{
142
142
element : "div.repos-files-header-commandbar.scroll-hidden" ,
143
- remove : "scroll-hidden" ,
143
+ removeClassName : "scroll-hidden" ,
144
144
} ,
145
145
] ,
146
146
urlTransformer ( originalUrl ) {
@@ -198,7 +198,7 @@ export const buttonContributions: ButtonContributionParams[] = [
198
198
{
199
199
// make the clone button secondary
200
200
element : "#clone-dropdown" ,
201
- remove : "btn-confirm" ,
201
+ removeClassName : "btn-confirm" ,
202
202
} ,
203
203
] ,
204
204
} ,
@@ -224,7 +224,7 @@ export const buttonContributions: ButtonContributionParams[] = [
224
224
// make the clone button secondary
225
225
element :
226
226
"#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" ,
228
228
} ,
229
229
] ,
230
230
} ,
@@ -241,7 +241,7 @@ export const buttonContributions: ButtonContributionParams[] = [
241
241
// make the clone button secondary
242
242
element :
243
243
"#content-body > div.merge-request .js-issuable-actions > div.dropdown.gl-dropdown > button" ,
244
- remove : "btn-confirm" ,
244
+ removeClassName : "btn-confirm" ,
245
245
} ,
246
246
] ,
247
247
} ,
@@ -267,6 +267,16 @@ export const buttonContributions: ButtonContributionParams[] = [
267
267
containerElement : createElement ( "div" , { } ) ,
268
268
additionalClassNames : [ "medium" ] ,
269
269
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
+ ] ,
270
280
match : ( ) => {
271
281
const regex = / ^ h t t p s ? : \/ \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) ( \/ ( t r e e \/ .* ) ? ) ? $ / ;
272
282
return document . querySelector ( "div.file-navigation" ) === null && regex . test ( window . location . href ) ;
@@ -290,20 +300,12 @@ export const buttonContributions: ButtonContributionParams[] = [
290
300
{
291
301
id : "gh-issue" ,
292
302
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" , { } ) ,
297
306
match : / \/ i s s u e s \/ / ,
298
307
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" ] ,
307
309
} ,
308
310
{
309
311
id : "gh-issue-new" , // this isn't referring to "new issue", but to new "issue"
0 commit comments