Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pouvoir trier les vidéos des chaines #1087

Open
MathieuDomingo opened this issue Apr 2, 2024 · 0 comments
Open

Pouvoir trier les vidéos des chaines #1087

MathieuDomingo opened this issue Apr 2, 2024 · 0 comments
Assignees

Comments

@MathieuDomingo
Copy link

Salut,

Petite demande d'amélioration :

  • est ce qu'il serait possible d'avoir pour les chaines le même principe de tri des vidéos que sur le tableau de bord ?

PS : Pour ne pas modifier le code source de pod, j'ai fais une bidouille en javascript en attendant :

async function load_all_videos_and_order_by_name() { await infinite.getData(infinite.url, infinite.next_page_number, infinite.nextPage).then((data) => {
      if (data !== null && data !== undefined) {
        const html = new DOMParser().parseFromString(data, "text/html");
        if (html.getElementById("videos_list").dataset.nextpage !== "True") {
          infinite.nextPage = false;
        }
        infinite.nextPage = html.getElementById("videos_list").dataset.nextpage;
        let element = infinite.videos_list;

        element.innerHTML += html.getElementById("videos_list").innerHTML;
        infinite.next_page_number += 1;
        const favoritesButtons =document.getElementsByClassName("favorite-btn-link");
        for (let btn of favoritesButtons) {
          preventRefreshButton(btn, true);
        }
      }
      infinite.callBackAfterLoad();
      /* Refresh Bootstrap tooltips after load */
      const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"], [data-pod-tooltip="true"]',);
      [...tooltipTriggerList].map((tooltipTriggerEl) => new bootstrap.Tooltip(tooltipTriggerEl),);
    });
   if(infinite.nextPage=="true"){
       load_all_videos_and_order_by_name();
   }
   else{
        let Videos = [...document.querySelectorAll(".infinite-item")];
        Videos.sort(function(a, b) {
            return a.querySelector('span.video-title > a').innerText.localeCompare(b.querySelector('span.video-title > a').innerText);
        });
        Videos.forEach(function(div, index) {
            div.style.order = index + 1;
        });
    }
  
};
if(document.querySelector('.page_title').innerText.trim() == 'Archives audiovisuelles du GRT  Vidéo  Audio'){
    load_all_videos_and_order_by_name();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants