Created
January 12, 2024 10:18
-
-
Save Fuud/e15d378f7b3f5428d7a31ab17560da0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> ➔ </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> </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