diff mod_jsxc/templates/template.js @ 4825:4bdfd83e091f

mod_jsxc: Demo module serving JSXC relatively easily from Prosody Copy of mod_conversejs adjusted for JSXC. README TODO
author Kim Alvefur <zash@zash.se>
date Wed, 15 Dec 2021 18:28:40 +0100
parents mod_conversejs/templates/template.js@13b065432bf2
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_jsxc/templates/template.js	Wed Dec 15 18:28:40 2021 +0100
@@ -0,0 +1,13 @@
+$(function() {
+	let jsxc = new JSXC({
+		loadConnectionOptions: function(username, password) {
+			return Promise.resolve(%s);
+		}
+	});
+
+	let formElement = $('#jsxc_login_form');
+	let usernameElement = $('#jsxc_username');
+	let passwordElement = $('#jsxc_password');
+
+	jsxc.watchForm(formElement, usernameElement, passwordElement);
+});