Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot] 0d8b516b6f
Merge d41a3d1ece into 227244e2d0 2023-07-11 17:50:21 +00:00
2 changed files with 6 additions and 17 deletions

View File

@ -18,12 +18,7 @@ window.DailymotionPlayer = class DailymotionPlayer extends Player
if quality != 'auto' if quality != 'auto'
params.quality = quality params.quality = quality
@element = DM.$('ytapiplayer') @dm = DM.player('ytapiplayer',
if not @element or @element.nodeType != Node.ELEMENT_NODE
throw new Error("Invalid player element in DailymotionPlayer(), requires an existing HTML element: " + @element)
if DM.Player._INSTANCES[@element.id] != undefined
@element = DM.Player.destroy(@element.id)
@dm = DM.Player.create(@element,
video: data.id video: data.id
width: parseInt(VWIDTH, 10) width: parseInt(VWIDTH, 10)
height: parseInt(VHEIGHT, 10) height: parseInt(VHEIGHT, 10)

View File

@ -2702,7 +2702,8 @@ function execEmotes(msg) {
} }
CHANNEL.emotes.forEach(function (e) { CHANNEL.emotes.forEach(function (e) {
msg = msg.replace(e.regex, '$1' + emoteToImg(e).outerHTML); msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
e.image + '" title="' + e.name + '">');
}); });
return msg; return msg;
@ -2710,12 +2711,13 @@ function execEmotes(msg) {
function execEmotesEfficient(msg) { function execEmotesEfficient(msg) {
CHANNEL.badEmotes.forEach(function (e) { CHANNEL.badEmotes.forEach(function (e) {
msg = msg.replace(e.regex, '$1' + emoteToImg(e).outerHTML); msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
e.image + '" title="' + e.name + '">');
}); });
msg = msg.replace(/[^\s]+/g, function (m) { msg = msg.replace(/[^\s]+/g, function (m) {
if (CHANNEL.emoteMap.hasOwnProperty(m)) { if (CHANNEL.emoteMap.hasOwnProperty(m)) {
var e = CHANNEL.emoteMap[m]; var e = CHANNEL.emoteMap[m];
return emoteToImg(e).outerHTML; return '<img class="channel-emote" src="' + e.image + '" title="' + e.name + '">';
} else { } else {
return m; return m;
} }
@ -2723,14 +2725,6 @@ function execEmotesEfficient(msg) {
return msg; return msg;
} }
function emoteToImg(e) {
var img = document.createElement('img');
img.className = 'channel-emote';
img.title = e.name;
img.src = e.image;
return img;
}
function initPm(user) { function initPm(user) {
if ($("#pm-" + user).length > 0) { if ($("#pm-" + user).length > 0) {
return $("#pm-" + user); return $("#pm-" + user);