Skip to content
This repository
Browse code

Combine htc wrapper files into one

  • Loading branch information...
commit 45381979a6a2b542aba1c5f6a5a4c5c7839723e7 1 parent cac6afb
authored November 27, 2011
36  build.xml
@@ -100,19 +100,22 @@
100 100
             </filterchain>
101 101
         </concat>
102 102
 
103  
-        <concat destfile="${build_dir}/PIE_uncompressed.htc">
104  
-            <fileset file="${src_dir}/htc_open.txt" />
105  
-            <fileset file="${src_dir}/htc_script.js" />
106  
-            <fileset file="${src_dir}/htc_close.txt" />
107  
-
  103
+        <loadfile property="htc_script_uncompressed" srcFile="${src_dir}/htc_script.js">
108 104
             <filterchain>
109 105
                 <tokenfilter>
110  
-                    <replacestring from="$Version$" to="${version}" />
111 106
                     <replacestring from="$JSVariant$" to="_uncompressed" />
112 107
                     <replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
113 108
                 </tokenfilter>
114 109
             </filterchain>
115  
-        </concat>
  110
+        </loadfile>
  111
+        <copy file="${src_dir}/htc_markup.htc" tofile="${build_dir}/PIE_uncompressed.htc">
  112
+            <filterchain>
  113
+                <tokenfilter>
  114
+                    <replacestring from="$Version$" to="${version}" />
  115
+                    <replacestring from="$Contents$" to="${htc_script_uncompressed}" />
  116
+                </tokenfilter>
  117
+            </filterchain>
  118
+        </copy>
116 119
     </target>
117 120
 
118 121
     <target name="build-compressed" depends="build-uncompressed">
@@ -145,22 +148,25 @@
145 148
                        --externs ${src_dir}/closure_externs.js' />
146 149
         </exec>
147 150
 
148  
-        <concat destfile="${build_dir}/PIE.htc">
149  
-            <fileset file="${src_dir}/htc_open.txt" />
150  
-            <fileset file="${build_dir}/htc_script_compressed.js" />
151  
-            <fileset file="${src_dir}/htc_close.txt" />
152  
-
  151
+        <loadfile property="htc_script_compressed" srcFile="${build_dir}/htc_script_compressed.js">
  152
+            <filterchain>
  153
+                <tokenfilter>
  154
+                    <replacestring from="$JSVariant$" to="" />
  155
+                    <replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
  156
+                </tokenfilter>
  157
+            </filterchain>
  158
+        </loadfile>
  159
+        <copy file="${src_dir}/htc_markup.htc" tofile="${build_dir}/PIE.htc">
153 160
             <filterchain>
154 161
                 <striplinecomments>
155 162
                     <comment value="//#" />
156 163
                 </striplinecomments>
157 164
                 <tokenfilter>
  165
+                    <replacestring from="$Contents$" to="${htc_script_compressed}" />
158 166
                     <replacestring from="$Version$" to="${version}" />
159  
-                    <replacestring from="$JSVariant$" to="" />
160  
-                    <replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
161 167
                 </tokenfilter>
162 168
             </filterchain>
163  
-        </concat>
  169
+        </copy>
164 170
 
165 171
         <delete file="${build_dir}/temp.js" />
166 172
         <delete file="${build_dir}/htc_script_compressed.js" />
9  sources/htc_close.txt
... ...
@@ -1,9 +0,0 @@
1  
-</script>
2  
-
3  
-//# IE will sometimes hang for a long time on unload of pages with .htc behaviors
4  
-//# attached to many elements, if the script block is a certain size. We can work
5  
-//# around this by including an empty vbscript block at the end. For more details:
6  
-//# http://www.pcreview.co.uk/forums/htc-components-512-bytes-javascript-slow-unload-t727396.html
7  
-//# http://code.google.com/p/svgweb/source/browse/trunk/src/svg.htc
8  
-<script type="text/vbscript"></script>
9  
-</PUBLIC:COMPONENT>
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
10 10
 <PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="init()" />
11 11
 <PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" />
12 12
 <script type="text/javascript">
  13
+$Contents$
  14
+</script>
  15
+
  16
+//# IE will sometimes hang for a long time on unload of pages with .htc behaviors
  17
+//# attached to many elements, if the script block is a certain size. We can work
  18
+//# around this by including an empty vbscript block at the end. For more details:
  19
+//# http://www.pcreview.co.uk/forums/htc-components-512-bytes-javascript-slow-unload-t727396.html
  20
+//# http://code.google.com/p/svgweb/source/browse/trunk/src/svg.htc
  21
+<script type="text/vbscript"></script>
  22
+</PUBLIC:COMPONENT>

0 notes on commit 4538197

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