Skip to content

Commit

Permalink
Fixup. Format code with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed May 17, 2024
1 parent 428bcab commit db3170e
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 22 deletions.
5 changes: 3 additions & 2 deletions pod/completion/static/js/caption_maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1448,7 +1450,6 @@ const onPlayerReady = function (player, options) {
endKeyframe.style = "left" + `${endPercent}%`;
regionHighlight.after(endKeyframe);
};

};

/**
Expand Down
4 changes: 1 addition & 3 deletions pod/completion/static/js/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion pod/enrichment/static/js/enrichment.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ function verify_fields() {
"beforebegin",
"<span class='form-help-inline'>" +
gettext("Please enter a correct richtext.") +
"</span>",
"</span>",
);
richtext.closest("div.form-group").classList.add("has-error");

Expand Down
12 changes: 7 additions & 5 deletions pod/enrichment/static/js/videojs-slides.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use-strict";
/**
* Esup-Pod videojs Slides plugin
*/
*/
// Read-only globals defined in video-script.html
/*
global player
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
4 changes: 3 additions & 1 deletion pod/live/static/js/filter_aside_event_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions pod/main/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion pod/video/static/js/change_video_owner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion pod/video/static/js/comment-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 5 additions & 2 deletions pod/video/static/js/regroup_videos_by_theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function run(has_more_themes, Helper) {
</div>
<div class="card-thumbnail">
<a class="link-center-pod" href="${VIDEO_URL}${video.slug}"
title="${video.title.charAt(0).toUpperCase()}${video.title.slice(1,)}">
title="${video.title.charAt(0).toUpperCase()}${video.title.slice(1)}">
${video.thumbnail}
</a>
</div>
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion pod/video/static/js/video_stats_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit db3170e

Please sign in to comment.