| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.View} | 7 * @extends {WebInspector.View} |
| 8 */ | 8 */ |
| 9 WebInspector.DocumentationView = function() | 9 WebInspector.DocumentationView = function() |
| 10 { | 10 { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 var article = WebInspector.JSArticle.parse(wikiMarkupText); | 60 var article = WebInspector.JSArticle.parse(wikiMarkupText); |
| 61 if (!article) | 61 if (!article) |
| 62 return; | 62 return; |
| 63 var renderer = new WebInspector.DocumentationView.Renderer(article, sear
chItem); | 63 var renderer = new WebInspector.DocumentationView.Renderer(article, sear
chItem); |
| 64 this.element.appendChild(renderer.renderJSArticle()); | 64 this.element.appendChild(renderer.renderJSArticle()); |
| 65 }, | 65 }, |
| 66 | 66 |
| 67 _createEmptyPage: function() | 67 _createEmptyPage: function() |
| 68 { | 68 { |
| 69 this.element.textContent = ""; | 69 this.element.textContent = ""; |
| 70 var pageTitle = this.element.createChild("div", "documentation-page-titl
e"); | 70 var pageTitle = this.element.createChild("div", "documentation-not-found
"); |
| 71 pageTitle.textContent = "No documentation found"; | 71 pageTitle.textContent = "No documentation found."; |
| 72 }, | 72 }, |
| 73 | 73 |
| 74 __proto__: WebInspector.View.prototype | 74 __proto__: WebInspector.View.prototype |
| 75 } | 75 } |
| 76 /** | 76 /** |
| 77 * @constructor | 77 * @constructor |
| 78 * @param {!WebInspector.JSArticle} article | 78 * @param {!WebInspector.JSArticle} article |
| 79 * @param {string} searchItem | 79 * @param {string} searchItem |
| 80 */ | 80 */ |
| 81 WebInspector.DocumentationView.Renderer = function(article, searchItem) | 81 WebInspector.DocumentationView.Renderer = function(article, searchItem) |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 function computeDescriptors(column) | 318 function computeDescriptors(column) |
| 319 { | 319 { |
| 320 var token = textEditor.tokenAtTextPosition(textSelection.startLine,
column); | 320 var token = textEditor.tokenAtTextPosition(textSelection.startLine,
column); |
| 321 if (!token) | 321 if (!token) |
| 322 return []; | 322 return []; |
| 323 var tokenText = textEditor.line(textSelection.startLine).substring(t
oken.startColumn, token.endColumn); | 323 var tokenText = textEditor.line(textSelection.startLine).substring(t
oken.startColumn, token.endColumn); |
| 324 return urlProvider.itemDescriptors(tokenText); | 324 return urlProvider.itemDescriptors(tokenText); |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 } | 327 } |
| OLD | NEW |