fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-08-26 03:27 pm

[dw-nonfree] change order of need_res calls

[commit: http://hg.dwscoalition.org/dw-nonfree/rev/4dfb22e5ba03]

http://bugs.dwscoalition.org/show_bug.cgi?id=712

Enforce ordering on inclusion of resources, so that we can make site scheme
CSS come before per-page CSS. Includes a hack to make some pages respect old
behavior.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/bml/scheme/tropo-purple.look
  • cgi-bin/bml/scheme/tropo-red.look
--------------------------------------------------------------------------------
diff -r 42c3f204bf4e -r 4dfb22e5ba03 cgi-bin/bml/scheme/tropo-purple.look
--- a/cgi-bin/bml/scheme/tropo-purple.look	Mon Aug 23 18:33:10 2010 +0800
+++ b/cgi-bin/bml/scheme/tropo-purple.look	Thu Aug 26 23:27:05 2010 +0800
@@ -39,15 +39,15 @@ head<=
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 
     <?_code
-        LJ::need_res( "stc/lj_base-app.css" );
-        LJ::need_res( "stc/tropo/reset.css" );
-        LJ::need_res( "stc/tropo/tropo-base.css" );
-        LJ::need_res( "stc/tropo/tropo-purple.css" );
+        LJ::need_res( { priority => $LJ::SCHEME_RES_PRIORITY }, "stc/lj_base-app.css" );
+        LJ::need_res( { priority => $LJ::SCHEME_RES_PRIORITY }, "stc/tropo/reset.css" );
+        LJ::need_res( { priority => $LJ::SCHEME_RES_PRIORITY }, "stc/tropo/tropo-base.css" );
+        LJ::need_res( { priority => $LJ::SCHEME_RES_PRIORITY }, "stc/tropo/tropo-purple.css" );
 
         # we support both old style and new style pages; only one of these will get
         # loaded ...
-        LJ::need_res( {group=>'jquery'}, "js/nav-jquery.js" );
-        LJ::need_res( {group=>'default'}, "js/nav.js" );
+        LJ::need_res( { group => 'jquery', priority => $LJ::SCHEME_RES_PRIORITY }, "js/nav-jquery.js" );
+        LJ::need_res( { group => 'default', priority => $LJ::SCHEME_RES_PRIORITY }, "js/nav.js" );
     _code?>
     <?_code LJ::res_includes(); _code?>
 
diff -r 42c3f204bf4e -r 4dfb22e5ba03 cgi-bin/bml/scheme/tropo-red.look
--- a/cgi-bin/bml/scheme/tropo-red.look	Mon Aug 23 18:33:10 2010 +0800
+++ b/cgi-bin/bml/scheme/tropo-red.look	Thu Aug 26 23:27:05 2010 +0800
@@ -39,15 +39,15 @@ head<=
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 
     <?_code
-        LJ::need_res( "stc/lj_base-app.css" );
-        LJ::need_res( "stc/tropo/reset.css" );
-        LJ::need_res( "stc/tropo/tropo-base.css" );
-        LJ::need_res( "stc/tropo/tropo-red.css" );
+        LJ::need_res( { priority => $LJ::SCHEME_RES_PRIORITY }, "stc/lj_base-app.css" );
+        LJ::need_res( { priority => $LJ::SCHEME_RES_PRIORITY }, "stc/tropo/reset.css" );
+        LJ::need_res( { priority => $LJ::SCHEME_RES_PRIORITY }, "stc/tropo/tropo-base.css" );
+        LJ::need_res( { priority => $LJ::SCHEME_RES_PRIORITY }, "stc/tropo/tropo-red.css" );
 
         # we support both old style and new style pages; only one of these will get
         # loaded ...
-        LJ::need_res( {group=>'jquery'}, "js/nav-jquery.js" );
-        LJ::need_res( {group=>'default'}, "js/nav.js" );
+        LJ::need_res( { group => 'jquery', priority => $LJ::SCHEME_RES_PRIORITY }, "js/nav-jquery.js" );
+        LJ::need_res( { group => 'default', priority => $LJ::SCHEME_RES_PRIORITY }, "js/nav.js" );
     _code?>
     <?_code LJ::res_includes(); _code?>
 
--------------------------------------------------------------------------------