Hey guys, I've modified a function in "Slim/Web/Setup.pm" so that it can sort numerically when filling SELECT boxes, and such. I hope it can be added to slim server to get rid of the messy drop-down boxes in the web interfaces when all of the options are numbers.
The function is attached in the text file. (Sorry...but I didn't have time to install CVS...grab the tree, and get the diff...this change is simple enough anyways)
The description at the top of the module should have this line...
# 'optionSort' => controls sort order of the options, one of K (key), KN (key numerically), KR (key reversed), KNR (key numerically reversed), V (value), VN (value numerically), VR (value reversed), VNR (value numerically reversed) - (default K)
Danny Rego
Results 1 to 5 of 5
Thread: Small patch for sorting...
-
2005-06-02, 20:42 #1Danny RegoGuest
Small patch for sorting...
-
2005-06-03, 08:02 #2Robert MoserGuest
Small patch for sorting...
Danny Rego wrote:
> Hey guys, I've modified a function in "Slim/Web/Setup.pm" so that it can sort numerically when filling SELECT boxes, and such. I hope it can be added to slim server to get rid of the messy drop-down boxes in the web interfaces when all of the options are numbers.
Any particular preferences that this would be used for?
-
2005-06-03, 14:18 #3Danny RegoGuest
Small patch for sorting...
Any numerical ones. When I release the next version of my plugin there are
some drop down boxes for times, and without this patch they show up like
this....
1 second
10 seconds
15 seconds
2 seconds
30 seconds
5 seconds
60 seconds
....it was really bugging me, so I thought this would help.
Danny Rego
----- Original Message -----
From: "Robert Moser" <rlmoser (AT) comcast (DOT) net>
To: "Slim Devices Developers" <developers (AT) lists (DOT) slimdevices.com>
Sent: Friday, June 03, 2005 11:02 AM
Subject: Re: [Developers] Small patch for sorting...
> Danny Rego wrote:
>> Hey guys, I've modified a function in "Slim/Web/Setup.pm" so that it can
>> sort numerically when filling SELECT boxes, and such. I hope it can be
>> added to slim server to get rid of the messy drop-down boxes in the web
>> interfaces when all of the options are numbers.
>
> Any particular preferences that this would be used for?
>
-
2005-06-03, 14:29 #4Danny RegoGuest
Small patch for sorting...
Sorry...haahaa...I guess you meant any current prefs...I will have a look
and let you know if I spot any in Slim Server.
Danny Rego
----- Original Message -----
From: "Danny Rego" <danny (AT) rego (DOT) com>
To: "Slim Devices Developers" <developers (AT) lists (DOT) slimdevices.com>
Sent: Friday, June 03, 2005 5:18 PM
Subject: Re: [Developers] Small patch for sorting...
> Any numerical ones. When I release the next version of my plugin there
> are some drop down boxes for times, and without this patch they show up
> like this....
>
> 1 second
> 10 seconds
> 15 seconds
> 2 seconds
> 30 seconds
> 5 seconds
> 60 seconds
>
> ...it was really bugging me, so I thought this would help.
>
> Danny Rego
>
>
>
> ----- Original Message -----
> From: "Robert Moser" <rlmoser (AT) comcast (DOT) net>
> To: "Slim Devices Developers" <developers (AT) lists (DOT) slimdevices.com>
> Sent: Friday, June 03, 2005 11:02 AM
> Subject: Re: [Developers] Small patch for sorting...
>
>
>> Danny Rego wrote:
>>> Hey guys, I've modified a function in "Slim/Web/Setup.pm" so that it can
>>> sort numerically when filling SELECT boxes, and such. I hope it can be
>>> added to slim server to get rid of the messy drop-down boxes in the web
>>> interfaces when all of the options are numbers.
>>
>> Any particular preferences that this would be used for?
>>
-
2005-06-03, 15:07 #5Robert MoserGuest
Small patch for sorting...
Danny Rego wrote:
> Sorry...haahaa...I guess you meant any current prefs...I will have a
> look and let you know if I spot any in Slim Server.
>
> Danny Rego
Exactly what I meant. I applied it to titleFormat, playingDisplayMode,
the brightnesses (in case a maxBrightness above 9 comes along),
maxBitrate, and lameQuality (although since this ranges from 0-9 it
probably doesn't need it).
I didn't see anywhere else that needed it, but I could be wrong.
>Any numerical ones. When I release the next version of my plugin there
>are some drop down boxes for times, and without this patch they show up
> like this....
>1 second
>10 seconds
>15 seconds
>2 seconds
>30 seconds
>5 seconds
>60 seconds
Just make sure that you don't apply it to the side that has that .
string('SECONDS') in it or you'll just throw warnings.

Reply With Quote
