summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2020-02-17 13:27:24 +0100
committerAndras Timar <andras.timar@collabora.com>2020-02-18 11:58:27 +0100
commit32b4805ad5f53782eccb5459af321fc97b72dea4 (patch)
treee7d46141a26a4eb6cfa66b8080a5755c41646da4
parent7091f57b358fd06a236b96cc91990251bba8ea6e (diff)
localize the buttons on vex.dialog.confirm
Change-Id: I24ab50b80e51c293a4ad71c6e5ea80bfda902883 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88860 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--loleaflet/admin/src/AdminSocketOverview.js4
-rw-r--r--loleaflet/admin/src/AdminSocketSettings.js4
-rw-r--r--loleaflet/js/toolbar.js4
-rw-r--r--loleaflet/src/control/Control.Menubar.js4
-rw-r--r--loleaflet/src/control/Control.Tabs.js4
5 files changed, 20 insertions, 0 deletions
diff --git a/loleaflet/admin/src/AdminSocketOverview.js b/loleaflet/admin/src/AdminSocketOverview.js
index 9c61089cc..10895437d 100644
--- a/loleaflet/admin/src/AdminSocketOverview.js
+++ b/loleaflet/admin/src/AdminSocketOverview.js
@@ -100,6 +100,10 @@ var AdminSocketOverview = AdminSocketBase.extend({
$('body').on('click', '#rowContextMenu a', function() {
vex.dialog.confirm({
message: _('Are you sure you want to terminate this session?'),
+ buttons: [
+ $.extend({}, vex.dialog.buttons.YES, { text: _('OK') }),
+ $.extend({}, vex.dialog.buttons.NO, { text: _('Cancel') })
+ ],
callback: function(value) {
if (value) {
var killPid = ($('#rowContextMenu').data('rowToKill')).substring('doc'.length);
diff --git a/loleaflet/admin/src/AdminSocketSettings.js b/loleaflet/admin/src/AdminSocketSettings.js
index a4017c34a..ab43bd605 100644
--- a/loleaflet/admin/src/AdminSocketSettings.js
+++ b/loleaflet/admin/src/AdminSocketSettings.js
@@ -32,6 +32,10 @@ var AdminSocketSettings = AdminSocketBase.extend({
$('#btnShutdown').click(function() {
vex.dialog.confirm({
message: _('Are you sure you want to shut down the server?'),
+ buttons: [
+ $.extend({}, vex.dialog.buttons.YES, { text: _('OK') }),
+ $.extend({}, vex.dialog.buttons.NO, { text: _('Cancel') })
+ ],
callback: function() {
// TODO: Prompt for reason.
socketSettings.send('shutdown maintenance');
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index e89092784..94e96e020 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -196,6 +196,10 @@ function onClick(e, id, item, subItem) {
else if (id === 'deletepage') {
vex.dialog.confirm({
message: _('Are you sure you want to delete this page?'),
+ buttons: [
+ $.extend({}, vex.dialog.buttons.YES, { text: _('OK') }),
+ $.extend({}, vex.dialog.buttons.NO, { text: _('Cancel') })
+ ],
callback: onDelete
});
}
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 5553993eb..674fe1405 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -765,6 +765,10 @@ L.Control.Menubar = L.Control.extend({
var map = this._map;
vex.dialog.confirm({
message: _('Are you sure you want to delete this slide?'),
+ buttons: [
+ $.extend({}, vex.dialog.buttons.YES, { text: _('OK') }),
+ $.extend({}, vex.dialog.buttons.NO, { text: _('Cancel') })
+ ],
callback: function(e) {
if (e) {
map.deletePage();
diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js
index e173c2bac..c963e9892 100644
--- a/loleaflet/src/control/Control.Tabs.js
+++ b/loleaflet/src/control/Control.Tabs.js
@@ -70,6 +70,10 @@ L.Control.Tabs = L.Control.extend({
var nPos = parseInt(options.$trigger.attr('id').split('spreadsheet-tab')[1]);
vex.dialog.confirm({
message: _('Are you sure you want to delete sheet, %sheet% ?').replace('%sheet%', options.$trigger.text()),
+ buttons: [
+ $.extend({}, vex.dialog.buttons.YES, { text: _('OK') }),
+ $.extend({}, vex.dialog.buttons.NO, { text: _('Cancel') })
+ ],
callback: function(data) {
if (data) {
map.deletePage(nPos);