Skip to content

Commit

Permalink
Entwicklung #1515
Browse files Browse the repository at this point in the history
  • Loading branch information
GeniusTimo committed Jul 19, 2020
1 parent d4cc9a9 commit b84fad8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
1 change: 1 addition & 0 deletions js/web/_i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"Boxes.Infobox.FilterLevel": "GB",
"Boxes.Infobox.FilterMessage": "Message",
"Boxes.Infobox.FilterTrade": "Trade",
"Boxes.Infobox.UnknownConversation": "Unknown Conversation",
"Boxes.Infobox.Messages.Auction": "'<strong>__player__</strong> has just placed a bid for __amount__ Trade Coins.",
"Boxes.Infobox.Messages.GEX": "<strong>__player__</strong> has just contributed __points__ GE points.",
"Boxes.Infobox.Messages.GildFightOccupied": "<span style=\"color:#ffb539\">__provinceName__</span> was captured by <span style=\"color:__attackerColor__;text-shadow: 0 1px 1px __attackerShadow__\">__attackerName__</span> and is locked until __untilOccupied__.",
Expand Down
1 change: 1 addition & 0 deletions js/web/infoboard/css/infoboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
position: sticky;
top: 0;
padding: 5px;
z-index: 100;
}

#BackgroundInfo #BackgroundInfoBody .filter-row span {
Expand Down
32 changes: 26 additions & 6 deletions js/web/infoboard/js/infoboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ FoEproxy.addHandler('ConversationService', 'getOverviewForCategory', (data, post
MainParser.setConversations(data.responseData);
});

FoEproxy.addHandler('ConversationService', 'getCategory', (data, postData) => {
MainParser.setConversations(data.responseData);
});

// altes Postfach
FoEproxy.addHandler('ConversationService', 'getEntities', (data, postData) => {
Expand Down Expand Up @@ -338,7 +341,7 @@ let Info = {


/**
* Nachricht von jemandem
* Nachricht in einem bekannten Chat
*
* @param d
* @returns {class: 'message', msg: string, type: string, img: string | undefined}
Expand Down Expand Up @@ -383,13 +386,10 @@ let Info = {
}
} else {
// Chatnachricht vom System (Betreten/Verlassen)
header = '<div><strong class="bright">' + header['title'] + '</strong></div>';
header = '<div><strong class="bright">' + chat['title'] + '</strong></div>';
}
} else if (d['sender'] && d['sender']['name']) {
// normale Chatnachricht (unbekannte ID)
header = '<div><strong class="bright">' + d['sender']['name'] + '</strong></div>';
} else {
header = ''
return undefined;
}

return {
Expand All @@ -400,6 +400,26 @@ let Info = {
};
},


/**
* Nachricht in einem unbekannten Chat
*
* @param d
* @returns {class: 'message', msg: string, type: string}
*/
ConversationService_getConversationUpdate: (d) => {
let chat = MainParser.Conversations.find(obj => obj.id === d['conversationId']);
if (chat) return undefined;

let message = '<div><strong class="bright">' + i18n('Boxes.Infobox.UnknownConversation') + '</strong></div>';
return {
class: 'message',
type: i18n('Boxes.Infobox.FilterMessage'),
msg: message
};
},


/**
* Auf der GG-Map kämpft jemand
*
Expand Down

0 comments on commit b84fad8

Please sign in to comment.