Refactor request messages
This commit is contained in:
parent
904a9f973f
commit
e8bfdaaa30
3 changed files with 195 additions and 306 deletions
|
|
@ -17,51 +17,63 @@ document.addEventListener('htmx:wsConfigSend', function (e) {
|
|||
};
|
||||
} else if (e.target.id == 'takeback-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'request_takeback',
|
||||
type: 'takeback',
|
||||
action: 'request',
|
||||
};
|
||||
} else if (e.target.id == 'accept-takeback-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'accept_takeback',
|
||||
type: 'takeback',
|
||||
action: 'accept',
|
||||
};
|
||||
} else if (e.target.id == 'decline-takeback-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'decline_takeback',
|
||||
};
|
||||
} else if (e.target.id == 'draw-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'request_draw',
|
||||
};
|
||||
} else if (e.target.id == 'accept-draw-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'accept_draw',
|
||||
};
|
||||
} else if (e.target.id == 'decline-draw-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'decline_draw',
|
||||
};
|
||||
} else if (e.target.id == 'rematch-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'request_rematch',
|
||||
};
|
||||
} else if (e.target.id == 'accept-rematch-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'accept_rematch',
|
||||
};
|
||||
} else if (e.target.id == 'decline-rematch-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'decline_rematch',
|
||||
type: 'takeback',
|
||||
action: 'decline',
|
||||
};
|
||||
} else if (e.target.id == 'cancel-takeback-request-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'cancel_takeback_request',
|
||||
type: 'takeback',
|
||||
action: 'cancel',
|
||||
};
|
||||
} else if (e.target.id == 'draw-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'draw',
|
||||
action: 'request',
|
||||
};
|
||||
} else if (e.target.id == 'accept-draw-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'draw',
|
||||
action: 'accept',
|
||||
};
|
||||
} else if (e.target.id == 'decline-draw-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'draw',
|
||||
action: 'decline',
|
||||
};
|
||||
} else if (e.target.id == 'cancel-draw-request-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'cancel_draw_request',
|
||||
type: 'draw',
|
||||
action: 'cancel',
|
||||
};
|
||||
} else if (e.target.id == 'rematch-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'rematch',
|
||||
action: 'request',
|
||||
};
|
||||
} else if (e.target.id == 'accept-rematch-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'rematch',
|
||||
action: 'accept',
|
||||
};
|
||||
} else if (e.target.id == 'decline-rematch-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'rematch',
|
||||
action: 'decline',
|
||||
};
|
||||
} else if (e.target.id == 'cancel-rematch-request-button') {
|
||||
e.detail.parameters = {
|
||||
type: 'cancel_rematch_request',
|
||||
type: 'rematch',
|
||||
action: 'cancel',
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue