Changeset 244350 in webkit
- Timestamp:
- Apr 16, 2019 12:02:23 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r244327 r244350 1 2019-04-16 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Storage: values truncated in Local/Session table 4 https://bugs.webkit.org/show_bug.cgi?id=178318 5 <rdar://problem/34998581> 6 7 Reviewed by Joseph Pecoraro. 8 9 * UserInterface/Views/DataGrid.js: 10 (WI.DataGrid): 11 (WI.DataGrid.prototype._copyTextForDataGridNode): 12 * UserInterface/Views/TimelineDataGrid.js: 13 (WI.TimelineDataGrid): 14 Refactor `WI.DataGrid` constructor to allow for more optional arguments. 15 Introduce a new optional argument `copyCallback` that can be used to override the text that 16 would be copied for any `WI.DataGridNode` in any column. 17 18 * UserInterface/Views/DOMStorageContentView.js: 19 (WI.DOMStorageContentView): 20 (WI.DOMStorageContentView.prototype.itemAdded): 21 (WI.DOMStorageContentView.prototype.itemUpdated): 22 (WI.DOMStorageContentView.prototype._populate): 23 (WI.DOMStorageContentView.prototype._dataGridCopy): Added. 24 Save the full non-truncated value as part of the `WI.DataGridNode`'s `data`. When copying, 25 use the full non-truncated value instead of what was shown in the DOM. 26 1 27 2019-04-15 Joseph Pecoraro <pecoraro@apple.com> 2 28 -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.js
r220119 r244350 42 42 columns.value = {title: WI.UIString("Value"), sortable: true}; 43 43 44 this._dataGrid = new WI.DataGrid(columns, this._editingCallback.bind(this), this._deleteCallback.bind(this)); 44 this._dataGrid = new WI.DataGrid(columns, { 45 editingCallback: this._editingCallback.bind(this), 46 copyCallback: this._dataGridCopy.bind(this), 47 deleteCallback: this._deleteCallback.bind(this), 48 }); 45 49 this._dataGrid.sortOrder = WI.DataGrid.SortOrder.Ascending; 46 50 this._dataGrid.sortColumnIdentifier = "key"; … … 86 90 { 87 91 let {key, value} = event.data; 92 let originalValue = value; 88 93 value = this._truncateValue(value); 89 94 … … 94 99 } 95 100 96 this._dataGrid.appendChild(new WI.DataGridNode({key, value }, false));101 this._dataGrid.appendChild(new WI.DataGridNode({key, value, originalValue}, false)); 97 102 this._sortDataGrid(); 98 103 } … … 101 106 { 102 107 let {key, value} = event.data; 108 let originalValue = value; 103 109 value = this._truncateValue(value); 104 110 … … 114 120 keyFound = true; 115 121 childNode.data.value = value; 122 childNode.data.originalValue = originalValue; 116 123 childNode.refresh(); 117 124 } … … 137 144 continue; 138 145 146 let originalValue = value; 139 147 value = this._truncateValue(value); 140 let node = new WI.DataGridNode({key, value }, false);148 let node = new WI.DataGridNode({key, value, originalValue}, false); 141 149 this._dataGrid.appendChild(node); 142 150 } … … 254 262 domStorage.setItem(key, value); 255 263 } 264 265 _dataGridCopy(node, columnIdentifier, text) 266 { 267 if (columnIdentifier === "value" && node.data.originalValue) 268 return node.data.originalValue; 269 return text; 270 } 256 271 }; 257 272 -
trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js
r242174 r244350 26 26 WI.DataGrid = class DataGrid extends WI.View 27 27 { 28 constructor(columnsData, editCallback, deleteCallback, preferredColumnOrder)28 constructor(columnsData, {editCallback, copyCallback, deleteCallback, preferredColumnOrder} = {}) 29 29 { 30 30 super(); … … 110 110 } 111 111 112 if (copyCallback) 113 this._copyCallback = copyCallback; 114 112 115 if (deleteCallback) 113 116 this._deleteCallback = deleteCallback; … … 169 172 } 170 173 171 var dataGrid = new WI.DataGrid(columnsData, undefined, undefined, columnNames);174 let dataGrid = new WI.DataGrid(columnsData, {preferredColumnOrder: columnNames}); 172 175 for (var i = 0; i < values.length / numColumns; ++i) { 173 176 var data = {}; … … 1698 1701 _copyTextForDataGridNode(node) 1699 1702 { 1700 let fields = node.dataGrid.orderedColumns.map((identifier) => this.textForDataGridNodeColumn(node, identifier)); 1703 let fields = node.dataGrid.orderedColumns.map((identifier) => { 1704 let text = this.textForDataGridNodeColumn(node, identifier); 1705 if (this._copyCallback) 1706 text = this._copyCallback(node, identifier, text); 1707 return text; 1708 }); 1701 1709 return fields.join(this._copyTextDelimiter); 1702 1710 } -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js
r238483 r244350 26 26 WI.TimelineDataGrid = class TimelineDataGrid extends WI.DataGrid 27 27 { 28 constructor(columns , editCallback, deleteCallback)29 { 30 super(columns , editCallback, deleteCallback);28 constructor(columns) 29 { 30 super(columns); 31 31 32 32 this.element.classList.add("timeline");
Note: See TracChangeset
for help on using the changeset viewer.