add editability

This commit is contained in:
2023-06-10 13:59:08 +02:00
parent a6ea3abe90
commit d44a4b8d7e
3 changed files with 64 additions and 40 deletions

View File

@@ -20,7 +20,7 @@
let nickname = $("#addnickname").val();
$.post("api.php",
{
action: "set",
action: "addlink",
password: password,
id: id,
contentid: contentid,
@@ -33,15 +33,12 @@
function justaddc(){
let id = $("#addidc").val();
let content = $("#addcontentc").val();
let type = "normal";
type = $("#addtypec").val();
$.post("api.php",
{
action: "setcontent",
action: "addcontent",
password: password,
id: id,
content: content,
type: type,
}, function( data ) {
getcontents();
});
@@ -57,6 +54,36 @@
});
}
function upcthis(name){
let id = $("#addidc_" + name).val();
let contentin = $("#addcontentc_" + name).val();
$.post("api.php",
{
action: "setcontent",
idwhere: name,
id: id,
content: contentin,
}, function( data ) {
getcontents();
});
}
function uplinkthis(name){
let id = $("#addid_" + name).val();
let contentid = $("#addcontentid_" + name).val();
let nickname = $("#addnickname_" + name).val();
$.post("api.php",
{
action: "setlink",
idwhere: name,
id: id,
contentid: contentid,
nickname: nickname,
}, function( data ) {
getcontents();
});
}
function getcontents(){
$.post("api.php",
{
@@ -82,7 +109,7 @@
function delthis(name){
$.post("api.php",
{
action: "delete",
action: "deletelink",
id: name
}, function( data ) {
getlinks();
@@ -125,7 +152,7 @@
function getlinks(){
$.post("api.php",
{
action: "get"
action: "getlinks"
}, function( data ) {
$("#linkslist").html(data);
$("#addnickname").keyup(function(event) {