Permalink
Browse files

Combine htc wrapper files into one

  • Loading branch information...
1 parent cac6afb commit 45381979a6a2b542aba1c5f6a5a4c5c7839723e7 Jason Johnston committed Nov 27, 2011
Showing with 31 additions and 24 deletions.
  1. +21 −15 build.xml
  2. +0 −9 sources/htc_close.txt
  3. +10 −0 sources/{htc_open.txt → htc_markup.htc}
View
36 build.xml
@@ -100,19 +100,22 @@
</filterchain>
</concat>
- <concat destfile="${build_dir}/PIE_uncompressed.htc">
- <fileset file="${src_dir}/htc_open.txt" />
- <fileset file="${src_dir}/htc_script.js" />
- <fileset file="${src_dir}/htc_close.txt" />
-
+ <loadfile property="htc_script_uncompressed" srcFile="${src_dir}/htc_script.js">
<filterchain>
<tokenfilter>
- <replacestring from="$Version$" to="${version}" />
<replacestring from="$JSVariant$" to="_uncompressed" />
<replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
</tokenfilter>
</filterchain>
- </concat>
+ </loadfile>
+ <copy file="${src_dir}/htc_markup.htc" tofile="${build_dir}/PIE_uncompressed.htc">
+ <filterchain>
+ <tokenfilter>
+ <replacestring from="$Version$" to="${version}" />
+ <replacestring from="$Contents$" to="${htc_script_uncompressed}" />
+ </tokenfilter>
+ </filterchain>
+ </copy>
</target>
<target name="build-compressed" depends="build-uncompressed">
@@ -145,22 +148,25 @@
--externs ${src_dir}/closure_externs.js' />
</exec>
- <concat destfile="${build_dir}/PIE.htc">
- <fileset file="${src_dir}/htc_open.txt" />
- <fileset file="${build_dir}/htc_script_compressed.js" />
- <fileset file="${src_dir}/htc_close.txt" />
-
+ <loadfile property="htc_script_compressed" srcFile="${build_dir}/htc_script_compressed.js">
+ <filterchain>
+ <tokenfilter>
+ <replacestring from="$JSVariant$" to="" />
+ <replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+ <copy file="${src_dir}/htc_markup.htc" tofile="${build_dir}/PIE.htc">
<filterchain>
<striplinecomments>
<comment value="//#" />
</striplinecomments>
<tokenfilter>
+ <replacestring from="$Contents$" to="${htc_script_compressed}" />
<replacestring from="$Version$" to="${version}" />
- <replacestring from="$JSVariant$" to="" />
- <replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
</tokenfilter>
</filterchain>
- </concat>
+ </copy>
<delete file="${build_dir}/temp.js" />
<delete file="${build_dir}/htc_script_compressed.js" />
View
9 sources/htc_close.txt
@@ -1,9 +0,0 @@
-</script>
-
-//# IE will sometimes hang for a long time on unload of pages with .htc behaviors
-//# attached to many elements, if the script block is a certain size. We can work
-//# around this by including an empty vbscript block at the end. For more details:
-//# http://www.pcreview.co.uk/forums/htc-components-512-bytes-javascript-slow-unload-t727396.html
-//# http://code.google.com/p/svgweb/source/browse/trunk/src/svg.htc
-<script type="text/vbscript"></script>
-</PUBLIC:COMPONENT>
View
10 sources/htc_open.txt → sources/htc_markup.htc
@@ -10,3 +10,13 @@ Dual-licensed for use under the Apache License Version 2.0 or the General Public
<PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="init()" />
<PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" />
<script type="text/javascript">
+$Contents$
+</script>
+
+//# IE will sometimes hang for a long time on unload of pages with .htc behaviors
+//# attached to many elements, if the script block is a certain size. We can work
+//# around this by including an empty vbscript block at the end. For more details:
+//# http://www.pcreview.co.uk/forums/htc-components-512-bytes-javascript-slow-unload-t727396.html
+//# http://code.google.com/p/svgweb/source/browse/trunk/src/svg.htc
+<script type="text/vbscript"></script>
+</PUBLIC:COMPONENT>

0 comments on commit 4538197

Please sign in to comment.