function pali_sim_dlg_init(title = "Sim") { $("body").append('
'); $("#pali_sim_dlg").dialog({ autoOpen: false, width: 550, buttons: [ { text: "Close", click: function () { $(this).dialog("close"); }, }, ], }); } function pali_sim_dlg_open(id, start, length) { { $.post( "../pali_sent/get_sim.php", { sent_id: id, start: start, length: length, }, function (data) { let sents = JSON.parse(data); let html = pali_sim_dlg_render(sents); $("#pali_sim_dlg_content").html(html); $("#pali_sim_dlg").dialog("open"); } ); } } function pali_sim_dlg_render(sent_list) { let output = ""; for (const iterator of sent_list) { output += "
"; output += "
" + iterator.text + "
"; output += "
" + iterator.path + "
"; output += "
"; } return output; }