|
|
@ -1,3 +1,28 @@ |
|
|
|
|
|
|
|
class TimeLogger { |
|
|
|
|
|
|
|
constructor() { |
|
|
|
|
|
|
|
this.logs = []; |
|
|
|
|
|
|
|
this.unlabelled_id = 0; |
|
|
|
|
|
|
|
this.start = this.previous = Date.now(); |
|
|
|
|
|
|
|
this.log('start'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
log(label) { |
|
|
|
|
|
|
|
var now = Date.now(); |
|
|
|
|
|
|
|
var log = { |
|
|
|
|
|
|
|
'when': now, |
|
|
|
|
|
|
|
'label': label, |
|
|
|
|
|
|
|
'elapsed': now - this.previous, |
|
|
|
|
|
|
|
'total': now - this.start |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.logs.push(log); |
|
|
|
|
|
|
|
this.previous = now; |
|
|
|
|
|
|
|
return log; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const timelogger = new TimeLogger; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(timelogger.logs[0]); |
|
|
|
|
|
|
|
|
|
|
|
var test_data = { |
|
|
|
var test_data = { |
|
|
|
"Chattel Setting": { |
|
|
|
"Chattel Setting": { |
|
|
|
"Born Chattel": { |
|
|
|
"Born Chattel": { |
|
|
@ -1594,6 +1619,8 @@ var test_data = { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(timelogger.log("post-data")); |
|
|
|
|
|
|
|
|
|
|
|
function StockedSetting(name, settingData) { |
|
|
|
function StockedSetting(name, settingData) { |
|
|
|
this.isSubsetting = false; |
|
|
|
this.isSubsetting = false; |
|
|
|
if(result = name.match(/(.*) setting/i)) { |
|
|
|
if(result = name.match(/(.*) setting/i)) { |
|
|
@ -1709,6 +1736,13 @@ function StockedCtrl($scope, burningData) { |
|
|
|
$scope.StockedUtil = StockedUtil; |
|
|
|
$scope.StockedUtil = StockedUtil; |
|
|
|
|
|
|
|
|
|
|
|
/* testing */ |
|
|
|
/* testing */ |
|
|
|
|
|
|
|
$scope.general = { |
|
|
|
|
|
|
|
'Name': '', |
|
|
|
|
|
|
|
'Stride': 7, |
|
|
|
|
|
|
|
'CommonTraits': ['foo', 'baz'], |
|
|
|
|
|
|
|
'selectedTrait': 'bar' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
$scope.parseStock = function (stockData){ |
|
|
|
$scope.parseStock = function (stockData){ |
|
|
|
let settings = []; |
|
|
|
let settings = []; |
|
|
|
for (let name in stockData) { |
|
|
|
for (let name in stockData) { |
|
|
@ -1720,6 +1754,10 @@ function StockedCtrl($scope, burningData) { |
|
|
|
$scope.settings = $scope.parseStock(test_data); |
|
|
|
$scope.settings = $scope.parseStock(test_data); |
|
|
|
/* end testing */ |
|
|
|
/* end testing */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.addSetting = function (){ |
|
|
|
|
|
|
|
this.settings.push(new StockedSetting(this.newSettingName, {})); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$scope.collapseBody = function(data_target, $event) { |
|
|
|
$scope.collapseBody = function(data_target, $event) { |
|
|
|
$(data_target).collapse("toggle"); |
|
|
|
$(data_target).collapse("toggle"); |
|
|
|
if($event) { $event.stopPropagation(); } |
|
|
|
if($event) { $event.stopPropagation(); } |
|
|
|