Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * @constructor | |
| 7 */ | |
| 8 WebInspector.DocumentationURLProvider = function() {} | |
| 9 | |
| 10 WebInspector.DocumentationURLProvider._Sources = [ | |
|
yurys
2014/08/07 08:27:37
Please add type annotation. Also it might make sen
semeny
2014/08/07 09:57:08
Done.
| |
| 11 {source: window, url: "javascript/"}, | |
|
lushnikov
2014/08/06 17:27:51
space after "{" and before "}"
semeny
2014/08/07 09:57:08
Done.
| |
| 12 {source: window.Node.prototype, url: "dom/Node/"}, | |
| 13 {source: window.Object, url: "javascript/Object/"}, | |
| 14 {source: window.Math, url: "javascript/Math/"}, | |
| 15 {source: window.Array, url: "javascript/Array/"}, | |
| 16 {source: window.String, url: "javascript/String/"}, | |
| 17 {source: window.Date, url: "javascript/Date/"}, | |
| 18 {source: window.JSON, url: "javascript/JSON/"} | |
| 19 ] | |
| 20 | |
| 21 WebInspector.DocumentationURLProvider.prototype = { | |
| 22 /** | |
| 23 * @param {string} searchTerm | |
| 24 * @return {?string} | |
| 25 */ | |
| 26 formItemPath: function(searchTerm) | |
|
yurys
2014/08/07 08:27:37
Just itemPath
semeny
2014/08/07 09:57:08
Done.
| |
| 27 { | |
| 28 for (var i = 0; i < WebInspector.DocumentationURLProvider._Sources.lengt h; ++i) { | |
| 29 var sourceRef = WebInspector.DocumentationURLProvider._Sources[i]; | |
| 30 if (sourceRef.source[searchTerm] instanceof Function) | |
| 31 return String.sprintf("http://docs.webplatform.org/w/api.php?act ion=query&titles=%s%s&prop=revisions&rvprop=timestamp|content&format=json", | |
|
lushnikov
2014/08/06 17:27:51
extract to constant
semeny
2014/08/07 09:57:08
Done.
| |
| 32 sourceRef.url, searchTerm); | |
| 33 } | |
| 34 return null; | |
| 35 } | |
| 36 } | |
| OLD | NEW |