public/debug/phpunitwebui/js/functions.js
/*
 * Shows or hides the tests for a suite.
 *
 * @param string suite name
 * @param event object
 * @param boolean show
 */
Shows or hides the tests for a suite.
@param string suite name
@param event object
@param boolean show
Shows or hides the tests for a suite . @param string suite name @param event object @param boolean show
function toggleTests(name, event, show)
{
	var arrows = $('.arrow_suite');
	if (arrows.length == 0){
		var arrows = $('.arrow_suite');
	}
	arrows.attr('src', 'images/collapsed.png');
	var length = arrows.length;
	var testsDiv = $('#tests_'+name)
	if (show){
		var arrows = $('.arrow_suite');
		var length = arrows.length;
		for(i = 0; i< length; i++){
			$('#tests_'+name).hide(2);
		}
		testsDiv.show(2);
	}else{
		var mouseX = event.clientX;
		var mouseY = event.clientY;
		var position  = testsDiv.position();
		var maxY = position.top + testsDiv.height();
		var maxX = position.left + testsDiv.width();
		var divSelector = $('#suiteSelect_'+name);
		var divPosition = divSelector.position();
		var divWidth = divSelector.width();
		var divHeight = divSelector.height();
		if (
				mouseX < divPosition.left || mouseX > maxX ||
				( 
					(mouseX > ( divPosition.left+10 ) && mouseX < position.left) &&
					( 
						( mouseY > (divPosition.top + divHeight + 10)) ||
						( mouseY < (divPosition.top + 10) )
					) 
				) ||
				(
					(mouseX > position.left && mouseX < maxX) &&
					(
						mouseY > maxY || mouseY < position.top
					)
				)
			){
				$('#tests_'+name).hide('fast');
		}else{
			$('#tests_'+name).show(2);
		}
	}
}
function toggleTests ( name , event , show ) { var arrows = $ ( '.arrow_suite' ) ; if ( arrows . length == 0 ) { var arrows = $ ( '.arrow_suite' ) ; } arrows . attr ( 'src' , 'images/collapsed.png' ) ; var length = arrows . length ; var testsDiv = $ ( '#tests_' + name ) if ( show ) { var arrows = $ ( '.arrow_suite' ) ; var length = arrows . length ; for ( i = 0 ; i < length ; i ++ ) { $ ( '#tests_' + name ) . hide ( 2 ) ; } testsDiv . show ( 2 ) ; } else { var mouseX = event . clientX ; var mouseY = event . clientY ; var position = testsDiv . position ( ) ; var maxY = position . top + testsDiv . height ( ) ; var maxX = position . left + testsDiv . width ( ) ; var divSelector = $ ( '#suiteSelect_' + name ) ; var divPosition = divSelector . position ( ) ; var divWidth = divSelector . width ( ) ; var divHeight = divSelector . height ( ) ; if ( mouseX < divPosition . left || mouseX > maxX || ( ( mouseX > ( divPosition . left + 10 ) && mouseX < position . left ) && ( ( mouseY > ( divPosition . top + divHeight + 10 ) ) || ( mouseY < ( divPosition . top + 10 ) ) ) ) || ( ( mouseX > position . left && mouseX < maxX ) && ( mouseY > maxY || mouseY < position . top ) ) ) { $ ( '#tests_' + name ) . hide ( 'fast' ) ; } else { $ ( '#tests_' + name ) . show ( 2 ) ; } } }
Shows or hides the tests for a suite.
Shows or hides the tests for a suite .
/*		alert('x = '+ mouseX + ' y='+ mouseY+"\n" + 
				"x1 ="+position.left + ' y1 =' + position.top +"\n"+
				"x2 = "+ maxX + " y2 = "+ maxY +" \n"+
				"width = "+$('#tests_'+name).width() + "heigth = " + $('#tests_'+name).height());
				*/ //conditii pe orizontala // e pe div-ul de selector // adica e in afara div-ului pe verticala /*$('#teste').show();
				$('#teste').html('MouseX: ' + mouseX + "<br>" +
								 "MouseY: " + mouseY + "<br>" +
								 "divCuTeste:<br/>&nbsp;&nbsp;&nbsp;" +
								 "X: " + position.left + "<br/>&nbsp;&nbsp;&nbsp;" + 
								 "Y: " + position.top + "<br/>&nbsp;&nbsp;&nbsp;" +
								 "MaxX: " + maxX + "<br/>&nbsp;&nbsp;&nbsp;" + 
								 "MaxY: " + maxY + "<br>" +
								 "divSelector:<br/>&nbsp;&nbsp;&nbsp;" +
								 "X: " + divPosition.left + "<br/>&nbsp;&nbsp;&nbsp;" + 
								 "Y: " + divPosition.top + "<br/>&nbsp;&nbsp;&nbsp;" +
								 "MaxX: " + (divPosition.left+divWidth+10) + "<br/>&nbsp;&nbsp;&nbsp;" + 
								 "MaxY: " + (divPosition.top+divHeight+10) + "<br/>&nbsp;&nbsp;&nbsp;");
			 	/**/ //