var FCKTestConfig =
{
BasePath : "/FCKeditor/FCKtest",
EditorPath : "/FCKeditor/trunk"
};
var FCKTestUtils =
{
TagMap :
{
"BASEPATH" : FCKTestConfig.BasePath,
"EDITORPATH" : FCKTestConfig.EditorPath
},
ReplaceTags : function( str )
{
for( var i in this.TagMap )
str = str.replace( new RegExp( "\\$({|%7B)" + i + "(}|%7D)", 'g' ), this.TagMap[i] ) ;
return str ;
},
ProcessBody : function()
{
document.body.innerHTML = this.ReplaceTags( document.body.innerHTML ) ;
},
ProcessStyles : function()
{
if ( navigator.userAgent.search( 'MSIE' ) != -1 )
{
for ( var i = 0 ; i < document.styleSheets.length ; i++ )
document.styleSheets[i].cssText = this.ReplaceTags( document.styleSheets[i].cssText ) ;
}
else
{
var styleNodes = document.getElementsByTagName( 'style' ) ;
for ( var i = 0 ; i < styleNodes.length ; i++ )
styleNodes[i].innerHTML = this.ReplaceTags( styleNodes[i].innerHTML ) ;
}
},
GetCurrentPath : function()
{
var href = document.location.href ;
href = href.split( '/' ) ;
href.pop() ;
return href.join( '/' ) ;
},
LoadScript : function( url )
{
url = this.ReplaceTags( url ) ;
document.write( '' ) ;
},
LoadStyleSheet : function( url )
{
url = this.ReplaceTags( url ) ;
document.write( '' ) ;
}
};
FCKTestUtils.TagMap["CURRENTPATH"] = FCKTestUtils.GetCurrentPath() ;