📄 isc_developerconsole.js
字号:
var expires=new Date();expires.setFullYear(expires.getFullYear()+20);expires=expires.toGMTString();isc.Page.setEvent("resize","saveState()");function saveState(){if(!validOpener()||!window.resultsLayout)return;if(window.dontSaveState)return true;if(!validOpener())return true;var _1=isc.LogViewer.getLogCookie();var _2=targetWindow.isc.LogViewer.getGlobalLogCookie();if(_1==null)_1={};if(_2==null)_2={};isc.addProperties(_2,targetWindow.isc.Page.getWindowRect(window));if(targetWindow.isc.Browser.isIE){_2.top-=23;_2.left-=4}_2.priorityDefaults=targetWindow.isc.Log.getLogPriorities();_2.defaultPriority=targetWindow.isc.Log.defaultPriority;if(window.rpcConfig){_2.trackRPC=rpcConfig.getValue("trackRPC")}var _3=isc.Comm.serialize(_2);targetWindow.isc.Cookie.set('GLog',_3,"/",null,expires);_1.evalExpression=evalForm.getValue("evalExpression");var _4=evalXMLForm.getValue("xmlData");if(_4&&_4.length<256)_1.evalXMLData=_4;var _5=evalJavaForm.getValue("javaCode");if(_5&&_5.length<256)_1.javaCode=_5;if(window.watchForm){_1.watchObject=watchForm.getValue("watchObject");_1.watchMethod=watchForm.getValue("watchMethod");_1.keepOpen=watchForm.getValue("keepOpen");_1.showHidden=watchFlags.getValue("showHidden");_1.showUndrawn=watchFlags.getValue("showUndrawn");_1.showGenerated=watchFlags.getValue("showGenerated")}if(window.supportForm){_1.username=supportForm.getValue("username");_1.password=supportForm.getValue("password")}var _6=isc.Comm.serialize(_1);if(_6.length>1200){_1.evalExpression=_1.evalExpression.substring(0,500);_6=isc.Comm.serialize(_1)}isc.Cookie.set('Log',_6,null,null,expires);return[_1,_2]}function setResultsValue(_1,_2,_3){var _4=resultsForm.getItem("results");var _5=isc.RichTextItem&&isc.isA.RichTextItem(_4);if(_5)_4=_4.canvas.editArea;var _6=_4.getScrollTop();_3=_3||(_6>=_4.getScrollHeight()-_4.getInnerHeight());if(_2){if(_5){_4.appendContents(_1)}else{var _7=resultsForm.getValue("results");resultsForm.setValue("results",_7?_7+_1:_1)}}else{resultsForm.setValue("results",_1)}if(_3){if(!_5&&isc.Browser.isIE)isc.Page.setEvent("idle","resultsForm.getItem('results').scrollToBottom();",isc.Page.FIRE_ONCE);else_4.scrollToBottom()}else if(isc.Browser.isMoz&&!_5)_4.scrollTo(null,_6)}function addToLog(_1,_2){if(!validOpener())return;_1=(targetWindow.isc.Log.showTimestamp?targetWindow.isc.Log.getLogTimestamp()+":":"")+_1+"\r";if(isc.Browser.isSafari){markForAddToLog(_1,_2);return}setResultsValue(_1,true,_2)}function markForAddToLog(_1,_2){if(isc.LogViewer.$486==null)isc.LogViewer.$486=_1;else isc.LogViewer.$486+=_1;if(_2)isc.LogViewer.$487=true;if(isc.LogViewer.$488==null){isc.Timer.setTimeout("delayedAddToLog()",100)}}function delayedAddToLog(){isc.LogViewer.$488=null;var _1=isc.LogViewer.$486;isc.LogViewer.$486=null;var _2=isc.LogViewer.$487;delete isc.LogViewer.$487;if(_1==null)return;setResultsValue(_1,true,_2)}function clearResults(){resultsForm.clearValues();if(isc.LogViewer.$488)isc.Timer.clear(isc.LogViewer.$488);isc.LogViewer.$488=null;isc.LogViewer.$486=null}function doEval(_1){if(!validOpener())return;var _2=evalForm.getValue('evalExpression');var _3=targetWindow.isc.Canvas._canvasList[0];if(window.canvasList){var _4=canvasList.getSelectedRecord();if(_4)_3=targetWindow[_4.id]}var _5={literalText:literalText.getValue(),watched:_3,element:window.commDisplay?commDisplay.getSelectedElement():null,time:executeTimeMethod,trace:executeTraceMethod,traceCall:function(_6,_7){executeTraceMethod(_6,_7,true)},timeExpression:function(_2,_6,_7){targetWindow.isc.Log.timeExpression(_2,_6,_7)},log:function(_6,_7){return targetWindow.isc.Log.logWarn.call(targetWindow.isc.Log,_6,_7)},echo:function(_6){return targetWindow.isc.Log.echo(_6)},echoAll:function(_6){return targetWindow.isc.Log.echoAll(_6)}}if(_1||isc.Browser.isSafari){targetWindow.isc.Log.logViewer.$489=_2;targetWindow.isc.Log.logViewer.$49a=_5;targetWindow.isc.Timer.setTimeout("var viewer = isc.Log.logViewer;"+"viewer.evaluate(viewer.$489,viewer.$49a);"+"viewer.$489 = viewer.$49a = null;",_1?3000:100)}else targetWindow.isc.Log.logViewer.evaluate(_2,_5)}function doEvalJava(){if(!validOpener())return;if(!isc.RPCManager.xmlHttpRequestAvailable()){addToLog("Eval Java requires XMLHttpRequest support, but no support detected."+(isc.Browser.isIE?" Check to make sure safe-for-scripting ActiveX scripts"+" are enabled.":isc.emptyString));return}var _1=evalJavaForm.getValue("javaCode");if(!_1.match(/<%(.|\n|\r)*%>/))_1="<%\n"+_1+"\n%>";isc.DMI.callBuiltin({methodName:"evalJava",callback:"doEvalJavaCallback(rpcResponse, data)",arguments:_1,requestParams:{willHandleError:true}})}function doEvalJavaCallback(_1,_2){if(isc.isA.String(_2)){_2=_2.replace(/^(\s|\n|\r)*/,isc.emptyString);_2=_2.replace(/(\s|\n|\r)*$/,isc.emptyString)}if(_1.status!=RPCResponse.STATUS_SUCCESS){addToLog("evalJava FAILED: "+_2);return}addToLog("Result of Java eval (leading and trailing whitespace removed): \n"+_2)}function doEvalXML(){if(!validOpener())return;var _1=evalXMLForm.getValue("xmlData");isc.xml.toJSCode(_1,"doEvalXMLCallback(data)")}function doEvalXMLCallback(_1){if(!validOpener())return;targetWindow.eval(_1)}function executeTimeMethod(_1,_2){if(!validOpener())return;if(_1!=""&&_2!=""){targetWindow.isc.Log.timeMethod(_1,_2);saveState()}}function executeTraceMethod(_1,_2,_3){if(!validOpener())return;if(_1!=""&&_2!=""){targetWindow.isc.Log.traceMethod(_1,_2,(_3?true:false));saveState()}}function execute(_1){saveState();eval(_1);return false}var DEFAULT_CATEGORIES=[{name:"layout",description:"Logs from Layout and Stack about members and layout policy."},{name:"sizing",description:"Reporting drawn sizes"},{name:"scrolling",description:"Detecting the need for scrolling and custom scrollbars"},{name:"animation",description:"Animation logs"},{name:"RPCManager",description:"RPC and DataSource requests and responses"},{name:"RPCManagerResponse",description:"Enable logging of full length RPC responses (can be slow)"},{name:"xmlComm",description:"Inbound and outbound XML messages"},{name:"xmlSelect",description:"XPath expressions and their results"},{name:"xmlBinding",description:"DataSource and WebService XML request/response handling"},{name:"xmlToJS",description:"XML to JavaScript translation in databinding"},{name:"ResultSet",description:"Load on demand and cache update management for ListGrids"},{name:"ResultTree",description:"Load on demand for TreeGrids"},{name:"FileLoader",description:"Background download and caching of files"},{name:"dragDrop",description:"Drag and drop related logs"},{name:"EventHandler",description:"Mouse and keyboard events, bubbling, cancellation"},{name:"visualState",description:"Visual state transitions for buttons, bars, and other stateful widgets"},{name:"gridEdit",description:"Inline editing in grids"},{name:"Page",description:"Page-wide events"},{name:"loadTime",description:"ISC load / parse time"},{name:"redraws",description:"Logging of redraw()s and reasons for them"},{name:"redrawTrace",description:"Logs a stack trace for every redraw when both 'redraws' "+"and 'redrawTrace' are set to debug priority"},{name:"clears",description:"Logs all clear()s"},{name:"destroys",description:"Logs all destroy()s"},{name:"draws",description:"All component draws"},{name:"resize",description:"Resizes of drawn components"},{name:"DynamicForm"},{name:"ListGrid"},{name:"TreeGrid"},{name:"CubeGrid"},{name:"deprecated",description:"Notify when deprecated attributes are used"}]function getDefaultCategories(){return DEFAULT_CATEGORIES.getProperty("name")}function getLogCategories(_1){if(!validOpener())return;var _2=targetWindow.isc.Log.getLogPriorities(_1),_3=getDefaultCategories();for(var _4 in _2){if(_3.contains(_4))continue;_3[_3.length]=_4}return _3}function getLogCategoryData(_1){if(!validOpener())return null;var _2=(_1?targetWindow.isc.Log.getLogPriorities(_1,true):null),_3=getLogCategories(_1),_4=targetWindow.isc.Log;var _5=[],_6;for(var i=0;i<_3.length;i++){var _8=_3[i];if(_1){if(_8==isc.Log._allCategories)continue;else if(_8==isc.Log.$fs){_6=_1.getDefaultLogPriority();continue}}var _9=_4.getPriority(_8,_1);_5.add({category:_8,priority:_9||_4.defaultPriority,custom:_2&&_2[_8]!=null})}_5.add({category:"[default]",priority:(_6||_4.defaultPriority),custom:(_6?true:false)});return _5}function getCategoryDescription(_1){for(var i=0;i<DEFAULT_CATEGORIES.length;i++){if(DEFAULT_CATEGORIES[i].name==_1)return DEFAULT_CATEGORIES[i].description}return null}function updateLogPriority(_1,_2,_3,_4){if(!validOpener())return;if(_2==null||_1==null)return;_2=parseInt(_2);var _5,_6={"1":"Fatal","2":"Error","3":"Warn","4":"Info","5":"Debug"},_7=_6[_2];if(isc.isA.Number(_2)){if(_1=="$fs"){targetWindow.isc.Log.setDefaultPriority(_2,_3);if(!_4)_5="Default Priority set to:"+_7}else if(_1=="_allCategories"){targetWindow.isc.Log.setPriority(null,_2,_3);if(!_4)_5="Now logging all messages at priority '"+_7+"' and above on this component."}else{targetWindow.isc.Log.setPriority(_1,_2,_3);if(!_4)_5="Logging messages at priority '"+_7+"' and above for category '"+_1+"'."}saveState();if(!_4)addToLog((_3?"Log Priorities updated for component: "+_3:"Global Log Priorities updated: ")+_5)}}function getCanvasList(){if(!validOpener())return;var _1=window.targetWindow.isc,_2=_1.Canvas._canvasList,_3=getLogCookieValue('showGenerated'),_4=getLogCookieValue('showUndrawn'),_5=getLogCookieValue('showHidden'),_6=[],_7={};var _8=[,"w x ",,"h"];var _9=[,", "];for(var i=0;i<_2.length;i++){var _11=_2[i];if(_1.Page._eT==_11)continue;else if(_1.Log._hiliteCanvas==_11)continue;else if(!_5&&!_11.isVisible())continue;else if(!_4&&!_11.isDrawn())continue;else if(_11._generated&&!_3)continue;var _12={id:_11.getID(),theClass:_11.Class,drawn:_11.isDrawn(),visible:_11.isVisible(),zIndex:_11.getZIndex(),hasChildren:_7[_11.getID()]};_8[0]=_11.getWidth();_8[2]=_11.getHeight();_12.size=_8.join(isc.emptyString);_8[0]=_11.getVisibleWidth();_8[2]=_11.getVisibleHeight();_12.drawnSize=_8.join(isc.emptyString);try{_9[0]=_11.getPageLeft();_9[2]=_11.getPageTop();_12.position=_9.join(isc.emptyString)}catch(e){_12.position="Error: "+e}var _13=_11;while(_13&&(_13.masterElement||_13.parentElement)){_13=(_13.masterElement||_13.parentElement);if(_3||!_13._generated)break}if(_13!=_11){var _14=_7[_13.getID()];if(_14)_14.hasChildren=true;else _7[_13.getID()]=true;_12.treeParentId=_13.ID}_7[_11.ID]=_12;_6.add(_12)}var _15=Tree.create({data:_6,modelType:"parent",idField:"id",parentIdField:"treeParentId",isFolderProperty:"hasChildren"});_15.openAll();return _15}function initPrioritiesMenu(){Menu.create({ID:"prioritiesSubmenu",hasLogPriority:function(_14){var _1=prioritiesMenu.component,_2=(this.category=="$fs"?targetWindow.isc.Log.getDefaultPriority(_1):targetWindow.isc.Log.getPriority(this.category,_1));if(_2==null)_2=targetWindow.isc.Log.getDefaultPriority();return(_2==_14)},data:[{title:"Debug",priority:5,checkIf:"this.hasLogPriority(5)"},{title:"Info",priority:4,checkIf:"this.hasLogPriority(4)"},{title:"Warn",priority:3,checkIf:"this.hasLogPriority(3)"},{title:"Error",priority:2,checkIf:"this.hasLogPriority(2)"},{title:"Fatal",priority:1,checkIf:"this.hasLogPriority(1)"}],itemClick:function(_14){var _3=this.category,_2=_14.priority,_1=prioritiesMenu.component;updateLogPriority(_3,_2,_1)}});var _4=getLogCategories(),_5=[],_6=[],_7=isc.Page.getHeight(),_8=Menu.getPrototype(),_9=_7-(_8.showShadow?_8.shadowDepth:0)-(_8.showEdges?2*_8.edgeSize:0);cellHeight=_8.cellHeight,numberOfCategories=Math.floor(_9/ cellHeight)-5;var _10=Math.min(_4.length,numberOfCategories);for(var i=0;i<_10;i++){var _3=_4[i];_6.add({title:_3,category:_3,submenu:prioritiesSubmenu,enableIf:"this.allCategoriesOverride() == null"})}_6.add({isSeparator:true});_6.add({title:"[default]",category:"$fs",submenu:prioritiesSubmenu,enableIf:"this.allCategoriesOverride() == null"})_6.add({title:"More...",click:"menu.setCustomLogPriorities()"});_5=_6.duplicate();_5.addListAt([{title:"All Categories",checkIf:"this.allCategoriesOverride() != null",submenu:Menu.create({getOverride:function(){return prioritiesMenu.allCategoriesOverride()},data:[{title:"Log By Category",enableIf:"this.getOverride() != null",checkIf:"this.getOverride() == null"},{isSeparator:true},{title:"Debug",priority:5,checkIf:"this.getOverride() == 5"},{title:"Info",priority:4,checkIf:"this.getOverride() == 4"},{title:"Warn",priority:3,checkIf:"this.getOverride() == 3"},{title:"Error",priority:2,checkIf:"this.getOverride == 2"},{title:"Fatal",priority:1,checkIf:"this.getOverride() == 1"}],itemClick:function(_14){var _1=prioritiesMenu.component;if(_14.priority)updateLogPriority("_allCategories",_14.priority,_1);else _1.clearLogPriority("_allCategories")}})},{isSeparator:true}],0);Menu.create({ID:"prioritiesMenu",showSubmenu:function(_14){if(_14.category)prioritiesSubmenu.category=_14.category;this.Super("showSubmenu",arguments)},setPriorityComponent:function(_1){this.component=_1;var _6=_1?this.componentMenuItems:this.generalMenuItems;for(var i=0;i<_6.length;i++){var _12=_6[i],_3=_12.category;if(_3){var _2=targetWindow.isc.Log.getPriority(_3,_1),_13=(_2>isc.Log.WARN?"color:blue;":null);if(_13!=_12.cssText){_12.cssText=_13}}}this.setData(_6);if(this.isDrawn())this.redraw()},allCategoriesOverride:function(){var _1=this.component;if(!_1)return;return targetWindow.isc.Log.getLogPriorities(_1)._allCategories},componentMenuItems:_5,generalMenuItems:_6,setCustomLogPriorities:function(){if(!window.logPriorityDialog)initPriorityDialog();logPriorityDialog.setTarget(this.component)}})}function initPriorityDialog(){isc.Dialog.create({ID:"logPriorityDialog",autoDraw:false,autoCenter:true,width:400,height:"80%",canDragReposition:true,canDragResize:true,isModal:true,showToolbar:true,toolbarButtons:[isc.Dialog.OK,isc.Dialog.CANCEL],items:[DynamicForm.create({ID:"allCategoriesForm",autoDraw:false,numCols:2,colWidths:[400,100],items:[{type:"checkbox",name:"setAll",getTitle:function(){return"<b>All messages</b> on <b>"+logPriorityDialog.target.getID()+"</b>"},defaultDynamicValue:function(){var _1=window.logPriorityDialog?logPriorityDialog.target:null;if(_1)return(targetWindow.isc.Log.getLogPriorities(_1)._allCategories!=null)},endRow:false,colSpan:1,showTitle:false,change:function(_14,_15,_16){var _2=this.form.getItem("priority");if(_16){_2.setValue(isc.Log.WARN);_2.setDisabled(false);specificCategoriesLayout.disable()}else{_2.clearValue();_2.setDisabled(true);specificCategoriesLayout.enable()}}},{type:"select",showTitle:false,name:"priority",valueMap:{"1":"Fatal","2":"Error","3":"Warn","4":"Info","5":"Debug"},defaultDynamicValue:function(){var _1=window.logPriorityDialog?logPriorityDialog.target:null;if(_1)return targetWindow.isc.Log.getLogPriorities(_1)._allCategories}}]}),VLayout.create({ID:"specificCategoriesLayout",width:"90%",height:"100%",autoDraw:false,layoutAlign:isc.Canvas.CENTER,border:"1px solid black",membersMargin:10,layoutMargin:10,members:[ListGrid.create({ID:"widgetCategoryGrid",sortFieldNum:0,sortDirection:Array.ASCENDING,selectionType:"single",autoDraw:false,layoutAlign:isc.Canvas.CENTER,canEdit:true,modalEditing:true,width:"90%",height:"100%",canHover:true,showHovers:true,cellHoverHTML:function(_3,_14,_15){return getCategoryDescription(_3.category)},fields:[{name:"category",title:"Category",canEdit:true},{name:"priority",title:"Priority",width:70,canEdit:true,valueMap:{"1":"Fatal","2":"Error","3":"Warn","4":"Info","5":"Debug"}}],canEditCell:function(_14,_15){var _3=this.getRecord(_14),_4=this.getField(_15);if(_4.name=="category"&&_3.category=="[default]")return false;return this.Super("canEditCell",arguments)},cellChanged:function(_3){_3.custom=true},rowClick:function(_3){var _5=this.getSelectedRecord();removeButton.setDisabled(!_5.custom)},getCellCSSText:function(_3,_14,_15){if(_3.custom)return"color:red;"var _6=parseInt(_3.priority);var _7=(_6!=isc.Log.defaultPriority)return _7?"font-weight:bold;":null}}),HLayout.create({autoDraw:false,membersMargin:10,height:10,width:"100%",overflow:"visible",members:[Button.create({autoDraw:false,title:"Add...",click:function(){var _8=widgetCategoryGrid.data;_8.addAt({custom:true,category:"New Category",priority:isc.Log.WARN},0)widgetCategoryGrid.startEditing(0,widgetCategoryGrid.getFieldNum("category"))}}),Button.create({ID:"removeButton",disabled:true,autoDraw:false,title:"Remove",click:function(){var _3=widgetCategoryGrid.getSelectedRecord(),_9=_3.category;if(_9=="[default]"){_3.custom=false;_3.priority=targetWindow.isc.Log.getDefaultPriority();widgetCategoryGrid.data.dataChanged()}else if(getLogCategories().contains(_9)){_3.custom=false;_3.priority=(targetWindow.isc.Log.getPriority(_9)||targetWindow.isc.Log.getDefaultPriority());widgetCategoryGrid.data.dataChanged()}else{widgetCategoryGrid.data.remove(_3)}}})]})]})],setTarget:function(_1){if(_1)this.setTitle("Logging priorities for target: "+_1.getID());else this.setTitle("Page Level Logging Priorities");this.target=_1;var _8=getLogCategoryData(_1)widgetCategoryGrid.setData(_8);if(_1){var _10=targetWindow.isc.Log.getLogPriorities(_1)._allCategories;allCategoriesForm.getItem("priority").setDisabled(_10==null);allCategoriesForm.show();specificCategoriesLayout.setDisabled(_10!=null)}else{allCategoriesForm.hide();specificCategoriesLayout.setDisabled(false)}this.show()},okClick:function(){if(this.target&&allCategoriesForm.getValue("setAll")){var _11=parseInt(allCategoriesForm.getValue("priority"));updateLogPriority("_allCategories",_11,this.target)}else{if(!validOpener())return;if(this.target)this.target.clearLogPriority();var _8=widgetCategoryGrid.data,_12={};for(var i=0;i<_8.length;i++){if(_8[i].custom){var _6=parseInt(_8[i].priority),_9=_8[i].category;_12[_9]=_6;if(_9=="[default]"){targetWindow.isc.Log.setDefaultPriority(_6,this.target)}else{targetWindow.isc.Log.setPriority(_9,_6,this.target)}}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -