Ivernia
Establishing Nation
- Joined
- Jun 15, 2012
- Messages
- 1,643
- Location
- Meath, Ireland
- Capital
- Royal City Caladbolg
- Nick
- Pádraig
Noticed that people post with links to images? Want to see the image in the post? This is what you have to do!
First you need to download an extension app called ''tampermonkey'' (Chrome) or ''Greasemonkey'' (Firefox)
You can google it on the interwebs, should be the first or second thing to come up. :3
Once you've got that installed,
1. Click the tampermonkey/greasemonkey icon that's in the top right of your chrome/firefox browser.
2. select ''add a new script''
3. it'll load up the script page
4. if there's any text just backspace it all
5. paste this in it's place:
That's it! Save that ''script''. and keep the app active and turned on. Should work fine.
If you have any problems, send a PM to me, Ivernia, for clarification on anything.
First you need to download an extension app called ''tampermonkey'' (Chrome) or ''Greasemonkey'' (Firefox)
You can google it on the interwebs, should be the first or second thing to come up. :3
Once you've got that installed,
1. Click the tampermonkey/greasemonkey icon that's in the top right of your chrome/firefox browser.
2. select ''add a new script''
3. it'll load up the script page
4. if there's any text just backspace it all
5. paste this in it's place:
PHP:
// ==UserScript==// @name NSEurope Image Enabler
// @namespace http://userscripts.org/users/161086
// @description Displays links to images as actual images on the forums, bypassing the restrictions on images in posts. Shamelessly ripped from the Argomir Bethesa Forums Script.
// @include http://www.ns-europe.eu/*
// @include http://www.ns-europe.eu/forum/*
// @include http://www.ns-europe.eu/wikim/*
// @include http://ns-europe.eu/wikim/*
// @include http://ns-europe.eu/*
// @include http://ns-europe.eu/forum/*
// @include http://ns-europe.eu/showthread.php?*
// @include http://www.europe-game.eu/*
// @include http://www.europe-game.eu/forum/*
// @include http://www.europe-game.eu/wikim/*
// @include http://www.europe-game.eu/showthread.php?*
// @include http://europe-game.eu/*
// @include http://europe-game.eu/forum/*
// @include http://europe-game.eu/wikim/*
// @include http://europe-game.eu/showthread.php?*
// ==/UserScript==
function getIMGWidth(imgSrc){
var newImg = new Image();
newImg.src = imgSrc;
var width = newImg.width;
return width;
}
function importImages(){
var maxWidth = 768; // RResizes images wider than the specified value. Change to something more to your likings if you find the images too small/large.
var idCount = 0; // Currently not used, but will be implemented later
var links = document.getElementsByTagName("a");
if(links != null){
for(i=0;i<links.length;i++){
var link = links[i];
var temp = link.href;
var text = link.innerHTML;
temp = temp.toLowerCase();
temp = temp.slice(-4);
if(temp == '.jpg' || temp == '.png' || temp == '.gif'|| temp == '.bmp' || temp == '.svg'){
if(getIMGWidth(link) > maxWidth){
link.innerHTML = '<img src="' + link.href + '" width="' + maxWidth + '" id="img' + idCount + '" title="' + text + '">';
idCount = idCount + 1;
}
else{
link.innerHTML = '<img src="' + link.href + '" id="img' + idCount + '" title="' + text + '">';
idCount = idCount + 1;
}
}
}
}
}
function insertCredits(){
footer = document.getElementById("copyright");
footer.innerHTML = footer.innerHTML + "<br>BGS Forum Image Enabler script for Greasemonky by <a href=http://forums.bethsoft.com/index.php?/user/541071-argomirr/'>Argomirr</a><br>Thanks for using!";
}
importImages(); insertCredits();
That's it! Save that ''script''. and keep the app active and turned on. Should work fine.
If you have any problems, send a PM to me, Ivernia, for clarification on anything.
Last edited: