Greasy Fork is available in English.

Flickr - TopPager

Inserts a pager at the top of pages which only show a pager at the bottom of the page.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// Flickr TopPager
// Copyright (c) 2010, Patrick Joseph.
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// ==UserScript==
// @name           	Flickr - TopPager
// @namespace		http://userscripts.org/users/isamux
// @description		Inserts a pager at the top of pages which only show a pager at the bottom of the page.
// @version         1.0.6
// @date            2011-04-24
// @creator         Patrick Joseph
// @include        	http://www.flickr.com/photos/*
// @include        	http://www.flickr.com/groups/*
// @include        	http://www.flickr.com/*/favorites*
// @exclude        	http://*.flickr.com/photos/friends*
// ==/UserScript==

// ==Changelog==
//2011-04-24 v1.0.6:
// * Reduced bottom margin of navigation.
//2011-04-24 v1.0.5:
// * Adjusted IDs of paginated contents after change of HTML-structure on Flickr.
// ==/Changelog==

// ---------------
//  CONFIGURATION
// ---------------
const CONST_ENABLE_FIREBUG_LOGGING = false;
const CONST_PAGINATED_CONTENT_XPATH_PHOTOSTREAM = '//div[starts-with(@class,"PhotoStream")]';
const CONST_PAGINATED_CONTENT_XPATH_GROUP = '//div[@class="HoldPhotos"]';
const CONST_PAGINATED_CONTENT_ID_FAVORITES = 'favoriteThumbs';

// ---------------
//  SCRIPT-MAIN
// ---------------
// 0. Prepare everything
// init logging
initLogging(console);

// I. get element before which the top pager will be inserted.
oPaginatedContent = getPaginatedContent();

// II. insert top page paginator
if(oPaginatedContent != null)
{
    console.info("TopPager: Paginated content was found");
	oPaginator = getPaginator();
	oPaginatorCopy = oPaginator.cloneNode(true);
    console.info("TopPager: Bottom paginator cloned");
	oPaginatedContent.parentNode.insertBefore(oPaginatorCopy, oPaginatedContent);
    console.info("TopPager: Finished adding top Pager");
    
     // reduce bottom margin of navigation
     subNav = document.getElementById('SubNav');
     subNav.style.setProperty("margin-bottom","0","");
}

// ===============
//  FUNCTION LIB
// ===============

function getPaginatedContent()
{
	// try get that element on photostream pages, ...
	oTmpFound =  getElement(CONST_PAGINATED_CONTENT_XPATH_PHOTOSTREAM);

	if(oTmpFound == null)
	{
		//...then on groups pages
		oTmpFound = getElement(CONST_PAGINATED_CONTENT_XPATH_GROUP);
	}

	if(oTmpFound == null)
	{
		//...and finally on favorites pages.
		oTmpFound = document.getElementById(CONST_PAGINATED_CONTENT_ID_FAVORITES);
	}

	return oTmpFound;
}

function getPaginator()
{
	return getElement('//div[@class="Pages"]');
}

function getElement(exp)
{
	var xpathResult = document.evaluate(
		exp,
		document,
		null,
		XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
		null);
		
	return xpathResult.snapshotItem(0);
}

function initLogging(pConsole)
{
	if(typeof pConsole === "undefined" || !CONST_ENABLE_FIREBUG_LOGGING) 
	{
		console = { 	log: function() { }, 
						info: function() {}, 
						debug: function() { } ,
						warn: function() {},
						error: function() {} };
	}
}