Demo/bin/Debug/front_end/sources_module.js

(开头部分) 307KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

WebInspector.UIList=function()
{WebInspector.VBox.call(this,true);this.registerRequiredCSS("sources/uiList.css");this._items=[];}
WebInspector.UIList._Key=Symbol("ownerList");WebInspector.UIList.prototype={addItem:function(item,beforeItem)
{item[WebInspector.UIList._Key]=this;var beforeElement=beforeItem?beforeItem.element:null;this.contentElement.insertBefore(item.element,beforeElement);var index=beforeItem?this._items.indexOf(beforeItem):this._items.length;console.assert(index>=0,"Anchor item not found in UIList");this._items.splice(index,0,item);},removeItem:function(item)
{var index=this._items.indexOf(item);console.assert(index>=0);this._items.splice(index,1);item.element.remove();},clear:function()
{this.contentElement.removeChildren();this._items=[];},__proto__:WebInspector.VBox.prototype}
WebInspector.UIList.Item=function(title,subtitle,isLabel)
{this.element=createElementWithClass("div","list-item");if(isLabel)
this.element.classList.add("label");this.subtitleElement=this.element.createChild("div","subtitle");this.titleElement=this.element.createChild("div","title");this._hidden=false;this._isLabel=!!isLabel;this.setTitle(title);this.setSubtitle(subtitle);this.setSelected(false);}
WebInspector.UIList.Item.prototype={nextSibling:function()
{var list=this[WebInspector.UIList._Key];var index=list._items.indexOf(this);console.assert(index>=0);return list._items[index+1]||null;},title:function()
{return this._title;},setTitle:function(x)
{if(this._title===x)
return;this._title=x;this.titleElement.textContent=x;},subtitle:function()
{return this._subtitle;},setSubtitle:function(x)
{if(this._subtitle===x)
return;this._subtitle=x;this.subtitleElement.textContent=x;},isSelected:function()
{return this._selected;},setSelected:function(x)
{if(x)
this.select();else
this.deselect();},select:function()
{if(this._selected)
return;this._selected=true;this.element.classList.add("selected");},deselect:function()
{if(!this._selected)
return;this._selected=false;this.element.classList.remove("selected");},toggleSelected:function()
{this.setSelected(!this.isSelected());},isHidden:function()
{return this._hidden;},setHidden:function(x)
{if(this._hidden===x)
return;this._hidden=x;this.element.classList.toggle("hidden",x);},isLabel:function()
{return this._isLabel;},setDimmed:function(x)
{this.element.classList.toggle("dimmed",x);},discard:function()
{}};WebInspector.AddSourceMapURLDialog=function(callback)
{WebInspector.HBox.call(this,true);this.registerRequiredCSS("sources/addSourceMapURLDialog.css");this.contentElement.createChild("label").textContent=WebInspector.UIString("Source map URL: ");this._input=this.contentElement.createChild("input");this._input.setAttribute("type","text");this._input.addEventListener("keydown",this._onKeyDown.bind(this),false);var addButton=this.contentElement.createChild("button");addButton.textContent=WebInspector.UIString("Add");addButton.addEventListener("click",this._apply.bind(this),false);this.setDefaultFocusedElement(this._input);this._callback=callback;this.contentElement.tabIndex=0;}
WebInspector.AddSourceMapURLDialog.show=function(callback)
{var dialog=new WebInspector.Dialog();var addSourceMapURLDialog=new WebInspector.AddSourceMapURLDialog(done);addSourceMapURLDialog.show(dialog.element);dialog.setWrapsContent(true);dialog.show();function done(value)
{dialog.detach();callback(value);}}
WebInspector.AddSourceMapURLDialog.prototype={_apply:function()
{this._callback(this._input.value);},_onKeyDown:function(event)
{if(event.keyCode===WebInspector.KeyboardShortcut.Keys.Enter.code){event.preventDefault();this._apply();}},__proto__:WebInspector.HBox.prototype};WebInspector.AsyncOperationsSidebarPane=function()
{WebInspector.BreakpointsSidebarPaneBase.call(this,WebInspector.UIString("Async Operation Breakpoints"));this.element.classList.add("async-operations");this._updateEmptyElement();var refreshButton=new WebInspector.ToolbarButton(WebInspector.UIString("Refresh"),"refresh-toolbar-item");refreshButton.addEventListener("click",this._refreshButtonClicked.bind(this));this.toolbar().appendToolbarItem(refreshButton);this._asyncOperationsByTarget=new Map();this._operationIdToElement=new Map();this._revealBlackboxedCallFrames=false;this._linkifier=new WebInspector.Linkifier(new WebInspector.Linkifier.DefaultFormatter(30));this._popoverHelper=new WebInspector.PopoverHelper(this.element,this._getPopoverAnchor.bind(this),this._showPopover.bind(this));this._popoverHelper.setTimeout(250,250);this.element.addEventListener("click",this._hidePopover.bind(this),true);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.AsyncOperationStarted,this._onAsyncOperationStarted,this);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.AsyncOperationCompleted,this._onAsyncOperationCompleted,this);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.DebuggerResumed,this._debuggerResumed,this);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);WebInspector.context.addFlavorChangeListener(WebInspector.Target,this._targetChanged,this);WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this._refresh,this);WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this._asyncStackTracesStateChanged,this);WebInspector.targetManager.observeTargets(this);}
WebInspector.AsyncOperationsSidebarPane.prototype={_operationIdSymbol:Symbol("operationId"),_checkedSymbol:Symbol("checked"),targetAdded:function(target)
{},targetRemoved:function(target)
{this._asyncOperationsByTarget.delete(target);if(this._target===target){this._clear();delete this._target;}},_targetChanged:function(event)
{var target=(event.data);if(this._target===target)
return;this._target=target;this._refresh();},operationById:function(target,operationId)
{if(!target)
return null;var operationsMap=this._asyncOperationsByTarget.get(target);if(!operationsMap)
return null;return operationsMap.get(operationId)||null;},_asyncStackTracesStateChanged:function()
{var enabled=WebInspector.moduleSetting("enableAsyncStackTraces").get();if(enabled){this._target=WebInspector.context.flavor(WebInspector.Target);}else if(this._target){this._asyncOperationsByTarget.delete(this._target);delete this._target;}
this._updateEmptyElement();this._refresh();},_updateEmptyElement:function()
{var enabled=WebInspector.moduleSetting("enableAsyncStackTraces").get();if(enabled){this.emptyElement.textContent=WebInspector.UIString("No Async Operations");}else{this.emptyElement.textContent=WebInspector.UIString("Async stack traces are disabled.");this.emptyElement.createTextChild(" ");var enableLink=this.emptyElement.createChild("span","link");enableLink.textContent=WebInspector.UIString("Enable");enableLink.addEventListener("click",enableAsyncStackTraces,true);}
function enableAsyncStackTraces()
{WebInspector.moduleSetting("enableAsyncStackTraces").set(true);}},wasShown:function()
{if(!this._target&&WebInspector.moduleSetting("enableAsyncStackTraces").get()){this._target=WebInspector.context.flavor(WebInspector.Target);this._refresh();}},willHide:function()
{this._hidePopover();},onResize:function()
{this._hidePopover();},revealHiddenCallFrames:function(target)
{if(this._target!==target||this._revealBlackboxedCallFrames)
return;this._revealBlackboxedCallFrames=true;this._refresh();},highlightBreakpoint:function(operationId)
{this._breakpointHitId=operationId;var element=this._operationIdToElement.get(operationId);if(!element)
return;this.expand();element.classList.add("breakpoint-hit");},clearBreakpointHighlight:function()
后面还有 1719+ 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。