Added support for config options with multiple values (mp3_dir,compdirs) to config.html
This commit is contained in:
parent
b8027504de
commit
99a1e55497
|
@ -47,12 +47,25 @@ var Config = {
|
|||
$('theform').appendChild(body);
|
||||
});
|
||||
},
|
||||
_getConfigOptionValue: function(id) {
|
||||
var value = Config.configOptionValues.getElementsByTagName(id);
|
||||
if (value.length > 0) {
|
||||
return Element.textContent(value[0]);
|
||||
_getConfigOptionValue: function(id,multiple) {
|
||||
if (multiple) {
|
||||
var ret = [];
|
||||
var option = Config.configOptionValues.getElementsByTagName(id);
|
||||
if (option.length > 0) {
|
||||
$A(option[0].getElementsByTagName('item')).each(function (item) {
|
||||
ret.push(Element.textContent(item));
|
||||
});
|
||||
} else {
|
||||
ret.push('');
|
||||
}
|
||||
return ret;
|
||||
} else {
|
||||
return '';
|
||||
var value = Config.configOptionValues.getElementsByTagName(id);
|
||||
if (value.length > 0) {
|
||||
return Element.textContent(value[0]);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
_buildItem: function(item) {
|
||||
|
@ -73,7 +86,28 @@ var Config = {
|
|||
Config._getConfigOptionValue(itemId),80,
|
||||
Element.textContent(item.getElementsByTagName('short_description')[0]),
|
||||
'');
|
||||
break;
|
||||
break;
|
||||
case 'short_text_multiple':
|
||||
ret = document.createDocumentFragment();
|
||||
Config._getConfigOptionValue(itemId,true).each(function (value,i) {
|
||||
ret.appendChild(BuildElement.input(itemId+i,
|
||||
Element.textContent(item.getElementsByTagName('name')[0]),
|
||||
value,20,
|
||||
Element.textContent(item.getElementsByTagName('short_description')[0])
|
||||
));
|
||||
});
|
||||
break;
|
||||
case 'long_text_multiple':
|
||||
//###TODO Do something smart instead of just copying
|
||||
ret = document.createDocumentFragment();
|
||||
Config._getConfigOptionValue(itemId,true).each(function (value,i) {
|
||||
ret.appendChild(BuildElement.input(itemId+i,
|
||||
Element.textContent(item.getElementsByTagName('name')[0]),
|
||||
value,80,
|
||||
Element.textContent(item.getElementsByTagName('short_description')[0])
|
||||
));
|
||||
});
|
||||
break;
|
||||
case 'select':
|
||||
ret = BuildElement.select(itemId,
|
||||
Element.textContent(item.getElementsByTagName('name')[0]),
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
The name iTunes and other daap clients should see
|
||||
</short_description>
|
||||
<long_description>
|
||||
This is both the name of the server as advertised via
|
||||
rendezvous, and the name of the database exported via
|
||||
DAAP. Also know as "What shows up in iTunes".
|
||||
This is both the name of the server as advertised via rendezvous, and the
|
||||
name of the database exported via DAAP. Also know as "What shows up in
|
||||
iTunes".
|
||||
</long_description>
|
||||
<type>short_text</type>
|
||||
</item>
|
||||
|
@ -83,7 +83,7 @@
|
|||
<item id="mp3_dir">
|
||||
<name>MP3 Directory</name>
|
||||
<short_description></short_description>
|
||||
<type>long_text</type>
|
||||
<type>long_text_multiple</type>
|
||||
</item>
|
||||
<item id="extensions">
|
||||
<name>Extensions</name>
|
||||
|
@ -108,7 +108,7 @@
|
|||
<item id="compdirs">
|
||||
<name>Compilation Directories</name>
|
||||
<short_description></short_description>
|
||||
<type>long_text</type>
|
||||
<type>long_text_multiple</type>
|
||||
</item>
|
||||
<item id="art_filename">
|
||||
<name>Art Filename</name>
|
||||
|
@ -157,6 +157,19 @@
|
|||
</item>
|
||||
</section>
|
||||
|
||||
<section name="Plugins">
|
||||
<item id="plugin_dir">
|
||||
<name>Plugin Directory</name>
|
||||
<short_description></short_description>
|
||||
<type>long_text</type>
|
||||
</item>
|
||||
<item id="plugins">
|
||||
<name>Plugins</name>
|
||||
<short_description></short_description>
|
||||
<type>short_text_multiple</type>
|
||||
</item>
|
||||
</section>
|
||||
|
||||
<section name="Transcoding">
|
||||
<item id="ssc_prog">
|
||||
<name>SSC Program</name>
|
||||
|
|
Loading…
Reference in New Issue