@@ -38,24 +38,24 @@ export interface ButtonContributionParams {
38
38
id : string ,
39
39
40
40
/**
41
- *
41
+ *
42
42
*/
43
43
exampleUrls : string [ ] ,
44
44
45
45
/**
46
46
* A CSS selector that matches the parent element in which the button should be inserted.
47
- *
47
+ *
48
48
* Use the developer tools -> right click on the element -> "copy JS path" to get the selector.
49
49
*/
50
50
selector : string ,
51
51
52
52
/**
53
53
* The element in which the button should be inserted.
54
- *
54
+ *
55
55
* This element will be inserted into teh main document and allows for styling within the original page.
56
- *
56
+ *
57
57
* The structure looks like this:
58
- *
58
+ *
59
59
* <selector>
60
60
* <some other elements/> ....
61
61
* <containerElement>
@@ -94,7 +94,7 @@ export interface ButtonContributionParams {
94
94
95
95
/**
96
96
* A list of manipulations that should be applied to the document.
97
- *
97
+ *
98
98
* Each manipulation contains a CSS selector (element) that is used to find the element to manipulate and optionally
99
99
* the classnames to remove and add.
100
100
*/
@@ -126,7 +126,7 @@ export const buttonContributions: ButtonContributionParams[] = [
126
126
application : "gitlab" ,
127
127
manipulations : [
128
128
{
129
- // make the clone button secondary
129
+ // make the clone button secondary
130
130
element : "#clone-dropdown" ,
131
131
remove : "btn-confirm" ,
132
132
}
@@ -143,7 +143,7 @@ export const buttonContributions: ButtonContributionParams[] = [
143
143
application : "gitlab" ,
144
144
manipulations : [
145
145
{
146
- // make the clone button secondary
146
+ // make the clone button secondary
147
147
element : "#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" ,
148
148
remove : "btn-confirm" ,
149
149
}
@@ -161,7 +161,7 @@ export const buttonContributions: ButtonContributionParams[] = [
161
161
insertBefore : "#content-body > div.merge-request > div.detail-page-header.border-bottom-0.gl-display-block.gl-pt-5.gl-md-display-flex\\!.is-merge-request > div.detail-page-header-actions.gl-align-self-start.is-merge-request.js-issuable-actions.gl-display-flex > div.gl-display-flex.gl-justify-content-end.gl-w-full.gl-relative" ,
162
162
manipulations : [
163
163
{
164
- // make the clone button secondary
164
+ // make the clone button secondary
165
165
element : "#content-body > div.merge-request > div.detail-page-header.border-bottom-0.gl-display-block.gl-pt-5.gl-md-display-flex\\!.is-merge-request > div.detail-page-header-actions.gl-align-self-start.is-merge-request.js-issuable-actions.gl-display-flex > div.gl-md-ml-3.dropdown.gl-dropdown.gl-display-none\\!.gl-md-display-flex\\! > button" ,
166
166
remove : "btn-confirm" ,
167
167
}
@@ -188,16 +188,16 @@ export const buttonContributions: ButtonContributionParams[] = [
188
188
} ,
189
189
] ,
190
190
} ,
191
-
191
+
192
192
// GitHub
193
193
{
194
- id : "gh-new- repo" ,
194
+ id : "gh-repo" ,
195
195
exampleUrls : [
196
196
// disabled testing, because the new layout doesn't show as an anonymous user
197
- // "https://github.com/svenefftinge/browser-extension-test",
198
- // "https://github.com/svenefftinge/browser-extension-test/tree/my-branch",
197
+ "https://github.com/svenefftinge/browser-extension-test" ,
198
+ "https://github.com/svenefftinge/browser-extension-test/tree/my-branch" ,
199
199
] ,
200
- selector : `xpath://*[@id="repo-content-pjax-container"]/div/div/div[2]/div[1]/react-partial/div/div/div[1]/div/div/div[2]/div[2]/div/div[3]/div[1 ]/div[2]` ,
200
+ selector : `xpath://*[@id="repo-content-pjax-container"]/div/div/div[2]/div[1]/react-partial/div/div/div[2 ]/div[2]` ,
201
201
containerElement : createElement ( "div" , { } ) ,
202
202
additionalClassNames : [ "medium" ] ,
203
203
application : "github" ,
@@ -220,7 +220,7 @@ export const buttonContributions: ButtonContributionParams[] = [
220
220
application : "github" ,
221
221
additionalClassNames : [ "medium" ] ,
222
222
} ,
223
-
223
+
224
224
{
225
225
id : "gh-issues" ,
226
226
exampleUrls : [
@@ -234,7 +234,7 @@ export const buttonContributions: ButtonContributionParams[] = [
234
234
application : "github" ,
235
235
manipulations : [
236
236
{
237
- // make the code button secondary
237
+ // make the code button secondary
238
238
element : "#partial-discussion-header > div.gh-header-show > div > div > a" ,
239
239
remove : "Button--primary" ,
240
240
add : "Button--secondary"
@@ -253,28 +253,6 @@ export const buttonContributions: ButtonContributionParams[] = [
253
253
match : / \/ p u l l \/ / ,
254
254
application : "github" ,
255
255
} ,
256
- // Look into removing since GitHub is shifting to the new repo layout (see gh-new-repo)
257
- {
258
- id : "gh-repo" ,
259
- exampleUrls : [
260
- "https://github.com/svenefftinge/browser-extension-test" ,
261
- "https://github.com/svenefftinge/browser-extension-test/tree/my-branch" ,
262
- ] ,
263
- selector : "#repo-content-turbo-frame > div > div > div.Layout.Layout--flowRow-until-md.Layout--sidebarPosition-end.Layout--sidebarPosition-flowRow-end > div.Layout-main > div.file-navigation.mb-3.d-flex.flex-items-start,#repo-content-pjax-container > div > div > div.Layout.Layout--flowRow-until-md.Layout--sidebarPosition-end.Layout--sidebarPosition-flowRow-end > div.Layout-main > div.file-navigation.mb-3.d-flex.flex-items-start" ,
264
- containerElement : createElement ( "div" , {
265
- marginLeft : "8px" ,
266
- } ) ,
267
- application : "github" ,
268
- additionalClassNames : [ "medium" ] ,
269
- manipulations : [
270
- {
271
- // make the code button secondary
272
- element : "#repo-content-pjax-container > div > div > div.Layout.Layout--flowRow-until-md.Layout--sidebarPosition-end.Layout--sidebarPosition-flowRow-end > div.Layout-main > div.file-navigation.mb-3.d-flex.flex-items-start > span.d-none.d-md-flex.ml-2 > get-repo > details > summary" ,
273
- remove : "Button--primary" ,
274
- add : "Button--secondary"
275
- }
276
- ] ,
277
- } ,
278
256
{
279
257
id : "gh-file" ,
280
258
exampleUrls : [
@@ -309,7 +287,7 @@ export const buttonContributions: ButtonContributionParams[] = [
309
287
}
310
288
}
311
289
]
312
-
290
+
313
291
} ,
314
292
// Bitbucket Server
315
293
{
@@ -391,4 +369,4 @@ export const buttonContributions: ButtonContributionParams[] = [
391
369
} ) ,
392
370
application : "bitbucket" ,
393
371
}
394
- ] ;
372
+ ] ;
0 commit comments