@@ -114,7 +114,7 @@ export interface ButtonContributionParams {
114
114
urlTransformer ?: ( originalURL : string ) => string ;
115
115
}
116
116
117
- function createElement (
117
+ function createContainerElement (
118
118
type : "div" | "li" ,
119
119
props : {
120
120
[ key : string ] : string ;
@@ -134,7 +134,7 @@ export const buttonContributions: ButtonContributionParams[] = [
134
134
// "https://dev.azure.com/services-azure/_git/project2"
135
135
] ,
136
136
selector : "div.repos-files-header-commandbar:nth-child(1)" ,
137
- containerElement : createElement ( "div" , { } ) ,
137
+ containerElement : createContainerElement ( "div" , { } ) ,
138
138
application : "azure-devops" ,
139
139
insertBefore : `div.bolt-header-command-item-button:has(button[id^="__bolt-header-command-bar-menu-button"])` ,
140
140
manipulations : [
@@ -170,7 +170,7 @@ export const buttonContributions: ButtonContributionParams[] = [
170
170
// "https://dev.azure.com/services-azure/test-project/_git/repo2/pullrequest/1"
171
171
] ,
172
172
selector : ".repos-pr-header > div:nth-child(2) > div:nth-child(1)" ,
173
- containerElement : createElement ( "div" , { } ) ,
173
+ containerElement : createContainerElement ( "div" , { } ) ,
174
174
application : "azure-devops" ,
175
175
insertBefore : `div.bolt-header-command-item-button:has(button[id^="__bolt-menu-button-"])` ,
176
176
} ,
@@ -179,7 +179,7 @@ export const buttonContributions: ButtonContributionParams[] = [
179
179
exampleUrls : [ ] ,
180
180
selector : "div.clone-with-application" ,
181
181
application : "azure-devops" ,
182
- containerElement : createElement ( "div" , { marginLeft : "4px" , marginRight : "4px" } ) ,
182
+ containerElement : createContainerElement ( "div" , { marginLeft : "4px" , marginRight : "4px" } ) ,
183
183
} ,
184
184
185
185
// GitLab
@@ -217,7 +217,7 @@ export const buttonContributions: ButtonContributionParams[] = [
217
217
match : / \/ b l o b \/ / ,
218
218
selector :
219
219
"#fileHolder > div.js-file-title.file-title-flex-parent > div.gl-display-flex.gl-flex-wrap.file-actions" ,
220
- containerElement : createElement ( "div" , { display : "inline-flex" , marginLeft : "8px" } ) ,
220
+ containerElement : createContainerElement ( "div" , { display : "inline-flex" , marginLeft : "8px" } ) ,
221
221
application : "gitlab" ,
222
222
manipulations : [
223
223
{
@@ -233,7 +233,7 @@ export const buttonContributions: ButtonContributionParams[] = [
233
233
exampleUrls : [ "https://gitlab.com/svenefftinge/browser-extension-test/-/merge_requests/1" ] ,
234
234
match : / \/ m e r g e _ r e q u e s t s \/ / ,
235
235
selector : "#content-body > div.merge-request .js-issuable-actions" ,
236
- containerElement : createElement ( "div" , { } ) ,
236
+ containerElement : createContainerElement ( "div" , { } ) ,
237
237
application : "gitlab" ,
238
238
insertBefore : "#content-body > div.merge-request .js-issuable-actions > div.dropdown.gl-dropdown" ,
239
239
manipulations : [
@@ -250,7 +250,7 @@ export const buttonContributions: ButtonContributionParams[] = [
250
250
exampleUrls : [ "https://gitlab.com/svenefftinge/browser-extension-test/-/issues/1" ] ,
251
251
match : / \/ i s s u e s (?: \/ \d + | \? ) / ,
252
252
selector : "#content-body [data-testid='detail-wrapper'] > div > div:has(div > [data-testid='work-item-actions-dropdown'])" ,
253
- containerElement : createElement ( "div" , { marginLeft : "0" , marginRight : "0px" } ) ,
253
+ containerElement : createContainerElement ( "div" , { marginLeft : "0" , marginRight : "0px" } ) ,
254
254
application : "gitlab" ,
255
255
insertBefore : "#content-body [data-testid='detail-wrapper'] > div > div:has(div > [data-testid='work-item-actions-dropdown']) > div" ,
256
256
} ,
@@ -264,7 +264,7 @@ export const buttonContributions: ButtonContributionParams[] = [
264
264
"https://github.com/svenefftinge/browser-extension-test/tree/my-branch" ,
265
265
] ,
266
266
selector : `xpath://*[contains(@id, 'repo-content-')]/div/div/div/div[1]/react-partial/div/div/div[2]/div[2]` ,
267
- containerElement : createElement ( "div" , { } ) ,
267
+ containerElement : createContainerElement ( "div" , { } ) ,
268
268
additionalClassNames : [ "medium" ] ,
269
269
application : "github" ,
270
270
manipulations : [
@@ -289,7 +289,7 @@ export const buttonContributions: ButtonContributionParams[] = [
289
289
] ,
290
290
selector : "#repo-content-pjax-container > div > div.commit.full-commit.mt-0.px-2.pt-2" ,
291
291
insertBefore : "#browse-at-time-link" ,
292
- containerElement : createElement ( "div" , {
292
+ containerElement : createContainerElement ( "div" , {
293
293
float : "right" ,
294
294
marginLeft : "8px" ,
295
295
} ) ,
@@ -302,7 +302,7 @@ export const buttonContributions: ButtonContributionParams[] = [
302
302
exampleUrls : [ "https://github.com/svenefftinge/browser-extension-test/issues/1" ] ,
303
303
selector : "[data-component='PH_Actions'] > div" , //
304
304
insertBefore : "[data-component='PH_Actions'] > div > button" ,
305
- containerElement : createElement ( "div" , { } ) ,
305
+ containerElement : createContainerElement ( "div" , { } ) ,
306
306
match : / \/ i s s u e s \/ / ,
307
307
application : "github" ,
308
308
additionalClassNames : [ "tall" ] ,
@@ -311,7 +311,7 @@ export const buttonContributions: ButtonContributionParams[] = [
311
311
id : "gh-issue-new" , // this isn't referring to "new issue", but to new "issue"
312
312
exampleUrls : [ "https://github.com/svenefftinge/browser-extension-test/issues/1" ] ,
313
313
selector : `xpath://*[@id="js-repo-pjax-container"]/react-app/div/div/div/div/div[1]/div/div/div[3]/div` ,
314
- containerElement : createElement ( "div" , { } ) ,
314
+ containerElement : createContainerElement ( "div" , { } ) ,
315
315
insertBefore : `xpath://*[@id="js-repo-pjax-container"]/react-app/div/div/div/div/div[1]/div/div/div[3]/div/div` ,
316
316
application : "github" ,
317
317
// we need to make the button higher: the buttons here use 2rem instead of 1.75rem
@@ -321,7 +321,7 @@ export const buttonContributions: ButtonContributionParams[] = [
321
321
id : "gh-pull" ,
322
322
exampleUrls : [ "https://github.com/svenefftinge/browser-extension-test/pull/2" ] ,
323
323
selector : "#partial-discussion-header div.gh-header-show > div > div" ,
324
- containerElement : createElement ( "div" , {
324
+ containerElement : createContainerElement ( "div" , {
325
325
order : "2" ,
326
326
} ) ,
327
327
match : / \/ p u l l \/ / ,
@@ -334,7 +334,7 @@ export const buttonContributions: ButtonContributionParams[] = [
334
334
// "https://github.com/svenefftinge/browser-extension-test/pull/2/files" // this is an experiment for now, and we can't test against GitHub's feature flags yet
335
335
] ,
336
336
selector : "div[data-component='PH_Actions']" ,
337
- containerElement : createElement ( "div" , {
337
+ containerElement : createContainerElement ( "div" , {
338
338
order : "2" ,
339
339
} ) ,
340
340
match : / \/ p u l l \/ / ,
@@ -344,7 +344,7 @@ export const buttonContributions: ButtonContributionParams[] = [
344
344
id : "gh-file" ,
345
345
exampleUrls : [ "https://github.com/svenefftinge/browser-extension-test/blob/my-branch/README.md" ] ,
346
346
selector : "#StickyHeader > div > div > div.Box-sc-g0xbh4-0.gtBUEp" ,
347
- containerElement : createElement ( "div" , {
347
+ containerElement : createContainerElement ( "div" , {
348
348
marginLeft : "8px" ,
349
349
} ) ,
350
350
application : "github" ,
@@ -357,7 +357,7 @@ export const buttonContributions: ButtonContributionParams[] = [
357
357
] ,
358
358
selector :
359
359
"#repo-content-pjax-container > div > div.d-md-flex.flex-items-stretch.gutter-md.mb-4 > div.col-md-6.mb-4.mb-md-0 > div,#repo-content-turbo-frame > div > div.d-md-flex.flex-items-stretch.gutter-md.mb-4 > div.col-md-6.mb-4.mb-md-0 > div" ,
360
- containerElement : createElement ( "div" , { } ) ,
360
+ containerElement : createContainerElement ( "div" , { } ) ,
361
361
application : "github" ,
362
362
manipulations : [
363
363
{
@@ -387,7 +387,7 @@ export const buttonContributions: ButtonContributionParams[] = [
387
387
selector :
388
388
"#main > div.aui-toolbar2.branch-selector-toolbar > div > div.aui-toolbar2-primary > div > div:nth-child(1) > div" ,
389
389
insertBefore : "#branch-actions" ,
390
- containerElement : createElement ( "div" , {
390
+ containerElement : createContainerElement ( "div" , {
391
391
marginLeft : "2px" ,
392
392
} ) ,
393
393
application : "bitbucket-server" ,
@@ -402,7 +402,7 @@ export const buttonContributions: ButtonContributionParams[] = [
402
402
selector : "#pull-requests-container > header > div.pull-request-header-bar > div.pull-request-actions" ,
403
403
insertBefore :
404
404
"#pull-requests-container > header > div.pull-request-header-bar > div.pull-request-actions > div.pull-request-more-actions" ,
405
- containerElement : createElement ( "div" , {
405
+ containerElement : createContainerElement ( "div" , {
406
406
marginLeft : "2px" ,
407
407
} ) ,
408
408
application : "bitbucket-server" ,
@@ -419,7 +419,7 @@ export const buttonContributions: ButtonContributionParams[] = [
419
419
selector : 'xpath://*[@id="main"]/div/div/div[1]/div/header/div/div/div/div[2]/div' ,
420
420
insertBefore :
421
421
"#main > div > div > div.css-1m2ufqk.efo6slf1 > div > header > div > div > div > div.css-1ianfu6 > div > div:nth-child(2)" ,
422
- containerElement : createElement ( "div" , {
422
+ containerElement : createContainerElement ( "div" , {
423
423
marginLeft : "2px" ,
424
424
} ) ,
425
425
application : "bitbucket" ,
@@ -430,7 +430,7 @@ export const buttonContributions: ButtonContributionParams[] = [
430
430
// "https://bitbucket.org/efftinge/browser-extension-test/pull-requests/1"
431
431
] ,
432
432
selector : 'xpath://*[@id="main"]/div/div/div[1]/div/div/div/div[1]/div/div[2]/div/div[2]/div/div' , // grandparent div of the "Request changes" and "Approve" buttons
433
- containerElement : createElement ( "div" , { } ) ,
433
+ containerElement : createContainerElement ( "div" , { } ) ,
434
434
insertBefore :
435
435
'xpath:(//*[@id="main"]/div/div/div[1]/div/div/div/div[1]/div/div[2]/div/div[2]/div/div/div)[last()]' , // note the [last()] to insert before the last child (the kebab menu)
436
436
application : "bitbucket" ,
@@ -442,7 +442,7 @@ export const buttonContributions: ButtonContributionParams[] = [
442
442
// "https://bitbucket.org/efftinge/browser-extension-test/branch/my-branch"
443
443
] ,
444
444
selector : 'xpath://*[@id="main"]/div/div/div[1]/div/div/div[2]/div/div' , // action bar section with the last action of "Settings"
445
- containerElement : createElement ( "div" , {
445
+ containerElement : createContainerElement ( "div" , {
446
446
marginLeft : "2px" ,
447
447
} ) ,
448
448
application : "bitbucket" ,
@@ -452,7 +452,7 @@ export const buttonContributions: ButtonContributionParams[] = [
452
452
match : / \/ c o m m i t s \/ ( .+ ) ? / ,
453
453
exampleUrls : [ "https://bitbucket.org/efftinge/browser-extension-test/commits/" ] ,
454
454
selector : 'xpath://*[@id="main"]/div/div/div[1]/div/div/div[1]/div[1]/div[2]/div' ,
455
- containerElement : createElement ( "div" , {
455
+ containerElement : createContainerElement ( "div" , {
456
456
marginLeft : "2px" ,
457
457
} ) ,
458
458
application : "bitbucket" ,
0 commit comments