sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[livejournal] r23444: LJSUP-14497: Implement JS code to set lj...

Committer: vtroitsky
LJSUP-14497: Implement JS code to set ljuniq cookie for unauthorized users on m.livejournal.com for all top User Agents
U   trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2012-12-10 07:14:47 UTC (rev 23443)
+++ trunk/cgi-bin/weblib.pl	2012-12-10 11:29:42 UTC (rev 23444)
@@ -1513,6 +1513,7 @@
 sub res_includes {
     my $opts = shift || {};
     my $only_needed = $opts->{only_needed}; # do not include defaults
+    my $site_anyway = $opts->{site_anyway}; # Site anyway
 
     # TODO: automatic dependencies from external map and/or content of files,
     # currently it's limited to dependencies on the order you call LJ::need_res();
@@ -1550,7 +1551,7 @@
     }
 
     # include standard JS info
-    unless ( $only_needed ) {
+    unless ( $only_needed && !$site_anyway) {
         # find current journal
         my $journal_base = '';
         my $journal      = '';
@@ -1638,7 +1639,7 @@
         $site{is_dev_server} = 1 if $LJ::IS_DEV_SERVER;
         $site{inbox_unread_count} = $remote->notification_inbox->unread_count if $remote and LJ::is_enabled('inbox_unread_count_in_head');
 
-        LJ::run_hooks('add_to_site_js', \%site);
+        LJ::run_hooks('add_to_site_js', \%site) unless ($only_needed);
 
         LJ::need_var(D => \%LJ::JS_D) unless exists $LJ::JSVAR{'D'};
 

Tags: livejournal, pl, sunnyman, vtroitsky
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