diff --git a/frontends/ycdl_flask/static/js/common.js b/frontends/ycdl_flask/static/js/common.js index 1a92cc7..e27add4 100644 --- a/frontends/ycdl_flask/static/js/common.js +++ b/frontends/ycdl_flask/static/js/common.js @@ -106,6 +106,14 @@ function entry_with_history_hook(box, button) } } +common.html_to_element = +function html_to_element(html) +{ + var template = document.createElement("template"); + template.innerHTML = html; + return template.content.firstChild; +} + common.init_atag_merge_params = function init_atag_merge_params() { diff --git a/frontends/ycdl_flask/templates/channel.html b/frontends/ycdl_flask/templates/channel.html index 4962a88..2cd4ebf 100644 --- a/frontends/ycdl_flask/templates/channel.html +++ b/frontends/ycdl_flask/templates/channel.html @@ -310,7 +310,7 @@ function toggle_embed_video(video_id) if (embeds.length == 0) { var html = `
` - var embed = html_to_element(html); + var embed = common.html_to_element(html); embed_toolbox.appendChild(embed); show_button.classList.add("hidden"); hide_button.classList.remove("hidden"); @@ -333,13 +333,6 @@ function deselect_all() video_card_selections = []; } -function html_to_element(html) -{ - var template = document.createElement("template"); - template.innerHTML = html; - return template.content.firstChild; -} - function onclick_select(event) { if (!event.target.classList.contains("video_card"))