Add fix to download widget for titles with unescaped characters

このコミットが含まれているのは:
Omar Roth 2019-01-24 00:01:56 -06:00
コミット 1a9057a175
2個のファイルの変更3行の追加2行の削除

ファイルの表示

@ -51,7 +51,8 @@ function hide_youtube_replies(target) {
target.setAttribute("onclick", "show_youtube_replies(this)"); target.setAttribute("onclick", "show_youtube_replies(this)");
} }
function download_video(title) { function download_video(target) {
var title = target.getAttribute("data-title");
var children = document.getElementById("download_widget").children; var children = document.getElementById("download_widget").children;
var progress = document.getElementById("download-progress"); var progress = document.getElementById("download-progress");
var url = ""; var url = "";

ファイルの表示

@ -75,7 +75,7 @@
</div> </div>
</div> </div>
<button type="button" onclick='download_video("<%= video.title.dump_unquoted %>-<%= video.id %>.mp4")' <button type="button" data-title="<%= video.title.dump_unquoted %>-<%= video.id %>.mp4" onclick="download_video(this)"
class="pure-button pure-button-primary"> class="pure-button pure-button-primary">
<%= translate(locale, "Download") %> <%= translate(locale, "Download") %>
</button> </button>