From e70762d61e10861c2c48c1b7d334f2f701ea249f Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Tue, 21 Nov 2023 17:30:08 +0000 Subject: [PATCH] fhemweb.js: optional size parameter for the multiple widget (Forum #135850) git-svn-id: https://svn.fhem.de/fhem/trunk@28196 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/pgm2/fhemweb.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index b5768ac45..1c07eb2dd 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -2047,8 +2047,11 @@ FW_createMultiple(elName, devName, vArr, currVal, set, params, cmd) if(vArr.length < 2 || (vArr[0]!="multiple" && vArr[0]!="multiple-strict") || (params && params.length)) return undefined; + var iSize = 30; + if(vArr[vArr.length-1].charAt(0) == "#") + iSize = vArr.pop().substr(1); - var newEl = $('').get(0); + var newEl = $('').get(0); if(currVal) $(newEl).val(currVal); if(elName) @@ -2418,25 +2421,25 @@ FW_rescueClient(pid, key)
  • noArg - show no input field.
  • time - show a JavaScript driven timepicker.
    Example: attr FS20dev widgetOverride on-till:time
  • -
  • textField[,placeholder,tfsize] - show an input field. tfsize is the size - attribute for the input field, defaults to 30.
    - Example: attr WEB widgetOverride room:textField
  • -
  • textFieldNL[,placeholder,tfsize] - show the input field and hide the +
  • textField[,placeholder,inputSize] - show an input field.
    + inputSize is the size attribute for the input field, defaults to 30.
    + Example: attr WEB widgetOverride room:textField,Name_Of_The_Room,20
  • +
  • textFieldNL[,placeholder,inputSize] - show the input field and hide the label.
  • -
  • textField-long[,sizePct,tfsize] - show an input-field, but upon +
  • textField-long[,sizePct,inputSize] - show an input-field, but upon clicking on the input field open a textArea. sizePct specifies the size of the dialog relative to the screen, in percent. Default is 75
  • -
  • textFieldNL-long[,sizePct,tfsize] - the behaviour is the same +
  • textFieldNL-long[,sizePct,inputSize] - the behaviour is the same as :textField-long, but no label is displayed.
  • slider,<min>,<step>,<max>[,1] - show a JavaScript driven slider. The optional ,1 at the end avoids the rounding of floating-point numbers.
  • -
  • multiple,<val1>,<val2>,..." - present a +
  • multiple,<val1>,<val2>,...[,#inputSize]" - present a multiple-value-selector with an additional textfield. The result is comman separated.
  • -
  • multiple-strict,<val1>,<val2>,... - like :multiple, but - without the textfield.
  • +
  • multiple-strict,<val1>,<val2>,...[,#inputSize] + - like multiple, but without the textfield.
  • selectnumbers,<min>,<step>,<max>,<number of digits after decimal point>,lin|log10" - display a select widget generated with values from min to max with step.