mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-10 16:10:55 +00:00
4.20.67
* Added: Warning on the Profile Manager about profiles not matching when viewing the FFZ Control Center in a pop-out. * API Added: Badges can now have custom CSS. * API Added: Badges can now have a `click_handler()` method for running JS when clicked.
This commit is contained in:
parent
165e17c014
commit
3fb6d5957a
6 changed files with 183 additions and 10 deletions
|
@ -162,7 +162,7 @@ export function generateBadgeCSS(badge, version, data, style, is_dark, badge_ver
|
|||
image,
|
||||
image_set,
|
||||
svg
|
||||
})}`;
|
||||
})}${data.css || ''}`;
|
||||
}
|
||||
|
||||
|
||||
|
@ -464,8 +464,11 @@ export default class Badges extends Module {
|
|||
if ( ! container.dataset.roomId )
|
||||
container = target.closest('[data-room-id]');
|
||||
|
||||
const room_id = container?.dataset?.roomId,
|
||||
room_login = container?.dataset?.room,
|
||||
const ds = container?.dataset,
|
||||
room_id = ds?.roomId,
|
||||
room_login = ds?.room,
|
||||
user_id = ds?.userId,
|
||||
user_login = ds?.user,
|
||||
data = JSON.parse(target.dataset.badgeData);
|
||||
|
||||
if ( data == null )
|
||||
|
@ -494,6 +497,11 @@ export default class Badges extends Module {
|
|||
|
||||
} else if ( p === 'ffz' ) {
|
||||
const badge = this.badges[target.dataset.badge];
|
||||
if ( badge?.click_handler ) {
|
||||
url = badge.click_handler(user_id, user_login, room_id, room_login, data, event);
|
||||
break;
|
||||
}
|
||||
|
||||
if ( badge?.click_url ) {
|
||||
url = badge.click_url;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue