From 22a5e2ee936d272d33695d7ba56069b76bee384e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 5 Jun 2014 23:06:13 +0200 Subject: [PATCH] Improved confirm messages for clipboard actions w/o DBOAction --- wcfsetup/install/files/js/WCF.js | 20 ++++++++++++++++++-- wcfsetup/install/lang/de.xml | 1 + wcfsetup/install/lang/en.xml | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 91293bcd6a..ba133ea3da 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1730,6 +1730,7 @@ WCF.Clipboard = { window.location.href = $url; } + var $fireEvent = true; if ($listItem.data('parameters').className && $listItem.data('parameters').actionName) { if ($listItem.data('parameters').actionName === 'unmarkAll' || $listItem.data('parameters').objectIDs) { var $confirmMessage = $listItem.data('internalData')['confirmMessage']; @@ -1757,9 +1758,24 @@ WCF.Clipboard = { } } } + else { + var $confirmMessage = $listItem.data('internalData')['confirmMessage']; + if ($confirmMessage) { + $fireEvent = false; + + WCF.System.Confirmation.show($confirmMessage, function(action) { + if (action === 'confirm') { + // fire event + $listItem.data('container').trigger('clipboardAction', [ $listItem.data('type'), $listItem.data('actionName'), $listItem.data('parameters') ]); + } + }); + } + } - // fire event - $listItem.data('container').trigger('clipboardAction', [ $listItem.data('type'), $listItem.data('actionName'), $listItem.data('parameters') ]); + if ($fireEvent) { + // fire event + $listItem.data('container').trigger('clipboardAction', [ $listItem.data('type'), $listItem.data('actionName'), $listItem.data('parameters') ]); + } }, /** diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 565b1073a3..adce4a87a9 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1920,6 +1920,7 @@ Fehler sind beispielsweise: + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 94ce2a92f7..d5a504b96b 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1854,6 +1854,7 @@ Errors are: + -- 2.20.1