2022-06-08 10:50:21 +08:00
|
|
|
function familiar(index) {
|
2022-07-18 12:02:15 +08:00
|
|
|
let username = $("#username").text();
|
|
|
|
let word = $("#word_" + index).text();
|
|
|
|
let freq = $("#freq_" + index).text();
|
2022-06-08 10:50:21 +08:00
|
|
|
$.ajax({
|
|
|
|
type:"get",
|
|
|
|
url:"/" + username + "/" + word + "/familiar",
|
2022-07-18 12:03:39 +08:00
|
|
|
success:function(response){
|
2022-07-18 12:02:15 +08:00
|
|
|
let new_freq = freq - 1;
|
2022-06-08 10:50:21 +08:00
|
|
|
if(new_freq <1) {
|
|
|
|
$("#p_" + index).remove();
|
|
|
|
} else {
|
|
|
|
$("#freq_" + index).text(new_freq);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function unfamiliar(index) {
|
2022-07-18 12:02:15 +08:00
|
|
|
let username = $("#username").text();
|
|
|
|
let word = $("#word_" + index).text();
|
|
|
|
let freq = $("#freq_" + index).text();
|
2022-06-08 10:50:21 +08:00
|
|
|
$.ajax({
|
|
|
|
type:"get",
|
|
|
|
url:"/" + username + "/" + word + "/unfamiliar",
|
2022-07-18 12:03:39 +08:00
|
|
|
success:function(response){
|
2022-07-18 12:02:15 +08:00
|
|
|
let new_freq = parseInt(freq) + 1;
|
2022-06-08 10:50:21 +08:00
|
|
|
$("#freq_" + index).text(new_freq);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function del_word(index) {
|
2022-07-18 12:02:15 +08:00
|
|
|
let username = $("#username").text();
|
|
|
|
let word = $("#word_" + index).text();
|
2022-06-08 10:50:21 +08:00
|
|
|
$.ajax({
|
|
|
|
type:"get",
|
|
|
|
url:"/" + username + "/" + word + "/del",
|
2022-07-18 12:03:39 +08:00
|
|
|
success:function(response){
|
2022-06-08 10:50:21 +08:00
|
|
|
$("#p_" + index).remove();
|
|
|
|
}
|
|
|
|
});
|
2022-07-18 12:02:15 +08:00
|
|
|
}
|