Index: HTML/Default/slimserver.css =================================================================== --- HTML/Default/slimserver.css (revision 12275) +++ HTML/Default/slimserver.css (working copy) @@ -587,3 +587,34 @@ padding: 0px 5px 1px 5px; } +div.autocomplete { + position: absolute; + width: 250px; + height: 100px; + overflow: auto; + background-color: white; + border: 1px solid #888; + margin: 0px; + padding: 0px; +} + +div.autocomplete ul { + list-style-type: none; + margin: 0px; + padding: 0px; +} + +div.autocomplete ul li.selected { + background-color: navy; + color: white; +} + +div.autocomplete ul li { + list-style-type: none; + display: block; + margin: 0; + padding: 2px; + height: 12px; + cursor: pointer; + white-space: nowrap +} Index: HTML/EN/html/settings.js =================================================================== --- HTML/EN/html/settings.js (revision 12275) +++ HTML/EN/html/settings.js (working copy) @@ -166,3 +166,29 @@ field.setStyle({backgroundColor: '#ffcccc'}); } } + +function addFolderSelector(field) { + addSelector(field, true); +} + +function addFileSelector(field) { + addSelector(field, false); +} + +function addSelector(field, foldersOnly) { + field = $(field); + new Ajax.Autocompleter( + field, + 'autocomplete', + '/settings/server/fileselector.html', + { + paramName: 'currDir', + parameters: (foldersOnly ? 'foldersonly=1' : ''), + updateElement: function(item) { + field.value = item.innerHTML; + field.setStyle({backgroundColor: bgColors[field]}); + field.focus(); + } + } + ); +} Index: HTML/EN/settings/header.html =================================================================== --- HTML/EN/settings/header.html (revision 12275) +++ HTML/EN/settings/header.html (working copy) @@ -10,7 +10,7 @@ [% pageHeaderScripts = BLOCK %] [% pageHeaderScripts %] - + [% END %] @@ -32,6 +32,8 @@