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 /** | 10 /** |
| 11 * @const | 11 * @const |
| 12 * @type {!Array.<!Object, string>} | 12 * @type {!Array.<!Object, string>} |
| 13 */ | 13 */ |
| 14 WebInspector.DocumentationURLProvider._Sources = [ | 14 WebInspector.DocumentationURLProvider._Sources = [ |
| 15 { source: window, url: "javascript/" }, | 15 { source: window, url: "javascript/" }, |
| 16 { source: window.Node.prototype, url: "dom/Node/" }, | 16 { source: window.Node.prototype, url: "dom/Node/" }, |
| 17 { source: window.Node, url: "dom/Node/" }, | |
| 18 { source: window.Object.prototype, url: "javascript/Object/" }, | |
| 17 { source: window.Object, url: "javascript/Object/" }, | 19 { source: window.Object, url: "javascript/Object/" }, |
| 18 { source: window.Math, url: "javascript/Math/" }, | 20 { source: window.Math, url: "javascript/Math/" }, |
| 21 { source: window.Array.prototype, url: "javascript/Array/" }, | |
| 19 { source: window.Array, url: "javascript/Array/" }, | 22 { source: window.Array, url: "javascript/Array/" }, |
| 23 { source: window.String.prototype, url: "javascript/String/" }, | |
| 20 { source: window.String, url: "javascript/String/" }, | 24 { source: window.String, url: "javascript/String/" }, |
| 25 { source: window.Date.prototype, url: "javascript/Date/" }, | |
| 21 { source: window.Date, url: "javascript/Date/" }, | 26 { source: window.Date, url: "javascript/Date/" }, |
| 22 { source: window.JSON, url: "javascript/JSON/" } | 27 { source: window.JSON, url: "javascript/JSON/" } |
| 23 ] | 28 ] |
|
lushnikov
2014/08/11 09:42:49
missing semicolon
iliia
2014/08/11 12:17:53
Done.
| |
| 24 | 29 |
| 25 /** | 30 /** |
| 26 * @const | 31 * @const |
| 27 */ | 32 */ |
| 28 WebInspector.DocumentationURLProvider._URLFormat = "http://docs.webplatform.org/ w/api.php?action=query&titles=%s%s&prop=revisions&rvprop=timestamp|content&forma t=json" | 33 WebInspector.DocumentationURLProvider._URLFormat = "http://docs.webplatform.org/ w/api.php?action=query&titles=%s%s&prop=revisions&rvprop=timestamp|content&forma t=json" |
| 29 | 34 |
| 30 WebInspector.DocumentationURLProvider.prototype = { | 35 WebInspector.DocumentationURLProvider.prototype = { |
| 31 /** | 36 /** |
| 32 * @param {string} searchTerm | 37 * @param {string} searchTerm |
| 33 * @return {?string} | 38 * @return {?string} |
| 34 */ | 39 */ |
| 35 itemPath: function(searchTerm) | 40 itemPath: function(searchTerm) |
| 36 { | 41 { |
| 37 for (var i = 0; i < WebInspector.DocumentationURLProvider._Sources.lengt h; ++i) { | 42 for (var i = 0; i < WebInspector.DocumentationURLProvider._Sources.lengt h; ++i) { |
| 38 var sourceRef = WebInspector.DocumentationURLProvider._Sources[i]; | 43 var sourceRef = WebInspector.DocumentationURLProvider._Sources[i]; |
| 39 if (sourceRef.source[searchTerm] instanceof Function) | 44 if (sourceRef.source[searchTerm] instanceof Function) |
| 40 return String.sprintf(WebInspector.DocumentationURLProvider._URL Format, sourceRef.url, searchTerm); | 45 return String.sprintf(WebInspector.DocumentationURLProvider._URL Format, sourceRef.url, searchTerm); |
| 41 } | 46 } |
| 42 return null; | 47 return null; |
| 43 } | 48 } |
| 44 } | 49 } |
| OLD | NEW |