# HG changeset patch # User Kim Alvefur # Date 1601567350 -7200 # Node ID 6b2a1c9ef6e2f7f5d6992454e0c344f3da4d395c # Parent a82b0745383b4155f5156a300d52010e7b532873 mod_conversejs: Move templates into a directory for easier install diff -r a82b0745383b -r 6b2a1c9ef6e2 mod_conversejs/mod_conversejs.lua --- a/mod_conversejs/mod_conversejs.lua Thu Oct 01 16:20:09 2020 +0200 +++ b/mod_conversejs/mod_conversejs.lua Thu Oct 01 17:49:10 2020 +0200 @@ -48,7 +48,7 @@ local html_template; do - local template_filename = module:get_option_string(module.name .. "_html_template", "template.html"); + local template_filename = module:get_option_string(module.name .. "_html_template", "templates/template.html"); local template_file, err = module:load_resource(template_filename); if template_file then html_template, err = template_file:read("*a"); @@ -65,7 +65,7 @@ local js_template; do - local template_filename = module:get_option_string(module.name .. "_js_template", "template.js"); + local template_filename = module:get_option_string(module.name .. "_js_template", "templates/template.js"); local template_file, err = module:load_resource(template_filename); if template_file then js_template, err = template_file:read("*a"); diff -r a82b0745383b -r 6b2a1c9ef6e2 mod_conversejs/template.html --- a/mod_conversejs/template.html Thu Oct 01 16:20:09 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ - - - - - -{header_style# -} -{header_scripts# -} -{service_name?Prosody IM and Converse.js} -{header_tags# -{item!}} - - - - - - diff -r a82b0745383b -r 6b2a1c9ef6e2 mod_conversejs/template.js --- a/mod_conversejs/template.js Thu Oct 01 16:20:09 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -if(typeof converse == 'undefined') { - var div = document.createElement("div"); - var noscript = document.getElementsByTagName("noscript")[0]; - div.innerHTML = noscript.innerText; - document.body.appendChild(div); -} else { - converse.initialize(%s); -} diff -r a82b0745383b -r 6b2a1c9ef6e2 mod_conversejs/templates/template.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_conversejs/templates/template.html Thu Oct 01 17:49:10 2020 +0200 @@ -0,0 +1,36 @@ + + + + + +{header_style# +} +{header_scripts# +} +{service_name?Prosody IM and Converse.js} +{header_tags# +{item!}} + + + + + + diff -r a82b0745383b -r 6b2a1c9ef6e2 mod_conversejs/templates/template.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_conversejs/templates/template.js Thu Oct 01 17:49:10 2020 +0200 @@ -0,0 +1,8 @@ +if(typeof converse == 'undefined') { + var div = document.createElement("div"); + var noscript = document.getElementsByTagName("noscript")[0]; + div.innerHTML = noscript.innerText; + document.body.appendChild(div); +} else { + converse.initialize(%s); +}