// ==UserScript== // @name flickr - open an amount of next pages at once // @namespace http://tampermonkey.net/ // @version 1.1 // @description flickr - open a specific amount of next pages at once - big button to close the page with a click // @author ClaoDD // @match https://www.flickr.com/* // @grant window.close // @downloadURL none // ==/UserScript== var indirizzoPhotos = window.location.href; if (!(indirizzoPhotos.includes('search'))){ if (indirizzoPhotos.includes('photos') || indirizzoPhotos.includes('group')){ var divmio = document.createElement("div"); divmio.style.cssText = 'position:static;width:100%;height:120px;opacity:0;z-index:100;'; var button1 = document.createElement("button"); button1.innerHTML = "open the next ... pages"; button1.style.position = "relative"; button1.style.left = "10%"; var buttonO = document.createElement("button"); buttonO.innerHTML = "Open next page"; buttonO.style.backgroundColor = "#ffffff"; buttonO.style.color = "#008ddf"; buttonO.style.border = "2px solid"; buttonO.style.width = "9%"; buttonO.style.height = "330px"; // Altezza ridotta per evitare la sovrapposizione buttonO.style.position = "fixed"; // Imposta il posizionamento fisso buttonO.style.right = "10px"; // Posiziona il bottone a destra buttonO.style.bottom = "120px"; // Imposta la posizione sopra "Close this page" var buttonClose = document.createElement("button"); buttonClose.innerHTML = "Close this page"; buttonClose.style.backgroundColor = "#ffffff"; buttonClose.style.color = "#a18160"; buttonClose.style.border = "2px solid"; buttonClose.style.width = "9%"; buttonClose.style.height = "330px"; // Altezza ridotta per evitare la sovrapposizione buttonClose.style.position = "fixed"; // Imposta il posizionamento fisso buttonClose.style.right = "10px"; // Posiziona il bottone a destra buttonClose.style.bottom = "460px"; // Imposta la posizione in basso var buttonO2 = document.createElement("button"); buttonO2.innerHTML = "open the next page"; buttonO2.style.position = "relative"; buttonO2.style.left = "20%"; buttonO2.style.backgroundColor = "#ffffff"; buttonO2.style.color = "#008ddf"; buttonO2.style.border = "2px solid"; buttonO2.style.width = "10%"; buttonO2.style.height = "200px"; var buttonClose2 = document.createElement("button"); buttonClose2.innerHTML = "Close this page"; buttonClose2.style.backgroundColor = "#ffffff"; buttonClose2.style.color = "#a18160"; buttonClose2.style.border = "2px solid"; buttonClose2.style.width = "36%"; //change this value for the width of the "Close this page" button buttonClose2.style.height = "200px"; //change this value for the height of the "Close this page" button buttonClose2.style.position = "relative"; buttonClose2.style.left = "21%"; var button10 = document.createElement("button"); button10.innerHTML = "10"; button10.style.position = "relative"; button10.style.left = "11%"; document.body.appendChild(divmio); document.body.insertBefore(button1, divmio); document.body.insertBefore(button10, divmio); document.body.insertBefore(buttonO2, divmio); document.body.insertBefore(buttonClose2, divmio); document.body.insertBefore(buttonO, divmio); document.body.insertBefore(buttonClose, divmio); buttonO.addEventListener("click", function() { var indirizzoPhotosB = window.location.href; if (indirizzoPhotosB.includes('page')){ var indirizzo2 = window.location.href; var indirizzoDiviso2 = indirizzo2.split('page'); var numCorrente2 = indirizzoDiviso2[indirizzoDiviso2.length -1]; var indirizzoSenzaNum2 = indirizzoDiviso2.splice(0, (indirizzoDiviso2.length -1)); window.open(indirizzoSenzaNum2 +'page'+(parseInt(numCorrente2, 10)+ 1), "_self"); }; if (!(indirizzoPhotosB.includes('page'))){ window.open(window.location.href + 'page2', "_self"); } }); buttonO2.addEventListener("click", function() { var indirizzoPhotosB = window.location.href; if (indirizzoPhotosB.includes('page')){ var indirizzo2 = window.location.href; var indirizzoDiviso2 = indirizzo2.split('page'); var numCorrente2 = indirizzoDiviso2[indirizzoDiviso2.length -1]; var indirizzoSenzaNum2 = indirizzoDiviso2.splice(0, (indirizzoDiviso2.length -1)); window.open(indirizzoSenzaNum2 +'page'+(parseInt(numCorrente2, 10)+ 1), "_self"); }; if (!(indirizzoPhotosB.includes('page'))){ window.open(window.location.href + 'page2', "_self"); } }); button1.addEventListener("click", function() { if (indirizzoPhotos.includes('page')){ var indirizzo = window.location.href; var indirizzoDiviso = indirizzo.split('page'); var numCorrente = indirizzoDiviso[indirizzoDiviso.length -1]; var numNew = numCorrente; var indirizzoSenzaNum = indirizzoDiviso.splice(0, (indirizzoDiviso.length -1)); if (indirizzo.indexOf('page') > -1) { var numPages = prompt("how many pages to open?"); var numStart = 1; while (numStart <= numPages) { window.open(indirizzoSenzaNum +'page'+(parseInt(numCorrente, 10)+numStart), "_blank"); numStart = numStart + 1; } button1.innerHTML = "...opened"; } } if (!(indirizzoPhotos.includes('page'))){ var indirizzo = window.location.href + 'page1'; var indirizzoDiviso = indirizzo.split('page'); var numCorrente = indirizzoDiviso[indirizzoDiviso.length -1]; var numNew = numCorrente; var indirizzoSenzaNum = indirizzoDiviso.splice(0, (indirizzoDiviso.length -1)); if (indirizzo.indexOf('page') > -1) { var numPages = prompt("how many pages to open?"); var numStart = 1; while (numStart <= numPages) { window.open(indirizzoSenzaNum +'page'+(parseInt(numCorrente, 10)+numStart), "_blank"); numStart = numStart + 1; } button.innerHTML = "...opened"; } } }); button10.addEventListener("click", function() { if (indirizzoPhotos.includes('page')){ var indirizzo = window.location.href; var indirizzoDiviso = indirizzo.split('page'); var numCorrente = indirizzoDiviso[indirizzoDiviso.length -1]; var numNew = numCorrente; var indirizzoSenzaNum = indirizzoDiviso.splice(0, (indirizzoDiviso.length -1)); if (indirizzo.indexOf('page') > -1) { var numPages = 10; var numStart = 1; while (numStart <= numPages) { window.open(indirizzoSenzaNum +'page'+(parseInt(numCorrente, 10)+numStart), "_blank"); numStart = numStart + 1; } button10.innerHTML = "__"; } } if (!(indirizzoPhotos.includes('page'))){ var indirizzoB = window.location.href + 'page1'; var indirizzoDivisoB = indirizzoB.split('page'); var numCorrenteB = indirizzoDivisoB[indirizzoDivisoB.length -1]; var numNewB = numCorrenteB; var indirizzoSenzaNumB = indirizzoDivisoB.splice(0, (indirizzoDivisoB.length -1)); if (indirizzo.indexOf('page') > -1) { var numPagesB = 10; var numStartB = 1; while (numStartB <= numPagesB) { window.open(indirizzoSenzaNumB +'page'+(parseInt(numCorrenteB, 10)+numStartB), "_blank"); numStartB = numStartB + 1; } button10.innerHTML = "__"; } } }); } buttonClose.addEventListener("click", function() { window.close(); }); buttonClose2.addEventListener("click", function() { window.close(); }); //AGGIUNTA DUPLICA BARRA // Trova l'elemento della barra delle pagine esistente var existingPager = document.querySelector('.pagination-view'); // Sostituisci con il selettore CSS corretto // Verifica se l'elemento è stato trovato if (existingPager) { // Clona l'elemento della barra delle pagine var duplicatedPager = existingPager.cloneNode(true); var magicToolbar = document.querySelector('.fluid-magic-toolbar'); // Assicurati che l'elemento sia stato trovato prima di procedere if (magicToolbar) { // Inserisci duplicatedPager prima di magicToolbar //magicToolbar.parentNode.insertBefore(duplicatedPager, magicToolbar); //magicToolbar.parentNode.insertBefore(duplicatedPager, magicToolbar.nextSibling); magicToolbar.parentNode.insertAdjacentElement('beforebegin', duplicatedPager); } else { // L'elemento con la classe .fluid-magic-toolbar non è stato trovato // Puoi gestire questo caso a tua discrezione. } } //FINE AGGIUNTA DUPLICA BARRA }