Show Image URL[superseded]

By GustavoG Last update Oct 23, 2009 — Installed 676 times.

Slight tweak to change position of link

in
Subscribe to Slight tweak to change position of link 3 posts, 2 voices



gingerbeardman Scriptwright
FirefoxMacintosh

I've added the following code, after newdiv.appendChild(link)

newdiv.setAttribute('style', 'left:470px;position:relative;top:-395px;');

This will position the [URL] link above the top right of the image, at the right of the other Flickr tools/buttons.

Hopefully somebody else will find this useful.

 
gingerbeardman Scriptwright
FirefoxMacintosh

I've made a second set of changes to maintain the positioning of the photo caption.

1. newdiv attributes changed
2. additional CSS added for photoImgDiv

Here's the full code:

// ==UserScript==
// @name Show Image URL
// @namespace http://www.flickr.com/photos/gustavog
// @include http://www.flickr.com/photos/*/*
// ==/UserScript==
var images = document.evaluate(
'//div[starts-with(@id,"photoImgDiv")]//img',
document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var image = images.snapshotItem(0);
GM_addStyle("div.photoImgDiv { position: relative; }");
var newdiv = document.createElement('div');
var urltext = '[URL]';
var text = document.createTextNode(urltext);
var link = document.createElement('a');
link.setAttribute('href', image.src);
link.appendChild(text);
newdiv.appendChild(link);
newdiv.setAttribute('style', 'position:absolute;right:0;top:-1.75em;');
image.parentNode.appendChild(newdiv, image);

 
GustavoG Script's Author
FirefoxMacintosh

Thanks gingerbeardman. :)