| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2008 Nokia Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 if (error) | 175 if (error) |
| 176 return; | 176 return; |
| 177 | 177 |
| 178 this._dataGrid = this._dataGridForDOMStorageItems(items); | 178 this._dataGrid = this._dataGridForDOMStorageItems(items); |
| 179 this._dataGrid.asWidget().show(this.element); | 179 this._dataGrid.asWidget().show(this.element); |
| 180 this.deleteButton.setVisible(this._dataGrid.rootNode().children.length >
1); | 180 this.deleteButton.setVisible(this._dataGrid.rootNode().children.length >
1); |
| 181 }, | 181 }, |
| 182 | 182 |
| 183 _dataGridForDOMStorageItems: function(items) | 183 _dataGridForDOMStorageItems: function(items) |
| 184 { | 184 { |
| 185 var columns = [ | 185 var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>
} */ ([ |
| 186 {id: "key", title: WebInspector.UIString("Key"), editable: true, wei
ght: 50}, | 186 {id: "key", title: WebInspector.UIString("Key"), sortable: false, ed
itable: true, weight: 50}, |
| 187 {id: "value", title: WebInspector.UIString("Value"), editable: true,
weight: 50} | 187 {id: "value", title: WebInspector.UIString("Value"), sortable: false
, editable: true, weight: 50} |
| 188 ]; | 188 ]); |
| 189 | 189 |
| 190 var nodes = []; | 190 var nodes = []; |
| 191 | 191 |
| 192 var keys = []; | 192 var keys = []; |
| 193 var length = items.length; | 193 var length = items.length; |
| 194 for (var i = 0; i < items.length; i++) { | 194 for (var i = 0; i < items.length; i++) { |
| 195 var key = items[i][0]; | 195 var key = items[i][0]; |
| 196 var value = items[i][1]; | 196 var value = items[i][1]; |
| 197 var node = new WebInspector.DataGridNode({key: key, value: value}, f
alse); | 197 var node = new WebInspector.DataGridNode({key: key, value: value}, f
alse); |
| 198 node.selectable = true; | 198 node.selectable = true; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 { | 254 { |
| 255 if (!node || node.isCreationNode) | 255 if (!node || node.isCreationNode) |
| 256 return; | 256 return; |
| 257 | 257 |
| 258 if (this.domStorage) | 258 if (this.domStorage) |
| 259 this.domStorage.removeItem(node.data.key); | 259 this.domStorage.removeItem(node.data.key); |
| 260 }, | 260 }, |
| 261 | 261 |
| 262 __proto__: WebInspector.SimpleView.prototype | 262 __proto__: WebInspector.SimpleView.prototype |
| 263 } | 263 } |
| OLD | NEW |