mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 22:55:35 +00:00
Initial commit
This commit is contained in:
26
app/js/directives/directive--list-cost.js
Normal file
26
app/js/directives/directive--list-cost.js
Normal 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();
|
||||
}
|
||||
}
|
||||
};
|
||||
}]);
|
||||
11
app/js/directives/directive-component-details.js
Normal file
11
app/js/directives/directive-component-details.js
Normal file
@@ -0,0 +1,11 @@
|
||||
angular.module('app').directive('componentDetails', [function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope:{
|
||||
c: '=',
|
||||
lbl: '=',
|
||||
opts: '='
|
||||
},
|
||||
templateUrl: 'views/component.html'
|
||||
};
|
||||
}]);
|
||||
17
app/js/directives/directive-component-select.js
Normal file
17
app/js/directives/directive-component-select.js
Normal 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;
|
||||
};
|
||||
}
|
||||
};
|
||||
}]);
|
||||
18
app/js/directives/directive-list-power.js
Normal file
18
app/js/directives/directive-list-power.js
Normal 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();
|
||||
}
|
||||
}
|
||||
};
|
||||
}]);
|
||||
13
app/js/directives/directive-menu.js
Normal file
13
app/js/directives/directive-menu.js
Normal 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
|
||||
|
||||
}
|
||||
};
|
||||
}]);
|
||||
Reference in New Issue
Block a user