Permalink
Browse files

Split the monolithic PIE.htc into separate source files per class/com…

…ponent. Introduce simple ant-based build to concatenate and compress all the individual files into the single htc file.
  • Loading branch information...
1 parent 808847e commit 3e71920cda8b497dbbf7c4e809f849f39b2850b5 Jason Johnston committed Apr 9, 2010
Showing with 2,377 additions and 2,379 deletions.
  1. +1 −1 .gitignore
  2. +0 −2,335 PIE.htc
  3. +56 −0 build.xml
  4. +24 −0 sources/Angle.js
  5. +582 −0 sources/BackgroundAndBorderRenderer.js
  6. +248 −0 sources/BackgroundStyleInfo.js
  7. +94 −0 sources/BgPosition.js
  8. +129 −0 sources/BorderImageRenderer.js
  9. +55 −0 sources/BorderImageStyleInfo.js
  10. +60 −0 sources/BorderRadiusStyleInfo.js
  11. +76 −0 sources/BorderStyleInfo.js
  12. +133 −0 sources/BoxShadowRenderer.js
  13. +50 −0 sources/BoxShadowStyleInfo.js
  14. +34 −0 sources/Color.js
  15. +113 −0 sources/Length.js
  16. +2 −0 sources/PIE_close.js
  17. +16 −0 sources/PIE_open.js
  18. +138 −0 sources/RendererBase.js
  19. +88 −0 sources/RootRenderer.js
  20. +32 −0 sources/StyleBase.js
  21. +197 −0 sources/Tokenizer.js
  22. +56 −0 sources/Util.js
  23. +138 −0 sources/event_handlers.js
  24. +3 −0 sources/htc_close.txt
  25. +9 −0 sources/htc_open.txt
  26. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-001.htm
  27. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-002.htm
  28. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-003.htm
  29. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-004.htm
  30. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-005.htm
  31. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-006.htm
  32. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-007.htm
  33. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-008.htm
  34. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-009.htm
  35. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-010.htm
  36. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-011.htm
  37. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-012.htm
  38. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-013.htm
  39. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-014.htm
  40. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-015.htm
  41. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-016.htm
  42. +1 −1 tests/IE9 border-radius tests/border-radius-applies-to-017.htm
  43. +1 −1 tests/IE9 border-radius tests/border-radius-different-width-001.htm
  44. +1 −1 tests/IE9 border-radius tests/border-radius-initial-value-001.htm
  45. +2 −2 tests/IE9 border-radius tests/border-radius-not-inherited-001.htm
  46. +4 −4 tests/IE9 border-radius tests/border-radius-shorthand-001.htm
  47. +1 −1 tests/IE9 border-radius tests/border-radius-style-001.htm
  48. +1 −1 tests/IE9 border-radius tests/border-radius-style-002.htm
  49. +1 −1 tests/IE9 border-radius tests/border-radius-style-003.htm
  50. +1 −1 tests/IE9 border-radius tests/border-radius-style-004.htm
  51. +1 −1 tests/IE9 border-radius tests/border-radius-style-005.htm
  52. +1 −1 tests/IE9 border-radius tests/border-radius-sum-of-radii-001.htm
  53. +1 −1 tests/IE9 border-radius tests/border-radius-sum-of-radii-002.htm
  54. +1 −1 tests/IE9 border-radius tests/border-radius-with-three-values-001.htm
  55. +1 −1 tests/IE9 border-radius tests/border-radius-with-two-values-001.htm
  56. +1 −1 tests/IE9 border-radius tests/border-top-left-radius-values-001.htm
  57. +2 −2 tests/IE9 border-radius tests/border-top-left-radius-values-002.htm
  58. +1 −1 tests/IE9 border-radius tests/border-top-left-radius-values-003.htm
  59. +1 −1 tests/border-image-test.html
  60. +1 −1 tests/gradient-tests.html
  61. +1 −1 tests/multiple-bg-tests.html
  62. +1 −1 tests/stress-test.html
  63. +1 −1 tests/z-index-tests.html
View
@@ -1,2 +1,2 @@
.idea
-
+build
View
2,335 PIE.htc
Oops, something went wrong.
View
@@ -0,0 +1,56 @@
+<?xml version="1.0" ?>
+
+<project name="PIE" default="package" basedir=".">
+
+ <property name="build_dir" value="./build" />
+ <property name="src_dir" value="./sources" />
+
+ <target name="package-uncompressed">
+ <mkdir dir="${build_dir}" />
+ <concat destfile="${build_dir}/script_uncompressed.js">
+ <fileset file="${src_dir}/PIE_open.js" />
+ <fileset file="${src_dir}/Util.js" />
+ <fileset file="${src_dir}/Length.js" />
+ <fileset file="${src_dir}/BgPosition.js" />
+ <fileset file="${src_dir}/Angle.js" />
+ <fileset file="${src_dir}/Color.js" />
+ <fileset file="${src_dir}/Tokenizer.js" />
+ <fileset file="${src_dir}/StyleBase.js" />
+ <fileset file="${src_dir}/BackgroundStyleInfo.js" />
+ <fileset file="${src_dir}/BorderStyleInfo.js" />
+ <fileset file="${src_dir}/BorderRadiusStyleInfo.js" />
+ <fileset file="${src_dir}/BorderImageStyleInfo.js" />
+ <fileset file="${src_dir}/BoxShadowStyleInfo.js" />
+ <fileset file="${src_dir}/RendererBase.js" />
+ <fileset file="${src_dir}/RootRenderer.js" />
+ <fileset file="${src_dir}/BackgroundAndBorderRenderer.js" />
+ <fileset file="${src_dir}/BorderImageRenderer.js" />
+ <fileset file="${src_dir}/BoxShadowRenderer.js" />
+ <fileset file="${src_dir}/PIE_close.js" />
+ <fileset file="${src_dir}/event_handlers.js" />
+ </concat>
+
+ <concat destfile="${build_dir}/PIE_uncompressed.htc">
+ <fileset file="${src_dir}/htc_open.txt" />
+ <fileset file="${build_dir}/script_uncompressed.js" />
+ <fileset file="${src_dir}/htc_close.txt" />
+ </concat>
+ </target>
+
+ <target name="package-compressed" depends="package-uncompressed">
+ <!--<copy file="${build_dir}/script_uncompressed.js" tofile="${build_dir}/script_compressed.js" overwrite="true" />-->
+
+ <exec executable="yuicompressor">
+ <arg line="${build_dir}/script_uncompressed.js -o ${build_dir}/script_compressed.js" />
+ </exec>
+
+ <concat destfile="${build_dir}/PIE.htc">
+ <fileset file="${src_dir}/htc_open.txt" />
+ <fileset file="${build_dir}/script_compressed.js" />
+ <fileset file="${src_dir}/htc_close.txt" />
+ </concat>
+ </target>
+
+ <target name="package" depends="package-uncompressed,package-compressed" />
+
+</project>
View
@@ -0,0 +1,24 @@
+/**
+ * Wrapper for angle values; handles conversion to degrees from all allowed angle units
+ * @param val
+ */
+PIE.Angle = function( val ) {
+ this.val = val;
+};
+PIE.Angle.prototype = {
+ unitRE: /(deg|rad|grad|turn)$/,
+
+ getUnit: function() {
+ return this._unit || ( this._unit = this.val.match( this.unitRE )[1] );
+ },
+
+ degrees: function() {
+ var deg = this._deg, u, n;
+ if( !deg ) {
+ u = this.getUnit();
+ n = parseFloat( this.val, 10 );
+ deg = this._deg = ( u === 'deg' ? n : u === 'rad' ? n / Math.PI * 180 : u === 'grad' ? n / 400 * 360 : u === 'turn' ? n * 360 : 0 );
+ }
+ return deg;
+ }
+};
Oops, something went wrong.

0 comments on commit 3e71920

Please sign in to comment.