| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 * This variable structure is here to document the structure that the template | 6 * This variable structure is here to document the structure that the template |
| 7 * expects to correctly populate the page. | 7 * expects to correctly populate the page. |
| 8 */ | 8 */ |
| 9 var moduleListDataFormat = { | 9 var moduleListDataFormat = { |
| 10 'moduleList': [ | 10 'moduleList': [{ |
| 11 { | |
| 12 'type': 'The type of module found', | 11 'type': 'The type of module found', |
| 13 'type_description': | 12 'type_description': |
| 14 'The type of module (string), defaults to blank for regular modules', | 13 'The type of module (string), defaults to blank for regular modules', |
| 15 'status': 'The module status', | 14 'status': 'The module status', |
| 16 'location': 'The module path, not including filename', | 15 'location': 'The module path, not including filename', |
| 17 'name': 'The name of the module', | 16 'name': 'The name of the module', |
| 18 'product_name': 'The name of the product the module belongs to', | 17 'product_name': 'The name of the product the module belongs to', |
| 19 'description': 'The module description', | 18 'description': 'The module description', |
| 20 'version': 'The module version', | 19 'version': 'The module version', |
| 21 'digital_signer': 'The signer of the digital certificate for the module', | 20 'digital_signer': 'The signer of the digital certificate for the module', |
| 22 'recommended_action': 'The help tips bitmask', | 21 'recommended_action': 'The help tips bitmask', |
| 23 'possible_resolution': 'The help tips in string form', | 22 'possible_resolution': 'The help tips in string form', |
| 24 'help_url': 'The link to the Help Center article' | 23 'help_url': 'The link to the Help Center article' |
| 25 } | 24 }] |
| 26 ] | |
| 27 }; | 25 }; |
| 28 | 26 |
| 29 /** | 27 /** |
| 30 * Takes the |moduleListData| input argument which represents data about | 28 * Takes the |moduleListData| input argument which represents data about |
| 31 * the currently available modules and populates the html jstemplate | 29 * the currently available modules and populates the html jstemplate |
| 32 * with that data. It expects an object structure like the above. | 30 * with that data. It expects an object structure like the above. |
| 33 * @param {Object} moduleListData Information about available modules. | 31 * @param {Object} moduleListData Information about available modules. |
| 34 */ | 32 */ |
| 35 function renderTemplate(moduleListData) { | 33 function renderTemplate(moduleListData) { |
| 36 // This is the javascript code that processes the template: | 34 // This is the javascript code that processes the template: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 54 * @param {Object} moduleListData Information about available modules. | 52 * @param {Object} moduleListData Information about available modules. |
| 55 */ | 53 */ |
| 56 function returnModuleList(moduleListData) { | 54 function returnModuleList(moduleListData) { |
| 57 renderTemplate(moduleListData); | 55 renderTemplate(moduleListData); |
| 58 $('loading-message').style.visibility = 'hidden'; | 56 $('loading-message').style.visibility = 'hidden'; |
| 59 $('body-container').style.visibility = 'visible'; | 57 $('body-container').style.visibility = 'visible'; |
| 60 } | 58 } |
| 61 | 59 |
| 62 // Get data and have it displayed upon loading. | 60 // Get data and have it displayed upon loading. |
| 63 document.addEventListener('DOMContentLoaded', requestModuleListData); | 61 document.addEventListener('DOMContentLoaded', requestModuleListData); |
| OLD | NEW |