diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
commit | 1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch) | |
tree | 3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/gfx/demos/circles.html | |
parent | 104d59099e048688c4dbac37d72137006e396558 (diff) | |
download | semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2 |
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/gfx/demos/circles.html')
-rw-r--r-- | includes/js/dojox/gfx/demos/circles.html | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/includes/js/dojox/gfx/demos/circles.html b/includes/js/dojox/gfx/demos/circles.html deleted file mode 100644 index ce4d0cd..0000000 --- a/includes/js/dojox/gfx/demos/circles.html +++ /dev/null @@ -1,90 +0,0 @@ -<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> -<head> -<title>dojox.gfx: 100 draggable circles</title> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<style type="text/css"> - @import "../../../dojo/resources/dojo.css"; - @import "../../../dijit/tests/css/dijitTests.css"; -</style> -<!-- -The next line should include Microsoft's Silverligth.js, if you plan to use the silverlight backend -<script type="text/javascript" src="Silverlight.js"></script> ---> -<script type="text/javascript" src="../../../dojo/dojo.js"></script> -<script type="text/javascript"> - -dojo.require("dojox.gfx"); -dojo.require("dojox.gfx.move"); - -var container = null, - surface = null, - surface_size = null; - -function getRand(from, to){ - return Math.random() * (to - from) + from; -} - -var skew_stat_factor = 15; - -function getRandSkewed(from, to){ - // let skew stats to smaller values - var seed = 0; - for(var i = 0; i < skew_stat_factor; ++i){ - seed += Math.random(); - } - seed = 2 * Math.abs(seed / skew_stat_factor - 0.5); - return seed * (to - from) + from; -} - -function randColor(alpha){ - var red = Math.floor(getRand(0, 255)), - green = Math.floor(getRand(0, 255)), - blue = Math.floor(getRand(0, 255)), - opacity = alpha ? getRand(0.1, 1) : 1; - return [red, green, blue, opacity]; -} - -var gShapes = {} -var gShapeCounter = 0; - -function makeCircleGrid(itemCount){ - var minR = 10, maxR = surface_size.width / 3; - for(var j = 0; j < itemCount; ++j){ - var r = getRandSkewed(minR, maxR), - cx = getRand(r, surface_size.width - r), - cy = getRand(r, surface_size.height - r), - shape = surface.createCircle({cx: cx, cy: cy, r: r}) - .setFill(randColor(true)) - .setStroke({color: randColor(true), width: getRand(0, 3)}) - ; - new dojox.gfx.Moveable(shape); - } -} - -function initGfx(){ - container = dojo.byId("gfx_holder"); - surface = dojox.gfx.createSurface(container, 500, 500); - surface_size = {width: 500, height: 500}; - - makeCircleGrid(100); - - // cancel text selection and text dragging - dojo.connect(container, "ondragstart", dojo, "stopEvent"); - dojo.connect(container, "onselectstart", dojo, "stopEvent"); -} - -dojo.addOnLoad(initGfx); - -</script> - -<style type="text/css"> -.movable { cursor: pointer; } -</style> - -</head> -<body> -<h1>dojox.gfx: 100 draggable circles</h1> -<p>Warning: Canvas renderer doesn't implement event handling.</p> -<div id="gfx_holder" style="width: 500px; height: 500px;"></div> -</body> -</html> |