| Index: chrome_linux/resources/inspector/ResourcesPanel.js
|
| ===================================================================
|
| --- chrome_linux/resources/inspector/ResourcesPanel.js (revision 229864)
|
| +++ chrome_linux/resources/inspector/ResourcesPanel.js (working copy)
|
| @@ -26,12 +26,14 @@
|
| this._dataGrid.rootNode().children[0].selected=true;},_deleteButtonClicked:function(event)
|
| {if(!this._dataGrid||!this._dataGrid.selectedNode)
|
| return;this._deleteCallback(this._dataGrid.selectedNode);},_deleteCallback:function(node)
|
| -{},__proto__:WebInspector.View.prototype};WebInspector.DOMStorageItemsView=function(domStorage)
|
| -{WebInspector.View.call(this);this.domStorage=domStorage;this.element.addStyleClass("storage-view");this.element.addStyleClass("table");this.deleteButton=new WebInspector.StatusBarButton(WebInspector.UIString("Delete"),"delete-storage-status-bar-item");this.deleteButton.visible=false;this.deleteButton.addEventListener("click",this._deleteButtonClicked,this);this.refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this.refreshButton.addEventListener("click",this._refreshButtonClicked,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemsCleared,this._domStorageItemsCleared,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemRemoved,this._domStorageItemRemoved,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemAdded,this._domStorageItemAdded,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemUpdated,this._domStorageItemUpdated,this);}
|
| +{},__proto__:WebInspector.View.prototype};WebInspector.DOMStorageItemsView=function(domStorage,domStorageModel)
|
| +{WebInspector.View.call(this);this.domStorage=domStorage;this.domStorageModel=domStorageModel;this.element.addStyleClass("storage-view");this.element.addStyleClass("table");this.deleteButton=new WebInspector.StatusBarButton(WebInspector.UIString("Delete"),"delete-storage-status-bar-item");this.deleteButton.visible=false;this.deleteButton.addEventListener("click",this._deleteButtonClicked,this);this.refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this.refreshButton.addEventListener("click",this._refreshButtonClicked,this);this.domStorageModel.addEventListener(WebInspector.DOMStorageModel.Events.DOMStorageItemsCleared,this._domStorageItemsCleared,this);this.domStorageModel.addEventListener(WebInspector.DOMStorageModel.Events.DOMStorageItemRemoved,this._domStorageItemRemoved,this);this.domStorageModel.addEventListener(WebInspector.DOMStorageModel.Events.DOMStorageItemAdded,this._domStorageItemAdded,this);this.domStorageModel.addEventListener(WebInspector.DOMStorageModel.Events.DOMStorageItemUpdated,this._domStorageItemUpdated,this);}
|
| WebInspector.DOMStorageItemsView.prototype={get statusBarItems()
|
| {return[this.refreshButton.element,this.deleteButton.element];},wasShown:function()
|
| {this._update();},willHide:function()
|
| -{this.deleteButton.visible=false;},_domStorageItemsCleared:function(event)
|
| +{this.deleteButton.visible=false;},handleShortcut:function(event)
|
| +{if(WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)&&!event.shiftKey&&event.keyIdentifier==="U+005A"){this.domStorage.undo();event.handled=true;return;}
|
| +var isRedoKey=WebInspector.isMac()?event.metaKey&&event.shiftKey&&event.keyIdentifier==="U+005A":event.ctrlKey&&event.keyIdentifier==="U+0059";if(isRedoKey){this.domStorage.redo();event.handled=true;return;}},_domStorageItemsCleared:function(event)
|
| {if(!this.isShowing()||!this._dataGrid)
|
| return;this._dataGrid.rootNode().removeChildren();this._dataGrid.addCreationNode(false);this.deleteButton.visible=false;event.consume(true);},_domStorageItemRemoved:function(event)
|
| {if(!this.isShowing()||!this._dataGrid)
|
| @@ -39,10 +41,10 @@
|
| {if(!this.isShowing()||!this._dataGrid)
|
| return;var storageData=event.data;var rootNode=this._dataGrid.rootNode();var children=rootNode.children;event.consume(true);this.deleteButton.visible=true;for(var i=0;i<children.length;++i)
|
| if(children[i].data.key===storageData.key)
|
| -return;var childNode=new WebInspector.DataGridNode({key:storageData.key,value:storageData.value},false);rootNode.insertChild(childNode,children.length-1);},_domStorageItemUpdated:function(event)
|
| +return;var childNode=new WebInspector.DataGridNode({key:storageData.key,value:storageData.newValue},false);rootNode.insertChild(childNode,children.length-1);},_domStorageItemUpdated:function(event)
|
| {if(!this.isShowing()||!this._dataGrid)
|
| return;var storageData=event.data;var rootNode=this._dataGrid.rootNode();var children=rootNode.children;event.consume(true);var keyFound=false;for(var i=0;i<children.length;++i){var childNode=children[i];if(childNode.data.key===storageData.key){if(keyFound){rootNode.removeChild(childNode);return;}
|
| -keyFound=true;if(childNode.data.value!==storageData.value){childNode.data.value=storageData.value;childNode.refresh();childNode.select();childNode.reveal();}
|
| +keyFound=true;if(childNode.data.value!==storageData.newValue){childNode.data.value=storageData.newValue;childNode.refresh();childNode.select();childNode.reveal();}
|
| this.deleteButton.visible=true;}}},_update:function()
|
| {this.detachChildViews();this.domStorage.getItems(this._showDOMStorageItems.bind(this));},_showDOMStorageItems:function(error,items)
|
| {if(error)
|
| @@ -244,7 +246,9 @@
|
| this._cachedResourcesLoaded();WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.Load,this._loadEventFired,this);WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded,this._cachedResourcesLoaded,this);WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources,this._resetWithFrames,this);WebInspector.databaseModel.databases().forEach(this._addDatabase.bind(this));WebInspector.databaseModel.addEventListener(WebInspector.DatabaseModel.Events.DatabaseAdded,this._databaseAdded,this);}
|
| WebInspector.ResourcesPanel.prototype={get statusBarItems()
|
| {return[this.storageViewStatusBarItemsContainer];},wasShown:function()
|
| -{WebInspector.Panel.prototype.wasShown.call(this);this._initialize();},_initialize:function()
|
| +{WebInspector.Panel.prototype.wasShown.call(this);this._initialize();},handleShortcut:function(event)
|
| +{if(this.visibleView&&typeof this.visibleView.handleShortcut==="function")
|
| +return this.visibleView.handleShortcut(event);},_initialize:function()
|
| {if(!this._initialized&&this.isShowing()&&this._cachedResourcesWereLoaded){this._populateResourceTree();this._populateDOMStorageTree();this._populateApplicationCacheTree();this._initDefaultSelection();this._initialized=true;}},_loadEventFired:function()
|
| {this._initDefaultSelection();},_initDefaultSelection:function()
|
| {if(!this._initialized)
|
| @@ -307,7 +311,7 @@
|
| this._innerShowView(view);},showIndexedDB:function(view)
|
| {this._innerShowView(view);},_showDOMStorage:function(domStorage)
|
| {if(!domStorage)
|
| -return;var view;view=this._domStorageViews.get(domStorage);if(!view){view=new WebInspector.DOMStorageItemsView(domStorage);this._domStorageViews.put(domStorage,view);}
|
| +return;var view;view=this._domStorageViews.get(domStorage);if(!view){view=new WebInspector.DOMStorageItemsView(domStorage,WebInspector.domStorageModel);this._domStorageViews.put(domStorage,view);}
|
| this._innerShowView(view);},showCookies:function(treeElement,cookieDomain)
|
| {var view=this._cookieViews[cookieDomain];if(!view){view=new WebInspector.CookieItemsView(treeElement,cookieDomain);this._cookieViews[cookieDomain]=view;}
|
| this._innerShowView(view);},clearCookies:function(cookieDomain)
|
| @@ -467,7 +471,8 @@
|
| {WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);if(this._resource.type===WebInspector.resourceTypes.Image){var previewImage=document.createElement("img");previewImage.className="image-resource-icon-preview";this._resource.populateImageSource(previewImage);var iconElement=document.createElement("div");iconElement.className="icon";iconElement.appendChild(previewImage);this.listItemElement.replaceChild(iconElement,this.imageElement);}
|
| this._statusElement=document.createElement("div");this._statusElement.className="status";this.listItemElement.insertBefore(this._statusElement,this.titleElement);this.listItemElement.draggable=true;this.listItemElement.addEventListener("dragstart",this._ondragstart.bind(this),false);this.listItemElement.addEventListener("contextmenu",this._handleContextMenuEvent.bind(this),true);this._updateErrorsAndWarningsBubbles();},_ondragstart:function(event)
|
| {event.dataTransfer.setData("text/plain",this._resource.content);event.dataTransfer.effectAllowed="copy";return true;},_handleContextMenuEvent:function(event)
|
| -{var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendApplicableItems(this._resource);contextMenu.show();},_setBubbleText:function(x)
|
| +{var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendApplicableItems(this._resource);if(this._resource.request)
|
| +contextMenu.appendApplicableItems(this._resource.request);contextMenu.show();},_setBubbleText:function(x)
|
| {if(!this._bubbleElement){this._bubbleElement=document.createElement("div");this._bubbleElement.className="bubble";this._statusElement.appendChild(this._bubbleElement);}
|
| this._bubbleElement.textContent=x;},_resetBubble:function()
|
| {if(this._bubbleElement){this._bubbleElement.textContent="";this._bubbleElement.removeStyleClass("search-matches");this._bubbleElement.removeStyleClass("warning");this._bubbleElement.removeStyleClass("error");}},_resetSearchResults:function()
|
|
|