From: Alexander Ebert Date: Thu, 5 Jun 2014 21:06:13 +0000 (+0200) Subject: Improved confirm messages for clipboard actions w/o DBOAction X-Git-Tag: 2.1.0_Alpha_1~748^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=22a5e2ee936d272d33695d7ba56069b76bee384e;p=GitHub%2FWoltLab%2FWCF.git Improved confirm messages for clipboard actions w/o DBOAction --- 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: +