Skip to content

Instantly share code, notes, and snippets.

@Fuud
Created January 12, 2024 10:18
Show Gist options
  • Save Fuud/e15d378f7b3f5428d7a31ab17560da0a to your computer and use it in GitHub Desktop.
Save Fuud/e15d378f7b3f5428d7a31ab17560da0a to your computer and use it in GitHub Desktop.
if (window.location == "https://stash.odkl.ru/dashboard"){
$(".pull-request-row").each(function (i, e){
const titleA = $(e).find(" .title a");
const url = "https://stash.odkl.ru/rest/api/latest" + $(titleA).attr("href").replace("/overview", "");
$.getJSON(url, function (data){
$(e).find(".details .pr-project-repo").after(`
<span class="ref-lozenge details-item"
data-project-key="ODKL"
data-repo-slug="odnoklassniki-webrtc">
<span role="presentation">
<span class="ref-lozenge-content" role="presentation">
<span>${data.fromRef.displayId}</span>
</span>
</span>
</span>
<span> &#10132; </span>
`)
});
});
}
if (window.location.pathname.endsWith("/pull-requests")){
$(".pull-request-row").each(function (i, e){
const titleA = $(e).find(" .pull-request-title");
if (titleA.size() === 1) {
const url = "https://stash.odkl.ru/rest/api/latest" + $(titleA).attr("href").replace("/overview", "");
$.getJSON(url, function (data) {
console.log(data.fromRef.displayId)
$(e).find(".aui-iconfont-arrow-right").before(`
<span>&nbsp;</span>
<span class="ref-label">
<span class="ref BRANCH">
<span class="name" aria-label="branch ${data.fromRef.displayId}">${data.fromRef.displayId}</span>
</span>
</span>
`)
});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment