Gallery Zoom Viewer

By KARASZI István Last update Nov 19, 2007 — Installed 2,250 times. Daily Installs: 5, 7, 5, 2, 5, 7, 15, 7, 9, 12, 6, 11, 6, 6, 7, 9, 3, 7, 5, 4, 8, 8, 5, 3, 8, 7, 6, 8, 7, 7, 8, 7
// 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();