summaryrefslogtreecommitdiff
path: root/includes/js/dojox/gfx/utils.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/gfx/utils.js
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-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/utils.js')
-rw-r--r--includes/js/dojox/gfx/utils.js87
1 files changed, 0 insertions, 87 deletions
diff --git a/includes/js/dojox/gfx/utils.js b/includes/js/dojox/gfx/utils.js
deleted file mode 100644
index 7ee4d9d..0000000
--- a/includes/js/dojox/gfx/utils.js
+++ /dev/null
@@ -1,87 +0,0 @@
-if(!dojo._hasResource["dojox.gfx.utils"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojox.gfx.utils"] = true;
-dojo.provide("dojox.gfx.utils");
-
-dojo.require("dojox.gfx");
-
-dojox.gfx.utils.serialize = function(
- /* dojox.gfx.Surface || dojox.gfx.Shape */ object
-){
- var t = {}, v, isSurface = object instanceof dojox.gfx.Surface;
- if(isSurface || object instanceof dojox.gfx.Group){
- t.children = [];
- for(var i = 0; i < object.children.length; ++i){
- t.children.push(dojox.gfx.utils.serialize(object.children[i]));
- }
- if(isSurface){
- return t.children; // Array
- }
- }else{
- t.shape = object.getShape();
- }
- if(object.getTransform){
- v = object.getTransform();
- if(v){ t.transform = v; }
- }
- if(object.getStroke){
- v = object.getStroke();
- if(v){ t.stroke = v; }
- }
- if(object.getFill){
- v = object.getFill();
- if(v){ t.fill = v; }
- }
- if(object.getFont){
- v = object.getFont();
- if(v){ t.font = v; }
- }
- return t; // Object
-};
-
-dojox.gfx.utils.toJson = function(
- /* dojox.gfx.Surface || dojox.gfx.Shape */ object,
- /* Boolean? */ prettyPrint
-){
- return dojo.toJson(dojox.gfx.utils.serialize(object), prettyPrint); // String
-};
-
-dojox.gfx.utils.deserialize = function(
- /* dojox.gfx.Surface || dojox.gfx.Shape */ parent,
- /* dojox.gfx.Shape || Array */ object
-){
- if(object instanceof Array){
- var t = [];
- for(var i = 0; i < object.length; ++i){
- t.push(dojox.gfx.utils.deserialize(parent, object[i]));
- }
- return t; // Array
- }
- var shape = ("shape" in object) ? parent.createShape(object.shape) : parent.createGroup();
- if("transform" in object){
- shape.setTransform(object.transform);
- }
- if("stroke" in object){
- shape.setStroke(object.stroke);
- }
- if("fill" in object){
- shape.setFill(object.fill);
- }
- if("font" in object){
- shape.setFont(object.font);
- }
- if("children" in object){
- for(var i = 0; i < object.children.length; ++i){
- dojox.gfx.utils.deserialize(shape, object.children[i]);
- }
- }
- return shape; // dojox.gfx.Shape
-};
-
-dojox.gfx.utils.fromJson = function(
- /* dojox.gfx.Surface || dojox.gfx.Shape */ parent,
- /* String */ json
-){
- return dojox.gfx.utils.deserialize(parent, dojo.fromJson(json)); // Array || dojox.gfx.Shape
-};
-
-}