An MVC framework that gives you a Facebook-alike app on both iOS and Android.
It doesn't have the model part, but you can easily add it as global objects. I will add the model part in the future.
This project consists of the framework's files, which are fe.js
and /Resources/fe/base/*
. It's very lightweighted.
The example project here shows you how to build navigate betweens pages (with animation), and how to build Facebook-alike menu.
It works on both iOS and Android. I hope you like it!
Version: 0.0.1
Your controller must be in /Resources/fe/controller
, and the corresponding view must be in Resources/fe/views
.
A controller and its corresponding view should have identical name.
For example:
/Resources/fe/controllers/News.js
/Resources/fe/views/News.js
Moreover, you need to add the controller's name into Fe.includeControllers(...)
. Life's not perfect.
In app.js, it should look like this:
Fe.includeControllers([
'News',
'Profile',
'SomePage',
'SomePageAgain',
'Frame'
]);
At the main entry point, you also need to specify the first controller with:
Fe.setRootController(Fe.controllers.Frame);
Fe.openWindow();
And call Fe.openWindow()
to open the window.
please refer to the object __exports
.
If you declare __exports.some_function
, then the controller will have some_function
method.
We also have a life-cycle for a controller, you can declare these methods:
__exports.viewLoaded = function() { ... };
__exports.viewWillAppear = function() { ... };
__exports.viewDidAppear = function() { ... };
__exports.viewWillDisappear = function() { ... };
__exports.viewDidDisappear = function() { ... };
The methods' names are self-explanatory.
You can call Fe.pushController(Fe.controllers.SomePage)
in order to switch to the SomePage
controller.
Or you can call Fe.popController()
in order to switch back to the previous controller.
Fe
is a global variableFe.controllers
is an object that contains the instances of controllers. For example, you can refer to the News controller usingFe.controllers.News
This is a very young framework. You need to study its source code in order to use it.
Just don't be lazy, ok?
Tanin Na Nakorn -- in an attempt of helping ChatterBox build the first working prototype.
Do What The Fuck You Want To Public License (http://sam.zoy.org/wtfpl/)
- You just DO WHAT THE FUCK YOU WANT TO.