Coriolis Shipyard was created using assets and imagery from Elite: Dangerous, with the permission of Frontier Developments plc, for non-commercial purposes.
diff --git a/app/js/config.js b/app/js/config.js
index c412f508..73af2293 100644
--- a/app/js/config.js
+++ b/app/js/config.js
@@ -46,10 +46,10 @@ angular.module('app').config(['$provide','$stateProvider', '$urlRouterProvider',
*
*/
$provide.decorator('$exceptionHandler', ['$delegate', '$injector', function ($delegate, $injector) {
- return function(exception, cause) {
+ return function(err, cause) {
// Go to error state, reload the controller, keep the current URL
- $injector.get('$state').go('error', { details: exception }, {location:false, reload:true});
- $delegate(exception, cause);
+ $injector.get('$state').go('error', {type:null, message: err.message, details: err.stack }, {location:false, reload:true});
+ $delegate(err, cause);
};
}]);
diff --git a/app/js/controllers/controller-error.js b/app/js/controllers/controller-error.js
index 65619ab4..01703696 100644
--- a/app/js/controllers/controller-error.js
+++ b/app/js/controllers/controller-error.js
@@ -7,26 +7,27 @@ angular.module('app')
switch ($scope.type) {
case 404:
+ $rootScope.bodyClass = 'deep-space';
$scope.msgPre = 'Page';
$scope.msgHighlight = $scope.path;
$scope.msgPost = 'Not Found';
- $rootScope.bodyClass = 'deep-space';
break;
case 'no-ship':
+ $rootScope.bodyClass = 'docking-bay';
$scope.msgPre = 'Ship';
$scope.msgHighlight = $p.message;
$scope.msgPost = 'does not exist';
- $rootScope.bodyClass = 'docking-bay';
break;
case 'build-fail':
+ $rootScope.bodyClass = 'ship-explode'; // TODO: create background imag for this
$scope.msgPre = 'Build Failure!';
- $scope.image = 'ship-explode';
- $rootScope.bodyClass = 'docking-bay';
+ $scope.details = $p.details;
break;
default:
+ $rootScope.bodyClass = 'thargoid'; // TODO: create background imag for this
$scope.msgPre = "Uh, this is bad..";
- $scope.image = 'thargoid';
- $rootScope.bodyClass = null;
+ $scope.errorMessage = $p.message;
+ $scope.details = $p.details;
}
}]);
\ No newline at end of file
diff --git a/app/js/controllers/controller-shipyard.js b/app/js/controllers/controller-shipyard.js
index 0e8fad10..b5353f57 100644
--- a/app/js/controllers/controller-shipyard.js
+++ b/app/js/controllers/controller-shipyard.js
@@ -1,4 +1,4 @@
angular.module('app').controller('ShipyardController', ['$rootScope', function ($rootScope) {
- $rootScope.title = 'Coriolis - Shipyard';
+ $rootScope.title = 'Coriolis';
$rootScope.bodyClass = 'docking-bay';
}]);
\ No newline at end of file
diff --git a/app/js/directives/directive-component-select.js b/app/js/directives/directive-component-select.js
index ae32fc8a..ef7e0719 100644
--- a/app/js/directives/directive-component-select.js
+++ b/app/js/directives/directive-component-select.js
@@ -2,18 +2,19 @@ angular.module('app').directive('componentSelect', [ function() {
return {
restrict: 'A',
scope:{
- opts: '=', // Component Options object
+ opts: '=', // Component Options object
+ mass: '=' // Current ship mass
},
link: function(scope, element) {
var list = [], o, id;
var opts = scope.opts;
- //TODO: take current ship mass into account if provided
+ var mass = scope.mass || 0;
// Generting the HTML in this manner is MUCH faster than using an angular template.
for (id in opts) {
o = opts[id];
list.push('
{{msgPost}}
-
-
- Path: {{path}}
- Error: {{type}}
- Details: {{details | json}}
- Browser: {{browser}}
+
-
-
\ No newline at end of file
diff --git a/app/views/page-outfit.html b/app/views/page-outfit.html
index 4748783b..18c622f4 100644
--- a/app/views/page-outfit.html
+++ b/app/views/page-outfit.html
@@ -52,7 +52,7 @@