plugins/gallery/gallery-bits.js
author Dan Fuhry <dan@enanocms.org>
Sun, 19 Sep 2010 03:51:00 -0400
changeset 45 740bbe1f4dd5
parent 42 7c6e2e97aa08
permissions -rw-r--r--
So yeah, new uploader broke on everything but zip files. Fixed that.

/*
 * Misc functions for Snapr.
 */

function gal_toggle(elem, img, img_open, img_close)
{
	if ( !img_close || !img_open )
	{
		img_close = scriptPath + '/plugins/gallery/toggle-closed.png';
		img_open  = scriptPath + '/plugins/gallery/toggle-open.png';
	}
	if ( elem.style.display == 'none' || !elem.style.display )
	{
		elem.style.display = 'block';
		try {
			img.src = img_open;
		} catch(e) {};
	}
	else
	{
		elem.style.display = 'none';
		try {
			img.src = img_close;
		} catch(e) {};
	}
}

function gal_unset_radios(name)
{
	var radios = document.getElementsByTagName('input');
	for ( var i = 0; i < radios.length; i++ )
	{
		var radio = radios[i];
		if ( radio.name == name )
		{
			radio.checked = false;
		}
	}
}