alexanderhiam/PyBBIO — pull request #51 by Ikario (2014-09-06 16:22:07+00:00)
Title: Added range slider to BBIOServer!

So I'm not an expert on Python, HTML or BBB but while using pyBBIO
library I thought that a slider might be neat, so I checked the
BBIO_server source and specially the add_entry function and thought it
could not be that hard. Thus, I add add_range. It works just like
add_entry, but it takes some extra optional values as well that are
pretty much self explanatory:

minvalue is the minimum value of the slider (all the way to the left)
maxvalue is the maximum value of the slider (all the way to the right)
defaultvalue is the default value where the slider starts when you load
the page
stepsize is the size of the steps in the slider, so the amount of steps
you have ends up being (maxvalue-minvalue)/stepsize

It works with integers as well as floats and returns, as add_entry a
string that can be easily manipulated. Tested and working properly on
Firefox, Chrome and Safari, all of those in Mac OS X 10.9.4.

Hope this is helpful for someone other than me :)

Resubmitting it as I probably submitted it wrong the last time.