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

[livejournal] r23324: LJSUP-14013 ([Friends Feed] Refactoring ...

Committer: ailyin
LJSUP-14013 ([Friends Feed] Refactoring of LJShare)
U   trunk/cgi-bin/LJ/Share.pm
Modified: trunk/cgi-bin/LJ/Share.pm
===================================================================
--- trunk/cgi-bin/LJ/Share.pm	2012-11-19 13:42:50 UTC (rev 23323)
+++ trunk/cgi-bin/LJ/Share.pm	2012-11-19 14:21:13 UTC (rev 23324)
@@ -17,6 +17,8 @@
 use LJ::Text;
 
 sub request_resources {
+    my ( $class, %opts ) = @_;
+
     return if $LJ::REQ_GLOBAL{'sharing_resources_requested'}++;
 
     LJ::need_res( qw( js/share.js stc/share.css ) );
@@ -71,7 +73,12 @@
 
     my $params_out = LJ::JSON->to_json($params);
 
-    LJ::include_raw( 'js' => "LJShare.init($params_out)" );
+    my $include_type = $opts{'include_type'} || 'init';
+    if ( $include_type eq 'init' ) {
+        LJ::include_raw( 'js' => "LJShare.init($params_out)" );
+    } elsif ( $include_type eq 'define' ) {
+        LJ::include_raw( 'js' => "Site.LJShareParams = $params_out;" );
+    }
 }
 
 sub render_js {

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