Mercurial > prosody-modules
comparison mod_conversejs/mod_conversejs.lua @ 4165:6b2a1c9ef6e2
mod_conversejs: Move templates into a directory for easier install
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 01 Oct 2020 17:49:10 +0200 |
| parents | 4ee2a90d3818 |
| children | 0016618e0975 |
comparison
equal
deleted
inserted
replaced
| 4164:a82b0745383b | 4165:6b2a1c9ef6e2 |
|---|---|
| 46 local css_url = module:get_option_string("conversejs_css", cdn_url..version.."/dist/converse.min.css"); | 46 local css_url = module:get_option_string("conversejs_css", cdn_url..version.."/dist/converse.min.css"); |
| 47 | 47 |
| 48 local html_template; | 48 local html_template; |
| 49 | 49 |
| 50 do | 50 do |
| 51 local template_filename = module:get_option_string(module.name .. "_html_template", "template.html"); | 51 local template_filename = module:get_option_string(module.name .. "_html_template", "templates/template.html"); |
| 52 local template_file, err = module:load_resource(template_filename); | 52 local template_file, err = module:load_resource(template_filename); |
| 53 if template_file then | 53 if template_file then |
| 54 html_template, err = template_file:read("*a"); | 54 html_template, err = template_file:read("*a"); |
| 55 template_file:close(); | 55 template_file:close(); |
| 56 end | 56 end |
| 63 end | 63 end |
| 64 end | 64 end |
| 65 | 65 |
| 66 local js_template; | 66 local js_template; |
| 67 do | 67 do |
| 68 local template_filename = module:get_option_string(module.name .. "_js_template", "template.js"); | 68 local template_filename = module:get_option_string(module.name .. "_js_template", "templates/template.js"); |
| 69 local template_file, err = module:load_resource(template_filename); | 69 local template_file, err = module:load_resource(template_filename); |
| 70 if template_file then | 70 if template_file then |
| 71 js_template, err = template_file:read("*a"); | 71 js_template, err = template_file:read("*a"); |
| 72 template_file:close(); | 72 template_file:close(); |
| 73 end | 73 end |
