Created
January 27, 2013 18:31
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 [email protected] | |
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