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

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

Issue 466743002: DevTools: Show doc context menu items for matching methods on all objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
Index: Source/devtools/front_end/documentation/DocumentationView.js
diff --git a/Source/devtools/front_end/documentation/DocumentationView.js b/Source/devtools/front_end/documentation/DocumentationView.js
index b3a440902d32712909c36ec74fdc36366db13c0f..6cbde4104cdc28b6638a1a1f25bfd249d80b4b98 100644
--- a/Source/devtools/front_end/documentation/DocumentationView.js
+++ b/Source/devtools/front_end/documentation/DocumentationView.js
@@ -12,9 +12,9 @@ WebInspector.DocumentationView = function()
}
/**
- * @param {string} searchTerm
+ * @param {string} searchURL
apavlov 2014/08/12 12:54:16 just "url"
semeny 2014/08/12 14:27:59 Done.
*/
-WebInspector.DocumentationView.showSearchTerm = function(searchTerm)
+WebInspector.DocumentationView.showSearchURL = function(searchURL)
apavlov 2014/08/12 12:54:17 showDocumentationURL() ?
semeny 2014/08/12 14:27:59 Done.
{
if (!WebInspector.DocumentationView._view)
WebInspector.DocumentationView._view = new WebInspector.DocumentationView();
@@ -50,9 +50,10 @@ WebInspector.DocumentationView.ContextMenuProvider.prototype = {
return;
var selectedText = textEditor.copyRange(selection);
var urlProvider = new WebInspector.DocumentationURLProvider();
- var itemPath = urlProvider.itemPath(selectedText);
- if (!itemPath)
- return;
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Show documentation" : "Show Documentation"), WebInspector.DocumentationView.showSearchTerm.bind(null, selectedText));
+ var possiblePaths = urlProvider.itemPath(selectedText);
+ for (var i = 0; i < possiblePaths.length; i++) {
apavlov 2014/08/12 12:54:16 we prefer the pre-increment across the code: ++i
semeny 2014/08/12 14:27:59 Done.
+ var contextMenuItemTitle = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Show documentation for " + possiblePaths[i].name : "Show Documentation for " + possiblePaths[i].name);
yurys 2014/08/12 12:50:00 Please use string sunstitution: WebInspector.UISt
apavlov 2014/08/12 12:54:17 This is a wrong way to use UIString. You should us
semeny 2014/08/12 14:27:59 Done.
+ contextMenu.appendItem(contextMenuItemTitle, WebInspector.DocumentationView.showSearchURL.bind(null, possiblePaths[i].url));
apavlov 2014/08/12 12:54:17 We seem to have agreed on having a submenu, not on
semeny 2014/08/12 14:27:59 Done.
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698