A Javascript MVC framework
bagushutomo / gravityjs Goto Github PK
View Code? Open in Web Editor NEWA Javascript MVC framework (not ready)
A Javascript MVC framework (not ready)
Currently, class definition should have a constructor method to work correctly..
(function(){
XM.define("com.Circle", {
centerX: 0,
centerY: 0,
constructor: function(x, y) {
this.centerX= x;
this.centerY= y;
}
});
})();
However, if constructor method is omitted, the framework will keep creating a class.
This is because constructor method provided in class definition will override the generic constructor method on native object. Therefore, if omitted the framework will execute the generic constructor method which contain the reference to the class itself, hence triggering the framework to further execute the generic constructor method. Thus, lead to the infinite loop.
If a class were attached by a listener via addEventListener
or attachEvent
, a this
reference on the listener function will return an undefined
instead of reference to the class itself (The undefined
result is a valid javascript behaviour, but not an expected result in this framework).
sample:
(function(){
XM.define("com.Circle", {
centerX: 0,
centerY: 0,
constructor: function(x, y) {
this.centerX= x;
this.centerY= y;
},
initialize: function() {
this.addEventListener("mousedown", this.onMouseDown, false);
},
onMouseDown: function(e) {
console.log(this); //return undefined instead of Circle
},
});
})();
Currently the ScriptLoading only able to do XHR load (i.e: only event of "start loading" and "loading finished" that tracked). In the future, might add capability for XHR2 loading (i.e: able to get the value of actual byte loaded). This will give better accuracy on preloader percentage value
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.