Chromium Code Reviews| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 break; | 245 break; |
| 246 case elementTypes.PlainText: | 246 case elementTypes.PlainText: |
| 247 element = document.createElement("span"); | 247 element = document.createElement("span"); |
| 248 element.textContent = article.text(); | 248 element.textContent = article.text(); |
| 249 if (article.isHighlighted()) | 249 if (article.isHighlighted()) |
| 250 element.classList.add("documentation-highlighted-text"); | 250 element.classList.add("documentation-highlighted-text"); |
| 251 break; | 251 break; |
| 252 default: | 252 default: |
| 253 console.error("Unknown ArticleElement type " + article.type()); | 253 console.error("Unknown ArticleElement type " + article.type()); |
| 254 case elementTypes.Block: | 254 case elementTypes.Block: |
| 255 element = document.createElement("p"); | 255 element = document.createElement(article.hasBullet() ? "li" : "p"); |
|
lushnikov
2014/09/04 16:27:16
rendering only <li> elements without any <ul>/<ol>
| |
| 256 break; | 256 break; |
| 257 } | 257 } |
| 258 | 258 |
| 259 if (article instanceof WebInspector.WikiParser.Block || article instance of WebInspector.WikiParser.Inline) { | 259 if (article instanceof WebInspector.WikiParser.Block || article instance of WebInspector.WikiParser.Inline) { |
| 260 for (var i = 0; i < article.children().length; ++i) { | 260 for (var i = 0; i < article.children().length; ++i) { |
| 261 var child = this._renderBlock(article.children()[i]); | 261 var child = this._renderBlock(article.children()[i]); |
| 262 if (child) | 262 if (child) |
| 263 element.appendChild(child); | 263 element.appendChild(child); |
| 264 } | 264 } |
| 265 } | 265 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 328 function computeDescriptors(column) | 328 function computeDescriptors(column) |
| 329 { | 329 { |
| 330 var token = textEditor.tokenAtTextPosition(textSelection.startLine, column); | 330 var token = textEditor.tokenAtTextPosition(textSelection.startLine, column); |
| 331 if (!token) | 331 if (!token) |
| 332 return []; | 332 return []; |
| 333 var tokenText = textEditor.line(textSelection.startLine).substring(t oken.startColumn, token.endColumn); | 333 var tokenText = textEditor.line(textSelection.startLine).substring(t oken.startColumn, token.endColumn); |
| 334 return urlProvider.itemDescriptors(tokenText); | 334 return urlProvider.itemDescriptors(tokenText); |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 } | 337 } |
| OLD | NEW |