Skip to content

Commit cd1a788

Browse files
authored
PRT-874: put the correct branch name in generated github link (#265)
1 parent 490c928 commit cd1a788

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/webapp/scripts/externalTinymcePlugins/github/dialog.htm

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
</div>
3434
<input id="gitHubHash" type="hidden" />
3535
<input id="gitHubRepo" type="hidden" />
36+
<input id="gitHubBranch" type="hidden" />
3637
<input id="gitHubPath" type="hidden" />
3738
</fieldset>
3839
</div>

src/main/webapp/scripts/externalTinymcePlugins/github/js/dialog.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ var githubDialog = {
2020
$('#gitHubRepo').val(splitFile[0]);
2121
$('#gitHubHash').val(splitFile[1]);
2222
$('#gitHubPath').val(splitFile[2]);
23+
24+
var branch = $('a[data-name="' + name +'"]').attr('rel').split('#')[1];
25+
$('#gitHubBranch').val(branch);
2326
}
2427
});
2528
},
@@ -28,7 +31,8 @@ var githubDialog = {
2831
var json = {
2932
id: 'github-' + $('#gitHubHash').val(),
3033
fileStore: 'github',
31-
recordURL: 'https://github.com/' + $('#gitHubRepo').val() + '/blob/master' + $('#gitHubPath').val(),
34+
recordURL: 'https://github.com/' + $('#gitHubRepo').val() + '/blob/'
35+
+ $('#gitHubBranch').val() + $('#gitHubPath').val(),
3236
name: $('#gitHubPath').val().split("/").splice(-1)[0],
3337
iconPath: '/images/icons/textBig.png',
3438
badgeIconPath: '/images/icons/GitHub-Mark-64px.png'

0 commit comments

Comments
 (0)