Second build sold out. Message will appear here when store is ready for third build ordering.

web file modifications (CSS/JS)

I have searched around and didn't find an answer, my apologies if I missed it.

I have played around with live editing the CSS (F12 on Chrome) to make the interface a little more mobile friendly. However when I make those changes to the files in /root/Beagle_SDR_GPS/web/openwebrx the application does not use them (loads them from a cache or a binary?). I even tried making the whole project to no avail.

What am I missing?

Thanks,
Nick W1NJC

Comments

  • jksjks
    edited December 2018
    Those files will be read from the filesystem if you run the Kiwi server in "foreground/development" mode. I.e. "cdp; mst" to stop the usual background server, then "./k" to start it in the foreground ("ku" to restart in the background again).

    When a "make install" is run all the support files, including CSS/JS, are packaged into the Kiwi binary so they are served directly out of main memory for maximum speed. That's the business at the end of the make about running the mkdata.pl script and creating the files edata_{embed,always}.cpp Also, you can use the "md" (make debug) command and look for the output definitions for FILES_EMBED and FILES_ALWAYS. The files listed under FILES_ALWAYS are packaged up even in development mode because they are very unlikely to change (e.g. fonts etc.) You have to look through the sub-Makefiles of the project to find all the contributors to FILES_{EMBED,ALWAYS}. And for the internal extensions these definitions are auto-generated.

    There is experimental code to apply the usual js/css minify/merge/gzip to the files. But this work is unfinished.

    The built-in web server attempts to generate and respond to the HTTP caching protocol so the browser will correctly cache the files. But this doesn't seem to work in all cases (e.g. it had to be disabled for mobile devices for reasons I still don't understand). Like so many things this desperately needs to be fixed..
  • @jks Thank you. ./k works.
  • This CSS seems to help most mobile browsers and makes the UI usable.


    @media only screen
    and (max-device-width: 600px)
    {
    #id-readme {
    display: none;
    }

    #id-control {
    transform: scale(.8);
    transform-origin: bottom right;
    right:0 !important
    }

    div#id-top-bar * {
    font-size: 0.9em;
    }

    #id-band-container {

    display: none;
    }
    }


    In order to implement this you have to manually edit your ~/Beagle_SDR_GPS/web/openwebrx/openwebrx.css file, and then per the instructions above:

    cdp;mst #stops running service

    then either:
    ./k #runs application in foreground mode

    OR
    make install #recompiles
    ./ku #runs application in background mode
    Powernumpty
  • jksjks
    edited May 2019
    Awesome!

    Wrap that stuff in a <style> ... </style> and chuck it in the box at the bottom of the webpage tab of the admin page that says "Additional HTML/Javascript for HTML element (e.g. Google analytics)". Then you don't have to edit any files and the changes will persist across software updates. And it's easier to experiment with. No need to restart the Kiwi or anything. Just edit the stuff in the box and reload the user connection to see the result. Edits in the box are saved to the Kiwi configuration as you type each time you press the return key (arguably a bug).

    i.e.
    
    @media only screen 
    and (max-device-width: 600px)
    {
    #id-readme {
    display: none;
    }
    
    #id-control {
    transform: scale(.8);
    transform-origin: bottom right;
    right:0 !important
    }
    
    div#id-top-bar * {
    font-size: 0.9em;
    }
    
    #id-band-container {
    
    display: none;
    }
    }
    
    Powernumptynjc
  • Awesome, John! I didn't realize that was available.
  • Note that in v1.290 a lot of this functionality is now directly in the Kiwi Javascript code. So there may be conflicts if you have made these sorts of changes. See the v1.290 release notes for details.
  • Thanks for the heads up. I'll check it out.
Sign In or Register to comment.