|
The Project is a community-driven online strategy game. One of the most unique features is the modular game engine, which enables admins to create servers that each have drastically different gameplay. The Project is currently under heavy development.
); }
catch(e) { node.style.color = '#F00'; return; }
if( node.form.url.value.match( re ) )
node.style.color = '#0C0';
else
node.style.color = '';
}
function hoodlink_try_xpath( node, flash, focus, topp )
{
var e = node.value, s;
try { e = document.evaluate( e, document, null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); }
catch(e) { node.style.color = '#F00'; return; }
if( !e.snapshotLength )
return node.style.color = '';
node.style.color = '#0C0';
node = e.snapshotItem( 0 );
if( flash )
{
if( focus )
hoodlink_focus( node, topp );
hoodlink_flash( node );
}
}
function hoodlink_focus( node, topp )
{
var x = 0, y = 0, top = node;
do {
x += node.offsetLeft;
y += node.offsetTop;
} while( node = node.offsetParent );
if( !topp )
y = Math.max( y, y+top.offsetHeight-window.innerHeight-10 );
window.scrollTo( x, y );
}
function hoodlink_flash( node, c )
{
if( !c || c < 8 )
setTimeout( hoodlink_flash, 100, node, c = 1+(c||0) );
node.style.outline = c & 1 ? '3px solid red' : 'none';
}
function sanshash( url )
{
return url.replace( /#.*/, '' );
}
function hoodwink_get( xpath, root )
{
var doc = root ? root.evaluate ? root : root.ownerDocument : document;
if(!doc) return [];
var got = doc.evaluate( xpath, root||doc, null, 0, null ), next, result = [];
while( next = got.iterateNext() )
result.push( next );
return result;
}
function hoodwink_place_after( node, a, on, move )
{
if( !on ) return node.style.display = 'none';
if( move )
{
node.firstChild.href = sanshash( a.href ) +'#hoodwinks';
var x = 0, y = 0, parent = a;
do {
if( document.defaultView.getComputedStyle( parent, null )
.getPropertyValue('position') != 'static' )
break;
else
{
x += parent.offsetLeft;
y += parent.offsetTop;
}
} while( parent = parent.offsetParent );
node.style.left = (x + a.offsetWidth) +'px';
node.style.top = (y + a.offsetHeight - 16) +'px';
}
node.style.display = 'block';
}
var inited = false;
function hoodwink_winksums( visibility )
{
var sums = hoodwink_get( '//div[@class="hoodwinkSummary"]' ), a, i, node;
for( i in sums )
if( a = hoodwink_get( 'preceding-sibling::a[1]', node = sums[i] )[0] )
hoodwink_place_after( node, a, visibility, !inited );
if( sums.length > 20 ) // don't recalculate positions for winksum heavy pages
inited = true;
}
|
|