From 043df1d9f1cea55d7585d25aecb7736b5e06bd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Poujade?= <lois.poujade@tetras-libre.fr> Date: Mon, 9 May 2022 07:39:38 +0200 Subject: [PATCH] Fixes from demo - change playback rate icon - pause on paste annotation - padding under settings button - reset filter on line upper - "playback rate" title + reduce size (& size of labels) - message sf danger/warning don't disapear - prevent crash on capsule with a bad video url --- assets/app.js | 4 ++-- capsule-prototype/css/common.css | 2 +- capsule-prototype/css/left_menu.css | 6 +++++- capsule-prototype/css/popup.css | 5 ++++- capsule-prototype/index.html | 2 +- capsule-prototype/js/MosaicPanelWidget.js | 4 +++- capsule-prototype/js/PopupPanelWidget.js | 2 ++ capsule-prototype/js/online-script.js | 12 ++++++++++-- src/Entity/Capsule.php | 22 +++++++++++++--------- 9 files changed, 41 insertions(+), 18 deletions(-) diff --git a/assets/app.js b/assets/app.js index f06402a..6c68975 100644 --- a/assets/app.js +++ b/assets/app.js @@ -28,6 +28,6 @@ $(function() { $("document").ready(function(){ setTimeout(function(){ - $(".flash-message").remove(); + $(".flash-message:not(.alert-danger):not(.alert-warning)").remove(); }, 5000 ); // 5 secs -}); \ No newline at end of file +}); diff --git a/capsule-prototype/css/common.css b/capsule-prototype/css/common.css index 959c244..8f20eae 100644 --- a/capsule-prototype/css/common.css +++ b/capsule-prototype/css/common.css @@ -9,7 +9,7 @@ .playback_form label { background-color: rgba(0, 0, 0, .5); - padding: 4px; + padding: 2px; box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2); } diff --git a/capsule-prototype/css/left_menu.css b/capsule-prototype/css/left_menu.css index e0532da..8e7fb8e 100644 --- a/capsule-prototype/css/left_menu.css +++ b/capsule-prototype/css/left_menu.css @@ -47,5 +47,9 @@ #btn_add_paste::before { content: ' '; background: url('images/icn-image.png') no-repeat center/45%; height: 40px; } #left_menu_item_preview::before { content: url('images/icn-menu-preview.png'); } -#left_menu_item_settings::before { content: url('images/icn-menu-settings.png'); } +#left_menu_item_settings::before { content: url('images/icn-menu-settings.png');} + +#left_menu_item_settings { + margin-bottom: 5px; +} diff --git a/capsule-prototype/css/popup.css b/capsule-prototype/css/popup.css index baea1c7..9c5a4fa 100644 --- a/capsule-prototype/css/popup.css +++ b/capsule-prototype/css/popup.css @@ -11,7 +11,8 @@ } #popupSpeedInput label { - margin: 2px; + margin: 1px; + font-size: 15px; } #popupSpeedInput label:first-child { @@ -28,6 +29,7 @@ max-height: 300px; align-content: first baseline; overflow: auto; + font-size: 15px; } #popupLabelsInput label { @@ -52,6 +54,7 @@ margin: 0; margin-bottom: 2px; font-size: 100%; + font-size: 15px; } #popupSpace, #popupAlertSpace, #popupAddLinkSpace, #popupSettingsSpace { diff --git a/capsule-prototype/index.html b/capsule-prototype/index.html index 7ad8498..7465951 100644 --- a/capsule-prototype/index.html +++ b/capsule-prototype/index.html @@ -174,7 +174,7 @@ </ul> <div class='flex-col'> <input type='checkbox' id='inp_playback_rate_dropdown' class='dropdown_control' /> - <label for ='inp_playback_rate_dropdown' class='left_menu_item' title='change playback rate'><i class='fas fa-play'></i></label> + <label for ='inp_playback_rate_dropdown' class='left_menu_item' title='change playback rate'><i class='fas fa-forward'></i></label> <form id='playback_speed_form' class='dropdown_content flex-col playback_form'> <input type='radio' id='playback_speed_025' value='0.25' name='playback_rate' /> <label class='left_menu_item' for='playback_speed_025'>0.25</label> diff --git a/capsule-prototype/js/MosaicPanelWidget.js b/capsule-prototype/js/MosaicPanelWidget.js index e117fe7..7655b8b 100644 --- a/capsule-prototype/js/MosaicPanelWidget.js +++ b/capsule-prototype/js/MosaicPanelWidget.js @@ -160,15 +160,17 @@ } const fillPanel = function () { + let resetfilterdiv = $('<div/>').addClass('mosaic_filter'); let typefilterdiv = $('<div/>').addClass('mosaic_filter'); let labelsfilterdiv = $('<div/>').addClass('mosaic_filter'); - typefilterdiv.append(getFilterElement( + resetfilterdiv.append(getFilterElement( 'Reset filters', 'rgb(100,100,100)', localOptions._resetFilters, 'mosaic_filter_item_all', false )); + localOptions.htmlElement().append(resetfilterdiv); localOptions.htmlElement().append(typefilterdiv); localOptions.htmlElement().append(labelsfilterdiv); // eslint-disable-next-line no-undef diff --git a/capsule-prototype/js/PopupPanelWidget.js b/capsule-prototype/js/PopupPanelWidget.js index 680065e..cd588f0 100644 --- a/capsule-prototype/js/PopupPanelWidget.js +++ b/capsule-prototype/js/PopupPanelWidget.js @@ -625,6 +625,8 @@ AnnotationSpeedPanelEdition.prototype.appendInputEditorDiv = function (parentDiv that.closeEdition.call(that); }) + var title = $('<div>').addClass('popupNewTitles').html('+ Playback rate'); + parentDiv.append(title); parentDiv.append(this.readonlyDiv); } AnnotationSpeedPanelEdition.prototype.closeEdition = function () { diff --git a/capsule-prototype/js/online-script.js b/capsule-prototype/js/online-script.js index 4cd35c1..f4ca93b 100644 --- a/capsule-prototype/js/online-script.js +++ b/capsule-prototype/js/online-script.js @@ -1004,8 +1004,16 @@ $(window).resize(function(e) { }); $(window).trigger("resize"); -function openPasteModal() { $('#paste_modal').css('display', 'flex'); $('#paste_modal_content').first().focus() } -function closePasteModal() { $('#paste_modal').hide(); $('#paste_modal_content').empty(); } +function openPasteModal() { + $('#paste_modal').css('display', 'flex'); + $('#paste_modal_content').first().focus(); + rekall.timeline.pause(); +} + +function closePasteModal() { + $('#paste_modal').hide(); + $('#paste_modal_content').empty(); +} function openImageEdition(message, tag) { $('#edit_pic_modal').show(); diff --git a/src/Entity/Capsule.php b/src/Entity/Capsule.php index b397ec3..faaf02e 100755 --- a/src/Entity/Capsule.php +++ b/src/Entity/Capsule.php @@ -200,23 +200,27 @@ class Capsule return null; } - $project_retriever = new ProjectRetriever($this); - $video_url = $project_retriever->getVideoUrl(); - $video_id = $project_retriever->getVideoId($video_url); + try { + $project_retriever = new ProjectRetriever($this); + $video_url = $project_retriever->getVideoUrl(); + $video_id = $project_retriever->getVideoId($video_url); - if (str_contains($video_url, 'yout')) { + if (str_contains($video_url, 'yout')) { $url = 'https://img.youtube.com/vi/%s/%s.jpg'; $high_resolution = sprintf($url, $video_id, 'maxresdefault'); $medium_resolution = sprintf($url, $video_id, 'mqdefault'); try { - $http_client->request('GET', $high_resolution); - return $high_resolution; + $http_client->request('GET', $high_resolution); + return $high_resolution; } catch (\Exception $e) { - return $medium_resolution; + return $medium_resolution; } - } + } - return 'https://vumbnail.com/' . $video_id . '.jpg'; + return 'https://vumbnail.com/' . $video_id . '.jpg'; + } catch (\Exception $e) { + return null; + } } /** -- GitLab