Савинцев Егор 🚶 (savintsev_egor) wrote in changelog,
Савинцев Егор 🚶
savintsev_egor
changelog

[ljcom] r10691: LJSUP-9106: Minimalism NeedRes

Committer: esavintcev
LJSUP-9106: Minimalism NeedRes
U   trunk/bin/upgrading/s2layers/sup/layout.s2
U   trunk/htdocs/stc/sup/s/x-1.css
U   trunk/htdocs/stc/sup/s/x-5.css
Modified: trunk/bin/upgrading/s2layers/sup/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sup/layout.s2	2011-06-23 10:01:58 UTC (rev 10690)
+++ trunk/bin/upgrading/s2layers/sup/layout.s2	2011-06-23 10:33:30 UTC (rev 10691)
@@ -255,36 +255,34 @@
 }
 
 function _print_CSS {
+    var Page p = get_page();
+    
     if ($*use_stylesheets) {
-        """\n    <link rel="stylesheet" type="text/css" media="screen" href="$*STATDIR/sup/s/style.css" />""";
-        """\n    <link rel="stylesheet" type="text/css" media="print" href="$*STATDIR/sup/s/print.css" />""";
+        $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/style.css"]);
+        $p->need_res({"args" => "media=\"print\"" }, ["stc/sup/s/print.css"]);
+        
         if ($*use_theme_stylesheet) {
-            if ($*active_theme == "x0") {
-                """\n    <link rel="stylesheet" type="text/css" media="screen" href="$*STATDIR/sup/s/x-0.css" />""";
+            if ($*active_theme == "x0") {                
+                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-0.css"]);
             } elseif ($*active_theme == "x1") {
-                """\n    <link rel="stylesheet" type="text/css" media="screen" href="$*STATDIR/sup/s/x-1.css" />""";
-            } elseif ($*active_theme == "x2") {
-                """\n    <link rel="stylesheet" type="text/css" media="screen" href="$*STATDIR/sup/s/x-2.css" />""";
-            } elseif ($*active_theme == "x3") {
-                """\n    <link rel="stylesheet" type="text/css" media="screen" href="$*STATDIR/sup/s/x-3.css" />""";
-            } elseif ($*active_theme == "x4") {
-                """\n    <link rel="stylesheet" type="text/css" media="screen" href="$*STATDIR/sup/s/x-4.css" />""";
+                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-0.css"]);
+                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-1.css"]);
+            } elseif ($*active_theme == "x2") {                
+                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-2.css"]);
+            } elseif ($*active_theme == "x3") {                
+                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-3.css"]);
+            } elseif ($*active_theme == "x4") {                
+                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-4.css"]);
             } elseif ($*active_theme == "x5") {
-                """\n    <link rel="stylesheet" type="text/css" media="screen" href="$*STATDIR/sup/s/x-5.css" />""";
+                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-4.css"]);
+                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-5.css"]);
             }
-            if ($*theme_css) {
-                """\n    <link rel="stylesheet" type="text/css" media="screen" href="$*STATDIR/sup/s/$*theme_css" />""";
-            }
-            """\n    <!--[if IE]><link rel="stylesheet" type="text/css" media="screen" href="$*STATDIR/sup/s/ie.css" /><![endif]-->""";
+            if ($*theme_css) {                
+                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/$*theme_css"]);
+            }            
+            $p->need_res({"condition" => "IE","args" => "media=\"screen\"" }, ["stc/sup/s/ie.css"]);
         }
     }
-    if ($*linked_stylesheet) {
-        print safe """\n    <link rel="stylesheet" type="text/css" href="$*linked_stylesheet" />""";
-    }
-    if ($*custom_css) {
-        print safe """\n    <style type="text/css">\n$*custom_css\n    </style>\n""";
-    }
-
 }
 
 function _user_print(UserLite user, string mode) : string {
@@ -721,7 +719,7 @@
 function _Header {
     var Page p = get_page();
     """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$*lang_current">\n<head>\n    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9" />\n    <title>""" + $p->title() + """</title>\n""";
-    $p->print_head();
+  
     var string prev = "";
     var string next = "";
     if ($p.view=="recent") {
@@ -746,7 +744,17 @@
     }
 
     _print_CSS();
-    """\n<script type="text/javascript" src="$*STATDIR/js/s2.js"></script>\n""";
+    
+    $p->need_res(["js/s2.js"]);
+    $p->print_head();
+
+    if ($*linked_stylesheet) {
+        print safe """\n    <link rel="stylesheet" type="text/css" href="$*linked_stylesheet" />""";
+    }
+    if ($*custom_css) {
+        print safe """\n    <style type="text/css">\n$*custom_css\n    </style>\n""";
+    }
+
     """\n</head>\n<body class="$*body_classes">""";
 }
 function _Footer {

Modified: trunk/htdocs/stc/sup/s/x-1.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-1.css	2011-06-23 10:01:58 UTC (rev 10690)
+++ trunk/htdocs/stc/sup/s/x-1.css	2011-06-23 10:33:30 UTC (rev 10691)
@@ -1,4 +1,3 @@
-@import "x-0.css";
 
 .content .header .nav .item-addfriend, .content .header .nav .item-rss {
 	top:3px;
@@ -132,4 +131,4 @@
 				}
 .content .header H1 {
 	height:40px;
-	}	
\ No newline at end of file
+	}	

Modified: trunk/htdocs/stc/sup/s/x-5.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-5.css	2011-06-23 10:01:58 UTC (rev 10690)
+++ trunk/htdocs/stc/sup/s/x-5.css	2011-06-23 10:33:30 UTC (rev 10691)
@@ -1,4 +1,3 @@
-@import "x-4.css";
 #page .header {
 	clear:both;
 	overflow:hidden;

Tags: css, ljcom, s2, savintsev_egor
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