Software /
code /
prosody-modules
Comparison
mod_conversejs/templates/template.js @ 4227:13b065432bf2
mod_conversejs: Comment on what's going on in JS template
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 23 Oct 2020 22:07:06 +0200 |
parent | 4165:6b2a1c9ef6e2 |
comparison
equal
deleted
inserted
replaced
4226:df2ccb42a241 | 4227:13b065432bf2 |
---|---|
1 if(typeof converse == 'undefined') { | 1 if(typeof converse == 'undefined') { |
2 /* | |
3 * This shows the content of <noscript> if there's a problem | |
4 * loading converse.js for some reason | |
5 */ | |
2 var div = document.createElement("div"); | 6 var div = document.createElement("div"); |
3 var noscript = document.getElementsByTagName("noscript")[0]; | 7 var noscript = document.getElementsByTagName("noscript")[0]; |
4 div.innerHTML = noscript.innerText; | 8 div.innerHTML = noscript.innerText; |
5 document.body.appendChild(div); | 9 document.body.appendChild(div); |
6 } else { | 10 } else { |
11 /* | |
12 * converse.js should have loaded, so we initialize it with | |
13 * the settings generated by Prosody. This uses sprintf-style | |
14 * formatting to insert the settigs as a JSON object. | |
15 */ | |
7 converse.initialize(%s); | 16 converse.initialize(%s); |
8 } | 17 } |