diff --git a/include/widgets.php b/include/widgets.php index bb9890add..18778ed36 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -421,7 +421,7 @@ function widget_affinity($arr) { if(feature_enabled(local_user(),'affinity')) { $tpl = get_markup_template('main_slider.tpl'); $x = replace_macros($tpl,array( - '$val' => $cmin . ';' . $cmax, + '$val' => $cmin . ',' . $cmax, '$refresh' => t('Refresh'), '$me' => t('Me'), '$intimate' => t('Best Friends'), diff --git a/library/jRange/.gitignore b/library/jRange/.gitignore new file mode 100644 index 000000000..089ae868a --- /dev/null +++ b/library/jRange/.gitignore @@ -0,0 +1,2 @@ + +*.codekit diff --git a/library/jRange/LICENSE b/library/jRange/LICENSE new file mode 100644 index 000000000..8f47b9a63 --- /dev/null +++ b/library/jRange/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Nitin Hayaran + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/library/jRange/README.md b/library/jRange/README.md new file mode 100644 index 000000000..5cbfe6aa8 --- /dev/null +++ b/library/jRange/README.md @@ -0,0 +1,5 @@ +## jQuery plugin to create Range Selector + + + +[Demo and Documentation](http://nitinhayaran.github.io/jRange/demo/) \ No newline at end of file diff --git a/library/jRange/demo/index.html b/library/jRange/demo/index.html new file mode 100644 index 000000000..ac443f11f --- /dev/null +++ b/library/jRange/demo/index.html @@ -0,0 +1,245 @@ + + +
+ +$('.single-slider').jRange({
+ from: 0,
+ to: 100,
+ step: 1,
+ scale: [0,50,100],
+ format: '%s',
+ width: 300,
+ showLabels: true
+});
+ $('.range-slider').jRange({
+ from: 0,
+ to: 100,
+ step: 1,
+ scale: [0,25,50,75,100],
+ format: '%s',
+ width: 300,
+ showLabels: true,
+ isRange : true
+});
+ To get started you'll have to include jquery.range.js
and jquery.range.css
files in your html file.
<link rel="stylesheet" href="jquery.range.css">
+<script src="jquery.range.js"></script>
+ Later just add an hidden input, where ever you want this slider to be shown.
+<input type="hidden" class="slider-input" value="23" />
+ After this you'll have to intialize this plugin for that input, as shown in the example above
+ +Options can also be set programatically, by passing an options hash to the jRange method. +
Option | +Override | +Type | +Details | +
---|---|---|---|
from | +Mandatory | +Integer | +Lower bound of slider | +
to | +Mandatory | +Integer | +Upper bound of slider | +
step | +Optional | +Integer | +
+ Default : 1
+ amount of increment on each step + |
+
scale | +Optional | +Array | +
+ Array containing label which are shown below the slider. By default its [from, to]. + |
+
showLabels | +Optional | +Boolean | +
+ False, if you'd like to hide label which are shown on top of slider. +Default : true
+ |
+
showScale | +Optional | +Boolean | +
+ False, if you'd like to hide scale which are shown below the slider. +Default : true
+ |
+
format | +Optional | +String / Function | +
+ this is used to show label on the pointer +Default : "%s"
+
+ |
+
width | +Optional | +Integer | +
+ Default : 300
+ |
+
theme | +Optional | +String | +
+ Default : "theme-green"
+ This is the css class name added to the container. Available themes are "theme-blue", "theme-green". You can also add more themes, just like in |
+
isRange | +Optional | +Boolean | +
+ Default : false
+ True if this is a range selector. If its a range the value of hidden input will be set comma-seperated, e.g., "25,75" + |
+
onstatechange | +Optional | +Function | +
+ This function is called whenever the value is changed by user. This same value is also automatically set for the provided Hidden Input. +For single slider value is without comma, however for a range selector value is comma-seperated. + |
+