Committer: anazarov
LJSUP-11969: Add an api to insert translated template into pageU trunk/cgi-bin/LJ/S2/HeadContent.pm U trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/LJ/S2/HeadContent.pm =================================================================== --- trunk/cgi-bin/LJ/S2/HeadContent.pm 2012-04-28 07:36:07 UTC (rev 21840) +++ trunk/cgi-bin/LJ/S2/HeadContent.pm 2012-04-28 07:57:52 UTC (rev 21841) @@ -123,6 +123,7 @@ } $head_content .= LJ::res_includes() . $extra_js; + $head_content .= LJ::res_includes({ only_needed => 1, only_tmpl => 1 }); LJ::run_hooks( 'head_content', \$head_content ); my $get = $opts->{'getargs'}; Modified: trunk/cgi-bin/weblib.pl =================================================================== --- trunk/cgi-bin/weblib.pl 2012-04-28 07:36:07 UTC (rev 21840) +++ trunk/cgi-bin/weblib.pl 2012-04-28 07:57:52 UTC (rev 21841) @@ -1384,8 +1384,8 @@ $wstatprefix = $LJ::WSTATPREFIX; } - if ( $opts->{'only_tmpl'} ) {{ - # add jQuery.tmpl templates + # add jQuery.tmpl templates + if ( $opts->{'only_tmpl'} ) { my %loaded; foreach my $template (@LJ::INCLUDE_TEMPLATE) { my $path = [split m{(?<!\\)/}, $template]; @@ -1394,7 +1394,7 @@ shift @$path if $path->[0] eq 'templates'; $path = join '/', $LJ::TEMPLATE_BASE, @$path; - my $fpath = join('/', $path, $file); + my $fpath = join '/', $path, $file; -f $fpath or next; $loaded{$fpath}++ and next; @@ -1431,7 +1431,7 @@ } return $ret; - }} + } # include standard JS info unless ( $only_needed ) {