@@ -328,7 +328,7 @@ $(function(){
328328            d . find ( 'label' ) . eq ( 0 ) . text ( define . split ( '.' ) [ 0 ] ) . attr ( 'title' , def . line . trim ( ) ) //.tooltip(def.line.length>24&&tooltip_large); //take 200ms 
329329            var  dis = d . find ( '.onoffswitch' ) 
330330            var  p = d . find ( '.mct-splitter' ) ; 
331-             var  val = d . find ( 'input[type=text] ' ) ; 
331+             var  val = d . find ( '. input-group ' ) ; 
332332            var  sel = d . find ( 'select' ) ; 
333333            if  ( def . value  ==  undefined ) 
334334              val . remove ( ) , p . remove ( ) , sel . remove ( ) ; 
@@ -348,7 +348,7 @@ $(function(){
348348                  def . type = 'numeric' ; 
349349                } 
350350              } 
351-               var  inp = val ; 
351+               var  inp = val . find ( 'input' ) ; 
352352              if  ( [ 'boolean' , 'select' ] . indexOf ( def . type ) >= 0 ) { 
353353                inp = sel ; 
354354                val . remove ( ) ; 
@@ -366,10 +366,9 @@ $(function(){
366366              } else { 
367367                if  ( def . type == 'string' ) 
368368                  dv = dv . slice ( 1 , - 1 ) 
369-                 val . val ( dv ) ; 
369+                 inp . val ( dv ) ; 
370370                sel . remove ( ) ; 
371371              } 
372-               inp . attr ( 'dtype' ,  def . type ) 
373372            } 
374373
375374            if  (  ! (  def . changed  &&  def . changed . disabled  )  &&  ! def . disabled  &&  def . value  !=  undefined ) 
@@ -400,18 +399,26 @@ $(function(){
400399            loadHint ( define ) ; 
401400          if  ( btn . hasClass ( 'fa-github' ) ) 
402401            window . opener ( "https://github.com/MarlinFirmware/Marlin/search?q="  +  define  +  "&type=Issues&utf8=%E2%9C%93" ,  "_blank" ) ; 
402+           if  ( btn . find ( '.fa-times' ) . length )  { 
403+             var  inp  =  $ ( this ) . parent ( ) . siblings ( 'input' ) ; 
404+             var  val  =  opts [ define ] . value ; 
405+             if  ( opts [ define ] . type  ==  'string' ) 
406+               val  =  val . slice ( 1 ,  - 1 ) ; 
407+             inp . val ( val ) ; 
408+             processProp ( define ,  'value' ,  opts [ define ] . value ) 
409+           } 
403410        } ) 
404411        function  processProp ( define ,  name ,  val )  { 
405412          lastChanged  =  define  +  name ; 
406-           saveProp ( '/set/'  +  file . file . name  +  '/'  +  define  +  '/'  +  name  +  '/'  +  val ) 
413+           saveProp ( '/set/'  +  file . file . name  +  '/'  +  define  +  '/'  +  name  +  '/'  +  encodeURI ( btoa ( val ) ) ) 
407414          . then ( function ( )  { 
408415              setProp ( define ,  name ,  val ) ; 
409416          } ) ; 
410417        } 
411418        tab . tab . on ( 'change' ,  '.card-block select,.card-block input[type=text]' ,  function ( )  { 
412419          var  btn  =  $ ( this ) ,  define  =  btn . parents ( '.form-group' ) . attr ( 'define' ) ; 
413420          var  val  =  btn . val ( ) ; 
414-           if  ( btn . attr ( 'dtype' )  ==  'string' ) 
421+           if  ( opts [ define ] . type  ==  'string' ) 
415422              val  =  '"'  +  val  +  '"' ; 
416423          processProp ( define ,  'value' ,  val ) ; 
417424        } ) 
@@ -441,6 +448,7 @@ $(function(){
441448          setTimeout ( function ( ) { location . hash = href + ' ' ; } , 500 ) ; 
442449        } 
443450      } ) ; 
451+       return ; 
444452      var  sideCountdown  =  3 ; 
445453      $ ( window ) . scroll ( $ . debounce (  250 ,  true ,  function ( ) { 
446454        sideCountdown  &&  $ ( '.navbar-side-right' ) . toggleClass ( 'toggled' ,  true ) ; 
@@ -715,7 +723,7 @@ $(function(){
715723      source . addEventListener ( 'set' ,  function ( event )  { 
716724        var  data =  JSON . parse ( event . data ) ; 
717725        if  ( lastChanged !== data . name + data . prop ) { 
718-           var  def = opts [ data . name ] , val = data . value , ui = uiDefs [ data . name ] ; 
726+           var  def = opts [ data . name ] , val = atob ( decodeURI ( data . value ) ) . toString ( ) , ui = uiDefs [ data . name ] ; 
719727          if  ( data . prop == 'disabled' ) { 
720728            val = val == 'true' ; 
721729            ui . find ( '.onoffswitch input' ) . prop ( 'checked' , ! val ) 
@@ -757,7 +765,7 @@ $(function(){
757765    proc . init = function ( ) {  p . text ( '' ) ;  r . modal ( ) ; } 
758766    proc . info = function ( ) { 
759767      _add ( $ ( 'template._alert' ) ) 
760-       . find ( 'p' ) . html ( `to install PlatformIO use guide from   
768+       . find ( 'p' ) . html ( `to install PlatformIO use guide from 
761769<strong><a target="_blank" href="http://docs.platformio.org/en/latest/installation.html">Official site</a></strong> 
762770<br>Linux/Mac hint:  <code>sudo apt install python-pip</code> <code>sudo pip install -U platformio</code>` ) 
763771    } 
0 commit comments