Permalink
Browse files

Deleted sources

  • Loading branch information...
1 parent 1bb4d59 commit f88532fcd808bc8f693bba4c4ad86dd05276a83e @ffrr committed Dec 13, 2011
@@ -1,97 +0,0 @@
-/**
- * app
- * App bootstrap class.
- *
- * @author fk
- * @version 0.1
- * @date May 27, 2011
- */
-
-DanteFrontend = {};
-
-DanteFrontend.appConf = {
- name: 'DanteFrontend',
-
- appFolder: '../static/js/app',
-
- requires: [
- 'DanteFrontend.lib.Util',
- 'DanteFrontend.lib.Router',
- 'DanteFrontend.lib.Notify',
- 'DanteFrontend.lib.Command',
- 'DanteFrontend.lib.CommandBus',
- ],
-
- controllers: [
- 'Root'
- ],
-
- //actionResolvers: ['modal', 'default'],
-
- launch: function() {
- this.addEvents('rootviewloaded');
- this.setCurrentController(null); this.setCurrentRootView(null);
-
- var lib = DanteFrontend.lib;
-
- Ext.create('Ext.container.Viewport', {
- layout: 'fit',
- items: {
- xtype: 'df-root'
- }
- });
-
- this.router = Ext.create('DanteFrontend.lib.Router');
- lib.CommandBus.init(this.router);
-
- //register routes to resolvers
- this.router.registerRoutes(DanteFrontend.routes, this);
-
- //use resolve, as the history may not be changed (when reloading the same viewport)
-
- this.loadStartingViewport();
- },
-
- loadStartingViewport: function() {
- var initUrl = res('url.init');
- if(window.location.toString().indexOf(initUrl) !== -1) {
- this.router.resolve(initUrl);
- } else {
- this.router.route(initUrl);
- }
- },
-
- getViewport: function() {
- return this.getController('Root').getContent();
- },
-
- getHandler: function(handlerName) {
- return this[handlerName];
- },
-
-
- //handlers should be probably separated to a singleton class, like renderers
- logout: function() {
- window.location.href = res('url.logout');
- },
-
-
- getCurrentController: function() {
- return this._currentController;
- },
-
- setCurrentController: function(controller) {
- this._currentController = controller;
- },
-
- getCurrentRootView: function() {
- return this._currentRootView;
- },
-
- setCurrentRootView: function(rootViewInstance) {
- this._currentRootView = rootViewInstance;
- }
-};
-
-Ext.application(DanteFrontend.appConf);
-
@@ -1,22 +0,0 @@
-/**
- * Root
- * The root controller. Handles viewport state changes - popups, main panel state changes, etc.
- *
- * @author fk
- * @version 0.1
- * @date May 27, 2011
- */
-
-//pre-init libs which are referenced as singleton classes in
-
-
-Ext.define('DanteFrontend.controller.Root', {
- extend: 'DanteFrontend.lib.Controller',
-
- views: [
- 'Root',
- 'main.Panel',
- 'main.Footer',
- 'main.Toolbar'
- ]
-});
@@ -1,21 +0,0 @@
-/**
- * Command
- * Command pattern implementation.
- *
- * @author fk
- * @version 0.1
- * @date Jun 2, 2011
- */
-
-
-Ext.define('DanteFrontend.lib.Command', {
- config: {
- token: ''
- },
-
- constructor: function(config) {
- Ext.apply(this, config);
- },
-
- execute: Ext.emptyFn
-});
@@ -1,59 +0,0 @@
-/**
- * CommandBus
- * A simple bus which contains all executed commands.
- * Uses LocalStorageProvider to store the state.
- *
- * @author fk
- * @version 0.1
- * @date Jun 2, 2011
- */
-
-//?
-Ext.require([
- 'Ext.util.History',
- 'Ext.state.Manager',
- 'Ext.state.LocalStorageProvider'
-]);
-
-Ext.define('DanteFrontend.lib.CommandBus', {
- singleton: true,
-
- MAPKEY: 'CommandMap',
-
- mixins: {
- 'observable': 'Ext.util.Observable'
- },
-
- init: function(router) {
- Ext.state.Manager.setProvider(new Ext.state.LocalStorageProvider());
- Ext.state.Manager.set(DanteFrontend.lib.CommandBus.MAPKEY, {});
- Ext.util.History.init();
- this.router = router;
- Ext.util.History.on('change', Ext.bind(this.onHistoryChanged, this));
- },
-
- add: function(command) {
- var token = command.getToken();
- this.getCommandMap()[token] = command;
- Ext.util.History.add(token);
- return command;
- },
-
-
- getCommandMap: function(bus) {
- return Ext.state.Manager.get(DanteFrontend.lib.CommandBus.MAPKEY, {});
- },
-
- onHistoryChanged: function(token) {
- if(token) {
- if(!this.hasCommand(token)) {
- this.router.route(token);
- }
- this.getCommandMap()[token].execute();
- }
- },
-
- hasCommand: function(token) {
- return !Ext.isEmpty(this.getCommandMap()[token]);
- }
-})
Oops, something went wrong.

0 comments on commit f88532f

Please sign in to comment.