ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[livejournal] r17471: LJSUP-6110: Livejournal Live - LJSUP-701...

Committer: ssafronova
LJSUP-6110: Livejournal Live - LJSUP-7011: Modify LJ::need_res to include additional params
U   trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2010-09-30 05:52:12 UTC (rev 17470)
+++ trunk/cgi-bin/weblib.pl	2010-09-30 06:31:54 UTC (rev 17471)
@@ -1239,10 +1239,19 @@
 ## Support for conditional file inclusion:
 ## e.g. LJ::need_res( {condition => 'IE'}, 'ie.css', 'myie.css') will result in
 ## <!--[if IE]><link rel="stylesheet" type="text/css" href="$statprefix/..." /><![endif]-->
+## Support 'args' option. Example: LJ::need_res( { args => 'media="screen"' }, 'stc/ljtimes/iframe.css' );
+## Results in: <link rel="stylesheet" type="text/css" href="http://stat.lj-3-32.bulyon.local/ljtimes/iframe.css?v=1285833891" media="screen"/>
+## LJ::need_res( {clean_list} ) will suppress ALL previous resources and do NOTHING more!
 sub need_res {
     my $opts = (ref $_[0]) ? shift : {};
     my @keys = @_;
 
+    if ($opts->{clean_list}) {
+        %LJ::NEEDED_RES = ();
+        @LJ::NEEDED_RES = ();
+        return;
+    }
+
     ## Filter included res.
     ## if resource is a part of a common set, skip it here
     ## and add to page inside the set.

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