Replace Ember app with Mithril app

This commit is contained in:
Toby Zerner
2015-04-25 22:28:39 +09:30
parent 6f67b8c247
commit b68a4711dc
377 changed files with 5641 additions and 7330 deletions

21
js/lib/utils/app.js Normal file
View File

@ -0,0 +1,21 @@
import ItemList from 'flarum/utils/item-list';
class App {
constructor() {
this.initializers = new ItemList();
this.cache = {};
}
boot() {
this.initializers.toArray().forEach((initializer) => initializer(this));
}
route(name, args, queryParams) {
var queryString = m.route.buildQueryString(queryParams);
return this.routes[name][0].replace(/:([^\/]+)/g, function(m, t) {
return typeof args[t] === 'function' ? args[t]() : args[t];
}) + (queryString ? '?'+queryString : '');
}
}
export default App;