Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: Source/devtools/front_end/documentation/DocumentationURLProvider.js

Issue 447703002: DocumentationURLProvider class created (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@semen
Patch Set: Files sorted by theirs names Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 /**
11 * @const
12 * @type {!Array.<!Object, string>}
13 */
14 WebInspector.DocumentationURLProvider._Sources = [
15 { source: window, url: "javascript/" },
16 { source: window.Node.prototype, url: "dom/Node/" },
17 { source: window.Object, url: "javascript/Object/" },
18 { source: window.Math, url: "javascript/Math/" },
19 { source: window.Array, url: "javascript/Array/" },
20 { source: window.String, url: "javascript/String/" },
21 { source: window.Date, url: "javascript/Date/" },
22 { source: window.JSON, url: "javascript/JSON/" }
23 ]
24
25 /**
26 * @const
27 */
28 WebInspector.DocumentationURLProvider._URLFormat = "http://docs.webplatform.org/ w/api.php?action=query&titles=%s%s&prop=revisions&rvprop=timestamp|content&forma t=json"
29
30 WebInspector.DocumentationURLProvider.prototype = {
31 /**
32 * @param {string} searchTerm
33 * @return {?string}
34 */
35 itemPath: function(searchTerm)
36 {
37 for (var i = 0; i < WebInspector.DocumentationURLProvider._Sources.lengt h; ++i) {
38 var sourceRef = WebInspector.DocumentationURLProvider._Sources[i];
39 if (sourceRef.source[searchTerm] instanceof Function)
40 return String.sprintf(WebInspector.DocumentationURLProvider._URL Format, sourceRef.url, searchTerm);
41 }
42 return null;
43 }
44 }
OLDNEW
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/documentation/DocumentationView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698