Software /
code /
prosody-modules
Annotate
mod_conversejs/templates/template.js @ 5551:8bfcedd93a72
mod_rest: List all error conditions in OpenAPI spec
These are not handled by datamanager but by util.stanza and util.error,
so they are not represented in the JSON schema file.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 17 Jun 2023 16:26:33 +0200 |
parent | 4227:13b065432bf2 |
rev | line source |
---|---|
3598
1921ae4449b8
mod_conversejs: Separate out templates into separate configurable files (breaks 0.9 compat)
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 if(typeof converse == 'undefined') { |
4227
13b065432bf2
mod_conversejs: Comment on what's going on in JS template
Kim Alvefur <zash@zash.se>
parents:
4165
diff
changeset
|
2 /* |
13b065432bf2
mod_conversejs: Comment on what's going on in JS template
Kim Alvefur <zash@zash.se>
parents:
4165
diff
changeset
|
3 * This shows the content of <noscript> if there's a problem |
13b065432bf2
mod_conversejs: Comment on what's going on in JS template
Kim Alvefur <zash@zash.se>
parents:
4165
diff
changeset
|
4 * loading converse.js for some reason |
13b065432bf2
mod_conversejs: Comment on what's going on in JS template
Kim Alvefur <zash@zash.se>
parents:
4165
diff
changeset
|
5 */ |
3598
1921ae4449b8
mod_conversejs: Separate out templates into separate configurable files (breaks 0.9 compat)
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 var div = document.createElement("div"); |
1921ae4449b8
mod_conversejs: Separate out templates into separate configurable files (breaks 0.9 compat)
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 var noscript = document.getElementsByTagName("noscript")[0]; |
1921ae4449b8
mod_conversejs: Separate out templates into separate configurable files (breaks 0.9 compat)
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 div.innerHTML = noscript.innerText; |
1921ae4449b8
mod_conversejs: Separate out templates into separate configurable files (breaks 0.9 compat)
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 document.body.appendChild(div); |
1921ae4449b8
mod_conversejs: Separate out templates into separate configurable files (breaks 0.9 compat)
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 } else { |
4227
13b065432bf2
mod_conversejs: Comment on what's going on in JS template
Kim Alvefur <zash@zash.se>
parents:
4165
diff
changeset
|
11 /* |
13b065432bf2
mod_conversejs: Comment on what's going on in JS template
Kim Alvefur <zash@zash.se>
parents:
4165
diff
changeset
|
12 * converse.js should have loaded, so we initialize it with |
13b065432bf2
mod_conversejs: Comment on what's going on in JS template
Kim Alvefur <zash@zash.se>
parents:
4165
diff
changeset
|
13 * the settings generated by Prosody. This uses sprintf-style |
13b065432bf2
mod_conversejs: Comment on what's going on in JS template
Kim Alvefur <zash@zash.se>
parents:
4165
diff
changeset
|
14 * formatting to insert the settigs as a JSON object. |
13b065432bf2
mod_conversejs: Comment on what's going on in JS template
Kim Alvefur <zash@zash.se>
parents:
4165
diff
changeset
|
15 */ |
3598
1921ae4449b8
mod_conversejs: Separate out templates into separate configurable files (breaks 0.9 compat)
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 converse.initialize(%s); |
1921ae4449b8
mod_conversejs: Separate out templates into separate configurable files (breaks 0.9 compat)
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 } |