/** Licensed Materials - Property of IBM, 5724-U69, (C) Copyright IBM Corp. 2009, 2010 - All Rights reserved. **/ if(!dojo._hasResource["ibm.toolbar.ModalDialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["ibm.toolbar.ModalDialog"] = true; dojo.provide("ibm.toolbar.ModalDialog"); dojo.declare("ibm.toolbar.ModalDialog", null, { // summary: // Provides a thin wrapper around the dialogModal.js based modal dialog framework. // Loads the files using the POC URI, if they have not been loaded by a previous // instance of ibm.toolbar.ModalDialog already. // Mixes the functions and variables defined by the global dialogModal dialog instance // into itself, to provide a ModalDialog instance that is fully compatible to the // previous version which had copied all of the dialogModal source code. // // Usage example: // var modalDlg = new ibm.toolbar.ModalDialog(); // modalDlg.open(, ); // // For more details on available parameters of the open() method, please refer to dialogModal.js // constructor: function() { // summary: // Checks the global singleton variables and if they're not defined yet, dynamically loads either dialogModal.js or // dialogModalUtils.js (or both) using a synchronous XHRGET request from the server. Once loaded, references to // dialogModal and dialogModalUtils objects are stored in the global singleton variables, so that the files // are not loaded again from the server, while there hasn't been a page refresh. // tags: // public if (!ibm.toolbar.ModalDialog.dialogModalSINGLETON) { // load the dialogModal.js, if not there yet dojo.xhrGet( { "url": ibmToolbarConfig.dialogJavascriptURL, "handleAs": "javascript", "sync": true, error: function(error, ioArgs) { // if there was a timeout do page reload to get to login page if(ioArgs.xhr.status == 401) { top.location.reload(); } console.debug("Cannot load modal dialog script: " + error); } }); ibm.toolbar.ModalDialog.dialogModalSINGLETON = dialogModal; } if (!ibm.toolbar.ModalDialog.dialogModalUtilsSINGLETON) { // load the dialogModalUtils.js, if not there yet dojo.xhrGet( { "url": ibmToolbarConfig.dialogUtilsJavascriptURL, "handleAs": "javascript", "sync": true, error: function(error, ioArgs) { // if there was a timeout do page reload to get to login page if(ioArgs.xhr.status == 401) { top.location.reload(); } console.debug("Cannot load modal dialog script: " + error); } }); ibm.toolbar.ModalDialog.dialogModalUtilsSINGLETON = dialogModalUtils; } // mixin methods/properties from dialogModal.js into this instance dojo.mixin(this, dialogModal); } }); // ibm.toolbar.ModalDialog.dialogModalSINGLETON: String // Singleton instance of the dialogModal object ibm.toolbar.ModalDialog.dialogModalSINGLETON = null; // ibm.toolbar.ModalDialog.dialogModalUtilsSINGLETON: String // Singleton instance of the dialogModalUtils object ibm.toolbar.ModalDialog.dialogModalUtilsSINGLETON = null; }