<commit_before>/**
 * Tumblr Album Photoset Lightbox (jQuery)
 *
 * Inspired by: https://github.com/PixelUnion/Extended-Tumblr-Photoset
 */

var albumPhotoset = require('tumblrPhotoset.albumPhotoset');
albumPhotoset.lightboxImageArray = {};

albumPhotoset.registerEventHandler('post-init', function (albumPhotosetInstance) {
	var photosetId = albumPhotosetInstance.photoset.attr('id');
	var photosetImages = albumPhotosetInstance.photosetImages;

	for (var imageCounter = 1; imageCounter <= photosetImages.length; imageCounter++) {
		var image = photosetImages[imageCounter];
		image.setAttribute('data-position', imageCounter);

		// extract properties for tumblr lightbox
		var imageWidth = image.getAttribute('data-width');
		var imageHeight = image.getAttribute('data-height');
		var imageLowRes = image.getAttribute('data-src');
		var imageHighRes = image.getAttribute('data-highres');

		// add image properties to lightbox array
		albumPhotosetInstance.lightboxImageArray[photosetId].push({
			width: imageWidth,
			height: imageHeight,
			low_res: imageLowRes,
			high_res: imageHighRes
		});

		image.addEventListener('click', function () {
			Tumblr.Lightbox.init(albumPhotosetInstance.lightboxImageArray[photosetId], image.getAttribute('data-position'));
		});
	}
});<commit_msg>updated documentation / debugging information in album photoset lightbox plugin<commit_after>/**
 * Tumblr Album Photoset Lightbox (jQuery)
 *
 * Inspired by: https://github.com/PixelUnion/Extended-Tumblr-Photoset
 *
 * define these attributes on the IMG tag:

 <img class="primary-photo"
 src="{PhotoURL-HighRes}"
 alt="{PhotoAlt}"
 data-width="{PhotoWidth-HighRes}"
 data-height="{PhotoHeight-HighRes}"
 data-lowres="{PhotoURL-256}"
 data-highres="{PhotoURL-HighRes}"
 />
 */

var albumPhotoset = require('tumblrPhotoset.albumPhotoset');
albumPhotoset.lightboxImageArray = {};

albumPhotoset.registerEventHandler('post-init', function (albumPhotosetInstance) {
	var photosetId = albumPhotosetInstance.photoset.attr('id');
	var photosetImages = albumPhotosetInstance.photosetImages;

	for (var imageCounter = 1; imageCounter <= photosetImages.length; imageCounter++) {
		var image = photosetImages[imageCounter];
		image.setAttribute('data-position', imageCounter);

		// extract properties for tumblr lightbox
		var imageWidth = image.getAttribute('data-width');
		var imageHeight = image.getAttribute('data-height');
		var imageLowRes = image.getAttribute('data-src');
		var imageHighRes = image.getAttribute('data-highres');

		// add image properties to lightbox array
		albumPhotosetInstance.lightboxImageArray[photosetId].push({
			width: imageWidth,
			height: imageHeight,
			low_res: imageLowRes,
			high_res: imageHighRes
		});

		image.addEventListener('click', function () {
			Tumblr.Lightbox.init(albumPhotosetInstance.lightboxImageArray[photosetId], image.getAttribute('data-position'));
		});
	}
});
console.log('Tumblr Photoset Lightbox registered');
{'fraction_non_alphanumeric': 0.12643678160919541, 'fraction_numerical': 0.0016903313049357674, 'mean_word_length': 5.881395348837209, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7322099', 'n_tokens_mistral': 956, 'n_tokens_neox': 855, 'n_words': 167}