From 5a2ef2d24d04eabb5a1d7f4629bdfed620b6625a Mon Sep 17 00:00:00 2001 From: calzoneman Date: Sun, 20 Dec 2015 22:35:24 -0800 Subject: [PATCH] Minor fixes for queueWarn --- src/channel/playlist.js | 6 ++++-- www/js/util.js | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/channel/playlist.js b/src/channel/playlist.js index e9e00a21..295c6a56 100644 --- a/src/channel/playlist.js +++ b/src/channel/playlist.js @@ -921,7 +921,8 @@ PlaylistModule.prototype._addItem = function (media, data, user, cb) { if (media.type === "fi" && media.meta.bitrate > 1000) { user.socket.emit("queueWarn", { msg: "This video has a bitrate over 1000kbps. Clients with slow " + - "connections may experience lots of buffering." + "connections may experience lots of buffering.", + link: data.link }); } @@ -933,7 +934,8 @@ PlaylistModule.prototype._addItem = function (media, data, user, cb) { user.socket.emit("queueWarn", { msg: "The codec " + media.meta.codec + " is not supported " + "by all browsers, and is not supported by the flash fallback layer. " + - "This video may not play for some users." + "This video may not play for some users.", + link: data.link }); } diff --git a/www/js/util.js b/www/js/util.js index 3d7a1ccd..a2c3ff43 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -2018,9 +2018,7 @@ function queueMessage(data, type) { var alerts = $(".qfalert.qf-" + type + " .alert"); for (var i = 0; i < alerts.length; i++) { var al = $(alerts[i]); - var cl = al.clone(); - cl.children().remove(); - if (cl.text() === data.msg) { + if (al.data("reason") === data.msg) { var tag = al.find("." + ltype); if (tag.length > 0) { var morelinks = al.find(".qflinks"); @@ -2057,9 +2055,10 @@ function queueMessage(data, type) { text += "
" + data.link + ""; } - makeAlert(title, text, type) + var newAlert = makeAlert(title, text, type) .addClass("linewrap qfalert qf-" + type) .appendTo($("#queuefail")); + newAlert.find(".alert").data("reason", data.msg); } function setupChanlogFilter(data) {