Initial commit

This commit is contained in:
Colin McLeod
2015-04-10 12:25:47 -07:00
commit 1097ca5a42
112 changed files with 10638 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
angular.module('app').directive('costList', ['$rootScope', 'lodash', function ($r, _) {
return {
restrict: 'A',
scope: {
ship: '='
},
templateUrl: 'views/costs.html',
link: function (scope, element, attributes) {
scope.hps = ship.hardpoints;
scope.ints = ship.internal;
scope.com = ship.common;
scope.$r = $r;
scope.insuranceOptions = {
Alpha: 0.975,
Beta: 0.965,
Standard: 0.95
};
scope.insurance = scope.insuranceOptions.Standard;
scope.toggle = function(item) {
item.incCost = !item.incCost;
scope.ship.updateTotals();
}
}
};
}]);

View File

@@ -0,0 +1,11 @@
angular.module('app').directive('componentDetails', [function () {
return {
restrict: 'E',
scope:{
c: '=',
lbl: '=',
opts: '='
},
templateUrl: 'views/component.html'
};
}]);

View File

@@ -0,0 +1,17 @@
angular.module('app').directive('componentSelect', [ function() {
return {
restrict: 'A',
scope:{
opts: '=',
c: '=',
ship: '='
},
templateUrl: 'views/component_select.html',
link: function (scope) {
scope.use = function(id, componentData) {
scope.ship.use(scope.c, id, componentData);
// hide this shit;
};
}
};
}]);

View File

@@ -0,0 +1,18 @@
angular.module('app')
.directive('powerList', ['$rootScope', 'lodash', function ($r, _) {
return {
restrict: 'A',
scope: {
ship: '=ship'
},
templateUrl: 'views/power.html',
link: function (scope, element, attributes) {
scope.$r = $r;
scope.toggle = function(component) {
component.enabled = !component.enabled;
scope.ship.updateTotals();
}
}
};
}]);

View File

@@ -0,0 +1,13 @@
angular.module('app').directive('shipyardMenu', ['$rootScope', 'lodash', function ($rootScope, _) {
return {
restrict: 'E',
templateUrl: 'views/menu.html',
link: function (scope, element, attributes) {
// TODO: Saved Ships: load, save, save as, delete, export
// TODO: Links: github, forum, etc
}
};
}]);