User:Hala/monobook.js

var Gallery = { initialize: function { if (wgPageName.indexOf('Image:') == 0) return; var a = AJS.A({ href: 'javascript:void(0);', title: 'View this page\'s gallery' }, 'Gallery'); this.link = AJS.LI({ id: 'ca-gallery' }, a); Gallery.imageList.initialize; Gallery.imageList.populate(AJS.$('bodyContent')); if (Gallery.imageList.count > 0) { var actionList = getElement("//div[@id='p-cactions']/div[@class='pBody']/ul"); if (actionList) actionList.appendChild(this.link); }		AJS.AEV(a, 'click', function(event){			var fun = AJS.bind(Gallery.activate, Gallery);			fun;		}); },	activate: function { if (Gallery.imageList.count == 1) GB_showImage(Gallery.imageList.images[0].caption, Gallery.imageList.images[0].url); else if (Gallery.imageList.count > 1) GB_showImageSet(Gallery.imageList.images, 1); },	imageList: { initialize: function { this.count = 0; this.images = new Array; this.minSize = 4097; // this is in number of pixels, since we DO want to display // armors that are 64x100 (6400) pixels and such, but not // skills icons that are 64x64 pixels (4096), so add 1px ;)		},		populate: function(fromElement) {			if (!fromElement)				return;			var imgs = AJS.$bytc('img', null, fromElement);			if (imgs) {				for (var i = 0; i < imgs.length; i++) {					if (imgs[i].width * imgs[i].height >= this.minSize) {						var img = imgs[i];						this.count++;						this.images.push({ 'caption': unescape(img.parentNode.href.substr(img.parentNode.href.indexOf('Image:')).replace(/_/g, ' ')), 'url': img.src.replace(/\/thumb(\/.*?)\/[^\/]*?$/i, '$1') });					}				}			}		}	} };

 Gaile

 Linsey

 Izzy

 Emily

 Auron

 Smurf

 Bad Gaile