'use strict';

/**
 * @ngdoc overview
 * @name siteOficinaItapetiApp
 * @description
 * # siteOficinaItapetiApp
 *
 * Main module of the application.
 */
angular
  .module('siteOficinaItapetiApp', [
    'ngAnimate',
    'ngAria',
    'ngCookies',
    'ngMessages',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ngTouch',
    'ui.router',
    'rzModule',
    'bootstrapLightbox',
    'ngCookies'
  ])

  .config(function (LightboxProvider) {
    // set a custom template
    LightboxProvider.templateUrl = 'views/lightbox-template.html';
  })

  .config(['$stateProvider', '$urlRouterProvider', '$httpProvider', function($stateProvider, $urlRouterProvider, $httpProvider) {
    // Configs
    //Enable cross domain calls
    $httpProvider.defaults.useXDomain = true;
    //Remove the header used to identify ajax call  that would prevent CORS from working
    delete $httpProvider.defaults.headers.common['X-Requested-With'];
    // UI router
    // For any unmatched url, redirect to /state1
    $stateProvider
    .state('home', {
      url: '/',
      templateUrl: 'views/main.html',
      controller: 'MainCtrl'
    })
    .state('sobre', {
      url: '/sobre',
      templateUrl: 'views/sobre.html',
      controller: 'MainCtrl'
    })
    .state('servicos', {
      url: '/servicos',
      templateUrl: 'views/servicos.html',
      controller: 'MainCtrl'
    }).state('portfolio', {
      url: '/portfolio',
      templateUrl: 'views/portfolio.html',
      controller: 'MainCtrl'
    }).state('contato', {
      url: '/contato',
      templateUrl: 'views/contato.html',
      controller: 'MainCtrl'
    }).state('corte-laser', {
      url: '/corte-laser',
      templateUrl: 'views/corte-laser.html',
      controller: 'MainCtrl'
    }).state('impressao-3d', {
      url: '/impressao-3d',
      templateUrl: 'views/impressao-3d.html',
      controller: 'MainCtrl'
    }).state('prototipagem', {
      url: '/prototipagem',
      templateUrl: 'views/prototipagem.html',
      controller: 'MainCtrl'
    }).state('corte-plasma', {
      url: '/corte-plasma',
      templateUrl: 'views/corte-plasma.html',
      controller: 'MainCtrl'
    }).state('solucoes', {
      url: '/solucoes',
      templateUrl: 'views/solucoes.html',
      controller: 'MainCtrl'
    }).state('projetos', {
      url: '/projetos',
      templateUrl: 'views/projetos.html',
      controller: 'MainCtrl'
    }).state('eletronica', {
      url: '/eletronica',
      templateUrl: 'views/eletronica.html',
      controller: 'MainCtrl'
    });
    $urlRouterProvider.otherwise('/');
  }]);
