Improved confirm messages for clipboard actions w/o DBOAction
authorAlexander Ebert <ebert@woltlab.com>
Thu, 5 Jun 2014 21:06:13 +0000 (23:06 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 5 Jun 2014 21:06:13 +0000 (23:06 +0200)
wcfsetup/install/files/js/WCF.js
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 91293bcd6a8e35e528e62b8ba6bf8ff9f3e8449a..ba133ea3da1aed4b3fa93301653e59acff9c17ee 100755 (executable)
@@ -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') ]);
+               }
        },
        
        /**
index 565b1073a3fa924f439bcbba3a8406685dc5f928..adce4a87a9da23a9ea98ee59b18a6549771370cd 100644 (file)
@@ -1920,6 +1920,7 @@ Fehler sind beispielsweise:
                <item name="wcf.global.noSelection"><![CDATA[(Keine Auswahl)]]></item>
                <item name="wcf.global.acp"><![CDATA[Administrationsoberfläche]]></item>
                <item name="wcf.global.acp.short"><![CDATA[Administration]]></item>
+               <item name="wcf.global.worker.completed"><![CDATA[Aufgabe abgeschlossen]]></item>
                <item name="wcf.global.worker.executing"><![CDATA[Aufgaben werden ausgeführt …]]></item>
                <item name="wcf.global.filter"><![CDATA[Filter]]></item>
                <item name="wcf.global.noItems"><![CDATA[Es wurden keine Einträge gefunden.]]></item>
index 94ce2a92f76a02e3783885f6338e658c3db9e659..d5a504b96befd24bc9f45a19132d353a601ed0b5 100644 (file)
@@ -1854,6 +1854,7 @@ Errors are:
                <item name="wcf.global.noSelection"><![CDATA[(No Selection)]]></item>
                <item name="wcf.global.acp"><![CDATA[Administration Control Panel]]></item>
                <item name="wcf.global.acp.short"><![CDATA[Administration]]></item>
+               <item name="wcf.global.worker.completed"><![CDATA[Task completed]]></item>
                <item name="wcf.global.worker.executing"><![CDATA[Executing …]]></item>
                <item name="wcf.global.filter"><![CDATA[Filter]]></item>
                <item name="wcf.global.noItems"><![CDATA[There are no items.]]></item>