Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added CSS stamping for Loader detection

  • Loading branch information...
commit e1b5751d4f8fb61a9f0fa49030cab5b8f548ffc3 1 parent cb92449
Dav Glass authored November 30, 2011
2  componentbuild/3.x/module.xml
@@ -114,6 +114,8 @@
114 114
                 <basename property="skin.name" file="@{skin.dir}"/>
115 115
                 <echo level="info">Concating Skin files for @{skin.dir} :: ${skin.name}</echo>
116 116
                 <concatsource destfile="${component.builddir}/assets/skins/${skin.name}/${component}.css" sourcedir="${component.assets.base}" sourcefiles="${component}-core.css, skins/${skin.name}/${component}-skin.css" />
  117
+                <!-- Stamp Skin CSS -->
  118
+                <stampcss file="${component.builddir}/assets/skins/${skin.name}/${component}.css" module="skin-${skin.name}-${component}" />
117 119
                 <yuicompress type="css" src="${component.builddir}/assets/skins/${skin.name}/${component}.css" dest="${component.builddir}/assets/skins/${skin.name}/${component}.css" args="${yuicompressor.css.args.internal}" />
118 120
                 <var name="skin.name" unset="true" />
119 121
             </sequential> 
2  componentbuild/files/css-stamp.txt
... ...
@@ -0,0 +1,2 @@
  1
+/* YUI CSS Detection Stamp */
  2
+#yui3-css-stamp.@MODULE@ { display: none; }
1  componentbuild/shared/cssmodule.xml
@@ -9,6 +9,7 @@
9 9
 
10 10
     <target name="buildcore">
11 11
         <concatsource destfile="${component.builddir}/${component.basefilename}.css" sourcedir="${component.cssfiles.base}" sourcefiles="${component.cssfiles}" />
  12
+        <stampcss file="${component.builddir}/${component.basefilename}.css" module="${component}" />
12 13
     </target>
13 14
 
14 15
     <target name="minify">
16  componentbuild/shared/macrolib.xml
@@ -380,5 +380,21 @@
380 380
 
381 381
         </sequential>
382 382
     </macrodef>
  383
+
  384
+    <macrodef name="stampcss">
  385
+        <attribute name="module" />
  386
+        <attribute name="file" />
  387
+        <sequential>
  388
+            <loadfile srcfile="${builddir}/files/css-stamp.txt" property="@{module}" >
  389
+                <filterchain>
  390
+                    <replacetokens>
  391
+                        <token key="MODULE" value="@{module}"/>
  392
+                    </replacetokens>
  393
+                </filterchain>
  394
+            </loadfile>
  395
+            <echo level="info">Adding CSS Registration Code to @{file}</echo>
  396
+            <concat destfile="@{file}" append="true" fixlastline="true">${@{module}}</concat>
  397
+        </sequential>
  398
+    </macrodef>    
383 399
 	
384 400
 </project>

0 notes on commit e1b5751

Please sign in to comment.
Something went wrong with that request. Please try again.