Allow cancel button in ConfirmDialog to be customizable

This commit is contained in:
Max Leiter 2021-11-16 00:03:02 -08:00
parent 2b0beac1d9
commit 462488edfd
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA
4 changed files with 11 additions and 6 deletions

View file

@ -275,7 +275,7 @@ export default {
this.channel.inputHistory.splice(1, 0, text); this.channel.inputHistory.splice(1, 0, text);
} }
// Limit input history to a 100 entries // Limit input history to 100 entries
if (this.channel.inputHistory.length > 100) { if (this.channel.inputHistory.length > 100) {
this.channel.inputHistory.pop(); this.channel.inputHistory.pop();
} }
@ -304,7 +304,8 @@ export default {
{ {
title: "Upload as file?", title: "Upload as file?",
text: `You're trying to send a lot of text. Would you like to upload it?`, text: `You're trying to send a lot of text. Would you like to upload it?`,
button: "Upload", confirmButton: "Upload",
cancelButton: "Send anyway",
}, },
(result) => { (result) => {
if (!result) { if (!result) {

View file

@ -6,8 +6,12 @@
<p>{{ data.text }}</p> <p>{{ data.text }}</p>
</div> </div>
<div class="confirm-buttons"> <div class="confirm-buttons">
<button class="btn btn-cancel" @click="close(false)">Cancel</button> <button class="btn btn-cancel" @click="close(false)">
<button class="btn btn-danger" @click="close(true)">{{ data.button }}</button> {{ data.cancelButton || "Cancel" }}
</button>
<button class="btn btn-danger" @click="close(true)">
{{ data.confirmButton }}
</button>
</div> </div>
</div> </div>
</div> </div>

View file

@ -154,7 +154,7 @@ export function generateChannelContextMenu($root, channel, network) {
{ {
title: "Clear history", title: "Clear history",
text: `Are you sure you want to clear history for ${channel.name}? This cannot be undone.`, text: `Are you sure you want to clear history for ${channel.name}? This cannot be undone.`,
button: "Clear history", confirmButton: "Clear history",
}, },
(result) => { (result) => {
if (!result) { if (!result) {

View file

@ -36,7 +36,7 @@ new Vue({
{ {
title: "Remove network", title: "Remove network",
text: `Are you sure you want to quit and remove ${channel.name}? This cannot be undone.`, text: `Are you sure you want to quit and remove ${channel.name}? This cannot be undone.`,
button: "Remove network", confirmButton: "Remove network",
}, },
(result) => { (result) => {
if (!result) { if (!result) {