diff --git a/composer.lock b/composer.lock index 1b796cca3d..7a32fa0b5c 100644 --- a/composer.lock +++ b/composer.lock @@ -281,16 +281,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.275.7", + "version": "3.276.3", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "54dcef3349c81b46c0f5f6e54b5f9bfb5db19903" + "reference": "c8b38cfab677a3ec98e3f40bccd1a2bf851a014f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/54dcef3349c81b46c0f5f6e54b5f9bfb5db19903", - "reference": "54dcef3349c81b46c0f5f6e54b5f9bfb5db19903", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c8b38cfab677a3ec98e3f40bccd1a2bf851a014f", + "reference": "c8b38cfab677a3ec98e3f40bccd1a2bf851a014f", "shasum": "" }, "require": { @@ -370,9 +370,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.275.7" + "source": "https://github.com/aws/aws-sdk-php/tree/3.276.3" }, - "time": "2023-07-13T18:21:04+00:00" + "time": "2023-07-21T18:30:18+00:00" }, { "name": "brick/math", @@ -3988,16 +3988,16 @@ }, { "name": "stripe/stripe-php", - "version": "v10.17.0", + "version": "v10.18.0", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "73383b44de153f4d602b90dad3ef075259bcecef" + "reference": "c32549e443a619d1b885b99d624568ecae82d6a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/73383b44de153f4d602b90dad3ef075259bcecef", - "reference": "73383b44de153f4d602b90dad3ef075259bcecef", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/c32549e443a619d1b885b99d624568ecae82d6a0", + "reference": "c32549e443a619d1b885b99d624568ecae82d6a0", "shasum": "" }, "require": { @@ -4043,9 +4043,9 @@ ], "support": { "issues": "https://github.com/stripe/stripe-php/issues", - "source": "https://github.com/stripe/stripe-php/tree/v10.17.0" + "source": "https://github.com/stripe/stripe-php/tree/v10.18.0" }, - "time": "2023-07-13T22:12:18+00:00" + "time": "2023-07-20T16:59:49+00:00" }, { "name": "symfony/console", diff --git a/objects/functions.php b/objects/functions.php index 4e080d6523..66d58aa514 100644 --- a/objects/functions.php +++ b/objects/functions.php @@ -18,15 +18,16 @@ if (!isset($global) || !is_array($global)) { */ if (!function_exists('str_starts_with')) { - function str_starts_with(string $Haystack, string $Needle): bool { + function str_starts_with(string $Haystack, string $Needle): bool + { return substr($Haystack, 0, strlen($Needle)) === $Needle; } - } if (!function_exists('xss_esc')) { - function xss_esc($text) { + function xss_esc($text) + { if (empty($text)) { return ""; } @@ -45,10 +46,10 @@ if (!function_exists('xss_esc')) { $result = str_ireplace(['&amp;'], ['&'], $result); return $result; } - } -function xss_esc_back($text) { +function xss_esc_back($text) +{ if (!isset($text)) { return ''; } @@ -58,23 +59,24 @@ function xss_esc_back($text) { } // Make sure SecureVideosDirectory will be the first -function cmpPlugin($a, $b) { +function cmpPlugin($a, $b) +{ if ( - $a['name'] === 'SecureVideosDirectory' || - $a['name'] === 'GoogleAds_IMA' || - $a['name'] === 'Subscription' || - $a['name'] === 'PayPerView' || - $a['name'] === 'FansSubscriptions' + $a['name'] === 'SecureVideosDirectory' || + $a['name'] === 'GoogleAds_IMA' || + $a['name'] === 'Subscription' || + $a['name'] === 'PayPerView' || + $a['name'] === 'FansSubscriptions' ) { return -1; } elseif ($a['name'] === 'PlayerSkins') { return 1; } elseif ( - $b['name'] === 'SecureVideosDirectory' || - $b['name'] === 'GoogleAds_IMA' || - $b['name'] === 'Subscription' || - $b['name'] === 'PayPerView' || - $b['name'] === 'FansSubscriptions' + $b['name'] === 'SecureVideosDirectory' || + $b['name'] === 'GoogleAds_IMA' || + $b['name'] === 'Subscription' || + $b['name'] === 'PayPerView' || + $b['name'] === 'FansSubscriptions' ) { return 1; } elseif ($b['name'] === 'PlayerSkins') { @@ -85,7 +87,8 @@ function cmpPlugin($a, $b) { // Returns a file size limit in bytes based on the PHP upload_max_filesize // and post_max_size -function file_upload_max_size() { +function file_upload_max_size() +{ static $max_size = -1; if ($max_size < 0) { @@ -102,7 +105,8 @@ function file_upload_max_size() { return $max_size; } -function parse_size($size) { +function parse_size($size) +{ $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. if ($unit) { @@ -113,7 +117,8 @@ function parse_size($size) { } } -function humanFileSize($size, $unit = "") { +function humanFileSize($size, $unit = "") +{ if ((!$unit && $size >= 1 << 30) || $unit == "GB") { return number_format($size / (1 << 30), 2) . "GB"; } @@ -129,11 +134,13 @@ function humanFileSize($size, $unit = "") { return number_format($size) . " bytes"; } -function get_max_file_size() { +function get_max_file_size() +{ return humanFileSize(file_upload_max_size()); } -function humanTiming($time, $precision = 0, $useDatabaseTime = true, $addAgo = false) { +function humanTiming($time, $precision = 0, $useDatabaseTime = true, $addAgo = false) +{ if (empty($time)) { return ''; } @@ -153,7 +160,8 @@ function humanTiming($time, $precision = 0, $useDatabaseTime = true, $addAgo = f * @param string $useDatabaseTime good if you are checking the created time * @return string */ -function humanTimingAgo($time, $precision = 0, $useDatabaseTime = true) { +function humanTimingAgo($time, $precision = 0, $useDatabaseTime = true) +{ $time = secondsIntervalFromNow($time, $useDatabaseTime); if (empty($time)) { return __("Now"); @@ -161,7 +169,8 @@ function humanTimingAgo($time, $precision = 0, $useDatabaseTime = true) { return sprintf(__('%s ago'), secondsToHumanTiming($time, $precision)); } -function humanTimingAfterwards($time, $precision = 0, $useDatabaseTime = true) { +function humanTimingAfterwards($time, $precision = 0, $useDatabaseTime = true) +{ if (!is_numeric($time)) { $time = strtotime($time); } @@ -174,7 +183,8 @@ function humanTimingAfterwards($time, $precision = 0, $useDatabaseTime = true) { return __('Coming in') . ' ' . secondsToHumanTiming($time, $precision); } -function secondsToHumanTiming($time, $precision = 0, $addAgo = false) { +function secondsToHumanTiming($time, $precision = 0, $addAgo = false) +{ if (empty($time)) { return __("Now"); } @@ -237,7 +247,8 @@ function secondsToHumanTiming($time, $precision = 0, $addAgo = false) { } } -function checkVideosDir() { +function checkVideosDir() +{ $dir = "../videos"; if (file_exists($dir)) { return is_writable($dir); @@ -245,15 +256,18 @@ function checkVideosDir() { return mkdir($dir); } -function isApache() { +function isApache() +{ return (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false); } -function isPHP($version = "'7.3.0'") { +function isPHP($version = "'7.3.0'") +{ return (version_compare(PHP_VERSION, $version) >= 0); } -function modEnabled($mod_name) { +function modEnabled($mod_name) +{ if (!function_exists('apache_get_modules')) { _ob_start(); phpinfo(INFO_MODULES); @@ -264,77 +278,91 @@ function modEnabled($mod_name) { return in_array('mod_' . $mod_name, apache_get_modules()); } -function modRewriteEnabled() { +function modRewriteEnabled() +{ return modEnabled("rewrite"); } -function modAliasEnabled() { +function modAliasEnabled() +{ return modEnabled("alias"); } -function isFFMPEG() { +function isFFMPEG() +{ return trim(shell_exec('which ffmpeg')); } -function isUnzip() { +function isUnzip() +{ return trim(shell_exec('which unzip')); } -function isExifToo() { +function isExifToo() +{ return trim(shell_exec('which exiftool')); } -function isAPPInstalled($appName) { +function isAPPInstalled($appName) +{ $appName = preg_replace('/[^a-z0-9_-]/i', '', $appName); return trim(shell_exec("which {$appName}")); } -function getPathToApplication() { +function getPathToApplication() +{ return str_replace(['install/index.php', 'view/configurations.php'], '', $_SERVER['SCRIPT_FILENAME']); } -function getURLToApplication() { +function getURLToApplication() +{ $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = explode("install/index.php", $url); return $url[0]; } //max_execution_time = 7200 -function check_max_execution_time() { +function check_max_execution_time() +{ $max_size = ini_get('max_execution_time'); $recomended_size = 7200; return ($recomended_size <= $max_size); } //post_max_size = 100M -function check_post_max_size() { +function check_post_max_size() +{ $max_size = parse_size(ini_get('post_max_size')); $recomended_size = parse_size('100M'); return ($recomended_size <= $max_size); } //upload_max_filesize = 100M -function check_upload_max_filesize() { +function check_upload_max_filesize() +{ $max_size = parse_size(ini_get('upload_max_filesize')); $recomended_size = parse_size('100M'); return ($recomended_size <= $max_size); } //memory_limit = 100M -function check_memory_limit() { +function check_memory_limit() +{ $max_size = parse_size(ini_get('memory_limit')); $recomended_size = parse_size('512M'); return ($recomended_size <= $max_size); } -function base64DataToImage($imgBase64) { +function base64DataToImage($imgBase64) +{ $img = $imgBase64; $img = str_replace('data:image/png;base64,', '', $img); $img = str_replace(' ', '+', $img); return base64_decode($img); } -function saveBase64DataToPNGImage($imgBase64, $filePath) { +function saveBase64DataToPNGImage($imgBase64, $filePath) +{ $fileData = base64DataToImage($imgBase64); if (empty($fileData)) { return false; @@ -342,7 +370,8 @@ function saveBase64DataToPNGImage($imgBase64, $filePath) { return _file_put_contents($filePath, $fileData); } -function getRealIpAddr() { +function getRealIpAddr() +{ $ip = "127.0.0.1"; if (isCommandLineInterface()) { @@ -355,14 +384,14 @@ function getRealIpAddr() { 'REMOTE_ADDR' ]; - foreach($headers as $header) { + foreach ($headers as $header) { if (!empty($_SERVER[$header])) { $ips = explode(',', $_SERVER[$header]); - foreach($ips as $ipCandidate) { + foreach ($ips as $ipCandidate) { $ipCandidate = trim($ipCandidate); // Just to be safe - if(filter_var($ipCandidate, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { + if (filter_var($ipCandidate, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { return $ipCandidate; // Return the first valid IPv4 we find - } elseif($header === 'REMOTE_ADDR' && filter_var($ipCandidate, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { + } elseif ($header === 'REMOTE_ADDR' && filter_var($ipCandidate, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $ip = $ipCandidate; // In case no IPv4 is found, set the first IPv6 found from REMOTE_ADDR } } @@ -371,7 +400,8 @@ function getRealIpAddr() { return $ip; } -function cleanString($text) { +function cleanString($text) +{ if (empty($text)) { return ''; } @@ -427,7 +457,8 @@ function cleanString($text) { * @param bool $strict (optional) Whether to apply strict sanitization. Defaults to false. * @return string The sanitized string. */ -function safeString($text, $strict = false, $try = 0) { +function safeString($text, $strict = false, $try = 0) +{ if (empty($text)) { return ''; } @@ -453,7 +484,8 @@ function safeString($text, $strict = false, $try = 0) { return $text; } -function cleanURLName($name, $replaceChar = '-') { +function cleanURLName($name, $replaceChar = '-') +{ $name = preg_replace('/[!#$&\'()*+,\\/:;=?@[\\]%"\/\\\\ ]+/', $replaceChar, trim(mb_strtolower(cleanString($name)))); return trim(preg_replace('/[\x00-\x1F\x7F\xD7\xE0]/u', $replaceChar, $name), $replaceChar); } @@ -463,7 +495,8 @@ function cleanURLName($name, $replaceChar = '-') { * if is set $_GET['ignoreCommandLineInterface'] will return false * @return boolean */ -function isCommandLineInterface() { +function isCommandLineInterface() +{ return (empty($_GET['ignoreCommandLineInterface']) && php_sapi_name() === 'cli'); } @@ -473,15 +506,16 @@ function isCommandLineInterface() { * @param array $statusarray associative array with type/message pairs * @return string */ -function status($statusarray) { +function status($statusarray) +{ if (isCommandLineInterface()) { foreach ($statusarray as $status => $message) { echo $status . ":" . $message . "\n"; } } else { echo json_encode(array_map(function ($text) { - return nl2br($text); - }, $statusarray)); + return nl2br($text); + }, $statusarray)); } } @@ -490,12 +524,14 @@ function status($statusarray) { * * @param array $statusarray associative array with type/message pairs */ -function croak($statusarray) { +function croak($statusarray) +{ status($statusarray); die; } -function getSecondsTotalVideosLength() { +function getSecondsTotalVideosLength() +{ $configFile = dirname(__FILE__) . '/../videos/configuration.php'; require_once $configFile; global $global; @@ -523,7 +559,8 @@ function getSecondsTotalVideosLength() { return $seconds; } -function getMinutesTotalVideosLength() { +function getMinutesTotalVideosLength() +{ $seconds = getSecondsTotalVideosLength(); return floor($seconds / 60); } @@ -534,7 +571,8 @@ function getMinutesTotalVideosLength() { * @param int|float|string $seconds The duration in seconds to convert. * @return string The formatted time string. */ -function secondsToVideoTime($seconds) { +function secondsToVideoTime($seconds) +{ if (!is_numeric($seconds)) { return (string) $seconds; } @@ -547,7 +585,8 @@ function secondsToVideoTime($seconds) { return sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds); } -function parseSecondsToDuration($seconds) { +function parseSecondsToDuration($seconds) +{ return secondsToVideoTime($seconds); } @@ -557,7 +596,8 @@ function parseSecondsToDuration($seconds) { * @param int|string $str The duration string to parse, in the format "HH:MM:SS". * @return int The duration in seconds. */ -function parseDurationToSeconds($str) { +function parseDurationToSeconds($str) +{ if ($str == "00:00:00") { return 0; } @@ -578,11 +618,13 @@ function parseDurationToSeconds($str) { return intval($durationParts[2]) + ($minutes * 60); } -function durationToSeconds($str) { +function durationToSeconds($str) +{ return parseDurationToSeconds($str); } -function secondsToDuration($seconds) { +function secondsToDuration($seconds) +{ return parseSecondsToDuration($seconds); } @@ -592,7 +634,8 @@ function secondsToDuration($seconds) { * @param string $mail * call it before send mail to let AVideo decide the method */ -function setSiteSendMessage(\PHPMailer\PHPMailer\PHPMailer &$mail) { +function setSiteSendMessage(\PHPMailer\PHPMailer\PHPMailer &$mail) +{ global $global; if (empty($mail)) { $mail = new \PHPMailer\PHPMailer\PHPMailer(); @@ -643,11 +686,13 @@ function setSiteSendMessage(\PHPMailer\PHPMailer\PHPMailer &$mail) { * @param array $array The input array. * @return array The array with unique values. */ -function array_iunique(array $array): array { +function array_iunique(array $array): array +{ return array_intersect_key($array, array_unique(array_map('mb_strtolower', $array))); } -function partition(array $list, $totalItens) { +function partition(array $list, $totalItens) +{ $listlen = count($list); _error_log("partition: listlen={$listlen} totalItens={$totalItens}"); $p = ceil($listlen / $totalItens); @@ -663,7 +708,8 @@ function partition(array $list, $totalItens) { return $partition; } -function sendSiteEmail($to, $subject, $message, $fromEmail = '', $fromName = '') { +function sendSiteEmail($to, $subject, $message, $fromEmail = '', $fromName = '') +{ global $advancedCustom; $resp = false; if (empty($to)) { @@ -762,7 +808,8 @@ function sendSiteEmail($to, $subject, $message, $fromEmail = '', $fromName = '') return $resp; } -function sendSiteEmailAsync($to, $subject, $message) { +function sendSiteEmailAsync($to, $subject, $message) +{ global $global; // If $to is not an array, make it one if (!is_array($to)) { @@ -782,7 +829,8 @@ function sendSiteEmailAsync($to, $subject, $message) { return $pid; } -function sendBulkEmail($users_id_array, $emails_array, $subject, $message) { +function sendBulkEmail($users_id_array, $emails_array, $subject, $message) +{ $obj = AVideoPlugin::getDataObjectIfEnabled('Scheduler'); if (!empty($users_id_array) && $obj->sendEmails) { @@ -816,7 +864,8 @@ function sendBulkEmail($users_id_array, $emails_array, $subject, $message) { } } -function createEmailMessageFromTemplate($message) { +function createEmailMessageFromTemplate($message) +{ //check if the message already have a HTML body if (preg_match("/html>/i", $message)) { return $message; @@ -833,7 +882,8 @@ function createEmailMessageFromTemplate($message) { return str_replace($replace, $words, $text); } -function sendEmailToSiteOwner($subject, $message) { +function sendEmailToSiteOwner($subject, $message) +{ global $advancedCustom, $global; $subject = UTF8encode($subject); $message = UTF8encode($message); @@ -861,11 +911,13 @@ function sendEmailToSiteOwner($subject, $message) { } } -function fixURL($url) { +function fixURL($url) +{ return str_replace(array('&%3B', '&'), array('&', '&'), $url); } -function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $showinfo = 0, $controls = 1, $time = 0, $objectFit = "") { +function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $showinfo = 0, $controls = 1, $time = 0, $objectFit = "") +{ global $global; if (!empty($videoString)) { $videoString = fixURL($videoString); @@ -873,7 +925,7 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ //_error_log("parseVideos: $videoString"); if (strpos($videoString, 'youtube.com/embed') !== false) { return $videoString . (parse_url($videoString, PHP_URL_QUERY) ? '&' : '?') . 'modestbranding=1&showinfo=' - . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time&objectFit=$objectFit"; + . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time&objectFit=$objectFit"; } if (strpos($videoString, 'iframe') !== false) { // retrieve the video url @@ -889,12 +941,12 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ if (stripos($link, 'embed') !== false) { return $link . (parse_url($link, PHP_URL_QUERY) ? '&' : '?') . 'modestbranding=1&showinfo=' - . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time&objectFit=$objectFit"; + . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time&objectFit=$objectFit"; } elseif (strpos($link, 'youtube.com') !== false) { preg_match( - '/[\\?\\&]v=([^\\?\\&]+)/', - $link, - $matches + '/[\\?\\&]v=([^\\?\\&]+)/', + $link, + $matches ); //the ID of the YouTube URL: x6qe_kVaBpg if (empty($matches[1])) { @@ -902,18 +954,18 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ } $id = $matches[1]; return '//www.youtube.com/embed/' . $id . '?modestbranding=1&showinfo=' - . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&te=$time&objectFit=$objectFit"; + . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&te=$time&objectFit=$objectFit"; } elseif (strpos($link, 'youtu.be') !== false) { //https://youtu.be/9XXOBSsPoMU preg_match( - '/youtu.be\/([a-zA-Z0-9_]+)($|\/)/', - $link, - $matches + '/youtu.be\/([a-zA-Z0-9_]+)($|\/)/', + $link, + $matches ); //the ID of the YouTube URL: x6qe_kVaBpg $id = $matches[1]; return '//www.youtube.com/embed/' . $id . '?modestbranding=1&showinfo=' - . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&te=$time&objectFit=$objectFit"; + . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&te=$time&objectFit=$objectFit"; } elseif (strpos($link, 'player.vimeo.com') !== false) { // works on: // http://player.vimeo.com/video/37985580?title=0&byline=0&portrait=0 @@ -924,9 +976,9 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ } elseif (strpos($link, 'vimeo.com/channels') !== false) { //extract the ID preg_match( - '/\/\/(www\.)?vimeo.com\/channels\/[a-z0-9-]+\/(\d+)($|\/)/i', - $link, - $matches + '/\/\/(www\.)?vimeo.com\/channels\/[a-z0-9-]+\/(\d+)($|\/)/i', + $link, + $matches ); //the ID of the Vimeo URL: 71673549 @@ -935,9 +987,9 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ } elseif (strpos($link, 'vimeo.com') !== false) { //extract the ID preg_match( - '/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/', - $link, - $matches + '/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/', + $link, + $matches ); //the ID of the Vimeo URL: 71673549 @@ -946,9 +998,9 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ } elseif (strpos($link, 'dailymotion.com') !== false) { //extract the ID preg_match( - '/\/\/(www\.)?dailymotion.com\/video\/([a-zA-Z0-9_]+)($|\/)/', - $link, - $matches + '/\/\/(www\.)?dailymotion.com\/video\/([a-zA-Z0-9_]+)($|\/)/', + $link, + $matches ); //the ID of the Vimeo URL: 71673549 @@ -957,18 +1009,18 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ } elseif (strpos($link, 'metacafe.com') !== false) { //extract the ID preg_match( - '/\/\/(www\.)?metacafe.com\/watch\/([a-zA-Z0-9_\/-]+)$/', - $link, - $matches + '/\/\/(www\.)?metacafe.com\/watch\/([a-zA-Z0-9_\/-]+)$/', + $link, + $matches ); $id = $matches[2]; return '//www.metacafe.com/embed/' . $id; } elseif (strpos($link, 'vid.me') !== false) { //extract the ID preg_match( - '/\/\/(www\.)?vid.me\/([a-zA-Z0-9_-]+)$/', - $link, - $matches + '/\/\/(www\.)?vid.me\/([a-zA-Z0-9_-]+)$/', + $link, + $matches ); $id = $matches[2]; @@ -1053,7 +1105,7 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ parse_str($url_parsed['query'], $new_qs_parsed); // Here's the other query string $other_query_string = 'modestbranding=1&showinfo=' - . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time"; + . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time"; $other_qs_parsed = []; parse_str($other_query_string, $other_qs_parsed); // Stitch the two query strings together @@ -1066,11 +1118,11 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ $scheme = "{$url_parsed['scheme']}:"; } $new_url = $scheme - . '//' - . $url_parsed['host'] - . $url_parsed['path'] - . '?' - . $final_query_string; + . '//' + . $url_parsed['host'] + . $url_parsed['path'] + . '?' + . $final_query_string; return $new_url; // return data @@ -1078,7 +1130,8 @@ function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $ $canUseCDN = []; -function canUseCDN($videos_id) { +function canUseCDN($videos_id) +{ if (empty($videos_id)) { return false; } @@ -1097,7 +1150,8 @@ function canUseCDN($videos_id) { return $canUseCDN[$videos_id]; } -function clearVideosURL($fileName = "") { +function clearVideosURL($fileName = "") +{ global $global; $path = getCacheDir() . "getVideosURL/"; if (empty($path)) { @@ -1108,7 +1162,8 @@ function clearVideosURL($fileName = "") { } } -function maxLifetime() { +function maxLifetime() +{ global $maxLifetime; if (!isset($maxLifetime)) { $aws_s3 = AVideoPlugin::getObjectDataIfEnabled('AWS_S3'); @@ -1133,7 +1188,8 @@ function maxLifetime() { $cacheExpirationTime = false; -function cacheExpirationTime() { +function cacheExpirationTime() +{ if (isBot()) { return 604800; // 1 week } @@ -1145,7 +1201,8 @@ function cacheExpirationTime() { return intval($cacheExpirationTime); } -function _getImagesURL($fileName, $type) { +function _getImagesURL($fileName, $type) +{ global $global; $files = []; $source = Video::getSourceFile($fileName, ".jpg"); @@ -1190,7 +1247,8 @@ function _getImagesURL($fileName, $type) { return $files; } -function getVideosURLPDF($fileName) { +function getVideosURLPDF($fileName) +{ global $global; if (empty($fileName)) { return []; @@ -1218,7 +1276,8 @@ function getVideosURLPDF($fileName) { return $files; } -function getVideosURLIMAGE($fileName) { +function getVideosURLIMAGE($fileName) +{ global $global; if (empty($fileName)) { return []; @@ -1254,7 +1313,8 @@ function getVideosURLIMAGE($fileName) { return $files; } -function getVideosURLZIP($fileName) { +function getVideosURLZIP($fileName) +{ global $global; if (empty($fileName)) { return []; @@ -1290,7 +1350,8 @@ function getVideosURLZIP($fileName) { return $files; } -function getVideosURLArticle($fileName) { +function getVideosURLArticle($fileName) +{ global $global; if (empty($fileName)) { return []; @@ -1310,7 +1371,8 @@ function getVideosURLArticle($fileName) { return $files; } -function getVideosURLAudio($fileName, $fileNameisThePath = false) { +function getVideosURLAudio($fileName, $fileNameisThePath = false) +{ global $global; if (empty($fileName)) { return []; @@ -1363,11 +1425,13 @@ function getVideosURLAudio($fileName, $fileNameisThePath = false) { return $files; } -function getVideosURL($fileName, $cache = true) { +function getVideosURL($fileName, $cache = true) +{ return getVideosURL_V2($fileName); // disable this function soon } -function getVideosURLMP4Only($fileName) { +function getVideosURLMP4Only($fileName) +{ $allFiles = getVideosURL_V2($fileName); if (is_array($allFiles)) { foreach ($allFiles as $key => $value) { @@ -1381,7 +1445,8 @@ function getVideosURLMP4Only($fileName) { return []; } -function getVideosURLMP3Only($fileName) { +function getVideosURLMP3Only($fileName) +{ $allFiles = getVideosURL_V2($fileName); if (is_array($allFiles)) { foreach ($allFiles as $key => $value) { @@ -1395,7 +1460,8 @@ function getVideosURLMP3Only($fileName) { return []; } -function getVideosURLWEBMOnly($fileName) { +function getVideosURLWEBMOnly($fileName) +{ $allFiles = getVideosURL_V2($fileName); // disable this function soon if (is_array($allFiles)) { foreach ($allFiles as $key => $value) { @@ -1409,15 +1475,18 @@ function getVideosURLWEBMOnly($fileName) { return []; } -function getVideosURLMP4WEBMOnly($fileName) { +function getVideosURLMP4WEBMOnly($fileName) +{ return array_merge(getVideosURLMP4Only($fileName), getVideosURLWEBMOnly($fileName)); } -function getVideosURLMP4WEBMMP3Only($fileName) { +function getVideosURLMP4WEBMMP3Only($fileName) +{ return array_merge(getVideosURLMP4Only($fileName), getVideosURLWEBMOnly($fileName), getVideosURLMP3Only($fileName)); } -function getVideosURLOnly($fileName, $includeOffline = true) { +function getVideosURLOnly($fileName, $includeOffline = true) +{ $allFiles = getVideosURL_V2($fileName); // disable this function soon foreach ($allFiles as $key => $value) { if ($value['type'] !== 'video' || (!$includeOffline && preg_match('/offline/i', $key))) { @@ -1427,7 +1496,8 @@ function getVideosURLOnly($fileName, $includeOffline = true) { return $allFiles; } -function getAudioURLOnly($fileName) { +function getAudioURLOnly($fileName) +{ $allFiles = getVideosURL_V2($fileName); // disable this function soon foreach ($allFiles as $key => $value) { if ($value['type'] !== 'audio') { @@ -1437,7 +1507,8 @@ function getAudioURLOnly($fileName) { return $allFiles; } -function getAudioOrVideoURLOnly($fileName, $recreateCache = false) { +function getAudioOrVideoURLOnly($fileName, $recreateCache = false) +{ $allFiles = getVideosURL_V2($fileName, $recreateCache); // disable this function soon if ($recreateCache) { _error_log("getAudioOrVideoURLOnly($fileName) " . json_encode($allFiles)); @@ -1450,13 +1521,15 @@ function getAudioOrVideoURLOnly($fileName, $recreateCache = false) { return $allFiles; } -function getVideosDir() { +function getVideosDir() +{ return Video::getStoragePath(); } $getVideosURL_V2Array = []; -function getVideosURL_V2($fileName, $recreateCache = false) { +function getVideosURL_V2($fileName, $recreateCache = false) +{ global $global, $getVideosURL_V2Array; if (empty($fileName)) { return []; @@ -1489,9 +1562,9 @@ function getVideosURL_V2($fileName, $recreateCache = false) { $pathFilesize = filesize($value['path']); } if ( - $value['type'] === 'video' && // is a video - preg_match("/^{$preg_match_url}/", $value['url']) && // the URL is the same as the main domain - $pathFilesize < 20 + $value['type'] === 'video' && // is a video + preg_match("/^{$preg_match_url}/", $value['url']) && // the URL is the same as the main domain + $pathFilesize < 20 ) { // file size is small _error_log("getVideosURL_V2:: dummy file found, fix cache " . json_encode(["/^{$preg_match_url}/", $value['url'], preg_match("/^{$preg_match_url}video/", $value['url']), $pathFilesize, $value])); unset($files); @@ -1631,7 +1704,8 @@ function getVideosURL_V2($fileName, $recreateCache = false) { } //Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal. -function sortVideosURL($a, $b) { +function sortVideosURL($a, $b) +{ if ($a['type'] === 'video' && $b['type'] === 'video') { $aRes = getResolutionFromFilename($a['filename']); $bRes = getResolutionFromFilename($b['filename']); @@ -1646,7 +1720,8 @@ function sortVideosURL($a, $b) { return 0; } -function getResolutionFromFilename($filename) { +function getResolutionFromFilename($filename) +{ global $getResolutionFromFilenameArray; if (!isset($getResolutionFromFilenameArray)) { @@ -1679,7 +1754,8 @@ function getResolutionFromFilename($filename) { return $res; } -function getSources($fileName, $returnArray = false, $try = 0) { +function getSources($fileName, $returnArray = false, $try = 0) +{ if ($returnArray) { $videoSources = $audioTracks = $subtitleTracks = []; } else { @@ -1753,7 +1829,8 @@ function getSources($fileName, $returnArray = false, $try = 0) { * @param string $file_src * @return array get image size with cache */ -function getimgsize($file_src) { +function getimgsize($file_src) +{ global $_getimagesize; if (empty($file_src) || !file_exists($file_src)) { return [0, 0]; @@ -1793,7 +1870,8 @@ function getimgsize($file_src) { return $size; } -function getImageFormat($file) { +function getImageFormat($file) +{ $size = getimgsize($file); if ($size === false) { return false; @@ -1831,7 +1909,8 @@ function getImageFormat($file) { return ['format' => $format, 'extension' => $extension]; } -function im_resize($file_src, $file_dest, $wd, $hd, $q = 80) { +function im_resize($file_src, $file_dest, $wd, $hd, $q = 80) +{ if (empty($file_dest)) { return false; } @@ -1947,7 +2026,8 @@ function im_resize($file_src, $file_dest, $wd, $hd, $q = 80) { return true; } -function scaleUpAndMantainAspectRatioFinalSizes($new_w, $old_w, $new_h, $old_h) { +function scaleUpAndMantainAspectRatioFinalSizes($new_w, $old_w, $new_h, $old_h) +{ if (empty($old_h)) { $old_h = $new_h; @@ -1982,7 +2062,8 @@ function scaleUpAndMantainAspectRatioFinalSizes($new_w, $old_w, $new_h, $old_h) return ['w' => $thumb_w, 'h' => $thumb_h]; } -function scaleUpImage($file_src, $file_dest, $wd, $hd) { +function scaleUpImage($file_src, $file_dest, $wd, $hd) +{ if (!file_exists($file_src)) { return false; } @@ -2069,7 +2150,8 @@ function scaleUpImage($file_src, $file_dest, $wd, $hd) { return $result; } -function resize_png_image($source_file_path, $destination_file_path, $target_width, $target_height) { +function resize_png_image($source_file_path, $destination_file_path, $target_width, $target_height) +{ // Check if the source file exists if (!file_exists($source_file_path)) { return false; @@ -2089,16 +2171,16 @@ function resize_png_image($source_file_path, $destination_file_path, $target_wid imagesavealpha($target_image, true); imagecopyresampled( - $target_image, - $src_image, - 0, - 0, - 0, - 0, - $target_width, - $target_height, - $src_width, - $src_height + $target_image, + $src_image, + 0, + 0, + 0, + 0, + $target_width, + $target_height, + $src_width, + $src_height ); $saved = imagepng($target_image, $destination_file_path); @@ -2108,47 +2190,51 @@ function resize_png_image($source_file_path, $destination_file_path, $target_wid if (false) { - class Imagick { + class Imagick + { public const FILTER_BOX = 1; - public function getImageFormat() { + public function getImageFormat() + { return ''; } - public function coalesceImages() { + public function coalesceImages() + { return new Imagick(); } - public function nextImage() { + public function nextImage() + { return true; } - public function resizeImage() { - + public function resizeImage() + { } - public function deconstructImages() { + public function deconstructImages() + { return new Imagick(); } - public function clear() { - + public function clear() + { } - public function destroy() { - + public function destroy() + { } - public function writeImages() { - + public function writeImages() + { } - } - } -function im_resize_gif($file_src, $file_dest, $max_width, $max_height) { +function im_resize_gif($file_src, $file_dest, $max_width, $max_height) +{ if (class_exists('Imagick')) { $imagick = new Imagick($file_src); @@ -2169,7 +2255,8 @@ function im_resize_gif($file_src, $file_dest, $max_width, $max_height) { } } -function im_resize_max_size($file_src, $file_dest, $max_width, $max_height) { +function im_resize_max_size($file_src, $file_dest, $max_width, $max_height) +{ $fn = $file_src; $extension = mb_strtolower(pathinfo($file_dest, PATHINFO_EXTENSION)); @@ -2238,7 +2325,8 @@ function im_resize_max_size($file_src, $file_dest, $max_width, $max_height) { @unlink($tmpFile); } -function detect_image_type($file_path) { +function detect_image_type($file_path) +{ $image_info = @getimagesize($file_path); if ($image_info !== false) { @@ -2265,7 +2353,8 @@ function detect_image_type($file_path) { } } -function convertImage($originalImage, $outputImage, $quality, $useExif = false) { +function convertImage($originalImage, $outputImage, $quality, $useExif = false) +{ ini_set('memory_limit', '512M'); if (!file_exists($originalImage) || empty(filesize($originalImage))) { return false; @@ -2378,7 +2467,8 @@ function convertImage($originalImage, $outputImage, $quality, $useExif = false) return $response; } -function decideMoveUploadedToVideos($tmp_name, $filename, $type = "video") { +function decideMoveUploadedToVideos($tmp_name, $filename, $type = "video") +{ if ($filename == '.zip') { return false; } @@ -2441,7 +2531,8 @@ function decideMoveUploadedToVideos($tmp_name, $filename, $type = "video") { return $destinationFile; } -function unzipDirectory($filename, $destination) { +function unzipDirectory($filename, $destination) +{ // Set memory limit and execution time to avoid issues with large files ini_set('memory_limit', '-1'); set_time_limit(0); @@ -2481,7 +2572,8 @@ function unzipDirectory($filename, $destination) { @unlink($filename); } -function make_path($path) { +function make_path($path) +{ $created = false; if (substr($path, -1) !== DIRECTORY_SEPARATOR) { $path = pathinfo($path, PATHINFO_DIRNAME); @@ -2513,7 +2605,8 @@ function make_path($path) { * @param string $allowedExtensions * @return string */ -function cleanDirectory($dir, $allowedExtensions = ['key', 'm3u8', 'ts', 'vtt', 'jpg', 'gif', 'mp3', 'webm', 'webp']) { +function cleanDirectory($dir, $allowedExtensions = ['key', 'm3u8', 'ts', 'vtt', 'jpg', 'gif', 'mp3', 'webm', 'webp']) +{ $ffs = scandir($dir); unset($ffs[array_search('.', $ffs, true)]); @@ -2536,7 +2629,8 @@ function cleanDirectory($dir, $allowedExtensions = ['key', 'm3u8', 'ts', 'vtt', } } -function isAnyStorageEnabled() { +function isAnyStorageEnabled() +{ if ($yptStorage = AVideoPlugin::loadPluginIfEnabled("YPTStorage")) { return true; } elseif ($aws_s3 = AVideoPlugin::loadPluginIfEnabled("AWS_S3")) { @@ -2551,13 +2645,14 @@ function isAnyStorageEnabled() { if (!function_exists('mime_content_type')) { - function mime_content_type($filename) { + function mime_content_type($filename) + { return mime_content_type_per_filename($filename); } - } -function fontAwesomeClassName($filename) { +function fontAwesomeClassName($filename) +{ $mime_type = mime_content_type_per_filename($filename); // List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml $icon_classes = [ @@ -2592,7 +2687,8 @@ function fontAwesomeClassName($filename) { return 'fas fa-file'; } -function mime_content_type_per_filename($filename) { +function mime_content_type_per_filename($filename) +{ $mime_types = [ 'txt' => 'text/plain', 'htm' => 'text/html', @@ -2689,7 +2785,8 @@ function mime_content_type_per_filename($filename) { return 'application/octet-stream'; } -function combineFiles($filesArray, $extension = "js") { +function combineFiles($filesArray, $extension = "js") +{ global $global, $advancedCustom; if ($extension == 'js' && isBot()) { @@ -2755,7 +2852,8 @@ function combineFiles($filesArray, $extension = "js") { return getURL($relativeDir . $md5FileName); } -function combineFilesHTML($filesArray, $extension = "js", $doNotCombine = false) { +function combineFilesHTML($filesArray, $extension = "js", $doNotCombine = false) +{ if (empty($doNotCombine)) { $jsURL = combineFiles($filesArray, $extension); } @@ -2784,7 +2882,8 @@ function combineFilesHTML($filesArray, $extension = "js", $doNotCombine = false) } } -function getTagIfExists($relativePath) { +function getTagIfExists($relativePath) +{ global $global; $relativePath = str_replace('\\', '/', $relativePath); $file = "{$global['systemRootPath']}{$relativePath}"; @@ -2805,7 +2904,8 @@ function getTagIfExists($relativePath) { } } -function getImageTagIfExists($relativePath, $title = '', $id = '', $style = '', $class = 'img img-responsive', $lazyLoad = false, $preloadImage = false) { +function getImageTagIfExists($relativePath, $title = '', $id = '', $style = '', $class = 'img img-responsive', $lazyLoad = false, $preloadImage = false) +{ global $global; $relativePathOriginal = $relativePath; $relativePath = getRelativePath($relativePath); @@ -2856,7 +2956,8 @@ function getImageTagIfExists($relativePath, $title = '', $id = '', $style = '', return $img; } -function createWebPIfNotExists($path) { +function createWebPIfNotExists($path) +{ if (version_compare(PHP_VERSION, '8.0.0') < 0 || !file_exists($path)) { return $path; } @@ -2872,7 +2973,8 @@ function createWebPIfNotExists($path) { return $nextGenPath; } -function getVideoImagewithHoverAnimation($relativePath, $relativePathHoverAnimation = '', $title = '', $preloadImage = false, $doNotUseAnimatedGif = false) { +function getVideoImagewithHoverAnimation($relativePath, $relativePathHoverAnimation = '', $title = '', $preloadImage = false, $doNotUseAnimatedGif = false) +{ $id = uniqid(); //getImageTagIfExists($relativePath, $title = '', $id = '', $style = '', $class = 'img img-responsive', $lazyLoad = false, $preloadImage=false) $img = getImageTagIfExists($relativePath, $title, "thumbsJPG{$id}", '', 'thumbsJPG img img-responsive', false, true) . PHP_EOL; @@ -2882,7 +2984,8 @@ function getVideoImagewithHoverAnimation($relativePath, $relativePathHoverAnimat return '
' . $img . '
'; } -function getRelativePath($path) { +function getRelativePath($path) +{ global $global; $relativePath = ''; $parts = explode('view/img/', $path); @@ -2906,7 +3009,8 @@ function getRelativePath($path) { return $parts2[0]; } -function local_get_contents($path) { +function local_get_contents($path) +{ if (function_exists('fopen')) { $myfile = fopen($path, "r") or die("Unable to open file! [{$path}]"); $text = fread($myfile, filesize($path)); @@ -2915,14 +3019,16 @@ function local_get_contents($path) { } } -function getSelfUserAgent() { +function getSelfUserAgent() +{ global $global, $AVideoStreamer_UA; $agent = $AVideoStreamer_UA . "_"; $agent .= md5($global['salt']); return $agent; } -function isValidM3U8Link($url, $timeout = 3) { +function isValidM3U8Link($url, $timeout = 3) +{ if (!isValidURL($url)) { return false; } @@ -2935,7 +3041,8 @@ function isValidM3U8Link($url, $timeout = 3) { return false; } -function copy_remotefile_if_local_is_smaller($url, $destination) { +function copy_remotefile_if_local_is_smaller($url, $destination) +{ if (file_exists($destination)) { $size = filesize($destination); $remote_size = getUsageFromURL($url); @@ -2949,7 +3056,8 @@ function copy_remotefile_if_local_is_smaller($url, $destination) { return file_put_contents($destination, $content); } -function try_get_contents_from_local($url) { +function try_get_contents_from_local($url) +{ if (substr($url, 0, 1) === '/') { // it is not a URL return file_get_contents($url); @@ -2972,7 +3080,8 @@ function try_get_contents_from_local($url) { return false; } -function url_get_contents_with_cache($url, $lifeTime = 60, $ctx = "", $timeout = 0, $debug = false, $mantainSession = false) { +function url_get_contents_with_cache($url, $lifeTime = 60, $ctx = "", $timeout = 0, $debug = false, $mantainSession = false) +{ $url = removeQueryStringParameter($url, 'pass'); $cacheName = str_replace('/', '-', $url); $cache = ObjectYPT::getCacheGlobal($cacheName, $lifeTime); // 24 hours @@ -2987,7 +3096,8 @@ function url_get_contents_with_cache($url, $lifeTime = 60, $ctx = "", $timeout = return $return; } -function url_get_contents($url, $ctx = "", $timeout = 0, $debug = false, $mantainSession = false) { +function url_get_contents($url, $ctx = "", $timeout = 0, $debug = false, $mantainSession = false) +{ global $global, $mysqlHost, $mysqlUser, $mysqlPass, $mysqlDatabase, $mysqlPort; if (!isValidURLOrPath($url)) { _error_log('url_get_contents Cannot download ' . $url); @@ -3102,7 +3212,8 @@ function url_get_contents($url, $ctx = "", $timeout = 0, $debug = false, $mantai return false; } -function getUpdatesFilesArray() { +function getUpdatesFilesArray() +{ global $config, $global; if (!class_exists('User') || !User::isAdmin()) { return []; @@ -3123,7 +3234,8 @@ function getUpdatesFilesArray() { return $updateFiles; } -function thereIsAnyUpdate() { +function thereIsAnyUpdate() +{ if (!User::isAdmin()) { return false; } @@ -3138,7 +3250,8 @@ function thereIsAnyUpdate() { return @$_SESSION['sessionCache'][$name]; } -function thereIsAnyRemoteUpdate() { +function thereIsAnyRemoteUpdate() +{ if (!User::isAdmin()) { return false; } @@ -3170,7 +3283,8 @@ function thereIsAnyRemoteUpdate() { return $_SESSION['sessionCache'][$name]; } -function UTF8encode($data) { +function UTF8encode($data) +{ if (emptyHTML($data)) { return $data; } @@ -3193,7 +3307,8 @@ function UTF8encode($data) { } //detect search engine bots -function isBot() { +function isBot() +{ global $_isBot; if (empty($_SERVER['HTTP_USER_AGENT'])) { return true; @@ -3241,7 +3356,8 @@ function isBot() { * @param string $adaptive * @return boolean */ -function tail($filepath, $lines = 1, $adaptive = true, $returnArray = false) { +function tail($filepath, $lines = 1, $adaptive = true, $returnArray = false) +{ if (!function_exists('mb_strlen')) { $msg = "AVideoLog::ERROR you need to install the mb_strlen function to make it work, please the command 'sudo apt install php-mbstring'"; if ($returnArray) { @@ -3309,7 +3425,8 @@ function tail($filepath, $lines = 1, $adaptive = true, $returnArray = false) { } } -function encryptPassword($password, $noSalt = false) { +function encryptPassword($password, $noSalt = false) +{ global $advancedCustom, $global, $advancedCustomUser; if (!empty($advancedCustomUser->encryptPasswordsWithSalt) && !empty($global['salt']) && empty($noSalt)) { $password .= $global['salt']; @@ -3318,7 +3435,8 @@ function encryptPassword($password, $noSalt = false) { return md5(hash("whirlpool", sha1($password))); } -function encryptPasswordVerify($password, $hash, $encodedPass = false) { +function encryptPasswordVerify($password, $hash, $encodedPass = false) +{ global $advancedCustom, $global; if (!$encodedPass || $encodedPass === 'false') { //_error_log("encryptPasswordVerify: encrypt"); @@ -3348,7 +3466,8 @@ function encryptPasswordVerify($password, $hash, $encodedPass = false) { return $isValid; } -function isMobile($userAgent = null, $httpHeaders = null) { +function isMobile($userAgent = null, $httpHeaders = null) +{ if (empty($userAgent) && empty($_SERVER["HTTP_USER_AGENT"])) { return false; } @@ -3359,7 +3478,8 @@ function isMobile($userAgent = null, $httpHeaders = null) { return $detect->isMobile($userAgent, $httpHeaders); } -function isAndroid() { +function isAndroid() +{ global $global; require_once $global['systemRootPath'] . 'objects/Mobile_Detect.php'; $detect = new Mobile_Detect(); @@ -3367,11 +3487,13 @@ function isAndroid() { return $detect->is('AndroidOS'); } -function isChannelPage() { +function isChannelPage() +{ return strpos($_SERVER["SCRIPT_NAME"], 'view/channel.php') !== false; } -function isAVideoMobileApp($user_agent = "") { +function isAVideoMobileApp($user_agent = "") +{ if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } @@ -3389,7 +3511,8 @@ function isAVideoMobileApp($user_agent = "") { return false; } -function isAVideoEncoder($user_agent = "") { +function isAVideoEncoder($user_agent = "") +{ if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } @@ -3407,21 +3530,24 @@ function isAVideoEncoder($user_agent = "") { return false; } -function isCDN() { +function isCDN() +{ if (empty($_SERVER['HTTP_CDN_HOST'])) { return false; } return isFromCDN($_SERVER['HTTP_CDN_HOST']); } -function isFromCDN($url) { +function isFromCDN($url) +{ if (preg_match('/cdn.ypt.me/i', $url)) { return true; } return false; } -function isAVideo($user_agent = "") { +function isAVideo($user_agent = "") +{ if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } @@ -3439,7 +3565,8 @@ function isAVideo($user_agent = "") { return false; } -function isAVideoEncoderOnSameDomain() { +function isAVideoEncoderOnSameDomain() +{ $url = isAVideoEncoder(); if (empty($url)) { return false; @@ -3448,7 +3575,8 @@ function isAVideoEncoderOnSameDomain() { return isSameDomainAsMyAVideo($url); } -function isSameDomainAsMyAVideo($url) { +function isSameDomainAsMyAVideo($url) +{ global $global; if (empty($url)) { return false; @@ -3456,7 +3584,8 @@ function isSameDomainAsMyAVideo($url) { return isSameDomain($url, $global['webSiteRootURL']) || isSameDomain($url, getCDN()); } -function getRefferOrOrigin() { +function getRefferOrOrigin() +{ $url = ''; if (!empty($_SERVER['HTTP_REFERER'])) { $url = $_SERVER['HTTP_REFERER']; @@ -3466,7 +3595,8 @@ function getRefferOrOrigin() { return $url; } -function requestComesFromSameDomainAsMyAVideo() { +function requestComesFromSameDomainAsMyAVideo() +{ global $global; $url = getRefferOrOrigin(); //var_dump($_SERVER);exit; @@ -3474,14 +3604,16 @@ function requestComesFromSameDomainAsMyAVideo() { return isSameDomain($url, $global['webSiteRootURL']) || isSameDomain($url, getCDN()) || isFromCDN($url); } -function forbidIfIsUntrustedRequest($logMsg = '', $approveAVideoUserAgent = true) { +function forbidIfIsUntrustedRequest($logMsg = '', $approveAVideoUserAgent = true) +{ global $global; if (isUntrustedRequest($logMsg, $approveAVideoUserAgent)) { forbiddenPage('Invalid Request ' . getRealIpAddr(), true); } } -function isUntrustedRequest($logMsg = '', $approveAVideoUserAgent = true) { +function isUntrustedRequest($logMsg = '', $approveAVideoUserAgent = true) +{ global $global; if (!empty($global['bypassSameDomainCheck']) || isCommandLineInterface()) { return false; @@ -3497,14 +3629,16 @@ function isUntrustedRequest($logMsg = '', $approveAVideoUserAgent = true) { return false; } -function forbidIfItIsNotMyUsersId($users_id, $logMsg = '') { +function forbidIfItIsNotMyUsersId($users_id, $logMsg = '') +{ if (itIsNotMyUsersId($users_id)) { _error_log("forbidIfItIsNotMyUsersId: [{$users_id}]!=[" . User::getId() . "] {$logMsg}"); forbiddenPage('It is not your user ' . getRealIpAddr(), true); } } -function itIsNotMyUsersId($users_id) { +function itIsNotMyUsersId($users_id) +{ $users_id = intval($users_id); if (empty($users_id)) { return false; @@ -3515,11 +3649,13 @@ function itIsNotMyUsersId($users_id) { return User::getId() != $users_id; } -function requestComesFromSafePlace() { +function requestComesFromSafePlace() +{ return (requestComesFromSameDomainAsMyAVideo() || isAVideo()); } -function addGlobalTokenIfSameDomain($url) { +function addGlobalTokenIfSameDomain($url) +{ if (!filter_var($url, FILTER_VALIDATE_URL) || (empty($_GET['livelink']) || !preg_match("/^http.*/i", $_GET['livelink']))) { return $url; } @@ -3529,7 +3665,8 @@ function addGlobalTokenIfSameDomain($url) { return addQueryStringParameter($url, 'globalToken', getToken(60)); } -function isGlobalTokenValid() { +function isGlobalTokenValid() +{ if (empty($_REQUEST['globalToken'])) { return false; } @@ -3544,7 +3681,8 @@ function isGlobalTokenValid() { * * @return string */ -function removeQueryStringParameter($url, $varname) { +function removeQueryStringParameter($url, $varname) +{ $parsedUrl = parse_url($url); if (empty($parsedUrl) || empty($parsedUrl['host'])) { return $url; @@ -3575,7 +3713,8 @@ function removeQueryStringParameter($url, $varname) { * * @return string */ -function addQueryStringParameter($url, $varname, $value) { +function addQueryStringParameter($url, $varname, $value) +{ if ($value === null || $value === '') { return removeQueryStringParameter($url, $varname); } @@ -3606,14 +3745,16 @@ function addQueryStringParameter($url, $varname, $value) { return $scheme . '//' . $parsedUrl['host'] . $port . $path . $query; } -function isSameDomain($url1, $url2) { +function isSameDomain($url1, $url2) +{ if (empty($url1) || empty($url2)) { return false; } return (get_domain($url1) === get_domain($url2)); } -function isAVideoStreamer($user_agent = "") { +function isAVideoStreamer($user_agent = "") +{ if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } @@ -3628,7 +3769,8 @@ function isAVideoStreamer($user_agent = "") { return false; } -function isAVideoUserAgent($user_agent = "") { +function isAVideoUserAgent($user_agent = "") +{ if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } @@ -3650,7 +3792,8 @@ function isAVideoUserAgent($user_agent = "") { return false; } -function isAVideoStorage($user_agent = "") { +function isAVideoStorage($user_agent = "") +{ if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } @@ -3668,7 +3811,8 @@ function isAVideoStorage($user_agent = "") { return false; } -function get_domain($url, $ifEmptyReturnSameString = false) { +function get_domain($url, $ifEmptyReturnSameString = false) +{ $pieces = parse_url($url); $domain = $pieces['host'] ?? ''; if (empty($domain)) { @@ -3685,7 +3829,8 @@ function get_domain($url, $ifEmptyReturnSameString = false) { return false; } -function verify($url) { +function verify($url) +{ global $global; ini_set('default_socket_timeout', 5); $cacheFile = sys_get_temp_dir() . '/' . md5($url) . "_verify.log"; @@ -3719,7 +3864,8 @@ function verify($url) { return json_decode($result); } -function isVerified($url) { +function isVerified($url) +{ $resultV = verify($url); if (!empty($resultV) && !$resultV->verified) { error_log("Error on Login not verified"); @@ -3728,7 +3874,8 @@ function isVerified($url) { return true; } -function siteMap() { +function siteMap() +{ _error_log("siteMap: start"); ini_set('memory_limit', '-1'); ini_set('max_execution_time', 0); @@ -3929,7 +4076,8 @@ function siteMap() { return $newXML5; } -function object_to_array($obj) { +function object_to_array($obj) +{ //only process if it's an object or array being passed to the function if (is_object($obj) || is_array($obj)) { $ret = (array) $obj; @@ -3945,7 +4093,8 @@ function object_to_array($obj) { } } -function allowOrigin() { +function allowOrigin() +{ global $global; cleanUpAccessControlHeader(); $HTTP_ORIGIN = empty($_SERVER['HTTP_ORIGIN']) ? @$_SERVER['HTTP_REFERER'] : $_SERVER['HTTP_ORIGIN']; @@ -3962,7 +4111,8 @@ function allowOrigin() { header("Access-Control-Allow-Headers: Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"); } -function cleanUpAccessControlHeader() { +function cleanUpAccessControlHeader() +{ if (!headers_sent()) { foreach (headers_list() as $header) { if (preg_match('/Access-Control-Allow-Origin/i', $header)) { @@ -3973,7 +4123,8 @@ function cleanUpAccessControlHeader() { } } -function rrmdir($dir) { +function rrmdir($dir) +{ //if(preg_match('/cache/i', $dir)){_error_log("rrmdir($dir) ". json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)));exit;} $dir = str_replace(['//', '\\\\'], DIRECTORY_SEPARATOR, $dir); @@ -4024,7 +4175,8 @@ function rrmdir($dir) { } } -function rrmdirCommandLine($dir, $async = false) { +function rrmdirCommandLine($dir, $async = false) +{ if (is_dir($dir)) { $dir = escapeshellarg($dir); if (isWindows()) { @@ -4045,7 +4197,8 @@ function rrmdirCommandLine($dir, $async = false) { * You can now configure it on the configuration.php * @return boolean */ -function ddosProtection() { +function ddosProtection() +{ global $global; $maxCon = empty($global['ddosMaxConnections']) ? 40 : $global['ddosMaxConnections']; $secondTimeout = empty($global['ddosSecondTimeout']) ? 5 : $global['ddosSecondTimeout']; @@ -4094,7 +4247,8 @@ function ddosProtection() { return true; } -function getAdsLeaderBoardBigVideo() { +function getAdsLeaderBoardBigVideo() +{ $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); $adCode = ''; if (!empty($ad)) { @@ -4103,7 +4257,8 @@ function getAdsLeaderBoardBigVideo() { return $adCode; } -function getAdsLeaderBoardTop() { +function getAdsLeaderBoardTop() +{ $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); $adCode = ''; if (!empty($ad)) { @@ -4112,7 +4267,8 @@ function getAdsLeaderBoardTop() { return $adCode; } -function getAdsChannelLeaderBoardTop() { +function getAdsChannelLeaderBoardTop() +{ $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); $adCode = ''; if (!empty($ad)) { @@ -4121,7 +4277,8 @@ function getAdsChannelLeaderBoardTop() { return $adCode; } -function getAdsLeaderBoardTop2() { +function getAdsLeaderBoardTop2() +{ $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); $adCode = ''; if (!empty($ad)) { @@ -4130,7 +4287,8 @@ function getAdsLeaderBoardTop2() { return $adCode; } -function getAdsLeaderBoardMiddle() { +function getAdsLeaderBoardMiddle() +{ $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); $adCode = ''; if (!empty($ad)) { @@ -4139,7 +4297,8 @@ function getAdsLeaderBoardMiddle() { return $adCode; } -function getAdsLeaderBoardFooter() { +function getAdsLeaderBoardFooter() +{ $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); $adCode = ''; if (!empty($ad)) { @@ -4148,7 +4307,8 @@ function getAdsLeaderBoardFooter() { return $adCode; } -function getAdsSideRectangle() { +function getAdsSideRectangle() +{ $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); $adCode = ''; if (!empty($ad)) { @@ -4157,7 +4317,8 @@ function getAdsSideRectangle() { return $adCode; } -function isToHidePrivateVideos() { +function isToHidePrivateVideos() +{ $obj = AVideoPlugin::getObjectDataIfEnabled("Gallery"); if (!empty($obj)) { return $obj->hidePrivateVideos; @@ -4173,7 +4334,8 @@ function isToHidePrivateVideos() { return false; } -function convertImageToOG($source, $destination) { +function convertImageToOG($source, $destination) +{ if (!file_exists($destination)) { $w = 200; $h = 200; @@ -4189,11 +4351,13 @@ function convertImageToOG($source, $destination) { return $destination; } -function convertImageToRoku($source, $destination) { +function convertImageToRoku($source, $destination) +{ return convertImageIfNotExists($source, $destination, 1280, 720, true); } -function convertImageIfNotExists($source, $destination, $width, $height, $scaleUp = true) { +function convertImageIfNotExists($source, $destination, $width, $height, $scaleUp = true) +{ if (empty($source)) { _error_log("convertImageIfNotExists: source image is empty"); return false; @@ -4251,17 +4415,20 @@ function convertImageIfNotExists($source, $destination, $width, $height, $scaleU return $destination; } -function ogSite() { +function ogSite() +{ global $global, $config; include $global['systemRootPath'] . 'objects/functionogSite.php'; } -function getOpenGraph($videos_id) { +function getOpenGraph($videos_id) +{ global $global, $config, $advancedCustom; include $global['systemRootPath'] . 'objects/functiongetOpenGraph.php'; } -function getLdJson($videos_id) { +function getLdJson($videos_id) +{ $cache = ObjectYPT::getCacheGlobal("getLdJson{$videos_id}", 0); if (empty($cache)) { echo $cache; @@ -4331,7 +4498,8 @@ function getLdJson($videos_id) { echo $output; } -function getItemprop($videos_id) { +function getItemprop($videos_id) +{ $cache = ObjectYPT::getCacheGlobal("getItemprop{$videos_id}", 0); if (empty($cache)) { echo $cache; @@ -4373,7 +4541,8 @@ function getItemprop($videos_id) { echo $output; } -function getOS($user_agent = "") { +function getOS($user_agent = "") +{ if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } @@ -4418,7 +4587,8 @@ function getOS($user_agent = "") { return $os_platform; } -function get_browser_name($user_agent = "") { +function get_browser_name($user_agent = "") +{ if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } @@ -4501,10 +4671,10 @@ function get_browser_name($user_agent = "") { // Check for strings commonly used in bot user agents elseif ( - strpos($t, 'crawler') || strpos($t, 'api') || - strpos($t, 'spider') || strpos($t, 'http') || - strpos($t, 'bot') || strpos($t, 'archive') || - strpos($t, 'info') || strpos($t, 'data') + strpos($t, 'crawler') || strpos($t, 'api') || + strpos($t, 'spider') || strpos($t, 'http') || + strpos($t, 'bot') || strpos($t, 'archive') || + strpos($t, 'info') || strpos($t, 'data') ) { return '[Bot] Other'; } @@ -4517,7 +4687,8 @@ function get_browser_name($user_agent = "") { * we need to detect the chrome browser and load an older version * */ -function isOldChromeVersion() { +function isOldChromeVersion() +{ global $global; if (empty($_SERVER['HTTP_USER_AGENT'])) { return false; @@ -4531,7 +4702,8 @@ function isOldChromeVersion() { return false; } -function TimeLogStart($name) { +function TimeLogStart($name) +{ global $global; if (!empty($global['noDebug'])) { return false; @@ -4546,7 +4718,8 @@ function TimeLogStart($name) { return $name; } -function TimeLogEnd($name, $line, $TimeLogLimit = 0.7) { +function TimeLogEnd($name, $line, $TimeLogLimit = 0.7) +{ global $global; if (!empty($global['noDebug']) || empty($global['start'][$name])) { return false; @@ -4565,17 +4738,18 @@ function TimeLogEnd($name, $line, $TimeLogLimit = 0.7) { TimeLogStart($name); } -class AVideoLog { +class AVideoLog +{ public static $DEBUG = 0; public static $WARNING = 1; public static $ERROR = 2; public static $SECURITY = 3; public static $SOCKET = 4; - } -function _error_log_debug($message, $show_args = false) { +function _error_log_debug($message, $show_args = false) +{ $array = debug_backtrace(); $message .= PHP_EOL; foreach ($array as $value) { @@ -4587,7 +4761,8 @@ function _error_log_debug($message, $show_args = false) { _error_log(PHP_EOL . '***' . PHP_EOL . $message . '***'); } -function _error_log($message, $type = 0, $doNotRepeat = false) { +function _error_log($message, $type = 0, $doNotRepeat = false) +{ if (empty($doNotRepeat)) { // do not log it too many times when you are using HLS format, other wise it will fill the log file with the same error $doNotRepeat = preg_match("/hls.php$/", $_SERVER['SCRIPT_NAME']); @@ -4627,7 +4802,8 @@ function _error_log($message, $type = 0, $doNotRepeat = false) { error_log($str); } -function postVariables($url, $array, $httpcodeOnly = true, $timeout = 10) { +function postVariables($url, $array, $httpcodeOnly = true, $timeout = 10) +{ if (!$url || !is_string($url) || !preg_match('/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(\/.*)?$/i', $url)) { return false; } @@ -4663,7 +4839,8 @@ function postVariables($url, $array, $httpcodeOnly = true, $timeout = 10) { } } -function _session_start(array $options = []) { +function _session_start(array $options = []) +{ try { if (isset($_GET['PHPSESSID']) && !_empty($_GET['PHPSESSID'])) { $PHPSESSID = $_GET['PHPSESSID']; @@ -4698,13 +4875,15 @@ function _session_start(array $options = []) { } } -function _session_regenerate_id() { +function _session_regenerate_id() +{ session_regenerate_id(true); _resetcookie('PHPSESSID', session_id()); _resetcookie(session_name(), session_id()); } -function debugMemmory($line) { +function debugMemmory($line) +{ global $lastDebugMemory, $lastDebugMemoryLine, $global; if (empty($global['debugMemmory'])) { return false; @@ -4726,7 +4905,8 @@ function debugMemmory($line) { * this is necessary because of the signup from the iframe pages * @return boolean */ -function blackListRegenerateSession() { +function blackListRegenerateSession() +{ if (!requestComesFromSafePlace()) { return false; } @@ -4743,7 +4923,8 @@ function blackListRegenerateSession() { return false; } -function _mysql_connect($persistent = false, $try = 0) { +function _mysql_connect($persistent = false, $try = 0) +{ global $global, $mysqlHost, $mysqlUser, $mysqlPass, $mysqlDatabase, $mysqlPort, $mysql_connect_was_closed; $checkValues = ['mysqlHost', 'mysqlUser', 'mysqlPass', 'mysqlDatabase']; @@ -4788,7 +4969,8 @@ function _mysql_connect($persistent = false, $try = 0) { return true; } -function _mysql_commit() { +function _mysql_commit() +{ global $global; if (_mysql_is_open()) { try { @@ -4799,13 +4981,13 @@ function _mysql_commit() { */ @$global['mysqli']->commit(); } catch (Exception $exc) { - } //$global['mysqli'] = false; } } -function _mysql_close() { +function _mysql_close() +{ global $global, $mysql_connect_was_closed; if (_mysql_is_open()) { //_error_log('MySQL Closed '. json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS))); @@ -4818,13 +5000,13 @@ function _mysql_close() { */ @$global['mysqli']->close(); } catch (Exception $exc) { - } //$global['mysqli'] = false; } } -function _mysql_is_open() { +function _mysql_is_open() +{ global $global, $mysql_connect_was_closed; try { /** @@ -4842,7 +5024,8 @@ function _mysql_is_open() { return false; } -function remove_utf8_bom($text) { +function remove_utf8_bom($text) +{ if (strlen($text) > 1000000) { return $text; } @@ -4852,7 +5035,8 @@ function remove_utf8_bom($text) { return $text; } -function getCacheDir() { +function getCacheDir() +{ $p = AVideoPlugin::loadPlugin("Cache"); if (empty($p)) { return addLastSlash(sys_get_temp_dir()); @@ -4860,7 +5044,8 @@ function getCacheDir() { return $p->getCacheDir(); } -function clearCache($firstPageOnly = false) { +function clearCache($firstPageOnly = false) +{ global $global; $lockFile = getVideosDir() . '.clearCache.lock'; if (file_exists($lockFile) && filectime($lockFile) > strtotime('-5 minutes')) { @@ -4900,15 +5085,18 @@ function clearCache($firstPageOnly = false) { return true; } -function clearAllUsersSessionCache() { +function clearAllUsersSessionCache() +{ sendSocketMessageToAll(time(), 'socketClearSessionCache'); } -function clearFirstPageCache() { +function clearFirstPageCache() +{ return clearCache(true); } -function getUsageFromFilename($filename, $dir = "") { +function getUsageFromFilename($filename, $dir = "") +{ global $global; if (!empty($global['getUsageFromFilename'])) { // manually add this variable in your configuration.php file to not scan your video usage @@ -5065,7 +5253,8 @@ function getUsageFromFilename($filename, $dir = "") { * return The size of the file referenced by $url, or false if the size * could not be determined. */ -function getUsageFromURL($url) { +function getUsageFromURL($url) +{ global $global; if (!empty($global['doNotGetUsageFromURL'])) { // manually add this variable in your configuration.php file to not scan your video usage @@ -5120,7 +5309,8 @@ function getUsageFromURL($url) { return (int) $result; } -function getDirSize($dir, $forceNew = false) { +function getDirSize($dir, $forceNew = false) +{ global $_getDirSize; if (!isset($_getDirSize)) { @@ -5163,7 +5353,8 @@ function getDirSize($dir, $forceNew = false) { } } -function foldersize($path) { +function foldersize($path) +{ $total_size = 0; $files = scandir($path); $cleanPath = rtrim($path, '/') . '/'; @@ -5184,7 +5375,8 @@ function foldersize($path) { return $total_size; } -function getDiskUsage() { +function getDiskUsage() +{ global $global; $dir = getVideosDir() . ""; $obj = new stdClass(); @@ -5206,11 +5398,13 @@ function getDiskUsage() { return $obj; } -function unsetSearch() { +function unsetSearch() +{ unset($_GET['searchPhrase'], $_POST['searchPhrase'], $_GET['search'], $_GET['q']); } -function encrypt_decrypt($string, $action) { +function encrypt_decrypt($string, $action) +{ global $global; $output = false; if (empty($string)) { @@ -5241,32 +5435,37 @@ function encrypt_decrypt($string, $action) { return $output; } -function compressString($string) { +function compressString($string) +{ if (function_exists("gzdeflate")) { $string = gzdeflate($string, 9); } return $string; } -function decompressString($string) { +function decompressString($string) +{ if (function_exists("gzinflate")) { $string = gzinflate($string); } return $string; } -function encryptString($string) { +function encryptString($string) +{ if (is_object($string) || is_array($string)) { $string = json_encode($string); } return encrypt_decrypt($string, 'encrypt'); } -function decryptString($string) { +function decryptString($string) +{ return encrypt_decrypt($string, 'decrypt'); } -function getToken($timeout = 0, $salt = "") { +function getToken($timeout = 0, $salt = "") +{ global $global; $obj = new stdClass(); $obj->salt = $global['salt'] . $salt; @@ -5286,11 +5485,13 @@ function getToken($timeout = 0, $salt = "") { return encryptString($strObj); } -function isTokenValid($token, $salt = "") { +function isTokenValid($token, $salt = "") +{ return verifyToken($token, $salt); } -function verifyToken($token, $salt = "") { +function verifyToken($token, $salt = "") +{ global $global; $obj = _json_decode(decryptString($token)); if (empty($obj)) { @@ -5312,7 +5513,8 @@ function verifyToken($token, $salt = "") { return true; } -class YPTvideoObject { +class YPTvideoObject +{ public $id; public $title; @@ -5321,7 +5523,8 @@ class YPTvideoObject { public $channelTitle; public $videoLink; - public function __construct($id, $title, $description, $thumbnails, $channelTitle, $videoLink) { + public function __construct($id, $title, $description, $thumbnails, $channelTitle, $videoLink) + { $this->id = $id; $this->title = $title; $this->description = $description; @@ -5329,10 +5532,10 @@ class YPTvideoObject { $this->channelTitle = $channelTitle; $this->videoLink = $videoLink; } - } -function isToShowDuration($type) { +function isToShowDuration($type) +{ $notShowTo = ['pdf', 'article', 'serie', 'zip', 'image', 'live', 'livelinks']; if (in_array($type, $notShowTo)) { return false; @@ -5341,13 +5544,15 @@ function isToShowDuration($type) { } } -function _dieAndLogObject($obj, $prefix = "") { +function _dieAndLogObject($obj, $prefix = "") +{ $objString = json_encode($obj); _error_log($prefix . $objString); die($objString); } -function isAVideoPlayer() { +function isAVideoPlayer() +{ global $global; if (!empty($global['doNotLoadPlayer'])) { return false; @@ -5358,12 +5563,14 @@ function isAVideoPlayer() { return false; } -function isFirstPage() { +function isFirstPage() +{ global $isFirstPage, $global; return !empty($isFirstPage) || getSelfURI() === "{$global['webSiteRootURL']}view/"; } -function isVideo() { +function isVideo() +{ global $isModeYouTube, $global; if (!empty($global['doNotLoadPlayer'])) { return false; @@ -5371,12 +5578,14 @@ function isVideo() { return !empty($isModeYouTube) || isPlayList() || isEmbed() || isLive(); } -function isOffline() { +function isOffline() +{ global $_isOffline; return !empty($_isOffline); } -function isVideoTypeEmbed() { +function isVideoTypeEmbed() +{ global $isVideoTypeEmbed; if (isVideo() && !empty($isVideoTypeEmbed) && $videos_id = getVideos_id()) { @@ -5386,21 +5595,25 @@ function isVideoTypeEmbed() { return false; } -function isAudio() { +function isAudio() +{ global $isAudio; return !empty($isAudio) || Video::forceAudio(); } -function isSerie() { +function isSerie() +{ return isPlayList(); } -function isPlayList() { +function isPlayList() +{ global $isPlayList, $isSerie; return !empty($isSerie) || !empty($isPlayList); } -function isChannel() { +function isChannel() +{ global $isChannel; if (!empty($isChannel) && !isVideo()) { $user_id = 0; @@ -5424,7 +5637,8 @@ function isChannel() { return false; } -function isEmbed() { +function isEmbed() +{ global $isEmbed, $global; if (!empty($global['doNotLoadPlayer'])) { return false; @@ -5432,7 +5646,8 @@ function isEmbed() { return !empty($isEmbed); } -function isWebRTC() { +function isWebRTC() +{ global $isWebRTC, $global; if (!empty($global['doNotLoadPlayer'])) { return false; @@ -5440,7 +5655,8 @@ function isWebRTC() { return !empty($isWebRTC); } -function isLive() { +function isLive() +{ global $isLive, $global; if (!empty($global['doNotLoadPlayer'])) { return false; @@ -5464,7 +5680,8 @@ function isLive() { } } -function isLiveLink() { +function isLiveLink() +{ global $isLiveLink; if (!empty($isLiveLink)) { return $isLiveLink; @@ -5473,7 +5690,8 @@ function isLiveLink() { } } -function getLiveKey() { +function getLiveKey() +{ global $getLiveKey; if (empty($getLiveKey)) { return false; @@ -5481,7 +5699,8 @@ function getLiveKey() { return $getLiveKey; } -function setLiveKey($key, $live_servers_id, $live_index = '') { +function setLiveKey($key, $live_servers_id, $live_index = '') +{ global $getLiveKey; $parameters = Live::getLiveParametersFromKey($key); $key = $parameters['key']; @@ -5502,7 +5721,8 @@ function setLiveKey($key, $live_servers_id, $live_index = '') { return $getLiveKey; } -function isVideoPlayerHasProgressBar() { +function isVideoPlayerHasProgressBar() +{ if (isWebRTC()) { return false; } @@ -5517,7 +5737,8 @@ function isVideoPlayerHasProgressBar() { return false; } -function isHLS() { +function isHLS() +{ global $video, $global; if (isLive()) { return true; @@ -5527,7 +5748,8 @@ function isHLS() { return false; } -function getRedirectUri($returnThisIfRedirectUriIsNotSet = false) { +function getRedirectUri($returnThisIfRedirectUriIsNotSet = false) +{ if (isValidURL(@$_GET['redirectUri'])) { return $_GET['redirectUri']; } @@ -5547,12 +5769,14 @@ function getRedirectUri($returnThisIfRedirectUriIsNotSet = false) { } } -function setRedirectUri($redirectUri) { +function setRedirectUri($redirectUri) +{ _session_start(); $_SESSION['redirectUri'] = $redirectUri; } -function redirectIfRedirectUriIsSet() { +function redirectIfRedirectUriIsSet() +{ $redirectUri = false; if (!empty($_GET['redirectUri'])) { if (isSameDomainAsMyAVideo($_GET['redirectUri'])) { @@ -5573,7 +5797,8 @@ function redirectIfRedirectUriIsSet() { } } -function getRedirectToVideo($videos_id) { +function getRedirectToVideo($videos_id) +{ $redirectUri = getRedirectUri(); $isEmbed = 0; if (stripos($redirectUri, "embed") !== false) { @@ -5586,14 +5811,16 @@ function getRedirectToVideo($videos_id) { return Video::getLink($videos_id, $video['clean_title'], $isEmbed); } -function getRequestURI() { +function getRequestURI() +{ if (empty($_SERVER['REQUEST_URI'])) { return ""; } return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; } -function getSelfURI() { +function getSelfURI() +{ if (empty($_SERVER['PHP_SELF']) || empty($_SERVER['HTTP_HOST'])) { return ""; } @@ -5612,11 +5839,13 @@ function getSelfURI() { return fixTestURL($url); } -function isSameVideoAsSelfURI($url) { +function isSameVideoAsSelfURI($url) +{ return URLsAreSameVideo($url, getSelfURI()); } -function URLsAreSameVideo($url1, $url2) { +function URLsAreSameVideo($url1, $url2) +{ $videos_id1 = getVideoIDFromURL($url1); $videos_id2 = getVideoIDFromURL($url2); if (empty($videos_id1) || empty($videos_id2)) { @@ -5625,7 +5854,8 @@ function URLsAreSameVideo($url1, $url2) { return $videos_id1 === $videos_id2; } -function getVideos_id($returnPlaylistVideosIDIfIsSerie = false) { +function getVideos_id($returnPlaylistVideosIDIfIsSerie = false) +{ global $_getVideos_id; $videos_id = false; if (isset($_getVideos_id) && is_int($_getVideos_id)) { @@ -5668,7 +5898,8 @@ function getVideos_id($returnPlaylistVideosIDIfIsSerie = false) { return $videos_id; } -function getPlayListIndex() { +function getPlayListIndex() +{ global $__playlistIndex; if (empty($__playlistIndex) && !empty($_REQUEST['playlist_index'])) { $__playlistIndex = intval($_REQUEST['playlist_index']); @@ -5676,7 +5907,8 @@ function getPlayListIndex() { return intval($__playlistIndex); } -function getPlayListData() { +function getPlayListData() +{ global $playListData; if (empty($playListData)) { $playListData = []; @@ -5684,7 +5916,8 @@ function getPlayListData() { return $playListData; } -function getPlayListDataVideosId() { +function getPlayListDataVideosId() +{ $playListData_videos_id = []; foreach (getPlayListData() as $value) { $playListData_videos_id[] = $value->getVideos_id(); @@ -5692,7 +5925,8 @@ function getPlayListDataVideosId() { return $playListData_videos_id; } -function getPlayListCurrentVideo($setVideos_id = true) { +function getPlayListCurrentVideo($setVideos_id = true) +{ $videos_id = getPlayListCurrentVideosId($setVideos_id); if (empty($videos_id)) { return false; @@ -5701,7 +5935,8 @@ function getPlayListCurrentVideo($setVideos_id = true) { return $video; } -function getPlayListCurrentVideosId($setVideos_id = true) { +function getPlayListCurrentVideosId($setVideos_id = true) +{ $playListData = getPlayListData(); $playlist_index = getPlayListIndex(); if (empty($playListData[$playlist_index])) { @@ -5715,17 +5950,20 @@ function getPlayListCurrentVideosId($setVideos_id = true) { return $videos_id; } -function setPlayListIndex($index) { +function setPlayListIndex($index) +{ global $__playlistIndex; $__playlistIndex = intval($index); } -function setVideos_id($videos_id) { +function setVideos_id($videos_id) +{ global $_getVideos_id; $_getVideos_id = $videos_id; } -function getPlaylists_id() { +function getPlaylists_id() +{ global $_isPlayList; if (!isset($_isPlayList)) { $_isPlayList = false; @@ -5749,7 +5987,8 @@ function getPlaylists_id() { return $_isPlayList; } -function isVideoOrAudioNotEmbed() { +function isVideoOrAudioNotEmbed() +{ if (!isVideo()) { return false; } @@ -5768,7 +6007,8 @@ function isVideoOrAudioNotEmbed() { return false; } -function getVideoIDFromURL($url) { +function getVideoIDFromURL($url) +{ if (preg_match("/v=([0-9]+)/", $url, $matches)) { return intval($matches[1]); } @@ -5797,7 +6037,8 @@ function getVideoIDFromURL($url) { return false; } -function getBackURL() { +function getBackURL() +{ global $global; $backURL = getRedirectUri(); if (empty($backURL)) { @@ -5809,7 +6050,8 @@ function getBackURL() { return $backURL; } -function getHomeURL() { +function getHomeURL() +{ global $global, $advancedCustomUser, $advancedCustom; if (isValidURL($advancedCustomUser->afterLoginGoToURL)) { return $advancedCustomUser->afterLoginGoToURL; @@ -5819,7 +6061,8 @@ function getHomeURL() { return $global['webSiteRootURL']; } -function isValidURL($url) { +function isValidURL($url) +{ //var_dump(empty($url), !is_string($url), preg_match("/^http.*/", $url), filter_var($url, FILTER_VALIDATE_URL)); if (empty($url) || !is_string($url)) { return false; @@ -5830,7 +6073,8 @@ function isValidURL($url) { return false; } -function isValidEmail($email) { +function isValidEmail($email) +{ global $_email_hosts_checked; if (empty($email)) { return false; @@ -5852,8 +6096,8 @@ function isValidEmail($email) { $_email_hosts_checked[$email_host] = true; // Check if valid IP (v4 or v6). If it is we can't do a DNS lookup if (!filter_var($email_host, FILTER_VALIDATE_IP, [ - 'flags' => FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE, - ])) { + 'flags' => FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE, + ])) { //Add a dot to the end of the host name to make a fully qualified domain name // and get last array element because an escaped @ is allowed in the local part (RFC 5322) // Then convert to ascii (http://us.php.net/manual/en/function.idn-to-ascii.php) @@ -5868,7 +6112,8 @@ function isValidEmail($email) { return $_email_hosts_checked[$email_host]; } -function isValidURLOrPath($str, $insideCacheOrTmpDirOnly = true) { +function isValidURLOrPath($str, $insideCacheOrTmpDirOnly = true) +{ global $global; //var_dump(empty($url), !is_string($url), preg_match("/^http.*/", $url), filter_var($url, FILTER_VALIDATE_URL)); if (empty($str) || !is_string($str)) { @@ -5895,11 +6140,11 @@ function isValidURLOrPath($str, $insideCacheOrTmpDirOnly = true) { foreach ($pathsToCheck as $value) { if ( - str_starts_with($value, $absolutePathTmp) || - str_starts_with($value, '/var/www/') || - str_starts_with($value, $absolutePathCache) || - str_starts_with($value, $global['systemRootPath']) || - str_starts_with($value, getVideosDir()) + str_starts_with($value, $absolutePathTmp) || + str_starts_with($value, '/var/www/') || + str_starts_with($value, $absolutePathCache) || + str_starts_with($value, $global['systemRootPath']) || + str_starts_with($value, getVideosDir()) ) { return true; } @@ -5915,21 +6160,25 @@ function isValidURLOrPath($str, $insideCacheOrTmpDirOnly = true) { return false; } -function hasLastSlash($word) { +function hasLastSlash($word) +{ $word = trim($word); return substr($word, -1) === '/'; } -function addLastSlash($word) { +function addLastSlash($word) +{ $word = trim($word); return $word . (hasLastSlash($word) ? "" : "/"); } -function URLHasLastSlash() { +function URLHasLastSlash() +{ return hasLastSlash($_SERVER["REQUEST_URI"]); } -function ucname($str) { +function ucname($str) +{ $str = ucwords(mb_strtolower($str)); foreach (['\'', '-'] as $delim) { @@ -5940,15 +6189,18 @@ function ucname($str) { return $str; } -function sanitize_input($input) { +function sanitize_input($input) +{ return htmlentities(strip_tags($input)); } -function sanitize_array_item(&$item, $key) { +function sanitize_array_item(&$item, $key) +{ $item = sanitize_input($item); } -function getSEOComplement($parameters = []) { +function getSEOComplement($parameters = []) +{ global $config; $allowedTypes = $parameters["allowedTypes"] ?? null; @@ -5996,7 +6248,8 @@ function getSEOComplement($parameters = []) { return $txt; } -function doNOTOrganizeHTMLIfIsPagination() { +function doNOTOrganizeHTMLIfIsPagination() +{ global $global; $page = getCurrentPage(); if ($page > 1) { @@ -6004,7 +6257,8 @@ function doNOTOrganizeHTMLIfIsPagination() { } } -function getCurrentPage() { +function getCurrentPage() +{ global $lastCurrent; $current = 1; if (!empty($_REQUEST['current'])) { @@ -6035,7 +6289,8 @@ function getCurrentPage() { return $current; } -function getTrendingLimit() { +function getTrendingLimit() +{ global $advancedCustom; if (empty($advancedCustom)) { $advancedCustom = AVideoPlugin::getObjectData("CustomizeAdvanced"); @@ -6044,17 +6299,20 @@ function getTrendingLimit() { return $daysLimit; } -function getTrendingLimitDate() { +function getTrendingLimitDate() +{ $daysLimit = getTrendingLimit(); $dateDaysLimit = date('Y-m-d H:i:s', strtotime("-{$daysLimit} days")); return $dateDaysLimit; } -function setCurrentPage($current) { +function setCurrentPage($current) +{ $_REQUEST['current'] = intval($current); } -function getRowCount($default = 1000) { +function getRowCount($default = 1000) +{ global $global; if (!empty($_REQUEST['rowCount'])) { $defaultN = intval($_REQUEST['rowCount']); @@ -6074,13 +6332,15 @@ function getRowCount($default = 1000) { return (!empty($defaultN) && $defaultN > 0) ? $defaultN : $default; } -function setRowCount($rowCount) { +function setRowCount($rowCount) +{ global $global; $_REQUEST['rowCount'] = intval($rowCount); $global['rowCount'] = $_REQUEST['rowCount']; } -function getSearchVar() { +function getSearchVar() +{ $search = ''; if (!empty($_REQUEST['search'])) { $search = $_REQUEST['search']; @@ -6094,13 +6354,15 @@ function getSearchVar() { return mb_strtolower($search); } -function isSearch() { +function isSearch() +{ return !empty(getSearchVar()); } $cleanSearchHistory = ''; -function cleanSearchVar() { +function cleanSearchVar() +{ global $cleanSearchHistory; $search = getSearchVar(); if (!empty($search)) { @@ -6112,7 +6374,8 @@ function cleanSearchVar() { } } -function reloadSearchVar() { +function reloadSearchVar() +{ global $cleanSearchHistory; $_REQUEST['search'] = $cleanSearchHistory; if (empty($_GET['search'])) { @@ -6123,7 +6386,8 @@ function reloadSearchVar() { } } -function wget($url, $filename, $debug = false) { +function wget($url, $filename, $debug = false) +{ if (empty($url) || $url == "php://input" || !isValidURL($url)) { return false; } @@ -6170,7 +6434,8 @@ function wget($url, $filename, $debug = false) { * @param $infile The full URL to the remote file * @param $outfile The path where to save the file */ -function copyfile_chunked($infile, $outfile) { +function copyfile_chunked($infile, $outfile) +{ $chunksize = 10 * (1024 * 1024); // 10 Megs /** @@ -6251,16 +6516,19 @@ function copyfile_chunked($infile, $outfile) { return $cnt; } -function wgetLockFile($url) { +function wgetLockFile($url) +{ return getTmpDir("YPTWget") . md5($url) . ".lock"; } -function wgetLock($url) { +function wgetLock($url) +{ $file = wgetLockFile($url); return file_put_contents($file, time() . PHP_EOL, FILE_APPEND | LOCK_EX); } -function wgetRemoveLock($url) { +function wgetRemoveLock($url) +{ $filename = wgetLockFile($url); if (!file_exists($filename)) { return false; @@ -6268,16 +6536,19 @@ function wgetRemoveLock($url) { return unlink($filename); } -function getLockFile($name) { +function getLockFile($name) +{ return getTmpDir("YPTLockFile") . md5($name) . ".lock"; } -function setLock($name) { +function setLock($name) +{ $file = getLockFile($name); return file_put_contents($file, time()); } -function isLock($name, $timeout = 60) { +function isLock($name, $timeout = 60) +{ $file = getLockFile($name); if (file_exists($file)) { $time = intval(file_get_contents($file)); @@ -6287,7 +6558,8 @@ function isLock($name, $timeout = 60) { } } -function removeLock($name) { +function removeLock($name) +{ $filename = getLockFile($name); if (!file_exists($filename)) { return false; @@ -6295,7 +6567,8 @@ function removeLock($name) { return unlink($filename); } -function wgetIsLocked($url) { +function wgetIsLocked($url) +{ $filename = wgetLockFile($url); if (!file_exists($filename)) { return false; @@ -6309,7 +6582,8 @@ function wgetIsLocked($url) { } // due the some OS gives a fake is_writable response -function isWritable($dir) { +function isWritable($dir) +{ $dir = rtrim($dir, '/') . '/'; $file = $dir . uniqid(); $result = false; @@ -6325,7 +6599,8 @@ function isWritable($dir) { return $result; } -function _isWritable($dir) { +function _isWritable($dir) +{ if (!isWritable($dir)) { return false; } @@ -6335,7 +6610,8 @@ function _isWritable($dir) { return !empty($bytes); } -function getTmpDir($subdir = "") { +function getTmpDir($subdir = "") +{ global $global; if (empty($_SESSION['getTmpDir'])) { $_SESSION['getTmpDir'] = []; @@ -6368,11 +6644,13 @@ function getTmpDir($subdir = "") { return $tmpDir; } -function getTmpFile() { +function getTmpFile() +{ return getTmpDir("tmpFiles") . uniqid(); } -function getMySQLDate() { +function getMySQLDate() +{ global $global; $sql = "SELECT now() as time FROM configurations LIMIT 1"; // I had to add this because the about from customize plugin was not loading on the about page http://127.0.0.1/AVideo/about @@ -6387,7 +6665,8 @@ function getMySQLDate() { return $row; } -function _file_put_contents($filename, $data, $flags = 0, $context = null) { +function _file_put_contents($filename, $data, $flags = 0, $context = null) +{ make_path($filename); if (!is_string($data)) { $data = _json_encode($data); @@ -6395,7 +6674,8 @@ function _file_put_contents($filename, $data, $flags = 0, $context = null) { return file_put_contents($filename, $data, $flags, $context); } -function html2plainText($html) { +function html2plainText($html) +{ if (!is_string($html)) { return ''; } @@ -6404,19 +6684,20 @@ function html2plainText($html) { return $text; } -function getInputPassword($id, $attributes = 'class="form-control"', $placeholder = '') { +function getInputPassword($id, $attributes = 'class="form-control"', $placeholder = '') +{ if (empty($placeholder)) { $placeholder = __("Password"); } - ?> +?>
> - +
- +?>
> - +
- +?> "; } -function getServerClock() { +function getServerClock() +{ $id = uniqid(); $today = getdate(); $html = '00:00:00'; @@ -7478,7 +7809,8 @@ function getServerClock() { * @param string $filepath * @return boolean */ -function downloadHLS($filepath) { +function downloadHLS($filepath) +{ global $global; if (!CustomizeUser::canDownloadVideos()) { @@ -7523,7 +7855,8 @@ function downloadHLS($filepath) { exit; } -function playHLSasMP4($filepath) { +function playHLSasMP4($filepath) +{ global $global; if (!CustomizeUser::canDownloadVideos()) { @@ -7556,33 +7889,34 @@ function playHLSasMP4($filepath) { exit; } -function getSocialModal($videos_id, $url = "", $title = "") { +function getSocialModal($videos_id, $url = "", $title = "") +{ global $global; $video['id'] = $videos_id; $sharingUid = uniqid(); $filePath = $global['systemRootPath'] . 'objects/functionGetSocialModal.php'; $contents = getIncludeFileContent( - $filePath, - [ - 'videos_id' => $videos_id, - 'url' => $url, - 'title' => $title, - 'video' => $video, - 'sharingUid' => $sharingUid - ] + $filePath, + [ + 'videos_id' => $videos_id, + 'url' => $url, + 'title' => $title, + 'video' => $video, + 'sharingUid' => $sharingUid + ] ); return ['html' => $contents, 'id' => $sharingUid]; } function getCroppie( - $buttonTitle, - $callBackJSFunction, - $resultWidth = 0, - $resultHeight = 0, - $viewportWidth = 0, - $boundary = 25, - $viewportHeight = 0, - $enforceBoundary = true + $buttonTitle, + $callBackJSFunction, + $resultWidth = 0, + $resultHeight = 0, + $viewportWidth = 0, + $boundary = 25, + $viewportHeight = 0, + $enforceBoundary = true ) { global $global; @@ -7645,7 +7979,8 @@ function getCroppie( ]; } -function saveCroppieImage($destination, $postIndex = "imgBase64") { +function saveCroppieImage($destination, $postIndex = "imgBase64") +{ if (empty($destination) || empty($_POST[$postIndex])) { return false; } @@ -7670,7 +8005,8 @@ function saveCroppieImage($destination, $postIndex = "imgBase64") { return $saved; } -function get_ffmpeg($ignoreGPU = false) { +function get_ffmpeg($ignoreGPU = false) +{ global $global; $complement = ' -user_agent "' . getSelfUserAgent() . '" '; //return 'ffmpeg -headers "User-Agent: '.getSelfUserAgent("FFMPEG").'" '; @@ -7687,14 +8023,16 @@ function get_ffmpeg($ignoreGPU = false) { return $ffmpeg . $complement; } -function removeUserAgentIfNotURL($cmd) { +function removeUserAgentIfNotURL($cmd) +{ if (!preg_match('/ -i [\'"]?https?:/', $cmd)) { $cmd = preg_replace('/-user_agent "[^"]+"/', '', $cmd); } return $cmd; } -function convertVideoToMP3FileIfNotExists($videos_id) { +function convertVideoToMP3FileIfNotExists($videos_id) +{ global $global; if (!empty($global['disableMP3'])) { return false; @@ -7726,7 +8064,8 @@ function convertVideoToMP3FileIfNotExists($videos_id) { } } -function convertVideoFileWithFFMPEG($fromFileLocation, $toFileLocation, $try = 0) { +function convertVideoFileWithFFMPEG($fromFileLocation, $toFileLocation, $try = 0) +{ $parts = explode('?', $fromFileLocation); $localFileLock = getCacheDir() . 'convertVideoFileWithFFMPEG_' . md5($parts[0]) . ".lock"; $ageInSeconds = time() - @filemtime($localFileLock); @@ -7794,7 +8133,8 @@ function convertVideoFileWithFFMPEG($fromFileLocation, $toFileLocation, $try = 0 return ['return' => $return, 'output' => $output, 'command' => $command, 'fromFileLocation' => $fromFileLocation, 'toFileLocation' => $toFileLocation, 'progressFile' => $progressFile]; } -function m3u8ToMP4($input) { +function m3u8ToMP4($input) +{ $videosDir = getVideosDir(); $outputfilename = str_replace($videosDir, "", $input); $parts = explode("/", $outputfilename); @@ -7849,17 +8189,20 @@ function m3u8ToMP4($input) { return ['error' => $error, 'msg' => $msg, 'path' => $outputpath, 'filename' => $outputfilename]; } -function getConvertVideoFileWithFFMPEGProgressFilename($toFileLocation) { +function getConvertVideoFileWithFFMPEGProgressFilename($toFileLocation) +{ $progressFile = $toFileLocation . '.log'; return $progressFile; } -function convertVideoToDownlaodProgress($toFileLocation) { +function convertVideoToDownlaodProgress($toFileLocation) +{ $progressFile = getConvertVideoFileWithFFMPEGProgressFilename($toFileLocation); return parseFFMPEGProgress($progressFile); } -function getPHP() { +function getPHP() +{ global $global; if (!empty($global['php'])) { $php = $global['php']; @@ -7874,11 +8217,13 @@ function getPHP() { return get_php(); } -function get_php() { +function get_php() +{ return getPHP(); } -function isHTMLPage($url) { +function isHTMLPage($url) +{ if (preg_match('/https?:\/\/(www\.)?(youtu.be|youtube.com|vimeo.com|bitchute.com)\//i', $url)) { return true; } elseif ($type = getHeaderContentTypeFromURL($url)) { @@ -7889,7 +8234,8 @@ function isHTMLPage($url) { return false; } -function url_exists($url) { +function url_exists($url) +{ global $global; if (preg_match('/^https?:\/\//i', $url)) { $parts = explode('/videos/', $url); @@ -7922,14 +8268,16 @@ function url_exists($url) { } } -function getHeaderContentTypeFromURL($url) { +function getHeaderContentTypeFromURL($url) +{ if (isValidURL($url) && $type = get_headers($url, 1)["Content-Type"]) { return $type; } return false; } -function canFullScreen() { +function canFullScreen() +{ global $doNotFullScreen; if (!empty($doNotFullScreen) || isSerie() || !isVideo()) { return false; @@ -7937,13 +8285,15 @@ function canFullScreen() { return true; } -function getTinyMCE($id, $simpleMode = false) { +function getTinyMCE($id, $simpleMode = false) +{ global $global; $contents = getIncludeFileContent($global['systemRootPath'] . 'objects/functionsGetTinyMCE.php', ['id' => $id, 'simpleMode' => $simpleMode]); return $contents; } -function pathToRemoteURL($filename, $forceHTTP = false, $ignoreCDN = false) { +function pathToRemoteURL($filename, $forceHTTP = false, $ignoreCDN = false) +{ global $pathToRemoteURL, $global; if (!isset($pathToRemoteURL)) { $pathToRemoteURL = []; @@ -8010,13 +8360,15 @@ function pathToRemoteURL($filename, $forceHTTP = false, $ignoreCDN = false) { return $url; } -function getFilenameFromPath($path) { +function getFilenameFromPath($path) +{ global $global; $fileName = Video::getCleanFilenameFromFile($path); return $fileName; } -function showCloseButton() { +function showCloseButton() +{ global $global, $showCloseButtonIncluded; if (!empty($showCloseButtonIncluded)) { return ''; @@ -8042,7 +8394,8 @@ function showCloseButton() { return ''; } -function getThemes() { +function getThemes() +{ global $_getThemes, $global; if (isset($_getThemes)) { return $_getThemes; @@ -8055,7 +8408,8 @@ function getThemes() { return $_getThemes; } -function getCurrentTheme() { +function getCurrentTheme() +{ global $config; if (!empty($_REQUEST['customCSS'])) { _setcookie('customCSS', $_REQUEST['customCSS']); @@ -8072,7 +8426,8 @@ function getCurrentTheme() { * $users_id="-1" means send to no one */ -function sendSocketMessage($msg, $callbackJSFunction = "", $users_id = "-1", $send_to_uri_pattern = "", $try = 0) { +function sendSocketMessage($msg, $callbackJSFunction = "", $users_id = "-1", $send_to_uri_pattern = "", $try = 0) +{ if (AVideoPlugin::isEnabledByName('YPTSocket')) { if (!is_string($msg)) { $msg = json_encode($msg); @@ -8098,7 +8453,8 @@ function sendSocketMessage($msg, $callbackJSFunction = "", $users_id = "-1", $se return false; } -function sendSocketMessageToUsers_id($msg, $users_id, $callbackJSFunction = "") { +function sendSocketMessageToUsers_id($msg, $users_id, $callbackJSFunction = "") +{ if (empty($users_id)) { return false; } @@ -8115,29 +8471,34 @@ function sendSocketMessageToUsers_id($msg, $users_id, $callbackJSFunction = "") return $resp; } -function sendSocketErrorMessageToUsers_id($msg, $users_id, $callbackJSFunction = "avideoResponse") { +function sendSocketErrorMessageToUsers_id($msg, $users_id, $callbackJSFunction = "avideoResponse") +{ $newMessage = new stdClass(); $newMessage->error = true; $newMessage->msg = $msg; return sendSocketMessageToUsers_id($newMessage, $users_id, $callbackJSFunction); } -function sendSocketSuccessMessageToUsers_id($msg, $users_id, $callbackJSFunction = "avideoResponse") { +function sendSocketSuccessMessageToUsers_id($msg, $users_id, $callbackJSFunction = "avideoResponse") +{ $newMessage = new stdClass(); $newMessage->error = false; $newMessage->msg = $msg; return sendSocketMessageToUsers_id($newMessage, $users_id, $callbackJSFunction); } -function sendSocketMessageToAll($msg, $callbackJSFunction = "", $send_to_uri_pattern = "") { +function sendSocketMessageToAll($msg, $callbackJSFunction = "", $send_to_uri_pattern = "") +{ return sendSocketMessage($msg, $callbackJSFunction, "", $send_to_uri_pattern); } -function sendSocketMessageToNone($msg, $callbackJSFunction = "") { +function sendSocketMessageToNone($msg, $callbackJSFunction = "") +{ return sendSocketMessage($msg, $callbackJSFunction, -1); } -function execAsync($command) { +function execAsync($command) +{ //$command = escapeshellarg($command); // If windows, else if (isWindows()) { @@ -8156,7 +8517,8 @@ function execAsync($command) { return $pid; } -function killProcess($pid) { +function killProcess($pid) +{ $pid = intval($pid); if (empty($pid)) { return false; @@ -8169,11 +8531,13 @@ function killProcess($pid) { return true; } -function isWindows() { +function isWindows() +{ return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; } -function getPIDUsingPort($port) { +function getPIDUsingPort($port) +{ $port = intval($port); if (empty($port)) { return false; @@ -8208,7 +8572,8 @@ function getPIDUsingPort($port) { return false; } -function isURL200($url, $forceRecheck = false) { +function isURL200($url, $forceRecheck = false) +{ global $_isURL200; $name = "isURL200" . DIRECTORY_SEPARATOR . md5($url); if (empty($forceRecheck)) { @@ -8233,9 +8598,9 @@ function isURL200($url, $forceRecheck = false) { $object->result = false; foreach ($headers as $value) { if ( - strpos($value, '200') || - strpos($value, '302') || - strpos($value, '304') + strpos($value, '200') || + strpos($value, '302') || + strpos($value, '304') ) { $object->result = true; break; @@ -8249,20 +8614,23 @@ function isURL200($url, $forceRecheck = false) { return $object->result; } -function isURL200Clear() { +function isURL200Clear() +{ $tmpDir = ObjectYPT::getCacheDir(); $cacheDir = $tmpDir . "isURL200" . DIRECTORY_SEPARATOR; _error_log('isURL200Clear: ' . json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS))); rrmdir($cacheDir); } -function deleteStatsNotifications($clearFirstPage = false) { +function deleteStatsNotifications($clearFirstPage = false) +{ Live::deleteStatsCache($clearFirstPage); $cacheName = "getStats" . DIRECTORY_SEPARATOR . "getStatsNotifications"; ObjectYPT::deleteCache($cacheName); } -function getLiveVideosFromUsers_id($users_id) { +function getLiveVideosFromUsers_id($users_id) +{ $videos = []; if (!empty($users_id)) { $stats = getStatsNotifications(); @@ -8280,7 +8648,8 @@ function getLiveVideosFromUsers_id($users_id) { return $videos; } -function getLiveVideosObject($application) { +function getLiveVideosObject($application) +{ foreach ($application as $key => $application2) { if (preg_match('/^html/i', $key)) { unset($application[$key]); @@ -8437,7 +8806,8 @@ function getLiveVideosObject($application) { return $video; } -function getLiveVideosFromCategory($categories_id) { +function getLiveVideosFromCategory($categories_id) +{ $stats = getStatsNotifications(); $videos = []; if (!empty($categories_id)) { @@ -8452,7 +8822,8 @@ function getLiveVideosFromCategory($categories_id) { return $videos; } -function getStatsNotifications($force_recreate = false, $listItIfIsAdminOrOwner = true) { +function getStatsNotifications($force_recreate = false, $listItIfIsAdminOrOwner = true) +{ global $__getStatsNotifications__; $isLiveEnabled = AVideoPlugin::isEnabledByName('Live'); $cacheName = "getStats" . DIRECTORY_SEPARATOR . "getStatsNotifications"; @@ -8564,7 +8935,8 @@ function getStatsNotifications($force_recreate = false, $listItIfIsAdminOrOwner return $json; } -function getSocketConnectionLabel() { +function getSocketConnectionLabel() +{ $html = ' @@ -8584,19 +8956,23 @@ function getSocketConnectionLabel() { return $html; } -function getSocketVideoClassName($videos_id) { +function getSocketVideoClassName($videos_id) +{ return 'total_on_videos_id_' . $videos_id; } -function getSocketLiveClassName($key, $live_servers_id) { +function getSocketLiveClassName($key, $live_servers_id) +{ return 'total_on_live_' . $key . '_' . intval($live_servers_id); } -function getSocketLiveLinksClassName($live_links_id) { +function getSocketLiveLinksClassName($live_links_id) +{ return 'total_on_live_links_id_' . $live_links_id; } -function getLiveUsersLabelVideo($videos_id, $totalViews = null, $viewsClass = "label label-default", $counterClass = "label label-primary") { +function getLiveUsersLabelVideo($videos_id, $totalViews = null, $viewsClass = "label label-default", $counterClass = "label label-primary") +{ global $global; $label = ''; if (AVideoPlugin::isEnabledByName('LiveUsers') && method_exists("LiveUsers", "getLabels")) { @@ -8605,20 +8981,23 @@ function getLiveUsersLabelVideo($videos_id, $totalViews = null, $viewsClass = "l return $label; } -function getLiveUsersLabelLive($key, $live_servers_id, $viewsClass = "label label-default", $counterClass = "label label-primary") { +function getLiveUsersLabelLive($key, $live_servers_id, $viewsClass = "label label-default", $counterClass = "label label-primary") +{ if (AVideoPlugin::isEnabledByName('LiveUsers') && method_exists("LiveUsers", "getLabels")) { $totalViews = LiveUsers::getTotalUsers($key, $live_servers_id); return LiveUsers::getLabels(getSocketLiveClassName($key, $live_servers_id), $totalViews, $viewsClass, $counterClass, 'live'); } } -function getLiveUsersLabelLiveLinks($liveLinks_id, $totalViews = null, $viewsClass = "label label-default", $counterClass = "label label-primary") { +function getLiveUsersLabelLiveLinks($liveLinks_id, $totalViews = null, $viewsClass = "label label-default", $counterClass = "label label-primary") +{ if (AVideoPlugin::isEnabledByName('LiveUsers') && method_exists("LiveUsers", "getWatchingNowLabel")) { return LiveUsers::getWatchingNowLabel(getSocketLiveLinksClassName($liveLinks_id), "label label-primary", '', $viewsClass, 'livelinks'); } } -function getLiveUsersLabel($viewsClass = "label label-default", $counterClass = "label label-primary") { +function getLiveUsersLabel($viewsClass = "label label-default", $counterClass = "label label-primary") +{ if (empty($_REQUEST['disableLiveUsers']) && AVideoPlugin::isEnabledByName('LiveUsers')) { $live = isLive(); if (!empty($live)) { @@ -8639,7 +9018,8 @@ function getLiveUsersLabel($viewsClass = "label label-default", $counterClass = return ""; } -function getLiveUsersLabelHTML($viewsClass = "label label-default", $counterClass = "label label-primary") { +function getLiveUsersLabelHTML($viewsClass = "label label-default", $counterClass = "label label-primary") +{ global $global, $_getLiveUsersLabelHTML; if (!empty($_getLiveUsersLabelHTML)) { return ''; @@ -8653,7 +9033,8 @@ function getLiveUsersLabelHTML($viewsClass = "label label-default", $counterClas return $htmlMediaTag; } -function getHTMLTitle($titleArray) { +function getHTMLTitle($titleArray) +{ global $config, $global; if (!is_array($titleArray)) { @@ -8666,7 +9047,8 @@ function getHTMLTitle($titleArray) { return "{$title}"; } -function getButtonSignInAndUp() { +function getButtonSignInAndUp() +{ $signIn = getButtonSignIn(); $signUp = getButtonSignUp(); $html = $signIn . $signUp; @@ -8677,7 +9059,8 @@ function getButtonSignInAndUp() { } } -function getButtonSignUp() { +function getButtonSignUp() +{ global $global; $obj = AVideoPlugin::getDataObject('CustomizeUser'); if (!empty($obj->disableNativeSignUp)) { @@ -8691,7 +9074,8 @@ function getButtonSignUp() { return $html; } -function getButtonSignIn() { +function getButtonSignIn() +{ global $global; $obj = AVideoPlugin::getDataObject('CustomizeUser'); if (!empty($obj->disableNativeSignIn)) { @@ -8705,7 +9089,8 @@ function getButtonSignIn() { return $html; } -function getTitle() { +function getTitle() +{ global $global; if (empty($global['pageTitle'])) { $url = getSelfURI(); @@ -8722,7 +9107,8 @@ function getTitle() { return $global['pageTitle']; } -function outputAndContinueInBackground($msg = '') { +function outputAndContinueInBackground($msg = '') +{ global $outputAndContinueInBackground; if (!empty($outputAndContinueInBackground)) { @@ -8745,7 +9131,8 @@ function outputAndContinueInBackground($msg = '') { flush(); } -function cleanUpRowFromDatabase($row) { +function cleanUpRowFromDatabase($row) +{ if (is_array($row)) { foreach ($row as $key => $value) { if (preg_match('/pass/i', $key)) { @@ -8756,12 +9143,14 @@ function cleanUpRowFromDatabase($row) { return $row; } -function getImageTransparent1pxURL() { +function getImageTransparent1pxURL() +{ global $global; return getCDN() . "view/img/transparent1px.png"; } -function getDatabaseTime() { +function getDatabaseTime() +{ global $global, $_getDatabaseTime; if (isset($_getDatabaseTime)) { return $_getDatabaseTime; @@ -8779,7 +9168,8 @@ function getDatabaseTime() { return $_getDatabaseTime; } -function fixTimezone($timezone) { +function fixTimezone($timezone) +{ $known_abbreviations = [ 'PDT' => 'America/Los_Angeles', 'PST' => 'America/Los_Angeles', @@ -8805,7 +9195,8 @@ function fixTimezone($timezone) { return $timezone; } -function getSystemTimezone() { +function getSystemTimezone() +{ global $global, $_getSystemTimezoneName; if (isset($_getSystemTimezoneName)) { return $_getSystemTimezoneName; @@ -8824,7 +9215,8 @@ function getSystemTimezone() { return $_getDatabaseTimezoneName; } -function getDatabaseTimezoneName() { +function getDatabaseTimezoneName() +{ global $global, $_getDatabaseTimezoneName; if (isset($_getDatabaseTimezoneName)) { return $_getDatabaseTimezoneName; @@ -8844,7 +9236,8 @@ function getDatabaseTimezoneName() { return $_getDatabaseTimezoneName; } -function get_js_availableLangs() { +function get_js_availableLangs() +{ global $global; if (empty($global['js_availableLangs'])) { include_once $global['systemRootPath'] . 'objects/bcp47.php'; @@ -8852,7 +9245,8 @@ function get_js_availableLangs() { return $global['js_availableLangs']; } -function listAllWordsToTranslate() { +function listAllWordsToTranslate() +{ global $global; $cacheName = 'listAllWordsToTranslate'; $cache = ObjectYPT::getCache($cacheName, 0); @@ -8861,7 +9255,8 @@ function listAllWordsToTranslate() { } ini_set('max_execution_time', 300); - function listAll($dir) { + function listAll($dir) + { $vars = []; if (preg_match('/vendor.*$/', $dir)) { return $vars; @@ -8879,9 +9274,9 @@ function listAllWordsToTranslate() { $data = file_get_contents($filename); $regex = '/__\(["\']{1}(.*)["\']{1}\)/U'; preg_match_all( - $regex, - $data, - $matches + $regex, + $data, + $matches ); foreach ($matches[0] as $key => $value) { $vars[$matches[1][$key]] = $matches[1][$key]; @@ -8907,7 +9302,8 @@ function listAllWordsToTranslate() { return $vars; } -function secondsInterval($time1, $time2) { +function secondsInterval($time1, $time2) +{ if (!isset($time1) || !isset($time2)) { return 0; } @@ -8921,7 +9317,8 @@ function secondsInterval($time1, $time2) { return $time1 - $time2; } -function secondsIntervalHuman($time, $useDatabaseTime = true) { +function secondsIntervalHuman($time, $useDatabaseTime = true) +{ $dif = secondsIntervalFromNow($time, $useDatabaseTime); if ($dif < 0) { return humanTimingAfterwards($time, 0, $useDatabaseTime); @@ -8930,7 +9327,8 @@ function secondsIntervalHuman($time, $useDatabaseTime = true) { } } -function isTimeForFuture($time, $useDatabaseTime = true) { +function isTimeForFuture($time, $useDatabaseTime = true) +{ $dif = secondsIntervalFromNow($time, $useDatabaseTime); if ($dif < 0) { return true; @@ -8939,7 +9337,8 @@ function isTimeForFuture($time, $useDatabaseTime = true) { } } -function secondsIntervalFromNow($time, $useDatabaseTimeOrTimezoneString = true) { +function secondsIntervalFromNow($time, $useDatabaseTimeOrTimezoneString = true) +{ $timeNow = time(); //var_dump($time, $useDatabaseTimeOrTimezoneString); if (!empty($useDatabaseTimeOrTimezoneString)) { @@ -8954,18 +9353,21 @@ function secondsIntervalFromNow($time, $useDatabaseTimeOrTimezoneString = true) return secondsInterval($timeNow, $time); } -function getScriptRunMicrotimeInSeconds() { +function getScriptRunMicrotimeInSeconds() +{ global $global; $time_now = microtime(true); return ($time_now - $global['avideoStartMicrotime']); } -function fixSystemPath() { +function fixSystemPath() +{ global $global; $global['systemRootPath'] = fixPath($global['systemRootPath']); } -function fixPath($path, $addLastSlash = false) { +function fixPath($path, $addLastSlash = false) +{ if (empty($path)) { return false; } @@ -8983,13 +9385,14 @@ function fixPath($path, $addLastSlash = false) { if (false) { - function openssl_cipher_key_length() { + function openssl_cipher_key_length() + { return 0; } - } -function getHashMethodsAndInfo() { +function getHashMethodsAndInfo() +{ global $global, $_getHashMethod; if (empty($_getHashMethod)) { @@ -9025,7 +9428,8 @@ function getHashMethodsAndInfo() { return $_getHashMethod; } -function idToHash($id) { +function idToHash($id) +{ global $global, $_idToHash; if (!isset($_idToHash)) { @@ -9059,7 +9463,8 @@ function idToHash($id) { return $hash; } -function hashToID($hash) { +function hashToID($hash) +{ //return hashToID_old($hash); global $global; $hash = str_replace(['_', '-', '.'], ['/', '+', '='], $hash); @@ -9087,7 +9492,8 @@ function hashToID($hash) { * @param type $hash * @return type */ -function hashToID_old($hash) { +function hashToID_old($hash) +{ global $global; if (!empty($global['useLongHash'])) { $base = 2; @@ -9104,7 +9510,8 @@ function hashToID_old($hash) { return intval($decrypt); } -function videosHashToID($hash_of_videos_id) { +function videosHashToID($hash_of_videos_id) +{ if (is_int($hash_of_videos_id)) { return $hash_of_videos_id; } @@ -9130,7 +9537,8 @@ function videosHashToID($hash_of_videos_id) { * @param string $id the ID of the URL in case the CDN is an array * @return \type */ -function getCDN($type = 'CDN', $id = 0) { +function getCDN($type = 'CDN', $id = 0) +{ global $advancedCustom, $global, $_getCDNURL; $index = $type . $id; if (!isset($_getCDNURL)) { @@ -9154,7 +9562,8 @@ function getCDN($type = 'CDN', $id = 0) { return empty($_getCDNURL[$index]) ? false : $_getCDNURL[$index]; } -function getURL($relativePath, $ignoreCDN = false) { +function getURL($relativePath, $ignoreCDN = false) +{ global $global; $relativePath = str_replace('\\', '/', $relativePath); $relativePath = getRelativePath($relativePath); @@ -9184,7 +9593,8 @@ function getURL($relativePath, $ignoreCDN = false) { return $url; } -function fixTestURL($text) { +function fixTestURL($text) +{ if (isAVideoMobileApp() || !empty($_REQUEST['isAVideoMobileApp'])) { $text = str_replace(array('https://vlu.me', 'https://www.vlu.me', 'vlu.me'), array('http://192.168.0.2', 'http://192.168.0.2', '192.168.0.2'), $text); } @@ -9192,7 +9602,8 @@ function fixTestURL($text) { return $text; } -function getCDNOrURL($url, $type = 'CDN', $id = 0) { +function getCDNOrURL($url, $type = 'CDN', $id = 0) +{ if (!preg_match('/^http/i', $url)) { return $url; } @@ -9203,7 +9614,8 @@ function getCDNOrURL($url, $type = 'CDN', $id = 0) { return addLastSlash($url); } -function replaceCDNIfNeed($url, $type = 'CDN', $id = 0) { +function replaceCDNIfNeed($url, $type = 'CDN', $id = 0) +{ $cdn = getCDN($type, $id); if (!empty($_GET['debug'])) { $obj = AVideoPlugin::getDataObject('Blackblaze_B2'); @@ -9231,7 +9643,8 @@ function replaceCDNIfNeed($url, $type = 'CDN', $id = 0) { return str_replace(parse_url($url, PHP_URL_HOST), parse_url($cdn, PHP_URL_HOST), $url); } -function isIPPrivate($ip) { +function isIPPrivate($ip) +{ if ($ip == '192.168.0.2') { return false; } @@ -9239,9 +9652,9 @@ function isIPPrivate($ip) { return false; } $result = filter_var( - $ip, - FILTER_VALIDATE_IP, - FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE + $ip, + FILTER_VALIDATE_IP, + FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ); if (empty($result)) { return true; @@ -9249,13 +9662,15 @@ function isIPPrivate($ip) { return false; } -function countDownPage($toTime, $message, $image, $bgImage, $title) { +function countDownPage($toTime, $message, $image, $bgImage, $title) +{ global $global; include $global['systemRootPath'] . 'objects/functionCountDownPage.php'; exit; } -function inputToRequest() { +function inputToRequest() +{ $content = file_get_contents("php://input"); if (!empty($content)) { $json = json_decode($content); @@ -9270,7 +9685,8 @@ function inputToRequest() { } } -function useVideoHashOrLogin() { +function useVideoHashOrLogin() +{ if (!empty($_REQUEST['video_id_hash'])) { $videos_id = Video::getVideoIdFromHash($_REQUEST['video_id_hash']); if (!empty($videos_id)) { @@ -9283,7 +9699,8 @@ function useVideoHashOrLogin() { return User::loginFromRequest(); } -function strip_specific_tags($string, $tags_to_strip = ['script', 'style', 'iframe', 'object', 'applet', 'link']) { +function strip_specific_tags($string, $tags_to_strip = ['script', 'style', 'iframe', 'object', 'applet', 'link']) +{ if (empty($string)) { return ''; } @@ -9293,7 +9710,8 @@ function strip_specific_tags($string, $tags_to_strip = ['script', 'style', 'ifra return $string; } -function strip_render_blocking_resources($string) { +function strip_render_blocking_resources($string) +{ $tags_to_strip = ['link', 'style']; $head = preg_match('/(.*)<\/head>/s', $string, $matches); if (empty($matches[0])) { @@ -9308,14 +9726,16 @@ function strip_render_blocking_resources($string) { return $string; } -function optimizeHTMLTags($html) { +function optimizeHTMLTags($html) +{ return $html; //$html = optimizeCSS($html); //$html = optimizeJS($html); return $html . '<--! optimized -->'; } -function optimizeCSS($html) { +function optimizeCSS($html) +{ global $global; $css = ''; $cacheDir = getVideosDir() . 'cache/'; @@ -9357,7 +9777,8 @@ function optimizeCSS($html) { return str_replace('', '' . PHP_EOL . $HTMLTag . PHP_EOL . '', $html); } -function optimizeJS($html) { +function optimizeJS($html) +{ global $global; $js = ''; $cacheDir = getVideosDir() . 'cache/'; @@ -9402,7 +9823,8 @@ function optimizeJS($html) { return str_replace('', '' . PHP_EOL . $HTMLTag . PHP_EOL . '', $html); } -function mysqlBeginTransaction() { +function mysqlBeginTransaction() +{ global $global; _error_log('Begin transaction ' . getSelfURI()); /** @@ -9413,7 +9835,8 @@ function mysqlBeginTransaction() { $global['mysqli']->autocommit(false); } -function mysqlRollback() { +function mysqlRollback() +{ global $global; _error_log('Rollback transaction ' . getSelfURI(), AVideoLog::$ERROR); /** @@ -9425,7 +9848,8 @@ function mysqlRollback() { $global['mysqli']->autocommit(true); } -function mysqlCommit() { +function mysqlCommit() +{ global $global; _error_log('Commit transaction ' . getSelfURI()); /** @@ -9437,7 +9861,8 @@ function mysqlCommit() { $global['mysqli']->autocommit(true); } -function number_format_short($n, $precision = 1) { +function number_format_short($n, $precision = 1) +{ $n = floatval($n); if ($n < 900) { // 0 - 900 @@ -9471,7 +9896,8 @@ function number_format_short($n, $precision = 1) { return $n_format . $suffix; } -function seconds2human($ss) { +function seconds2human($ss) +{ $s = $ss % 60; $m = floor(($ss % 3600) / 60); $h = floor(($ss % 86400) / 3600); @@ -9505,7 +9931,8 @@ function seconds2human($ss) { * @param string $timezone * @return string */ -function getTimeInTimezone($time, $timezone) { +function getTimeInTimezone($time, $timezone) +{ if (!is_numeric($time)) { $time = strtotime($time); } @@ -9524,7 +9951,8 @@ function getTimeInTimezone($time, $timezone) { return strtotime($dateString); } -function listFolderFiles($dir) { +function listFolderFiles($dir) +{ if (empty($dir)) { return []; } @@ -9552,24 +9980,29 @@ function listFolderFiles($dir) { return $files; } -function convertToMyTimezone($date, $fromTimezone) { +function convertToMyTimezone($date, $fromTimezone) +{ $time = getTimestampFromTimezone($date, $fromTimezone); return date('Y-m-d H:i:s', $time); } -function convertFromMyTimeTOMySQL($date) { +function convertFromMyTimeTOMySQL($date) +{ return ObjectYPT::clientTimezoneToDatabaseTimezone($date); } -function convertFromMyTimeTODefaultTimezoneTime($date) { +function convertFromMyTimeTODefaultTimezoneTime($date) +{ return convertDateFromToTimezone($date, date_default_timezone_get(), getDefaultTimezone()); } -function convertFromDefaultTimezoneTimeToMyTimezone($date) { +function convertFromDefaultTimezoneTimeToMyTimezone($date) +{ return convertDateFromToTimezone($date, getDefaultTimezone(), date_default_timezone_get()); } -function getDefaultTimezone() { +function getDefaultTimezone() +{ global $advancedCustom, $_getDefaultTimezone; if (!empty($_getDefaultTimezone)) { return $_getDefaultTimezone; @@ -9582,7 +10015,8 @@ function getDefaultTimezone() { return $_getDefaultTimezone; } -function convertDateFromToTimezone($date, $fromTimezone, $toTimezone) { +function convertDateFromToTimezone($date, $fromTimezone, $toTimezone) +{ if (!preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}(:[0-9]{2})?/', $date)) { _error_log("convertDateFromToTimezone ERROR ($date, $fromTimezone, $toTimezone)"); return $date; @@ -9599,18 +10033,21 @@ function convertDateFromToTimezone($date, $fromTimezone, $toTimezone) { return $newDate; } -function getTimestampFromTimezone($date, $fromTimezone) { +function getTimestampFromTimezone($date, $fromTimezone) +{ $date = new DateTime($date, new DateTimeZone($fromTimezone)); return $date->getTimestamp(); } -function getCSSAnimation($type = 'animate__flipInX', $loaderSequenceName = 'default', $delay = 0.1) { +function getCSSAnimation($type = 'animate__flipInX', $loaderSequenceName = 'default', $delay = 0.1) +{ global $_getCSSAnimationClassDelay; getCSSAnimationClassAndStyleAddWait($delay, $loaderSequenceName); return ['class' => 'animate__animated ' . $type, 'style' => "-webkit-animation-delay: {$_getCSSAnimationClassDelay[$loaderSequenceName]}s; animation-delay: {$_getCSSAnimationClassDelay[$loaderSequenceName]}s;"]; } -function getCSSAnimationClassAndStyleAddWait($delay, $loaderSequenceName = 'default') { +function getCSSAnimationClassAndStyleAddWait($delay, $loaderSequenceName = 'default') +{ global $_getCSSAnimationClassDelay; if (!isset($_getCSSAnimationClassDelay)) { $_getCSSAnimationClassDelay = []; @@ -9621,7 +10058,8 @@ function getCSSAnimationClassAndStyleAddWait($delay, $loaderSequenceName = 'defa $_getCSSAnimationClassDelay[$loaderSequenceName] += $delay; } -function getCSSAnimationClassAndStyle($type = 'animate__flipInX', $loaderSequenceName = 'default', $delay = 0.1) { +function getCSSAnimationClassAndStyle($type = 'animate__flipInX', $loaderSequenceName = 'default', $delay = 0.1) +{ if (isAVideoMobileApp()) { return false; } @@ -9629,7 +10067,8 @@ function getCSSAnimationClassAndStyle($type = 'animate__flipInX', $loaderSequenc return "{$array['class']}\" style=\"{$array['style']}"; } -function isImage($file) { +function isImage($file) +{ [$width, $height, $type, $attr] = getimagesize($file); if ($type == IMAGETYPE_PNG) { return 'png'; @@ -9643,17 +10082,20 @@ function isImage($file) { return false; } -function isHTMLEmpty($html_string) { +function isHTMLEmpty($html_string) +{ $html_string_no_tags = strip_specific_tags($html_string, ['br', 'p', 'span', 'div']); //var_dump($html_string_no_tags, $html_string); return empty(trim(str_replace(["\r", "\n"], ['', ''], $html_string_no_tags))); } -function emptyHTML($html_string) { +function emptyHTML($html_string) +{ return isHTMLEmpty($html_string); } -function totalImageColors($image_path) { +function totalImageColors($image_path) +{ $img = imagecreatefromjpeg($image_path); $w = imagesx($img); $h = imagesy($img); @@ -9680,7 +10122,8 @@ function totalImageColors($image_path) { return $colorCount; } -function isImageCorrupted($image_path) { +function isImageCorrupted($image_path) +{ $fsize = filesize($image_path); if (strpos($image_path, 'thumbsSmall') !== false) { if ($fsize < 1000) { @@ -9703,7 +10146,8 @@ function isImageCorrupted($image_path) { } // detect partial grey immages -function isGoodImage($fn) { +function isGoodImage($fn) +{ [$w, $h] = getimagesize($fn); $im = imagecreatefromstring(file_get_contents($fn)); $grey = 0; @@ -9720,7 +10164,8 @@ function isGoodImage($fn) { return $grey < 12; } -function defaultIsPortrait() { +function defaultIsPortrait() +{ global $_defaultIsPortrait; if (!isset($_defaultIsPortrait)) { @@ -9734,11 +10179,13 @@ function defaultIsPortrait() { return $_defaultIsPortrait; } -function defaultIsLandscape() { +function defaultIsLandscape() +{ return !defaultIsPortrait(); } -function isDummyFile($filePath) { +function isDummyFile($filePath) +{ global $_isDummyFile; if (!isset($_isDummyFile)) { @@ -9762,7 +10209,8 @@ function isDummyFile($filePath) { return $return; } -function forbiddenPageIfCannotEmbed($videos_id) { +function forbiddenPageIfCannotEmbed($videos_id) +{ global $customizedAdvanced, $advancedCustomUser, $global; if (empty($customizedAdvanced)) { $customizedAdvanced = AVideoPlugin::getObjectDataIfEnabled('CustomizeAdvanced'); @@ -9793,7 +10241,8 @@ function forbiddenPageIfCannotEmbed($videos_id) { } } -function getMediaSessionPosters($imagePath) { +function getMediaSessionPosters($imagePath) +{ global $global; if (empty($imagePath) || !file_exists($imagePath)) { return array(); @@ -9815,7 +10264,8 @@ function getMediaSessionPosters($imagePath) { return $posters; } -function deleteMediaSessionPosters($imagePath) { +function deleteMediaSessionPosters($imagePath) +{ if (empty($imagePath)) { return false; } @@ -9827,7 +10277,8 @@ function deleteMediaSessionPosters($imagePath) { } } -function getMediaSession() { +function getMediaSession() +{ $MediaMetadata = new stdClass(); $MediaMetadata->title = ''; $videos_id = getVideos_id(); @@ -9855,7 +10306,8 @@ function getMediaSession() { return $MediaMetadata; } -function _ob_start($force = false) { +function _ob_start($force = false) +{ global $global; if (!isset($global['ob_start_callback'])) { $global['ob_start_callback'] = 'ob_gzhandler'; @@ -9881,14 +10333,16 @@ function _ob_start($force = false) { ob_get_contents x ob_get_flush x x */ -function _ob_get_clean() { +function _ob_get_clean() +{ $content = ob_get_contents(); _ob_end_clean(); _ob_start(); return $content; } -function getIncludeFileContent($filePath, $varsArray = [], $setCacheName = false) { +function getIncludeFileContent($filePath, $varsArray = [], $setCacheName = false) +{ global $global, $config, $advancedCustom, $advancedCustomUser, $t; if (empty($advancedCustom)) { @@ -9951,24 +10405,28 @@ function getIncludeFileContent($filePath, $varsArray = [], $setCacheName = false * @link https://github.com/php/php-src/issues/8218 * @return bool */ -function doesPHPVersioHasOBBug() { +function doesPHPVersioHasOBBug() +{ return (version_compare(phpversion(), '8.1.4', '==') || version_compare(phpversion(), '8.0.17', '==')); } /** * @link https://github.com/php/php-src/issues/8218#issuecomment-1072439915 */ -function _ob_end_clean() { +function _ob_end_clean() +{ @ob_end_clean(); header_remove('Content-Encoding'); } -function _ob_clean() { +function _ob_clean() +{ @ob_clean(); header_remove('Content-Encoding'); } -function pluginsRequired($arrayPluginName, $featureName = '') { +function pluginsRequired($arrayPluginName, $featureName = '') +{ global $global; $obj = new stdClass(); $obj->error = false; @@ -9990,11 +10448,13 @@ function pluginsRequired($arrayPluginName, $featureName = '') { return $obj; } -function _strtotime($datetime) { +function _strtotime($datetime) +{ return is_int($datetime) ? $datetime : strtotime($datetime); } -function _isSocketPresentOnCrontab() { +function _isSocketPresentOnCrontab() +{ foreach (getValidCrontabLines() as $line) { if (!empty($line) && preg_match('/plugin\/YPTSocket\/server.php/', $line)) { return true; @@ -10003,7 +10463,8 @@ function _isSocketPresentOnCrontab() { return false; } -function _isSchedulerPresentOnCrontab() { +function _isSchedulerPresentOnCrontab() +{ foreach (getValidCrontabLines() as $line) { if (!empty($line) && preg_match('/plugin\/Scheduler\/run.php/', $line)) { return true; @@ -10012,7 +10473,8 @@ function _isSchedulerPresentOnCrontab() { return false; } -function getValidCrontabLines() { +function getValidCrontabLines() +{ global $_validCrontabLines; if (empty($validCrontabLines)) { $crontab = shell_exec('crontab -l'); @@ -10037,7 +10499,8 @@ function getValidCrontabLines() { * @param string $strOrArray * @return string return an array with the valid emails. */ -function is_email($strOrArray) { +function is_email($strOrArray) +{ if (empty($strOrArray)) { return []; } @@ -10064,7 +10527,8 @@ function is_email($strOrArray) { * @param string $parameters * @return string */ -function getHamburgerButton($id = '', $type = 0, $parameters = 'class="btn btn-default hamburger"', $startActive = false, $invert = false) { +function getHamburgerButton($id = '', $type = 0, $parameters = 'class="btn btn-default hamburger"', $startActive = false, $invert = false) +{ global $global; if ($type === 'x') { $XOptions = [1, 4, 6, 7, 8]; @@ -10084,7 +10548,8 @@ function getHamburgerButton($id = '', $type = 0, $parameters = 'class="btn btn-d return getIncludeFileContent($filePath, ['type' => $type, 'id' => $id, 'parameters' => $parameters, 'startActive' => $startActive, 'invert' => $invert]); } -function getUserOnlineLabel($users_id, $class = '', $style = '') { +function getUserOnlineLabel($users_id, $class = '', $style = '') +{ if (AVideoPlugin::isEnabledByName('YPTSocket')) { return YPTSocket::getUserOnlineLabel($users_id, $class, $style); } else { @@ -10092,7 +10557,8 @@ function getUserOnlineLabel($users_id, $class = '', $style = '') { } } -function sendToEncoder($videos_id, $downloadURL, $checkIfUserCanUpload = false) { +function sendToEncoder($videos_id, $downloadURL, $checkIfUserCanUpload = false) +{ global $global, $config; _error_log("sendToEncoder($videos_id, $downloadURL) start"); @@ -10155,7 +10621,8 @@ function sendToEncoder($videos_id, $downloadURL, $checkIfUserCanUpload = false) return $obj; } -function parseFFMPEGProgress($progressFilename) { +function parseFFMPEGProgress($progressFilename) +{ //get duration of source $obj = new stdClass(); @@ -10239,7 +10706,8 @@ function parseFFMPEGProgress($progressFilename) { return $obj; } -function getExtension($link) { +function getExtension($link) +{ $path_parts = pathinfo($link); //$extension = mb_strtolower(@$path_parts["extension"]); $filebasename = explode('?', $path_parts['basename']); @@ -10252,7 +10720,8 @@ function getExtension($link) { * @param string $html_string * @return boolean */ -function _empty($html_string) { +function _empty($html_string) +{ if (empty($html_string)) { return true; } @@ -10264,7 +10733,8 @@ function _empty($html_string) { return emptyHTML($html_string); } -function adminSecurityCheck($force = false) { +function adminSecurityCheck($force = false) +{ if (empty($force)) { if (!empty($_SESSION['adminSecurityCheck'])) { return false; @@ -10292,7 +10762,8 @@ function adminSecurityCheck($force = false) { return true; } -function getHtaccessForVideoVersion($videosHtaccessFile) { +function getHtaccessForVideoVersion($videosHtaccessFile) +{ if (!file_exists($videosHtaccessFile)) { return 0; } @@ -10303,7 +10774,8 @@ function getHtaccessForVideoVersion($videosHtaccessFile) { return @$matches[1]; } -function fileIsAnValidImage($filepath) { +function fileIsAnValidImage($filepath) +{ if (file_exists($filepath)) { if (filesize($filepath) === 42342) { return false; @@ -10323,7 +10795,8 @@ function fileIsAnValidImage($filepath) { * @param string $filepath * @return boolean */ -function deleteInvalidImage($filepath) { +function deleteInvalidImage($filepath) +{ if (file_exists($filepath)) { if (!fileIsAnValidImage($filepath)) { _error_log("deleteInvalidImage($filepath)"); @@ -10340,7 +10813,8 @@ function deleteInvalidImage($filepath) { * @param string $text * @return string */ -function addTwitterJS($text) { +function addTwitterJS($text) +{ if (preg_match('/href=.+twitter.com.+ref_src=.+/', $text)) { if (!preg_match('/platform.twitter.com.widgets.js/', $text)) { $text .= ''; @@ -10349,7 +10823,8 @@ function addTwitterJS($text) { return $text; } -function getMP3ANDMP4DownloadLinksFromHLS($videos_id, $video_type) { +function getMP3ANDMP4DownloadLinksFromHLS($videos_id, $video_type) +{ $downloadOptions = []; if (empty($videos_id)) { return []; @@ -10372,18 +10847,21 @@ function getMP3ANDMP4DownloadLinksFromHLS($videos_id, $video_type) { return $downloadOptions; } -function isOnDeveloperMode() { +function isOnDeveloperMode() +{ global $global; return (!empty($global['developer_mode']) || (!empty($global['developer_mode_admin_only']) && User::isAdmin())); } -function setDefaultSort($defaultSortColumn, $defaultSortOrder) { +function setDefaultSort($defaultSortColumn, $defaultSortOrder) +{ if (empty($_REQUEST['sort']) && empty($_GET['sort']) && empty($_POST['sort']) && empty($_GET['order'][0]['dir'])) { $_POST['sort'][$defaultSortColumn] = $defaultSortOrder; } } -function getWordOrIcon($word, $class = '') { +function getWordOrIcon($word, $class = '') +{ $word = trim($word); if (preg_match('/facebook/i', $word)) { return ''; @@ -10397,7 +10875,8 @@ function getWordOrIcon($word, $class = '') { return $word; } -function getHomePageURL() { +function getHomePageURL() +{ global $global; if (useIframe()) { return "{$global['webSiteRootURL']}site/"; @@ -10406,11 +10885,13 @@ function getHomePageURL() { } } -function useIframe() { +function useIframe() +{ return false && isOnDeveloperMode() && !isBot(); } -function getIframePaths() { +function getIframePaths() +{ global $global; $modeYoutube = false; if (!empty($_GET['videoName']) || !empty($_GET['v']) || !empty($_GET['playlist_id']) || !empty($_GET['liveVideoName']) || !empty($_GET['evideo'])) { @@ -10439,7 +10920,8 @@ function getIframePaths() { return ['relative' => $relativeSRC, 'url' => $url, 'path' => "{$global['systemRootPath']}{$relativeSRC}", 'modeYoutube' => $modeYoutube]; } -function getFeedButton($rss, $mrss, $roku) { +function getFeedButton($rss, $mrss, $roku) +{ $buttons = ' + \ No newline at end of file diff --git a/plugin/Layout/categoriesTopButtons.php b/plugin/Layout/categoriesTopButtons.php index dce2b067a4..9449896581 100644 --- a/plugin/Layout/categoriesTopButtons.php +++ b/plugin/Layout/categoriesTopButtons.php @@ -1,72 +1,45 @@ categoriesTopButtonsFluid)){ +if (empty($obj) || !isset($obj->categoriesTopButtonsFluid)) { $obj = AVideoPlugin::loadPlugin('Layout'); } -?> - -
-
-
- -
- -
-
-
-
\ No newline at end of file + if (empty($total)) { + continue; + } + if (in_array($value['id'], $parsed_cats)) { + continue; + } + $label = ' ' + . '' . __($value['name']) . ''; + if (!empty($obj->categoriesTopButtonsShowVideosCount)) { + $label .= ' ' . $total . ''; + } + $items[] = array( + 'href' => Category::getCategoryLinkFromName($value['clean_name']), + 'tooltip' => __($value['name']), + 'onclick' => '', + 'label' => $label, + 'isActive' => $value['clean_name'] == @$_REQUEST['catName'], + 'clean_name' => $value['clean_name'] + ); +} +//var_dump($_REQUEST['catName'], $items);exit; +generateHorizontalFlickity($items); diff --git a/plugin/MonetizeUsers/View/report.php b/plugin/MonetizeUsers/View/report.php index 64213373b6..e917ba2bff 100644 --- a/plugin/MonetizeUsers/View/report.php +++ b/plugin/MonetizeUsers/View/report.php @@ -122,4 +122,70 @@ foreach ($rows as $key => $value) { } } }); - \ No newline at end of file + + $reward, + 'title' => $title, + ]; + } +} + +$videosIds = []; +$rewards = []; +$titles = []; +foreach ($videosData as $videosId => $videoInfo) { + $videosIds[] = $videosId; + $rewards[] = $videoInfo['reward']; + $titles[] = $videoInfo['title']; +} +?> + +
+
+
+ +
+
+
+ + diff --git a/plugin/PlayerSkins/PlayerSkins.php b/plugin/PlayerSkins/PlayerSkins.php index 4a01098c91..a47f4270cd 100644 --- a/plugin/PlayerSkins/PlayerSkins.php +++ b/plugin/PlayerSkins/PlayerSkins.php @@ -169,7 +169,6 @@ class PlayerSkins extends PluginAbstract { $htmlMediaTag .= ''; //$htmlMediaTag .= '
'; $htmlMediaTag .= ''; - $htmlMediaTag .= ''; //$htmlMediaTag .= '
'; } else { // youtube! @@ -650,18 +649,14 @@ class PlayerSkins extends PluginAbstract { $url = Video::getURLFriendly($videos_id); $js .= " player.on('play', function () { - addView({$videos_id}, this.currentTime()); - _addViewBeaconAdded = false; sendAVideoMobileMessage('play', this.currentTime()); }); player.on('ended', function () { var time = Math.round(this.currentTime()); - addView({$videos_id}, time); sendAVideoMobileMessage('ended', time); }); player.on('pause', function () { var time = Math.round(this.currentTime()); - addView({$videos_id}, time); sendAVideoMobileMessage('pause', time); }); player.on('volumechange', function () { @@ -683,13 +678,6 @@ class PlayerSkins extends PluginAbstract { $('#linkCurrentTime, .linkCurrentTime').val(url); - if (time >= 5 && time % 1 === 0) { - addView({$videos_id}, time); - } else { - addViewFromCookie(); - addViewSetCookie(PHPSESSID, {$videos_id}, time, seconds_watching_video); - } - sendAVideoMobileMessage('timeupdate', time); }); ;"; diff --git a/plugin/Shorts/player.php b/plugin/Shorts/player.php index 9616e8181a..6da131e7aa 100644 --- a/plugin/Shorts/player.php +++ b/plugin/Shorts/player.php @@ -22,9 +22,6 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { cursor: move; } - .playingShorts .scrtabs-tab-container { - display: none; - } body.playingShorts { overflow: hidden; @@ -162,6 +159,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { #buttonsCarousel { bottom: 50px; } + .circleCarouselBtn { width: 35px; height: 35px; @@ -177,7 +175,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
removeThumbsUpAndDown)) { - ?> + ?> - + ?> - + ?> -
@@ -220,7 +218,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { carouselPlayerResetLikesResponse(); $.ajax({ url: url, - success: function (response) { + success: function(response) { carouselPlayerProcessLikesResponse(response) } }); @@ -277,10 +275,10 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { $.ajax({ url: url, - success: function (response) { + success: function(response) { carouselPlayerProcessLikesResponse(response) }, - complete: function (response) { + complete: function(response) { modal.hidePleaseWait(); } }); @@ -290,7 +288,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { function shortsOpen(index) { shortIsOpen = true; $('body').addClass('playingShorts'); - + console.log('shortsPlay', index); $('#ShortsPlayerContent').show(); $('#ShortsPlayer').flickity('destroy'); @@ -305,11 +303,11 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { if (typeof currentCell != 'undefined') { currentCell.html(''); } - console.log('shortsClose 1'); - setTimeout(function () { + console.log('shortsClose 1'); + setTimeout(function() { console.log('shortsClose 2'); $('body').removeClass('playingShorts'); - + $('#ShortsPlayerContent').hide(); $('#ShortsPlayerContent').removeClass('animate__bounceOutLeft'); }, 100); @@ -319,8 +317,8 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { var $carouselPlayer = $('#ShortsPlayer'); var newCarouselCell = $('
').addClass('carousel-cell'); var newCarouselCellContent = $('
') - .addClass('carousel-cell-content') - .attr('data-flickity-bg-lazyload', video.images.poster); + .addClass('carousel-cell-content') + .attr('data-flickity-bg-lazyload', video.images.poster); newCarouselCellContent.append($('').text(video.title)); newCarouselCell.append(newCarouselCellContent); $carouselPlayer.flickity('append', newCarouselCell); @@ -336,6 +334,10 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { var iframe; var currentShortsPlayerIndex = -1; + function playNextShorts() { + $('#ShortsPlayer').flickity('next'); + } + function createShortsPlayerFlickity(initialIndex) { var $carouselPlayer = $('#ShortsPlayer'); @@ -348,7 +350,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { adaptiveHeight: true, cellSelector: '.carousel-cell', }); - $carouselPlayer.on('scroll.flickity', function (event, progress) { + $carouselPlayer.on('scroll.flickity', function(event, progress) { if (typeof currentCell != 'undefined') { currentCell.html(''); } @@ -356,7 +358,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { loadShorts(); } }); - $carouselPlayer.on('settle.flickity', function (event, index) { + $carouselPlayer.on('settle.flickity', function(event, index) { if (isSettling) { return; } @@ -369,7 +371,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { if (typeof currentCell != 'undefined') { currentCell.html(''); } - timeoutId = setTimeout(function () { + timeoutId = setTimeout(function() { var index2 = $('#ShortsPlayer .carousel-cell.is-selected').index(); if (currentShortsPlayerIndex !== index2) { carouselPlayerGetLikes(); @@ -406,22 +408,22 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) { resetPlayerFlickity(); // reset the timeoutId }); - $carouselPlayer.on('change.flickity', function (event, index) { + $carouselPlayer.on('change.flickity', function(event, index) { console.log('Slide changed to ' + index) }); - $carouselPlayer.on('select.flickity', function (event, index) { + $carouselPlayer.on('select.flickity', function(event, index) { if (shortIsOpen) { var browserWidth = $(window).width(); - $value) { - if (empty($key)) { - echo "var newIndex = Math.floor(index/{$value});"; - } else { - echo "if(browserWidth<{$key}){newIndex = Math.floor(index/{$value});}"; - } -} -?> + $value) { + if (empty($key)) { + echo "var newIndex = Math.floor(index/{$value});"; + } else { + echo "if(browserWidth<{$key}){newIndex = Math.floor(index/{$value});}"; + } + } + ?> $('#Shorts').flickity('select', newIndex); console.log('Flickity select ' + index) } @@ -430,10 +432,20 @@ foreach ($totalFlickityCells as $key => $value) { } - $(document).ready(function () { + $(document).ready(function() { createShortsPlayerFlickity(); - $('#closeCarousel').on('click', function () { + $('#closeCarousel').on('click', function() { shortsClose(); }); }); + // Event listener to receive messages from the iframe + window.addEventListener('message', function(event) { + if (event.data === 'playNextShorts') { + // Call the function + playNextShorts(); + } else { + // Execute another code if the function doesn't exist + console.log("playNextShorts() does not exist in the parent page"); + } + }); \ No newline at end of file diff --git a/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.css b/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.css deleted file mode 100644 index b47fc4c2be..0000000000 --- a/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.css +++ /dev/null @@ -1,65 +0,0 @@ -/** - * jquery-bootstrap-scrolling-tabs - * @version v2.6.1 - * @link https://github.com/mikejacobson/jquery-bootstrap-scrolling-tabs - * @author Mike Jacobson - * @license MIT License, http://www.opensource.org/licenses/MIT - */ -.scrtabs-tab-container * { - box-sizing: border-box; } - -.scrtabs-tab-container { - height: 42px; } - .scrtabs-tab-container .tab-content { - clear: left; } - -.scrtabs-tab-container.scrtabs-bootstrap4 .scrtabs-tabs-movable-container > .navbar-nav { - -ms-flex-direction: row; - flex-direction: row; } - -.scrtabs-tabs-fixed-container { - float: left; - height: 42px; - overflow: hidden; - width: 100%; } - -.scrtabs-tabs-movable-container { - position: relative; } - .scrtabs-tabs-movable-container .tab-content { - display: none; } - -.scrtabs-tab-container.scrtabs-rtl .scrtabs-tabs-movable-container > ul.nav-tabs { - padding-right: 0; } - -.scrtabs-tab-scroll-arrow { - border: 1px solid #dddddd; - border-top: none; - color: #428bca; - display: none; - float: left; - font-size: 12px; - height: 42px; - margin-bottom: -1px; - padding-left: 2px; - padding-top: 13px; - width: 20px; } - .scrtabs-tab-scroll-arrow:hover { - background-color: #eeeeee; } - -.scrtabs-tab-scroll-arrow, -.scrtabs-tab-scroll-arrow .scrtabs-click-target { - cursor: pointer; } - -.scrtabs-tab-scroll-arrow.scrtabs-with-click-target { - cursor: default; } - -.scrtabs-tab-scroll-arrow.scrtabs-disable, -.scrtabs-tab-scroll-arrow.scrtabs-disable .scrtabs-click-target { - color: #ddd; - cursor: default; } - -.scrtabs-tab-scroll-arrow.scrtabs-disable:hover { - background-color: initial; } - -.scrtabs-tabs-fixed-container ul.nav-tabs > li { - white-space: nowrap; } diff --git a/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.js b/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.js deleted file mode 100644 index 2b317323d3..0000000000 --- a/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.js +++ /dev/null @@ -1,2011 +0,0 @@ -/** - * jquery-bootstrap-scrolling-tabs - * @version v2.6.1 - * @link https://github.com/mikejacobson/jquery-bootstrap-scrolling-tabs - * @author Mike Jacobson - * @license MIT License, http://www.opensource.org/licenses/MIT - */ -/** - * jQuery plugin version of Angular directive angular-bootstrap-scrolling-tabs: - * https://github.com/mikejacobson/angular-bootstrap-scrolling-tabs - * - * Usage: - * - * Use case #1: HTML-defined tabs - * ------------------------------ - * Demo: http://plnkr.co/edit/thyD0grCxIjyU4PoTt4x?p=preview - * - * Sample HTML: - * - * - * - * - * - *
- *
Tab 1 content...
- *
Tab 2 content...
- *
Tab 3 content...
- *
Tab 4 content...
- *
- * - * - * JavaScript: - * - * $('.nav-tabs').scrollingTabs(); - * - * - * Use Case #2: Data-driven tabs - * ----------------------------- - * Demo: http://plnkr.co/edit/MWBjLnTvJeetjU3NEimg?p=preview - * - * Sample HTML: - * - * - *
- * - * - * JavaScript: - * - * $('#tabs-inside-here').scrollingTabs({ - * tabs: tabs, // required - * propPaneId: 'paneId', // optional - * propTitle: 'title', // optional - * propActive: 'active', // optional - * propDisabled: 'disabled', // optional - * propContent: 'content', // optional - * ignoreTabPanes: false, // optional - * scrollToTabEdge: false, // optional - * disableScrollArrowsOnFullyScrolled: false, // optional - * reverseScroll: false // optional - * }); - * - * Settings/Options: - * - * tabs: tabs data array - * prop*: name of your tab object's property name that - * corresponds to that required tab property if - * your property name is different than the - * standard name (paneId, title, etc.) - * tabsLiContent: - * optional string array used to define custom HTML - * for each tab's
  • element. Each entry is an HTML - * string defining the tab
  • element for the - * corresponding tab in the tabs array. - * The default for a tab is: - * '
  • ' - * So, for example, if you had 3 tabs and you needed - * a custom 'tooltip' attribute on each one, your - * tabsLiContent array might look like this: - * [ - * '', - * '', - * '' - * ] - * This plunk demonstrates its usage (in conjunction - * with tabsPostProcessors): - * http://plnkr.co/edit/ugJLMk7lmDCuZQziQ0k0 - * tabsPostProcessors: - * optional array of functions, each one associated - * with an entry in the tabs array. When a tab element - * has been created, its associated post-processor - * function will be called with two arguments: the - * newly created $li and $a jQuery elements for that tab. - * This allows you to, for example, attach a custom - * event listener to each anchor tag. - * This plunk demonstrates its usage (in conjunction - * with tabsLiContent): - * http://plnkr.co/edit/ugJLMk7lmDCuZQziQ0k0 - * ignoreTabPanes: relevant for data-driven tabs only--set to true if - * you want the plugin to only touch the tabs - * and to not generate the tab pane elements - * that go in .tab-content. By default, the plugin - * will generate the tab panes based on the content - * property in your tab data, if a content property - * is present. - * scrollToTabEdge: set to true if you want to force full-width tabs - * to display at the left scroll arrow. i.e., if the - * scrolling stops with only half a tab showing, - * it will snap the tab to its edge so the full tab - * shows. - * disableScrollArrowsOnFullyScrolled: - * set to true if you want the left scroll arrow to - * disable when the tabs are scrolled fully left, - * and the right scroll arrow to disable when the tabs - * are scrolled fully right. - * reverseScroll: - * set to true if you want the left scroll arrow to - * slide the tabs left instead of right, and the right - * scroll arrow to slide the tabs right. - * enableSwiping: - * set to true if you want to enable horizontal swiping - * for touch screens. - * widthMultiplier: - * set to a value less than 1 if you want the tabs - * container to be less than the full width of its - * parent element. For example, set it to 0.5 if you - * want the tabs container to be half the width of - * its parent. - * tabClickHandler: - * a callback function to execute any time a tab is clicked. - * The function is simply passed as the event handler - * to jQuery's .on(), so the function will receive - * the jQuery event as an argument, and the 'this' - * inside the function will be the clicked tab's anchor - * element. - * cssClassLeftArrow, cssClassRightArrow: - * custom values for the class attributes for the - * left and right scroll arrows. The defaults are - * 'glyphicon glyphicon-chevron-left' and - * 'glyphicon glyphicon-chevron-right'. - * Using different icons might require you to add - * custom styling to the arrows to position the icons - * correctly; the arrows can be targeted with these - * selectors: - * .scrtabs-tab-scroll-arrow - * .scrtabs-tab-scroll-arrow-left - * .scrtabs-tab-scroll-arrow-right - * leftArrowContent, rightArrowContent: - * custom HTML string for the left and right scroll - * arrows. This will override any custom cssClassLeftArrow - * and cssClassRightArrow settings. - * For example, if you wanted to use svg icons, you - * could set them like so: - * - * leftArrowContent: [ - * '
    ', - * ' ', - * ' ', - * ' ', - * '
    ' - * ].join(''), - * rightArrowContent: [ - * '
    ', - * ' ', - * ' ', - * ' ', - * '
    ' - * ].join('') - * - * You would then need to add some CSS to make them - * work correctly if you don't give them the - * default scrtabs-tab-scroll-arrow classes. - * This plunk shows it working with svg icons: - * http://plnkr.co/edit/2MdZCAnLyeU40shxaol3?p=preview - * - * When using this option, you can also mark a child - * element within the arrow content as the click target - * if you don't want the entire content to be - * clickable. You do that my adding the CSS class - * 'scrtabs-click-target' to the element that should - * be clickable, like so: - * - * leftArrowContent: [ - * '
    ', - * ' ', - * '
    ' - * ].join(''), - * rightArrowContent: [ - * '
    ', - * ' ', - * '
    ' - * ].join('') - * - * enableRtlSupport: - * set to true if you want your site to support - * right-to-left languages. If true, the plugin will - * check the page's tag for attribute dir="rtl" - * and will adjust its behavior accordingly. - * handleDelayedScrollbar: - * set to true if you experience a situation where the - * right scroll arrow wraps to the next line due to a - * vertical scrollbar coming into existence on the page - * after the plugin already calculated its width without - * a scrollbar present. This would occur if, for example, - * the bulk of the page's content loaded after a delay, - * and only then did a vertical scrollbar become necessary. - * It would also occur if a vertical scrollbar only appeared - * on selection of a particular tab that had more content - * than the default tab. - * bootstrapVersion: - * set to 4 if you're using Boostrap 4. Default is 3. - * Bootstrap 4 handles some things differently than 3 - * (e.g., the 'active' class gets applied to the tab's - * 'li > a' element rather than the 'li' itself). - * - * - * On tabs data change: - * - * $('#tabs-inside-here').scrollingTabs('refresh'); - * - * On tabs data change, if you want the active tab to be set based on - * the updated tabs data (i.e., you want to override the current - * active tab setting selected by the user), for example, if you - * added a new tab and you want it to be the active tab: - * - * $('#tabs-inside-here').scrollingTabs('refresh', { - * forceActiveTab: true - * }); - * - * Any options that can be passed into the plugin can be set on the - * plugin's 'defaults' object instead so you don't have to pass them in: - * - * $.fn.scrollingTabs.defaults.tabs = tabs; - * $.fn.scrollingTabs.defaults.forceActiveTab = true; - * $.fn.scrollingTabs.defaults.scrollToTabEdge = true; - * $.fn.scrollingTabs.defaults.disableScrollArrowsOnFullyScrolled = true; - * $.fn.scrollingTabs.defaults.reverseScroll = true; - * $.fn.scrollingTabs.defaults.widthMultiplier = 0.5; - * $.fn.scrollingTabs.defaults.tabClickHandler = function () { }; - * - * - * Methods - * ----------------------------- - * - refresh - * On window resize, the tabs should refresh themselves, but to force a refresh: - * - * $('.nav-tabs').scrollingTabs('refresh'); - * - * - scrollToActiveTab - * On window resize, the active tab will automatically be scrolled to - * if it ends up offscreen, but you can also programmatically force a - * scroll to the active tab any time (if, for example, you're - * programmatically setting the active tab) by calling the - * 'scrollToActiveTab' method: - * - * $('.nav-tabs').scrollingTabs('scrollToActiveTab'); - * - * - * Events - * ----------------------------- - * The plugin triggers event 'ready.scrtabs' when the tabs have - * been wrapped in the scroller and are ready for viewing: - * - * $('.nav-tabs') - * .scrollingTabs() - * .on('ready.scrtabs', function() { - * // tabs ready, do my other stuff... - * }); - * - * $('#tabs-inside-here') - * .scrollingTabs({ tabs: tabs }) - * .on('ready.scrtabs', function() { - * // tabs ready, do my other stuff... - * }); - * - * - * Destroying - * ----------------------------- - * To destroy: - * - * $('.nav-tabs').scrollingTabs('destroy'); - * - * $('#tabs-inside-here').scrollingTabs('destroy'); - * - * If you were wrapping markup, the markup will be restored; if your tabs - * were data-driven, the tabs will be destroyed along with the plugin. - * - */ - -;(function ($, window) { - 'use strict'; - /* jshint unused:false */ - - /* exported CONSTANTS */ - var CONSTANTS = { - CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL: 50, // timeout interval for repeatedly moving the tabs container - // by one increment while the mouse is held down--decrease to - // make mousedown continous scrolling faster - SCROLL_OFFSET_FRACTION: 6, // each click moves the container this fraction of the fixed container--decrease - // to make the tabs scroll farther per click - - DATA_KEY_DDMENU_MODIFIED: 'scrtabsddmenumodified', - DATA_KEY_IS_MOUSEDOWN: 'scrtabsismousedown', - DATA_KEY_BOOTSTRAP_TAB: 'bs.tab', - - CSS_CLASSES: { - BOOTSTRAP4: 'scrtabs-bootstrap4', - RTL: 'scrtabs-rtl', - SCROLL_ARROW_CLICK_TARGET: 'scrtabs-click-target', - SCROLL_ARROW_DISABLE: 'scrtabs-disable', - SCROLL_ARROW_WITH_CLICK_TARGET: 'scrtabs-with-click-target' - }, - - SLIDE_DIRECTION: { - LEFT: 1, - RIGHT: 2 - }, - - EVENTS: { - CLICK: 'click.scrtabs', - DROPDOWN_MENU_HIDE: 'hide.bs.dropdown.scrtabs', - DROPDOWN_MENU_SHOW: 'show.bs.dropdown.scrtabs', - FORCE_REFRESH: 'forcerefresh.scrtabs', - MOUSEDOWN: 'mousedown.scrtabs', - MOUSEUP: 'mouseup.scrtabs', - TABS_READY: 'ready.scrtabs', - TOUCH_END: 'touchend.scrtabs', - TOUCH_MOVE: 'touchmove.scrtabs', - TOUCH_START: 'touchstart.scrtabs', - WINDOW_RESIZE: 'resize.scrtabs' - } - }; - - // smartresize from Paul Irish (debounced window resize) - (function (sr) { - var debounce = function (func, threshold, execAsap) { - var timeout; - - return function debounced() { - var obj = this, args = arguments; - function delayed() { - if (!execAsap) { - func.apply(obj, args); - } - timeout = null; - } - - if (timeout) { - clearTimeout(timeout); - } else if (execAsap) { - func.apply(obj, args); - } - - timeout = setTimeout(delayed, threshold || 100); - }; - }; - $.fn[sr] = function (fn, customEventName) { - var eventName = customEventName || CONSTANTS.EVENTS.WINDOW_RESIZE; - return fn ? this.bind(eventName, debounce(fn)) : this.trigger(sr); - }; - - })('smartresizeScrtabs'); - - /* *********************************************************************************** - * ElementsHandler - Class that each instance of ScrollingTabsControl will instantiate - * **********************************************************************************/ - function ElementsHandler(scrollingTabsControl) { - var ehd = this; - - ehd.stc = scrollingTabsControl; - } - - // ElementsHandler prototype methods - (function (p) { - p.initElements = function (options) { - var ehd = this; - - ehd.setElementReferences(options); - ehd.setEventListeners(options); - }; - - p.listenForTouchEvents = function () { - var ehd = this, - stc = ehd.stc, - smv = stc.scrollMovement, - ev = CONSTANTS.EVENTS; - - var touching = false; - var touchStartX; - var startingContainerLeftPos; - var newLeftPos; - - stc.$movableContainer - .on(ev.TOUCH_START, function (e) { - touching = true; - startingContainerLeftPos = stc.movableContainerLeftPos; - touchStartX = e.originalEvent.changedTouches[0].pageX; - }) - .on(ev.TOUCH_END, function () { - touching = false; - }) - .on(ev.TOUCH_MOVE, function (e) { - if (!touching) { - return; - } - - var touchPageX = e.originalEvent.changedTouches[0].pageX; - var diff = touchPageX - touchStartX; - if (stc.rtl) { - diff = -diff; - } - var minPos; - - newLeftPos = startingContainerLeftPos + diff; - if (newLeftPos > 0) { - newLeftPos = 0; - } else { - minPos = smv.getMinPos(); - if (newLeftPos < minPos) { - newLeftPos = minPos; - } - } - stc.movableContainerLeftPos = newLeftPos; - - var leftOrRight = stc.rtl ? 'right' : 'left'; - stc.$movableContainer.css(leftOrRight, smv.getMovableContainerCssLeftVal()); - smv.refreshScrollArrowsDisabledState(); - }); - }; - - p.refreshAllElementSizes = function () { - var ehd = this, - stc = ehd.stc, - smv = stc.scrollMovement, - scrollArrowsWereVisible = stc.scrollArrowsVisible, - actionsTaken = { - didScrollToActiveTab: false - }, - isPerformingSlideAnim = false, - minPos; - - ehd.setElementWidths(); - ehd.setScrollArrowVisibility(); - - // this could have been a window resize or the removal of a - // dynamic tab, so make sure the movable container is positioned - // correctly because, if it is far to the left and we increased the - // window width, it's possible that the tabs will be too far left, - // beyond the min pos. - if (stc.scrollArrowsVisible) { - // make sure container not too far left - minPos = smv.getMinPos(); - - isPerformingSlideAnim = smv.scrollToActiveTab({ - isOnWindowResize: true - }); - - if (!isPerformingSlideAnim) { - smv.refreshScrollArrowsDisabledState(); - - if (stc.rtl) { - if (stc.movableContainerRightPos < minPos) { - smv.incrementMovableContainerLeft(minPos); - } - } else { - if (stc.movableContainerLeftPos < minPos) { - smv.incrementMovableContainerRight(minPos); - } - } - } - - actionsTaken.didScrollToActiveTab = true; - - } else if (scrollArrowsWereVisible) { - // scroll arrows went away after resize, so position movable container at 0 - stc.movableContainerLeftPos = 0; - smv.slideMovableContainerToLeftPos(); - } - - return actionsTaken; - }; - - p.setElementReferences = function (settings) { - var ehd = this, - stc = ehd.stc, - $tabsContainer = stc.$tabsContainer, - $leftArrow, - $rightArrow, - $leftArrowClickTarget, - $rightArrowClickTarget; - - stc.isNavPills = false; - - if (stc.rtl) { - $tabsContainer.addClass(CONSTANTS.CSS_CLASSES.RTL); - } - - if (stc.usingBootstrap4) { - $tabsContainer.addClass(CONSTANTS.CSS_CLASSES.BOOTSTRAP4); - } - - stc.$fixedContainer = $tabsContainer.find('.scrtabs-tabs-fixed-container'); - $leftArrow = stc.$fixedContainer.prev(); - $rightArrow = stc.$fixedContainer.next(); - - // if we have custom arrow content, we might have a click target defined - if (settings.leftArrowContent) { - $leftArrowClickTarget = $leftArrow.find('.' + CONSTANTS.CSS_CLASSES.SCROLL_ARROW_CLICK_TARGET); - } - - if (settings.rightArrowContent) { - $rightArrowClickTarget = $rightArrow.find('.' + CONSTANTS.CSS_CLASSES.SCROLL_ARROW_CLICK_TARGET); - } - - if ($leftArrowClickTarget && $leftArrowClickTarget.length) { - $leftArrow.addClass(CONSTANTS.CSS_CLASSES.SCROLL_ARROW_WITH_CLICK_TARGET); - } else { - $leftArrowClickTarget = $leftArrow; - } - - if ($rightArrowClickTarget && $rightArrowClickTarget.length) { - $rightArrow.addClass(CONSTANTS.CSS_CLASSES.SCROLL_ARROW_WITH_CLICK_TARGET); - } else { - $rightArrowClickTarget = $rightArrow; - } - - stc.$movableContainer = $tabsContainer.find('.scrtabs-tabs-movable-container'); - stc.$tabsUl = $tabsContainer.find('.nav-tabs'); - - // check for pills - if (!stc.$tabsUl.length) { - stc.$tabsUl = $tabsContainer.find('.nav-pills'); - - if (stc.$tabsUl.length) { - stc.isNavPills = true; - } - } - - stc.$tabsLiCollection = stc.$tabsUl.find('> li'); - - stc.$slideLeftArrow = stc.reverseScroll ? $leftArrow : $rightArrow; - stc.$slideLeftArrowClickTarget = stc.reverseScroll ? $leftArrowClickTarget : $rightArrowClickTarget; - stc.$slideRightArrow = stc.reverseScroll ? $rightArrow : $leftArrow; - stc.$slideRightArrowClickTarget = stc.reverseScroll ? $rightArrowClickTarget : $leftArrowClickTarget; - stc.$scrollArrows = stc.$slideLeftArrow.add(stc.$slideRightArrow); - - stc.$win = $(window); - }; - - p.setElementWidths = function () { - var ehd = this, - stc = ehd.stc; - - stc.winWidth = stc.$win.width(); - stc.scrollArrowsCombinedWidth = stc.$slideLeftArrow.outerWidth() + stc.$slideRightArrow.outerWidth(); - - ehd.setFixedContainerWidth(); - ehd.setMovableContainerWidth(); - }; - - p.setEventListeners = function (settings) { - var ehd = this, - stc = ehd.stc, - evh = stc.eventHandlers, - ev = CONSTANTS.EVENTS, - resizeEventName = ev.WINDOW_RESIZE + stc.instanceId; - - if (settings.enableSwiping) { - ehd.listenForTouchEvents(); - } - - stc.$slideLeftArrowClickTarget - .off('.scrtabs') - .on(ev.MOUSEDOWN, function (e) { evh.handleMousedownOnSlideMovContainerLeftArrow.call(evh, e); }) - .on(ev.MOUSEUP, function (e) { evh.handleMouseupOnSlideMovContainerLeftArrow.call(evh, e); }) - .on(ev.CLICK, function (e) { evh.handleClickOnSlideMovContainerLeftArrow.call(evh, e); }); - - stc.$slideRightArrowClickTarget - .off('.scrtabs') - .on(ev.MOUSEDOWN, function (e) { evh.handleMousedownOnSlideMovContainerRightArrow.call(evh, e); }) - .on(ev.MOUSEUP, function (e) { evh.handleMouseupOnSlideMovContainerRightArrow.call(evh, e); }) - .on(ev.CLICK, function (e) { evh.handleClickOnSlideMovContainerRightArrow.call(evh, e); }); - - if (stc.tabClickHandler) { - stc.$tabsLiCollection - .find('a[data-toggle="tab"]') - .off(ev.CLICK) - .on(ev.CLICK, stc.tabClickHandler); - } - - if (settings.handleDelayedScrollbar) { - ehd.listenForDelayedScrollbar(); - } - - stc.$win - .off(resizeEventName) - .smartresizeScrtabs(function (e) { evh.handleWindowResize.call(evh, e); }, resizeEventName); - - $('body').on(CONSTANTS.EVENTS.FORCE_REFRESH, stc.elementsHandler.refreshAllElementSizes.bind(stc.elementsHandler)); - }; - - p.listenForDelayedScrollbar = function () { - var iframe = document.createElement('iframe'); - iframe.id = "scrtabs-scrollbar-resize-listener"; - iframe.style.cssText = 'height: 0; background-color: transparent; margin: 0; padding: 0; overflow: hidden; border-width: 0; position: absolute; width: 100%;'; - iframe.onload = function() { - var timeout; - - function handleResize() { - try { - $(window).trigger('resize'); - timeout = null; - } catch(e) {} - } - - iframe.contentWindow.addEventListener('resize', function() { - if (timeout) { - clearTimeout(timeout); - } - - timeout = setTimeout(handleResize, 100); - }); - }; - - document.body.appendChild(iframe); - }; - - p.setFixedContainerWidth = function () { - var ehd = this, - stc = ehd.stc, - tabsContainerRect = stc.$tabsContainer.get(0).getBoundingClientRect(); - /** - * @author poletaew - * It solves problem with rounding by jQuery.outerWidth - * If we have real width 100.5 px, jQuery.outerWidth returns us 101 px and we get layout's fail - */ - stc.fixedContainerWidth = tabsContainerRect.width || (tabsContainerRect.right - tabsContainerRect.left); - stc.fixedContainerWidth = stc.fixedContainerWidth * stc.widthMultiplier; - - stc.$fixedContainer.width(stc.fixedContainerWidth); - }; - - p.setFixedContainerWidthForHiddenScrollArrows = function () { - var ehd = this, - stc = ehd.stc; - - stc.$fixedContainer.width(stc.fixedContainerWidth); - }; - - p.setFixedContainerWidthForVisibleScrollArrows = function () { - var ehd = this, - stc = ehd.stc; - - stc.$fixedContainer.width(stc.fixedContainerWidth - stc.scrollArrowsCombinedWidth); - }; - - p.setMovableContainerWidth = function () { - var ehd = this, - stc = ehd.stc, - $tabLi = stc.$tabsUl.find('> li'); - - stc.movableContainerWidth = 0; - - if ($tabLi.length) { - - $tabLi.each(function () { - var $li = $(this), - totalMargin = 0; - - if (stc.isNavPills) { // pills have a margin-left, tabs have no margin - totalMargin = parseInt($li.css('margin-left'), 10) + parseInt($li.css('margin-right'), 10); - } - - stc.movableContainerWidth += ($li.outerWidth() + totalMargin); - }); - - stc.movableContainerWidth += 1; - - // if the tabs don't span the width of the page, force the - // movable container width to full page width so the bottom - // border spans the page width instead of just spanning the - // width of the tabs - if (stc.movableContainerWidth < stc.fixedContainerWidth) { - stc.movableContainerWidth = stc.fixedContainerWidth; - } - } - - stc.$movableContainer.width(stc.movableContainerWidth); - }; - - p.setScrollArrowVisibility = function () { - var ehd = this, - stc = ehd.stc, - shouldBeVisible = stc.movableContainerWidth > stc.fixedContainerWidth; - - if (shouldBeVisible && !stc.scrollArrowsVisible) { - stc.$scrollArrows.show(); - stc.scrollArrowsVisible = true; - } else if (!shouldBeVisible && stc.scrollArrowsVisible) { - stc.$scrollArrows.hide(); - stc.scrollArrowsVisible = false; - } - - if (stc.scrollArrowsVisible) { - ehd.setFixedContainerWidthForVisibleScrollArrows(); - } else { - ehd.setFixedContainerWidthForHiddenScrollArrows(); - } - }; - - }(ElementsHandler.prototype)); - - /* *********************************************************************************** - * EventHandlers - Class that each instance of ScrollingTabsControl will instantiate - * **********************************************************************************/ - function EventHandlers(scrollingTabsControl) { - var evh = this; - - evh.stc = scrollingTabsControl; - } - - // prototype methods - (function (p){ - p.handleClickOnSlideMovContainerLeftArrow = function () { - var evh = this, - stc = evh.stc; - - stc.scrollMovement.incrementMovableContainerLeft(); - }; - - p.handleClickOnSlideMovContainerRightArrow = function () { - var evh = this, - stc = evh.stc; - - stc.scrollMovement.incrementMovableContainerRight(); - }; - - p.handleMousedownOnSlideMovContainerLeftArrow = function () { - var evh = this, - stc = evh.stc; - - stc.$slideLeftArrowClickTarget.data(CONSTANTS.DATA_KEY_IS_MOUSEDOWN, true); - stc.scrollMovement.continueSlideMovableContainerLeft(); - }; - - p.handleMousedownOnSlideMovContainerRightArrow = function () { - var evh = this, - stc = evh.stc; - - stc.$slideRightArrowClickTarget.data(CONSTANTS.DATA_KEY_IS_MOUSEDOWN, true); - stc.scrollMovement.continueSlideMovableContainerRight(); - }; - - p.handleMouseupOnSlideMovContainerLeftArrow = function () { - var evh = this, - stc = evh.stc; - - stc.$slideLeftArrowClickTarget.data(CONSTANTS.DATA_KEY_IS_MOUSEDOWN, false); - }; - - p.handleMouseupOnSlideMovContainerRightArrow = function () { - var evh = this, - stc = evh.stc; - - stc.$slideRightArrowClickTarget.data(CONSTANTS.DATA_KEY_IS_MOUSEDOWN, false); - }; - - p.handleWindowResize = function () { - var evh = this, - stc = evh.stc, - newWinWidth = stc.$win.width(); - - if (newWinWidth === stc.winWidth) { - return false; - } - - stc.winWidth = newWinWidth; - stc.elementsHandler.refreshAllElementSizes(); - }; - - }(EventHandlers.prototype)); - - /* *********************************************************************************** - * ScrollMovement - Class that each instance of ScrollingTabsControl will instantiate - * **********************************************************************************/ - function ScrollMovement(scrollingTabsControl) { - var smv = this; - - smv.stc = scrollingTabsControl; - } - - // prototype methods - (function (p) { - - p.continueSlideMovableContainerLeft = function () { - var smv = this, - stc = smv.stc; - - setTimeout(function() { - if (stc.movableContainerLeftPos <= smv.getMinPos() || - !stc.$slideLeftArrowClickTarget.data(CONSTANTS.DATA_KEY_IS_MOUSEDOWN)) { - return; - } - - if (!smv.incrementMovableContainerLeft()) { // haven't reached max left - smv.continueSlideMovableContainerLeft(); - } - }, CONSTANTS.CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL); - }; - - p.continueSlideMovableContainerRight = function () { - var smv = this, - stc = smv.stc; - - setTimeout(function() { - if (stc.movableContainerLeftPos >= 0 || - !stc.$slideRightArrowClickTarget.data(CONSTANTS.DATA_KEY_IS_MOUSEDOWN)) { - return; - } - - if (!smv.incrementMovableContainerRight()) { // haven't reached max right - smv.continueSlideMovableContainerRight(); - } - }, CONSTANTS.CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL); - }; - - p.decrementMovableContainerLeftPos = function (minPos) { - var smv = this, - stc = smv.stc; - - stc.movableContainerLeftPos -= (stc.fixedContainerWidth / CONSTANTS.SCROLL_OFFSET_FRACTION); - if (stc.movableContainerLeftPos < minPos) { - stc.movableContainerLeftPos = minPos; - } else if (stc.scrollToTabEdge) { - smv.setMovableContainerLeftPosToTabEdge(CONSTANTS.SLIDE_DIRECTION.LEFT); - - if (stc.movableContainerLeftPos < minPos) { - stc.movableContainerLeftPos = minPos; - } - } - }; - - p.disableSlideLeftArrow = function () { - var smv = this, - stc = smv.stc; - - if (!stc.disableScrollArrowsOnFullyScrolled || !stc.scrollArrowsVisible) { - return; - } - - stc.$slideLeftArrow.addClass(CONSTANTS.CSS_CLASSES.SCROLL_ARROW_DISABLE); - }; - - p.disableSlideRightArrow = function () { - var smv = this, - stc = smv.stc; - - if (!stc.disableScrollArrowsOnFullyScrolled || !stc.scrollArrowsVisible) { - return; - } - - stc.$slideRightArrow.addClass(CONSTANTS.CSS_CLASSES.SCROLL_ARROW_DISABLE); - }; - - p.enableSlideLeftArrow = function () { - var smv = this, - stc = smv.stc; - - if (!stc.disableScrollArrowsOnFullyScrolled || !stc.scrollArrowsVisible) { - return; - } - - stc.$slideLeftArrow.removeClass(CONSTANTS.CSS_CLASSES.SCROLL_ARROW_DISABLE); - }; - - p.enableSlideRightArrow = function () { - var smv = this, - stc = smv.stc; - - if (!stc.disableScrollArrowsOnFullyScrolled || !stc.scrollArrowsVisible) { - return; - } - - stc.$slideRightArrow.removeClass(CONSTANTS.CSS_CLASSES.SCROLL_ARROW_DISABLE); - }; - - p.getMinPos = function () { - var smv = this, - stc = smv.stc; - - return stc.scrollArrowsVisible ? (stc.fixedContainerWidth - stc.movableContainerWidth - stc.scrollArrowsCombinedWidth) : 0; - }; - - p.getMovableContainerCssLeftVal = function () { - var smv = this, - stc = smv.stc; - - return (stc.movableContainerLeftPos === 0) ? '0' : stc.movableContainerLeftPos + 'px'; - }; - - p.incrementMovableContainerLeft = function () { - var smv = this, - stc = smv.stc, - minPos = smv.getMinPos(); - - smv.decrementMovableContainerLeftPos(minPos); - smv.slideMovableContainerToLeftPos(); - smv.enableSlideRightArrow(); - - // return true if we're fully left, false otherwise - return (stc.movableContainerLeftPos === minPos); - }; - - p.incrementMovableContainerRight = function (minPos) { - var smv = this, - stc = smv.stc; - - // if minPos passed in, the movable container was beyond the minPos - if (minPos) { - stc.movableContainerLeftPos = minPos; - } else { - stc.movableContainerLeftPos += (stc.fixedContainerWidth / CONSTANTS.SCROLL_OFFSET_FRACTION); - - if (stc.movableContainerLeftPos > 0) { - stc.movableContainerLeftPos = 0; - } else if (stc.scrollToTabEdge) { - smv.setMovableContainerLeftPosToTabEdge(CONSTANTS.SLIDE_DIRECTION.RIGHT); - } - } - - smv.slideMovableContainerToLeftPos(); - smv.enableSlideLeftArrow(); - - // return true if we're fully right, false otherwise - // left pos of 0 is the movable container's max position (farthest right) - return (stc.movableContainerLeftPos === 0); - }; - - p.refreshScrollArrowsDisabledState = function() { - var smv = this, - stc = smv.stc; - - if (!stc.disableScrollArrowsOnFullyScrolled || !stc.scrollArrowsVisible) { - return; - } - - if (stc.movableContainerLeftPos >= 0) { // movable container fully right - smv.disableSlideRightArrow(); - smv.enableSlideLeftArrow(); - return; - } - - if (stc.movableContainerLeftPos <= smv.getMinPos()) { // fully left - smv.disableSlideLeftArrow(); - smv.enableSlideRightArrow(); - return; - } - - smv.enableSlideLeftArrow(); - smv.enableSlideRightArrow(); - }; - - p.scrollToActiveTab = function () { - var smv = this, - stc = smv.stc, - $activeTab, - $activeTabAnchor, - activeTabLeftPos, - activeTabRightPos, - rightArrowLeftPos, - activeTabWidth, - leftPosOffset, - offsetToMiddle, - leftScrollArrowWidth, - rightScrollArrowWidth; - - if (!stc.scrollArrowsVisible) { - return; - } - - if (stc.usingBootstrap4) { - $activeTabAnchor = stc.$tabsUl.find('li > .nav-link.active'); - if ($activeTabAnchor.length) { - $activeTab = $activeTabAnchor.parent(); - } - } else { - $activeTab = stc.$tabsUl.find('li.active'); - } - - if (!$activeTab || !$activeTab.length) { - return; - } - - rightScrollArrowWidth = stc.$slideRightArrow.outerWidth(); - activeTabWidth = $activeTab.outerWidth(); - - /** - * @author poletaew - * We need relative offset (depends on $fixedContainer), don't absolute - */ - activeTabLeftPos = $activeTab.offset().left - stc.$fixedContainer.offset().left; - activeTabRightPos = activeTabLeftPos + activeTabWidth; - - rightArrowLeftPos = stc.fixedContainerWidth - rightScrollArrowWidth; - - if (stc.rtl) { - leftScrollArrowWidth = stc.$slideLeftArrow.outerWidth(); - - if (activeTabLeftPos < 0) { // active tab off left side - stc.movableContainerLeftPos += activeTabLeftPos; - smv.slideMovableContainerToLeftPos(); - return true; - } else { // active tab off right side - if (activeTabRightPos > rightArrowLeftPos) { - stc.movableContainerLeftPos += (activeTabRightPos - rightArrowLeftPos) + (2 * rightScrollArrowWidth); - smv.slideMovableContainerToLeftPos(); - return true; - } - } - } else { - if (activeTabRightPos > rightArrowLeftPos) { // active tab off right side - leftPosOffset = activeTabRightPos - rightArrowLeftPos + rightScrollArrowWidth; - offsetToMiddle = stc.fixedContainerWidth / 2; - leftPosOffset += offsetToMiddle - (activeTabWidth / 2); - stc.movableContainerLeftPos -= leftPosOffset; - smv.slideMovableContainerToLeftPos(); - return true; - } else { - leftScrollArrowWidth = stc.$slideLeftArrow.outerWidth(); - if (activeTabLeftPos < 0) { // active tab off left side - offsetToMiddle = stc.fixedContainerWidth / 2; - stc.movableContainerLeftPos += (-activeTabLeftPos) + offsetToMiddle - (activeTabWidth / 2); - smv.slideMovableContainerToLeftPos(); - return true; - } - } - } - - return false; - }; - - p.setMovableContainerLeftPosToTabEdge = function (slideDirection) { - var smv = this, - stc = smv.stc, - offscreenWidth = -stc.movableContainerLeftPos, - totalTabWidth = 0; - - // make sure LeftPos is set so that a tab edge will be against the - // left scroll arrow so we won't have a partial, cut-off tab - stc.$tabsLiCollection.each(function () { - var tabWidth = $(this).width(); - - totalTabWidth += tabWidth; - - if (totalTabWidth > offscreenWidth) { - stc.movableContainerLeftPos = (slideDirection === CONSTANTS.SLIDE_DIRECTION.RIGHT) ? -(totalTabWidth - tabWidth) : -totalTabWidth; - return false; // exit .each() loop - } - - }); - }; - - p.slideMovableContainerToLeftPos = function () { - var smv = this, - stc = smv.stc, - minPos = smv.getMinPos(), - leftOrRightVal; - - if (stc.movableContainerLeftPos > 0) { - stc.movableContainerLeftPos = 0; - } else if (stc.movableContainerLeftPos < minPos) { - stc.movableContainerLeftPos = minPos; - } - - stc.movableContainerLeftPos = stc.movableContainerLeftPos / 1; - leftOrRightVal = smv.getMovableContainerCssLeftVal(); - - smv.performingSlideAnim = true; - - var targetPos = stc.rtl ? { right: leftOrRightVal } : { left: leftOrRightVal }; - - stc.$movableContainer.stop().animate(targetPos, 'slow', function __slideAnimComplete() { - var newMinPos = smv.getMinPos(); - - smv.performingSlideAnim = false; - - // if we slid past the min pos--which can happen if you resize the window - // quickly--move back into position - if (stc.movableContainerLeftPos < newMinPos) { - smv.decrementMovableContainerLeftPos(newMinPos); - - targetPos = stc.rtl ? { right: smv.getMovableContainerCssLeftVal() } : { left: smv.getMovableContainerCssLeftVal() }; - - stc.$movableContainer.stop().animate(targetPos, 'fast', function() { - smv.refreshScrollArrowsDisabledState(); - }); - } else { - smv.refreshScrollArrowsDisabledState(); - } - }); - }; - - }(ScrollMovement.prototype)); - - /* ********************************************************************** - * ScrollingTabsControl - Class that each directive will instantiate - * **********************************************************************/ - function ScrollingTabsControl($tabsContainer) { - var stc = this; - - stc.$tabsContainer = $tabsContainer; - stc.instanceId = $.fn.scrollingTabs.nextInstanceId++; - - stc.movableContainerLeftPos = 0; - stc.scrollArrowsVisible = false; - stc.scrollToTabEdge = false; - stc.disableScrollArrowsOnFullyScrolled = false; - stc.reverseScroll = false; - stc.widthMultiplier = 1; - - stc.scrollMovement = new ScrollMovement(stc); - stc.eventHandlers = new EventHandlers(stc); - stc.elementsHandler = new ElementsHandler(stc); - } - - // prototype methods - (function (p) { - p.initTabs = function (options, $scroller, readyCallback, attachTabContentToDomCallback) { - var stc = this, - elementsHandler = stc.elementsHandler, - num; - - if (options.enableRtlSupport && $('html').attr('dir') === 'rtl') { - stc.rtl = true; - } - - if (options.scrollToTabEdge) { - stc.scrollToTabEdge = true; - } - - if (options.disableScrollArrowsOnFullyScrolled) { - stc.disableScrollArrowsOnFullyScrolled = true; - } - - if (options.reverseScroll) { - stc.reverseScroll = true; - } - - if (options.widthMultiplier !== 1) { - num = Number(options.widthMultiplier); // handle string value - - if (!isNaN(num)) { - stc.widthMultiplier = num; - } - } - - if (options.bootstrapVersion.toString().charAt(0) === '4') { - stc.usingBootstrap4 = true; - } - - setTimeout(initTabsAfterTimeout, 100); - - function initTabsAfterTimeout() { - var actionsTaken; - - // if we're just wrapping non-data-driven tabs, the user might - // have the .nav-tabs hidden to prevent the clunky flash of - // multi-line tabs on page refresh, so we need to make sure - // they're visible before trying to wrap them - $scroller.find('.nav-tabs').show(); - - elementsHandler.initElements(options); - actionsTaken = elementsHandler.refreshAllElementSizes(); - - $scroller.css('visibility', 'visible'); - - if (attachTabContentToDomCallback) { - attachTabContentToDomCallback(); - } - - if (readyCallback) { - readyCallback(); - } - } - }; - - p.scrollToActiveTab = function(options) { - var stc = this, - smv = stc.scrollMovement; - - smv.scrollToActiveTab(options); - }; - }(ScrollingTabsControl.prototype)); - - - /* exported buildNavTabsAndTabContentForTargetElementInstance */ - var tabElements = (function () { - - return { - getElTabPaneForLi: getElTabPaneForLi, - getNewElNavTabs: getNewElNavTabs, - getNewElScrollerElementWrappingNavTabsInstance: getNewElScrollerElementWrappingNavTabsInstance, - getNewElTabAnchor: getNewElTabAnchor, - getNewElTabContent: getNewElTabContent, - getNewElTabLi: getNewElTabLi, - getNewElTabPane: getNewElTabPane - }; - - /////////////////// - - // ---- retrieve existing elements from the DOM ---------- - function getElTabPaneForLi($li) { - return $($li.find('a').attr('href')); - } - - - // ---- create new elements ---------- - function getNewElNavTabs() { - return $(''); - } - - function getNewElScrollerElementWrappingNavTabsInstance($navTabsInstance, settings) { - var $tabsContainer = $('
    '), - leftArrowContent = settings.leftArrowContent || '
    ', - $leftArrow = $(leftArrowContent), - rightArrowContent = settings.rightArrowContent || '
    ', - $rightArrow = $(rightArrowContent), - $fixedContainer = $('
    '), - $movableContainer = $('
    '); - - if (settings.disableScrollArrowsOnFullyScrolled) { - $leftArrow.add($rightArrow).addClass(CONSTANTS.CSS_CLASSES.SCROLL_ARROW_DISABLE); - } - - return $tabsContainer - .append($leftArrow, - $fixedContainer.append($movableContainer.append($navTabsInstance)), - $rightArrow); - } - - function getNewElTabAnchor(tab, propNames) { - return $('') - .attr('href', '#' + tab[propNames.paneId]) - .html(tab[propNames.title]); - } - - function getNewElTabContent() { - return $('
    '); - } - - function getNewElTabLi(tab, propNames, options) { - var liContent = options.tabLiContent || '
  • ', - $li = $(liContent), - $a = getNewElTabAnchor(tab, propNames).appendTo($li); - - if (tab[propNames.disabled]) { - $li.addClass('disabled'); - $a.attr('data-toggle', ''); - } else if (options.forceActiveTab && tab[propNames.active]) { - $li.addClass('active'); - } - - if (options.tabPostProcessor) { - options.tabPostProcessor($li, $a); - } - - return $li; - } - - function getNewElTabPane(tab, propNames, options) { - var $pane = $('
    ') - .attr('id', tab[propNames.paneId]) - .html(tab[propNames.content]); - - if (options.forceActiveTab && tab[propNames.active]) { - $pane.addClass('active'); - } - - return $pane; - } - - - }()); // tabElements - - var tabUtils = (function () { - - return { - didTabOrderChange: didTabOrderChange, - getIndexOfClosestEnabledTab: getIndexOfClosestEnabledTab, - getTabIndexByPaneId: getTabIndexByPaneId, - storeDataOnLiEl: storeDataOnLiEl - }; - - /////////////////// - - function didTabOrderChange($currTabLis, updatedTabs, propNames) { - var isTabOrderChanged = false; - - $currTabLis.each(function (currDomIdx) { - var newIdx = getTabIndexByPaneId(updatedTabs, propNames.paneId, $(this).data('tab')[propNames.paneId]); - - if ((newIdx > -1) && (newIdx !== currDomIdx)) { // tab moved - isTabOrderChanged = true; - return false; // exit .each() loop - } - }); - - return isTabOrderChanged; - } - - function getIndexOfClosestEnabledTab($currTabLis, startIndex) { - var lastIndex = $currTabLis.length - 1, - closestIdx = -1, - incrementFromStartIndex = 0, - testIdx = 0; - - // expand out from the current tab looking for an enabled tab; - // we prefer the tab after us over the tab before - while ((closestIdx === -1) && (testIdx >= 0)) { - - if ( (((testIdx = startIndex + (++incrementFromStartIndex)) <= lastIndex) && - !$currTabLis.eq(testIdx).hasClass('disabled')) || - (((testIdx = startIndex - incrementFromStartIndex) >= 0) && - !$currTabLis.eq(testIdx).hasClass('disabled')) ) { - - closestIdx = testIdx; - - } - } - - return closestIdx; - } - - function getTabIndexByPaneId(tabs, paneIdPropName, paneId) { - var idx = -1; - - tabs.some(function (tab, i) { - if (tab[paneIdPropName] === paneId) { - idx = i; - return true; // exit loop - } - }); - - return idx; - } - - function storeDataOnLiEl($li, tabs, index) { - $li.data({ - tab: $.extend({}, tabs[index]), // store a clone so we can check for changes - index: index - }); - } - - }()); // tabUtils - - function buildNavTabsAndTabContentForTargetElementInstance($targetElInstance, settings, readyCallback) { - var tabs = settings.tabs, - propNames = { - paneId: settings.propPaneId, - title: settings.propTitle, - active: settings.propActive, - disabled: settings.propDisabled, - content: settings.propContent - }, - ignoreTabPanes = settings.ignoreTabPanes, - hasTabContent = tabs.length && tabs[0][propNames.content] !== undefined, - $navTabs = tabElements.getNewElNavTabs(), - $tabContent = tabElements.getNewElTabContent(), - $scroller, - attachTabContentToDomCallback = ignoreTabPanes ? null : function() { - $scroller.after($tabContent); - }; - - if (!tabs.length) { - return; - } - - tabs.forEach(function(tab, index) { - var options = { - forceActiveTab: true, - tabLiContent: settings.tabsLiContent && settings.tabsLiContent[index], - tabPostProcessor: settings.tabsPostProcessors && settings.tabsPostProcessors[index] - }; - - tabElements - .getNewElTabLi(tab, propNames, options) - .appendTo($navTabs); - - // build the tab panes if we weren't told to ignore them and there's - // tab content data available - if (!ignoreTabPanes && hasTabContent) { - tabElements - .getNewElTabPane(tab, propNames, options) - .appendTo($tabContent); - } - }); - - $scroller = wrapNavTabsInstanceInScroller($navTabs, - settings, - readyCallback, - attachTabContentToDomCallback); - - $scroller.appendTo($targetElInstance); - - $targetElInstance.data({ - scrtabs: { - tabs: tabs, - propNames: propNames, - ignoreTabPanes: ignoreTabPanes, - hasTabContent: hasTabContent, - tabsLiContent: settings.tabsLiContent, - tabsPostProcessors: settings.tabsPostProcessors, - scroller: $scroller - } - }); - - // once the nav-tabs are wrapped in the scroller, attach each tab's - // data to it for reference later; we need to wait till they're - // wrapped in the scroller because we wrap a *clone* of the nav-tabs - // we built above, not the original nav-tabs - $scroller.find('.nav-tabs > li').each(function (index) { - tabUtils.storeDataOnLiEl($(this), tabs, index); - }); - - return $targetElInstance; - } - - - function wrapNavTabsInstanceInScroller($navTabsInstance, settings, readyCallback, attachTabContentToDomCallback) { - // Remove tab data stored by Bootstrap in order to fix tabs that were already visited - $navTabsInstance - .find('a[data-toggle="tab"]') - .removeData(CONSTANTS.DATA_KEY_BOOTSTRAP_TAB); - - var $scroller = tabElements.getNewElScrollerElementWrappingNavTabsInstance($navTabsInstance.clone(true), settings), // use clone because we replaceWith later - scrollingTabsControl = new ScrollingTabsControl($scroller), - navTabsInstanceData = $navTabsInstance.data('scrtabs'); - - if (!navTabsInstanceData) { - $navTabsInstance.data('scrtabs', { - scroller: $scroller - }); - } else { - navTabsInstanceData.scroller = $scroller; - } - - $navTabsInstance.replaceWith($scroller.css('visibility', 'hidden')); - - if (settings.tabClickHandler && (typeof settings.tabClickHandler === 'function')) { - $scroller.hasTabClickHandler = true; - scrollingTabsControl.tabClickHandler = settings.tabClickHandler; - } - - $scroller.initTabs = function () { - scrollingTabsControl.initTabs(settings, - $scroller, - readyCallback, - attachTabContentToDomCallback); - }; - - $scroller.scrollToActiveTab = function() { - scrollingTabsControl.scrollToActiveTab(settings); - }; - - $scroller.initTabs(); - - listenForDropdownMenuTabs($scroller, scrollingTabsControl); - - return $scroller; - } - - /* exported listenForDropdownMenuTabs, - refreshTargetElementInstance, - scrollToActiveTab */ - function checkForTabAdded(refreshData) { - var updatedTabsArray = refreshData.updatedTabsArray, - updatedTabsLiContent = refreshData.updatedTabsLiContent || [], - updatedTabsPostProcessors = refreshData.updatedTabsPostProcessors || [], - propNames = refreshData.propNames, - ignoreTabPanes = refreshData.ignoreTabPanes, - options = refreshData.options, - $currTabLis = refreshData.$currTabLis, - $navTabs = refreshData.$navTabs, - $currTabContentPanesContainer = ignoreTabPanes ? null : refreshData.$currTabContentPanesContainer, - $currTabContentPanes = ignoreTabPanes ? null : refreshData.$currTabContentPanes, - isInitTabsRequired = false; - - // make sure each tab in the updated tabs array has a corresponding DOM element - updatedTabsArray.forEach(function (tab, idx) { - var $li = $currTabLis.find('a[href="#' + tab[propNames.paneId] + '"]'), - isTabIdxPastCurrTabs = (idx >= $currTabLis.length), - $pane; - - if (!$li.length) { // new tab - isInitTabsRequired = true; - - // add the tab, add its pane (if necessary), and refresh the scroller - options.tabLiContent = updatedTabsLiContent[idx]; - options.tabPostProcessor = updatedTabsPostProcessors[idx]; - $li = tabElements.getNewElTabLi(tab, propNames, options); - tabUtils.storeDataOnLiEl($li, updatedTabsArray, idx); - - if (isTabIdxPastCurrTabs) { // append to end of current tabs - $li.appendTo($navTabs); - } else { // insert in middle of current tabs - $li.insertBefore($currTabLis.eq(idx)); - } - - if (!ignoreTabPanes && tab[propNames.content] !== undefined) { - $pane = tabElements.getNewElTabPane(tab, propNames, options); - if (isTabIdxPastCurrTabs) { // append to end of current tabs - $pane.appendTo($currTabContentPanesContainer); - } else { // insert in middle of current tabs - $pane.insertBefore($currTabContentPanes.eq(idx)); - } - } - - } - - }); - - return isInitTabsRequired; - } - - function checkForTabPropertiesUpdated(refreshData) { - var tabLiData = refreshData.tabLi, - ignoreTabPanes = refreshData.ignoreTabPanes, - $li = tabLiData.$li, - $contentPane = tabLiData.$contentPane, - origTabData = tabLiData.origTabData, - newTabData = tabLiData.newTabData, - propNames = refreshData.propNames, - isInitTabsRequired = false; - - // update tab title if necessary - if (origTabData[propNames.title] !== newTabData[propNames.title]) { - $li.find('a[role="tab"]') - .html(origTabData[propNames.title] = newTabData[propNames.title]); - - isInitTabsRequired = true; - } - - // update tab disabled state if necessary - if (origTabData[propNames.disabled] !== newTabData[propNames.disabled]) { - if (newTabData[propNames.disabled]) { // enabled -> disabled - $li.addClass('disabled'); - $li.find('a[role="tab"]').attr('data-toggle', ''); - } else { // disabled -> enabled - $li.removeClass('disabled'); - $li.find('a[role="tab"]').attr('data-toggle', 'tab'); - } - - origTabData[propNames.disabled] = newTabData[propNames.disabled]; - isInitTabsRequired = true; - } - - // update tab active state if necessary - if (refreshData.options.forceActiveTab) { - // set the active tab based on the tabs array regardless of the current - // DOM state, which could have been changed by the user clicking a tab - // without those changes being reflected back to the tab data - $li[newTabData[propNames.active] ? 'addClass' : 'removeClass']('active'); - - $contentPane[newTabData[propNames.active] ? 'addClass' : 'removeClass']('active'); - - origTabData[propNames.active] = newTabData[propNames.active]; - - isInitTabsRequired = true; - } - - // update tab content pane if necessary - if (!ignoreTabPanes && origTabData[propNames.content] !== newTabData[propNames.content]) { - $contentPane.html(origTabData[propNames.content] = newTabData[propNames.content]); - isInitTabsRequired = true; - } - - return isInitTabsRequired; - } - - function checkForTabRemoved(refreshData) { - var tabLiData = refreshData.tabLi, - ignoreTabPanes = refreshData.ignoreTabPanes, - $li = tabLiData.$li, - idxToMakeActive; - - if (tabLiData.newIdx !== -1) { // tab was not removed--it has a valid index - return false; - } - - // if this was the active tab, make the closest enabled tab active - if ($li.hasClass('active')) { - - idxToMakeActive = tabUtils.getIndexOfClosestEnabledTab(refreshData.$currTabLis, tabLiData.currDomIdx); - if (idxToMakeActive > -1) { - refreshData.$currTabLis - .eq(idxToMakeActive) - .addClass('active'); - - if (!ignoreTabPanes) { - refreshData.$currTabContentPanes - .eq(idxToMakeActive) - .addClass('active'); - } - } - } - - $li.remove(); - - if (!ignoreTabPanes) { - tabLiData.$contentPane.remove(); - } - - return true; - } - - function checkForTabsOrderChanged(refreshData) { - var $currTabLis = refreshData.$currTabLis, - updatedTabsArray = refreshData.updatedTabsArray, - propNames = refreshData.propNames, - ignoreTabPanes = refreshData.ignoreTabPanes, - newTabsCollection = [], - newTabPanesCollection = ignoreTabPanes ? null : []; - - if (!tabUtils.didTabOrderChange($currTabLis, updatedTabsArray, propNames)) { - return false; - } - - // the tab order changed... - updatedTabsArray.forEach(function (t) { - var paneId = t[propNames.paneId]; - - newTabsCollection.push( - $currTabLis - .find('a[role="tab"][href="#' + paneId + '"]') - .parent('li') - ); - - if (!ignoreTabPanes) { - newTabPanesCollection.push($('#' + paneId)); - } - }); - - refreshData.$navTabs.append(newTabsCollection); - - if (!ignoreTabPanes) { - refreshData.$currTabContentPanesContainer.append(newTabPanesCollection); - } - - return true; - } - - function checkForTabsRemovedOrUpdated(refreshData) { - var $currTabLis = refreshData.$currTabLis, - updatedTabsArray = refreshData.updatedTabsArray, - propNames = refreshData.propNames, - isInitTabsRequired = false; - - - $currTabLis.each(function (currDomIdx) { - var $li = $(this), - origTabData = $li.data('tab'), - newIdx = tabUtils.getTabIndexByPaneId(updatedTabsArray, propNames.paneId, origTabData[propNames.paneId]), - newTabData = (newIdx > -1) ? updatedTabsArray[newIdx] : null; - - refreshData.tabLi = { - $li: $li, - currDomIdx: currDomIdx, - newIdx: newIdx, - $contentPane: tabElements.getElTabPaneForLi($li), - origTabData: origTabData, - newTabData: newTabData - }; - - if (checkForTabRemoved(refreshData)) { - isInitTabsRequired = true; - return; // continue to next $li in .each() since we removed this tab - } - - if (checkForTabPropertiesUpdated(refreshData)) { - isInitTabsRequired = true; - } - }); - - return isInitTabsRequired; - } - - function listenForDropdownMenuTabs($scroller, stc) { - var $ddMenu; - - // for dropdown menus to show, we need to move them out of the - // scroller and append them to the body - $scroller - .on(CONSTANTS.EVENTS.DROPDOWN_MENU_SHOW, handleDropdownShow) - .on(CONSTANTS.EVENTS.DROPDOWN_MENU_HIDE, handleDropdownHide); - - function handleDropdownHide(e) { - // move the dropdown menu back into its tab - $(e.target).append($ddMenu.off(CONSTANTS.EVENTS.CLICK)); - } - - function handleDropdownShow(e) { - var $ddParentTabLi = $(e.target), - ddLiOffset = $ddParentTabLi.offset(), - $currActiveTab = $scroller.find('li[role="presentation"].active'), - ddMenuRightX, - tabsContainerMaxX, - ddMenuTargetLeft; - - $ddMenu = $ddParentTabLi - .find('.dropdown-menu') - .attr('data-' + CONSTANTS.DATA_KEY_DDMENU_MODIFIED, true); - - // if the dropdown's parent tab li isn't already active, - // we need to deactivate any active menu item in the dropdown - if ($currActiveTab[0] !== $ddParentTabLi[0]) { - $ddMenu.find('li.active').removeClass('active'); - } - - // we need to do our own click handling because the built-in - // bootstrap handlers won't work since we moved the dropdown - // menu outside the tabs container - $ddMenu.on(CONSTANTS.EVENTS.CLICK, 'a[role="tab"]', handleClickOnDropdownMenuItem); - - $('body').append($ddMenu); - - // make sure the menu doesn't go off the right side of the page - ddMenuRightX = $ddMenu.width() + ddLiOffset.left; - tabsContainerMaxX = $scroller.width() - (stc.$slideRightArrow.outerWidth() + 1); - ddMenuTargetLeft = ddLiOffset.left; - - if (ddMenuRightX > tabsContainerMaxX) { - ddMenuTargetLeft -= (ddMenuRightX - tabsContainerMaxX); - } - - $ddMenu.css({ - 'display': 'block', - 'top': ddLiOffset.top + $ddParentTabLi.outerHeight() - 2, - 'left': ddMenuTargetLeft - }); - - function handleClickOnDropdownMenuItem() { - /* jshint validthis: true */ - var $selectedMenuItemAnc = $(this), - $selectedMenuItemLi = $selectedMenuItemAnc.parent('li'), - $selectedMenuItemDropdownMenu = $selectedMenuItemLi.parent('.dropdown-menu'), - targetPaneId = $selectedMenuItemAnc.attr('href'); - - if ($selectedMenuItemLi.hasClass('active')) { - return; - } - - // once we select a menu item from the dropdown, deactivate - // the current tab (unless it's our parent tab), deactivate - // any active dropdown menu item, make our parent tab active - // (if it's not already), and activate the selected menu item - $scroller - .find('li.active') - .not($ddParentTabLi) - .add($selectedMenuItemDropdownMenu.find('li.active')) - .removeClass('active'); - - $ddParentTabLi - .add($selectedMenuItemLi) - .addClass('active'); - - // manually deactivate current active pane and activate our pane - $('.tab-content .tab-pane.active').removeClass('active'); - $(targetPaneId).addClass('active'); - } - - } - } - - function refreshDataDrivenTabs($container, options) { - var instanceData = $container.data().scrtabs, - scroller = instanceData.scroller, - $navTabs = $container.find('.scrtabs-tab-container .nav-tabs'), - $currTabContentPanesContainer = $container.find('.tab-content'), - isInitTabsRequired = false, - refreshData = { - options: options, - updatedTabsArray: instanceData.tabs, - updatedTabsLiContent: instanceData.tabsLiContent, - updatedTabsPostProcessors: instanceData.tabsPostProcessors, - propNames: instanceData.propNames, - ignoreTabPanes: instanceData.ignoreTabPanes, - $navTabs: $navTabs, - $currTabLis: $navTabs.find('> li'), - $currTabContentPanesContainer: $currTabContentPanesContainer, - $currTabContentPanes: $currTabContentPanesContainer.find('.tab-pane') - }; - - // to preserve the tab positions if we're just adding or removing - // a tab, don't completely rebuild the tab structure, but check - // for differences between the new tabs array and the old - if (checkForTabAdded(refreshData)) { - isInitTabsRequired = true; - } - - if (checkForTabsOrderChanged(refreshData)) { - isInitTabsRequired = true; - } - - if (checkForTabsRemovedOrUpdated(refreshData)) { - isInitTabsRequired = true; - } - - if (isInitTabsRequired) { - scroller.initTabs(); - } - - return isInitTabsRequired; - } - - function refreshTargetElementInstance($container, options) { - if (!$container.data('scrtabs')) { // target element doesn't have plugin on it - return; - } - - // force a refresh if the tabs are static html or they're data-driven - // but the data didn't change so we didn't call initTabs() - if ($container.data('scrtabs').isWrapperOnly || !refreshDataDrivenTabs($container, options)) { - $('body').trigger(CONSTANTS.EVENTS.FORCE_REFRESH); - } - } - - function scrollToActiveTab() { - /* jshint validthis: true */ - var $targetElInstance = $(this), - scrtabsData = $targetElInstance.data('scrtabs'); - - if (!scrtabsData) { - return; - } - - scrtabsData.scroller.scrollToActiveTab(); - } - - var methods = { - destroy: function() { - var $targetEls = this; - - return $targetEls.each(destroyPlugin); - }, - - init: function(options) { - var $targetEls = this, - targetElsLastIndex = $targetEls.length - 1, - settings = $.extend({}, $.fn.scrollingTabs.defaults, options || {}); - - // ---- tabs NOT data-driven ------------------------- - if (!settings.tabs) { - - // just wrap the selected .nav-tabs element(s) in the scroller - return $targetEls.each(function(index) { - var dataObj = { - isWrapperOnly: true - }, - $targetEl = $(this).data({ scrtabs: dataObj }), - readyCallback = (index < targetElsLastIndex) ? null : function() { - $targetEls.trigger(CONSTANTS.EVENTS.TABS_READY); - }; - - wrapNavTabsInstanceInScroller($targetEl, settings, readyCallback); - }); - - } - - // ---- tabs data-driven ------------------------- - return $targetEls.each(function (index) { - var $targetEl = $(this), - readyCallback = (index < targetElsLastIndex) ? null : function() { - $targetEls.trigger(CONSTANTS.EVENTS.TABS_READY); - }; - - buildNavTabsAndTabContentForTargetElementInstance($targetEl, settings, readyCallback); - }); - }, - - refresh: function(options) { - var $targetEls = this, - settings = $.extend({}, $.fn.scrollingTabs.defaults, options || {}); - - return $targetEls.each(function () { - refreshTargetElementInstance($(this), settings); - }); - }, - - scrollToActiveTab: function() { - return this.each(scrollToActiveTab); - } - }; - - function destroyPlugin() { - /* jshint validthis: true */ - var $targetElInstance = $(this), - scrtabsData = $targetElInstance.data('scrtabs'), - $tabsContainer; - - if (!scrtabsData) { - return; - } - - if (scrtabsData.enableSwipingElement === 'self') { - $targetElInstance.removeClass(CONSTANTS.CSS_CLASSES.ALLOW_SCROLLBAR); - } else if (scrtabsData.enableSwipingElement === 'parent') { - $targetElInstance.closest('.scrtabs-tab-container').parent().removeClass(CONSTANTS.CSS_CLASSES.ALLOW_SCROLLBAR); - } - - scrtabsData.scroller - .off(CONSTANTS.EVENTS.DROPDOWN_MENU_SHOW) - .off(CONSTANTS.EVENTS.DROPDOWN_MENU_HIDE); - - // if there were any dropdown menus opened, remove the css we added to - // them so they would display correctly - scrtabsData.scroller - .find('[data-' + CONSTANTS.DATA_KEY_DDMENU_MODIFIED + ']') - .css({ - display: '', - left: '', - top: '' - }) - .off(CONSTANTS.EVENTS.CLICK) - .removeAttr('data-' + CONSTANTS.DATA_KEY_DDMENU_MODIFIED); - - if (scrtabsData.scroller.hasTabClickHandler) { - $targetElInstance - .find('a[data-toggle="tab"]') - .off('.scrtabs'); - } - - if (scrtabsData.isWrapperOnly) { // we just wrapped nav-tabs markup, so restore it - // $targetElInstance is the ul.nav-tabs - $tabsContainer = $targetElInstance.parents('.scrtabs-tab-container'); - - if ($tabsContainer.length) { - $tabsContainer.replaceWith($targetElInstance); - } - - } else { // we generated the tabs from data so destroy everything we created - if (scrtabsData.scroller && scrtabsData.scroller.initTabs) { - scrtabsData.scroller.initTabs = null; - } - - // $targetElInstance is the container for the ul.nav-tabs we generated - $targetElInstance - .find('.scrtabs-tab-container') - .add('.tab-content') - .remove(); - } - - $targetElInstance.removeData('scrtabs'); - - while(--$.fn.scrollingTabs.nextInstanceId >= 0) { - $(window).off(CONSTANTS.EVENTS.WINDOW_RESIZE + $.fn.scrollingTabs.nextInstanceId); - } - - $('body').off(CONSTANTS.EVENTS.FORCE_REFRESH); - } - - - $.fn.scrollingTabs = function(methodOrOptions) { - - if (methods[methodOrOptions]) { - return methods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1)); - } else if (!methodOrOptions || (typeof methodOrOptions === 'object')) { - return methods.init.apply(this, arguments); - } else { - $.error('Method ' + methodOrOptions + ' does not exist on $.scrollingTabs.'); - } - }; - - $.fn.scrollingTabs.nextInstanceId = 0; - - $.fn.scrollingTabs.defaults = { - tabs: null, - propPaneId: 'paneId', - propTitle: 'title', - propActive: 'active', - propDisabled: 'disabled', - propContent: 'content', - ignoreTabPanes: false, - scrollToTabEdge: false, - disableScrollArrowsOnFullyScrolled: false, - forceActiveTab: false, - reverseScroll: false, - widthMultiplier: 1, - tabClickHandler: null, - cssClassLeftArrow: 'glyphicon glyphicon-chevron-left', - cssClassRightArrow: 'glyphicon glyphicon-chevron-right', - leftArrowContent: '', - rightArrowContent: '', - tabsLiContent: null, - tabsPostProcessors: null, - enableSwiping: false, - enableRtlSupport: false, - handleDelayedScrollbar: false, - bootstrapVersion: 3 - }; - - - -}(jQuery, window)); diff --git a/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.min.css b/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.min.css deleted file mode 100644 index c4b8f93a4c..0000000000 --- a/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * jquery-bootstrap-scrolling-tabs - * @version v2.6.1 - * @link https://github.com/mikejacobson/jquery-bootstrap-scrolling-tabs - * @author Mike Jacobson - * @license MIT License, http://www.opensource.org/licenses/MIT - */ -.scrtabs-tab-container *{box-sizing:border-box}.scrtabs-tab-container{height:42px}.scrtabs-tab-container .tab-content{clear:left}.scrtabs-tab-container.scrtabs-bootstrap4 .scrtabs-tabs-movable-container>.navbar-nav{-ms-flex-direction:row;flex-direction:row}.scrtabs-tabs-fixed-container{float:left;height:42px;overflow:hidden;width:100%}.scrtabs-tabs-movable-container{position:relative}.scrtabs-tabs-movable-container .tab-content{display:none}.scrtabs-tab-container.scrtabs-rtl .scrtabs-tabs-movable-container>ul.nav-tabs{padding-right:0}.scrtabs-tab-scroll-arrow{border:1px solid #ddd;border-top:none;color:#428bca;display:none;float:left;font-size:12px;height:42px;margin-bottom:-1px;padding-left:2px;padding-top:13px;width:20px}.scrtabs-tab-scroll-arrow:hover{background-color:#eee}.scrtabs-tab-scroll-arrow,.scrtabs-tab-scroll-arrow .scrtabs-click-target{cursor:pointer}.scrtabs-tab-scroll-arrow.scrtabs-with-click-target{cursor:default}.scrtabs-tab-scroll-arrow.scrtabs-disable,.scrtabs-tab-scroll-arrow.scrtabs-disable .scrtabs-click-target{color:#ddd;cursor:default}.scrtabs-tab-scroll-arrow.scrtabs-disable:hover{background-color:initial}.scrtabs-tabs-fixed-container ul.nav-tabs>li{white-space:nowrap} \ No newline at end of file diff --git a/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.min.js b/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.min.js deleted file mode 100644 index 65c94ba6c9..0000000000 --- a/view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * jquery-bootstrap-scrolling-tabs - * @version v2.6.1 - * @link https://github.com/mikejacobson/jquery-bootstrap-scrolling-tabs - * @author Mike Jacobson - * @license MIT License, http://www.opensource.org/licenses/MIT - */ -!function(e,t){"use strict";function n(e){this.stc=e}function r(e){this.stc=e}function a(e){this.stc=e}function o(t){var o=this;o.$tabsContainer=t,o.instanceId=e.fn.scrollingTabs.nextInstanceId++,o.movableContainerLeftPos=0,o.scrollArrowsVisible=!1,o.scrollToTabEdge=!1,o.disableScrollArrowsOnFullyScrolled=!1,o.reverseScroll=!1,o.widthMultiplier=1,o.scrollMovement=new a(o),o.eventHandlers=new r(o),o.elementsHandler=new n(o)}function i(t,n,r){var a,o=n.tabs,i={paneId:n.propPaneId,title:n.propTitle,active:n.propActive,disabled:n.propDisabled,content:n.propContent},l=n.ignoreTabPanes,c=o.length&&void 0!==o[0][i.content],d=A.getNewElNavTabs(),b=A.getNewElTabContent(),f=l?null:function(){a.after(b)};if(o.length)return o.forEach(function(e,t){var r={forceActiveTab:!0,tabLiContent:n.tabsLiContent&&n.tabsLiContent[t],tabPostProcessor:n.tabsPostProcessors&&n.tabsPostProcessors[t]};A.getNewElTabLi(e,i,r).appendTo(d),!l&&c&&A.getNewElTabPane(e,i,r).appendTo(b)}),a=s(d,n,r,f),a.appendTo(t),t.data({scrtabs:{tabs:o,propNames:i,ignoreTabPanes:l,hasTabContent:c,tabsLiContent:n.tabsLiContent,tabsPostProcessors:n.tabsPostProcessors,scroller:a}}),a.find(".nav-tabs > li").each(function(t){L.storeDataOnLiEl(e(this),o,t)}),t}function s(e,t,n,r){e.find('a[data-toggle="tab"]').removeData(T.DATA_KEY_BOOTSTRAP_TAB);var a=A.getNewElScrollerElementWrappingNavTabsInstance(e.clone(!0),t),i=new o(a),s=e.data("scrtabs");return s?s.scroller=a:e.data("scrtabs",{scroller:a}),e.replaceWith(a.css("visibility","hidden")),t.tabClickHandler&&"function"==typeof t.tabClickHandler&&(a.hasTabClickHandler=!0,i.tabClickHandler=t.tabClickHandler),a.initTabs=function(){i.initTabs(t,a,n,r)},a.scrollToActiveTab=function(){i.scrollToActiveTab(t)},a.initTabs(),C(a,i),a}function l(e){var t=e.updatedTabsArray,n=e.updatedTabsLiContent||[],r=e.updatedTabsPostProcessors||[],a=e.propNames,o=e.ignoreTabPanes,i=e.options,s=e.$currTabLis,l=e.$navTabs,c=o?null:e.$currTabContentPanesContainer,d=o?null:e.$currTabContentPanes,b=!1;return t.forEach(function(e,f){var C,v=s.find('a[href="#'+e[a.paneId]+'"]'),u=f>=s.length;v.length||(b=!0,i.tabLiContent=n[f],i.tabPostProcessor=r[f],v=A.getNewElTabLi(e,a,i),L.storeDataOnLiEl(v,t,f),u?v.appendTo(l):v.insertBefore(s.eq(f)),o||void 0===e[a.content]||(C=A.getNewElTabPane(e,a,i),u?C.appendTo(c):C.insertBefore(d.eq(f))))}),b}function c(e){var t=e.tabLi,n=e.ignoreTabPanes,r=t.$li,a=t.$contentPane,o=t.origTabData,i=t.newTabData,s=e.propNames,l=!1;return o[s.title]!==i[s.title]&&(r.find('a[role="tab"]').html(o[s.title]=i[s.title]),l=!0),o[s.disabled]!==i[s.disabled]&&(i[s.disabled]?(r.addClass("disabled"),r.find('a[role="tab"]').attr("data-toggle","")):(r.removeClass("disabled"),r.find('a[role="tab"]').attr("data-toggle","tab")),o[s.disabled]=i[s.disabled],l=!0),e.options.forceActiveTab&&(r[i[s.active]?"addClass":"removeClass"]("active"),a[i[s.active]?"addClass":"removeClass"]("active"),o[s.active]=i[s.active],l=!0),n||o[s.content]===i[s.content]||(a.html(o[s.content]=i[s.content]),l=!0),l}function d(e){var t,n=e.tabLi,r=e.ignoreTabPanes,a=n.$li;return-1===n.newIdx&&(a.hasClass("active")&&(t=L.getIndexOfClosestEnabledTab(e.$currTabLis,n.currDomIdx))>-1&&(e.$currTabLis.eq(t).addClass("active"),r||e.$currTabContentPanes.eq(t).addClass("active")),a.remove(),r||n.$contentPane.remove(),!0)}function b(t){var n=t.$currTabLis,r=t.updatedTabsArray,a=t.propNames,o=t.ignoreTabPanes,i=[],s=o?null:[];return!!L.didTabOrderChange(n,r,a)&&(r.forEach(function(t){var r=t[a.paneId];i.push(n.find('a[role="tab"][href="#'+r+'"]').parent("li")),o||s.push(e("#"+r))}),t.$navTabs.append(i),o||t.$currTabContentPanesContainer.append(s),!0)}function f(t){var n=t.$currTabLis,r=t.updatedTabsArray,a=t.propNames,o=!1;return n.each(function(n){var i=e(this),s=i.data("tab"),l=L.getTabIndexByPaneId(r,a.paneId,s[a.paneId]),b=l>-1?r[l]:null;if(t.tabLi={$li:i,currDomIdx:n,newIdx:l,$contentPane:A.getElTabPaneForLi(i),origTabData:s,newTabData:b},d(t))return void(o=!0);c(t)&&(o=!0)}),o}function C(t,n){function r(t){e(t.target).append(o.off(T.EVENTS.CLICK))}function a(r){function a(){var n=e(this),r=n.parent("li"),a=r.parent(".dropdown-menu"),o=n.attr("href");r.hasClass("active")||(t.find("li.active").not(c).add(a.find("li.active")).removeClass("active"),c.add(r).addClass("active"),e(".tab-content .tab-pane.active").removeClass("active"),e(o).addClass("active"))}var i,s,l,c=e(r.target),d=c.offset(),b=t.find('li[role="presentation"].active');o=c.find(".dropdown-menu").attr("data-"+T.DATA_KEY_DDMENU_MODIFIED,!0),b[0]!==c[0]&&o.find("li.active").removeClass("active"),o.on(T.EVENTS.CLICK,'a[role="tab"]',a),e("body").append(o),i=o.width()+d.left,s=t.width()-(n.$slideRightArrow.outerWidth()+1),l=d.left,i>s&&(l-=i-s),o.css({display:"block",top:d.top+c.outerHeight()-2,left:l})}var o;t.on(T.EVENTS.DROPDOWN_MENU_SHOW,a).on(T.EVENTS.DROPDOWN_MENU_HIDE,r)}function v(e,t){var n=e.data().scrtabs,r=n.scroller,a=e.find(".scrtabs-tab-container .nav-tabs"),o=e.find(".tab-content"),i=!1,s={options:t,updatedTabsArray:n.tabs,updatedTabsLiContent:n.tabsLiContent,updatedTabsPostProcessors:n.tabsPostProcessors,propNames:n.propNames,ignoreTabPanes:n.ignoreTabPanes,$navTabs:a,$currTabLis:a.find("> li"),$currTabContentPanesContainer:o,$currTabContentPanes:o.find(".tab-pane")};return l(s)&&(i=!0),b(s)&&(i=!0),f(s)&&(i=!0),i&&r.initTabs(),i}function u(t,n){t.data("scrtabs")&&(!t.data("scrtabs").isWrapperOnly&&v(t,n)||e("body").trigger(T.EVENTS.FORCE_REFRESH))}function h(){var t=e(this),n=t.data("scrtabs");n&&n.scroller.scrollToActiveTab()}function S(){var n,r=e(this),a=r.data("scrtabs");if(a){for("self"===a.enableSwipingElement?r.removeClass(T.CSS_CLASSES.ALLOW_SCROLLBAR):"parent"===a.enableSwipingElement&&r.closest(".scrtabs-tab-container").parent().removeClass(T.CSS_CLASSES.ALLOW_SCROLLBAR),a.scroller.off(T.EVENTS.DROPDOWN_MENU_SHOW).off(T.EVENTS.DROPDOWN_MENU_HIDE),a.scroller.find("[data-"+T.DATA_KEY_DDMENU_MODIFIED+"]").css({display:"",left:"",top:""}).off(T.EVENTS.CLICK).removeAttr("data-"+T.DATA_KEY_DDMENU_MODIFIED),a.scroller.hasTabClickHandler&&r.find('a[data-toggle="tab"]').off(".scrtabs"),a.isWrapperOnly?(n=r.parents(".scrtabs-tab-container"),n.length&&n.replaceWith(r)):(a.scroller&&a.scroller.initTabs&&(a.scroller.initTabs=null),r.find(".scrtabs-tab-container").add(".tab-content").remove()),r.removeData("scrtabs");--e.fn.scrollingTabs.nextInstanceId>=0;)e(t).off(T.EVENTS.WINDOW_RESIZE+e.fn.scrollingTabs.nextInstanceId);e("body").off(T.EVENTS.FORCE_REFRESH)}}var T={CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL:50,SCROLL_OFFSET_FRACTION:6,DATA_KEY_DDMENU_MODIFIED:"scrtabsddmenumodified",DATA_KEY_IS_MOUSEDOWN:"scrtabsismousedown",DATA_KEY_BOOTSTRAP_TAB:"bs.tab",CSS_CLASSES:{BOOTSTRAP4:"scrtabs-bootstrap4",RTL:"scrtabs-rtl",SCROLL_ARROW_CLICK_TARGET:"scrtabs-click-target",SCROLL_ARROW_DISABLE:"scrtabs-disable",SCROLL_ARROW_WITH_CLICK_TARGET:"scrtabs-with-click-target"},SLIDE_DIRECTION:{LEFT:1,RIGHT:2},EVENTS:{CLICK:"click.scrtabs",DROPDOWN_MENU_HIDE:"hide.bs.dropdown.scrtabs",DROPDOWN_MENU_SHOW:"show.bs.dropdown.scrtabs",FORCE_REFRESH:"forcerefresh.scrtabs",MOUSEDOWN:"mousedown.scrtabs",MOUSEUP:"mouseup.scrtabs",TABS_READY:"ready.scrtabs",TOUCH_END:"touchend.scrtabs",TOUCH_MOVE:"touchmove.scrtabs",TOUCH_START:"touchstart.scrtabs",WINDOW_RESIZE:"resize.scrtabs"}};!function(t){var n=function(e,t,n){var r;return function(){function a(){n||e.apply(o,i),r=null}var o=this,i=arguments;r?clearTimeout(r):n&&e.apply(o,i),r=setTimeout(a,t||100)}};e.fn[t]=function(e,r){var a=r||T.EVENTS.WINDOW_RESIZE;return e?this.bind(a,n(e)):this.trigger(t)}}("smartresizeScrtabs"),function(n){n.initElements=function(e){var t=this;t.setElementReferences(e),t.setEventListeners(e)},n.listenForTouchEvents=function(){var e,t,n,r=this,a=r.stc,o=a.scrollMovement,i=T.EVENTS,s=!1;a.$movableContainer.on(i.TOUCH_START,function(n){s=!0,t=a.movableContainerLeftPos,e=n.originalEvent.changedTouches[0].pageX}).on(i.TOUCH_END,function(){s=!1}).on(i.TOUCH_MOVE,function(r){if(s){var i=r.originalEvent.changedTouches[0].pageX,l=i-e;a.rtl&&(l=-l);var c;n=t+l,n>0?n=0:(c=o.getMinPos(),n li"),l.$slideLeftArrow=l.reverseScroll?r:a,l.$slideLeftArrowClickTarget=l.reverseScroll?o:i,l.$slideRightArrow=l.reverseScroll?a:r,l.$slideRightArrowClickTarget=l.reverseScroll?i:o,l.$scrollArrows=l.$slideLeftArrow.add(l.$slideRightArrow),l.$win=e(t)},n.setElementWidths=function(){var e=this,t=e.stc;t.winWidth=t.$win.width(),t.scrollArrowsCombinedWidth=t.$slideLeftArrow.outerWidth()+t.$slideRightArrow.outerWidth(),e.setFixedContainerWidth(),e.setMovableContainerWidth()},n.setEventListeners=function(t){var n=this,r=n.stc,a=r.eventHandlers,o=T.EVENTS,i=o.WINDOW_RESIZE+r.instanceId;t.enableSwiping&&n.listenForTouchEvents(),r.$slideLeftArrowClickTarget.off(".scrtabs").on(o.MOUSEDOWN,function(e){a.handleMousedownOnSlideMovContainerLeftArrow.call(a,e)}).on(o.MOUSEUP,function(e){a.handleMouseupOnSlideMovContainerLeftArrow.call(a,e)}).on(o.CLICK,function(e){a.handleClickOnSlideMovContainerLeftArrow.call(a,e)}),r.$slideRightArrowClickTarget.off(".scrtabs").on(o.MOUSEDOWN,function(e){a.handleMousedownOnSlideMovContainerRightArrow.call(a,e)}).on(o.MOUSEUP,function(e){a.handleMouseupOnSlideMovContainerRightArrow.call(a,e)}).on(o.CLICK,function(e){a.handleClickOnSlideMovContainerRightArrow.call(a,e)}),r.tabClickHandler&&r.$tabsLiCollection.find('a[data-toggle="tab"]').off(o.CLICK).on(o.CLICK,r.tabClickHandler),t.handleDelayedScrollbar&&n.listenForDelayedScrollbar(),r.$win.off(i).smartresizeScrtabs(function(e){a.handleWindowResize.call(a,e)},i),e("body").on(T.EVENTS.FORCE_REFRESH,r.elementsHandler.refreshAllElementSizes.bind(r.elementsHandler))},n.listenForDelayedScrollbar=function(){var n=document.createElement("iframe");n.id="scrtabs-scrollbar-resize-listener",n.style.cssText="height: 0; background-color: transparent; margin: 0; padding: 0; overflow: hidden; border-width: 0; position: absolute; width: 100%;",n.onload=function(){function r(){try{e(t).trigger("resize"),a=null}catch(e){}}var a;n.contentWindow.addEventListener("resize",function(){a&&clearTimeout(a),a=setTimeout(r,100)})},document.body.appendChild(n)},n.setFixedContainerWidth=function(){var e=this,t=e.stc,n=t.$tabsContainer.get(0).getBoundingClientRect();t.fixedContainerWidth=n.width||n.right-n.left,t.fixedContainerWidth=t.fixedContainerWidth*t.widthMultiplier,t.$fixedContainer.width(t.fixedContainerWidth)},n.setFixedContainerWidthForHiddenScrollArrows=function(){var e=this,t=e.stc;t.$fixedContainer.width(t.fixedContainerWidth)},n.setFixedContainerWidthForVisibleScrollArrows=function(){var e=this,t=e.stc;t.$fixedContainer.width(t.fixedContainerWidth-t.scrollArrowsCombinedWidth)},n.setMovableContainerWidth=function(){var t=this,n=t.stc,r=n.$tabsUl.find("> li");n.movableContainerWidth=0,r.length&&(r.each(function(){var t=e(this),r=0;n.isNavPills&&(r=parseInt(t.css("margin-left"),10)+parseInt(t.css("margin-right"),10)),n.movableContainerWidth+=t.outerWidth()+r}),n.movableContainerWidth+=1,n.movableContainerWidtht.fixedContainerWidth;n&&!t.scrollArrowsVisible?(t.$scrollArrows.show(),t.scrollArrowsVisible=!0):!n&&t.scrollArrowsVisible&&(t.$scrollArrows.hide(),t.scrollArrowsVisible=!1),t.scrollArrowsVisible?e.setFixedContainerWidthForVisibleScrollArrows():e.setFixedContainerWidthForHiddenScrollArrows()}}(n.prototype),function(e){e.handleClickOnSlideMovContainerLeftArrow=function(){this.stc.scrollMovement.incrementMovableContainerLeft()},e.handleClickOnSlideMovContainerRightArrow=function(){this.stc.scrollMovement.incrementMovableContainerRight()},e.handleMousedownOnSlideMovContainerLeftArrow=function(){var e=this,t=e.stc;t.$slideLeftArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN,!0),t.scrollMovement.continueSlideMovableContainerLeft()},e.handleMousedownOnSlideMovContainerRightArrow=function(){var e=this,t=e.stc;t.$slideRightArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN,!0),t.scrollMovement.continueSlideMovableContainerRight()},e.handleMouseupOnSlideMovContainerLeftArrow=function(){this.stc.$slideLeftArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN,!1)},e.handleMouseupOnSlideMovContainerRightArrow=function(){this.stc.$slideRightArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN,!1)},e.handleWindowResize=function(){var e=this,t=e.stc,n=t.$win.width();if(n===t.winWidth)return!1;t.winWidth=n,t.elementsHandler.refreshAllElementSizes()}}(r.prototype),function(t){t.continueSlideMovableContainerLeft=function(){var e=this,t=e.stc;setTimeout(function(){t.movableContainerLeftPos<=e.getMinPos()||!t.$slideLeftArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN)||e.incrementMovableContainerLeft()||e.continueSlideMovableContainerLeft()},T.CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL)},t.continueSlideMovableContainerRight=function(){var e=this,t=e.stc;setTimeout(function(){t.movableContainerLeftPos>=0||!t.$slideRightArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN)||e.incrementMovableContainerRight()||e.continueSlideMovableContainerRight()},T.CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL)},t.decrementMovableContainerLeftPos=function(e){var t=this,n=t.stc;n.movableContainerLeftPos-=n.fixedContainerWidth/T.SCROLL_OFFSET_FRACTION,n.movableContainerLeftPos0?n.movableContainerLeftPos=0:n.scrollToTabEdge&&t.setMovableContainerLeftPosToTabEdge(T.SLIDE_DIRECTION.RIGHT)),t.slideMovableContainerToLeftPos(),t.enableSlideLeftArrow(),0===n.movableContainerLeftPos},t.refreshScrollArrowsDisabledState=function(){var e=this,t=e.stc;if(t.disableScrollArrowsOnFullyScrolled&&t.scrollArrowsVisible){if(t.movableContainerLeftPos>=0)return e.disableSlideRightArrow(),void e.enableSlideLeftArrow();if(t.movableContainerLeftPos<=e.getMinPos())return e.disableSlideLeftArrow(),void e.enableSlideRightArrow();e.enableSlideLeftArrow(),e.enableSlideRightArrow()}},t.scrollToActiveTab=function(){var e,t,n,r,a,o,i,s,l,c=this,d=c.stc;if(d.scrollArrowsVisible&&(d.usingBootstrap4?(t=d.$tabsUl.find("li > .nav-link.active"),t.length&&(e=t.parent())):e=d.$tabsUl.find("li.active"),e&&e.length)){if(l=d.$slideRightArrow.outerWidth(),o=e.outerWidth(),n=e.offset().left-d.$fixedContainer.offset().left,r=n+o,a=d.fixedContainerWidth-l,d.rtl){if(d.$slideLeftArrow.outerWidth(),n<0)return d.movableContainerLeftPos+=n,c.slideMovableContainerToLeftPos(),!0;if(r>a)return d.movableContainerLeftPos+=r-a+2*l,c.slideMovableContainerToLeftPos(),!0}else{if(r>a)return i=r-a+l,s=d.fixedContainerWidth/2,i+=s-o/2,d.movableContainerLeftPos-=i,c.slideMovableContainerToLeftPos(),!0;if(d.$slideLeftArrow.outerWidth(),n<0)return s=d.fixedContainerWidth/2,d.movableContainerLeftPos+=-n+s-o/2,c.slideMovableContainerToLeftPos(),!0}return!1}},t.setMovableContainerLeftPosToTabEdge=function(t){var n=this,r=n.stc,a=-r.movableContainerLeftPos,o=0;r.$tabsLiCollection.each(function(){var n=e(this).width();if((o+=n)>a)return r.movableContainerLeftPos=t===T.SLIDE_DIRECTION.RIGHT?-(o-n):-o,!1})},t.slideMovableContainerToLeftPos=function(){var e,t=this,n=t.stc,r=t.getMinPos();n.movableContainerLeftPos>0?n.movableContainerLeftPos=0:n.movableContainerLeftPos')}function r(t,n){var r=e('
    '),a=n.leftArrowContent||'
    ',o=e(a),i=n.rightArrowContent||'
    ',s=e(i),l=e('
    '),c=e('
    ');return n.disableScrollArrowsOnFullyScrolled&&o.add(s).addClass(T.CSS_CLASSES.SCROLL_ARROW_DISABLE),r.append(o,l.append(c.append(t)),s)}function a(t,n){return e('').attr("href","#"+t[n.paneId]).html(t[n.title])}function o(){return e('
    ')}function i(t,n,r){var o=r.tabLiContent||'
  • ',i=e(o),s=a(t,n).appendTo(i);return t[n.disabled]?(i.addClass("disabled"),s.attr("data-toggle","")):r.forceActiveTab&&t[n.active]&&i.addClass("active"),r.tabPostProcessor&&r.tabPostProcessor(i,s),i}function s(t,n,r){var a=e('
    ').attr("id",t[n.paneId]).html(t[n.content]);return r.forceActiveTab&&t[n.active]&&a.addClass("active"),a}return{getElTabPaneForLi:t,getNewElNavTabs:n,getNewElScrollerElementWrappingNavTabsInstance:r,getNewElTabAnchor:a,getNewElTabContent:o,getNewElTabLi:i,getNewElTabPane:s}}(),L=function(){function t(t,n,a){var o=!1;return t.each(function(t){var i=r(n,a.paneId,e(this).data("tab")[a.paneId]);if(i>-1&&i!==t)return o=!0,!1}),o}function n(e,t){for(var n=e.length-1,r=-1,a=0,o=0;-1===r&&o>=0;)((o=t+ ++a)<=n&&!e.eq(o).hasClass("disabled")||(o=t-a)>=0&&!e.eq(o).hasClass("disabled"))&&(r=o);return r}function r(e,t,n){var r=-1;return e.some(function(e,a){if(e[t]===n)return r=a,!0}),r}function a(t,n,r){t.data({tab:e.extend({},n[r]),index:r})}return{didTabOrderChange:t,getIndexOfClosestEnabledTab:n,getTabIndexByPaneId:r,storeDataOnLiEl:a}}(),E={destroy:function(){return this.each(S)},init:function(t){var n=this,r=n.length-1,a=e.extend({},e.fn.scrollingTabs.defaults,t||{});return a.tabs?n.each(function(t){i(e(this),a,t span.select2-selection--single{ border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); +} + +#filterDropdown label{ + color: #333; } \ No newline at end of file diff --git a/view/css/main.css b/view/css/main.css index 15ebc05316..09c0b6b1c4 100644 --- a/view/css/main.css +++ b/view/css/main.css @@ -1,26 +1,28 @@ html, body { - height: 100vh; + height: 100vh; + transition: all 0.3s ease-in-out; } html { - scroll-behavior: smooth; + scroll-behavior: smooth; } body { - padding-top: 50px; + padding-top: 50px; } body.fullscreen { - padding: 0 !important; - margin: 0 !important; - overflow: hidden; + padding: 0 !important; + margin: 0 !important; + overflow: hidden; } .nopadding { - padding: 0 !important; - margin: 0 !important; + padding: 0 !important; + margin: 0 !important; } + /* .videoLink > .duration, time.duration{ @@ -35,25 +37,26 @@ time.duration{ } */ time.duration { - position: absolute; - background: rgba(0, 0, 0, 0.6)!important; - padding: 1px 4px; - color: #FFF; - top: 5px; - left: 5px; - font-size: 12px; - border-radius: 5px; - opacity: 0.8; - text-shadow: 1px 1px 4px #000; - z-index: 10; + position: absolute; + background: rgba(0, 0, 0, 0.6) !important; + padding: 1px 4px; + color: #FFF; + top: 5px; + left: 5px; + font-size: 12px; + border-radius: 5px; + opacity: 0.8; + text-shadow: 1px 1px 4px #000; + z-index: 10; } .thumbsImageContainer { - position: relative; + position: relative; } -.thumbsImageContainer .thumbsImage, #channelLive .thumbsImage { - border: none; +.thumbsImageContainer .thumbsImage, +#channelLive .thumbsImage { + border: none; position: absolute; top: 0; left: 0; @@ -63,1155 +66,1189 @@ time.duration { } .thumbsImageContainer .progress { - height: 5px; - z-index: 1; - top: -5px; - border-radius: unset; + height: 5px; + z-index: 1; + top: -5px; + border-radius: unset; } .videoLink .glyphicon-play-circle { - transition: all 0.3s ease-in-out; - top: 50%; - left: 50%; - margin: -25px 0 0 -25px; - position: absolute; - color: rgba(255, 255, 255, 0.3)!important; - font-size: 50px; + transition: all 0.3s ease-in-out; + top: 50%; + left: 50%; + margin: -25px 0 0 -25px; + position: absolute; + color: rgba(255, 255, 255, 0.3) !important; + font-size: 50px; } .gallery:hover .glyphicon-play-circle, .videoLink:hover .glyphicon-play-circle { - color: rgba(255, 255, 255, 0.6)!important; + color: rgba(255, 255, 255, 0.6) !important; } .bottom-border { - border-bottom: 2px solid #F2F2F2; - margin: 0; - padding: 5px; + border-bottom: 2px solid #F2F2F2; + margin: 0; + padding: 5px; } h1, h2, h3, h4 { - margin: 5px; - padding: 5px; + margin: 5px; + padding: 5px; } h1 { - font-size: 20px; + font-size: 20px; } h2 { - font-size: 18px; + font-size: 18px; } h3 { - font-size: 16px; + font-size: 16px; } h4 { - font-size: 14px; + font-size: 14px; } footer { - color: #AAA; - padding: 2px; - background-color: #F2F2F2; - border-top: 1px solid #DDD; - text-align: right; - margin: 0; - font-size: 0.8em; + color: #AAA; + padding: 2px; + background-color: #F2F2F2; + border-top: 1px solid #DDD; + text-align: right; + margin: 0; + font-size: 0.8em; } footer .btn-outline:hover, footer .btn-outline:focus, footer .btn-outline:active { - color: #888; - background: white; - border: solid 1px white; + color: #888; + background: white; + border: solid 1px white; } footer .btn-outline { - color: #AAA; - border: solid 1px #AAA; - background: transparent; - transition: all 0.3s ease-in-out; - margin: 0 2px; - font-size: 0.9em; + color: #AAA; + border: solid 1px #AAA; + background: transparent; + transition: all 0.3s ease-in-out; + margin: 0 2px; + font-size: 0.9em; } footer ul.list-inline { - justify-content: flex-end; - margin-bottom: 0; + justify-content: flex-end; + margin-bottom: 0; } footer ul.list-inline li { - justify-content: center; - align-items: center; - padding-right: 1px; - padding-left: 1px; - font-size: 0.8em; + justify-content: center; + align-items: center; + padding-right: 1px; + padding-left: 1px; + font-size: 0.8em; } /* for main video */ .video-content { - flex: 0 1 100%; - height: 50%; - display: flex; - justify-content: flex-start; + flex: 0 1 100%; + height: 50%; + display: flex; + justify-content: flex-start; } .main-video { - background-color: #000; - margin-bottom: 10px; + background-color: #000; + margin-bottom: 10px; } .main-video { - -webkit-transition: ease 1s; - /* Safari */ - transition: ease 1s; + -webkit-transition: ease 1s; + /* Safari */ + transition: ease 1s; } + /* to fix the click on mobile */ .rightBar div { - z-index: 10; + z-index: 10; } -#videosList, #videosList div { - z-index: 1; +#videosList, +#videosList div { + z-index: 1; } + /* end for main video */ .form-compact .form-control { - position: relative; - height: auto; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: 10px; - font-size: 16px; + position: relative; + height: auto; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 10px; + font-size: 16px; } .form-compact input.form-control { - border-radius: 0; + border-radius: 0; } .form-compact input.first, .form-compact select.first { - border-top-left-radius: 5px; - border-top-right-radius: 5px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; } .form-compact input.last, .form-compact select.last { - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; - margin-bottom: 10px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + margin-bottom: 10px; } .container-fluid { - margin: 0; - transition: width 0.3s, margin 0.3s; + margin: 0; + transition: width 0.3s, margin 0.3s; } -.panel, #mainNavBar, #sidebar, .swal-modal { - box-shadow: 0 1px 8px 0 rgb(0 0 0 / 8%); +.panel, +#mainNavBar, +#sidebar, +.swal-modal { + box-shadow: 0 1px 8px 0 rgb(0 0 0 / 8%); } #mainNavBar .dropdown-menu { - max-height: calc(100vh - 80px); - overflow: auto; + max-height: calc(100vh - 80px); + overflow: auto; } .panel { - margin-top: 10px; + margin-top: 10px; } @media (max-width: 767px) { - .navbar-form, #modeYoutubeBottomContent, .principalContainer, - .nopaddingOnSmall,.container-fluid,.container, #yptRightBar, - body > div.container-fluid.gallery > div { - padding: 0; - } - .panel-body, .tabbable-panel { - padding: 5px; - } + .navbar-form, + #modeYoutubeBottomContent, + .principalContainer, + .nopaddingOnSmall, + .container-fluid, + .container, + #yptRightBar, + body>div.container-fluid.gallery>div { + padding: 0; + } + + .panel-body, + .tabbable-panel { + padding: 5px; + } } @media (max-width: 450px) { - #captchaText, .captcha .input-group { - display: block; - } - .captcha .input-group-addon:first-child { - border-right: 1px solid rgb(204, 204, 204); - } + #captchaText, + .captcha .input-group { + display: block; + } + + .captcha .input-group-addon:first-child { + border-right: 1px solid rgb(204, 204, 204); + } } /* Comments */ .commenterName small { - font-family: verdana; - font-size: 0.9em; + font-family: verdana; + font-size: 0.9em; } .commenterName { - margin-right: 5px; + margin-right: 5px; } .commentText { - clear: both; + clear: both; } .commentDetails { - margin: 0 0 0 60px; + margin: 0 0 0 60px; } + /* End Comments */ /* Tabs panel */ .tabbable-panel { - padding: 10px; + padding: 10px; } /* Default mode */ -.tabbable-line > .nav-tabs { - border: none; - margin: 0px; +.tabbable-line>.nav-tabs { + border: none; + margin: 0px; } -.tabbable-line > .nav-tabs > li > a { - border: 0; - margin-right: 0; +.tabbable-line>.nav-tabs>li>a { + border: 0; + margin-right: 0; } -.tabbable-line > .nav-tabs > li.open > a, -.tabbable-line > .nav-tabs > li:hover > a { - border: 0; - background: none !important; +.tabbable-line>.nav-tabs>li.open>a, +.tabbable-line>.nav-tabs>li:hover>a { + border: 0; + background: none !important; } -.tabbable-line > .nav-tabs > li.open > a > i, -.tabbable-line > .nav-tabs > li:hover > a > i { - color: #a6a6a6; +.tabbable-line>.nav-tabs>li.open>a>i, +.tabbable-line>.nav-tabs>li:hover>a>i { + color: #a6a6a6; } -.tabbable-line > .nav-tabs > li.open .dropdown-menu, -.tabbable-line > .nav-tabs > li:hover .dropdown-menu { - margin-top: 0px; +.tabbable-line>.nav-tabs>li.open .dropdown-menu, +.tabbable-line>.nav-tabs>li:hover .dropdown-menu { + margin-top: 0px; } -.tabbable-line > .nav-tabs > li.active > a { - border: 0; - background: none !important; +.tabbable-line>.nav-tabs>li.active>a { + border: 0; + background: none !important; } -.tabbable-line > .nav-tabs > li.active > a > i { - color: #404040; +.tabbable-line>.nav-tabs>li.active>a>i { + color: #404040; } -.tabbable-line > .tab-content { - margin-top: -3px; - border: 0; - border-top: 1px solid #eee; - padding: 15px 0; +.tabbable-line>.tab-content { + margin-top: -3px; + border: 0; + border-top: 1px solid #eee; + padding: 15px 0; } -.tabbable-line > .nav-tabs>li:after { - content: ""; - background: #DDD; - height: 4px; - position: absolute; - width: 100%; - left: 0px; - bottom: 1px; +.tabbable-line>.nav-tabs>li:after { + content: ""; + background: #DDD; + height: 4px; + position: absolute; + width: 100%; + left: 0px; + bottom: 1px; } -.tabbable-line > .nav-tabs>li>a::after { - content: ""; - background: #f3565d; - height: 4px; - position: absolute; - width: 100%; - left: 0px; - bottom: 1px; - transition: all 250ms ease 0s; - transform: scale(0); - z-index: 1; +.tabbable-line>.nav-tabs>li>a::after { + content: ""; + background: #f3565d; + height: 4px; + position: absolute; + width: 100%; + left: 0px; + bottom: 1px; + transition: all 250ms ease 0s; + transform: scale(0); + z-index: 1; } -.tabbable-line > .nav-tabs>li:hover>a::after { - background: #F99; +.tabbable-line>.nav-tabs>li:hover>a::after { + background: #F99; } -.tabbable-line > .nav-tabs>li.active>a::after { - background: #f3565d; +.tabbable-line>.nav-tabs>li.active>a::after { + background: #f3565d; } -.tabbable-line > .nav-tabs > li.open, -.tabbable-line > .nav-tabs>li.active>a::after, -.tabbable-line > .nav-tabs>li:hover>a::after { - transform: scale(1); +.tabbable-line>.nav-tabs>li.open, +.tabbable-line>.nav-tabs>li.active>a::after, +.tabbable-line>.nav-tabs>li:hover>a::after { + transform: scale(1); } -.portlet .tabbable-line > .tab-content { - padding-bottom: 0; +.portlet .tabbable-line>.tab-content { + padding-bottom: 0; } + /* END Tabs panel */ .nowrapCell td { - white-space: normal !important; + white-space: normal !important; } .watch8-action-buttons { - padding: 5px 10px 0 10px; - margin: 5px 0 0 0; - border-top: 2px solid #F2F2F2; - clear: both; + padding: 5px 10px 0 10px; + margin: 5px 0 0 0; + border-top: 2px solid #F2F2F2; + clear: both; } .watch8-action-buttons .btn { - margin: 5px 2px; + margin: 5px 2px; } .bgWhite { - margin: 0 0 10px; - border: 0; - box-shadow: 0 1px 2px rgba(0, 0, 0, .1); - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: 10px; + margin: 0 0 10px; + border: 0; + box-shadow: 0 1px 2px rgba(0, 0, 0, .1); + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 10px; /*overflow: hidden;*/ - text-overflow: ellipsis; + text-overflow: ellipsis; } .ellipsis { - width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .no-outline { - border: 0 !important; - border-color: transparent !important; + border: 0 !important; + border-color: transparent !important; } #showMore { - padding: 20px; - margin: 10px; - border-top: 2px solid #F2F2F2; + padding: 20px; + margin: 10px; + border-top: 2px solid #F2F2F2; } .watch-view-count { - line-height: 24px; - max-height: 24px; - font-size: 19px; - white-space: nowrap; - margin: -5px; - padding: -5px; - border-bottom: 2px solid #167ac6; + line-height: 24px; + max-height: 24px; + font-size: 19px; + white-space: nowrap; + margin: -5px; + padding: -5px; + border-bottom: 2px solid #167ac6; } .myVote span, .myVote small { - color: #167ac6; + color: #167ac6; } + /* fancy checkbox */ -.material-switch > input[type="checkbox"] { - display: none; +.material-switch>input[type="checkbox"] { + display: none; } -.material-switch > label { - cursor: pointer; - height: 0px; - position: relative; - width: 40px; +.material-switch>label { + cursor: pointer; + height: 0px; + position: relative; + width: 40px; } -.material-switch > label::before { - background: rgb(0, 0, 0); - box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5); - border-radius: 8px; - content: ''; - height: 16px; - margin-top: -8px; - position: absolute; - opacity: 0.3; - transition: all 0.4s ease-in-out; - width: 40px; +.material-switch>label::before { + background: rgb(0, 0, 0); + box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5); + border-radius: 8px; + content: ''; + height: 16px; + margin-top: -8px; + position: absolute; + opacity: 0.3; + transition: all 0.4s ease-in-out; + width: 40px; } -.material-switch > label::after { - background: rgb(255, 255, 255); - border-radius: 16px; - box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3); - content: ''; - height: 24px; - left: -4px; - margin-top: -8px; - position: absolute; - top: -4px; - transition: all 0.3s ease-in-out; - width: 24px; +.material-switch>label::after { + background: rgb(255, 255, 255); + border-radius: 16px; + box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3); + content: ''; + height: 24px; + left: -4px; + margin-top: -8px; + position: absolute; + top: -4px; + transition: all 0.3s ease-in-out; + width: 24px; } -.material-switch > input[type="checkbox"]:checked + label::before { - background: inherit; - opacity: 0.5; +.material-switch>input[type="checkbox"]:checked+label::before { + background: inherit; + opacity: 0.5; } -.material-switch > input[type="checkbox"]:checked + label::after { - background: inherit; - left: 20px; +.material-switch>input[type="checkbox"]:checked+label::after { + background: inherit; + left: 20px; } /* fancy checkbox */ -.material-small.material-switch > input[type="checkbox"] { - display: none; +.material-small.material-switch>input[type="checkbox"] { + display: none; } -.material-small.material-switch > label { - width: 20px; - margin-right: 5px; +.material-small.material-switch>label { + width: 20px; + margin-right: 5px; } -.material-small.material-switch > label::before { - margin-top: -5px; - width: 20px; - height: 10px; +.material-small.material-switch>label::before { + margin-top: -5px; + width: 20px; + height: 10px; } -.material-small.material-switch > label::after { - margin-top: -4px; - width: 15px; - height: 15px; +.material-small.material-switch>label::after { + margin-top: -4px; + width: 15px; + height: 15px; } -.material-small.material-switch > input[type="checkbox"]:checked + label::after { - left: 10px; +.material-small.material-switch>input[type="checkbox"]:checked+label::after { + left: 10px; } /* fancy checkbox end */ .videosDetails .label { - border-radius: 0; + border-radius: 0; } -.videosDetails .label:first-child { - border-top-left-radius: 0.25em; - border-bottom-left-radius: 0.25em; +.videosDetails .label:first-child { + border-top-left-radius: 0.25em; + border-bottom-left-radius: 0.25em; } -.videosDetails .label:last-child { - border-top-right-radius: 0.25em; - border-bottom-right-radius: 0.25em; +.videosDetails .label:last-child { + border-top-right-radius: 0.25em; + border-bottom-right-radius: 0.25em; } .popover-content, .popover-title, .popover { - color: #333 !important; + color: #333 !important; } .videosDetails { - padding-left: 20px; + padding-left: 20px; } .autoplay span span { - margin: 0 5px; - font-weight: bold; + margin: 0 5px; + font-weight: bold; } img.rotate90, img.rotate-270 { - transform: rotate(90deg); - -ms-transform: rotate(90deg); + transform: rotate(90deg); + -ms-transform: rotate(90deg); /* IE 9 */ - -moz-transform: rotate(90deg); + -moz-transform: rotate(90deg); /* Firefox */ - -webkit-transform: rotate(90deg); + -webkit-transform: rotate(90deg); /* Safari and Chrome */ - -o-transform: rotate(90deg); - /* Opera */; + -o-transform: rotate(90deg); + /* Opera */ + ; } img.rotate180, img.rotate-180 { - transform: rotate(180deg); - -ms-transform: rotate(180deg); + transform: rotate(180deg); + -ms-transform: rotate(180deg); /* IE 9 */ - -moz-transform: rotate(180deg); + -moz-transform: rotate(180deg); /* Firefox */ - -webkit-transform: rotate(180deg); + -webkit-transform: rotate(180deg); /* Safari and Chrome */ - -o-transform: rotate(180deg); - /* Opera */; + -o-transform: rotate(180deg); + /* Opera */ + ; } img.rotate270, img.rotate-90 { - transform: rotate(270deg); - -ms-transform: rotate(270deg); + transform: rotate(270deg); + -ms-transform: rotate(270deg); /* IE 9 */ - -moz-transform: rotate(270deg); + -moz-transform: rotate(270deg); /* Firefox */ - -webkit-transform: rotate(270deg); + -webkit-transform: rotate(270deg); /* Safari and Chrome */ - -o-transform: rotate(270deg); - /* Opera */; + -o-transform: rotate(270deg); + /* Opera */ + ; } .notificationButton button { - display: none; - border-radius: 4px 0 0 4px !important; + display: none; + border-radius: 4px 0 0 4px !important; } .notificationButton button.subscribe { - border-radius: 4px !important; + border-radius: 4px !important; } .notificationButton button.notifyBtn { - border-radius: 0 4px 4px 0 !important; + border-radius: 0 4px 4px 0 !important; } .notificationButton.subscribed .doNotNotify, .notificationButton .subscribe { - display: inline-block !important; + display: inline-block !important; } .notificationButton.subscribed .subscribed, .notificationButton.subscribed.notify .doNotify { - display: inline-block !important; + display: inline-block !important; } .notificationButton.subscribed.notify .doNotNotify, .notificationButton.subscribed .subscribe { - display: none !important; + display: none !important; } .suggestBtn .btnText { - display: none; + display: none; } .suggestBtn.isNotSuggested .suggestText { - display: inline-block; + display: inline-block; } .suggestBtn.isSuggested .unsuggestText { - display: inline-block; + display: inline-block; } .profileBg { - padding: 20px; - height: 27vw; - min-height: 90px; - max-height: 300px; - margin: 10px 0; - -webkit-background-size: cover; - -moz-background-size: cover; - -o-background-size: cover; - background-size: cover; + padding: 20px; + height: 27vw; + min-height: 90px; + max-height: 300px; + margin: 10px 0; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; } #sidebar { - width: 300px; - position: absolute; - top: 0; - height: 100vh; - margin-top: 50px; + width: 300px; + position: absolute; + top: 0; + height: 100vh; + margin-top: 50px; } #sideBarContainer { - overflow: hidden; - position: absolute; - left: 0; - padding: 10px; - height: 100%; - width: 100%; - overflow-y: auto; - padding-right: 10px; + overflow: hidden; + position: absolute; + left: 0; + padding: 10px; + height: 100%; + width: 100%; + overflow-y: auto; + padding-right: 10px; } #sideBarContainer ul { - margin-bottom: 150px; + margin-bottom: 150px; } .navbar-brand { - padding: 0px; - /* firefox bug fix */ - margin-left: 10px; - height: auto; + padding: 0px; + /* firefox bug fix */ + margin-left: 10px; + height: auto; } .navbar-brand>img { - width: 178px; + width: 178px; } .list-inline { - display: flex; - justify-content: left; + display: flex; + justify-content: left; } /** header **/ nav ul.items-container { - display: flex; - justify-content: flex-end; - margin: 0px; - padding: 0px; + display: flex; + justify-content: flex-end; + margin: 0px; + padding: 0px; } nav ul.items-container .tooltip { - min-width: 150px; + min-width: 150px; } nav ul.items-container, nav ul.items-container li { - list-style: none; + list-style: none; } nav ul.items-container li:first-child { - flex: 1; - display: flex; + flex: 1; + display: flex; } nav ul.items-container li:first-child ul.left-side { - display: flex; - align-items: center; + display: flex; + align-items: center; } ul.left-side { - height: 50px; + height: 50px; } nav ul.items-container li ul.right-menus { - display: flex; - flex-direction: row; + display: flex; + flex-direction: row; } nav ul.items-container li ul.right-menus li { - margin-left: 5px; + margin-left: 5px; } nav ul.items-container li ul.right-menus li li { - margin-left: 0; + margin-left: 0; } .navbar-left { - padding-right: 0; + padding-right: 0; } + /** header **/ .navbar .container { - padding: 0 2px; - align-items: center; + padding: 0 2px; + align-items: center; } -.list-inline > li { - display: flex; +.list-inline>li { + display: flex; } .navbar .list-inline { - margin: 0; - display: flex; - align-items: center; + margin: 0; + display: flex; + align-items: center; } /* Play List */ .playlistList { - height: 80vh; - overflow: hidden; + height: 80vh; + overflow: hidden; } .playlistList .nav { - overflow-y: auto; - position: absolute; - top: 0; - height: 100%; - overflow-x: hidden; + overflow-y: auto; + position: absolute; + top: 0; + height: 100%; + overflow-x: hidden; } .playListIsLive .fas { - -webkit-animation: flash 2s ease infinite; - animation: flash 2s ease infinite; - color: red; + -webkit-animation: flash 2s ease infinite; + animation: flash 2s ease infinite; + color: red; } .playlist-nav .navbar { - padding: 0; - max-height: none; - margin: 0; + padding: 0; + max-height: none; + margin: 0; } .playlist-nav .navbar ul { - float: none; - display: block; + float: none; + display: block; } .playlist-nav .navbar li { - float: none; - display: block; + float: none; + display: block; } .playlist-nav .navbar li a { - padding-top: 12px; - padding-bottom: 12px; + padding-top: 12px; + padding-bottom: 12px; } + /* End Play List */ #videoContainer { - overflow: visible; - background: black; + overflow: visible; + background: black; } /** video manager progress bar */ .progress { - position: relative; - height: 25px; + position: relative; + height: 25px; } -.progress > .progress-type { - position: absolute; - left: 0px; - font-weight: 800; - padding: 3px 30px 2px 10px; - color: rgb(255, 255, 255); - background-color: rgba(25, 25, 25, 0.2); +.progress>.progress-type { + position: absolute; + left: 0px; + font-weight: 800; + padding: 3px 30px 2px 10px; + color: rgb(255, 255, 255); + background-color: rgba(25, 25, 25, 0.2); } -.progress > .progress-completed { - position: absolute; - right: 0px; - font-weight: 800; - padding: 3px 10px 2px; +.progress>.progress-completed { + position: absolute; + right: 0px; + font-weight: 800; + padding: 3px 10px 2px; } .loader { - border: 5px solid #f3f3f3; - /* Light grey */ - border-top: 5px solid #3498db; - /* Blue */ - border-radius: 50%; - width: 30px; - height: 30px; - animation: spin 2s linear infinite; + border: 5px solid #f3f3f3; + /* Light grey */ + border-top: 5px solid #3498db; + /* Blue */ + border-radius: 50%; + width: 30px; + height: 30px; + animation: spin 2s linear infinite; } .zoom { - -webkit-transition: all 0.35s ease-in-out; - -moz-transition: all 0.35s ease-in-out; - transition: all 0.35s ease-in-out; - cursor: -webkit-zoom-in; - cursor: -moz-zoom-in; - cursor: zoom-in; + -webkit-transition: all 0.35s ease-in-out; + -moz-transition: all 0.35s ease-in-out; + transition: all 0.35s ease-in-out; + cursor: -webkit-zoom-in; + cursor: -moz-zoom-in; + cursor: zoom-in; } .zoom:hover, .zoom:active, .zoom:focus { /**adjust scale to desired size, - add browser prefixes**/ - -ms-transform: scale(2.5); - -moz-transform: scale(2.5); - -webkit-transform: scale(2.5); - -o-transform: scale(2.5); - transform: scale(2.5); - position: relative; - z-index: 100; +add browser prefixes**/ + -ms-transform: scale(2.5); + -moz-transform: scale(2.5); + -webkit-transform: scale(2.5); + -o-transform: scale(2.5); + transform: scale(2.5); + position: relative; + z-index: 100; } @keyframes spin { - 0% { - transform: rotate(0deg); - } + 0% { + transform: rotate(0deg); + } - 100% { - transform: rotate(360deg); - } + 100% { + transform: rotate(360deg); + } } .navbar-collapse.in { - overflow-y: visible; - /* Bootstrap default is "auto" */; + overflow-y: visible; + /* Bootstrap default is "auto" */ + ; } .transparent { - opacity: 0.3; - filter: alpha(opacity=30); - /* For IE8 and earlier */; + opacity: 0.3; + filter: alpha(opacity=30); + /* For IE8 and earlier */ + ; } .principalContainer { - position: relative; + position: relative; } .vjs-button-fa-size { - font-size: 14px !important; + font-size: 14px !important; } -a.h6 h2, a.h6 h1 { - font-weight: bold; +a.h6 h2, +a.h6 h1 { + font-weight: bold; } img.blur { - filter: blur(5px); + filter: blur(5px); } -.navbar-default .navbar-default, .navbar-inverse .navbar-default { - border-width: 0; +.navbar-default .navbar-default, +.navbar-inverse .navbar-default { + border-width: 0; } /*Show play button only when paused*/ .vjs-paused .vjs-big-play-button, .vjs-paused.vjs-has-started .vjs-big-play-button { - display: block; + display: block; } .rightProfile li a { - text-align: left; + text-align: left; } .ima-controls-div { - pointer-events: none !important; + pointer-events: none !important; } .ima-controls-div div { - pointer-events: auto !important; + pointer-events: auto !important; } .btn-circle { - width: 32px; - height: 32px; - text-align: center; - padding: 6px 0; - font-size: 12px; - line-height: 1.42; - border-radius: 15px; + width: 32px; + height: 32px; + text-align: center; + padding: 6px 0; + font-size: 12px; + line-height: 1.42; + border-radius: 15px; } -.btn-circle:hover, .btn-group.open .btn-circle { - box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.05) inset, 0px 0px 8px rgba(82, 168, 236, 0.6); +.btn-circle:hover, +.btn-group.open .btn-circle { + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.05) inset, 0px 0px 8px rgba(82, 168, 236, 0.6); } ::-webkit-scrollbar-track { - -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); - border-radius: 4px; - background-color: rgba(100,100,100,0.01); + -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); + border-radius: 4px; + background-color: rgba(100, 100, 100, 0.01); } ::-webkit-scrollbar { - width: 12px; - height: 8px; - background-color: rgba(100,100,100,0.01); - overflow: hidden; + width: 12px; + height: 8px; + background-color: rgba(100, 100, 100, 0.01); + overflow: hidden; } ::-webkit-scrollbar-thumb { - border-radius: 4px; - -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); - background-color: rgba(100,100,100,0.05); + border-radius: 4px; + -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3); + background-color: rgba(100, 100, 100, 0.05); } .videoAdUiSkipContainer { - z-index: 99 !important; + z-index: 99 !important; } @media (min-width: 1200px) and (max-width: 1600px) { - .hidden-mdx { - display: none !important; - } + .hidden-mdx { + display: none !important; + } } .swal-noform .form-group { - display: none; + display: none; } #modeYoutubeBottomContentDetails { - overflow: hidden; + overflow: hidden; } #mainContainer { - overflow-x: hidden; + overflow-x: hidden; } .cursorPointer:hover { - cursor: pointer; - text-decoration: underline; + cursor: pointer; + text-decoration: underline; } .btn-dark { - color: #CCC; - background-color: #111; - border-color: #000; + color: #CCC; + background-color: #111; + border-color: #000; } .btn-dark:hover { - color: #FFF; - background-color: #000; - border-color: #000; + color: #FFF; + background-color: #000; + border-color: #000; } .opacityBtn { - opacity: 0.2; + opacity: 0.2; } -.btn-group.justified, .btn-group-justified { - display: flex; +.btn-group.justified, +.btn-group-justified { + display: flex; } -.btn-group-justified .btn, .justified .btn { - flex: 1; +.btn-group-justified .btn, +.justified .btn { + flex: 1; } .liveVideo .thumbsImage img { - width: 100%; + width: 100%; } #mainVideo_ima-ad-container, #mainVideo_ima-ad-container:after, #mainVideo_ima-ad-container:before { - font-size: 14px !important; - line-height: 1 !important; + font-size: 14px !important; + line-height: 1 !important; } #mainVideo_ima-ad-container .ima-play-pause-div, #mainVideo_ima-ad-container .ima-mute-div, #mainVideo_ima-ad-container .ima-slider-div, #mainVideo_ima-ad-container .ima-fullscreen-div { - font-size: 1.5em !important; - line-height: 2 !important; + font-size: 1.5em !important; + line-height: 2 !important; } #mainVideo_ima-controls-div { - max-height: 3.7em; + max-height: 3.7em; } -.vjs-menu-item, .vjs-menu-title { - margin: 0 !important; - padding: 0 !important; - border-radius: 0 !important; +.vjs-menu-item, +.vjs-menu-title { + margin: 0 !important; + padding: 0 !important; + border-radius: 0 !important; } .vjs-menu li { - text-transform: none; + text-transform: none; } #navBarFlag li { - cursor: pointer; + cursor: pointer; } .videoListItem { - overflow: hidden; - font-size: smaller; + overflow: hidden; + font-size: smaller; } .extraVideos:empty { - display: none; + display: none; } .list-group-horizontal .list-group-item { - display: inline-block; + display: inline-block; } .list-group-horizontal .list-group-item { - margin-bottom: 0; - margin-left: -4px; - margin-right: 0; - border-right-width: 0; + margin-bottom: 0; + margin-left: -4px; + margin-right: 0; + border-right-width: 0; } .list-group-horizontal .list-group-item:first-child { - border-top-right-radius: 0; - border-bottom-left-radius: 4px; + border-top-right-radius: 0; + border-bottom-left-radius: 4px; } .list-group-horizontal .list-group-item:last-child { - border-top-right-radius: 4px; - border-bottom-left-radius: 0; - border-right-width: 1px; + border-top-right-radius: 4px; + border-bottom-left-radius: 0; + border-right-width: 1px; } -#modeYoutubeTop, #mvideo, #videoContainer { - position: relative; +#modeYoutubeTop, +#mvideo, +#videoContainer { + position: relative; } #closeBtnFull { - opacity: 0.25; - filter: alpha(opacity=25); - -webkit-transition: opacity 0.25s ease-in-out; - -moz-transition: opacity 0.25s ease-in-out; - -ms-transition: opacity 0.25s ease-in-out; - -o-transition: opacity 0.25s ease-in-out; - transition: opacity 0.25s ease-in-out; - padding: 12px; - margin: 5px; - cursor: pointer; + opacity: 0.25; + filter: alpha(opacity=25); + -webkit-transition: opacity 0.25s ease-in-out; + -moz-transition: opacity 0.25s ease-in-out; + -ms-transition: opacity 0.25s ease-in-out; + -o-transition: opacity 0.25s ease-in-out; + transition: opacity 0.25s ease-in-out; + padding: 12px; + margin: 5px; + cursor: pointer; } #divTopBar:hover #closeBtnFull { - opacity: 1; - filter: alpha(opacity=100); + opacity: 1; + filter: alpha(opacity=100); } #closeBtnFull i { - text-shadow: 1px 1px rgba(255,255,255,0.7); + text-shadow: 1px 1px rgba(255, 255, 255, 0.7); } -li.dropdown-submenu > ul > li > a { - width: 100%; +li.dropdown-submenu>ul>li>a { + width: 100%; } .dropdown-menu.dropdown-menu-arrow:before { - position: absolute; - top: -7px; - right: 20px; - display: inline-block; - border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; - border-left: 7px solid transparent; - border-bottom-color: rgba(0, 0, 0, 0.2); - content: ''; + position: absolute; + top: -7px; + right: 20px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-left: 7px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; } .dropdown-menu.dropdown-menu-arrow:after { - position: absolute; - top: -6px; - right: 20px; - display: inline-block; - border-right: 6px solid transparent; - border-bottom: 6px solid #ffffff; - border-left: 6px solid transparent; - content: ''; + position: absolute; + top: -6px; + right: 20px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + border-left: 6px solid transparent; + content: ''; } -#topMenuUserNotifications > ul > div.list-group { - overflow-x: hidden; +#topMenuUserNotifications>ul>div.list-group { + overflow-x: hidden; } .socket_not_loading { - display: none; + display: none; } -.socket_connected .socket_loading_icon, .socket_disconnected .socket_loading_icon { - display: none; +.socket_connected .socket_loading_icon, +.socket_disconnected .socket_loading_icon { + display: none; } .socket_connected .socket_connected_icon { - display: block; + display: block; } .socket_disconnected .socket_disconnected_icon { - display: block; + display: block; } .socket_icon { - font-weight: bold; + font-weight: bold; } .socket_connected { - color: #FFF; - animation: socketGlow 1s infinite alternate; + color: #FFF; + animation: socketGlow 1s infinite alternate; } .socket_connected_icon { - color: #FFF; - animation: socketGlow 1s infinite alternate; + color: #FFF; + animation: socketGlow 1s infinite alternate; } .socket_loading_icon { - color: #FFF; - animation: socketGlowBlue 1s infinite alternate; + color: #FFF; + animation: socketGlowBlue 1s infinite alternate; } @keyframes socketGlow { - from { - color: #DFD; - text-shadow: 0 0 1px #050, + from { + color: #DFD; + text-shadow: 0 0 1px #050, 0 0 2px #070, 0 0 3px #670, 0 0 4px #670; - } + } - to { - color: #FFF; - text-shadow: 0 0 2px #020, + to { + color: #FFF; + text-shadow: 0 0 2px #020, 0 0 5px #090, 0 0 10px #0F0, 0 0 15px #BF0, 0 0 20px #B6FF00; - } + } } @keyframes socketGlowBlue { - from { - color: #DDF; - text-shadow: 0 0 1px #005, + from { + color: #DDF; + text-shadow: 0 0 1px #005, 0 0 2px #007, 0 0 3px #067, 0 0 4px #067; - } + } - to { - color: #FFF; - text-shadow: 0 0 2px #002, + to { + color: #FFF; + text-shadow: 0 0 2px #002, 0 0 5px #009, 0 0 10px #00F, 0 0 15px #0BF, 0 0 20px #00B6FF; - } + } } .glowText { - animation: socketGlow 1s infinite alternate; + animation: socketGlow 1s infinite alternate; } .glowTextBlue { - animation: socketGlowBlue 1s infinite alternate; + animation: socketGlowBlue 1s infinite alternate; } .glowBox { - animation: glowBox 1s infinite alternate; + animation: glowBox 1s infinite alternate; } @keyframes glowBox { - from { - color: #DFD; - box-shadow: 0 0 1px #050, + from { + color: #DFD; + box-shadow: 0 0 1px #050, 0 0 2px #070, 0 0 3px #670, 0 0 4px #670; - } + } - to { - color: #FFF; - box-shadow: 0 0 2px #020, + to { + color: #FFF; + box-shadow: 0 0 2px #020, 0 0 5px #090, 0 0 10px #0F0, 0 0 15px #BF0, 0 0 20px #B6FF00; - } + } } #extraVideos .liveVideo { - min-height: 170px; + min-height: 170px; } #extraVideos .liveVideo .thumbsImage img { - min-height: 90px; + min-height: 90px; } .thumbsImage .thumbsGIF { - display: none; + display: none; } .thumbsImage:hover .thumbsGIF { - display: block; + display: block; } .swal-modal.swal-modal-iframe { - width: calc(100% - 150px); - height: calc(100% - 150px); + width: calc(100% - 150px); + height: calc(100% - 150px); } .swal-modal.swal-modal-iframe .swal-content, @@ -1221,8 +1258,8 @@ li.dropdown-submenu > ul > li > a { .swal-modal.swal-modal-iframe-full .swal-content, .swal-modal.swal-modal-iframe-full-with-minimize .swal-content, .swal-modal.swal-modal-iframe-full-transparent .swal-content { - width: 100%; - height: 100%; + width: 100%; + height: 100%; } .swal-modal.swal-modal-iframe iframe, @@ -1232,664 +1269,689 @@ li.dropdown-submenu > ul > li > a { .swal-modal.swal-modal-iframe-full iframe, .swal-modal.swal-modal-iframe-full-with-minimize iframe, .swal-modal.swal-modal-iframe-full-transparent iframe { - width: 100%; - height: calc(100% - 50px); + width: 100%; + height: calc(100% - 50px); } #avideoModalIframeDiv { - display: none; - padding: 8px 10px; - padding-inline-start: 40px; + display: none; + padding: 8px 10px; + padding-inline-start: 40px; } .swal-modal-iframe-small { - width: 800px; - height: 600px; - max-width: 100%; - max-height: 100%; + width: 800px; + height: 600px; + max-width: 100%; + max-height: 100%; } .swal-modal-iframe-xsmall { - width: 640px; - height: 480px; - max-width: 100%; - max-height: 100%; + width: 640px; + height: 480px; + max-width: 100%; + max-height: 100%; } .swal-modal-iframe-large { - width: calc(100% - 50px); - height: calc(100% - 50px); - max-width: 100%; - max-height: 100%; + width: calc(100% - 50px); + height: calc(100% - 50px); + max-width: 100%; + max-height: 100%; } .swal-modal-iframe-full, .swal-modal-iframe-full-with-minimize, .swal-modal-iframe-full-transparent { - margin: 0; - position: fixed; - top: 0; - left: 0; - width: 100%; - height: calc(100% - 50px); - max-width: 100%; - max-height: 100%; + margin: 0; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: calc(100% - 50px); + max-width: 100%; + max-height: 100%; } .swal-modal.swal-modal-iframe-full iframe, .swal-modal.swal-modal-iframe-full-with-minimize iframe, .swal-modal.swal-modal-iframe-full-transparent iframe { - height: 100%; + height: 100%; } .swal-modal-iframe-full-transparent iframe, .swal-modal-iframe-full-transparent .swal-content, .swal-modal-iframe-full-transparent { - background-color: transparent; + background-color: transparent; } .swal-modal-iframe-full #avideoModalIframeDiv, .swal-modal-iframe-full-with-minimize #avideoModalIframeDiv, .swal-modal-iframe-full-transparent #avideoModalIframeDiv { - display: block; - margin: 0; + display: block; + margin: 0; } .swal-modal.swal-modal-iframe-large .swal-content, .swal-modal.swal-modal-iframe-full .swal-content, .swal-modal.swal-modal-iframe-full-with-minimize .swal-content, .swal-modal-iframe-full-transparent .swal-content { - padding: 0; - margin: 0; + padding: 0; + margin: 0; } .swal-modal-iframe-full-with-maximize-btn { - display: none; + display: none; } .swal-offline-video-compress #avideoModalIframeDiv { - padding-inline-start: 0; + padding-inline-start: 0; } .swal-offline-video-compress .swal-modal-iframe-full-with-minimize-btn { - display: none; + display: none; } .swal-offline-video-compress .swal-modal-iframe-full-with-maximize-btn { - display: inline-block; + display: inline-block; } .swal-offline-video-compress, .swal-offline-video-compress .swal-modal { - width: 300px; - height: 300px; - right: 0; - position: fixed; - bottom: 0; - top: auto; - left: auto; + width: 300px; + height: 300px; + right: 0; + position: fixed; + bottom: 0; + top: auto; + left: auto; } .swal-offline-video-compress .swal-modal-logo { - display: none; + display: none; } /* sm */ @media (max-width: 992px) { - .btn-group.justified.keepLabels span.hidden-sm, - .btn-group.justified.keepLabels span.hidden-xs { - display: block !important; - font-size: 0.8em; - white-space: normal; - } - .btn-group.justified.keepLabels.keepLabels span.hidden-xs { - display: block; - font-size: 0.7em; - } + .btn-group.justified.keepLabels span.hidden-sm, + .btn-group.justified.keepLabels span.hidden-xs { + display: block !important; + font-size: 0.8em; + white-space: normal; + } + + .btn-group.justified.keepLabels.keepLabels span.hidden-xs { + display: block; + font-size: 0.7em; + } } /* xs */ @media (max-width: 767px) { - .swal-modal.swal-modal-iframe { - width: calc(100% - 40px); - height: calc(100% - 50px); - } + .swal-modal.swal-modal-iframe { + width: calc(100% - 40px); + height: calc(100% - 50px); + } - #avideoModalIframeDiv { - padding-inline-start: 5px; - } + #avideoModalIframeDiv { + padding-inline-start: 5px; + } - button.hamburger { - display: flex !important; - } + button.hamburger { + display: flex !important; + } } .getChangeVideoStatusButton button { - display: none; + display: none; } .getChangeVideoStatusButton.status_i button.getChangeVideoStatusButton_i { - display: block; + display: block; } .getChangeVideoStatusButton.status_a button.getChangeVideoStatusButton_a { - display: block; + display: block; } .getChangeVideoStatusButton.status_u button.getChangeVideoStatusButton_u { - display: block; + display: block; } .getChangeVideoStatusButton.status_s button.getChangeVideoStatusButton_s { - display: block; + display: block; } .pleaseWaitDialog { - z-index: 19999; - background-color: #00000077; + z-index: 19999; + background-color: #00000077; } -.pleaseWaitDialog>div, .pleaseWaitDialog .progress, .pleaseWaitDialog h2 { - margin: 0; - position: absolute; - top: 50%; - -ms-transform: translateY(-50%); - transform: translateY(-50%); +.pleaseWaitDialog>div, +.pleaseWaitDialog .progress, +.pleaseWaitDialog h2 { + margin: 0; + position: absolute; + top: 50%; + -ms-transform: translateY(-50%); + transform: translateY(-50%); } .pleaseWaitDialog>div { - margin: -65px 0 0 -40px; - left: 50%; + margin: -65px 0 0 -40px; + left: 50%; } -.pleaseWaitDialog .progress, .pleaseWaitDialog h2 { - margin: 0 0 0 -50%; - width: 100%; - left: 50%; +.pleaseWaitDialog .progress, +.pleaseWaitDialog h2 { + margin: 0 0 0 -50%; + width: 100%; + left: 50%; } .pleaseWaitDialog .progress { - background-color: #FFFFFF77; + background-color: #FFFFFF77; } .pleaseWaitDialog h2 { - margin-top: 40px; - text-shadow: #000 1px 0 5px; - color: #FFF; - font-weight: bold; - z-index: 1; + margin-top: 40px; + text-shadow: #000 1px 0 5px; + color: #FFF; + font-weight: bold; + z-index: 1; } @media (min-width: 1200px) { - .pleaseWaitDialog .progress, .pleaseWaitDialog h2 { - margin: 0 0 0 -200px; - width: 400px; - left: 50%; - } - .playerFullHeight, .playerFullHeight video, .playerFullHeight audio, .playerFullHeight iframe, .playerFullHeight #mainVideo, .playerFullHeight #main-video { - width: 100%; - padding: 0; - } + .pleaseWaitDialog .progress, + .pleaseWaitDialog h2 { + margin: 0 0 0 -200px; + width: 400px; + left: 50%; + } - .ypt-is-expanded .playerFullHeight, .ypt-is-expanded .playerFullHeight video, .ypt-is-expanded .playerFullHeight audio, .ypt-is-expanded .playerFullHeight iframe, - .ypt-is-expanded .playerFullHeight #mainVideo, .ypt-is-expanded .playerFullHeight #main-video { - height: calc(100vh - 60px); - } + .playerFullHeight, + .playerFullHeight video, + .playerFullHeight audio, + .playerFullHeight iframe, + .playerFullHeight #mainVideo, + .playerFullHeight #main-video { + width: 100%; + padding: 0; + } - .playerFullHeight .floatVideo video, .playerFullHeight .floatVideo audio, .playerFullHeight .floatVideo iframe, .playerFullHeight .floatVideo #mainVideo, .playerFullHeight .floatVideo #main-video { - height: 300px; - } + .ypt-is-expanded .playerFullHeight, + .ypt-is-expanded .playerFullHeight video, + .ypt-is-expanded .playerFullHeight audio, + .ypt-is-expanded .playerFullHeight iframe, + .ypt-is-expanded .playerFullHeight #mainVideo, + .ypt-is-expanded .playerFullHeight #main-video, + .ypt-is-compressed .playerFullHeight #videoContainer, + .ypt-is-compressed .playerFullHeight #main-video { + height: calc(100vh - 60px); + } + + .playerFullHeight .floatVideo video, + .playerFullHeight .floatVideo audio, + .playerFullHeight .floatVideo iframe, + .playerFullHeight .floatVideo #mainVideo, + .playerFullHeight .floatVideo #main-video { + height: 300px; + } - .playerFullHeight .mainVideo { - padding: 0; - } + .playerFullHeight .mainVideo { + padding: 0; + } } .modal { - overflow: auto !important; -} - -.nav-tabs-horizontal { - display: -webkit-box; - display: -webkit-inline-box; -} - -.scrtabs-tab-container { - margin: 5px 0; -} - -.scrtabs-tab-scroll-arrow { - border-top: 1px solid #ddd; + overflow: auto !important; } .videoCreator { - display: inline-block; + display: inline-block; } .videoCreator .zoom { - width: 40px; - height: 40px; + width: 40px; + height: 40px; } .videoCreatorSmall .zoom { - width: 20px; - height: 20px; + width: 20px; + height: 20px; } .videoCreator>img, .videoCreator>a, .videoCreator>div { - margin: 2px 10px 2px 2px; + margin: 2px 10px 2px 2px; } -.videoCreator>img, .videoCreatorSmall img { - float: left; +.videoCreator>img, +.videoCreatorSmall img { + float: left; } .videoCreatorSmall img { - margin-right: 5px; + margin-right: 5px; } a:hover { - text-decoration: none; + text-decoration: none; } .descriptionArea .descriptionAreaPreContent { - max-height: 200px; - overflow: hidden; - transition: max-height 0.25s ease-out; - overflow: hidden; + max-height: 200px; + overflow: hidden; + transition: max-height 0.25s ease-out; + overflow: hidden; } .descriptionAreaPreContent { - margin-bottom: 10px; + margin-bottom: 10px; } .descriptionArea.expanded .descriptionAreaPreContent { - max-height: 1500px; - overflow: auto; - transition: max-height 0.25s ease-in; + max-height: 1500px; + overflow: auto; + transition: max-height 0.25s ease-in; } .descriptionAreaShowMoreBtn { - margin-top: -10px; + margin-top: -10px; } .descriptionArea .showMore { - display: block; + display: block; } .descriptionArea .showLess { - display: none; + display: none; } .descriptionArea.expanded .showMore { - display: none; + display: none; } .descriptionArea.expanded .showLess { - display: block; + display: block; } .infoDetails { - margin: 4px 0; + margin: 4px 0; } .avideoIframeIntoElement { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 1; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1; } /* hamburger menu styles*/ button.hamburger { - outline: none !important; - display: flex; - margin: 0 5px; - padding: 0 4px; + outline: none !important; + display: flex; + margin: 0 5px; + padding: 0 4px; } button.btn-sm.hamburger { - margin: -2px 5px; - padding: 0; + margin: -2px 5px; + padding: 0; } button.btn-sm.hamburger svg { - width: 24px; + width: 24px; } .ham { - cursor: pointer; - -webkit-tap-highlight-color: transparent; - transition: transform 400ms; - -moz-user-select: none; - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; + cursor: pointer; + -webkit-tap-highlight-color: transparent; + transition: transform 400ms; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; } .hamRotate.active { - transform: rotate(45deg); + transform: rotate(45deg); } .hamRotate180.active { - transform: rotate(180deg); + transform: rotate(180deg); } .line { - fill: none; - transition: stroke-dasharray 400ms, stroke-dashoffset 400ms; - stroke: #000; - stroke-width: 5.5; - stroke-linecap: round; + fill: none; + transition: stroke-dasharray 400ms, stroke-dashoffset 400ms; + stroke: #000; + stroke-width: 5.5; + stroke-linecap: round; } .ham1 .top { - stroke-dasharray: 40 139; + stroke-dasharray: 40 139; } .ham1 .bottom { - stroke-dasharray: 40 180; + stroke-dasharray: 40 180; } .ham1.active .top { - stroke-dashoffset: -98px; + stroke-dashoffset: -98px; } .ham1.active .bottom { - stroke-dashoffset: -138px; + stroke-dashoffset: -138px; } .ham2 .top { - stroke-dasharray: 40 121; + stroke-dasharray: 40 121; } .ham2 .bottom { - stroke-dasharray: 40 121; + stroke-dasharray: 40 121; } .ham2.active .top { - stroke-dashoffset: -102px; + stroke-dashoffset: -102px; } .ham2.active .bottom { - stroke-dashoffset: -102px; + stroke-dashoffset: -102px; } .ham3 .top { - stroke-dasharray: 40 130; + stroke-dasharray: 40 130; } .ham3 .middle { - stroke-dasharray: 40 140; + stroke-dasharray: 40 140; } .ham3 .bottom { - stroke-dasharray: 40 205; + stroke-dasharray: 40 205; } .ham3.active .top { - stroke-dasharray: 75 130; - stroke-dashoffset: -63px; + stroke-dasharray: 75 130; + stroke-dashoffset: -63px; } .ham3.active .middle { - stroke-dashoffset: -102px; + stroke-dashoffset: -102px; } .ham3.active .bottom { - stroke-dasharray: 110 205; - stroke-dashoffset: -86px; + stroke-dasharray: 110 205; + stroke-dashoffset: -86px; } .ham4 .top { - stroke-dasharray: 40 121; + stroke-dasharray: 40 121; } .ham4 .bottom { - stroke-dasharray: 40 121; + stroke-dasharray: 40 121; } .ham4.active .top { - stroke-dashoffset: -68px; + stroke-dashoffset: -68px; } .ham4.active .bottom { - stroke-dashoffset: -68px; + stroke-dashoffset: -68px; } .ham5 .top { - stroke-dasharray: 40 82; + stroke-dasharray: 40 82; } .ham5 .bottom { - stroke-dasharray: 40 82; + stroke-dasharray: 40 82; } .ham5.active .top { - stroke-dasharray: 14 82; - stroke-dashoffset: -72px; + stroke-dasharray: 14 82; + stroke-dashoffset: -72px; } .ham5.active .bottom { - stroke-dasharray: 14 82; - stroke-dashoffset: -72px; + stroke-dasharray: 14 82; + stroke-dashoffset: -72px; } .ham6 .top { - stroke-dasharray: 40 172; + stroke-dasharray: 40 172; } .ham6 .middle { - stroke-dasharray: 40 111; + stroke-dasharray: 40 111; } .ham6 .bottom { - stroke-dasharray: 40 172; + stroke-dasharray: 40 172; } .ham6.active .top { - stroke-dashoffset: -132px; + stroke-dashoffset: -132px; } .ham6.active .middle { - stroke-dashoffset: -71px; + stroke-dashoffset: -71px; } .ham6.active .bottom { - stroke-dashoffset: -132px; + stroke-dashoffset: -132px; } .ham7 .top { - stroke-dasharray: 40 82; + stroke-dasharray: 40 82; } .ham7 .middle { - stroke-dasharray: 40 111; + stroke-dasharray: 40 111; } .ham7 .bottom { - stroke-dasharray: 40 161; + stroke-dasharray: 40 161; } .ham7.active .top { - stroke-dasharray: 17 82; - stroke-dashoffset: -62px; + stroke-dasharray: 17 82; + stroke-dashoffset: -62px; } .ham7.active .middle { - stroke-dashoffset: 23px; + stroke-dashoffset: 23px; } .ham7.active .bottom { - stroke-dashoffset: -83px; + stroke-dashoffset: -83px; } .ham8 .top { - stroke-dasharray: 40 160; + stroke-dasharray: 40 160; } .ham8 .middle { - stroke-dasharray: 40 142; - transform-origin: 50%; - transition: transform 400ms; + stroke-dasharray: 40 142; + transform-origin: 50%; + transition: transform 400ms; } .ham8 .bottom { - stroke-dasharray: 40 85; - transform-origin: 50%; - transition: transform 400ms, stroke-dashoffset 400ms; + stroke-dasharray: 40 85; + transform-origin: 50%; + transition: transform 400ms, stroke-dashoffset 400ms; } .ham8.active .top { - stroke-dashoffset: -64px; + stroke-dashoffset: -64px; } .ham8.active .middle { - transform: rotate(90deg); + transform: rotate(90deg); } .ham8.active .bottom { - stroke-dashoffset: -64px; + stroke-dashoffset: -64px; } .users_id_online_label .label { - padding: 5px; - border-radius: 5px !important; + padding: 5px; + border-radius: 5px !important; } .users_id_online_label .label-success, .users_id_online_label .callerButton { - display: none; + display: none; } .users_id_online_label .label-success:hover { - animation: glowBox 1s infinite alternate; + animation: glowBox 1s infinite alternate; } .users_id_online_label.online .label-success, .users_id_online_label.online .callerButton { - display: inline; + display: inline; } .users_id_online_label.online .label-danger { - display: none; + display: none; } .align-center { - display: flex; - justify-content: center; - align-items: center; + display: flex; + justify-content: center; + align-items: center; } .loading-background { - --border-width: 3px; - border-radius: var(--border-width); + --border-width: 3px; + border-radius: var(--border-width); } .loading-background::after { - position: absolute; - content: ""; - top: calc(-1 * var(--border-width)); - left: calc(-1 * var(--border-width)); - z-index: -1; - width: calc(100% + var(--border-width) * 2); - height: calc(100% + var(--border-width) * 2); - background: linear-gradient(60deg, #555, #777, #999, #AAA, #BBB, #CCC, #DDD, #FFF); - background-size: 300% 300%; - background-position: 0 50%; - border-radius: calc(2 * var(--border-width)); - animation: moveGradient 4s ease-in-out infinite; + position: absolute; + content: ""; + top: calc(-1 * var(--border-width)); + left: calc(-1 * var(--border-width)); + z-index: -1; + width: calc(100% + var(--border-width) * 2); + height: calc(100% + var(--border-width) * 2); + background: linear-gradient(60deg, #555, #777, #999, #AAA, #BBB, #CCC, #DDD, #FFF); + background-size: 300% 300%; + background-position: 0 50%; + border-radius: calc(2 * var(--border-width)); + animation: moveGradient 4s ease-in-out infinite; } .SeoTags { - margin: 15px 0; + margin: 15px 0; } -.SeoTags h1, .SeoTags h2 { - margin: 10px 0; - padding: 0; +.SeoTags h1, +.SeoTags h2 { + margin: 10px 0; + padding: 0; } .SeoTags h1 { - font-weight: bold; + font-weight: bold; } .SeoTags h2 { - font-size: 1em; + font-size: 1em; } -.ypt-article{ +.ypt-article { padding: 15px 20px; } @keyframes moveGradient { - 50% { - background-position: 100% 50%; - } + 50% { + background-position: 100% 50%; + } } -.bootgrid-footer ul.pagination > li { - cursor: pointer; +.bootgrid-footer ul.pagination>li { + cursor: pointer; } .subCategoryName { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - font-weight: bold; - border-radius: 15px; - background-color: #000000DD; - color: white; - position: absolute; - margin-left: 10%; - width: 80% !important; - bottom: 40% !important; - opacity: 0.8 !important; - text-align: center; - padding: 5px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-weight: bold; + border-radius: 15px; + background-color: #000000DD; + color: white; + position: absolute; + margin-left: 10%; + width: 80% !important; + bottom: 40% !important; + opacity: 0.8 !important; + text-align: center; + padding: 5px; } .mainArea .galleryVideo { - margin-bottom: 3em; + margin-bottom: 3em; } .ui-menu .ui-menu-item { - display: grid; + display: grid; } .labelUpperCase { - text-transform: uppercase; + text-transform: uppercase; } -.live-icon::before{ - content: "\1f534"; /* insert the high voltage sign */ - animation: glow 1s ease-in-out infinite alternate, flash 1s infinite; /* animate the glow and flash */ - +.live-icon::before { + content: "\1f534"; + /* insert the high voltage sign */ + animation: glow 1s ease-in-out infinite alternate, flash 1s infinite; + /* animate the glow and flash */ + } - @keyframes glow { - from { - text-shadow: 0 0 10px rgba(255, 0, 0, 0.096); - } - to { - text-shadow: 0 0 20px #f00; - } - } - - @keyframes flash { - 0% { - opacity: 1; - } - 50% { - opacity: 0; - } - 100% { - opacity: 1; - } - } \ No newline at end of file +@keyframes glow { + from { + text-shadow: 0 0 10px rgba(255, 0, 0, 0.096); + } + + to { + text-shadow: 0 0 20px #f00; + } +} + +@keyframes flash { + 0% { + opacity: 1; + } + + 50% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +.HorizontalFlickity .btn { + border-radius: 32px; + margin: 5px 2px; +} + +.HorizontalFlickity .flickity-button { + width: 22px; + height: 22px; +} \ No newline at end of file diff --git a/view/css/navbar.css b/view/css/navbar.css index 2161ec74f5..e8cd60a425 100644 --- a/view/css/navbar.css +++ b/view/css/navbar.css @@ -219,7 +219,7 @@ li.navsub-toggle a + ul { @media screen and (min-width: 992px) { - body.youtube>div.container-fluid{ + body.youtube{ margin-left: 300px; } body.youtube div.container-fluid .col-sm-10.col-sm-offset-1.list-group-item{ diff --git a/view/include/footer.php b/view/include/footer.php index 6048d1914c..bafe19fa9d 100644 --- a/view/include/footer.php +++ b/view/include/footer.php @@ -78,7 +78,6 @@ $jsFiles[] = "view/js/webui-popover/jquery.webui-popover.min.js"; $jsFiles[] = "view/js/bootstrap-list-filter/bootstrap-list-filter.min.js"; $jsFiles[] = "node_modules/js-cookie/dist/js.cookie.js"; $jsFiles[] = "node_modules/jquery-toast-plugin/dist/jquery.toast.min.js"; -$jsFiles[] = "view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.min.js"; $jsFiles[] = "view/js/BootstrapMenu.min.js"; $jsFiles = array_merge($jsFiles, AVideoPlugin::getJSFiles()); diff --git a/view/include/head.php b/view/include/head.php index 03259d3ac5..38dd1b9307 100644 --- a/view/include/head.php +++ b/view/include/head.php @@ -94,7 +94,6 @@ if (!isBot()) { ?> - diff --git a/view/js/addView.js b/view/js/addView.js index f6ca6b50ed..507800e1c6 100644 --- a/view/js/addView.js +++ b/view/js/addView.js @@ -1,11 +1,31 @@ var last_videos_id = 0; var last_currentTime = -1; var videoViewAdded = false; -var addViewBeaconTimeout; var _addViewCheck = false; +var isVideoPlaying = false; +// Create an encapsulation for seconds_watching_video +var VideoWatchTime = (function () { + var seconds_watching_video = 0; + + return { + increment: function() { + if (isVideoPlaying) { + seconds_watching_video++; + } + }, + reset: function() { + seconds_watching_video = 0; + }, + getValue: function() { + return seconds_watching_video; + } + }; +})(); + +// Modify the addView function function addView(videos_id, currentTime) { - addViewSetCookie(PHPSESSID, videos_id, currentTime, seconds_watching_video); + addViewSetCookie(PHPSESSID, videos_id, currentTime, VideoWatchTime.getValue()); if (_addViewCheck) { return false; @@ -15,15 +35,12 @@ function addView(videos_id, currentTime) { return false; } - if (currentTime > 5 && currentTime % 30 !== 0) { // only update each 30 seconds - return false; - } - + // Removed the currentTime condition _addViewCheck = true; last_videos_id = videos_id; last_currentTime = currentTime; - _addView(videos_id, currentTime, seconds_watching_video); + _addView(videos_id, currentTime, VideoWatchTime.getValue()); setTimeout(function() { _addViewCheck = false; @@ -41,7 +58,6 @@ function _addView(videos_id, currentTime, seconds_watching_video) { } console.log('_addView 2', videos_id, currentTime, seconds_watching_video); - isVideoAddViewCount = true; if (typeof PHPSESSID === 'undefined') { PHPSESSID = ''; @@ -52,23 +68,29 @@ function _addView(videos_id, currentTime, seconds_watching_video) { if (empty(PHPSESSID)) { return false; } - + + isVideoAddViewCount = true; console.log('_addView 3', videos_id, currentTime, seconds_watching_video); url = addGetParam(url, 'PHPSESSID', PHPSESSID); - + // reset seconds_watching_video + var seconds_watching_video_to_send = seconds_watching_video; + VideoWatchTime.reset(); + //console.trace(); $.ajax({ url: url, method: 'POST', data: { id: videos_id, currentTime: currentTime, - seconds_watching_video: seconds_watching_video + seconds_watching_video: seconds_watching_video_to_send }, success: function(response) { console.log('_addView 4', response); - isVideoAddViewCount = false; $('.view-count' + videos_id).text(response.countHTML); PHPSESSID = response.session_id; + }, complete: function(response) { + console.log('_addView 5', response); + isVideoAddViewCount = false; } }); } @@ -122,6 +144,49 @@ async function addViewSetCookie(PHPSESSID, videos_id, playerCurrentTime, seconds Cookies.set('addView_seconds_watching_video', seconds_watching_video, { path: '/', expires: 1 }); } -$(document).ready(function() { +async function startAddViewCountInPlayer(){ + if(typeof player !== 'undefined' && typeof mediaId !== 'undefined'){ + player.on('play', function () { + isVideoPlaying = true; + addView(mediaId, this.currentTime()); + }); + player.on('pause', function () { + isVideoPlaying = false; + var time = Math.round(this.currentTime()); + addView(mediaId, time); + }); + player.on('ended', function () { + isVideoPlaying = false; + var time = Math.round(this.currentTime()); + addView(mediaId, time); + }); + + player.on('timeupdate', function() { + var time = Math.round(this.currentTime()); + if (time === 0 || time % 30 === 0) { + addView(mediaId, time); + } + }); + } else { + setTimeout(function() { + startAddViewCountInPlayer(); + }, 5000); + } +} + +// Add beforeunload event +window.addEventListener('beforeunload', (event) => { addViewFromCookie(); }); + +$(document).ready(function() { + // Use setInterval to update seconds_watching_video every second + setInterval(function () { + VideoWatchTime.increment(); + }, 1000); + + // Call addViewFromCookie on the next page load + addViewFromCookie(); + + startAddViewCountInPlayer(); +}); \ No newline at end of file diff --git a/view/js/navbarLogged.js b/view/js/navbarLogged.js index e4d4bc409f..a9f9a3a56b 100644 --- a/view/js/navbarLogged.js +++ b/view/js/navbarLogged.js @@ -125,8 +125,6 @@ async function openLeftMenu() { closeRightMenu(); closeSearchMenu(); } - var selector = '#buttonMenu svg'; - $(selector).addClass('active'); YPTSidebarOpen(); } @@ -213,6 +211,8 @@ function YPTSidebarIsOpen() { return $('body').hasClass('youtube'); } async function YPTSidebarOpen() { + var selector = '#buttonMenu svg'; + $(selector).addClass('active'); $("#sidebar").removeClass('animate__bounceOutLeft'); $("#sidebar").show(); $("#sidebar").addClass('animate__animated animate__bounceInLeft'); diff --git a/view/js/script.js b/view/js/script.js index 82ffaa7858..799e1f9757 100644 --- a/view/js/script.js +++ b/view/js/script.js @@ -266,8 +266,6 @@ async function lazyImage() { } var pauseIfIsPlayinAdsInterval; -var seconds_watching_video = 0; -var _startCountPlayingTime; async function setPlayerListners() { if (typeof player !== 'undefined') { player.on('pause', function () { @@ -275,7 +273,6 @@ async function setPlayerListners() { //console.log("setPlayerListners: pause"); //userIsControling = true; clearInterval(pauseIfIsPlayinAdsInterval); - clearInterval(_startCountPlayingTime); }); player.on('play', function () { isTryingToPlay = false; @@ -291,10 +288,6 @@ async function setPlayerListners() { pauseIfIsPlayinAdsInterval = setInterval(function () { pauseIfIsPlayinAds(); }, 500); - clearInterval(_startCountPlayingTime); - _startCountPlayingTime = setInterval(function () { - seconds_watching_video++; - }, 1000); }); $("#mainVideo .vjs-mute-control").click(function () { Cookies.set('muted', player.muted(), { @@ -849,7 +842,11 @@ function playNext(url) { }, 1000); } else if (isPlayNextEnabled()) { modal.showPleaseWait(); - if (typeof autoPlayAjax == 'undefined' || !autoPlayAjax) { + if (window.parent && typeof window.parent.playNextShorts === 'function') { + // Function exists, send a message to call it + console.log(" window.parent.postMessage(playNextShorts "); + window.parent.postMessage('playNextShorts', '*'); + } else if (typeof autoPlayAjax == 'undefined' || !autoPlayAjax) { //console.log("playNext changing location " + url); document.location = url; } else { @@ -2832,17 +2829,6 @@ $(document).ready(function () { expires: 365 }); tabsCategoryDocumentHeight = $(document).height(); - if (typeof $('.nav-tabs-horizontal').scrollingTabs == 'function') { - $('.nav-tabs-horizontal').scrollingTabs(); - //$('.nav-tabs-horizontal').fadeIn(); - } - setInterval(function () { - if (tabsCategoryDocumentHeightChanged()) { - if (typeof $('.nav-tabs-horizontal').scrollingTabs == 'function') { - $('.nav-tabs-horizontal').scrollingTabs('refresh'); - } - } - }, 2000); modal = getPleaseWait(); try { $('[data-toggle="popover"]').popover(); diff --git a/view/managerUsers_body.php b/view/managerUsers_body.php index fe35792a4a..b4205c0f41 100644 --- a/view/managerUsers_body.php +++ b/view/managerUsers_body.php @@ -14,9 +14,11 @@ foreach ($userGroups as $value) { $users_tabs[] = ['selector' => 'userGroupGrid' . $value['id'], 'queryString' => '?status=a&user_groups_id=' . $value['id'], 'icon' => 'fas fa-users', 'title' => $value['group_name'], 'active' => '', 'userGroupID' => $value['id']]; } ?> + +
    -
    +
    @@ -34,30 +36,27 @@ foreach ($userGroups as $value) {
    - + " . __($value['title']); + $items[] = array('href' => "#{$value['selector']}Tab", 'tooltip' => __($value['title']), 'onclick' => "startUserGrid('#{$value['selector']}', '{$value['queryString']}', " . intval($value['userGroupID']) . ");", 'label' => $label); + } + generateHorizontalFlickity($items); + ?>
    + ?>
    + ?>
    - @@ -78,17 +77,17 @@ foreach ($userGroups as $value) { - - - - - + + + + +
    -
    @@ -104,28 +103,28 @@ foreach ($userGroups as $value) {
  • - +
  • - +
  • - +
  • - +
  • - +
  • - +
  • @@ -197,22 +196,22 @@ foreach ($userGroups as $value) { @@ -240,7 +239,7 @@ foreach ($userGroups as $value) {
    - +
    @@ -250,7 +249,7 @@ foreach ($userGroups as $value) {
    - +
    @@ -260,7 +259,7 @@ foreach ($userGroups as $value) {
    - +
    @@ -270,7 +269,7 @@ foreach ($userGroups as $value) {
    - +
    @@ -280,7 +279,7 @@ foreach ($userGroups as $value) {
    - +
    @@ -289,7 +288,7 @@ foreach ($userGroups as $value) {
    - +
    @@ -298,7 +297,7 @@ foreach ($userGroups as $value) {
    - +
    @@ -307,7 +306,7 @@ foreach ($userGroups as $value) {
    - +
    @@ -317,6 +316,8 @@ foreach ($userGroups as $value) { + + + \ No newline at end of file diff --git a/view/modeYoutubeTop.php b/view/modeYoutubeTop.php index e8146b7e4f..809261afb8 100644 --- a/view/modeYoutubeTop.php +++ b/view/modeYoutubeTop.php @@ -13,7 +13,11 @@ "; + echo ""; + } ?>