Jimmie1717

UserScript: BingoSync Popouts

May 9th, 2025 (edited)
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         BingoSync Popouts
  3. // @namespace    http://jimmie1717.com/
  4. // @version      2025-05-09
  5. // @description  Make popouts clickable and open a separate window with the goals.
  6. // @author       Jimmie1717
  7. // @match        https://bingosync.com/room/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function(){
  12.     'use strict';
  13.  
  14.     ["tlbr","bltr","col1","col2","col3","col4","col5","row1","row2","row3","row4","row5"].forEach((popout,i)=>{
  15.         document.getElementById(popout).addEventListener('click',()=>{
  16.             let elements=document.getElementsByClassName(popout),goals=new Array(elements.length);
  17.             for(var i=0;i<goals.length;i++) goals[i]=elements[i].children[elements[i].children.length-1].textContent.replace(/\s/g,"_").replace(/'/g,"`").replace(/&/g,"and");
  18.             if(popout=="bltr") goals.reverse();
  19.             window.open(`https://bingo.jimmie1717.com/popout?game=mm&name=${document.getElementById(popout).textContent}&goals=${goals.join(';')}&layout=vertical&version=1.1&seed=${document.getElementById('the-seed').textContent.replace(/\s/g,"")}&mode=normal&lang=en`,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=319, height=670");
  20.         },false);
  21.     });
  22. })();
Add Comment
Please, Sign In to add comment