Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 */ | 7 */ |
| 8 WebInspector.DocumentationURLProvider = function() | 8 WebInspector.DocumentationURLProvider = function() |
| 9 { | 9 { |
| 10 this._gapFromIndex = 0; | 10 this._gapFromIndex = 0; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 }, | 226 }, |
| 227 | 227 |
| 228 /** | 228 /** |
| 229 * @param {string} itemPath | 229 * @param {string} itemPath |
| 230 */ | 230 */ |
| 231 _addDescriptorToList: function(itemPath) | 231 _addDescriptorToList: function(itemPath) |
| 232 { | 232 { |
| 233 var lastSlashIndex = itemPath.lastIndexOf("/"); | 233 var lastSlashIndex = itemPath.lastIndexOf("/"); |
| 234 if (lastSlashIndex === -1) | 234 if (lastSlashIndex === -1) |
| 235 return; | 235 return; |
| 236 var sourceName = itemPath.substring(0, lastSlashIndex + 1); | 236 var sourceName = itemPath.substring(0, lastSlashIndex + 1).replace(" ", "_"); |
|
lushnikov
2014/09/03 15:24:51
what is this for?
semeny
2014/09/03 15:34:27
Done.
| |
| 237 // There are some properties which have several words in their name. | 237 // There are some properties which have several words in their name. |
| 238 // In article list they are written through gap, while in URL they are w ritten through underscore. | 238 // In article list they are written through gap, while in URL they are w ritten through underscore. |
| 239 // We are creating URL for current property, so we have to replace all t he gaps with underscores. | 239 // We are creating URL for current property, so we have to replace all t he gaps with underscores. |
| 240 var propertyName = itemPath.substring(lastSlashIndex + 1).replace(" ", " _"); | 240 var propertyName = itemPath.substring(lastSlashIndex + 1).replace(" ", " _"); |
| 241 var sources = WebInspector.DocumentationURLProvider._sources; | 241 var sources = WebInspector.DocumentationURLProvider._sources; |
| 242 for (var i = 0; i < sources.length; ++i) { | 242 for (var i = 0; i < sources.length; ++i) { |
| 243 if (sources[i].url() !== sourceName || !sources[i].source().hasOwnPr operty(propertyName)) | 243 if (sources[i].url() !== sourceName || !sources[i].source().hasOwnPr operty(propertyName)) |
| 244 continue; | 244 continue; |
| 245 var descriptors = this._articleList.get(propertyName) || []; | 245 var descriptors = this._articleList.get(propertyName) || []; |
| 246 descriptors.push(new WebInspector.DocumentationURLProvider.ItemDescr iptor(sources[i], propertyName)); | 246 descriptors.push(new WebInspector.DocumentationURLProvider.ItemDescr iptor(sources[i], propertyName)); |
| 247 this._articleList.set(propertyName, descriptors); | 247 this._articleList.set(propertyName, descriptors); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 } | 250 } |
| OLD | NEW |