diff --git a/board/static/board/post.js b/board/static/board/post.js index 53228cb..4fea7bd 100644 --- a/board/static/board/post.js +++ b/board/static/board/post.js @@ -345,6 +345,27 @@ $(window).on("load", () => { $(e.target).attr("src", thumbUrl); } }); + + $(".youtube_embed_link").on("click", (e) => { + e.preventDefault(); + let fullEnt = $(e.target).parents(".youtube_embed"); + let frame = fullEnt.find(".youtube_embed_frame"); + if (frame.length) { + frame.remove(); + } else { + let hash = $(e.target).attr("data-yt-hash"); + let embed = $("") + .attr("class", "youtube_embed_frame") + .append("
") + .append( + $("