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/"} |
+ ] |
+} |