From 47071c58aa868ee9756a98c967b64c024d22920b Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 5 Jan 2023 18:21:49 +0100 Subject: fix affinity slider updates - issue #1714 --- Zotlabs/Web/Session.php | 2 +- library/jRange/.gitignore | 2 +- library/jRange/demo/index.html | 87 +++++++++++++++++++--- library/jRange/jquery.range-min.js | 2 +- library/jRange/jquery.range.js | 146 +++++++++++++++++++++++++++---------- view/js/main.js | 11 ++- view/tpl/main_slider.tpl | 59 +++++++-------- 7 files changed, 220 insertions(+), 89 deletions(-) diff --git a/Zotlabs/Web/Session.php b/Zotlabs/Web/Session.php index 14c054d20..1b5537ba0 100644 --- a/Zotlabs/Web/Session.php +++ b/Zotlabs/Web/Session.php @@ -81,7 +81,7 @@ class Session { 'lifetime' => ((isset($arr['lifetime'])) ? $arr['lifetime'] : 0), 'path' => ((isset($arr['path'])) ? $arr['path'] : '/'), 'domain' => (($arr['domain']) ? $arr['domain'] : false), - 'secure' => ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? true : false), + 'secure' => true, //((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? true : false), 'httponly' => ((isset($arr['httponly'])) ? $arr['httponly'] : true), 'samesite' => 'None' ]); diff --git a/library/jRange/.gitignore b/library/jRange/.gitignore index 089ae868a..bdedd7dd3 100644 --- a/library/jRange/.gitignore +++ b/library/jRange/.gitignore @@ -1,2 +1,2 @@ - +.DS_Store *.codekit diff --git a/library/jRange/demo/index.html b/library/jRange/demo/index.html index 19a5f33f0..61966ba22 100644 --- a/library/jRange/demo/index.html +++ b/library/jRange/demo/index.html @@ -38,17 +38,18 @@
$('.single-slider').jRange({
-    from: 0,
-    to: 100,
-    step: 1,
-    scale: [0,25,50,75,100],
+    from: -2.0,
+    to: 2.0,
+    step: 0.5,
+    scale: [-2.0,-1.0,0.0,1.0,2.0],
     format: '%s',
     width: 300,
-    showLabels: true
+    showLabels: true,
+    snap: true
 });
- +
@@ -179,6 +180,15 @@ 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"

+ + + snap + Optional + Boolean + + Default : false +

True to snap slider to step values

+ disable @@ -203,8 +213,62 @@

For single slider value is without comma, however for a range selector value is comma-seperated.

+ + ondragend + Optional + Function + +

ondragend callback. Useful if you want to fire event just once per slider drag.

+ + + + onbarclicked + Optional + Function + +

called when user clicks on the bar

+ + +

Modification

+

Change values on runtime

+

Methods which you can call to dynamically modify current values and range. + + + + + + + + + + + + + + + + + + + +
MethodDescription
setValue +

sets the current value of the slider without changing its range, if you want to update the range as well use updateRange instead.

+ + $('.slider').jRange('setValue', '10,20');
+ $('.slider').jRange('setValue', '10'); +
+
updateRange +

'updateRange' to change (min, max) value and interval after initialized.

+ + $('.slider').jRange('updateRange', '0,100');
+ $('.slider').jRange('updateRange', '0,100', '25,50');
+ $('.slider').jRange('updateRange', '0,100', 25); +
+

passing second parameter also sets its current value

+
+

@@ -235,13 +299,14 @@