mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-16 18:06:55 +00:00
3.5.386. Add high-DPI custom mod badges. Fix mod cards when you're not a mod.
This commit is contained in:
parent
3de30ce618
commit
fc9373947a
5 changed files with 66 additions and 41 deletions
|
@ -978,15 +978,17 @@ FFZ.prototype.modify_moderation_card = function(component) {
|
|||
var def_actions = el.querySelector('.moderation-card__actions');
|
||||
if ( def_actions ) {
|
||||
var def_line = def_actions.querySelector('.clearfix'),
|
||||
bad_line = def_actions.querySelector('.moderation-card__controls'),
|
||||
children = bad_line.querySelectorAll('button');
|
||||
bad_line = def_actions.querySelector('.moderation-card__controls');
|
||||
|
||||
for(var i=0; i < children.length; i++) {
|
||||
bad_line.removeChild(children[i]);
|
||||
def_line.appendChild(children[i]);
|
||||
if ( def_line && bad_line ) {
|
||||
var children = bad_line.querySelectorAll('button');
|
||||
for(var i=0; i < children.length; i++) {
|
||||
bad_line.removeChild(children[i]);
|
||||
def_line.appendChild(children[i]);
|
||||
}
|
||||
|
||||
bad_line.classList.add('hidden');
|
||||
}
|
||||
|
||||
bad_line.classList.add('hidden');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -41,21 +41,34 @@ var FFZ = window.FrankerFaceZ,
|
|||
is_android = navigator.userAgent.indexOf('Android') !== -1,
|
||||
|
||||
moderator_css = function(room) {
|
||||
if ( ! room.moderator_badge )
|
||||
if ( ! room.mod_urls )
|
||||
return "";
|
||||
|
||||
var urls = room.mod_urls,
|
||||
image_set = image = 'url("' + urls[1] + '")';
|
||||
|
||||
if ( urls[2] || urls[4] ) {
|
||||
image_set += ' 1x';
|
||||
if ( urls[2] )
|
||||
image_set += ', url("' + urls[2] + '") 2x';
|
||||
if ( urls[4] )
|
||||
image_set += ', url("' + urls[4] + '") 4x';
|
||||
|
||||
image_set = (constants.IS_WEBKIT ? '-webkit-' : '') + 'image-set(' + image_set + ')';
|
||||
}
|
||||
|
||||
return '.from-display-preview[data-room="' + room.id + '"] .badges .moderator:not(.ffz-badge-replacement):not(.colored),' +
|
||||
'.chat-line[data-room="' + room.id + '"] .badges .moderator:not(.ffz-badge-replacement):not(.colored) {' +
|
||||
'background-repeat: no-repeat;' +
|
||||
'background-size: initial !important;' +
|
||||
'background-position: center;' +
|
||||
'background-image:url("' + room.moderator_badge + '") !important; }' +
|
||||
'background-repeat:no-repeat;' +
|
||||
'background-size:initial !important;' +
|
||||
'background-position:center;' +
|
||||
'background-image:' + image_set + ' !important}' +
|
||||
'.from-display-preview[data-room="' + room.id + '"] .badges .moderator:not(.ffz-badge-replacement).colored,' +
|
||||
'.chat-line[data-room="' + room.id + '"] .badges .moderator:not(.ffz-badge-replacement).colored {' +
|
||||
'-webkit-mask-repeat: no-repeat;' +
|
||||
'-webkit-mask-size: initial !important;' +
|
||||
'-webkit-mask-position: center;' +
|
||||
'-webkit-mask-image: url("' + room.moderator_badge + '"); }';
|
||||
'-webkit-mask-repeat:no-repeat;' +
|
||||
'-webkit-mask-size:initial !important;' +
|
||||
'-webkit-mask-position:center;' +
|
||||
'-webkit-mask-image:' + image_set + '}';
|
||||
};
|
||||
|
||||
// --------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue