function index_onload() { index_load_term_new(); index_load_collect_new(); index_load_course_new(); } function index_load_collect_new() { $.get( "../collect/list.php", { begin: 0, page: 4, }, function (data, status) { let arrCollectList = JSON.parse(data); let html = ""; for (const iterator of arrCollectList.data) { html += "
"; html += '
'; html += "
" + gLocal.gui.ongoing + "
"; html += "
"; html += "
"; gLocal.gui.ongoing + "
"; html += "
"; html += "" + iterator.title + ""; html += "
"; if(iterator.subtitle){ html += "
" + iterator.subtitle + "
"; } html += "
" + iterator.username.nickname + "
"; if(iterator.summary){ html += "
" + iterator.summary + "
"; } if( iterator.tag){ html +="
" + iterator.tag + "
"; } const article_limit = 4; let article_count = 0; let article_list = JSON.parse(iterator.article_list); for (const article of article_list) { html += "
"; html += "" + article.title + ""; html += "
"; article_count++; if (article_count > article_limit) { break; } } html += "
"; html += ""; } $("#article_new").html(html); } ); } function index_load_term_new() { $.get("../term/new.php", function (data, status) { let xDiv = document.getElementById("pali_pedia"); if (xDiv) { xDiv.innerHTML = data; } }); } function index_load_course_new() { $.get("../course/list_new.php", function (data, status) { let xDiv = document.getElementById("course_list_new"); if (xDiv) { xDiv.innerHTML = data; } }); }