G_Debug.js 3.3 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: hal
  3. // (C) Copyright IBM Corp. 2003, 2017.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. var G_Debug={};G_Debug._hI11=new Array(50);G_Debug._hQE1=1;G_Debug.F_EnableDebugMode=function(_hVZ1){this._hJ11=_hVZ1;};G_Debug.F_IsDebugEnabled=function(){return !!this._hJ11;};G_Debug.F_OnRequireResourceLoad=function(context,_hOD2,_hCS1){if(!G_Debug._hC4){G_Debug._hC4=[];}G_Debug._hC4.push( { "map":_hOD2, "depArray":_hCS1 } );};G_Debug.F_GetRequireResourcesAsXmlString=function(_h6A){var d=U_XML.F_LoadString(D_XmlError, "<require.js/>", false);var _hAA2=d.documentElement;for(var i=0;i<this._hC4.length;i++){var o=this._hC4[i];var _hOD2=o.map;var _hEB2=_hAA2.appendChild(d.createElement("file"));if(_hOD2.prefix){_hEB2.setAttribute("prefix", _hOD2.prefix);}_hEB2.setAttribute("name", _hOD2.name);if(_hOD2.url&&(_hOD2.name!=_hOD2.url)&&((_hOD2.name+".js")!=_hOD2.url)){_hEB2.setAttribute("url", _hOD2.url);}if((_h6A!==false)&&o.depArray){o.depArray.forEach(this._hVL.bind(this, d, _hEB2));}}return _hAA2.xml;};G_Debug._hVL=function(d,_hEB2,_hOD2){var _hPD2=_hEB2.appendChild(d.createElement("dependency"));if(_hOD2.prefix){_hPD2.setAttribute("prefix", _hOD2.prefix);}_hPD2.setAttribute("name", _hOD2.name);if(_hOD2.url&&(_hOD2.name!=_hOD2.url)&&((_hOD2.name+".js")!=_hOD2.url)){_hPD2.setAttribute("url", _hOD2.url);}};G_Debug.F_ClearRequireResourcesLog=function(){this._hC4=[];};G_Debug.F_ShowConsole=function(){try{if(this._hRE2&&!this._hRE2.closed){return;}this._hQE1=1;var _hFB2=[];for(var i=0;i<this._hI11.length;i++){var s=this._hI11[i];if(s){_hFB2.push(this._hK11(s));}}var _h5Y1=_hFB2.join("");var _hZL1="white-space:nowrap;background-color:black;color:silver;padding:5px;font-size:10pt";this._hRE2=U_DOM.F_ShowChildWindow( _h5Y1, "HAL Debug Console", _hZL1 );}catch(e){}};G_Debug.F_CloseConsole=function(){try{if(this._hRE2&&!this._hRE2.closed){this._hRE2.close();}this._hRE2=null;}catch(e){}};G_Debug.F_Print=function(s){try{this._hRE1(s);console.log(s);if(this._hRE2&&!this._hRE2.closed){this._hRE2.document.body.innerHTML+= this._hK11(s);this._hRE2.scrollBy(0, 10000);}}catch(e){}};G_Debug.F_PrintObject=function(o,_h492){switch(typeof o){case "object":if(o){if(o.constructor==Array){for(var i=0;i<o.length;i++){this.F_Print((_h492?_h492:"" ) + "[" + i + "] = " + o[i] );}}else{for(var s in o){this.F_Print((_h492?_h492:"" ) + "[" + s + "] = " + o[s] );}}}break;case "string":case "number":case "boolean":case "function":case "undefined":this.F_Print(String(o));break;}};G_Debug.F_Alert=function(s){if(!this._hJ11){return;}try{this._hRE1(s);window.alert( "Debug Alert:\r\n\r\n" + s );}catch(e){}};G_Debug.F_Assert=function(b){if(!this._hJ11){return;}try{if(!b&&window.confirm( "Assertion failed!\r\n\r\nDebug?" ) ){debugger;}}catch(e){}};G_Debug._hK11=function(s){s=( this._hQE1++ ).toString().F_PadLeft( " ", 4 ).replace( /\s/g, "&nbsp;" ) + ": " + String( s ).F_HTMLEncode();s=s.replace(/\n/g, "<br>");s=s.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");s=s.replace(/ /g, "&nbsp;&nbsp;");s="<div><tt>" + s + "</tt></div>";return s;};G_Debug._hRE1=function(s){this._hI11.splice(0, 1);this._hI11.push(s);};G_Debug.F_TimeStart=function(s){G_Performance.F_TimeStart(s);};G_Debug.F_TimeEnd=function(s){G_Performance.F_TimeEnd(s);};