summaryrefslogtreecommitdiffstatshomepage
path: root/includes/js/dojox/wire/ml/Data.js
diff options
context:
space:
mode:
authorGravatar mensonge2008-11-14 15:39:19 +0000
committerGravatar mensonge2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/wire/ml/Data.js
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
scuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.zip
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/wire/ml/Data.js')
-rw-r--r--includes/js/dojox/wire/ml/Data.js143
1 files changed, 0 insertions, 143 deletions
diff --git a/includes/js/dojox/wire/ml/Data.js b/includes/js/dojox/wire/ml/Data.js
deleted file mode 100644
index 71ab0ad..0000000
--- a/includes/js/dojox/wire/ml/Data.js
+++ /dev/null
@@ -1,143 +0,0 @@
-if(!dojo._hasResource["dojox.wire.ml.Data"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojox.wire.ml.Data"] = true;
-dojo.provide("dojox.wire.ml.Data");
-dojo.provide("dojox.wire.ml.DataProperty");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Container");
-dojo.require("dojox.wire.ml.util");
-
-dojo.declare("dojox.wire.ml.Data", [dijit._Widget, dijit._Container], {
- // summary:
- // A widget for a data object
- // description:
- // This widget represents an object with '_properties' property.
- // If child 'DataProperty' widgets exist, they are used to initialize
- // propertiy values of '_properties' object.
-
- startup: function(){
- // summary:
- // Call _initializeProperties()
- // description:
- // See _initializeProperties().
- this._initializeProperties();
- },
-
- _initializeProperties: function(/*Boolean*/reset){
- // summary:
- // Initialize a data object
- // description:
- // If this widget has child DataProperty widgets, their getValue()
- // methods are called and set the return value to a property
- // specified by 'name' attribute of the child widgets.
- // reset:
- // A boolean to reset current properties
- if(!this._properties || reset){
- this._properties = {};
- }
- var children = this.getChildren();
- for(var i in children){
- var child = children[i];
- if((child instanceof dojox.wire.ml.DataProperty) && child.name){
- this.setPropertyValue(child.name, child.getValue());
- }
- }
- },
-
- getPropertyValue: function(/*String*/property){
- // summary:
- // Return a property value
- // description:
- // This method returns the value of a property, specified with
- // 'property' argument, in '_properties' object.
- // property:
- // A property name
- // returns:
- // A property value
- return this._properties[property]; //anything
- },
-
- setPropertyValue: function(/*String*/property, /*anything*/value){
- // summary:
- // Store a property value
- // description:
- // This method stores 'value' as a property, specified with
- // 'property' argument, in '_properties' object.
- // property:
- // A property name
- // value:
- // A property value
- this._properties[property] = value;
- }
-});
-
-dojo.declare("dojox.wire.ml.DataProperty", [dijit._Widget, dijit._Container], {
- // summary:
- // A widget to define a data property
- // description:
- // Attributes of this widget are used to add a property to the parent
- // Data widget.
- // 'type' attribute specifies one of "string", "number", "boolean",
- // "array", "object" and "element" (DOM Element)
- // (default to "string").
- // If 'type' is "array" or "object", child DataProperty widgets are
- // used to initialize the array elements or the object properties.
- // name:
- // A property name
- // type:
- // A property type name
- // value:
- // A property value
- name: "",
- type: "",
- value: "",
-
- getValue: function(){
- // summary:
- // Returns a property value
- // description:
- // If 'type' is specified, 'value' attribute is converted to
- // the specified type and returned.
- // Otherwise, 'value' attribute is returned as is.
- // returns:
- // A property value
- var value = this.value;
- if(this.type){
- if(this.type == "number"){
- value = parseInt(value);
- }else if(this.type == "boolean"){
- value = (value == "true");
- }else if(this.type == "array"){
- value = [];
- var children = this.getChildren();
- for(var i in children){
- var child = children[i];
- if(child instanceof dojox.wire.ml.DataProperty){
- value.push(child.getValue());
- }
- }
- }else if(this.type == "object"){
- value = {};
- var children = this.getChildren();
- for(var i in children){
- var child = children[i];
- if((child instanceof dojox.wire.ml.DataProperty) && child.name){
- value[child.name] = child.getValue();
- }
- }
- }else if(this.type == "element"){
- value = new dojox.wire.ml.XmlElement(value);
- var children = this.getChildren();
- for(var i in children){
- var child = children[i];
- if((child instanceof dojox.wire.ml.DataProperty) && child.name){
- value.setPropertyValue(child.name, child.getValue());
- }
- }
- }
- }
- return value; //anything
- }
-});
-
-}