From db3170e826446dd5c0824e024f01b05c6a2a9629 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 17 May 2024 12:46:20 +0000 Subject: [PATCH] Fixup. Format code with Prettier --- pod/completion/static/js/caption_maker.js | 5 +++-- pod/completion/static/js/completion.js | 4 +--- pod/enrichment/static/js/enrichment.js | 2 +- pod/enrichment/static/js/videojs-slides.js | 12 +++++++----- pod/live/static/js/filter_aside_event_list.js | 4 +++- pod/main/static/js/main.js | 14 +++++++++----- pod/video/static/js/change_video_owner.js | 3 ++- pod/video/static/js/comment-script.js | 3 ++- pod/video/static/js/regroup_videos_by_theme.js | 7 +++++-- pod/video/static/js/video_stats_view.js | 4 +++- 10 files changed, 36 insertions(+), 22 deletions(-) diff --git a/pod/completion/static/js/caption_maker.js b/pod/completion/static/js/caption_maker.js index 561428e27c..cd31ee2d81 100644 --- a/pod/completion/static/js/caption_maker.js +++ b/pod/completion/static/js/caption_maker.js @@ -842,7 +842,9 @@ function createCaptionBlock(newCaption, spawnFunction) { let captionObj = { start: newCaption.end, end: - playTime > newCaption.end ? playTime : parseInt(newCaption.end, 10) + 2, + playTime > newCaption.end + ? playTime + : parseInt(newCaption.end, 10) + 2, caption: "", }; let index = Array.from(this.div.parentNode.children).indexOf(this.div); @@ -1448,7 +1450,6 @@ const onPlayerReady = function (player, options) { endKeyframe.style = "left" + `${endPercent}%`; regionHighlight.after(endKeyframe); }; - }; /** diff --git a/pod/completion/static/js/completion.js b/pod/completion/static/js/completion.js index a3fbd3936d..06c46abe4d 100644 --- a/pod/completion/static/js/completion.js +++ b/pod/completion/static/js/completion.js @@ -258,9 +258,7 @@ var sendAndGetForm = async function (elt, action, name, form, list) { if (deleteConfirm) { id = elt.querySelector("input[name=id]").value; url = window.location.origin + href; - token = document.querySelector( - "input[name=csrfmiddlewaretoken]", - ).value; + token = document.querySelector("input[name=csrfmiddlewaretoken]").value; let form_data = new FormData(); form_data.append("action", action); form_data.append("id", id); diff --git a/pod/enrichment/static/js/enrichment.js b/pod/enrichment/static/js/enrichment.js index b4f875750d..d6bc96ac01 100644 --- a/pod/enrichment/static/js/enrichment.js +++ b/pod/enrichment/static/js/enrichment.js @@ -452,7 +452,7 @@ function verify_fields() { "beforebegin", "" + gettext("Please enter a correct richtext.") + - "", + "", ); richtext.closest("div.form-group").classList.add("has-error"); diff --git a/pod/enrichment/static/js/videojs-slides.js b/pod/enrichment/static/js/videojs-slides.js index 04a514441f..3fbd3fb448 100644 --- a/pod/enrichment/static/js/videojs-slides.js +++ b/pod/enrichment/static/js/videojs-slides.js @@ -1,7 +1,7 @@ "use-strict"; /** * Esup-Pod videojs Slides plugin -*/ + */ // Read-only globals defined in video-script.html /* global player @@ -48,7 +48,9 @@ var loadEnrichmentVTTfile = function (url, callback) { timeInSecond = function (strtime) { let atime = strtime.split(":"); return ( - parseInt(atime[0], 10) * 3600 + parseInt(atime[1], 10) * 60 + parseInt(atime[2], 10) + parseInt(atime[0], 10) * 3600 + + parseInt(atime[1], 10) * 60 + + parseInt(atime[2], 10) ); }, createEmptyCue = function (start, end) { @@ -75,8 +77,7 @@ var loadEnrichmentVTTfile = function (url, callback) { if (this.readyState === 4) { var lines = xhr.responseText.split("\n"), nbl = lines.length, - reg = - /(^\d{2}:\d{2}:\d{2})\.\d{3} --> (\d{2}:\d{2}:\d{2})\.\d{3}$/i, + reg = /(^\d{2}:\d{2}:\d{2})\.\d{3} --> (\d{2}:\d{2}:\d{2})\.\d{3}$/i, fisrtcueline = 1, txtdata = "", c = 0; @@ -325,7 +326,8 @@ var VideoSlides = function (items) { var slidebar_left = (parseInt(this.slidesItems[i].start, 10) / duration) * 100; var slidebar_width = - (parseInt(this.slidesItems[i].end, 10) / duration) * 100 - slidebar_left; + (parseInt(this.slidesItems[i].end, 10) / duration) * 100 - + slidebar_left; var id = this.slidesItems[i].id; var type = this.slidesItems[i].type; var newslide = document.createElement("div"); diff --git a/pod/live/static/js/filter_aside_event_list.js b/pod/live/static/js/filter_aside_event_list.js index bcc17044a6..847c0379f9 100644 --- a/pod/live/static/js/filter_aside_event_list.js +++ b/pod/live/static/js/filter_aside_event_list.js @@ -81,7 +81,9 @@ function refreshEvents() { window.history.pushState({}, "", url); }) .catch(() => { - events_content.textContent = gettext("An Error occurred while processing."); + events_content.textContent = gettext( + "An Error occurred while processing.", + ); }) .finally(() => { // Re-enable inputs and dismiss loader diff --git a/pod/main/static/js/main.js b/pod/main/static/js/main.js index bed2576529..5e95b7a80a 100644 --- a/pod/main/static/js/main.js +++ b/pod/main/static/js/main.js @@ -801,10 +801,14 @@ var send_form_data = async function ( typeof callbackSuccess === "function" ? callbackSuccess : function ($data) { - return $data; - }; + return $data; + }; callbackFail = - typeof callbackFail === "function" ? callbackFail : function (xhr) {console.log(xhr);}; + typeof callbackFail === "function" + ? callbackFail + : function (xhr) { + console.log(xhr); + }; // console.log("send_form_data. fct=" + fct); method = method || "post"; @@ -883,8 +887,8 @@ var send_form_data_vanilla = function ( typeof callbackSuccess === "function" ? callbackSuccess : function (data) { - return data; - }; + return data; + }; callbackFail = typeof callbackFail === "function" ? callbackFail : function () {}; if (data_form) { diff --git a/pod/video/static/js/change_video_owner.js b/pod/video/static/js/change_video_owner.js index 93be1582a3..93a152096d 100644 --- a/pod/video/static/js/change_video_owner.js +++ b/pod/video/static/js/change_video_owner.js @@ -188,7 +188,8 @@ return; } const curr_offset = Number.parseInt( - getSearchParamFromURL(url, "offset", 0), 10 + getSearchParamFromURL(url, "offset", 0), + 10, ); const curr_page = curr_offset === 0 ? 1 : 1 + curr_offset / limit; const total_page = Math.ceil(DATA.count / limit); diff --git a/pod/video/static/js/comment-script.js b/pod/video/static/js/comment-script.js index 6013a42587..bf3a0bc7ab 100644 --- a/pod/video/static/js/comment-script.js +++ b/pod/video/static/js/comment-script.js @@ -811,7 +811,8 @@ function getElementPosition(element) { let yPosition = 0; // get body padding top if exists that will be let bodyPaddingTop = Number.parseInt( - getComputedStyle(document.body)["padding-top"] ?? 0, 10 + getComputedStyle(document.body)["padding-top"] ?? 0, + 10, ); while (element) { diff --git a/pod/video/static/js/regroup_videos_by_theme.js b/pod/video/static/js/regroup_videos_by_theme.js index 8fee5ef7a1..04d80a8c8b 100644 --- a/pod/video/static/js/regroup_videos_by_theme.js +++ b/pod/video/static/js/regroup_videos_by_theme.js @@ -129,7 +129,7 @@ function run(has_more_themes, Helper) {
+ title="${video.title.charAt(0).toUpperCase()}${video.title.slice(1)}"> ${video.thumbnail}
@@ -209,7 +209,10 @@ function run(has_more_themes, Helper) { const themes_contents = scroll_wrapper.querySelectorAll( ".list-children-theme", ); - if (this.isEqualNode(next_btn) && curr_page < Number.parseInt(max_pages, 10)) { + if ( + this.isEqualNode(next_btn) && + curr_page < Number.parseInt(max_pages, 10) + ) { current_position -= 100; // swipe content on the right themes_contents.forEach( diff --git a/pod/video/static/js/video_stats_view.js b/pod/video/static/js/video_stats_view.js index ef445fbf90..a08d3fc048 100644 --- a/pod/video/static/js/video_stats_view.js +++ b/pod/video/static/js/video_stats_view.js @@ -119,7 +119,9 @@ $(() => { // remove date_min in data data.pop(); document.getElementById("jsperiode").min = min_date[0].min_date; - } catch (uselesserr) { /* empty */ } + } catch (uselesserr) { + /* empty */ + } }, postData: { csrfmiddlewaretoken: $("[name=csrfmiddlewaretoken]").val(),