Correct a JS method name and format JS script

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@226900 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vincent Siveton 2005-08-01 22:30:26 +00:00
parent ec22f0087f
commit 2639914fee
1 changed files with 15 additions and 14 deletions

View File

@ -163,13 +163,15 @@ public class TeamListReport
startSection( getBundle( locale ).getString( "report.team-list.intro.title" ) ); startSection( getBundle( locale ).getString( "report.team-list.intro.title" ) );
// To handle JS // To handle JS
StringBuffer javascript = new StringBuffer( "function offsetDate(id, offset) {" ) StringBuffer javascript = new StringBuffer( "function offsetDate(id, offset) {\n" )
.append( "var now = new Date() ;" ).append( "var nowTime = now.getTime() ;" ) .append( " var now = new Date();\n" )
.append( "var localOffset = now.getTimezoneOffset() ;" ) .append( " var nowTime = now.getTime();\n" )
.append( "var developerTime = nowTime + ( offset * 60 * 60 * 1000 ) + ( localOffset * 60 * 1000 ) ;" ) .append( " var localOffset = now.getTimezoneOffset();\n" )
.append( "var developerDate = new Date(developerTime) ;" ).append( "" ) .append( " var developerTime = nowTime + ( offset * 60 * 60 * 1000 ) + ( localOffset * 60 * 1000 );\n" )
.append( "document.getElementById(id).innerHTML = developerDate;" ).append( "}" ).append( "" ) .append( " var developerDate = new Date(developerTime);\n" ).append( "\n" )
.append( "function init(){" ); .append( " document.getElementById(id).innerHTML = developerDate;\n" ).append( "}\n" )
.append( "\n" )
.append( "function init(){\n" );
// Intoduction // Intoduction
paragraph( getBundle( locale ).getString( "report.team-list.intro.description1" ) ); paragraph( getBundle( locale ).getString( "report.team-list.intro.description1" ) );
@ -232,8 +234,7 @@ public class TeamListReport
tableCell( developer.getOrganization() ); tableCell( developer.getOrganization() );
tableCell( createLinkPatternedText( developer.getOrganizationUrl(), tableCell( createLinkPatternedText( developer.getOrganizationUrl(), developer.getOrganizationUrl() ) );
developer.getOrganizationUrl() ) );
if ( developer.getRoles() != null ) if ( developer.getRoles() != null )
{ {
@ -253,7 +254,7 @@ public class TeamListReport
text( developer.getTimezone() ); text( developer.getTimezone() );
if ( !StringUtils.isEmpty( developer.getTimezone() ) ) if ( !StringUtils.isEmpty( developer.getTimezone() ) )
{ {
javascript.append( "offsetDate('developer-" + developersRows + "', '" ); javascript.append( " offsetDate('developer-" + developersRows + "', '" );
javascript.append( developer.getTimezone() ); javascript.append( developer.getTimezone() );
javascript.append( "');\n" ); javascript.append( "');\n" );
} }
@ -333,8 +334,8 @@ public class TeamListReport
tableCell( contributor.getOrganization() ); tableCell( contributor.getOrganization() );
tableCell( createLinkPatternedText( contributor.getOrganizationUrl(), tableCell( createLinkPatternedText( contributor.getOrganizationUrl(), contributor
contributor.getOrganizationUrl() ) ); .getOrganizationUrl() ) );
if ( contributor.getRoles() != null ) if ( contributor.getRoles() != null )
{ {
@ -354,7 +355,7 @@ public class TeamListReport
text( contributor.getTimezone() ); text( contributor.getTimezone() );
if ( !StringUtils.isEmpty( contributor.getTimezone() ) ) if ( !StringUtils.isEmpty( contributor.getTimezone() ) )
{ {
javascript.append( "offsetDate('contributor-" + contributorsRows + "', '" ); javascript.append( " offsetDate('contributor-" + contributorsRows + "', '" );
javascript.append( contributor.getTimezone() ); javascript.append( contributor.getTimezone() );
javascript.append( "');\n" ); javascript.append( "');\n" );
} }
@ -384,7 +385,7 @@ public class TeamListReport
endSection(); endSection();
// To handle JS // To handle JS
javascript.append( "}" ).append( "window.onload = init();" ); javascript.append( "}\n" ).append( "\n" ).append( "window.onLoad = init();\n" );
javaScript( javascript.toString() ); javaScript( javascript.toString() );
} }
} }