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

[ljcom] r7584: LJSUP-4757: Preparation for reskining

Committer: gariev
LJSUP-4757: Preparation for reskining

U   trunk/cgi-bin/LJ/Hooks/Homepage.pm
U   trunk/cgi-bin/bml/scheme/lanzelot.look
Modified: trunk/cgi-bin/LJ/Hooks/Homepage.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/Homepage.pm	2009-08-20 09:33:51 UTC (rev 7583)
+++ trunk/cgi-bin/LJ/Hooks/Homepage.pm	2009-08-20 10:55:20 UTC (rev 7584)
@@ -1,6 +1,24 @@
 package LJ::LJcom;
 use strict;
 
+LJ::register_hook("service_page_reskining", sub {
+    
+    ## Only homepage must be reskined
+    my $uri = BML::get_uri();
+    return unless $uri eq '/index.bml' or $uri eq '/';
+    
+    ## Only US-users are affected
+    my $country = LJ::GeoLocation->get_country_info_by_ip();
+    # TODO: uncomment the next line before final commit
+    #return unless $country eq 'US';
+    
+    # TODO: uncomment the next line after css file is created
+    #LJ::need_res("stc/reskining.css");
+    return q{
+        <div class="b-reskining-header">HELLO!</div>
+    };
+});
+
 LJ::register_hook("homepage_sidebar", sub {
     my $u = shift;
     my %opts = @_;

Modified: trunk/cgi-bin/bml/scheme/lanzelot.look
===================================================================
--- trunk/cgi-bin/bml/scheme/lanzelot.look	2009-08-20 09:33:51 UTC (rev 7583)
+++ trunk/cgi-bin/bml/scheme/lanzelot.look	2009-08-20 10:55:20 UTC (rev 7584)
@@ -86,8 +86,17 @@
     };
 } _code?>
 
-    <?_code LJ::need_res( {condition => 'IE'}, 'stc/lanzelot/css/ie.css'); return ''; _code?> 
+    <?_code 
+        LJ::need_res( {condition => 'IE'}, 'stc/lanzelot/css/ie.css'); 
 
+        ## reskining hook must be called just before LJ::res_includes(), 
+        ## as it may need_res() some css that must be the last in line
+        use vars '$reskining_html';
+        $reskining_html = LJ::run_hook('service_page_reskining');
+
+        return ''; 
+    _code?> 
+
     <?_code LJ::res_includes() _code?>
 
     <link rel="SHORTCUT ICON" href="<?siteroot?>/favicon.ico">
@@ -106,6 +115,7 @@
 <body %%bodyopts%%>
         <div id="header">
                 <h1 class="logo"><a href="<?siteroot?>">LiveJournal.com</a></h1>
+                <?_code use vars '$reskining_html'; return $reskining_html; _code?>
                 <div class="options">
 
 <?_code

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 

  • 1 comment