| 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 ae798e3c0f9feba81659eb0a8650c8f634da279d..501a9d689c841e2ed282d32782d4a41c0edf822a 100644
|
| --- a/Source/devtools/front_end/documentation/DocumentationView.js
|
| +++ b/Source/devtools/front_end/documentation/DocumentationView.js
|
| @@ -6,3 +6,62 @@ importScript("WikiParser.js");
|
| importScript("JSArticle.js");
|
| importScript("CSSArticle.js");
|
| importScript("DocumentationURLProvider.js");
|
| +
|
| +/**
|
| + * @constructor
|
| + * @extends {WebInspector.VBox}
|
| + */
|
| +WebInspector.DocumentationView = function()
|
| +{
|
| + WebInspector.VBox.call(this);
|
| +}
|
| +
|
| +/**
|
| + * @param {string} searchTerm
|
| + */
|
| +WebInspector.DocumentationView.showSearchTerm = function(searchTerm)
|
| +{
|
| + if (!WebInspector.DocumentationView._view)
|
| + WebInspector.DocumentationView._view = new WebInspector.DocumentationView();
|
| + var view = WebInspector.DocumentationView._view;
|
| + WebInspector.inspectorView.showCloseableViewInDrawer("documentation", WebInspector.UIString("Documentation"), view);
|
| +}
|
| +
|
| +WebInspector.DocumentationView.prototype = {
|
| + __proto__: WebInspector.VBox.prototype
|
| +}
|
| +
|
| +/**
|
| + * @constructor
|
| + * @implements {WebInspector.ContextMenu.Provider}
|
| + */
|
| +WebInspector.DocumentationView.ContextMenuProvider = function()
|
| +{
|
| +}
|
| +
|
| +WebInspector.DocumentationView.ContextMenuProvider.prototype = {
|
| + /**
|
| + * @param {!Event} event
|
| + * @param {!WebInspector.ContextMenu} contextMenu
|
| + * @param {!Object} target
|
| + */
|
| + appendApplicableItems: function(event, contextMenu, target)
|
| + {
|
| + if (!(target instanceof WebInspector.CodeMirrorTextEditor))
|
| + return;
|
| + var textEditor = /** @type {!WebInspector.CodeMirrorTextEditor} */ (target);
|
| + contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Show documentation" : "Show Documentation"), this._showDocumentation.bind(this, textEditor));
|
| + },
|
| +
|
| + /**
|
| + * @param {!WebInspector.CodeMirrorTextEditor} textEditor
|
| + */
|
| + _showDocumentation: function(textEditor)
|
| + {
|
| + var selection = textEditor.selection();
|
| + if (!selection || selection.isEmpty())
|
| + return;
|
| + var selectedText = textEditor.copyRange(selection);
|
| + WebInspector.DocumentationView.showSearchTerm(selectedText);
|
| + }
|
| +}
|
|
|