Skip to content

Commit 6826cde

Browse files
committed
bugfixes + incomings overview attackid grouping
1 parent b0ab989 commit 6826cde

File tree

13 files changed

+355
-77
lines changed

13 files changed

+355
-77
lines changed

config/trans.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* Contains all translation
3+
* The highest level is split in
4+
* - tw = translations that should be translated by their server equivalents (they are used somewhere in the html by Innogames)
5+
* - sp = new translations specific for the Sangu Package
6+
*/
17
trans = {
28
tw: {
39
units: {
@@ -116,7 +122,7 @@ trans = {
116122
total: "Totaal",
117123
last: "Laatste",
118124
target: "Doel",
119-
targetEx: "Doeldorp",
125+
targetEx: "Doelwit",
120126
more: "meer",
121127
less: "minder",
122128
all: "Alle",
@@ -220,9 +226,9 @@ trans = {
220226
filterWalkingTimeTooltip: "Toon enkel de dorpen met een langere looptijd (in uren) tot het doeldorp",
221227
calcStack: "Bereken stack",
222228
calcStackTooltip: "Toon de bevolking per dorp in de \"Nacht?\" kolom",
223-
filterNoble: "Filter edels",
229+
filterNoble: "Toon edels",
224230
filterNobleTooltip: "Toon enkel de dorpen waar edels aanwezig zijn",
225-
filterUnderAttack: "Filter onder aanval",
231+
filterUnderAttack: "Toon onder aanval",
226232
filterUnderAttackTooltip: "Toon enkel de dorpen die onder aanval zijn",
227233
sort: "Sorteren",
228234
sortTooltip: "Sorteren op looptijd tot doeldorp",
@@ -398,11 +404,20 @@ trans = {
398404
graphTWMap: "TribalWarsMap.com"
399405
},
400406
incomings: {
401-
dynamicGrouping: "Dynamisch Groeperen",
407+
dynamicGrouping: "Dynamisch groeperen",
408+
dynamicGroupingTooltip: "Groepeert trager maar bevriest de pagina niet",
402409
summation: "Somlijn",
403-
fastGrouping: "Snel Groeperen",
404-
showNewIncomings: "Toon Nieuwe Aanvallen",
410+
fastGrouping: "Snel groeperen",
411+
fastGroupingTooltip: "Groepeert sneller en bevriest de pagina (geen refreshs wanneer een aanval binnenkomt)",
412+
showNewIncomings: "Toon nieuwe aanvallen",
413+
sortByAttackId: "Sorteer op aanvalsid",
414+
sortByAttackIdTooltip: "Een kleiner aanvalsid betekent een eerder verstuurde aanval",
405415
amount: "Aanvallen:",
416+
attackId: "Aanvalsid",
417+
attackIdDifference: "Verschil",
418+
filterColumnButton: "Kolom filter",
419+
filterColumnButtonTooltip: "Alle bevelen waarbij de geselecteerde kolom de ingegeven tekst bevat verbergen",
420+
406421
indicator: {
407422
lastTimeCheckHintBoxTooltip: "Klik op {img} om de laatste tijdcheck met de huidige tijd te vervangen.",
408423
lastTimeCheckNotYetSet: "(nog niet)"

config/user_data.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ if (user_data !== '') {
8181
}
8282
},
8383

84+
incomings: {
85+
attackIdDescriptions: [
86+
{minValue: 10, text: " "},
87+
{minValue: 50, text: "10-50"},
88+
{minValue: 100, text: "50-100"},
89+
{minValue: 200, text: "100-200"},
90+
{minValue: 500, text: "200-500"},
91+
{minValue: 1000, text: "500-1000"},
92+
{minValue: 5000, text: "1000-5000"}
93+
],
94+
attackIdHigherDescription: "5000+"
95+
},
96+
97+
8498
overviews: {
8599
addFancyImagesToOverviewLinks: true
86100
},

func/debug.js

Lines changed: 60 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13,70 +13,72 @@ function qa(what) { alert(typeof what === "undefined" ? "yaye" : what); }
1313
*/
1414
function sangu_alert(e, title) {
1515
var activator = $("#sangu_activator");
16-
if (sangu_crash) {
17-
activator
18-
.attr("src", "graphic/dots/grey.png")
19-
.attr("title", trans.sp.sp.packageCrashTooltip);
2016

21-
(function() {
22-
var position = $("#storage").position(),
23-
options = {
24-
left: position.left - 150,
25-
top: position.top + 35
26-
},
27-
content = {body: trans.sp.sp.packageCrashTooltip, title: trans.sp.sp.packageCrashTitle};
17+
activator
18+
.attr("src", "graphic/dots/grey.png")
19+
.attr("title", trans.sp.sp.packageCrashTooltip);
20+
21+
(function() {
22+
var position = $("#storage").position(),
23+
options = {
24+
left: position.left - 150,
25+
top: position.top + 35
26+
},
27+
content = {body: trans.sp.sp.packageCrashTooltip, title: trans.sp.sp.packageCrashTitle};
2828

29-
createFixedTooltip("sanguCrashTooltip", content, options);
30-
}());
29+
createFixedTooltip("sanguCrashTooltip", content, options);
30+
}());
3131

32-
activator.click(function() {
33-
var currentPageHtml = document.documentElement.innerHTML,
34-
position = $("#storage").position(),
35-
options = {
36-
left: $(window).width() / 2 - 300,
37-
top: position.top + 35,
38-
width: 600,
39-
showOnce: false
40-
},
41-
game_dataSubset = {
42-
majorVersion: game_data.majorVersion,
43-
market: game_data.market,
44-
world: game_data.world,
45-
sitter_id: game_data.player.sitter_id,
46-
village_id: game_data.village.id,
47-
player_id: game_data.player.id,
48-
player_name: game_data.player.name,
49-
ally_id: game_data.player.ally_id,
50-
villages: game_data.player.villages,
51-
premium: game_data.player.premium/*,
52-
account_manager: game_data.player.account_manager,
53-
farm_manager: game_data.player.farm_manager*/
54-
},
55-
content = {
56-
title: trans.sp.sp.packageCrashTitle,
57-
body: trans.sp.sp.packageCrash
58-
.replace("{forum-url}", server_settings.helpdeskUrl)
59-
.replace("{title}", title)
60-
.replace(/\{error\}/g, e.message)
61-
.replace("{page}", JSON.stringify(current_page))
62-
.replace("{url}", document.location.href)
63-
.replace("{version}", sangu_version)
64-
.replace("{browser}", JSON.stringify($.browser))
65-
.replace("{game_data}", JSON.stringify(game_dataSubset))
66-
.replace("{stacktrace}", e.stack ? e.stack + "\n\n" + e.stacktrace : "assertion?")
67-
.replace("{email}", server_settings.sanguEmail)
68-
.replace("{html}", currentPageHtml)
69-
};
32+
activator.click(function() {
33+
var currentPageHtml = document.documentElement.innerHTML,
34+
position = $("#storage").position(),
35+
options = {
36+
left: $(window).width() / 2 - 300,
37+
top: position.top + 35,
38+
width: 600,
39+
showOnce: false
40+
},
41+
game_dataSubset = {
42+
majorVersion: game_data.majorVersion,
43+
market: game_data.market,
44+
world: game_data.world,
45+
sitter_id: game_data.player.sitter_id,
46+
village_id: game_data.village.id,
47+
player_id: game_data.player.id,
48+
player_name: game_data.player.name,
49+
ally_id: game_data.player.ally_id,
50+
villages: game_data.player.villages,
51+
premium: game_data.player.premium/*,
52+
account_manager: game_data.player.account_manager,
53+
farm_manager: game_data.player.farm_manager*/
54+
},
55+
content = {
56+
title: trans.sp.sp.packageCrashTitle,
57+
body: trans.sp.sp.packageCrash
58+
.replace("{forum-url}", server_settings.helpdeskUrl)
59+
.replace("{title}", title)
60+
.replace(/\{error\}/g, e.message)
61+
.replace("{page}", JSON.stringify(current_page))
62+
.replace("{url}", document.location.href)
63+
.replace("{version}", sangu_version)
64+
.replace("{browser}", JSON.stringify($.browser))
65+
.replace("{game_data}", JSON.stringify(game_dataSubset))
66+
.replace("{stacktrace}", e.stack ? e.stack + "\n\n" + e.stacktrace : "assertion?")
67+
.replace("{email}", server_settings.sanguEmail)
68+
.replace("{html}", currentPageHtml)
69+
};
7070

71-
createFixedTooltip("sanguCrash", content, options);
72-
$("#crashArea").val($("#crashArea").val() + currentPageHtml);
71+
createFixedTooltip("sanguCrash", content, options);
72+
$("#crashArea").val($("#crashArea").val() + currentPageHtml);
7373

74-
return false;
75-
});
74+
return false;
75+
});
7676

77-
for(i = 0; i < 7; i++) {
78-
activator.fadeTo('slow', 0.2).fadeTo('slow', 1.0);
79-
}
77+
for(i = 0; i < 7; i++) {
78+
activator.fadeTo('slow', 0.2).fadeTo('slow', 1.0);
79+
}
80+
if (sangu_crash) {
81+
activator.click();
8082
}
8183
}
8284

overviews/commands.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
}
3434

3535
menu += "</th></tr></table>";
36+
37+
// second row
3638
menu += "<table><tr><th width='1%' nowrap>";
3739
menu += "<input type=checkbox id=defReverseFilter title='" + trans.sp.commands.filtersReverse + "'> " + trans.sp.commands.filtersReverseInfo + ": ";
3840

overviews/incomings/filters.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Show new attacks only
12
$("#filterAttack").click(function () {
23
trackClickEvent("FilterNewAttacks");
34
var goners = $();
@@ -15,4 +16,5 @@ $("#filterAttack").click(function () {
1516
var amountOfCommandsHeaderCell = $("tr:first", overviewTable).find("th:first");
1617
assert(amountOfCommandsHeaderCell.length === 1, "couldn't find the command headercell");
1718
amountOfCommandsHeaderCell.html(amountOfCommandsHeaderCell.html().replace(/\(\d+\)/, "(" + remainingVillages + ")"));
18-
});
19+
});
20+

overviews/incomings/menu.js

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,97 @@
22
var menu = "";
33
menu += "<table width='100%' class=vis>";
44
menu += "<tr><th width='1%'>";
5-
menu += "<input type=button id=sortIt value='" + trans.sp.incomings.dynamicGrouping + "'>";
5+
menu += "<input type=button id=sortIt value='" + trans.sp.incomings.dynamicGrouping + "' title='" + trans.sp.incomings.dynamicGroupingTooltip + "'>";
66
menu += "</th><th width='1%' nowrap>";
77
menu += "<input type=checkbox id=sortShowTotalRow " + (user_data.command.sumRow ? "checked" : "") + "> " + trans.sp.incomings.summation + " ";
8-
menu += "<input type=button id=sortQuick value='" + trans.sp.incomings.fastGrouping + "'>";
9-
menu += "</th><th width='97%'>";
8+
menu += "<input type=button id=sortQuick value='" + trans.sp.incomings.fastGrouping + "' title='" + trans.sp.incomings.fastGroupingTooltip + "'>";
9+
menu += "</th><th width='1%'>";
10+
11+
menu += "<input type=button id=sortByAttackId value='" + trans.sp.incomings.sortByAttackId + "' title='" + trans.sp.incomings.sortByAttackIdTooltip + "'>";
12+
13+
menu += "</th><th width='96%'>";
1014
menu += "<input type=button id=filterAttack value='" + trans.sp.incomings.showNewIncomings + "'>";
15+
1116
menu += "</th><th width='1%' nowrap>";
1217
menu += "<input type=button id=commandsImport value='" + trans.sp.incomings.commandsImport + "' title='" + trans.sp.incomings.commandsImportTooltip + "'>";
1318
menu += "</th></tr>";
19+
menu += "</table>";
20+
21+
// second row
22+
//menu += "<table width='100%' class=vis>";
23+
//menu += "<tr><th width='1%' nowrap>";
24+
//
25+
//menu += "<input type=checkbox id=defReverseFilter title='" + trans.sp.commands.filtersReverse + "'> " + trans.sp.commands.filtersReverseInfo + ": ";
26+
//menu += "</th>";
27+
//
28+
//// generate one input field/button filter with a select for the first cells
29+
//var defaultColumnFilters = (function() {
30+
// var headerCells = $("tr:first th", overviewTable),
31+
// cols = [],
32+
// headerCellText;
33+
//
34+
// for (i = 0; i < 4; i++) {
35+
// headerCellText = headerCells.eq(i).text();
36+
// if (headerCellText.indexOf(" ") !== -1) {
37+
// headerCellText = $.trim(headerCellText.substr(0, headerCellText.indexOf(" ")));
38+
// }
39+
// cols.push(headerCellText);
40+
// }
41+
// return cols;
42+
//}());
43+
//
44+
///**
45+
// * builds a textinput+select+button filter that filters rows based on table column index
46+
// */
47+
//function buildColumnFilter() {
48+
// var i,
49+
// menu = "<th width='99%' nowrap>";
50+
// menu += "<input type='text' size='12' id='filterColumnValue'>";
51+
// menu += "<select id='filterColumnValue'>";
52+
// for (i = 0; i < defaultColumnFilters.length; i++) {
53+
// menu += "<option>" + defaultColumnFilters[i] + "</option>";
54+
// }
55+
// menu += "</select>";
56+
// menu += "<input type='button' id='filterColumn' value='"
57+
// + trans.sp.incomings.filterColumnButton + "'"
58+
// + " title='" + trans.sp.incomings.filterColumnButtonTooltip + "'"
59+
// + "'>";
60+
// menu += "</th>";
61+
// return menu;
62+
//}
63+
//
64+
//menu += buildColumnFilter();
65+
66+
//menu += "<th width='97%' nowrap>";
67+
//menu += "<input type=textbox size=3 id=defFilterContinentText maxlength=2><input type=button id=defFilterContinent value='" + trans.sp.commands.continentFilter + "'>";
68+
//menu += "</th></tr>";
69+
70+
1471
menu += "</table>";
1572
overviewTable.before(menu);
1673

74+
// switch tooltips on reverse filter checkbox change
75+
$("#defReverseFilter").change( function () {
76+
var isChecked = $(this).is(":checked");
77+
var defTrans = trans.sp.commands;
78+
var i;
79+
80+
//filterButtonId
81+
82+
$("#defFilterContinent").attr("title", isChecked ? defTrans.continentFilterTooltip : defTrans.continentFilterTooltipReverse);
83+
84+
$("#defFilterText").attr("title", defTrans.freeTextFilterTooltip.replace("{filterType}", isChecked ? defTrans.freeTextFilterTooltipFilterTypeWith : defTrans.freeTextFilterTooltipFilterTypeWithout));
85+
});
86+
87+
// Auto filter - column 1 (commandName)
88+
//filterCommandName
89+
90+
// Auto filter - column 2 (target village)
91+
//filterTarget
92+
93+
94+
95+
// select all checkbox
1796
$("#select_all").replaceWith("<input type='checkbox' id='selectAll'>");
1897
$("#selectAll").change(function() {
1998
var isChecked = $("#selectAll").is(":checked");

0 commit comments

Comments
 (0)