[ai] new option on how to continue for mapping
This commit is contained in:
@@ -164,13 +164,17 @@ function playNamedSong(song) {
|
||||
function editMapping() {
|
||||
var rfid = document.getElementById('rfid').value;
|
||||
var song = document.getElementById('song').value;
|
||||
var modeEl = document.getElementById('mode');
|
||||
var mode = modeEl ? modeEl.value : 's';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "/edit_mapping", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
|
||||
xhr.send("rfid=" + encodeURIComponent(rfid) + "&song=" + encodeURIComponent(song));
|
||||
xhr.send("rfid=" + encodeURIComponent(rfid) + "&song=" + encodeURIComponent(song) + "&mode=" + encodeURIComponent(mode));
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
alert("Mapping updated successfully!");
|
||||
} else if (xhr.readyState === 4) {
|
||||
alert("Failed to update mapping: " + (xhr.responseText || xhr.status));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user