fix expand/collapse in non-MSIE
This commit is contained in:
@@ -60,7 +60,7 @@ void TranslatedWrite( RageFile &f, CString s )
|
|||||||
static int g_Level = 1;
|
static int g_Level = 1;
|
||||||
|
|
||||||
inline CString MakeUniqueId() { CString s="id"+ssprintf("%d%d%d",rand(),rand(),rand()); return s; }
|
inline CString MakeUniqueId() { CString s="id"+ssprintf("%d%d%d",rand(),rand(),rand()); return s; }
|
||||||
inline void PRINT_OPEN(RageFile &f,CString sName,bool bExpanded,CString sID){ g_Level++; ASSERT(g_Level>0 && g_Level<6); TranslatedWrite(f,ssprintf("<div class='section%d'>\n" "<h%d onClick='expandIt(%s); return false' CLASS='outline'>%s</h%d>\n" "<DIV ID='%s' CLASS='%s'>\n", g_Level, g_Level, sID.c_str(), sName.c_str(), g_Level, sID.c_str(), bExpanded?"visibletext":"hiddentext") ); }
|
inline void PRINT_OPEN(RageFile &f,CString sName,bool bExpanded,CString sID){ g_Level++; ASSERT(g_Level>0 && g_Level<6); TranslatedWrite(f,ssprintf("<div class='section%d'>\n" "<h%d onClick=\"toggle('%s');\" CLASS='outline'>%s</h%d>\n" "<DIV ID='%s'%s>\n", g_Level, g_Level, sID.c_str(), sName.c_str(), g_Level, sID.c_str(), bExpanded?"":" CLASS='hiddentext'") ); }
|
||||||
inline void PRINT_OPEN(RageFile &f,CString sName,bool bExpanded=false) { PRINT_OPEN(f,sName,bExpanded,MakeUniqueId()); }
|
inline void PRINT_OPEN(RageFile &f,CString sName,bool bExpanded=false) { PRINT_OPEN(f,sName,bExpanded,MakeUniqueId()); }
|
||||||
inline void PRINT_CLOSE(RageFile &f) { TranslatedWrite(f, "</div>\n" "</div>\n" ); g_Level--; ASSERT(g_Level>=0); }
|
inline void PRINT_CLOSE(RageFile &f) { TranslatedWrite(f, "</div>\n" "</div>\n" ); g_Level--; ASSERT(g_Level>=0); }
|
||||||
|
|
||||||
@@ -1402,33 +1402,19 @@ void SaveStatsWebPage(
|
|||||||
<head>\n\
|
<head>\n\
|
||||||
<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=UTF-8\">\n\
|
<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=UTF-8\">\n\
|
||||||
<title>%s</title>\n\
|
<title>%s</title>\n\
|
||||||
<SCRIPT LANGUAGE=\"JavaScript\" TYPE=\"text/javascript\">\n\
|
<script language=\"JavaScript\"><!--\n\
|
||||||
<!-- // hide from old browsers\n\
|
function toggle(object) {\n\
|
||||||
\n\
|
if (document.getElementById && document.getElementById(object) != null)\n\
|
||||||
// hide text from MSIE browsers\n\
|
node = document.getElementById(object).style.display = (document.getElementById(object).style.display=='block') ? 'none' : 'block';\n\
|
||||||
\n\
|
else if (document.layers && document.layers[object] != null)\n\
|
||||||
with (document)\n\
|
document.layers[object].display = (document.layers[object].display=='block') ? 'none' : 'block';\n\
|
||||||
{\n\
|
else if (document.all)\n\
|
||||||
write(\"<STYLE TYPE='text/css'>\");\n\
|
document.all[object].style.display = (document.all[object].style.display=='block') ? 'none' : 'block';\n\
|
||||||
if (navigator.appName == 'Microsoft Internet Explorer')\n\
|
|
||||||
{\n\
|
|
||||||
write(\".hiddentext {display:none} .visibletext {display:block} .outline {cursor:hand; text-decoration:underline}\");\n\
|
|
||||||
}\n\
|
}\n\
|
||||||
write(\"</STYLE>\");\n\
|
//--></script>\n\
|
||||||
}\n\
|
<style type='text/css'><!--\n\
|
||||||
\n\
|
.hiddentext {display:none} .outline {cursor:hand; text-decoration:underline}\n\
|
||||||
// show text on click for MSIE browsers\n\
|
//--></style>\n\
|
||||||
\n\
|
|
||||||
function expandIt(whichEl)\n\
|
|
||||||
{\n\
|
|
||||||
if (navigator.appName == 'Microsoft Internet Explorer')\n\
|
|
||||||
{\n\
|
|
||||||
whichEl.style.display = (whichEl.style.display == \"block\" ) ? \"none\" : \"block\";\n\
|
|
||||||
}\n\
|
|
||||||
else return;\n\
|
|
||||||
}\n\
|
|
||||||
// end hiding from old browsers -->\n\
|
|
||||||
</SCRIPT>\n\
|
|
||||||
<link rel='stylesheet' type='text/css' href='%s'>\n\
|
<link rel='stylesheet' type='text/css' href='%s'>\n\
|
||||||
</head>\n\
|
</head>\n\
|
||||||
<body>",
|
<body>",
|
||||||
|
|||||||
Reference in New Issue
Block a user