From e3acc2a2d6725ce0ff1f68efda45be3fa8c17f03 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Thu, 10 Apr 2025 22:57:15 +0300 Subject: [PATCH] Move "FontFaceObserver" to the top (functions.php) Now we don't have to wait for the DOM to fully load (without media content) to change the class of elements. Now after loading the font, we write the style for displaying the font in the DOM. --- web/skins/classic/includes/functions.php | 59 +++++++++++------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index d9b8b5c0e..1ad7655fc 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -65,6 +65,24 @@ if (defined('ZM_WEB_FAVICON')) { '; } echo output_link_if_exists(array('css/base/material-icons.css')); +echo output_script_if_exists(array( + 'js/fontfaceobserver.standalone.js', +)); + +?> + +' .translate('Cycle'). ''.PHP_EOL; } - + return $result; } @@ -769,12 +787,12 @@ function getCycleHTML($view) { function getMontageHTML($view) { global $user; $result = ''; - + if (canView('Stream') and count($user->viewableMonitorIds())) { $class = $view == 'montage' ? ' selected' : ''; $result .= ''.PHP_EOL; } - + return $result; } @@ -801,42 +819,42 @@ function getMontageReviewHTML($view) { $class = $view == 'montagereview' ? ' selected' : ''; $result .= ''.PHP_EOL; } - + return $result; } // Returns the html representing the Montage menu item function getSnapshotsHTML($view) { $result = ''; - + if (defined('ZM_FEATURES_SNAPSHOTS') and ZM_FEATURES_SNAPSHOTS and canView('Snapshots')) { $class = $view == 'snapshots' ? ' selected' : ''; $result .= ''.PHP_EOL; } - + return $result; } function getReportsHTML($view) { $result = ''; - + if (canView('Events')) { $class = ($view == 'reports' or $view == 'report') ? ' selected' : ''; $result .= ''.PHP_EOL; } - + return $result; } // Returns the html representing the Audit Events Report menu item function getRprtEvntAuditHTML($view) { $result = ''; - + if ( canView('Events') ) { $class = $view == 'report_event_audit' ? ' selected' : ''; $result .= ''.PHP_EOL; } - + return $result; } @@ -994,27 +1012,6 @@ function xhtmlFooter() { global $skin; global $basename; - echo output_script_if_exists(array( - 'js/fontfaceobserver.standalone.js', - )); -?> - -