2017-02-16 19:52:11 +01:00
|
|
|
/* Faction Invitation Pop-up box */
|
|
|
|
function factionInvitationBoxInit() {
|
|
|
|
var cancelButton = document.getElementById("faction-invitation-box-no");
|
|
|
|
|
|
|
|
//Close Dialog box
|
|
|
|
cancelButton.addEventListener("click", function() {
|
|
|
|
factionInvitationBoxClose();
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", factionInvitationBoxInit, false);
|
|
|
|
|
|
|
|
factionInvitationBoxClose = function() {
|
|
|
|
var factionInvitationBox = document.getElementById("faction-invitation-box-container");
|
|
|
|
factionInvitationBox.style.display = "none";
|
|
|
|
}
|
|
|
|
|
|
|
|
factionInvitationBoxOpen = function() {
|
|
|
|
var factionInvitationBox = document.getElementById("faction-invitation-box-container");
|
|
|
|
factionInvitationBox.style.display = "block";
|
|
|
|
}
|
|
|
|
|
|
|
|
factionInvitationSetText = function(txt) {
|
|
|
|
var textBox = document.getElementById("faction-invitation-box-text");
|
|
|
|
textBox.innerHTML = txt;
|
|
|
|
}
|
|
|
|
|
|
|
|
factionInvitationSetMessage = function(msg) {
|
|
|
|
var msgBox = document.getElementById("faction-invitation-box-message");
|
|
|
|
msgBox.innerHTML = msg;
|
|
|
|
}
|
|
|
|
|
|
|
|
//ram argument is in GB
|
|
|
|
factionInvitationBoxCreate = function(faction) {
|
|
|
|
factionInvitationSetText("You have received a faction invitation from " + faction.name);
|
|
|
|
//TODO Faction invitation message
|
|
|
|
|
2017-05-05 23:27:35 +02:00
|
|
|
var newYesButton = clearEventListeners("faction-invitation-box-yes");
|
|
|
|
//var yesButton = document.getElementById("faction-invitation-box-yes");
|
|
|
|
//var newYesButton = yesButton.cloneNode(true);
|
|
|
|
//yesButton.parentNode.replaceChild(newYesButton, yesButton);
|
2017-04-17 14:26:54 +02:00
|
|
|
|
|
|
|
newYesButton.addEventListener("click", function() {
|
2017-02-16 19:52:11 +01:00
|
|
|
joinFaction(faction);
|
|
|
|
factionInvitationBoxClose();
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
factionInvitationBoxOpen();
|
|
|
|
}
|