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 */ | 7 */ |
8 WebInspector.JSArticle = function() | 8 WebInspector.JSArticle = function() |
9 { | 9 { |
10 /** @type {string} */ | 10 /** @type {string} */ |
11 this.pageTitle; | 11 this.pageTitle; |
12 /** @type {string} */ | 12 /** @type {string} */ |
13 this.standardizationStatus; | 13 this.standardizationStatus; |
14 /** @type {string} */ | 14 /** @type {string} */ |
15 this.summary; | 15 this.summary; |
16 /** @type {!Object.<string, ?Array.<!Object.<string> > >} */ | 16 /** @type {!Object.<string, ?Array.<!Object.<string>>>} */ |
17 this.methods; | 17 this.methods; |
18 /** @type {string} */ | 18 /** @type {string} */ |
19 this.remarks; | 19 this.remarks; |
20 } | 20 } |
21 | 21 |
22 /** | 22 /** |
23 * @param {string} wikiMarkupText | 23 * @param {string} wikiMarkupText |
24 * @return {!WebInspector.JSArticle} | 24 * @return {!WebInspector.JSArticle} |
25 */ | 25 */ |
26 WebInspector.JSArticle.parse = function(wikiMarkupText) | 26 WebInspector.JSArticle.parse = function(wikiMarkupText) |
27 { | 27 { |
28 var wikiParser = new WebInspector.WikiParser(wikiMarkupText); | 28 var wikiParser = new WebInspector.WikiParser(wikiMarkupText); |
29 var from = wikiParser.document(); | 29 var wikiDocument = wikiParser.document(); |
30 | 30 |
31 var article = new WebInspector.JSArticle(); | 31 var article = new WebInspector.JSArticle(); |
32 if (typeof from["Page_Title"] !== "undefined" && from["Page_Title"] !== {}) | 32 if (typeof wikiDocument["Page_Title"] !== "undefined" && wikiDocument["Page_
Title"] !== {}) |
33 article.pageTitle = from["Page_Title"]; | 33 article.pageTitle = wikiDocument["Page_Title"]; |
34 if (typeof from["Standardization_Status"] !== "undefined") | 34 if (typeof wikiDocument["Standardization_Status"] !== "undefined") |
35 article.standardizationStatus = from["Standardization_Status"]; | 35 article.standardizationStatus = wikiDocument["Standardization_Status"]; |
36 if (typeof from["Summary_Section"] !== "undefined") | 36 if (typeof wikiDocument["Summary_Section"] !== "undefined") |
37 article.summary = from["Summary_Section"]; | 37 article.summary = wikiDocument["Summary_Section"]; |
38 if (typeof from["API_Object_Method"] !== "undefined") | 38 if (typeof wikiDocument["API_Object_Method"] !== "undefined") |
39 article.methods = from["API_Object_Method"]; | 39 article.methods = wikiDocument["API_Object_Method"]; |
40 if (typeof from["Remarks_Section"] !== "undefined") | 40 if (typeof wikiDocument["Remarks_Section"] !== "undefined") |
41 article.remarks = from["Remarks_Section"]; | 41 article.remarks = wikiDocument["Remarks_Section"]; |
42 | 42 |
43 return article; | 43 return article; |
44 } | 44 } |
45 | 45 |
OLD | NEW |