forked from lojjic/PIE
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Jason Johnston
committed
Apr 9, 2010
1 parent
808847e
commit 3e71920
Showing
63 changed files
with
2,377 additions
and
2,379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
.idea | ||
|
||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.