www.gusucode.com > rtw 工具箱matlab源码程序 > rtw/+coder/+report/resources/webview_codegen.js

    /*
 Copyright 2015-2016 The MathWorks, Inc.
*/
function webviewToCodeInit(){document.getElementById("rtw_webview").contentWindow.require(["dojo/dom-style","dojo/topic","dojo/window","dijit/registry"],function(k,m,n,p){var c=p.byId("slwebview"),g=!0,h={traceableColor:"#00cfcf",untraceableColor:"#e8d152",getColor:function(d){return d?this.traceableColor:this.untraceableColor},getStyle:function(d,c){var a=this.getColor(c);return"fill:"+a+"; fill-opacity:0.5; stroke:"+a+";"}},f,l=function(d,e,a){c.open(d).then(function(){var b;if(b=c.getElementViewer())if(f&&
k.set(f,"background",""),b=b.getLineNode(e))k.set(b,"background",a),n.scrollIntoView(b),f=b})};m.subscribe("slwebview/select",function(d,e){var a,b;c.isElement(d)&&g&&(c.unhighlightAll(),a=d.backing.sid,b=e&&e.line?e.line:-1,0<=b&&(a=d.backing.obj_viewer.code_sid+":"+b.toString()),a=top.rtwChangeSysCallback(a),c.highlight(d,h.getStyle(d,a)),0<=b&&l(d,b,h.getColor(a)))});top.codeToWebView=function(d,e){var a=c.getElement(d),b,f;a||(f=d.lastIndexOf(":"),b=d.substring(f+1),a=c.getElement(e));if(a){g=
!1;try{c.open(a.diagram).then(function(){try{c.unhighlightAll(),c.moveToView(a),c.highlight(a,h.getStyle(a,!0)),0<=b?(l(a,b,h.getColor(!0)),c.select(a)):c.select(a.diagram)}finally{g=!0}},function(){g=!0})}catch(k){g=!0}}}})};