Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r19202: LJSUP-8952 (<lj like> tag)

Committer: ailyin
LJSUP-8952 (<lj like> tag)
U   trunk/cgi-bin/LJ/Hooks/LJLike.pm
Modified: trunk/cgi-bin/LJ/Hooks/LJLike.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/LJLike.pm	2011-06-02 08:53:43 UTC (rev 19201)
+++ trunk/cgi-bin/LJ/Hooks/LJLike.pm	2011-06-02 09:01:13 UTC (rev 19202)
@@ -1,34 +1,34 @@
-package LJ::Hooks::LJLike;-use strict;-use warnings;--LJ::register_hook( 'sitewide_resources' => sub {-    return 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;--    LJ::include_raw( 'html' => qq{<script type="text/javascript" src="http://apis.google.com/js/plusone.js">{lang: $locale}</script>} );-} );--LJ::register_hook( 'insert_html_after_body_open' => sub {-    my ($after_body_open_ref) = @_;--    my $language = LJ::Lang::get_remote_lang();-    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>};-} );--LJ::register_hook( 'sitewide_resources' => sub {-    return if $LJ::REQ_GLOBAL{'sitewide_resources_ljlike_vkontakte'}++;--    my $api_id = $LJ::VKONTAKTE_CONF->{'client_id'};--    LJ::include_raw( 'html' => qq{<script type="text/javascript" src="http://userapi.com/js/api/openapi.js?31"></script>}-                             . qq{<script type="text/javascript">VK.init({apiId: $api_id, onlyWidgets: true});</script>} );-} );--1;
\ No newline at end of file
+package LJ::Hooks::LJLike;
+use strict;
+use warnings;
+
+LJ::register_hook( 'sitewide_resources' => sub {
+    return 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;
+
+    LJ::include_raw( 'html' => qq{<script type="text/javascript" src="http://apis.google.com/js/plusone.js">{lang: $locale}</script>} );
+} );
+
+LJ::register_hook( 'insert_html_after_body_open' => sub {
+    my ($after_body_open_ref) = @_;
+
+    my $language = LJ::Lang::get_remote_lang();
+    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>};
+} );
+
+LJ::register_hook( 'sitewide_resources' => sub {
+    return if $LJ::REQ_GLOBAL{'sitewide_resources_ljlike_vkontakte'}++;
+
+    my $api_id = $LJ::VKONTAKTE_CONF->{'client_id'};
+
+    LJ::include_raw( 'html' => qq{<script type="text/javascript" src="http://userapi.com/js/api/openapi.js?31"></script>}
+                             . qq{<script type="text/javascript">VK.init({apiId: $api_id, onlyWidgets: true});</script>} );
+} );
+
+1;

Tags: andy, 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