2010-08-17, 11:03 AM
I have read over lots of the posts about it and tried it but it keeps removing my editor when I add it into headerinclude. Here is my script
What do I need to do to it so it wont mess up prototype or do i need to put something less in headerinclude? Please let me now asap.
Thanks
MouseX = 0;
MouseY = 0;
function getPageEventCoords(evt) {
var coords = {left:0, top:0};
if (evt.pageX) {
coords.left = evt.pageX;
coords.top = evt.pageY;
} else if (evt.clientX) {
coords.left =
evt.clientX + document.body.scrollLeft - document.body.clientLeft;
coords.top =
evt.clientY + document.body.scrollTop - document.body.clientTop;
// include html element space, if applicable
if (document.body.parentElement && document.body.parentElement.clientLeft) {
var bodParent = document.body.parentElement;
coords.left += bodParent.scrollLeft - bodParent.clientLeft;
coords.top += bodParent.scrollTop - bodParent.clientTop;
}
}
MouseX = coords.left;
MouseY = coords.top;
return coords;
}
function CreateFloatingDiv( x, y, id )
{
var Exists = $( '#'+id );
if ( Exists[0] )
{
Exists[0].style.left = x + 'px';
Exists[0].style.top = y + 'px';
Exists[0].style.display = 'none';
Exists.show( 'fast' );
return;
}
var div = document.createElement( 'div' );
div.style.left = x + 'px';
div.style.top = y + 'px';
div.style.position = "absolute";
div.style.background = "#FFF";
div.style.border = "1px solid #777";
div.style.padding = '5px';
div.style.color = '#555';
div.style.fontSize = '11px';
div.style.display = 'none';
div.className = "top";
div.id = id;
document.body.appendChild( div );
$( div ).show( 'fast' );
return div;
}
function OpenEvent( $data, $id )
{
var div = CreateFloatingDiv( MouseX, MouseY, 'Event_'+$id );
if (!div) return false;
div.innerHTML += 'Fetching..';
$(div).click( function(){ $(div).hide(); } );
$( div ).show( 'fast' );
$.get( '/index.php', 'aj=1&' + $data, function( d ) { div.innerHTML = d; }, "html" );
return false;
}
function CloseThis( pChild, reason )
{
if ( $( pChild ).hasClass("top") )
{
if ( reason )
{
pChild.innerHTML = reason;
$(pChild).fadeOut( 3000 );
}
else
{
$( pChild ).hide();
}
return false;
}
return CloseThis( pChild.parentNode, reason );
}
function OpenURLInBox( $name, $url )
{
var div = CreateFloatingDiv( MouseX, MouseY, $name );
if (!div) return false;
div.innerHTML += 'Fetching..';
//$(div).click( function(){ $(div).hide(); } );
$( div ).show("normal");
$.get( $url, '', function( d ) { div.innerHTML = d; }, "html" );
return false;
}
What do I need to do to it so it wont mess up prototype or do i need to put something less in headerinclude? Please let me now asap.
Thanks