// Gallery Zoom Viewer
// version 0.3
// 2007-01-23
// Copyright (c) 2007, KARASZI Istvan
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// ==UserScript==
// @name Gallery Zoom Viewer
// @namespace http://raszi.hu/gallery-zoom-viewer/
// @description First, previous, next, last links will open photos in the same size on Gallery (http://gallery.menalto.com/) pages
// @include *displayimage*
// @include *gal*
// @include *album*
// @include *main.php*
// @include */v/*
// ==/UserScript==
GalleryFullView = function() {
var locstr = new String(window.location);
var found;
if ((found = locstr.match(/(full=1|g2_imageViewsIndex=\d+)/))) {
var urls = document.getElementsByTagName("a");
for(var i = 0; i < urls.length; i++) {
var url = urls[i];
var parent = url.parentNode;
var class = new String(parent.className);
var obj = this;
//
// we can only match on classes
//
if (class.match(/(nav|first-and-previous|next-and-last)/)) {
var link = new String(url.href);
if (link.match(/\?/)) {
link += "&" + found[1];
} else {
link += "?" + found[1];
}
url.href = link;
}
}
}
}
GalleryFullView();