mirror of
https://github.com/s00500/ESPUI.git
synced 2026-02-05 17:02:41 +00:00
6 lines
4.5 KiB
C
6 lines
4.5 KiB
C
const char JS_SLIDER[] PROGMEM = R"=====(
|
|
function rkmd_rangeSlider(e){var n,s,o,t=$(e),a=t.width(),r=t.offset().left,i=t;i.each(function(){n=$(this),n.append(sliderDiscrete_tmplt()),o=n.find('input[type="range"]'),s=n.find(".slider"),slider_fill=s.find(".slider-fill"),slider_handle=s.find(".slider-handle"),slider_label=s.find(".slider-label");var i=parseInt(o.val());slider_fill.css("width",i+"%"),slider_handle.css("left",i+"%"),slider_label.find("span").text(i)}),t.on("mousedown touchstart",".slider-handle",function(e){if(e.button===2)return!1;var n,s,o,t=$(this).parents(".rkmd-slider"),i=t.width(),a=t.offset().left,r=t.find('input[type="range"]').is(":disabled");if(r===!0)return!1;$(this).addClass("is-active"),n=function(e){var s=e.pageX||e.changedTouches[0].pageX,n=s-a;n<=i&&!(n<"0")&&slider_move(t,n,i,!0)},s=function(){$(this).off(o),t.find(".is-active").removeClass("is-active")},o={mousemove:n,touchmove:n,mouseup:s,touchend:s},$(document).on(o)}),t.on("mousedown touchstart",".slider",function(e){if(e.button===2)return!1;var n,s,o,t=$(this).parents(".rkmd-slider"),i=t.width(),a=t.offset().left,r=t.find('input[type="range"]').is(":disabled");if(r===!0)return!1;n=e.pageX-a,n<=i&&!(n<"0")&&slider_move(t,n,i,!0),s=function(){$(this).off(o)},o={mouseup:s,touchend:s},$(document).on(o)})}function sliderDiscrete_tmplt(){var e='<div class="slider"><div class="slider-fill"></div><div class="slider-handle"><div class="slider-label"><span>0</span></div></div></div>';return e}function slider_move(e,t,n,s){var a,o=parseInt(Math.round(t/n*100)),r=e.find(".slider-fill"),c=e.find(".slider-handle"),i=e.find('input[type="range"]');i.next().html(t),r.css("width",o+"%"),c.css({left:o+"%",transition:"none","-webkit-transition":"none","-moz-transition":"none"}),i.val(o),e.find(".slider-handle span").text()!=o&&(e.find(".slider-handle span").text(o),a=e.attr("id").substring(2),s&&websock.send("slvalue:"+o+":"+a))}
|
|
)=====";
|
|
|
|
const uint8_t JS_SLIDER_GZIP[730] PROGMEM = { 31,139,8,0,0,0,0,0,0,255,212,84,193,110,227,54,16,253,21,155,72,21,78,67,51,222,61,74,102,46,237,165,135,158,218,67,129,197,34,160,197,81,68,68,30,10,228,200,105,235,245,191,23,148,236,216,137,141,32,215,94,108,97,222,96,248,248,222,240,53,3,213,236,3,205,226,243,198,61,70,75,79,248,71,231,29,70,137,176,219,218,56,35,149,84,80,108,110,36,130,178,134,245,139,119,220,74,80,209,176,14,77,147,144,37,232,14,27,86,222,112,229,53,218,186,149,199,177,18,118,100,110,36,183,62,129,34,109,251,30,201,201,52,158,240,171,79,117,68,198,71,222,244,29,75,0,21,12,233,198,147,147,183,158,250,129,191,241,63,61,26,49,146,18,223,111,65,165,35,46,244,52,66,128,154,62,30,27,223,117,38,189,69,23,185,120,106,105,45,185,14,47,154,166,242,169,173,179,107,188,28,53,86,5,84,89,18,111,122,27,19,254,70,44,131,222,218,78,2,84,103,52,116,157,146,20,163,76,66,249,59,241,211,123,10,83,67,150,236,61,62,158,114,56,57,245,150,4,104,198,191,89,122,216,131,98,29,72,138,77,24,18,186,240,66,51,14,67,221,38,182,145,133,122,127,27,245,106,0,194,206,55,18,245,122,96,14,100,140,249,10,17,121,136,52,255,82,189,245,119,52,73,247,54,34,113,146,66,231,141,88,188,234,236,207,172,183,23,214,231,101,248,192,57,237,147,20,165,243,201,174,59,116,2,42,223,200,104,140,153,47,79,100,142,4,172,115,191,116,54,43,228,211,194,214,236,183,217,28,50,231,55,202,196,147,65,221,219,39,252,235,199,15,212,117,155,143,114,127,102,73,48,125,91,126,159,32,69,38,45,108,69,43,227,139,98,46,105,37,150,2,138,226,160,246,38,108,81,178,34,229,213,124,9,123,149,204,217,218,30,233,132,166,145,33,139,127,216,135,51,82,58,98,30,113,201,118,175,130,217,141,70,101,188,36,53,90,117,248,30,235,67,95,166,169,138,228,202,180,87,55,210,133,122,216,32,49,100,155,195,103,13,255,63,58,77,71,231,22,86,125,202,154,143,156,57,105,253,25,77,247,175,121,119,61,131,198,205,66,115,187,114,126,59,171,179,177,70,28,132,121,184,172,77,1,243,176,186,119,126,123,13,62,60,198,107,208,148,39,15,171,252,202,31,150,171,251,241,255,48,232,236,247,182,154,84,155,225,123,230,147,68,168,178,72,105,226,109,85,56,37,211,239,150,91,29,195,64,78,242,61,253,252,101,185,132,156,217,120,61,34,235,11,224,53,22,253,17,186,110,120,229,53,229,136,2,221,242,166,147,12,42,190,9,192,48,5,92,61,22,119,121,133,202,177,164,56,90,74,62,223,168,20,20,8,133,18,139,23,92,63,123,94,156,32,113,194,54,225,223,43,192,30,148,31,51,56,128,186,126,133,217,121,144,194,220,132,162,144,159,232,12,121,249,81,91,230,40,133,119,2,116,26,214,137,163,167,39,249,21,84,42,138,23,92,167,80,63,235,132,99,92,119,91,219,13,88,138,187,112,39,74,113,103,1,246,255,5,0,0,255,255,129,21,153,100,93,7,0,0 };
|