Permalink
Browse files

Added CSS stamping for Loader detection

  • Loading branch information...
1 parent cb92449 commit e1b5751d4f8fb61a9f0fa49030cab5b8f548ffc3 @davglass committed Nov 30, 2011
@@ -114,6 +114,8 @@
<basename property="skin.name" file="@{skin.dir}"/>
<echo level="info">Concating Skin files for @{skin.dir} :: ${skin.name}</echo>
<concatsource destfile="${component.builddir}/assets/skins/${skin.name}/${component}.css" sourcedir="${component.assets.base}" sourcefiles="${component}-core.css, skins/${skin.name}/${component}-skin.css" />
+ <!-- Stamp Skin CSS -->
+ <stampcss file="${component.builddir}/assets/skins/${skin.name}/${component}.css" module="skin-${skin.name}-${component}" />
<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}" />
<var name="skin.name" unset="true" />
</sequential>
@@ -0,0 +1,2 @@
+/* YUI CSS Detection Stamp */
+#yui3-css-stamp.@MODULE@ { display: none; }
@@ -9,6 +9,7 @@
<target name="buildcore">
<concatsource destfile="${component.builddir}/${component.basefilename}.css" sourcedir="${component.cssfiles.base}" sourcefiles="${component.cssfiles}" />
+ <stampcss file="${component.builddir}/${component.basefilename}.css" module="${component}" />
</target>
<target name="minify">
@@ -380,5 +380,21 @@
</sequential>
</macrodef>
+
+ <macrodef name="stampcss">
+ <attribute name="module" />
+ <attribute name="file" />
+ <sequential>
+ <loadfile srcfile="${builddir}/files/css-stamp.txt" property="@{module}" >
+ <filterchain>
+ <replacetokens>
+ <token key="MODULE" value="@{module}"/>
+ </replacetokens>
+ </filterchain>
+ </loadfile>
+ <echo level="info">Adding CSS Registration Code to @{file}</echo>
+ <concat destfile="@{file}" append="true" fixlastline="true">${@{module}}</concat>
+ </sequential>
+ </macrodef>
</project>

0 comments on commit e1b5751

Please sign in to comment.