mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
* Change action GETs to POST * submite = submit + smite * No more # href * Fix test * Match other tests * Explicit csrf Signed-off-by: jolheiser <[email protected]> Co-authored-by: guillep2k <[email protected]>
This commit is contained in:
co-authored by
GitHub
guillep2k
parent
3abb25166c
commit
4cb18601ff
@@ -2479,6 +2479,7 @@ $(document).ready(() => {
|
||||
// Helpers.
|
||||
$('.delete-button').click(showDeletePopup);
|
||||
$('.add-all-button').click(showAddAllPopup);
|
||||
$('.link-action').click(linkAction);
|
||||
|
||||
$('.delete-branch-button').click(showDeletePopup);
|
||||
|
||||
@@ -2736,6 +2737,19 @@ function showAddAllPopup() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function linkAction() {
|
||||
const $this = $(this);
|
||||
$.post($this.data('url'), {
|
||||
_csrf: csrf
|
||||
}).done((data) => {
|
||||
if (data.redirect) {
|
||||
window.location.href = data.redirect;
|
||||
} else {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initVueComponents() {
|
||||
const vueDelimeters = ['${', '}'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user