Skip to content
Snippets Groups Projects
Commit acf1d420 authored by rswindell's avatar rswindell
Browse files

New library module used to load a set of options (for a particular module)

from ctrl/modsopts.ini and return the key=value pairs as properties of an
object. This allows optional behavior/features in any JS modules (stock
or 3rd party) to be enabled/controlled by editing ctrl/modopts.ini rather than
modifying the JS module/script file itself (for Ree).
parent 7e971bec
No related branches found
No related tags found
No related merge requests found
/* modopts.js */
/* $Id$ */
/* Load Synchronet JS Module Control/Enable options from ctrl/modopts.ini */
/* Parse a single .ini section using the argument (to load) as the section name */
/* and return an object containing the key=value pairs as properties */
function get_mod_options(modname)
{
var ini_file = new File(file_cfgname(system.ctrl_dir, "modopts.ini"));
if(!ini_file.open("r")) {
delete ini_file;
return undefined;
}
var obj = ini_file.iniGetObject(modname);
delete ini_file;
return obj;
}
return get_mod_options(argv[0]);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment