mirror of
https://github.com/FAUSheppy/oh-my-nemesis
synced 2025-12-11 00:58:34 +01:00
Initial (reset)
This commit is contained in:
49
static/team_champselect.js
Normal file
49
static/team_champselect.js
Normal file
@@ -0,0 +1,49 @@
|
||||
function saveToServer(){
|
||||
var xhttp = new XMLHttpRequest();
|
||||
|
||||
champ = "Atrox"
|
||||
position = "Top"
|
||||
affinity = "5"
|
||||
|
||||
req = "/save?type=teamChampSelect" + "&champ=" + cahmp
|
||||
+ "&position=" + position
|
||||
+ "&affinity=" + affinity
|
||||
xhttp.open("POST", req, true);
|
||||
//xhttp.setRequestHeader('Content-Type', 'application/json');
|
||||
xhttp.send(json)
|
||||
}
|
||||
|
||||
|
||||
function addChamp(selectorId, role){
|
||||
champ = document.getElementById(selectorId).value
|
||||
url = window.location.href + "?" + "role=" + role +
|
||||
"&" + "champ=" + champ +
|
||||
"&" + "action=" + "add"
|
||||
fetch(url, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
referrerPolicy: 'strict-origin'
|
||||
}
|
||||
).then(window.location.reload());
|
||||
}
|
||||
|
||||
|
||||
function removeChamp(champ, role){
|
||||
url = window.location.href + "?" + "role=" + role +
|
||||
"&" + "champ=" + champ +
|
||||
"&" + "action=" + "remove"
|
||||
fetch(url, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
referrerPolicy: 'strict-origin'
|
||||
}
|
||||
).then(window.location.reload());
|
||||
}
|
||||
Reference in New Issue
Block a user