view 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
parents 6b2a1c9ef6e2
children
line wrap: on
line source

if(typeof converse == 'undefined') {
	/*
	 * This shows the content of <noscript> if there's a problem
	 * loading converse.js for some reason
	 */
	var div = document.createElement("div");
	var noscript = document.getElementsByTagName("noscript")[0];
	div.innerHTML = noscript.innerText;
	document.body.appendChild(div);
} else {
	/*
	 * converse.js should have loaded, so we initialize it with
	 * the settings generated by Prosody. This uses sprintf-style
	 * formatting to insert the settigs as a JSON object.
	 */
	converse.initialize(%s);
}