Skip to content

Instantly share code, notes, and snippets.

@sldenazis
Last active May 27, 2017 16:20
Show Gist options
  • Save sldenazis/9b8ecba2ba5e8fdc3888132107c9a2b4 to your computer and use it in GitHub Desktop.
Save sldenazis/9b8ecba2ba5e8fdc3888132107c9a2b4 to your computer and use it in GitHub Desktop.
Greasemonkey's script for opr.ingress.com that allows you to select all the stars at once.
// ==UserScript==
// @name selectallstars
// @namespace selectallstars
// @include https://opr.ingress.com/recon
// @version 0.2
// @grant none
// ==/UserScript==
var newButtons = document.createElement('div');
newButtons.innerHTML = ' \
<div class="ngroup" style="position:absolute;top:60px"> \
<button class="button-star" onclick="selectAll(2)"><span style="font-size:28px" class="glyphicon glyphicon-star-empty ingress-light-blue text-center"></span></button><br /> \
<button class="button-star" onclick="selectAll(4)"><span style="font-size:28px" class="glyphicon glyphicon-star-empty ingress-light-blue text-center"></span></button><br /> \
<button class="button-star" onclick="selectAll(6)"><span style="font-size:28px" class="glyphicon glyphicon-star-empty ingress-light-blue text-center"></span></button><br /> \
<button class="button-star" onclick="selectAll(8)"><span style="font-size:28px" class="glyphicon glyphicon-star-empty ingress-light-blue text-center"></span></button><br /> \
<button class="button-star" onclick="selectAll(10)"><span style="font-size:28px" class="glyphicon glyphicon-star-empty ingress-light-blue text-center"></span></button><br /> \
</div> \
';
var newScript = document.createElement('script');
newScript.innerHTML = ' \
function selectAll(value){ \
for ( var i = 0; i < document.getElementsByClassName("btn-group").length; i++ ) { \
document.getElementsByClassName("btn-group")[i].childNodes[value].click() \
}; \
};';
document.body.appendChild(newScript);
document.body.appendChild(newButtons);
@sldenazis
Copy link
Author

It adds a vertical set of stars at the left of the page, that allows you to just click one of them for select all the others. Contributions and suggestions are welcomed :).

Agrega un grupo de estrellas vertical a la izquierda de la página, lo que te permite seleccionar todas las demas clickeando sólo una de ellas. Todos los aportes y sugerencias son bienvenidos :).

screenshot opr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment