Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
- release 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wout fierens committed Dec 1, 2009
1 parent b1fa1a1 commit 265d4d8
Show file tree
Hide file tree
Showing 8 changed files with 5,063 additions and 0 deletions.
Empty file removed README
Empty file.
20 changes: 20 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Raphaël SVG import plugin - 0.0.1

### What is it?
An extension to the Raphael Vector Library.
It enables Raphael to import raw SVG data.

### Dependencies
- [Raphael JS](http://raphaeljs.com/)
- [Prototype JS](http://prototypejs.org/)

### Important
- This plugin is still under development
- It requires the Prototype JS library

### To-do
- SVG group to Raphael set conversion
- line recognition
- text recognition
- image recognition
- writing tests (yes I've been lazy :-)
37 changes: 37 additions & 0 deletions demo/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Raphael SVG Import - Interactive demo</title>
<style type="text/css" media="screen">
body, html {
margin: 0;
padding: 0;
background-color: #fff;
height: 100%;
}
#paper {
width:100%;
height: 100%;
}
#buttons {
position: absolute;
right: 10px;
top: 10px;
}
</style>
</head>

<body>
<div id="paper"></div>
<div id="buttons">
<input type="button" name="import" value="Import SVG" class="button" onclick="Demo.importSVG()" />
</div>
</body>
<script src="../lib/prototype.js" type="text/javascript" charset="utf-8"></script>
<script src="../lib/onresize.js" type="text/javascript" charset="utf-8"></script>
<script src="../lib/raphael-min.js" type="text/javascript" charset="utf-8"></script>
<script src="../src/raphael-svg-import.js" type="text/javascript" charset="utf-8"></script>
<script src="../src/demo.js" type="text/javascript" charset="utf-8"></script>
</html>
24 changes: 24 additions & 0 deletions lib/onresize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* onResize 0.0.1 - Extension to Prototype JS
*
* Copyright (c) 2009 Wout Fierens
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
Object.extend(window, {
fire: Element.Methods.fire.methodize(),
observe: Element.Methods.observe.methodize(),
stopObserving: Element.Methods.stopObserving.methodize()
});

(document.onresize ? document : window).observe("resize", function() {
if (!document.viewport.is_resized) {
document.viewport.is_resized = true;
window.fire("resize:start");
resizeEnd = (function() {
document.viewport.is_resized = false;
window.fire("resize:end");
Event.stopObserving(document, "mousemove");
}).bind(this);
document.observe("mousemove", resizeEnd);
}
});
Loading

0 comments on commit 265d4d8

Please sign in to comment.