Hi, I''ve just made a reasonably simple modification to the Slider control in script.aculo.us which makes it so that you can drag a span as well as handles (if you drag a span, the span width stays the same, and the span and handles slide up and down together). This also works if a slider ''track'' has multiple spans. For example: ------||=====||~~~~~||------ Where ----- is the track, || are handles and === and ~~~ are spans, in case my diagram makes no sense without an explananation :). If I might be so bold as to suggest such a thing, it seems to me like this might be useful functionality to add to the Slider control. Is there a mechanism in place where people can submit code changes like this for review and possible inclusion? Is this the right place to ask this question? Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Span is possibly the wrong tag to use. If I recall correctly, a span is an inline element and can''t have a width applied to it, unless you make it a block element, and then you might as well use a div. Some browsers incorrectly apply this property... took me a while to figure out why my widths/heights weren''t working. Gareth On 3/19/07, zarusoba <laws.andrew-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, > > I''ve just made a reasonably simple modification to the Slider control > in script.aculo.us which makes it so that you can drag a span as well > as handles (if you drag a span, the span width stays the same, and the > span and handles slide up and down together). > > This also works if a slider ''track'' has multiple spans. For example: > > ------||=====||~~~~~||------ > > Where ----- is the track, || are handles and === and ~~~ are spans, in > case my diagram makes no sense without an explananation :). > > If I might be so bold as to suggest such a thing, it seems to me like > this might be useful functionality to add to the Slider control. > > Is there a mechanism in place where people can submit code changes > like this for review and possible inclusion? Is this the right place > to ask this question? > > Thanks! > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Howdy Gareth, Thanks for the quick response - I can see where the confusion might arise regarding "span", but I''m actually using the script.aulo.us terminology... as far as I know. When I say "span" with respect to the Slider control I''m talking about the spans feature already supported by it - see http://www.aldenta.com/examples/script.aculo.us/slider-two-colored.html for an example. The parameter name used when creating the Slider is ''spans'', for example: ----- <div id="track" style="width:500px;background- color:#888;height:20px;position:relative;z-index:0;"> <div id="lfthandle" style="background- color:#000;position:absolute;cursor:col-resize;width:5px;height:20px;z- index:2;"></div> <div id="colorbar" style="background- color:#F00;position:absolute;z-index:1;"> </div> <div id="rgthandle" style="background- color:#000;position:absolute;cursor:col-resize;width:5px;height:20px;z- index:2;"></div> </div> --->snip<--- var slider = new Control.Slider( [''lfthandle'',''rgthandle''], ''track'', { range: $R(0,20), values: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], sliderValue:[5,15], restricted:true, =====> spans:[''colorbar''], onSlide: function(v) { updateLables(v); }, onChange: function(v) { updateLables(v); } } ); ----- As you can see, this is not the HTML ''span'' tag, but a Javascript parameter. Also, if I understand your reply correctly it sounds as though you might have read my message to mean I''m having a problem with the Slider - I''m not. It works perfectly, I''ve just added some functionality to the slider.js code so that it does what I need it to do. I''m mainly wondering if there is somewhere I can put this updated version so that someone can see if it''s worth incorporating the changes (or implementing it in a better way) into a script.aculo.us release in the future. If not, I don''t really care; I just figured others might find it useful. Thanks! Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Ah yeah, I realise you were suggesting a change, and it sounds good but might not be applicable to everyone. I''m not sure of the submission process for scriptaculous though. Gareth On 3/19/07, zarusoba <laws.andrew-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Howdy Gareth, > > Thanks for the quick response - I can see where the confusion might > arise regarding "span", but I''m actually using the script.aulo.us > terminology... as far as I know. > > When I say "span" with respect to the Slider control I''m talking about > the spans feature already supported by it - see > http://www.aldenta.com/examples/script.aculo.us/slider-two-colored.html > for an example. > > The parameter name used when creating the Slider is ''spans'', for > example: > > ----- > <div id="track" style="width:500px;background- > color:#888;height:20px;position:relative;z-index:0;"> > <div id="lfthandle" style="background- > color:#000;position:absolute;cursor:col-resize;width:5px;height:20px;z- > index:2;"></div> > <div id="colorbar" style="background- > color:#F00;position:absolute;z-index:1;"> </div> > <div id="rgthandle" style="background- > color:#000;position:absolute;cursor:col-resize;width:5px;height:20px;z- > index:2;"></div> > </div> > > --->snip<--- > > var slider = new Control.Slider( > [''lfthandle'',''rgthandle''], > ''track'', > { > range: $R(0,20), > values: > [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], > sliderValue:[5,15], > restricted:true, > =====> spans:[''colorbar''], > onSlide: function(v) { updateLables(v); }, > onChange: function(v) { updateLables(v); } > } > ); > ----- > > As you can see, this is not the HTML ''span'' tag, but a Javascript > parameter. > > Also, if I understand your reply correctly it sounds as though you > might have read my message to mean I''m having a problem with the > Slider - I''m not. It works perfectly, I''ve just added some > functionality to the slider.js code so that it does what I need it to > do. > > I''m mainly wondering if there is somewhere I can put this updated > version so that someone can see if it''s worth incorporating the > changes (or implementing it in a better way) into a script.aculo.us > release in the future. If not, I don''t really care; I just figured > others might find it useful. > > Thanks! > > Andrew > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
OK, no worries... just a thought. Thanks for the quick responses! On Mar 19, 4:49 pm, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ah yeah, I realise you were suggesting a change, and it sounds good but > might not be applicable to everyone. I''m not sure of the submission process > for scriptaculous though. > > Gareth > > On 3/19/07, zarusoba <laws.and...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Howdy Gareth, > > > Thanks for the quick response - I can see where the confusion might > > arise regarding "span", but I''m actually using the script.aulo.us > > terminology... as far as I know. > > > When I say "span" with respect to the Slider control I''m talking about > > the spans feature already supported by it - see > >http://www.aldenta.com/examples/script.aculo.us/slider-two-colored.html > > for an example. > > > The parameter name used when creating the Slider is ''spans'', for > > example: > > > ----- > > <div id="track" style="width:500px;background- > > color:#888;height:20px;position:relative;z-index:0;"> > > <div id="lfthandle" style="background- > > color:#000;position:absolute;cursor:col-resize;width:5px;height:20px;z- > > index:2;"></div> > > <div id="colorbar" style="background- > > color:#F00;position:absolute;z-index:1;"> </div> > > <div id="rgthandle" style="background- > > color:#000;position:absolute;cursor:col-resize;width:5px;height:20px;z- > > index:2;"></div> > > </div> > > > --->snip<--- > > > var slider = new Control.Slider( > > [''lfthandle'',''rgthandle''], > > ''track'', > > { > > range: $R(0,20), > > values: > > [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], > > sliderValue:[5,15], > > restricted:true, > > =====> spans:[''colorbar''], > > onSlide: function(v) { updateLables(v); }, > > onChange: function(v) { updateLables(v); } > > } > > ); > > ----- > > > As you can see, this is not the HTML ''span'' tag, but a Javascript > > parameter. > > > Also, if I understand your reply correctly it sounds as though you > > might have read my message to mean I''m having a problem with the > > Slider - I''m not. It works perfectly, I''ve just added some > > functionality to the slider.js code so that it does what I need it to > > do. > > > I''m mainly wondering if there is somewhere I can put this updated > > version so that someone can see if it''s worth incorporating the > > changes (or implementing it in a better way) into a script.aculo.us > > release in the future. If not, I don''t really care; I just figured > > others might find it useful. > > > Thanks! > > > Andrew--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---