25.05 stages
This commit is contained in:
+31
-29
@@ -1,4 +1,4 @@
|
|||||||
$(function(){
|
|
||||||
var toe = new Vue({
|
var toe = new Vue({
|
||||||
el: '#toe',
|
el: '#toe',
|
||||||
data: {
|
data: {
|
||||||
@@ -65,37 +65,39 @@ var toe = new Vue({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function getData(fileindex) {
|
$(function(){
|
||||||
var nextfile = fileindex + 1;
|
function getData(fileindex) {
|
||||||
|
var nextfile = fileindex + 1;
|
||||||
|
|
||||||
$.get('../toe/' + fileindex + '.json', function (data) {
|
$.get('../toe/' + fileindex + '.json', function (data) {
|
||||||
var matches = data.results[0].result.response.results;
|
var matches = data.results[0].result.response.results;
|
||||||
|
|
||||||
for (match in matches) {
|
for (match in matches) {
|
||||||
var thisMatch = matches[match];
|
var thisMatch = matches[match];
|
||||||
// add enemy total power to match data
|
// add enemy total power to match data
|
||||||
var power = 0;
|
var power = 0;
|
||||||
var attackerTeam = thisMatch.defBattle.attackers;
|
var attackerTeam = thisMatch.defBattle.attackers;
|
||||||
for (titan in attackerTeam) {
|
for (titan in attackerTeam) {
|
||||||
power += attackerTeam[titan].power;
|
power += attackerTeam[titan].power;
|
||||||
|
}
|
||||||
|
matches[match].enemypower = power;
|
||||||
|
|
||||||
|
toe.matches.push(matches[match]);
|
||||||
}
|
}
|
||||||
matches[match].enemypower = power;
|
|
||||||
|
|
||||||
toe.matches.push(matches[match]);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.done(function () {
|
|
||||||
getData(nextfile);
|
|
||||||
$('.loadingbar').css({
|
|
||||||
'width': fileindex + '%'
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.fail(function () {
|
.done(function () {
|
||||||
$('.loadingbar').css('width', '100%').delay(150).fadeOut(150);
|
getData(nextfile);
|
||||||
});
|
$('.loadingbar').css({
|
||||||
}
|
'width': fileindex + '%'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.fail(function () {
|
||||||
|
$('.loadingbar').css('width', '100%').delay(150).fadeOut(150);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if ($('#toe').length) {
|
|
||||||
getData(1);
|
if ($('#toe').length) {
|
||||||
}
|
getData(1);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user