From 73b84427856b24c791cedda6c15ce32df87b70aa Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 20 Jun 2012 19:56:47 +0200 Subject: [PATCH] Improved System.Notification to provide custom HTML --- wcfsetup/install/files/js/WCF.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index baad301f169..4a412e6607a 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -4256,8 +4256,9 @@ WCF.System.Confirmation = { * @param string message * @param object callback * @param object parameters + * @param jQuery template */ - show: function(message, callback, parameters) { + show: function(message, callback, parameters, template) { if (this._visible) { console.debug('[WCF.System.Confirmation] Confirmation dialog is already open, refusing action.'); return; @@ -4274,6 +4275,11 @@ WCF.System.Confirmation = { this._createDialog(); } + this._dialog.find('#wcfSystemConfirmationContent').empty().hide(); + if (template && template.length) { + template.appendTo(this._dialog.find('#wcfSystemConfirmationContent').show()); + } + this._dialog.find('p').html(message); this._dialog.wcfDialog({ onClose: $.proxy(this._close, this), @@ -4288,7 +4294,7 @@ WCF.System.Confirmation = { * Creates the confirmation dialog on first use. */ _createDialog: function() { - this._dialog = $('

').hide().appendTo(document.body); + this._dialog = $('

').hide().appendTo(document.body); var $formButtons = $('
').appendTo(this._dialog); $('').data('action', 'confirm').click($.proxy(this._click, this)).appendTo($formButtons);