New Classes always need to be set up through ITSA.Classes.createClass(). You can choose to pass an constructor-function as the first argument --> this function gets invoked for every instance that is created - this references the instance-context. The second argument (or the first when there is no constructor defined) will define the properties at the prototype.
Code-example:
<body>
<div id="cont"></div>
</body>
<script src="itsabuild-min.js"></script>
<script>
var container = document.getElement('#cont'),
FirstClass, SecondClass, ThirdClass, FourthClass,
one, two, twoCopy, three, four;
FirstClass = ITSA.Classes.createClass();
SecondClass = ITSA.Classes.createClass(
function(x) {
this.x = x;
}
);
ThirdClass = ITSA.Classes.createClass(
{
multiply: function(value, multiplier) {
return value*multiplier;
}
}
);
FourthClass = ITSA.Classes.createClass(
function(x) {
this.x = x;
},
{
getMultiplied: function(multiplier) {
return this.x*multiplier;
}
}
);
one = new FirstClass();
one.x = 15;
two = new SecondClass(5);
twoCopy = new SecondClass(10);
three = new ThirdClass();
four = new FourthClass(15);
container.append('value one: '+one.x);
container.append('<br>value two: '+two.x);
container.append('<br>value twoCopy: '+twoCopy.x);
container.append('<br>value three.multiply(2,4): '+three.multiply(2,4));
container.append('<br>value four.getMultiplier(3): '+four.getMultiplied(3));
</script>