var LOGGER_SINGLETON = false; var log = {}; (function() { window.log.info = console.info; var assignmentWorks = true; try { window.log.info("hooking up the console to log"); } catch (e) { // fails in IE10 and IE11 if the console isn't already open assignmentWorks = false; } if (assignmentWorks) { window.log.critical = console.error; window.log.error = console.error; window.log.warning = console.warn; window.log.info = console.info; window.log.debug = console.debug; window.log.trace = console.debug; // there is a console.trace but it means something else } else { window.log.critical = console.error.bind(console); window.log.error = console.error.bind(console); window.log.warning = console.warn.bind(console); window.log.info = console.info.bind(console); window.log.debug = console.debug.bind(console); window.log.trace = console.debug.bind(console); // there is a console.trace but it means something else } })(); (function() { 'use strict'; // Created temporary logger so logging calls don't fail if the initialization doesn't happen correctly if (window.logger == null && window === window.top) { var LOGGER = function() { /** get / set method for display logger instance */ this.getDisplayLogger = function() { return this.displayLogger; }; this.setDisplayLogger = function(displayLogger) { this.displayLogger = displayLogger; }; /** * Method is used to display the logger popup */ this.showDisplayLogger = function() { this.displayLogger.openLogger(); }; /** * Method is used to close the logger popup */ this.closeDisplayLogger = function() { this.displayLogger.closeLogger(); }; } window.logger = new LOGGER(); window.displayLog = new DISPLAY_LOG(); window.logger.setDisplayLogger(displayLog); } })(); /** * Class is JavaScript Bridge between logger / and logger Display - JavaScript is defined in display log because log * window - is dynamically generated, i.e. the source doesn't isn't retrieved from webserver */ function DISPLAY_LOG() { var date = new Date(); /** stores reference to logger popup & tbl */ this.loggerPopup = null; this.loggerWinName = "LOGGER_POPUP_" + date.getTime(); /** * Method clones the data from the passed in instace into this instance.. This is needed because Object instances * are invalid after the creator window is closed i.e. the window which performed the new operation */ this.COPY_DISPLAY_LOG = function(inDisplayLog) { this.loggerPopup = inDisplayLog.loggerPopup; }; /** getter / setter for loggerPopup */ this.setLoggerPopup = function(loggerPopup) { this.loggerPopup = loggerPopup; }; this.getLoggerPopup = function() { return loggerPopup; }; /** * Method closes the instance of the logger popup */ this.closeLogger = function() { if (this.loggerPopup != null && this.loggerPopup.closed == false) { this.loggerPopup.close(); } }; /** * Method is used to either open the existing instance of the logger popup or dynamically create a new instance of * the logger display by building the HTML dynamically for the PopUP */ this.openLogger = function() { // if logger already opened, then simply bring to focus if (this.loggerPopup != null && this.loggerPopup.closed == false) { this.loggerPopup.focus(); return; } var topWin = window.top.topWindow; var features = 'height=800,width=800,location=no,menubar=no,status=no,resizable=yes'; if (topWin && topWin.isClientSideFailover()) { // error.do is only being used because it's a non secured action, so it can be loaded without having a // valid // session (that will cause document.domain to be set and logger code will properly be opened) this.loggerPopup = window.open(getFullURL('error.do?showJSLogger=true&uid=' + topWin.uid), this.loggerWinName, features); // Delayed document.write as it takes a bit of time for the popup to set the document.domain this.delayedWriteLoggerWindowContent(); } else { this.loggerPopup = window.open('', this.loggerWinName, features); this.writeLoggerWindowContent(false); } }; this.delayedWriteLoggerWindowContent = function(count) { if (!count) { count = 0; } try { this.writeLoggerWindowContent(true); } catch (e) { if (count < 20) { window.setTimeout('displayLog.delayedWriteLoggerWindowContent(' + (++count) + ')', 500); } } }; this.writeLoggerWindowContent = function(isClientSideFailover) { var logWindowInfo = window.top.logWindowInfo; var devEnv = window.top.devEnvEnabled; var htmlContent = new Array( "Debug Tools\n", (isClientSideFailover ? "" : ""), "