1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00
Daniel Neto 2023-11-16 10:54:08 -03:00
parent f6015148d3
commit 0f717a5e2d
6 changed files with 30 additions and 7 deletions

View file

@ -489,8 +489,8 @@ class Live extends PluginAbstract {
$title,
$u->getNameIdentificationBd(),
$link,
(!empty($imgJPG) ? '<img src="' . ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL) . '" data-src="' . $imgJPG . '" class="thumbsJPG img-responsive" height="130">' : ''),
(!empty($imgGIF) ? ('<img src="' .ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL) . '" data-src="' . $imgGIF . '" style="position: absolute; top: 0px; height: 0px; width: 0px; display: none;" class="thumbsGIF img-responsive" height="130">') : ''),
(!empty($imgJPG) ? '<img src="' . ImagesPlaceHolders::getVideoAnimationLandscape(ImagesPlaceHolders::$RETURN_URL) . '" data-src="' . $imgJPG . '" class="thumbsJPG img-responsive" height="130">' : ''),
(!empty($imgGIF) ? ('<img src="' .ImagesPlaceHolders::getVideoAnimationLandscape(ImagesPlaceHolders::$RETURN_URL) . '" data-src="' . $imgGIF . '" style="position: absolute; top: 0px; height: 0px; width: 0px; display: none;" class="thumbsGIF img-responsive" height="130">') : ''),
$LiveUsersLabelLive,
$class,
];

View file

@ -72,8 +72,11 @@ class UserNotifications extends PluginAbstract {
global $global;
$css = '<link href="' . getURL('plugin/UserNotifications/style.css') . '" rel="stylesheet" type="text/css"/>';
$js = '<script>var user_notification_template = ' . json_encode(self::getTemplate()) . '</script>';
$js .= '<script>var requiredUserNotificationTemplateFields = ' . json_encode(self::requiredUserNotificationTemplateFields) . '</script>';
$js = '<script>';
$js .= 'var user_notification_template = ' . json_encode(self::getTemplate()) . ';';
$js .= 'var user_notification_template_placeholder_image = ' . json_encode(ImagesPlaceHolders::getVideoAnimationLandscape(ImagesPlaceHolders::$RETURN_URL)) . ';';
$js .= 'var requiredUserNotificationTemplateFields = ' . json_encode(self::requiredUserNotificationTemplateFields) . ';';
$js .= '</script>';
return $css . $js;
}
@ -99,6 +102,8 @@ class UserNotifications extends PluginAbstract {
static function createTemplateFromArray($itemsArray) {
global $global;
$template = self::getTemplate();
$template = str_replace("{placeholder}", ImagesPlaceHolders::getVideoAnimationLandscape(ImagesPlaceHolders::$RETURN_URL), $template);
foreach ($itemsArray as $search => $replace) {
if ($search == 'icon') {
$replace = '<i class="' . $replace . '"></i>';

View file

@ -3,6 +3,8 @@ function getTemplateFromArray(itemsArray) {
return false;
}
var template = user_notification_template;
template = template.replace(new RegExp('{placeholder}', 'g'), user_notification_template_placeholder_image);
for (var search in itemsArray) {
var replace = itemsArray[search];
if (typeof replace == 'function') {
@ -306,5 +308,14 @@ $(document).ready(function () {
$(document).on('click', '#topMenuUserNotifications .dropdown-menu', function (e) {
e.stopPropagation();
});
$('#topMenuUserNotifications').on('click', function (e) {
$(this).find('.lazyload').lazy({
effect: 'fadeIn',
afterLoad: function (element) {
element.removeClass('lazyload');
element.addClass('lazyloadLoaded');
}
});
});
getUserNotification();
});

View file

@ -34,8 +34,10 @@
}
#topMenuUserNotifications .dropdown-menu img{
max-width: 100px;
width: 60px;
height: 60px;
object-fit: cover;
object-position: center;
margin: 10px 0 0 10px;
}

View file

@ -2,7 +2,7 @@
<a href="{href}" onclick="{onclick}" class="list-group-item {status}">
<div class="media">
<div class="media-left">
<img src="{image}" class="media-object">
<img src="{placeholder}" data-src="{image}" class="media-object lazyload">
</div>
<div class="media-body">
<strong class="media-heading">

View file

@ -232,6 +232,7 @@ async function lazyImage() {
afterLoad: function (element) {
element.addClass('gifNotLoaded');
element.addClass('lazyloadLoaded');
element.removeClass('blur');
element.mouseover(function () {
@ -470,7 +471,11 @@ async function mouseEffect() {
var gif = $(this).find(".thumbsGIF");
var jpg = $(this).find(".thumbsJPG");
try {
gif.lazy({ effect: 'fadeIn' });
gif.lazy({ effect: 'fadeIn',
afterLoad: function (element) {
element.removeClass('lazyload');
element.addClass('lazyloadLoaded');
} });
setTimeout(function () {
gif.height(jpg.height());
gif.width(jpg.width());