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

Unified Diff: Source/devtools/front_end/documentation/DocumentationURLFormer.js

Issue 447703002: DocumentationURLProvider class created (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@semen
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/documentation/DocumentationURLFormer.js
diff --git a/Source/devtools/front_end/documentation/DocumentationURLFormer.js b/Source/devtools/front_end/documentation/DocumentationURLFormer.js
new file mode 100644
index 0000000000000000000000000000000000000000..f44a2575372dfb48505adfdae337e96528241bea
--- /dev/null
+++ b/Source/devtools/front_end/documentation/DocumentationURLFormer.js
@@ -0,0 +1,33 @@
+/**
lushnikov 2014/08/06 11:25:18 LICENSE is missing
semeny 2014/08/06 17:17:30 Done.
+ * @constructor
+ */
+WebInspector.DocumentationURLFormer = function() {}
lushnikov 2014/08/06 11:25:18 DocumentationURLProvider?
semeny 2014/08/06 17:17:29 Done.
+
+WebInspector.DocumentationURLFormer.prototype = {
+ /**
+ * @param {string} searchTerm
+ * @return {string}
+ */
+ formItemPath: function(searchTerm)
+ {
+ for (var i = 0; i < this._Sources.length; i++) {
lushnikov 2014/08/06 11:25:17 Our codestyle requires ++i
semeny 2014/08/06 17:17:29 Done.
+ var source = this._Sources[i].source;
+ var url = this._Sources[i].url;
+ if (source[searchTerm] instanceof Function)
+ return "http://docs.webplatform.org/w/api.php?action=query&titles=" + url
lushnikov 2014/08/06 11:25:18 use String.sprintf
semeny 2014/08/06 17:17:29 Done.
+ + searchTerm + "&prop=revisions&rvprop=timestamp|content&format=json";
+ }
+ return "NONE";
lushnikov 2014/08/06 11:25:17 return null;
semeny 2014/08/06 17:17:29 Done.
+ },
+
+ _Sources: [
lushnikov 2014/08/06 11:25:17 This should be a field on WebInspector.Documentati
semeny 2014/08/06 17:17:30 Done.
+ {source: window, url: "javascript/"},
+ {source: window.Node.prototype, url: "dom/Node/"},
+ {source: window.Object, url: "javascript/Object/"},
+ {source: window.Math, url: "javascript/Math/"},
+ {source: window.Array, url: "javascript/Array/"},
+ {source: window.String, url: "javascript/String/"},
+ {source: window.Date, url: "javascript/Date/"},
+ {source: window.JSON, url: "javascript/JSON/"}
+ ]
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698