From ce09e323af1d8408cdc680ba060804e6fd234fc9 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 2 Sep 2021 18:42:12 +0200 Subject: [PATCH] ok/cancel buttons in platform-defined order --- copyparty/web/util.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/copyparty/web/util.js b/copyparty/web/util.js index a1d7d1a2..908fe469 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -8,7 +8,8 @@ if (!window['console']) var is_touch = 'ontouchstart' in window, IPHONE = /iPhone|iPad|iPod/i.test(navigator.userAgent), - ANDROID = /android/i.test(navigator.userAgent); + ANDROID = /android/i.test(navigator.userAgent), + WINDOWS = navigator.platform ? navigator.platform == 'Win32' : /Windows/.test(navigator.userAgent); var ebi = document.getElementById.bind(document), @@ -838,8 +839,12 @@ var modal = (function () { var r = {}, q = [], o = null, + cb_up = null, cb_ok = null, - cb_ng = null; + cb_ng = null, + prim = 'OK', + sec = 'Cancel', + ok_cancel = WINDOWS ? prim + sec : sec + prim; r.busy = false; @@ -942,7 +947,7 @@ var modal = (function () { function _confirm(html, cok, cng) { cb_ok = cok; cb_ng = cng === undefined ? cok : null; - html += '
OKCancel
'; + html += '
' + ok_cancel + '
'; r.show(html); } @@ -955,7 +960,7 @@ var modal = (function () { function _prompt(html, v, cok, cng) { cb_ok = cok; cb_ng = cng === undefined ? cok : null; - html += '
OKCancel
'; + html += '
' + ok_cancel + '
'; r.show(html); ebi('modali').value = v || '';