Add ability to pass browser's client height to the server

This commit is contained in:
iliajie
2023-05-12 12:02:58 +03:00
parent cfa2e38162
commit 9eb2624deb
2 changed files with 15 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1090,6 +1090,7 @@ my $dir = $current_lang_info->{'dir'} ? "dir=\"$current_lang_info->{'dir'}\"" :
my $html_body = "<body bgcolor=\"#$bgcolor\" link=\"#$link\" vlink=\"#$link\" text=\"#$text\" style=\"height:100%\" $bgimage $tconfig{'inbody'} $dir $_[8]>\n";
$html_body =~ s/\s+\>/>/g;
print $html_body;
print "<script>function _document_cookie_set_client_height(){document.cookie='client_height='+document.documentElement.clientHeight+'';}_document_cookie_set_client_height();window.onresize=_document_cookie_set_client_height</script>\n";
if (defined(&theme_prebody)) {
&theme_prebody(@_);
@@ -12996,7 +12997,17 @@ if (!$@ && $locale_system) {
return $locale_def;
}
$done_web_lib_funcs = 1;
=head2 get_http_cookie(cookie-name)
Returns a cookie value based on its name
=cut
sub get_http_cookie
{
my ($name) = @_;
my ($value) = $ENV{'HTTP_COOKIE'} =~ /$name=(\d+)(;|\z)/;
return $value;
}
=head2 create_wrapper(wrapper-path, module, script)
@@ -13057,4 +13068,6 @@ else {
chmod(0755, $path);
}
$done_web_lib_funcs = 1;
1;