# HG changeset patch # User Matthew Wild # Date 1538045679 -3600 # Node ID d98341bca458b44a30e9f43899f4a944006807c4 # Parent 426447d8f82ece0343ec8737b27cb13e67e4927f mod_conversejs: Allow overriding CDN URL, or script/css URLs independently diff -r 426447d8f82e -r d98341bca458 mod_conversejs/mod_conversejs.lua --- a/mod_conversejs/mod_conversejs.lua Mon Sep 24 14:41:37 2018 +0000 +++ b/mod_conversejs/mod_conversejs.lua Thu Sep 27 11:54:39 2018 +0100 @@ -10,13 +10,19 @@ module:depends("websocket"); end); -local html_template = [[ +local cdn_url = module:get_option_string("conversejs_cdn", "https://cdn.conversejs.org"); + +local version = module:get_option_string("conversejs_version", "4.0.1"); +local js_url = module:get_option_string("conversejs_script", cdn_url.."/"..version.."/dist/converse.min.js"); +local css_url = module:get_option_string("conversejs_css", cdn_url.."/"..version.."/css/converse.min.css"); + +local html_template = ([[ - - + + Prosody IM and Converse.js @@ -42,7 +48,7 @@ -]] +]]):gsub("$([%w_]+)", { js_url = js_url, css_url = css_url }); js_template = "converse.initialize(%s);";