diff --git a/mumu-test.html b/mumu-test.html index ac2de3a..34eb4f1 100644 --- a/mumu-test.html +++ b/mumu-test.html @@ -69,6 +69,7 @@ } var history_shift = 0; var history_page = 0; + var history_id_roll = 0; var loadHistory = function(){ history_page++; $.get("https://mumu.irin.in.th/history?access_token="+sessionStorage.token+"&limit="+(((history_page-1)*10)+history_shift)+",10",function(r){ @@ -80,13 +81,14 @@ } r.forEach(function(q){ var add_date = new Date(q.ADD_DATE); - $("#history-display").append(""+q.INPUT+""+q.REPLY+""+zerogap(add_date.getDate())+"/"+zerogap(add_date.getMonth())+"/"+(add_date.getFullYear()+543)+" "+zerogap(add_date.getHours())+":"+zerogap(add_date.getMinutes())+""); + $("#history-display").append(""+q.INPUT+""+q.REPLY+""+zerogap(add_date.getDate())+"/"+zerogap(add_date.getMonth())+"/"+(add_date.getFullYear()+543)+" "+zerogap(add_date.getHours())+":"+zerogap(add_date.getMinutes())+""); + history_id_roll++; }); $("#history-spinner").remove(); }); } - var historyEdit = function(input,reply){ - $("#REPLY_"+input+"_"+reply).replaceWith(""); + var historyEdit = function(input,reply,history_id_roll){ + $("#REPLY_"+history_id_roll).replaceWith(""); } var clickloadHistory = function(){ $("#history-display").append("
"); @@ -141,7 +143,8 @@ if($("#history-nothing").length){ $("#history-nothing").remove(); } - $("#history-display").prepend(""+cin+""+cout+""+zerogap(add_date.getDate())+"/"+zerogap(add_date.getMonth())+"/"+(add_date.getFullYear()+543)+" "+zerogap(add_date.getHours())+":"+zerogap(add_date.getMinutes())+""); + $("#history-display").prepend(""+cin+""+cout+""+zerogap(add_date.getDate())+"/"+zerogap(add_date.getMonth())+"/"+(add_date.getFullYear()+543)+" "+zerogap(add_date.getHours())+":"+zerogap(add_date.getMinutes())+""); + history_id_roll++; history_shift++; $('#addwordcomplete').stop().fadeIn(400).delay(3000).fadeOut(400);