Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /** | |
| 2 * Takes the |moduleListData| input argument which represents data about | |
|
James Hawkins
2012/08/09 17:16:55
Indentation is off, should be two more spaces.
jvoung (off chromium)
2012/08/09 20:03:35
double checking on two more spaces:
/**
*
*/
James Hawkins
2012/08/11 19:24:28
Sorry, the latter.
| |
| 3 * the currently available modules and populates the html jstemplate | |
| 4 * with that data. It expects an object structure like the above. | |
| 5 * @param {Object} moduleListData Information about available modules | |
| 6 */ | |
| 7 function renderTemplate(moduleListData) { | |
|
James Hawkins
2012/08/09 17:16:55
These need to be wrapped in a namespace.
jvoung (off chromium)
2012/08/09 20:03:35
Done.
| |
| 8 // This is the javascript code that processes the template: | |
|
James Hawkins
2012/08/09 17:16:55
nit: // Process the template.
jvoung (off chromium)
2012/08/09 20:03:35
Done.
| |
| 9 var input = new JsEvalContext(moduleListData); | |
| 10 var output = document.getElementById('naclInfoTemplate'); | |
| 11 jstProcess(input, output); | |
| 12 } | |
| 13 | |
| 14 /** | |
| 15 * Asks the C++ NaClUIDOMHandler to get details about the NaCl and return | |
| 16 * the data in returnNaClInfo() (below). | |
| 17 */ | |
| 18 function requestNaClInfo() { | |
| 19 chrome.send('requestNaClInfo'); | |
| 20 } | |
| 21 | |
| 22 /** | |
| 23 * Called by the WebUI to re-populate the page with data representing the | |
| 24 * current state of NaCl. | |
| 25 * @param {Object} moduleListData Information about available modules | |
| 26 */ | |
| 27 function returnNaClInfo(moduleListData) { | |
| 28 document.getElementById('loading-message').style.visibility = 'hidden'; | |
| 29 document.getElementById('body-container').style.visibility = 'visible'; | |
| 30 renderTemplate(moduleListData); | |
| 31 } | |
| 32 | |
| 33 // Get data and have it displayed upon loading. | |
| 34 document.addEventListener('DOMContentLoaded', requestNaClInfo); | |
| OLD | NEW |