{foreach from=$eventList item=event}
<dt>{lang}wcf.user.notification.{$event->objectType}.{$event->eventName}{/lang}</dt>
<dd>
- <a class="button small jsTestEventButton" data-event-id="{$event->eventID}" data-title="{lang}wcf.user.notification.{$event->objectType}.{$event->eventName}{/lang}">{lang}wcf.acp.devtools.notificationTest.button.test{/lang}</a>
+ <button class="small jsTestEventButton" data-event-id="{$event->eventID}" data-title="{lang}wcf.user.notification.{$event->objectType}.{$event->eventName}{/lang}">{lang}wcf.acp.devtools.notificationTest.button.test{/lang}</button>
</dd>
{/foreach}
</dl>
{/foreach}
<script data-relocate="true">
- require(['WoltLabSuite/Core/Acp/Ui/Devtools/Notification/Test'], function(AcpUiDevtoolsNotificationTest) {
+ require(['Language', 'WoltLabSuite/Core/Acp/Ui/Devtools/Notification/Test'], function(Language, AcpUiDevtoolsNotificationTest) {
+ Language.addObject({
+ 'wcf.acp.devtools.notificationTest.button.test': '{lang}wcf.acp.devtools.notificationTest.button.test{/lang}'
+ });
+
AcpUiDevtoolsNotificationTest.init();
});
</script>
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Acp/Ui/Devtools/Project/QuickSetup
*/
-define(['Ajax', 'Dictionary', 'Ui/Dialog'], function(Ajax, Dictionary, UiDialog) {
+define(['Ajax', 'Dictionary', 'Language', 'Ui/Dialog'], function(Ajax, Dictionary, Language, UiDialog) {
var _buttons = elByClass('jsTestEventButton');
var _titles = new Dictionary();
});
elById('notificationTestDialog').parentNode.scrollTop = 0;
+
+ // restore buttons
+ Array.prototype.forEach.call(_buttons, function(button) {
+ button.innerHTML = Language.get('wcf.acp.devtools.notificationTest.button.test');
+ button.disabled = false;
+ });
},
/**
* @param {Event} event
*/
_test: function(event) {
+ var button = event.currentTarget;
+
+ button.innerHTML = '<span class="icon icon16 fa-spinner"></span>';
+
+ Array.prototype.forEach.call(_buttons, function(button) {
+ button.disabled = true;
+ });
+
Ajax.api(this, {
parameters: {
- eventID: elData(event.currentTarget, 'event-id')
+ eventID: elData(button, 'event-id')
}
});
}