Skip to content

Instantly share code, notes, and snippets.

@breunigs
Created January 27, 2013 18:31
Show Gist options
  • Save breunigs/4649628 to your computer and use it in GitHub Desktop.
Save breunigs/4649628 to your computer and use it in GitHub Desktop.
shows full image when clicking on the truncated thumbnail in portal details on ingress.com/intel
// ==UserScript==
// @name show portal image for ingress.com/intel
// @description Click on an image in the portal details to show it in full
// @namespace https://gist.github.com/4649628
// @updateURL https://gist.github.com/raw/4649628/show-img-ingress.user.js
// @downloadURL https://gist.github.com/raw/4649628/show-img-ingress.user.js
// @include http://www.ingress.com/intel*
// @version 1
// ==/UserScript==
// Public Domain. Please send improvements or suggestions
// to stefan+ingress@mathphys.fsk.uni-heidelberg.de
var elem = document.createElement('script');
var scr = document.createTextNode(
'('+function() {
$("body").on("click", function() {
setTimeout(function() {
$("#portal_image").on("click", function() {
$("#largepreview").remove();
var u = $(this).css("background-image").match(/^url\(['"](.+)["']\)$/)[1];
var e = $('<div id="largepreview"><img src="'+u+'"/></div>');
$(this).append(e).one("click", function() {
$("#largepreview").remove();
});
});
}, 100);
});
}.toString()+')();'
);
elem.appendChild(scr);
document.body.appendChild(elem);
elem = document.createElement('style');
scr = document.createTextNode(
'#largepreview { top:0; left:0; z-index:1000; position:fixed; width:100%; text-align:center; padding-top:10em }' +
'.RESISTANCE #largepreview img { border:3px solid #1B7089 } ' +
'.ALIENS img { border:3px solid #338738 } ' +
'#largepreview img { box-shadow:0 0 20px #000 } ' +
'#portal_image { cursor: pointer } '
);
elem.appendChild(scr);
document.body.appendChild(elem);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment