/**
 * This file is part of tenside/ui.
 *
 * (c) Tristan Lins <https://github.com/tristanlins>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * This project is provided in good faith and hope to be usable by anyone.
 *
 * @package    tenside/ui
 * @author     Tristan Lins <https://github.com/tristanlins>
 * @author     Tim Becker <https://github.com/tim-bec>
 * @copyright  Tristan Lins <https://github.com/tristanlins>
 * @link       https://github.com/tenside/ui
 * @license    https://github.com/tenside/ui/blob/master/LICENSE MIT
 * @filesource
 */

var TENSIDE;

(function () {
    var app = angular.module('tenside', ['ngRoute']);

    TENSIDE = app;

    TENSIDE.config(function ($routeProvider, $locationProvider) {
        $locationProvider.html5Mode(false);

        // route to the packages
        $routeProvider.when('/packages', {
            templateUrl: 'pages/packages.html',
            controller: 'tensidePackages'
        });

        // route to the search page
        $routeProvider.when('/search', {
            templateUrl: 'pages/search.html',
            controller: 'tensideSearchController'
        });

        // route for the editor page
        $routeProvider.when('/editor', {
            templateUrl: 'pages/editor.html',
            controller: 'tensideEditor'
        });

        // route for config
        $routeProvider.when('/config', {
            templateUrl: 'pages/config.html',
            controller: 'tensideConfigController'
        });

        // route for about page
        $routeProvider.when('/about', {
            templateUrl: 'pages/about.html',
            controller: 'tensideAboutController'
        });

        // route for support page
        $routeProvider.when('/support', {
            templateUrl: 'pages/support.html',
            controller: 'tensideSupportController'
        });

        $routeProvider.otherwise({redirectTo: '/packages'});
    });

    app.controller('tensidePackages', ['$window', '$scope', function ($window, $scope) {
        $scope.packages = {};
    }]);

    app.controller('tensideEditor', ['$window', '$scope', function ($window, $scope) {
        // var editor = ace.edit("editor");
        // editor.setTheme("ace/theme/monokai");
        // editor.getSession().setMode("ace/mode/javascript");
    }]);

    app.controller('tensideConfigController', ['$window', '$scope', function ($window, $scope) {
        $scope.config = {};
    }]);
})();

@@ -884,16 +884,21 @@
 packages
+ page
 %0A       
@@ -1021,16 +1021,26 @@
 Packages
+Controller
 '%0A      
@@ -1394,16 +1394,26 @@
 deEditor
+Controller
 '%0A      
@@ -1446,16 +1446,21 @@
 r config
+ page
 %0A       
@@ -2073,16 +2073,26 @@
 Packages
+Controller
 ', %5B'$wi
@@ -2210,16 +2210,26 @@
 deEditor
+Controller
 ', %5B'$wi
@@ -2573,15 +2573,285 @@
     %7D%5D);
+%0A%0A    app.controller('tensideAboutController', %5B'$window', '$scope', function ($window, $scope) %7B%0A        $scope.config = %7B%7D;%0A    %7D%5D);%0A%0A    app.controller('tensideSupportController', %5B'$window', '$scope', function ($window, $scope) %7B%0A        $scope.config = %7B%7D;%0A    %7D%5D);
 %0A%7D)();%0A

Rework the controllers.