/******************************************************************************* * IBM Confidential * * OCO Source Materials * * A and PM: PD * * (c) Copyright IBM Corp. 2014, 2015 * * The source code for this program is not published or otherwise divested of * its trade secrets, irrespective of what has been deposited with the U.S. * Copyright Office. ******************************************************************************/ define([ "dojo/_base/declare", "bux/dialogs/InformationDialog", "dojo/dom-style", "dojo/dom-class" ],function(declare, InformationDialog, domStyle, domClass){ var MessageDialog = declare("pd/widgets/MessageDialog", [InformationDialog], { title: PDMSG.IPT.IDS_IPT_APPLICATION_TITLE, style: "width: auto", postMixInProperties: function() { //pd.convertToInnerHtml is to work around a HTML encode used in BUX InformationNotice.js //which basically will make any XML escaped content (e.g. non-Latin-1 characters in //ERROR_DESC tag in the error page returned by CPS engine) double encoded. this.sMainMessage = pd.convertToInnerHtml(this.sMainMessage); this.sDescription = pd.convertToInnerHtml(this.sDescription); this.inherited(arguments); }, _size: function() { this.inherited(arguments); var oDialogContentContainer = dojo.marginBox(this.dialogContentContainer); domStyle.set(this.dialogContentContainer,{ width: oDialogContentContainer.w + "px", overflow: "auto", position: "relative" }); }, startup: function() { this.inherited(arguments); if (this._titlePane) { domClass.add(this._titlePane.containerNode, "pdDialogPaneContent"); } } }); MessageDialog.Alert = function (_sMainMessage, _sDescription, _okHandler, sInfoIconClass) { var AlertDialog = new MessageDialog({ sInfoIconClass: (sInfoIconClass || 'bux-informationDialog-warning-icon'), sMainMessage: _sMainMessage, sDescription: _sDescription, yesOKHandler : _okHandler }); return AlertDialog; }; MessageDialog.Confirm = function (_title,_sMainMessage, _sDescription, _yesHandler, sInfoIconClass) { var ConfirmDialog = new MessageDialog({ title: _title, sInfoIconClass: (sInfoIconClass || 'bux-informationDialog-warning-icon'), sMainMessage: _sMainMessage, sDescription: _sDescription, buttons : ['YES','NO'], yesOKHandler : _yesHandler }); return ConfirmDialog; }; MessageDialog.Error = function (_sMainMessage, _sDescription, _sDetail, _okHandler) { var ErrorDialog = new MessageDialog({ sInfoIconClass: 'bux-informationDialog-error-icon', sMainMessage: _sMainMessage, sDescription: _sDescription, sDetail : _sDetail, bDetailIsHtml: true, _bContainerHeightAuto: true, yesOKHandler : _okHandler }); return ErrorDialog; }; MessageDialog.Info = function (_sMainMessage, _sDescription, _okHandler) { var InfoDialog = new MessageDialog({ sInfoIconClass: 'bux-informationDialog-info-icon', sMainMessage: _sMainMessage, sDescription: _sDescription, yesOKHandler : _okHandler }); return InfoDialog; }; MessageDialog.Warning = function (_sMainMessage, _sDescription, _sDetail, _okHandler) { var InfoDialog = MessageDialog.WarningWithDetails(_sMainMessage, _sDescription, _sDetail, _okHandler); return InfoDialog; }; MessageDialog.WarningWithDetails = function (_sMainMessage, _sDescription, _sDetail, _okHandler) { var InfoDialog = new MessageDialog({ sInfoIconClass: 'bux-informationDialog-warning-icon', sMainMessage: _sMainMessage, sDescription: _sDescription, sDetail : _sDetail, yesOKHandler : _okHandler, _bContainerHeightAuto: true, bDetailIsHtml:true }); return InfoDialog; }; MessageDialog.Working = function (_sMainMessage) { var WorkingDialog = new MessageDialog({ sInfoIconClass: 'bux-informationDialog-working-icon', sMainMessage: _sMainMessage, buttons: ['CLOSE'], baseClass: "icdDialogNoChrome bux-WorkingDialog", autofocus: false, duration: 0.000001, //Can't be 0, or there will be a divide by 0 exception within the dojo transition. _onShow: function(){ dojo.style(this.domNode, "opacity", 1); } }); return WorkingDialog; }; return MessageDialog; });