Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dan Newcome
committed
Apr 13, 2012
1 parent
6531144
commit 3d13c37
Showing
3 changed files
with
48 additions
and
0 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
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
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,42 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<!-- test the donatello api features. --> | ||
<script src="../donatello.js" type="text/javascript"></script> | ||
<script src="../rect.js" type="text/javascript"></script> | ||
<script> | ||
var line; | ||
|
||
function main() { | ||
var paper = Donatello.paper('paper-div', 20, 20, 300, 300 ); | ||
|
||
// common attributes | ||
var attrs = { | ||
stroke:'red', | ||
'stroke-width':5 | ||
}; | ||
|
||
// nested objects using chaining | ||
paper | ||
.rect( 0, 0, 50, 50, attrs ) | ||
.rect( 10, 10, 50, 50, attrs ); | ||
|
||
// sibling objects using chaining | ||
paper | ||
.rect( 20, 20, 50, 50, attrs ).parent() | ||
.rect( 40, 40, 50, 50, attrs ); | ||
} | ||
|
||
</script> | ||
<style> | ||
#paper-div { | ||
border: 1px solid black | ||
} | ||
</style> | ||
|
||
</head> | ||
<body onload='main();'> | ||
<div id="paper-div"> | ||
</div> | ||
</body> | ||
</html> |