Dodano obsługę WebP oraz poprawiono formatowanie kodu w plikach PHP i JS

This commit is contained in:
2025-01-06 21:49:32 +01:00
parent c1ef7fceab
commit a6e6c13fd8
3 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
var user_agent = navigator.userAgent.toLowerCase();
var click_event = user_agent.match(/(iphone|ipod|ipad)/) ? "touchend" : "click";
var windowsize = $(window).width();
$( function()
{
function hasWebP() {
var rv = $.Deferred(), img = new Image();
img.onload = function() { rv.resolve(); };
img.onerror = function() { rv.reject(); };
img.src = "/libraries/webp.webp";
return rv.promise();
}
hasWebP().then(function() {
}, function() {
$('body').addClass('nowebp');
$( 'img' ).each( function()
{
if ( $( this ).attr( 'src-nowebp' ) )
{
$( this ).attr( 'src', $( this ).attr( 'src-nowebp' ) );
$( this ).attr( 'data-src', $( this ).attr( 'src-nowebp' ) );
}
});
});
});

View File

@@ -194,6 +194,7 @@
buttons : {}
}
});
$(function () {
$(".article-21 .nav-tabs li:nth-child(2)").find('a').trigger("click");
})

View File

@@ -140,6 +140,7 @@
$text = $before . $out;
}
}
$dom = new DomDocument('1.0', 'UTF-8');
$dom -> loadHTML( '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . $text );
$elements = $dom -> getElementsByTagName( 'img' );