From e08269c9c2f634883cbc4cd53bcc0867a56fe384 Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Wed, 2 Oct 2024 13:37:18 -0300 Subject: [PATCH] Add help on videos manager --- view/js/script.js | 17 ++- view/managerVideos_body.help.json | 107 +++++++++++++++ view/managerVideos_body.php | 216 +++++++++++++----------------- 3 files changed, 213 insertions(+), 127 deletions(-) create mode 100644 view/managerVideos_body.help.json diff --git a/view/js/script.js b/view/js/script.js index decffe8fa0..b09ab6ab69 100644 --- a/view/js/script.js +++ b/view/js/script.js @@ -2998,7 +2998,7 @@ $(document).ready(function () { var innerDiv = $(this).find("div.hidden"); avideoAlertInfo(innerDiv.html()); }); - + setInterval(function () { TotalPageLoadSeconds++; }, 1000); @@ -4358,9 +4358,16 @@ function startTour(stepsFileRelativePath) { success: function (response) { // Initialize the tour with the fetched data var tour = introJs(); - tour.setOptions({ - steps: response + var filteredSteps = $.grep(response, function (step) { + var $element = $(step.element); + // Only include steps where the element exists and is fully visible (not in a hidden parent) + return $element.length > 0 && isElementVisible($element); }); + + tour.setOptions({ + steps: filteredSteps + }); + tour.start(); }, error: function (xhr, status, error) { @@ -4368,6 +4375,10 @@ function startTour(stepsFileRelativePath) { } }); } + function isElementVisible($element) { + // Check if the element itself and its parent chain are visible + return $element.is(':visible') && $element.closest(':hidden').length === 0; + } } function findIndex(value, array) { diff --git a/view/managerVideos_body.help.json b/view/managerVideos_body.help.json new file mode 100644 index 0000000000..5925a8111c --- /dev/null +++ b/view/managerVideos_body.help.json @@ -0,0 +1,107 @@ +[ + { + "element": "#userGroupsButton", + "intro": "This button allows you to manage User Groups in your platform.", + "position": "bottom" + }, + { + "element": "#usersButton", + "intro": "This button provides access to the Users management page.", + "position": "bottom" + }, + { + "element": "#videoChartButton", + "intro": "Use this button to view the Video Chart statistics.", + "position": "bottom" + }, + { + "element": "#advertisingManagerButton", + "intro": "This button opens the Advertising Manager for managing ads on your platform.", + "position": "bottom" + }, + { + "element": "#encodeVideoButton", + "intro": "Click here to encode video and audio using the encoding service.", + "position": "bottom" + }, + { + "element": "#uploadMp4Button", + "intro": "This button lets you upload files directly without encoding, including formats like pdf, images, zip, mp4, and mp3.", + "position": "bottom" + }, + { + "element": "#embedVideoLinkButton", + "intro": "Use this button to embed a video link from external sources.", + "position": "bottom" + }, + { + "element": "#addArticleButton", + "intro": "Click here to add a new article to your platform.", + "position": "bottom" + }, + { + "element": "#sortVideosButton", + "intro": "This button allows you to sort your videos for better organization.", + "position": "bottom" + }, + { + "element": "#checkBtn", + "intro": "This button allows you to select or deselect all videos in the grid manager.", + "position": "bottom" + }, + { + "element": "#statusBtnGroup", + "intro": "Here you can change the status of the selected videos to Active, Inactive, Unlisted, or Unpublished.", + "position": "bottom" + }, + { + "element": "#addUserGroupBtnGroup", + "intro": "This option allows you to add the selected videos to a specific user group for controlled access.", + "position": "bottom" + }, + { + "element": "#removeUserGroupBtnGroup", + "intro": "This option allows you to remove the selected videos from a specific user group.", + "position": "bottom" + }, + { + "element": "#swapBtn", + "intro": "Use this button to swap the video file for another one while keeping the current video metadata.", + "position": "bottom" + }, + { + "element": "#updateAllUsage", + "intro": "Click here to update the disk usage for all videos, providing updated storage statistics.", + "position": "bottom" + }, + { + "element": "#deleteBtn", + "intro": "This button allows you to delete the selected videos from the system.", + "position": "bottom" + }, + { + "element": "#filterButtonsVideoManagerCategory", + "intro": "Use this dropdown to filter videos by categories. You can search and select the category you want to filter.", + "position": "bottom" + }, + { + "element": "#filterButtonsVideoManager", + "intro": "Filter videos by status such as Active, Inactive, Encoding, and more.", + "position": "bottom" + }, + { + "element": "#filterTypeButtonsVideoManager", + "intro": "Use this dropdown to filter videos by type. You can choose between video, embed, image, article, or series.", + "position": "bottom" + }, + { + "element": "#filterSearchButtonsVideoManager", + "intro": "Customize your search fields here. You can select which fields to search for when you are filtering videos.", + "position": "bottom" + }, + { + "element": "#compactMode", + "intro": "Enable or disable compact mode to adjust the display of the video list.", + "position": "bottom" + } +] diff --git a/view/managerVideos_body.php b/view/managerVideos_body.php index 680305153f..f2a248f385 100644 --- a/view/managerVideos_body.php +++ b/view/managerVideos_body.php @@ -175,79 +175,53 @@ if (!empty($video_id) && Video::canEdit($video_id)) {
- + - + - + - - + + - - doNotShowEncoderButton)) { - if (!empty($config->getEncoderURL())) { - } - ?> -
- - - -
- - - - - - doNotShowEmbedButton)) { - ?> - - - - - - + + +
+ + + +
+ + + + + + + + + + +
+
@@ -291,56 +265,49 @@ if (!empty($video_id) && Video::canEdit($video_id)) { - videosManegerBulkActionButtons) { + videosManegerBulkActionButtons) { if (!empty($categories)) { - if (empty($advancedCustomUser->userCanNotChangeCategory) || Permissions::canAdminVideos()) { - ?> -
-
- -
- + + + - userCanNotChangeUserGroup) || Permissions::canAdminVideos()) { - $userGroups = UserGroups::getAllUsersGroups(); - ?> -
- + + userCanNotChangeUserGroup) || Permissions::canAdminVideos()) { + $userGroups = UserGroups::getAllUsersGroups(); ?> + + -
- + + - disableVideoSwap) && (empty($advancedCustom->makeSwapVideosOnlyForAdmin) || Permissions::canAdminVideos())) { - ?> + + + disableVideoSwap) && (empty($advancedCustom->makeSwapVideosOnlyForAdmin) || Permissions::canAdminVideos())) { ?> - + + + - + + + } ?> + + +
+ +
@@ -688,9 +656,9 @@ if (empty($advancedCustom->disableHTMLDescription)) { 'playlists_id': playlists_id }, success: function(response) { - if(response.error){ + if (response.error) { avideoToastError(__('Error on playlist')); - }else{ + } else { avideoToastSuccess(__('Success')); } modal.hidePleaseWait(); @@ -2298,4 +2266,4 @@ if (empty($advancedCustom->disableHTMLDescription)) { }, 500); } - + \ No newline at end of file