my_collect.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. function my_collect_list() {
  2. $.get(
  3. "../article/collect_list.php",
  4. {
  5. userid: getCookie("userid"),
  6. setting: "",
  7. },
  8. function (data, status) {
  9. if (status == "success") {
  10. try {
  11. let html = "";
  12. let result = JSON.parse(data);
  13. let key = 1;
  14. for (const iterator of result) {
  15. html += '<div class="file_list_row" style="padding:5px;">';
  16. html +=
  17. '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
  18. html += "<div style='flex:1;'>" + key++ + "</div>";
  19. html += "<div style='flex:2;'>" + iterator.title + "</div>";
  20. html +=
  21. "<div style='flex:2;'>" +
  22. render_status(iterator.status) +
  23. "</div>";
  24. html += "<div style='flex:1;'>Copy Link</div>";
  25. html +=
  26. "<div style='flex:1;'><a href='../article/my_article_edit.php?id=" +
  27. iterator.id +
  28. "'>Edit</a></div>";
  29. html +=
  30. "<div style='flex:1;'><a href='../article/?id=" +
  31. iterator.id +
  32. "' target='_blank'>Preview</a></div>";
  33. html += "<div style='flex:1;'>15</div>";
  34. html += "</div>";
  35. }
  36. $("#article_list").html(html);
  37. } catch (e) {
  38. console.error(e);
  39. }
  40. } else {
  41. console.error("ajex error");
  42. }
  43. }
  44. );
  45. }