2015-01-23 13:09:30 +00:00
|
|
|
|
2016-09-26 09:28:47 +00:00
|
|
|
vnCustomTags = {};
|
|
|
|
|
|
|
|
var Mutators = Class.Mutators;
|
|
|
|
|
|
|
|
Mutators.Tag = function (tagName)
|
2015-01-23 13:09:30 +00:00
|
|
|
{
|
2016-09-26 09:28:47 +00:00
|
|
|
vnCustomTags[tagName] = this;
|
2015-01-23 13:09:30 +00:00
|
|
|
|
|
|
|
if (this.parent)
|
|
|
|
{
|
|
|
|
this.implement ({Parent: this.parent.Parent});
|
|
|
|
this.implement ({Child: this.parent.Child});
|
|
|
|
this.implement ({Properties: {}});
|
|
|
|
}
|
|
|
|
|
|
|
|
this.extend ({Tag: tagName});
|
|
|
|
};
|
|
|
|
|
2016-09-26 09:28:47 +00:00
|
|
|
Mutators.Properties = function (props)
|
2015-01-23 13:09:30 +00:00
|
|
|
{
|
|
|
|
var parentProps;
|
|
|
|
|
|
|
|
for (var propName in props)
|
|
|
|
{
|
|
|
|
var prop = props[propName];
|
2016-09-26 09:28:47 +00:00
|
|
|
prop.configurable = true;
|
2015-01-23 13:09:30 +00:00
|
|
|
|
|
|
|
if (!prop.get && !prop.set && prop.writable === undefined)
|
|
|
|
prop.writable = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.parent && (parentProps = this.parent.Properties))
|
|
|
|
for (var propName in parentProps)
|
2016-09-26 09:28:47 +00:00
|
|
|
if (!props[propName])
|
2015-01-23 13:09:30 +00:00
|
|
|
props[propName] = parentProps[propName];
|
|
|
|
|
|
|
|
this.extend ({Properties: props});
|
|
|
|
Object.defineProperties (this.prototype, props);
|
|
|
|
};
|
|
|
|
|
2016-09-26 09:28:47 +00:00
|
|
|
Mutators.Parent = function (propName)
|
2015-01-23 13:09:30 +00:00
|
|
|
{
|
|
|
|
this.extend ({Parent: propName});
|
|
|
|
};
|
|
|
|
|
2016-09-26 09:28:47 +00:00
|
|
|
Mutators.Child = function (propName)
|
2015-01-23 13:09:30 +00:00
|
|
|
{
|
|
|
|
this.extend ({Child: propName});
|
|
|
|
};
|
|
|
|
|