| Index: chrome_linux/resources/inspector/ScriptsPanel.js
|
| ===================================================================
|
| --- chrome_linux/resources/inspector/ScriptsPanel.js (revision 229864)
|
| +++ chrome_linux/resources/inspector/ScriptsPanel.js (working copy)
|
| @@ -72,7 +72,7 @@
|
| {var breakpoints=WebInspector.settings.xhrBreakpoints.get();for(var i=0;i<breakpoints.length;++i){var breakpoint=breakpoints[i];if(breakpoint&&typeof breakpoint.url==="string")
|
| this._setBreakpoint(breakpoint.url,breakpoint.enabled);}},__proto__:WebInspector.NativeBreakpointsSidebarPane.prototype}
|
| WebInspector.EventListenerBreakpointsSidebarPane=function()
|
| -{WebInspector.SidebarPane.call(this,WebInspector.UIString("Event Listener Breakpoints"));this.registerRequiredCSS("breakpointsList.css");this.categoriesElement=document.createElement("ol");this.categoriesElement.tabIndex=0;this.categoriesElement.addStyleClass("properties-tree");this.categoriesElement.addStyleClass("event-listener-breakpoints");this.categoriesTreeOutline=new TreeOutline(this.categoriesElement);this.bodyElement.appendChild(this.categoriesElement);this._breakpointItems={};this._createCategory(WebInspector.UIString("Animation"),false,["requestAnimationFrame","cancelAnimationFrame","animationFrameFired"]);this._createCategory(WebInspector.UIString("Control"),true,["resize","scroll","zoom","focus","blur","select","change","submit","reset"]);this._createCategory(WebInspector.UIString("Clipboard"),true,["copy","cut","paste","beforecopy","beforecut","beforepaste"]);this._createCategory(WebInspector.UIString("DOM Mutation"),true,["DOMActivate","DOMFocusIn","DOMFocusOut","DOMAttrModified","DOMCharacterDataModified","DOMNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMSubtreeModified","DOMContentLoaded"]);this._createCategory(WebInspector.UIString("Device"),true,["deviceorientation","devicemotion"]);this._createCategory(WebInspector.UIString("Keyboard"),true,["keydown","keyup","keypress","input"]);this._createCategory(WebInspector.UIString("Load"),true,["load","unload","abort","error","hashchange"]);this._createCategory(WebInspector.UIString("Mouse"),true,["click","dblclick","mousedown","mouseup","mouseover","mousemove","mouseout","mousewheel"]);this._createCategory(WebInspector.UIString("Timer"),false,["setTimer","clearTimer","timerFired"]);this._createCategory(WebInspector.UIString("Touch"),true,["touchstart","touchmove","touchend","touchcancel"]);this._createCategory(WebInspector.UIString("WebGL"),false,["webglErrorFired","webglWarningFired"]);this._restoreBreakpoints();}
|
| +{WebInspector.SidebarPane.call(this,WebInspector.UIString("Event Listener Breakpoints"));this.registerRequiredCSS("breakpointsList.css");this.categoriesElement=document.createElement("ol");this.categoriesElement.tabIndex=0;this.categoriesElement.addStyleClass("properties-tree");this.categoriesElement.addStyleClass("event-listener-breakpoints");this.categoriesTreeOutline=new TreeOutline(this.categoriesElement);this.bodyElement.appendChild(this.categoriesElement);this._breakpointItems={};this._createCategory(WebInspector.UIString("Animation"),false,["requestAnimationFrame","cancelAnimationFrame","animationFrameFired"]);this._createCategory(WebInspector.UIString("Control"),true,["resize","scroll","zoom","focus","blur","select","change","submit","reset"]);this._createCategory(WebInspector.UIString("Clipboard"),true,["copy","cut","paste","beforecopy","beforecut","beforepaste"]);this._createCategory(WebInspector.UIString("DOM Mutation"),true,["DOMActivate","DOMFocusIn","DOMFocusOut","DOMAttrModified","DOMCharacterDataModified","DOMNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMSubtreeModified","DOMContentLoaded"]);this._createCategory(WebInspector.UIString("Device"),true,["deviceorientation","devicemotion"]);this._createCategory(WebInspector.UIString("Keyboard"),true,["keydown","keyup","keypress","input"]);this._createCategory(WebInspector.UIString("Load"),true,["load","unload","abort","error"]);this._createCategory(WebInspector.UIString("Mouse"),true,["click","dblclick","mousedown","mouseup","mouseover","mousemove","mouseout","mousewheel"]);this._createCategory(WebInspector.UIString("Timer"),false,["setTimer","clearTimer","timerFired"]);this._createCategory(WebInspector.UIString("Touch"),true,["touchstart","touchmove","touchend","touchcancel"]);this._createCategory(WebInspector.UIString("WebGL"),false,["webglErrorFired","webglWarningFired"]);this._restoreBreakpoints();}
|
| WebInspector.EventListenerBreakpointsSidebarPane.categotyListener="listener:";WebInspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation="instrumentation:";WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI=function(eventName,auxData)
|
| {if(!WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI){WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI={"instrumentation:setTimer":WebInspector.UIString("Set Timer"),"instrumentation:clearTimer":WebInspector.UIString("Clear Timer"),"instrumentation:timerFired":WebInspector.UIString("Timer Fired"),"instrumentation:requestAnimationFrame":WebInspector.UIString("Request Animation Frame"),"instrumentation:cancelAnimationFrame":WebInspector.UIString("Cancel Animation Frame"),"instrumentation:animationFrameFired":WebInspector.UIString("Animation Frame Fired"),"instrumentation:webglErrorFired":WebInspector.UIString("WebGL Error Fired"),"instrumentation:webglWarningFired":WebInspector.UIString("WebGL Warning Fired")};}
|
| if(auxData){if(eventName==="instrumentation:webglErrorFired"&&auxData["webglErrorName"]){var errorName=auxData["webglErrorName"];errorName=errorName.replace(/^.*(0x[0-9a-f]+).*$/i,"$1");return WebInspector.UIString("WebGL Error Fired (%s)",errorName);}}
|
| @@ -109,7 +109,6 @@
|
| {var breakpoints=WebInspector.settings.eventListenerBreakpoints.get();for(var i=0;i<breakpoints.length;++i){var breakpoint=breakpoints[i];if(breakpoint&&typeof breakpoint.eventName==="string")
|
| this._setBreakpoint(breakpoint.eventName);}},__proto__:WebInspector.SidebarPane.prototype};WebInspector.CallStackSidebarPane=function()
|
| {WebInspector.SidebarPane.call(this,WebInspector.UIString("Call Stack"));this._model=WebInspector.debuggerModel;this.bodyElement.addEventListener("keydown",this._keyDown.bind(this),true);this.bodyElement.tabIndex=0;}
|
| -WebInspector.CallStackSidebarPane.Events={CallFrameSelected:"CallFrameSelected"}
|
| WebInspector.CallStackSidebarPane.prototype={update:function(callFrames)
|
| {this.bodyElement.removeChildren();delete this._statusMessageElement;this.placards=[];if(!callFrames){var infoElement=document.createElement("div");infoElement.className="info";infoElement.textContent=WebInspector.UIString("Not Paused");this.bodyElement.appendChild(infoElement);return;}
|
| for(var i=0;i<callFrames.length;++i){var callFrame=callFrames[i];var placard=new WebInspector.CallStackSidebarPane.Placard(callFrame,this);placard.element.addEventListener("click",this._placardSelected.bind(this,placard),false);this.placards.push(placard);this.bodyElement.appendChild(placard.element);}},setSelectedCallFrame:function(x)
|
| @@ -124,7 +123,7 @@
|
| return-1;for(var i=0;i<this.placards.length;++i){var placard=this.placards[i];if(placard._callFrame===this._model.selectedCallFrame())
|
| return i;}
|
| return-1;},_placardSelected:function(placard)
|
| -{this.dispatchEventToListeners(WebInspector.CallStackSidebarPane.Events.CallFrameSelected,placard._callFrame);},_copyStackTrace:function()
|
| +{this._model.setSelectedCallFrame(placard._callFrame);},_copyStackTrace:function()
|
| {var text="";for(var i=0;i<this.placards.length;++i)
|
| text+=this.placards[i].title+" ("+this.placards[i].subtitle+")\n";InspectorFrontendHost.copyText(text);},registerShortcuts:function(registerShortcutDelegate)
|
| {registerShortcutDelegate(WebInspector.ScriptsPanelDescriptor.ShortcutKeys.NextCallFrame,this._selectNextCallFrameOnStack.bind(this));registerShortcutDelegate(WebInspector.ScriptsPanelDescriptor.ShortcutKeys.PrevCallFrame,this._selectPreviousCallFrameOnStack.bind(this));},setStatus:function(status)
|
| @@ -169,9 +168,9 @@
|
| return 0;if(!consecutiveMatch)
|
| return this._singleCharScore(query,data,i,j);else
|
| return this._sequenceCharScore(query,data,i,j-consecutiveMatch,consecutiveMatch);},};WebInspector.FilteredItemSelectionDialog=function(delegate)
|
| -{WebInspector.DialogDelegate.call(this);var xhr=new XMLHttpRequest();xhr.open("GET","filteredItemSelectionDialog.css",false);xhr.send(null);this.element=document.createElement("div");this.element.className="filtered-item-list-dialog";this.element.addEventListener("keydown",this._onKeyDown.bind(this),false);var styleElement=this.element.createChild("style");styleElement.type="text/css";styleElement.textContent=xhr.responseText;this._promptElement=this.element.createChild("input","monospace");this._promptElement.addEventListener("input",this._onInput.bind(this),false);this._promptElement.type="text";this._promptElement.setAttribute("spellcheck","false");this._filteredItems=[];this._viewportControl=new WebInspector.ViewportControl(this);this._itemElementsContainer=this._viewportControl.element;this._itemElementsContainer.addStyleClass("container");this._itemElementsContainer.addStyleClass("monospace");this._itemElementsContainer.addEventListener("click",this._onClick.bind(this),false);this.element.appendChild(this._itemElementsContainer);this._delegate=delegate;this._delegate.setRefreshCallback(this._itemsLoaded.bind(this));this._itemsLoaded();this._shouldShowMatchingItems=true;}
|
| +{WebInspector.DialogDelegate.call(this);var xhr=new XMLHttpRequest();xhr.open("GET","filteredItemSelectionDialog.css",false);xhr.send(null);this.element=document.createElement("div");this.element.className="filtered-item-list-dialog";this.element.addEventListener("keydown",this._onKeyDown.bind(this),false);var styleElement=this.element.createChild("style");styleElement.type="text/css";styleElement.textContent=xhr.responseText;this._promptElement=this.element.createChild("input","monospace");this._promptElement.addEventListener("input",this._onInput.bind(this),false);this._promptElement.type="text";this._promptElement.setAttribute("spellcheck","false");this._filteredItems=[];this._viewportControl=new WebInspector.ViewportControl(this);this._itemElementsContainer=this._viewportControl.element;this._itemElementsContainer.addStyleClass("container");this._itemElementsContainer.addStyleClass("monospace");this._itemElementsContainer.addEventListener("click",this._onClick.bind(this),false);this.element.appendChild(this._itemElementsContainer);this._delegate=delegate;this._delegate.setRefreshCallback(this._itemsLoaded.bind(this));this._itemsLoaded();}
|
| WebInspector.FilteredItemSelectionDialog.prototype={position:function(element,relativeToElement)
|
| -{const minWidth=500;const minHeight=204;var width=Math.max(relativeToElement.offsetWidth*2/3,minWidth);var height=Math.max(relativeToElement.offsetHeight*2/3,minHeight);this.element.style.width=width+"px";const shadowPadding=20;element.positionAt(relativeToElement.totalOffsetLeft()+Math.max((relativeToElement.offsetWidth-width-2*shadowPadding)/2,shadowPadding),relativeToElement.totalOffsetTop()+Math.max((relativeToElement.offsetHeight-height-2*shadowPadding)/2,shadowPadding));this._dialogHeight=height;this._updateShowMatchingItems();},focus:function()
|
| +{const minWidth=500;const minHeight=204;var width=Math.max(relativeToElement.offsetWidth*2/3,minWidth);var height=Math.max(relativeToElement.offsetHeight*2/3,minHeight);this.element.style.width=width+"px";this.element.style.height=height+"px";const shadowPadding=20;element.positionAt(relativeToElement.totalOffsetLeft()+Math.max((relativeToElement.offsetWidth-width-2*shadowPadding)/2,shadowPadding),relativeToElement.totalOffsetTop()+Math.max((relativeToElement.offsetHeight-height-2*shadowPadding)/2,shadowPadding));},focus:function()
|
| {WebInspector.setCurrentFocusElement(this._promptElement);if(this._filteredItems.length&&this._viewportControl.lastVisibleIndex()===-1)
|
| this._viewportControl.refresh();},willHide:function()
|
| {if(this._isHiding)
|
| @@ -198,8 +197,7 @@
|
| delete this._scoringTimer;this._filteredItems=bestItems.concat(overflowItems).concat(filteredItems);for(var i=0;i<this._filteredItems.length;++i){if(this._filteredItems[i]===oldSelectedAbsoluteIndex){this._selectedIndexInFiltered=i;break;}}
|
| this._viewportControl.refresh();if(!query)
|
| this._selectedIndexInFiltered=0;this._updateSelection(this._selectedIndexInFiltered,false);}},_onInput:function(event)
|
| -{this._shouldShowMatchingItems=this._delegate.shouldShowMatchingItems(this._promptElement.value);this._updateShowMatchingItems();this._scheduleFilter();},_updateShowMatchingItems:function()
|
| -{this._itemElementsContainer.enableStyleClass("hidden",!this._shouldShowMatchingItems);this.element.style.height=this._shouldShowMatchingItems?this._dialogHeight+"px":"auto";},_onKeyDown:function(event)
|
| +{this._scheduleFilter();},_onKeyDown:function(event)
|
| {var newSelectedIndex=this._selectedIndexInFiltered;switch(event.keyCode){case WebInspector.KeyboardShortcut.Keys.Down.code:if(++newSelectedIndex>=this._filteredItems.length)
|
| newSelectedIndex=this._filteredItems.length-1;this._updateSelection(newSelectedIndex,true);event.consume(true);break;case WebInspector.KeyboardShortcut.Keys.Up.code:if(--newSelectedIndex<0)
|
| newSelectedIndex=0;this._updateSelection(newSelectedIndex,false);event.consume(true);break;case WebInspector.KeyboardShortcut.Keys.PageDown.code:newSelectedIndex=Math.min(newSelectedIndex+this._viewportControl.rowsPerViewport(),this._filteredItems.length-1);this._updateSelection(newSelectedIndex,true);event.consume(true);break;case WebInspector.KeyboardShortcut.Keys.PageUp.code:newSelectedIndex=Math.max(newSelectedIndex-this._viewportControl.rowsPerViewport(),0);this._updateSelection(newSelectedIndex,false);event.consume(true);break;default:}},_scheduleFilter:function()
|
| @@ -216,8 +214,7 @@
|
| WebInspector.SelectionDialogContentProvider=function()
|
| {}
|
| WebInspector.SelectionDialogContentProvider.prototype={setRefreshCallback:function(refreshCallback)
|
| -{this._refreshCallback=refreshCallback;},shouldShowMatchingItems:function(query)
|
| -{return true;},itemCount:function()
|
| +{this._refreshCallback=refreshCallback;},itemCount:function()
|
| {return 0;},itemKeyAt:function(itemIndex)
|
| {return"";},itemScoreAt:function(itemIndex,query)
|
| {return 1;},renderItem:function(itemIndex,query,titleElement,subtitleElement)
|
| @@ -266,9 +263,7 @@
|
| {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(query).score(subtitleElement.textContent,indexes);var fileNameIndex=subtitleElement.textContent.lastIndexOf("/");var ranges=[];for(var i=0;i<indexes.length;++i)
|
| ranges.push({offset:indexes[i],length:1});if(indexes[0]>fileNameIndex){for(var i=0;i<ranges.length;++i)
|
| ranges[i].offset-=fileNameIndex+1;return WebInspector.highlightRangesWithStyleClass(titleElement,ranges,"highlight");}else{return WebInspector.highlightRangesWithStyleClass(subtitleElement,ranges,"highlight");}},selectItem:function(itemIndex,promptValue)
|
| -{if(/^:\d+$/.test(promptValue.trimRight())){var lineNumber=parseInt(promptValue.trimRight().substring(1),10)-1;if(!isNaN(lineNumber)&&lineNumber>=0)
|
| -this.uiSourceCodeSelected(null,lineNumber);return;}
|
| -var lineNumberMatch=promptValue.match(/[^:]+\:([\d]*)$/);var lineNumber=lineNumberMatch?Math.max(parseInt(lineNumberMatch[1],10)-1,0):undefined;this.uiSourceCodeSelected(this._uiSourceCodes[itemIndex],lineNumber);},rewriteQuery:function(query)
|
| +{var lineNumberMatch=promptValue.match(/[^:]+\:([\d]*)$/);var lineNumber=lineNumberMatch?Math.max(parseInt(lineNumberMatch[1],10)-1,0):undefined;this.uiSourceCodeSelected(this._uiSourceCodes[itemIndex],lineNumber);},rewriteQuery:function(query)
|
| {if(!query)
|
| return query;query=query.trim();var lineNumberMatch=query.match(/([^:]+)(\:[\d]*)$/);this._queryLineNumber=lineNumberMatch?lineNumberMatch[2]:"";return lineNumberMatch?lineNumberMatch[1]:query;},_uiSourceCodeAdded:function(event)
|
| {var uiSourceCode=(event.data);if(!this.filterProject(uiSourceCode.project()))
|
| @@ -278,10 +273,7 @@
|
| WebInspector.OpenResourceDialog=function(panel,defaultScores)
|
| {WebInspector.SelectUISourceCodeDialog.call(this,defaultScores);this._panel=panel;}
|
| WebInspector.OpenResourceDialog.prototype={uiSourceCodeSelected:function(uiSourceCode,lineNumber)
|
| -{if(!uiSourceCode)
|
| -uiSourceCode=this._panel.currentUISourceCode();if(!uiSourceCode)
|
| -return;this._panel.showUISourceCode(uiSourceCode,lineNumber);},shouldShowMatchingItems:function(query)
|
| -{return!query.startsWith(":");},filterProject:function(project)
|
| +{this._panel.showUISourceCode(uiSourceCode,lineNumber);},filterProject:function(project)
|
| {return!project.isServiceProject();},__proto__:WebInspector.SelectUISourceCodeDialog.prototype}
|
| WebInspector.OpenResourceDialog.show=function(panel,relativeToElement,name,defaultScores)
|
| {if(WebInspector.Dialog.currentInstance())
|
| @@ -295,7 +287,7 @@
|
| WebInspector.SelectUISourceCodeForProjectTypeDialog.show=function(name,type,callback,relativeToElement)
|
| {if(WebInspector.Dialog.currentInstance())
|
| return;var filteredItemSelectionDialog=new WebInspector.FilteredItemSelectionDialog(new WebInspector.SelectUISourceCodeForProjectTypeDialog(type,callback));filteredItemSelectionDialog.setQuery(name);filteredItemSelectionDialog.renderAsTwoRows();WebInspector.Dialog.show(relativeToElement,filteredItemSelectionDialog);};WebInspector.UISourceCodeFrame=function(uiSourceCode)
|
| -{this._uiSourceCode=uiSourceCode;WebInspector.SourceFrame.call(this,this._uiSourceCode);this.textEditor.setCompletionDictionary(new WebInspector.SampleCompletionDictionary());this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.FormattedChanged,this._onFormattedChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._onWorkingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._onWorkingCopyCommitted,this);this._updateStyle();}
|
| +{this._uiSourceCode=uiSourceCode;WebInspector.SourceFrame.call(this,this._uiSourceCode);this.textEditor.setCompletionDictionary(new WebInspector.SampleCompletionDictionary());this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.FormattedChanged,this._onFormattedChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._onWorkingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._onWorkingCopyCommitted,this);}
|
| WebInspector.UISourceCodeFrame.prototype={wasShown:function()
|
| {WebInspector.SourceFrame.prototype.wasShown.call(this);this._boundWindowFocused=this._windowFocused.bind(this);window.addEventListener("focus",this._boundWindowFocused,false);this._checkContentUpdated();},willHide:function()
|
| {WebInspector.SourceFrame.prototype.willHide.call(this);window.removeEventListener("focus",this._boundWindowFocused,false);delete this._boundWindowFocused;this._uiSourceCode.removeWorkingCopyGetter();},canEditSource:function()
|
| @@ -314,14 +306,13 @@
|
| {if(this._muteSourceCodeEvents)
|
| return;this._innerSetContent(this._uiSourceCode.workingCopy());this.onUISourceCodeContentChanged();},_onWorkingCopyCommitted:function(event)
|
| {if(!this._muteSourceCodeEvents){this._innerSetContent(this._uiSourceCode.workingCopy());this.onUISourceCodeContentChanged();}
|
| -this._textEditor.markClean();this._updateStyle();},_updateStyle:function()
|
| -{this.element.enableStyleClass("source-frame-unsaved-committed-changes",this._uiSourceCode.hasUnsavedCommittedChanges());},onUISourceCodeContentChanged:function()
|
| +this._textEditor.markClean();},onUISourceCodeContentChanged:function()
|
| {},_innerSetContent:function(content)
|
| {this._isSettingContent=true;this.setContent(content,false,this._uiSourceCode.mimeType());delete this._isSettingContent;},populateTextAreaContextMenu:function(contextMenu,lineNumber)
|
| {WebInspector.SourceFrame.prototype.populateTextAreaContextMenu.call(this,contextMenu,lineNumber);contextMenu.appendApplicableItems(this._uiSourceCode);contextMenu.appendSeparator();},dispose:function()
|
| {this.detach();},__proto__:WebInspector.SourceFrame.prototype};WebInspector.JavaScriptSourceFrame=function(scriptsPanel,uiSourceCode)
|
| {this._scriptsPanel=scriptsPanel;this._breakpointManager=WebInspector.breakpointManager;this._uiSourceCode=uiSourceCode;WebInspector.UISourceCodeFrame.call(this,uiSourceCode);if(uiSourceCode.project().type()===WebInspector.projectTypes.Debugger)
|
| -this.element.addStyleClass("source-frame-debugger-script");this._popoverHelper=new WebInspector.ObjectPopoverHelper(this.textEditor.element,this._getPopoverAnchor.bind(this),this._resolveObjectForPopover.bind(this),this._onHidePopover.bind(this),true);this.textEditor.element.addEventListener("keydown",this._onKeyDown.bind(this),true);this.textEditor.addEventListener(WebInspector.TextEditor.Events.GutterClick,this._handleGutterClick.bind(this),this);this.textEditor.element.addEventListener("mousedown",this._onMouseDownAndClick.bind(this,true),true);this.textEditor.element.addEventListener("click",this._onMouseDownAndClick.bind(this,false),true);this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._breakpointRemoved,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessageAdded,this._consoleMessageAdded,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessageRemoved,this._consoleMessageRemoved,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessagesCleared,this._consoleMessagesCleared,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged,this._onSourceMappingChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);this._registerShortcuts();this._updateScriptFile();}
|
| +this.element.addStyleClass("source-frame-debugger-script");this._popoverHelper=new WebInspector.ObjectPopoverHelper(this.textEditor.element,this._getPopoverAnchor.bind(this),this._resolveObjectForPopover.bind(this),this._onHidePopover.bind(this),true);this.textEditor.element.addEventListener("keydown",this._onKeyDown.bind(this),true);this.textEditor.addEventListener(WebInspector.TextEditor.Events.GutterClick,this._handleGutterClick.bind(this),this);this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._breakpointRemoved,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessageAdded,this._consoleMessageAdded,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessageRemoved,this._consoleMessageRemoved,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessagesCleared,this._consoleMessagesCleared,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged,this._onSourceMappingChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);this._registerShortcuts();this._updateScriptFile();}
|
| WebInspector.JavaScriptSourceFrame.prototype={_registerShortcuts:function()
|
| {var modifiers=WebInspector.KeyboardShortcut.Modifiers;this.addShortcut(WebInspector.KeyboardShortcut.makeKey("e",modifiers.Shift|modifiers.Ctrl),this._evaluateSelectionInConsole.bind(this));},_evaluateSelectionInConsole:function(event)
|
| {var selection=this.textEditor.selection();if(!selection||selection.isEmpty())
|
| @@ -358,7 +349,7 @@
|
| breakpoints[i].remove();},_getPopoverAnchor:function(element,event)
|
| {if(!WebInspector.debuggerModel.isPaused())
|
| return null;var textPosition=this.textEditor.coordinatesToCursorPosition(event.x,event.y);if(!textPosition)
|
| -return null;var mouseLine=textPosition.startLine;var mouseColumn=textPosition.startColumn;var textSelection=this.textEditor.selection().normalize();if(textSelection&&!textSelection.isEmpty()){if(textSelection.startLine!==textSelection.endLine||textSelection.startLine!==mouseLine||mouseColumn<textSelection.startColumn||mouseColumn>textSelection.endColumn)
|
| +return null;var mouseLine=textPosition.startLine;var mouseColumn=textPosition.startColumn;var textSelection=this.textEditor.selection();if(textSelection&&!textSelection.isEmpty()){if(textSelection.startLine!==textSelection.endLine||textSelection.startLine!==mouseLine||mouseColumn<textSelection.startColumn||mouseColumn>textSelection.endColumn)
|
| return null;var leftCorner=this.textEditor.cursorPositionToCoordinates(textSelection.startLine,textSelection.startColumn);var rightCorner=this.textEditor.cursorPositionToCoordinates(textSelection.endLine,textSelection.endColumn);var anchorBox=new AnchorBox(leftCorner.x,leftCorner.y,rightCorner.x-leftCorner.x,leftCorner.height);anchorBox.highlight={lineNumber:textSelection.startLine,startColumn:textSelection.startColumn,endColumn:textSelection.endColumn-1};anchorBox.forSelection=true;return anchorBox;}
|
| var token=this.textEditor.tokenAtTextPosition(textPosition.startLine,textPosition.startColumn);if(!token)
|
| 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"||tokenContent!=="this"))
|
| @@ -375,29 +366,21 @@
|
| this.textEditor.removeHighlight(this._popoverAnchorBox._highlightDescriptor);delete this._popoverAnchorBox;},_addBreakpointDecoration:function(lineNumber,condition,enabled,mutedWhileEditing)
|
| {var breakpoint={condition:condition,enabled:enabled};this.textEditor.setAttribute(lineNumber,"breakpoint",breakpoint);var disabled=!enabled||mutedWhileEditing;this.textEditor.addBreakpoint(lineNumber,disabled,!!condition);},_removeBreakpointDecoration:function(lineNumber)
|
| {this.textEditor.removeAttribute(lineNumber,"breakpoint");this.textEditor.removeBreakpoint(lineNumber);},_onKeyDown:function(event)
|
| -{if(event.keyIdentifier==="U+001B"){if(this._popoverHelper.isPopoverVisible()){this._popoverHelper.hidePopover();event.consume();return;}
|
| -if(this._stepIntoMarkup&&WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)){this._stepIntoMarkup.stoptIteratingSelection();event.consume();return;}}},_editBreakpointCondition:function(lineNumber,breakpoint)
|
| +{if(event.keyIdentifier==="U+001B"){if(this._popoverHelper.isPopoverVisible()){this._popoverHelper.hidePopover();event.consume();}}},_editBreakpointCondition:function(lineNumber,breakpoint)
|
| {this._conditionElement=this._createConditionElement(lineNumber);this.textEditor.addDecoration(lineNumber,this._conditionElement);function finishEditing(committed,element,newText)
|
| {this.textEditor.removeDecoration(lineNumber,this._conditionElement);delete this._conditionEditorElement;delete this._conditionElement;if(!committed)
|
| return;if(breakpoint)
|
| breakpoint.setCondition(newText);else
|
| this._setBreakpoint(lineNumber,newText,true);}
|
| var config=new WebInspector.EditingConfig(finishEditing.bind(this,true),finishEditing.bind(this,false));WebInspector.startEditing(this._conditionEditorElement,config);this._conditionEditorElement.value=breakpoint?breakpoint.condition():"";this._conditionEditorElement.select();},_createConditionElement:function(lineNumber)
|
| -{var conditionElement=document.createElement("div");conditionElement.className="source-frame-breakpoint-condition";var labelElement=document.createElement("label");labelElement.className="source-frame-breakpoint-message";labelElement.htmlFor="source-frame-breakpoint-condition";labelElement.appendChild(document.createTextNode(WebInspector.UIString("The breakpoint on line %d will stop only if this expression is true:",lineNumber)));conditionElement.appendChild(labelElement);var editorElement=document.createElement("input");editorElement.id="source-frame-breakpoint-condition";editorElement.className="monospace";editorElement.type="text";conditionElement.appendChild(editorElement);this._conditionEditorElement=editorElement;return conditionElement;},setExecutionLine:function(lineNumber,callFrame)
|
| -{this._executionLineNumber=lineNumber;this._executionCallFrame=callFrame;if(this.loaded){this.textEditor.setExecutionLine(lineNumber);if(WebInspector.experimentsSettings.stepIntoSelection.isEnabled()){function locationsCallback(locations)
|
| -{if(this._executionCallFrame!==callFrame||this._stepIntoMarkup)
|
| -return;this._stepIntoMarkup=WebInspector.JavaScriptSourceFrame.StepIntoMarkup.create(this,locations);if(this._stepIntoMarkup)
|
| -this._stepIntoMarkup.show();}
|
| -callFrame.getStepIntoLocations(locationsCallback.bind(this));}}},clearExecutionLine:function()
|
| -{if(this._stepIntoMarkup){this._stepIntoMarkup.dispose();delete this._stepIntoMarkup;}
|
| -if(this.loaded&&typeof this._executionLineNumber==="number")
|
| -this.textEditor.clearExecutionLine();delete this._executionLineNumber;delete this._executionCallFrame;},_lineNumberAfterEditing:function(lineNumber,oldRange,newRange)
|
| +{var conditionElement=document.createElement("div");conditionElement.className="source-frame-breakpoint-condition";var labelElement=document.createElement("label");labelElement.className="source-frame-breakpoint-message";labelElement.htmlFor="source-frame-breakpoint-condition";labelElement.appendChild(document.createTextNode(WebInspector.UIString("The breakpoint on line %d will stop only if this expression is true:",lineNumber)));conditionElement.appendChild(labelElement);var editorElement=document.createElement("input");editorElement.id="source-frame-breakpoint-condition";editorElement.className="monospace";editorElement.type="text";conditionElement.appendChild(editorElement);this._conditionEditorElement=editorElement;return conditionElement;},setExecutionLine:function(lineNumber)
|
| +{this._executionLineNumber=lineNumber;if(this.loaded){this.textEditor.setExecutionLine(lineNumber);this.revealLine(this._executionLineNumber);if(this.canEditSource())
|
| +this.setSelection(WebInspector.TextRange.createFromLocation(lineNumber,0));}},clearExecutionLine:function()
|
| +{if(this.loaded&&typeof this._executionLineNumber==="number")
|
| +this.textEditor.clearExecutionLine();delete this._executionLineNumber;},_lineNumberAfterEditing:function(lineNumber,oldRange,newRange)
|
| {var shiftOffset=lineNumber<=oldRange.startLine?0:newRange.linesCount-oldRange.linesCount;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;}}}
|
| var newLineNumber=Math.max(0,lineNumber+shiftOffset);if(oldRange.startLine<lineNumber&&lineNumber<oldRange.endLine)
|
| -newLineNumber=oldRange.startLine;return newLineNumber;},_onMouseDownAndClick:function(isMouseDown,event)
|
| -{var markup=this._stepIntoMarkup;if(!markup)
|
| -return;var index=markup.findItemByCoordinates(event.x,event.y);if(typeof index==="undefined")
|
| -return;if(isMouseDown){event.consume();}else{var rawLocation=markup.getRawPosition(index);this._scriptsPanel.doStepIntoSelection(rawLocation);}},_shouldIgnoreExternalBreakpointEvents:function()
|
| +newLineNumber=oldRange.startLine;return newLineNumber;},_shouldIgnoreExternalBreakpointEvents:function()
|
| {if(this._supportsEnabledBreakpointsWhileEditing())
|
| return false;if(this._muted)
|
| return true;return this._scriptFile&&(this._scriptFile.isDivergingFromVM()||this._scriptFile.isMergingToVM());},_breakpointAdded:function(event)
|
| @@ -420,7 +403,7 @@
|
| this._scriptFile=this._uiSourceCode.scriptFile();if(this._scriptFile){this._scriptFile.addEventListener(WebInspector.ScriptFile.Events.DidMergeToVM,this._didMergeToVM,this);this._scriptFile.addEventListener(WebInspector.ScriptFile.Events.DidDivergeFromVM,this._didDivergeFromVM,this);if(this.loaded)
|
| this._scriptFile.checkMapping();}},onTextEditorContentLoaded:function()
|
| {if(typeof this._executionLineNumber==="number")
|
| -this.setExecutionLine(this._executionLineNumber,this._executionCallFrame);var breakpointLocations=this._breakpointManager.breakpointLocationsForUISourceCode(this._uiSourceCode);for(var i=0;i<breakpointLocations.length;++i)
|
| +this.setExecutionLine(this._executionLineNumber);var breakpointLocations=this._breakpointManager.breakpointLocationsForUISourceCode(this._uiSourceCode);for(var i=0;i<breakpointLocations.length;++i)
|
| this._breakpointAdded({data:breakpointLocations[i]});var messages=this._uiSourceCode.consoleMessages();for(var i=0;i<messages.length;++i){var message=messages[i];this.addMessageToSource(message.lineNumber,message.originalMessage);}
|
| if(this._scriptFile)
|
| this._scriptFile.checkMapping();},_handleGutterClick:function(event)
|
| @@ -435,40 +418,8 @@
|
| return;var selection=this.textEditor.selection();if(!selection)
|
| return;this._toggleBreakpoint(selection.startLine,false);},_setBreakpoint:function(lineNumber,condition,enabled)
|
| {this._breakpointManager.setBreakpoint(this._uiSourceCode,lineNumber,condition,enabled);WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction,{action:WebInspector.UserMetrics.UserActionNames.SetBreakpoint,url:this._uiSourceCode.originURL(),line:lineNumber,enabled:enabled});},_continueToLine:function(lineNumber)
|
| -{var rawLocation=(this._uiSourceCode.uiLocationToRawLocation(lineNumber,0));this._scriptsPanel.continueToLocation(rawLocation);},stepIntoMarkup:function()
|
| -{return this._stepIntoMarkup;},dispose:function()
|
| -{this._breakpointManager.removeEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.removeEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._breakpointRemoved,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.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);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged,this._onSourceMappingChanged,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);WebInspector.UISourceCodeFrame.prototype.dispose.call(this);},__proto__:WebInspector.UISourceCodeFrame.prototype}
|
| -WebInspector.JavaScriptSourceFrame.StepIntoMarkup=function(rawPositions,editorRanges,firstToExecute,sourceFrame)
|
| -{this._positions=rawPositions;this._editorRanges=editorRanges;this._highlightDescriptors=new Array(rawPositions.length);this._currentHighlight=undefined;this._firstToExecute=firstToExecute;this._currentSelection=undefined;this._sourceFrame=sourceFrame;};WebInspector.JavaScriptSourceFrame.StepIntoMarkup.prototype={show:function()
|
| -{var highlight=this._getVisibleHighlight();for(var i=0;i<this._positions.length;++i)
|
| -this._highlightItem(i,i===highlight);this._shownVisibleHighlight=highlight;},startIteratingSelection:function()
|
| -{this._currentSelection=this._positions.length
|
| -this._redrawHighlight();},stopIteratingSelection:function()
|
| -{this._currentSelection=undefined;this._redrawHighlight();},iterateSelection:function(backward)
|
| -{if(typeof this._currentSelection==="undefined")
|
| -return;var nextSelection=backward?this._currentSelection-1:this._currentSelection+1;var modulo=this._positions.length+1;nextSelection=(nextSelection+modulo)%modulo;this._currentSelection=nextSelection;this._redrawHighlight();},_redrawHighlight:function()
|
| -{var visibleHighlight=this._getVisibleHighlight();if(this._shownVisibleHighlight===visibleHighlight)
|
| -return;this._hideItemHighlight(this._shownVisibleHighlight);this._hideItemHighlight(visibleHighlight);this._highlightItem(this._shownVisibleHighlight,false);this._highlightItem(visibleHighlight,true);this._shownVisibleHighlight=visibleHighlight;},_getVisibleHighlight:function()
|
| -{return typeof this._currentSelection==="undefined"?this._firstToExecute:this._currentSelection;},_highlightItem:function(position,selected)
|
| -{if(position===this._positions.length)
|
| -return;var styleName=selected?"source-frame-stepin-mark-highlighted":"source-frame-stepin-mark";var textEditor=this._sourceFrame.textEditor;var highlightDescriptor=textEditor.highlightRange(this._editorRanges[position],styleName);this._highlightDescriptors[position]=highlightDescriptor;},_hideItemHighlight:function(position)
|
| -{if(position===this._positions.length)
|
| -return;var highlightDescriptor=this._highlightDescriptors[position];console.assert(highlightDescriptor);var textEditor=this._sourceFrame.textEditor;textEditor.removeHighlight(highlightDescriptor);this._highlightDescriptors[position]=undefined;},dispose:function()
|
| -{for(var i=0;i<this._positions.length;++i)
|
| -this._hideItemHighlight(i);},findItemByCoordinates:function(x,y)
|
| -{var textPosition=this._sourceFrame.textEditor.coordinatesToCursorPosition(x,y);if(!textPosition)
|
| -return;var ranges=this._editorRanges;for(var i=0;i<ranges.length;++i){var nextRange=ranges[i];if(nextRange.startLine==textPosition.startLine&&nextRange.startColumn<=textPosition.startColumn&&nextRange.endColumn>=textPosition.startColumn)
|
| -return i;}},getSelectedItemIndex:function()
|
| -{if(this._currentSelection===this._positions.length)
|
| -return undefined;return this._currentSelection;},getRawPosition:function(position)
|
| -{return(this._positions[position]);}};WebInspector.JavaScriptSourceFrame.StepIntoMarkup.create=function(sourceFrame,stepIntoRawLocations)
|
| -{if(!stepIntoRawLocations.length)
|
| -return null;var firstToExecute=stepIntoRawLocations[0];stepIntoRawLocations.sort(WebInspector.JavaScriptSourceFrame.StepIntoMarkup._Comparator);var firstToExecuteIndex=stepIntoRawLocations.indexOf(firstToExecute);var textEditor=sourceFrame.textEditor;var uiRanges=[];for(var i=0;i<stepIntoRawLocations.length;++i){var uiLocation=WebInspector.debuggerModel.rawLocationToUILocation((stepIntoRawLocations[i]));var token=textEditor.tokenAtTextPosition(uiLocation.lineNumber,uiLocation.columnNumber);var startColumn;var endColumn;if(token){startColumn=token.startColumn;endColumn=token.endColumn;}else{startColumn=uiLocation.columnNumber;endColumn=uiLocation.columnNumber;}
|
| -var range=new WebInspector.TextRange(uiLocation.lineNumber,startColumn,uiLocation.lineNumber,endColumn);uiRanges.push(range);}
|
| -return new WebInspector.JavaScriptSourceFrame.StepIntoMarkup(stepIntoRawLocations,uiRanges,firstToExecuteIndex,sourceFrame);};WebInspector.JavaScriptSourceFrame.StepIntoMarkup._Comparator=function(locationA,locationB)
|
| -{if(locationA.lineNumber===locationB.lineNumber)
|
| -return locationA.columnNumber-locationB.columnNumber;else
|
| -return locationA.lineNumber-locationB.lineNumber;};;WebInspector.NavigatorOverlayController=function(parentSidebarView,navigatorView,editorView)
|
| +{var rawLocation=(this._uiSourceCode.uiLocationToRawLocation(lineNumber,0));WebInspector.debuggerModel.continueToLocation(rawLocation);},dispose:function()
|
| +{this._breakpointManager.removeEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.removeEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._breakpointRemoved,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.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);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged,this._onSourceMappingChanged,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);WebInspector.UISourceCodeFrame.prototype.dispose.call(this);},__proto__:WebInspector.UISourceCodeFrame.prototype};WebInspector.NavigatorOverlayController=function(parentSidebarView,navigatorView,editorView)
|
| {this._parentSidebarView=parentSidebarView;this._navigatorView=navigatorView;this._editorView=editorView;this._navigatorSidebarResizeWidgetElement=this._navigatorView.element.createChild("div","resizer-widget");this._parentSidebarView.installResizer(this._navigatorSidebarResizeWidgetElement);this._navigatorShowHideButton=new WebInspector.StatusBarButton(WebInspector.UIString("Hide navigator"),"left-sidebar-show-hide-button scripts-navigator-show-hide-button",3);this._navigatorShowHideButton.state="left";this._navigatorShowHideButton.addEventListener("click",this._toggleNavigator,this);this._editorView.element.appendChild(this._navigatorShowHideButton.element);WebInspector.settings.navigatorHidden=WebInspector.settings.createSetting("navigatorHidden",true);if(WebInspector.settings.navigatorHidden.get())
|
| this._toggleNavigator();}
|
| WebInspector.NavigatorOverlayController.prototype={wasShown:function()
|
| @@ -532,11 +483,9 @@
|
| {var contextMenu=new WebInspector.ContextMenu(event);var path="/";var projectNode=node;while(projectNode.parent!==this._rootNode){path="/"+projectNode.id+path;projectNode=projectNode.parent;}
|
| var project=projectNode._project;if(project.type()===WebInspector.projectTypes.FileSystem){function refresh()
|
| {project.refresh(path);}
|
| -contextMenu.appendItem(WebInspector.UIString("Refresh"),refresh.bind(this));function create()
|
| +function create()
|
| {var data={};data.project=project;data.path=path;this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemCreationRequested,data);}
|
| -contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"New file":"New File"),create.bind(this));function exclude()
|
| -{var shouldExclude=window.confirm(WebInspector.UIString("Are you sure you want to exclude this folder?"));if(shouldExclude){WebInspector.startBatchUpdate();project.excludeFolder(path);WebInspector.endBatchUpdate();}}
|
| -contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Exclude folder":"Exclude Folder"),exclude.bind(this));}
|
| +contextMenu.appendItem(WebInspector.UIString("Refresh"),refresh.bind(this));contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"New file":"New File"),create.bind(this));}
|
| contextMenu.appendSeparator();this._appendAddFolderItem(contextMenu);if(project.type()===WebInspector.projectTypes.FileSystem&&node===projectNode){function removeFolder()
|
| {var shouldRemove=window.confirm(WebInspector.UIString("Are you sure you want to remove this folder?"));if(shouldRemove)
|
| project.remove();}
|
| @@ -639,7 +588,7 @@
|
| {if(this._treeElement)
|
| return this._treeElement;this._treeElement=new WebInspector.NavigatorSourceTreeElement(this._navigatorView,this._uiSourceCode,"");this.updateTitle();this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged,this._titleChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.FormattedChanged,this._formattedChanged,this);return this._treeElement;},updateTitle:function(ignoreIsDirty)
|
| {if(!this._treeElement)
|
| -return;var titleText=this._uiSourceCode.displayName();if(!ignoreIsDirty&&(this._uiSourceCode.isDirty()||this._uiSourceCode.hasUnsavedCommittedChanges()))
|
| +return;var titleText=this._uiSourceCode.displayName();if(!ignoreIsDirty&&this._uiSourceCode.isDirty())
|
| titleText="*"+titleText;this._treeElement.titleText=titleText;},hasChildren:function()
|
| {return false;},dispose:function()
|
| {if(!this._treeElement)
|
| @@ -838,7 +787,7 @@
|
| {if(this._currentFile===uiSourceCode)
|
| return;this._removeScrollAndSelectionListeners();this._currentFile=uiSourceCode;var tabId=this._tabIds.get(uiSourceCode)||this._appendFileTab(uiSourceCode,userGesture);this._tabbedPane.selectTab(tabId,userGesture);if(userGesture)
|
| this._editorSelectedByUserAction();this._currentView=this.visibleView;this._addScrollAndSelectionListeners();this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events.EditorSelected,this._currentFile);},_titleForFile:function(uiSourceCode)
|
| -{var maxDisplayNameLength=30;var title=uiSourceCode.displayName(true).trimMiddle(maxDisplayNameLength);if(uiSourceCode.isDirty()||uiSourceCode.hasUnsavedCommittedChanges())
|
| +{var maxDisplayNameLength=30;var title=uiSourceCode.displayName(true).trimMiddle(maxDisplayNameLength);if(uiSourceCode.isDirty())
|
| title+="*";return title;},_maybeCloseTab:function(id,nextTabId)
|
| {var uiSourceCode=this._files[id];var shouldPrompt=uiSourceCode.isDirty()&&uiSourceCode.project().canSetFileContent();if(!shouldPrompt||confirm(WebInspector.UIString("Are you sure you want to close unsaved file: %s?",uiSourceCode.name()))){uiSourceCode.resetWorkingCopy();if(nextTabId)
|
| this._tabbedPane.selectTab(nextTabId,true);this._tabbedPane.closeTab(id,true);return true;}
|
| @@ -868,7 +817,7 @@
|
| {return uiSourceCode.originURL();},_appendFileTab:function(uiSourceCode,userGesture)
|
| {var view=this._delegate.viewForFile(uiSourceCode);var title=this._titleForFile(uiSourceCode);var tooltip=this._tooltipForFile(uiSourceCode);var tabId=this._generateTabId();this._tabIds.put(uiSourceCode,tabId);this._files[tabId]=uiSourceCode;var savedSelectionRange=this._history.selectionRange(uiSourceCode.uri());if(savedSelectionRange)
|
| view.setSelection(savedSelectionRange);var savedScrollLineNumber=this._history.scrollLineNumber(uiSourceCode.uri());if(savedScrollLineNumber)
|
| -view.scrollToLine(savedScrollLineNumber);this._tabbedPane.appendTab(tabId,title,view,tooltip,userGesture);this._updateFileTitle(uiSourceCode);this._addUISourceCodeListeners(uiSourceCode);return tabId;},_tabClosed:function(event)
|
| +view.scrollToLine(savedScrollLineNumber);this._tabbedPane.appendTab(tabId,title,view,tooltip,userGesture);this._addUISourceCodeListeners(uiSourceCode);return tabId;},_tabClosed:function(event)
|
| {var tabId=(event.data.tabId);var userGesture=(event.data.isUserGesture);var uiSourceCode=this._files[tabId];if(this._currentFile===uiSourceCode){this._removeScrollAndSelectionListeners();delete this._currentView;delete this._currentFile;}
|
| this._tabIds.remove(uiSourceCode);delete this._files[tabId];this._removeUISourceCodeListeners(uiSourceCode);this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events.EditorClosed,uiSourceCode);if(userGesture)
|
| this._editorClosedByUserAction(uiSourceCode);},_tabSelected:function(event)
|
| @@ -1024,16 +973,16 @@
|
| {WorkerAgent.setAutoconnectToWorkers(this._enableWorkersCheckbox.checked);},__proto__:WebInspector.SidebarPane.prototype};WebInspector.ScriptsPanel=function(workspaceForTest)
|
| {WebInspector.Panel.call(this,"scripts");this.registerRequiredCSS("scriptsPanel.css");this.registerRequiredCSS("textPrompt.css");WebInspector.settings.navigatorWasOnceHidden=WebInspector.settings.createSetting("navigatorWasOnceHidden",false);WebInspector.settings.debuggerSidebarHidden=WebInspector.settings.createSetting("debuggerSidebarHidden",false);this._workspace=workspaceForTest||WebInspector.workspace;function viewGetter()
|
| {return this.visibleView;}
|
| -WebInspector.GoToLineDialog.install(this,viewGetter.bind(this));var helpSection=WebInspector.shortcutsScreen.section(WebInspector.UIString("Sources Panel"));this.debugToolbar=this._createDebugToolbar();const initialDebugSidebarWidth=225;const minimumDebugSidebarWidthPercent=0.5;this.createSidebarView(this.element,WebInspector.SidebarView.SidebarPosition.End,initialDebugSidebarWidth);this.splitView.element.id="scripts-split-view";this.splitView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);this.splitView.setMainElementConstraints(minimumDebugSidebarWidthPercent);const initialNavigatorWidth=225;const minimumViewsContainerWidthPercent=0.5;this.editorView=new WebInspector.SidebarView(WebInspector.SidebarView.SidebarPosition.Start,"scriptsPanelNavigatorSidebarWidth",initialNavigatorWidth);this.editorView.element.tabIndex=0;this.editorView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);this.editorView.setMainElementConstraints(minimumViewsContainerWidthPercent);this.editorView.show(this.splitView.mainElement);this._navigator=new WebInspector.ScriptsNavigator();this._navigator.view.show(this.editorView.sidebarElement);var tabbedEditorPlaceholderText=WebInspector.isMac()?WebInspector.UIString("Hit Cmd+O to open a file"):WebInspector.UIString("Hit Ctrl+O to open a file");this._editorContentsElement=this.editorView.mainElement.createChild("div","fill");this._editorFooterElement=this.editorView.mainElement.createChild("div","inspector-footer status-bar hidden");this._editorContainer=new WebInspector.TabbedEditorContainer(this,"previouslyViewedFiles",tabbedEditorPlaceholderText);this._editorContainer.show(this._editorContentsElement);this._navigatorController=new WebInspector.NavigatorOverlayController(this.editorView,this._navigator.view,this._editorContainer.view);this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ScriptSelected,this._scriptSelected,this);this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ItemSearchStarted,this._itemSearchStarted,this);this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ItemCreationRequested,this._itemCreationRequested,this);this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ItemRenamingRequested,this._itemRenamingRequested,this);this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorSelected,this._editorSelected,this);this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorClosed,this._editorClosed,this);this._debugSidebarResizeWidgetElement=this.splitView.mainElement.createChild("div","resizer-widget");this._debugSidebarResizeWidgetElement.id="scripts-debug-sidebar-resizer-widget";this.splitView.installResizer(this._debugSidebarResizeWidgetElement);this.sidebarPanes={};this.sidebarPanes.watchExpressions=new WebInspector.WatchExpressionsSidebarPane();this.sidebarPanes.callstack=new WebInspector.CallStackSidebarPane();this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPane.Events.CallFrameSelected,this._callFrameSelectedInSidebar.bind(this));this.sidebarPanes.scopechain=new WebInspector.ScopeChainSidebarPane();this.sidebarPanes.jsBreakpoints=new WebInspector.JavaScriptBreakpointsSidebarPane(WebInspector.breakpointManager,this._showSourceLocation.bind(this));this.sidebarPanes.domBreakpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.xhrBreakpoints=new WebInspector.XHRBreakpointsSidebarPane();this.sidebarPanes.eventListenerBreakpoints=new WebInspector.EventListenerBreakpointsSidebarPane();if(Capabilities.canInspectWorkers&&!WebInspector.WorkerManager.isWorkerFrontend()){WorkerAgent.enable();this.sidebarPanes.workerList=new WebInspector.WorkersSidebarPane(WebInspector.workerManager);}
|
| +WebInspector.GoToLineDialog.install(this,viewGetter.bind(this));var helpSection=WebInspector.shortcutsScreen.section(WebInspector.UIString("Sources Panel"));this.debugToolbar=this._createDebugToolbar();const initialDebugSidebarWidth=225;const minimumDebugSidebarWidthPercent=0.5;this.createSidebarView(this.element,WebInspector.SidebarView.SidebarPosition.End,initialDebugSidebarWidth);this.splitView.element.id="scripts-split-view";this.splitView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);this.splitView.setMainElementConstraints(minimumDebugSidebarWidthPercent);const initialNavigatorWidth=225;const minimumViewsContainerWidthPercent=0.5;this.editorView=new WebInspector.SidebarView(WebInspector.SidebarView.SidebarPosition.Start,"scriptsPanelNavigatorSidebarWidth",initialNavigatorWidth);this.editorView.element.tabIndex=0;this.editorView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);this.editorView.setMainElementConstraints(minimumViewsContainerWidthPercent);this.editorView.show(this.splitView.mainElement);this._navigator=new WebInspector.ScriptsNavigator();this._navigator.view.show(this.editorView.sidebarElement);var tabbedEditorPlaceholderText=WebInspector.isMac()?WebInspector.UIString("Hit Cmd+O to open a file"):WebInspector.UIString("Hit Ctrl+O to open a file");this._editorContentsElement=this.editorView.mainElement.createChild("div","fill");this._editorFooterElement=this.editorView.mainElement.createChild("div","inspector-footer status-bar hidden");this._editorContainer=new WebInspector.TabbedEditorContainer(this,"previouslyViewedFiles",tabbedEditorPlaceholderText);this._editorContainer.show(this._editorContentsElement);this._navigatorController=new WebInspector.NavigatorOverlayController(this.editorView,this._navigator.view,this._editorContainer.view);this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ScriptSelected,this._scriptSelected,this);this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ItemSearchStarted,this._itemSearchStarted,this);this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ItemCreationRequested,this._itemCreationRequested,this);this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ItemRenamingRequested,this._itemRenamingRequested,this);this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorSelected,this._editorSelected,this);this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorClosed,this._editorClosed,this);this._debugSidebarResizeWidgetElement=this.splitView.mainElement.createChild("div","resizer-widget");this._debugSidebarResizeWidgetElement.id="scripts-debug-sidebar-resizer-widget";this.splitView.installResizer(this._debugSidebarResizeWidgetElement);this.sidebarPanes={};this.sidebarPanes.watchExpressions=new WebInspector.WatchExpressionsSidebarPane();this.sidebarPanes.callstack=new WebInspector.CallStackSidebarPane();this.sidebarPanes.scopechain=new WebInspector.ScopeChainSidebarPane();this.sidebarPanes.jsBreakpoints=new WebInspector.JavaScriptBreakpointsSidebarPane(WebInspector.breakpointManager,this._showSourceLocation.bind(this));this.sidebarPanes.domBreakpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.xhrBreakpoints=new WebInspector.XHRBreakpointsSidebarPane();this.sidebarPanes.eventListenerBreakpoints=new WebInspector.EventListenerBreakpointsSidebarPane();if(Capabilities.canInspectWorkers&&!WebInspector.WorkerManager.isWorkerFrontend()){WorkerAgent.enable();this.sidebarPanes.workerList=new WebInspector.WorkersSidebarPane(WebInspector.workerManager);}
|
| this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(this));this.registerShortcuts(WebInspector.ScriptsPanelDescriptor.ShortcutKeys.GoToMember,this._showOutlineDialog.bind(this));this.registerShortcuts(WebInspector.ScriptsPanelDescriptor.ShortcutKeys.ToggleBreakpoint,this._toggleBreakpoint.bind(this));this._pauseOnExceptionButton=new WebInspector.StatusBarButton("","scripts-pause-on-exceptions-status-bar-item",3);this._pauseOnExceptionButton.addEventListener("click",this._togglePauseOnExceptions,this);this._toggleFormatSourceButton=new WebInspector.StatusBarButton(WebInspector.UIString("Pretty print"),"scripts-toggle-pretty-print-status-bar-item");this._toggleFormatSourceButton.toggled=false;this._toggleFormatSourceButton.addEventListener("click",this._toggleFormatSource,this);this._scriptViewStatusBarItemsContainer=document.createElement("div");this._scriptViewStatusBarItemsContainer.className="inline-block";this._scriptViewStatusBarTextContainer=document.createElement("div");this._scriptViewStatusBarTextContainer.className="inline-block";this._installDebuggerSidebarController();WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged,this._dockSideChanged.bind(this));WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(this._dockSideChanged.bind(this));this._dockSideChanged();this._sourceFramesByUISourceCode=new Map();this._updateDebuggerButtons();this._pauseOnExceptionStateChanged();if(WebInspector.debuggerModel.isPaused())
|
| -this._debuggerPaused();WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled,this._debuggerWasEnabled,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled,this._debuggerWasDisabled,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused,this._debuggerPaused,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed,this._debuggerResumed,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.CallFrameSelected,this._callFrameSelected,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ConsoleCommandEvaluatedInSelectedCallFrame,this._consoleCommandEvaluatedInSelectedCallFrame,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointsActiveStateChanged,this._breakpointsActiveStateChanged,this);WebInspector.startBatchUpdate();this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this));WebInspector.endBatchUpdate();this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAdded,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectWillReset,this._projectWillReset.bind(this),this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);WebInspector.advancedSearchController.registerSearchScope(new WebInspector.ScriptsSearchScope(this._workspace));this._boundOnKeyUp=this._onKeyUp.bind(this);this._boundOnKeyDown=this._onKeyDown.bind(this);}
|
| +this._debuggerPaused();WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled,this._debuggerWasEnabled,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled,this._debuggerWasDisabled,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused,this._debuggerPaused,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed,this._debuggerResumed,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.CallFrameSelected,this._callFrameSelected,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ConsoleCommandEvaluatedInSelectedCallFrame,this._consoleCommandEvaluatedInSelectedCallFrame,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ExecutionLineChanged,this._executionLineChanged,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointsActiveStateChanged,this._breakpointsActiveStateChanged,this);WebInspector.startBatchUpdate();this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this));WebInspector.endBatchUpdate();this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAdded,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectWillReset,this._projectWillReset.bind(this),this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);WebInspector.advancedSearchController.registerSearchScope(new WebInspector.ScriptsSearchScope(this._workspace));}
|
| WebInspector.ScriptsPanel.prototype={get statusBarItems()
|
| {return[this._pauseOnExceptionButton.element,this._toggleFormatSourceButton.element,this._scriptViewStatusBarItemsContainer];},statusBarText:function()
|
| {return this._scriptViewStatusBarTextContainer;},defaultFocusedElement:function()
|
| {return this._editorContainer.view.defaultFocusedElement()||this._navigator.view.defaultFocusedElement();},get paused()
|
| {return this._paused;},wasShown:function()
|
| -{WebInspector.Panel.prototype.wasShown.call(this);this._navigatorController.wasShown();this.element.addEventListener("keydown",this._boundOnKeyDown,false);this.element.addEventListener("keyup",this._boundOnKeyUp,false);},willHide:function()
|
| -{this.element.removeEventListener("keydown",this._boundOnKeyDown,false);this.element.removeEventListener("keyup",this._boundOnKeyUp,false);WebInspector.Panel.prototype.willHide.call(this);WebInspector.closeViewInDrawer();},_uiSourceCodeAdded:function(event)
|
| +{WebInspector.Panel.prototype.wasShown.call(this);this._navigatorController.wasShown();},willHide:function()
|
| +{WebInspector.Panel.prototype.willHide.call(this);WebInspector.closeViewInDrawer();},_uiSourceCodeAdded:function(event)
|
| {var uiSourceCode=(event.data);this._addUISourceCode(uiSourceCode);},_addUISourceCode:function(uiSourceCode)
|
| {if(this._toggleFormatSourceButton.toggled)
|
| uiSourceCode.setFormatted(true);if(uiSourceCode.project().isServiceProject())
|
| @@ -1058,7 +1007,7 @@
|
| {this._paused=false;this._waitingToPause=false;this._stepping=false;this._clearInterface();this._toggleDebuggerSidebarButton.setEnabled(true);},_debuggerWasEnabled:function()
|
| {this._updateDebuggerButtons();},_debuggerWasDisabled:function()
|
| {this._debuggerReset();},_debuggerReset:function()
|
| -{this._debuggerResumed();this.sidebarPanes.watchExpressions.reset();delete this._skipExecutionLineRevealing;},_projectWillReset:function(event)
|
| +{this._debuggerResumed();this.sidebarPanes.watchExpressions.reset();},_projectWillReset:function(event)
|
| {var project=event.data;var uiSourceCodes=project.uiSourceCodes();this._removeUISourceCodes(uiSourceCodes);if(project.type()===WebInspector.projectTypes.Network)
|
| this._editorContainer.reset();},get visibleView()
|
| {return this._editorContainer.visibleView;},_updateScriptViewStatusBarItems:function()
|
| @@ -1069,9 +1018,7 @@
|
| return true;var uiSourceCode=WebInspector.workspace.uiSourceCodeForURL(anchor.href);if(uiSourceCode){anchor.uiSourceCode=uiSourceCode;return true;}
|
| return false;},showAnchorLocation:function(anchor)
|
| {this._showSourceLocation(anchor.uiSourceCode,anchor.lineNumber,anchor.columnNumber);},showUISourceCode:function(uiSourceCode,lineNumber,columnNumber)
|
| -{this._showSourceLocation(uiSourceCode,lineNumber,columnNumber);},currentUISourceCode:function()
|
| -{return this._currentUISourceCode;},showUILocation:function(uiLocation)
|
| -{this._showSourceLocation(uiLocation.uiSourceCode,uiLocation.lineNumber,uiLocation.columnNumber);},_showSourceLocation:function(uiSourceCode,lineNumber,columnNumber)
|
| +{this._showSourceLocation(uiSourceCode,lineNumber,columnNumber);},_showSourceLocation:function(uiSourceCode,lineNumber,columnNumber)
|
| {var sourceFrame=this._showFile(uiSourceCode);if(typeof lineNumber==="number")
|
| sourceFrame.highlightPosition(lineNumber,columnNumber);sourceFrame.focus();WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction,{action:WebInspector.UserMetrics.UserActionNames.OpenSourceLink,url:uiSourceCode.originURL(),lineNumber:lineNumber});},_showFile:function(uiSourceCode)
|
| {var sourceFrame=this._getOrCreateSourceFrame(uiSourceCode);if(this._currentUISourceCode===uiSourceCode)
|
| @@ -1086,14 +1033,14 @@
|
| {var sourceFrame=this._sourceFramesByUISourceCode.get(uiSourceCode);if(!sourceFrame)
|
| return;this._sourceFramesByUISourceCode.remove(uiSourceCode);sourceFrame.dispose();},_clearCurrentExecutionLine:function()
|
| {if(this._executionSourceFrame)
|
| -this._executionSourceFrame.clearExecutionLine();delete this._executionSourceFrame;},_setExecutionLine:function(uiLocation)
|
| -{var callFrame=WebInspector.debuggerModel.selectedCallFrame()
|
| -var sourceFrame=this._getOrCreateSourceFrame(uiLocation.uiSourceCode);sourceFrame.setExecutionLine(uiLocation.lineNumber,callFrame);this._executionSourceFrame=sourceFrame;},_executionLineChanged:function(uiLocation)
|
| -{this._clearCurrentExecutionLine();this._setExecutionLine(uiLocation);var uiSourceCode=uiLocation.uiSourceCode;var scriptFile=this._currentUISourceCode?this._currentUISourceCode.scriptFile():null;if(this._skipExecutionLineRevealing)
|
| -return;this._skipExecutionLineRevealing=true;var sourceFrame=this._showFile(uiSourceCode);sourceFrame.revealLine(uiLocation.lineNumber);if(sourceFrame.canEditSource())
|
| -sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(uiLocation.lineNumber,0));sourceFrame.focus();},_callFrameSelected:function(event)
|
| +this._executionSourceFrame.clearExecutionLine();delete this._executionSourceFrame;},_executionLineChanged:function(event)
|
| +{var uiLocation=event.data;this._clearCurrentExecutionLine();if(!uiLocation)
|
| +return;var sourceFrame=this._getOrCreateSourceFrame(uiLocation.uiSourceCode);sourceFrame.setExecutionLine(uiLocation.lineNumber);this._executionSourceFrame=sourceFrame;},_revealExecutionLine:function(uiLocation)
|
| +{var uiSourceCode=uiLocation.uiSourceCode;if(this._currentUISourceCode&&this._currentUISourceCode.scriptFile()&&this._currentUISourceCode.scriptFile().isDivergingFromVM())
|
| +return;if(this._toggleFormatSourceButton.toggled&&!uiSourceCode.formatted())
|
| +uiSourceCode.setFormatted(true);var sourceFrame=this._showFile(uiSourceCode);sourceFrame.revealLine(uiLocation.lineNumber);sourceFrame.focus();},_callFrameSelected:function(event)
|
| {var callFrame=event.data;if(!callFrame)
|
| -return;this.sidebarPanes.scopechain.update(callFrame);this.sidebarPanes.watchExpressions.refreshExpressions();this.sidebarPanes.callstack.setSelectedCallFrame(callFrame);callFrame.createLiveLocation(this._executionLineChanged.bind(this));},_editorClosed:function(event)
|
| +return;this.sidebarPanes.scopechain.update(callFrame);this.sidebarPanes.watchExpressions.refreshExpressions();this.sidebarPanes.callstack.setSelectedCallFrame(callFrame);callFrame.createLiveLocation(this._revealExecutionLine.bind(this));},_editorClosed:function(event)
|
| {this._navigatorController.hideNavigatorOverlay();var uiSourceCode=(event.data);if(this._currentUISourceCode===uiSourceCode)
|
| delete this._currentUISourceCode;this._updateScriptViewStatusBarItems();WebInspector.searchController.resetSearch();},_editorSelected:function(event)
|
| {var uiSourceCode=(event.data);var sourceFrame=this._showFile(uiSourceCode);this._navigatorController.hideNavigatorOverlay();if(!this._navigatorController.isNavigatorPinned())
|
| @@ -1105,8 +1052,8 @@
|
| this._pauseOnExceptionButton.state=pauseOnExceptionsState;},_updateDebuggerButtons:function()
|
| {if(WebInspector.debuggerModel.debuggerEnabled()){this._pauseOnExceptionButton.visible=true;}else{this._pauseOnExceptionButton.visible=false;}
|
| if(this._paused){this._updateButtonTitle(this._pauseButton,WebInspector.UIString("Resume script execution (%s)."))
|
| -this._pauseButton.state=true;this._pauseButton.setLongClickOptionsEnabled((function(){return[this._longResumeButton]}).bind(this));this._pauseButton.setEnabled(true);this._stepOverButton.setEnabled(true);this._stepIntoButton.setEnabled(true);this._stepOutButton.setEnabled(true);this.debuggerStatusElement.textContent=WebInspector.UIString("Paused");}else{this._updateButtonTitle(this._pauseButton,WebInspector.UIString("Pause script execution (%s)."))
|
| -this._pauseButton.state=false;this._pauseButton.setLongClickOptionsEnabled(null);this._pauseButton.setEnabled(!this._waitingToPause);this._stepOverButton.setEnabled(false);this._stepIntoButton.setEnabled(false);this._stepOutButton.setEnabled(false);if(this._waitingToPause)
|
| +this._pauseButton.state=true;this._pauseButton.setEnabled(true);this._stepOverButton.setEnabled(true);this._stepIntoButton.setEnabled(true);this._stepOutButton.setEnabled(true);this.debuggerStatusElement.textContent=WebInspector.UIString("Paused");}else{this._updateButtonTitle(this._pauseButton,WebInspector.UIString("Pause script execution (%s)."))
|
| +this._pauseButton.state=false;this._pauseButton.setEnabled(!this._waitingToPause);this._stepOverButton.setEnabled(false);this._stepIntoButton.setEnabled(false);this._stepOutButton.setEnabled(false);if(this._waitingToPause)
|
| this.debuggerStatusElement.textContent=WebInspector.UIString("Pausing");else if(this._stepping)
|
| this.debuggerStatusElement.textContent=WebInspector.UIString("Stepping");else
|
| this.debuggerStatusElement.textContent="";}},_clearInterface:function()
|
| @@ -1114,29 +1061,17 @@
|
| {var nextStateMap={};var stateEnum=WebInspector.DebuggerModel.PauseOnExceptionsState;nextStateMap[stateEnum.DontPauseOnExceptions]=stateEnum.PauseOnAllExceptions;nextStateMap[stateEnum.PauseOnAllExceptions]=stateEnum.PauseOnUncaughtExceptions;nextStateMap[stateEnum.PauseOnUncaughtExceptions]=stateEnum.DontPauseOnExceptions;WebInspector.settings.pauseOnExceptionStateString.set(nextStateMap[this._pauseOnExceptionButton.state]);},_runSnippet:function(event)
|
| {if(this._currentUISourceCode.project().type()!==WebInspector.projectTypes.Snippets)
|
| return false;WebInspector.scriptSnippetModel.evaluateScriptSnippet(this._currentUISourceCode);return true;},_togglePause:function(event)
|
| -{if(this._paused){delete this._skipExecutionLineRevealing;this._paused=false;this._waitingToPause=false;DebuggerAgent.resume();}else{this._stepping=false;this._waitingToPause=true;DebuggerAgent.setSkipAllPauses(false);DebuggerAgent.pause();}
|
| -this._clearInterface();return true;},_longResume:function(event)
|
| +{if(this._paused){this._paused=false;this._waitingToPause=false;DebuggerAgent.resume();}else{this._stepping=false;this._waitingToPause=true;DebuggerAgent.pause();}
|
| +this._clearInterface();return true;},_stepOverClicked:function(event)
|
| {if(!this._paused)
|
| -return true;this._paused=false;this._waitingToPause=false;DebuggerAgent.setSkipAllPauses(true,true);setTimeout(DebuggerAgent.setSkipAllPauses.bind(DebuggerAgent,false),500);DebuggerAgent.resume();this._clearInterface();return true;},_stepOverClicked:function(event)
|
| +return true;this._paused=false;this._stepping=true;this._clearInterface();DebuggerAgent.stepOver();return true;},_stepIntoClicked:function(event)
|
| {if(!this._paused)
|
| -return true;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();DebuggerAgent.stepOver();return true;},_stepIntoClicked:function(event)
|
| +return true;this._paused=false;this._stepping=true;this._clearInterface();DebuggerAgent.stepInto();return true;},_stepOutClicked:function(event)
|
| {if(!this._paused)
|
| -return true;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();DebuggerAgent.stepInto();return true;},_stepIntoSelectionClicked:function(event)
|
| -{if(!this._paused)
|
| -return true;if(this._executionSourceFrame){var stepIntoMarkup=this._executionSourceFrame.stepIntoMarkup();if(stepIntoMarkup)
|
| -stepIntoMarkup.iterateSelection(event.shiftKey);}
|
| -return true;},doStepIntoSelection:function(rawLocation)
|
| -{if(!this._paused)
|
| -return;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();WebInspector.debuggerModel.stepIntoSelection(rawLocation);},_stepOutClicked:function(event)
|
| -{if(!this._paused)
|
| -return true;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();DebuggerAgent.stepOut();return true;},_callFrameSelectedInSidebar:function(event)
|
| -{var callFrame=(event.data);delete this._skipExecutionLineRevealing;WebInspector.debuggerModel.setSelectedCallFrame(callFrame);},continueToLocation:function(rawLocation)
|
| -{if(!this._paused)
|
| -return;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();WebInspector.debuggerModel.continueToLocation(rawLocation);},_toggleBreakpointsClicked:function(event)
|
| +return true;this._paused=false;this._stepping=true;this._clearInterface();DebuggerAgent.stepOut();return true;},_toggleBreakpointsClicked:function(event)
|
| {WebInspector.debuggerModel.setBreakpointsActive(!WebInspector.debuggerModel.breakpointsActive());},_breakpointsActiveStateChanged:function(event)
|
| {var active=event.data;this._toggleBreakpointsButton.toggled=!active;if(active){this._toggleBreakpointsButton.title=WebInspector.UIString("Deactivate breakpoints.");WebInspector.inspectorView.element.removeStyleClass("breakpoints-deactivated");this.sidebarPanes.jsBreakpoints.listElement.removeStyleClass("breakpoints-list-deactivated");}else{this._toggleBreakpointsButton.title=WebInspector.UIString("Activate breakpoints.");WebInspector.inspectorView.element.addStyleClass("breakpoints-deactivated");this.sidebarPanes.jsBreakpoints.listElement.addStyleClass("breakpoints-list-deactivated");}},_createDebugToolbar:function()
|
| -{var debugToolbar=document.createElement("div");debugToolbar.className="status-bar";debugToolbar.id="scripts-debug-toolbar";var title,handler;var platformSpecificModifier=WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta;title=WebInspector.UIString("Run snippet (%s).");handler=this._runSnippet.bind(this);this._runSnippetButton=this._createButtonAndRegisterShortcuts("scripts-run-snippet",title,handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.RunSnippet);debugToolbar.appendChild(this._runSnippetButton.element);this._runSnippetButton.element.addStyleClass("hidden");handler=this._togglePause.bind(this);this._pauseButton=this._createButtonAndRegisterShortcuts("scripts-pause","",handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.PauseContinue);debugToolbar.appendChild(this._pauseButton.element);title=WebInspector.UIString("Resume with all pauses blocked for 500 ms");this._longResumeButton=new WebInspector.StatusBarButton(title,"scripts-long-resume");this._longResumeButton.addEventListener("click",this._longResume.bind(this),this);title=WebInspector.UIString("Step over next function call (%s).");handler=this._stepOverClicked.bind(this);this._stepOverButton=this._createButtonAndRegisterShortcuts("scripts-step-over",title,handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.StepOver);debugToolbar.appendChild(this._stepOverButton.element);title=WebInspector.UIString("Step into next function call (%s).");handler=this._stepIntoClicked.bind(this);this._stepIntoButton=this._createButtonAndRegisterShortcuts("scripts-step-into",title,handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.StepInto);debugToolbar.appendChild(this._stepIntoButton.element);this.registerShortcuts(WebInspector.ScriptsPanelDescriptor.ShortcutKeys.StepIntoSelection,this._stepIntoSelectionClicked.bind(this))
|
| -title=WebInspector.UIString("Step out of current function (%s).");handler=this._stepOutClicked.bind(this);this._stepOutButton=this._createButtonAndRegisterShortcuts("scripts-step-out",title,handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.StepOut);debugToolbar.appendChild(this._stepOutButton.element);this._toggleBreakpointsButton=new WebInspector.StatusBarButton(WebInspector.UIString("Deactivate breakpoints."),"scripts-toggle-breakpoints");this._toggleBreakpointsButton.toggled=false;this._toggleBreakpointsButton.addEventListener("click",this._toggleBreakpointsClicked,this);debugToolbar.appendChild(this._toggleBreakpointsButton.element);this.debuggerStatusElement=document.createElement("div");this.debuggerStatusElement.id="scripts-debugger-status";debugToolbar.appendChild(this.debuggerStatusElement);return debugToolbar;},_updateButtonTitle:function(button,buttonTitle)
|
| +{var debugToolbar=document.createElement("div");debugToolbar.className="status-bar";debugToolbar.id="scripts-debug-toolbar";var title,handler;var platformSpecificModifier=WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta;title=WebInspector.UIString("Run snippet (%s).");handler=this._runSnippet.bind(this);this._runSnippetButton=this._createButtonAndRegisterShortcuts("scripts-run-snippet",title,handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.RunSnippet);debugToolbar.appendChild(this._runSnippetButton.element);this._runSnippetButton.element.addStyleClass("hidden");handler=this._togglePause.bind(this);this._pauseButton=this._createButtonAndRegisterShortcuts("scripts-pause","",handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.PauseContinue);debugToolbar.appendChild(this._pauseButton.element);title=WebInspector.UIString("Step over next function call (%s).");handler=this._stepOverClicked.bind(this);this._stepOverButton=this._createButtonAndRegisterShortcuts("scripts-step-over",title,handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.StepOver);debugToolbar.appendChild(this._stepOverButton.element);title=WebInspector.UIString("Step into next function call (%s).");handler=this._stepIntoClicked.bind(this);this._stepIntoButton=this._createButtonAndRegisterShortcuts("scripts-step-into",title,handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.StepInto);debugToolbar.appendChild(this._stepIntoButton.element);title=WebInspector.UIString("Step out of current function (%s).");handler=this._stepOutClicked.bind(this);this._stepOutButton=this._createButtonAndRegisterShortcuts("scripts-step-out",title,handler,WebInspector.ScriptsPanelDescriptor.ShortcutKeys.StepOut);debugToolbar.appendChild(this._stepOutButton.element);this._toggleBreakpointsButton=new WebInspector.StatusBarButton(WebInspector.UIString("Deactivate breakpoints."),"scripts-toggle-breakpoints");this._toggleBreakpointsButton.toggled=false;this._toggleBreakpointsButton.addEventListener("click",this._toggleBreakpointsClicked,this);debugToolbar.appendChild(this._toggleBreakpointsButton.element);this.debuggerStatusElement=document.createElement("div");this.debuggerStatusElement.id="scripts-debugger-status";debugToolbar.appendChild(this.debuggerStatusElement);return debugToolbar;},_updateButtonTitle:function(button,buttonTitle)
|
| {var hasShortcuts=button.shortcuts&&button.shortcuts.length;if(hasShortcuts)
|
| button.title=String.vsprintf(buttonTitle,[button.shortcuts[0].name]);else
|
| button.title=buttonTitle;},_createButtonAndRegisterShortcuts:function(buttonId,buttonTitle,handler,shortcuts)
|
| @@ -1160,16 +1095,8 @@
|
| this._searchView.jumpToPreviousSearchResult();},canSearchAndReplace:function()
|
| {var view=(this.visibleView);return!!view&&view.canEditSource();},replaceSelectionWith:function(text)
|
| {var view=(this.visibleView);view.replaceSearchMatchWith(text);},replaceAllWith:function(query,text)
|
| -{var view=(this.visibleView);view.replaceAllWith(query,text);},_onKeyDown:function(event)
|
| -{if(event.keyCode!==WebInspector.KeyboardShortcut.Keys.CtrlOrMeta.code)
|
| -return;if(!this._paused||!this._executionSourceFrame)
|
| -return;var stepIntoMarkup=this._executionSourceFrame.stepIntoMarkup();if(stepIntoMarkup)
|
| -stepIntoMarkup.startIteratingSelection();},_onKeyUp:function(event)
|
| -{if(event.keyCode!==WebInspector.KeyboardShortcut.Keys.CtrlOrMeta.code)
|
| -return;if(!this._paused||!this._executionSourceFrame)
|
| -return;var stepIntoMarkup=this._executionSourceFrame.stepIntoMarkup();if(!stepIntoMarkup)
|
| -return;var currentPosition=stepIntoMarkup.getSelectedItemIndex();if(typeof currentPosition==="undefined"){stepIntoMarkup.stopIteratingSelection();}else{var rawLocation=stepIntoMarkup.getRawPosition(currentPosition);this.doStepIntoSelection(rawLocation);}},_toggleFormatSource:function()
|
| -{delete this._skipExecutionLineRevealing;this._toggleFormatSourceButton.toggled=!this._toggleFormatSourceButton.toggled;var uiSourceCodes=this._workspace.uiSourceCodes();for(var i=0;i<uiSourceCodes.length;++i)
|
| +{var view=(this.visibleView);view.replaceAllWith(query,text);},_toggleFormatSource:function()
|
| +{this._toggleFormatSourceButton.toggled=!this._toggleFormatSourceButton.toggled;var uiSourceCodes=this._workspace.uiSourceCodes();for(var i=0;i<uiSourceCodes.length;++i)
|
| uiSourceCodes[i].setFormatted(this._toggleFormatSourceButton.toggled);var currentFile=this._editorContainer.currentFile();WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction,{action:WebInspector.UserMetrics.UserActionNames.TogglePrettyPrint,enabled:this._toggleFormatSourceButton.toggled,url:currentFile?currentFile.originURL():null});},addToWatch:function(expression)
|
| {this.sidebarPanes.watchExpressions.addExpression(expression);},_toggleBreakpoint:function()
|
| {var sourceFrame=this.visibleView;if(!sourceFrame)
|
| @@ -1214,7 +1141,8 @@
|
| contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Map to file system resource\u2026":"Map to File System Resource\u2026"),this._mapNetworkToFileSystem.bind(this,uiSourceCode));}},_appendUISourceCodeItems:function(contextMenu,target)
|
| {if(!(target instanceof WebInspector.UISourceCode))
|
| return;var uiSourceCode=(target);contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Local modifications\u2026":"Local Modifications\u2026"),this._showLocalHistory.bind(this,uiSourceCode));if(WebInspector.isolatedFileSystemManager.supportsFileSystems())
|
| -this._appendUISourceCodeMappingItems(contextMenu,uiSourceCode);},_appendFunctionItems:function(contextMenu,target)
|
| +this._appendUISourceCodeMappingItems(contextMenu,uiSourceCode);var resource=WebInspector.resourceForURL(uiSourceCode.url);if(resource&&resource.request)
|
| +contextMenu.appendApplicableItems(resource.request);},_appendFunctionItems:function(contextMenu,target)
|
| {if(!(target instanceof WebInspector.RemoteObject))
|
| return;var remoteObject=(target);if(remoteObject.type!=="function")
|
| return;function didGetDetails(error,response)
|
|
|