OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 WebInspector.DataGridNode.call(this, data); | 94 WebInspector.DataGridNode.call(this, data); |
95 this._entry = entry; | 95 this._entry = entry; |
96 this._metadata = null; | 96 this._metadata = null; |
97 | 97 |
98 this._entry.requestMetadata(this._metadataReceived.bind(this)); | 98 this._entry.requestMetadata(this._metadataReceived.bind(this)); |
99 } | 99 } |
100 | 100 |
101 /** | 101 /** |
102 * @param {string} column | 102 * @param {string} column |
103 * @param {boolean} reverse | 103 * @param {boolean} reverse |
104 * @return {function(*, *):number|undefined} | |
aandrey
2014/06/17 11:33:54
why * instead of types?
apavlov
2014/06/17 12:46:03
Done.
| |
104 */ | 105 */ |
105 WebInspector.DirectoryContentView.Node.comparator = function(column, reverse) | 106 WebInspector.DirectoryContentView.Node.comparator = function(column, reverse) |
106 { | 107 { |
107 var reverseFactor = reverse ? -1 : 1; | 108 var reverseFactor = reverse ? -1 : 1; |
108 const indexes = WebInspector.DirectoryContentView.columnIndexes; | 109 const indexes = WebInspector.DirectoryContentView.columnIndexes; |
109 | 110 |
110 switch (column) { | 111 switch (column) { |
111 case indexes.Name: | 112 case indexes.Name: |
112 case indexes.URL: | 113 case indexes.URL: |
113 return function(x, y) | 114 return function(x, y) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 if (this._entry.isDirectory) | 176 if (this._entry.isDirectory) |
176 data[indexes.Size] = WebInspector.UIString("-"); | 177 data[indexes.Size] = WebInspector.UIString("-"); |
177 else | 178 else |
178 data[indexes.Size] = Number.bytesToString(metadata.size); | 179 data[indexes.Size] = Number.bytesToString(metadata.size); |
179 data[indexes.ModificationTime] = new Date(metadata.modificationTime).toI SOString(); | 180 data[indexes.ModificationTime] = new Date(metadata.modificationTime).toI SOString(); |
180 this.data = data; | 181 this.data = data; |
181 }, | 182 }, |
182 | 183 |
183 __proto__: WebInspector.DataGridNode.prototype | 184 __proto__: WebInspector.DataGridNode.prototype |
184 } | 185 } |
OLD | NEW |