Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: chrome_linux64/resources/inspector/SourcesPanel.js

Issue 310483004: Roll reference builds to 35.0.1916.114. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/reference_builds/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 WebInspector.JavaScriptBreakpointsSidebarPane=function(breakpointManager,showSou rceLineDelegate) 1 WebInspector.JavaScriptBreakpointsSidebarPane=function(debuggerModel,breakpointM anager,showSourceLineDelegate)
2 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Breakpoints"));this.r egisterRequiredCSS("breakpointsList.css");this._breakpointManager=breakpointMana ger;this._showSourceLineDelegate=showSourceLineDelegate;this.listElement=documen t.createElement("ol");this.listElement.className="breakpoint-list";this.emptyEle ment=document.createElement("div");this.emptyElement.className="info";this.empty Element.textContent=WebInspector.UIString("No Breakpoints");this.bodyElement.app endChild(this.emptyElement);this._items=new Map();var breakpointLocations=this._ breakpointManager.allBreakpointLocations();for(var i=0;i<breakpointLocations.len gth;++i) 2 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Breakpoints"));this._ debuggerModel=debuggerModel;this.registerRequiredCSS("breakpointsList.css");this ._breakpointManager=breakpointManager;this._showSourceLineDelegate=showSourceLin eDelegate;this.listElement=document.createElement("ol");this.listElement.classNa me="breakpoint-list";this.emptyElement=document.createElement("div");this.emptyE lement.className="info";this.emptyElement.textContent=WebInspector.UIString("No Breakpoints");this.bodyElement.appendChild(this.emptyElement);this._items=new Ma p();var breakpointLocations=this._breakpointManager.allBreakpointLocations();for (var i=0;i<breakpointLocations.length;++i)
3 this._addBreakpoint(breakpointLocations[i].breakpoint,breakpointLocations[i].uiL ocation);this._breakpointManager.addEventListener(WebInspector.BreakpointManager .Events.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.addE ventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._break pointRemoved,this);this.emptyElement.addEventListener("contextmenu",this._emptyE lementContextMenu.bind(this),true);} 3 this._addBreakpoint(breakpointLocations[i].breakpoint,breakpointLocations[i].uiL ocation);this._breakpointManager.addEventListener(WebInspector.BreakpointManager .Events.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.addE ventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._break pointRemoved,this);this.emptyElement.addEventListener("contextmenu",this._emptyE lementContextMenu.bind(this),true);}
4 WebInspector.JavaScriptBreakpointsSidebarPane.prototype={_emptyElementContextMen u:function(event) 4 WebInspector.JavaScriptBreakpointsSidebarPane.prototype={_emptyElementContextMen u:function(event)
5 {var contextMenu=new WebInspector.ContextMenu(event);var breakpointActive=WebIns pector.debuggerModel.breakpointsActive();var breakpointActiveTitle=breakpointAct ive?WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Deactivate brea kpoints":"Deactivate Breakpoints"):WebInspector.UIString(WebInspector.useLowerCa seMenuTitles()?"Activate breakpoints":"Activate Breakpoints");contextMenu.append Item(breakpointActiveTitle,WebInspector.debuggerModel.setBreakpointsActive.bind( WebInspector.debuggerModel,!breakpointActive));contextMenu.show();},_breakpointA dded:function(event) 5 {var contextMenu=new WebInspector.ContextMenu(event);var breakpointActive=this._ debuggerModel.breakpointsActive();var breakpointActiveTitle=breakpointActive?Web Inspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Deactivate breakpoints ":"Deactivate Breakpoints"):WebInspector.UIString(WebInspector.useLowerCaseMenuT itles()?"Activate breakpoints":"Activate Breakpoints");contextMenu.appendItem(br eakpointActiveTitle,this._debuggerModel.setBreakpointsActive.bind(this._debugger Model,!breakpointActive));contextMenu.show();},_breakpointAdded:function(event)
6 {this._breakpointRemoved(event);var breakpoint=(event.data.breakpoint);var uiLoc ation=(event.data.uiLocation);this._addBreakpoint(breakpoint,uiLocation);},_addB reakpoint:function(breakpoint,uiLocation) 6 {this._breakpointRemoved(event);var breakpoint=(event.data.breakpoint);var uiLoc ation=(event.data.uiLocation);this._addBreakpoint(breakpoint,uiLocation);},_addB reakpoint:function(breakpoint,uiLocation)
7 {var element=document.createElement("li");element.classList.add("cursor-pointer" );element.addEventListener("contextmenu",this._breakpointContextMenu.bind(this,b reakpoint),true);element.addEventListener("click",this._breakpointClicked.bind(t his,uiLocation),false);var checkbox=document.createElement("input");checkbox.cla ssName="checkbox-elem";checkbox.type="checkbox";checkbox.checked=breakpoint.enab led();checkbox.addEventListener("click",this._breakpointCheckboxClicked.bind(thi s,breakpoint),false);element.appendChild(checkbox);var labelElement=document.cre ateTextNode(uiLocation.linkText());element.appendChild(labelElement);var snippet Element=document.createElement("div");snippetElement.className="source-text mono space";element.appendChild(snippetElement);function didRequestContent(content) 7 {var element=document.createElement("li");element.classList.add("cursor-pointer" );element.addEventListener("contextmenu",this._breakpointContextMenu.bind(this,b reakpoint),true);element.addEventListener("click",this._breakpointClicked.bind(t his,uiLocation),false);var checkbox=document.createElement("input");checkbox.cla ssName="checkbox-elem";checkbox.type="checkbox";checkbox.checked=breakpoint.enab led();checkbox.addEventListener("click",this._breakpointCheckboxClicked.bind(thi s,breakpoint),false);element.appendChild(checkbox);var labelElement=document.cre ateTextNode(uiLocation.linkText());element.appendChild(labelElement);var snippet Element=document.createElement("div");snippetElement.className="source-text mono space";element.appendChild(snippetElement);function didRequestContent(content)
8 {var lineEndings=content.lineEndings();if(uiLocation.lineNumber<lineEndings.leng th) 8 {var lineNumber=uiLocation.lineNumber
9 snippetElement.textContent=content.substring(lineEndings[uiLocation.lineNumber-1 ],lineEndings[uiLocation.lineNumber]);} 9 var columnNumber=uiLocation.columnNumber;var contentString=new String(content);i f(lineNumber<contentString.lineCount()){var lineText=contentString.lineAt(lineNu mber);var maxSnippetLength=200;snippetElement.textContent=lineText.substr(column Number).trimEnd(maxSnippetLength);}}
10 uiLocation.uiSourceCode.requestContent(didRequestContent.bind(this));element._da ta=uiLocation;var currentElement=this.listElement.firstChild;while(currentElemen t){if(currentElement._data&&this._compareBreakpoints(currentElement._data,elemen t._data)>0) 10 uiLocation.uiSourceCode.requestContent(didRequestContent);element._data=uiLocati on;var currentElement=this.listElement.firstChild;while(currentElement){if(curre ntElement._data&&this._compareBreakpoints(currentElement._data,element._data)>0)
11 break;currentElement=currentElement.nextSibling;} 11 break;currentElement=currentElement.nextSibling;}
12 this._addListElement(element,currentElement);var breakpointItem={};breakpointIte m.element=element;breakpointItem.checkbox=checkbox;this._items.put(breakpoint,br eakpointItem);this.expand();},_breakpointRemoved:function(event) 12 this._addListElement(element,currentElement);var breakpointItem={};breakpointIte m.element=element;breakpointItem.checkbox=checkbox;this._items.put(breakpoint,br eakpointItem);this.expand();},_breakpointRemoved:function(event)
13 {var breakpoint=(event.data.breakpoint);var uiLocation=(event.data.uiLocation);v ar breakpointItem=this._items.get(breakpoint);if(!breakpointItem) 13 {var breakpoint=(event.data.breakpoint);var uiLocation=(event.data.uiLocation);v ar breakpointItem=this._items.get(breakpoint);if(!breakpointItem)
14 return;this._items.remove(breakpoint);this._removeListElement(breakpointItem.ele ment);},highlightBreakpoint:function(breakpoint) 14 return;this._items.remove(breakpoint);this._removeListElement(breakpointItem.ele ment);},highlightBreakpoint:function(breakpoint)
15 {var breakpointItem=this._items.get(breakpoint);if(!breakpointItem) 15 {var breakpointItem=this._items.get(breakpoint);if(!breakpointItem)
16 return;breakpointItem.element.classList.add("breakpoint-hit");this._highlightedB reakpointItem=breakpointItem;},clearBreakpointHighlight:function() 16 return;breakpointItem.element.classList.add("breakpoint-hit");this._highlightedB reakpointItem=breakpointItem;},clearBreakpointHighlight:function()
17 {if(this._highlightedBreakpointItem){this._highlightedBreakpointItem.element.cla ssList.remove("breakpoint-hit");delete this._highlightedBreakpointItem;}},_break pointClicked:function(uiLocation,event) 17 {if(this._highlightedBreakpointItem){this._highlightedBreakpointItem.element.cla ssList.remove("breakpoint-hit");delete this._highlightedBreakpointItem;}},_break pointClicked:function(uiLocation,event)
18 {this._showSourceLineDelegate(uiLocation.uiSourceCode,uiLocation.lineNumber);},_ breakpointCheckboxClicked:function(breakpoint,event) 18 {this._showSourceLineDelegate(uiLocation.uiSourceCode,uiLocation.lineNumber);},_ breakpointCheckboxClicked:function(breakpoint,event)
19 {event.consume();breakpoint.setEnabled(event.target.checked);},_breakpointContex tMenu:function(breakpoint,event) 19 {event.consume();breakpoint.setEnabled(event.target.checked);},_breakpointContex tMenu:function(breakpoint,event)
20 {var breakpoints=this._items.values();var contextMenu=new WebInspector.ContextMe nu(event);contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCase MenuTitles()?"Remove breakpoint":"Remove Breakpoint"),breakpoint.remove.bind(bre akpoint));if(breakpoints.length>1){var removeAllTitle=WebInspector.UIString(WebI nspector.useLowerCaseMenuTitles()?"Remove all breakpoints":"Remove All Breakpoin ts");contextMenu.appendItem(removeAllTitle,this._breakpointManager.removeAllBrea kpoints.bind(this._breakpointManager));} 20 {var breakpoints=this._items.values();var contextMenu=new WebInspector.ContextMe nu(event);contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCase MenuTitles()?"Remove breakpoint":"Remove Breakpoint"),breakpoint.remove.bind(bre akpoint));if(breakpoints.length>1){var removeAllTitle=WebInspector.UIString(WebI nspector.useLowerCaseMenuTitles()?"Remove all breakpoints":"Remove All Breakpoin ts");contextMenu.appendItem(removeAllTitle,this._breakpointManager.removeAllBrea kpoints.bind(this._breakpointManager));}
21 contextMenu.appendSeparator();var breakpointActive=WebInspector.debuggerModel.br eakpointsActive();var breakpointActiveTitle=breakpointActive?WebInspector.UIStri ng(WebInspector.useLowerCaseMenuTitles()?"Deactivate breakpoints":"Deactivate Br eakpoints"):WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Activat e breakpoints":"Activate Breakpoints");contextMenu.appendItem(breakpointActiveTi tle,WebInspector.debuggerModel.setBreakpointsActive.bind(WebInspector.debuggerMo del,!breakpointActive));function enabledBreakpointCount(breakpoints) 21 contextMenu.appendSeparator();var breakpointActive=this._debuggerModel.breakpoin tsActive();var breakpointActiveTitle=breakpointActive?WebInspector.UIString(WebI nspector.useLowerCaseMenuTitles()?"Deactivate breakpoints":"Deactivate Breakpoin ts"):WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Activate break points":"Activate Breakpoints");contextMenu.appendItem(breakpointActiveTitle,thi s._debuggerModel.setBreakpointsActive.bind(this._debuggerModel,!breakpointActive ));function enabledBreakpointCount(breakpoints)
22 {var count=0;for(var i=0;i<breakpoints.length;++i){if(breakpoints[i].checkbox.ch ecked) 22 {var count=0;for(var i=0;i<breakpoints.length;++i){if(breakpoints[i].checkbox.ch ecked)
23 count++;} 23 count++;}
24 return count;} 24 return count;}
25 if(breakpoints.length>1){var enableBreakpointCount=enabledBreakpointCount(breakp oints);var enableTitle=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Enable all breakpoints":"Enable All Breakpoints");var disableTitle=WebInspec tor.UIString(WebInspector.useLowerCaseMenuTitles()?"Disable all breakpoints":"Di sable All Breakpoints");contextMenu.appendSeparator();contextMenu.appendItem(ena bleTitle,this._breakpointManager.toggleAllBreakpoints.bind(this._breakpointManag er,true),!(enableBreakpointCount!=breakpoints.length));contextMenu.appendItem(di sableTitle,this._breakpointManager.toggleAllBreakpoints.bind(this._breakpointMan ager,false),!(enableBreakpointCount>1));} 25 if(breakpoints.length>1){var enableBreakpointCount=enabledBreakpointCount(breakp oints);var enableTitle=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Enable all breakpoints":"Enable All Breakpoints");var disableTitle=WebInspec tor.UIString(WebInspector.useLowerCaseMenuTitles()?"Disable all breakpoints":"Di sable All Breakpoints");contextMenu.appendSeparator();contextMenu.appendItem(ena bleTitle,this._breakpointManager.toggleAllBreakpoints.bind(this._breakpointManag er,true),!(enableBreakpointCount!=breakpoints.length));contextMenu.appendItem(di sableTitle,this._breakpointManager.toggleAllBreakpoints.bind(this._breakpointMan ager,false),!(enableBreakpointCount>1));}
26 contextMenu.show();},_addListElement:function(element,beforeElement) 26 contextMenu.show();},_addListElement:function(element,beforeElement)
27 {if(beforeElement) 27 {if(beforeElement)
28 this.listElement.insertBefore(element,beforeElement);else{if(!this.listElement.f irstChild){this.bodyElement.removeChild(this.emptyElement);this.bodyElement.appe ndChild(this.listElement);} 28 this.listElement.insertBefore(element,beforeElement);else{if(!this.listElement.f irstChild){this.bodyElement.removeChild(this.emptyElement);this.bodyElement.appe ndChild(this.listElement);}
29 this.listElement.appendChild(element);}},_removeListElement:function(element) 29 this.listElement.appendChild(element);}},_removeListElement:function(element)
30 {this.listElement.removeChild(element);if(!this.listElement.firstChild){this.bod yElement.removeChild(this.listElement);this.bodyElement.appendChild(this.emptyEl ement);}},_compare:function(x,y) 30 {this.listElement.removeChild(element);if(!this.listElement.firstChild){this.bod yElement.removeChild(this.listElement);this.bodyElement.appendChild(this.emptyEl ement);}},_compare:function(x,y)
31 {if(x!==y) 31 {if(x!==y)
32 return x<y?-1:1;return 0;},_compareBreakpoints:function(b1,b2) 32 return x<y?-1:1;return 0;},_compareBreakpoints:function(b1,b2)
33 {return this._compare(b1.uiSourceCode.originURL(),b2.uiSourceCode.originURL())|| this._compare(b1.lineNumber,b2.lineNumber);},reset:function() 33 {return this._compare(b1.uiSourceCode.originURL(),b2.uiSourceCode.originURL())|| this._compare(b1.lineNumber,b2.lineNumber);},reset:function()
34 {this.listElement.removeChildren();if(this.listElement.parentElement){this.bodyE lement.removeChild(this.listElement);this.bodyElement.appendChild(this.emptyElem ent);} 34 {this.listElement.removeChildren();if(this.listElement.parentElement){this.bodyE lement.removeChild(this.listElement);this.bodyElement.appendChild(this.emptyElem ent);}
35 this._items.clear();},__proto__:WebInspector.SidebarPane.prototype} 35 this._items.clear();},__proto__:WebInspector.SidebarPane.prototype}
36 WebInspector.XHRBreakpointsSidebarPane=function() 36 WebInspector.XHRBreakpointsSidebarPane=function()
37 {WebInspector.NativeBreakpointsSidebarPane.call(this,WebInspector.UIString("XHR Breakpoints"));this._breakpointElements={};var addButton=document.createElement( "button");addButton.className="pane-title-button add";addButton.addEventListener ("click",this._addButtonClicked.bind(this),false);addButton.title=WebInspector.U IString("Add XHR breakpoint");this.titleElement.appendChild(addButton);this.empt yElement.addEventListener("contextmenu",this._emptyElementContextMenu.bind(this) ,true);this._restoreBreakpoints();} 37 {WebInspector.NativeBreakpointsSidebarPane.call(this,WebInspector.UIString("XHR Breakpoints"));this._breakpointElements={};var addButton=document.createElement( "button");addButton.className="pane-title-button add";addButton.addEventListener ("click",this._addButtonClicked.bind(this),false);addButton.title=WebInspector.U IString("Add XHR breakpoint");this.titleElement.appendChild(addButton);this.empt yElement.addEventListener("contextmenu",this._emptyElementContextMenu.bind(this) ,true);this._restoreBreakpoints();}
38 WebInspector.XHRBreakpointsSidebarPane.prototype={_emptyElementContextMenu:funct ion(event) 38 WebInspector.XHRBreakpointsSidebarPane.prototype={_emptyElementContextMenu:funct ion(event)
39 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendItem(WebI nspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add breakpoint":"Add Br eakpoint"),this._addButtonClicked.bind(this));contextMenu.show();},_addButtonCli cked:function(event) 39 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendItem(WebI nspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add breakpoint":"Add Br eakpoint"),this._addButtonClicked.bind(this));contextMenu.show();},_addButtonCli cked:function(event)
40 {if(event) 40 {if(event)
41 event.consume();this.expand();var inputElementContainer=document.createElement(" p");inputElementContainer.className="breakpoint-condition";var inputElement=docu ment.createElement("span");inputElementContainer.textContent=WebInspector.UIStri ng("Break when URL contains:");inputElement.className="editing";inputElement.id= "breakpoint-condition-input";inputElementContainer.appendChild(inputElement);thi s._addListElement(inputElementContainer,this.listElement.firstChild);function fi nishEditing(accept,e,text) 41 event.consume();this.expand();var inputElementContainer=document.createElement(" p");inputElementContainer.className="breakpoint-condition";var inputElement=docu ment.createElement("span");inputElementContainer.textContent=WebInspector.UIStri ng("Break when URL contains:");inputElement.className="editing";inputElement.id= "breakpoint-condition-input";inputElementContainer.appendChild(inputElement);thi s._addListElement(inputElementContainer,this.listElement.firstChild);function fi nishEditing(accept,e,text)
42 {this._removeListElement(inputElementContainer);if(accept){this._setBreakpoint(t ext,true);this._saveBreakpoints();}} 42 {this._removeListElement(inputElementContainer);if(accept){this._setBreakpoint(t ext,true);this._saveBreakpoints();}}
43 var config=new WebInspector.EditingConfig(finishEditing.bind(this,true),finishEd iting.bind(this,false));WebInspector.startEditing(inputElement,config);},_setBre akpoint:function(url,enabled) 43 var config=new WebInspector.InplaceEditor.Config(finishEditing.bind(this,true),f inishEditing.bind(this,false));WebInspector.InplaceEditor.startEditing(inputElem ent,config);},_setBreakpoint:function(url,enabled)
44 {if(url in this._breakpointElements) 44 {if(url in this._breakpointElements)
45 return;var element=document.createElement("li");element._url=url;element.addEven tListener("contextmenu",this._contextMenu.bind(this,url),true);var checkboxEleme nt=document.createElement("input");checkboxElement.className="checkbox-elem";che ckboxElement.type="checkbox";checkboxElement.checked=enabled;checkboxElement.add EventListener("click",this._checkboxClicked.bind(this,url),false);element._check boxElement=checkboxElement;element.appendChild(checkboxElement);var labelElement =document.createElement("span");if(!url) 45 return;var element=document.createElement("li");element._url=url;element.addEven tListener("contextmenu",this._contextMenu.bind(this,url),true);var checkboxEleme nt=document.createElement("input");checkboxElement.className="checkbox-elem";che ckboxElement.type="checkbox";checkboxElement.checked=enabled;checkboxElement.add EventListener("click",this._checkboxClicked.bind(this,url),false);element._check boxElement=checkboxElement;element.appendChild(checkboxElement);var labelElement =document.createElement("span");if(!url)
46 labelElement.textContent=WebInspector.UIString("Any XHR");else 46 labelElement.textContent=WebInspector.UIString("Any XHR");else
47 labelElement.textContent=WebInspector.UIString("URL contains \"%s\"",url);labelE lement.classList.add("cursor-auto");labelElement.addEventListener("dblclick",thi s._labelClicked.bind(this,url),false);element.appendChild(labelElement);var curr entElement=this.listElement.firstChild;while(currentElement){if(currentElement._ url&&currentElement._url<element._url) 47 labelElement.textContent=WebInspector.UIString("URL contains \"%s\"",url);labelE lement.classList.add("cursor-auto");labelElement.addEventListener("dblclick",thi s._labelClicked.bind(this,url),false);element.appendChild(labelElement);var curr entElement=this.listElement.firstChild;while(currentElement){if(currentElement._ url&&currentElement._url<element._url)
48 break;currentElement=currentElement.nextSibling;} 48 break;currentElement=currentElement.nextSibling;}
49 this._addListElement(element,currentElement);this._breakpointElements[url]=eleme nt;if(enabled) 49 this._addListElement(element,currentElement);this._breakpointElements[url]=eleme nt;if(enabled)
50 DOMDebuggerAgent.setXHRBreakpoint(url);},_removeBreakpoint:function(url) 50 DOMDebuggerAgent.setXHRBreakpoint(url);},_removeBreakpoint:function(url)
51 {var element=this._breakpointElements[url];if(!element) 51 {var element=this._breakpointElements[url];if(!element)
52 return;this._removeListElement(element);delete this._breakpointElements[url];if( element._checkboxElement.checked) 52 return;this._removeListElement(element);delete this._breakpointElements[url];if( element._checkboxElement.checked)
53 DOMDebuggerAgent.removeXHRBreakpoint(url);},_contextMenu:function(url,event) 53 DOMDebuggerAgent.removeXHRBreakpoint(url);},_contextMenu:function(url,event)
54 {var contextMenu=new WebInspector.ContextMenu(event);function removeBreakpoint() 54 {var contextMenu=new WebInspector.ContextMenu(event);function removeBreakpoint()
55 {this._removeBreakpoint(url);this._saveBreakpoints();} 55 {this._removeBreakpoint(url);this._saveBreakpoints();}
56 function removeAllBreakpoints() 56 function removeAllBreakpoints()
57 {for(var url in this._breakpointElements) 57 {for(var url in this._breakpointElements)
58 this._removeBreakpoint(url);this._saveBreakpoints();} 58 this._removeBreakpoint(url);this._saveBreakpoints();}
59 var removeAllTitle=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?" Remove all breakpoints":"Remove All Breakpoints");contextMenu.appendItem(WebInsp ector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add breakpoint":"Add Break point"),this._addButtonClicked.bind(this));contextMenu.appendItem(WebInspector.U IString(WebInspector.useLowerCaseMenuTitles()?"Remove breakpoint":"Remove Breakp oint"),removeBreakpoint.bind(this));contextMenu.appendItem(removeAllTitle,remove AllBreakpoints.bind(this));contextMenu.show();},_checkboxClicked:function(url,ev ent) 59 var removeAllTitle=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?" Remove all breakpoints":"Remove All Breakpoints");contextMenu.appendItem(WebInsp ector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add breakpoint":"Add Break point"),this._addButtonClicked.bind(this));contextMenu.appendItem(WebInspector.U IString(WebInspector.useLowerCaseMenuTitles()?"Remove breakpoint":"Remove Breakp oint"),removeBreakpoint.bind(this));contextMenu.appendItem(removeAllTitle,remove AllBreakpoints.bind(this));contextMenu.show();},_checkboxClicked:function(url,ev ent)
60 {if(event.target.checked) 60 {if(event.target.checked)
61 DOMDebuggerAgent.setXHRBreakpoint(url);else 61 DOMDebuggerAgent.setXHRBreakpoint(url);else
62 DOMDebuggerAgent.removeXHRBreakpoint(url);this._saveBreakpoints();},_labelClicke d:function(url) 62 DOMDebuggerAgent.removeXHRBreakpoint(url);this._saveBreakpoints();},_labelClicke d:function(url)
63 {var element=this._breakpointElements[url];var inputElement=document.createEleme nt("span");inputElement.className="breakpoint-condition editing";inputElement.te xtContent=url;this.listElement.insertBefore(inputElement,element);element.classL ist.add("hidden");function finishEditing(accept,e,text) 63 {var element=this._breakpointElements[url];var inputElement=document.createEleme nt("span");inputElement.className="breakpoint-condition editing";inputElement.te xtContent=url;this.listElement.insertBefore(inputElement,element);element.classL ist.add("hidden");function finishEditing(accept,e,text)
64 {this._removeListElement(inputElement);if(accept){this._removeBreakpoint(url);th is._setBreakpoint(text,element._checkboxElement.checked);this._saveBreakpoints() ;}else 64 {this._removeListElement(inputElement);if(accept){this._removeBreakpoint(url);th is._setBreakpoint(text,element._checkboxElement.checked);this._saveBreakpoints() ;}else
65 element.classList.remove("hidden");} 65 element.classList.remove("hidden");}
66 WebInspector.startEditing(inputElement,new WebInspector.EditingConfig(finishEdit ing.bind(this,true),finishEditing.bind(this,false)));},highlightBreakpoint:funct ion(url) 66 WebInspector.InplaceEditor.startEditing(inputElement,new WebInspector.InplaceEdi tor.Config(finishEditing.bind(this,true),finishEditing.bind(this,false)));},high lightBreakpoint:function(url)
67 {var element=this._breakpointElements[url];if(!element) 67 {var element=this._breakpointElements[url];if(!element)
68 return;this.expand();element.classList.add("breakpoint-hit");this._highlightedEl ement=element;},clearBreakpointHighlight:function() 68 return;this.expand();element.classList.add("breakpoint-hit");this._highlightedEl ement=element;},clearBreakpointHighlight:function()
69 {if(this._highlightedElement){this._highlightedElement.classList.remove("breakpo int-hit");delete this._highlightedElement;}},_saveBreakpoints:function() 69 {if(this._highlightedElement){this._highlightedElement.classList.remove("breakpo int-hit");delete this._highlightedElement;}},_saveBreakpoints:function()
70 {var breakpoints=[];for(var url in this._breakpointElements) 70 {var breakpoints=[];for(var url in this._breakpointElements)
71 breakpoints.push({url:url,enabled:this._breakpointElements[url]._checkboxElement .checked});WebInspector.settings.xhrBreakpoints.set(breakpoints);},_restoreBreak points:function() 71 breakpoints.push({url:url,enabled:this._breakpointElements[url]._checkboxElement .checked});WebInspector.settings.xhrBreakpoints.set(breakpoints);},_restoreBreak points:function()
72 {var breakpoints=WebInspector.settings.xhrBreakpoints.get();for(var i=0;i<breakp oints.length;++i){var breakpoint=breakpoints[i];if(breakpoint&&typeof breakpoint .url==="string") 72 {var breakpoints=WebInspector.settings.xhrBreakpoints.get();for(var i=0;i<breakp oints.length;++i){var breakpoint=breakpoints[i];if(breakpoint&&typeof breakpoint .url==="string")
73 this._setBreakpoint(breakpoint.url,breakpoint.enabled);}},__proto__:WebInspector .NativeBreakpointsSidebarPane.prototype} 73 this._setBreakpoint(breakpoint.url,breakpoint.enabled);}},__proto__:WebInspector .NativeBreakpointsSidebarPane.prototype}
74 WebInspector.EventListenerBreakpointsSidebarPane=function() 74 WebInspector.EventListenerBreakpointsSidebarPane=function()
75 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Event Listener Breakp oints"));this.registerRequiredCSS("breakpointsList.css");this.categoriesElement= document.createElement("ol");this.categoriesElement.tabIndex=0;this.categoriesEl ement.classList.add("properties-tree");this.categoriesElement.classList.add("eve nt-listener-breakpoints");this.categoriesTreeOutline=new TreeOutline(this.catego riesElement);this.bodyElement.appendChild(this.categoriesElement);this._breakpoi ntItems={};this._createCategory(WebInspector.UIString("Animation"),false,["reque stAnimationFrame","cancelAnimationFrame","animationFrameFired"]);this._createCat egory(WebInspector.UIString("Control"),true,["resize","scroll","zoom","focus","b lur","select","change","submit","reset"]);this._createCategory(WebInspector.UISt ring("Clipboard"),true,["copy","cut","paste","beforecopy","beforecut","beforepas te"]);this._createCategory(WebInspector.UIString("DOM Mutation"),true,["DOMActiv ate","DOMFocusIn","DOMFocusOut","DOMAttrModified","DOMCharacterDataModified","DO MNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFro mDocument","DOMSubtreeModified","DOMContentLoaded"]);this._createCategory(WebIns pector.UIString("Device"),true,["deviceorientation","devicemotion"]);this._creat eCategory(WebInspector.UIString("Keyboard"),true,["keydown","keyup","keypress"," input"]);this._createCategory(WebInspector.UIString("Load"),true,["load","before unload","unload","abort","error","hashchange","popstate"]);this._createCategory( WebInspector.UIString("Mouse"),true,["click","dblclick","mousedown","mouseup","m ouseover","mousemove","mouseout","mousewheel"]);this._createCategory(WebInspecto r.UIString("Timer"),false,["setTimer","clearTimer","timerFired"]);this._createCa tegory(WebInspector.UIString("Touch"),true,["touchstart","touchmove","touchend", "touchcancel"]);this._createCategory(WebInspector.UIString("WebGL"),false,["webg lErrorFired","webglWarningFired"]);this._restoreBreakpoints();} 75 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Event Listener Breakp oints"));this.registerRequiredCSS("breakpointsList.css");this.categoriesElement= document.createElement("ol");this.categoriesElement.tabIndex=0;this.categoriesEl ement.classList.add("properties-tree");this.categoriesElement.classList.add("eve nt-listener-breakpoints");this.categoriesTreeOutline=new TreeOutline(this.catego riesElement);this.bodyElement.appendChild(this.categoriesElement);this._breakpoi ntItems={};this._createCategory(WebInspector.UIString("Animation"),false,["reque stAnimationFrame","cancelAnimationFrame","animationFrameFired"]);this._createCat egory(WebInspector.UIString("Control"),true,["resize","scroll","zoom","focus","b lur","select","change","submit","reset"]);this._createCategory(WebInspector.UISt ring("Clipboard"),true,["copy","cut","paste","beforecopy","beforecut","beforepas te"]);this._createCategory(WebInspector.UIString("DOM Mutation"),true,["DOMActiv ate","DOMFocusIn","DOMFocusOut","DOMAttrModified","DOMCharacterDataModified","DO MNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFro mDocument","DOMSubtreeModified","DOMContentLoaded"]);this._createCategory(WebIns pector.UIString("Device"),true,["deviceorientation","devicemotion"]);this._creat eCategory(WebInspector.UIString("Drag / drop"),true,["dragenter","dragover","dra gleave","drop"]);this._createCategory(WebInspector.UIString("Keyboard"),true,["k eydown","keyup","keypress","input"]);this._createCategory(WebInspector.UIString( "Load"),true,["load","beforeunload","unload","abort","error","hashchange","popst ate"]);this._createCategory(WebInspector.UIString("Mouse"),true,["click","dblcli ck","mousedown","mouseup","mouseover","mousemove","mouseout","mousewheel","wheel "]);this._createCategory(WebInspector.UIString("Timer"),false,["setTimer","clear Timer","timerFired"]);this._createCategory(WebInspector.UIString("Touch"),true,[ "touchstart","touchmove","touchend","touchcancel"]);this._createCategory(WebInsp ector.UIString("WebGL"),false,["webglErrorFired","webglWarningFired"]);this._res toreBreakpoints();}
76 WebInspector.EventListenerBreakpointsSidebarPane.categotyListener="listener:";We bInspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation="instrume ntation:";WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI=functi on(eventName,auxData) 76 WebInspector.EventListenerBreakpointsSidebarPane.categotyListener="listener:";We bInspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation="instrume ntation:";WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI=functi on(eventName,auxData)
77 {if(!WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI){WebInspe ctor.EventListenerBreakpointsSidebarPane._eventNamesForUI={"instrumentation:setT imer":WebInspector.UIString("Set Timer"),"instrumentation:clearTimer":WebInspect or.UIString("Clear Timer"),"instrumentation:timerFired":WebInspector.UIString("T imer Fired"),"instrumentation:requestAnimationFrame":WebInspector.UIString("Requ est Animation Frame"),"instrumentation:cancelAnimationFrame":WebInspector.UIStri ng("Cancel Animation Frame"),"instrumentation:animationFrameFired":WebInspector. UIString("Animation Frame Fired"),"instrumentation:webglErrorFired":WebInspector .UIString("WebGL Error Fired"),"instrumentation:webglWarningFired":WebInspector. UIString("WebGL Warning Fired")};} 77 {if(!WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI){WebInspe ctor.EventListenerBreakpointsSidebarPane._eventNamesForUI={"instrumentation:setT imer":WebInspector.UIString("Set Timer"),"instrumentation:clearTimer":WebInspect or.UIString("Clear Timer"),"instrumentation:timerFired":WebInspector.UIString("T imer Fired"),"instrumentation:requestAnimationFrame":WebInspector.UIString("Requ est Animation Frame"),"instrumentation:cancelAnimationFrame":WebInspector.UIStri ng("Cancel Animation Frame"),"instrumentation:animationFrameFired":WebInspector. UIString("Animation Frame Fired"),"instrumentation:webglErrorFired":WebInspector .UIString("WebGL Error Fired"),"instrumentation:webglWarningFired":WebInspector. UIString("WebGL Warning Fired")};}
78 if(auxData){if(eventName==="instrumentation:webglErrorFired"&&auxData["webglErro rName"]){var errorName=auxData["webglErrorName"];errorName=errorName.replace(/^. *(0x[0-9a-f]+).*$/i,"$1");return WebInspector.UIString("WebGL Error Fired (%s)", errorName);}} 78 if(auxData){if(eventName==="instrumentation:webglErrorFired"&&auxData["webglErro rName"]){var errorName=auxData["webglErrorName"];errorName=errorName.replace(/^. *(0x[0-9a-f]+).*$/i,"$1");return WebInspector.UIString("WebGL Error Fired (%s)", errorName);}}
79 return WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI[eventNa me]||eventName.substring(eventName.indexOf(":")+1);} 79 return WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI[eventNa me]||eventName.substring(eventName.indexOf(":")+1);}
80 WebInspector.EventListenerBreakpointsSidebarPane.prototype={_createCategory:func tion(name,isDOMEvent,eventNames) 80 WebInspector.EventListenerBreakpointsSidebarPane.prototype={_createCategory:func tion(name,isDOMEvent,eventNames)
81 {var categoryItem={};categoryItem.element=new TreeElement(name);this.categoriesT reeOutline.appendChild(categoryItem.element);categoryItem.element.listItemElemen t.classList.add("event-category");categoryItem.element.selectable=true;categoryI tem.checkbox=this._createCheckbox(categoryItem.element);categoryItem.checkbox.ad dEventListener("click",this._categoryCheckboxClicked.bind(this,categoryItem),tru e);categoryItem.children={};for(var i=0;i<eventNames.length;++i){var eventName=( isDOMEvent?WebInspector.EventListenerBreakpointsSidebarPane.categotyListener:Web Inspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation)+eventName s[i];var breakpointItem={};var title=WebInspector.EventListenerBreakpointsSideba rPane.eventNameForUI(eventName);breakpointItem.element=new TreeElement(title);ca tegoryItem.element.appendChild(breakpointItem.element);var hitMarker=document.cr eateElement("div");hitMarker.className="breakpoint-hit-marker";breakpointItem.el ement.listItemElement.appendChild(hitMarker);breakpointItem.element.listItemElem ent.classList.add("source-code");breakpointItem.element.selectable=false;breakpo intItem.checkbox=this._createCheckbox(breakpointItem.element);breakpointItem.che ckbox.addEventListener("click",this._breakpointCheckboxClicked.bind(this,eventNa me),true);breakpointItem.parent=categoryItem;this._breakpointItems[eventName]=br eakpointItem;categoryItem.children[eventName]=breakpointItem;}},_createCheckbox: function(treeElement) 81 {var categoryItem={};categoryItem.element=new TreeElement(name);this.categoriesT reeOutline.appendChild(categoryItem.element);categoryItem.element.listItemElemen t.classList.add("event-category");categoryItem.element.selectable=true;categoryI tem.checkbox=this._createCheckbox(categoryItem.element);categoryItem.checkbox.ad dEventListener("click",this._categoryCheckboxClicked.bind(this,categoryItem),tru e);categoryItem.children={};for(var i=0;i<eventNames.length;++i){var eventName=( isDOMEvent?WebInspector.EventListenerBreakpointsSidebarPane.categotyListener:Web Inspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation)+eventName s[i];var breakpointItem={};var title=WebInspector.EventListenerBreakpointsSideba rPane.eventNameForUI(eventName);breakpointItem.element=new TreeElement(title);ca tegoryItem.element.appendChild(breakpointItem.element);var hitMarker=document.cr eateElement("div");hitMarker.className="breakpoint-hit-marker";breakpointItem.el ement.listItemElement.appendChild(hitMarker);breakpointItem.element.listItemElem ent.classList.add("source-code");breakpointItem.element.selectable=false;breakpo intItem.checkbox=this._createCheckbox(breakpointItem.element);breakpointItem.che ckbox.addEventListener("click",this._breakpointCheckboxClicked.bind(this,eventNa me),true);breakpointItem.parent=categoryItem;this._breakpointItems[eventName]=br eakpointItem;categoryItem.children[eventName]=breakpointItem;}},_createCheckbox: function(treeElement)
82 {var checkbox=document.createElement("input");checkbox.className="checkbox-elem" ;checkbox.type="checkbox";treeElement.listItemElement.insertBefore(checkbox,tree Element.listItemElement.firstChild);return checkbox;},_categoryCheckboxClicked:f unction(categoryItem) 82 {var checkbox=document.createElement("input");checkbox.className="checkbox-elem" ;checkbox.type="checkbox";treeElement.listItemElement.insertBefore(checkbox,tree Element.listItemElement.firstChild);return checkbox;},_categoryCheckboxClicked:f unction(categoryItem)
83 {var checked=categoryItem.checkbox.checked;for(var eventName in categoryItem.chi ldren){var breakpointItem=categoryItem.children[eventName];if(breakpointItem.che ckbox.checked===checked) 83 {var checked=categoryItem.checkbox.checked;for(var eventName in categoryItem.chi ldren){var breakpointItem=categoryItem.children[eventName];if(breakpointItem.che ckbox.checked===checked)
84 continue;if(checked) 84 continue;if(checked)
85 this._setBreakpoint(eventName);else 85 this._setBreakpoint(eventName);else
(...skipping 15 matching lines...) Expand all
101 hasDisabled=true;} 101 hasDisabled=true;}
102 categoryItem.checkbox.checked=hasEnabled;categoryItem.checkbox.indeterminate=has Enabled&&hasDisabled;},highlightBreakpoint:function(eventName) 102 categoryItem.checkbox.checked=hasEnabled;categoryItem.checkbox.indeterminate=has Enabled&&hasDisabled;},highlightBreakpoint:function(eventName)
103 {var breakpointItem=this._breakpointItems[eventName];if(!breakpointItem) 103 {var breakpointItem=this._breakpointItems[eventName];if(!breakpointItem)
104 return;this.expand();breakpointItem.parent.element.expand();breakpointItem.eleme nt.listItemElement.classList.add("breakpoint-hit");this._highlightedElement=brea kpointItem.element.listItemElement;},clearBreakpointHighlight:function() 104 return;this.expand();breakpointItem.parent.element.expand();breakpointItem.eleme nt.listItemElement.classList.add("breakpoint-hit");this._highlightedElement=brea kpointItem.element.listItemElement;},clearBreakpointHighlight:function()
105 {if(this._highlightedElement){this._highlightedElement.classList.remove("breakpo int-hit");delete this._highlightedElement;}},_saveBreakpoints:function() 105 {if(this._highlightedElement){this._highlightedElement.classList.remove("breakpo int-hit");delete this._highlightedElement;}},_saveBreakpoints:function()
106 {var breakpoints=[];for(var eventName in this._breakpointItems){if(this._breakpo intItems[eventName].checkbox.checked) 106 {var breakpoints=[];for(var eventName in this._breakpointItems){if(this._breakpo intItems[eventName].checkbox.checked)
107 breakpoints.push({eventName:eventName});} 107 breakpoints.push({eventName:eventName});}
108 WebInspector.settings.eventListenerBreakpoints.set(breakpoints);},_restoreBreakp oints:function() 108 WebInspector.settings.eventListenerBreakpoints.set(breakpoints);},_restoreBreakp oints:function()
109 {var breakpoints=WebInspector.settings.eventListenerBreakpoints.get();for(var i= 0;i<breakpoints.length;++i){var breakpoint=breakpoints[i];if(breakpoint&&typeof breakpoint.eventName==="string") 109 {var breakpoints=WebInspector.settings.eventListenerBreakpoints.get();for(var i= 0;i<breakpoints.length;++i){var breakpoint=breakpoints[i];if(breakpoint&&typeof breakpoint.eventName==="string")
110 this._setBreakpoint(breakpoint.eventName);}},__proto__:WebInspector.SidebarPane. prototype};WebInspector.CallStackSidebarPane=function() 110 this._setBreakpoint(breakpoint.eventName);}},__proto__:WebInspector.SidebarPane. prototype};WebInspector.CallStackSidebarPane=function()
111 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Call Stack"));this.bo dyElement.addEventListener("keydown",this._keyDown.bind(this),true);this.bodyEle ment.tabIndex=0;var asyncCheckbox=this.titleElement.appendChild(WebInspector.Set tingsTab.createSettingCheckbox(WebInspector.UIString("Async"),WebInspector.setti ngs.enableAsyncStackTraces,true,undefined,WebInspector.UIString("Capture async s tack traces")));asyncCheckbox.classList.add("scripts-callstack-async");asyncChec kbox.addEventListener("click",consumeEvent,false);WebInspector.settings.enableAs yncStackTraces.addChangeListener(this._asyncStackTracesStateChanged,this);} 111 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Call Stack"));this.bo dyElement.addEventListener("keydown",this._keyDown.bind(this),true);this.bodyEle ment.tabIndex=0;var asyncCheckbox=this.titleElement.appendChild(WebInspector.Set tingsUI.createSettingCheckbox(WebInspector.UIString("Async"),WebInspector.settin gs.enableAsyncStackTraces,true,undefined,WebInspector.UIString("Capture async st ack traces")));asyncCheckbox.classList.add("scripts-callstack-async");asyncCheck box.addEventListener("click",consumeEvent,false);WebInspector.settings.enableAsy ncStackTraces.addChangeListener(this._asyncStackTracesStateChanged,this);}
112 WebInspector.CallStackSidebarPane.Events={CallFrameRestarted:"CallFrameRestarted ",CallFrameSelected:"CallFrameSelected"} 112 WebInspector.CallStackSidebarPane.Events={CallFrameRestarted:"CallFrameRestarted ",CallFrameSelected:"CallFrameSelected"}
113 WebInspector.CallStackSidebarPane.prototype={update:function(callFrames,asyncSta ckTrace) 113 WebInspector.CallStackSidebarPane.prototype={update:function(callFrames,asyncSta ckTrace)
114 {this.bodyElement.removeChildren();delete this._statusMessageElement;this.placar ds=[];if(!callFrames){var infoElement=this.bodyElement.createChild("div","info") ;infoElement.textContent=WebInspector.UIString("Not Paused");return;} 114 {this.bodyElement.removeChildren();delete this._statusMessageElement;this.placar ds=[];if(!callFrames){var infoElement=this.bodyElement.createChild("div","info") ;infoElement.textContent=WebInspector.UIString("Not Paused");return;}
115 this._appendSidebarPlacards(callFrames);while(asyncStackTrace){var title="["+(as yncStackTrace.description||WebInspector.UIString("Async Call"))+"]";var asyncPla card=new WebInspector.Placard(title,"");this.bodyElement.appendChild(asyncPlacar d.element);this._appendSidebarPlacards(asyncStackTrace.callFrames,asyncPlacard); asyncStackTrace=asyncStackTrace.asyncStackTrace;}},_appendSidebarPlacards:functi on(callFrames,asyncPlacard) 115 this._appendSidebarPlacards(callFrames);while(asyncStackTrace){var title=asyncSt ackTrace.description;if(title)
116 title+=" "+WebInspector.UIString("(async)");else
117 title=WebInspector.UIString("Async Call");var asyncPlacard=new WebInspector.Plac ard(title,"");asyncPlacard.element.classList.add("placard-label");this.bodyEleme nt.appendChild(asyncPlacard.element);this._appendSidebarPlacards(asyncStackTrace .callFrames,asyncPlacard);asyncStackTrace=asyncStackTrace.asyncStackTrace;}},_ap pendSidebarPlacards:function(callFrames,asyncPlacard)
116 {for(var i=0,n=callFrames.length;i<n;++i){var placard=new WebInspector.CallStack SidebarPane.Placard(callFrames[i],asyncPlacard);placard.element.addEventListener ("click",this._placardSelected.bind(this,placard),false);placard.element.addEven tListener("contextmenu",this._placardContextMenu.bind(this,placard),true);if(!i& &asyncPlacard){asyncPlacard.element.addEventListener("click",this._placardSelect ed.bind(this,placard),false);asyncPlacard.element.addEventListener("contextmenu" ,this._placardContextMenu.bind(this,placard),true);} 118 {for(var i=0,n=callFrames.length;i<n;++i){var placard=new WebInspector.CallStack SidebarPane.Placard(callFrames[i],asyncPlacard);placard.element.addEventListener ("click",this._placardSelected.bind(this,placard),false);placard.element.addEven tListener("contextmenu",this._placardContextMenu.bind(this,placard),true);if(!i& &asyncPlacard){asyncPlacard.element.addEventListener("click",this._placardSelect ed.bind(this,placard),false);asyncPlacard.element.addEventListener("contextmenu" ,this._placardContextMenu.bind(this,placard),true);}
117 this.placards.push(placard);this.bodyElement.appendChild(placard.element);}},_pl acardContextMenu:function(placard,event) 119 this.placards.push(placard);this.bodyElement.appendChild(placard.element);}},_pl acardContextMenu:function(placard,event)
118 {var contextMenu=new WebInspector.ContextMenu(event);if(!placard._callFrame.isAs ync()) 120 {var contextMenu=new WebInspector.ContextMenu(event);if(!placard._callFrame.isAs ync())
119 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Restart frame":"Restart Frame"),this._restartFrame.bind(this,placard));conte xtMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"C opy stack trace":"Copy Stack Trace"),this._copyStackTrace.bind(this));contextMen u.show();},_restartFrame:function(placard) 121 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Restart frame":"Restart Frame"),this._restartFrame.bind(this,placard));conte xtMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"C opy stack trace":"Copy Stack Trace"),this._copyStackTrace.bind(this));contextMen u.show();},_restartFrame:function(placard)
120 {placard._callFrame.restart();this.dispatchEventToListeners(WebInspector.CallSta ckSidebarPane.Events.CallFrameRestarted,placard._callFrame);},_asyncStackTracesS tateChanged:function() 122 {placard._callFrame.restart();this.dispatchEventToListeners(WebInspector.CallSta ckSidebarPane.Events.CallFrameRestarted,placard._callFrame);},_asyncStackTracesS tateChanged:function()
121 {var enabled=WebInspector.settings.enableAsyncStackTraces.get();if(!enabled&&thi s.placards) 123 {var enabled=WebInspector.settings.enableAsyncStackTraces.get();if(!enabled&&thi s.placards)
122 this._removeAsyncPlacards();},_removeAsyncPlacards:function() 124 this._removeAsyncPlacards();},_removeAsyncPlacards:function()
123 {var shouldSelectTopFrame=false;var lastSyncPlacardIndex=-1;for(var i=0;i<this.p lacards.length;++i){var placard=this.placards[i];if(placard._asyncPlacard){if(pl acard.selected) 125 {var shouldSelectTopFrame=false;var lastSyncPlacardIndex=-1;for(var i=0;i<this.p lacards.length;++i){var placard=this.placards[i];if(placard._asyncPlacard){if(pl acard.selected)
124 shouldSelectTopFrame=true;placard._asyncPlacard.element.remove();placard.element .remove();}else{lastSyncPlacardIndex=i;}} 126 shouldSelectTopFrame=true;placard._asyncPlacard.element.remove();placard.element .remove();}else{lastSyncPlacardIndex=i;}}
125 this.placards.length=lastSyncPlacardIndex+1;if(shouldSelectTopFrame) 127 this.placards.length=lastSyncPlacardIndex+1;if(shouldSelectTopFrame)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 {if(this.readOnly()) 166 {if(this.readOnly())
165 return;if(!this.empty()) 167 return;if(!this.empty())
166 this._entries.splice(this._activeEntryIndex+1);this._entries.push(entry);if(this ._entries.length>this._historyDepth) 168 this._entries.splice(this._activeEntryIndex+1);this._entries.push(entry);if(this ._entries.length>this._historyDepth)
167 this._entries.shift();this._activeEntryIndex=this._entries.length-1;},rollback:f unction() 169 this._entries.shift();this._activeEntryIndex=this._entries.length-1;},rollback:f unction()
168 {if(this.empty()) 170 {if(this.empty())
169 return false;var revealIndex=this._activeEntryIndex-1;while(revealIndex>=0&&!thi s._entries[revealIndex].valid()) 171 return false;var revealIndex=this._activeEntryIndex-1;while(revealIndex>=0&&!thi s._entries[revealIndex].valid())
170 --revealIndex;if(revealIndex<0) 172 --revealIndex;if(revealIndex<0)
171 return false;this.readOnlyLock();this._entries[revealIndex].reveal();this.releas eReadOnlyLock();this._activeEntryIndex=revealIndex;return true;},rollover:functi on() 173 return false;this.readOnlyLock();this._entries[revealIndex].reveal();this.releas eReadOnlyLock();this._activeEntryIndex=revealIndex;return true;},rollover:functi on()
172 {var revealIndex=this._activeEntryIndex+1;while(revealIndex<this._entries.length &&!this._entries[revealIndex].valid()) 174 {var revealIndex=this._activeEntryIndex+1;while(revealIndex<this._entries.length &&!this._entries[revealIndex].valid())
173 ++revealIndex;if(revealIndex>=this._entries.length) 175 ++revealIndex;if(revealIndex>=this._entries.length)
174 return false;this.readOnlyLock();this._entries[revealIndex].reveal();this.releas eReadOnlyLock();this._activeEntryIndex=revealIndex;return true;},};;WebInspector .EditingLocationHistoryManager=function(sourcesPanel,currentSourceFrameCallback) 176 return false;this.readOnlyLock();this._entries[revealIndex].reveal();this.releas eReadOnlyLock();this._activeEntryIndex=revealIndex;return true;},};;WebInspector .EditingLocationHistoryManager=function(sourcesView,currentSourceFrameCallback)
175 {this._sourcesPanel=sourcesPanel;this._historyManager=new WebInspector.SimpleHis toryManager(WebInspector.EditingLocationHistoryManager.HistoryDepth);this._curre ntSourceFrameCallback=currentSourceFrameCallback;} 177 {this._sourcesView=sourcesView;this._historyManager=new WebInspector.SimpleHisto ryManager(WebInspector.EditingLocationHistoryManager.HistoryDepth);this._current SourceFrameCallback=currentSourceFrameCallback;}
176 WebInspector.EditingLocationHistoryManager.HistoryDepth=20;WebInspector.EditingL ocationHistoryManager.prototype={trackSourceFrameCursorJumps:function(sourceFram e) 178 WebInspector.EditingLocationHistoryManager.HistoryDepth=20;WebInspector.EditingL ocationHistoryManager.prototype={trackSourceFrameCursorJumps:function(sourceFram e)
177 {sourceFrame.addEventListener(WebInspector.SourceFrame.Events.JumpHappened,this. _onJumpHappened.bind(this));},_onJumpHappened:function(event) 179 {sourceFrame.addEventListener(WebInspector.SourceFrame.Events.JumpHappened,this. _onJumpHappened.bind(this));},_onJumpHappened:function(event)
178 {if(event.data.from) 180 {if(event.data.from)
179 this._updateActiveState(event.data.from);if(event.data.to) 181 this._updateActiveState(event.data.from);if(event.data.to)
180 this._pushActiveState(event.data.to);},rollback:function() 182 this._pushActiveState(event.data.to);},rollback:function()
181 {this._historyManager.rollback();},rollover:function() 183 {this._historyManager.rollback();},rollover:function()
182 {this._historyManager.rollover();},updateCurrentState:function() 184 {this._historyManager.rollover();},updateCurrentState:function()
183 {var sourceFrame=this._currentSourceFrameCallback();if(!sourceFrame) 185 {var sourceFrame=this._currentSourceFrameCallback();if(!sourceFrame)
184 return;this._updateActiveState(sourceFrame.textEditor.selection());},pushNewStat e:function() 186 return;this._updateActiveState(sourceFrame.textEditor.selection());},pushNewStat e:function()
185 {var sourceFrame=this._currentSourceFrameCallback();if(!sourceFrame) 187 {var sourceFrame=this._currentSourceFrameCallback();if(!sourceFrame)
186 return;this._pushActiveState(sourceFrame.textEditor.selection());},_updateActive State:function(selection) 188 return;this._pushActiveState(sourceFrame.textEditor.selection());},_updateActive State:function(selection)
187 {var active=this._historyManager.active();if(!active) 189 {var active=this._historyManager.active();if(!active)
188 return;var sourceFrame=this._currentSourceFrameCallback();if(!sourceFrame) 190 return;var sourceFrame=this._currentSourceFrameCallback();if(!sourceFrame)
189 return;var entry=new WebInspector.EditingLocationHistoryEntry(this._sourcesPanel ,this,sourceFrame,selection);active.merge(entry);},_pushActiveState:function(sel ection) 191 return;var entry=new WebInspector.EditingLocationHistoryEntry(this._sourcesView, this,sourceFrame,selection);active.merge(entry);},_pushActiveState:function(sele ction)
190 {var sourceFrame=this._currentSourceFrameCallback();if(!sourceFrame) 192 {var sourceFrame=this._currentSourceFrameCallback();if(!sourceFrame)
191 return;var entry=new WebInspector.EditingLocationHistoryEntry(this._sourcesPanel ,this,sourceFrame,selection);this._historyManager.push(entry);},removeHistoryFor SourceCode:function(uiSourceCode) 193 return;var entry=new WebInspector.EditingLocationHistoryEntry(this._sourcesView, this,sourceFrame,selection);this._historyManager.push(entry);},removeHistoryForS ourceCode:function(uiSourceCode)
192 {function filterOut(entry) 194 {function filterOut(entry)
193 {return entry._projectId===uiSourceCode.project().id()&&entry._path===uiSourceCo de.path();} 195 {return entry._projectId===uiSourceCode.project().id()&&entry._path===uiSourceCo de.path();}
194 this._historyManager.filterOut(filterOut);},} 196 this._historyManager.filterOut(filterOut);},}
195 WebInspector.EditingLocationHistoryEntry=function(sourcesPanel,editingLocationMa nager,sourceFrame,selection) 197 WebInspector.EditingLocationHistoryEntry=function(sourcesView,editingLocationMan ager,sourceFrame,selection)
196 {this._sourcesPanel=sourcesPanel;this._editingLocationManager=editingLocationMan ager;var uiSourceCode=sourceFrame.uiSourceCode();this._projectId=uiSourceCode.pr oject().id();this._path=uiSourceCode.path();var position=this._positionFromSelec tion(selection);this._positionHandle=sourceFrame.textEditor.textEditorPositionHa ndle(position.lineNumber,position.columnNumber);} 198 {this._sourcesView=sourcesView;this._editingLocationManager=editingLocationManag er;var uiSourceCode=sourceFrame.uiSourceCode();this._projectId=uiSourceCode.proj ect().id();this._path=uiSourceCode.path();var position=this._positionFromSelecti on(selection);this._positionHandle=sourceFrame.textEditor.textEditorPositionHand le(position.lineNumber,position.columnNumber);}
197 WebInspector.EditingLocationHistoryEntry.prototype={merge:function(entry) 199 WebInspector.EditingLocationHistoryEntry.prototype={merge:function(entry)
198 {if(this._projectId!==entry._projectId||this._path!==entry._path) 200 {if(this._projectId!==entry._projectId||this._path!==entry._path)
199 return;this._positionHandle=entry._positionHandle;},_positionFromSelection:funct ion(selection) 201 return;this._positionHandle=entry._positionHandle;},_positionFromSelection:funct ion(selection)
200 {return{lineNumber:selection.endLine,columnNumber:selection.endColumn};},valid:f unction() 202 {return{lineNumber:selection.endLine,columnNumber:selection.endColumn};},valid:f unction()
201 {var position=this._positionHandle.resolve();var uiSourceCode=WebInspector.works pace.project(this._projectId).uiSourceCode(this._path);return!!(position&&uiSour ceCode);},reveal:function() 203 {var position=this._positionHandle.resolve();var uiSourceCode=WebInspector.works pace.project(this._projectId).uiSourceCode(this._path);return!!(position&&uiSour ceCode);},reveal:function()
202 {var position=this._positionHandle.resolve();var uiSourceCode=WebInspector.works pace.project(this._projectId).uiSourceCode(this._path);if(!position||!uiSourceCo de) 204 {var position=this._positionHandle.resolve();var uiSourceCode=WebInspector.works pace.project(this._projectId).uiSourceCode(this._path);if(!position||!uiSourceCo de)
203 return;this._editingLocationManager.updateCurrentState();this._sourcesPanel.show UISourceCode(uiSourceCode,position.lineNumber,position.columnNumber);}};;WebInsp ector.FilePathScoreFunction=function(query) 205 return;this._editingLocationManager.updateCurrentState();this._sourcesView.showS ourceLocation(uiSourceCode,position.lineNumber,position.columnNumber);}};;WebIns pector.FilePathScoreFunction=function(query)
204 {this._query=query;this._queryUpperCase=query.toUpperCase();this._score=null;thi s._sequence=null;this._dataUpperCase="";this._fileNameIndex=0;} 206 {this._query=query;this._queryUpperCase=query.toUpperCase();this._score=null;thi s._sequence=null;this._dataUpperCase="";this._fileNameIndex=0;}
205 WebInspector.FilePathScoreFunction.filterRegex=function(query) 207 WebInspector.FilePathScoreFunction.filterRegex=function(query)
206 {const toEscape=String.regexSpecialCharacters();var regexString="";for(var i=0;i <query.length;++i){var c=query.charAt(i);if(toEscape.indexOf(c)!==-1) 208 {const toEscape=String.regexSpecialCharacters();var regexString="";for(var i=0;i <query.length;++i){var c=query.charAt(i);if(toEscape.indexOf(c)!==-1)
207 c="\\"+c;if(i) 209 c="\\"+c;if(i)
208 regexString+="[^"+c+"]*";regexString+=c;} 210 regexString+="[^"+c+"]*";regexString+=c;}
209 return new RegExp(regexString,"i");} 211 return new RegExp(regexString,"i");}
210 WebInspector.FilePathScoreFunction.prototype={score:function(data,matchIndexes) 212 WebInspector.FilePathScoreFunction.prototype={score:function(data,matchIndexes)
211 {if(!data||!this._query) 213 {if(!data||!this._query)
212 return 0;var n=this._query.length;var m=data.length;if(!this._score||this._score .length<n*m){this._score=new Int32Array(n*m*2);this._sequence=new Int32Array(n*m *2);} 214 return 0;var n=this._query.length;var m=data.length;if(!this._score||this._score .length<n*m){this._score=new Int32Array(n*m*2);this._sequence=new Int32Array(n*m *2);}
213 var score=this._score;var sequence=(this._sequence);this._dataUpperCase=data.toU pperCase();this._fileNameIndex=data.lastIndexOf("/");for(var i=0;i<n;++i){for(va r j=0;j<m;++j){var skipCharScore=j===0?0:score[i*m+j-1];var prevCharScore=i===0| |j===0?0:score[(i-1)*m+j-1];var consecutiveMatch=i===0||j===0?0:sequence[(i-1)*m +j-1];var pickCharScore=this._match(this._query,data,i,j,consecutiveMatch);if(pi ckCharScore&&prevCharScore+pickCharScore>skipCharScore){sequence[i*m+j]=consecut iveMatch+1;score[i*m+j]=(prevCharScore+pickCharScore);}else{sequence[i*m+j]=0;sc ore[i*m+j]=skipCharScore;}}} 215 var score=this._score;var sequence=(this._sequence);this._dataUpperCase=data.toU pperCase();this._fileNameIndex=data.lastIndexOf("/");for(var i=0;i<n;++i){for(va r j=0;j<m;++j){var skipCharScore=j===0?0:score[i*m+j-1];var prevCharScore=i===0| |j===0?0:score[(i-1)*m+j-1];var consecutiveMatch=i===0||j===0?0:sequence[(i-1)*m +j-1];var pickCharScore=this._match(this._query,data,i,j,consecutiveMatch);if(pi ckCharScore&&prevCharScore+pickCharScore>skipCharScore){sequence[i*m+j]=consecut iveMatch+1;score[i*m+j]=(prevCharScore+pickCharScore);}else{sequence[i*m+j]=0;sc ore[i*m+j]=skipCharScore;}}}
214 if(matchIndexes) 216 if(matchIndexes)
215 this._restoreMatchIndexes(sequence,n,m,matchIndexes);return score[n*m-1];},_test WordStart:function(data,j) 217 this._restoreMatchIndexes(sequence,n,m,matchIndexes);return score[n*m-1];},_test WordStart:function(data,j)
216 {var prevChar=data.charAt(j-1);return j===0||prevChar==="_"||prevChar==="-"||pre vChar==="/"||(data[j-1]!==this._dataUpperCase[j-1]&&data[j]===this._dataUpperCas e[j]);},_restoreMatchIndexes:function(sequence,n,m,out) 218 {var prevChar=data.charAt(j-1);return j===0||prevChar==="_"||prevChar==="-"||pre vChar==="/"||(data[j-1]!==this._dataUpperCase[j-1]&&data[j]===this._dataUpperCas e[j]);},_restoreMatchIndexes:function(sequence,n,m,out)
217 {var i=n-1,j=m-1;while(i>=0&&j>=0){switch(sequence[i*m+j]){case 0:--j;break;defa ult:out.push(j);--i;--j;break;}} 219 {var i=n-1,j=m-1;while(i>=0&&j>=0){switch(sequence[i*m+j]){case 0:--j;break;defa ult:out.push(j);--i;--j;break;}}
218 out.reverse();},_singleCharScore:function(query,data,i,j) 220 out.reverse();},_singleCharScore:function(query,data,i,j)
219 {var isWordStart=this._testWordStart(data,j);var isFileName=j>this._fileNameInde x;var isPathTokenStart=j===0||data[j-1]==="/";var isCapsMatch=query[i]===data[j] &&query[i]==this._queryUpperCase[i];var score=10;if(isPathTokenStart) 221 {var isWordStart=this._testWordStart(data,j);var isFileName=j>this._fileNameInde x;var isPathTokenStart=j===0||data[j-1]==="/";var isCapsMatch=query[i]===data[j] &&query[i]==this._queryUpperCase[i];var score=10;if(isPathTokenStart)
220 score+=4;if(isWordStart) 222 score+=4;if(isWordStart)
221 score+=2;if(isCapsMatch) 223 score+=2;if(isCapsMatch)
222 score+=6;if(isFileName) 224 score+=6;if(isFileName)
223 score+=4;if(j===this._fileNameIndex+1&&i===0) 225 score+=4;if(j===this._fileNameIndex+1&&i===0)
224 score+=5;if(isFileName&&isWordStart) 226 score+=5;if(isFileName&&isWordStart)
225 score+=3;return score;},_sequenceCharScore:function(query,data,i,j,sequenceLengt h) 227 score+=3;return score;},_sequenceCharScore:function(query,data,i,j,sequenceLengt h)
226 {var isFileName=j>this._fileNameIndex;var isPathTokenStart=j===0||data[j-1]==="/ ";var score=10;if(isFileName) 228 {var isFileName=j>this._fileNameIndex;var isPathTokenStart=j===0||data[j-1]==="/ ";var score=10;if(isFileName)
227 score+=4;if(isPathTokenStart) 229 score+=4;if(isPathTokenStart)
228 score+=5;score+=sequenceLength*4;return score;},_match:function(query,data,i,j,c onsecutiveMatch) 230 score+=5;score+=sequenceLength*4;return score;},_match:function(query,data,i,j,c onsecutiveMatch)
229 {if(this._queryUpperCase[i]!==this._dataUpperCase[j]) 231 {if(this._queryUpperCase[i]!==this._dataUpperCase[j])
230 return 0;if(!consecutiveMatch) 232 return 0;if(!consecutiveMatch)
231 return this._singleCharScore(query,data,i,j);else 233 return this._singleCharScore(query,data,i,j);else
232 return this._sequenceCharScore(query,data,i,j-consecutiveMatch,consecutiveMatch) ;},};WebInspector.FilteredItemSelectionDialog=function(delegate) 234 return this._sequenceCharScore(query,data,i,j-consecutiveMatch,consecutiveMatch) ;},};WebInspector.FilteredItemSelectionDialog=function(delegate)
233 {WebInspector.DialogDelegate.call(this);var xhr=new XMLHttpRequest();xhr.open("G ET","filteredItemSelectionDialog.css",false);xhr.send(null);this.element=documen t.createElement("div");this.element.className="filtered-item-list-dialog";this.e lement.addEventListener("keydown",this._onKeyDown.bind(this),false);var styleEle ment=this.element.createChild("style");styleElement.type="text/css";styleElement .textContent=xhr.responseText;this._promptElement=this.element.createChild("inpu t","monospace");this._promptElement.addEventListener("input",this._onInput.bind( this),false);this._promptElement.type="text";this._promptElement.setAttribute("s pellcheck","false");this._filteredItems=[];this._viewportControl=new WebInspecto r.ViewportControl(this);this._itemElementsContainer=this._viewportControl.elemen t;this._itemElementsContainer.classList.add("container");this._itemElementsConta iner.classList.add("monospace");this._itemElementsContainer.addEventListener("cl ick",this._onClick.bind(this),false);this.element.appendChild(this._itemElements Container);this._delegate=delegate;this._delegate.setRefreshCallback(this._items Loaded.bind(this));this._itemsLoaded();this._shouldShowMatchingItems=true;} 235 {WebInspector.DialogDelegate.call(this);if(!WebInspector.FilteredItemSelectionDi alog._stylesLoaded){WebInspector.View.createStyleElement("filteredItemSelectionD ialog.css");WebInspector.FilteredItemSelectionDialog._stylesLoaded=true;}
236 this.element=document.createElement("div");this.element.className="filtered-item -list-dialog";this.element.addEventListener("keydown",this._onKeyDown.bind(this) ,false);this._promptElement=this.element.createChild("input","monospace");this._ promptElement.addEventListener("input",this._onInput.bind(this),false);this._pro mptElement.type="text";this._promptElement.setAttribute("spellcheck","false");th is._filteredItems=[];this._viewportControl=new WebInspector.ViewportControl(this );this._itemElementsContainer=this._viewportControl.element;this._itemElementsCo ntainer.classList.add("container");this._itemElementsContainer.classList.add("mo nospace");this._itemElementsContainer.addEventListener("click",this._onClick.bin d(this),false);this.element.appendChild(this._itemElementsContainer);this._deleg ate=delegate;this._delegate.setRefreshCallback(this._itemsLoaded.bind(this));thi s._itemsLoaded();}
234 WebInspector.FilteredItemSelectionDialog.prototype={position:function(element,re lativeToElement) 237 WebInspector.FilteredItemSelectionDialog.prototype={position:function(element,re lativeToElement)
235 {const minWidth=500;const minHeight=204;var width=Math.max(relativeToElement.off setWidth*2/3,minWidth);var height=Math.max(relativeToElement.offsetHeight*2/3,mi nHeight);this.element.style.width=width+"px";const shadowPadding=20;element.posi tionAt(relativeToElement.totalOffsetLeft()+Math.max((relativeToElement.offsetWid th-width-2*shadowPadding)/2,shadowPadding),relativeToElement.totalOffsetTop()+Ma th.max((relativeToElement.offsetHeight-height-2*shadowPadding)/2,shadowPadding)) ;this._dialogHeight=height;this._updateShowMatchingItems();},focus:function() 238 {const shadow=10;const shadowPadding=20;var container=WebInspector.Dialog.modalH ostView().element;var preferredWidth=Math.max(relativeToElement.offsetWidth*2/3, 500);var width=Math.min(preferredWidth,container.offsetWidth-2*shadowPadding);va r preferredHeight=Math.max(relativeToElement.offsetHeight*2/3,204);var height=Ma th.min(preferredHeight,container.offsetHeight-2*shadowPadding);this.element.styl e.width=width+"px";var box=relativeToElement.boxInWindow(window).relativeToEleme nt(container);var positionX=box.x+Math.max((box.width-width-2*shadowPadding)/2,s hadow);positionX=Math.max(shadow,Math.min(container.offsetWidth-width-2*shadowPa dding,positionX));var positionY=box.y+Math.max((box.height-height-2*shadowPaddin g)/2,shadow);positionY=Math.max(shadow,Math.min(container.offsetHeight-height-2* shadowPadding,positionY));element.positionAt(positionX,positionY,container);this ._dialogHeight=height;this._updateShowMatchingItems();},focus:function()
236 {WebInspector.setCurrentFocusElement(this._promptElement);if(this._filteredItems .length&&this._viewportControl.lastVisibleIndex()===-1) 239 {WebInspector.setCurrentFocusElement(this._promptElement);if(this._filteredItems .length&&this._viewportControl.lastVisibleIndex()===-1)
237 this._viewportControl.refresh();},willHide:function() 240 this._viewportControl.refresh();},willHide:function()
238 {if(this._isHiding) 241 {if(this._isHiding)
239 return;this._isHiding=true;this._delegate.dispose();if(this._filterTimer) 242 return;this._isHiding=true;this._delegate.dispose();if(this._filterTimer)
240 clearTimeout(this._filterTimer);},renderAsTwoRows:function() 243 clearTimeout(this._filterTimer);},renderAsTwoRows:function()
241 {this._renderAsTwoRows=true;},onEnter:function() 244 {this._renderAsTwoRows=true;},onEnter:function()
242 {if(!this._delegate.itemCount()) 245 {if(!this._delegate.itemCount())
243 return;this._delegate.selectItem(this._filteredItems[this._selectedIndexInFilter ed],this._promptElement.value.trim());},_itemsLoaded:function() 246 return;var selectedIndex=this._selectedIndexInFiltered<this._filteredItems.lengt h?this._filteredItems[this._selectedIndexInFiltered]:null;this._delegate.selectI tem(selectedIndex,this._promptElement.value.trim());},_itemsLoaded:function()
244 {if(this._loadTimeout) 247 {if(this._loadTimeout)
245 return;this._loadTimeout=setTimeout(this._updateAfterItemsLoaded.bind(this),0);} ,_updateAfterItemsLoaded:function() 248 return;this._loadTimeout=setTimeout(this._updateAfterItemsLoaded.bind(this),0);} ,_updateAfterItemsLoaded:function()
246 {delete this._loadTimeout;this._filterItems();},_createItemElement:function(inde x) 249 {delete this._loadTimeout;this._filterItems();},_createItemElement:function(inde x)
247 {var itemElement=document.createElement("div");itemElement.className="filtered-i tem-list-dialog-item "+(this._renderAsTwoRows?"two-rows":"one-row");itemElement. _titleElement=itemElement.createChild("span");itemElement._titleSuffixElement=it emElement.createChild("span");itemElement._subtitleElement=itemElement.createChi ld("div","filtered-item-list-dialog-subtitle");itemElement._subtitleElement.text Content="\u200B";itemElement._index=index;this._delegate.renderItem(index,this._ promptElement.value.trim(),itemElement._titleElement,itemElement._subtitleElemen t);return itemElement;},setQuery:function(query) 250 {var itemElement=document.createElement("div");itemElement.className="filtered-i tem-list-dialog-item "+(this._renderAsTwoRows?"two-rows":"one-row");itemElement. _titleElement=itemElement.createChild("div","filtered-item-list-dialog-title");i temElement._subtitleElement=itemElement.createChild("div","filtered-item-list-di alog-subtitle");itemElement._subtitleElement.textContent="\u200B";itemElement._i ndex=index;this._delegate.renderItem(index,this._promptElement.value.trim(),item Element._titleElement,itemElement._subtitleElement);return itemElement;},setQuer y:function(query)
248 {this._promptElement.value=query;this._scheduleFilter();},_filterItems:function( ) 251 {this._promptElement.value=query;this._scheduleFilter();},_filterItems:function( )
249 {delete this._filterTimer;if(this._scoringTimer){clearTimeout(this._scoringTimer );delete this._scoringTimer;} 252 {delete this._filterTimer;if(this._scoringTimer){clearTimeout(this._scoringTimer );delete this._scoringTimer;}
250 var query=this._delegate.rewriteQuery(this._promptElement.value.trim());this._qu ery=query;var queryLength=query.length;var filterRegex=query?WebInspector.FilePa thScoreFunction.filterRegex(query):null;var oldSelectedAbsoluteIndex=this._selec tedIndexInFiltered?this._filteredItems[this._selectedIndexInFiltered]:null;var f ilteredItems=[];this._selectedIndexInFiltered=0;var bestScores=[];var bestItems= [];var bestItemsToCollect=100;var minBestScore=0;var overflowItems=[];scoreItems .call(this,0);function compareIntegers(a,b) 253 var query=this._delegate.rewriteQuery(this._promptElement.value.trim());this._qu ery=query;var queryLength=query.length;var filterRegex=query?WebInspector.FilePa thScoreFunction.filterRegex(query):null;var oldSelectedAbsoluteIndex=this._selec tedIndexInFiltered?this._filteredItems[this._selectedIndexInFiltered]:null;var f ilteredItems=[];this._selectedIndexInFiltered=0;var bestScores=[];var bestItems= [];var bestItemsToCollect=100;var minBestScore=0;var overflowItems=[];scoreItems .call(this,0);function compareIntegers(a,b)
251 {return b-a;} 254 {return b-a;}
252 function scoreItems(fromIndex) 255 function scoreItems(fromIndex)
253 {var maxWorkItems=1000;var workDone=0;for(var i=fromIndex;i<this._delegate.itemC ount()&&workDone<maxWorkItems;++i){if(filterRegex&&!filterRegex.test(this._deleg ate.itemKeyAt(i))) 256 {var maxWorkItems=1000;var workDone=0;for(var i=fromIndex;i<this._delegate.itemC ount()&&workDone<maxWorkItems;++i){if(filterRegex&&!filterRegex.test(this._deleg ate.itemKeyAt(i)))
254 continue;var score=this._delegate.itemScoreAt(i,query);if(query) 257 continue;var score=this._delegate.itemScoreAt(i,query);if(query)
255 workDone++;if(score>minBestScore||bestScores.length<bestItemsToCollect){var inde x=insertionIndexForObjectInListSortedByFunction(score,bestScores,compareIntegers ,true);bestScores.splice(index,0,score);bestItems.splice(index,0,i);if(bestScore s.length>bestItemsToCollect){overflowItems.push(bestItems.peekLast());bestScores .length=bestItemsToCollect;bestItems.length=bestItemsToCollect;} 258 workDone++;if(score>minBestScore||bestScores.length<bestItemsToCollect){var inde x=insertionIndexForObjectInListSortedByFunction(score,bestScores,compareIntegers ,true);bestScores.splice(index,0,score);bestItems.splice(index,0,i);if(bestScore s.length>bestItemsToCollect){overflowItems.push(bestItems.peekLast());bestScores .length=bestItemsToCollect;bestItems.length=bestItemsToCollect;}
256 minBestScore=bestScores.peekLast();}else 259 minBestScore=bestScores.peekLast();}else
257 filteredItems.push(i);} 260 filteredItems.push(i);}
258 if(i<this._delegate.itemCount()){this._scoringTimer=setTimeout(scoreItems.bind(t his,i),0);return;} 261 if(i<this._delegate.itemCount()){this._scoringTimer=setTimeout(scoreItems.bind(t his,i),0);return;}
259 delete this._scoringTimer;this._filteredItems=bestItems.concat(overflowItems).co ncat(filteredItems);for(var i=0;i<this._filteredItems.length;++i){if(this._filte redItems[i]===oldSelectedAbsoluteIndex){this._selectedIndexInFiltered=i;break;}} 262 delete this._scoringTimer;this._filteredItems=bestItems.concat(overflowItems).co ncat(filteredItems);for(var i=0;i<this._filteredItems.length;++i){if(this._filte redItems[i]===oldSelectedAbsoluteIndex){this._selectedIndexInFiltered=i;break;}}
260 this._viewportControl.refresh();if(!query) 263 this._viewportControl.refresh();if(!query)
261 this._selectedIndexInFiltered=0;this._updateSelection(this._selectedIndexInFilte red,false);}},_onInput:function(event) 264 this._selectedIndexInFiltered=0;this._updateSelection(this._selectedIndexInFilte red,false);}},_shouldShowMatchingItems:function()
262 {this._shouldShowMatchingItems=this._delegate.shouldShowMatchingItems(this._prom ptElement.value);this._updateShowMatchingItems();this._scheduleFilter();},_updat eShowMatchingItems:function() 265 {return this._delegate.shouldShowMatchingItems(this._promptElement.value);},_onI nput:function(event)
263 {this._itemElementsContainer.enableStyleClass("hidden",!this._shouldShowMatching Items);this.element.style.height=this._shouldShowMatchingItems?this._dialogHeigh t+"px":"auto";},_onKeyDown:function(event) 266 {this._updateShowMatchingItems();this._scheduleFilter();},_updateShowMatchingIte ms:function()
267 {var shouldShowMatchingItems=this._shouldShowMatchingItems();this._itemElementsC ontainer.classList.toggle("hidden",!shouldShowMatchingItems);this.element.style. height=shouldShowMatchingItems?this._dialogHeight+"px":"auto";},_onKeyDown:funct ion(event)
264 {var newSelectedIndex=this._selectedIndexInFiltered;switch(event.keyCode){case W ebInspector.KeyboardShortcut.Keys.Down.code:if(++newSelectedIndex>=this._filtere dItems.length) 268 {var newSelectedIndex=this._selectedIndexInFiltered;switch(event.keyCode){case W ebInspector.KeyboardShortcut.Keys.Down.code:if(++newSelectedIndex>=this._filtere dItems.length)
265 newSelectedIndex=this._filteredItems.length-1;this._updateSelection(newSelectedI ndex,true);event.consume(true);break;case WebInspector.KeyboardShortcut.Keys.Up. code:if(--newSelectedIndex<0) 269 newSelectedIndex=this._filteredItems.length-1;this._updateSelection(newSelectedI ndex,true);event.consume(true);break;case WebInspector.KeyboardShortcut.Keys.Up. code:if(--newSelectedIndex<0)
266 newSelectedIndex=0;this._updateSelection(newSelectedIndex,false);event.consume(t rue);break;case WebInspector.KeyboardShortcut.Keys.PageDown.code:newSelectedInde x=Math.min(newSelectedIndex+this._viewportControl.rowsPerViewport(),this._filter edItems.length-1);this._updateSelection(newSelectedIndex,true);event.consume(tru e);break;case WebInspector.KeyboardShortcut.Keys.PageUp.code:newSelectedIndex=Ma th.max(newSelectedIndex-this._viewportControl.rowsPerViewport(),0);this._updateS election(newSelectedIndex,false);event.consume(true);break;default:}},_scheduleF ilter:function() 270 newSelectedIndex=0;this._updateSelection(newSelectedIndex,false);event.consume(t rue);break;case WebInspector.KeyboardShortcut.Keys.PageDown.code:newSelectedInde x=Math.min(newSelectedIndex+this._viewportControl.rowsPerViewport(),this._filter edItems.length-1);this._updateSelection(newSelectedIndex,true);event.consume(tru e);break;case WebInspector.KeyboardShortcut.Keys.PageUp.code:newSelectedIndex=Ma th.max(newSelectedIndex-this._viewportControl.rowsPerViewport(),0);this._updateS election(newSelectedIndex,false);event.consume(true);break;default:}},_scheduleF ilter:function()
267 {if(this._filterTimer) 271 {if(this._filterTimer)
268 return;this._filterTimer=setTimeout(this._filterItems.bind(this),0);},_updateSel ection:function(index,makeLast) 272 return;this._filterTimer=setTimeout(this._filterItems.bind(this),0);},_updateSel ection:function(index,makeLast)
269 {var element=this._viewportControl.renderedElementAt(this._selectedIndexInFilter ed);if(element) 273 {var element=this._viewportControl.renderedElementAt(this._selectedIndexInFilter ed);if(element)
270 element.classList.remove("selected");this._viewportControl.scrollItemIntoView(in dex,makeLast);this._selectedIndexInFiltered=index;element=this._viewportControl. renderedElementAt(index);if(element) 274 element.classList.remove("selected");this._viewportControl.scrollItemIntoView(in dex,makeLast);this._selectedIndexInFiltered=index;element=this._viewportControl. renderedElementAt(index);if(element)
271 element.classList.add("selected");},_onClick:function(event) 275 element.classList.add("selected");},_onClick:function(event)
272 {var itemElement=event.target.enclosingNodeOrSelfWithClass("filtered-item-list-d ialog-item");if(!itemElement) 276 {var itemElement=event.target.enclosingNodeOrSelfWithClass("filtered-item-list-d ialog-item");if(!itemElement)
273 return;this._delegate.selectItem(itemElement._index,this._promptElement.value.tr im());WebInspector.Dialog.hide();},itemCount:function() 277 return;this._delegate.selectItem(itemElement._index,this._promptElement.value.tr im());WebInspector.Dialog.hide();},itemCount:function()
(...skipping 15 matching lines...) Expand all
289 ranges.push(new WebInspector.SourceRange(opcode[3],opcode[4]-opcode[3]));else if (opcode[0]!=="insert") 293 ranges.push(new WebInspector.SourceRange(opcode[3],opcode[4]-opcode[3]));else if (opcode[0]!=="insert")
290 return null;} 294 return null;}
291 return ranges;} 295 return ranges;}
292 var text=element.textContent;var ranges=rangesForMatch(text,query);if(!ranges) 296 var text=element.textContent;var ranges=rangesForMatch(text,query);if(!ranges)
293 ranges=rangesForMatch(text.toUpperCase(),query.toUpperCase());if(ranges){WebInsp ector.highlightRangesWithStyleClass(element,ranges,"highlight");return true;} 297 ranges=rangesForMatch(text.toUpperCase(),query.toUpperCase());if(ranges){WebInsp ector.highlightRangesWithStyleClass(element,ranges,"highlight");return true;}
294 return false;},selectItem:function(itemIndex,promptValue) 298 return false;},selectItem:function(itemIndex,promptValue)
295 {},refresh:function() 299 {},refresh:function()
296 {this._refreshCallback();},rewriteQuery:function(query) 300 {this._refreshCallback();},rewriteQuery:function(query)
297 {return query;},dispose:function() 301 {return query;},dispose:function()
298 {}} 302 {}}
299 WebInspector.JavaScriptOutlineDialog=function(view,contentProvider,selectItemCal lback) 303 WebInspector.JavaScriptOutlineDialog=function(uiSourceCode,selectItemCallback)
300 {WebInspector.SelectionDialogContentProvider.call(this);this._functionItems=[];t his._view=view;this._selectItemCallback=selectItemCallback;contentProvider.reque stContent(this._contentAvailable.bind(this));} 304 {WebInspector.SelectionDialogContentProvider.call(this);this._functionItems=[];t his._selectItemCallback=selectItemCallback;this._outlineWorker=new Worker("Scrip tFormatterWorker.js");this._outlineWorker.onmessage=this._didBuildOutlineChunk.b ind(this);this._outlineWorker.postMessage({method:"javaScriptOutline",params:{co ntent:uiSourceCode.workingCopy()}});}
301 WebInspector.JavaScriptOutlineDialog.show=function(view,contentProvider,selectIt emCallback) 305 WebInspector.JavaScriptOutlineDialog.show=function(view,uiSourceCode,selectItemC allback)
302 {if(WebInspector.Dialog.currentInstance()) 306 {if(WebInspector.Dialog.currentInstance())
303 return null;var filteredItemSelectionDialog=new WebInspector.FilteredItemSelecti onDialog(new WebInspector.JavaScriptOutlineDialog(view,contentProvider,selectIte mCallback));WebInspector.Dialog.show(view.element,filteredItemSelectionDialog);} 307 return null;var filteredItemSelectionDialog=new WebInspector.FilteredItemSelecti onDialog(new WebInspector.JavaScriptOutlineDialog(uiSourceCode,selectItemCallbac k));WebInspector.Dialog.show(view.element,filteredItemSelectionDialog);}
304 WebInspector.JavaScriptOutlineDialog.prototype={_contentAvailable:function(conte nt) 308 WebInspector.JavaScriptOutlineDialog.prototype={_didBuildOutlineChunk:function(e vent)
305 {this._outlineWorker=new Worker("ScriptFormatterWorker.js");this._outlineWorker. onmessage=this._didBuildOutlineChunk.bind(this);const method="outline";this._out lineWorker.postMessage({method:method,params:{content:content}});},_didBuildOutl ineChunk:function(event) 309 {var data=(event.data);var chunk=data.chunk;for(var i=0;i<chunk.length;++i)
306 {var data=event.data;var chunk=data["chunk"];for(var i=0;i<chunk.length;++i) 310 this._functionItems.push(chunk[i]);if(data.total===data.index+1)
307 this._functionItems.push(chunk[i]);if(data.total===data.index)
308 this.dispose();this.refresh();},itemCount:function() 311 this.dispose();this.refresh();},itemCount:function()
309 {return this._functionItems.length;},itemKeyAt:function(itemIndex) 312 {return this._functionItems.length;},itemKeyAt:function(itemIndex)
310 {return this._functionItems[itemIndex].name;},itemScoreAt:function(itemIndex,que ry) 313 {return this._functionItems[itemIndex].name;},itemScoreAt:function(itemIndex,que ry)
311 {var item=this._functionItems[itemIndex];return-item.line;},renderItem:function( itemIndex,query,titleElement,subtitleElement) 314 {var item=this._functionItems[itemIndex];return-item.line;},renderItem:function( itemIndex,query,titleElement,subtitleElement)
312 {var item=this._functionItems[itemIndex];titleElement.textContent=item.name+(ite m.arguments?item.arguments:"");this.highlightRanges(titleElement,query);subtitle Element.textContent=":"+(item.line+1);},selectItem:function(itemIndex,promptValu e) 315 {var item=this._functionItems[itemIndex];titleElement.textContent=item.name+(ite m.arguments?item.arguments:"");this.highlightRanges(titleElement,query);subtitle Element.textContent=":"+(item.line+1);},selectItem:function(itemIndex,promptValu e)
313 {var lineNumber=this._functionItems[itemIndex].line;if(!isNaN(lineNumber)&&lineN umber>=0) 316 {if(itemIndex===null)
317 return;var lineNumber=this._functionItems[itemIndex].line;if(!isNaN(lineNumber)& &lineNumber>=0)
314 this._selectItemCallback(lineNumber,this._functionItems[itemIndex].column);},dis pose:function() 318 this._selectItemCallback(lineNumber,this._functionItems[itemIndex].column);},dis pose:function()
315 {if(this._outlineWorker){this._outlineWorker.terminate();delete this._outlineWor ker;}},__proto__:WebInspector.SelectionDialogContentProvider.prototype} 319 {if(this._outlineWorker){this._outlineWorker.terminate();delete this._outlineWor ker;}},__proto__:WebInspector.SelectionDialogContentProvider.prototype}
316 WebInspector.SelectUISourceCodeDialog=function(defaultScores) 320 WebInspector.SelectUISourceCodeDialog=function(defaultScores)
317 {WebInspector.SelectionDialogContentProvider.call(this);this._uiSourceCodes=[];v ar projects=WebInspector.workspace.projects().filter(this.filterProject.bind(thi s));for(var i=0;i<projects.length;++i) 321 {WebInspector.SelectionDialogContentProvider.call(this);this._uiSourceCodes=[];v ar projects=WebInspector.workspace.projects().filter(this.filterProject.bind(thi s));for(var i=0;i<projects.length;++i)
318 this._uiSourceCodes=this._uiSourceCodes.concat(projects[i].uiSourceCodes());this ._defaultScores=defaultScores;this._scorer=new WebInspector.FilePathScoreFunctio n("");WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISo urceCodeAdded,this._uiSourceCodeAdded,this);} 322 this._uiSourceCodes=this._uiSourceCodes.concat(projects[i].uiSourceCodes());this ._defaultScores=defaultScores;this._scorer=new WebInspector.FilePathScoreFunctio n("");WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISo urceCodeAdded,this._uiSourceCodeAdded,this);}
319 WebInspector.SelectUISourceCodeDialog.prototype={uiSourceCodeSelected:function(u iSourceCode,lineNumber) 323 WebInspector.SelectUISourceCodeDialog.prototype={uiSourceCodeSelected:function(u iSourceCode,lineNumber,columnNumber)
320 {},filterProject:function(project) 324 {},filterProject:function(project)
321 {return true;},itemCount:function() 325 {return true;},itemCount:function()
322 {return this._uiSourceCodes.length;},itemKeyAt:function(itemIndex) 326 {return this._uiSourceCodes.length;},itemKeyAt:function(itemIndex)
323 {return this._uiSourceCodes[itemIndex].fullDisplayName();},itemScoreAt:function( itemIndex,query) 327 {return this._uiSourceCodes[itemIndex].fullDisplayName();},itemScoreAt:function( itemIndex,query)
324 {var uiSourceCode=this._uiSourceCodes[itemIndex];var score=this._defaultScores?( this._defaultScores.get(uiSourceCode)||0):0;if(!query||query.length<2) 328 {var uiSourceCode=this._uiSourceCodes[itemIndex];var score=this._defaultScores?( this._defaultScores.get(uiSourceCode)||0):0;if(!query||query.length<2)
325 return score;if(this._query!==query){this._query=query;this._scorer=new WebInspe ctor.FilePathScoreFunction(query);} 329 return score;if(this._query!==query){this._query=query;this._scorer=new WebInspe ctor.FilePathScoreFunction(query);}
326 var path=uiSourceCode.fullDisplayName();return score+10*this._scorer.score(path, null);},renderItem:function(itemIndex,query,titleElement,subtitleElement) 330 var path=uiSourceCode.fullDisplayName();return score+10*this._scorer.score(path, null);},renderItem:function(itemIndex,query,titleElement,subtitleElement)
327 {query=this.rewriteQuery(query);var uiSourceCode=this._uiSourceCodes[itemIndex]; titleElement.textContent=uiSourceCode.displayName()+(this._queryLineNumber?this. _queryLineNumber:"");subtitleElement.textContent=uiSourceCode.fullDisplayName(). trimEnd(100);var indexes=[];var score=new WebInspector.FilePathScoreFunction(que ry).score(subtitleElement.textContent,indexes);var fileNameIndex=subtitleElement .textContent.lastIndexOf("/");var ranges=[];for(var i=0;i<indexes.length;++i) 331 {query=this.rewriteQuery(query);var uiSourceCode=this._uiSourceCodes[itemIndex]; titleElement.textContent=uiSourceCode.displayName()+(this._queryLineNumberAndCol umnNumber||"");subtitleElement.textContent=uiSourceCode.fullDisplayName().trimEn d(100);var indexes=[];var score=new WebInspector.FilePathScoreFunction(query).sc ore(subtitleElement.textContent,indexes);var fileNameIndex=subtitleElement.textC ontent.lastIndexOf("/");var ranges=[];for(var i=0;i<indexes.length;++i)
328 ranges.push({offset:indexes[i],length:1});if(indexes[0]>fileNameIndex){for(var i =0;i<ranges.length;++i) 332 ranges.push({offset:indexes[i],length:1});if(indexes[0]>fileNameIndex){for(var i =0;i<ranges.length;++i)
329 ranges[i].offset-=fileNameIndex+1;return WebInspector.highlightRangesWithStyleCl ass(titleElement,ranges,"highlight");}else{return WebInspector.highlightRangesWi thStyleClass(subtitleElement,ranges,"highlight");}},selectItem:function(itemInde x,promptValue) 333 ranges[i].offset-=fileNameIndex+1;return WebInspector.highlightRangesWithStyleCl ass(titleElement,ranges,"highlight");}else{return WebInspector.highlightRangesWi thStyleClass(subtitleElement,ranges,"highlight");}},selectItem:function(itemInde x,promptValue)
330 {if(/^:\d+$/.test(promptValue.trimRight())){var lineNumber=parseInt(promptValue. trimRight().substring(1),10)-1;if(!isNaN(lineNumber)&&lineNumber>=0) 334 {var parsedExpression=promptValue.trim().match(/^([^:]*)(:\d+)?(:\d+)?$/);if(!pa rsedExpression)
331 this.uiSourceCodeSelected(null,lineNumber);return;} 335 return;var lineNumber;var columnNumber;if(parsedExpression[2])
332 var lineNumberMatch=promptValue.match(/[^:]+\:([\d]*)$/);var lineNumber=lineNumb erMatch?Math.max(parseInt(lineNumberMatch[1],10)-1,0):undefined;this.uiSourceCod eSelected(this._uiSourceCodes[itemIndex],lineNumber);},rewriteQuery:function(que ry) 336 lineNumber=parseInt(parsedExpression[2].substr(1),10)-1;if(parsedExpression[3])
337 columnNumber=parseInt(parsedExpression[3].substr(1),10)-1;var uiSourceCode=itemI ndex!==null?this._uiSourceCodes[itemIndex]:null;this.uiSourceCodeSelected(uiSour ceCode,lineNumber,columnNumber);},rewriteQuery:function(query)
333 {if(!query) 338 {if(!query)
334 return query;query=query.trim();var lineNumberMatch=query.match(/([^:]+)(\:[\d]* )$/);this._queryLineNumber=lineNumberMatch?lineNumberMatch[2]:"";return lineNumb erMatch?lineNumberMatch[1]:query;},_uiSourceCodeAdded:function(event) 339 return query;query=query.trim();var lineNumberMatch=query.match(/^([^:]+)((?::[^ :]*){0,2})$/);this._queryLineNumberAndColumnNumber=lineNumberMatch?lineNumberMat ch[2]:"";return lineNumberMatch?lineNumberMatch[1]:query;},_uiSourceCodeAdded:fu nction(event)
335 {var uiSourceCode=(event.data);if(!this.filterProject(uiSourceCode.project())) 340 {var uiSourceCode=(event.data);if(!this.filterProject(uiSourceCode.project()))
336 return;this._uiSourceCodes.push(uiSourceCode) 341 return;this._uiSourceCodes.push(uiSourceCode)
337 this.refresh();},dispose:function() 342 this.refresh();},dispose:function()
338 {WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded,this._uiSourceCodeAdded,this);},__proto__:WebInspector.SelectionDial ogContentProvider.prototype} 343 {WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded,this._uiSourceCodeAdded,this);},__proto__:WebInspector.SelectionDial ogContentProvider.prototype}
339 WebInspector.OpenResourceDialog=function(panel,defaultScores) 344 WebInspector.OpenResourceDialog=function(sourcesView,defaultScores)
340 {WebInspector.SelectUISourceCodeDialog.call(this,defaultScores);this._panel=pane l;} 345 {WebInspector.SelectUISourceCodeDialog.call(this,defaultScores);this._sourcesVie w=sourcesView;}
341 WebInspector.OpenResourceDialog.prototype={uiSourceCodeSelected:function(uiSourc eCode,lineNumber) 346 WebInspector.OpenResourceDialog.prototype={uiSourceCodeSelected:function(uiSourc eCode,lineNumber,columnNumber)
342 {if(!uiSourceCode) 347 {if(!uiSourceCode)
343 uiSourceCode=this._panel.currentUISourceCode();if(!uiSourceCode) 348 uiSourceCode=this._sourcesView.currentUISourceCode();if(!uiSourceCode)
344 return;this._panel.showUISourceCode(uiSourceCode,lineNumber);},shouldShowMatchin gItems:function(query) 349 return;this._sourcesView.showSourceLocation(uiSourceCode,lineNumber,columnNumber );},shouldShowMatchingItems:function(query)
345 {return!query.startsWith(":");},filterProject:function(project) 350 {return!query.startsWith(":");},filterProject:function(project)
346 {return!project.isServiceProject();},__proto__:WebInspector.SelectUISourceCodeDi alog.prototype} 351 {return!project.isServiceProject();},__proto__:WebInspector.SelectUISourceCodeDi alog.prototype}
347 WebInspector.OpenResourceDialog.show=function(panel,relativeToElement,name,defau ltScores) 352 WebInspector.OpenResourceDialog.show=function(sourcesView,relativeToElement,quer y,defaultScores)
348 {if(WebInspector.Dialog.currentInstance()) 353 {if(WebInspector.Dialog.currentInstance())
349 return;var filteredItemSelectionDialog=new WebInspector.FilteredItemSelectionDia log(new WebInspector.OpenResourceDialog(panel,defaultScores));filteredItemSelect ionDialog.renderAsTwoRows();if(name) 354 return;var filteredItemSelectionDialog=new WebInspector.FilteredItemSelectionDia log(new WebInspector.OpenResourceDialog(sourcesView,defaultScores));filteredItem SelectionDialog.renderAsTwoRows();if(query)
350 filteredItemSelectionDialog.setQuery(name);WebInspector.Dialog.show(relativeToEl ement,filteredItemSelectionDialog);} 355 filteredItemSelectionDialog.setQuery(query);WebInspector.Dialog.show(relativeToE lement,filteredItemSelectionDialog);}
351 WebInspector.SelectUISourceCodeForProjectTypeDialog=function(type,callback) 356 WebInspector.SelectUISourceCodeForProjectTypeDialog=function(type,callback)
352 {this._type=type;WebInspector.SelectUISourceCodeDialog.call(this);this._callback =callback;} 357 {this._type=type;WebInspector.SelectUISourceCodeDialog.call(this);this._callback =callback;}
353 WebInspector.SelectUISourceCodeForProjectTypeDialog.prototype={uiSourceCodeSelec ted:function(uiSourceCode,lineNumber) 358 WebInspector.SelectUISourceCodeForProjectTypeDialog.prototype={uiSourceCodeSelec ted:function(uiSourceCode,lineNumber,columnNumber)
354 {this._callback(uiSourceCode);},filterProject:function(project) 359 {this._callback(uiSourceCode);},filterProject:function(project)
355 {return project.type()===this._type;},__proto__:WebInspector.SelectUISourceCodeD ialog.prototype} 360 {return project.type()===this._type;},__proto__:WebInspector.SelectUISourceCodeD ialog.prototype}
356 WebInspector.SelectUISourceCodeForProjectTypeDialog.show=function(name,type,call back,relativeToElement) 361 WebInspector.SelectUISourceCodeForProjectTypeDialog.show=function(name,type,call back,relativeToElement)
357 {if(WebInspector.Dialog.currentInstance()) 362 {if(WebInspector.Dialog.currentInstance())
358 return;var filteredItemSelectionDialog=new WebInspector.FilteredItemSelectionDia log(new WebInspector.SelectUISourceCodeForProjectTypeDialog(type,callback));filt eredItemSelectionDialog.setQuery(name);filteredItemSelectionDialog.renderAsTwoRo ws();WebInspector.Dialog.show(relativeToElement,filteredItemSelectionDialog);};W ebInspector.UISourceCodeFrame=function(uiSourceCode) 363 return;var filteredItemSelectionDialog=new WebInspector.FilteredItemSelectionDia log(new WebInspector.SelectUISourceCodeForProjectTypeDialog(type,callback));filt eredItemSelectionDialog.setQuery(name);filteredItemSelectionDialog.renderAsTwoRo ws();WebInspector.Dialog.show(relativeToElement,filteredItemSelectionDialog);}
359 {this._uiSourceCode=uiSourceCode;WebInspector.SourceFrame.call(this,this._uiSour ceCode);WebInspector.settings.textEditorAutocompletion.addChangeListener(this._e nableAutocompletionIfNeeded,this);this._enableAutocompletionIfNeeded();this._uiS ourceCode.addEventListener(WebInspector.UISourceCode.Events.FormattedChanged,thi s._onFormattedChanged,this);this._uiSourceCode.addEventListener(WebInspector.UIS ourceCode.Events.WorkingCopyChanged,this._onWorkingCopyChanged,this);this._uiSou rceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,t his._onWorkingCopyCommitted,this);this._updateStyle();} 364 WebInspector.JavaScriptOutlineDialog.MessageEventData;;WebInspector.UISourceCode Frame=function(uiSourceCode)
365 {this._uiSourceCode=uiSourceCode;WebInspector.SourceFrame.call(this,this._uiSour ceCode);WebInspector.settings.textEditorAutocompletion.addChangeListener(this._e nableAutocompletionIfNeeded,this);this._enableAutocompletionIfNeeded();this._uiS ourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,t his._onWorkingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector .UISourceCode.Events.WorkingCopyCommitted,this._onWorkingCopyCommitted,this);thi s._updateStyle();}
360 WebInspector.UISourceCodeFrame.prototype={uiSourceCode:function() 366 WebInspector.UISourceCodeFrame.prototype={uiSourceCode:function()
361 {return this._uiSourceCode;},_enableAutocompletionIfNeeded:function() 367 {return this._uiSourceCode;},_enableAutocompletionIfNeeded:function()
362 {this.textEditor.setCompletionDictionary(WebInspector.settings.textEditorAutocom pletion.get()?new WebInspector.SampleCompletionDictionary():null);},wasShown:fun ction() 368 {this.textEditor.setCompletionDictionary(WebInspector.settings.textEditorAutocom pletion.get()?new WebInspector.SampleCompletionDictionary():null);},wasShown:fun ction()
363 {WebInspector.SourceFrame.prototype.wasShown.call(this);this._boundWindowFocused =this._windowFocused.bind(this);window.addEventListener("focus",this._boundWindo wFocused,false);this._checkContentUpdated();},willHide:function() 369 {WebInspector.SourceFrame.prototype.wasShown.call(this);this._boundWindowFocused =this._windowFocused.bind(this);window.addEventListener("focus",this._boundWindo wFocused,false);this._checkContentUpdated();},willHide:function()
364 {WebInspector.SourceFrame.prototype.willHide.call(this);window.removeEventListen er("focus",this._boundWindowFocused,false);delete this._boundWindowFocused;this. _uiSourceCode.removeWorkingCopyGetter();},canEditSource:function() 370 {WebInspector.SourceFrame.prototype.willHide.call(this);window.removeEventListen er("focus",this._boundWindowFocused,false);delete this._boundWindowFocused;this. _uiSourceCode.removeWorkingCopyGetter();},canEditSource:function()
365 {return this._uiSourceCode.isEditable();},_windowFocused:function(event) 371 {return this._uiSourceCode.isEditable();},_windowFocused:function(event)
366 {this._checkContentUpdated();},_checkContentUpdated:function() 372 {this._checkContentUpdated();},_checkContentUpdated:function()
367 {if(!this.loaded||!this.isShowing()) 373 {if(!this.loaded||!this.isShowing())
368 return;this._uiSourceCode.checkContentUpdated();},commitEditing:function(text) 374 return;this._uiSourceCode.checkContentUpdated();},commitEditing:function()
369 {if(!this._uiSourceCode.isDirty()) 375 {if(!this._uiSourceCode.isDirty())
370 return;this._muteSourceCodeEvents=true;this._uiSourceCode.commitWorkingCopy(this ._didEditContent.bind(this));delete this._muteSourceCodeEvents;},onTextChanged:f unction(oldRange,newRange) 376 return;this._muteSourceCodeEvents=true;this._uiSourceCode.commitWorkingCopy(this ._didEditContent.bind(this));delete this._muteSourceCodeEvents;},onTextChanged:f unction(oldRange,newRange)
371 {WebInspector.SourceFrame.prototype.onTextChanged.call(this,oldRange,newRange);i f(this._isSettingContent) 377 {WebInspector.SourceFrame.prototype.onTextChanged.call(this,oldRange,newRange);i f(this._isSettingContent)
372 return;this._muteSourceCodeEvents=true;if(this._textEditor.isClean()) 378 return;this._muteSourceCodeEvents=true;if(this._textEditor.isClean())
373 this._uiSourceCode.resetWorkingCopy();else 379 this._uiSourceCode.resetWorkingCopy();else
374 this._uiSourceCode.setWorkingCopyGetter(this._textEditor.text.bind(this._textEdi tor));delete this._muteSourceCodeEvents;},_didEditContent:function(error) 380 this._uiSourceCode.setWorkingCopyGetter(this._textEditor.text.bind(this._textEdi tor));delete this._muteSourceCodeEvents;},_didEditContent:function(error)
375 {if(error){WebInspector.log(error,WebInspector.ConsoleMessage.MessageLevel.Error ,true);return;}},beforeFormattedChange:function(){},_onFormattedChanged:function (event) 381 {if(error){WebInspector.console.log(error,WebInspector.ConsoleMessage.MessageLev el.Error,true);return;}},_onWorkingCopyChanged:function(event)
376 {this.beforeFormattedChange();var content=(event.data.content);this._textEditor. setReadOnly(this._uiSourceCode.formatted());var selection=this._textEditor.selec tion();this._innerSetContent(content);var start=null;var end=null;if(this._uiSou rceCode.formatted()){start=event.data.newFormatter.originalToFormatted(selection .startLine,selection.startColumn);end=event.data.newFormatter.originalToFormatte d(selection.endLine,selection.endColumn);}else{start=event.data.oldFormatter.for mattedToOriginal(selection.startLine,selection.startColumn);end=event.data.oldFo rmatter.formattedToOriginal(selection.endLine,selection.endColumn);}
377 this.textEditor.setSelection(new WebInspector.TextRange(start[0],start[1],end[0] ,end[1]));this.textEditor.revealLine(start[0]);},_onWorkingCopyChanged:function( event)
378 {if(this._muteSourceCodeEvents) 382 {if(this._muteSourceCodeEvents)
379 return;this._innerSetContent(this._uiSourceCode.workingCopy());this.onUISourceCo deContentChanged();},_onWorkingCopyCommitted:function(event) 383 return;this._innerSetContent(this._uiSourceCode.workingCopy());this.onUISourceCo deContentChanged();},_onWorkingCopyCommitted:function(event)
380 {if(!this._muteSourceCodeEvents){this._innerSetContent(this._uiSourceCode.workin gCopy());this.onUISourceCodeContentChanged();} 384 {if(!this._muteSourceCodeEvents){this._innerSetContent(this._uiSourceCode.workin gCopy());this.onUISourceCodeContentChanged();}
381 this._textEditor.markClean();this._updateStyle();},_updateStyle:function() 385 this._textEditor.markClean();this._updateStyle();},_updateStyle:function()
382 {this.element.enableStyleClass("source-frame-unsaved-committed-changes",this._ui SourceCode.hasUnsavedCommittedChanges());},onUISourceCodeContentChanged:function () 386 {this.element.classList.toggle("source-frame-unsaved-committed-changes",this._ui SourceCode.hasUnsavedCommittedChanges());},onUISourceCodeContentChanged:function ()
383 {},_innerSetContent:function(content) 387 {},_innerSetContent:function(content)
384 {this._isSettingContent=true;this.setContent(content);delete this._isSettingCont ent;},populateTextAreaContextMenu:function(contextMenu,lineNumber) 388 {this._isSettingContent=true;this.setContent(content);delete this._isSettingCont ent;},populateTextAreaContextMenu:function(contextMenu,lineNumber)
385 {WebInspector.SourceFrame.prototype.populateTextAreaContextMenu.call(this,contex tMenu,lineNumber);contextMenu.appendApplicableItems(this._uiSourceCode);contextM enu.appendSeparator();},dispose:function() 389 {WebInspector.SourceFrame.prototype.populateTextAreaContextMenu.call(this,contex tMenu,lineNumber);contextMenu.appendApplicableItems(this._uiSourceCode);contextM enu.appendSeparator();},dispose:function()
386 {this.detach();},__proto__:WebInspector.SourceFrame.prototype};WebInspector.Java ScriptSourceFrame=function(scriptsPanel,uiSourceCode) 390 {this.detach();},__proto__:WebInspector.SourceFrame.prototype};WebInspector.Java ScriptSourceFrame=function(scriptsPanel,uiSourceCode)
387 {this._scriptsPanel=scriptsPanel;this._breakpointManager=WebInspector.breakpoint Manager;this._uiSourceCode=uiSourceCode;WebInspector.UISourceCodeFrame.call(this ,uiSourceCode);if(uiSourceCode.project().type()===WebInspector.projectTypes.Debu gger) 391 {this._scriptsPanel=scriptsPanel;this._breakpointManager=WebInspector.breakpoint Manager;this._uiSourceCode=uiSourceCode;WebInspector.UISourceCodeFrame.call(this ,uiSourceCode);if(uiSourceCode.project().type()===WebInspector.projectTypes.Debu gger)
388 this.element.classList.add("source-frame-debugger-script");this._popoverHelper=n ew WebInspector.ObjectPopoverHelper(this.textEditor.element,this._getPopoverAnch or.bind(this),this._resolveObjectForPopover.bind(this),this._onHidePopover.bind( this),true);this.textEditor.element.addEventListener("keydown",this._onKeyDown.b ind(this),true);this.textEditor.addEventListener(WebInspector.TextEditor.Events. GutterClick,this._handleGutterClick.bind(this),this);this.textEditor.element.add EventListener("mousedown",this._onMouseDownAndClick.bind(this,true),true);this.t extEditor.element.addEventListener("click",this._onMouseDownAndClick.bind(this,f alse),true);this._breakpointManager.addEventListener(WebInspector.BreakpointMana ger.Events.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.a ddEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._br eakpointRemoved,this);this._uiSourceCode.addEventListener(WebInspector.UISourceC ode.Events.ConsoleMessageAdded,this._consoleMessageAdded,this);this._uiSourceCod e.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessageRemoved,this._ consoleMessageRemoved,this);this._uiSourceCode.addEventListener(WebInspector.UIS ourceCode.Events.ConsoleMessagesCleared,this._consoleMessagesCleared,this);this. _uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceMappingCha nged,this._onSourceMappingChanged,this);this._uiSourceCode.addEventListener(WebI nspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);t his._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyC ommitted,this._workingCopyCommitted,this);this._registerShortcuts();this._update ScriptFile();} 392 this.element.classList.add("source-frame-debugger-script");this._popoverHelper=n ew WebInspector.ObjectPopoverHelper(this.textEditor.element,this._getPopoverAnch or.bind(this),this._resolveObjectForPopover.bind(this),this._onHidePopover.bind( this),true);this.textEditor.element.addEventListener("keydown",this._onKeyDown.b ind(this),true);this.textEditor.addEventListener(WebInspector.TextEditor.Events. GutterClick,this._handleGutterClick.bind(this),this);this._breakpointManager.add EventListener(WebInspector.BreakpointManager.Events.BreakpointAdded,this._breakp ointAdded,this);this._breakpointManager.addEventListener(WebInspector.Breakpoint Manager.Events.BreakpointRemoved,this._breakpointRemoved,this);this._uiSourceCod e.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessageAdded,this._co nsoleMessageAdded,this);this._uiSourceCode.addEventListener(WebInspector.UISourc eCode.Events.ConsoleMessageRemoved,this._consoleMessageRemoved,this);this._uiSou rceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessagesCleared ,this._consoleMessagesCleared,this);this._uiSourceCode.addEventListener(WebInspe ctor.UISourceCode.Events.SourceMappingChanged,this._onSourceMappingChanged,this) ;this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCop yChanged,this._workingCopyChanged,this);this._uiSourceCode.addEventListener(WebI nspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,thi s);this._registerShortcuts();this._updateScriptFile();}
389 WebInspector.JavaScriptSourceFrame.prototype={_registerShortcuts:function() 393 WebInspector.JavaScriptSourceFrame.prototype={_registerShortcuts:function()
390 {var shortcutKeys=WebInspector.ShortcutsScreen.SourcesPanelShortcuts;for(var i=0 ;i<shortcutKeys.EvaluateSelectionInConsole.length;++i){var keyDescriptor=shortcu tKeys.EvaluateSelectionInConsole[i];this.addShortcut(keyDescriptor.key,this._eva luateSelectionInConsole.bind(this));} 394 {var shortcutKeys=WebInspector.ShortcutsScreen.SourcesPanelShortcuts;for(var i=0 ;i<shortcutKeys.EvaluateSelectionInConsole.length;++i){var keyDescriptor=shortcu tKeys.EvaluateSelectionInConsole[i];this.addShortcut(keyDescriptor.key,this._eva luateSelectionInConsole.bind(this));}
391 for(var i=0;i<shortcutKeys.AddSelectionToWatch.length;++i){var keyDescriptor=sho rtcutKeys.AddSelectionToWatch[i];this.addShortcut(keyDescriptor.key,this._addCur rentSelectionToWatch.bind(this));}},_addCurrentSelectionToWatch:function() 395 for(var i=0;i<shortcutKeys.AddSelectionToWatch.length;++i){var keyDescriptor=sho rtcutKeys.AddSelectionToWatch[i];this.addShortcut(keyDescriptor.key,this._addCur rentSelectionToWatch.bind(this));}},_addCurrentSelectionToWatch:function()
392 {var textSelection=this.textEditor.selection();if(textSelection&&!textSelection. isEmpty()) 396 {var textSelection=this.textEditor.selection();if(textSelection&&!textSelection. isEmpty())
393 this._innerAddToWatch(this.textEditor.copyRange(textSelection));},_innerAddToWat ch:function(expression) 397 this._innerAddToWatch(this.textEditor.copyRange(textSelection));},_innerAddToWat ch:function(expression)
394 {this._scriptsPanel.addToWatch(expression);},_evaluateSelectionInConsole:functio n() 398 {this._scriptsPanel.addToWatch(expression);},_evaluateSelectionInConsole:functio n()
395 {var selection=this.textEditor.selection();if(!selection||selection.isEmpty()) 399 {var selection=this.textEditor.selection();if(!selection||selection.isEmpty())
396 return false;WebInspector.evaluateInConsole(this.textEditor.copyRange(selection) );return true;},wasShown:function() 400 return false;this._evaluateInConsole(this.textEditor.copyRange(selection));retur n true;},_evaluateInConsole:function(expression)
401 {WebInspector.console.evaluate(expression);},wasShown:function()
397 {WebInspector.UISourceCodeFrame.prototype.wasShown.call(this);},willHide:functio n() 402 {WebInspector.UISourceCodeFrame.prototype.wasShown.call(this);},willHide:functio n()
398 {WebInspector.UISourceCodeFrame.prototype.willHide.call(this);this._popoverHelpe r.hidePopover();},onUISourceCodeContentChanged:function() 403 {WebInspector.UISourceCodeFrame.prototype.willHide.call(this);this._popoverHelpe r.hidePopover();},onUISourceCodeContentChanged:function()
399 {this._removeAllBreakpoints();WebInspector.UISourceCodeFrame.prototype.onUISourc eCodeContentChanged.call(this);},populateLineGutterContextMenu:function(contextM enu,lineNumber) 404 {this._removeAllBreakpoints();WebInspector.UISourceCodeFrame.prototype.onUISourc eCodeContentChanged.call(this);},populateLineGutterContextMenu:function(contextM enu,lineNumber)
400 {contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitle s()?"Continue to here":"Continue to Here"),this._continueToLine.bind(this,lineNu mber));var breakpoint=this._breakpointManager.findBreakpoint(this._uiSourceCode, lineNumber);if(!breakpoint){contextMenu.appendItem(WebInspector.UIString(WebInsp ector.useLowerCaseMenuTitles()?"Add breakpoint":"Add Breakpoint"),this._setBreak point.bind(this,lineNumber,"",true));contextMenu.appendItem(WebInspector.UIStrin g(WebInspector.useLowerCaseMenuTitles()?"Add conditional breakpoint…":"Add Condi tional Breakpoint…"),this._editBreakpointCondition.bind(this,lineNumber));}else{ contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Remove breakpoint":"Remove Breakpoint"),breakpoint.remove.bind(breakpoint)); contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Edit breakpoint…":"Edit Breakpoint…"),this._editBreakpointCondition.bind(thi s,lineNumber,breakpoint));if(breakpoint.enabled()) 405 {contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitle s()?"Continue to here":"Continue to Here"),this._continueToLine.bind(this,lineNu mber));var breakpoint=this._breakpointManager.findBreakpointOnLine(this._uiSourc eCode,lineNumber);if(!breakpoint){contextMenu.appendItem(WebInspector.UIString(W ebInspector.useLowerCaseMenuTitles()?"Add breakpoint":"Add Breakpoint"),this._se tBreakpoint.bind(this,lineNumber,0,"",true));contextMenu.appendItem(WebInspector .UIString(WebInspector.useLowerCaseMenuTitles()?"Add conditional breakpoint…":"A dd Conditional Breakpoint…"),this._editBreakpointCondition.bind(this,lineNumber) );}else{contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles()?"Remove breakpoint":"Remove Breakpoint"),breakpoint.remove.bind(break point));contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles()?"Edit breakpoint…":"Edit Breakpoint…"),this._editBreakpointCondition. bind(this,lineNumber,breakpoint));if(breakpoint.enabled())
401 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Disable breakpoint":"Disable Breakpoint"),breakpoint.setEnabled.bind(breakpo int,false));else 406 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Disable breakpoint":"Disable Breakpoint"),breakpoint.setEnabled.bind(breakpo int,false));else
402 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Enable breakpoint":"Enable Breakpoint"),breakpoint.setEnabled.bind(breakpoin t,true));}},populateTextAreaContextMenu:function(contextMenu,lineNumber) 407 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Enable breakpoint":"Enable Breakpoint"),breakpoint.setEnabled.bind(breakpoin t,true));}},populateTextAreaContextMenu:function(contextMenu,lineNumber)
403 {var textSelection=this.textEditor.selection();if(textSelection&&!textSelection. isEmpty()){var selection=this.textEditor.copyRange(textSelection);var addToWatch Label=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add to watch" :"Add to Watch");contextMenu.appendItem(addToWatchLabel,this._innerAddToWatch.bi nd(this,selection));var evaluateLabel=WebInspector.UIString(WebInspector.useLowe rCaseMenuTitles()?"Evaluate in console":"Evaluate in Console");contextMenu.appen dItem(evaluateLabel,WebInspector.evaluateInConsole.bind(WebInspector,selection)) ;contextMenu.appendSeparator();}else if(!this._uiSourceCode.isEditable()&&this._ uiSourceCode.contentType()===WebInspector.resourceTypes.Script){var liveEditLabe l=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Live edit":"Live Edit");contextMenu.appendItem(liveEditLabel,liveEdit.bind(this));contextMenu.app endSeparator();} 408 {var textSelection=this.textEditor.selection();if(textSelection&&!textSelection. isEmpty()){var selection=this.textEditor.copyRange(textSelection);var addToWatch Label=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add to watch" :"Add to Watch");contextMenu.appendItem(addToWatchLabel,this._innerAddToWatch.bi nd(this,selection));var evaluateLabel=WebInspector.UIString(WebInspector.useLowe rCaseMenuTitles()?"Evaluate in console":"Evaluate in Console");contextMenu.appen dItem(evaluateLabel,this._evaluateInConsole.bind(this,selection));contextMenu.ap pendSeparator();}else if(!this._uiSourceCode.isEditable()&&this._uiSourceCode.co ntentType()===WebInspector.resourceTypes.Script){var liveEditLabel=WebInspector. UIString(WebInspector.useLowerCaseMenuTitles()?"Live edit":"Live Edit");contextM enu.appendItem(liveEditLabel,liveEdit.bind(this));contextMenu.appendSeparator(); }
404 function liveEdit() 409 function liveEdit()
405 {var liveEditUISourceCode=WebInspector.liveEditSupport.uiSourceCodeForLiveEdit(t his._uiSourceCode);this._scriptsPanel.showUISourceCode(liveEditUISourceCode,line Number)} 410 {var liveEditUISourceCode=WebInspector.liveEditSupport.uiSourceCodeForLiveEdit(t his._uiSourceCode);this._scriptsPanel.showUISourceCode(liveEditUISourceCode,line Number)}
406 WebInspector.UISourceCodeFrame.prototype.populateTextAreaContextMenu.call(this,c ontextMenu,lineNumber);},_workingCopyChanged:function(event) 411 WebInspector.UISourceCodeFrame.prototype.populateTextAreaContextMenu.call(this,c ontextMenu,lineNumber);},_workingCopyChanged:function(event)
407 {if(this._supportsEnabledBreakpointsWhileEditing()||this._scriptFile) 412 {if(this._supportsEnabledBreakpointsWhileEditing()||this._scriptFile)
408 return;if(this._uiSourceCode.isDirty()) 413 return;if(this._uiSourceCode.isDirty())
409 this._muteBreakpointsWhileEditing();else 414 this._muteBreakpointsWhileEditing();else
410 this._restoreBreakpointsAfterEditing();},_workingCopyCommitted:function(event) 415 this._restoreBreakpointsAfterEditing();},_workingCopyCommitted:function(event)
411 {if(this._supportsEnabledBreakpointsWhileEditing()||this._scriptFile) 416 {if(this._supportsEnabledBreakpointsWhileEditing()||this._scriptFile)
412 return;this._restoreBreakpointsAfterEditing();},_didMergeToVM:function() 417 return;this._restoreBreakpointsAfterEditing();},_didMergeToVM:function()
413 {if(this._supportsEnabledBreakpointsWhileEditing()) 418 {if(this._supportsEnabledBreakpointsWhileEditing())
414 return;this._restoreBreakpointsAfterEditing();},_didDivergeFromVM:function() 419 return;this._restoreBreakpointsAfterEditing();},_didDivergeFromVM:function()
415 {if(this._supportsEnabledBreakpointsWhileEditing()) 420 {if(this._supportsEnabledBreakpointsWhileEditing())
416 return;this._muteBreakpointsWhileEditing();},_muteBreakpointsWhileEditing:functi on() 421 return;this._muteBreakpointsWhileEditing();},_muteBreakpointsWhileEditing:functi on()
417 {if(this._muted) 422 {if(this._muted)
418 return;for(var lineNumber=0;lineNumber<this._textEditor.linesCount;++lineNumber) {var breakpointDecoration=this._textEditor.getAttribute(lineNumber,"breakpoint") ;if(!breakpointDecoration) 423 return;for(var lineNumber=0;lineNumber<this._textEditor.linesCount;++lineNumber) {var breakpointDecoration=this._textEditor.getAttribute(lineNumber,"breakpoint") ;if(!breakpointDecoration)
419 continue;this._removeBreakpointDecoration(lineNumber);this._addBreakpointDecorat ion(lineNumber,breakpointDecoration.condition,breakpointDecoration.enabled,true) ;} 424 continue;this._removeBreakpointDecoration(lineNumber);this._addBreakpointDecorat ion(lineNumber,breakpointDecoration.columnNumber,breakpointDecoration.condition, breakpointDecoration.enabled,true);}
420 this._muted=true;},_supportsEnabledBreakpointsWhileEditing:function() 425 this._muted=true;},_supportsEnabledBreakpointsWhileEditing:function()
421 {return this._uiSourceCode.project().type()===WebInspector.projectTypes.Snippets ;},_restoreBreakpointsAfterEditing:function() 426 {return this._uiSourceCode.project().type()===WebInspector.projectTypes.Snippets ;},_restoreBreakpointsAfterEditing:function()
422 {delete this._muted;var breakpoints={};for(var lineNumber=0;lineNumber<this._tex tEditor.linesCount;++lineNumber){var breakpointDecoration=this._textEditor.getAt tribute(lineNumber,"breakpoint");if(breakpointDecoration){breakpoints[lineNumber ]=breakpointDecoration;this._removeBreakpointDecoration(lineNumber);}} 427 {delete this._muted;var breakpoints={};for(var lineNumber=0;lineNumber<this._tex tEditor.linesCount;++lineNumber){var breakpointDecoration=this._textEditor.getAt tribute(lineNumber,"breakpoint");if(breakpointDecoration){breakpoints[lineNumber ]=breakpointDecoration;this._removeBreakpointDecoration(lineNumber);}}
423 this._removeAllBreakpoints();for(var lineNumberString in breakpoints){var lineNu mber=parseInt(lineNumberString,10);if(isNaN(lineNumber)) 428 this._removeAllBreakpoints();for(var lineNumberString in breakpoints){var lineNu mber=parseInt(lineNumberString,10);if(isNaN(lineNumber))
424 continue;var breakpointDecoration=breakpoints[lineNumberString];this._setBreakpo int(lineNumber,breakpointDecoration.condition,breakpointDecoration.enabled);}},_ removeAllBreakpoints:function() 429 continue;var breakpointDecoration=breakpoints[lineNumberString];this._setBreakpo int(lineNumber,breakpointDecoration.columnNumber,breakpointDecoration.condition, breakpointDecoration.enabled);}},_removeAllBreakpoints:function()
425 {var breakpoints=this._breakpointManager.breakpointsForUISourceCode(this._uiSour ceCode);for(var i=0;i<breakpoints.length;++i) 430 {var breakpoints=this._breakpointManager.breakpointsForUISourceCode(this._uiSour ceCode);for(var i=0;i<breakpoints.length;++i)
426 breakpoints[i].remove();},_getPopoverAnchor:function(element,event) 431 breakpoints[i].remove();},_getPopoverAnchor:function(element,event)
427 {if(!WebInspector.debuggerModel.isPaused()) 432 {if(!WebInspector.debuggerModel.isPaused())
428 return null;var textPosition=this.textEditor.coordinatesToCursorPosition(event.x ,event.y);if(!textPosition) 433 return null;var textPosition=this.textEditor.coordinatesToCursorPosition(event.x ,event.y);if(!textPosition)
429 return null;var mouseLine=textPosition.startLine;var mouseColumn=textPosition.st artColumn;var textSelection=this.textEditor.selection().normalize();if(textSelec tion&&!textSelection.isEmpty()){if(textSelection.startLine!==textSelection.endLi ne||textSelection.startLine!==mouseLine||mouseColumn<textSelection.startColumn|| mouseColumn>textSelection.endColumn) 434 return null;var mouseLine=textPosition.startLine;var mouseColumn=textPosition.st artColumn;var textSelection=this.textEditor.selection().normalize();if(textSelec tion&&!textSelection.isEmpty()){if(textSelection.startLine!==textSelection.endLi ne||textSelection.startLine!==mouseLine||mouseColumn<textSelection.startColumn|| mouseColumn>textSelection.endColumn)
430 return null;var leftCorner=this.textEditor.cursorPositionToCoordinates(textSelec tion.startLine,textSelection.startColumn);var rightCorner=this.textEditor.cursor PositionToCoordinates(textSelection.endLine,textSelection.endColumn);var anchorB ox=new AnchorBox(leftCorner.x,leftCorner.y,rightCorner.x-leftCorner.x,leftCorner .height);anchorBox.highlight={lineNumber:textSelection.startLine,startColumn:tex tSelection.startColumn,endColumn:textSelection.endColumn-1};anchorBox.forSelecti on=true;return anchorBox;} 435 return null;var leftCorner=this.textEditor.cursorPositionToCoordinates(textSelec tion.startLine,textSelection.startColumn);var rightCorner=this.textEditor.cursor PositionToCoordinates(textSelection.endLine,textSelection.endColumn);var anchorB ox=new AnchorBox(leftCorner.x,leftCorner.y,rightCorner.x-leftCorner.x,leftCorner .height);anchorBox.highlight={lineNumber:textSelection.startLine,startColumn:tex tSelection.startColumn,endColumn:textSelection.endColumn-1};anchorBox.forSelecti on=true;return anchorBox;}
431 var token=this.textEditor.tokenAtTextPosition(textPosition.startLine,textPositio n.startColumn);if(!token) 436 var token=this.textEditor.tokenAtTextPosition(textPosition.startLine,textPositio n.startColumn);if(!token)
432 return null;var lineNumber=textPosition.startLine;var line=this.textEditor.line( lineNumber);var tokenContent=line.substring(token.startColumn,token.endColumn+1) ;if(token.type!=="javascript-ident"&&(token.type!=="javascript-keyword"||tokenCo ntent!=="this")) 437 return null;var lineNumber=textPosition.startLine;var line=this.textEditor.line( lineNumber);var tokenContent=line.substring(token.startColumn,token.endColumn+1) ;var isIdentifier=token.type.startsWith("js-variable")||token.type.startsWith("j s-property")||token.type=="js-def";if(!isIdentifier&&(token.type!=="js-keyword"| |tokenContent!=="this"))
433 return null;var leftCorner=this.textEditor.cursorPositionToCoordinates(lineNumbe r,token.startColumn);var rightCorner=this.textEditor.cursorPositionToCoordinates (lineNumber,token.endColumn+1);var anchorBox=new AnchorBox(leftCorner.x,leftCorn er.y,rightCorner.x-leftCorner.x,leftCorner.height);anchorBox.highlight={lineNumb er:lineNumber,startColumn:token.startColumn,endColumn:token.endColumn};return an chorBox;},_resolveObjectForPopover:function(anchorBox,showCallback,objectGroupNa me) 438 return null;var leftCorner=this.textEditor.cursorPositionToCoordinates(lineNumbe r,token.startColumn);var rightCorner=this.textEditor.cursorPositionToCoordinates (lineNumber,token.endColumn+1);var anchorBox=new AnchorBox(leftCorner.x,leftCorn er.y,rightCorner.x-leftCorner.x,leftCorner.height);anchorBox.highlight={lineNumb er:lineNumber,startColumn:token.startColumn,endColumn:token.endColumn};return an chorBox;},_resolveObjectForPopover:function(anchorBox,showCallback,objectGroupNa me)
434 {function showObjectPopover(result,wasThrown) 439 {function showObjectPopover(result,wasThrown)
435 {if(!WebInspector.debuggerModel.isPaused()||!result){this._popoverHelper.hidePop over();return;} 440 {if(!WebInspector.debuggerModel.isPaused()||!result){this._popoverHelper.hidePop over();return;}
436 this._popoverAnchorBox=anchorBox;showCallback(WebInspector.RemoteObject.fromPayl oad(result),wasThrown,this._popoverAnchorBox);if(this._popoverAnchorBox){var hig hlightRange=new WebInspector.TextRange(lineNumber,startHighlight,lineNumber,endH ighlight);this._popoverAnchorBox._highlightDescriptor=this.textEditor.highlightR ange(highlightRange,"source-frame-eval-expression");}} 441 this._popoverAnchorBox=anchorBox;showCallback(WebInspector.RemoteObject.fromPayl oad(result),wasThrown,this._popoverAnchorBox);if(this._popoverAnchorBox){var hig hlightRange=new WebInspector.TextRange(lineNumber,startHighlight,lineNumber,endH ighlight);this._popoverAnchorBox._highlightDescriptor=this.textEditor.highlightR ange(highlightRange,"source-frame-eval-expression");}}
437 if(!WebInspector.debuggerModel.isPaused()){this._popoverHelper.hidePopover();ret urn;} 442 if(!WebInspector.debuggerModel.isPaused()){this._popoverHelper.hidePopover();ret urn;}
438 var lineNumber=anchorBox.highlight.lineNumber;var startHighlight=anchorBox.highl ight.startColumn;var endHighlight=anchorBox.highlight.endColumn;var line=this.te xtEditor.line(lineNumber);if(!anchorBox.forSelection){while(startHighlight>1&&li ne.charAt(startHighlight-1)==='.'){var token=this.textEditor.tokenAtTextPosition (lineNumber,startHighlight-2);if(!token){this._popoverHelper.hidePopover();retur n;} 443 var lineNumber=anchorBox.highlight.lineNumber;var startHighlight=anchorBox.highl ight.startColumn;var endHighlight=anchorBox.highlight.endColumn;var line=this.te xtEditor.line(lineNumber);if(!anchorBox.forSelection){while(startHighlight>1&&li ne.charAt(startHighlight-1)==='.'){var token=this.textEditor.tokenAtTextPosition (lineNumber,startHighlight-2);if(!token){this._popoverHelper.hidePopover();retur n;}
439 startHighlight=token.startColumn;}} 444 startHighlight=token.startColumn;}}
440 var evaluationText=line.substring(startHighlight,endHighlight+1);var selectedCal lFrame=WebInspector.debuggerModel.selectedCallFrame();selectedCallFrame.evaluate (evaluationText,objectGroupName,false,true,false,false,showObjectPopover.bind(th is));},_onHidePopover:function() 445 var evaluationText=line.substring(startHighlight,endHighlight+1);var selectedCal lFrame=WebInspector.debuggerModel.selectedCallFrame();selectedCallFrame.evaluate (evaluationText,objectGroupName,false,true,false,false,showObjectPopover.bind(th is));},_onHidePopover:function()
441 {if(!this._popoverAnchorBox) 446 {if(!this._popoverAnchorBox)
442 return;if(this._popoverAnchorBox._highlightDescriptor) 447 return;if(this._popoverAnchorBox._highlightDescriptor)
443 this.textEditor.removeHighlight(this._popoverAnchorBox._highlightDescriptor);del ete this._popoverAnchorBox;},_addBreakpointDecoration:function(lineNumber,condit ion,enabled,mutedWhileEditing) 448 this.textEditor.removeHighlight(this._popoverAnchorBox._highlightDescriptor);del ete this._popoverAnchorBox;},_addBreakpointDecoration:function(lineNumber,column Number,condition,enabled,mutedWhileEditing)
444 {var breakpoint={condition:condition,enabled:enabled};this.textEditor.setAttribu te(lineNumber,"breakpoint",breakpoint);var disabled=!enabled||mutedWhileEditing; this.textEditor.addBreakpoint(lineNumber,disabled,!!condition);},_removeBreakpoi ntDecoration:function(lineNumber) 449 {var breakpoint={condition:condition,enabled:enabled,columnNumber:columnNumber}; this.textEditor.setAttribute(lineNumber,"breakpoint",breakpoint);var disabled=!e nabled||mutedWhileEditing;this.textEditor.addBreakpoint(lineNumber,disabled,!!co ndition);},_removeBreakpointDecoration:function(lineNumber)
445 {this.textEditor.removeAttribute(lineNumber,"breakpoint");this.textEditor.remove Breakpoint(lineNumber);},_onKeyDown:function(event) 450 {this.textEditor.removeAttribute(lineNumber,"breakpoint");this.textEditor.remove Breakpoint(lineNumber);},_onKeyDown:function(event)
446 {if(event.keyIdentifier==="U+001B"){if(this._popoverHelper.isPopoverVisible()){t his._popoverHelper.hidePopover();event.consume();return;} 451 {if(event.keyIdentifier==="U+001B"){if(this._popoverHelper.isPopoverVisible()){t his._popoverHelper.hidePopover();event.consume();}}},_editBreakpointCondition:fu nction(lineNumber,breakpoint)
447 if(this._stepIntoMarkup&&WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) ){this._stepIntoMarkup.stoptIteratingSelection();event.consume();return;}}},_edi tBreakpointCondition:function(lineNumber,breakpoint)
448 {this._conditionElement=this._createConditionElement(lineNumber);this.textEditor .addDecoration(lineNumber,this._conditionElement);function finishEditing(committ ed,element,newText) 452 {this._conditionElement=this._createConditionElement(lineNumber);this.textEditor .addDecoration(lineNumber,this._conditionElement);function finishEditing(committ ed,element,newText)
449 {this.textEditor.removeDecoration(lineNumber,this._conditionElement);delete this ._conditionEditorElement;delete this._conditionElement;if(!committed) 453 {this.textEditor.removeDecoration(lineNumber,this._conditionElement);delete this ._conditionEditorElement;delete this._conditionElement;if(!committed)
450 return;if(breakpoint) 454 return;if(breakpoint)
451 breakpoint.setCondition(newText);else 455 breakpoint.setCondition(newText);else
452 this._setBreakpoint(lineNumber,newText,true);} 456 this._setBreakpoint(lineNumber,0,newText,true);}
453 var config=new WebInspector.EditingConfig(finishEditing.bind(this,true),finishEd iting.bind(this,false));WebInspector.startEditing(this._conditionEditorElement,c onfig);this._conditionEditorElement.value=breakpoint?breakpoint.condition():"";t his._conditionEditorElement.select();},_createConditionElement:function(lineNumb er) 457 var config=new WebInspector.InplaceEditor.Config(finishEditing.bind(this,true),f inishEditing.bind(this,false));WebInspector.InplaceEditor.startEditing(this._con ditionEditorElement,config);this._conditionEditorElement.value=breakpoint?breakp oint.condition():"";this._conditionEditorElement.select();},_createConditionElem ent:function(lineNumber)
454 {var conditionElement=document.createElement("div");conditionElement.className=" source-frame-breakpoint-condition";var labelElement=document.createElement("labe l");labelElement.className="source-frame-breakpoint-message";labelElement.htmlFo r="source-frame-breakpoint-condition";labelElement.appendChild(document.createTe xtNode(WebInspector.UIString("The breakpoint on line %d will stop only if this e xpression is true:",lineNumber)));conditionElement.appendChild(labelElement);var editorElement=document.createElement("input");editorElement.id="source-frame-br eakpoint-condition";editorElement.className="monospace";editorElement.type="text ";conditionElement.appendChild(editorElement);this._conditionEditorElement=edito rElement;return conditionElement;},setExecutionLine:function(lineNumber,callFram e) 458 {var conditionElement=document.createElement("div");conditionElement.className=" source-frame-breakpoint-condition";var labelElement=document.createElement("labe l");labelElement.className="source-frame-breakpoint-message";labelElement.htmlFo r="source-frame-breakpoint-condition";labelElement.appendChild(document.createTe xtNode(WebInspector.UIString("The breakpoint on line %d will stop only if this e xpression is true:",lineNumber)));conditionElement.appendChild(labelElement);var editorElement=document.createElement("input");editorElement.id="source-frame-br eakpoint-condition";editorElement.className="monospace";editorElement.type="text ";conditionElement.appendChild(editorElement);this._conditionEditorElement=edito rElement;return conditionElement;},setExecutionLine:function(lineNumber)
455 {this._executionLineNumber=lineNumber;this._executionCallFrame=callFrame;if(this .loaded){this.textEditor.setExecutionLine(lineNumber);if(WebInspector.experiment sSettings.stepIntoSelection.isEnabled()) 459 {this._executionLineNumber=lineNumber;if(this.loaded)
456 callFrame.getStepIntoLocations(locationsCallback.bind(this));} 460 this.textEditor.setExecutionLine(lineNumber);},clearExecutionLine:function()
457 function locationsCallback(locations) 461 {if(this.loaded&&typeof this._executionLineNumber==="number")
458 {if(this._executionCallFrame!==callFrame||this._stepIntoMarkup) 462 this.textEditor.clearExecutionLine();delete this._executionLineNumber;},_shouldI gnoreExternalBreakpointEvents:function()
459 return;this._stepIntoMarkup=WebInspector.JavaScriptSourceFrame.StepIntoMarkup.cr eate(this,locations);if(this._stepIntoMarkup)
460 this._stepIntoMarkup.show();}},clearExecutionLine:function()
461 {if(this._stepIntoMarkup){this._stepIntoMarkup.dispose();delete this._stepIntoMa rkup;}
462 if(this.loaded&&typeof this._executionLineNumber==="number")
463 this.textEditor.clearExecutionLine();delete this._executionLineNumber;delete thi s._executionCallFrame;},_lineNumberAfterEditing:function(lineNumber,oldRange,new Range)
464 {var shiftOffset=lineNumber<=oldRange.startLine?0:newRange.linesCount-oldRange.l inesCount;if(lineNumber===oldRange.startLine){var whiteSpacesRegex=/^[\s\xA0]*$/ ;for(var i=0;lineNumber+i<=newRange.endLine;++i){if(!whiteSpacesRegex.test(this. textEditor.line(lineNumber+i))){shiftOffset=i;break;}}}
465 var newLineNumber=Math.max(0,lineNumber+shiftOffset);if(oldRange.startLine<lineN umber&&lineNumber<oldRange.endLine)
466 newLineNumber=oldRange.startLine;return newLineNumber;},_onMouseDownAndClick:fun ction(isMouseDown,event)
467 {var markup=this._stepIntoMarkup;if(!markup)
468 return;var index=markup.findItemByCoordinates(event.x,event.y);if(typeof index== ="undefined")
469 return;if(isMouseDown){event.consume();}else{var rawLocation=markup.getRawPositi on(index);this._scriptsPanel.doStepIntoSelection(rawLocation);}},_shouldIgnoreEx ternalBreakpointEvents:function()
470 {if(this._supportsEnabledBreakpointsWhileEditing()) 463 {if(this._supportsEnabledBreakpointsWhileEditing())
471 return false;if(this._muted) 464 return false;if(this._muted)
472 return true;return this._scriptFile&&(this._scriptFile.isDivergingFromVM()||this ._scriptFile.isMergingToVM());},_breakpointAdded:function(event) 465 return true;return this._scriptFile&&(this._scriptFile.isDivergingFromVM()||this ._scriptFile.isMergingToVM());},_breakpointAdded:function(event)
473 {var uiLocation=(event.data.uiLocation);if(uiLocation.uiSourceCode!==this._uiSou rceCode) 466 {var uiLocation=(event.data.uiLocation);if(uiLocation.uiSourceCode!==this._uiSou rceCode)
474 return;if(this._shouldIgnoreExternalBreakpointEvents()) 467 return;if(this._shouldIgnoreExternalBreakpointEvents())
475 return;var breakpoint=(event.data.breakpoint);if(this.loaded) 468 return;var breakpoint=(event.data.breakpoint);if(this.loaded)
476 this._addBreakpointDecoration(uiLocation.lineNumber,breakpoint.condition(),break point.enabled(),false);},_breakpointRemoved:function(event) 469 this._addBreakpointDecoration(uiLocation.lineNumber,uiLocation.columnNumber,brea kpoint.condition(),breakpoint.enabled(),false);},_breakpointRemoved:function(eve nt)
477 {var uiLocation=(event.data.uiLocation);if(uiLocation.uiSourceCode!==this._uiSou rceCode) 470 {var uiLocation=(event.data.uiLocation);if(uiLocation.uiSourceCode!==this._uiSou rceCode)
478 return;if(this._shouldIgnoreExternalBreakpointEvents()) 471 return;if(this._shouldIgnoreExternalBreakpointEvents())
479 return;var breakpoint=(event.data.breakpoint);var remainingBreakpoint=this._brea kpointManager.findBreakpoint(this._uiSourceCode,uiLocation.lineNumber);if(!remai ningBreakpoint&&this.loaded) 472 return;var breakpoint=(event.data.breakpoint);var remainingBreakpoint=this._brea kpointManager.findBreakpointOnLine(this._uiSourceCode,uiLocation.lineNumber);if( !remainingBreakpoint&&this.loaded)
480 this._removeBreakpointDecoration(uiLocation.lineNumber);},_consoleMessageAdded:f unction(event) 473 this._removeBreakpointDecoration(uiLocation.lineNumber);},_consoleMessageAdded:f unction(event)
481 {var message=(event.data);if(this.loaded) 474 {var message=(event.data);if(this.loaded)
482 this.addMessageToSource(message.lineNumber,message.originalMessage);},_consoleMe ssageRemoved:function(event) 475 this.addMessageToSource(message.lineNumber,message.originalMessage);},_consoleMe ssageRemoved:function(event)
483 {var message=(event.data);if(this.loaded) 476 {var message=(event.data);if(this.loaded)
484 this.removeMessageFromSource(message.lineNumber,message.originalMessage);},_cons oleMessagesCleared:function(event) 477 this.removeMessageFromSource(message.lineNumber,message.originalMessage);},_cons oleMessagesCleared:function(event)
485 {this.clearMessages();},_onSourceMappingChanged:function(event) 478 {this.clearMessages();},_onSourceMappingChanged:function(event)
486 {this._updateScriptFile();},_updateScriptFile:function() 479 {this._updateScriptFile();},_updateScriptFile:function()
487 {if(this._scriptFile){this._scriptFile.removeEventListener(WebInspector.ScriptFi le.Events.DidMergeToVM,this._didMergeToVM,this);this._scriptFile.removeEventList ener(WebInspector.ScriptFile.Events.DidDivergeFromVM,this._didDivergeFromVM,this );if(this._muted&&!this._uiSourceCode.isDirty()) 480 {if(this._scriptFile){this._scriptFile.removeEventListener(WebInspector.ScriptFi le.Events.DidMergeToVM,this._didMergeToVM,this);this._scriptFile.removeEventList ener(WebInspector.ScriptFile.Events.DidDivergeFromVM,this._didDivergeFromVM,this );if(this._muted&&!this._uiSourceCode.isDirty())
488 this._restoreBreakpointsAfterEditing();} 481 this._restoreBreakpointsAfterEditing();}
489 this._scriptFile=this._uiSourceCode.scriptFile();if(this._scriptFile){this._scri ptFile.addEventListener(WebInspector.ScriptFile.Events.DidMergeToVM,this._didMer geToVM,this);this._scriptFile.addEventListener(WebInspector.ScriptFile.Events.Di dDivergeFromVM,this._didDivergeFromVM,this);if(this.loaded) 482 this._scriptFile=this._uiSourceCode.scriptFile();if(this._scriptFile){this._scri ptFile.addEventListener(WebInspector.ScriptFile.Events.DidMergeToVM,this._didMer geToVM,this);this._scriptFile.addEventListener(WebInspector.ScriptFile.Events.Di dDivergeFromVM,this._didDivergeFromVM,this);if(this.loaded)
490 this._scriptFile.checkMapping();}},beforeFormattedChange:function() 483 this._scriptFile.checkMapping();}},onTextEditorContentLoaded:function()
491 {this.clearExecutionLine();},onTextEditorContentLoaded:function()
492 {if(typeof this._executionLineNumber==="number") 484 {if(typeof this._executionLineNumber==="number")
493 this.setExecutionLine(this._executionLineNumber,this._executionCallFrame);var br eakpointLocations=this._breakpointManager.breakpointLocationsForUISourceCode(thi s._uiSourceCode);for(var i=0;i<breakpointLocations.length;++i) 485 this.setExecutionLine(this._executionLineNumber);var breakpointLocations=this._b reakpointManager.breakpointLocationsForUISourceCode(this._uiSourceCode);for(var i=0;i<breakpointLocations.length;++i)
494 this._breakpointAdded({data:breakpointLocations[i]});var messages=this._uiSource Code.consoleMessages();for(var i=0;i<messages.length;++i){var message=messages[i ];this.addMessageToSource(message.lineNumber,message.originalMessage);} 486 this._breakpointAdded({data:breakpointLocations[i]});var messages=this._uiSource Code.consoleMessages();for(var i=0;i<messages.length;++i){var message=messages[i ];this.addMessageToSource(message.lineNumber,message.originalMessage);}
495 if(this._scriptFile) 487 if(this._scriptFile)
496 this._scriptFile.checkMapping();},_handleGutterClick:function(event) 488 this._scriptFile.checkMapping();},_handleGutterClick:function(event)
497 {if(this._muted) 489 {if(this._muted)
498 return;var eventData=(event.data);var lineNumber=eventData.lineNumber;var eventO bject=(eventData.event);if(eventObject.button!=0||eventObject.altKey||eventObjec t.ctrlKey||eventObject.metaKey) 490 return;var eventData=(event.data);var lineNumber=eventData.lineNumber;var eventO bject=(eventData.event);if(eventObject.button!=0||eventObject.altKey||eventObjec t.ctrlKey||eventObject.metaKey)
499 return;this._toggleBreakpoint(lineNumber,eventObject.shiftKey);eventObject.consu me(true);},_toggleBreakpoint:function(lineNumber,onlyDisable) 491 return;this._toggleBreakpoint(lineNumber,eventObject.shiftKey);eventObject.consu me(true);},_toggleBreakpoint:function(lineNumber,onlyDisable)
500 {var breakpoint=this._breakpointManager.findBreakpoint(this._uiSourceCode,lineNu mber);if(breakpoint){if(onlyDisable) 492 {var breakpoint=this._breakpointManager.findBreakpointOnLine(this._uiSourceCode, lineNumber);if(breakpoint){if(onlyDisable)
501 breakpoint.setEnabled(!breakpoint.enabled());else 493 breakpoint.setEnabled(!breakpoint.enabled());else
502 breakpoint.remove();}else 494 breakpoint.remove();}else
503 this._setBreakpoint(lineNumber,"",true);},toggleBreakpointOnCurrentLine:function () 495 this._setBreakpoint(lineNumber,0,"",true);},toggleBreakpointOnCurrentLine:functi on()
504 {if(this._muted) 496 {if(this._muted)
505 return;var selection=this.textEditor.selection();if(!selection) 497 return;var selection=this.textEditor.selection();if(!selection)
506 return;this._toggleBreakpoint(selection.startLine,false);},_setBreakpoint:functi on(lineNumber,condition,enabled) 498 return;this._toggleBreakpoint(selection.startLine,false);},_setBreakpoint:functi on(lineNumber,columnNumber,condition,enabled)
507 {this._breakpointManager.setBreakpoint(this._uiSourceCode,lineNumber,condition,e nabled);WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMet rics.UserAction,{action:WebInspector.UserMetrics.UserActionNames.SetBreakpoint,u rl:this._uiSourceCode.originURL(),line:lineNumber,enabled:enabled});},_continueT oLine:function(lineNumber) 499 {this._breakpointManager.setBreakpoint(this._uiSourceCode,lineNumber,columnNumbe r,condition,enabled);WebInspector.notifications.dispatchEventToListeners(WebInsp ector.UserMetrics.UserAction,{action:WebInspector.UserMetrics.UserActionNames.Se tBreakpoint,url:this._uiSourceCode.originURL(),line:lineNumber,enabled:enabled}) ;},_continueToLine:function(lineNumber)
508 {var rawLocation=(this._uiSourceCode.uiLocationToRawLocation(lineNumber,0));this ._scriptsPanel.continueToLocation(rawLocation);},stepIntoMarkup:function() 500 {var rawLocation=(this._uiSourceCode.uiLocationToRawLocation(lineNumber,0));this ._scriptsPanel.continueToLocation(rawLocation);},dispose:function()
509 {return this._stepIntoMarkup;},dispose:function() 501 {this._breakpointManager.removeEventListener(WebInspector.BreakpointManager.Even ts.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.removeEve ntListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._breakpo intRemoved,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCod e.Events.ConsoleMessageAdded,this._consoleMessageAdded,this);this._uiSourceCode. removeEventListener(WebInspector.UISourceCode.Events.ConsoleMessageRemoved,this. _consoleMessageRemoved,this);this._uiSourceCode.removeEventListener(WebInspector .UISourceCode.Events.ConsoleMessagesCleared,this._consoleMessagesCleared,this);t his._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.SourceMap pingChanged,this._onSourceMappingChanged,this);this._uiSourceCode.removeEventLis tener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChang ed,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted,this._workingCopyCommitted,this);WebInspector.UISourceCode Frame.prototype.dispose.call(this);},__proto__:WebInspector.UISourceCodeFrame.pr ototype};WebInspector.CSSSourceFrame=function(uiSourceCode)
510 {this._breakpointManager.removeEventListener(WebInspector.BreakpointManager.Even ts.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.removeEve ntListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._breakpo intRemoved,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCod e.Events.ConsoleMessageAdded,this._consoleMessageAdded,this);this._uiSourceCode. removeEventListener(WebInspector.UISourceCode.Events.ConsoleMessageRemoved,this. _consoleMessageRemoved,this);this._uiSourceCode.removeEventListener(WebInspector .UISourceCode.Events.ConsoleMessagesCleared,this._consoleMessagesCleared,this);t his._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.SourceMap pingChanged,this._onSourceMappingChanged,this);this._uiSourceCode.removeEventLis tener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChang ed,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted,this._workingCopyCommitted,this);WebInspector.UISourceCode Frame.prototype.dispose.call(this);},__proto__:WebInspector.UISourceCodeFrame.pr ototype}
511 WebInspector.JavaScriptSourceFrame.StepIntoMarkup=function(rawPositions,editorRa nges,firstToExecute,sourceFrame)
512 {this._positions=rawPositions;this._editorRanges=editorRanges;this._highlightDes criptors=new Array(rawPositions.length);this._currentHighlight=undefined;this._f irstToExecute=firstToExecute;this._currentSelection=undefined;this._sourceFrame= sourceFrame;};WebInspector.JavaScriptSourceFrame.StepIntoMarkup.prototype={show: function()
513 {var highlight=this._getVisibleHighlight();for(var i=0;i<this._positions.length; ++i)
514 this._highlightItem(i,i===highlight);this._shownVisibleHighlight=highlight;},sta rtIteratingSelection:function()
515 {this._currentSelection=this._positions.length
516 this._redrawHighlight();},stopIteratingSelection:function()
517 {this._currentSelection=undefined;this._redrawHighlight();},iterateSelection:fun ction(backward)
518 {if(typeof this._currentSelection==="undefined")
519 return;var nextSelection=backward?this._currentSelection-1:this._currentSelectio n+1;var modulo=this._positions.length+1;nextSelection=(nextSelection+modulo)%mod ulo;this._currentSelection=nextSelection;this._redrawHighlight();},_redrawHighli ght:function()
520 {var visibleHighlight=this._getVisibleHighlight();if(this._shownVisibleHighlight ===visibleHighlight)
521 return;this._hideItemHighlight(this._shownVisibleHighlight);this._hideItemHighli ght(visibleHighlight);this._highlightItem(this._shownVisibleHighlight,false);thi s._highlightItem(visibleHighlight,true);this._shownVisibleHighlight=visibleHighl ight;},_getVisibleHighlight:function()
522 {return typeof this._currentSelection==="undefined"?this._firstToExecute:this._c urrentSelection;},_highlightItem:function(position,selected)
523 {if(position===this._positions.length)
524 return;var styleName=selected?"source-frame-stepin-mark-highlighted":"source-fra me-stepin-mark";var textEditor=this._sourceFrame.textEditor;var highlightDescrip tor=textEditor.highlightRange(this._editorRanges[position],styleName);this._high lightDescriptors[position]=highlightDescriptor;},_hideItemHighlight:function(pos ition)
525 {if(position===this._positions.length)
526 return;var highlightDescriptor=this._highlightDescriptors[position];console.asse rt(highlightDescriptor);var textEditor=this._sourceFrame.textEditor;textEditor.r emoveHighlight(highlightDescriptor);this._highlightDescriptors[position]=undefin ed;},dispose:function()
527 {for(var i=0;i<this._positions.length;++i)
528 this._hideItemHighlight(i);},findItemByCoordinates:function(x,y)
529 {var textPosition=this._sourceFrame.textEditor.coordinatesToCursorPosition(x,y); if(!textPosition)
530 return;var ranges=this._editorRanges;for(var i=0;i<ranges.length;++i){var nextRa nge=ranges[i];if(nextRange.startLine==textPosition.startLine&&nextRange.startCol umn<=textPosition.startColumn&&nextRange.endColumn>=textPosition.startColumn)
531 return i;}},getSelectedItemIndex:function()
532 {if(this._currentSelection===this._positions.length)
533 return undefined;return this._currentSelection;},getRawPosition:function(positio n)
534 {return(this._positions[position]);}};WebInspector.JavaScriptSourceFrame.StepInt oMarkup.create=function(sourceFrame,stepIntoRawLocations)
535 {if(!stepIntoRawLocations.length)
536 return null;var firstToExecute=stepIntoRawLocations[0];stepIntoRawLocations.sort (WebInspector.JavaScriptSourceFrame.StepIntoMarkup._Comparator);var firstToExecu teIndex=stepIntoRawLocations.indexOf(firstToExecute);var textEditor=sourceFrame. textEditor;var uiRanges=[];for(var i=0;i<stepIntoRawLocations.length;++i){var ui Location=WebInspector.debuggerModel.rawLocationToUILocation((stepIntoRawLocation s[i]));var token=textEditor.tokenAtTextPosition(uiLocation.lineNumber,uiLocation .columnNumber);var startColumn;var endColumn;if(token){startColumn=token.startCo lumn;endColumn=token.endColumn;}else{startColumn=uiLocation.columnNumber;endColu mn=uiLocation.columnNumber;}
537 var range=new WebInspector.TextRange(uiLocation.lineNumber,startColumn,uiLocatio n.lineNumber,endColumn);uiRanges.push(range);}
538 return new WebInspector.JavaScriptSourceFrame.StepIntoMarkup(stepIntoRawLocation s,uiRanges,firstToExecuteIndex,sourceFrame);};WebInspector.JavaScriptSourceFrame .StepIntoMarkup._Comparator=function(locationA,locationB)
539 {if(locationA.lineNumber===locationB.lineNumber)
540 return locationA.columnNumber-locationB.columnNumber;else
541 return locationA.lineNumber-locationB.lineNumber;};;WebInspector.CSSSourceFrame= function(uiSourceCode)
542 {WebInspector.UISourceCodeFrame.call(this,uiSourceCode);this._registerShortcuts( );} 502 {WebInspector.UISourceCodeFrame.call(this,uiSourceCode);this._registerShortcuts( );}
543 WebInspector.CSSSourceFrame.prototype={_registerShortcuts:function() 503 WebInspector.CSSSourceFrame.prototype={_registerShortcuts:function()
544 {var shortcutKeys=WebInspector.ShortcutsScreen.SourcesPanelShortcuts;for(var i=0 ;i<shortcutKeys.IncreaseCSSUnitByOne.length;++i) 504 {var shortcutKeys=WebInspector.ShortcutsScreen.SourcesPanelShortcuts;for(var i=0 ;i<shortcutKeys.IncreaseCSSUnitByOne.length;++i)
545 this.addShortcut(shortcutKeys.IncreaseCSSUnitByOne[i].key,this._handleUnitModifi cation.bind(this,1));for(var i=0;i<shortcutKeys.DecreaseCSSUnitByOne.length;++i) 505 this.addShortcut(shortcutKeys.IncreaseCSSUnitByOne[i].key,this._handleUnitModifi cation.bind(this,1));for(var i=0;i<shortcutKeys.DecreaseCSSUnitByOne.length;++i)
546 this.addShortcut(shortcutKeys.DecreaseCSSUnitByOne[i].key,this._handleUnitModifi cation.bind(this,-1));for(var i=0;i<shortcutKeys.IncreaseCSSUnitByTen.length;++i ) 506 this.addShortcut(shortcutKeys.DecreaseCSSUnitByOne[i].key,this._handleUnitModifi cation.bind(this,-1));for(var i=0;i<shortcutKeys.IncreaseCSSUnitByTen.length;++i )
547 this.addShortcut(shortcutKeys.IncreaseCSSUnitByTen[i].key,this._handleUnitModifi cation.bind(this,10));for(var i=0;i<shortcutKeys.DecreaseCSSUnitByTen.length;++i ) 507 this.addShortcut(shortcutKeys.IncreaseCSSUnitByTen[i].key,this._handleUnitModifi cation.bind(this,10));for(var i=0;i<shortcutKeys.DecreaseCSSUnitByTen.length;++i )
548 this.addShortcut(shortcutKeys.DecreaseCSSUnitByTen[i].key,this._handleUnitModifi cation.bind(this,-10));},_modifyUnit:function(unit,change) 508 this.addShortcut(shortcutKeys.DecreaseCSSUnitByTen[i].key,this._handleUnitModifi cation.bind(this,-10));},_modifyUnit:function(unit,change)
549 {var unitValue=parseInt(unit,10);if(isNaN(unitValue)) 509 {var unitValue=parseInt(unit,10);if(isNaN(unitValue))
550 return null;var tail=unit.substring((unitValue).toString().length);return String .sprintf("%d%s",unitValue+change,tail);},_handleUnitModification:function(change ) 510 return null;var tail=unit.substring((unitValue).toString().length);return String .sprintf("%d%s",unitValue+change,tail);},_handleUnitModification:function(change )
551 {var selection=this.textEditor.selection().normalize();var token=this.textEditor .tokenAtTextPosition(selection.startLine,selection.startColumn);if(!token){if(se lection.startColumn>0) 511 {var selection=this.textEditor.selection().normalize();var token=this.textEditor .tokenAtTextPosition(selection.startLine,selection.startColumn);if(!token){if(se lection.startColumn>0)
552 token=this.textEditor.tokenAtTextPosition(selection.startLine,selection.startCol umn-1);if(!token) 512 token=this.textEditor.tokenAtTextPosition(selection.startLine,selection.startCol umn-1);if(!token)
553 return false;} 513 return false;}
554 if(token.type!=="css-number") 514 if(token.type!=="css-number")
555 return false;var cssUnitRange=new WebInspector.TextRange(selection.startLine,tok en.startColumn,selection.startLine,token.endColumn+1);var cssUnitText=this.textE ditor.copyRange(cssUnitRange);var newUnitText=this._modifyUnit(cssUnitText,chang e);if(!newUnitText) 515 return false;var cssUnitRange=new WebInspector.TextRange(selection.startLine,tok en.startColumn,selection.startLine,token.endColumn+1);var cssUnitText=this.textE ditor.copyRange(cssUnitRange);var newUnitText=this._modifyUnit(cssUnitText,chang e);if(!newUnitText)
556 return false;this.textEditor.editRange(cssUnitRange,newUnitText);selection.start Column=token.startColumn;selection.endColumn=selection.startColumn+newUnitText.l ength;this.textEditor.setSelection(selection);return true;},__proto__:WebInspect or.UISourceCodeFrame.prototype};WebInspector.NavigatorOverlayController=function (parentSidebarView,navigatorView,editorView) 516 return false;this.textEditor.editRange(cssUnitRange,newUnitText);selection.start Column=token.startColumn;selection.endColumn=selection.startColumn+newUnitText.l ength;this.textEditor.setSelection(selection);return true;},__proto__:WebInspect or.UISourceCodeFrame.prototype};WebInspector.NavigatorView=function()
557 {this._parentSidebarView=parentSidebarView;this._navigatorView=navigatorView;thi s._editorView=editorView;this._navigatorSidebarResizeWidgetElement=this._navigat orView.element.createChild("div","resizer-widget");this._parentSidebarView.insta llResizer(this._navigatorSidebarResizeWidgetElement);this._navigatorShowHideButt on=new WebInspector.StatusBarButton(WebInspector.UIString("Hide navigator"),"lef t-sidebar-show-hide-button scripts-navigator-show-hide-button",3);this._navigato rShowHideButton.state="left";this._navigatorShowHideButton.addEventListener("cli ck",this._toggleNavigator,this);parentSidebarView.mainElement().appendChild(this ._navigatorShowHideButton.element);WebInspector.settings.navigatorHidden=WebInsp ector.settings.createSetting("navigatorHidden",true);if(WebInspector.settings.na vigatorHidden.get()) 517 {WebInspector.VBox.call(this);this.registerRequiredCSS("navigatorView.css");var scriptsTreeElement=document.createElement("ol");this._scriptsTree=new WebInspect or.NavigatorTreeOutline(scriptsTreeElement);var scriptsOutlineElement=document.c reateElement("div");scriptsOutlineElement.classList.add("outline-disclosure");sc riptsOutlineElement.classList.add("navigator");scriptsOutlineElement.appendChild (scriptsTreeElement);this.element.classList.add("navigator-container");this.elem ent.appendChild(scriptsOutlineElement);this.setDefaultFocusedElement(this._scrip tsTree.element);this._uiSourceCodeNodes=new Map();this._subfolderNodes=new Map() ;this._rootNode=new WebInspector.NavigatorRootTreeNode(this);this._rootNode.popu late();this.element.addEventListener("contextmenu",this.handleContextMenu.bind(t his),false);}
558 this._toggleNavigator();} 518 WebInspector.NavigatorView.Events={ItemSelected:"ItemSelected",ItemRenamed:"Item Renamed",}
559 WebInspector.NavigatorOverlayController.prototype={wasShown:function()
560 {window.setTimeout(this._maybeShowNavigatorOverlay.bind(this),0);},_maybeShowNav igatorOverlay:function()
561 {if(WebInspector.settings.navigatorHidden.get()&&!WebInspector.settings.navigato rWasOnceHidden.get())
562 this.showNavigatorOverlay();},_toggleNavigator:function()
563 {if(this._navigatorShowHideButton.state==="overlay")
564 this._pinNavigator();else if(this._navigatorShowHideButton.state==="right")
565 this.showNavigatorOverlay();else
566 this._hidePinnedNavigator();},_hidePinnedNavigator:function()
567 {this._navigatorShowHideButton.state="right";this._navigatorShowHideButton.title =WebInspector.UIString("Show navigator");this._parentSidebarView.element.appendC hild(this._navigatorShowHideButton.element);this._editorView.element.classList.a dd("navigator-hidden");this._navigatorSidebarResizeWidgetElement.classList.add(" hidden");this._parentSidebarView.hideSidebarElement();this._navigatorView.detach ();this._editorView.focus();WebInspector.settings.navigatorWasOnceHidden.set(tru e);WebInspector.settings.navigatorHidden.set(true);},_pinNavigator:function()
568 {this._navigatorShowHideButton.state="left";this._navigatorShowHideButton.title= WebInspector.UIString("Hide navigator");this._editorView.element.classList.remov e("navigator-hidden");this._navigatorSidebarResizeWidgetElement.classList.remove ("hidden");this._editorView.element.appendChild(this._navigatorShowHideButton.el ement);this._innerHideNavigatorOverlay();this._parentSidebarView.showSidebarElem ent();this._parentSidebarView.setSidebarView(this._navigatorView);this._navigato rView.focus();WebInspector.settings.navigatorHidden.set(false);},showNavigatorOv erlay:function()
569 {if(this._navigatorShowHideButton.state==="overlay")
570 return;this._navigatorShowHideButton.state="overlay";this._navigatorShowHideButt on.title=WebInspector.UIString("Pin navigator");this._sidebarOverlay=new WebInsp ector.SidebarOverlay(this._navigatorView,"scriptsPanelNavigatorOverlayWidth",Pre ferences.minScriptsSidebarWidth);this._boundKeyDown=this._keyDown.bind(this);thi s._sidebarOverlay.element.addEventListener("keydown",this._boundKeyDown,false);v ar navigatorOverlayResizeWidgetElement=document.createElement("div");navigatorOv erlayResizeWidgetElement.classList.add("resizer-widget");this._sidebarOverlay.re sizerWidgetElement=navigatorOverlayResizeWidgetElement;this._navigatorView.eleme nt.appendChild(this._navigatorShowHideButton.element);this._boundContainingEleme ntFocused=this._containingElementFocused.bind(this);this._parentSidebarView.elem ent.addEventListener("mousedown",this._boundContainingElementFocused,false);this ._sidebarOverlay.show(this._parentSidebarView.element);this._navigatorView.focus ();},_keyDown:function(event)
571 {if(event.handled)
572 return;if(event.keyCode===WebInspector.KeyboardShortcut.Keys.Esc.code){this.hide NavigatorOverlay();event.consume(true);}},hideNavigatorOverlay:function()
573 {if(this._navigatorShowHideButton.state!=="overlay")
574 return;this._navigatorShowHideButton.state="right";this._navigatorShowHideButton .title=WebInspector.UIString("Show navigator");this._parentSidebarView.element.a ppendChild(this._navigatorShowHideButton.element);this._innerHideNavigatorOverla y();this._editorView.focus();},_innerHideNavigatorOverlay:function()
575 {this._parentSidebarView.element.removeEventListener("mousedown",this._boundCont ainingElementFocused,false);this._sidebarOverlay.element.removeEventListener("ke ydown",this._boundKeyDown,false);this._sidebarOverlay.hide();},_containingElemen tFocused:function(event)
576 {if(!event.target.isSelfOrDescendant(this._sidebarOverlay.element))
577 this.hideNavigatorOverlay();},isNavigatorPinned:function()
578 {return this._navigatorShowHideButton.state==="left";},isNavigatorHidden:functio n()
579 {return this._navigatorShowHideButton.state==="right";}};WebInspector.NavigatorV iew=function()
580 {WebInspector.View.call(this);this.registerRequiredCSS("navigatorView.css");var scriptsTreeElement=document.createElement("ol");this._scriptsTree=new WebInspect or.NavigatorTreeOutline(scriptsTreeElement);this._scriptsTree.childrenListElemen t.addEventListener("keypress",this._treeKeyPress.bind(this),true);var scriptsOut lineElement=document.createElement("div");scriptsOutlineElement.classList.add("o utline-disclosure");scriptsOutlineElement.classList.add("navigator");scriptsOutl ineElement.appendChild(scriptsTreeElement);this.element.classList.add("fill");th is.element.classList.add("navigator-container");this.element.appendChild(scripts OutlineElement);this.setDefaultFocusedElement(this._scriptsTree.element);this._u iSourceCodeNodes=new Map();this._subfolderNodes=new Map();this._rootNode=new Web Inspector.NavigatorRootTreeNode(this);this._rootNode.populate();WebInspector.res ourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.Inspec tedURLChanged,this._inspectedURLChanged,this);this.element.addEventListener("con textmenu",this.handleContextMenu.bind(this),false);}
581 WebInspector.NavigatorView.Events={ItemSelected:"ItemSelected",ItemSearchStarted :"ItemSearchStarted",ItemRenamingRequested:"ItemRenamingRequested",ItemCreationR equested:"ItemCreationRequested"}
582 WebInspector.NavigatorView.iconClassForType=function(type) 519 WebInspector.NavigatorView.iconClassForType=function(type)
583 {if(type===WebInspector.NavigatorTreeOutline.Types.Domain) 520 {if(type===WebInspector.NavigatorTreeOutline.Types.Domain)
584 return"navigator-domain-tree-item";if(type===WebInspector.NavigatorTreeOutline.T ypes.FileSystem) 521 return"navigator-domain-tree-item";if(type===WebInspector.NavigatorTreeOutline.T ypes.FileSystem)
585 return"navigator-folder-tree-item";return"navigator-folder-tree-item";} 522 return"navigator-folder-tree-item";return"navigator-folder-tree-item";}
586 WebInspector.NavigatorView.prototype={addUISourceCode:function(uiSourceCode) 523 WebInspector.NavigatorView.prototype={setWorkspace:function(workspace)
587 {var projectNode=this._projectNode(uiSourceCode.project());var folderNode=this._ folderNode(projectNode,uiSourceCode.parentPath());var uiSourceCodeNode=new WebIn spector.NavigatorUISourceCodeTreeNode(this,uiSourceCode);this._uiSourceCodeNodes .put(uiSourceCode,uiSourceCodeNode);folderNode.appendChild(uiSourceCodeNode);if( uiSourceCode.url===WebInspector.inspectedPageURL) 524 {this._workspace=workspace;this._workspace.addEventListener(WebInspector.Workspa ce.Events.UISourceCodeAdded,this._uiSourceCodeAdded,this);this._workspace.addEve ntListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeR emoved,this);this._workspace.addEventListener(WebInspector.Workspace.Events.Proj ectWillReset,this._projectWillReset.bind(this),this);},wasShown:function()
588 this.revealUISourceCode(uiSourceCode);},_inspectedURLChanged:function(event) 525 {if(this._loaded)
589 {var nodes=this._uiSourceCodeNodes.values();for(var i=0;i<nodes.length;++i){var uiSourceCode=nodes[i].uiSourceCode();if(uiSourceCode.url===WebInspector.inspecte dPageURL) 526 return;this._loaded=true;this._workspace.uiSourceCodes().forEach(this._addUISour ceCode.bind(this));},accept:function(uiSourceCode)
590 this.revealUISourceCode(uiSourceCode);}},_projectNode:function(project) 527 {return!uiSourceCode.project().isServiceProject();},_addUISourceCode:function(ui SourceCode)
528 {if(!this.accept(uiSourceCode))
529 return;var projectNode=this._projectNode(uiSourceCode.project());var folderNode= this._folderNode(projectNode,uiSourceCode.parentPath());var uiSourceCodeNode=new WebInspector.NavigatorUISourceCodeTreeNode(this,uiSourceCode);this._uiSourceCod eNodes.put(uiSourceCode,uiSourceCodeNode);folderNode.appendChild(uiSourceCodeNod e);},_uiSourceCodeAdded:function(event)
530 {var uiSourceCode=(event.data);this._addUISourceCode(uiSourceCode);},_uiSourceCo deRemoved:function(event)
531 {var uiSourceCode=(event.data);this._removeUISourceCode(uiSourceCode);},_project WillReset:function(event)
532 {var project=(event.data);var uiSourceCodes=project.uiSourceCodes();for(var i=0; i<uiSourceCodes.length;++i)
533 this._removeUISourceCode(uiSourceCodes[i]);},_projectNode:function(project)
591 {if(!project.displayName()) 534 {if(!project.displayName())
592 return this._rootNode;var projectNode=this._rootNode.child(project.id());if(!pro jectNode){var type=project.type()===WebInspector.projectTypes.FileSystem?WebInsp ector.NavigatorTreeOutline.Types.FileSystem:WebInspector.NavigatorTreeOutline.Ty pes.Domain;projectNode=new WebInspector.NavigatorFolderTreeNode(this,project,pro ject.id(),type,"",project.displayName());this._rootNode.appendChild(projectNode) ;} 535 return this._rootNode;var projectNode=this._rootNode.child(project.id());if(!pro jectNode){var type=project.type()===WebInspector.projectTypes.FileSystem?WebInsp ector.NavigatorTreeOutline.Types.FileSystem:WebInspector.NavigatorTreeOutline.Ty pes.Domain;projectNode=new WebInspector.NavigatorFolderTreeNode(this,project,pro ject.id(),type,"",project.displayName());this._rootNode.appendChild(projectNode) ;}
593 return projectNode;},_folderNode:function(projectNode,folderPath) 536 return projectNode;},_folderNode:function(projectNode,folderPath)
594 {if(!folderPath) 537 {if(!folderPath)
595 return projectNode;var subfolderNodes=this._subfolderNodes.get(projectNode);if(! subfolderNodes){subfolderNodes=(new StringMap());this._subfolderNodes.put(projec tNode,subfolderNodes);} 538 return projectNode;var subfolderNodes=this._subfolderNodes.get(projectNode);if(! subfolderNodes){subfolderNodes=(new StringMap());this._subfolderNodes.put(projec tNode,subfolderNodes);}
596 var folderNode=subfolderNodes.get(folderPath);if(folderNode) 539 var folderNode=subfolderNodes.get(folderPath);if(folderNode)
597 return folderNode;var parentNode=projectNode;var index=folderPath.lastIndexOf("/ ");if(index!==-1) 540 return folderNode;var parentNode=projectNode;var index=folderPath.lastIndexOf("/ ");if(index!==-1)
598 parentNode=this._folderNode(projectNode,folderPath.substring(0,index));var name= folderPath.substring(index+1);folderNode=new WebInspector.NavigatorFolderTreeNod e(this,null,name,WebInspector.NavigatorTreeOutline.Types.Folder,folderPath,name) ;subfolderNodes.put(folderPath,folderNode);parentNode.appendChild(folderNode);re turn folderNode;},revealUISourceCode:function(uiSourceCode,select) 541 parentNode=this._folderNode(projectNode,folderPath.substring(0,index));var name= folderPath.substring(index+1);folderNode=new WebInspector.NavigatorFolderTreeNod e(this,null,name,WebInspector.NavigatorTreeOutline.Types.Folder,folderPath,name) ;subfolderNodes.put(folderPath,folderNode);parentNode.appendChild(folderNode);re turn folderNode;},revealUISourceCode:function(uiSourceCode,select)
599 {var node=this._uiSourceCodeNodes.get(uiSourceCode);if(!node) 542 {var node=this._uiSourceCodeNodes.get(uiSourceCode);if(!node)
600 return;if(this._scriptsTree.selectedTreeElement) 543 return;if(this._scriptsTree.selectedTreeElement)
601 this._scriptsTree.selectedTreeElement.deselect();this._lastSelectedUISourceCode= uiSourceCode;node.reveal(select);},_sourceSelected:function(uiSourceCode,focusSo urce) 544 this._scriptsTree.selectedTreeElement.deselect();this._lastSelectedUISourceCode= uiSourceCode;node.reveal(select);},_sourceSelected:function(uiSourceCode,focusSo urce)
602 {this._lastSelectedUISourceCode=uiSourceCode;var data={uiSourceCode:uiSourceCode ,focusSource:focusSource};this.dispatchEventToListeners(WebInspector.NavigatorVi ew.Events.ItemSelected,data);},sourceDeleted:function(uiSourceCode) 545 {this._lastSelectedUISourceCode=uiSourceCode;var data={uiSourceCode:uiSourceCode ,focusSource:focusSource};this.dispatchEventToListeners(WebInspector.NavigatorVi ew.Events.ItemSelected,data);},sourceDeleted:function(uiSourceCode)
603 {},removeUISourceCode:function(uiSourceCode) 546 {},_removeUISourceCode:function(uiSourceCode)
604 {var node=this._uiSourceCodeNodes.get(uiSourceCode);if(!node) 547 {var node=this._uiSourceCodeNodes.get(uiSourceCode);if(!node)
605 return;var projectNode=this._projectNode(uiSourceCode.project());var subfolderNo des=this._subfolderNodes.get(projectNode);var parentNode=node.parent;this._uiSou rceCodeNodes.remove(uiSourceCode);parentNode.removeChild(node);node=parentNode;w hile(node){parentNode=node.parent;if(!parentNode||!node.isEmpty()) 548 return;var projectNode=this._projectNode(uiSourceCode.project());var subfolderNo des=this._subfolderNodes.get(projectNode);var parentNode=node.parent;this._uiSou rceCodeNodes.remove(uiSourceCode);parentNode.removeChild(node);node=parentNode;w hile(node){parentNode=node.parent;if(!parentNode||!node.isEmpty())
606 break;if(subfolderNodes) 549 break;if(subfolderNodes)
607 subfolderNodes.remove(node._folderPath);parentNode.removeChild(node);node=parent Node;}},updateIcon:function(uiSourceCode) 550 subfolderNodes.remove(node._folderPath);parentNode.removeChild(node);node=parent Node;}},_updateIcon:function(uiSourceCode)
608 {var node=this._uiSourceCodeNodes.get(uiSourceCode);node.updateIcon();},requestR ename:function(uiSourceCode) 551 {var node=this._uiSourceCodeNodes.get(uiSourceCode);node.updateIcon();},reset:fu nction()
609 {this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.ItemRenaming Requested,uiSourceCode);},rename:function(uiSourceCode,callback)
610 {var node=this._uiSourceCodeNodes.get(uiSourceCode);if(!node)
611 return;node.rename(callback);},reset:function()
612 {var nodes=this._uiSourceCodeNodes.values();for(var i=0;i<nodes.length;++i) 552 {var nodes=this._uiSourceCodeNodes.values();for(var i=0;i<nodes.length;++i)
613 nodes[i].dispose();this._scriptsTree.removeChildren();this._uiSourceCodeNodes.cl ear();this._subfolderNodes.clear();this._rootNode.reset();},handleContextMenu:fu nction(event) 553 nodes[i].dispose();this._scriptsTree.removeChildren();this._uiSourceCodeNodes.cl ear();this._subfolderNodes.clear();this._rootNode.reset();},handleContextMenu:fu nction(event)
614 {var contextMenu=new WebInspector.ContextMenu(event);this._appendAddFolderItem(c ontextMenu);contextMenu.show();},_appendAddFolderItem:function(contextMenu) 554 {var contextMenu=new WebInspector.ContextMenu(event);this._appendAddFolderItem(c ontextMenu);contextMenu.show();},_appendAddFolderItem:function(contextMenu)
615 {function addFolder() 555 {function addFolder()
616 {WebInspector.isolatedFileSystemManager.addFileSystem();} 556 {WebInspector.isolatedFileSystemManager.addFileSystem();}
617 var addFolderLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?" Add folder to workspace":"Add Folder to Workspace");contextMenu.appendItem(addFo lderLabel,addFolder);},_handleContextMenuRefresh:function(project,path) 557 var addFolderLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?" Add folder to workspace":"Add Folder to Workspace");contextMenu.appendItem(addFo lderLabel,addFolder);},_handleContextMenuRefresh:function(project,path)
618 {project.refresh(path);},_handleContextMenuCreate:function(project,path,uiSource Code) 558 {project.refresh(path);},_handleContextMenuCreate:function(project,path,uiSource Code)
619 {var data={};data.project=project;data.path=path;data.uiSourceCode=uiSourceCode; this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemCreationRequ ested,data);},_handleContextMenuExclude:function(project,path) 559 {this.create(project,path,uiSourceCode);},_handleContextMenuExclude:function(pro ject,path)
620 {var shouldExclude=window.confirm(WebInspector.UIString("Are you sure you want t o exclude this folder?"));if(shouldExclude){WebInspector.startBatchUpdate();proj ect.excludeFolder(path);WebInspector.endBatchUpdate();}},_handleContextMenuDelet e:function(uiSourceCode) 560 {var shouldExclude=window.confirm(WebInspector.UIString("Are you sure you want t o exclude this folder?"));if(shouldExclude){WebInspector.startBatchUpdate();proj ect.excludeFolder(path);WebInspector.endBatchUpdate();}},_handleContextMenuDelet e:function(uiSourceCode)
621 {var shouldDelete=window.confirm(WebInspector.UIString("Are you sure you want to delete this file?"));if(shouldDelete) 561 {var shouldDelete=window.confirm(WebInspector.UIString("Are you sure you want to delete this file?"));if(shouldDelete)
622 uiSourceCode.project().deleteFile(uiSourceCode.path());},handleFileContextMenu:f unction(event,uiSourceCode) 562 uiSourceCode.project().deleteFile(uiSourceCode.path());},handleFileContextMenu:f unction(event,uiSourceCode)
623 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendApplicabl eItems(uiSourceCode);contextMenu.appendSeparator();var project=uiSourceCode.proj ect();var path=uiSourceCode.parentPath();contextMenu.appendItem(WebInspector.UIS tring(WebInspector.useLowerCaseMenuTitles()?"Refresh parent":"Refresh Parent"),t his._handleContextMenuRefresh.bind(this,project,path));contextMenu.appendItem(We bInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Duplicate file":"Dupl icate File"),this._handleContextMenuCreate.bind(this,project,path,uiSourceCode)) ;contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitle s()?"Exclude parent folder":"Exclude Parent Folder"),this._handleContextMenuExcl ude.bind(this,project,path));contextMenu.appendItem(WebInspector.UIString(WebIns pector.useLowerCaseMenuTitles()?"Delete file":"Delete File"),this._handleContext MenuDelete.bind(this,uiSourceCode));contextMenu.appendSeparator();this._appendAd dFolderItem(contextMenu);contextMenu.show();},handleFolderContextMenu:function(e vent,node) 563 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendApplicabl eItems(uiSourceCode);contextMenu.appendSeparator();var project=uiSourceCode.proj ect();var path=uiSourceCode.parentPath();contextMenu.appendItem(WebInspector.UIS tring(WebInspector.useLowerCaseMenuTitles()?"Refresh parent":"Refresh Parent"),t his._handleContextMenuRefresh.bind(this,project,path));contextMenu.appendItem(We bInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Duplicate file":"Dupl icate File"),this._handleContextMenuCreate.bind(this,project,path,uiSourceCode)) ;contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitle s()?"Exclude parent folder":"Exclude Parent Folder"),this._handleContextMenuExcl ude.bind(this,project,path));contextMenu.appendItem(WebInspector.UIString(WebIns pector.useLowerCaseMenuTitles()?"Delete file":"Delete File"),this._handleContext MenuDelete.bind(this,uiSourceCode));contextMenu.appendSeparator();this._appendAd dFolderItem(contextMenu);contextMenu.show();},handleFolderContextMenu:function(e vent,node)
624 {var contextMenu=new WebInspector.ContextMenu(event);var path="/";var projectNod e=node;while(projectNode.parent!==this._rootNode){path="/"+projectNode.id+path;p rojectNode=projectNode.parent;} 564 {var contextMenu=new WebInspector.ContextMenu(event);var path="/";var projectNod e=node;while(projectNode.parent!==this._rootNode){path="/"+projectNode.id+path;p rojectNode=projectNode.parent;}
625 var project=projectNode._project;if(project.type()===WebInspector.projectTypes.F ileSystem){contextMenu.appendItem(WebInspector.UIString("Refresh"),this._handleC ontextMenuRefresh.bind(this,project,path));contextMenu.appendItem(WebInspector.U IString(WebInspector.useLowerCaseMenuTitles()?"New file":"New File"),this._handl eContextMenuCreate.bind(this,project,path));contextMenu.appendItem(WebInspector. UIString(WebInspector.useLowerCaseMenuTitles()?"Exclude folder":"Exclude Folder" ),this._handleContextMenuExclude.bind(this,project,path));} 565 var project=projectNode._project;if(project.type()===WebInspector.projectTypes.F ileSystem){contextMenu.appendItem(WebInspector.UIString("Refresh"),this._handleC ontextMenuRefresh.bind(this,project,path));contextMenu.appendItem(WebInspector.U IString(WebInspector.useLowerCaseMenuTitles()?"New file":"New File"),this._handl eContextMenuCreate.bind(this,project,path));contextMenu.appendItem(WebInspector. UIString(WebInspector.useLowerCaseMenuTitles()?"Exclude folder":"Exclude Folder" ),this._handleContextMenuExclude.bind(this,project,path));}
626 contextMenu.appendSeparator();this._appendAddFolderItem(contextMenu);function re moveFolder() 566 contextMenu.appendSeparator();this._appendAddFolderItem(contextMenu);function re moveFolder()
627 {var shouldRemove=window.confirm(WebInspector.UIString("Are you sure you want to remove this folder?"));if(shouldRemove) 567 {var shouldRemove=window.confirm(WebInspector.UIString("Are you sure you want to remove this folder?"));if(shouldRemove)
628 project.remove();} 568 project.remove();}
629 if(project.type()===WebInspector.projectTypes.FileSystem&&node===projectNode){va r removeFolderLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()? "Remove folder from workspace":"Remove Folder from Workspace");contextMenu.appen dItem(removeFolderLabel,removeFolder);} 569 if(project.type()===WebInspector.projectTypes.FileSystem&&node===projectNode){va r removeFolderLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()? "Remove folder from workspace":"Remove Folder from Workspace");contextMenu.appen dItem(removeFolderLabel,removeFolder);}
630 contextMenu.show();},_treeKeyPress:function(event) 570 contextMenu.show();},rename:function(uiSourceCode,deleteIfCanceled)
631 {if(WebInspector.isBeingEdited(this._scriptsTree.childrenListElement)) 571 {var node=this._uiSourceCodeNodes.get(uiSourceCode);console.assert(node);node.re name(callback.bind(this));function callback(committed)
632 return;var searchText=String.fromCharCode(event.charCode);if(searchText.trim()!= =searchText) 572 {if(!committed){if(deleteIfCanceled)
633 return;this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemSearc hStarted,searchText);event.consume(true);},__proto__:WebInspector.View.prototype } 573 uiSourceCode.remove();return;}
574 var data={uiSourceCode:uiSourceCode};this.dispatchEventToListeners(WebInspector. NavigatorView.Events.ItemRenamed,data);this._updateIcon(uiSourceCode);this._sour ceSelected(uiSourceCode,true)}},create:function(project,path,uiSourceCodeToCopy)
575 {var filePath;var uiSourceCode;function contentLoaded(content)
576 {createFile.call(this,content||"");}
577 if(uiSourceCodeToCopy)
578 uiSourceCodeToCopy.requestContent(contentLoaded.bind(this));else
579 createFile.call(this);function createFile(content)
580 {project.createFile(path,null,content||"",fileCreated.bind(this));}
581 function fileCreated(path)
582 {if(!path)
583 return;filePath=path;uiSourceCode=project.uiSourceCode(filePath);if(!uiSourceCod e){console.assert(uiSourceCode)
584 return;}
585 this._sourceSelected(uiSourceCode,false);this.rename(uiSourceCode,true);}},__pro to__:WebInspector.VBox.prototype}
586 WebInspector.SourcesNavigatorView=function()
587 {WebInspector.NavigatorView.call(this);WebInspector.resourceTreeModel.addEventLi stener(WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged,this._inspe ctedURLChanged,this);}
588 WebInspector.SourcesNavigatorView.prototype={accept:function(uiSourceCode)
589 {if(!WebInspector.NavigatorView.prototype.accept(uiSourceCode))
590 return false;return!uiSourceCode.isContentScript&&uiSourceCode.project().type()! ==WebInspector.projectTypes.Snippets;},_inspectedURLChanged:function(event)
591 {var nodes=this._uiSourceCodeNodes.values();for(var i=0;i<nodes.length;++i){var uiSourceCode=nodes[i].uiSourceCode();if(uiSourceCode.url===WebInspector.resource TreeModel.inspectedPageURL())
592 this.revealUISourceCode(uiSourceCode,true);}},_addUISourceCode:function(uiSource Code)
593 {WebInspector.NavigatorView.prototype._addUISourceCode.call(this,uiSourceCode);i f(uiSourceCode.url===WebInspector.resourceTreeModel.inspectedPageURL())
594 this.revealUISourceCode(uiSourceCode,true);},__proto__:WebInspector.NavigatorVie w.prototype}
595 WebInspector.ContentScriptsNavigatorView=function()
596 {WebInspector.NavigatorView.call(this);}
597 WebInspector.ContentScriptsNavigatorView.prototype={accept:function(uiSourceCode )
598 {if(!WebInspector.NavigatorView.prototype.accept(uiSourceCode))
599 return false;return uiSourceCode.isContentScript;},__proto__:WebInspector.Naviga torView.prototype}
634 WebInspector.NavigatorTreeOutline=function(element) 600 WebInspector.NavigatorTreeOutline=function(element)
635 {TreeOutline.call(this,element);this.element=element;this.comparator=WebInspecto r.NavigatorTreeOutline._treeElementsCompare;} 601 {TreeOutline.call(this,element);this.element=element;this.comparator=WebInspecto r.NavigatorTreeOutline._treeElementsCompare;}
636 WebInspector.NavigatorTreeOutline.Types={Root:"Root",Domain:"Domain",Folder:"Fol der",UISourceCode:"UISourceCode",FileSystem:"FileSystem"} 602 WebInspector.NavigatorTreeOutline.Types={Root:"Root",Domain:"Domain",Folder:"Fol der",UISourceCode:"UISourceCode",FileSystem:"FileSystem"}
637 WebInspector.NavigatorTreeOutline._treeElementsCompare=function compare(treeElem ent1,treeElement2) 603 WebInspector.NavigatorTreeOutline._treeElementsCompare=function compare(treeElem ent1,treeElement2)
638 {function typeWeight(treeElement) 604 {function typeWeight(treeElement)
639 {var type=treeElement.type();if(type===WebInspector.NavigatorTreeOutline.Types.D omain){if(treeElement.titleText===WebInspector.inspectedPageDomain) 605 {var type=treeElement.type();if(type===WebInspector.NavigatorTreeOutline.Types.D omain){if(treeElement.titleText===WebInspector.resourceTreeModel.inspectedPageDo main())
640 return 1;return 2;} 606 return 1;return 2;}
641 if(type===WebInspector.NavigatorTreeOutline.Types.FileSystem) 607 if(type===WebInspector.NavigatorTreeOutline.Types.FileSystem)
642 return 3;if(type===WebInspector.NavigatorTreeOutline.Types.Folder) 608 return 3;if(type===WebInspector.NavigatorTreeOutline.Types.Folder)
643 return 4;return 5;} 609 return 4;return 5;}
644 var typeWeight1=typeWeight(treeElement1);var typeWeight2=typeWeight(treeElement2 );var result;if(typeWeight1>typeWeight2) 610 var typeWeight1=typeWeight(treeElement1);var typeWeight2=typeWeight(treeElement2 );var result;if(typeWeight1>typeWeight2)
645 result=1;else if(typeWeight1<typeWeight2) 611 result=1;else if(typeWeight1<typeWeight2)
646 result=-1;else{var title1=treeElement1.titleText;var title2=treeElement2.titleTe xt;result=title1.compareTo(title2);} 612 result=-1;else{var title1=treeElement1.titleText;var title2=treeElement2.titleTe xt;result=title1.compareTo(title2);}
647 return result;} 613 return result;}
648 WebInspector.NavigatorTreeOutline.prototype={scriptTreeElements:function() 614 WebInspector.NavigatorTreeOutline.prototype={scriptTreeElements:function()
649 {var result=[];if(this.children.length){for(var treeElement=this.children[0];tre eElement;treeElement=treeElement.traverseNextTreeElement(false,this,true)){if(tr eeElement instanceof WebInspector.NavigatorSourceTreeElement) 615 {var result=[];if(this.children.length){for(var treeElement=this.children[0];tre eElement;treeElement=treeElement.traverseNextTreeElement(false,this,true)){if(tr eeElement instanceof WebInspector.NavigatorSourceTreeElement)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 {this.updateIconClasses(this._calculateIconClasses());},onattach:function() 649 {this.updateIconClasses(this._calculateIconClasses());},onattach:function()
684 {WebInspector.BaseNavigatorTreeElement.prototype.onattach.call(this);this.listIt emElement.draggable=true;this.listItemElement.addEventListener("click",this._onc lick.bind(this),false);this.listItemElement.addEventListener("contextmenu",this. _handleContextMenuEvent.bind(this),false);this.listItemElement.addEventListener( "mousedown",this._onmousedown.bind(this),false);this.listItemElement.addEventLis tener("dragstart",this._ondragstart.bind(this),false);},_onmousedown:function(ev ent) 650 {WebInspector.BaseNavigatorTreeElement.prototype.onattach.call(this);this.listIt emElement.draggable=true;this.listItemElement.addEventListener("click",this._onc lick.bind(this),false);this.listItemElement.addEventListener("contextmenu",this. _handleContextMenuEvent.bind(this),false);this.listItemElement.addEventListener( "mousedown",this._onmousedown.bind(this),false);this.listItemElement.addEventLis tener("dragstart",this._ondragstart.bind(this),false);},_onmousedown:function(ev ent)
685 {if(event.which===1) 651 {if(event.which===1)
686 this._uiSourceCode.requestContent(callback.bind(this));function callback(content ) 652 this._uiSourceCode.requestContent(callback.bind(this));function callback(content )
687 {this._warmedUpContent=content;}},_shouldRenameOnMouseDown:function() 653 {this._warmedUpContent=content;}},_shouldRenameOnMouseDown:function()
688 {if(!this._uiSourceCode.canRename()) 654 {if(!this._uiSourceCode.canRename())
689 return false;var isSelected=this===this.treeOutline.selectedTreeElement;var isFo cused=this.treeOutline.childrenListElement.isSelfOrAncestor(document.activeEleme nt);return isSelected&&isFocused&&!WebInspector.isBeingEdited(this.treeOutline.e lement);},selectOnMouseDown:function(event) 655 return false;var isSelected=this===this.treeOutline.selectedTreeElement;var isFo cused=this.treeOutline.childrenListElement.isSelfOrAncestor(document.activeEleme nt);return isSelected&&isFocused&&!WebInspector.isBeingEdited(this.treeOutline.e lement);},selectOnMouseDown:function(event)
690 {if(event.which!==1||!this._shouldRenameOnMouseDown()){TreeElement.prototype.sel ectOnMouseDown.call(this,event);return;} 656 {if(event.which!==1||!this._shouldRenameOnMouseDown()){TreeElement.prototype.sel ectOnMouseDown.call(this,event);return;}
691 setTimeout(rename.bind(this),300);function rename() 657 setTimeout(rename.bind(this),300);function rename()
692 {if(this._shouldRenameOnMouseDown()) 658 {if(this._shouldRenameOnMouseDown())
693 this._navigatorView.requestRename(this._uiSourceCode);}},_ondragstart:function(e vent) 659 this._navigatorView.rename(this.uiSourceCode,false);}},_ondragstart:function(eve nt)
694 {event.dataTransfer.setData("text/plain",this._warmedUpContent);event.dataTransf er.effectAllowed="copy";return true;},onspace:function() 660 {event.dataTransfer.setData("text/plain",this._warmedUpContent);event.dataTransf er.effectAllowed="copy";return true;},onspace:function()
695 {this._navigatorView._sourceSelected(this.uiSourceCode,true);return true;},_oncl ick:function(event) 661 {this._navigatorView._sourceSelected(this.uiSourceCode,true);return true;},_oncl ick:function(event)
696 {this._navigatorView._sourceSelected(this.uiSourceCode,false);},ondblclick:funct ion(event) 662 {this._navigatorView._sourceSelected(this.uiSourceCode,false);},ondblclick:funct ion(event)
697 {var middleClick=event.button===1;this._navigatorView._sourceSelected(this.uiSou rceCode,!middleClick);return false;},onenter:function() 663 {var middleClick=event.button===1;this._navigatorView._sourceSelected(this.uiSou rceCode,!middleClick);return false;},onenter:function()
698 {this._navigatorView._sourceSelected(this.uiSourceCode,true);return true;},ondel ete:function() 664 {this._navigatorView._sourceSelected(this.uiSourceCode,true);return true;},ondel ete:function()
699 {this._navigatorView.sourceDeleted(this.uiSourceCode);return true;},_handleConte xtMenuEvent:function(event) 665 {this._navigatorView.sourceDeleted(this.uiSourceCode);return true;},_handleConte xtMenuEvent:function(event)
700 {this.select();this._navigatorView.handleFileContextMenu(event,this._uiSourceCod e);},__proto__:WebInspector.BaseNavigatorTreeElement.prototype} 666 {this.select();this._navigatorView.handleFileContextMenu(event,this._uiSourceCod e);},__proto__:WebInspector.BaseNavigatorTreeElement.prototype}
701 WebInspector.NavigatorTreeNode=function(id) 667 WebInspector.NavigatorTreeNode=function(id)
702 {this.id=id;this._children=new StringMap();} 668 {this.id=id;this._children=new StringMap();}
703 WebInspector.NavigatorTreeNode.prototype={treeElement:function(){},dispose:funct ion(){},isRoot:function() 669 WebInspector.NavigatorTreeNode.prototype={treeElement:function(){throw"Not imple mented";},dispose:function(){},isRoot:function()
704 {return false;},hasChildren:function() 670 {return false;},hasChildren:function()
705 {return true;},populate:function() 671 {return true;},populate:function()
706 {if(this.isPopulated()) 672 {if(this.isPopulated())
707 return;if(this.parent) 673 return;if(this.parent)
708 this.parent.populate();this._populated=true;this.wasPopulated();},wasPopulated:f unction() 674 this.parent.populate();this._populated=true;this.wasPopulated();},wasPopulated:f unction()
709 {var children=this.children();for(var i=0;i<children.length;++i) 675 {var children=this.children();for(var i=0;i<children.length;++i)
710 this.treeElement().appendChild(children[i].treeElement());},didAddChild:function (node) 676 this.treeElement().appendChild(children[i].treeElement());},didAddChild:function (node)
711 {if(this.isPopulated()) 677 {if(this.isPopulated())
712 this.treeElement().appendChild(node.treeElement());},willRemoveChild:function(no de) 678 this.treeElement().appendChild(node.treeElement());},willRemoveChild:function(no de)
713 {if(this.isPopulated()) 679 {if(this.isPopulated())
(...skipping 10 matching lines...) Expand all
724 WebInspector.NavigatorRootTreeNode.prototype={isRoot:function() 690 WebInspector.NavigatorRootTreeNode.prototype={isRoot:function()
725 {return true;},treeElement:function() 691 {return true;},treeElement:function()
726 {return this._navigatorView._scriptsTree;},__proto__:WebInspector.NavigatorTreeN ode.prototype} 692 {return this._navigatorView._scriptsTree;},__proto__:WebInspector.NavigatorTreeN ode.prototype}
727 WebInspector.NavigatorUISourceCodeTreeNode=function(navigatorView,uiSourceCode) 693 WebInspector.NavigatorUISourceCodeTreeNode=function(navigatorView,uiSourceCode)
728 {WebInspector.NavigatorTreeNode.call(this,uiSourceCode.name());this._navigatorVi ew=navigatorView;this._uiSourceCode=uiSourceCode;this._treeElement=null;} 694 {WebInspector.NavigatorTreeNode.call(this,uiSourceCode.name());this._navigatorVi ew=navigatorView;this._uiSourceCode=uiSourceCode;this._treeElement=null;}
729 WebInspector.NavigatorUISourceCodeTreeNode.prototype={uiSourceCode:function() 695 WebInspector.NavigatorUISourceCodeTreeNode.prototype={uiSourceCode:function()
730 {return this._uiSourceCode;},updateIcon:function() 696 {return this._uiSourceCode;},updateIcon:function()
731 {if(this._treeElement) 697 {if(this._treeElement)
732 this._treeElement.updateIcon();},treeElement:function() 698 this._treeElement.updateIcon();},treeElement:function()
733 {if(this._treeElement) 699 {if(this._treeElement)
734 return this._treeElement;this._treeElement=new WebInspector.NavigatorSourceTreeE lement(this._navigatorView,this._uiSourceCode,"");this.updateTitle();this._uiSou rceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged,this._tit leChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Ev ents.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.addEve ntListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCo pyCommitted,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode. Events.FormattedChanged,this._formattedChanged,this);return this._treeElement;}, updateTitle:function(ignoreIsDirty) 700 return this._treeElement;this._treeElement=new WebInspector.NavigatorSourceTreeE lement(this._navigatorView,this._uiSourceCode,"");this.updateTitle();this._uiSou rceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged,this._tit leChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Ev ents.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.addEve ntListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCo pyCommitted,this);return this._treeElement;},updateTitle:function(ignoreIsDirty)
735 {if(!this._treeElement) 701 {if(!this._treeElement)
736 return;var titleText=this._uiSourceCode.displayName();if(!ignoreIsDirty&&(this._ uiSourceCode.isDirty()||this._uiSourceCode.hasUnsavedCommittedChanges())) 702 return;var titleText=this._uiSourceCode.displayName();if(!ignoreIsDirty&&(this._ uiSourceCode.isDirty()||this._uiSourceCode.hasUnsavedCommittedChanges()))
737 titleText="*"+titleText;this._treeElement.titleText=titleText;},hasChildren:func tion() 703 titleText="*"+titleText;this._treeElement.titleText=titleText;},hasChildren:func tion()
738 {return false;},dispose:function() 704 {return false;},dispose:function()
739 {if(!this._treeElement) 705 {if(!this._treeElement)
740 return;this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.T itleChanged,this._titleChanged,this);this._uiSourceCode.removeEventListener(WebI nspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);t his._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCo pyCommitted,this._workingCopyCommitted,this);this._uiSourceCode.removeEventListe ner(WebInspector.UISourceCode.Events.FormattedChanged,this._formattedChanged,thi s);},_titleChanged:function(event) 706 return;this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.T itleChanged,this._titleChanged,this);this._uiSourceCode.removeEventListener(WebI nspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);t his._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCo pyCommitted,this._workingCopyCommitted,this);},_titleChanged:function(event)
741 {this.updateTitle();},_workingCopyChanged:function(event) 707 {this.updateTitle();},_workingCopyChanged:function(event)
742 {this.updateTitle();},_workingCopyCommitted:function(event) 708 {this.updateTitle();},_workingCopyCommitted:function(event)
743 {this.updateTitle();},_formattedChanged:function(event)
744 {this.updateTitle();},reveal:function(select) 709 {this.updateTitle();},reveal:function(select)
745 {this.parent.populate();this.parent.treeElement().expand();this._treeElement.rev eal();if(select) 710 {this.parent.populate();this.parent.treeElement().expand();this._treeElement.rev eal();if(select)
746 this._treeElement.select();},rename:function(callback) 711 this._treeElement.select(true);},rename:function(callback)
747 {if(!this._treeElement) 712 {if(!this._treeElement)
748 return;var treeOutlineElement=this._treeElement.treeOutline.element;WebInspector .markBeingEdited(treeOutlineElement,true);function commitHandler(element,newTitl e,oldTitle) 713 return;var treeOutlineElement=this._treeElement.treeOutline.element;WebInspector .markBeingEdited(treeOutlineElement,true);function commitHandler(element,newTitl e,oldTitle)
749 {if(newTitle!==oldTitle){this._treeElement.titleText=newTitle;this._uiSourceCode .rename(newTitle,renameCallback.bind(this));return;} 714 {if(newTitle!==oldTitle){this._treeElement.titleText=newTitle;this._uiSourceCode .rename(newTitle,renameCallback.bind(this));return;}
750 afterEditing.call(this,true);} 715 afterEditing.call(this,true);}
751 function renameCallback(success) 716 function renameCallback(success)
752 {if(!success){WebInspector.markBeingEdited(treeOutlineElement,false);this.update Title();this.rename(callback);return;} 717 {if(!success){WebInspector.markBeingEdited(treeOutlineElement,false);this.update Title();this.rename(callback);return;}
753 afterEditing.call(this,true);} 718 afterEditing.call(this,true);}
754 function cancelHandler() 719 function cancelHandler()
755 {afterEditing.call(this,false);} 720 {afterEditing.call(this,false);}
756 function afterEditing(committed) 721 function afterEditing(committed)
757 {WebInspector.markBeingEdited(treeOutlineElement,false);this.updateTitle();this. _treeElement.treeOutline.childrenListElement.focus();if(callback) 722 {WebInspector.markBeingEdited(treeOutlineElement,false);this.updateTitle();this. _treeElement.treeOutline.childrenListElement.focus();if(callback)
758 callback(committed);} 723 callback(committed);}
759 var editingConfig=new WebInspector.EditingConfig(commitHandler.bind(this),cancel Handler.bind(this));this.updateTitle(true);WebInspector.startEditing(this._treeE lement.titleElement,editingConfig);window.getSelection().setBaseAndExtent(this._ treeElement.titleElement,0,this._treeElement.titleElement,1);},__proto__:WebInsp ector.NavigatorTreeNode.prototype} 724 var editingConfig=new WebInspector.InplaceEditor.Config(commitHandler.bind(this) ,cancelHandler.bind(this));this.updateTitle(true);WebInspector.InplaceEditor.sta rtEditing(this._treeElement.titleElement,editingConfig);window.getSelection().se tBaseAndExtent(this._treeElement.titleElement,0,this._treeElement.titleElement,1 );},__proto__:WebInspector.NavigatorTreeNode.prototype}
760 WebInspector.NavigatorFolderTreeNode=function(navigatorView,project,id,type,fold erPath,title) 725 WebInspector.NavigatorFolderTreeNode=function(navigatorView,project,id,type,fold erPath,title)
761 {WebInspector.NavigatorTreeNode.call(this,id);this._navigatorView=navigatorView; this._project=project;this._type=type;this._folderPath=folderPath;this._title=ti tle;} 726 {WebInspector.NavigatorTreeNode.call(this,id);this._navigatorView=navigatorView; this._project=project;this._type=type;this._folderPath=folderPath;this._title=ti tle;}
762 WebInspector.NavigatorFolderTreeNode.prototype={treeElement:function() 727 WebInspector.NavigatorFolderTreeNode.prototype={treeElement:function()
763 {if(this._treeElement) 728 {if(this._treeElement)
764 return this._treeElement;this._treeElement=this._createTreeElement(this._title,t his);return this._treeElement;},_createTreeElement:function(title,node) 729 return this._treeElement;this._treeElement=this._createTreeElement(this._title,t his);return this._treeElement;},_createTreeElement:function(title,node)
765 {var treeElement=new WebInspector.NavigatorFolderTreeElement(this._navigatorView ,this._type,title);treeElement.setNode(node);return treeElement;},wasPopulated:f unction() 730 {var treeElement=new WebInspector.NavigatorFolderTreeElement(this._navigatorView ,this._type,title);treeElement.setNode(node);return treeElement;},wasPopulated:f unction()
766 {if(!this._treeElement||this._treeElement._node!==this) 731 {if(!this._treeElement||this._treeElement._node!==this)
767 return;this._addChildrenRecursive();},_addChildrenRecursive:function() 732 return;this._addChildrenRecursive();},_addChildrenRecursive:function()
768 {var children=this.children();for(var i=0;i<children.length;++i){var child=child ren[i];this.didAddChild(child);if(child instanceof WebInspector.NavigatorFolderT reeNode) 733 {var children=this.children();for(var i=0;i<children.length;++i){var child=child ren[i];this.didAddChild(child);if(child instanceof WebInspector.NavigatorFolderT reeNode)
769 child._addChildrenRecursive();}},_shouldMerge:function(node) 734 child._addChildrenRecursive();}},_shouldMerge:function(node)
770 {return this._type!==WebInspector.NavigatorTreeOutline.Types.Domain&&node instan ceof WebInspector.NavigatorFolderTreeNode;},didAddChild:function(node) 735 {return this._type!==WebInspector.NavigatorTreeOutline.Types.Domain&&node instan ceof WebInspector.NavigatorFolderTreeNode;},didAddChild:function(node)
771 {function titleForNode(node) 736 {function titleForNode(node)
772 {return node._title;} 737 {return node._title;}
773 if(!this._treeElement) 738 if(!this._treeElement)
774 return;var children=this.children();if(children.length===1&&this._shouldMerge(no de)){node._isMerged=true;this._treeElement.titleText=this._treeElement.titleText +"/"+node._title;node._treeElement=this._treeElement;this._treeElement.setNode(n ode);return;} 739 return;var children=this.children();if(children.length===1&&this._shouldMerge(no de)){node._isMerged=true;this._treeElement.titleText=this._treeElement.titleText +"/"+node._title;node._treeElement=this._treeElement;this._treeElement.setNode(n ode);return;}
775 var oldNode;if(children.length===2) 740 var oldNode;if(children.length===2)
776 oldNode=children[0]!==node?children[0]:children[1];if(oldNode&&oldNode._isMerged ){delete oldNode._isMerged;var mergedToNodes=[];mergedToNodes.push(this);var tre eNode=this;while(treeNode._isMerged){treeNode=treeNode.parent;mergedToNodes.push (treeNode);} 741 oldNode=children[0]!==node?children[0]:children[1];if(oldNode&&oldNode._isMerged ){delete oldNode._isMerged;var mergedToNodes=[];mergedToNodes.push(this);var tre eNode=this;while(treeNode._isMerged){treeNode=treeNode.parent;mergedToNodes.push (treeNode);}
777 mergedToNodes.reverse();var titleText=mergedToNodes.map(titleForNode).join("/"); var nodes=[];treeNode=oldNode;do{nodes.push(treeNode);children=treeNode.children ();treeNode=children.length===1?children[0]:null;}while(treeNode&&treeNode._isMe rged);if(!this.isPopulated()){this._treeElement.titleText=titleText;this._treeEl ement.setNode(this);for(var i=0;i<nodes.length;++i){delete nodes[i]._treeElement ;delete nodes[i]._isMerged;} 742 mergedToNodes.reverse();var titleText=mergedToNodes.map(titleForNode).join("/"); var nodes=[];treeNode=oldNode;do{nodes.push(treeNode);children=treeNode.children ();treeNode=children.length===1?children[0]:null;}while(treeNode&&treeNode._isMe rged);if(!this.isPopulated()){this._treeElement.titleText=titleText;this._treeEl ement.setNode(this);for(var i=0;i<nodes.length;++i){delete nodes[i]._treeElement ;delete nodes[i]._isMerged;}
778 return;} 743 return;}
779 var oldTreeElement=this._treeElement;var treeElement=this._createTreeElement(tit leText,this);for(var i=0;i<mergedToNodes.length;++i) 744 var oldTreeElement=this._treeElement;var treeElement=this._createTreeElement(tit leText,this);for(var i=0;i<mergedToNodes.length;++i)
780 mergedToNodes[i]._treeElement=treeElement;oldTreeElement.parent.appendChild(tree Element);oldTreeElement.setNode(nodes[nodes.length-1]);oldTreeElement.titleText= nodes.map(titleForNode).join("/");oldTreeElement.parent.removeChild(oldTreeEleme nt);this._treeElement.appendChild(oldTreeElement);if(oldTreeElement.expanded) 745 mergedToNodes[i]._treeElement=treeElement;oldTreeElement.parent.appendChild(tree Element);oldTreeElement.setNode(nodes[nodes.length-1]);oldTreeElement.titleText= nodes.map(titleForNode).join("/");oldTreeElement.parent.removeChild(oldTreeEleme nt);this._treeElement.appendChild(oldTreeElement);if(oldTreeElement.expanded)
781 treeElement.expand();} 746 treeElement.expand();}
782 if(this.isPopulated()) 747 if(this.isPopulated())
783 this._treeElement.appendChild(node.treeElement());},willRemoveChild:function(nod e) 748 this._treeElement.appendChild(node.treeElement());},willRemoveChild:function(nod e)
784 {if(node._isMerged||!this.isPopulated()) 749 {if(node._isMerged||!this.isPopulated())
785 return;this._treeElement.removeChild(node._treeElement);},__proto__:WebInspector .NavigatorTreeNode.prototype};WebInspector.RevisionHistoryView=function() 750 return;this._treeElement.removeChild(node._treeElement);},__proto__:WebInspector .NavigatorTreeNode.prototype};WebInspector.RevisionHistoryView=function()
786 {WebInspector.View.call(this);this.registerRequiredCSS("revisionHistory.css");th is.element.classList.add("revision-history-drawer");this.element.classList.add(" fill");this.element.classList.add("outline-disclosure");this._uiSourceCodeItems= new Map();var olElement=this.element.createChild("ol");this._treeOutline=new Tre eOutline(olElement);function populateRevisions(uiSourceCode) 751 {WebInspector.VBox.call(this);this.registerRequiredCSS("revisionHistory.css");th is.element.classList.add("revision-history-drawer");this.element.classList.add(" outline-disclosure");this._uiSourceCodeItems=new Map();var olElement=this.elemen t.createChild("ol");this._treeOutline=new TreeOutline(olElement);function popula teRevisions(uiSourceCode)
787 {if(uiSourceCode.history.length) 752 {if(uiSourceCode.history.length)
788 this._createUISourceCodeItem(uiSourceCode);} 753 this._createUISourceCodeItem(uiSourceCode);}
789 WebInspector.workspace.uiSourceCodes().forEach(populateRevisions.bind(this));Web Inspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeC ontentCommitted,this._revisionAdded,this);WebInspector.workspace.addEventListene r(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,th is);WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.Projec tWillReset,this._projectWillReset,this);} 754 WebInspector.workspace.uiSourceCodes().forEach(populateRevisions.bind(this));Web Inspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeC ontentCommitted,this._revisionAdded,this);WebInspector.workspace.addEventListene r(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,th is);WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.Projec tWillReset,this._projectWillReset,this);}
790 WebInspector.RevisionHistoryView.showHistory=function(uiSourceCode) 755 WebInspector.RevisionHistoryView.showHistory=function(uiSourceCode)
791 {if(!WebInspector.RevisionHistoryView._view) 756 {if(!WebInspector.RevisionHistoryView._view)
792 WebInspector.RevisionHistoryView._view=new WebInspector.RevisionHistoryView();va r view=WebInspector.RevisionHistoryView._view;WebInspector.inspectorView.showClo seableViewInDrawer("history",WebInspector.UIString("History"),view);view._reveal UISourceCode(uiSourceCode);} 757 WebInspector.RevisionHistoryView._view=new WebInspector.RevisionHistoryView();va r view=WebInspector.RevisionHistoryView._view;WebInspector.inspectorView.showClo seableViewInDrawer("history",WebInspector.UIString("History"),view);view._reveal UISourceCode(uiSourceCode);}
793 WebInspector.RevisionHistoryView.prototype={_createUISourceCodeItem:function(uiS ourceCode) 758 WebInspector.RevisionHistoryView.prototype={_createUISourceCodeItem:function(uiS ourceCode)
794 {var uiSourceCodeItem=new TreeElement(uiSourceCode.displayName(),null,true);uiSo urceCodeItem.selectable=false;for(var i=0;i<this._treeOutline.children.length;++ i){if(this._treeOutline.children[i].title.localeCompare(uiSourceCode.displayName ())>0){this._treeOutline.insertChild(uiSourceCodeItem,i);break;}} 759 {var uiSourceCodeItem=new TreeElement(uiSourceCode.displayName(),null,true);uiSo urceCodeItem.selectable=false;for(var i=0;i<this._treeOutline.children.length;++ i){if(this._treeOutline.children[i].title.localeCompare(uiSourceCode.displayName ())>0){this._treeOutline.insertChild(uiSourceCodeItem,i);break;}}
795 if(i===this._treeOutline.children.length) 760 if(i===this._treeOutline.children.length)
796 this._treeOutline.appendChild(uiSourceCodeItem);this._uiSourceCodeItems.put(uiSo urceCode,uiSourceCodeItem);var revisionCount=uiSourceCode.history.length;for(var i=revisionCount-1;i>=0;--i){var revision=uiSourceCode.history[i];var historyIte m=new WebInspector.RevisionHistoryTreeElement(revision,uiSourceCode.history[i-1] ,i!==revisionCount-1);uiSourceCodeItem.appendChild(historyItem);} 761 this._treeOutline.appendChild(uiSourceCodeItem);this._uiSourceCodeItems.put(uiSo urceCode,uiSourceCodeItem);var revisionCount=uiSourceCode.history.length;for(var i=revisionCount-1;i>=0;--i){var revision=uiSourceCode.history[i];var historyIte m=new WebInspector.RevisionHistoryTreeElement(revision,uiSourceCode.history[i-1] ,i!==revisionCount-1);uiSourceCodeItem.appendChild(historyItem);}
797 var linkItem=new TreeElement("",null,false);linkItem.selectable=false;uiSourceCo deItem.appendChild(linkItem);var revertToOriginal=linkItem.listItemElement.creat eChild("span","revision-history-link revision-history-link-row");revertToOrigina l.textContent=WebInspector.UIString("apply original content");revertToOriginal.a ddEventListener("click",uiSourceCode.revertToOriginal.bind(uiSourceCode));var cl earHistoryElement=uiSourceCodeItem.listItemElement.createChild("span","revision- history-link");clearHistoryElement.textContent=WebInspector.UIString("revert");c learHistoryElement.addEventListener("click",this._clearHistory.bind(this,uiSourc eCode));return uiSourceCodeItem;},_clearHistory:function(uiSourceCode) 762 var linkItem=new TreeElement("",null,false);linkItem.selectable=false;uiSourceCo deItem.appendChild(linkItem);var revertToOriginal=linkItem.listItemElement.creat eChild("span","revision-history-link revision-history-link-row");revertToOrigina l.textContent=WebInspector.UIString("apply original content");revertToOriginal.a ddEventListener("click",uiSourceCode.revertToOriginal.bind(uiSourceCode));var cl earHistoryElement=uiSourceCodeItem.listItemElement.createChild("span","revision- history-link");clearHistoryElement.textContent=WebInspector.UIString("revert");c learHistoryElement.addEventListener("click",this._clearHistory.bind(this,uiSourc eCode));return uiSourceCodeItem;},_clearHistory:function(uiSourceCode)
798 {uiSourceCode.revertAndClearHistory(this._removeUISourceCode.bind(this));},_revi sionAdded:function(event) 763 {uiSourceCode.revertAndClearHistory(this._removeUISourceCode.bind(this));},_revi sionAdded:function(event)
799 {var uiSourceCode=(event.data.uiSourceCode);var uiSourceCodeItem=this._uiSourceC odeItems.get(uiSourceCode);if(!uiSourceCodeItem){uiSourceCodeItem=this._createUI SourceCodeItem(uiSourceCode);return;} 764 {var uiSourceCode=(event.data.uiSourceCode);var uiSourceCodeItem=this._uiSourceC odeItems.get(uiSourceCode);if(!uiSourceCodeItem){uiSourceCodeItem=this._createUI SourceCodeItem(uiSourceCode);return;}
800 var historyLength=uiSourceCode.history.length;var historyItem=new WebInspector.R evisionHistoryTreeElement(uiSourceCode.history[historyLength-1],uiSourceCode.his tory[historyLength-2],false);if(uiSourceCodeItem.children.length) 765 var historyLength=uiSourceCode.history.length;var historyItem=new WebInspector.R evisionHistoryTreeElement(uiSourceCode.history[historyLength-1],uiSourceCode.his tory[historyLength-2],false);if(uiSourceCodeItem.children.length)
801 uiSourceCodeItem.children[0].allowRevert();uiSourceCodeItem.insertChild(historyI tem,0);},_revealUISourceCode:function(uiSourceCode) 766 uiSourceCodeItem.children[0].allowRevert();uiSourceCodeItem.insertChild(historyI tem,0);},_revealUISourceCode:function(uiSourceCode)
802 {var uiSourceCodeItem=this._uiSourceCodeItems.get(uiSourceCode);if(uiSourceCodeI tem){uiSourceCodeItem.reveal();uiSourceCodeItem.expand();}},_uiSourceCodeRemoved :function(event) 767 {var uiSourceCodeItem=this._uiSourceCodeItems.get(uiSourceCode);if(uiSourceCodeI tem){uiSourceCodeItem.reveal();uiSourceCodeItem.expand();}},_uiSourceCodeRemoved :function(event)
803 {var uiSourceCode=(event.data);this._removeUISourceCode(uiSourceCode);},_removeU ISourceCode:function(uiSourceCode) 768 {var uiSourceCode=(event.data);this._removeUISourceCode(uiSourceCode);},_removeU ISourceCode:function(uiSourceCode)
804 {var uiSourceCodeItem=this._uiSourceCodeItems.get(uiSourceCode);if(!uiSourceCode Item) 769 {var uiSourceCodeItem=this._uiSourceCodeItems.get(uiSourceCode);if(!uiSourceCode Item)
805 return;this._treeOutline.removeChild(uiSourceCodeItem);this._uiSourceCodeItems.r emove(uiSourceCode);},_projectWillReset:function(event) 770 return;this._treeOutline.removeChild(uiSourceCodeItem);this._uiSourceCodeItems.r emove(uiSourceCode);},_projectWillReset:function(event)
806 {var project=event.data;project.uiSourceCodes().forEach(this._removeUISourceCode .bind(this));},__proto__:WebInspector.View.prototype} 771 {var project=event.data;project.uiSourceCodes().forEach(this._removeUISourceCode .bind(this));},__proto__:WebInspector.VBox.prototype}
807 WebInspector.RevisionHistoryTreeElement=function(revision,baseRevision,allowReve rt) 772 WebInspector.RevisionHistoryTreeElement=function(revision,baseRevision,allowReve rt)
808 {TreeElement.call(this,revision.timestamp.toLocaleTimeString(),null,true);this.s electable=false;this._revision=revision;this._baseRevision=baseRevision;this._re vertElement=document.createElement("span");this._revertElement.className="revisi on-history-link";this._revertElement.textContent=WebInspector.UIString("apply re vision content");this._revertElement.addEventListener("click",this._revision.rev ertToThis.bind(this._revision),false);if(!allowRevert) 773 {TreeElement.call(this,revision.timestamp.toLocaleTimeString(),null,true);this.s electable=false;this._revision=revision;this._baseRevision=baseRevision;this._re vertElement=document.createElement("span");this._revertElement.className="revisi on-history-link";this._revertElement.textContent=WebInspector.UIString("apply re vision content");this._revertElement.addEventListener("click",this._revision.rev ertToThis.bind(this._revision),false);if(!allowRevert)
809 this._revertElement.classList.add("hidden");} 774 this._revertElement.classList.add("hidden");}
810 WebInspector.RevisionHistoryTreeElement.prototype={onattach:function() 775 WebInspector.RevisionHistoryTreeElement.prototype={onattach:function()
811 {this.listItemElement.classList.add("revision-history-revision");},onexpand:func tion() 776 {this.listItemElement.classList.add("revision-history-revision");},onexpand:func tion()
812 {this.listItemElement.appendChild(this._revertElement);if(this._wasExpandedOnce) 777 {this.listItemElement.appendChild(this._revertElement);if(this._wasExpandedOnce)
813 return;this._wasExpandedOnce=true;this.childrenListElement.classList.add("source -code");if(this._baseRevision) 778 return;this._wasExpandedOnce=true;this.childrenListElement.classList.add("source -code");if(this._baseRevision)
814 this._baseRevision.requestContent(step1.bind(this));else 779 this._baseRevision.requestContent(step1.bind(this));else
815 this._revision.uiSourceCode.requestOriginalContent(step1.bind(this));function st ep1(baseContent) 780 this._revision.uiSourceCode.requestOriginalContent(step1.bind(this));function st ep1(baseContent)
816 {this._revision.requestContent(step2.bind(this,baseContent));} 781 {this._revision.requestContent(step2.bind(this,baseContent));}
817 function step2(baseContent,newContent) 782 function step2(baseContent,newContent)
818 {var baseLines=difflib.stringAsLines(baseContent);var newLines=difflib.stringAsL ines(newContent);var sm=new difflib.SequenceMatcher(baseLines,newLines);var opco des=sm.get_opcodes();var lastWasSeparator=false;for(var idx=0;idx<opcodes.length ;idx++){var code=opcodes[idx];var change=code[0];var b=code[1];var be=code[2];va r n=code[3];var ne=code[4];var rowCount=Math.max(be-b,ne-n);var topRows=[];var b ottomRows=[];for(var i=0;i<rowCount;i++){if(change==="delete"||(change==="replac e"&&b<be)){var lineNumber=b++;this._createLine(lineNumber,null,baseLines[lineNum ber],"removed");lastWasSeparator=false;} 783 {var baseLines=difflib.stringAsLines(baseContent);var newLines=difflib.stringAsL ines(newContent);var sm=new difflib.SequenceMatcher(baseLines,newLines);var opco des=sm.get_opcodes();var lastWasSeparator=false;for(var idx=0;idx<opcodes.length ;idx++){var code=opcodes[idx];var change=code[0];var b=code[1];var be=code[2];va r n=code[3];var ne=code[4];var rowCount=Math.max(be-b,ne-n);var topRows=[];var b ottomRows=[];for(var i=0;i<rowCount;i++){if(change==="delete"||(change==="replac e"&&b<be)){var lineNumber=b++;this._createLine(lineNumber,null,baseLines[lineNum ber],"removed");lastWasSeparator=false;}
819 if(change==="insert"||(change==="replace"&&n<ne)){var lineNumber=n++;this._creat eLine(null,lineNumber,newLines[lineNumber],"added");lastWasSeparator=false;} 784 if(change==="insert"||(change==="replace"&&n<ne)){var lineNumber=n++;this._creat eLine(null,lineNumber,newLines[lineNumber],"added");lastWasSeparator=false;}
820 if(change==="equal"){b++;n++;if(!lastWasSeparator) 785 if(change==="equal"){b++;n++;if(!lastWasSeparator)
821 this._createLine(null,null," \u2026","separator");lastWasSeparator=true;}}}}} ,oncollapse:function() 786 this._createLine(null,null," \u2026","separator");lastWasSeparator=true;}}}}} ,oncollapse:function()
822 {this._revertElement.remove();},_createLine:function(baseLineNumber,newLineNumbe r,lineContent,changeType) 787 {this._revertElement.remove();},_createLine:function(baseLineNumber,newLineNumbe r,lineContent,changeType)
823 {var child=new TreeElement("",null,false);child.selectable=false;this.appendChil d(child);var lineElement=document.createElement("span");function appendLineNumbe r(lineNumber) 788 {var child=new TreeElement("",null,false);child.selectable=false;this.appendChil d(child);var lineElement=document.createElement("span");function appendLineNumbe r(lineNumber)
824 {var numberString=lineNumber!==null?numberToStringWithSpacesPadding(lineNumber+1 ,4):" ";var lineNumberSpan=document.createElement("span");lineNumberSpan.clas sList.add("webkit-line-number");lineNumberSpan.textContent=numberString;child.li stItemElement.appendChild(lineNumberSpan);} 789 {var numberString=lineNumber!==null?numberToStringWithSpacesPadding(lineNumber+1 ,4):" ";var lineNumberSpan=document.createElement("span");lineNumberSpan.clas sList.add("webkit-line-number");lineNumberSpan.textContent=numberString;child.li stItemElement.appendChild(lineNumberSpan);}
825 appendLineNumber(baseLineNumber);appendLineNumber(newLineNumber);var contentSpan =document.createElement("span");contentSpan.textContent=lineContent;child.listIt emElement.appendChild(contentSpan);child.listItemElement.classList.add("revision -history-line");child.listItemElement.classList.add("revision-history-line-"+cha ngeType);},allowRevert:function() 790 appendLineNumber(baseLineNumber);appendLineNumber(newLineNumber);var contentSpan =document.createElement("span");contentSpan.textContent=lineContent;child.listIt emElement.appendChild(contentSpan);child.listItemElement.classList.add("revision -history-line");child.listItemElement.classList.add("revision-history-line-"+cha ngeType);},allowRevert:function()
826 {this._revertElement.classList.remove("hidden");},__proto__:TreeElement.prototyp e};WebInspector.ScopeChainSidebarPane=function() 791 {this._revertElement.classList.remove("hidden");},__proto__:TreeElement.prototyp e};WebInspector.ScopeChainSidebarPane=function()
827 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Scope Variables"));th is._sections=[];this._expandedSections={};this._expandedProperties=[];} 792 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Scope Variables"));th is._sections=[];this._expandedSections={};this._expandedProperties=[];}
828 WebInspector.ScopeChainSidebarPane.prototype={update:function(callFrame) 793 WebInspector.ScopeChainSidebarPane.prototype={update:function(callFrame)
829 {this.bodyElement.removeChildren();if(!callFrame){var infoElement=document.creat eElement("div");infoElement.className="info";infoElement.textContent=WebInspecto r.UIString("Not Paused");this.bodyElement.appendChild(infoElement);return;} 794 {this.bodyElement.removeChildren();if(!callFrame){var infoElement=document.creat eElement("div");infoElement.className="info";infoElement.textContent=WebInspecto r.UIString("Not Paused");this.bodyElement.appendChild(infoElement);return;}
830 for(var i=0;i<this._sections.length;++i){var section=this._sections[i];if(!secti on.title) 795 for(var i=0;i<this._sections.length;++i){var section=this._sections[i];if(!secti on.title)
831 continue;if(section.expanded) 796 continue;if(section.expanded)
832 this._expandedSections[section.title]=true;else 797 this._expandedSections[section.title]=true;else
833 delete this._expandedSections[section.title];} 798 delete this._expandedSections[section.title];}
834 this._sections=[];var foundLocalScope=false;var scopeChain=callFrame.scopeChain; for(var i=0;i<scopeChain.length;++i){var scope=scopeChain[i];var title=null;var subtitle=scope.object.description;var emptyPlaceholder=null;var extraProperties= [];var declarativeScope;switch(scope.type){case DebuggerAgent.ScopeType.Local:fo undLocalScope=true;title=WebInspector.UIString("Local");emptyPlaceholder=WebInsp ector.UIString("No Variables");subtitle=undefined;if(callFrame.this) 799 this._sections=[];var foundLocalScope=false;var scopeChain=callFrame.scopeChain; for(var i=0;i<scopeChain.length;++i){var scope=scopeChain[i];var title=null;var subtitle=scope.object.description;var emptyPlaceholder=null;var extraProperties= [];var declarativeScope;switch(scope.type){case DebuggerAgent.ScopeType.Local:fo undLocalScope=true;title=WebInspector.UIString("Local");emptyPlaceholder=WebInsp ector.UIString("No Variables");subtitle=undefined;if(callFrame.this)
835 extraProperties.push(new WebInspector.RemoteObjectProperty("this",WebInspector.R emoteObject.fromPayload(callFrame.this)));if(i==0){var details=WebInspector.debu ggerModel.debuggerPausedDetails();var exception=details.reason===WebInspector.De buggerModel.BreakReason.Exception?details.auxData:0;if(exception){var exceptionO bject=(exception);extraProperties.push(new WebInspector.RemoteObjectProperty("<e xception>",WebInspector.RemoteObject.fromPayload(exceptionObject)));} 800 extraProperties.push(new WebInspector.RemoteObjectProperty("this",WebInspector.R emoteObject.fromPayload(callFrame.this)));if(i==0){var details=WebInspector.debu ggerModel.debuggerPausedDetails();var exception=details.reason===WebInspector.De buggerModel.BreakReason.Exception?details.auxData:0;if(exception&&!callFrame.isA sync()){var exceptionObject=(exception);extraProperties.push(new WebInspector.Re moteObjectProperty("<exception>",WebInspector.RemoteObject.fromPayload(exception Object)));}
836 if(callFrame.returnValue) 801 if(callFrame.returnValue)
837 extraProperties.push(new WebInspector.RemoteObjectProperty("<return>",WebInspect or.RemoteObject.fromPayload(callFrame.returnValue)));} 802 extraProperties.push(new WebInspector.RemoteObjectProperty("<return>",WebInspect or.RemoteObject.fromPayload(callFrame.returnValue)));}
838 declarativeScope=true;break;case DebuggerAgent.ScopeType.Closure:title=WebInspec tor.UIString("Closure");emptyPlaceholder=WebInspector.UIString("No Variables");s ubtitle=undefined;declarativeScope=true;break;case DebuggerAgent.ScopeType.Catch :title=WebInspector.UIString("Catch");subtitle=undefined;declarativeScope=true;b reak;case DebuggerAgent.ScopeType.With:title=WebInspector.UIString("With Block") ;declarativeScope=false;break;case DebuggerAgent.ScopeType.Global:title=WebInspe ctor.UIString("Global");declarativeScope=false;break;} 803 declarativeScope=true;break;case DebuggerAgent.ScopeType.Closure:title=WebInspec tor.UIString("Closure");emptyPlaceholder=WebInspector.UIString("No Variables");s ubtitle=undefined;declarativeScope=true;break;case DebuggerAgent.ScopeType.Catch :title=WebInspector.UIString("Catch");subtitle=undefined;declarativeScope=true;b reak;case DebuggerAgent.ScopeType.With:title=WebInspector.UIString("With Block") ;declarativeScope=false;break;case DebuggerAgent.ScopeType.Global:title=WebInspe ctor.UIString("Global");declarativeScope=false;break;}
839 if(!title||title===subtitle) 804 if(!title||title===subtitle)
840 subtitle=undefined;var scopeRef=declarativeScope?new WebInspector.ScopeRef(i,cal lFrame.id,undefined):undefined;var scopeObject=WebInspector.ScopeRemoteObject.fr omPayload(scope.object,scopeRef);var section=new WebInspector.ObjectPropertiesSe ction(scopeObject,title,subtitle,emptyPlaceholder,true,extraProperties,WebInspec tor.ScopeVariableTreeElement);section.editInSelectedCallFrameWhenPaused=true;sec tion.pane=this;if(scope.type===DebuggerAgent.ScopeType.Global) 805 subtitle=undefined;var scopeRef=declarativeScope?new WebInspector.ScopeRef(i,cal lFrame.id,undefined):undefined;var scopeObject=WebInspector.ScopeRemoteObject.fr omPayload(scope.object,scopeRef);var section=new WebInspector.ObjectPropertiesSe ction(scopeObject,title,subtitle,emptyPlaceholder,true,extraProperties,WebInspec tor.ScopeVariableTreeElement);section.editInSelectedCallFrameWhenPaused=true;sec tion.pane=this;if(scope.type===DebuggerAgent.ScopeType.Global)
841 section.expanded=false;else if(!foundLocalScope||scope.type===DebuggerAgent.Scop eType.Local||title in this._expandedSections) 806 section.expanded=false;else if(!foundLocalScope||scope.type===DebuggerAgent.Scop eType.Local||title in this._expandedSections)
842 section.expanded=true;this._sections.push(section);this.bodyElement.appendChild( section.element);}},__proto__:WebInspector.SidebarPane.prototype} 807 section.expanded=true;this._sections.push(section);this.bodyElement.appendChild( section.element);}},__proto__:WebInspector.SidebarPane.prototype}
843 WebInspector.ScopeVariableTreeElement=function(property) 808 WebInspector.ScopeVariableTreeElement=function(property)
844 {WebInspector.ObjectPropertyTreeElement.call(this,property);} 809 {WebInspector.ObjectPropertyTreeElement.call(this,property);}
845 WebInspector.ScopeVariableTreeElement.prototype={onattach:function() 810 WebInspector.ScopeVariableTreeElement.prototype={onattach:function()
846 {WebInspector.ObjectPropertyTreeElement.prototype.onattach.call(this);if(this.ha sChildren&&this.propertyIdentifier in this.treeOutline.section.pane._expandedPro perties) 811 {WebInspector.ObjectPropertyTreeElement.prototype.onattach.call(this);if(this.ha sChildren&&this.propertyIdentifier in this.treeOutline.section.pane._expandedPro perties)
847 this.expand();},onexpand:function() 812 this.expand();},onexpand:function()
848 {this.treeOutline.section.pane._expandedProperties[this.propertyIdentifier]=true ;},oncollapse:function() 813 {this.treeOutline.section.pane._expandedProperties[this.propertyIdentifier]=true ;},oncollapse:function()
849 {delete this.treeOutline.section.pane._expandedProperties[this.propertyIdentifie r];},get propertyIdentifier() 814 {delete this.treeOutline.section.pane._expandedProperties[this.propertyIdentifie r];},get propertyIdentifier()
850 {if("_propertyIdentifier"in this) 815 {if("_propertyIdentifier"in this)
851 return this._propertyIdentifier;var section=this.treeOutline.section;this._prope rtyIdentifier=section.title+":"+(section.subtitle?section.subtitle+":":"")+this. propertyPath();return this._propertyIdentifier;},__proto__:WebInspector.ObjectPr opertyTreeElement.prototype};WebInspector.SourcesNavigator=function() 816 return this._propertyIdentifier;var section=this.treeOutline.section;this._prope rtyIdentifier=section.title+":"+(section.subtitle?section.subtitle+":":"")+this. propertyPath();return this._propertyIdentifier;},__proto__:WebInspector.ObjectPr opertyTreeElement.prototype};WebInspector.SourcesNavigator=function(workspace)
852 {WebInspector.Object.call(this);this._tabbedPane=new WebInspector.TabbedPane();t his._tabbedPane.shrinkableTabs=true;this._tabbedPane.element.classList.add("navi gator-tabbed-pane");this._sourcesView=new WebInspector.NavigatorView();this._sou rcesView.addEventListener(WebInspector.NavigatorView.Events.ItemSelected,this._s ourceSelected,this);this._sourcesView.addEventListener(WebInspector.NavigatorVie w.Events.ItemSearchStarted,this._itemSearchStarted,this);this._sourcesView.addEv entListener(WebInspector.NavigatorView.Events.ItemRenamingRequested,this._itemRe namingRequested,this);this._sourcesView.addEventListener(WebInspector.NavigatorV iew.Events.ItemCreationRequested,this._itemCreationRequested,this);this._content ScriptsView=new WebInspector.NavigatorView();this._contentScriptsView.addEventLi stener(WebInspector.NavigatorView.Events.ItemSelected,this._sourceSelected,this) ;this._contentScriptsView.addEventListener(WebInspector.NavigatorView.Events.Ite mSearchStarted,this._itemSearchStarted,this);this._contentScriptsView.addEventLi stener(WebInspector.NavigatorView.Events.ItemRenamingRequested,this._itemRenamin gRequested,this);this._contentScriptsView.addEventListener(WebInspector.Navigato rView.Events.ItemCreationRequested,this._itemCreationRequested,this);this._snipp etsView=new WebInspector.SnippetsNavigatorView();this._snippetsView.addEventList ener(WebInspector.NavigatorView.Events.ItemSelected,this._sourceSelected,this);t his._snippetsView.addEventListener(WebInspector.NavigatorView.Events.ItemSearchS tarted,this._itemSearchStarted,this);this._snippetsView.addEventListener(WebInsp ector.NavigatorView.Events.ItemRenamingRequested,this._itemRenamingRequested,thi s);this._snippetsView.addEventListener(WebInspector.NavigatorView.Events.ItemCre ationRequested,this._itemCreationRequested,this);this._tabbedPane.appendTab(WebI nspector.SourcesNavigator.SourcesTab,WebInspector.UIString("Sources"),this._sour cesView);this._tabbedPane.selectTab(WebInspector.SourcesNavigator.SourcesTab);th is._tabbedPane.appendTab(WebInspector.SourcesNavigator.ContentScriptsTab,WebInsp ector.UIString("Content scripts"),this._contentScriptsView);this._tabbedPane.app endTab(WebInspector.SourcesNavigator.SnippetsTab,WebInspector.UIString("Snippets "),this._snippetsView);} 817 {WebInspector.Object.call(this);this._workspace=workspace;this._tabbedPane=new W ebInspector.TabbedPane();this._tabbedPane.shrinkableTabs=true;this._tabbedPane.e lement.classList.add("navigator-tabbed-pane");new WebInspector.ExtensibleTabbedP aneController(this._tabbedPane,"navigator-view",this._navigatorViewCreated.bind( this));this._navigatorViews=new StringMap();}
853 WebInspector.SourcesNavigator.Events={SourceSelected:"SourceSelected",ItemCreati onRequested:"ItemCreationRequested",ItemRenamingRequested:"ItemRenamingRequested ",ItemSearchStarted:"ItemSearchStarted",} 818 WebInspector.SourcesNavigator.Events={SourceSelected:"SourceSelected",SourceRena med:"SourceRenamed"}
854 WebInspector.SourcesNavigator.SourcesTab="sources";WebInspector.SourcesNavigator .ContentScriptsTab="contentScripts";WebInspector.SourcesNavigator.SnippetsTab="s nippets";WebInspector.SourcesNavigator.prototype={get view() 819 WebInspector.SourcesNavigator.prototype={_navigatorViewCreated:function(id,view)
855 {return this._tabbedPane;},_navigatorViewForUISourceCode:function(uiSourceCode) 820 {var navigatorView=(view);navigatorView.addEventListener(WebInspector.NavigatorV iew.Events.ItemSelected,this._sourceSelected,this);navigatorView.addEventListene r(WebInspector.NavigatorView.Events.ItemRenamed,this._sourceRenamed,this);this._ navigatorViews.put(id,navigatorView);navigatorView.setWorkspace(this._workspace) ;},get view()
856 {if(uiSourceCode.isContentScript) 821 {return this._tabbedPane;},_navigatorViewIdForUISourceCode:function(uiSourceCode )
857 return this._contentScriptsView;else if(uiSourceCode.project().type()===WebInspe ctor.projectTypes.Snippets) 822 {var ids=this._navigatorViews.keys();for(var i=0;i<ids.length;++i){var id=ids[i]
858 return this._snippetsView;else 823 var navigatorView=this._navigatorViews.get(id);if(navigatorView.accept(uiSourceC ode))
859 return this._sourcesView;},addUISourceCode:function(uiSourceCode) 824 return id;}
860 {this._navigatorViewForUISourceCode(uiSourceCode).addUISourceCode(uiSourceCode); },removeUISourceCode:function(uiSourceCode) 825 return null;},revealUISourceCode:function(uiSourceCode)
861 {this._navigatorViewForUISourceCode(uiSourceCode).removeUISourceCode(uiSourceCod e);},revealUISourceCode:function(uiSourceCode,select) 826 {var id=this._navigatorViewIdForUISourceCode(uiSourceCode);if(!id)
862 {this._navigatorViewForUISourceCode(uiSourceCode).revealUISourceCode(uiSourceCod e,select);if(uiSourceCode.isContentScript) 827 return;var navigatorView=this._navigatorViews.get(id);console.assert(navigatorVi ew);navigatorView.revealUISourceCode(uiSourceCode,true);this._tabbedPane.selectT ab(id);},_sourceSelected:function(event)
863 this._tabbedPane.selectTab(WebInspector.SourcesNavigator.ContentScriptsTab);else if(uiSourceCode.project().type()!==WebInspector.projectTypes.Snippets) 828 {this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.SourceSelect ed,event.data);},_sourceRenamed:function(event)
864 this._tabbedPane.selectTab(WebInspector.SourcesNavigator.SourcesTab);},updateIco n:function(uiSourceCode) 829 {this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.SourceRename d,event.data);},__proto__:WebInspector.Object.prototype}
865 {this._navigatorViewForUISourceCode(uiSourceCode).updateIcon(uiSourceCode);},ren ame:function(uiSourceCode,callback)
866 {this._navigatorViewForUISourceCode(uiSourceCode).rename(uiSourceCode,callback); },_sourceSelected:function(event)
867 {this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.SourceSelect ed,event.data);},_itemSearchStarted:function(event)
868 {this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.ItemSearchSt arted,event.data);},_itemRenamingRequested:function(event)
869 {this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.ItemRenaming Requested,event.data);},_itemCreationRequested:function(event)
870 {this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.ItemCreation Requested,event.data);},__proto__:WebInspector.Object.prototype}
871 WebInspector.SnippetsNavigatorView=function() 830 WebInspector.SnippetsNavigatorView=function()
872 {WebInspector.NavigatorView.call(this);} 831 {WebInspector.NavigatorView.call(this);}
873 WebInspector.SnippetsNavigatorView.prototype={handleContextMenu:function(event) 832 WebInspector.SnippetsNavigatorView.prototype={accept:function(uiSourceCode)
833 {if(!WebInspector.NavigatorView.prototype.accept(uiSourceCode))
834 return false;return uiSourceCode.project().type()===WebInspector.projectTypes.Sn ippets;},handleContextMenu:function(event)
874 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendItem(WebI nspector.UIString("New"),this._handleCreateSnippet.bind(this));contextMenu.show( );},handleFileContextMenu:function(event,uiSourceCode) 835 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendItem(WebI nspector.UIString("New"),this._handleCreateSnippet.bind(this));contextMenu.show( );},handleFileContextMenu:function(event,uiSourceCode)
875 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendItem(WebI nspector.UIString("Run"),this._handleEvaluateSnippet.bind(this,uiSourceCode));co ntextMenu.appendItem(WebInspector.UIString("Rename"),this.requestRename.bind(thi s,uiSourceCode));contextMenu.appendItem(WebInspector.UIString("Remove"),this._ha ndleRemoveSnippet.bind(this,uiSourceCode));contextMenu.appendSeparator();context Menu.appendItem(WebInspector.UIString("New"),this._handleCreateSnippet.bind(this ));contextMenu.show();},_handleEvaluateSnippet:function(uiSourceCode) 836 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendItem(WebI nspector.UIString("Run"),this._handleEvaluateSnippet.bind(this,uiSourceCode));co ntextMenu.appendItem(WebInspector.UIString("Rename"),this.rename.bind(this,uiSou rceCode));contextMenu.appendItem(WebInspector.UIString("Remove"),this._handleRem oveSnippet.bind(this,uiSourceCode));contextMenu.appendSeparator();contextMenu.ap pendItem(WebInspector.UIString("New"),this._handleCreateSnippet.bind(this));cont extMenu.show();},_handleEvaluateSnippet:function(uiSourceCode)
876 {if(uiSourceCode.project().type()!==WebInspector.projectTypes.Snippets) 837 {if(uiSourceCode.project().type()!==WebInspector.projectTypes.Snippets)
877 return;WebInspector.scriptSnippetModel.evaluateScriptSnippet(uiSourceCode);},_ha ndleRemoveSnippet:function(uiSourceCode) 838 return;WebInspector.scriptSnippetModel.evaluateScriptSnippet(uiSourceCode);},_ha ndleRemoveSnippet:function(uiSourceCode)
878 {if(uiSourceCode.project().type()!==WebInspector.projectTypes.Snippets) 839 {if(uiSourceCode.project().type()!==WebInspector.projectTypes.Snippets)
879 return;uiSourceCode.project().deleteFile(uiSourceCode.path());},_handleCreateSni ppet:function() 840 return;uiSourceCode.remove();},_handleCreateSnippet:function()
880 {var data={};data.project=WebInspector.scriptSnippetModel.project();data.path="" ;this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemCreationReq uested,data);},sourceDeleted:function(uiSourceCode) 841 {this.create(WebInspector.scriptSnippetModel.project(),"")},sourceDeleted:functi on(uiSourceCode)
881 {this._handleRemoveSnippet(uiSourceCode);},__proto__:WebInspector.NavigatorView. prototype};WebInspector.SourcesSearchScope=function() 842 {this._handleRemoveSnippet(uiSourceCode);},__proto__:WebInspector.NavigatorView. prototype};WebInspector.SourcesSearchScope=function()
882 {this._searchId=0;this._workspace=WebInspector.workspace;} 843 {this._searchId=0;this._workspace=WebInspector.workspace;}
883 WebInspector.SourcesSearchScope.prototype={performIndexing:function(progress,ind exingFinishedCallback) 844 WebInspector.SourcesSearchScope.prototype={performIndexing:function(progress,ind exingFinishedCallback)
884 {this.stopSearch();function filterOutServiceProjects(project) 845 {this.stopSearch();var projects=this._workspace.projects().filter(this._filterOu tServiceProjects);var barrier=new CallbackBarrier();var compositeProgress=new We bInspector.CompositeProgress(progress);progress.addEventListener(WebInspector.Pr ogress.Events.Canceled,indexingCanceled);for(var i=0;i<projects.length;++i){var project=projects[i];var projectProgress=compositeProgress.createSubProgress(proj ect.uiSourceCodes().length);project.indexContent(projectProgress,barrier.createC allback());}
885 {return!project.isServiceProject();}
886 var projects=this._workspace.projects().filter(filterOutServiceProjects);var bar rier=new CallbackBarrier();var compositeProgress=new WebInspector.CompositeProgr ess(progress);progress.addEventListener(WebInspector.Progress.Events.Canceled,in dexingCanceled.bind(this));for(var i=0;i<projects.length;++i){var project=projec ts[i];var projectProgress=compositeProgress.createSubProgress(project.uiSourceCo des().length);project.indexContent(projectProgress,barrier.createCallback());}
887 barrier.callWhenDone(indexingFinishedCallback.bind(this,true));function indexing Canceled() 846 barrier.callWhenDone(indexingFinishedCallback.bind(this,true));function indexing Canceled()
888 {indexingFinishedCallback(false);progress.done();}},performSearch:function(searc hConfig,progress,searchResultCallback,searchFinishedCallback) 847 {indexingFinishedCallback(false);progress.done();}},_filterOutServiceProjects:fu nction(project)
889 {this.stopSearch();this._searchResultCallback=searchResultCallback;this._searchF inishedCallback=searchFinishedCallback;this._searchConfig=searchConfig;function filterOutServiceProjects(project) 848 {return!project.isServiceProject()||project.type()===WebInspector.projectTypes.F ormatter;},performSearch:function(searchConfig,progress,searchResultCallback,sea rchFinishedCallback)
890 {return!project.isServiceProject();} 849 {this.stopSearch();this._searchResultCallback=searchResultCallback;this._searchF inishedCallback=searchFinishedCallback;this._searchConfig=searchConfig;var proje cts=this._workspace.projects().filter(this._filterOutServiceProjects);var barrie r=new CallbackBarrier();var compositeProgress=new WebInspector.CompositeProgress (progress);for(var i=0;i<projects.length;++i){var project=projects[i];var weight =project.uiSourceCodes().length;var projectProgress=new WebInspector.CompositePr ogress(compositeProgress.createSubProgress(weight));var findMatchingFilesProgres s=projectProgress.createSubProgress();var searchContentProgress=projectProgress. createSubProgress();var barrierCallback=barrier.createCallback();var callback=th is._processMatchingFilesForProject.bind(this,this._searchId,project,searchConten tProgress,barrierCallback);project.findFilesMatchingSearchRequest(searchConfig.q ueries(),searchConfig.fileQueries(),!searchConfig.ignoreCase,searchConfig.isRege x,findMatchingFilesProgress,callback);}
891 var projects=this._workspace.projects().filter(filterOutServiceProjects);var bar rier=new CallbackBarrier();var compositeProgress=new WebInspector.CompositeProgr ess(progress);for(var i=0;i<projects.length;++i){var project=projects[i];var wei ght=project.uiSourceCodes().length;var projectProgress=new WebInspector.Composit eProgress(compositeProgress.createSubProgress(weight));var findMatchingFilesProg ress=projectProgress.createSubProgress();var searchContentProgress=projectProgre ss.createSubProgress();var barrierCallback=barrier.createCallback();var callback =this._processMatchingFilesForProject.bind(this,this._searchId,project,searchCon tentProgress,barrierCallback);project.findFilesMatchingSearchRequest(searchConfi g.queries(),searchConfig.fileQueries(),!searchConfig.ignoreCase,searchConfig.isR egex,findMatchingFilesProgress,callback);}
892 barrier.callWhenDone(this._searchFinishedCallback.bind(this,true));},_processMat chingFilesForProject:function(searchId,project,progress,callback,files) 850 barrier.callWhenDone(this._searchFinishedCallback.bind(this,true));},_processMat chingFilesForProject:function(searchId,project,progress,callback,files)
893 {if(searchId!==this._searchId){this._searchFinishedCallback(false);return;} 851 {if(searchId!==this._searchId){this._searchFinishedCallback(false);return;}
894 if(!files.length){progress.done();callback();return;} 852 if(!files.length){progress.done();callback();return;}
895 progress.setTotalWork(files.length);var fileIndex=0;var maxFileContentRequests=2 0;var callbacksLeft=0;for(var i=0;i<maxFileContentRequests&&i<files.length;++i) 853 progress.setTotalWork(files.length);var fileIndex=0;var maxFileContentRequests=2 0;var callbacksLeft=0;for(var i=0;i<maxFileContentRequests&&i<files.length;++i)
896 scheduleSearchInNextFileOrFinish.call(this);function searchInNextFile(path) 854 scheduleSearchInNextFileOrFinish.call(this);function searchInNextFile(path)
897 {var uiSourceCode=project.uiSourceCode(path);if(!uiSourceCode){--callbacksLeft;p rogress.worked(1);scheduleSearchInNextFileOrFinish.call(this);return;} 855 {var uiSourceCode=project.uiSourceCode(path);if(!uiSourceCode){--callbacksLeft;p rogress.worked(1);scheduleSearchInNextFileOrFinish.call(this);return;}
898 uiSourceCode.requestContent(contentLoaded.bind(this,path));} 856 uiSourceCode.requestContent(contentLoaded.bind(this,path));}
899 function scheduleSearchInNextFileOrFinish() 857 function scheduleSearchInNextFileOrFinish()
900 {if(fileIndex>=files.length){if(!callbacksLeft){progress.done();callback();retur n;} 858 {if(fileIndex>=files.length){if(!callbacksLeft){progress.done();callback();retur n;}
901 return;} 859 return;}
902 ++callbacksLeft;var path=files[fileIndex++];setTimeout(searchInNextFile.bind(thi s,path),0);} 860 ++callbacksLeft;var path=files[fileIndex++];setTimeout(searchInNextFile.bind(thi s,path),0);}
903 function contentLoaded(path,content) 861 function contentLoaded(path,content)
904 {function matchesComparator(a,b) 862 {function matchesComparator(a,b)
905 {return a.lineNumber-b.lineNumber;} 863 {return a.lineNumber-b.lineNumber;}
906 progress.worked(1);var matches=[];var queries=this._searchConfig.queries();if(co ntent!==null){for(var i=0;i<queries.length;++i){var nextMatches=WebInspector.Con tentProvider.performSearchInContent(content,queries[i],!this._searchConfig.ignor eCase,this._searchConfig.isRegex) 864 progress.worked(1);var matches=[];var queries=this._searchConfig.queries();if(co ntent!==null){for(var i=0;i<queries.length;++i){var nextMatches=WebInspector.Con tentProvider.performSearchInContent(content,queries[i],!this._searchConfig.ignor eCase,this._searchConfig.isRegex)
907 matches=matches.mergeOrdered(nextMatches,matchesComparator);}} 865 matches=matches.mergeOrdered(nextMatches,matchesComparator);}}
908 var uiSourceCode=project.uiSourceCode(path);if(matches&&uiSourceCode){var search Result=new WebInspector.FileBasedSearchResultsPane.SearchResult(uiSourceCode,mat ches);this._searchResultCallback(searchResult);} 866 var uiSourceCode=project.uiSourceCode(path);if(matches&&uiSourceCode){var search Result=new WebInspector.FileBasedSearchResultsPane.SearchResult(uiSourceCode,mat ches);this._searchResultCallback(searchResult);}
909 --callbacksLeft;scheduleSearchInNextFileOrFinish.call(this);}},stopSearch:functi on() 867 --callbacksLeft;scheduleSearchInNextFileOrFinish.call(this);}},stopSearch:functi on()
910 {++this._searchId;},createSearchResultsPane:function(searchConfig) 868 {++this._searchId;},createSearchResultsPane:function(searchConfig)
911 {return new WebInspector.FileBasedSearchResultsPane(searchConfig);}};WebInspecto r.StyleSheetOutlineDialog=function(view,uiSourceCode,selectItemCallback) 869 {return new WebInspector.FileBasedSearchResultsPane(searchConfig);}};WebInspecto r.StyleSheetOutlineDialog=function(uiSourceCode,selectItemCallback)
912 {WebInspector.SelectionDialogContentProvider.call(this);this._selectItemCallback =selectItemCallback;this._rules=[];this._view=view;this._uiSourceCode=uiSourceCo de;this._requestItems();} 870 {WebInspector.SelectionDialogContentProvider.call(this);this._selectItemCallback =selectItemCallback;this._cssParser=new WebInspector.CSSParser();this._cssParser .addEventListener(WebInspector.CSSParser.Events.RulesParsed,this.refresh.bind(th is));this._cssParser.parse(uiSourceCode.workingCopy());}
913 WebInspector.StyleSheetOutlineDialog.show=function(view,uiSourceCode,selectItemC allback) 871 WebInspector.StyleSheetOutlineDialog.show=function(view,uiSourceCode,selectItemC allback)
914 {if(WebInspector.Dialog.currentInstance()) 872 {if(WebInspector.Dialog.currentInstance())
915 return null;var delegate=new WebInspector.StyleSheetOutlineDialog(view,uiSourceC ode,selectItemCallback);var filteredItemSelectionDialog=new WebInspector.Filtere dItemSelectionDialog(delegate);WebInspector.Dialog.show(view.element,filteredIte mSelectionDialog);} 873 return null;var delegate=new WebInspector.StyleSheetOutlineDialog(uiSourceCode,s electItemCallback);var filteredItemSelectionDialog=new WebInspector.FilteredItem SelectionDialog(delegate);WebInspector.Dialog.show(view.element,filteredItemSele ctionDialog);}
916 WebInspector.StyleSheetOutlineDialog.prototype={itemCount:function() 874 WebInspector.StyleSheetOutlineDialog.prototype={itemCount:function()
917 {return this._rules.length;},itemKeyAt:function(itemIndex) 875 {return this._cssParser.rules().length;},itemKeyAt:function(itemIndex)
918 {return this._rules[itemIndex].selectorText;},itemScoreAt:function(itemIndex,que ry) 876 {var rule=this._cssParser.rules()[itemIndex];return rule.selectorText||rule.atRu le;},itemScoreAt:function(itemIndex,query)
919 {var rule=this._rules[itemIndex];return-rule.rawLocation.lineNumber;},renderItem :function(itemIndex,query,titleElement,subtitleElement) 877 {var rule=this._cssParser.rules()[itemIndex];return-rule.lineNumber;},renderItem :function(itemIndex,query,titleElement,subtitleElement)
920 {var rule=this._rules[itemIndex];titleElement.textContent=rule.selectorText;this .highlightRanges(titleElement,query);subtitleElement.textContent=":"+(rule.rawLo cation.lineNumber+1);},_requestItems:function() 878 {var rule=this._cssParser.rules()[itemIndex];titleElement.textContent=rule.selec torText||rule.atRule;this.highlightRanges(titleElement,query);subtitleElement.te xtContent=":"+(rule.lineNumber+1);},selectItem:function(itemIndex,promptValue)
921 {function didGetAllStyleSheets(error,infos) 879 {var rule=this._cssParser.rules()[itemIndex];var lineNumber=rule.lineNumber;if(! isNaN(lineNumber)&&lineNumber>=0)
922 {if(error) 880 this._selectItemCallback(lineNumber,rule.columnNumber);},dispose:function()
923 return;for(var i=0;i<infos.length;++i){var info=infos[i];if(info.sourceURL===thi s._uiSourceCode.url){WebInspector.CSSStyleSheet.createForId(info.styleSheetId,di dGetStyleSheet.bind(this));return;}}} 881 {this._cssParser.dispose();},__proto__:WebInspector.SelectionDialogContentProvid er.prototype};WebInspector.TabbedEditorContainerDelegate=function(){}
924 CSSAgent.getAllStyleSheets(didGetAllStyleSheets.bind(this));function didGetStyle Sheet(styleSheet) 882 WebInspector.TabbedEditorContainerDelegate.prototype={viewForFile:function(uiSou rceCode){},}
925 {if(!styleSheet)
926 return;this._rules=styleSheet.rules;this.refresh();}},selectItem:function(itemIn dex,promptValue)
927 {var rule=this._rules[itemIndex];var lineNumber=rule.rawLocation.lineNumber;if(! isNaN(lineNumber)&&lineNumber>=0)
928 this._selectItemCallback(lineNumber,rule.rawLocation.columnNumber);},__proto__:W ebInspector.SelectionDialogContentProvider.prototype};WebInspector.TabbedEditorC ontainerDelegate=function(){}
929 WebInspector.TabbedEditorContainerDelegate.prototype={viewForFile:function(uiSou rceCode){}}
930 WebInspector.TabbedEditorContainer=function(delegate,settingName,placeholderText ) 883 WebInspector.TabbedEditorContainer=function(delegate,settingName,placeholderText )
931 {WebInspector.Object.call(this);this._delegate=delegate;this._tabbedPane=new Web Inspector.TabbedPane();this._tabbedPane.setPlaceholderText(placeholderText);this ._tabbedPane.setTabDelegate(new WebInspector.EditorContainerTabDelegate(this));t his._tabbedPane.closeableTabs=true;this._tabbedPane.element.id="sources-editor-c ontainer-tabbed-pane";this._tabbedPane.addEventListener(WebInspector.TabbedPane. EventTypes.TabClosed,this._tabClosed,this);this._tabbedPane.addEventListener(Web Inspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);this._tabIds =new Map();this._files={};this._previouslyViewedFilesSetting=WebInspector.settin gs.createSetting(settingName,[]);this._history=WebInspector.TabbedEditorContaine r.History.fromObject(this._previouslyViewedFilesSetting.get());} 884 {WebInspector.Object.call(this);this._delegate=delegate;this._tabbedPane=new Web Inspector.TabbedPane();this._tabbedPane.setPlaceholderText(placeholderText);this ._tabbedPane.setTabDelegate(new WebInspector.EditorContainerTabDelegate(this));t his._tabbedPane.closeableTabs=true;this._tabbedPane.element.id="sources-editor-c ontainer-tabbed-pane";this._tabbedPane.addEventListener(WebInspector.TabbedPane. EventTypes.TabClosed,this._tabClosed,this);this._tabbedPane.addEventListener(Web Inspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);this._tabIds =new Map();this._files={};this._previouslyViewedFilesSetting=WebInspector.settin gs.createSetting(settingName,[]);this._history=WebInspector.TabbedEditorContaine r.History.fromObject(this._previouslyViewedFilesSetting.get());}
932 WebInspector.TabbedEditorContainer.Events={EditorSelected:"EditorSelected",Edito rClosed:"EditorClosed"} 885 WebInspector.TabbedEditorContainer.Events={EditorSelected:"EditorSelected",Edito rClosed:"EditorClosed"}
933 WebInspector.TabbedEditorContainer._tabId=0;WebInspector.TabbedEditorContainer.m aximalPreviouslyViewedFilesCount=30;WebInspector.TabbedEditorContainer.prototype ={get view() 886 WebInspector.TabbedEditorContainer._tabId=0;WebInspector.TabbedEditorContainer.m aximalPreviouslyViewedFilesCount=30;WebInspector.TabbedEditorContainer.prototype ={get view()
934 {return this._tabbedPane;},get visibleView() 887 {return this._tabbedPane;},get visibleView()
935 {return this._tabbedPane.visibleView;},show:function(parentElement) 888 {return this._tabbedPane.visibleView;},show:function(parentElement)
936 {this._tabbedPane.show(parentElement);},showFile:function(uiSourceCode) 889 {this._tabbedPane.show(parentElement);},showFile:function(uiSourceCode)
937 {this._innerShowFile(uiSourceCode,true);},historyUISourceCodes:function() 890 {this._innerShowFile(uiSourceCode,true);},closeFile:function(uiSourceCode)
891 {var tabId=this._tabIds.get(uiSourceCode);if(!tabId)
892 return;this._closeTabs([tabId]);},historyUISourceCodes:function()
938 {var uriToUISourceCode={};for(var id in this._files){var uiSourceCode=this._file s[id];uriToUISourceCode[uiSourceCode.uri()]=uiSourceCode;} 893 {var uriToUISourceCode={};for(var id in this._files){var uiSourceCode=this._file s[id];uriToUISourceCode[uiSourceCode.uri()]=uiSourceCode;}
939 var result=[];var uris=this._history._urls();for(var i=0;i<uris.length;++i){var uiSourceCode=uriToUISourceCode[uris[i]];if(uiSourceCode) 894 var result=[];var uris=this._history._urls();for(var i=0;i<uris.length;++i){var uiSourceCode=uriToUISourceCode[uris[i]];if(uiSourceCode)
940 result.push(uiSourceCode);} 895 result.push(uiSourceCode);}
941 return result;},_addScrollAndSelectionListeners:function() 896 return result;},_addViewListeners:function()
942 {if(!this._currentView) 897 {if(!this._currentView)
943 return;this._currentView.addEventListener(WebInspector.SourceFrame.Events.Scroll Changed,this._scrollChanged,this);this._currentView.addEventListener(WebInspecto r.SourceFrame.Events.SelectionChanged,this._selectionChanged,this);},_removeScro llAndSelectionListeners:function() 898 return;this._currentView.addEventListener(WebInspector.SourceFrame.Events.Scroll Changed,this._scrollChanged,this);this._currentView.addEventListener(WebInspecto r.SourceFrame.Events.SelectionChanged,this._selectionChanged,this);},_removeView Listeners:function()
944 {if(!this._currentView) 899 {if(!this._currentView)
945 return;this._currentView.removeEventListener(WebInspector.SourceFrame.Events.Scr ollChanged,this._scrollChanged,this);this._currentView.removeEventListener(WebIn spector.SourceFrame.Events.SelectionChanged,this._selectionChanged,this);},_scro llChanged:function(event) 900 return;this._currentView.removeEventListener(WebInspector.SourceFrame.Events.Scr ollChanged,this._scrollChanged,this);this._currentView.removeEventListener(WebIn spector.SourceFrame.Events.SelectionChanged,this._selectionChanged,this);},_scro llChanged:function(event)
946 {var lineNumber=(event.data);this._history.updateScrollLineNumber(this._currentF ile.uri(),lineNumber);this._history.save(this._previouslyViewedFilesSetting);},_ selectionChanged:function(event) 901 {var lineNumber=(event.data);this._history.updateScrollLineNumber(this._currentF ile.uri(),lineNumber);this._history.save(this._previouslyViewedFilesSetting);},_ selectionChanged:function(event)
947 {var range=(event.data);this._history.updateSelectionRange(this._currentFile.uri (),range);this._history.save(this._previouslyViewedFilesSetting);},_innerShowFil e:function(uiSourceCode,userGesture) 902 {var range=(event.data);this._history.updateSelectionRange(this._currentFile.uri (),range);this._history.save(this._previouslyViewedFilesSetting);},_innerShowFil e:function(uiSourceCode,userGesture)
948 {if(this._currentFile===uiSourceCode) 903 {if(this._currentFile===uiSourceCode)
949 return;this._removeScrollAndSelectionListeners();this._currentFile=uiSourceCode; var tabId=this._tabIds.get(uiSourceCode)||this._appendFileTab(uiSourceCode,userG esture);this._tabbedPane.selectTab(tabId,userGesture);if(userGesture) 904 return;this._removeViewListeners();this._currentFile=uiSourceCode;var tabId=this ._tabIds.get(uiSourceCode)||this._appendFileTab(uiSourceCode,userGesture);this._ tabbedPane.selectTab(tabId,userGesture);if(userGesture)
950 this._editorSelectedByUserAction();this._currentView=this.visibleView;this._addS crollAndSelectionListeners();var eventData={currentFile:this._currentFile,userGe sture:userGesture};this.dispatchEventToListeners(WebInspector.TabbedEditorContai ner.Events.EditorSelected,eventData);},_titleForFile:function(uiSourceCode) 905 this._editorSelectedByUserAction();this._currentView=this.visibleView;this._addV iewListeners();var eventData={currentFile:this._currentFile,userGesture:userGest ure};this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events.Edi torSelected,eventData);},_titleForFile:function(uiSourceCode)
951 {var maxDisplayNameLength=30;var title=uiSourceCode.displayName(true).trimMiddle (maxDisplayNameLength);if(uiSourceCode.isDirty()||uiSourceCode.hasUnsavedCommitt edChanges()) 906 {var maxDisplayNameLength=30;var title=uiSourceCode.displayName(true).trimMiddle (maxDisplayNameLength);if(uiSourceCode.isDirty()||uiSourceCode.hasUnsavedCommitt edChanges())
952 title+="*";return title;},_maybeCloseTab:function(id,nextTabId) 907 title+="*";return title;},_maybeCloseTab:function(id,nextTabId)
953 {var uiSourceCode=this._files[id];var shouldPrompt=uiSourceCode.isDirty()&&uiSou rceCode.project().canSetFileContent();if(!shouldPrompt||confirm(WebInspector.UIS tring("Are you sure you want to close unsaved file: %s?",uiSourceCode.name()))){ uiSourceCode.resetWorkingCopy();if(nextTabId) 908 {var uiSourceCode=this._files[id];var shouldPrompt=uiSourceCode.isDirty()&&uiSou rceCode.project().canSetFileContent();if(!shouldPrompt||confirm(WebInspector.UIS tring("Are you sure you want to close unsaved file: %s?",uiSourceCode.name()))){ uiSourceCode.resetWorkingCopy();if(nextTabId)
954 this._tabbedPane.selectTab(nextTabId,true);this._tabbedPane.closeTab(id,true);re turn true;} 909 this._tabbedPane.selectTab(nextTabId,true);this._tabbedPane.closeTab(id,true);re turn true;}
955 return false;},_closeTabs:function(ids) 910 return false;},_closeTabs:function(ids)
956 {var dirtyTabs=[];var cleanTabs=[];for(var i=0;i<ids.length;++i){var id=ids[i];v ar uiSourceCode=this._files[id];if(uiSourceCode.isDirty()) 911 {var dirtyTabs=[];var cleanTabs=[];for(var i=0;i<ids.length;++i){var id=ids[i];v ar uiSourceCode=this._files[id];if(uiSourceCode.isDirty())
957 dirtyTabs.push(id);else 912 dirtyTabs.push(id);else
958 cleanTabs.push(id);} 913 cleanTabs.push(id);}
959 if(dirtyTabs.length) 914 if(dirtyTabs.length)
960 this._tabbedPane.selectTab(dirtyTabs[0],true);this._tabbedPane.closeTabs(cleanTa bs,true);for(var i=0;i<dirtyTabs.length;++i){var nextTabId=i+1<dirtyTabs.length? dirtyTabs[i+1]:null;if(!this._maybeCloseTab(dirtyTabs[i],nextTabId)) 915 this._tabbedPane.selectTab(dirtyTabs[0],true);this._tabbedPane.closeTabs(cleanTa bs,true);for(var i=0;i<dirtyTabs.length;++i){var nextTabId=i+1<dirtyTabs.length? dirtyTabs[i+1]:null;if(!this._maybeCloseTab(dirtyTabs[i],nextTabId))
(...skipping 11 matching lines...) Expand all
972 this._tabbedPane.closeTabs(tabIds);},_editorClosedByUserAction:function(uiSource Code) 927 this._tabbedPane.closeTabs(tabIds);},_editorClosedByUserAction:function(uiSource Code)
973 {this._userSelectedFiles=true;this._history.remove(uiSourceCode.uri());this._upd ateHistory();},_editorSelectedByUserAction:function() 928 {this._userSelectedFiles=true;this._history.remove(uiSourceCode.uri());this._upd ateHistory();},_editorSelectedByUserAction:function()
974 {this._userSelectedFiles=true;this._updateHistory();},_updateHistory:function() 929 {this._userSelectedFiles=true;this._updateHistory();},_updateHistory:function()
975 {var tabIds=this._tabbedPane.lastOpenedTabIds(WebInspector.TabbedEditorContainer .maximalPreviouslyViewedFilesCount);function tabIdToURI(tabId) 930 {var tabIds=this._tabbedPane.lastOpenedTabIds(WebInspector.TabbedEditorContainer .maximalPreviouslyViewedFilesCount);function tabIdToURI(tabId)
976 {return this._files[tabId].uri();} 931 {return this._files[tabId].uri();}
977 this._history.update(tabIds.map(tabIdToURI.bind(this)));this._history.save(this. _previouslyViewedFilesSetting);},_tooltipForFile:function(uiSourceCode) 932 this._history.update(tabIds.map(tabIdToURI.bind(this)));this._history.save(this. _previouslyViewedFilesSetting);},_tooltipForFile:function(uiSourceCode)
978 {return uiSourceCode.originURL();},_appendFileTab:function(uiSourceCode,userGest ure) 933 {return uiSourceCode.originURL();},_appendFileTab:function(uiSourceCode,userGest ure)
979 {var view=this._delegate.viewForFile(uiSourceCode);var title=this._titleForFile( uiSourceCode);var tooltip=this._tooltipForFile(uiSourceCode);var tabId=this._gen erateTabId();this._tabIds.put(uiSourceCode,tabId);this._files[tabId]=uiSourceCod e;var savedSelectionRange=this._history.selectionRange(uiSourceCode.uri());if(sa vedSelectionRange) 934 {var view=this._delegate.viewForFile(uiSourceCode);var title=this._titleForFile( uiSourceCode);var tooltip=this._tooltipForFile(uiSourceCode);var tabId=this._gen erateTabId();this._tabIds.put(uiSourceCode,tabId);this._files[tabId]=uiSourceCod e;var savedSelectionRange=this._history.selectionRange(uiSourceCode.uri());if(sa vedSelectionRange)
980 view.setSelection(savedSelectionRange);var savedScrollLineNumber=this._history.s crollLineNumber(uiSourceCode.uri());if(savedScrollLineNumber) 935 view.setSelection(savedSelectionRange);var savedScrollLineNumber=this._history.s crollLineNumber(uiSourceCode.uri());if(savedScrollLineNumber)
981 view.scrollToLine(savedScrollLineNumber);this._tabbedPane.appendTab(tabId,title, view,tooltip,userGesture);this._updateFileTitle(uiSourceCode);this._addUISourceC odeListeners(uiSourceCode);return tabId;},_tabClosed:function(event) 936 view.scrollToLine(savedScrollLineNumber);this._tabbedPane.appendTab(tabId,title, view,tooltip,userGesture);this._updateFileTitle(uiSourceCode);this._addUISourceC odeListeners(uiSourceCode);return tabId;},_tabClosed:function(event)
982 {var tabId=(event.data.tabId);var userGesture=(event.data.isUserGesture);var uiS ourceCode=this._files[tabId];if(this._currentFile===uiSourceCode){this._removeSc rollAndSelectionListeners();delete this._currentView;delete this._currentFile;} 937 {var tabId=(event.data.tabId);var userGesture=(event.data.isUserGesture);var uiS ourceCode=this._files[tabId];if(this._currentFile===uiSourceCode){this._removeVi ewListeners();delete this._currentView;delete this._currentFile;}
983 this._tabIds.remove(uiSourceCode);delete this._files[tabId];this._removeUISource CodeListeners(uiSourceCode);this.dispatchEventToListeners(WebInspector.TabbedEdi torContainer.Events.EditorClosed,uiSourceCode);if(userGesture) 938 this._tabIds.remove(uiSourceCode);delete this._files[tabId];this._removeUISource CodeListeners(uiSourceCode);this.dispatchEventToListeners(WebInspector.TabbedEdi torContainer.Events.EditorClosed,uiSourceCode);if(userGesture)
984 this._editorClosedByUserAction(uiSourceCode);},_tabSelected:function(event) 939 this._editorClosedByUserAction(uiSourceCode);},_tabSelected:function(event)
985 {var tabId=(event.data.tabId);var userGesture=(event.data.isUserGesture);var uiS ourceCode=this._files[tabId];this._innerShowFile(uiSourceCode,userGesture);},_ad dUISourceCodeListeners:function(uiSourceCode) 940 {var tabId=(event.data.tabId);var userGesture=(event.data.isUserGesture);var uiS ourceCode=this._files[tabId];this._innerShowFile(uiSourceCode,userGesture);},_ad dUISourceCodeListeners:function(uiSourceCode)
986 {uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged,thi s._uiSourceCodeTitleChanged,this);uiSourceCode.addEventListener(WebInspector.UIS ourceCode.Events.WorkingCopyChanged,this._uiSourceCodeWorkingCopyChanged,this);u iSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitt ed,this._uiSourceCodeWorkingCopyCommitted,this);uiSourceCode.addEventListener(We bInspector.UISourceCode.Events.SavedStateUpdated,this._uiSourceCodeSavedStateUpd ated,this);uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Format tedChanged,this._uiSourceCodeFormattedChanged,this);},_removeUISourceCodeListene rs:function(uiSourceCode) 941 {uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged,thi s._uiSourceCodeTitleChanged,this);uiSourceCode.addEventListener(WebInspector.UIS ourceCode.Events.WorkingCopyChanged,this._uiSourceCodeWorkingCopyChanged,this);u iSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitt ed,this._uiSourceCodeWorkingCopyCommitted,this);uiSourceCode.addEventListener(We bInspector.UISourceCode.Events.SavedStateUpdated,this._uiSourceCodeSavedStateUpd ated,this);},_removeUISourceCodeListeners:function(uiSourceCode)
987 {uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged,this);uiSourceCode.removeEventListener(WebInspect or.UISourceCode.Events.WorkingCopyChanged,this._uiSourceCodeWorkingCopyChanged,t his);uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCo pyCommitted,this._uiSourceCodeWorkingCopyCommitted,this);uiSourceCode.removeEven tListener(WebInspector.UISourceCode.Events.SavedStateUpdated,this._uiSourceCodeS avedStateUpdated,this);uiSourceCode.removeEventListener(WebInspector.UISourceCod e.Events.FormattedChanged,this._uiSourceCodeFormattedChanged,this);},_updateFile Title:function(uiSourceCode) 942 {uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged,this);uiSourceCode.removeEventListener(WebInspect or.UISourceCode.Events.WorkingCopyChanged,this._uiSourceCodeWorkingCopyChanged,t his);uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCo pyCommitted,this._uiSourceCodeWorkingCopyCommitted,this);uiSourceCode.removeEven tListener(WebInspector.UISourceCode.Events.SavedStateUpdated,this._uiSourceCodeS avedStateUpdated,this);},_updateFileTitle:function(uiSourceCode)
988 {var tabId=this._tabIds.get(uiSourceCode);if(tabId){var title=this._titleForFile (uiSourceCode);this._tabbedPane.changeTabTitle(tabId,title);if(uiSourceCode.hasU nsavedCommittedChanges()) 943 {var tabId=this._tabIds.get(uiSourceCode);if(tabId){var title=this._titleForFile (uiSourceCode);this._tabbedPane.changeTabTitle(tabId,title);if(uiSourceCode.hasU nsavedCommittedChanges())
989 this._tabbedPane.setTabIcon(tabId,"editor-container-unsaved-committed-changes-ic on",WebInspector.UIString("Changes to this file were not saved to file system.") );else 944 this._tabbedPane.setTabIcon(tabId,"editor-container-unsaved-committed-changes-ic on",WebInspector.UIString("Changes to this file were not saved to file system.") );else
990 this._tabbedPane.setTabIcon(tabId,"");}},_uiSourceCodeTitleChanged:function(even t) 945 this._tabbedPane.setTabIcon(tabId,"");}},_uiSourceCodeTitleChanged:function(even t)
991 {var uiSourceCode=(event.target);this._updateFileTitle(uiSourceCode);this._updat eHistory();},_uiSourceCodeWorkingCopyChanged:function(event) 946 {var uiSourceCode=(event.target);this._updateFileTitle(uiSourceCode);this._updat eHistory();},_uiSourceCodeWorkingCopyChanged:function(event)
992 {var uiSourceCode=(event.target);this._updateFileTitle(uiSourceCode);},_uiSource CodeWorkingCopyCommitted:function(event) 947 {var uiSourceCode=(event.target);this._updateFileTitle(uiSourceCode);},_uiSource CodeWorkingCopyCommitted:function(event)
993 {var uiSourceCode=(event.target);this._updateFileTitle(uiSourceCode);},_uiSource CodeSavedStateUpdated:function(event) 948 {var uiSourceCode=(event.target);this._updateFileTitle(uiSourceCode);},_uiSource CodeSavedStateUpdated:function(event)
994 {var uiSourceCode=(event.target);this._updateFileTitle(uiSourceCode);},_uiSource CodeFormattedChanged:function(event)
995 {var uiSourceCode=(event.target);this._updateFileTitle(uiSourceCode);},reset:fun ction() 949 {var uiSourceCode=(event.target);this._updateFileTitle(uiSourceCode);},reset:fun ction()
996 {delete this._userSelectedFiles;},_generateTabId:function() 950 {delete this._userSelectedFiles;},_generateTabId:function()
997 {return"tab_"+(WebInspector.TabbedEditorContainer._tabId++);},currentFile:functi on() 951 {return"tab_"+(WebInspector.TabbedEditorContainer._tabId++);},currentFile:functi on()
998 {return this._currentFile;},__proto__:WebInspector.Object.prototype} 952 {return this._currentFile;},__proto__:WebInspector.Object.prototype}
999 WebInspector.TabbedEditorContainer.HistoryItem=function(url,selectionRange,scrol lLineNumber) 953 WebInspector.TabbedEditorContainer.HistoryItem=function(url,selectionRange,scrol lLineNumber)
1000 {this.url=url;this._isSerializable=url.length<WebInspector.TabbedEditorContainer .HistoryItem.serializableUrlLengthLimit;this.selectionRange=selectionRange;this. scrollLineNumber=scrollLineNumber;} 954 {this.url=url;this._isSerializable=url.length<WebInspector.TabbedEditorContainer .HistoryItem.serializableUrlLengthLimit;this.selectionRange=selectionRange;this. scrollLineNumber=scrollLineNumber;}
1001 WebInspector.TabbedEditorContainer.HistoryItem.serializableUrlLengthLimit=4096;W ebInspector.TabbedEditorContainer.HistoryItem.fromObject=function(serializedHist oryItem) 955 WebInspector.TabbedEditorContainer.HistoryItem.serializableUrlLengthLimit=4096;W ebInspector.TabbedEditorContainer.HistoryItem.fromObject=function(serializedHist oryItem)
1002 {var selectionRange=serializedHistoryItem.selectionRange?WebInspector.TextRange. fromObject(serializedHistoryItem.selectionRange):undefined;return new WebInspect or.TabbedEditorContainer.HistoryItem(serializedHistoryItem.url,selectionRange,se rializedHistoryItem.scrollLineNumber);} 956 {var selectionRange=serializedHistoryItem.selectionRange?WebInspector.TextRange. fromObject(serializedHistoryItem.selectionRange):undefined;return new WebInspect or.TabbedEditorContainer.HistoryItem(serializedHistoryItem.url,selectionRange,se rializedHistoryItem.scrollLineNumber);}
1003 WebInspector.TabbedEditorContainer.HistoryItem.prototype={serializeToObject:func tion() 957 WebInspector.TabbedEditorContainer.HistoryItem.prototype={serializeToObject:func tion()
1004 {if(!this._isSerializable) 958 {if(!this._isSerializable)
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 {if(!context.elementToEdit.textContent) 1068 {if(!context.elementToEdit.textContent)
1115 this.treeOutline.section.updateExpression(this,null);WebInspector.ObjectProperty TreeElement.prototype.editingCancelled.call(this,element,context);},applyExpress ion:function(expression,updateInterface) 1069 this.treeOutline.section.updateExpression(this,null);WebInspector.ObjectProperty TreeElement.prototype.editingCancelled.call(this,element,context);},applyExpress ion:function(expression,updateInterface)
1116 {expression=expression.trim();if(!expression) 1070 {expression=expression.trim();if(!expression)
1117 expression=null;this.property.name=expression;this.treeOutline.section.updateExp ression(this,expression);},__proto__:WebInspector.ObjectPropertyTreeElement.prot otype} 1071 expression=null;this.property.name=expression;this.treeOutline.section.updateExp ression(this,expression);},__proto__:WebInspector.ObjectPropertyTreeElement.prot otype}
1118 WebInspector.WatchedPropertyTreeElement=function(property) 1072 WebInspector.WatchedPropertyTreeElement=function(property)
1119 {WebInspector.ObjectPropertyTreeElement.call(this,property);} 1073 {WebInspector.ObjectPropertyTreeElement.call(this,property);}
1120 WebInspector.WatchedPropertyTreeElement.prototype={onattach:function() 1074 WebInspector.WatchedPropertyTreeElement.prototype={onattach:function()
1121 {WebInspector.ObjectPropertyTreeElement.prototype.onattach.call(this);if(this.ha sChildren&&this.propertyPath()in this.treeOutline.section._expandedProperties) 1075 {WebInspector.ObjectPropertyTreeElement.prototype.onattach.call(this);if(this.ha sChildren&&this.propertyPath()in this.treeOutline.section._expandedProperties)
1122 this.expand();},onexpand:function() 1076 this.expand();},onexpand:function()
1123 {WebInspector.ObjectPropertyTreeElement.prototype.onexpand.call(this);this.treeO utline.section._expandedProperties[this.propertyPath()]=true;},oncollapse:functi on() 1077 {WebInspector.ObjectPropertyTreeElement.prototype.onexpand.call(this);this.treeO utline.section._expandedProperties[this.propertyPath()]=true;},oncollapse:functi on()
1124 {WebInspector.ObjectPropertyTreeElement.prototype.oncollapse.call(this);delete t his.treeOutline.section._expandedProperties[this.propertyPath()];},__proto__:Web Inspector.ObjectPropertyTreeElement.prototype};WebInspector.Worker=function(id,u rl,shared) 1078 {WebInspector.ObjectPropertyTreeElement.prototype.oncollapse.call(this);delete t his.treeOutline.section._expandedProperties[this.propertyPath()];},__proto__:Web Inspector.ObjectPropertyTreeElement.prototype};WebInspector.WorkersSidebarPane=f unction()
1125 {this.id=id;this.url=url;this.shared=shared;}
1126 WebInspector.WorkersSidebarPane=function(workerManager)
1127 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Workers"));this._enab leWorkersCheckbox=new WebInspector.Checkbox(WebInspector.UIString("Pause on star t"),"sidebar-label",WebInspector.UIString("Automatically attach to new workers a nd pause them. Enabling this option will force opening inspector for all new wor kers."));this._enableWorkersCheckbox.element.id="pause-workers-checkbox";this.bo dyElement.appendChild(this._enableWorkersCheckbox.element);this._enableWorkersCh eckbox.addEventListener(this._autoattachToWorkersClicked.bind(this));this._enabl eWorkersCheckbox.checked=false;var note=this.bodyElement.createChild("div");note .id="shared-workers-list";note.classList.add("sidebar-label") 1079 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Workers"));this._enab leWorkersCheckbox=new WebInspector.Checkbox(WebInspector.UIString("Pause on star t"),"sidebar-label",WebInspector.UIString("Automatically attach to new workers a nd pause them. Enabling this option will force opening inspector for all new wor kers."));this._enableWorkersCheckbox.element.id="pause-workers-checkbox";this.bo dyElement.appendChild(this._enableWorkersCheckbox.element);this._enableWorkersCh eckbox.addEventListener(this._autoattachToWorkersClicked.bind(this));this._enabl eWorkersCheckbox.checked=false;var note=this.bodyElement.createChild("div");note .id="shared-workers-list";note.classList.add("sidebar-label")
1128 note.textContent=WebInspector.UIString("Shared workers can be inspected in the T ask Manager");var separator=this.bodyElement.createChild("div","sidebar-separato r");separator.textContent=WebInspector.UIString("Dedicated worker inspectors");t his._workerListElement=document.createElement("ol");this._workerListElement.tabI ndex=0;this._workerListElement.classList.add("properties-tree");this._workerList Element.classList.add("sidebar-label");this.bodyElement.appendChild(this._worker ListElement);this._idToWorkerItem={};this._workerManager=workerManager;workerMan ager.addEventListener(WebInspector.WorkerManager.Events.WorkerAdded,this._worker Added,this);workerManager.addEventListener(WebInspector.WorkerManager.Events.Wor kerRemoved,this._workerRemoved,this);workerManager.addEventListener(WebInspector .WorkerManager.Events.WorkersCleared,this._workersCleared,this);} 1080 note.textContent=WebInspector.UIString("Shared workers can be inspected in the T ask Manager");var separator=this.bodyElement.createChild("div","sidebar-separato r");separator.textContent=WebInspector.UIString("Dedicated worker inspectors");t his._workerListElement=document.createElement("ol");this._workerListElement.tabI ndex=0;this._workerListElement.classList.add("properties-tree");this._workerList Element.classList.add("sidebar-label");this.bodyElement.appendChild(this._worker ListElement);this._idToWorkerItem={};var threadList=WebInspector.workerManager.t hreadsList();for(var i=0;i<threadList.length;++i){var threadId=threadList[i];if( threadId===WebInspector.WorkerManager.MainThreadId)
1081 continue;this._addWorker(threadId,WebInspector.workerManager.threadUrl(threadId) );}
1082 WebInspector.workerManager.addEventListener(WebInspector.WorkerManager.Events.Wo rkerAdded,this._workerAdded,this);WebInspector.workerManager.addEventListener(We bInspector.WorkerManager.Events.WorkerRemoved,this._workerRemoved,this);WebInspe ctor.workerManager.addEventListener(WebInspector.WorkerManager.Events.WorkersCle ared,this._workersCleared,this);}
1129 WebInspector.WorkersSidebarPane.prototype={_workerAdded:function(event) 1083 WebInspector.WorkersSidebarPane.prototype={_workerAdded:function(event)
1130 {this._addWorker(event.data.workerId,event.data.url,event.data.inspectorConnecte d);},_workerRemoved:function(event) 1084 {this._addWorker(event.data.workerId,event.data.url);},_workerRemoved:function(e vent)
1131 {this._idToWorkerItem[event.data].remove();delete this._idToWorkerItem[event.dat a];},_workersCleared:function(event) 1085 {this._idToWorkerItem[event.data].remove();delete this._idToWorkerItem[event.dat a];},_workersCleared:function(event)
1132 {this._idToWorkerItem={};this._workerListElement.removeChildren();},_addWorker:f unction(workerId,url,inspectorConnected) 1086 {this._idToWorkerItem={};this._workerListElement.removeChildren();},_addWorker:f unction(workerId,url)
1133 {var item=this._workerListElement.createChild("div","dedicated-worker-item");var link=item.createChild("a");link.textContent=url;link.href="#";link.target="_bla nk";link.addEventListener("click",this._workerItemClicked.bind(this,workerId),tr ue);this._idToWorkerItem[workerId]=item;},_workerItemClicked:function(workerId,e vent) 1087 {var item=this._workerListElement.createChild("div","dedicated-worker-item");var link=item.createChild("a");link.textContent=url;link.href="#";link.target="_bla nk";link.addEventListener("click",this._workerItemClicked.bind(this,workerId),tr ue);this._idToWorkerItem[workerId]=item;},_workerItemClicked:function(workerId,e vent)
1134 {event.preventDefault();this._workerManager.openWorkerInspector(workerId);},_aut oattachToWorkersClicked:function(event) 1088 {event.preventDefault();WebInspector.workerFrontendManager.openWorkerInspector(w orkerId);},_autoattachToWorkersClicked:function(event)
1135 {WorkerAgent.setAutoconnectToWorkers(this._enableWorkersCheckbox.checked);},__pr oto__:WebInspector.SidebarPane.prototype};WebInspector.SourcesPanel=function(wor kspaceForTest) 1089 {WorkerAgent.setAutoconnectToWorkers(this._enableWorkersCheckbox.checked);},__pr oto__:WebInspector.SidebarPane.prototype};WebInspector.ThreadsToolbar=function()
1136 {WebInspector.Panel.call(this,"sources");this.registerRequiredCSS("sourcesPanel. css");this.registerRequiredCSS("textPrompt.css");WebInspector.settings.navigator WasOnceHidden=WebInspector.settings.createSetting("navigatorWasOnceHidden",false );WebInspector.settings.debuggerSidebarHidden=WebInspector.settings.createSettin g("debuggerSidebarHidden",false);WebInspector.settings.showEditorInDrawer=WebIns pector.settings.createSetting("showEditorInDrawer",true);this._workspace=workspa ceForTest||WebInspector.workspace;function viewGetter() 1090 {this.element=document.createElement("div");this.element.className="status-bar s cripts-debug-toolbar threads-toolbar hidden";this._comboBox=new WebInspector.Sta tusBarComboBox(this._onComboBoxSelectionChange.bind(this));this.element.appendCh ild(this._comboBox.element);this._reset();if(WebInspector.experimentsSettings.wo rkersInMainWindow.isEnabled()){WebInspector.workerManager.addEventListener(WebIn spector.WorkerManager.Events.WorkerAdded,this._workerAdded,this);WebInspector.wo rkerManager.addEventListener(WebInspector.WorkerManager.Events.WorkerRemoved,thi s._workerRemoved,this);WebInspector.workerManager.addEventListener(WebInspector. WorkerManager.Events.WorkersCleared,this._workersCleared,this);}}
1137 {return this;} 1091 WebInspector.ThreadsToolbar.prototype={_reset:function()
1138 WebInspector.GoToLineDialog.install(this,viewGetter.bind(this));var helpSection= WebInspector.shortcutsScreen.section(WebInspector.UIString("Sources Panel"));thi s.debugToolbar=this._createDebugToolbar();const initialDebugSidebarWidth=225;con st minimumDebugSidebarWidthPercent=0.5;this.createSidebarView(this.element,WebIn spector.SidebarView.SidebarPosition.End,initialDebugSidebarWidth);this.splitView .element.id="scripts-split-view";this.splitView.setSidebarElementConstraints(Pre ferences.minScriptsSidebarWidth);this.splitView.setMainElementConstraints(minimu mDebugSidebarWidthPercent);const initialNavigatorWidth=225;const minimumViewsCon tainerWidthPercent=0.5;this.editorView=new WebInspector.SidebarView(WebInspector .SidebarView.SidebarPosition.Start,"scriptsPanelNavigatorSidebarWidth",initialNa vigatorWidth);this.editorView.element.id="scripts-editor-split-view";this.editor View.element.tabIndex=0;this.editorView.setSidebarElementConstraints(Preferences .minScriptsSidebarWidth);this.editorView.setMainElementConstraints(minimumViewsC ontainerWidthPercent);this.splitView.setMainView(this.editorView);this._navigato r=new WebInspector.SourcesNavigator();this.editorView.setSidebarView(this._navig ator.view);var tabbedEditorPlaceholderText=WebInspector.isMac()?WebInspector.UIS tring("Hit Cmd+O to open a file"):WebInspector.UIString("Hit Ctrl+O to open a fi le");this.editorView.mainElement().classList.add("vbox");this.editorView.sidebar Element().classList.add("vbox");this.sourcesView=new WebInspector.SourcesView(); this._searchableView=new WebInspector.SearchableView(this);this._searchableView. setMinimalSearchQuerySize(0);this._searchableView.show(this.sourcesView.element) ;this._editorContainer=new WebInspector.TabbedEditorContainer(this,"previouslyVi ewedFiles",tabbedEditorPlaceholderText);this._editorContainer.show(this._searcha bleView.element);this._navigatorController=new WebInspector.NavigatorOverlayCont roller(this.editorView,this._navigator.view,this._editorContainer.view);this._na vigator.addEventListener(WebInspector.SourcesNavigator.Events.SourceSelected,thi s._sourceSelected,this);this._navigator.addEventListener(WebInspector.SourcesNav igator.Events.ItemSearchStarted,this._itemSearchStarted,this);this._navigator.ad dEventListener(WebInspector.SourcesNavigator.Events.ItemCreationRequested,this._ itemCreationRequested,this);this._navigator.addEventListener(WebInspector.Source sNavigator.Events.ItemRenamingRequested,this._itemRenamingRequested,this);this._ editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.Edito rSelected,this._editorSelected,this);this._editorContainer.addEventListener(WebI nspector.TabbedEditorContainer.Events.EditorClosed,this._editorClosed,this);this ._debugSidebarResizeWidgetElement=document.createElementWithClass("div","resizer -widget");this._debugSidebarResizeWidgetElement.id="scripts-debug-sidebar-resize r-widget";this.splitView.installResizer(this._debugSidebarResizeWidgetElement);t his.sidebarPanes={};this.sidebarPanes.watchExpressions=new WebInspector.WatchExp ressionsSidebarPane();this.sidebarPanes.callstack=new WebInspector.CallStackSide barPane();this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSid ebarPane.Events.CallFrameSelected,this._callFrameSelectedInSidebar.bind(this));t his.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPane.Ev ents.CallFrameRestarted,this._callFrameRestartedInSidebar.bind(this));this.sideb arPanes.scopechain=new WebInspector.ScopeChainSidebarPane();this.sidebarPanes.js Breakpoints=new WebInspector.JavaScriptBreakpointsSidebarPane(WebInspector.break pointManager,this._showSourceLocation.bind(this));this.sidebarPanes.domBreakpoin ts=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.xh rBreakpoints=new WebInspector.XHRBreakpointsSidebarPane();this.sidebarPanes.even tListenerBreakpoints=new WebInspector.EventListenerBreakpointsSidebarPane();if(C apabilities.canInspectWorkers&&!WebInspector.WorkerManager.isWorkerFrontend()){W orkerAgent.enable();this.sidebarPanes.workerList=new WebInspector.WorkersSidebar Pane(WebInspector.workerManager);} 1092 {if(!WebInspector.experimentsSettings.workersInMainWindow.isEnabled())
1139 function currentSourceFrame() 1093 return;this._threadIdToOption={};var connectedThreads=WebInspector.workerManager .threadsList();for(var i=0;i<connectedThreads.length;++i){var threadId=connected Threads[i];this._addOption(threadId,WebInspector.workerManager.threadUrl(threadI d));}
1140 {var uiSourceCode=this.currentUISourceCode();if(!uiSourceCode) 1094 this._alterVisibility();this._comboBox.select(this._threadIdToOption[WebInspecto r.workerManager.selectedThreadId()]);},_addOption:function(workerId,url)
1141 return null;return this._sourceFramesByUISourceCode.get(uiSourceCode);} 1095 {var option=this._comboBox.createOption(url,"",String(workerId));this._threadIdT oOption[workerId]=option;},_workerAdded:function(event)
1142 this._historyManager=new WebInspector.EditingLocationHistoryManager(this,current SourceFrame.bind(this));this.registerShortcuts(WebInspector.ShortcutsScreen.Sour cesPanelShortcuts.JumpToPreviousLocation,this._onJumpToPreviousLocation.bind(thi s));this.registerShortcuts(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.Ju mpToNextLocation,this._onJumpToNextLocation.bind(this));this.sidebarPanes.callst ack.registerShortcuts(this.registerShortcuts.bind(this));this.registerShortcuts( WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToMember,this._showOutlineD ialog.bind(this));this.registerShortcuts(WebInspector.ShortcutsScreen.SourcesPan elShortcuts.ToggleBreakpoint,this._toggleBreakpoint.bind(this));this._extensionS idebarPanes=[];this._toggleFormatSourceButton=new WebInspector.StatusBarButton(W ebInspector.UIString("Pretty print"),"sources-toggle-pretty-print-status-bar-ite m");this._toggleFormatSourceButton.toggled=false;this._toggleFormatSourceButton. addEventListener("click",this._toggleFormatSource,this);this._scriptViewStatusBa rItemsContainer=document.createElement("div");this._scriptViewStatusBarItemsCont ainer.className="inline-block";this._scriptViewStatusBarTextContainer=document.c reateElement("div");this._scriptViewStatusBarTextContainer.className="inline-blo ck";this._statusBarContainerElement=this.sourcesView.element.createChild("div"," sources-status-bar");this._statusBarContainerElement.appendChild(this._toggleFor matSourceButton.element);this._statusBarContainerElement.appendChild(this._scrip tViewStatusBarItemsContainer);this._statusBarContainerElement.appendChild(this._ scriptViewStatusBarTextContainer);this._installDebuggerSidebarController();WebIn spector.dockController.addEventListener(WebInspector.DockController.Events.DockS ideChanged,this._dockSideChanged.bind(this));WebInspector.settings.splitVertical lyWhenDockedToRight.addChangeListener(this._dockSideChanged.bind(this));this._do ckSideChanged();this._sourceFramesByUISourceCode=new Map();this._updateDebuggerB uttons();this._pauseOnExceptionStateChanged();if(WebInspector.debuggerModel.isPa used()) 1096 {var data=(event.data);this._addOption(data.workerId,data.url);this._alterVisibi lity();},_workerRemoved:function(event)
1143 this._showDebuggerPausedDetails();WebInspector.settings.pauseOnExceptionStateStr ing.addChangeListener(this._pauseOnExceptionStateChanged,this);WebInspector.debu ggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled, this._debuggerWasEnabled,this);WebInspector.debuggerModel.addEventListener(WebIn spector.DebuggerModel.Events.DebuggerWasDisabled,this._debuggerWasDisabled,this) ;WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.D ebuggerPaused,this._debuggerPaused,this);WebInspector.debuggerModel.addEventList ener(WebInspector.DebuggerModel.Events.DebuggerResumed,this._debuggerResumed,thi s);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events .CallFrameSelected,this._callFrameSelected,this);WebInspector.debuggerModel.addE ventListener(WebInspector.DebuggerModel.Events.ConsoleCommandEvaluatedInSelected CallFrame,this._consoleCommandEvaluatedInSelectedCallFrame,this);WebInspector.de buggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointsActive StateChanged,this._breakpointsActiveStateChanged,this);WebInspector.startBatchUp date();this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this)) ;WebInspector.endBatchUpdate();this._workspace.addEventListener(WebInspector.Wor kspace.Events.UISourceCodeAdded,this._uiSourceCodeAdded,this);this._workspace.ad dEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceC odeRemoved,this);this._workspace.addEventListener(WebInspector.Workspace.Events. ProjectWillReset,this._projectWillReset.bind(this),this);WebInspector.debuggerMo del.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this. _debuggerReset,this);this._boundOnKeyUp=this._onKeyUp.bind(this);this._boundOnKe yDown=this._onKeyDown.bind(this);function handleBeforeUnload(event) 1097 {var data=(event.data);this._comboBox.removeOption(this._threadIdToOption[data.w orkerId]);delete this._threadIdToOption[data.workerId];this._alterVisibility();} ,_workersCleared:function()
1098 {this._comboBox.removeOptions();this._reset();},_onComboBoxSelectionChange:funct ion()
1099 {var selectedOption=this._comboBox.selectedOption();if(!selectedOption)
1100 return;WebInspector.workerManager.setSelectedThreadId(parseInt(selectedOption.va lue,10));},_alterVisibility:function()
1101 {var hidden=this._comboBox.size()===1;this.element.classList.toggle("hidden",hid den);}};WebInspector.FormatterScriptMapping=function(workspace,debuggerModel)
1102 {this._workspace=workspace;this._debuggerModel=debuggerModel;this._init();this._ projectDelegate=new WebInspector.FormatterProjectDelegate();this._workspace.addP roject(this._projectDelegate);this._debuggerModel.addEventListener(WebInspector. DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);}
1103 WebInspector.FormatterScriptMapping.prototype={rawLocationToUILocation:function( rawLocation)
1104 {var debuggerModelLocation=(rawLocation);var script=this._debuggerModel.scriptFo rId(debuggerModelLocation.scriptId);var uiSourceCode=this._uiSourceCodes.get(scr ipt);if(!uiSourceCode)
1105 return null;var formatData=this._formatData.get(uiSourceCode);if(!formatData)
1106 return null;var mapping=formatData.mapping;var lineNumber=debuggerModelLocation. lineNumber;var columnNumber=debuggerModelLocation.columnNumber||0;var formattedL ocation=mapping.originalToFormatted(lineNumber,columnNumber);return new WebInspe ctor.UILocation(uiSourceCode,formattedLocation[0],formattedLocation[1]);},uiLoca tionToRawLocation:function(uiSourceCode,lineNumber,columnNumber)
1107 {var formatData=this._formatData.get(uiSourceCode);if(!formatData)
1108 return null;var originalLocation=formatData.mapping.formattedToOriginal(lineNumb er,columnNumber)
1109 return this._debuggerModel.createRawLocation(formatData.scripts[0],originalLocat ion[0],originalLocation[1]);},isIdentity:function()
1110 {return false;},_scriptsForUISourceCode:function(uiSourceCode)
1111 {function isInlineScript(script)
1112 {return script.isInlineScript();}
1113 if(uiSourceCode.contentType()===WebInspector.resourceTypes.Document)
1114 return this._debuggerModel.scriptsForSourceURL(uiSourceCode.url).filter(isInline Script);if(uiSourceCode.contentType()===WebInspector.resourceTypes.Script){var r awLocation=uiSourceCode.uiLocationToRawLocation(0,0);return rawLocation?[this._d ebuggerModel.scriptForId(rawLocation.scriptId)]:[];}
1115 return[];},_init:function()
1116 {this._uiSourceCodes=new Map();this._formattedPaths=new StringMap();this._format Data=new Map();},_debuggerReset:function()
1117 {var formattedPaths=this._formattedPaths.values();for(var i=0;i<formattedPaths.l ength;++i)
1118 this._projectDelegate._removeFormatted(formattedPaths[i]);this._init();},_perfor mUISourceCodeScriptFormatting:function(uiSourceCode,callback)
1119 {var path=this._formattedPaths.get(uiSourceCode.project().id()+":"+uiSourceCode. path());if(path){var uiSourceCodePath=path;var formattedUISourceCode=this._works pace.uiSourceCode(this._projectDelegate.id(),uiSourceCodePath);var formatData=fo rmattedUISourceCode?this._formatData.get(formattedUISourceCode):null;if(!formatD ata)
1120 callback(null);else
1121 callback(formattedUISourceCode,formatData.mapping);return;}
1122 uiSourceCode.requestContent(contentLoaded.bind(this));function contentLoaded(con tent)
1123 {var formatter=WebInspector.Formatter.createFormatter(uiSourceCode.contentType() );formatter.formatContent(uiSourceCode.highlighterType(),content||"",innerCallba ck.bind(this));}
1124 function innerCallback(formattedContent,formatterMapping)
1125 {var scripts=this._scriptsForUISourceCode(uiSourceCode);if(!scripts.length){call back(null);return;}
1126 var name;if(uiSourceCode.contentType()===WebInspector.resourceTypes.Document)
1127 name=uiSourceCode.displayName();else
1128 name=uiSourceCode.name()||scripts[0].scriptId;path=this._projectDelegate._addFor matted(name,uiSourceCode.url,uiSourceCode.contentType(),formattedContent);var fo rmattedUISourceCode=(this._workspace.uiSourceCode(this._projectDelegate.id(),pat h));var formatData=new WebInspector.FormatterScriptMapping.FormatData(uiSourceCo de.project().id(),uiSourceCode.path(),formatterMapping,scripts);this._formatData .put(formattedUISourceCode,formatData);this._formattedPaths.put(uiSourceCode.pro ject().id()+":"+uiSourceCode.path(),path);for(var i=0;i<scripts.length;++i){this ._uiSourceCodes.put(scripts[i],formattedUISourceCode);scripts[i].pushSourceMappi ng(this);}
1129 formattedUISourceCode.setSourceMapping(this);callback(formattedUISourceCode,form atterMapping);}},_discardFormattedUISourceCodeScript:function(formattedUISourceC ode)
1130 {var formatData=this._formatData.get(formattedUISourceCode);if(!formatData)
1131 return null;this._formatData.remove(formattedUISourceCode);this._formattedPaths. remove(formatData.projectId+":"+formatData.path);for(var i=0;i<formatData.script s.length;++i){this._uiSourceCodes.remove(formatData.scripts[i]);formatData.scrip ts[i].popSourceMapping();}
1132 this._projectDelegate._removeFormatted(formattedUISourceCode.path());return form atData.mapping;},}
1133 WebInspector.FormatterScriptMapping.FormatData=function(projectId,path,mapping,s cripts)
1134 {this.projectId=projectId;this.path=path;this.mapping=mapping;this.scripts=scrip ts;}
1135 WebInspector.FormatterProjectDelegate=function()
1136 {WebInspector.ContentProviderBasedProjectDelegate.call(this,WebInspector.project Types.Formatter);}
1137 WebInspector.FormatterProjectDelegate.prototype={id:function()
1138 {return"formatter:";},displayName:function()
1139 {return"formatter";},_addFormatted:function(name,sourceURL,contentType,content)
1140 {var contentProvider=new WebInspector.StaticContentProvider(contentType,content) ;return this.addContentProvider(sourceURL,name+":formatted","deobfuscated:"+sour ceURL,contentProvider,false,false);},_removeFormatted:function(path)
1141 {this.removeFile(path);},__proto__:WebInspector.ContentProviderBasedProjectDeleg ate.prototype}
1142 WebInspector.ScriptFormatterEditorAction=function()
1143 {this._scriptMapping=new WebInspector.FormatterScriptMapping(WebInspector.worksp ace,WebInspector.debuggerModel);}
1144 WebInspector.ScriptFormatterEditorAction.prototype={_editorSelected:function(eve nt)
1145 {var uiSourceCode=(event.data);this._updateButton(uiSourceCode);},_editorClosed: function(event)
1146 {var uiSourceCode=(event.data.uiSourceCode);var wasSelected=(event.data.wasSelec ted);if(wasSelected)
1147 this._updateButton(null);this._discardFormattedUISourceCodeScript(uiSourceCode); },_updateButton:function(uiSourceCode)
1148 {this._button.element.classList.toggle("hidden",!this._isFormatableScript(uiSour ceCode));},button:function(sourcesView)
1149 {if(this._button)
1150 return this._button.element;this._sourcesView=sourcesView;this._sourcesView.addE ventListener(WebInspector.SourcesView.Events.EditorSelected,this._editorSelected .bind(this));this._sourcesView.addEventListener(WebInspector.SourcesView.Events. EditorClosed,this._editorClosed.bind(this));this._button=new WebInspector.Status BarButton(WebInspector.UIString("Pretty print"),"sources-toggle-pretty-print-sta tus-bar-item");this._button.toggled=false;this._button.addEventListener("click", this._toggleFormatScriptSource,this);this._updateButton(null);return this._butto n.element;},_isFormatableScript:function(uiSourceCode)
1151 {if(!uiSourceCode)
1152 return false;var projectType=uiSourceCode.project().type();if(projectType!==WebI nspector.projectTypes.Network&&projectType!==WebInspector.projectTypes.Debugger)
1153 return false;var contentType=uiSourceCode.contentType();return contentType===Web Inspector.resourceTypes.Script||contentType===WebInspector.resourceTypes.Documen t;},_toggleFormatScriptSource:function()
1154 {var uiSourceCode=this._sourcesView.currentUISourceCode();if(!this._isFormatable Script(uiSourceCode))
1155 return;this._formatUISourceCodeScript(uiSourceCode);WebInspector.notifications.d ispatchEventToListeners(WebInspector.UserMetrics.UserAction,{action:WebInspector .UserMetrics.UserActionNames.TogglePrettyPrint,enabled:true,url:uiSourceCode.ori ginURL()});},_formatUISourceCodeScript:function(uiSourceCode)
1156 {this._scriptMapping._performUISourceCodeScriptFormatting(uiSourceCode,innerCall back.bind(this));function innerCallback(formattedUISourceCode,mapping)
1157 {if(!formattedUISourceCode)
1158 return;if(uiSourceCode!==this._sourcesView.currentUISourceCode())
1159 return;var sourceFrame=this._sourcesView.viewForFile(uiSourceCode);var start=[0, 0];if(sourceFrame){var selection=sourceFrame.selection();start=mapping.originalT oFormatted(selection.startLine,selection.startColumn);}
1160 this._sourcesView.showSourceLocation(formattedUISourceCode,start[0],start[1]);th is._updateButton(formattedUISourceCode);}},_discardFormattedUISourceCodeScript:f unction(uiSourceCode)
1161 {this._scriptMapping._discardFormattedUISourceCodeScript(uiSourceCode);}};WebIns pector.InplaceFormatterEditorAction=function()
1162 {}
1163 WebInspector.InplaceFormatterEditorAction.prototype={_editorSelected:function(ev ent)
1164 {var uiSourceCode=(event.data);this._updateButton(uiSourceCode);},_editorClosed: function(event)
1165 {var wasSelected=(event.data.wasSelected);if(wasSelected)
1166 this._updateButton(null);},_updateButton:function(uiSourceCode)
1167 {this._button.element.classList.toggle("hidden",!this._isFormattable(uiSourceCod e));},button:function(sourcesView)
1168 {if(this._button)
1169 return this._button.element;this._sourcesView=sourcesView;this._sourcesView.addE ventListener(WebInspector.SourcesView.Events.EditorSelected,this._editorSelected .bind(this));this._sourcesView.addEventListener(WebInspector.SourcesView.Events. EditorClosed,this._editorClosed.bind(this));this._button=new WebInspector.Status BarButton(WebInspector.UIString("Format"),"sources-toggle-pretty-print-status-ba r-item");this._button.toggled=false;this._button.addEventListener("click",this._ formatSourceInPlace,this);this._updateButton(null);return this._button.element;} ,_isFormattable:function(uiSourceCode)
1170 {if(!uiSourceCode)
1171 return false;return uiSourceCode.contentType()===WebInspector.resourceTypes.Styl esheet||uiSourceCode.project().type()===WebInspector.projectTypes.Snippets;},_fo rmatSourceInPlace:function()
1172 {var uiSourceCode=this._sourcesView.currentUISourceCode();if(!this._isFormattabl e(uiSourceCode))
1173 return;if(uiSourceCode.isDirty())
1174 contentLoaded.call(this,uiSourceCode.workingCopy());else
1175 uiSourceCode.requestContent(contentLoaded.bind(this));function contentLoaded(con tent)
1176 {var formatter=WebInspector.Formatter.createFormatter(uiSourceCode.contentType() );formatter.formatContent(uiSourceCode.highlighterType(),content||"",innerCallba ck.bind(this));}
1177 function innerCallback(formattedContent,formatterMapping)
1178 {if(uiSourceCode.workingCopy()===formattedContent)
1179 return;var sourceFrame=this._sourcesView.viewForFile(uiSourceCode);var start=[0, 0];if(sourceFrame){var selection=sourceFrame.selection();start=formatterMapping. originalToFormatted(selection.startLine,selection.startColumn);}
1180 uiSourceCode.setWorkingCopy(formattedContent);this._sourcesView.showSourceLocati on(uiSourceCode,start[0],start[1]);}},};WebInspector.Formatter=function()
1181 {}
1182 WebInspector.Formatter.createFormatter=function(contentType)
1183 {if(contentType===WebInspector.resourceTypes.Script||contentType===WebInspector. resourceTypes.Document||contentType===WebInspector.resourceTypes.Stylesheet)
1184 return new WebInspector.ScriptFormatter();return new WebInspector.IdentityFormat ter();}
1185 WebInspector.Formatter.locationToPosition=function(lineEndings,lineNumber,column Number)
1186 {var position=lineNumber?lineEndings[lineNumber-1]+1:0;return position+columnNum ber;}
1187 WebInspector.Formatter.positionToLocation=function(lineEndings,position)
1188 {var lineNumber=lineEndings.upperBound(position-1);if(!lineNumber)
1189 var columnNumber=position;else
1190 var columnNumber=position-lineEndings[lineNumber-1]-1;return[lineNumber,columnNu mber];}
1191 WebInspector.Formatter.prototype={formatContent:function(mimeType,content,callba ck)
1192 {}}
1193 WebInspector.ScriptFormatter=function()
1194 {this._tasks=[];}
1195 WebInspector.ScriptFormatter.prototype={formatContent:function(mimeType,content, callback)
1196 {content=content.replace(/\r\n?|[\n\u2028\u2029]/g,"\n").replace(/^\uFEFF/,'');c onst method="format";var parameters={mimeType:mimeType,content:content,indentStr ing:WebInspector.settings.textEditorIndent.get()};this._tasks.push({data:paramet ers,callback:callback});this._worker.postMessage({method:method,params:parameter s});},_didFormatContent:function(event)
1197 {var task=this._tasks.shift();var originalContent=task.data.content;var formatte dContent=event.data.content;var mapping=event.data["mapping"];var sourceMapping= new WebInspector.FormatterSourceMappingImpl(originalContent.lineEndings(),format tedContent.lineEndings(),mapping);task.callback(formattedContent,sourceMapping); },get _worker()
1198 {if(!this._cachedWorker){this._cachedWorker=new Worker("ScriptFormatterWorker.js ");this._cachedWorker.onmessage=(this._didFormatContent.bind(this));}
1199 return this._cachedWorker;}}
1200 WebInspector.IdentityFormatter=function()
1201 {this._tasks=[];}
1202 WebInspector.IdentityFormatter.prototype={formatContent:function(mimeType,conten t,callback)
1203 {callback(content,new WebInspector.IdentityFormatterSourceMapping());}}
1204 WebInspector.FormatterMappingPayload=function()
1205 {this.original=[];this.formatted=[];}
1206 WebInspector.FormatterSourceMapping=function()
1207 {}
1208 WebInspector.FormatterSourceMapping.prototype={originalToFormatted:function(line Number,columnNumber){},formattedToOriginal:function(lineNumber,columnNumber){}}
1209 WebInspector.IdentityFormatterSourceMapping=function()
1210 {}
1211 WebInspector.IdentityFormatterSourceMapping.prototype={originalToFormatted:funct ion(lineNumber,columnNumber)
1212 {return[lineNumber,columnNumber||0];},formattedToOriginal:function(lineNumber,co lumnNumber)
1213 {return[lineNumber,columnNumber||0];}}
1214 WebInspector.FormatterSourceMappingImpl=function(originalLineEndings,formattedLi neEndings,mapping)
1215 {this._originalLineEndings=originalLineEndings;this._formattedLineEndings=format tedLineEndings;this._mapping=mapping;}
1216 WebInspector.FormatterSourceMappingImpl.prototype={originalToFormatted:function( lineNumber,columnNumber)
1217 {var originalPosition=WebInspector.Formatter.locationToPosition(this._originalLi neEndings,lineNumber,columnNumber||0);var formattedPosition=this._convertPositio n(this._mapping.original,this._mapping.formatted,originalPosition||0);return Web Inspector.Formatter.positionToLocation(this._formattedLineEndings,formattedPosit ion);},formattedToOriginal:function(lineNumber,columnNumber)
1218 {var formattedPosition=WebInspector.Formatter.locationToPosition(this._formatted LineEndings,lineNumber,columnNumber||0);var originalPosition=this._convertPositi on(this._mapping.formatted,this._mapping.original,formattedPosition);return WebI nspector.Formatter.positionToLocation(this._originalLineEndings,originalPosition ||0);},_convertPosition:function(positions1,positions2,position)
1219 {var index=positions1.upperBound(position)-1;var convertedPosition=positions2[in dex]+position-positions1[index];if(index<positions2.length-1&&convertedPosition> positions2[index+1])
1220 convertedPosition=positions2[index+1];return convertedPosition;}};WebInspector.S ourcesView=function(workspace,sourcesPanel)
1221 {WebInspector.VBox.call(this);this.registerRequiredCSS("sourcesView.css");this.e lement.id="sources-panel-sources-view";this.setMinimumSize(50,25);this._workspac e=workspace;this._sourcesPanel=sourcesPanel;this._searchableView=new WebInspecto r.SearchableView(this);this._searchableView.setMinimalSearchQuerySize(0);this._s earchableView.show(this.element);this._sourceFramesByUISourceCode=new Map();var tabbedEditorPlaceholderText=WebInspector.isMac()?WebInspector.UIString("Hit Cmd+ O to open a file"):WebInspector.UIString("Hit Ctrl+O to open a file");this._edit orContainer=new WebInspector.TabbedEditorContainer(this,"previouslyViewedFiles", tabbedEditorPlaceholderText);this._editorContainer.show(this._searchableView.ele ment);this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer. Events.EditorSelected,this._editorSelected,this);this._editorContainer.addEventL istener(WebInspector.TabbedEditorContainer.Events.EditorClosed,this._editorClose d,this);this._historyManager=new WebInspector.EditingLocationHistoryManager(this ,this.currentSourceFrame.bind(this));this._scriptViewStatusBarItemsContainer=doc ument.createElement("div");this._scriptViewStatusBarItemsContainer.className="in line-block";this._scriptViewStatusBarTextContainer=document.createElement("div") ;this._scriptViewStatusBarTextContainer.className="hbox";this._statusBarContaine rElement=this.element.createChild("div","sources-status-bar");function appendBut tonForExtension(EditorAction)
1222 {this._statusBarContainerElement.appendChild(EditorAction.button(this));}
1223 var editorActions=(WebInspector.moduleManager.instances(WebInspector.SourcesView .EditorAction));editorActions.forEach(appendButtonForExtension.bind(this));this. _statusBarContainerElement.appendChild(this._scriptViewStatusBarItemsContainer); this._statusBarContainerElement.appendChild(this._scriptViewStatusBarTextContain er);WebInspector.startBatchUpdate();this._workspace.uiSourceCodes().forEach(this ._addUISourceCode.bind(this));WebInspector.endBatchUpdate();this._workspace.addE ventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeA dded,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISour ceCodeRemoved,this._uiSourceCodeRemoved,this);this._workspace.addEventListener(W ebInspector.Workspace.Events.ProjectWillReset,this._projectWillReset.bind(this), this);function handleBeforeUnload(event)
1144 {if(event.returnValue) 1224 {if(event.returnValue)
1145 return;var unsavedSourceCodes=WebInspector.workspace.unsavedSourceCodes();if(!un savedSourceCodes.length) 1225 return;var unsavedSourceCodes=WebInspector.workspace.unsavedSourceCodes();if(!un savedSourceCodes.length)
1146 return;event.returnValue=WebInspector.UIString("DevTools have unsaved changes th at will be permanently lost.");WebInspector.showPanel("sources");for(var i=0;i<u nsavedSourceCodes.length;++i) 1226 return;event.returnValue=WebInspector.UIString("DevTools have unsaved changes th at will be permanently lost.");WebInspector.inspectorView.showPanel("sources");f or(var i=0;i<unsavedSourceCodes.length;++i)
1147 WebInspector.panels.sources.showUISourceCode(unsavedSourceCodes[i]);} 1227 WebInspector.panels.sources.showUISourceCode(unsavedSourceCodes[i]);}
1148 window.addEventListener("beforeunload",handleBeforeUnload.bind(this),true);} 1228 window.addEventListener("beforeunload",handleBeforeUnload,true);this._shortcuts= {};this.element.addEventListener("keydown",this._handleKeyDown.bind(this),false) ;}
1149 WebInspector.SourcesPanel.PauseOnExceptionsStates=[WebInspector.DebuggerModel.Pa useOnExceptionsState.DontPauseOnExceptions,WebInspector.DebuggerModel.PauseOnExc eptionsState.PauseOnUncaughtExceptions,WebInspector.DebuggerModel.PauseOnExcepti onsState.PauseOnAllExceptions];WebInspector.SourcesPanel.prototype={_onJumpToPre viousLocation:function(event) 1229 WebInspector.SourcesView.Events={EditorClosed:"EditorClosed",EditorSelected:"Edi torSelected",}
1230 WebInspector.SourcesView.prototype={registerShortcuts:function(registerShortcutD elegate)
1231 {function registerShortcut(shortcuts,handler)
1232 {registerShortcutDelegate(shortcuts,handler);this._registerShortcuts(shortcuts,h andler);}
1233 registerShortcut.call(this,WebInspector.ShortcutsScreen.SourcesPanelShortcuts.Ju mpToPreviousLocation,this._onJumpToPreviousLocation.bind(this));registerShortcut .call(this,WebInspector.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation ,this._onJumpToNextLocation.bind(this));registerShortcut.call(this,WebInspector. ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab,this._onCloseEditorTab.bind (this));registerShortcut.call(this,WebInspector.ShortcutsScreen.SourcesPanelShor tcuts.GoToLine,this._showGoToLineDialog.bind(this));registerShortcut.call(this,W ebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToMember,this._showOutlineDi alog.bind(this));registerShortcut.call(this,WebInspector.ShortcutsScreen.Sources PanelShortcuts.ToggleBreakpoint,this._toggleBreakpoint.bind(this));registerShort cut.call(this,WebInspector.ShortcutsScreen.SourcesPanelShortcuts.Save,this._save .bind(this));},_registerShortcuts:function(keys,handler)
1234 {for(var i=0;i<keys.length;++i)
1235 this._shortcuts[keys[i].key]=handler;},_handleKeyDown:function(event)
1236 {var shortcutKey=WebInspector.KeyboardShortcut.makeKeyFromEvent(event);var handl er=this._shortcuts[shortcutKey];if(handler&&handler())
1237 event.consume(true);},statusBarContainerElement:function()
1238 {return this._statusBarContainerElement;},defaultFocusedElement:function()
1239 {return this._editorContainer.view.defaultFocusedElement();},searchableView:func tion()
1240 {return this._searchableView;},visibleView:function()
1241 {return this._editorContainer.visibleView;},currentSourceFrame:function()
1242 {var view=this.visibleView();if(!(view instanceof WebInspector.SourceFrame))
1243 return null;return(view);},currentUISourceCode:function()
1244 {return this._currentUISourceCode;},_onCloseEditorTab:function(event)
1245 {var uiSourceCode=this.currentUISourceCode();if(!uiSourceCode)
1246 return false;this._editorContainer.closeFile(uiSourceCode);return true;},_onJump ToPreviousLocation:function(event)
1150 {this._historyManager.rollback();return true;},_onJumpToNextLocation:function(ev ent) 1247 {this._historyManager.rollback();return true;},_onJumpToNextLocation:function(ev ent)
1151 {this._historyManager.rollover();return true;},defaultFocusedElement:function() 1248 {this._historyManager.rollover();return true;},_uiSourceCodeAdded:function(event )
1152 {return this._editorContainer.view.defaultFocusedElement()||this._navigator.view .defaultFocusedElement();},get paused()
1153 {return this._paused;},wasShown:function()
1154 {WebInspector.inspectorView.closeViewInDrawer("editor");this.editorView.setMainV iew(this.sourcesView);WebInspector.Panel.prototype.wasShown.call(this);this._nav igatorController.wasShown();this.element.addEventListener("keydown",this._boundO nKeyDown,false);this.element.addEventListener("keyup",this._boundOnKeyUp,false); },willHide:function()
1155 {this.element.removeEventListener("keydown",this._boundOnKeyDown,false);this.ele ment.removeEventListener("keyup",this._boundOnKeyUp,false);WebInspector.Panel.pr ototype.willHide.call(this);},searchableView:function()
1156 {return this._searchableView;},_uiSourceCodeAdded:function(event)
1157 {var uiSourceCode=(event.data);this._addUISourceCode(uiSourceCode);},_addUISourc eCode:function(uiSourceCode) 1249 {var uiSourceCode=(event.data);this._addUISourceCode(uiSourceCode);},_addUISourc eCode:function(uiSourceCode)
1158 {if(this._toggleFormatSourceButton.toggled) 1250 {if(uiSourceCode.project().isServiceProject())
1159 uiSourceCode.setFormatted(true);if(uiSourceCode.project().isServiceProject()) 1251 return;this._editorContainer.addUISourceCode(uiSourceCode);var currentUISourceCo de=this._currentUISourceCode;if(currentUISourceCode&&currentUISourceCode.project ().isServiceProject()&&currentUISourceCode!==uiSourceCode&&currentUISourceCode.u rl===uiSourceCode.url){this._showFile(uiSourceCode);this._editorContainer.remove UISourceCode(currentUISourceCode);}},_uiSourceCodeRemoved:function(event)
1160 return;this._navigator.addUISourceCode(uiSourceCode);this._editorContainer.addUI SourceCode(uiSourceCode);var currentUISourceCode=this._currentUISourceCode;if(cu rrentUISourceCode&&currentUISourceCode.project().isServiceProject()&&currentUISo urceCode!==uiSourceCode&&currentUISourceCode.url===uiSourceCode.url){this._showF ile(uiSourceCode);this._editorContainer.removeUISourceCode(currentUISourceCode); }},_uiSourceCodeRemoved:function(event)
1161 {var uiSourceCode=(event.data);this._removeUISourceCodes([uiSourceCode]);},_remo veUISourceCodes:function(uiSourceCodes) 1252 {var uiSourceCode=(event.data);this._removeUISourceCodes([uiSourceCode]);},_remo veUISourceCodes:function(uiSourceCodes)
1162 {for(var i=0;i<uiSourceCodes.length;++i){this._navigator.removeUISourceCode(uiSo urceCodes[i]);this._removeSourceFrame(uiSourceCodes[i]);this._historyManager.rem oveHistoryForSourceCode(uiSourceCodes[i]);} 1253 {for(var i=0;i<uiSourceCodes.length;++i){this._removeSourceFrame(uiSourceCodes[i ]);this._historyManager.removeHistoryForSourceCode(uiSourceCodes[i]);}
1163 this._editorContainer.removeUISourceCodes(uiSourceCodes);},_consoleCommandEvalua tedInSelectedCallFrame:function(event) 1254 this._editorContainer.removeUISourceCodes(uiSourceCodes);},_projectWillReset:fun ction(event)
1255 {var project=event.data;var uiSourceCodes=project.uiSourceCodes();this._removeUI SourceCodes(uiSourceCodes);if(project.type()===WebInspector.projectTypes.Network )
1256 this._editorContainer.reset();},_updateScriptViewStatusBarItems:function()
1257 {this._scriptViewStatusBarItemsContainer.removeChildren();this._scriptViewStatus BarTextContainer.removeChildren();var sourceFrame=this.currentSourceFrame();if(! sourceFrame)
1258 return;var statusBarItems=sourceFrame.statusBarItems()||[];for(var i=0;i<statusB arItems.length;++i)
1259 this._scriptViewStatusBarItemsContainer.appendChild(statusBarItems[i]);var statu sBarText=sourceFrame.statusBarText();if(statusBarText)
1260 this._scriptViewStatusBarTextContainer.appendChild(statusBarText);},showSourceLo cation:function(uiSourceCode,lineNumber,columnNumber,omitFocus,omitHighlight)
1261 {this._historyManager.updateCurrentState();var sourceFrame=this._showFile(uiSour ceCode);if(typeof lineNumber==="number")
1262 sourceFrame.revealPosition(lineNumber,columnNumber,!omitHighlight);this._history Manager.pushNewState();if(!omitFocus)
1263 sourceFrame.focus();WebInspector.notifications.dispatchEventToListeners(WebInspe ctor.UserMetrics.UserAction,{action:WebInspector.UserMetrics.UserActionNames.Ope nSourceLink,url:uiSourceCode.originURL(),lineNumber:lineNumber});},_showFile:fun ction(uiSourceCode)
1264 {var sourceFrame=this._getOrCreateSourceFrame(uiSourceCode);if(this._currentUISo urceCode===uiSourceCode)
1265 return sourceFrame;this._currentUISourceCode=uiSourceCode;this._editorContainer. showFile(uiSourceCode);this._updateScriptViewStatusBarItems();return sourceFrame ;},_createSourceFrame:function(uiSourceCode)
1266 {var sourceFrame;switch(uiSourceCode.contentType()){case WebInspector.resourceTy pes.Script:sourceFrame=new WebInspector.JavaScriptSourceFrame(this._sourcesPanel ,uiSourceCode);break;case WebInspector.resourceTypes.Document:sourceFrame=new We bInspector.JavaScriptSourceFrame(this._sourcesPanel,uiSourceCode);break;case Web Inspector.resourceTypes.Stylesheet:sourceFrame=new WebInspector.CSSSourceFrame(u iSourceCode);break;default:sourceFrame=new WebInspector.UISourceCodeFrame(uiSour ceCode);break;}
1267 sourceFrame.setHighlighterType(uiSourceCode.highlighterType());this._sourceFrame sByUISourceCode.put(uiSourceCode,sourceFrame);this._historyManager.trackSourceFr ameCursorJumps(sourceFrame);return sourceFrame;},_getOrCreateSourceFrame:functio n(uiSourceCode)
1268 {return this._sourceFramesByUISourceCode.get(uiSourceCode)||this._createSourceFr ame(uiSourceCode);},_sourceFrameMatchesUISourceCode:function(sourceFrame,uiSourc eCode)
1269 {switch(uiSourceCode.contentType()){case WebInspector.resourceTypes.Script:case WebInspector.resourceTypes.Document:return sourceFrame instanceof WebInspector.J avaScriptSourceFrame;case WebInspector.resourceTypes.Stylesheet:return sourceFra me instanceof WebInspector.CSSSourceFrame;default:return!(sourceFrame instanceof WebInspector.JavaScriptSourceFrame);}},_recreateSourceFrameIfNeeded:function(ui SourceCode)
1270 {var oldSourceFrame=this._sourceFramesByUISourceCode.get(uiSourceCode);if(!oldSo urceFrame)
1271 return;if(this._sourceFrameMatchesUISourceCode(oldSourceFrame,uiSourceCode)){old SourceFrame.setHighlighterType(uiSourceCode.highlighterType());}else{this._edito rContainer.removeUISourceCode(uiSourceCode);this._removeSourceFrame(uiSourceCode );}},viewForFile:function(uiSourceCode)
1272 {return this._getOrCreateSourceFrame(uiSourceCode);},_removeSourceFrame:function (uiSourceCode)
1273 {var sourceFrame=this._sourceFramesByUISourceCode.get(uiSourceCode);if(!sourceFr ame)
1274 return;this._sourceFramesByUISourceCode.remove(uiSourceCode);sourceFrame.dispose ();},clearCurrentExecutionLine:function()
1275 {if(this._executionSourceFrame)
1276 this._executionSourceFrame.clearExecutionLine();delete this._executionSourceFram e;},setExecutionLine:function(uiLocation)
1277 {var sourceFrame=this._getOrCreateSourceFrame(uiLocation.uiSourceCode);sourceFra me.setExecutionLine(uiLocation.lineNumber);this._executionSourceFrame=sourceFram e;},_editorClosed:function(event)
1278 {var uiSourceCode=(event.data);this._historyManager.removeHistoryForSourceCode(u iSourceCode);var wasSelected=false;if(this._currentUISourceCode===uiSourceCode){ delete this._currentUISourceCode;wasSelected=true;}
1279 this._updateScriptViewStatusBarItems();this._searchableView.resetSearch();var da ta={};data.uiSourceCode=uiSourceCode;data.wasSelected=wasSelected;this.dispatchE ventToListeners(WebInspector.SourcesView.Events.EditorClosed,data);},_editorSele cted:function(event)
1280 {var uiSourceCode=(event.data.currentFile);var shouldUseHistoryManager=uiSourceC ode!==this._currentUISourceCode&&event.data.userGesture;if(shouldUseHistoryManag er)
1281 this._historyManager.updateCurrentState();var sourceFrame=this._showFile(uiSourc eCode);if(shouldUseHistoryManager)
1282 this._historyManager.pushNewState();this._searchableView.setReplaceable(!!source Frame&&sourceFrame.canEditSource());this._searchableView.resetSearch();this.disp atchEventToListeners(WebInspector.SourcesView.Events.EditorSelected,uiSourceCode );},sourceRenamed:function(uiSourceCode)
1283 {this._recreateSourceFrameIfNeeded(uiSourceCode);},searchCanceled:function()
1284 {if(this._searchView)
1285 this._searchView.searchCanceled();delete this._searchView;delete this._searchQue ry;},performSearch:function(query,shouldJump)
1286 {this._searchableView.updateSearchMatchesCount(0);var sourceFrame=this.currentSo urceFrame();if(!sourceFrame)
1287 return;this._searchView=sourceFrame;this._searchQuery=query;function finishedCal lback(view,searchMatches)
1288 {if(!searchMatches)
1289 return;this._searchableView.updateSearchMatchesCount(searchMatches);}
1290 function currentMatchChanged(currentMatchIndex)
1291 {this._searchableView.updateCurrentMatchIndex(currentMatchIndex);}
1292 function searchResultsChanged()
1293 {this._searchableView.cancelSearch();}
1294 this._searchView.performSearch(query,shouldJump,finishedCallback.bind(this),curr entMatchChanged.bind(this),searchResultsChanged.bind(this));},jumpToNextSearchRe sult:function()
1295 {if(!this._searchView)
1296 return;if(this._searchView!==this.currentSourceFrame()){this.performSearch(this. _searchQuery,true);return;}
1297 this._searchView.jumpToNextSearchResult();},jumpToPreviousSearchResult:function( )
1298 {if(!this._searchView)
1299 return;if(this._searchView!==this.currentSourceFrame()){this.performSearch(this. _searchQuery,true);if(this._searchView)
1300 this._searchView.jumpToLastSearchResult();return;}
1301 this._searchView.jumpToPreviousSearchResult();},replaceSelectionWith:function(te xt)
1302 {var sourceFrame=this.currentSourceFrame();if(!sourceFrame){console.assert(sourc eFrame);return;}
1303 sourceFrame.replaceSelectionWith(text);},replaceAllWith:function(query,text)
1304 {var sourceFrame=this.currentSourceFrame();if(!sourceFrame){console.assert(sourc eFrame);return;}
1305 sourceFrame.replaceAllWith(query,text);},_showOutlineDialog:function(event)
1306 {var uiSourceCode=this._editorContainer.currentFile();if(!uiSourceCode)
1307 return false;switch(uiSourceCode.contentType()){case WebInspector.resourceTypes. Document:case WebInspector.resourceTypes.Script:WebInspector.JavaScriptOutlineDi alog.show(this,uiSourceCode,this.showSourceLocation.bind(this,uiSourceCode));ret urn true;case WebInspector.resourceTypes.Stylesheet:WebInspector.StyleSheetOutli neDialog.show(this,uiSourceCode,this.showSourceLocation.bind(this,uiSourceCode)) ;return true;}
1308 return false;},showOpenResourceDialog:function(query)
1309 {var uiSourceCodes=this._editorContainer.historyUISourceCodes();var defaultScore s=new Map();for(var i=1;i<uiSourceCodes.length;++i)
1310 defaultScores.put(uiSourceCodes[i],uiSourceCodes.length-i);WebInspector.OpenReso urceDialog.show(this,this.element,query,defaultScores);},_showGoToLineDialog:fun ction(event)
1311 {if(this._currentUISourceCode)
1312 this.showOpenResourceDialog(":");return true;},_save:function()
1313 {var sourceFrame=this.currentSourceFrame();if(!sourceFrame)
1314 return true;if(!(sourceFrame instanceof WebInspector.UISourceCodeFrame))
1315 return true;var uiSourceCodeFrame=(sourceFrame);uiSourceCodeFrame.commitEditing( );return true;},_toggleBreakpoint:function()
1316 {var sourceFrame=this.currentSourceFrame();if(!sourceFrame)
1317 return false;if(sourceFrame instanceof WebInspector.JavaScriptSourceFrame){var j avaScriptSourceFrame=(sourceFrame);javaScriptSourceFrame.toggleBreakpointOnCurre ntLine();return true;}
1318 return false;},toggleBreakpointsActiveState:function(active)
1319 {this._editorContainer.view.element.classList.toggle("breakpoints-deactivated",! active);},__proto__:WebInspector.VBox.prototype}
1320 WebInspector.SourcesView.EditorAction=function()
1321 {}
1322 WebInspector.SourcesView.EditorAction.prototype={button:function(sourcesView){}} ;WebInspector.SourcesPanel=function(workspaceForTest)
1323 {WebInspector.Panel.call(this,"sources");this.registerRequiredCSS("sourcesPanel. css");this.registerRequiredCSS("textPrompt.css");new WebInspector.UpgradeFileSys temDropTarget(this.element);WebInspector.settings.showEditorInDrawer=WebInspecto r.settings.createSetting("showEditorInDrawer",true);this._workspace=workspaceFor Test||WebInspector.workspace;var helpSection=WebInspector.shortcutsScreen.sectio n(WebInspector.UIString("Sources Panel"));this.debugToolbar=this._createDebugToo lbar();this._debugToolbarDrawer=this._createDebugToolbarDrawer();this.threadsToo lbar=new WebInspector.ThreadsToolbar();const initialDebugSidebarWidth=225;this._ splitView=new WebInspector.SplitView(true,true,"sourcesPanelSplitViewState",init ialDebugSidebarWidth);this._splitView.enableShowModeSaving();this._splitView.sho w(this.element);const initialNavigatorWidth=225;this.editorView=new WebInspector .SplitView(true,false,"sourcesPanelNavigatorSplitViewState",initialNavigatorWidt h);this.editorView.enableShowModeSaving();this.editorView.element.id="scripts-ed itor-split-view";this.editorView.element.tabIndex=0;this.editorView.show(this._s plitView.mainElement());this._navigator=new WebInspector.SourcesNavigator(this._ workspace);this._navigator.view.setMinimumSize(Preferences.minSidebarWidth,25);t his._navigator.view.show(this.editorView.sidebarElement());this._navigator.addEv entListener(WebInspector.SourcesNavigator.Events.SourceSelected,this._sourceSele cted,this);this._navigator.addEventListener(WebInspector.SourcesNavigator.Events .SourceRenamed,this._sourceRenamed,this);this._sourcesView=new WebInspector.Sour cesView(this._workspace,this);this._sourcesView.addEventListener(WebInspector.So urcesView.Events.EditorSelected,this._editorSelected.bind(this));this._sourcesVi ew.addEventListener(WebInspector.SourcesView.Events.EditorClosed,this._editorClo sed.bind(this));this._sourcesView.registerShortcuts(this.registerShortcuts.bind( this));this._drawerEditorView=new WebInspector.SourcesPanel.DrawerEditorView();t his._sourcesView.show(this._drawerEditorView.element);this._debugSidebarResizeWi dgetElement=document.createElementWithClass("div","resizer-widget");this._debugS idebarResizeWidgetElement.id="scripts-debug-sidebar-resizer-widget";this._splitV iew.addEventListener(WebInspector.SplitView.Events.ShowModeChanged,this._updateD ebugSidebarResizeWidget,this);this._updateDebugSidebarResizeWidget();this._split View.installResizer(this._debugSidebarResizeWidgetElement);this.sidebarPanes={}; this.sidebarPanes.watchExpressions=new WebInspector.WatchExpressionsSidebarPane( );this.sidebarPanes.callstack=new WebInspector.CallStackSidebarPane();this.sideb arPanes.callstack.addEventListener(WebInspector.CallStackSidebarPane.Events.Call FrameSelected,this._callFrameSelectedInSidebar.bind(this));this.sidebarPanes.cal lstack.addEventListener(WebInspector.CallStackSidebarPane.Events.CallFrameRestar ted,this._callFrameRestartedInSidebar.bind(this));this.sidebarPanes.callstack.re gisterShortcuts(this.registerShortcuts.bind(this));this.sidebarPanes.scopechain= new WebInspector.ScopeChainSidebarPane();this.sidebarPanes.jsBreakpoints=new Web Inspector.JavaScriptBreakpointsSidebarPane(WebInspector.debuggerModel,WebInspect or.breakpointManager,this.showUISourceCode.bind(this));this.sidebarPanes.domBrea kpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPan es.xhrBreakpoints=new WebInspector.XHRBreakpointsSidebarPane();this.sidebarPanes .eventListenerBreakpoints=new WebInspector.EventListenerBreakpointsSidebarPane() ;if(Capabilities.isMainFrontend)
1324 this.sidebarPanes.workerList=new WebInspector.WorkersSidebarPane();this._extensi onSidebarPanes=[];this._installDebuggerSidebarController();WebInspector.dockCont roller.addEventListener(WebInspector.DockController.Events.DockSideChanged,this. _dockSideChanged.bind(this));WebInspector.settings.splitVerticallyWhenDockedToRi ght.addChangeListener(this._dockSideChanged.bind(this));this._dockSideChanged(); this._updateDebuggerButtons();this._pauseOnExceptionEnabledChanged();if(WebInspe ctor.debuggerModel.isPaused())
1325 this._showDebuggerPausedDetails();WebInspector.settings.pauseOnExceptionEnabled. addChangeListener(this._pauseOnExceptionEnabledChanged,this);WebInspector.debugg erModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled,th is._debuggerWasEnabled,this);WebInspector.debuggerModel.addEventListener(WebInsp ector.DebuggerModel.Events.DebuggerWasDisabled,this._debuggerWasDisabled,this);W ebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Deb uggerPaused,this._debuggerPaused,this);WebInspector.debuggerModel.addEventListen er(WebInspector.DebuggerModel.Events.DebuggerResumed,this._debuggerResumed,this) ;WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.C allFrameSelected,this._callFrameSelected,this);WebInspector.debuggerModel.addEve ntListener(WebInspector.DebuggerModel.Events.ConsoleCommandEvaluatedInSelectedCa llFrame,this._consoleCommandEvaluatedInSelectedCallFrame,this);WebInspector.debu ggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointsActiveSt ateChanged,this._breakpointsActiveStateChanged,this);WebInspector.debuggerModel. addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._deb uggerReset,this);}
1326 WebInspector.SourcesPanel.minToolbarWidth=215;WebInspector.SourcesPanel.prototyp e={defaultFocusedElement:function()
1327 {return this._sourcesView.defaultFocusedElement()||this._navigator.view.defaultF ocusedElement();},get paused()
1328 {return this._paused;},_drawerEditor:function()
1329 {var drawerEditorInstance=WebInspector.moduleManager.instance(WebInspector.Drawe rEditor);console.assert(drawerEditorInstance instanceof WebInspector.SourcesPane l.DrawerEditor,"WebInspector.DrawerEditor module instance does not use WebInspec tor.SourcesPanel.DrawerEditor as an implementation. ");return(drawerEditorInstan ce);},wasShown:function()
1330 {this._drawerEditor()._panelWasShown();this._sourcesView.show(this.editorView.ma inElement());WebInspector.Panel.prototype.wasShown.call(this);},willHide:functio n()
1331 {WebInspector.Panel.prototype.willHide.call(this);this._drawerEditor()._panelWil lHide();this._sourcesView.show(this._drawerEditorView.element);},searchableView: function()
1332 {return this._sourcesView.searchableView();},_consoleCommandEvaluatedInSelectedC allFrame:function(event)
1164 {this.sidebarPanes.scopechain.update(WebInspector.debuggerModel.selectedCallFram e());},_debuggerPaused:function() 1333 {this.sidebarPanes.scopechain.update(WebInspector.debuggerModel.selectedCallFram e());},_debuggerPaused:function()
1165 {WebInspector.inspectorView.setCurrentPanel(this);this._showDebuggerPausedDetail s();},_showDebuggerPausedDetails:function() 1334 {WebInspector.inspectorView.setCurrentPanel(this);this._showDebuggerPausedDetail s();},_showDebuggerPausedDetails:function()
1166 {var details=WebInspector.debuggerModel.debuggerPausedDetails();this._paused=tru e;this._waitingToPause=false;this._stepping=false;this._updateDebuggerButtons(); this.sidebarPanes.callstack.update(details.callFrames,details.asyncStackTrace);f unction didCreateBreakpointHitStatusMessage(element) 1335 {var details=WebInspector.debuggerModel.debuggerPausedDetails();this._paused=tru e;this._waitingToPause=false;this._updateDebuggerButtons();this.sidebarPanes.cal lstack.update(details.callFrames,details.asyncStackTrace);function didCreateBrea kpointHitStatusMessage(element)
1167 {this.sidebarPanes.callstack.setStatus(element);} 1336 {this.sidebarPanes.callstack.setStatus(element);}
1168 function didGetUILocation(uiLocation) 1337 function didGetUILocation(uiLocation)
1169 {var breakpoint=WebInspector.breakpointManager.findBreakpoint(uiLocation.uiSourc eCode,uiLocation.lineNumber);if(!breakpoint) 1338 {var breakpoint=WebInspector.breakpointManager.findBreakpointOnLine(uiLocation.u iSourceCode,uiLocation.lineNumber);if(!breakpoint)
1170 return;this.sidebarPanes.jsBreakpoints.highlightBreakpoint(breakpoint);this.side barPanes.callstack.setStatus(WebInspector.UIString("Paused on a JavaScript break point."));} 1339 return;this.sidebarPanes.jsBreakpoints.highlightBreakpoint(breakpoint);this.side barPanes.callstack.setStatus(WebInspector.UIString("Paused on a JavaScript break point."));}
1171 if(details.reason===WebInspector.DebuggerModel.BreakReason.DOM){WebInspector.dom BreakpointsSidebarPane.highlightBreakpoint(details.auxData);WebInspector.domBrea kpointsSidebarPane.createBreakpointHitStatusMessage(details.auxData,didCreateBre akpointHitStatusMessage.bind(this));}else if(details.reason===WebInspector.Debug gerModel.BreakReason.EventListener){var eventName=details.auxData.eventName;this .sidebarPanes.eventListenerBreakpoints.highlightBreakpoint(details.auxData.event Name);var eventNameForUI=WebInspector.EventListenerBreakpointsSidebarPane.eventN ameForUI(eventName,details.auxData);this.sidebarPanes.callstack.setStatus(WebIns pector.UIString("Paused on a \"%s\" Event Listener.",eventNameForUI));}else if(d etails.reason===WebInspector.DebuggerModel.BreakReason.XHR){this.sidebarPanes.xh rBreakpoints.highlightBreakpoint(details.auxData["breakpointURL"]);this.sidebarP anes.callstack.setStatus(WebInspector.UIString("Paused on a XMLHttpRequest."));} else if(details.reason===WebInspector.DebuggerModel.BreakReason.Exception) 1340 if(details.reason===WebInspector.DebuggerModel.BreakReason.DOM){WebInspector.dom BreakpointsSidebarPane.highlightBreakpoint(details.auxData);WebInspector.domBrea kpointsSidebarPane.createBreakpointHitStatusMessage(details.auxData,didCreateBre akpointHitStatusMessage.bind(this));}else if(details.reason===WebInspector.Debug gerModel.BreakReason.EventListener){var eventName=details.auxData.eventName;this .sidebarPanes.eventListenerBreakpoints.highlightBreakpoint(details.auxData.event Name);var eventNameForUI=WebInspector.EventListenerBreakpointsSidebarPane.eventN ameForUI(eventName,details.auxData);this.sidebarPanes.callstack.setStatus(WebIns pector.UIString("Paused on a \"%s\" Event Listener.",eventNameForUI));}else if(d etails.reason===WebInspector.DebuggerModel.BreakReason.XHR){this.sidebarPanes.xh rBreakpoints.highlightBreakpoint(details.auxData["breakpointURL"]);this.sidebarP anes.callstack.setStatus(WebInspector.UIString("Paused on a XMLHttpRequest."));} else if(details.reason===WebInspector.DebuggerModel.BreakReason.Exception)
1172 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on exception : '%s'.",details.auxData.description));else if(details.reason===WebInspector.Deb uggerModel.BreakReason.Assert) 1341 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on exception : '%s'.",details.auxData.description));else if(details.reason===WebInspector.Deb uggerModel.BreakReason.Assert)
1173 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on assertion ."));else if(details.reason===WebInspector.DebuggerModel.BreakReason.CSPViolatio n) 1342 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on assertion ."));else if(details.reason===WebInspector.DebuggerModel.BreakReason.CSPViolatio n)
1174 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a script blocked due to Content Security Policy directive: \"%s\".",details.auxData["dire ctiveText"]));else if(details.reason===WebInspector.DebuggerModel.BreakReason.De bugCommand) 1343 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a script blocked due to Content Security Policy directive: \"%s\".",details.auxData["dire ctiveText"]));else if(details.reason===WebInspector.DebuggerModel.BreakReason.De bugCommand)
1175 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a debugge d function"));else{if(details.callFrames.length) 1344 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a debugge d function"));else{if(details.callFrames.length)
1176 details.callFrames[0].createLiveLocation(didGetUILocation.bind(this));else 1345 details.callFrames[0].createLiveLocation(didGetUILocation.bind(this));else
1177 console.warn("ScriptsPanel paused, but callFrames.length is zero.");} 1346 console.warn("ScriptsPanel paused, but callFrames.length is zero.");}
1178 this._enableDebuggerSidebar(true);this._toggleDebuggerSidebarButton.setEnabled(f alse);window.focus();InspectorFrontendHost.bringToFront();},_debuggerResumed:fun ction() 1347 this._splitView.showBoth(true);this._toggleDebuggerSidebarButton.setEnabled(fals e);window.focus();InspectorFrontendHost.bringToFront();},_debuggerResumed:functi on()
1179 {this._paused=false;this._waitingToPause=false;this._stepping=false;this._clearI nterface();this._toggleDebuggerSidebarButton.setEnabled(true);},_debuggerWasEnab led:function() 1348 {this._paused=false;this._waitingToPause=false;this._clearInterface();this._togg leDebuggerSidebarButton.setEnabled(true);},_debuggerWasEnabled:function()
1180 {this._updateDebuggerButtons();},_debuggerWasDisabled:function() 1349 {this._updateDebuggerButtons();},_debuggerWasDisabled:function()
1181 {this._debuggerReset();},_debuggerReset:function() 1350 {this._debuggerReset();},_debuggerReset:function()
1182 {this._debuggerResumed();this.sidebarPanes.watchExpressions.reset();delete this. _skipExecutionLineRevealing;},_projectWillReset:function(event) 1351 {this._debuggerResumed();this.sidebarPanes.watchExpressions.reset();delete this. _skipExecutionLineRevealing;},get visibleView()
1183 {var project=event.data;var uiSourceCodes=project.uiSourceCodes();this._removeUI SourceCodes(uiSourceCodes);if(project.type()===WebInspector.projectTypes.Network ) 1352 {return this._sourcesView.visibleView();},showUISourceCode:function(uiSourceCode ,lineNumber,columnNumber,forceShowInPanel)
1184 this._editorContainer.reset();},get visibleView() 1353 {this._showEditor(forceShowInPanel);this._sourcesView.showSourceLocation(uiSourc eCode,lineNumber,columnNumber);},_showEditor:function(forceShowInPanel)
1185 {return this._editorContainer.visibleView;},_updateScriptViewStatusBarItems:func tion() 1354 {if(this._sourcesView.isShowing())
1186 {this._scriptViewStatusBarItemsContainer.removeChildren();this._scriptViewStatus BarTextContainer.removeChildren();var sourceFrame=this.visibleView;if(sourceFram e){var statusBarItems=sourceFrame.statusBarItems()||[];for(var i=0;i<statusBarIt ems.length;++i) 1355 return;if(this._shouldShowEditorInDrawer()&&!forceShowInPanel)
1187 this._scriptViewStatusBarItemsContainer.appendChild(statusBarItems[i]);var statu sBarText=sourceFrame.statusBarText();if(statusBarText) 1356 this._drawerEditor()._show();else
1188 this._scriptViewStatusBarTextContainer.appendChild(statusBarText);}},showAnchorL ocation:function(anchor) 1357 WebInspector.inspectorView.showPanel("sources");},showUILocation:function(uiLoca tion,forceShowInPanel)
1189 {if(!anchor.uiSourceCode){var uiSourceCode=WebInspector.workspace.uiSourceCodeFo rURL(anchor.href);if(uiSourceCode) 1358 {this.showUISourceCode(uiLocation.uiSourceCode,uiLocation.lineNumber,uiLocation. columnNumber,forceShowInPanel);},_shouldShowEditorInDrawer:function()
1190 anchor.uiSourceCode=uiSourceCode;} 1359 {return WebInspector.experimentsSettings.showEditorInDrawer.isEnabled()&&WebInsp ector.settings.showEditorInDrawer.get()&&WebInspector.inspectorView.isDrawerEdit orShown();},_revealInNavigator:function(uiSourceCode)
1191 if(!anchor.uiSourceCode) 1360 {this._navigator.revealUISourceCode(uiSourceCode);},_executionLineChanged:functi on(uiLocation)
1192 return false;this._showSourceLocation(anchor.uiSourceCode,anchor.lineNumber,anch or.columnNumber);return true;},showUISourceCode:function(uiSourceCode,lineNumber ,columnNumber,forceShowInPanel) 1361 {this._sourcesView.clearCurrentExecutionLine();this._sourcesView.setExecutionLin e(uiLocation);if(this._skipExecutionLineRevealing)
1193 {this._showSourceLocation(uiSourceCode,lineNumber,columnNumber,forceShowInPanel) ;},_showEditor:function(forceShowInPanel) 1362 return;this._skipExecutionLineRevealing=true;this._sourcesView.showSourceLocatio n(uiLocation.uiSourceCode,uiLocation.lineNumber,0,undefined,true);},_callFrameSe lected:function(event)
1194 {if(this.sourcesView.isShowing())
1195 return;if(this._canShowEditorInDrawer()&&!forceShowInPanel){var drawerEditorView =new WebInspector.DrawerEditorView();this.sourcesView.show(drawerEditorView.elem ent);WebInspector.inspectorView.showCloseableViewInDrawer("editor",WebInspector. UIString("Editor"),drawerEditorView);}else{WebInspector.showPanel("sources");}}, currentUISourceCode:function()
1196 {return this._currentUISourceCode;},showUILocation:function(uiLocation,forceShow InPanel)
1197 {this._showSourceLocation(uiLocation.uiSourceCode,uiLocation.lineNumber,uiLocati on.columnNumber,forceShowInPanel);},_canShowEditorInDrawer:function()
1198 {return WebInspector.experimentsSettings.showEditorInDrawer.isEnabled()&&WebInsp ector.settings.showEditorInDrawer.get();},_showSourceLocation:function(uiSourceC ode,lineNumber,columnNumber,forceShowInPanel)
1199 {this._showEditor(forceShowInPanel);this._historyManager.updateCurrentState();va r sourceFrame=this._showFile(uiSourceCode);if(typeof lineNumber==="number")
1200 sourceFrame.highlightPosition(lineNumber,columnNumber);this._historyManager.push NewState();sourceFrame.focus();WebInspector.notifications.dispatchEventToListene rs(WebInspector.UserMetrics.UserAction,{action:WebInspector.UserMetrics.UserActi onNames.OpenSourceLink,url:uiSourceCode.originURL(),lineNumber:lineNumber});},_s howFile:function(uiSourceCode)
1201 {var sourceFrame=this._getOrCreateSourceFrame(uiSourceCode);if(this._currentUISo urceCode===uiSourceCode)
1202 return sourceFrame;this._currentUISourceCode=uiSourceCode;if(!uiSourceCode.proje ct().isServiceProject())
1203 this._navigator.revealUISourceCode(uiSourceCode,true);this._editorContainer.show File(uiSourceCode);this._updateScriptViewStatusBarItems();if(this._currentUISour ceCode.project().type()===WebInspector.projectTypes.Snippets)
1204 this._runSnippetButton.element.classList.remove("hidden");else
1205 this._runSnippetButton.element.classList.add("hidden");return sourceFrame;},_cre ateSourceFrame:function(uiSourceCode)
1206 {var sourceFrame;switch(uiSourceCode.contentType()){case WebInspector.resourceTy pes.Script:sourceFrame=new WebInspector.JavaScriptSourceFrame(this,uiSourceCode) ;break;case WebInspector.resourceTypes.Document:sourceFrame=new WebInspector.Jav aScriptSourceFrame(this,uiSourceCode);break;case WebInspector.resourceTypes.Styl esheet:sourceFrame=new WebInspector.CSSSourceFrame(uiSourceCode);break;default:s ourceFrame=new WebInspector.UISourceCodeFrame(uiSourceCode);break;}
1207 sourceFrame.setHighlighterType(uiSourceCode.highlighterType());this._sourceFrame sByUISourceCode.put(uiSourceCode,sourceFrame);this._historyManager.trackSourceFr ameCursorJumps(sourceFrame);return sourceFrame;},_getOrCreateSourceFrame:functio n(uiSourceCode)
1208 {return this._sourceFramesByUISourceCode.get(uiSourceCode)||this._createSourceFr ame(uiSourceCode);},_sourceFrameMatchesUISourceCode:function(sourceFrame,uiSourc eCode)
1209 {switch(uiSourceCode.contentType()){case WebInspector.resourceTypes.Script:case WebInspector.resourceTypes.Document:return sourceFrame instanceof WebInspector.J avaScriptSourceFrame;case WebInspector.resourceTypes.Stylesheet:return sourceFra me instanceof WebInspector.CSSSourceFrame;default:return!(sourceFrame instanceof WebInspector.JavaScriptSourceFrame);}},_recreateSourceFrameIfNeeded:function(ui SourceCode)
1210 {var oldSourceFrame=this._sourceFramesByUISourceCode.get(uiSourceCode);if(!oldSo urceFrame)
1211 return;if(this._sourceFrameMatchesUISourceCode(oldSourceFrame,uiSourceCode)){old SourceFrame.setHighlighterType(uiSourceCode.highlighterType());}else{this._edito rContainer.removeUISourceCode(uiSourceCode);this._removeSourceFrame(uiSourceCode );}},viewForFile:function(uiSourceCode)
1212 {return this._getOrCreateSourceFrame(uiSourceCode);},_removeSourceFrame:function (uiSourceCode)
1213 {var sourceFrame=this._sourceFramesByUISourceCode.get(uiSourceCode);if(!sourceFr ame)
1214 return;this._sourceFramesByUISourceCode.remove(uiSourceCode);sourceFrame.dispose ();},_clearCurrentExecutionLine:function()
1215 {if(this._executionSourceFrame)
1216 this._executionSourceFrame.clearExecutionLine();delete this._executionSourceFram e;},_setExecutionLine:function(uiLocation)
1217 {var callFrame=WebInspector.debuggerModel.selectedCallFrame()
1218 var sourceFrame=this._getOrCreateSourceFrame(uiLocation.uiSourceCode);sourceFram e.setExecutionLine(uiLocation.lineNumber,callFrame);this._executionSourceFrame=s ourceFrame;},_executionLineChanged:function(uiLocation)
1219 {this._historyManager.updateCurrentState();this._clearCurrentExecutionLine();thi s._setExecutionLine(uiLocation);var uiSourceCode=uiLocation.uiSourceCode;var scr iptFile=this._currentUISourceCode?this._currentUISourceCode.scriptFile():null;if (this._skipExecutionLineRevealing)
1220 return;this._skipExecutionLineRevealing=true;var sourceFrame=this._showFile(uiSo urceCode);sourceFrame.revealLine(uiLocation.lineNumber);this._historyManager.pus hNewState();if(sourceFrame.canEditSource())
1221 sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(uiLocation.li neNumber,0));sourceFrame.focus();},_callFrameSelected:function(event)
1222 {var callFrame=event.data;if(!callFrame) 1363 {var callFrame=event.data;if(!callFrame)
1223 return;this.sidebarPanes.scopechain.update(callFrame);this.sidebarPanes.watchExp ressions.refreshExpressions();this.sidebarPanes.callstack.setSelectedCallFrame(c allFrame);callFrame.createLiveLocation(this._executionLineChanged.bind(this));}, _editorClosed:function(event) 1364 return;this.sidebarPanes.scopechain.update(callFrame);this.sidebarPanes.watchExp ressions.refreshExpressions();this.sidebarPanes.callstack.setSelectedCallFrame(c allFrame);callFrame.createLiveLocation(this._executionLineChanged.bind(this));}, _sourceSelected:function(event)
1224 {this._navigatorController.hideNavigatorOverlay();var uiSourceCode=(event.data); this._historyManager.removeHistoryForSourceCode(uiSourceCode);if(this._currentUI SourceCode===uiSourceCode) 1365 {var uiSourceCode=(event.data.uiSourceCode);this._sourcesView.showSourceLocation (uiSourceCode,undefined,undefined,!event.data.focusSource)},_sourceRenamed:funct ion(event)
1225 delete this._currentUISourceCode;this._updateScriptViewStatusBarItems();this._se archableView.resetSearch();},_editorSelected:function(event) 1366 {var uiSourceCode=(event.data);this._sourcesView.sourceRenamed(uiSourceCode);},_ pauseOnExceptionEnabledChanged:function()
1226 {var uiSourceCode=(event.data.currentFile);var shouldUseHistoryManager=uiSourceC ode!==this._currentUISourceCode&&event.data.userGesture;if(shouldUseHistoryManag er) 1367 {var enabled=WebInspector.settings.pauseOnExceptionEnabled.get();this._pauseOnEx ceptionButton.toggled=enabled;this._pauseOnExceptionButton.title=WebInspector.UI String(enabled?"Don't pause on exceptions.":"Pause on exceptions.");this._debugT oolbarDrawer.classList.toggle("expanded",enabled);},_updateDebuggerButtons:funct ion()
1227 this._historyManager.updateCurrentState();var sourceFrame=this._showFile(uiSourc eCode);if(shouldUseHistoryManager)
1228 this._historyManager.pushNewState();this._navigatorController.hideNavigatorOverl ay();if(!this._navigatorController.isNavigatorPinned())
1229 sourceFrame.focus();this._searchableView.setReplaceable(!!sourceFrame&&sourceFra me.canEditSource());this._searchableView.resetSearch();},_sourceSelected:functio n(event)
1230 {var uiSourceCode=(event.data.uiSourceCode);var shouldUseHistoryManager=uiSource Code!==this._currentUISourceCode;if(shouldUseHistoryManager)
1231 this._historyManager.updateCurrentState();var sourceFrame=this._showFile(uiSourc eCode);if(shouldUseHistoryManager)
1232 this._historyManager.pushNewState();this._navigatorController.hideNavigatorOverl ay();if(sourceFrame&&(!this._navigatorController.isNavigatorPinned()||event.data .focusSource))
1233 sourceFrame.focus();},_itemSearchStarted:function(event)
1234 {var searchText=(event.data);WebInspector.OpenResourceDialog.show(this,this.edit orView.mainElement(),searchText);},_createPauseOnExceptionOptions:function()
1235 {this._pauseOnExceptionButton.title=this._pauseOnExceptionStateTitle(this._pause OnExceptionButton.state);var excludedOption=this._pauseOnExceptionButton.state;v ar pauseStates=WebInspector.SourcesPanel.PauseOnExceptionsStates.slice(0);var op tions=[];for(var i=0;i<pauseStates.length;++i){if(pauseStates[i]===excludedOptio n)
1236 continue;var button=new WebInspector.StatusBarButton("","scripts-pause-on-except ions-status-bar-item",3);button.addEventListener("click",this._togglePauseOnExce ptions,this);button.state=pauseStates[i];button.title=this._pauseOnExceptionStat eTitle(pauseStates[i]);options.push(button);}
1237 return options;},_pauseOnExceptionStateChanged:function()
1238 {var state=WebInspector.settings.pauseOnExceptionStateString.get();var nextState ;if(state===WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExcepti ons)
1239 nextState=WebInspector.settings.lastPauseOnExceptionState.get();else
1240 nextState=WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnException s;this._pauseOnExceptionButton.title=this._pauseOnExceptionStateTitle(state,next State);this._pauseOnExceptionButton.state=state;},_pauseOnExceptionStateTitle:fu nction(state,nextState)
1241 {var states=WebInspector.DebuggerModel.PauseOnExceptionsState;var stateDescripti on;if(state===states.DontPauseOnExceptions){stateDescription=WebInspector.UIStri ng("Don't pause on exceptions.");}else if(state===states.PauseOnAllExceptions){s tateDescription=WebInspector.UIString("Pause on exceptions, including caught exc eptions.");}else if(state===states.PauseOnUncaughtExceptions){stateDescription=W ebInspector.UIString("Pause on exceptions.");}else{throw"Unexpected state: "+sta te;}
1242 var nextStateDescription;if(nextState===states.DontPauseOnExceptions){nextStateD escription=WebInspector.UIString("Click to Not pause on exceptions.");}else if(n extState===states.PauseOnAllExceptions){nextStateDescription=WebInspector.UIStri ng("Click to Pause on exceptions, including caught exceptions.");}else if(nextSt ate===states.PauseOnUncaughtExceptions){nextStateDescription=WebInspector.UIStri ng("Click to Pause on exceptions.");}
1243 return nextState?String.sprintf("%s\n%s",stateDescription,nextStateDescription): stateDescription;},_updateDebuggerButtons:function()
1244 {if(this._paused){this._updateButtonTitle(this._pauseButton,WebInspector.UIStrin g("Resume script execution (%s).")) 1368 {if(this._paused){this._updateButtonTitle(this._pauseButton,WebInspector.UIStrin g("Resume script execution (%s)."))
1245 this._pauseButton.state=true;this._pauseButton.setLongClickOptionsEnabled((funct ion(){return[this._longResumeButton]}).bind(this));this._pauseButton.setEnabled( true);this._stepOverButton.setEnabled(true);this._stepIntoButton.setEnabled(true );this._stepOutButton.setEnabled(true);}else{this._updateButtonTitle(this._pause Button,WebInspector.UIString("Pause script execution (%s).")) 1369 this._pauseButton.state=true;this._pauseButton.setLongClickOptionsEnabled((funct ion(){return[this._longResumeButton]}).bind(this));this._pauseButton.setEnabled( true);this._stepOverButton.setEnabled(true);this._stepIntoButton.setEnabled(true );this._stepOutButton.setEnabled(true);}else{this._updateButtonTitle(this._pause Button,WebInspector.UIString("Pause script execution (%s)."))
1246 this._pauseButton.state=false;this._pauseButton.setLongClickOptionsEnabled(null) ;this._pauseButton.setEnabled(!this._waitingToPause);this._stepOverButton.setEna bled(false);this._stepIntoButton.setEnabled(false);this._stepOutButton.setEnable d(false);}},_clearInterface:function() 1370 this._pauseButton.state=false;this._pauseButton.setLongClickOptionsEnabled(null) ;this._pauseButton.setEnabled(!this._waitingToPause);this._stepOverButton.setEna bled(false);this._stepIntoButton.setEnabled(false);this._stepOutButton.setEnable d(false);}},_clearInterface:function()
1247 {this.sidebarPanes.callstack.update(null,null);this.sidebarPanes.scopechain.upda te(null);this.sidebarPanes.jsBreakpoints.clearBreakpointHighlight();WebInspector .domBreakpointsSidebarPane.clearBreakpointHighlight();this.sidebarPanes.eventLis tenerBreakpoints.clearBreakpointHighlight();this.sidebarPanes.xhrBreakpoints.cle arBreakpointHighlight();this._clearCurrentExecutionLine();this._updateDebuggerBu ttons();},_togglePauseOnExceptions:function(e) 1371 {this.sidebarPanes.callstack.update(null,null);this.sidebarPanes.scopechain.upda te(null);this.sidebarPanes.jsBreakpoints.clearBreakpointHighlight();WebInspector .domBreakpointsSidebarPane.clearBreakpointHighlight();this.sidebarPanes.eventLis tenerBreakpoints.clearBreakpointHighlight();this.sidebarPanes.xhrBreakpoints.cle arBreakpointHighlight();this._sourcesView.clearCurrentExecutionLine();this._upda teDebuggerButtons();},_togglePauseOnExceptions:function()
1248 {var target=(e.target);var state=(target.state);var toggle=!e.data;var stateEnum =WebInspector.DebuggerModel.PauseOnExceptionsState;if(toggle){if(state!==stateEn um.DontPauseOnExceptions) 1372 {WebInspector.settings.pauseOnExceptionEnabled.set(!this._pauseOnExceptionButton .toggled);},_runSnippet:function()
1249 state=stateEnum.DontPauseOnExceptions 1373 {var uiSourceCode=this._sourcesView.currentUISourceCode();if(uiSourceCode.projec t().type()!==WebInspector.projectTypes.Snippets)
1250 else 1374 return false;WebInspector.scriptSnippetModel.evaluateScriptSnippet(uiSourceCode) ;return true;},_editorSelected:function(event)
1251 state=WebInspector.settings.lastPauseOnExceptionState.get();} 1375 {var uiSourceCode=(event.data);this._editorChanged(uiSourceCode);},_editorClosed :function(event)
1252 if(state!==stateEnum.DontPauseOnExceptions) 1376 {var wasSelected=(event.data.wasSelected);if(wasSelected)
1253 WebInspector.settings.lastPauseOnExceptionState.set(state);WebInspector.settings .pauseOnExceptionStateString.set(state);},_runSnippet:function() 1377 this._editorChanged(null);},_editorChanged:function(uiSourceCode)
1254 {if(this._currentUISourceCode.project().type()!==WebInspector.projectTypes.Snipp ets) 1378 {var isSnippet=uiSourceCode&&uiSourceCode.project().type()===WebInspector.projec tTypes.Snippets;this._runSnippetButton.element.classList.toggle("hidden",!isSnip pet);},_togglePause:function()
1255 return false;WebInspector.scriptSnippetModel.evaluateScriptSnippet(this._current UISourceCode);return true;},_togglePause:function() 1379 {if(this._paused){delete this._skipExecutionLineRevealing;this._paused=false;thi s._waitingToPause=false;WebInspector.debuggerModel.resume();}else{this._waitingT oPause=true;WebInspector.debuggerModel.skipAllPauses(false);DebuggerAgent.pause( );}
1256 {if(this._paused){delete this._skipExecutionLineRevealing;this._paused=false;thi s._waitingToPause=false;WebInspector.debuggerModel.resume();}else{this._stepping =false;this._waitingToPause=true;WebInspector.debuggerModel.skipAllPauses(false) ;DebuggerAgent.pause();}
1257 this._clearInterface();return true;},_longResume:function() 1380 this._clearInterface();return true;},_longResume:function()
1258 {if(!this._paused) 1381 {if(!this._paused)
1259 return true;this._paused=false;this._waitingToPause=false;WebInspector.debuggerM odel.skipAllPausesUntilReloadOrTimeout(500);WebInspector.debuggerModel.resume(); this._clearInterface();return true;},_stepOverClicked:function() 1382 return true;this._paused=false;this._waitingToPause=false;WebInspector.debuggerM odel.skipAllPausesUntilReloadOrTimeout(500);WebInspector.debuggerModel.resume(); this._clearInterface();return true;},_stepOverClicked:function()
1260 {if(!this._paused) 1383 {if(!this._paused)
1261 return true;delete this._skipExecutionLineRevealing;this._paused=false;this._ste pping=true;this._clearInterface();WebInspector.debuggerModel.stepOver();return t rue;},_stepIntoClicked:function() 1384 return true;delete this._skipExecutionLineRevealing;this._paused=false;this._cle arInterface();WebInspector.debuggerModel.stepOver();return true;},_stepIntoClick ed:function()
1262 {if(!this._paused) 1385 {if(!this._paused)
1263 return true;delete this._skipExecutionLineRevealing;this._paused=false;this._ste pping=true;this._clearInterface();WebInspector.debuggerModel.stepInto();return t rue;},_stepIntoSelectionClicked:function(event) 1386 return true;delete this._skipExecutionLineRevealing;this._paused=false;this._cle arInterface();WebInspector.debuggerModel.stepInto();return true;},_stepOutClicke d:function()
1264 {if(!this._paused) 1387 {if(!this._paused)
1265 return true;if(this._executionSourceFrame){var stepIntoMarkup=this._executionSou rceFrame.stepIntoMarkup();if(stepIntoMarkup) 1388 return true;delete this._skipExecutionLineRevealing;this._paused=false;this._cle arInterface();WebInspector.debuggerModel.stepOut();return true;},_callFrameSelec tedInSidebar:function(event)
1266 stepIntoMarkup.iterateSelection(event.shiftKey);}
1267 return true;},doStepIntoSelection:function(rawLocation)
1268 {if(!this._paused)
1269 return;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping =true;this._clearInterface();WebInspector.debuggerModel.stepIntoSelection(rawLoc ation);},_stepOutClicked:function()
1270 {if(!this._paused)
1271 return true;delete this._skipExecutionLineRevealing;this._paused=false;this._ste pping=true;this._clearInterface();WebInspector.debuggerModel.stepOut();return tr ue;},_callFrameSelectedInSidebar:function(event)
1272 {var callFrame=(event.data);delete this._skipExecutionLineRevealing;WebInspector .debuggerModel.setSelectedCallFrame(callFrame);},_callFrameRestartedInSidebar:fu nction() 1389 {var callFrame=(event.data);delete this._skipExecutionLineRevealing;WebInspector .debuggerModel.setSelectedCallFrame(callFrame);},_callFrameRestartedInSidebar:fu nction()
1273 {delete this._skipExecutionLineRevealing;},continueToLocation:function(rawLocati on) 1390 {delete this._skipExecutionLineRevealing;},continueToLocation:function(rawLocati on)
1274 {if(!this._paused) 1391 {if(!this._paused)
1275 return;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping =true;this._clearInterface();WebInspector.debuggerModel.continueToLocation(rawLo cation);},_toggleBreakpointsClicked:function(event) 1392 return;delete this._skipExecutionLineRevealing;this._paused=false;this._clearInt erface();WebInspector.debuggerModel.continueToLocation(rawLocation);},_toggleBre akpointsClicked:function(event)
1276 {WebInspector.debuggerModel.setBreakpointsActive(!WebInspector.debuggerModel.bre akpointsActive());},_breakpointsActiveStateChanged:function(event) 1393 {WebInspector.debuggerModel.setBreakpointsActive(!WebInspector.debuggerModel.bre akpointsActive());},_breakpointsActiveStateChanged:function(event)
1277 {var active=event.data;this._toggleBreakpointsButton.toggled=!active;if(active){ this._toggleBreakpointsButton.title=WebInspector.UIString("Deactivate breakpoint s.");this._editorContainer.view.element.classList.remove("breakpoints-deactivate d");this.sidebarPanes.jsBreakpoints.listElement.classList.remove("breakpoints-li st-deactivated");}else{this._toggleBreakpointsButton.title=WebInspector.UIString ("Activate breakpoints.");this._editorContainer.view.element.classList.add("brea kpoints-deactivated");this.sidebarPanes.jsBreakpoints.listElement.classList.add( "breakpoints-list-deactivated");}},_createDebugToolbar:function() 1394 {var active=event.data;this._toggleBreakpointsButton.toggled=!active;this.sideba rPanes.jsBreakpoints.listElement.classList.toggle("breakpoints-list-deactivated" ,!active);this._sourcesView.toggleBreakpointsActiveState(active);if(active)
1278 {var debugToolbar=document.createElement("div");debugToolbar.className="status-b ar";debugToolbar.id="scripts-debug-toolbar";var title,handler;var platformSpecif icModifier=WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta;title=WebInspector .UIString("Run snippet (%s).");handler=this._runSnippet.bind(this);this._runSnip petButton=this._createButtonAndRegisterShortcuts("scripts-run-snippet",title,han dler,WebInspector.ShortcutsScreen.SourcesPanelShortcuts.RunSnippet);debugToolbar .appendChild(this._runSnippetButton.element);this._runSnippetButton.element.clas sList.add("hidden");handler=this._togglePause.bind(this);this._pauseButton=this. _createButtonAndRegisterShortcuts("scripts-pause","",handler,WebInspector.Shortc utsScreen.SourcesPanelShortcuts.PauseContinue);debugToolbar.appendChild(this._pa useButton.element);title=WebInspector.UIString("Resume with all pauses blocked f or 500 ms");this._longResumeButton=new WebInspector.StatusBarButton(title,"scrip ts-long-resume");this._longResumeButton.addEventListener("click",this._longResum e.bind(this),this);title=WebInspector.UIString("Step over next function call (%s ).");handler=this._stepOverClicked.bind(this);this._stepOverButton=this._createB uttonAndRegisterShortcuts("scripts-step-over",title,handler,WebInspector.Shortcu tsScreen.SourcesPanelShortcuts.StepOver);debugToolbar.appendChild(this._stepOver Button.element);title=WebInspector.UIString("Step into next function call (%s)." );handler=this._stepIntoClicked.bind(this);this._stepIntoButton=this._createButt onAndRegisterShortcuts("scripts-step-into",title,handler,WebInspector.ShortcutsS creen.SourcesPanelShortcuts.StepInto);debugToolbar.appendChild(this._stepIntoBut ton.element);this.registerShortcuts(WebInspector.ShortcutsScreen.SourcesPanelSho rtcuts.StepIntoSelection,this._stepIntoSelectionClicked.bind(this)) 1395 this._toggleBreakpointsButton.title=WebInspector.UIString("Deactivate breakpoint s.");else
1279 title=WebInspector.UIString("Step out of current function (%s).");handler=this._ stepOutClicked.bind(this);this._stepOutButton=this._createButtonAndRegisterShort cuts("scripts-step-out",title,handler,WebInspector.ShortcutsScreen.SourcesPanelS hortcuts.StepOut);debugToolbar.appendChild(this._stepOutButton.element);this._to ggleBreakpointsButton=new WebInspector.StatusBarButton(WebInspector.UIString("De activate breakpoints."),"scripts-toggle-breakpoints");this._toggleBreakpointsBut ton.toggled=false;this._toggleBreakpointsButton.addEventListener("click",this._t oggleBreakpointsClicked,this);debugToolbar.appendChild(this._toggleBreakpointsBu tton.element);this._pauseOnExceptionButton=new WebInspector.StatusBarButton(""," scripts-pause-on-exceptions-status-bar-item",3);this._pauseOnExceptionButton.add EventListener("click",this._togglePauseOnExceptions,this);this._pauseOnException Button.setLongClickOptionsEnabled(this._createPauseOnExceptionOptions.bind(this) );debugToolbar.appendChild(this._pauseOnExceptionButton.element);return debugToo lbar;},_updateButtonTitle:function(button,buttonTitle) 1396 this._toggleBreakpointsButton.title=WebInspector.UIString("Activate breakpoints. ");},_createDebugToolbar:function()
1397 {var debugToolbar=document.createElement("div");debugToolbar.className="scripts- debug-toolbar";var title,handler;var platformSpecificModifier=WebInspector.Keybo ardShortcut.Modifiers.CtrlOrMeta;title=WebInspector.UIString("Run snippet (%s)." );handler=this._runSnippet.bind(this);this._runSnippetButton=this._createButtonA ndRegisterShortcuts("scripts-run-snippet",title,handler,WebInspector.ShortcutsSc reen.SourcesPanelShortcuts.RunSnippet);debugToolbar.appendChild(this._runSnippet Button.element);this._runSnippetButton.element.classList.add("hidden");handler=t his._togglePause.bind(this);this._pauseButton=this._createButtonAndRegisterShort cuts("scripts-pause","",handler,WebInspector.ShortcutsScreen.SourcesPanelShortcu ts.PauseContinue);debugToolbar.appendChild(this._pauseButton.element);title=WebI nspector.UIString("Resume with all pauses blocked for 500 ms");this._longResumeB utton=new WebInspector.StatusBarButton(title,"scripts-long-resume");this._longRe sumeButton.addEventListener("click",this._longResume.bind(this),this);title=WebI nspector.UIString("Step over next function call (%s).");handler=this._stepOverCl icked.bind(this);this._stepOverButton=this._createButtonAndRegisterShortcuts("sc ripts-step-over",title,handler,WebInspector.ShortcutsScreen.SourcesPanelShortcut s.StepOver);debugToolbar.appendChild(this._stepOverButton.element);title=WebInsp ector.UIString("Step into next function call (%s).");handler=this._stepIntoClick ed.bind(this);this._stepIntoButton=this._createButtonAndRegisterShortcuts("scrip ts-step-into",title,handler,WebInspector.ShortcutsScreen.SourcesPanelShortcuts.S tepInto);debugToolbar.appendChild(this._stepIntoButton.element);title=WebInspect or.UIString("Step out of current function (%s).");handler=this._stepOutClicked.b ind(this);this._stepOutButton=this._createButtonAndRegisterShortcuts("scripts-st ep-out",title,handler,WebInspector.ShortcutsScreen.SourcesPanelShortcuts.StepOut );debugToolbar.appendChild(this._stepOutButton.element);this._toggleBreakpointsB utton=new WebInspector.StatusBarButton(WebInspector.UIString("Deactivate breakpo ints."),"scripts-toggle-breakpoints");this._toggleBreakpointsButton.toggled=fals e;this._toggleBreakpointsButton.addEventListener("click",this._toggleBreakpoints Clicked,this);debugToolbar.appendChild(this._toggleBreakpointsButton.element);th is._pauseOnExceptionButton=new WebInspector.StatusBarButton("","scripts-pause-on -exceptions-status-bar-item");this._pauseOnExceptionButton.addEventListener("cli ck",this._togglePauseOnExceptions,this);debugToolbar.appendChild(this._pauseOnEx ceptionButton.element);return debugToolbar;},_createDebugToolbarDrawer:function( )
1398 {var debugToolbarDrawer=document.createElement("div");debugToolbarDrawer.classNa me="scripts-debug-toolbar-drawer";var label=WebInspector.UIString("Pause On Caug ht Exceptions");var setting=WebInspector.settings.pauseOnCaughtException;debugTo olbarDrawer.appendChild(WebInspector.SettingsUI.createSettingCheckbox(label,sett ing,true));return debugToolbarDrawer;},_updateButtonTitle:function(button,button Title)
1280 {var hasShortcuts=button.shortcuts&&button.shortcuts.length;if(hasShortcuts) 1399 {var hasShortcuts=button.shortcuts&&button.shortcuts.length;if(hasShortcuts)
1281 button.title=String.vsprintf(buttonTitle,[button.shortcuts[0].name]);else 1400 button.title=String.vsprintf(buttonTitle,[button.shortcuts[0].name]);else
1282 button.title=buttonTitle;},_createButtonAndRegisterShortcuts:function(buttonId,b uttonTitle,handler,shortcuts) 1401 button.title=buttonTitle;},_createButtonAndRegisterShortcuts:function(buttonId,b uttonTitle,handler,shortcuts)
1283 {var button=new WebInspector.StatusBarButton(buttonTitle,buttonId);button.elemen t.addEventListener("click",handler,false);button.shortcuts=shortcuts;this._updat eButtonTitle(button,buttonTitle);this.registerShortcuts(shortcuts,handler);retur n button;},searchCanceled:function() 1402 {var button=new WebInspector.StatusBarButton(buttonTitle,buttonId);button.elemen t.addEventListener("click",handler,false);button.shortcuts=shortcuts;this._updat eButtonTitle(button,buttonTitle);this.registerShortcuts(shortcuts,handler);retur n button;},addToWatch:function(expression)
1284 {if(this._searchView) 1403 {this.sidebarPanes.watchExpressions.addExpression(expression);},_installDebugger SidebarController:function()
1285 this._searchView.searchCanceled();delete this._searchView;delete this._searchQue ry;},performSearch:function(query,shouldJump) 1404 {this._toggleNavigatorSidebarButton=this.editorView.createShowHideSidebarButton( "navigator","scripts-navigator-show-hide-button");this.editorView.mainElement(). appendChild(this._toggleNavigatorSidebarButton.element);this._toggleDebuggerSide barButton=this._splitView.createShowHideSidebarButton("debugger","scripts-debugg er-show-hide-button");this._splitView.mainElement().appendChild(this._toggleDebu ggerSidebarButton.element);this._splitView.mainElement().appendChild(this._debug SidebarResizeWidgetElement);},_updateDebugSidebarResizeWidget:function()
1286 {this._searchableView.updateSearchMatchesCount(0);if(!this.visibleView) 1405 {this._debugSidebarResizeWidgetElement.classList.toggle("hidden",this._splitView .showMode()!==WebInspector.SplitView.ShowMode.Both);},_showLocalHistory:function (uiSourceCode)
1287 return;this._searchView=this.visibleView;this._searchQuery=query;function finish edCallback(view,searchMatches)
1288 {if(!searchMatches)
1289 return;this._searchableView.updateSearchMatchesCount(searchMatches);}
1290 function currentMatchChanged(currentMatchIndex)
1291 {this._searchableView.updateCurrentMatchIndex(currentMatchIndex);}
1292 function searchResultsChanged()
1293 {this._searchableView.cancelSearch();}
1294 this._searchView.performSearch(query,shouldJump,finishedCallback.bind(this),curr entMatchChanged.bind(this),searchResultsChanged.bind(this));},jumpToNextSearchRe sult:function()
1295 {if(!this._searchView)
1296 return;if(this._searchView!==this.visibleView){this.performSearch(this._searchQu ery,true);return;}
1297 this._searchView.jumpToNextSearchResult();},jumpToPreviousSearchResult:function( )
1298 {if(!this._searchView)
1299 return;if(this._searchView!==this.visibleView){this.performSearch(this._searchQu ery,true);if(this._searchView)
1300 this._searchView.jumpToLastSearchResult();return;}
1301 this._searchView.jumpToPreviousSearchResult();},replaceSelectionWith:function(te xt)
1302 {var view=(this.visibleView);view.replaceSelectionWith(text);},replaceAllWith:fu nction(query,text)
1303 {var view=(this.visibleView);view.replaceAllWith(query,text);},_onKeyDown:functi on(event)
1304 {if(event.keyCode!==WebInspector.KeyboardShortcut.Keys.CtrlOrMeta.code)
1305 return;if(!this._paused||!this._executionSourceFrame)
1306 return;var stepIntoMarkup=this._executionSourceFrame.stepIntoMarkup();if(stepInt oMarkup)
1307 stepIntoMarkup.startIteratingSelection();},_onKeyUp:function(event)
1308 {if(event.keyCode!==WebInspector.KeyboardShortcut.Keys.CtrlOrMeta.code)
1309 return;if(!this._paused||!this._executionSourceFrame)
1310 return;var stepIntoMarkup=this._executionSourceFrame.stepIntoMarkup();if(!stepIn toMarkup)
1311 return;var currentPosition=stepIntoMarkup.getSelectedItemIndex();if(typeof curre ntPosition==="undefined"){stepIntoMarkup.stopIteratingSelection();}else{var rawL ocation=stepIntoMarkup.getRawPosition(currentPosition);this.doStepIntoSelection( rawLocation);}},_toggleFormatSource:function()
1312 {delete this._skipExecutionLineRevealing;this._toggleFormatSourceButton.toggled= !this._toggleFormatSourceButton.toggled;var uiSourceCodes=this._workspace.uiSour ceCodes();for(var i=0;i<uiSourceCodes.length;++i)
1313 uiSourceCodes[i].setFormatted(this._toggleFormatSourceButton.toggled);var curren tFile=this._editorContainer.currentFile();WebInspector.notifications.dispatchEve ntToListeners(WebInspector.UserMetrics.UserAction,{action:WebInspector.UserMetri cs.UserActionNames.TogglePrettyPrint,enabled:this._toggleFormatSourceButton.togg led,url:currentFile?currentFile.originURL():null});},addToWatch:function(express ion)
1314 {this.sidebarPanes.watchExpressions.addExpression(expression);},_toggleBreakpoin t:function()
1315 {var sourceFrame=this.visibleView;if(!sourceFrame)
1316 return false;if(sourceFrame instanceof WebInspector.JavaScriptSourceFrame){var j avaScriptSourceFrame=(sourceFrame);javaScriptSourceFrame.toggleBreakpointOnCurre ntLine();return true;}
1317 return false;},_showOutlineDialog:function(event)
1318 {var uiSourceCode=this._editorContainer.currentFile();if(!uiSourceCode)
1319 return false;switch(uiSourceCode.contentType()){case WebInspector.resourceTypes. Document:case WebInspector.resourceTypes.Script:WebInspector.JavaScriptOutlineDi alog.show(this.visibleView,uiSourceCode,this.highlightPosition.bind(this));retur n true;case WebInspector.resourceTypes.Stylesheet:WebInspector.StyleSheetOutline Dialog.show(this.visibleView,uiSourceCode,this.highlightPosition.bind(this));ret urn true;}
1320 return false;},_installDebuggerSidebarController:function()
1321 {this._toggleDebuggerSidebarButton=new WebInspector.StatusBarButton("","right-si debar-show-hide-button scripts-debugger-show-hide-button",3);this._toggleDebugge rSidebarButton.addEventListener("click",clickHandler,this);if(this.splitView.isV ertical()){this.editorView.element.appendChild(this._toggleDebuggerSidebarButton .element);this.splitView.mainElement().appendChild(this._debugSidebarResizeWidge tElement);}else{this._statusBarContainerElement.appendChild(this._debugSidebarRe sizeWidgetElement);this._statusBarContainerElement.appendChild(this._toggleDebug gerSidebarButton.element);}
1322 this._enableDebuggerSidebar(!WebInspector.settings.debuggerSidebarHidden.get()); function clickHandler()
1323 {this._enableDebuggerSidebar(this._toggleDebuggerSidebarButton.state==="left");} },_enableDebuggerSidebar:function(show)
1324 {this._toggleDebuggerSidebarButton.state=show?"right":"left";this._toggleDebugge rSidebarButton.title=show?WebInspector.UIString("Hide debugger"):WebInspector.UI String("Show debugger");if(show)
1325 this.splitView.showSidebarElement();else
1326 this.splitView.hideSidebarElement();this._debugSidebarResizeWidgetElement.enable StyleClass("hidden",!show);WebInspector.settings.debuggerSidebarHidden.set(!show );},_itemCreationRequested:function(event)
1327 {var project=event.data.project;var path=event.data.path;var uiSourceCodeToCopy= event.data.uiSourceCode;var filePath;var shouldHideNavigator;var uiSourceCode;fu nction contentLoaded(content)
1328 {createFile.call(this,content||"");}
1329 if(uiSourceCodeToCopy)
1330 uiSourceCodeToCopy.requestContent(contentLoaded.bind(this));else
1331 createFile.call(this);function createFile(content)
1332 {project.createFile(path,null,content||"",fileCreated.bind(this));}
1333 function fileCreated(path)
1334 {if(!path)
1335 return;filePath=path;uiSourceCode=project.uiSourceCode(filePath);this._showSourc eLocation(uiSourceCode);shouldHideNavigator=!this._navigatorController.isNavigat orPinned();if(this._navigatorController.isNavigatorHidden())
1336 this._navigatorController.showNavigatorOverlay();this._navigator.rename(uiSource Code,callback.bind(this));}
1337 function callback(committed)
1338 {if(shouldHideNavigator)
1339 this._navigatorController.hideNavigatorOverlay();if(!committed){project.deleteFi le(uiSourceCode);return;}
1340 this._recreateSourceFrameIfNeeded(uiSourceCode);this._navigator.updateIcon(uiSou rceCode);this._showSourceLocation(uiSourceCode);}},_itemRenamingRequested:functi on(event)
1341 {var uiSourceCode=(event.data);var shouldHideNavigator=!this._navigatorControlle r.isNavigatorPinned();if(this._navigatorController.isNavigatorHidden())
1342 this._navigatorController.showNavigatorOverlay();this._navigator.rename(uiSource Code,callback.bind(this));function callback(committed)
1343 {if(shouldHideNavigator&&committed)
1344 this._navigatorController.hideNavigatorOverlay();this._recreateSourceFrameIfNeed ed(uiSourceCode);this._navigator.updateIcon(uiSourceCode);this._showSourceLocati on(uiSourceCode);}},_showLocalHistory:function(uiSourceCode)
1345 {WebInspector.RevisionHistoryView.showHistory(uiSourceCode);},appendApplicableIt ems:function(event,contextMenu,target) 1406 {WebInspector.RevisionHistoryView.showHistory(uiSourceCode);},appendApplicableIt ems:function(event,contextMenu,target)
1346 {this._appendUISourceCodeItems(contextMenu,target);this._appendFunctionItems(con textMenu,target);},_mapFileSystemToNetwork:function(uiSourceCode) 1407 {this._appendUISourceCodeItems(event,contextMenu,target);this._appendRemoteObjec tItems(contextMenu,target);},_suggestReload:function()
1408 {if(window.confirm(WebInspector.UIString("It is recommended to restart inspector after making these changes. Would you like to restart it?")))
1409 WebInspector.reload();},_mapFileSystemToNetwork:function(uiSourceCode)
1347 {WebInspector.SelectUISourceCodeForProjectTypeDialog.show(uiSourceCode.name(),We bInspector.projectTypes.Network,mapFileSystemToNetwork.bind(this),this.editorVie w.mainElement()) 1410 {WebInspector.SelectUISourceCodeForProjectTypeDialog.show(uiSourceCode.name(),We bInspector.projectTypes.Network,mapFileSystemToNetwork.bind(this),this.editorVie w.mainElement())
1348 function mapFileSystemToNetwork(networkUISourceCode) 1411 function mapFileSystemToNetwork(networkUISourceCode)
1349 {this._workspace.addMapping(networkUISourceCode,uiSourceCode,WebInspector.fileSy stemWorkspaceProvider);}},_removeNetworkMapping:function(uiSourceCode) 1412 {this._workspace.addMapping(networkUISourceCode,uiSourceCode,WebInspector.fileSy stemWorkspaceProvider);this._suggestReload();}},_removeNetworkMapping:function(u iSourceCode)
1350 {if(confirm(WebInspector.UIString("Are you sure you want to remove network mappi ng?"))) 1413 {if(confirm(WebInspector.UIString("Are you sure you want to remove network mappi ng?"))){this._workspace.removeMapping(uiSourceCode);this._suggestReload();}},_ma pNetworkToFileSystem:function(networkUISourceCode)
1351 this._workspace.removeMapping(uiSourceCode);},_mapNetworkToFileSystem:function(n etworkUISourceCode)
1352 {WebInspector.SelectUISourceCodeForProjectTypeDialog.show(networkUISourceCode.na me(),WebInspector.projectTypes.FileSystem,mapNetworkToFileSystem.bind(this),this .editorView.mainElement()) 1414 {WebInspector.SelectUISourceCodeForProjectTypeDialog.show(networkUISourceCode.na me(),WebInspector.projectTypes.FileSystem,mapNetworkToFileSystem.bind(this),this .editorView.mainElement())
1353 function mapNetworkToFileSystem(uiSourceCode) 1415 function mapNetworkToFileSystem(uiSourceCode)
1354 {this._workspace.addMapping(networkUISourceCode,uiSourceCode,WebInspector.fileSy stemWorkspaceProvider);}},_appendUISourceCodeMappingItems:function(contextMenu,u iSourceCode) 1416 {this._workspace.addMapping(networkUISourceCode,uiSourceCode,WebInspector.fileSy stemWorkspaceProvider);}},_appendUISourceCodeMappingItems:function(contextMenu,u iSourceCode)
1355 {if(uiSourceCode.project().type()===WebInspector.projectTypes.FileSystem){var ha sMappings=!!uiSourceCode.url;if(!hasMappings) 1417 {if(uiSourceCode.project().type()===WebInspector.projectTypes.FileSystem){var ha sMappings=!!uiSourceCode.url;if(!hasMappings)
1356 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Map to network resource\u2026":"Map to Network Resource\u2026"),this._mapFil eSystemToNetwork.bind(this,uiSourceCode));else 1418 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Map to network resource\u2026":"Map to Network Resource\u2026"),this._mapFil eSystemToNetwork.bind(this,uiSourceCode));else
1357 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Remove network mapping":"Remove Network Mapping"),this._removeNetworkMapping .bind(this,uiSourceCode));} 1419 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Remove network mapping":"Remove Network Mapping"),this._removeNetworkMapping .bind(this,uiSourceCode));}
1358 function filterProject(project) 1420 function filterProject(project)
1359 {return project.type()===WebInspector.projectTypes.FileSystem;} 1421 {return project.type()===WebInspector.projectTypes.FileSystem;}
1360 if(uiSourceCode.project().type()===WebInspector.projectTypes.Network){if(!this._ workspace.projects().filter(filterProject).length) 1422 if(uiSourceCode.project().type()===WebInspector.projectTypes.Network){if(!this._ workspace.projects().filter(filterProject).length)
1361 return;if(this._workspace.uiSourceCodeForURL(uiSourceCode.url)===uiSourceCode) 1423 return;if(this._workspace.uiSourceCodeForURL(uiSourceCode.url)===uiSourceCode)
1362 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Map to file system resource\u2026":"Map to File System Resource\u2026"),this ._mapNetworkToFileSystem.bind(this,uiSourceCode));}},_appendUISourceCodeItems:fu nction(contextMenu,target) 1424 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Map to file system resource\u2026":"Map to File System Resource\u2026"),this ._mapNetworkToFileSystem.bind(this,uiSourceCode));}},_appendUISourceCodeItems:fu nction(event,contextMenu,target)
1363 {if(!(target instanceof WebInspector.UISourceCode)) 1425 {if(!(target instanceof WebInspector.UISourceCode))
1364 return;var uiSourceCode=(target);contextMenu.appendItem(WebInspector.UIString(We bInspector.useLowerCaseMenuTitles()?"Local modifications\u2026":"Local Modificat ions\u2026"),this._showLocalHistory.bind(this,uiSourceCode));if(WebInspector.iso latedFileSystemManager.supportsFileSystems()) 1426 return;var uiSourceCode=(target);contextMenu.appendItem(WebInspector.UIString(We bInspector.useLowerCaseMenuTitles()?"Local modifications\u2026":"Local Modificat ions\u2026"),this._showLocalHistory.bind(this,uiSourceCode));this._appendUISourc eCodeMappingItems(contextMenu,uiSourceCode);if(!event.target.isSelfOrDescendant( this.editorView.sidebarElement())){contextMenu.appendSeparator();contextMenu.app endItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Reveal in n avigator":"Reveal in Navigator"),this._handleContextMenuReveal.bind(this,uiSourc eCode));}},_handleContextMenuReveal:function(uiSourceCode)
1365 this._appendUISourceCodeMappingItems(contextMenu,uiSourceCode);},_appendFunction Items:function(contextMenu,target) 1427 {this.editorView.showBoth();this._revealInNavigator(uiSourceCode);},_appendRemot eObjectItems:function(contextMenu,target)
1366 {if(!(target instanceof WebInspector.RemoteObject)) 1428 {if(!(target instanceof WebInspector.RemoteObject))
1367 return;var remoteObject=(target);if(remoteObject.type!=="function") 1429 return;var remoteObject=(target);contextMenu.appendItem(WebInspector.UIString(We bInspector.useLowerCaseMenuTitles()?"Store as global variable":"Store as Global Variable"),this._saveToTempVariable.bind(this,remoteObject));if(remoteObject.typ e==="function")
1368 return;function didGetDetails(error,response) 1430 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Show function definition":"Show Function Definition"),this._showFunctionDefi nition.bind(this,remoteObject));},_saveToTempVariable:function(remoteObject)
1431 {WebInspector.runtimeModel.evaluate("window","",false,true,false,false,didGetGlo balObject);function didGetGlobalObject(global,wasThrown)
1432 {function remoteFunction(value)
1433 {var prefix="temp";var index=1;while((prefix+index)in this)
1434 ++index;var name=prefix+index;this[name]=value;return name;}
1435 if(wasThrown||!global)
1436 failedToSave(global);else
1437 global.callFunction(remoteFunction,[WebInspector.RemoteObject.toCallArgument(rem oteObject)],didSave.bind(null,global));}
1438 function didSave(global,result,wasThrown)
1439 {global.release();if(wasThrown||!result||result.type!=="string")
1440 failedToSave(result);else
1441 WebInspector.console.evaluate(result.value);}
1442 function failedToSave(result)
1443 {var message=WebInspector.UIString("Failed to save to temp variable.");if(result ){message+=" "+result.description;result.release();}
1444 WebInspector.console.showErrorMessage(message)}},_showFunctionDefinition:functio n(remoteObject)
1445 {function didGetFunctionDetails(error,response)
1369 {if(error){console.error(error);return;} 1446 {if(error){console.error(error);return;}
1370 var uiLocation=WebInspector.debuggerModel.rawLocationToUILocation(response.locat ion);if(!uiLocation) 1447 var uiLocation=WebInspector.debuggerModel.rawLocationToUILocation(response.locat ion);if(!uiLocation)
1371 return;this.showUILocation(uiLocation,true);} 1448 return;this.showUILocation(uiLocation,true);}
1372 function revealFunction() 1449 DebuggerAgent.getFunctionDetails(remoteObject.objectId,didGetFunctionDetails.bin d(this));},showGoToSourceDialog:function()
1373 {DebuggerAgent.getFunctionDetails(remoteObject.objectId,didGetDetails.bind(this) );} 1450 {this._sourcesView.showOpenResourceDialog();},_dockSideChanged:function()
1374 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles ()?"Show function definition":"Show Function Definition"),revealFunction.bind(th is));},showGoToSourceDialog:function() 1451 {var vertically=WebInspector.dockController.isVertical()&&WebInspector.settings. splitVerticallyWhenDockedToRight.get();this._splitVertically(vertically);},_spli tVertically:function(vertically)
1375 {var uiSourceCodes=this._editorContainer.historyUISourceCodes();var defaultScore s=new Map();for(var i=1;i<uiSourceCodes.length;++i) 1452 {if(this.sidebarPaneView&&vertically===!this._splitView.isVertical())
1376 defaultScores.put(uiSourceCodes[i],uiSourceCodes.length-i);WebInspector.OpenReso urceDialog.show(this,this.editorView.mainElement(),undefined,defaultScores);},_d ockSideChanged:function()
1377 {var dockSide=WebInspector.dockController.dockSide();var vertically=dockSide===W ebInspector.DockController.State.DockedToRight&&WebInspector.settings.splitVerti callyWhenDockedToRight.get();this._splitVertically(vertically);},_splitVerticall y:function(vertically)
1378 {if(this.sidebarPaneView&&vertically===!this.splitView.isVertical())
1379 return;if(this.sidebarPaneView) 1453 return;if(this.sidebarPaneView)
1380 this.sidebarPaneView.detach();this.splitView.setVertical(!vertically);if(!vertic ally){this.splitView.uninstallResizer(this._statusBarContainerElement);this.side barPaneView=new WebInspector.SidebarPaneStack();for(var pane in this.sidebarPane s) 1454 this.sidebarPaneView.detach();this._splitView.setVertical(!vertically);if(!verti cally)
1381 this.sidebarPaneView.addPane(this.sidebarPanes[pane]);this._extensionSidebarPane sContainer=this.sidebarPaneView;this.splitView.sidebarElement().appendChild(this .debugToolbar);this.editorView.element.appendChild(this._toggleDebuggerSidebarBu tton.element);this.splitView.mainElement().appendChild(this._debugSidebarResizeW idgetElement);}else{this.splitView.installResizer(this._statusBarContainerElemen t);this.sidebarPaneView=new WebInspector.SplitView(true,this.name+"PanelSplitSid ebarRatio",0.5);var group1=new WebInspector.SidebarPaneStack();this.sidebarPaneV iew.setFirstView(group1);group1.element.id="scripts-sidebar-stack-pane";group1.a ddPane(this.sidebarPanes.callstack);group1.addPane(this.sidebarPanes.jsBreakpoin ts);group1.addPane(this.sidebarPanes.domBreakpoints);group1.addPane(this.sidebar Panes.xhrBreakpoints);group1.addPane(this.sidebarPanes.eventListenerBreakpoints) ;if(this.sidebarPanes.workerList) 1455 this._splitView.uninstallResizer(this._sourcesView.statusBarContainerElement()); else
1382 group1.addPane(this.sidebarPanes.workerList);var group2=new WebInspector.Sidebar TabbedPane();this.sidebarPaneView.setSecondView(group2);group2.addPane(this.side barPanes.scopechain);group2.addPane(this.sidebarPanes.watchExpressions);this._ex tensionSidebarPanesContainer=group2;this.sidebarPaneView.firstElement().appendCh ild(this.debugToolbar);this._statusBarContainerElement.appendChild(this._debugSi debarResizeWidgetElement);this._statusBarContainerElement.appendChild(this._togg leDebuggerSidebarButton.element)} 1456 this._splitView.installResizer(this._sourcesView.statusBarContainerElement());va r vbox=new WebInspector.VBox();vbox.element.appendChild(this._debugToolbarDrawer );vbox.element.appendChild(this.debugToolbar);vbox.element.appendChild(this.thre adsToolbar.element);vbox.setMinimumSize(WebInspector.SourcesPanel.minToolbarWidt h,25);var sidebarPaneStack=new WebInspector.SidebarPaneStack();sidebarPaneStack. element.classList.add("flex-auto");sidebarPaneStack.show(vbox.element);if(!verti cally){for(var pane in this.sidebarPanes)
1457 sidebarPaneStack.addPane(this.sidebarPanes[pane]);this._extensionSidebarPanesCon tainer=sidebarPaneStack;this.sidebarPaneView=vbox;}else{var splitView=new WebIns pector.SplitView(true,true,"sourcesPanelDebuggerSidebarSplitViewState",0.5);vbox .show(splitView.mainElement());sidebarPaneStack.addPane(this.sidebarPanes.callst ack);sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints);sidebarPaneStack. addPane(this.sidebarPanes.domBreakpoints);sidebarPaneStack.addPane(this.sidebarP anes.xhrBreakpoints);sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBre akpoints);if(this.sidebarPanes.workerList)
1458 sidebarPaneStack.addPane(this.sidebarPanes.workerList);var tabbedPane=new WebIns pector.SidebarTabbedPane();tabbedPane.show(splitView.sidebarElement());tabbedPan e.addPane(this.sidebarPanes.scopechain);tabbedPane.addPane(this.sidebarPanes.wat chExpressions);this._extensionSidebarPanesContainer=tabbedPane;this.sidebarPaneV iew=splitView;}
1383 for(var i=0;i<this._extensionSidebarPanes.length;++i) 1459 for(var i=0;i<this._extensionSidebarPanes.length;++i)
1384 this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]);thi s.sidebarPaneView.element.id="scripts-debug-sidebar-contents";this.splitView.set SidebarView(this.sidebarPaneView);this.sidebarPanes.scopechain.expand();this.sid ebarPanes.jsBreakpoints.expand();this.sidebarPanes.callstack.expand();if(WebInsp ector.settings.watchExpressions.get().length>0) 1460 this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]);thi s.sidebarPaneView.show(this._splitView.sidebarElement());this.sidebarPanes.scope chain.expand();this.sidebarPanes.jsBreakpoints.expand();this.sidebarPanes.callst ack.expand();if(WebInspector.settings.watchExpressions.get().length>0)
1385 this.sidebarPanes.watchExpressions.expand();},canHighlightPosition:function() 1461 this.sidebarPanes.watchExpressions.expand();},addExtensionSidebarPane:function(i d,pane)
1386 {return this.visibleView&&this.visibleView.canHighlightPosition();},highlightPos ition:function(line,column) 1462 {this._extensionSidebarPanes.push(pane);this._extensionSidebarPanesContainer.add Pane(pane);this.setHideOnDetach();},sourcesView:function()
1387 {if(!this.canHighlightPosition()) 1463 {return this._sourcesView;},__proto__:WebInspector.Panel.prototype}
1388 return;this._historyManager.updateCurrentState();this.visibleView.highlightPosit ion(line,column);this._historyManager.pushNewState();},addExtensionSidebarPane:f unction(id,pane) 1464 WebInspector.UpgradeFileSystemDropTarget=function(element)
1389 {this._extensionSidebarPanes.push(pane);this._extensionSidebarPanesContainer.add Pane(pane);this.setHideOnDetach();},get tabbedEditorContainer() 1465 {element.addEventListener("dragenter",this._onDragEnter.bind(this),true);element .addEventListener("dragover",this._onDragOver.bind(this),true);this._element=ele ment;}
1390 {return this._editorContainer;},__proto__:WebInspector.Panel.prototype} 1466 WebInspector.UpgradeFileSystemDropTarget.dragAndDropFilesType="Files";WebInspect or.UpgradeFileSystemDropTarget.prototype={_onDragEnter:function(event)
1391 WebInspector.SourcesView=function() 1467 {if(event.dataTransfer.types.indexOf(WebInspector.UpgradeFileSystemDropTarget.dr agAndDropFilesType)===-1)
1392 {WebInspector.View.call(this);this.registerRequiredCSS("sourcesView.css");this.e lement.id="sources-panel-sources-view";this.element.classList.add("vbox");this.e lement.addEventListener("dragenter",this._onDragEnter.bind(this),true);this.elem ent.addEventListener("dragover",this._onDragOver.bind(this),true);}
1393 WebInspector.SourcesView.dragAndDropFilesType="Files";WebInspector.SourcesView.p rototype={_onDragEnter:function(event)
1394 {if(event.dataTransfer.types.indexOf(WebInspector.SourcesView.dragAndDropFilesTy pe)===-1)
1395 return;event.consume(true);},_onDragOver:function(event) 1468 return;event.consume(true);},_onDragOver:function(event)
1396 {if(event.dataTransfer.types.indexOf(WebInspector.SourcesView.dragAndDropFilesTy pe)===-1) 1469 {if(event.dataTransfer.types.indexOf(WebInspector.UpgradeFileSystemDropTarget.dr agAndDropFilesType)===-1)
1397 return;event.consume(true);if(this._dragMaskElement) 1470 return;event.dataTransfer.dropEffect="copy";event.consume(true);if(this._dragMas kElement)
1398 return;this._dragMaskElement=this.element.createChild("div","fill drag-mask");th is._dragMaskElement.addEventListener("drop",this._onDrop.bind(this),true);this._ dragMaskElement.addEventListener("dragleave",this._onDragLeave.bind(this),true); },_onDrop:function(event) 1471 return;this._dragMaskElement=this._element.createChild("div","fill drag-mask");t his._dragMaskElement.createChild("div","fill drag-mask-inner").textContent=WebIn spector.UIString("Drop workspace folder here");this._dragMaskElement.addEventLis tener("drop",this._onDrop.bind(this),true);this._dragMaskElement.addEventListene r("dragleave",this._onDragLeave.bind(this),true);},_onDrop:function(event)
1399 {event.consume(true);this._removeMask();var items=(event.dataTransfer.items);if( !items.length) 1472 {event.consume(true);this._removeMask();var items=(event.dataTransfer.items);if( !items.length)
1400 return;var entry=items[0].webkitGetAsEntry();if(!entry.isDirectory) 1473 return;var entry=items[0].webkitGetAsEntry();if(!entry.isDirectory)
1401 return;InspectorFrontendHost.upgradeDraggedFileSystemPermissions(entry.filesyste m);},_onDragLeave:function(event) 1474 return;InspectorFrontendHost.upgradeDraggedFileSystemPermissions(entry.filesyste m);},_onDragLeave:function(event)
1402 {event.consume(true);this._removeMask();},_removeMask:function() 1475 {event.consume(true);this._removeMask();},_removeMask:function()
1403 {this._dragMaskElement.remove();delete this._dragMaskElement;},__proto__:WebInsp ector.View.prototype} 1476 {this._dragMaskElement.remove();delete this._dragMaskElement;}}
1404 WebInspector.DrawerEditorView=function() 1477 WebInspector.SourcesPanel.DrawerEditor=function()
1405 {WebInspector.View.call(this);this.element.id="drawer-editor-view";this.element. classList.add("vbox");} 1478 {this._panel=WebInspector.inspectorView.panel("sources");}
1406 WebInspector.DrawerEditorView.prototype={__proto__:WebInspector.View.prototype} 1479 WebInspector.SourcesPanel.DrawerEditor.prototype={view:function()
1480 {return this._panel._drawerEditorView;},installedIntoDrawer:function()
1481 {if(this._panel.isShowing())
1482 this._panelWasShown();else
1483 this._panelWillHide();},_panelWasShown:function()
1484 {WebInspector.inspectorView.setDrawerEditorAvailable(false);WebInspector.inspect orView.hideDrawerEditor();},_panelWillHide:function()
1485 {WebInspector.inspectorView.setDrawerEditorAvailable(true);if(WebInspector.inspe ctorView.isDrawerEditorShown())
1486 WebInspector.inspectorView.showDrawerEditor();},_show:function()
1487 {WebInspector.inspectorView.showDrawerEditor();},}
1488 WebInspector.SourcesPanel.DrawerEditorView=function()
1489 {WebInspector.VBox.call(this);this.element.id="drawer-editor-view";}
1490 WebInspector.SourcesPanel.DrawerEditorView.prototype={__proto__:WebInspector.VBo x.prototype}
1407 WebInspector.SourcesPanel.ContextMenuProvider=function() 1491 WebInspector.SourcesPanel.ContextMenuProvider=function()
1408 {} 1492 {}
1409 WebInspector.SourcesPanel.ContextMenuProvider.prototype={appendApplicableItems:f unction(event,contextMenu,target) 1493 WebInspector.SourcesPanel.ContextMenuProvider.prototype={appendApplicableItems:f unction(event,contextMenu,target)
1410 {WebInspector.panel("sources").appendApplicableItems(event,contextMenu,target);} } 1494 {WebInspector.inspectorView.panel("sources").appendApplicableItems(event,context Menu,target);}}
1495 WebInspector.SourcesPanel.UILocationRevealer=function()
1496 {}
1497 WebInspector.SourcesPanel.UILocationRevealer.prototype={reveal:function(uiLocati on)
1498 {if(uiLocation instanceof WebInspector.UILocation)
1499 (WebInspector.inspectorView.panel("sources")).showUILocation(uiLocation);}}
1500 WebInspector.SourcesPanel.ShowGoToSourceDialogActionDelegate=function(){}
1501 WebInspector.SourcesPanel.ShowGoToSourceDialogActionDelegate.prototype={handleAc tion:function()
1502 {(WebInspector.inspectorView.showPanel("sources")).showGoToSourceDialog();return true;}}
OLDNEW
« no previous file with comments | « chrome_linux64/resources/inspector/ScriptFormatterWorker.js ('k') | chrome_linux64/resources/inspector/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698