/* $Id: module.js 573 2007-09-08 19:14:26Z zapotek $ */
/* __________________________________________________________________ */
var Obj = new Array();
/**
* Shows/hides the quick help body
*/
function toggleQuickHelp( e ) {
el = Event.getTarget(e);
if( Dom.getStyle( 'quickHelp', 'display' ) == 'none' ) {
el.innerHTML = '';
Dom.setStyle( 'quickHelp', 'display', 'block' );
} else {
el.innerHTML = '';
Dom.setStyle( 'quickHelp', 'display', 'none' );
}
}
/**
* Outputs a message/warning/error
*/
function showMessage( msg, container_id ) {
if( !container_id )
container_id = 'customMessage';
container = $(container_id);
if( !container ) return;
var html = '
'+ msg['text'] +'
';
container.innerHTML = html;
// turn opacity back on
YAHOO.util.Dom.setStyle( container_id, 'display', 'block' );
// turn opacity back on
YAHOO.util.Dom.setStyle( container_id, 'opacity', 100 );
// animate
YAHOO.example.init( container_id );
}
function highlight( el ) {
if( !el ) {
// hightlight the globally saved line
Dom.addClass( $(gbl.currentHighlight), 'selected' );
} else {
// remove the class from a previously highlited line
Dom.removeClass( gbl.currentHighlight, 'selected' );
if( typeof el != 'object' ) {
// hightlight a line by ID
Dom.addClass( $('mngTableLine_'+ el), 'selected' );
// save its id
gbl.currentHighlight = el;
} else {
// hightlight the line
Dom.addClass( el, 'selected' );
// save its id
gbl.currentHighlight = el.id;
}
} // end if( !el ) ...
} // end highlight( )
function toggleElementDisplay( id ){
if( $(id).style.display == 'none' || $(id).style.display == '' ){
$(id).style.display = 'block';
sign = '[-]';
} else {
$(id).style.display = 'none';
sign = '[+]';
}
if( $(id + '_sign') ){
$(id + '_sign').innerHTML = sign;
}
}
/**
* make an element disappear
*
* @param string the div ID
* @return void
*
**/
function hideElement( id ){
$(id).style.display = 'none';
}
/**
* make an element re-appear
*
* @param string the div ID
* @return void
**/
function showElement( id ){
$(id).style.display = 'block';
}
/**
* get an element's position
*
* @param string the div ID
* @return array X,Y
**/
getXY = function( pID ) {
var curleft = curtop = 0;
var obj = $( pID );
if( obj.offsetParent ) {
curleft = obj.offsetLeft;
curtop = obj.offsetTop;
while( obj = obj.offsetParent ) {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
}
}
return [curleft,curtop];
} // end of getXY()
var params = {
'action' : 'loadReleases',
'releasesOrderBy' : 'release_version',
'releasesOrderWay' : 'DESC',
'catOrderBy' : 'caption',
'catOrderWay' : 'ASC',
'lang_iso' : 'en',
'lang' : 'en',
'content_lang' : '',
'projects_id' : '9',
'field' : 0,
'value' : 0
}
gbl.handler = '/projects/ajax/ajax_handler.php';
function projects_init( ) {
loadReleases();
if( $('releaseList') )
toggleElementDisplay('releaseList');
if( $('screenshots') )
toggleElementDisplay('screenshots');
}
function loadReleases( ) {
params.projects_id = params.projects_id;
var myCallback = function(o) {
if( $('releaseList') )
$('releaseList').innerHTML = o.responseText;
}
SENTEL.util.sendRequest( 'loadReleases', myCallback );
}
function changeReleaseOrder( releasesOrderBy ) {
if( !releasesOrderBy ) return;
if( params.releasesOrderBy == releasesOrderBy ) {
if( params.releasesOrderWay == 'ASC' ) params.releasesOrderWay = 'DESC';
else params.releasesOrderWay = 'ASC';
}
params.releasesOrderBy = releasesOrderBy;
loadReleases();
}