HEX
Server: Apache/2.4.59 (Debian)
System: Linux skycube.cz 4.19.0-25-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64
User: ilya (534)
PHP: 7.3.31-1~deb10u7
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/ilya/data/www/kamforum.ru/jscripts/ipb_galleryjs.js
/*
* Gallery jscript functions
* By Adam Kinder
*
* $Id$
*/
var addquotebutton     = ipb_var_image_url + "/p_mq_add.gif";
var removequotebutton  = ipb_var_image_url + "/p_mq_remove.gif";
var unselectedbutton = ipb_var_image_url + "/topic_unselected.gif";
var selectedbutton   = ipb_var_image_url + "/topic_selected.gif";
var lang_gobutton    = "With selected";
var gallery_lang_prompt = "Link to Image:";

/**
* Resize thumb-div to ensure that all image rows are the
* same height
*
* @author	Matt
* @since	2.0.3
*/
function html_resize_thumb_divs( use_thumbs, thumbs_x, thumbs_x )
{
	if ( use_thumbs && thumbs_x && thumbs_y )
	{
		var thumb_divs = document.getElementsByTagName('DIV');
		
		//----------------------------------
		// Sort through and resize divs
		//----------------------------------
		
		for ( var i = 0 ; i <= thumb_divs.length ; i++ )
		{
			try
			{
				if ( ! thumb_divs[i].id && thumb_divs[i].className == 'thumb' )
				{
					// Resize to chosen thumb height + 30 px of "padding"
					thumb_divs[i].style.height = thumbs_x + 30 + 'px';
				}
			}
			catch(e)
			{
				continue;
			}
		}
	}
}

function gallery_link_to_post(pid,img) {
	temp = prompt( gallery_lang_prompt, ipb_var_base_url + "automodule=gallery&cmd=si&img=" + img + "#" + pid );
	return false;
}

function delete_img(theURL)  {
	if (confirm( ipb_lang_js_del_1 )) {
		window.location.href=theURL;
	}
	else {
		alert ( ipb_lang_js_del_2 );
	} 
}

function gallery_toggleview(id)  {
	if ( ! id ) return;
	
	if ( itm = my_getbyid(id) )	{
		if (itm.style.display == "none") {
			my_show_div(itm);
		}
		else {
			my_hide_div(itm);
		}
	}
}

function gallery_toggle_pid( id )
{
	saved = new Array();
	clean = new Array();
	add   = 1;
	
	//-----------------------------------
	// Get form info
	//-----------------------------------
	
	tmp = document.modform.selectedgcids.value;
	
	saved = tmp.split(",");
	
	//-----------------------------------
	// Remove bit if exists
	//-----------------------------------
	
	for( i = 0 ; i < saved.length; i++ )
	{
		if ( saved[i] != "" )
		{
			if ( saved[i] == id)
			{
				 add = 0;
			}
			else
			{
				clean[clean.length] = saved[i];
			}
		}
	}
	
	//-----------------------------------
	// Add?
	//-----------------------------------
	
	if ( add )
	{
		clean[ clean.length ] = id;
		eval("document.pid"+id+".src=selectedbutton");
	}
	else
	{
		eval(" document.pid"+id+".src=unselectedbutton");
	}
	
	newvalue = clean.join(',');
	
	my_setcookie( 'modgcids', newvalue, 0 );
	
	document.modform.selectedgcids.value = newvalue;
	
	newcount = stacksize(clean);
	
	document.modform.gobutton.value = lang_gobutton + '(' + newcount + ')';
	
	return false;
}

/*--------------------------------------------*/
// Multi quote ( From ibf_topic.js )
/*--------------------------------------------*/

function multiquote_add(id)
{
	saved = new Array();
	clean = new Array();
	add   = 1;
	
	//-----------------------------------
	// Get any saved info
	//-----------------------------------
	
	if ( tmp = my_getcookie('gal_pids') )
	{
		saved = tmp.split(",");
	}
	
	//-----------------------------------
	// Remove bit if exists
	//-----------------------------------
	
	for( i = 0 ; i < saved.length; i++ )
	{
		if ( saved[i] != "" )
		{
			if ( saved[i] == id )
			{
				 add = 0;
			}
			else
			{
				clean[clean.length] = saved[i];
			}
		}
	}
	
	//-----------------------------------
	// Add?
	//-----------------------------------
	
	if ( add )
	{
		clean[ clean.length ] = id;
		eval("document.mad_"+id+".src=removequotebutton");
	}
	else
	{
		eval(" document.mad_"+id+".src=addquotebutton");
	}
	
	my_setcookie( 'gal_pids', clean.join(','), 0 );
	
	return false;
}

function gallery_toggle_img( id )
{
	saved = new Array();
	clean = new Array();
	add   = 1;
	
	//-----------------------------------
	// Get form info
	//-----------------------------------
	
	tmp = document.modform.selectedimgids.value;
	
	saved = tmp.split(",");
	
	//-----------------------------------
	// Remove bit if exists
	//-----------------------------------
	
	for( i = 0 ; i < saved.length; i++ )
	{
		if ( saved[i] != "" )
		{
			if ( saved[i] == id)
			{
				 add = 0;
			}
			else
			{
				clean[clean.length] = saved[i];
			}
		}
	}
	
	//-----------------------------------
	// Add?
	//-----------------------------------
	
	if ( add )
	{
		clean[ clean.length ] = id;
		eval("document.img"+id+".src=selectedbutton");
	}
	else
	{
		eval(" document.img"+id+".src=unselectedbutton");
	}
	
	newvalue = clean.join(',');
	
	my_setcookie( 'modimgids', newvalue, 0 );
	
	document.modform.selectedimgids.value = newvalue;
	
	newcount = stacksize(clean);
	
	document.modform.gobutton.value = lang_gobutton + '(' + newcount + ')';
	
	return false;
}