Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r19206: LJSUP-8952: <lj like> tag

Committer: gariev
LJSUP-8952: <lj like> tag
Moving Google JS from head to body for IE
U   branches/r79.4/cgi-bin/LJ/Hooks/LJLike.pm
Modified: branches/r79.4/cgi-bin/LJ/Hooks/LJLike.pm
===================================================================
--- branches/r79.4/cgi-bin/LJ/Hooks/LJLike.pm	2011-06-02 09:58:05 UTC (rev 19205)
+++ branches/r79.4/cgi-bin/LJ/Hooks/LJLike.pm	2011-06-02 11:31:39 UTC (rev 19206)
@@ -2,6 +2,7 @@
 use strict;
 use warnings;
 
+=comment
 LJ::register_hook( 'sitewide_resources' => sub {
     return if $LJ::REQ_GLOBAL{'sitewide_resources_ljlike_google'}++;
 
@@ -12,6 +13,7 @@
 
     LJ::include_raw( 'html' => qq{<script type="text/javascript" src="http://apis.google.com/js/plusone.js">{lang: $locale}</script>} );
 } );
+=cut
 
 LJ::register_hook( 'insert_html_after_body_open' => sub {
     my ($after_body_open_ref) = @_;
@@ -20,6 +22,12 @@
     my $locale = LJ::lang_to_locale($language);
 
     $$after_body_open_ref .= qq{<div id="fb-root"></div><script src="http://connect.facebook.net/$locale/all.js#appId=214181831945836&amp;xfbml=1"></script>};
+    if (!$LJ::REQ_GLOBAL{'sitewide_resources_ljlike_google'}++) {
+        my $language = LJ::Lang::get_remote_lang();
+        my $locale = LJ::lang_to_locale($language);
+        $locale =~ s/_.*//g;
+        $$after_body_open_ref .=  qq{<script type="text/javascript" src="http://apis.google.com/js/plusone.js">{lang: $locale}</script>};
+    }
 } );
 
 LJ::register_hook( 'sitewide_resources' => sub {

Tags: gariev, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments