SHARE
TWEET

Untitled

a guest Jun 18th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name     fast-torrent tool
  3. // @version  1
  4. // @grant    none
  5. // ==/UserScript==
  6.  
  7. function sleep(ms) {
  8.   return new Promise(resolve => setTimeout(resolve, ms));
  9. }
  10.  
  11. async function main() {
  12.   let button = null;
  13.   do {
  14.     await sleep(100);
  15.     button = document.querySelector("div.upload-header div.c7");
  16.   } while (button == null);
  17.  
  18.   button.onclick = function() {
  19.     const panels = document.querySelectorAll("div.torrent-row div.torrent-info");
  20.     const hidden = panels.length > 0 ? panels[0].classList.contains("hidden") : false;
  21.     for (const panel of panels) {
  22.       if (hidden)
  23.         panel.classList.remove("hidden");
  24.       else
  25.         panel.classList.add("hidden");
  26.     }
  27.   };
  28. }
  29. main();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top